nodes

A node is the fundamental entity in a graph. Every node carries three fields: a unique string id, a category string that determines its visual type and schema membership, and a properties map of arbitrary key-value pairs (strings, numbers, and booleans). Nodes are stored in the engine's GraphStore and are the primary targets for layout, styling, and interaction.

The CRUD lifecycle follows a straightforward pattern: nodes.add to insert one or more nodes, nodes.update or nodes.updateBatch to merge new property values onto existing nodes, and nodes.remove to delete by id or selector. nodes.clear removes every node at once. All write operations are recorded in the undo/redo history and emit events on the shared event bus.

Read operations — nodes.get, nodes.getAll, nodes.count, nodes.has, and nodes.isVisible — are synchronous and do not touch history. For filtered reads, nodes.where returns a chainable NodeQuery builder that lets you filter by category, properties, or a custom predicate and then call .toArray() or chain mutations directly.

Nodes are referenced by edges via their id: every edge has a source and target field that must match existing node ids. Removing a node does not automatically remove its incident edges; call api.edges.remove() or use the where query on edges first if you need clean teardown.

Beyond CRUD, the namespace exposes three orthogonal subsystems:

Methods