Force-Directed Voronoi Graph
A force-directed graph of character co-occurrence in *Les Misérables* shows relationships between characters, with a Voronoi overlay partitioning the space around each node. The code uses `d3.forceSimulation` to position nodes and `d3.voronoi` to compute polygon cells that update on each tick. Nodes and links render as SVG circles and lines, with polygons filling areas by group color. Users can drag any polygon or circle to move its associated node. Data comes from the `miserables.json` file.
AI-generated descriptionThis is a fork of <a href='http://bl.ocks.org/mbostock/'>mbostock</a>'s block: <a href='http://bl.ocks.org/mbostock/4062045'>Force-Directed Graph</a> where I've added a voronoi overlay. This could have a practical use by not having to click directly on a node in order select it and drag it.
<br><br> From the original block:
This simple force-directed graph shows character co-occurence in Les Misérables. A physical simulation of charged particles and springs places related characters in closer proximity, while unrelated characters are farther apart. Layout algorithm inspired by Tim Dwyer and Thomas Jakobsen. Data based on character coappearence in Victor Hugo's Les Misérables, compiled by Donald Knuth.
Compare this display to a force layout with curved links, a force layout with fisheye distortion and a matrix diagram.
forked from <a href='http://bl.ocks.org/alexmacy/'>alexmacy</a>'s block: <a href='http://bl.ocks.org/alexmacy/15962e97f7a9ebacd55710bf277593d4'>Force-Directed Voronoi Graph</a>