forever components

Charts & Flow

Bubble Pack

64 mint/teal/amber/coral circles settle under gravity with collision physics; size encodes value. Large bubbles pull toward center with a breathing pulse.

canvasheavy complexitymoderate motion

Open on the canvas to copy the code → Free account · 3 copies a day · membership goes unlimited

Live demo — the real component, running in a sandbox. One self-contained HTML file, zero dependencies. Open it on the canvas →
Worth keeping? Votes steer what gets built next — sign in to cast one, free to read

When to use it

Data visualization contexts needing a lively proportional chart — portfolio breakdowns, category distributions, or ambient dashboard backgrounds.

When not to

Contexts requiring labeled or interactive data points — bubbles have no text labels and no click/hover handlers. Avoid on low-end devices if many redraws are expected.

Working with an AI agent

Every component ships agent-ready metadata. An example instruction for this one:

Change bubble count to 80 by setting N=80, swap PAL array to blues/purples palette, and slow breathing animation by changing the 0.0012 multiplier to 0.0006. 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

  • bubble count (N=64)
  • color palette (PAL array)
  • gravity strength (k=0.0016*dt weight factor)
  • breathing speed (t*0.0012)
  • radius scale (scale = m * 0.052)
  • damping factor (0.86)
  • theme tokens (:root dark defaults + [data-theme=light] overrides)

Keep intact

  • typed-array particle store (px/py/vx/vy/pr/pv/tr)
  • visibilitychange pause/resume
  • reduced-motion static settle path
  • DPR-aware canvas sizing
  • theme hook (?theme= bootstrap + forever:theme message listener + theme tokens)

Known limitations

  • O(N^2) pairwise collision loop — keep N at or below 110 cap or perf degrades
  • No text labels on bubbles — not suitable as a standalone labeled chart
  • Background color hardcoded in both CSS and JS fillRect — must change both to retheme

bubble-chartcircle-packingphysicsgravitycanvasdata-vizgenerative

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.