-
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
Animation numsteps wrong value #8613
Comments
Good question as to what the most correct behaviour is here. For example, what happens if the tooltip is configured such that the duration of the position change is 400ms, but the background color changes in 800ms. That's essentially the case that I am seeing happen while debugging this sample. I see 15 different animations, 7 of which are active. Durations range from 2000ms to 200ms.
|
As an end user with the current implementation of the sample I would say the opacity since when thats 1 you see it, but if you implement it otherwise when you still see the backgroundcolor changing it would be weird to see that the progress bar is already done. So I think the behaviour should then be to take the animation which takes the longest and show that progressbar (guess that is how it works now) even though it feels really weird to see the tooltip already dissapeared while the appear animation is still in progress |
I don't think it correctly gets the longest even; it just uses the top level which in this case happens to be the longest. One thought I had was to change the callback to call for each animation that is firing so the callback would be called 7x per step here since there are 7 active animations. Without additional meta-data though, it would be very hard to know what property is for which item. For example, which |
If every callback would get metadata about it, it would also solve #8612 since you can filter the right animation out from it |
It finds the longest duration every time animations are started, and use that in the progress event: Chart.js/src/core/core.animator.js Line 165 in e513a90
It might be and performance killer to call the |
I think there is actually some other issue here, the duration might be wrong on those 2000ms animations when hovered. |
Expected Behavior
The numsteps should be the duration of that animation and not the global one
Current Behavior
the short tooltip animation works but the
onProgress
callback in the animation block for the options reports back the main long duration.V2 (correct behaviour): https://www.chartjs.org/samples/latest/advanced/progress-bar.html
V3 (wrong behaviour): https://www.chartjs.org/samples/master/advanced/progress-bar.html
Context
Found this through another issue
Environment
The text was updated successfully, but these errors were encountered: