Flowchart Syntax
Flowcharts are created using the graph keyword followed by direction (TD, LR, BT, RL).
Basic Syntax
| Syntax | Description | Example |
|---|---|---|
graph TD |
Top Down flowchart | graph TD; A --> B |
graph LR |
Left Right flowchart | graph LR; A --> B |
[Text] |
Rectangle node | A[Start] |
(Text) |
Rounded rectangle | A(Process) |
{Text} |
Diamond decision | A{Decision} |
((Text)) |
Circle node | A((Circle)) |
--> |
Arrow connection | A --> B |
-->|Label| |
Labeled arrow | A -->|Yes| B |
Sequence Diagram Syntax
Sequence diagrams show interactions between participants over time.
Basic Syntax
| Syntax | Description | Example |
|---|---|---|
sequenceDiagram |
Start sequence diagram | sequenceDiagram |
participant Name |
Define participant | participant User |
A->>B: Message |
Solid arrow (request) | User->>Server: Request |
A-->>B: Message |
Dashed arrow (response) | Server-->>User: Response |
A->B: Message |
Solid line (synchronous) | User->Server: Sync |
A-->B: Message |
Dashed line (asynchronous) | User-->Server: Async |
Class Diagram Syntax
Class diagrams show object-oriented structures with classes and relationships.
Basic Syntax
| Syntax | Description | Example |
|---|---|---|
classDiagram |
Start class diagram | classDiagram |
class Name {} |
Define class | class Animal {} |
+attribute |
Public attribute | +String name |
-attribute |
Private attribute | -int age |
+method() |
Public method | +makeSound() |
ClassA <|-- ClassB |
Inheritance | Animal <|-- Dog |
ClassA --> ClassB |
Association | User --> Order |
Gantt Chart Syntax
Gantt charts show project timelines and task scheduling.
Basic Syntax
| Syntax | Description | Example |
|---|---|---|
gantt |
Start Gantt chart | gantt |
title Text |
Chart title | title Project Timeline |
dateFormat Format |
Date format | dateFormat YYYY-MM-DD |
section Name |
Section/phase | section Planning |
Task :id, start, duration |
Task definition | Task1 :a1, 2024-01-01, 30d |
after id |
Dependency | Task2 :a2, after a1, 20d |
Pie Chart Syntax
Pie charts display proportional data.
Basic Syntax
| Syntax | Description | Example |
|---|---|---|
pie title Text |
Start pie chart with title | pie title Budget |
"Label" : value |
Data point | "Development" : 45 |
ER Diagram Syntax
Entity-relationship diagrams show database schemas.
Basic Syntax
| Syntax | Description | Example |
|---|---|---|
erDiagram |
Start ER diagram | erDiagram |
ENTITY {} |
Define entity | CUSTOMER {} |
type name |
Attribute definition | string name |
A ||--o{ B |
One-to-many | CUSTOMER ||--o{ ORDER |
A ||--|| B |
One-to-one | USER ||--|| PROFILE |
User Journey Syntax
User journey diagrams map customer experiences.
Basic Syntax
| Syntax | Description | Example |
|---|---|---|
journey |
Start user journey | journey |
title Text |
Journey title | title Shopping |
section Name |
Journey section | section Browse |
Action: score: Actor |
Journey step | Visit Site: 5: User |