Skip to main content
100%

Fork of Fork of D3 Starter

✓ Published1🌍 Public
Kkmuddana@gitam.in
Last edited Apr 12, 2026
Created on Apr 12, 2026
Forked from Fork of D3 Starter

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 description
MIT Licensed

Similar vizzes