Skip to content
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
Plays by weekday and hour
67891011121314151617181920212223
Mon28 plays69 plays92 plays64 plays29 plays11 plays13 plays16 plays19 plays11 plays14 plays18 plays26 plays34 plays62 plays78 plays57 plays35 plays
Tue24 plays65 plays99 plays60 plays25 plays18 plays20 plays12 plays15 plays18 plays10 plays14 plays22 plays41 plays58 plays74 plays64 plays42 plays
Wed31 plays61 plays95 plays67 plays21 plays14 plays16 plays19 plays11 plays14 plays17 plays21 plays18 plays37 plays65 plays70 plays60 plays38 plays
Thu27 plays68 plays91 plays63 plays28 plays21 plays12 plays15 plays18 plays10 plays13 plays17 plays25 plays33 plays61 plays77 plays67 plays34 plays
Fri23 plays64 plays98 plays59 plays24 plays17 plays19 plays11 plays14 plays17 plays20 plays13 plays21 plays40 plays57 plays73 plays63 plays41 plays
Sat23 plays29 plays44 plays35 plays24 plays12 plays15 plays18 plays10 plays13 plays16 plays21 plays20 plays47 plays87 plays110 plays82 plays48 plays
Sun19 plays36 plays40 plays31 plays20 plays19 plays11 plays14 plays17 plays20 plays12 plays17 plays27 plays43 plays83 plays106 plays89 plays44 plays
  • rows and columns are the names on the two edges. values[row][column] is the number of each cell. null is 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. color sets that color, as a token name or any CSS color (default chart-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. label names the table, and format sets 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

NameTypeDefaultDescription
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
colorstring"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"`
labelstring"Heatmap"names the table

Released under the MIT License. Character names and artwork belong to their owners.