Reference
Primitives
| Primitive | Description |
|---|---|
| Card | Atomic unit of existence with text content and edges |
| Edge | Directional connection between two cards |
| Navigate | Move to a connected card along an edge |
| Edit | Modify the content of the current card |
Domain API
CardGraph
Y.js CRDT-backed card and edge store with change notifications.
addCard(text, position)— create a new cardgetCard(id)— retrieve a card by IDupdateCard(id, patch)— update text or positionremoveCard(id)— delete a card (cascades edges)addEdge(from, to, label?)— create a directional edgeremoveEdge(id)— delete an edgeedgesFrom(id)/edgesTo(id)— query edges by directionneighbors(id)— all adjacent cards (both directions)allCards()/allEdges()— list alltoJSON()/loadJSON(data)— serialize / deserializeonChange— callback fired on any mutation
Navigator
Tracks the current card and provides movement.
current— the card you're looking atexits— outgoing edges from the current cardreachable— cards reachable via exitsmoveTo(id)— follow an edge (throws if no edge exists)jumpTo(id)— move to any card (unconstrained, for canvas clicks)onNavigate— callback fired on movement
Editor
Thin mutation layer over CardGraph.
setText(id, text)— change a card's text contentsetPosition(id, position)— change a card's positiononEdit— callback fired on edits
Persistence & Multiplayer
All state lives in a Y.Doc (Y.js CRDT). Persistence and sync are handled automatically:
- y-indexeddb — local persistence to IndexedDB for offline support
- y-websocket — real-time sync via WebSocket at
/ws/:room - Y.UndoManager — per-client undo/redo (tracks cards and edges)
Open /room/<name> in multiple tabs or browsers to share a world.
Canvas Interactions
| Gesture | Action |
|---|---|
| Drag empty space | Pan the canvas |
| Scroll wheel | Zoom at cursor |
| Click card | Navigate to card |
| Double-click card | Edit card text inline |
| Drag card | Reposition card |
| Double-click empty space | Create new card with edge from current |