Skip to content

Heatmap

Stable

A grid of coloured cells with the number printed in each one. Use it to spot patterns across two things.

Also known as heat map, matrix chart, calendar heatmap

Install with npm install @tattva/ui (setup), or copy the code from the kit in Downloads.

Sector moves by day

Sector moves this week

Change in price, percent

Energy had the biggest swings. Banks and Tech were mixed.

Mon
Tue
Wed
Thu
Fri
Banks
Tech
Energy
Health
Retail

The direction scale. The up and down colours are stronger for bigger moves. Each cell prints its signed number. The cell with no data shows a dash.

When to use it

Shows where the high and low spots are in a table of numbers, at a glance, without losing the exact values.

Made of: Column headings · Row headings · Cells with colour and number · Dash for missing data · Scale bar (optional)

Use it for

  • Moves by group and day, where gains and losses both matter: direction scale.
  • A profit and loss calendar: weekday rows by week columns.
  • Counts or amounts by two categories, such as orders by region and hour: sequential scale.

Not for

  • Change over time for a few lines: use LineChart.
  • Comparing a handful of amounts: use BarChart.
  • Reading exact values and sorting: use DataTable.

Do and avoid

9am
12pm
3pm
6pm
North
South
West
Do. Shades find the busy hours, and the numbers stay readable.
9am
12pm
3pm
6pm
North
South
West
Avoid. Color with no numbers hides the real values from many people.

Do

  • Keep the numbers printed in the cells.
  • Use the direction scale only when zero means something, such as gain against loss.
  • Put it in a ChartFrame with a summary and a table.
  • Use null for missing data, not 0.

Avoid

  • Don't use the direction scale for counts that cannot be negative. Use sequential.
  • Don't hide the numbers and rely on colour.
  • Don't use dozens of columns on a phone. The grid scrolls sideways, so keep it short.

On a phone

  • The grid keeps cells at least 32px square, and when there are too many columns it scrolls sideways inside its own box.
  • Column headers are cut off with an ellipsis when they do not fit, so keep them short.
  • Values show inside the cells, so nothing depends on hover.
  • Cells are 32px by default and have no larger size on touch screens, so raise cellSize if people need to tap them.

Build your next AI screen with Tattva.

Free and open, with the code. Start in one line.

Get started