camera.flyToNodes
flyToNodes(nodeIds: string[], options?: FlyToOptions): Promise<void>Animate the camera to frame a specific subset of nodes.
Computes the bounding box of the given nodes and moves cloudScene so
those nodes are centered in the viewport. Uses the same target formula as
the legacy engine's flyToPosition (graph2DControl.js):
target = cloudScene.position − localToWorld(center) + Vector3(0, 0, offset).
This correctly handles any current cloudScene rotation via localToWorld().
Returns immediately (resolves Promise<void>) if the interaction manager
or layout runtime are not yet bound, or if none of the given node ids have
known positions.
Not undoable. Does not emit any event.
nodeIds | string[] | Ids of the nodes to frame. |
options | FlyToOptions | Optional animation duration, scale, and z-offset overrides. |
Returns: Promise<void>
Example
await api.camera.flyToNodes(["s1", "s2"], { duration: 600 });