Skip to main content

Heatmap Chart

A heatmap/matrix chart for visualizing value density across two dimensions. Built with custom SVG for activity grids, correlation matrices, and intensity maps.

Installation

$ npx shadcn@latest add @orecus/heatmap-chart
Dependencies:
motion
Registry:
@orecus/chart@orecus/color-utils@orecus/card

Component

Activity heatmap showing values across days and hours. Single color with intensity mapping.

Weekly Activity

Interactions per time slot

Quarterly Performance

Scores by metric and quarter

Props

PropTypeDefaultDescription
data*Record<string, any>[]Array of row objects with values for each category
categories*string[]Column keys to render as cells
index*stringRow label field key
colorThemeColor'primary'Single color with intensity-based opacity
colorScaleThemeColor[]Multi-color scale (2-3 stops) for gradient interpolation
emptyColorstring'transparent'Color for null/zero cells
variant'default' | 'gradient''default'Color fill variant
glowbooleanfalseAdd glow effect on hovered cell
showCellValuesbooleanfalseRender value text inside cells
showTooltipbooleantrueShow tooltip on hover
showXAxisbooleantrueShow column labels
showYAxisbooleantrueShow row labels
cellRadiusnumber4Cell border radius in px
cellGapnumber2Gap between cells in px
valueFormatter(value: number) => stringFormat cell values for display
cardPropsCardPropsProps passed to the Card wrapper