postgkyl.plotly_animate¶
- postgkyl.plotly_animate(data, *, frame_labels=None, frame_duration=50, transition_duration=0, from_start=False, no_redraw=False, save=False, saveas=None, show=False)¶
Build a Plotly animation figure from a sequence of datasets.
Renders the first dataset with
plotly()to create the base figure, then renders every subsequent dataset as an animation frame, wiring up Play/Pause buttons and a frame slider. All datasets must produce the same number of traces.Like
plotly(),save/saveas/showare self-sufficient here with zero CLI glue:show=Trueopens the animation (a plain HTML preview – the frame slider is its own scrubber, so unlikeplotly()this never rotates the camera on save) in the browser; both default to inert, so a bare call just builds and returns the figure (seeplotly()’s docstring for why). The per-frameplotly()calls below always render withsave=False, show=False: only this function’s own save/preview, on the assembled animation, should ever hit disk or a browser tab.- Parameters:
data – Selected datasets, one per animation frame.
frame_labels – Optional label for each frame and slider step.
frame_duration – Duration of each animation frame in milliseconds.
transition_duration – Duration of transitions between frames.
from_start – Start playback from the first rather than current slider frame.
no_redraw – Do not redraw traces between frames.
save – Save the animation as
plotly_animate.html.saveas – Explicit HTML output path.
show – Open the animation in a browser.
- Returns:
the assembled animation.
- Return type:
plotly.graph_objects.Figure