Animation slider in Pluto.jl

I wonder if this functionality already exists, that is why I am asking before trying to reinvent the bicycle.

Is there an existing component to create a visual UI, which can run animation?

What I have in mind, is some setup similar to the usual Slider, so one can write

@bind param html"<input type='animation_slider'>"

and instead of the usual slider one get something like
flameshot-2020-11-22T14-54-36

By pressing play button, this slider should just auto-update the value of param and as a result, the user gets some nice live animation of his plots. It can be useful for example in simulation modeling, where one wants to see how the model evolves over time and it’s more convenient than generating gif for each set of parameters.

It’s not exactly with the UI you suggested, but you can use PlutoUI.Clock() for this; for example

image

which is from my work-in-progress notebook https://github.com/ericphanson/UnbalancedOptimalTransport.jl/blob/305544b877b0fba57bc24329b814c6d216de47e1/scripts/visualize_pluto.jl

You just use t as your timer, which just counts up when you press play, and resets to 1 if you stop and start it. You can use mod1(t,N) to loop after N steps, etc.

3 Likes

Thank you! After some consideration I understood that this Clock is better for my purposes than my initial idea. It worth an issue of adding it to the documentation though, since currently it is amiss.

2 Likes