Force Directed Graph - Simple
This example shows a simple force-directed graph with a small dataset of character relationships from Les Misérables, rendered as SVG circles in D3 v5. Each node is a character, colored by group using `d3.scaleOrdinal` with `d3.schemePaired`, and hover text reveals the character’s id. The layout is driven by `d3.forceSimulation` with link, charge, and center forces, while nodes are draggable via `d3.drag`. The data is loaded from a CSV file using `d3.csv` with `d3.autoType`, and the code also builds a hierarchy from flat data using `d3.rollup` and `d3.hierarchy`, though links are not displayed.
AI-generated descriptionA simple FDG to fork VizHub. To help work out using flat data for hiearchies, uisng this tutorial http://dataviscourse.net/tutorials/lectures/lecture-d3-layouts/ Using flat data