🌍 Public
Viewing a saved revision (read-only)
b93028b372534183beddfc3fe49a26da
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