Collapsible Force Layout
This interactive visualization uses a collapsible force-directed layout to display a hierarchical dataset of software clusters. Orange leaf nodes represent individual items, while blue nodes indicate packages that can be expanded or collapsed by clicking. The underlying tree structure is flattened for the simulation, with links computed via `d3.layout.tree`. Node positions update on each tick of the `d3.layout.force` simulation, with SVG circles and text labels rendered dynamically based on the current node state.
AI-generated descriptionThis example demonstrates how to create a force layout of a hierarchy whose internal nodes are collapsible. Leaf nodes are shown in orange, while internal nodes (packages) are shown in blue. Clicking on an internal node (without dragging) causes that node to expand or collapse, toggling the visibility of its descendant nodes.