SankeyMATIC Gallery: Energy Flows

Reworking a complex example

Back to Gallery Home

Energy flows, revised diagram

Original Diagram


Sankey energy example: Original

Notes from the original:

Source: Department of Energy & Climate Change, Tom Counsell.

“This intricate diagram shows a possible scenario for UK energy production and consumption in 2050: energy supplies are on the left, and demands are on the right.

Intermediate nodes group related forms of production and show how energy is converted and transmitted before it is consumed (or lost!).”

This dataset is used in the big library of D3 examples as a demonstration of D3's Sankey capabilities.

I have adapted the original inputs (found here) to be in SankeyMATIC format (shown below).

Some of the formatting changes I experimented with:

  • Nodes are no longer multicolored. (I found the wide assortment of node colors distracting.)

  • Nodes are narrower—just enough width to establish how large each is, and no more. This allows more room for the label text.

  • Since the labels had room to grow, I made them slightly larger & easier to read. (I did try displaying the node totals in the labels, but the amounts didn't fit in a diagram this size; in many places they overlapped other nodes.)

  • After removing most of the color, it is easier to highlight specific flows. In this rendition of the diagram I chose to call out the “Losses” node and the flows into it. With SankeyMATIC this only takes one extra line in the source data:

    :Losses #900 <<

  • This version of the diagram is a static PNG graphic, not an interactive SVG diagram. Each format has its strengths & weaknesses; SankeyMATIC will be able to produce output in both formats later in 2014.

One interesting oddity about this diagram - when you enter all the original inputs (shown at right) into SankeyMATIC, several flows are called out as imbalanced:

The Flow Cross-Checker found some Imbalances:

"Bio-conversion": Amount IN (388.924 TWh) ≠ OUT (388.925 TWh). Δ = -0.001 TWh

"Solid": Amount IN (447.480 TWh) ≠ OUT (447.479 TWh). Δ = +0.001 TWh

"Gas": Amount IN (204.096 TWh) ≠ OUT (204.097 TWh). Δ = -0.001 TWh

"District heating": Amount IN (79.329 TWh) ≠ OUT (79.328 TWh). Δ = +0.001 TWh

"Electricity grid": Amount IN (917.271 TWh) ≠ OUT (918.607 TWh). Δ = -1.336 TWh

"H2 conversion": Amount IN (27.140 TWh) ≠ OUT (27.139 TWh). Δ = +0.001 TWh

Diagram Total IN (2,840.703 TWh) ≠ Total OUT (2,842.038 TWh). Δ = -1.335 TWh

Regarding all the +/- 0.001 TWh differences: those are at the limit of the input data's precision and are easily considered rounding errors and not very important.

The more interesting line is the “Electricity grid” imbalance, which is noticeably larger.

I've put a little effort into trying to dig up the original data, but haven't been successful in pinning down what may be missing. My theory is that since these are all projections, it's possible there was a slight miscalculation in the original spreadsheet.

Whatever the source, the error is still quite small: 0.15% of the total size of the “Electricity grid” node. The fact that the IN amount is less than the OUT amount by 1.336 TWh is hardly even visible at this diagram size.


  • SankeyMATIC will tell you when there is an imbalance of any size in your diagram.

  • When the imbalance is greater than the limit of the input data's precision (0.001 here) and therefore potentially significant, the warning message will emphasize the amount to make it stand out from the other lines.

  • SankeyMATIC will render whatever it is able to, despite any imbalances.

See the Manual for more specific examples, or
return to the Gallery home page, or
go forth and try out a diagram of your own.