{
  "id": "sankey",
  "name": "Sankey",
  "family": "flow",
  "tier": "free",
  "summary": "Use a Sankey to show how a total splits and merges across two or more stages, with each ribbon's width as its volume. Takes either the example's countries-by-source table or any process flow as { nodes?, links: [{ source, target, value }] }, with 2 to 5 stages found from the links.",
  "title": "Fossil fuels still made 59% of the world's electricity in 2024",
  "subtitle": "Electricity generation by country and source, terawatt-hours, 2024",
  "howToRead": "Ribbons run from each country to the sources it burns or harnesses, then on to fossil or low-carbon; width is terawatt-hours.",
  "useWhen": [
    "one total splits into parts and those parts regroup at a later stage",
    "the volumes matter as much as the routes",
    "there are 2 to 4 stages with up to about 12 nodes in each",
    "any process or funnel with drop-offs (a pipeline, a budget, a sign-up flow): pass { nodes?, links } and the stages come from the links"
  ],
  "avoidWhen": [
    "the flows loop back on themselves (use a chord or a network)",
    "you need exact comparisons between similar ribbons (use bars)",
    "there are dozens of tiny flows that turn into hair"
  ],
  "fields": [
    {
      "name": "year",
      "type": "year",
      "description": "the year of the figures"
    },
    {
      "name": "sources",
      "type": "category",
      "description": "the middle stage: six groups of generation sources, in ink order"
    },
    {
      "name": "lowCarbon",
      "type": "category",
      "description": "the sources counted as low-carbon in the last stage"
    },
    {
      "name": "countries[].country",
      "type": "place",
      "description": "the first stage: six largest generators and the rest of the world"
    },
    {
      "name": "countries[].<source>",
      "type": "number",
      "description": "terawatt-hours generated from that source in that country",
      "unit": "TWh",
      "format": "count"
    }
  ],
  "shapes": [
    {
      "when": [
        "links"
      ],
      "fields": [
        {
          "name": "links[].source",
          "type": "category",
          "description": "the node a flow leaves (a node id)"
        },
        {
          "name": "links[].target",
          "type": "category",
          "description": "the node it goes to; a node's column is its longest path from a start, 2 to 5 columns"
        },
        {
          "name": "links[].value",
          "type": "number",
          "sign": "non-negative",
          "description": "the size of the flow"
        },
        {
          "name": "nodes[].id",
          "type": "category",
          "description": "optional: the nodes in the order to stack them in each column",
          "optional": true
        },
        {
          "name": "nodes[].label",
          "type": "text",
          "description": "optional: the name to show (else the id)",
          "optional": true
        },
        {
          "name": "nodes[].stage",
          "type": "category",
          "description": "optional: the node's column, a number or a column name (names become the column heads; or set the hint stages, \"A; B; C\")",
          "optional": true
        }
      ]
    }
  ],
  "hints": {
    "heads": "Country; Source; Kind",
    "kinds": "Fossil fuels; Low-carbon"
  },
  "interactions": [
    "hover or tap a ribbon to read its terawatt-hours and share of the world",
    "hover a bar to light every ribbon through it"
  ],
  "motion": "The ribbons pour in from left to right when the chart comes into view; the bars of each stage appear as the flow reaches them.",
  "sound": "A pop pitched by source on hover. Quiet while it draws and between steps; mute it from its card.",
  "annotations": [
    {
      "type": "underline",
      "words": "59%",
      "in": "title"
    }
  ],
  "tags": [
    "flow",
    "energy",
    "electricity",
    "stages",
    "volume",
    "alluvial",
    "climate"
  ],
  "mobile": "adapts",
  "mobileNote": "Draws its own phone layout below 520px",
  "mobileChecked": "2026-12-02",
  "ratios": [
    "16:9"
  ],
  "bestRatio": "16:9",
  "source": {
    "title": "Energy dataset (electricity generation by source)",
    "publisher": "Our World in Data (Ember, Energy Institute Statistical Review of World Energy)",
    "url": "https://github.com/owid/energy-data",
    "license": "CC BY 4.0",
    "retrieved": "2026-12-01"
  },
  "note": "\"Bioenergy and other\" is OWID's other renewables including bioenergy; \"Rest of world\" is the world total minus the six countries shown."
}