Skip to content

hd-sankey

Attributes and example

hd-sankey

Where something goes, as bands as wide as how much, from left to right: an hd-flow inside per flow (energy from the grid, solar and the battery to the house and its devices). Each node is named with what passes through it. A node takes the colour of the first flow from it that has one, else the theme’s chart colours in turn. Bands can be hovered for their amount; nothing moves. Parts: ::part(band), ::part(node), ::part(label).

AttributeWhat it is
unitShown after every amount, e.g. kWh.
decimalsDigits after the decimal point.Default 1.
<hd-sankey unit="kWh">  <hd-flow from="Solar" to="Home" value="{{ energy.today.solar }}" color="lit"></hd-flow>  <hd-flow from="Grid" to="Home" value="2.1"></hd-flow></hd-sankey>

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-chart-
CSS input read by hd-sankey.
--hd-font-mono
The monospaced font of small labels.
--hd-font-ui
The font of labels and running text.
--hd-motion-fast
A quick change, like a press. 0ms when nothing may move.
--hd-sankey-band-opacity
CSS input read by hd-sankey.
--hd-text
Text and big numbers.
--hd-text-faint
The quietest text: hints, units, times.
--hd-text-muted
Labels and secondary text.
--hd-text-sm
CSS input read by hd-sankey.

Exposed parts

hd-sankey::part(band) {  /* Your styles */}hd-sankey::part(empty) {  /* Your styles */}hd-sankey::part(label) {  /* Your styles */}hd-sankey::part(node) {  /* Your styles */}

Style the host

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