-
Notifications
You must be signed in to change notification settings - Fork 65
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
feat: add a simple paused and progress with event to control transition animation. #102
base: main
Are you sure you want to change the base?
Conversation
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 really great!
A few remarks:
-
Have you studied if there is any performance hit when animating hundreds of elements, sending progress events all the time (even when nothing listens to them?).
-
I was surprised in the following scenario (https://observablehq.com/d/97dc4e77951d416d), that calling transition.paused(false) did not seem to resume the transition at the progress where it was paused (about 1/4), but rather go directly to the end (note: I've built the feature on branch two)
-
Listening to on("progress") we don't have an easy access to elapsed or to progress; I'm not sure it's possible to do better, though.
Co-authored-by: Philippe Rivière <[email protected]>
Co-authored-by: Philippe Rivière <[email protected]>
Co-authored-by: Philippe Rivière <[email protected]>
Co-authored-by: Philippe Rivière <[email protected]>
Co-authored-by: Philippe Rivière <[email protected]>
Co-authored-by: Philippe Rivière <[email protected]>
|
Thanks for pointing out that progress is the 4th argument, I had missed it. And I've now fixed the transition.interrupt error in the test notebook. I still don't understand why progress jumps from 0.25 to 1 when we resume the transition at 5000ms. It seems that it restarts at 0.5 if I resume at 3000ms, so it may be because the actual time elapsed during the pause has been counted somehow? Also, I get an error when I click "replay" in the middle of the transition, I'm not sure why. |
|
finally I got it. You can try now. |
perfect! https://observablehq.com/d/97dc4e77951d416d is working as expected (see https://observablehq.com/d/97dc4e77951d416d@59 for the previous version). So the only question that remains for me is the possible performance hit. In the default case, when no listeners are set on "progress", can we make sure we're not spending more CPU cycles? |
No description provided.