Re-edit a mermaid diagram in draw.io
When Mermaid code is inserted and converted to draw.io shapes, you gain the ability to style, edit and add to your diagram using the draw.io features. But you can’t re-edit the original Mermaid code.
To be able to view and edit the Mermaid code of an inserted diagram, you must insert it as an image.
Insert the Mermaid diagram as an SVG image
- Click Arrange > Insert > Mermaid or + > Mermaid from the toolbar.
- Add your Mermaid code in the large text block.
- Select Image from the list, then click Insert to add it to the drawing canvas.
This generates the Mermaid diagram as a single SVG image and places it on the drawing canvas. Hover over the SVG image to see the Mermaid code in the tooltip. Note that you can’t edit or style the individual shapes or connectors in this SVG image version.
Edit the Mermaid SVG image
- Double-click on the SVG image on the drawing canvas to open the Mermaid code dialog.
- Edit the text and click _Apply to regenerate the SVG image.