Skip to main content
100%

Neighborhood Pull

✓ Published0🌍 Public
ZZoeLeBlanc
Last edited Feb 19, 2018
Created on Feb 19, 2018

This example shows a force-directed graph of character co-occurrence in Les Misérables, where nodes represent characters and links represent their relationships. Built with React and D3 v4, the visualization renders as an SVG and supports dragging nodes to adjust the layout dynamically. Clicking a node selects it, while double-clicking highlights its immediate neighborhood—the selected node and all directly connected neighbors—which then respond to the drag gesture. When a drag starts, the targeted node is fixed to the pointer, and any previously selected neighborhood nodes are released; when the drag ends, the neighborhood selection is cleared.

AI-generated description

This example demonstrates applying d3-drag to a force-directed graph computed using d3-force. When the drag gesture starts, the targetted node is fixed to the pointer; it is released when the gesture ends.

Double-click to select a neighborhood, which will react to the dragged node.

forked from <a href='http://bl.ocks.org/mbostock/'>mbostock</a>'s block: <a href='http://bl.ocks.org/mbostock/2675ff61ea5e063ede2b5d63c08020c7'>Force Dragging I</a>

forked from <a href='http://bl.ocks.org/akollegger/'>akollegger</a>'s block: <a href='http://bl.ocks.org/akollegger/54c4be03e148c625217df1984e1c3908'>Force Dragging I</a>

forked from <a href='http://bl.ocks.org/akollegger/'>akollegger</a>'s block: <a href='http://bl.ocks.org/akollegger/f7fc55f6733cff158e97794002252c59'>Cold Force Dragging </a>

forked from <a href='http://bl.ocks.org/akollegger/'>akollegger</a>'s block: <a href='http://bl.ocks.org/akollegger/e399668d292ace1b1a249ef6c017b3cb'>Neighborhood Pull </a>

gpl-3.0 Licensed

Similar vizzes