🌍 Public
Viewing a saved revision (read-only)
47ce62936034403381c2e42dad888dd5
Q2
This example displays a hierarchical tree of food categories, from the root "Food" down to specific items like "Almonds" and "Broccoli." It uses D3 v7's `d3.stratify` and `d3.tree` layouts to compute node positions, with horizontal curved links drawn via `d3.linkHorizontal`. Nodes are rendered as SVG circles colored by depth, with labels positioned to the right for leaves and left for internal nodes. A legend at the top-left explains the color mapping for each hierarchy layer.
AI-generated description