{
  "id": "sankey-diagram",
  "title": "Sankey Diagram",
  "lang": "en",
  "source_lang": "en",
  "summary": "A Sankey diagram represents flows between processes or categories using bands whose widths are proportional to the quantities they carry.",
  "category": "mathematics",
  "subcategory": "probability-statistics",
  "type": "concept",
  "aliases": [
    "Sankey chart"
  ],
  "generated_at": "2026-11-04",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/sankey-diagram/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/sankey-diagram/",
      "json": "https://aiwiki.page/zh/sankey-diagram.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "A Sankey diagram is a type of data visualization in which the width of each connecting band is proportional to the quantity flowing between processes, categories, or locations. Bands can split, merge, or pass through successive stages, making the diagram useful for showing how a total is distributed and transformed. Originally associated with engineering and energy accounting, Sankey diagrams also represent material movements, financial transactions, and transitions between categories."
    },
    {
      "heading": "Structure and visual encoding",
      "text": "A Sankey diagram has two principal components:\n\n- Nodes, representing processes, categories, locations, or system boundaries.\n- Links, drawn as bands connecting nodes and representing quantities transferred between them.\n\nThe defining visual rule is proportional width. If a link carries a quantity \\(q\\), its width \\(w\\) is ideally\n\n\\[w=kq,\\]\n\nwhere \\(k\\) is a common scale factor for comparable flows within the diagram. A flow twice as large as another should therefore appear twice as wide. Width is measured across a band, perpendicular to its local direction; the band’s length and total area do not normally encode quantity.\n\nDirection is commonly indicated by a left-to-right or top-to-bottom arrangement, sometimes supplemented by arrows. Other arrangements can accommodate feedback and circular flows. Color may identify an origin, destination, material, or category, but its meaning depends on the legend rather than on a universal convention.\n\nUnlike a conventional flowchart, which primarily describes the order of operations or decisions, a Sankey diagram makes quantitative magnitude central to its design."
    },
    {
      "heading": "Mathematical representation and balance",
      "text": "A Sankey diagram can be modeled as a weighted directed graph. For a set of nodes \\(V\\), let \\(f_{ij}\\geq 0\\) denote the quantity flowing from node \\(i\\) to node \\(j\\). These quantities can be stored in a matrix \\(F=(f_{ij})\\).\n\nFor a node \\(i\\), total incoming and outgoing flows are\n\n\\[I_i=\\sum_j f_{ji}, \\qquad O_i=\\sum_j f_{ij}.\\]\n\nIn a balanced steady-state system, an internal node without external additions or withdrawals satisfies\n\n\\[I_i=O_i.\\]\n\nMore generally, a bookkeeping balance over a specified period can be written as\n\n\\[I_i+S_i-O_i-R_i=\\Delta X_i,\\]\n\nwhere \\(S_i\\) denotes additions not already represented by incoming links, \\(R_i\\) denotes withdrawals not represented by outgoing links, and \\(\\Delta X_i\\) is the change in the quantity stored at the node.\n\nThis balance connects many engineering Sankey diagrams to conservation laws. Its interpretation depends on what the bands measure:\n\n- In an energy balance, energy entering a system is allocated among useful outputs, transfers to the environment, and changes in stored energy.\n- In a material balance, inputs are allocated among products, waste streams, emissions, and inventory changes.\n- In a financial diagram, balance depends on the accounting definitions and may include borrowing, saving, or changes in assets.\n\nA Sankey diagram does not itself establish that a quantity is conserved. The data and accounting framework must justify any balance assumption. Nor must every diagram be balanced: unequal totals can represent accumulation, incomplete coverage, or an error requiring investigation.\n\nExample\n\nSuppose a process receives 100 units of energy and produces 35 units of useful work while releasing 65 units as waste heat. The input band has width proportional to 100, and the two output bands have widths proportional to 35 and 65.\n\nIf a downstream process uses only the 35 units of useful output, those units should not also be counted as a new external input when calculating the total entering the overall system. A diagram may display the same quantity at several successive stages without those appearances representing additional quantities."
    },
    {
      "heading": "Historical development",
      "text": "The diagram is named after Matthew Henry Phineas Riall Sankey, who published a prominent example in 1898 comparing the energy performance of steam engines. Its bands showed how supplied energy was divided among useful work and other outputs, making inefficiencies visually apparent.\n\nProportional-width flow graphics predate Sankey’s publication. Charles Joseph Minard’s nineteenth-century graphics are important predecessors. His 1869 depiction of Napoleon’s Russian campaign used a changing band width to represent the size of an army along its route. It combined geographic movement with quantitative loss rather than presenting an industrial energy balance.\n\nThe name “Sankey diagram” subsequently became associated with proportional-flow diagrams well beyond steam engineering. Modern implementations include both technical balance diagrams and more general displays of category-to-category transitions."
    },
    {
      "heading": "Principal applications",
      "text": "Energy and industrial systems\n\nSankey diagrams show how primary energy sources are converted into electricity, fuels, and useful services. They can reveal the relative scale of conversion losses and final uses across an electrical grid, industrial facility, or national energy system.\n\nIn thermodynamics, “lost energy” generally means energy no longer available for the intended purpose, not energy that has ceased to exist. Energy and exergy diagrams answer different questions: energy accounts track conserved quantity, whereas exergy analysis tracks the potential to perform useful work relative to a specified environment.\n\nMaterials and environmental accounting\n\nIn material flow analysis, Sankey diagrams represent extraction, processing, use, recycling, and disposal. They can show the movement of metals, biomass, water, or other materials through a defined system.\n\nThe accounting basis matters. A diagram of total material mass is not interchangeable with one tracking the mass of a particular chemical element. Likewise, a diagram showing water withdrawals requires different interpretation from one showing water consumption.\n\nEconomics and organizational reporting\n\nFinancial Sankey diagrams can allocate revenue among expenditure categories, show transfers between sectors, or trace a budget through organizational units. Such diagrams require explicit definitions of gross and net flows. A large gross transfer need not imply a large net contribution.\n\nCategory transitions\n\nSankey-style graphics can display movements between educational stages, employment categories, customer states, or other classifications. Their quantities are often counts of people or events rather than physical flows.\n\nA sequence of categories does not automatically indicate elapsed time. The stages may instead represent classifications, administrative steps, or successive aggregations."
    },
    {
      "heading": "Construction and layout",
      "text": "Preparing a Sankey diagram involves defining the system as well as drawing it:\n\n- Specify the quantity and unit. All widths compared on a common scale must refer to compatible quantities.\n- Define the boundary and period. Flows must cover a consistent system and observation interval.\n- Construct the links. Each link requires a source, destination, and nonnegative value.\n- Check balances and coverage. Differences may reflect storage, omitted flows, rounding, or inconsistent definitions.\n- Arrange and label the diagram. Node placement, band order, colors, and numerical labels determine readability.\n\nMany layouts place stages in columns and treat the network as a directed acyclic graph. This is a layout convenience, not a defining requirement: recycling and feedback can introduce cycles.\n\nLayout software often applies algorithms that reduce crossings or improve spacing. These are forms of constrained optimization, and different layouts can make the same data appear more or less complex without changing the quantities.\n\nOrdinary band widths cannot directly encode negative values. Signed data therefore require a stated convention, such as separating positive and negative contributions or reversing link direction when that matches the underlying meaning."
    },
    {
      "heading": "Related diagrams",
      "text": "An alluvial diagram emphasizes how groups or observations are distributed across successive categorical dimensions. It shares the proportional-band appearance of a Sankey diagram, but often preserves identifiable groups across multiple axes. Terminology overlaps in software and publishing.\n\nA chord diagram typically arranges categories around a circle and connects them with ribbons. It is useful for relationships among categories without requiring a staged process.\n\nA conventional network diagram emphasizes connectivity, while a Sankey diagram emphasizes the magnitude of connections. A line chart is generally better suited to showing the detailed evolution of a quantity over a continuous time axis."
    },
    {
      "heading": "Interpretation and limitations",
      "text": "Widths, not areas, represent values. Long or highly curved bands can occupy more visual space than short bands carrying the same quantity. Numerical labels help prevent area from being mistaken for magnitude.\n\nAggregation hides detail. A broad band may combine heterogeneous sources or destinations. A small band may be important despite carrying little of the measured quantity—for example, a low-mass stream may have substantial environmental significance.\n\nMerging can erase provenance. If several sources enter a shared node and then split into several outputs, the diagram does not necessarily reveal which original source supplied each destination. That conclusion requires additional data or an explicit allocation assumption.\n\nFlows are not necessarily causal evidence. A connection may record a transfer, sequence, or association. Its presence alone does not establish causation.\n\nUncertainty is often visually understated. Bands are usually drawn with precise boundaries even when the underlying estimates have substantial measurement uncertainty. Rounding, estimation, and incomplete records can also produce apparent imbalances.\n\nDense diagrams become difficult to read. Numerous crossings, small links, and crowded labels can obscure the main patterns. Aggregation and interactive filtering can reduce clutter, but may also hide relevant flows.\n\nMeaningful interpretation therefore depends on clear units, boundaries, stage definitions, and explanations of any normalization or balancing adjustments."
    }
  ],
  "links": [
    "data-visualization",
    "energy",
    "directed-graph",
    "matrix",
    "conservation-law",
    "heat",
    "electrical-grid",
    "thermodynamics",
    "directed-acyclic-graph",
    "algorithm",
    "mathematical-optimization",
    "causal-inference",
    "measurement-uncertainty"
  ],
  "sources": [],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}