Heatmap()
function Heatmap<T>(__namedParameters): Element;
Defined in: packages/react/src/Heatmap.tsx:38
Client-only <canvas> heatmap, painted imperatively via core's
renderHeatmapLayersToCanvas in an effect. Unlike the SVG layer
components, this can't be re-emitted as JSX — Canvas has no declarative
JSX equivalent, and dense raster data is exactly the case core's hybrid
SVG+Canvas architecture (PRD §8.1) reserves Canvas for. The <canvas>
itself renders server-side (empty), but its pixels only appear after the
client effect runs — a documented client-only boundary.
Wrapped in <foreignObject> since a raw <canvas> can't be a direct
child of <svg> — this keeps the heatmap inside the same SVG tree as
the pitch and every other layer, rather than needing a second,
separately-positioned DOM element the way the vanilla-JS core example
demo has to (core has no JSX to lean on there).
No effect dependency array (runs after every render) rather than
enumerating every spread props field plus dimensions/viewport —
repainting a canvas is cheap and idempotent, so this avoids a fragile,
easily-stale dependency list.
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
__namedParameters | HeatmapProps<T> |
Returns
Element