design 3534 words

Flowchart Design Standard

Source: flowchart

Flowchart Design Standard

Scope: Layout, aesthetics, and visual design principles for flowcharts. NOT in scope: Symbol shapes, colors, edge types — see flowchart_symbols_standard.md (the SINGLE SOURCE OF TRUTH).

Core philosophy: 美化是手段,传递信息才是目的。 Any decoration that prevents a reader from narrating the main flow in 3 seconds is harmful.


1. Design Axiom

A flowchart is a visual language for information transfer. Every design choice must answer one question: does this help the reader understand the logic faster? If not, remove it.

Priority Goal Metric
P0 3-second scan Reader narrates the main flow without clicking anything
P1 Straight lines Lines that CAN be straight MUST be straight — no unnecessary curves or detours
P2 No overlap Nodes never overlap nodes; edges never cross nodes; edge crossings minimized to zero
P3 Shape = meaning Each node's shape instantly tells "what it is" per the symbol standard
P4 Color = role Same semantic role → same color. No guessing.
P5 Line hierarchy Primary flow is obviously thicker/darker than everything else
P6 Fit in one view fitView shows all nodes without scroll, drag, or zoom

2. Color Principles

Node and edge colors are defined in flowchart_symbols_standard.md. This section covers how to use color, not which colors.

2.1 Consistency (统一性)

2.2 Contrast (对比度)

2.3 Restraint (精简性)

2.4 Context Adaptation (场景适配)

Context Recommendation
Technical docs Rely on the standard palette as-is (low saturation, high readability)
Presentations Increase stroke width by 1px; use slightly larger nodes for projector visibility
Print / PDF Ensure all dashed lines reproduce in B&W (dash pattern, not color alone, carries meaning)
Dark background Swap fill/stroke to inverted variants (not covered in the standard; handle per project)

3. Node Design Principles

3.1 Size Standardization (节点标准化)

Property Value Tolerance
Min width 120px
Max width 240px
Min height 48px
Max height 96px (2 lines)
Border radius 8px (Process), 16px (AI/Display), 0 (Diamond) Per symbol standard
Stroke width 2px (normal), 3px (emphasis: AI, Internal Storage) Per symbol standard

3.2 Content Density (文字易读化)

Each node has at most 3 text lines. Each line answers ONE question for the reader:

┌──────────────────────────────────┐
│  Literature Survey               │  Line 1: What IS this stage?
│  collect background papers       │  Line 2: What does it PRODUCE?
│  topic → annotated reading notes │  Line 3: What goes IN → what comes OUT?
└──────────────────────────────────┘
Line Field Question Font Max Length
1 label (Title) What is this stage? 12.5px bold ≤ 24 chars
2 sub (Subtitle) What does it produce / do? 10px gray ≤ 36 chars
3 io (I/O) What goes in → what comes out? 9px light gray ≤ 36 chars

Title: Verb + Object (动词化)

Subtitle: What it Produces

I/O: Semantic Transformation (语义变换, NOT 实现细节)

The io line describes the domain-level transformation: what data enters, what data exits. It must NOT contain implementation details.

