Skip to main content
100%

Static Force Layout

✓ Published0🌍 Public
FFrissAnalytics
Last edited Sep 30, 2018
Created on May 22, 2017

A static force-directed graph layout renders 100 linked nodes as circles and lines in SVG, computed with d3.forceSimulation, d3.forceManyBody, d3.forceLink, d3.forceX, and d3.forceY. The simulation is stopped and looped through a fixed number of ticks before drawing the final positions, avoiding incremental updates. A brief loading text appears while the layout computes asynchronously via d3.timeout.

AI-generated description

This demonstrates how to produce a static force-directed graph layout with d3-force. Rather than updating the graph with each tick, we run the graph a fixed number of times, and then display it once. To avoid freezing the user interface, it may be desirable to compute the force-directed layout in a web worker.

forked from <a href='http://bl.ocks.org/mbostock/'>mbostock</a>'s block: <a href='http://bl.ocks.org/mbostock/1667139'>Static Force Layout</a>

gpl-3.0 Licensed

Similar vizzes