Waterfall
GraphWaterfall
Running total as floating bars. First row is the start, last is the end, signed values in between.
Command
pnpm dlx shadcn@latest add <origin>/r/graph-waterfall.jsonMargin
First row starts the run. Negative values use the second hue. Last row is the total.
- Revenue48
- Refunds−6
- Hosting−4
- Profit38
Headcount
kind can be set by hand when the last row is not a total.
- Start12
- Hired+4
- Left−2
- Now14
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| title | string | — | Caption drawn on the top edge of the frame. |
| items | WaterfallItem[] | — | label, value, optional kind: start, in, out, or end. Kind is inferred if omitted. |
| ticks | number | 24 | Bar width in characters. |
| glyphs | "shade" | "ascii" | "hash" | "bar" | string[] | "shade" | Character set. shade is ·░▒▓█. ascii is .- =#@. Pass a preset or your own characters. |
| palette | "mono" | "duo" | "multi" | "mono" | mono is one accent plus muted. duo paints the second series with --graph-accent-2. multi cycles three accents. |
| corner | string | "+" | Character at each corner of the frame. |
| className | string | — | Passed to the outer frame. |