Components

Heatmap

Compare numeric intensity across two ordered domains with native table cells.

Loading chart…

Support requests by day and hour
DayHourRequests
Mon08:0012
Mon10:0034
Mon12:0048
Mon14:0039
Mon16:0027
Mon18:008
Tue08:0016
Tue10:0042
Tue12:0056
Tue14:0045
Tue16:0031
Tue18:000
Wed08:0011
Wed10:0029
Wed12:00No report
Wed14:0041
Wed16:0024
Wed18:006
Thu08:0018
Thu10:0047
Thu12:0060
Thu14:0052
Thu16:0033
Thu18:00No report

Usage

HeatmapChart owns the matrix model and inspection. Supply ordered domains, numeric records and one scale; compose the grid, legend and tooltip as children.

Composition
<Chart.HeatmapChart
  rows={rows} columns={columns} data={data} scale={scale}
  animate missingLabel="No report"
>
  <Chart.HeatmapGrid caption="Support requests by day and hour" />
  <Chart.HeatmapLegend label="Requests per two-hour interval" />
  <Chart.HeatmapTooltip valueAnimation="shuffle" />
</Chart.HeatmapChart>

Domain order determines equal-cell layout. Missing records and null use patterned cells; zero remains measured. Compose one grid and at most one tooltip per chart.

Compact activity grid

layout gives contributions fixed square cells and visual header controls. The grid keeps row/column headers and explicit cell associations when labels are hidden.

Loading chart…

Contributions by day and week
DayWeekContributions
MonWeek 10
MonWeek 21
MonWeek 32
MonWeek 43
MonWeek 54
MonWeek 60
MonWeek 71
MonWeek 82
MonWeek 93
MonWeek 104
MonWeek 110
MonWeek 121
MonWeek 132
MonWeek 143
MonWeek 154
MonWeek 160
MonWeek 171
MonWeek 182
MonWeek 193
MonWeek 204
MonWeek 210
MonWeek 221
MonWeek 232
MonWeek 243
MonWeek 254
MonWeek 260
TueWeek 11
TueWeek 22
TueWeek 33
TueWeek 44
TueWeek 50
TueWeek 61
TueWeek 72
TueWeek 83
TueWeek 94
TueWeek 100
TueWeek 111
TueWeek 122
TueWeek 133
TueWeek 144
TueWeek 150
TueWeek 161
TueWeek 172
TueWeek 183
TueWeek 194
TueWeek 200
TueWeek 211
TueWeek 222
TueWeek 233
TueWeek 244
TueWeek 250
TueWeek 261
WedWeek 12
WedWeek 23
WedWeek 34
WedWeek 40
WedWeek 51
WedWeek 62
WedWeek 73
WedWeek 84
WedWeek 90
WedWeek 101
WedWeek 112
WedWeek 123
WedWeek 134
WedWeek 140
WedWeek 151
WedWeek 162
WedWeek 173
WedWeek 184
WedWeek 190
WedWeek 201
WedWeek 212
WedWeek 223
WedWeek 234
WedWeek 240
WedWeek 251
WedWeek 262
ThuWeek 13
ThuWeek 24
ThuWeek 30
ThuWeek 41
ThuWeek 52
ThuWeek 63
ThuWeek 74
ThuWeek 80
ThuWeek 91
ThuWeek 102
ThuWeek 113
ThuWeek 124
ThuWeek 130
ThuWeek 141
ThuWeek 152
ThuWeek 163
ThuWeek 174
ThuWeek 180
ThuWeek 191
ThuWeek 202
ThuWeek 213
ThuWeek 224
ThuWeek 230
ThuWeek 241
ThuWeek 252
ThuWeek 263
FriWeek 14
FriWeek 20
FriWeek 31
FriWeek 42
FriWeek 53
FriWeek 64
FriWeek 70
FriWeek 81
FriWeek 92
FriWeek 103
FriWeek 114
FriWeek 120
FriWeek 131
FriWeek 142
FriWeek 153
FriWeek 164
FriWeek 170
FriWeek 181
FriWeek 192
FriWeek 203
FriWeek 214
FriWeek 220
FriWeek 231
FriWeek 242
FriWeek 253
FriWeek 264
SatWeek 10
SatWeek 21
SatWeek 32
SatWeek 43
SatWeek 54
SatWeek 60
SatWeek 71
SatWeek 82
SatWeek 93
SatWeek 104
SatWeek 110
SatWeek 121
SatWeek 132
SatWeek 143
SatWeek 154
SatWeek 160
SatWeek 171
SatWeek 182
SatWeek 193
SatWeek 204
SatWeek 210
SatWeek 221
SatWeek 232
SatWeek 243
SatWeek 254
SatWeek 260
SunWeek 11
SunWeek 22
SunWeek 33
SunWeek 44
SunWeek 50
SunWeek 61
SunWeek 72
SunWeek 83
SunWeek 94
SunWeek 100
SunWeek 111
SunWeek 122
SunWeek 133
SunWeek 144
SunWeek 150
SunWeek 161
SunWeek 172
SunWeek 183
SunWeek 194
SunWeek 200
SunWeek 211
SunWeek 222
SunWeek 233
SunWeek 244
SunWeek 250
SunWeek 261

Numbers use pixels; valid CSS lengths such as "1rem" work too. Omit cellSize for fluid sizing. A width-constrained host retains horizontal scrolling; custom content or native cell styles can enlarge cells. Use min-width: 0 when a flex/grid host must shrink.

Signed comparisons

A symmetric [-20, 20] scale centers zero between below-target orange and above-target blue. Keep the same domain for comparisons; out-of-range values clamp to endpoint colors.

Loading chart…

