🌍 Public
Viewing a saved revision (read-only)
f43852466da246b7aee7bb4f19dde47d
Collapsible Tree Hierarchy Reformatted
This example presents an interactive collapsible tree visualization built with React and D3.js v6. Clicking a node re-roots the hierarchy to that node, toggling its children open or closed while animating transitions between states. The SVG rendering uses `d3.tree`, `d3.hierarchy`, and `transition.attrTween` to smoothly update node positions and link paths over 250-millisecond durations. A pop-up div displays the clicked node’s ID and name, positioned dynamically within the viewport.
AI-generated descriptionA bare minimum HTML page demonstrating use of CSS and JavaScript.
See also React Starter.