d3 / d3-zoom

Pan and zoom SVG, HTML or Canvas using mouse or touch input.
https://d3js.org/d3-zoom
ISC License
505 stars 143 forks source link

Resetting d3.event.transform? #151

Closed grahamdjuric closed 5 years ago

grahamdjuric commented 6 years ago

I am trying to have the values for pan reset to zero.

This doesn't work: d3.event.transform.x = 0; d3.event.transform.y = 0;

ClonedOne commented 5 years ago

Having the same issue: d3.event.transform keeps maintaining the state even after I change the content of the svg. How can one reset d3.event.transform to [0,0,1]?

mbostock commented 5 years ago

Use zoom.transform.

If you have further questions, please use Stack Overflow to ask for help.