Regional orders versus monthly target
RegionMonthDifference (%)
NorthApr-12
NorthMay-6
NorthJun0
NorthJul14
SouthApr4
SouthMay11
SouthJun18
SouthJul7
EastApr-20
EastMay-9
EastJun-3
EastJulNo report
WestApr2
WestMay0
WestJun9
WestJul20

Use sequential palettes for nonnegative counts. Calendar layouts require consumer-owned day/week domains, date parsing and labels.

Cell materials

Choose plain, paper, clay or glow on cell edges. The central 84% retains the exact scale color; missing cells retain their pattern. Consumer paint overrides can change encoding.

Loading chart…

Support requests by day and hour
DayHourRequests
Mon08:0012
Mon10:0034
Mon12:0048
Mon14:0039
Mon16:0027
Mon18:008
Tue08:0016
Tue10:0042
Tue12:0056
Tue14:0045
Tue16:0031
Tue18:000
Wed08:0011
Wed10:0029
Wed12:00No report
Wed14:0041
Wed16:0024
Wed18:006
Thu08:0018
Thu10:0047
Thu12:0060
Thu14:0052
Thu16:0033
Thu18:00No report

Keyboard and motion

Tab enters/leaves the grid; arrows move between cells. Home/End reach row ends; Ctrl+Home/End reach matrix corners. Escape dismisses inspection. See the data grid pattern.

Entrance fades cells diagonally, preserving geometry and colors. Interaction, input changes or resize finish it; reduced motion skips it.

API reference

Native HTML components with an independent Kind context; no Root or Recharts composition is needed.

HeatmapChart

PropTypeDefaultDescription
rows / columnsreadonly string[]RequiredUnique, explicitly ordered domains. Records outside them throw.
datareadonly HeatmapDatum[]RequiredRecords shaped as { row: string; column: string; value: number | null }. Nonfinite values throw.
scaleHeatmapScaleRequiredShared numeric encoding for grid, legend and tooltip content.
duplicates"error" | "first" | "last" | "sum""error"Coordinate collision policy. Sum ignores null records; all-null coordinates stay missing. Nonfinite sums throw.
formatValue(value: number) => stringString conversionFormats cells, tooltip, legend and data table without changing the numeric scale.
missingLabelstring"Missing"Text used for absent or null observations.
animatebooleanfalseDiagonal cell entrance; respects reduced motion and interaction.

createHeatmapScale

Produces the HeatmapScale passed to HeatmapChart.

PropTypeDefaultDescription
domainreadonly [number, number]RequiredFinite ascending endpoints; their difference must also be finite. Equal endpoints use the palette midpoint.
colorsreadonly string[]RequiredAt least two opaque #rrggbb stops, evenly spaced in sRGB.

color(value) interpolates opaque hex colors and clamps to the explicit domain. Nonfinite values throw; data does not infer the scale or categorical palette.

HeatmapGrid

Captioned native table with row/column headers and roving grid focus. Empty domains show an empty state; wide matrices scroll horizontally.

PropTypeDefaultDescription
captionstringRequiredVisible table caption and accessible grid name.
layout{ cellSize?: number | string; gap?: number | string; rowLabels?: "visible" | "hidden"; columnLabels?: "visible" | "hidden" }Fluid cells; gap: 3; labels visibleOptional fixed cells, spacing and independent visual headers.
material"plain" | "paper" | "clay" | "glow""plain"Static cell-edge finish; missing cells do not receive it.
CellComponentType<HeatmapCellContentProps>HeatmapCellContentCustom cell content receives cell, fill and formattedValue. Keep content compatible with grid navigation.
cellProps(cell: HeatmapCell) => ComponentPropsWithRef<"td">—Native styles, refs and handlers. The grid still owns cell semantics, focus and background color.
rowLabel / columnLabel(key: string) => ReactNodeDomain keyCustomize visible headers; coordinate identities and inspection labels remain domain keys.

cellSize must be positive; gap must be nonnegative, including zero. Numeric values must be finite. Native table style, custom Cell and cellProps keep their existing overrides. Hidden labels retain grid names, header IDs and keyboard navigation; HeatmapDataTable is independent.

Each HeatmapCell retains row/column identities, indices, value and every source record. See native table semantics.

HeatmapCellContent

Formats values and chooses black/white text from hex-fill luminance. Also usable inside a custom Cell.

PropTypeDefaultDescription
cellHeatmapCellRequiredNormalized coordinate supplied to a custom cell component.
fillstringRequiredOpaque scale hex color or the missing-fill CSS variable.
formattedValuestringRequiredDisplay text; the default renderer does not format the number again.

HeatmapLegend

PropTypeDefaultDescription
labelstringRequiredFieldset legend describing the numeric encoding.

Shows scale endpoints, zero for signed domains and the missingLabel swatch. It is a numeric key, without series toggles.

HeatmapTooltip

In-flow inspection below the grid, linked to the active cell by aria-describedby. Focus, hover and touch inspect the same value.

Shuffle affects numeric digits only; assistive text exposes the final value immediately. Reduced motion uses plain text.

PropTypeDefaultDescription
ContentComponentType<HeatmapCellContentProps>Coordinate and value textCustom content receives the active cell, fill and formattedValue; presentation stays consumer-owned.
valueAnimation"shuffle"OffOptional digit motion for built-in numeric content. Missing cells remain text; custom Content receives no injected animation.

HeatmapDataTable

Static table using the shared model and formatter. The consumer chooses visible or visually hidden presentation; these examples preserve every observation.

PropTypeDefaultDescription
captionstringRequiredNative data table caption.

createHeatmapModel

Normalizes ordered domains into a two-dimensional cell array, filling missing coordinates with null and retaining source records. Accepts the chart’s rows, columns, data and duplicate policy; invalid input throws.