Cohort heatmap
Retention by cohort with incomplete cohorts left blank and a size-weighted average.
A grid coloured by value, sequential or diverging, with missing cells hatched.
<Heatmap />Heatmap is a Pro chart.
Installation is part of Pro
The full source is included in the Pro download. Get Pro to install it with the CLI and use it in unlimited projects.
Unlock with Pronpx chartslibraryui add heatmap --from ./chartslibraryui-proUsage examples are part of Pro
Every example on this page comes with its code in the Pro download. The props and data shape below are public.
Unlock with ProLong-format rows: row key, column key, value key.
[{ channel: "Search", week: "W1", delta: 1.4 }, ...]Missing values are null. Invalid values make the chart say what’s wrong instead of drawing a misleading picture. How charts handle bad data
Every chart also accepts the shared frame props: title, subtitle, source, height, mode, toolbar. Common API
export interface HeatmapProps extends FrameProps {
/** Long-format rows: one row per cell. */
data: Row[];
/** Key of the row label (y). */
row: string;
/** Key of the column label (x). */
column: string;
/** Key of the cell value. */
value: string;
format?: FormatInput;
/** "sequential" for magnitude (default); "diverging" for above/below a centre (e.g. variance to plan). */
scale?: "sequential" | "diverging";
/** Diverging centre. Default 0. */
center?: number;
/** Fixed colour domain [min, max]; values beyond it take the end colour (the legend says so). */
domain?: [number, number];
/** Print values in cells when they fit. Default "auto". */
labels?: boolean | "auto";
/** Explicit column order. Default: order of first appearance. */
columnOrder?: string[];
rowOrder?: string[];
/** Cell height in px. Default 28. */
cellHeight?: number;
}Retention by cohort with incomplete cohorts left blank and a size-weighted average.
A year of daily values as weeks × weekdays.
A sortable table with inline bars, coloured deltas and sparklines.