Skip to main content
100%

Navigate and Zoom around graph

✓ Published0🌍 Public
FFrissAnalytics
Last edited Sep 3, 2018
Created on Aug 25, 2018

This example demonstrates an interactive graph visualization that users can navigate by panning across the background, zooming with the mousewheel, and dragging individual nodes. A force-directed layout, powered by `d3.layout.force`, positions and animates the nodes and links, with SVG rendering for all elements. Middle-clicking on the background adds new nodes at the cursor’s location, while buttons freeze, thaw, or fit the entire graph to the viewport. The zoom behavior uses `d3.behavior.zoom`, and the fit function computes the graph’s bounding box via `getBBox` to adjust the view transform.

AI-generated description

See SO answer.

You can pan (click background), zoom (mousewheel), drag nodes around. Middle click to add more nodes (at mouse).

forked from <a href='http://bl.ocks.org/TWiStErRob/'>TWiStErRob</a>'s block: <a href='http://bl.ocks.org/TWiStErRob/b1c62730e01fe33baa2dea0d0aa29359'>Zoom to fit</a>

mit Licensed

Similar vizzes