Skip to content
Alea0.1

Charts

Scatter, Radar and Heatmap

How two measures relate, several measures at once, and intensity in a grid.

Ant Design: Scatter, Radar, Heatmap (Ant Charts)

import { ScatterChart, RadarChart, Heatmap } from '@alea/ui';

Examples

Scatter and bubbles

Point size can carry a third measure.

Session length and pages
  • Desktop
  • Mobile
020406080020406080100Minutes

Radar

Several measures at once: two profiles compared.

Skills
  • Ana
  • Bruno
DesignCodeWritingResearchSystems

Heatmap

Activity by day and hour; arrows read each cell.

Deploys by day and hour

Props

ScatterChart props

How two measures relate; sizes make it a bubble chart (MUI ScatterChart, Mantine BubbleChart).

PropTypeDefaultDescription
seriesrequired{ label: string; color?: string | undefined; points: { x: number; y: number; label?: string | undefined; size?: number | undefined; }[]; }[]-Groups of points: label, color and the points with x, y (and an optional label and size).
descriptionReactNode-One sentence on what the chart shows; read before it.
heightnumber280Plot height in px. Default 280.
showTablebooleantrueShows the "view as table" toggle. Default true.
titleReactNode-The title shown above it and read by screen readers.
xFormat((v: number) => string)-Formats x values.
xLabelstring'x'Name of the x measure (axis, tooltip, table).
yFormat((v: number) => string)-Formats y values.
yLabelstring'y'Name of the y measure.

RadarChart props

Several measures at once, one shape per series: skills, scores, profiles (Mantine RadarChart).

PropTypeDefaultDescription
axisrequiredstring-The key in each row that names the axis ("skill").
datarequiredChartRow[]-One row per axis: the axis name in `axis`, a value per series key.
seriesrequiredSeries[]-The series to draw: key in each row, label for the legend, optional color.
descriptionReactNode-One sentence on what the chart shows; read before it.
maxnumber-The top of the scale. Default the largest value.
showTablebooleantrueShows the "view as table" toggle. Default true.
sizenumber280Width and height in px. Default 280.
titleReactNode-The title shown above it and read by screen readers.

Heatmap props

Intensity in a grid: activity by day and hour, contributions, correlations (Mantine Heatmap, MUI X heatmap).

PropTypeDefaultDescription
columnsrequiredstring[]-Column labels.
rowsrequired{ label: string; values: number[]; }[]-Rows of cells: [row label, ...values].
descriptionReactNode-One sentence on what the chart shows; read before it.
showTablebooleantrueShows the "view as table" toggle. Default true.
titleReactNode-The title shown above it and read by screen readers.
valueFormat((v: number) => string)-Formats values in the axis, tooltip and table, e.g. v => `${v}k`.

Accessibility

  • Scatter and heatmap read each point or cell with the arrow keys.

Keyboard

KeyDoes
TabFocuses the chart
Arrow keysRead each point or cell
EscapeHides the tooltip

Do and don't

Do

  • Use scatter for correlation, radar for profiles, heatmap for patterns over time.
  • Write the takeaway in description.

Don't

  • Don't use radar charts with more than eight axes.
  • Don't use a heatmap without the table view for exact numbers.
Tested with axe, keyboard and screen reader roles