Untitled
✓ Published0🌍 Public
This example shows a collapsible tree diagram of a small hierarchical dataset with four labeled nodes. Users can click nodes to expand or collapse their children, triggering smooth animated transitions of the SVG links and circles. The code uses `d3.hierarchy`, `d3.tree`, and `d3.selectAll` with transition methods to update node positions and draw curved diagonal paths. Node and link styling is applied via CSS classes, with collapsed nodes rendered in lightsteelblue.
AI-generated descriptionAn example showing the capabilities of VizHub:
- Loads D3 via UNPKG.
- Demonstrates use of
importfrom"d3". - Demonstrates use of
importfrom local ES6 modules.
MIT Licensed