Import from observable (was: circle pack example)
This example visualizes a hierarchical dataset as a circle packing diagram, where each leaf node’s area encodes its value and color encodes depth. It imports the flare dataset via Observable’s `require` API, then uses D3 v5’s `d3.pack` layout and `d3.hierarchy` to compute circle positions, with `d3.scaleSequential` and `d3.interpolateMagma` coloring circles by tree depth. The SVG rendering appends circles and clipped text labels for leaves, and tooltips show the full ancestor path and value via `d3.select` and `append("title")`. The code also uses Observable’s `DOM.uid` for unique IDs and `d3.format` for number display.
AI-generated descriptionBuilt with blockbuilder.org
forked from <a href='http://bl.ocks.org/bryangingechen/'>bryangingechen</a>'s block: <a href='http://bl.ocks.org/bryangingechen/ffd619bb5889d146fe6c5d581d3ea00e'>circle pack example</a>