Heatmap
Standalone grid heatmap. Color-encodes values in a 2D grid with configurable color scale.
Primitive:
ChartHeatmap· Standalone (no ChartRoot needed)Interactive demo
Usage
import { ChartHeatmap } from '@ramtt/charts'
<ChartHeatmap
data={matrix}
xLabels={['Mon','Tue','Wed','Thu','Fri']}
yLabels={['6am','9am','12pm','3pm','6pm']}
colorScale={[
{ value: 0, color: '#f0f9ff' },
{ value: 100, color: '#3b82f6' },
]}
/>Props
| Prop | Type | Default | Description |
|---|---|---|---|
| data* | (number | null)[][] | — | 2D data matrix |
| colorScale* | ColorStop[] | — | Color interpolation stops |
| xLabels | string[] | — | Column labels |
| yLabels | string[] | — | Row labels |
| cellSize | number | 14 | Cell size in pixels |
| showValues | boolean | false | Show values in cells |