io.import
import(snapshot: GraphSnapshot): voidRestore 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".
snapshot | GraphSnapshot | A snapshot previously produced by export (version "1.0"). |
Returns: void
Example
const raw = localStorage.getItem("graph");
if (raw) api.io.import(JSON.parse(raw));