dashboards/; the file name is the page’s name and URL (dashboards/sales.yaml builds
dist/sales/index.html). Print the full JSON Schema with hatchmark schema dashboard.
Period
Every block reads the same window.
Without
period, a dashboard uses { asOf: latest_data, range: last_12_months, compare: previous_period }.
Windows are calendar dates in the project time zone; Numbers has the rules.
Blocks
Fields every block takes:
Metric names in blocks are metric file names (see Metrics); columns in
by and
split are source columns. line, area and bar blocks with several series take groups to colour
related series as one hue family (Series groups). kpi, line,
area and bar blocks take target: <id>, one of the targets of the block’s metric (with several
metrics, the first that defines it; see Metrics). Each component shows it
its own way: see KPI, line and area
and bar.
Heights
height picks one of three presets. There are no pixel heights: the theme sets each preset
separately for desktop and phone, so axis labels, keys, tooltips and KPI figures stay legible at
every preset.
In the Default theme a chart is 200, 280 or 400 px tall on desktop (
compact, default, tall)
and 180, 230 or 320 px on phones; Theme lists every value.
Cards side by side end level. On screens 1024 px and wider, the charts in one grid row are drawn at
the tallest preset among them, and a KPI strip at the tallest preset of its KPIs, so a compact
chart is never drawn beside a tall one. A card set lower gets warning HM2028. Below 1024 px cards
stack, and every card, each KPI included, keeps its own preset. Tables keep their own height in any row.
A pixel value or another string is an error that lists the presets. height on a text or
bar_list block is an error with a safe fix that removes it, and on a table with
overflow: page it is warning HM2031 (see Diagnostics).
Filters
filters declares controls a reader can change: select on a column, period with a list of
ranges, grain with a list of grains, or segment with a list of segments.
A filter’s id is its query parameter in the page URL, such as ?period=last_30_days. The page
reads theme (light or dark) itself, so no filter may use that id (HM2050).
grain filter draws one control in the page header. Choosing a grain switches every line, area
and bar block whose grains list it; the others keep their grain. Its default is shown first in
those blocks. A dashboard has at most one grain filter (HM3007).
Its accessible name is the filter’s label followed by ”, all charts”, so screen readers tell it
apart from a chart’s own grain switch. A grain option that no block lists switches nothing and is a
warning (HM2025).
A period filter draws a date control in the page header. options lists up to 12 presets, using
the same range values as period.range (last_30_days, { to_date: month },
{ last_complete: quarter }, …). Each preset is listed once, even under another spelling, and
default must be one of them (HM3007). The default is what the page shows first, and it
replaces period.range. Unless custom: false is set, the control also offers a calendar where
a reader picks any start and end day within the data.
The built page stays static. Every preset is computed exactly at build time. Custom ranges are
added up in the browser from day-level totals embedded in the page. Metrics that can’t be added up
from days (count_distinct, median, SQL metrics that are not additive) show ”—” on a custom
range and ask the reader to pick a preset; check notes each one (HM4041). So does an additive SQL
metric whose SQL gives a number other than 0 over no rows, such as coalesce(sum(amount), 99):
every day without rows would add that number. Build notes it (HM4041). The day-level data makes
the page bigger. Above 3 MB, build warns (HM5002) and names what weighs the most. Set
custom: false to embed only the presets.
The chosen period and grain are kept in the page’s URL query under each filter’s id
(?period=last_7_days, ?period=2026-03-01..2026-05-15 with the last day included, ?grain=week;
a filter at its default is left out), so a reload or a shared link opens the same view.
A segment filter draws one toggle button per segment in the page header (a segment is a named row
filter in segments/<name>.yaml: a label and a list of filters). A reader turns any of them on or off; the segments
on combine with AND and apply to every block, before anything else is computed. segments lists 1
to 4 segment names, each once, and the optional default lists the ones on when the page opens
(none by default). A dashboard has at most one segment filter (HM3007). An unknown segment is
HM2021, and a block reading several sources of which only some have a segment’s columns is
HM2013. A segment whose columns none of the dashboard’s sources have would change nothing, and
is warning HM2030 (so is a select filter on such a column). Segments may use in_table and
not_in_table; their key columns follow the same type rule as in metrics (HM2029). A key table that is a
lookup source isn’t evaluated yet: a block whose sources the segment applies to is left out with
HM4023, and blocks whose sources it can’t apply to are unaffected.
Build runs the dashboard once per combination of segments (at most 16), with each combination’s
period presets and day-level data when the dashboard also has a period filter, so every number
on the page is exact. The combinations count toward the page weight warning (HM5002). The
combination is kept in the URL under the filter’s id (?segments=paid_marketing,americas,
?segments= for none when the default has some on).
This version does not draw select controls yet: the built page shows the data at each
select filter’s default, and does not say so on the page. A select filter with a default
therefore filters the whole page (only the default’s rows); leave default out to show all rows. A
dashboard has at most one period filter (HM3007).