renderHeatmapLayersToCanvas
const renderHeatmapLayersToCanvas: (scene, canvas, options) => void = renderDensityLayersToCanvas;Defined in: packages/core/src/render/canvas/render-heatmap.ts:74
The original name for renderDensityLayersToCanvas, from when heatmap
was the only Canvas-rendered layer. Kept as an alias because it shipped
in @pitchkit/core@0.1.0's public API — it paints every density layer,
not just heatmaps.
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 (docs/architecture.md#responsive-and-multi-device), 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