Charts & Flow
Waterfall
Waterfall chart with staggered bar reveals and dashed connectors. Green bars for gains, pink for losses, with a scan dot tracing the running total.
canvasmedium complexitymoderate motion
Open on the canvas to copy the code → Free account · 3 copies a day · membership goes unlimited
Worth keeping?
Votes steer what gets built next — sign in to cast one, free to read
When to use it
Finance dashboards, earnings breakdowns, P&L summaries, or any demo showing incremental contribution to a total.
When not to
Contexts needing user interaction with chart data, or when more than ~8 bars are needed — bars shrink below readability on narrow viewports.
Working with an AI agent
Every component ships agent-ready metadata. An example instruction for this one:
Change the STEP data to a new P&L scenario: update label/value pairs in the STEP array, set UP to '#60a5fa' for blue gains, and slow the stride to 0.55. Theme: dark tokens live in :root, the light variant in :root[data-theme="light"]; ?theme=light or a {type:'forever:theme'} postMessage switches at runtime.
Safe to edit
- bar data (STEP array — labels, values, types)
- gain/loss colors (UP, DOWN variables)
- animation stride and perBar timing
- scan dot color (ACC variable)
- grid and axis opacity (GRID, AX)
- theme tokens (:root dark defaults + [data-theme=light] overrides)
Keep intact
- IIFE wrapper
- prefers-reduced-motion guard (reduce variable)
- visibilitychange stop/start
- DPR-aware canvas sizing
- theme hook (?theme= bootstrap + forever:theme message listener + theme tokens)
Known limitations
- Bar labels can overlap on narrow screens with many steps — no responsive label truncation
- Total bar value is implicitly computed from cumulative sum; hardcoding a different total requires updating size() logic
- No tooltip or hover interaction — values appear only as inline chips above bars
More Charts & Flow components
- Sankey FlowThree-stage Sankey diagram on dark canvas: bezier ribbons grow stage-by-stage from origins to hubs to outcomes, pulsing softly in opacity to show flow volume.
- Chord DiagramEight ring nodes with curved ribbons that swell and shrink as weights rebalance every ~3s. Additive blending creates glowing color overlaps.
- Treemap7 rounded cells partition the canvas via slice-dice treemap; cells lerp to new sizes every 2.6 s as synthetic values drift, with a subtle alpha pulse.
- CandlesticksGreen and red OHLC candles stream in from the right with smooth slide animation; newest candle grows from pivot. Dashed last-price marker traces horizontally.
- StreamgraphSix translucent stacked bands breathe around a central baseline via layered sines; a sweeping readout line tracks across with colored tick dots per band.
- Sparkline GridNine teal sparklines in a 3x3 grid scroll leftward every 140ms; orange/blue diamonds mark running max/min and a halo dot tracks the latest value.