Collapsible Indented Tree
✓ Published0🌍 Public
Mmbostock
Last edited Mar 1, 2020
Created on Jul 19, 2011
This example shows a collapsible indented tree visualization of the flare.json dataset, where each node represents a class and its size. Clicking a node toggles the display of its children, with smooth transitions animating nodes and links between positions. The visualization uses D3 v4’s hierarchy layout to compute node positions, d3.linkHorizontal to draw curved links, and SVG rectangles and text for node rendering. Transitions are handled via the selection.transition method with a 400-millisecond duration, while node colors change based on collapsed or expanded states.
AI-generated descriptiongpl-3.0 Licensed