Documentation / @finchart/react / SeriesCollector
Interface: SeriesCollector<T>
Defined in: react/src/components/series-collector.ts:21
Collects the list of series one pane will draw, in JSX order. One per pane.
syncSeries treats array order as draw order, but effects run in mount order, so a series switched on late by a condition always lands at the end. Only the render phase knows the JSX order, so the slot gets decided by a render-local placement pass and applying it to the chart is deferred to after commit (flush).
The key is holding the slot as a rank, not an array position — an array position loses its way back when something mounts and unmounts without a render in between (StrictMode, Activity).
The id comes from <ChartSeries>, freshly made per instance (useId) — deciding identity is React reconciliation's job, not this collector's.
Type Parameters
T
T extends BaseDataPoint
Methods
flush()
flush():
void
Defined in: react/src/components/series-collector.ts:35
After commit. Hands the current list to the pane. Safe to call more than once.
Returns
void
keep()
keep(
spec,rank?):void
Defined in: react/src/components/series-collector.ts:29
Commit phase. Only confirms membership in the list. The rank is whatever render already assigned, so it lands back in its place.
StrictMode attaches, detaches, and reattaches an effect, so something that left through cleanup has to come back without a render.
Parameters
spec
SeriesSpec<T>
rank?
readonly number[]
Returns
void
remove()
remove(
id):void
Defined in: react/src/components/series-collector.ts:32
Unmount. A replayed effect carries its captured rank when it reattaches.
Parameters
id
string
Returns
void