Calm motion: animations on this site only fade, with no movement
Heatmap
A grid of rows and columns, colored by value
Shows a number for each pair of two things, for example plays by weekday and hour, so busy and quiet times stand out. For one value a day over a year, use the heatmap calendar.
Basic
| 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Mon | 28 plays | 69 plays | 92 plays | 64 plays | 29 plays | 11 plays | 13 plays | 16 plays | 19 plays | 11 plays | 14 plays | 18 plays | 26 plays | 34 plays | 62 plays | 78 plays | 57 plays | 35 plays |
| Tue | 24 plays | 65 plays | 99 plays | 60 plays | 25 plays | 18 plays | 20 plays | 12 plays | 15 plays | 18 plays | 10 plays | 14 plays | 22 plays | 41 plays | 58 plays | 74 plays | 64 plays | 42 plays |
| Wed | 31 plays | 61 plays | 95 plays | 67 plays | 21 plays | 14 plays | 16 plays | 19 plays | 11 plays | 14 plays | 17 plays | 21 plays | 18 plays | 37 plays | 65 plays | 70 plays | 60 plays | 38 plays |
| Thu | 27 plays | 68 plays | 91 plays | 63 plays | 28 plays | 21 plays | 12 plays | 15 plays | 18 plays | 10 plays | 13 plays | 17 plays | 25 plays | 33 plays | 61 plays | 77 plays | 67 plays | 34 plays |
| Fri | 23 plays | 64 plays | 98 plays | 59 plays | 24 plays | 17 plays | 19 plays | 11 plays | 14 plays | 17 plays | 20 plays | 13 plays | 21 plays | 40 plays | 57 plays | 73 plays | 63 plays | 41 plays |
| Sat | 23 plays | 29 plays | 44 plays | 35 plays | 24 plays | 12 plays | 15 plays | 18 plays | 10 plays | 13 plays | 16 plays | 21 plays | 20 plays | 47 plays | 87 plays | 110 plays | 82 plays | 48 plays |
| Sun | 19 plays | 36 plays | 40 plays | 31 plays | 20 plays | 19 plays | 11 plays | 14 plays | 17 plays | 20 plays | 12 plays | 17 plays | 27 plays | 43 plays | 83 plays | 106 plays | 89 plays | 44 plays |
rowsandcolumnsare the names on the two edges.values[row][column]is the number of each cell.nullis a cell with no data, and it is gray.- The color of a cell goes from a light tint for the lowest value to the full color for the highest.
colorsets that color, as a token name or any CSS color (defaultchart-1). - The legend under the grid shows the scale from the lowest to the highest value. A hover on a cell shows its row, column, and value.
- The grid is a real table, with the names of the rows and columns as headers, so screen readers read each value with its row and column.
labelnames the table, andformatsets the text of a value. - A wide grid scrolls to the side in its own box.
Usage
ts
import { BlessHeatmap } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
rows* | string[] | — | the names of the rows, down the start edge |
columns* | string[] | — | the names of the columns, along the top |
values* | (number | null | undefined)[][] | — | `values[row][column]`; `null` is a cell with no data |
color | string | "chart-1" | a token name or any CSS color for the highest value |
format | ((v: number) => string) | — | text for one value, for example `(v) => v + " plays"` |
label | string | "Heatmap" | names the table |