Skip to content

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).

new Animator(duration?, easing?): Animator

Defined in: core/animator.ts:63

number = 600

Animation length in ms (default 600).

EasingName = 'easeOutCubic'

Easing curve name; falls back to easeOutCubic if unknown.

Animator

duration: number

Defined in: core/animator.ts:50

Animation duration in milliseconds. Mutate to adjust on the fly.


easing: EasingName

Defined in: core/animator.ts:52

Active easing curve name. Mutate to switch curves.


progress: number

Defined in: core/animator.ts:54

Current raw (un-eased) progress, between 0 and 1.


running: boolean

Defined in: core/animator.ts:56

True while start is driving frames. Resets to false on completion or stop.

start(onFrame, onDone?): void

Defined in: core/animator.ts:77

Begin a new animation. Cancels any prior frame.

(progress) => void

Called every frame with the eased progress in [0,1] (or slightly outside for overshoot easings).

() => void

Optional callback fired once when the animation reaches 1.

void


stop(): void

Defined in: core/animator.ts:101

Cancel the current animation, if any. Safe to call when idle.

void