Skip to main content
100%

canvas + drag + zoom + fixed nodes

✓ Published0🌍 Public
FFrissAnalytics
Last edited Nov 1, 2018
Created on Nov 1, 2018

This example shows a force-directed network graph rendered on a canvas, where nodes settle into a fixed layout once the simulation ends. Users can drag individual nodes and zoom or pan the entire visualization with the mouse. The code uses D3 v4’s d3.forceSimulation with charge, link, and centering forces, and handles canvas rendering through the 2D context with transform scaling and translation. Node and edge data are loaded from an external JSON file, with pre-defined edge connections.

AI-generated description

Influenced mostly by http://bl.ocks.org/mbostock/d1f7b58631e71fbf9c568345ee04a60e

forked from <a href='http://bl.ocks.org/jodyphelan/'>jodyphelan</a>'s block: <a href='http://bl.ocks.org/jodyphelan/5dc989637045a0f48418101423378fbd'>Force layout on canvas with zoom/pan and drag</a>

forked from <a href='http://bl.ocks.org/FrissAnalytics/'>FrissAnalytics</a>'s block: <a href='http://bl.ocks.org/FrissAnalytics/e31cc912cc0c512ec06436087844b523'>Force layout on canvas with zoom/pan and drag</a>

mit Licensed

Similar vizzes