Skip to content

@eightkk/vue-weave / core / restoreWeaveSnapshot

Function: restoreWeaveSnapshot() ​

restoreWeaveSnapshot(snapshot, registry?): RestoreWeaveSnapshotResult

Defined in: src/core/snapshot.ts:566

Turn a snapshot into live values: Maps and Sets, codec values decoded, registered layouts and column functions resolved. The snapshot is validated again, so a hand-built object is checked like parsed text. The result is all-or-nothing: on any error (an unknown codec, a missing required registration, an invalid reference) ok is false and no partial value is returned, so the current screen can stay as it is. Warnings come with a successful result. Does not mutate snapshot or registry.

Apply a graph in this order: accept nodes, edges, groups, positions, sizes and view.collapsedGroupIds, wait for the DOM update (nextTick), then set the camera from view.camera.

Parameters ​

snapshot ​

WeaveSnapshotV1

registry? ​

WeaveSnapshotRegistry = {}

Returns ​

RestoreWeaveSnapshotResult

Released under the MIT License.