Sankey diagram
Sankey diagram for flows from sources through stages to uses, with ribbons as wide as the flow they carry.
Use a sankey diagram to show how a quantity splits and merges as it moves from where it starts to where it ends, such as energy, money or visitors.
Coal and gas feed most of the power that homes and industry use
Energy flows in TWh, synthetic
CoalGasWindSolar
This chart cannot be displayed here: it needs JavaScript and WebGL.
ribbons are as wide as their flow; a node is as tall as the larger of what enters and what leaves it
The same chart in each style
Source
```chart
type: sankey
title: Coal and gas feed most of the power that homes and industry use
subtitle: Energy flows in TWh, synthetic
data:
inline:
- {from: Coal, to: Power, twh: 35}
- {from: Gas, to: Power, twh: 30}
- {from: Gas, to: Heat, twh: 25}
- {from: Wind, to: Power, twh: 20}
- {from: Solar, to: Power, twh: 10}
- {from: Power, to: Homes, twh: 45}
- {from: Power, to: Industry, twh: 40}
- {from: Power, to: Losses, twh: 10}
- {from: Heat, to: Homes, twh: 15}
- {from: Heat, to: Industry, twh: 10}
encoding: {source: from, target: to, y: twh}
axes:
y: {label: TWh}
```
Fields that matter
type: sankeywithencoding.sourcefor the node a flow starts at,encoding.targetfor the node it ends at andencoding.yfor its value; each pair of nodes may have one row- A node stands in the column of its longest path from a source, and is as tall as the larger of what enters and what leaves it
- A ribbon is as wide as its flow; ribbons and nodes take the colour of the source that a node mostly receives from, and the legend names the sources
- A flow that points back and closes a cycle is left out with a finding, so what is drawn flows one way; rows without a node, with a missing or negative value, or with a value of zero are left out and counted
- A sankey takes at most 300 nodes and 2,000 links in a panel; above that the chart is not drawn and
checkraiseschart.limit-exceedednaming the limit and the count - Node sizes, shares and the sides of a node are computed by RichView and marked as derived in the readout
encoding.facetmakes one diagram per value on a shared scale unlessstyle.facet_scaleisfree; names that do not fit beside their node are left out and listed
Interactions
- Hover or focus a node to read its size, what enters and leaves it and its share of the column.
- Hover or focus a ribbon to read its value and its share of its source and of its target.
- Click a legend entry to remove a source and what it feeds, and back.
- Open the Table view, Download PNG or CSV, or Expand the chart.