Hierarchy examples: Tree
✓ Published3🌍 Public
This example demonstrates a node-link diagram for a small hierarchical dataset, showing both the original parent-child relationships and two manually added cross-links between a mid-level node and its grandchildren. The tree layout is computed using `d3.tree()` in D3 v6, and the visualization is rendered as an SVG with separate groups for nodes and links. Nodes appear as circles with text labels, while links are drawn as curved Bézier paths using a custom `crossDiagonal` function, which computes control points to create gentle arcs between connected nodes. The data is sourced from a static JavaScript object.
AI-generated descriptionMIT Licensed