Skip to content

Documentation / @finchart/core / index / SeriesSpec

Interface: SeriesSpec<TSource> ​

Defined in: packages/core/src/registration/series-spec.ts:28

The point type survives in only one place: data. Each array element can have a different derived-result type, so a single element type can't express it — the same move Entry makes. seriesSpec() seals off that type, leaving outside only the identity (id) and whatever an update verdict needs.

TSource sits only in covariant position (data), so a SeriesSpec<OHLC> can be dropped straight into a SeriesSpec slot. This is the property a pane relies on when it takes the list.

Type Parameters ​

TSource ​

TSource extends BaseDataPoint = BaseDataPoint

Properties ​

color? ​

readonly optional color?: string

Defined in: packages/core/src/registration/series-spec.ts:67


data? ​

readonly optional data?: TSource[]

Defined in: packages/core/src/registration/series-spec.ts:55

The data this series draws. A changed reference counts as an update.

Passing the list again can't distinguish "replace" from "prepend past data," so what arrives here is always a replacement. It doesn't refit, though — in the declarative world, growing data means infinite scroll, and the window shouldn't jump when that happens. Use the imperative SeriesHandle when you need incremental updates and refitting.

Same handoff as SeriesHandle.setData: the array is copied, the points are kept as given — a point isn't edited after it's been passed in.


deriveKey? ​

readonly optional deriveKey?: readonly unknown[]

Defined in: packages/core/src/registration/series-spec.ts:41

The values that decide whether to rerun the derivation. undefined when there's no derivation.


id ​

readonly id: string

Defined in: packages/core/src/registration/series-spec.ts:30

The identity an update matches against. An index would quietly get this wrong on a conditional insert.


input? ​

readonly optional input?: Source<BaseDataPoint>

Defined in: packages/core/src/registration/series-spec.ts:63

Input for a registration that draws someone else's output — the declarative world's third mode. The reference is the identity — changing it rebuilds the entry. It doesn't own data, so it can't coexist with data or deriveKey.


name? ​

readonly optional name?: string

Defined in: packages/core/src/registration/series-spec.ts:66

What the series is shown as — re-read on every sync, so a changed name or colour reaches the legend.


readout? ​

readonly optional readout?: boolean

Defined in: packages/core/src/registration/series-spec.ts:69


series ​

readonly series: unknown

Defined in: packages/core/src/registration/series-spec.ts:38

What gets swapped in when the identity matches. The point type is erased.

A Series must be stateless — swapping it loses any internal state. Things that carry state (a crosshair, say) go through decorations, not series.


toEntry ​

readonly toEntry: (createDataManager) => Entry

Defined in: packages/core/src/registration/series-spec.ts:72

What a Pane uses to seal this into an Entry. The point type is concrete only inside this function.

Parameters ​

createDataManager ​

DataManagerFactory

Returns ​

Entry


zIndex? ​

readonly optional zIndex?: number

Defined in: packages/core/src/registration/series-spec.ts:68