interface RendererEntry {
    connectsBars?: boolean;
    defaultStyle: SeriesStyle;
    isPriceSeries: boolean;
    draw(
        ctx: CanvasRenderingContext2D,
        items: readonly DrawItem[],
        toY: (v: number) => number,
        barSpacing: number,
        dpr: number,
        style: SeriesStyle,
        rc: SeriesRenderContext,
    ): void;
    extents(bar: Bar, style: SeriesStyle): { max: number; min: number };
}

Properties

connectsBars?: boolean

True for a renderer that draws a segment from each bar to the next (a line, a step, an area, kagi). Its items then carry the nearest bar beyond each edge of the view as well, marked with edgeX, so the segment that crosses an edge is drawn: a sparse line (a level held for an hour, a position that steps twice a session) would otherwise lose the part that enters from off screen. Such a renderer cuts that segment at edgeX.

defaultStyle: SeriesStyle
isPriceSeries: boolean

True for the price series whose last close drives the last-price line.

Methods

  • Paint the items on a bitmap-scope 2D context: the bars in view, and for a connectsBars renderer the neighbour beyond each edge (DrawItem.edgeX). On screen the pane reaches this through its render backend (src/render/backend.ts); the 2D backend calls it as is, and the vector export calls it directly on the serialising target.

    Parameters

    Returns void