withBlueprintProvenance()
Attach caller-supplied provenance data to a blueprint.
Import
Section titled “Import”import { withBlueprintProvenance } from "@graphrefly/ts/graph";Signature
Section titled “Signature”function withBlueprintProvenance( blueprint: GraphBlueprint, provenance: GraphBlueprintProvenance,): GraphBlueprintParameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
blueprint | GraphBlueprint | Blueprint to augment. |
provenance | GraphBlueprintProvenance | Strict JSON provenance payload. |
Returns
Section titled “Returns”The blueprint with normalized provenance attached.
Example
Section titled “Example”import { GRAPH_BLUEPRINT_VERSION, normalizeTopology, withBlueprintProvenance,} from "@graphrefly/ts/graph";
const blueprint = { version: GRAPH_BLUEPRINT_VERSION, topology: normalizeTopology({ nodes: [], edges: [] }),};withBlueprintProvenance(blueprint, { source: "snapshot" });Source
Section titled “Source”packages/ts/src/graph/blueprint.ts