Skip to main content

Change the Mermaid configuration

The Mermaid source is saved inside the Mermaid container group in your draw.io diagram as a mermaidData attribute on the group cell.

The attribute holds a small JSON object — the data (your Mermaid source) and an optional config (a Mermaid configuration object, or null). Diagrams you insert are stored with config: null, so draw.io's built-in default Mermaid settings are applied every time the source is parsed.

To force Mermaid styles, tweak spacing, or change the layout engine, edit the shape attribute of the Mermaid container group.

  1. Right-click on the Mermaid container group, and select Edit Data
    Right click on the Mermaid group and select Edit Data from the context menu
  2. Edit the mermaidData value, and click Apply. This does not re-render the Mermaid diagram.
    You can edit the Mermaid data including any initialisation commands via the Mermaid container group's shape data (right click on the group and select Edit Data)
  3. Finally, click the pen icon to edit the Mermaid source, then click Apply to re-render the diagram with your new Mermaid configuration.