renderDensityLayersToCanvas()
function renderDensityLayersToCanvas(
scene,
canvas,
options?
): void;Defined in: packages/core/src/render/canvas/render-heatmap.ts:26
Paints every density-type layer in a Scene (heatmap,
positionalHeatmap, hexbin, kde) onto a 2D canvas, ignoring every
other layer type — the SVG renderer handles those. Backs the canvas at
cssSize x devicePixelRatio physical pixels and scales the drawing
context accordingly (PRD §8.6), so dense layers stay crisp on retina
displays without every painter needing to know about DPR itself.
Does not attempt to composite with the SVG renderer's output — stacking
the resulting canvas with an <svg> in the DOM is a consumer concern
(@pitchkit/react's), not core's.
Parameters
| Parameter | Type |
|---|---|
scene | Scene |
canvas | HTMLCanvasElement |
options | RenderHeatmapOptions |
Returns
void