Collapsible Tree Example
A collapsible tree diagram displays hierarchical data as a set of linked nodes, where each node’s children can be expanded or hidden by clicking, though the example code does not yet implement click interactions. The flat CSV data, containing parent-child relationships, is converted into a tree structure using a name-to-node map. The visualization is rendered as an SVG using D3.js version 3.5, with `d3.layout.tree` computing the layout, `d3.svg.diagonal` drawing curved links, and nodes represented by circles and text labels.
AI-generated descriptionThis is a simple d3.js tree diagram put together in response to a question on Stack Overflow
It is aimed at providing some exposure to some d3.js functions and should be taken in context with the text of the book which can be downloaded for free from Leanpub.