---
name: dag-visual-editor-design
version: 1.0.0
description: Design modern, intuitive DAG/workflow visual editors that feel like LEGO, not LabView
category: Design
tags:
- dag
- workflow
- visual-programming
- node-editor
- react-flow
- ux-design
trigger_phrases:
- "design dag editor"
- "workflow builder ui"
- "node graph ux"
- "visual programming interface"
- "make dag editor intuitive"
allowed_tools:
- Read
- Write
- Edit
- WebSearch
- WebFetch
---
# DAG Visual Editor Design
Design modern, intuitive DAG and workflow visual editors. This skill captures best practices from industry leaders like **n8n**, **ComfyUI**, **Retool Workflows**, and **React Flow** — prioritizing clarity over complexity.
## Philosophy: LEGO, Not LabView
Traditional node editors (LabView, Max/MSP, older VFX tools) suffer from:
- Dense, cluttered interfaces
- Overwhelming port/connection complexity
- Steep learning curves
- "Spaghetti" wire syndrome
Modern DAG editors take a different approach:
- **LEGO-like composability** — snap blocks together
- **Progressive disclosure** — show complexity only when needed
- **Clear data flow** — left-to-right or top-to-bottom
- **Minimal chrome** — the content IS the interface
## Core Design Principles
### 1. Nodes as First-Class Components
Nodes should feel like self-contained units, not wiring terminals.
```
┌─────────────────────────────┐
│ 🔄 Transform Data │ ← Clear title with icon
├─────────────────────────────┤
│ Input: users.json │ ← Inline config, not ports
│ Output: filtered_users │
├─────────────────────────────┤
│ ▶ Run │ ⚙ Config │ 📋 Docs │ ← Actions in footer
└─────────────────────────────┘
```
**Bad (LabView style):**
```
●─┬─● ●─●
│ │
┌───┴───┐ ┌─┴─┐
│ Node │─│ N │
└───┬───┘ └─┬─┘
│ │
●─┴─● ●─┴─●
```
**Good (Modern style):**
```
┌──────────┐ ┌──────────┐
│ Input │ ───▶ │ Process │ ───▶ [Output]
└──────────┘ └──────────┘
```
### 2. Connection Semantics
| Pattern | When to Use | Visual |
|---------|------------|--------|
| **Implicit** | Sequential flows | Vertical stack, no lines |
| **Explicit minimal** | Branching logic | Single clear edge |
| **Bundled** | Multiple data channels | Grouped/labeled edges |
| **Animated** | Execution/data flow | Particles along edges |
**Key insight from ComfyUI:** Show data flowing through edges during execution. Users understand what's happening.
### 3. Handle Design
**Avoid:** Multiple tiny ports crammed on node sides
**Prefer:**
- Single input handle (top or left)
- Single output handle (bottom or right)
- Type indicators via color/shape only when needed
- Handle reveals on hover for clean default state
### 4. Layout Algorithms
Auto-layout is critical. Users shouldn't manually arrange nodes.
```typescript
// Dagre layout (hierarchical, left-to-right)
const layout = dagre.graphlib.Graph()
.setGraph({ rankdir: 'LR', ranksep: 80, nodesep: 40 })
.setDefaultEdgeLabel(() => ({}));
// ELK (more sophisticated, handles complex graphs)
const elk = new ELK();
await elk.layout(graph, {
algorithm: 'layered',
'elk.direction': 'RIGHT',
'elk.layered.spacing.nodeNodeBetweenLayers': 100,
});
```
### 5. Minimap & Navigation
Essential for complex workflows:
- Minimap in corner (toggleable)
- Fit-to-view on double-click background
- Breadcrumbs for nested/grouped nodes
- Search to jump to nodes
## Technology Stack
### React Flow (Recommended)
```tsx
import ReactFlow, {
Background,
Controls,
MiniMap,
useNodesState,
useEdgesState,
} from 'reactflow';
function WorkflowEditor() {
const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes);
const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges);
return (