Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zoom resetting invoking panning not at current zoom level #53

Closed
syarul opened this issue Aug 22, 2016 · 3 comments
Closed

zoom resetting invoking panning not at current zoom level #53

syarul opened this issue Aug 22, 2016 · 3 comments

Comments

@syarul
Copy link

syarul commented Aug 22, 2016

zoomIdentity does not reset pan, only zoom values. Panning will use previous zoom level.

chart.transition()
    .duration(750)
    .call(zoom.transform, d3.zoomIdentity);
@mbostock
Copy link
Member

Works for me?

http://bl.ocks.org/mbostock/db6b4335bf1662b413e7968910104f0f/541b7d087ff21635423a4e7f92c5542e0cca8295

If you want to report an issue, please link to a live example on bl.ocks.org that reproduces the issue. A code snippet out of context is rarely sufficient to demonstrate a bug. Thank you!

@syarul
Copy link
Author

syarul commented Aug 23, 2016

Alright thanks, will look into it.

@marcusklaas
Copy link

You've probably long solved this yourself, but for any one running into this later (like me), you may be calling the transform on the wrong element. Specifically, I had to call

svg.transition()
    .duration(750)
    .call(zoom.transform, d3.zoomIdentity);

where svg would be the parent of chart.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants