All effects
Parameter playground

Drag a slider: the demo replays itself so the difference is visible, and the matching number inside the prompt is rewritten. Copy it and you take a prompt tuned to your taste.

Bubbles 6 个 Bubbles add or drop instantly: 4 spread out, 8 start crowding
Label threshold 14px Bubbles redraw instantly: lower shows labels on tiny bubbles, higher keeps them on big ones only
Charts

Interactive Bubble Chart

Circle size encodes volume; tap a bubble to enlarge and center it while the others slide out of the way.

AI Prompt
Make a bubble chart (6 content bubbles, labels above 14px radius): one circle per category with size representing volume; tapping a bubble smoothly enlarges it and moves it to the canvas center while the other bubbles are pushed away with distance-based avoidance offsets. SVG/CSS plus vanilla JS.

How it works

The bubble chart's encoding is simple: one circle per category, radius mapping magnitude, positioned by category or by two metrics. The tap interaction chains three motions: the chosen bubble scales up (capped near 1.7x) and travels to the canvas center; every other bubble computes an avoidance offset by distance from the mover - close ones pushed far, distant ones barely - iterated two or three rounds until nothing overlaps; all of it transitions over 0.4 seconds on a spring curve, like a bead pressed into water shoving its neighbors aside.

The structural key: put translation on the g element's transform and scaling on the circle with transform-box: fill-box so the scale anchors at the bubble's own center. The two layers cascade without fighting each other. The avoidance pass is a tiny O(n squared) relaxation - trivial for a dozen bubbles, still sub-millisecond for dozens.

How to use this prompt

For compositions with many categories and wild value spreads: content types, traffic channels, inventory. Provide names, values, and an optional second dimension; the AI builds radius mapping and the avoidance solver. When small bubbles cannot fit their labels, instruct: bubbles under 14px radius place their label below the circle.

Tips for better results

Map radius to area, not value - r proportional to the square root of v - or big numbers visually dwarf reality. Tapping the enlarged bubble must restore the layout; both states need a clean exit. Keep all bubbles one hue at varied lightness and give the centered one an outline for emphasis. Fade pushed-aside bubbles slightly with distance for instant depth. And honor prefers-reduced-motion: jump straight to the final state, skipping the push animation entirely.

Keep exploring