Skip to content

Function: forceLayout() ​

ts
function forceLayout(graph, options?): LayoutResult;

The force layout as a GraphLayout: a simulation run for options.ticks ticks (or to rest, if a given alphaDecay gets there sooner), cleared of the last overlaps when collide is on, then centered on options.center (the origin by default). It is not centered along an axis where a node is pinned or a positional target is set: those coordinates mean what they say.

Parameters ​

ParameterType
graphLayoutGraph
optionsForceOptions

Returns ​

LayoutResult

Released under the MIT License.