Charts & Flow
Sankey Flow
Three-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.
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
Data visualization contexts needing animated flow diagrams — traffic splits, funnel analysis, budget allocation, network routing dashboards.
When not to
Light-color UIs (background hardcoded dark navy). Contexts needing real data binding — values are synthetic constants in the A/B matrices.
Working with an AI agent
Every component ships agent-ready metadata. An example instruction for this one:
Change the flow data by editing matrix A to [[8,2,1],[1,7,2],[2,1,9]] and matrix B to [[5,4,1,1],[1,6,2,2],[1,1,5,5]], then update COL[0] to '#ff6b6b' for a warm accent. 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
- flow value matrices A and B
- color palette (COL array)
- stage reveal timing (t%9 period, /3.6 divisor)
- pulse opacity range (0.16 + 0.12 amplitude)
- node bar width (6px in fillRect)
- 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
- Flow data is hardcoded — no external data binding without refactor
- Background color hardcoded in BG and CSS — must change both to retheme
- Staged reveal resets on a 9s loop with no pause control
More Charts & Flow components
- 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.
- Bubble Pack64 mint/teal/amber/coral circles settle under gravity with collision physics; size encodes value. Large bubbles pull toward center with a breathing pulse.