Viewing a saved revision (read-only)
hxQLoRpMEnK_GfFDyeHA2
Binary Tree Circle Packing
A recursive binary tree visualized with D3 circle packing inside a responsive React component.
App.jsxgenerates a tree with three levels below its root and two children per internal node.viz.jsis the D3 rendering entry point.renderCircles.jscomputes a D3 hierarchy and pack layout, then renders nested SVG circles.useContainerDimensions.jstracks the available space.
Change the depth or branching arguments to generateTree in App.jsx to explore other tree structures. Each leaf has equal weight. Click a circle to highlight its outline.