Viewing a saved revision (read-only)
8BCduWAf2PJ7f-paf-rL0
Infinite Octopus Packing
An effectively unbounded procedural hierarchy, rendered with D3 and SVG.
- Every node generates six, nine, twelve, or fifteen children (three times the original branching factor), with random weights from a deterministic seed.
- Each parent is a stylized eight-armed octopus. Its children are packed inside its solid central disk using D3's circle pack, keeping their arms within the body and preventing overlap. The camera uses the same containment radius.
- Children fade in based on projected radius. Offscreen and tiny circles are culled; the layout cache and visible SVG node count are bounded.
- The camera rebases into a child when the viewport fits inside it, and returns to its parent when zooming or panning out. This avoids accumulating a huge global scale.
On load the camera automatically flies into the largest child at each level, using a damped velocity controller with capped steering and a maximum logarithmic zoom rate of 0.23 per second. The first pointer, touch, wheel or keyboard interaction with the SVG stops autopilot for the remainder of the session; reduced-motion preferences disable autopilot at startup. Drag to pan, pinch or scroll to zoom, double-click to zoom in, and click an octopus to highlight it. Keep zooming into octopuses to discover more levels. There is no configured tree depth limit. Zooming into empty space has a numerical guard; a single gesture also has a generous finite scale range that resets at gesture end. Six shared radial nebula gradients create bright cores, blue, violet, cyan and magenta midtones, and dark rims on a deep-space background. A gentle 28-second hue oscillation keeps the cosmic palette moving. The hue animation does not recompute the layout. Children orbit their parents together at alternating signed angular velocities by depth, with seeded speed variation at twice the previous angular velocity. Camera rebasing uses the same rotated coordinates, and autopilot tracks moving targets. Rotation continues after manual camera takeover; both rotation and hue animation respect reduced-motion preferences.