Skip to main content
100%

Collapsible Force Layout

✓ Published0🌍 Public
Mmbostock
Last edited Feb 9, 2016
Created on Jul 19, 2011

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 description

This 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.

gpl-3.0 Licensed

Similar vizzes