Animator
Defined in: core/animator.ts:48
Lightweight requestAnimationFrame driver used by every chart for
entry transitions. Owns a single live frame at a time, exposes the
current progress (0 → 1) and running flag, and applies the chart’s
configured easing curve before invoking the per-frame callback.
Charts call animator.start(onFrame, onDone?) from their internal
_animate(); stop() cancels mid-flight (used during destroy() and
before re-starting).
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Animator(
duration?,easing?):Animator
Defined in: core/animator.ts:63
Parameters
Section titled “Parameters”duration?
Section titled “duration?”number = 600
Animation length in ms (default 600).
easing?
Section titled “easing?”EasingName = 'easeOutCubic'
Easing curve name; falls back to easeOutCubic if unknown.
Returns
Section titled “Returns”Animator
Properties
Section titled “Properties”duration
Section titled “duration”duration:
number
Defined in: core/animator.ts:50
Animation duration in milliseconds. Mutate to adjust on the fly.
easing
Section titled “easing”easing:
EasingName
Defined in: core/animator.ts:52
Active easing curve name. Mutate to switch curves.
progress
Section titled “progress”progress:
number
Defined in: core/animator.ts:54
Current raw (un-eased) progress, between 0 and 1.
running
Section titled “running”running:
boolean
Defined in: core/animator.ts:56
True while start is driving frames. Resets to false on completion or stop.
Methods
Section titled “Methods”start()
Section titled “start()”start(
onFrame,onDone?):void
Defined in: core/animator.ts:77
Begin a new animation. Cancels any prior frame.
Parameters
Section titled “Parameters”onFrame
Section titled “onFrame”(progress) => void
Called every frame with the eased progress in [0,1]
(or slightly outside for overshoot easings).
onDone?
Section titled “onDone?”() => void
Optional callback fired once when the animation reaches 1.
Returns
Section titled “Returns”void
stop()
Section titled “stop()”stop():
void
Defined in: core/animator.ts:101
Cancel the current animation, if any. Safe to call when idle.
Returns
Section titled “Returns”void