Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

D3 Partition Layouts

Public visualization

Viewing a saved revision (read-only)

9efad1c3ce04474fb2be74b14c2f98c5

D3 Partition Layouts

1 star3🌍 Public
SSubhendu Karmakar
Last edited Mar 13, 2024
Created on Mar 13, 2024
Forked from D3 Pack 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

D3 Hierarchies