🌍 Public
Viewing a saved revision (read-only)
9efad1c3ce04474fb2be74b14c2f98c5
D3 Partition Layouts
This example demonstrates a hierarchical partition layout, representing the tree data with nested rectangles that are sized according to the sum of their descendant values. The visualization uses the `d3.partition` layout on a `d3.hierarchy` computed from a static JavaScript object, drawing the resulting rectangles and text labels as SVG elements. The code relies on D3 v3’s `d3.select` and the `.join` operator to efficiently update the SVG canvas, with the root node’s sum calculated via `rootNode.sum`.
AI-generated description