Skip to main content
100%

Fork of D3 Pack Layouts

✓ Published0🌍 Public
RRustamova Malakkhanim
Last edited Mar 13, 2024
Created on Mar 13, 2024
Forked from D3 Pack Layouts

This example shows a hierarchical dataset with nested nodes (A1, B1, C1–C3, B2) displayed as a circle-packing layout, where each node’s bubble size reflects its numeric value. The code uses D3’s `d3.pack()` and `d3.hierarchy()` to compute the layout, with `rootNode.sum()` summing child values for sizing. An SVG canvas is created and sized to the container, and descendant nodes are selected for rendering. The visualization relies on D3 7.8.5 and the `index.js` module exports a `main` function that drives the layout generation and SVG setup.

AI-generated description

D3 Hierarchies

MIT Licensed

Similar vizzes