Skip to main content
100%

[SO 38995816] D3-Force updating parameters after initializing graph

✓ Published0🌍 Public
Aaltocumulus
Last edited Aug 17, 2016
Created on Aug 17, 2016

This interactive force-directed graph depicts character co-occurrence in Victor Hugo’s *Les Misérables*, using D3 v4’s `d3.forceSimulation` with link, charge, and centering forces. The novel feature is dynamic parameter updating: as the mouse moves over the SVG, the link distance is recalculated based on the cursor's distance from the center, and the simulation is restarted with an alpha of 1. This causes the graph to continuously re-layout, pulling characters closer or pushing them apart as the mouse moves. Nodes are draggable and colored by group, while link thickness encodes co-occurrence strength. The data, based on character co-appearances compiled by Donald Knuth, is rendered with SVG circles and lines.

AI-generated description

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/mbostock/'>mbostock</a>'s block: <a href='http://bl.ocks.org/mbostock/4062045'>Force-Directed Graph</a>

forked from <a href='http://bl.ocks.org/anonymous/'>anonymous</a>'s block: <a href='http://bl.ocks.org/anonymous/8266529adc755d479a5d0cf6cb1f34c4'>Force-Directed Graph</a>

gpl-3.0 Licensed

Similar vizzes