normalizeTopology()
Normalize a graph topology into its canonical blueprint shape.
Import
Section titled “Import”import { normalizeTopology } from "@graphrefly/ts/graph";Signature
Section titled “Signature”function normalizeTopology(snapshot: GraphTopologySnapshot | NormalizedGraphTopologySnapshot): NormalizedGraphTopologySnapshotParameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
snapshot | GraphTopologySnapshot | NormalizedGraphTopologySnapshot | Graph topology snapshot or already-normalized topology. |
Returns
Section titled “Returns”A normalized topology with derived edges and sorted nodes.
Example
Section titled “Example”import { normalizeTopology } from "@graphrefly/ts/graph";
const normalized = normalizeTopology({ nodes: [{ id: "source", factory: "state", deps: [] }], edges: [],});Source
Section titled “Source”packages/ts/src/graph/blueprint.ts