reachable()
Traverse reachable nodes in a describe snapshot.
Import
Section titled “Import”import { reachable } from "@graphrefly/ts/graph";Signature
Section titled “Signature”function reachable( snapshot: DescribeSnapshot, from: string, direction: ReachableDirection, options: ReachableOptions = {},): readonly string[] | ReachableResultParameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
snapshot | DescribeSnapshot | Describe snapshot to traverse. |
from | string | Starting node id. |
direction | ReachableDirection | Direction to follow when both is not set. |
options | ReachableOptions | Optional depth and detail controls. |
Returns
Section titled “Returns”Reachable node ids, or a detailed result when withDetail is true.
Example
Section titled “Example”reachable(snapshot, "root", "downstream");Source
Section titled “Source”packages/ts/src/graph/diagnostics.ts