Editing Graphs
This page covers the day-to-day editing gestures. It assumes you have read Getting Started and know the three modes.
Vertices
Section titled “Vertices”Adding a vertex
Section titled “Adding a vertex”- Enter Add vertex mode (
Vor the toolbar). - Pick a type from the vertex-type menu on the left, or press
1–9. - Click anywhere on the empty canvas to drop a vertex of that type.
Keep clicking to add more — the type stays selected, so you don’t need to re-pick it.
Selecting
Section titled “Selecting”- Click a vertex (in Select mode) to select it; clicking another replaces the selection.
- Shift-click to add to the selection.
- Cmd/Ctrl-click also toggles individual vertices into the selection.
- Shift-drag on empty canvas draws a box (marquee) selection.
- Ctrl/Cmd+A selects everything.
- Esc is a three-step ladder: clear pending edge sources → clear the selection → return to Select mode (each press peels one layer).
When exactly one vertex is selected, the property panel opens on the right. Selecting zero or more than one vertex hides it.
Moving
Section titled “Moving”Drag any selected vertex in Select mode. Moving a vertex is treated as a single undo step — the whole drag collapses to one entry on the undo stack, not one per pixel.
Vertices snap to a 24 px grid — both when you drop a new vertex and while you drag. The grid matches the dot spacing of the canvas background, so aligned vertices sit exactly on the dots.
Editing the label
Section titled “Editing the label”- Double-click a vertex body to edit its label inline, or
- Use the Label field in the property panel.
Commit with Enter or by clicking away; cancel with Esc. For spider and box types the label is
interpreted as a phase expression — see Vertex Types.
Changing type, phase, label, and rotation
Section titled “Changing type, phase, label, and rotation”The property panel (single selection only) exposes:
- Type — a grid of swatches; click to retype the vertex in place. Changing a vertex to an
input/outputboundary assigns it the next free order in its group. - Phase — the phase expression for spider/box types, with a live preview (how it renders, and the parsed value in radians or an error). See Vertex Types.
- Label — a separate visual annotation shown next to the vertex (
$...$for KaTeX). It is purely decorative — never parsed as a phase, never sent to the compute layer. A Label location dropdown picks which side it sits on (top / bottom / left / right / Hidden). - Rotation — a number box plus a slider (0–360°), with a Reset button. Rotation is visual only: it rotates the drawn body but does not affect the graph-theoretic content. Edges on directional vertices (W, And gate) follow the rotation so they still meet the rotated handle.
- Order — only for
input/outputboundaries: the 0-indexed position within the type group that fixes the tensor’s axis order (see Vertex Types).
Edges are drawn in Add edge mode (E). There is no drag-to-connect — you connect by
clicking vertices. This keeps clicks precise and avoids accidental edges while moving nodes.
The click vocabulary (inspired by typical connect-tool UX):
| Gesture | Result |
|---|---|
| Click a vertex | Makes it a pending source (the first click). |
| Click a second vertex | Draws an edge from every pending source to it, then clears the pending list. |
| Cmd/Ctrl-click a vertex | Adds it to the pending source list without committing. |
| Shift-click a target | Draws the fan-out edges but keeps the pending sources, so you can connect the same sources to more targets. |
| Click an already-pending vertex | Removes it from the pending list (toggle off). |
| Click empty canvas | Cancels the pending source list without drawing anything. |
| Esc | Clears pending sources, then selection, then returns to Select mode. |
Pending source vertices glow amber; the selected vertex glows blue. Duplicate edges (same source and target) are silently skipped.
Edge kinds
Section titled “Edge kinds”Edges have a kind, picked the same way vertices pick a type:
| Kind | Look |
|---|---|
default |
Thin slate line. |
dashed_blue |
Blue dashed line. |
dashed_light |
Thin grey dashed line. |
While in Add edge mode an Edge kind menu appears next to the vertex-type menu; every edge you draw from then on uses the staged kind. To change an existing edge, select exactly one edge — an edge property panel opens with the three kinds. All kinds compute identically for now; the distinction exists so future edge types can compute differently.
Box-select into pending sources
Section titled “Box-select into pending sources”In Add edge mode, Shift-drag on the canvas draws a marquee. When you release, every vertex inside the box is swept into the pending source list — handy for fanning one edge out from a whole region of spiders in a single gesture.
Directional vertices (W, And gate)
Section titled “Directional vertices (W, And gate)”The W node and And gate are directional: they have one input at the top and fan out to many outputs at the bottom. When you draw an edge to a directional vertex, it connects to the top handle automatically. Other vertex types connect at the body centre.
Boundary vertices (input, output)
Section titled “Boundary vertices (input, output)”The input and output vertices are boundary markers — they declare the open legs of the diagram, not tensors themselves. They behave like any other vertex, but each should connect to at most one other vertex. A boundary of degree 0 dangles as an open leg; a boundary with degree above 1 is rejected when you compute. See Vertex Types for details.
Clipboard
Section titled “Clipboard”Cut / copy / paste works on subgraphs: copying a selection captures the selected vertices plus the edges that run between them. Edges with only one endpoint in the selection are dropped — pasting them would leave dangling references.
Pasting re-mints all IDs (no collision with the originals) and offsets each consecutive paste so duplicates don’t stack. The clipboard is session-only — it does not survive a page reload — but it is shared across tabs: copy a subgraph in one tab and paste it into another (see Working with Tabs).
Deleting
Section titled “Deleting”- Del or Backspace, or the Delete toolbar button, removes the current selection.
- Deleting a vertex also removes every edge touching it.
- Reset (which wipes the active tab’s canvas) asks for confirmation first. Import never replaces your graph — it merges — so it doesn’t need one. Closing a tab with content also asks for confirmation.
Undo and redo
Section titled “Undo and redo”- Ctrl/Cmd+Z undo, Ctrl/Cmd+Shift+Z (or Ctrl/Cmd+Y) redo. Up to 50 steps are kept, and the history is per tab: undoing in one tab never affects another (see Working with Tabs).
- Structural changes (add/delete vertex/edge, label/phase/type/edge-kind edits) are tracked normally.
- Visual changes are deliberately kept off the undo stack as they happen: drag ticks and selection toggles are never recorded individually. A completed drag collapses into a single undo entry (undo restores the pre-drag positions); selection changes aren’t undoable at all; a rotation-slider sweep behaves like a drag — one sweep, one undo entry.
- Importing a file merges and stays on the undo stack, so
Ctrl/Cmd+Zremoves the imported graph like any other mutation. Reset and loading on start clear the (active tab’s) undo history; closing a tab deletes its history along with its graph.
Next: Vertex Types.