Made with ApexNo. 06ApexSankey

Coal's river into American power plants peaked in 2007 at 20.8 quadrillion Btu and by 2025 had narrowed 62%, to 7.8.

Where the energy the United States consumed came from and where it went, each year from 1950 to 2025, in quadrillion British thermal units (quads): five fuels on the left, the sectors that used them on the right, all drawn to one scale. Coal is the near-black river. Step through to watch it swell and narrow.

Coal into U.S. power plants rose from 2.2 quadrillion Btu in 1950 to a peak of 20.8 in 2007, then fell, though not every year, to 7.0 in 2024, and was 7.8 in 2025, 62% below the peak. Since 2019 natural gas has carried more energy into power plants than coal.

Data
1950 to 2025, from the edition released 24 November 2026
Licence
Public domain (U.S. government work); EIA asks for an acknowledgment with the publication date
Made by
The ApexCharts team
Built with
ApexSankey

How it was made

The piece is one ApexSankey diagram with 76 frames, one for each year from 1950 to 2025. Five fuels sit on the left and the five sectors of the economy that used them on the right; each ribbon is one fuel going into one sector that year. Its four steps play the years between one stop and the next: 1950, the 2007 peak of coal into power plants, the 2024 low and 2025.

One scale for 75 years

A Sankey diagram normally fits each drawing to its box, so the largest column fills the height. For one year that is right. For a run of years it is wrong, and this was the first version:

The rejected version: 1950 and 2007 side by side, each fitted to the same height, so 33.5 quads in 1950 look as large as 98.8 in 2007

The ribbons carry 33.5 quads in 1950 and 98.8 in 2007, and the two drawings are the same size. Coal's 1950 ribbon into industry looks nearly as wide as its 2007 ribbon into power plants, which carried more than three times as much. Since ApexSankey 1.15.0, maxValue fixes the scale: the piece sets it to the largest yearly total in the data, so a quad is the same thickness in every frame, and a lighter year packs to the top and leaves the rest of the space empty. The empty space is part of the picture.

nodeOrder: 'input' keeps both columns in the order the nodes are listed, whatever the flows do. The order is chosen once: the fuels from those that have gone mostly to power plants since the 1960s (coal, nuclear) down to the one that goes mostly to vehicles (petroleum), and the sectors in the same order, with power plants at the top. The rivers the story is about, coal into power plants and petroleum into transportation, then run nearly straight. Every flow that carries energy in any year is in every frame, at 0 where it carries none, so no node ever loses its slot. Nuclear's flow is in the data from 1957 and grows out of its node, wide enough to see by about 1970.

Stepping through the years

The years are played by the timePlayback plugin, with its control bar off. The page drives it through the controller it returns, as Driving playback from the page describes: a step calls goTo() on the year it starts from and play(), and the onFrame callback writes the year and the two figures under it, and calls pause() when the step's year is reached.

const playback = ApexSankey.plugins.timePlayback({
  frames, // one { nodes, edges, label } per year
  interval: 130,
  controls: false,
  announce: false,
  onFrame: (i) => {
    showDial(i)
    if (target >= 0 && i >= target) playback.pause()
  },
})
chart.use(playback)

Each frame is an update(), so the ribbons spring from year to year. Moving back, or with reduced motion, a step goes straight to its year. The plugin's own announcement is off: it would read out a year every second and a half while a step plays, over the step's caption, which is the page's live region.

The particles are particleFlow with unitsPerParticle: 1, one particle for each quad a flow carries (one for every two on a phone, where the ribbons are short). They run all the time, so a button stops them with pauseParticles(); with reduced motion the library leaves them out and the button goes too.

Colour and labels

Each fuel is the colour of its material: coal near-black, a gas flame's blue, crude amber, violet for nuclear and green for renewables. Every ribbon is named by the label at its fuel, so no colour has to be decoded. The ribbons are solid in their fuel's colour, and the sectors are grey.

The node labels give each node's value to one decimal through nodeLabel.formatter, outside the columns, with "<0.1" for nuclear's first years so they never read as nothing. Labels on thin nodes sit just above them, so the column titles, which carry the unit, are HTML set above the diagram and lined up with each column of labels, where they can never meet a label. The tooltips and the spoken labels name the year on screen and spell out quadrillion Btu.

Every number is computed

The data at the top of the script is the 76 annual rows of the Monthly Energy Review's Tables 2.2 to 2.6, in trillion Btu as the tables print them. The peak, the low, the years coal rose after the peak, the year natural gas moved ahead, every percentage and the scale come from those rows, and so does the headline: the piece computes it and reports any difference from the text it shipped with, and the site's build checks this page's headline against the piece's.

Coal, gas, petroleum and biomass are counted by the heat in the fuel, nuclear by the heat its reactors produce, and hydro, wind, solar and geothermal by the electricity they generate, at 3,412 Btu per kilowatthour. EIA moved to that last method with the September 2023 edition and restated every year back to 1949, so the 75 years are on one basis, but a kilowatthour of nuclear power draws a ribbon about three times as wide as a kilowatthour of wind, and renewables look smaller here than in charts made before 2023. The footer says so, and says what else the ribbons leave out: the electricity power plants make, and the energy lost making it.

What is hand-written

The step buttons, the captions, the year and the two figures under it, the particle button, the column titles and the footer are ordinary HTML. The tooltips are custom templates, so their box is styled by the page's own CSS, and a focused node gets a vermilion ring that no fuel uses, so it shows on the coal node as well. The year's digits each sit in a cell of one width, so it ticks without moving.

The labels sit in the diagram's spacing, its margin, which the script measures from the widest label in the piece's own face. That margin is on every side, so the script hides the empty bands above and below with an overflow box, and sets the internal viewport to the diagram's width in pixels so labels keep their size. A new width builds the diagram again at its own size, on the year it was showing.

ApexSankey needs a licence key; the piece sets the site's, and the download leaves a place for yours.

Get the code

The piece is one HTML file with its data inside it, loading ApexSankey from a CDN. Save it and open it in a browser, or take it apart.

ApexSankey needs a licence key: add yours where the file marks the spot. Without one it shows a watermark.

Download us-energy.htmlOpen the piece on its own