Skip to content

Interface: LayoutSimulation ​

A layout that settles over time (force): the trace runs it to rest in calc, or steps it frame by frame for simulate: true and while a node is dragged.

Properties ​

PropertyModifierTypeDescription
alphareadonlynumberHow far from rest: starts at 1 and cools toward 0.
xreadonlyFloat64ArrayCurrent positions; the arrays are updated in place by tick.
yreadonlyFloat64Array-
z?readonlyFloat64Array<ArrayBufferLike>-

Methods ​

pin() ​

ts
pin(
   i,
   x,
   y,
   z?
): void;

Hold node i at a position (a drag); NaN for a coordinate frees it along that axis.

Parameters ​

ParameterType
inumber
xnumber
ynumber
z?number

Returns ​

void


reheat() ​

ts
reheat(alpha?): void;

Warm the layout up again (a drag, new data): alpha is set to at least alpha (default 0.3).

Parameters ​

ParameterType
alpha?number

Returns ​

void


tick() ​

ts
tick(steps?): boolean;

Run up to steps iterations (default 1). false once the layout is at rest.

Parameters ​

ParameterType
steps?number

Returns ​

boolean


unpin() ​

ts
unpin(i): void;

Release node i.

Parameters ​

ParameterType
inumber

Returns ​

void

Released under the MIT License.