layout

layout.explode

explode(nodeIds?: string[], center: object): Promise<void>

Explosion entrance — animate nodes from a center point to their current positions. Uses the same LayoutTween system as geometric layouts.

Saves each node's current position as the target, snaps all to center, then tweens center → target over tweenDuration ms (set via setTweenDuration).

nodeIdsstring[]Node IDs to animate. If omitted, animates all nodes.
centerobjectCenter point to explode from. Default: { x: 0, y: 0, z: 0 }.

Returns: Promise<void>

Example

const ids = await api.nodes.add(nodes);
api.layout.setTweenDuration(800);
await api.layout.explode(ids);