Mermaid Import
Draph supports importing diagrams from Mermaid syntax. Paste your Mermaid code and get an editable visual diagram.
How to Import
Section titled “How to Import”- Press
Mor click the Mermaid button in the left toolbar - Paste your Mermaid code in the editor
- Click “Import” or press
Ctrl+Enter - Your diagram appears on the canvas, fully editable
Supported Diagram Types
Section titled “Supported Diagram Types”Flowcharts
Section titled “Flowcharts”flowchart TD A[Start] --> B{Decision} B -->|Yes| C[Action] B -->|No| D[Other Action] C --> E[End] D --> EDirections:
TD/TB- Top to bottomLR- Left to rightRL- Right to leftBT- Bottom to top
Node Shapes:
| Syntax | Shape |
|---|---|
A[text] | Rectangle |
A(text) | Pill (rounded) |
A{text} | Diamond |
A((text)) | Circle |
A[["text"]] | Container |
Connections:
| Syntax | Description |
|---|---|
--> | Arrow |
--- | Line (no arrow) |
-.-> | Dotted arrow |
==> | Thick arrow |
--|label|--> | Arrow with label |
Sequence Diagrams
Section titled “Sequence Diagrams”sequenceDiagram participant A as Alice participant B as Bob A->>B: Hello Bob! B-->>A: Hi Alice! A->>B: How are you? B-->>A: Great, thanks!Participants:
participant A- Basic participantparticipant A as Alice- Participant with aliasactor A as Alice- Actor (stick figure)
Messages:
| Syntax | Description |
|---|---|
->> | Solid arrow (sync call) |
-->> | Dashed arrow (response) |
-) | Open arrow (async) |
--) | Dashed open arrow |
Blocks:
sequenceDiagram loop Every minute A->>B: Ping end alt Success B-->>A: Pong else Failure B-->>A: Error end opt Optional A->>B: Extra call endClass Diagrams
Section titled “Class Diagrams”classDiagram class User { +String name +String email -String password +login() +logout() -hashPassword() } class Admin { +String role +deleteUser() } User <|-- AdminVisibility:
+Public-Private#Protected~Package
Relationships:
| Syntax | Type |
|---|---|
<|-- | Inheritance |
*-- | Composition |
o-- | Aggregation |
--> | Association |
..> | Dependency |
Limitations
Section titled “Limitations”Not all Mermaid features are supported. Current limitations:
- Subgraphs - Partially supported as containers
- Styling - Inline styles (
style A fill:#f00) not supported - Links - Click handlers not supported
- Icons - Font Awesome icons not supported
- Notes - Sequence diagram notes partially supported
- Edit after import - Mermaid gives you a starting point; refine positioning manually
- Auto-arrange - Press
Aafter import to clean up layout - Keep it simple - Complex Mermaid diagrams may need manual adjustment
- Iterate - Import, tweak, export - use Draph as your visual editor
API Usage
Section titled “API Usage”You can also create diagrams from Mermaid via the API:
curl -X POST https://draph.sanath.dev/api/diagram \ -H "Content-Type: application/json" \ -d '{"mermaid": "flowchart TD\n A[Start] --> B[End]"}'See API Reference for details.