Force Dragging I
This interactive force-directed graph visualizes character co-appearances in *Les Misérables*. Users can drag any node, which fixes it to the pointer during the gesture while the simulation's target alpha is set to a non-zero value, "heating" the layout to emphasize the drag's effect. The graph uses `d3.forceSimulation` with link, many-body, and center forces, while `d3.drag` manages the drag interactions on SVG circles. Node and link positions update on each simulation tick, and the underlying data comes from `miserables.json`.
AI-generated descriptionThis 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. In addition, the simulation is temporarily “heated” during interaction by setting the target alpha to a non-zero value.
If desired, you could refine this technique by also fixing nodes on mouseover, and releasing them on mouseout. (However, if there’s an active drag gesture during mouseout, you wouldn’t want to release the node until the gesture finishes.)
Compare to the Canvas version.