Tidy Tree vs Dendogram
This example animates the same hierarchical dataset through six layout transitions, comparing the tidy tree (d3.tree) and dendogram (d3.cluster) layouts in vertical, horizontal, and radial orientations. The tree keeps sibling nodes at equal depth, while the cluster aligns all leaf nodes at the same level. Using d3.v4 and SVG, the code applies d3.linkVertical, d3.linkHorizontal, and d3.linkRadial to morph paths, with cubic Bézier curves for cluster links. Data is a static nested JSON object rendered as circles and labels.
AI-generated descriptionThis bl.ock mostly just duplicates the cannonical d3.tree and d3.cluster bl.ocks by Mike Bostock. Intended to visualize differences in layout. It proceeds through transitions of:
- Vertical Tree
- Vertical Cluster
- Radial Tree
- Radial Cluster
- Horizontal Tree
- Horizontal Cluster
The difference between cluster and tree (dendogram and tidy tree respectively) is that the cluster puts all childless nodes (terminal nodes) at the same level, while the tree layout places all nodes with the same parent at the same level.