Edit Mermaid diagrams visually in VS Code
Drag, connect and restyle a Mermaid diagram on Flowgraph's canvas inside VS Code, and every change is written back into the .mmd file or Markdown block as ordinary code.
The Flowgraph Studio extension can open a diagram on the same canvas the website uses, inside VS Code. You drag nodes, connect them and pick a theme there, and the extension writes each change into your file as an ordinary edit. There's no second copy anywhere: the file in your repository is the diagram, so VS Code's Undo, Save, the unsaved dot and git all work as they do when you type.
Plan: Free, Pro and Pro Max. The visual editor is free. Signed in on Pro or Pro Max, the Pro icon sets (such as the Gen AI icons) draw in it and are unlocked in its icon picker.
Open the visual editor
For a .mmd or .mermaid file, use any of these:
- Edit Visually in the editor's title bar (the layout icon).
- Edit Visually in the line of links at the top of the file.
- Flowgraph: Edit Visually from the command palette.
It opens beside the text editor, so you see the code and the canvas together. Typing in the text editor redraws the canvas, and changes on the canvas appear in the text straight away.

To always open .mmd files on the canvas, right-click one in the Explorer, choose Open With…, then Configure default editor for '*.mmd'… and pick Flowgraph Visual Editor. The text editor is the default until you do.
What you can do on the canvas
- Move and resize: drag a node, or drag the handles of a selected one. Drag on empty canvas to select several.
- Connect: select a node and drag one of its + handles onto another node. Click a + instead to add a new node connected on that side.
- Add: Node, Icon node (the icon picker, with the cloud, brand and Lucide sets), and Text in the toolbar.
- Change a node: select it and edit its label, subtitle, status and shape in the bar above the canvas.
- Auto layout: clear the saved positions and let Flowgraph lay the diagram out again.
- Style: the panel on the right has the website's themes, colours, fonts and layout settings.
Delete removes the selection; Escape clears it.
How changes reach the file
Everything you do becomes normal Mermaid code in the file:
- Positions go into a
%% flowgraph-layout:comment line at the end, the same line the website writes. The first drag adds it; later ones update it. - A style you pick goes into a
%% flowgraph-theme:line just above it. If your repository'sflowgraph.ymlalready gives the file that style, no line is added. See Keep a diagram's style in its code. - New nodes and connections are written as Mermaid statements.

Because each change is an edit of the file:
- Undo (
Ctrl+Z,Cmd+Zon a Mac) takes back the last change, from either side. - Save works as usual, and the tab shows the unsaved dot until you do.
- Git shows only the lines that changed. A drag changes the layout line; a new theme changes the theme line.
- Opening a file on the canvas doesn't change it. Flowgraph fixes each node's position in the code with your first change, not before.
Other Mermaid tools ignore %% comment lines, so the file still draws everywhere else, in their own layout and style.
Edit a diagram inside a Markdown file
Each ```mermaid block in a Markdown file has Edit Visually in the line of links above it. The canvas opens on that block alone, beside the file. Changes replace only the block's lines, indented like its fence, and the rest of the file is never touched.

If you change the block in the text while the canvas is open, the canvas redraws from your text.
What stays on the website
Some things need your Flowgraph Studio account and are on flowgraph.studio only: comments and reviews, version history (git does that job for files), share links, your saved presets and snippets, and AI help. Use Open on flowgraph.studio in the line of links when you need them.
More guides
- Keep a diagram's style in its code with %% flowgraph-themeOne comment line keeps a Mermaid diagram's Flowgraph theme in the file, so it looks the same in your repository, in VS Code, from the CLI and through the render API.
- Preview Flowgraph diagrams in VS Code, with icons, layout and your themeInstall the Flowgraph Studio extension to preview Mermaid files and Markdown blocks in VS Code as Flowgraph draws them, see mistakes in plain words, and export SVG or PNG.
- Connect Claude, Cursor or VS Code to Flowgraph Studio by signing inAdd Flowgraph Studio's MCP server to Claude, Claude Code, Cursor or VS Code with its address alone, approve the connection once, and revoke it whenever you like. No API key to copy.