29. Link Nodes by Name
✓ Published0🌍 Public
深深度碎片
Last edited Aug 4, 2016
Created on Aug 4, 2016
Six colored nodes are linked by name rather than numeric index in this force-directed graph. The SVG renders circles and lines using d3.forceSimulation with d3.forceManyBody, d3.forceLink, and positional forces. Graph data from graph.json specifies node ids like "red" and "violet", and links reference those same ids as source and target. The simulation assigns coordinates, and the ticked function updates the circle centers and line endpoints accordingly.
AI-generated descriptionThis example shows how to link nodes in a force-directed graph using a named identifier rather than a numeric index.
forked from <a href='http://bl.ocks.org/mbostock/'>mbostock</a>'s block: <a href='http://bl.ocks.org/mbostock/533daf20348023dfdd76'>29. Link Nodes by Name</a>
gpl-3.0 Licensed