Skip to content
PACKAGES

reachable()

Traverse reachable nodes in a describe snapshot.

import { reachable } from "@graphrefly/ts/graph";
function reachable(
snapshot: DescribeSnapshot,
from: string,
direction: ReachableDirection,
options: ReachableOptions = {},
): readonly string[] | ReachableResult
ParameterTypeDescription
snapshotDescribeSnapshotDescribe snapshot to traverse.
fromstringStarting node id.
directionReachableDirectionDirection to follow when both is not set.
optionsReachableOptionsOptional depth and detail controls.

Reachable node ids, or a detailed result when withDetail is true.

reachable(snapshot, "root", "downstream");

packages/ts/src/graph/diagnostics.ts