Fork of Fork of D3 Starter
✓ Published1🌍 Public
This example shows a hierarchical tree diagram of food items, with a red root node ("Food"), orange category nodes for fruits, vegetables, and grains, and green leaf nodes for individual items. Built with D3 v7, the code uses `d3.tree()` and `d3.hierarchy()` to compute the layout, then renders SVG lines for links and circles with labels for nodes. The diagram is hardcoded with sample data, and node colors are assigned via a custom function based on the `type` field.
AI-generated descriptionMIT Licensed