# Waterfall

> Use a waterfall to show how a starting total becomes an ending total through a series of gains and losses.

- Data type: Values per item (`compare`)
- Free (MIT): install with `npx chartreuse add waterfall`, or registry item `/r/waterfall.json`
- Example: **Asia and Africa added nearly nine in ten of the world's 800 million new people since 2013** (World population, 2013 to 2023, and the change in each UN continent, people)
- How to read it: Start at the 2013 total on the left; each green block is one continent's growth, stacked until they reach the 2023 total on the right.
- Phone: Adapts to mobile (Draws its own phone layout below 520px) · Video formats: 16:9 (best 16:9)

## Use it when
- a total changes because of several parts that add or subtract
- you want to show which parts drove the change
- 3 to 12 steps between a start and an end

## Avoid it when
- the parts do not add up to the change
- the order of steps implies a sequence that did not happen
- the shares of a total matter more than its change (use a treemap or stacked bar)
- more than 12 parts (the smallest changes fold into one Other step)

## Fields (data.json)
- `region` (category): one part (a UN continent in the example); an optional row named as hints.total (World) gives the start and end totals, else the parts are summed
- `y2013` (number, unit "people", format count): population in 2013, people
- `y2023` (number, unit "people", format count): population in 2023, people

Units are the example's: with your own data, set each number field's `unit` and `format` (percent, count, decimal, currency, compact) in the meta you pass to mount, or `chartreuse render --unit field=text --format field=count`. Scales and labels follow your data.

## Interactions, motion, sound
- hover or tap a block to read its change and share of the world's growth
- Play builds the waterfall one step at a time
- Motion: The blocks drop in one after another and settle, like bricks stacking from the 2013 total to the 2023 total.
- Sound: A chime for the final total; a pop on hover. Quiet while it draws and between steps; mute it from its card. (sound is off until the viewer turns it on)

## Example spec
```json
{
  "chart": "waterfall",
  "title": "Asia and Africa added nearly nine in ten of the world's 800 million new people since 2013",
  "subtitle": "World population, 2013 to 2023, and the change in each UN continent, people",
  "data": "/charts/waterfall.data.json"
}
```

## Source
Population (UN World Population Prospects 2024), Our World in Data (CC BY 4.0), retrieved 2026-12-01: https://ourworldindata.org/grapher/population

Note: The vertical axis starts at 7 billion so the steps are visible; the zig-zag on the two totals marks the cut.

Live: /charts/waterfall · Manifest: /charts/waterfall.json · Tags: waterfall, bridge chart, build-up, contribution, population, continents
