Skip to main content
Public

Share visualization

Loading preview…

Untitled Visualization

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Viewing a saved revision (read-only)

KArABDcUhGKXitXO3Ez-N

Untitled Visualization

0 stars0
CCurran Kelleher
Last edited Nov 27, 2026
Created on Nov 27, 2026
View stargazers

Binary Tree Circle Packing

A recursive binary tree visualized with D3 circle packing inside a responsive React component.

  • App.jsx generates a tree with three levels below its root and two children per internal node.
  • viz.js is the D3 rendering entry point.
  • renderCircles.js computes a D3 hierarchy and pack layout, then renders nested SVG circles.
  • useContainerDimensions.js tracks the available space.

Change the depth or branching arguments to generateTree in App.jsx to explore other tree structures. Each leaf receives a random weight between 1 and 10 when the tree is generated. D3 packs the leaves proportionally by area, with enclosing circles sized by the layout. Weights stay fixed during panning, zooming, selection, and resizing. Click a circle to highlight its outline. Drag to pan, scroll or pinch to zoom, and double-click to zoom in. Zoom ranges from 0.5× to 32× and is preserved when selecting a circle.