Vanilla and core API

Framework-neutral SnapLine classes, configuration, callbacks, and lifecycle.

Main classes

ClassResponsibility
NodeMirrorPosition, selection, resize, and connectors
ConnectorMirrorConnection rules, metadata, and gestures
LineMirrorConnection state and SVG geometry
RectSelectControllerBackground rectangle selection
GroupNodeMirrorResizable exclusive membership and recursive carry
PlacementController<T>Preview, validation, commit, and cancellation state

Core objects require an engine with collision support. Assign each committed element to its object, then call remeasureDomGeometry(). Destroy owned objects when their records are removed. Topology is always controlled: attach a graph owner with attachControlledGraph(engine, { onLineChangeRequest }), push your LineRecords through setCanonicalGraph, and apply each gesture’s atomic proposal to your records.

Query helpers

getNodes, getConnectors, getGroupNodes, and getSelectedNodes return engine-scoped snapshots; query(engine) exposes the read-only GraphQuery facade with collection snapshots (nodes() / connectors() / groups() / lines() — settled lines only, and the only public way to enumerate them), identity lookups (node(id) / connector(id) / line(id)), and diagnostics(). getParentGroup returns settled ownership.

Callbacks use event objects carrying the relevant component, metadata, pointer information, and final geometry. Configuration objects are not graph persistence.