D3 v5 Circle Packing from Observable
This example visualizes a hierarchical dataset from the Observable `@observablehq/flare` library using circle packing. It displays the data as nested circles, where each circle's area encodes a value and color encodes the depth in the hierarchy. The visualization is rendered as an SVG, using D3 v5's `d3.hierarchy` and `d3.pack` layout, with a sequential magma color scale via `d3.scaleSequential`. Hovering reveals a tooltip with the full path and value, generated through SVG `title` elements.
AI-generated descriptionMike Bostock's Circle-Packing example
- with D3 v5 (based on the changes in v5)
<br></br> Ported from this Observable notebook for this forum thread. Many thanks to Bryan Gingechen who answered my question about the necessary steps to get from an (Observable) JavaScript notebook to a vanilla JavaScript index.html. He presented his solution on blockbuilder.org