Skip to content

Heatmap

A 2D grid of values, each rendered as a block character whose density represents the cell’s intensity within the visible range.

See also: CalendarHeatmap for values keyed by date.

Import: package:fleury/fleury.dart, or package:fleury/fleury_core.dart in browser code.

const Heatmap(
values: <List<num>>[
<num>[0.1, 0.3, 0.6, 0.9],
<num>[0.2, 0.5, 0.8, 0.4],
<num>[0.7, 0.6, 0.3, 0.1],
],
rowLabels: <String>['a', 'b', 'c'],
colLabels: <String>['w', 'x', 'y', 'z'],
showLegend: true,
)

Common shapes: GitHub-style activity calendars, time-of-day usage matrices, attention heatmaps. Each value maps to one of four blocks (░▒▓█) by where it falls in the range from min to max (fitted to the data by default); a value at or below the low end leaves its cell blank. Cells draw in the theme’s primary color unless you pass color.

Screen readers and agents get one chart node: semanticLabel plus the row and column counts and the value range the blocks are scaled to, not a node per cell.

ParameterTypeDefaultDescription
values:List<List<num>>requiredvalues[row][col] — outer list is rows top→bottom, inner is cols left→right.
min:num?—Low end of the color/intensity range. null autoscales.
max:num?—High end. null autoscales.
cellWidth:int2Cells per data point (≥ 1). Wider cells make each data point easier to read; 2 is a nice default.
color:Color?—Foreground for active cells. Defaults to the theme’s primary.
rowLabels:List<String>?—Optional labels for the rows (drawn to the left).
colLabels:List<String>?—Optional labels for the columns (drawn above the grid).
showLegend:boolfalseWhen true, append a ░▒▓█ min – max scale strip below the grid so the intensity ladder maps to real values — the encoding is otherwise opaque (and color/glyph-density-only is an accessibility red flag).
semanticLabel:String'Heatmap'Label exposed through the semantic app graph.

Heatmap is defined in packages/fleury/lib/src/catalog/heatmap.dart.

Category: Charts & meters · All widgets