Skip to content

simulateForce

simulateForce(nodes, links, opts): void

Defined in: perf/layout/force.ts:51

Run a deterministic spring/charge simulation in place.

The function mutates nodes[i].x/y and resets vx/vy to 0. Total work is O(iterations × (n² + links)). Stable for n up to ~300 in real-time UI.

Parameters

nodes

ForceNode[]

ForceLink[]

opts

ForceOptions

Returns

void