Tree Diagram
Source: Data Visualisation Catalogue - Tree Diagram
Why This Belongs In The Compiler Gallery
Tree diagrams verify the compiler can work from relational parent-child data instead of flat metric tables. The chart also exercises generated link paths, not only positioned point marks.
Data Contract
Each raw row is one hierarchy node.
| Field | Type | Purpose |
|---|---|---|
node | categorical | Stable node id. |
parent | categorical/null | Parent node id; null identifies the root. |
label | text | Visible node label. |
value | quantitative | Leaf metric used for aggregate hierarchy values. |
aggregateValue, depth, childCount | derived | Hierarchy normalization output. |
x, y, r | quantitative, derived | Node layout geometry. |
pathD | text, derived | Generated parent-child link path. |
Compiler Mapping
| Compiler part | Mapping |
|---|---|
| Data source | Raw tree-rows, normalized hierarchy, derived tree-nodes, and derived tree-links. |
| Transform | hierarchy normalizes parent-child rows; layout with treeNodes and treeLinks derives node/link geometry. |
| Scales | Ordinal depth color. |
| Layers | Direct path links, point nodes, and text labels. |
Faithfulness Notes
The first pass uses a tidy left-to-right tree with cubic link paths. It does not yet support radial trees, collapsible branches, or advanced node overlap/collision policies.