layout

layout.rotate

rotate(axis: "x" | "y" | "z", angle: number, nodeIds?: string[]): Promise<void>

Rotate nodes around the given axis by angle degrees.

Recorded in history as "SetPositions" or "DragPositions". Emits "layout:start" and "layout:end".

axis"x" | "y" | "z"Axis of rotation: "x", "y", or "z".
anglenumberRotation angle in degrees.
nodeIdsstring[]Subset of nodes to rotate; defaults to all nodes.

Returns: Promise<void>

Example

await api.layout.rotate("y", 90);