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

transition.easeVarying? #107

Closed
mbostock opened this issue Jun 5, 2020 · 0 comments · Fixed by #110
Closed

transition.easeVarying? #107

mbostock opened this issue Jun 5, 2020 · 0 comments · Fixed by #110

Comments

@mbostock
Copy link
Member

mbostock commented Jun 5, 2020

Re-reading d3/d3-ease#13 four years later, I feel this problem was made much more difficult by the desire to overload transition.ease to support both a single easing function shared by all selected nodes and multiple easing functions varying across nodes.

While it would be more verbose (and arguably inconsistent), an easy way around this problem is a separate transition method for the rare case where varying easing functions are desired. For example:

transition.easeVarying(d => d3.easePolyIn.exponent(d.exponent))

Unlike transition.ease, transition.easeVarying would always take a function, and it would always invoke that function for each selected node. If you pass in something that’s not a function (not a function that returns a function, in this case), it would error (though perhaps not immediately).

Fil added a commit that referenced this issue Jul 9, 2020
@Fil Fil closed this as completed in #110 Jul 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant