🌍 Public
Viewing a saved revision (read-only)
60d43564f2584fc6a173cf45c1f3c3b5
D3 Starter
This example demonstrates three different layout methods for hierarchical music data—a labeled tree layout, an interactive force-directed graph, and a subtree view—all rendered as SVG. The data is read from a CSV file containing record labels, artists, and albums, converted into a hierarchy. The code uses D3 v7’s `tree`, `hierarchy`, `linkHorizontal`, and `forceSimulation` APIs to construct the layouts. The force-directed version includes dragging interactions via `drag`, allowing users to reposition nodes while the simulation updates positions on each tick.
AI-generated descriptionA demonstration of how to start using D3 version 6.