Install
@graphysdk/react and nothing else. Register the plugin once with createGraphyKit, which adds kit.geom.waterfall() and binds kit.GraphProvider to the same plugin:
One bar per change
Pass one row per bar, in the order the total runs. Map the category tox and the change to y, and map measure to a column saying which rows are totals:
domain that reorders the categories moves the bars but not the total, so the connectors then skip across bars.
Totals
measure reads each row as one of three kinds, the names Plotly uses:
Without
measure, every row is a step. Any other value is an error. Use 'absolute' for an opening balance, and 'total' for each subtotal and the closing figure:
Running totals already in the data
When the data already holds each bar’s running total before and after, as a finance tool exports a bridge, set the layer’s stat toidentity and map start and end instead of y. measure still marks the totals, which colour apart from the steps:
identity, a missing start or end is an error. Under the default stat, mapping either is an error too, since the stat computes them from y.
Horizontal
Addkit.coord.flip(). The categories move to the vertical axis and the bars run across.
Bar width and connectors
width sets how much of its band each bar spans, as a fraction from just above 0 up to 1. It defaults to 0.8, which leaves a gap for the connector; at 1 neighbouring bars touch. A width above 1 is clamped to the full band, and one at or below 0 falls back to the default; the compiler warns in both cases.
connector sets how the running total is carried from each bar to the next: 'spanning' (the default) runs the line across both bars, along their edges, and 'between' runs it across the gap only. To hide connectors, style them: kit.style.geom.waterfall.connector({ alpha: 0 }) hides every one, and a where hides only those leaving the bars it picks. An unknown value falls back to 'spanning' with a warning.
Styling
The bars are the observations, and each kind and the connectors have a builder of their own. A bar’s colour says what the step did, so a chart-widestyle.geom() does not recolour it:
where can pick connectors out by that bar’s values.
Colour through a scale
To colour the kinds through the colour scale, with a legend, mapcolor to waterfallKind. A mapped colour beats the kind builders’ defaults entries; an overrides entry still beats it. The connectors keep their own colour.
The running-total variables
The geom writes four variables you can name in ahighlight or an entry’s where:
Under
stat: 'identity' your own start and end columns hold the running totals, so the geom writes only waterfallKind and waterfallValue. y keeps the values you passed. A pinned number or a difference arrow reads waterfallValue. An absolute bar is a 'total' kind; highlight on your measure column to pick it out.
Hover and highlight
Hovering anywhere in a category’s band emphasises its bar, and the tooltip lists its value and the running total it lands on. A highlight raises each matched bar. The connectors stay with the dimmed layer:Not yet supported
- The editor’s chart-type picker and the chart agent. In editable mode the waterfall renders, hovers, selects and takes annotations on each bar’s running total, but it is authored in code.
- Dodged groups. Each group runs its own total, but groups on the same category overlap rather than sitting side by side.
- Data labels.
dataLabelsprints nothing on a bar yet.

