Cue, draw, and morph animations — plus the parameter slider for interactive exploration
Animations are placed inside a diagram{} body. They work on a timeline measured in milliseconds. Set autoplay: true on the parent scene to play automatically; otherwise students step through cue points manually.
cueFades content in at time in and out at time out. Any diagram primitive or text block can be wrapped in a cue. Wrapping multiple elements in one cue reveals them simultaneously.
in (optional-duration-or-integer; default: —). Time (ms) when content fades inout (optional-duration-or-integer; default: —). Time (ms) when content fades outin-duration (duration; default: 500). Length of the fade-in animationout-duration (duration; default: 500). Length of the fade-out animationeasing (linear / smooth; default: smooth). Animation timing curvecue.drawProgressively draws a diagram element onto the canvas, as if being sketched in real time. Ideal for showing curves, lines, and shapes being constructed step by step.
in (optional-duration-or-integer; default: —). Time (ms) when drawing startsout (optional-duration-or-integer; default: —). Time (ms) when element is erasedin-duration (duration; default: 750). How long the drawing animation takesout-duration (duration; default: 750). How long the erase animation takeseasing (linear / smooth; default: smooth). Animation timing curvecue.morphSmoothly transforms a shape from its initial {} state to its final [] state. Use to show continuity, transformations, or animated transitions between configurations.
at (duration-or-integer; default: 0). Time (ms) when the morph beginsduration (duration; default: 750). Length of the morph animationeasing (linear / smooth; default: smooth). Animation timing curvecue.morph works best when morphing between elements of the same type (e.g. circle → circle, curve → curve). Morphing between different element types may produce unexpected results.
You can layer cue, cue.draw, and cue.morph blocks inside the same diagram to build up complex step-by-step explanations.