Skip to main content
100%

Exercise 4(c)

✓ Published0🌍 Public
Yyuva24
Last edited Jan 31, 2021
Created on Jan 31, 2021
Forked from HTML Starter

This example shows a circle-packing visualization of a hierarchical dataset, where the size of each circle represents the summed value of its leaf nodes. The code uses `d3.pack()` with a padding of 20 to create non-overlapping circles within a 300x300 area, rendering them as red, semi-transparent SVG circles with white strokes. Leaf nodes display their names as centered white text, while parent nodes remain unlabeled. The data is a hardcoded JSON object with nested children, and the layout is computed by calling `rootNode.sum()` and `packLayout(rootNode)`.

AI-generated description
MIT Licensed

Similar vizzes