Skip to content
GitHub (opens in a new tab)

Heatmap

A grid of cells, rows by columns, like weekday by hour, where each cell's shade shows its value. One hue from light to dark, a low-to-high legend, a tooltip per cell and a table view.

stableOrganismcontracts/heatmap.json

Preview

Heatmap

A grid of cells, rows by columns, where each cell's shade shows its value. One hue from light to dark, a low-to-high legend, a tooltip per cell and a table view.

Master

Agent runs by weekday and hour, with quiet nights and an outage gap.

Agent runs by hour

Last 7 days, local time

Row000102030405060708091011121314151617181920212223
Mon
Tue
Wed
Thu
Fri
Sat
Sun
094Lighter cells are lower, darker cells are higher.

Usage

Four shades of the first chart colour, by equal shares of the largest value. Zero keeps a solid outline; a cell with no entry has a dashed one and says No data. Tab into the grid, then move with the arrow keys, Home and End.

Do's

  • When something happens across two dimensions, like runs by weekday and hour or errors by service and day
  • Spotting busy and quiet patches in a dense grid, where reading every number would be slow
  • One measure over a fixed set of rows and columns, with gaps that matter

Don'ts

  • Exact values people compare cell by cell — use Table or DataTable
  • Editing values in cells — use DataGrid
  • Dated events people open or change — use Calendar
  • Change over time for one or a few series — use LineChart
  • A short ranking by one measure — use BarList
<Heatmap
  title="Agent runs by hour"
  description="Last 7 days, local time"
  rows={["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]}
  columns={["00", "01", /* … */ "23"]}
  data={[
    { row: "Mon", column: "09", value: 58 },
    { row: "Mon", column: "10", value: 81 },
    // one entry per cell; a cell with no entry shows as No data
  ]}
/>

When to use

  • When something happens across two dimensions, like runs by weekday and hour or errors by service and day
  • Spotting busy and quiet patches in a dense grid, where reading every number would be slow
  • One measure over a fixed set of rows and columns, with gaps that matter

When not to use

  • Exact values people compare cell by cell — use Table or DataTable
  • Editing values in cells — use DataGrid
  • Dated events people open or change — use Calendar
  • Change over time for one or a few series — use LineChart
  • A short ranking by one measure — use BarList

What an agent reads

import { Heatmap } from "agentic-ds-kit";
must
  • Title on the figure when provided, and the grid is named by it
  • The cells are a role=grid with column and row headers; the grid is one Tab stop and arrow keys, Home and End move between cells
  • Each cell names its row, column and value (or No data) and shows the tooltip on focus as well as on hover
  • Shade is never the only cue: the tooltip and the table view give every value as text
  • The Table toggle swaps the grid for a plain table with every value
defaults
  • isLoading false
stops if
  • Do not build a heatmap from a Table with coloured cells or from loose divs — use Heatmap
  • Do not use several hues or status colours for the scale; it is one measure in one hue
  • Do not use it for exact values people compare cell by cell — use Table
  • Do not squash the grid on small screens; it scrolls sideways inside its frame
  • Do not pass negative values; the scale starts at zero
  • Do not use raw hex or primitive --color-* ramps
  • Do not wrap a chart in a Card only to get a header button — pass actions

From contracts/heatmap.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.

Props

NameTypeRequiredDefaultNotes
rowsstring[]Yes—Row labels, top to bottom, like Mon to Sun. Each label is unique.
columnsstring[]Yes—Column labels, start to end, like 00 to 23. Each label is unique.
dataarrayYes—One entry per cell with a value. A cell with no entry shows as empty (No data), a cell with 0 shows as zero; both keep a visible outline. Entries for unknown rows or columns are ignored.
valueFormatterfunctionNo—(value: number) => string for the tooltip, the legend ends and the table. Defaults to the chart format: 1,240, 12.4k, 1.2M.
titlestringNo—Chart heading on the frame, like the other charts. Also names the grid for screen readers.
descriptionstringNo—One line under the title, like the time range.
isLoadingbooleanNofalseThe chart frame shows its loading skeleton in place of the plot. Same as LineChart.
errorstringNo—When set, the plot is replaced by the kit's "Couldn't load" row (role=alert) with this message. Same as LineChart.
onRetryfunctionNo—Shows an outline Retry Button on the error row.
actionsslotNo—Kit Buttons in the chart header, before the Table toggle, like an icon-only Ask. ghost sm reads quietest. Setting it draws the frame even with no title.
  • Component
    →

    Table

    Simple semantic table for invoices, lists, and text rows, with optional sort, row menu, sticky header, loading, empty and error states, row dividers on or off, and one optional highlighted row.

  • Component
    →

    DataTable

    Framed dataset with search, filters, column settings, and a caption title.

  • Component
    →

    DataGrid

    An editable table: people click a cell to add or change its content, like rule conditions, line items, or mappings.

  • Component
    →

    Calendar

    A full calendar of events by month, week, day, or list.