canonicalTopologyJson()
Serialize a topology to the canonical blueprint JSON string.
Import
Section titled “Import”import { canonicalTopologyJson } from "@graphrefly/ts/graph";Signature
Section titled “Signature”function canonicalTopologyJson(snapshot: GraphTopologySnapshot | NormalizedGraphTopologySnapshot): stringParameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
snapshot | GraphTopologySnapshot | NormalizedGraphTopologySnapshot | Graph topology snapshot or normalized topology. |
Returns
Section titled “Returns”A deterministic JSON string for the normalized topology.
Example
Section titled “Example”import { canonicalTopologyJson } from "@graphrefly/ts/graph";
canonicalTopologyJson({ nodes: [{ id: "source", factory: "state", deps: [] }], edges: [],});Source
Section titled “Source”packages/ts/src/graph/blueprint.ts