interface ReplayOptions {
    barMs?: number;
    bars?: readonly Bar[];
    now?: () => number;
    onFrame?: (state: ReplayState) => void;
    scheduler?: ReplayScheduler;
    series?: SeriesApi | readonly SeriesApi[];
    speed?: number;
    startIndex?: number;
    subBars?: readonly Bar[];
}

Properties

barMs?: number

Wall-clock milliseconds per bar at speed 1. Default 1000.

bars?: readonly Bar[]

The full session. Defaults to the primary series' current data. Never mutated, and never handed to the chart as-is: each frame gets its own slice.

now?: () => number

Playback clock. Default performance.now.

onFrame?: (state: ReplayState) => void

Called on every playhead move, after the chart has been updated.

scheduler?: ReplayScheduler

Playback timer. Default setInterval.

series?: SeriesApi | readonly SeriesApi[]

The series replay drives. The first one owns the timeline; any others (a volume histogram, a comparison line) are truncated to the same instant by time, because the shared DataLayer merges every series onto one axis and a series left at full length would drag future timestamps back onto it.

Optional only if the host chart implements primarySeries().

speed?: number

Initial speed multiplier. Default 1.

startIndex?: number

Bar to open at (0-based). Default 0.

subBars?: readonly Bar[]

Finer-grained bars the displayed ones are built from: the 1-minute session under a 5-minute chart. Given these, the playhead advances a sub-bar at a time and the newest bar forms in front of the user the way a live one does, instead of appearing complete. A 5-minute bar over 1-minute data takes five steps.

They must cover the same session as bars and be sorted by time; sub-bars outside any displayed bucket are ignored. The last step of a bucket emits the displayed bar verbatim rather than the aggregate, so a bucket always closes on exactly the number the chart would have shown without this option, whatever the two feeds disagree about in between.

Only the first driven series forms partially. Followers are cut to completed buckets, because the controller cannot know how to half-aggregate an arbitrary one: a volume histogram is summed, not OHLC-merged. The partial bar reaches the host as ReplayState.bar on every frame, so a host that wants a growing volume bar writes it from there.