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 transform interrupts null transitions #110

Closed
magjac opened this issue Jul 29, 2017 · 2 comments
Closed

Zoom transform interrupts null transitions #110

magjac opened this issue Jul 29, 2017 · 2 comments

Comments

@magjac
Copy link

magjac commented Jul 29, 2017

Not 100% sure this is a bug or possibly intentional.

A zoom behavior attached to a selection that has an active transition without a name (i.e. null is used) interrupts the transition when translated by e.g. translateBy. If the transition is named, it is not interrupted.

I think this happens on https://github.com/d3/d3-zoom/blobymaster/src/zoom.js#L81. Should it just interrupt transitions named "zoom"?

@mbostock
Copy link
Member

This is the intended behavior. The only case where the zoom behavior initiates a transition on its own is in response to a dblclick event, and this transition has the null name. If you pass a selection to zoom.transform (or a wrapper method such as zoom.translateBy) it will likewise only interrupt transitions with the null name.

We could change the zoom behavior to use the name “zoom” in these two situations, but that would mean any programmatic zoom transitions would not be automatically interrupted by interaction. So, the null name was chosen to keep things simple.

@magjac
Copy link
Author

magjac commented Jul 30, 2017

Thanks for the clarification. I will apply the zoom behavior to a selection that will not have any transitions or use a named transition.

magjac pushed a commit to magjac/d3-graphviz that referenced this issue Nov 14, 2017
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

2 participants