Skip to main content
100%

D3 v5 Circle Packing from Observable

✓ Published3🌍 Public
Ttasqon
Last edited Feb 12, 2019
Created on Feb 5, 2019

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 description

Mike Bostock's Circle-Packing example

<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

MIT Licensed

Similar vizzes