Interface PrimitiveRenderContext

interface PrimitiveRenderContext {
    bars?: () => readonly Bar[];
    dataLayer: DataLayer;
    dpr: number;
    dragId?: null | string;
    hoverId?: null | string;
    hoverKey?: null | string;
    plotHeight: number;
    plotWidth: number;
    priceAxisOffset?: number;
    priceAxisSide?: "left" | "right" | "hidden";
    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.

hoverKey?: null | string

Optional subtarget identity; leaves the primitive's external click ID unchanged.

plotHeight: number
plotWidth: number
priceAxisOffset?: number

Plot-relative media-px x of the bound column's inner edge. Defaults to 0 on the left and plotWidth on the right. An explicit offset confines axis tags to this column without shifting the primitive's plot coordinates.

priceAxisSide?: "left" | "right" | "hidden"

Axis placement for price labels. Absent retains the default right axis.

priceAxisWidth: number

Width of the bound scale's axis column; zero for hidden scales.

priceScale: PriceScale

Explicitly bound scale, or the pane's right scale for an unbound primitive.

readoutPriceScale?: PriceScale

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

theme: ChartTheme
timeScale: TimeScale