Paints one pane's series. One instance per pane: a backend holds a context on that pane's base canvas, and contexts do not travel between canvases.

Implements

Constructors

Properties

kind: "canvas2d" = 'canvas2d'

Methods

  • Paint one series. Same contract as RendererEntry.draw minus the context: priceToY and items[].x are media px, and the renderer snaps to device pixels with dpr itself.

    items and the objects in it belong to the pane, which rewrites them in place the next time it draws this series, so a backend that keeps any of it past that (a batch held across frames, say) copies what it keeps.

    Parameters

    Returns void

  • Take the pane's base data canvas. ctx2d is the 2D context the pane already holds on it, when it holds one: the canvas-2D backend draws on exactly that object, so a frame is one context's op stream and not two contexts' interleaved. A backend that owns the canvas outright ignores it.

    Parameters

    • canvas: HTMLCanvasElement
    • ctx2d: null | CanvasRenderingContext2D

    Returns void

  • A 2D context for what the backend does not draw natively (grid, axes, primitives), or null when the backend paints those itself.

    Returns null | CanvasRenderingContext2D

  • Nothing to do: the pane's CanvasLayer owns the backing store and sized it already. Re-sizing it here would clear a bitmap that was just painted.

    Parameters

    • _widthPx: number
    • _heightPx: number
    • _dpr: number

    Returns void