-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
Expose animation default interpolators to use in custom implementation #11129
Closed
Closed
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
80736c3
Expose animation interpolators to use in custom ones
stockiNail fb64719
Update src/types/animation.d.ts
stockiNail a2e82a6
apply review
stockiNail 16d52a0
remove useless comma
stockiNail 1fba89b
remove useless empty line
stockiNail e3a0b0e
add new empty line
stockiNail 3beac4b
Merge remote-tracking branch 'chartjs/master' into exposeInterpolators
stockiNail File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
this is a really bad test, animating numbers a, and b and resulting to an object value.
I would argue it would be better to fix the options resolution for
font
in the use case and just animate the size as a number.. and not support animation objects, because its going to open deep can of worms.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.
That said, I'm not against this PR itself. I'd even maybe make the interpolators writable, if that can be supported.
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.
@kurkle when you wrote ‘writable’ do you mean custom interpolator for custom type?
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.
@kurkle this is just a test for the OOTB interpolators. I can add a specific test for objects but I didn't want to add another test case because fn was used here.
@kurkle I could agree with you but, afai understood,
fn
option was born for this reason, to give to the user the possibility to animate items not manageable OOTB (like objects). If there is this option for other purposes, it's not clear to me.About font, this is not really my use case. The use case is coming from annotation plugin where, having color option aa an array, the animation doesn't recognize the array, therefore I was thinking to have a specific animation for color where, when configured as an array, the custom interpolator will return an array of intepolated colors.
The best solution could be to enable animation on inner nodes of the options (like font, padding, borders and other), where the property is defined by dot separator. Something like:
But I think this deserve a specific PR, this one is just to expose the OOTB interpolator.
Let me know how to proceed.