Skip to content
PACKAGES

canonicalTopologyJson()

Serialize a topology to the canonical blueprint JSON string.

import { canonicalTopologyJson } from "@graphrefly/ts/graph";
function canonicalTopologyJson(snapshot: GraphTopologySnapshot | NormalizedGraphTopologySnapshot): string
ParameterTypeDescription
snapshotGraphTopologySnapshot | NormalizedGraphTopologySnapshotGraph topology snapshot or normalized topology.

A deterministic JSON string for the normalized topology.

import { canonicalTopologyJson } from "@graphrefly/ts/graph";
canonicalTopologyJson({
nodes: [{ id: "source", factory: "state", deps: [] }],
edges: [],
});

packages/ts/src/graph/blueprint.ts