Quality Example Why
GOOD papers → hypothesis tree Semantic: reader knows the transformation
GOOD goal.md → role + topic + project Concrete: specific input → specific outputs
GOOD hypotheses → experiment plan Shows the logical data flow between stages
BAD 10 calls → sessions/*.md "10 calls" = implementation detail (API call count)
BAD 30 calls → exp_*.md Reader doesn't care how many API calls
BAD N lanes → exp_*.md Too vague + filename glob instead of meaning
BAD 11 checks → pass / fail "11 checks" = implementation detail (check count)
BETTER all artifacts → pass / fail Semantic: what is being verified

The acid test: Cover the label. Can a reader understand the node's purpose from sub + io alone? If not, rewrite.

Rule: The io line must form a data story when read top-to-bottom across all nodes:

goal.md → role + topic + project
  → topic → annotated reading notes
    → papers → hypothesis tree
      → hypotheses → experiment plan
        → plan → per-hypothesis results
          → results → advance or backtrack
            → experiments → reusable insights
              → insights → paper + slides
                → all artifacts → pass / fail

Each output feeds into the next input. If there's a gap, a node label or io is wrong.

Chips (Optional, for Overview Nodes)

Zone Rule
Chips Artifact names (max 3). Overflow shows +N. Never >3 visible.

3.3 Badges and Status


4. Edge Design Principles

Edge types and colors are defined in flowchart_symbols_standard.md. This section covers routing and visual hierarchy.

4.1 Visual Hierarchy (线条层级)

The reader should instantly know which line is the "main road":

Layer Edge Type Visual Weight
Foreground Primary Flow 3px, black, solid, opacity 0.85
Mid-ground Gate Pass / Gate Fail 2px, green/red, solid/dashed, opacity 0.70–0.80
Background Data / Skip / Feedback 1.5px, muted colors, opacity 0.40–0.50

4.2 Straightness Rules (线条必须直,Non-Negotiable)

If a line CAN be straight, it MUST be straight. A crooked line between aligned nodes is always a bug.

Rule Description
Straight when aligned If source and target share the same X (vertical flow) or same Y (horizontal flow), the edge MUST be a single straight segment — zero bends.
Orthogonal when offset If source and target are NOT aligned, use exactly one right-angle bend (L-shape). Never use Bezier curves on primary flow.
No gratuitous curves Bezier/spline routing is FORBIDDEN for Primary Flow, Gate Pass, and Gate Fail edges. Only Skip and Feedback edges may use curves, and only when necessary to avoid crossing.
Layout causes straightness Edges don't need routing tricks if nodes are properly aligned. Fix the layout first, not the edge.

4.3 Routing Rules (线条路由)

Rule Description
Fixed ports L→R layout: enter from Left, exit from Right. T→B layout: enter from Top, exit from Bottom.
No self-loops source === target edges are always filtered out — zero exceptions.
No back-edges in Overview Except max 1 Feedback edge. All loops belong in detail views.
Zero crossings target Re-order nodes to eliminate ALL edge crossings. If truly impossible, cross at right angles with a visible gap.
No edge-through-node An edge must NEVER visually pass through or overlap a node it is not connected to. Re-route or re-order nodes to prevent this.

4.3 Label Rules

Edge Type Label? Example
Primary Flow No label
Gate Pass pass or yes pass
Gate Fail fail or no fail
Data Flow Name of data report.csv
Skip / Jump Optional skip to
Feedback Optional retry

5. Layout Principles

5.1 Spine-First Layout (主干优先)

Every flowchart must have exactly one main trunk (spine). All other information hangs off this spine as sidecars, chips, or detail views.

Correct:                           Wrong:
  A → B → C → D → E               A → B → C
                                       ↓   ↗
                                       D → E
                                   (two competing paths)

The reader's eye follows ONE line. If two paths look equally strong, the hierarchy is broken.

5.2 Direction Rules

Node Count Direction Layout Method
≤ 5 Left → Right Single row, direction: right
6–10 Grid (L→R, T→B) grid-rows: 2, grid-columns: 5
> 10 Split into Overview + Detail Overview ≤ 10 nodes; excess becomes drilldown

5.3 Row Wrapping (Hard Rule)

5.4 Alignment (对齐,Non-Negotiable)

If two nodes CAN be aligned, they MUST be aligned. Misalignment is the #1 cause of crooked lines.

Rule Description
Same-row Y alignment All nodes in the same row share the EXACT same Y coordinate. Tolerance: 0px (not 12px — zero).
Same-column X alignment All nodes in the same column share the EXACT same X coordinate.
Grid snapping Use grid-rows + grid-columns in D2 to enforce alignment mechanically. Never hand-place nodes if a grid achieves the same result.
Alignment before routing Align nodes FIRST, then draw edges. A straight edge is the natural consequence of aligned nodes.
Correct (aligned):              Wrong (misaligned):
  ┌───┐   ┌───┐   ┌───┐          ┌───┐  ┌───┐
  │ A │───│ B │───│ C │          │ A │──┐ │ B │
  └───┘   └───┘   └───┘          └───┘  └─└───┘
  (same Y → straight lines)         (offset Y → crooked line)

5.5 No Overlap (不重叠,Non-Negotiable)

Nodes must never overlap other nodes. Edges must never pass through unconnected nodes.

Rule Description
Node-node gap Minimum 20px clearance between any two node boundaries.
Edge-node clearance An edge must maintain ≥ 10px distance from any node it does not connect to.
Edge-edge crossing Target: ZERO crossings. If unavoidable, cross at right angles (never acute).
Re-order to fix If overlap or crossing occurs, change the node order / column assignment. Do NOT add routing hacks — fix the layout.
Correct (no overlap):           Wrong (edge crosses node):
  ┌───┐   ┌───┐                   ┌───┐───┌───┐
  │ A │───│ B │                   │ A │ X │ B │
  └───┘   └───┘                   └───┘───└───┘
  ┌───┐   ┌───┐                        │
  │ C │───│ D │                   ┌───┐─┘
  └───┘   └───┘                   │ C │
                                  └───┘

5.6 Spacing

Metric Value
Horizontal node gap 60px (L→R)
Vertical node gap 40px (T→B)
Same-row Y tolerance 0px (exact alignment)
Same-column X tolerance 0px (exact alignment)
Group internal padding 16px
Group inter-step spacing 28px
Edge-to-unconnected-node clearance ≥ 10px

5.7 Visual Balance (视觉平衡)


6. Overview Design (L0)

The Overview is the reader's first and most important impression. It must be optimized for instant comprehension.

6.1 Hard Limits

Metric Target
Nodes = 10 (exactly)
Primary edges 9–11
Feedback edges ≤ 1
fitView All 10 nodes visible without scroll
Back-edges 0 (except the 1 allowed Feedback)

6.2 What Belongs in Overview

Include Exclude
Start / End terminators Intermediate artifacts (config files, temp data)
Main process steps Sub-steps within a phase
Key decision gates Internal data flows
Collapsed group nodes Retry/rework loops (except 1 Feedback)

6.3 Collapsed Groups

When multiple related steps are collapsed into one group node:

6.4 Sidecar Pattern

Artifacts, configurations, and data products should NOT be main-trunk nodes. Instead:


7. Detail Design (L1+)

Detail views expand what was collapsed in the Overview.

7.1 Expansion Rules

7.2 Detail Limits

Metric Target
Nodes per detail view ≤ 15
Nesting depth ≤ 2 levels (L0 → L1 → L2 max)
Edge types shown Primary + Gate + Data (all 6 types allowed)

7.3 Internal Layout

Within an expanded group:

Group Container (Analysis)
  ├─ Map (Pass 1)         ← vertical stack
  ├─ Q1 Gate (diamond)    ← smaller, same column
  ├─ Mechanics (Pass 2)
  └─ Mastery (Pass 3)

8. Interaction Principles

8.1 Default State

8.2 Progressive Disclosure

8.3 Navigation


9. Legend (Required)

Every diagram MUST include a legend. The legend shows:

  1. Symbol shapes used in this diagram (subset of the 20 standard types)
  2. Edge types used in this diagram (subset of the 6 standard types)

Legend rules:


10. Anti-Patterns (What NOT to Do)

Anti-Pattern Why It's Bad Fix
Crooked line between aligned nodes Looks broken, screams "auto-layout bug" Align nodes to same X or Y → line becomes straight automatically
Nodes overlapping nodes Unreadable, blocks content Increase spacing; re-order columns/rows
Edge passing through a node Confuses "is this connected?" Re-order nodes or add routing clearance
Edge crossing edge Creates false intersections Re-order nodes to eliminate; if impossible, cross at 90°
Misaligned same-row nodes Causes unnecessary bends in horizontal edges Force exact same Y coordinate for all nodes in a row
Self-loop edges 100% visual noise, never informational Filter source === target
All edges same thickness No hierarchy, reader can't find main flow Primary 3px, others 1.5px
> 10 nodes in Overview Cognitive overload Group into collapsed containers
Bezier curves on primary flow Creates unnecessary visual complexity Use orthogonal/step routing
Artifacts as main-trunk nodes Breaks the action spine Move to chips or sidecars
Mixed L→R and T→B Inconsistent reading direction Pick one, commit
Color = execution actor (blue=code, green=LLM) Conflicts with color = symbol type standard Use shape for semantics, color follows symbol standard
Status encoded in fill color Clashes with symbol-type color Use border style + badge instead
> 3 lines of text in a node Nodes are labels, not paragraphs Title ≤ 24 chars, subtitle ≤ 36 chars

11. Acceptance Checklist (8-Point Test)

Before shipping any flowchart, verify all 8:

# Test Pass Criteria
1 3-second scan Without clicking, narrate the main flow in 3 seconds
2 All lines straight Every edge between aligned nodes is a single straight segment — zero unnecessary bends
3 Zero overlap No node overlaps another node; no edge passes through an unconnected node
4 Zero crossings No edge crosses another edge (or crosses at 90° if truly unavoidable)
5 Shape scan Each node's shape instantly tells you what it is
6 Zero self-loops No edge where source === target
7 Visual hierarchy Secondary edges obviously lighter than primary
8 fitView test "Show All" fits everything, no overlap, no drag needed

12. Quick Decision Tree

Use this when designing a new flowchart:

Q: How many main steps?
├─ ≤ 5 → Single row, L→R, direction: right
├─ 6–10 → Grid layout, 2 rows × 5 cols
└─ > 10 → Overview (10 nodes) + Detail drilldowns

Q: Does a step contain sub-steps?
├─ Yes, 2–5 sub-steps → Collapse into group node
├─ Yes, > 5 sub-steps → Separate detail diagram
└─ No → Regular node

Q: Is this an artifact, not an action?
├─ Key output (PDF, report) → Data or Document node in spine
├─ Intermediate file (config, index) → Chip on producing node
└─ Multiple artifacts → Sidecar note box

Q: Does this edge go backward?
├─ Main retry loop → 1 Feedback edge (purple dotted)
├─ Gate fail → rework → Gate Fail edge (red dashed) to rework node
└─ Other backward reference → Skip edge (slate dashed), or hide in detail

References

Skills Using This Standard (1)