Documentation / @finchart/core / index / PlotOptions
Interface: PlotOptions
Defined in: packages/core/src/plot/plot.ts:105
What it takes to stand up a Plot.
This used to be five positional arguments; now it's named. new Plot(el, deps, config, null, size) gave no way to tell what the fourth argument was just by reading the call site.
There's no series here. When there was, nothing checked that series and data agreed on point type — a class constructor can't be generic, so it fell back to PlotOptions<BaseDataPoint>, which disarmed the registration union's discriminant (SeriesRegistration) entirely. { series: lineSeries(), data: candles } compiled and read .y at runtime as undefined — the exact bug the discriminant was supposed to block, alive on this one path.
The place to mount one is plot.mainPane.addSeries(). Being a method generic lets the registration's point type flow through, and it hands back a handle besides. PlotBuilder and createPlotModel both go through that door internally.
Properties
config?
optionalconfig?:PlotConfig
Defined in: packages/core/src/plot/plot.ts:116
May be left out — every static default is filled at this door (resolveConfig).
deps
deps:
PlotDeps
Defined in: packages/core/src/plot/plot.ts:114
container isn't here — where the chart mounts is something the wiring (deps) already knows. Browser assembly's browserDeps(options) returns a recipe whose build(el) feeds it an element to produce container-bound deps, and headless assembly (createPlotModel) has no such slot to begin with. Keeping element types out of the core contract is half of what makes headless headless.
scope?
optionalscope?:Scope
Defined in: packages/core/src/plot/plot.ts:127
A parent lifetime to live under. When the given scope is disposed, this chart is destroyed with it — a page-level scope can own several charts and their sibling subscriptions, and one dispose() walks out of all of it. Destroying the chart yourself first is fine (the parent then has nothing left to do), and a chart mounted into an already-disposed scope is destroyed on the spot rather than living unowned.
size
size:
ViewportDimensions
Defined in: packages/core/src/plot/plot.ts:118
Initial size of the layers. Changed afterward with setViewport.