algorithms

algorithms.connectedComponent

connectedComponent(options: CommonAlgorithmOptions & AlgorithmWriteOptions): Promise<NodeGroupResult>

Assign each node to its weakly connected component.

Dispatched to the background worker. Emits the standard algorithm lifecycle events. When writeTo is supplied group labels are written to node properties (recorded in history, undoable).

optionsCommonAlgorithmOptions & AlgorithmWriteOptionsCommonAlgorithmOptions merged with AlgorithmWriteOptions.

Returns: Promise<NodeGroupResult>

Example

await api.algorithms.connectedComponent({ writeTo: "component" });