Convert a Mermaid diagram to Excalidraw.
Useful when a Mermaid diagram has outgrown what Mermaid's layout can render legibly.
Why convert at all
Mermaid is excellent up to about twenty or thirty nodes. Past that its layout produces crossing edges and awkward spacing, the available levers are coarse, and there is no way to attach a real icon to a node so every box looks the same. Converting hands the same graph to a full layered solver and gives the nodes real service logos, which is usually enough to make a diagram readable again.
The graph is what transfers
Mermaid's node and edge declarations map directly onto the semantic graph, so the structure comes across exactly. What does not transfer is Mermaid's own layout, because that is the thing being replaced. Direction hints and subgraphs become layout preferences and sections rather than instructions.
It is a one-way trip
There is no round trip back to Mermaid that preserves the result, because the output is a scene rather than a text description. If your requirement is that the diagram stays as text in the repository and renders on GitHub, stay in Mermaid; converting is for diagrams that have outgrown that constraint.
Fidelity
| Comes through | Does not | |
|---|---|---|
| Nodes and labels | Yes, exactly | |
| Edges and direction | Yes | |
| Edge labels | Yes | |
| Subgraphs | Become sections | Nested subgraph styling |
| Direction hints (TD, LR) | Become a layout preference | Not an instruction |
| classDef styling | Replaced by tier colouring | |
| Node shapes | Mapped where equivalent | Exotic shapes |
| Layout | Recomputed by ELK, deliberately |
The prompt
Questions
Can it convert Mermaid sequence diagrams too?
Yes, along with flowcharts and ER diagrams. Flowcharts and architecture diagrams are the ones that benefit most, since they are where Mermaid's layout struggles first.
Can it go back to Mermaid?
The agent will write Mermaid from the current graph if you ask, so the structure survives. The computed layout does not, because Mermaid has no way to express it.
Should I convert everything?
No. A small Mermaid diagram in a README that renders on GitHub is doing its job perfectly. Convert when the diagram has stopped being readable.
Related
- Convert SQL to an ER DiagramForeign keys already encode the relationships and their cardinality. The diagram renders what the schema is enforcing anyway.
- Convert OpenAPI to a Sequence DiagramThe spec supplies the operations and their exact names. You supply the ordering, because a spec describes endpoints and not journeys.
- Convert Docker Compose to a DiagramA Compose file is a complete description of a small system written in a format that hides its shape.
- Convert Kubernetes YAML to a DiagramThe whole topology is in the YAML, expressed as label matches spread across forty files.
Last updated