Skip to main content
100%

strange dancing behaviour

✓ Published0🌍 Public
KKcnarf
Last edited Dec 3, 2018
Created on Oct 27, 2016

This example shows a moving chain of 120 colored points arranged in a circle, whose nodes link sequentially and appear to “dance” unpredictably as the simulation runs. The user can drag the first node with the mouse, which perturbs the whole chain. The code uses `d3.forceSimulation` with custom forces, including a “dance” force that pushes each node away from its predecessor, plus `d3.forceManyBody`, `d3.forceX`, `d3.forceY`, and `d3.forceCenter`. Rendering is done on a Canvas via `getContext("2d")`, drawing arcs for points and line segments for links. The data is generated procedurally from 360 degrees divided by a sample rate of 3.

AI-generated description

This block helps me to understand the noise-link behaviour that seems to emerge from the force layout. This behaviour originaly comes from <a href='http://bl.ocks.org/Fil/'>Fil</a>'s block: <a href='http://bl.ocks.org/Fil/41f4c6ea19859768a1b3d56cb2c23218'>Urquhart Force Mesh Dance</a>

Acknowledgments to:

  • <a href='https://d3js.org/'>D3.js</a> (v.4)
  • <a href='http://blockbuilder.org'>blockbuilder.org</a>
  • forked from <a href='http://bl.ocks.org/Fil/'>Fil</a>'s block: <a href='http://bl.ocks.org/Fil/41f4c6ea19859768a1b3d56cb2c23218'>Urquhart Force Mesh Dance</a>
gpl-3.0 Licensed

Similar vizzes