Skip to content

hd-heatmap

Attributes and example

hd-heatmap

A reading’s history as a grid, a row per day and a column per hour, each cell coloured from --hd-heatmap-low to --hd-heatmap-high (the accent) by its value; hovering a cell names its time and value. Reads the history again every ten minutes and says so when the reading isn’t recorded. Parts: ::part(cell), ::part(axis).

AttributeWhat it is
bindrequiredThe capability, e.g. {{ settings.meter.cap.meter_power }} (the whole capability, no .value).
rangeHow many days back.One of 7d, 14d, 30d. Default 7d.
layoutA row per day, or the range folded into a typical week (a row per weekday, each hour the average).One of days, week. Default days.
aggregateEach hour’s average, highest, or a meter’s use in it (delta).One of avg, max, delta. Default avg.
unitShown after values; the capability’s by default.
decimalsDigits after the decimal point.Default 1.
<hd-heatmap bind="{{ cap.measure_temperature }}" range="7d"></hd-heatmap>

Styling

Set CSS variables on the component element. Its internal elements live in Shadow DOM; only the exposed named parts can be styled with ::part.

--hd-accent
The theme’s accent: active controls, links, highlights.
--hd-border
Lines round tiles and between parts.
--hd-font-mono
The monospaced font of small labels.
--hd-font-ui
The font of labels and running text.
--hd-heatmap-high
CSS input read by hd-heatmap.
--hd-heatmap-low
CSS input read by hd-heatmap.
--hd-surface
A tile’s colour.
--hd-text-faint
The quietest text: hints, units, times.
--hd-text-sm
CSS input read by hd-heatmap.

Exposed parts

hd-heatmap::part(axis) {  /* Your styles */}hd-heatmap::part(cell) {  /* Your styles */}hd-heatmap::part(note) {  /* Your styles */}

Style the host

hd-heatmap {  --hd-accent: #2563eb;  max-width: 100%;}
Theme variables