Number of edges.
Number of nodes.
Add an edge with Qualified Edge metadata (D1).
Uses input.key as the edge ID when given (a stable id the host
owns, which snapshots and exports then carry unchanged); otherwise
auto-generates one for multi-edge support. Graphology's generator
skips ids already present, so a restored keyed id can never
collide with a later generated one.
the edge ID
Remove all nodes, edges and derivation stamps.
Drop the stamp for one property. The value stays; it is now a source value as far as every reader is concerned.
Iterate all edges.
Iterate all node IDs.
StaticfromDeserialize from a JSON object produced by toJSON(). Edge ids are restored as keys, so a snapshot round-trip keeps every edge id (host-supplied or generated); before issue #31 the restore regenerated them, and an undo step silently renamed every edge.
Reads versions 1 (no version field, or version: 1) and 2
(derivations); any other version throws UnsupportedVersionError
and a stamp naming a node the document does not contain throws
MalformedDocumentError, the throwing convention of
model/document-errors.ts (a snapshot has no useful partial
reading).
The stamp for a derived property, or undefined when the value is a source value (never derived, or overwritten since).
Get the source and target of an edge.
Get edges between two specific nodes (multi-edge support).
Get neighbor node IDs at depth 1.
Retrieve node attributes by ID. Returns undefined if not found.
Get all edges incident to a node.
Get all node IDs as an array.
Get the current property-key registry (readonly snapshot).
Check whether an edge exists.
Check whether a node exists.
Every stamp, or the stamps of one node. Insertion order.
OptionalnodeId: stringSubscribe to a UGM event. Returns an unsubscribe function.
Remove an edge by ID.
Remove a node and all its incident edges.
Record that property on nodeId currently holds a DERIVED value
written by stamp.definitionId. Replaces any earlier stamp for the
pair. The value itself is written through updateNodeProperties
first (which clears the old stamp), then stamped.
Serialize to a JSON-compatible object.
Update Qualified Edge metadata. Merges with existing.
Update properties on an existing edge. Merges with existing.
Update properties on an existing node. Merges with existing.
This is a SOURCE write as far as the derivation registry is
concerned: every key written here loses its stamp, since whatever
value is there afterwards was not produced by the stamped
definition. DerivedPropertyEngine writes through this method too
and re-stamps immediately after, which is the only ordering that
keeps the registry honest without a second, privileged write path.
@g3-toolkit/core public API.
Framework-agnostic (D6): zero React, zero Zustand, zero Cytoscape imports.
The boundary here is enforced two ways: (1) physical separation (packages/core/src/ cannot relatively-import from packages/react/src/), and (2) the module-boundary test in test/module-boundary.test.ts which dynamically imports every entry below and asserts none of them pull in React.