Skip to main content
100%

D3.js v4 Force Directed Graph with Labels

✓ Published0🌍 Public
GGerardoFurtado
Last edited Apr 18, 2019
Created on Apr 18, 2019

This force-directed graph visualizes character co-occurrence in *Les Misérables*, adapted from Mike Bostock’s original with added permanent labels. Each character is represented by a circle colored by group via an ordinal scale, and a text label is placed beside it by grouping both elements inside a shared SVG `<g>` container. Node positions are computed with D3 v4’s force simulation, including link, charge, and centering forces, with drag behavior to reposition nodes. Edge thickness encodes co-occurrence strength, and labels update in place as the simulation runs, making the network easier to explore than the unlabeled original.

AI-generated description

A quick adaptation of Mike Bostock's force-directed graph showing character co-occurence in Les Misérables. In this version, the character names are displayed. This is accomplished by wrapping both circles and text svg components within a group svg component.

Compare to the original diagram by Mike Bostock.

forked from <a href='http://bl.ocks.org/heybignick/'>heybignick</a>'s block: <a href='http://bl.ocks.org/heybignick/3faf257bbbbc7743bb72310d03b86ee8'>D3.js v4 Force Directed Graph with Labels</a>

gpl-3.0 Licensed

Similar vizzes