Skip to main content
100%

Force Directed With Symbols, d3v4

✓ Published0🌍 Public
Aandrew-reid
Last edited Mar 16, 2017
Created on Feb 9, 2017

This example shows a force-directed network graph of the co-occurrence of characters in Victor Hugo’s Les Misérables, rendered as SVG. Nodes are drawn as symbols (shapes) scaled by group, using d3.symbol() with a d3.scaleOrdinal over d3.symbols, while links are lines whose stroke width reflects connection weight. Node color encodes group membership via d3.schemeCategory20. The d3 v4 force simulation with charge, link, and centering forces drives the layout; nodes are draggable and reposition during the simulation, with a tick handler updating link endpoints and node transforms. Data is loaded from the classic miserables.json co-occurrence dataset.

AI-generated description

Slight modification of this block: https://bl.ocks.org/mbostock/4062045 by MBostock to include symbols

Based on the stack overflow question here: http://stackoverflow.com/a/42141785/7106086

Similar vizzes