When to use a heatmap
Heatmaps show patterns across two dimensions at once.
- Weekly cohort retention (triangle tables)
- Activity by weekday and hour
- Correlation or comparison matrices
Data format
- Column 1 labels the rows; every other column is a column of the grid.
- Blank cells stay empty, which suits cohort triangles.
- Choose Percent to show 0–1 values, or values that are already percentages, with a % sign.
- Paste CSV, JSON from your API, TSV copied from Excel or Google Sheets, or a Markdown table. The generated component keeps your column names as its data keys.
Cohort,Week 0,Week 1,Week 2,Week 3,Week 4,Week 5
Jan,100,62,48,41,37,34
Feb,100,65,51,44,40,
Mar,100,68,55,47,,
Apr,100,70,57,,,
May,100,72,,,,
Jun,100,,,,,[
{"cohort": "Jan", "week0": 100, "week1": 62, "week2": 48, "week3": 41, "week4": 37, "week5": 34},
{"cohort": "Feb", "week0": 100, "week1": 65, "week2": 51, "week3": 44, "week4": 40, "week5": null},
{"cohort": "Mar", "week0": 100, "week1": 68, "week2": 55, "week3": 47, "week4": null, "week5": null},
…
]Options
- Values
- Show numbers, percentages, or hide the labels.
- Heat color
- The color cells blend toward at the maximum.
How to add it to your project
- 1. This component is plain React and Tailwind: no chart library to install.
- 2. Paste your data above, pick the options, and copy the generated
chart.tsx. - 3. Save it in your project (e.g.
components/heatmap-chart.tsx) and render<Chart />, or<Chart data={rows} />in Data as prop mode.
Heatmap FAQ
No. It's a CSS grid of cells shaded with color-mix(), so the copied component has no dependencies beyond React and Tailwind.
Put cohorts in column 1 and Week 0, Week 1, … as the other columns, leaving future weeks blank. Choose Percent to show the values as percentages.
Cells use table roles with row and column headers, and each cell has a title with its row, column, and value.