Edit Mermaid diagrams by dragging, typing, or asking
Three ways to edit the same Mermaid diagram: drag nodes, connectors and labels on the canvas in Manual mode, type the code, or describe the change to the AI assistant. The code always stays in step.
Mermaid's strength is that a diagram is text. Its weakness is that some changes are easier to make with a mouse: "move that box over there", "make this arrow come out of the side". Flowgraph Studio lets you do both on the same diagram, plus a third way, describing the change in words. Whichever you use, the Mermaid code is the single source of truth and updates as you go.
Code: the source of truth
The editor speaks every Mermaid diagram type. The canvas redraws a moment after you stop typing; if the text can't be read, the status bar shows the error and the last good drawing stays on screen. Undo and redo work across every kind of edit below.
flowchart LR
A[Order placed] --> B{Paid?}
B -->|yes| C[Ship order]
B -->|no| D[Send reminder]
C --> E((Done))Canvas: Manual mode
Switch the toggle in the top bar from Code to Manual to edit flowcharts, state diagrams, sequence diagrams, ER diagrams, and class diagrams directly. The code panel stays open, so you can watch each change land in the text.
Arrange
- Drag a node to move it; it stays where you drop it. Select it and drag a corner to resize.
- Move a connection's ends: select a connection and drag either end to another side of its node. The four sides show as targets, and the line is re-routed from there. Or pick the sides with From and To in the bar; Auto lets it choose again.
- Move text: select a node and drag the small handle under its text to place the text anywhere; Reset text puts it back.
- Move a connection label by dragging it; it follows its connection when nodes move.
- Auto layout arranges everything automatically again.
Grow and connect
- Click a + beside the selected node to add a connected node on that side, ready to type into.
- Drag a + onto another node to connect them, or onto empty canvas to add a connected node there.
- Shift-click or Shift-drag to select several nodes and move them together, or Save as snippet to reuse them in any flowchart.
Where the positions go
Mermaid has no syntax for positions, so they're saved in one comment line at the end of the code:
flowchart TD
A[Start] --> B[Check stock]
B --> C[Ship]
%% flowgraph-layout: {"v":1,"nodes":{"A":{"x":102,"y":39}, …},"edges":{"L_A_B_0":{"start":"right"}}}
Other Mermaid tools ignore the line and lay the diagram out automatically. In Flowgraph Studio, exports, the API, and shared links keep your arrangement. Delete the line to go back to automatic layout.
Once nodes are placed by hand, the layout engine, direction, and spacing settings no longer move them; the Layout tab says so, with Arrange automatically to hand the layout back.
Diagram types beyond flowcharts
| Diagram | What you can do on the canvas |
|---|---|
| State | Everything a flowchart can; add states and choices; move and connect start and end points |
| Sequence | Reorder participants by dragging, add a message by dragging between lifelines, move messages up or down, change arrows and text |
| ER | Move entities, relate them with a + and pick the cardinality on each side, edit attributes, mark keys (PK, FK, UK) |
| Class | Move classes, relate them (inheritance, composition, aggregation, …) with multiplicities, edit members and stereotypes |
For example, a relationship you draw between two ER entities becomes ordinary Mermaid:
erDiagram
CUSTOMER ||--o{ ORDER : places
ORDER ||--|{ ORDER_LINE : contains
PRODUCT ||--o{ ORDER_LINE : "appears in"
CUSTOMER {
uuid id PK
string email UK
}
ORDER {
uuid id PK
uuid customer_id FK
date placed_at
}Words: the AI assistant
With Pro or Pro Max, AI in the top bar does two things:
- New diagram: describe a system or process and get a diagram, with real components and icons. It's saved as a new diagram in the current project.
- Change this diagram: say what to change, such as "add a Redis cache between the API and the database" or "group the services into a VPC". Everything else stays as it was, including node ids and the positions you set in Manual mode, and it's a normal edit that undo reverses.
flowchart LR
you([You]) -->|"add a Redis cache<br/>between API and DB"| ai[AI assistant]
ai -->|edits the code| code[Mermaid code]
code --> canvas[Canvas]
canvas -->|drag, connect| codePro includes 20 AI requests a month and Pro Max 300; if Mermaid can't read an answer, the fix is free. AI can make mistakes, so check the diagram before you share it.
Which to use when
- Type when you know the structure: it's fastest, and the text diffs well in a pull request.
- Drag when the structure is right but the picture isn't: crossing lines, a cramped corner, an arrow on the wrong side.
- Ask for changes that touch many lines at once: grouping, renaming a component everywhere, inserting a layer.
All three can be undone, and version history keeps earlier versions if you change your mind later. To start from something rather than a blank page, see the flowchart cheat sheet or the Templates page.
More guides
- Animate a Mermaid diagram as a short technical explanationTurn a static Mermaid flow into a captioned explanation. Plan the story, select GIF or video output, and check that animation preserves the system's meaning.
- Explain an Azure background-job architecture with MermaidDraw an illustrative Azure job-processing architecture with API, queue, worker, and storage boundaries. Explain acknowledgment, completion, and failure handling.
- Build a consistent technical carousel with a reusable brand kitCreate readable technical carousel slides using a reusable brand kit. Keep colors, typography, diagrams, and export checks consistent across the series.