Joined July 2016
·
dl00065
Posted to
Simplest way to add zoom/pan on d3.js (version 3 and 4)
over 1 year
ago
This is awesome! Works like a charm. Is there any chance you can elaborate a bit more on how to do reset the d3.behavior.zoom for a reset button? Thanks!
Found the answer, thanks:
zoom.scale(1);
zoom.translate([0, 0]);
svg.transition().duration(500).attr('transform', 'translate(' + zoom.translate() + ') scale(' + zoom.scale() + ')')