@pond-ts/charts API Reference
    Preparing search index...

    Function Canvas

    • The DPR-aware <canvas> primitive every chart draw layer sits on. It sizes the backing buffer to width*dpr × height*dpr, keeps the CSS box at width × height, applies setTransform(dpr, …) so the CanvasDraw callback works in CSS-pixel coordinates, clears, and calls draw.

      Drawing runs in useLayoutEffect (synchronous, before paint) so there is no flash of an unsized or empty canvas. Setting canvas.width/height resets all context state, so the transform is re-applied on every run — see trap #7 in docs/rfcs/charts.md.

      Parameters

      Returns Element