Interface PrimitiveRenderContext

interface PrimitiveRenderContext {
    bars?: () => readonly Bar[];
    dataLayer: DataLayer;
    dpr: number;
    dragId?: null | string;
    hoverId?: null | string;
    plotHeight: number;
    plotWidth: number;
    priceAxisWidth: number;
    priceScale: PriceScale;
    readoutPriceScale?: PriceScale;
    theme: ChartTheme;
    timeScale: TimeScale;
}

Properties

bars?: () => readonly Bar[]

The pane's primary price series, for a primitive that needs what price actually did rather than just the scales — a forecast scoring itself, say. Lazy, so nothing pays for it unless asked. Absent on synthetic contexts.

dataLayer: DataLayer
dpr: number
dragId?: null | string

externalId of the line being dragged (active state), if any.

hoverId?: null | string

externalId of the primitive hit under the pointer (hover state), if any.

plotHeight: number
plotWidth: number
priceAxisWidth: number
priceScale: PriceScale
readoutPriceScale?: PriceScale

The pane's primary visible price series scale, including a moved left axis.

theme: ChartTheme
timeScale: TimeScale