io

io.import

import(snapshot: GraphSnapshot): void

Restore graph state from a GraphSnapshot.

Applies node/edge data, positions, visual overrides, selection, and hidden elements from snapshot. The operation is routed through ImportSnapshotCommand so it is recorded in history and can be undone.

Recorded in history as "ImportSnapshot".

snapshotGraphSnapshotA snapshot previously produced by export (version "1.0").

Returns: void

Example

const raw = localStorage.getItem("graph");
if (raw) api.io.import(JSON.parse(raw));