-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Adjust d3 update to enable text mode animation #1011
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
Conversation
785d46b
to
4f3f0a6
Compare
.each(function(d) { | ||
|
||
// This just *has* to be totally custom becuase of SVG text positioning :( | ||
// It's obviously copied from translatePoint; we just can't use that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Edit: technically I think maybe translatePoint would work. I'm not 100% certain how much work it is to recompute the positions a bunch, but it seems silly to do that for every tspan.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ha. That's not too bad. Thanks for the comment!
.each(function(d) { | ||
|
||
// This just *has* to be totally custom becuase of SVG text positioning :( | ||
// It's obviously copied from translatePoint; we just can't use that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ha. That's not too bad. Thanks for the comment!
💃 nicely done. |
Turned out to be reasonably straightforward after messing around with it for three hours… |
cc @etpinard @cpsievert
This PR refactors text mode scatter just slightly to properly duck-type the node being translated as a transition. The text node itself remains an instantaneous update.