layout

layout.ego

ego(rootNodeIds?: string[], options?: EgoLayoutOptions): Promise<void>

Apply an ego-network (radial tree) layout rooted at the given nodes.

The full graph context (all nodes and edges) is built so the algorithm can BFS outward from the roots. Only the root ids are passed as starting points; neighbors are discovered via all edges in the store.

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

rootNodeIdsstring[]Ids of the ego-root nodes; defaults to all nodes when omitted.
optionsEgoLayoutOptionsRing spacing, radial angle, and other ego parameters.

Returns: Promise<void>

Example

await api.layout.ego(["s1"]);