Calm motion: animations on this site only fade, with no movement
NodeGraph
Boxes you drag and link: a pipeline, a flow, a dependency map
An editable diagram: nodes the reader places, and arrows they draw between them. Use it where the relationships are the content: a build pipeline, an automation, a lesson order. For a fixed hierarchy that is only displayed, use OrgChart. For tasks on a calendar, Gantt. It sits on InfiniteCanvas, so the whole diagram pans and zooms.
Pipeline
Source
Lint
Test
Ship
Source → Lint, Source → Test, Lint → Ship
- Every node has one input (left) and one output (right). Drag a node to move it (
snapkeeps it on a grid). pull from the output square onto another node to link them. Click an arrow to select it and press Delete to remove it. - Keyboard: focus a node (one is in the tab order). The arrows move it (Shift: further). L starts a link, then the arrows choose the target. Enter links, or unlinks if they are already linked. Esc cancels, and Delete removes the node and its links. Each step is announced, and every node is named with what it connects to.
acyclicrefuses a link that closes a loop. Self-links and duplicates are always refused, and the refusal is announced.- The state is yours:
v-model:nodes({ id, x, y, label }),v-model:edges({ from, to }),v-model:selectedandv-model:view.connect,disconnect,moveandremoveevents say what changed. - Nodes are
nodeWidth×nodeHeight(160 × 56) so links can find their ports. The#node="{ node, selected }"slot draws something richer inside that box.:editable="false"shows and selects but changes nothing.
Usage
ts
import { BlessNodeGraph } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
nodeWidth | number | 160 | size used for ports and links; put content that fits it in the `#node` slot |
nodeHeight | number | 56 | |
snap | number | 0 | snap dragged nodes to this grid, px; 0 is free |
acyclic | boolean | — | refuse a link that would close a loop |
editable | boolean | true | off: nodes can be selected and the view moved, nothing is dragged, linked or removed |
grid | boolean | true | |
controls | boolean | true | |
minZoom | number | — | |
maxZoom | number | — | |
label | string | "Graph" | |
labels | Partial<{ node: (label: string, to: string[], from: string[]) => string; linkFrom: (from: string) => string; linkTo: (from: string, to: string, exists: boolean) => string; linked: (from: string, to: string) => string; unlinked: (from: string, to: string) => string; refused: (from: string, to: string, why: "self" | "exists" | "cycle") => string; cancelled: string; removed: (label: string) => string; hint: string; }> | — | |
nodes | BlessGraphNode[] | [] | |
edges | GraphEdge[] | [] | |
selected | string | null | null | |
view | CanvasView | { x: 0, y: 0, zoom: 1 } |
Events
| Name | Payload | Description |
|---|---|---|
remove | [id: string] | |
update:selected | [value: string | null] | |
update:view | [value: CanvasView] | |
move | [id: string, x: number, y: number] | |
update:nodes | [value: BlessGraphNode[]] | |
update:edges | [value: GraphEdge[]] | |
connect | [edge: GraphEdge] | |
disconnect | [edge: GraphEdge] |
Slots
| Name | Scope | Description |
|---|---|---|
node | { node: BlessGraphNode; selected: boolean; } |