Skip to main content
100%

Collapsible tree diagram in v4

✓ Published0🌍 Public
663anp3ca
Last edited Oct 31, 2018
Created on Oct 31, 2018

This collapsible tree diagram visualizes hierarchical task data, where each node represents a task or aggregate with color-coded statuses (red for in-progress, green for complete). The visualization uses an interactive layout where any parent node can be clicked to collapse or expand the portion of the tree beneath it, with smooth animated transitions. The tree layout is rendered as an SVG using D3 v4, with nodes shown as circles colored by status and connected by curved links. The diagram dynamically resizes its height based on the number of visible nodes, and the example is built upon Mike Bostock's classic collapsible tree, updated for v4 compatibility.

AI-generated description

This is a d3.js tree diagram that incldes an interactive element as used as an example in the book D3 Tips and Tricks v4.x.

Any parent node can be clicked on to collapse the portion of the tree below it, on itself. Conversly, it can be clicked on again to regrow.

It is derived from the Mike Bostock Collapsible tree example and updated to use v4.

Kudos and thanks also go out to Soumya Ranjan for steering me in the fight direction for the diagonal solution.

forked from <a href='http://bl.ocks.org/d3noob/'>d3noob</a>'s block: <a href='http://bl.ocks.org/d3noob/43a860bc0024792f8803bba8ca0d5ecd'>Collapsible tree diagram in v4</a>

forked from <a href='http://bl.ocks.org/zanthrash/'>zanthrash</a>'s block: <a href='http://bl.ocks.org/zanthrash/fa49f572c97761ebee405bab6f151e5e'>Collapsible tree diagram in v4</a>

mit Licensed

Similar vizzes