io

io.diff

diff(a: GraphSnapshot, b: GraphSnapshot): SnapshotDiff

Compute the structural diff between two GraphSnapshot objects.

Compares node and edge IDs and property values; visual state (colors, sizes, positions) is not considered. Use this to detect what changed between an old and a new snapshot before deciding whether to import.

Static method — does not require an instance.

aGraphSnapshotThe baseline snapshot.
bGraphSnapshotThe target snapshot to compare against a.

Returns: SnapshotDiff

Example

const diff = IoApi.diff(snapshotA, snapshotB);
console.log("added nodes:", diff.nodesAdded);