Heatmap

An SVG-based heatmap for visualizing 2D data with a color scale. Typical uses include activity calendars, correlation matrices, and time-of-day patterns. The component is fully responsive via viewBox and adapts its label and legend colors to the active theme.

Use a rectangular values[y][x] matrix matching the label counts and finite numeric values. showLegend and showColLabels default to false. Tooltip and oncellHover respond to mouse entry; keyboard focus does not open the tooltip.


Yearly activity (GitHub-style)

52 weeks × 7 days with small cells. Default green scale, no legend.

MonTueWedThuFriSatSun

Hourly traffic — multi-stop scale

24h × 7 days. Three-stop color scale for richer contrast.

MonTueWedThuFriSatSun

Custom tooltip & click handler

Override the tooltip with a snippet and react to cell clicks via oncellClick.

JanFebMarAprMayJunJulAugSepOctNovDecAlphaBetaGammaDeltaEpsilonZetaEtaThetaRevenue ($k)52547