Files
MyAiDesk/nomifun-tauri/test-data/builtin-skills/mermaid/references/syntax.md
T
freedak f7a720204a Update: 将子项目从 submodule 转为完整内容
- 移除 GovAI, nomifun-tauri, 算力盒子 的 submodule 引用
- 添加所有子项目的完整源代码
- 保留原始 .git 为 .git.bak 备份
2026-07-04 19:20:46 +08:00

1.3 KiB

Mermaid Syntax Quick Reference

Flowchart

graph TD
    A[Start] --> B{Decision}
    B -->|Yes| C[Action 1]
    B -->|No| D[Action 2]
    C --> E[End]
    D --> E

Directions: TD (top-down), LR (left-right), BT, RL

Node shapes:

  • A[text] - rectangle
  • A(text) - rounded
  • A{text} - diamond
  • A([text]) - stadium
  • A[[text]] - subroutine
  • A[(text)] - cylinder
  • A((text)) - circle

Sequence Diagram

sequenceDiagram
    participant A as Alice
    participant B as Bob
    A->>B: Hello
    B-->>A: Hi
    A->>+B: Request
    B->>-A: Response
    Note over A,B: Shared note

Arrows: ->> solid, -->> dashed, -x cross, -) open

State Diagram

stateDiagram-v2
    [*] --> Idle
    Idle --> Running: start
    Running --> Idle: stop
    Running --> [*]: terminate

Class Diagram

classDiagram
    class Animal {
        +String name
        +eat()
    }
    class Dog {
        +bark()
    }
    Animal <|-- Dog

Relations: <|-- inheritance, *-- composition, o-- aggregation, --> association

ER Diagram

erDiagram
    USER ||--o{ ORDER : places
    ORDER ||--|{ LINE-ITEM : contains
    PRODUCT ||--o{ LINE-ITEM : includes

Cardinality: || one, o| zero or one, }| one or more, }o zero or more