Import and export

Bring sequence diagrams in from Mermaid, PlantUML and sequencediagram.org, and export them as images or code files.

Bring a sequence diagram in from another tool by pasting its code or importing a file. Take it out as a picture, as sequence code, or as a Mermaid or PlantUML file.

Code from other tools

You can paste a diagram from another tool straight into the Sequence code pane.

  • sequencediagram.org code, and PlantUML code without its header, is close enough to sequence code that it stays as you pasted it. The parts the canvas can't draw stay in the code, and a message after the paste names them.
  • A Mermaid diagram (starting sequenceDiagram) or a PlantUML file (with @startuml) is rewritten in sequence code as you paste it. A message names anything that was left out.

If you type a Mermaid or PlantUML diagram rather than paste it, the text doesn't change while you type. The pane offers Convert from Mermaid or Convert from PlantUML next to the error instead.

Sequence code that reads is never converted, so pasting your own code back is safe.

What the app reads

Read asCode
A boxparticipantgroup #colour Label … end
A notebox, abox, rbox, state, hnote and rnote with over, left of or right of
A participantrparticipant, and icon participants such as fontawesome5solid f007 Shopper or materialdesignicons F0004 Phone, without the icon
A created participantA->*B, create B
The end of a lifeline or bardestroyafter, destroysilent, deactivateafter
++ and --autoactivation on, autoactivate on
A cross-x, --x, and ->xB when B is a participant
A group fragmentexpandable+, expandable-
andthread
Messages from and to outsidePlantUML's ?-> and ->?
Comments/* … */, ', /' … '/, %%

What the app reads past

The app reads past these, and names them in the message after a paste:

  • sequencediagram.org settings lines, such as entryspacing 0.9, participantspacing, fontfamily, fontsize, lifelinestyle, activecolor and bottomparticipants. A PlantUML file's skinparam and hide lines are read past as it converts.
  • Extra space between rows: space, space 3, ||| and ||45||.
  • Activation colours, as in activate API #lightblue or ++ #red.
  • Arrow widths and styles, such as -[#red,dashed]>, -[bold]-> and -#red:3>. The colour is kept.
  • Fragment background colours, as in alt#Gold #LightYellow. The tab colour is kept.
  • PlantUML's teoz extras. These are & for messages at the same time, which the app draws one after the other, and {anchor} names with the durations between them.
  • Mermaid's central connections, A->>()B.
  • autonumber stop and autonumber resume. The numbering carries on.

Import a file

  1. In the Diagrams panel, open New diagram (the + button).
  2. Choose Import Mermaid, PlantUML or sequence code file….
  3. Pick a .mmd, .mermaid, .puml, .plantuml, .pu, .seq or .txt file.

The file becomes a new diagram, named after its title or the file.

The app works out the format from the file:

  • A file whose first line is sequenceDiagram is read as Mermaid.
  • A file with @startuml is read as PlantUML.
  • Any other file is read as sequence code, or as PlantUML when it doesn't read as sequence code.

A file with no sequence diagram in it isn't imported, and the message says so.

What comes across

Participant shapes, boxes, message ends, created and destroyed participants, critical with its options and numbering come across. So do PlantUML's ref over, ... delays and messages from outside ([->, ->]).

Colours come across too:

  • PlantUML's colour on a participant, a note, a message arrow, a fragment or a box, such as participant A #red, A -[#red]> B or box "Label" #LightBlue.
  • Mermaid's box colours, and rect areas, which become a group fragment with the colour.

A colour name or rgb(…) is read as a hex colour. A box's transparent or default grey is no colour.

Parts a sequence diagram here can't show, such as other styling and numbering formats, are read as near as they can be. When something is left out, a message after the import names it.

Export a file

Open Export at the top right of the diagram. Pictures are under Image, text files under Code:

Menu itemWhat you get
SVGAn .svg picture of the diagram.
PNGA .png picture of the diagram. PNG resolution sets its size.
Copy as imageThe picture, copied to your clipboard.
Sequence codeA .seq file with the diagram in sequence code.
Mermaid fileA .mmd file for Mermaid. ⇧ ⌘ E (Shift Ctrl E on Windows and Linux) downloads it without opening the menu.
PlantUML fileA .puml file for PlantUML.
Copy Sequence codeThe sequence code, copied to your clipboard.

PNG resolution and Image theme sit under the images. See Export for both.

View Mermaid… and View PlantUML… at the bottom of the menu show the text read-only, with a button to copy it.

What the Mermaid file holds

Mermaid can't hold everything a sequence diagram here can, so the app writes some parts another way:

  • Dividers, refs and delays become notes across the diagram.
  • Groups become shaded areas. So do UML's other operators, such as strict or neg, with the operator's word starting the note.
  • Colours are written as box colours and rect areas.
  • Mermaid has a cross but no circle, so a lost message ends in a cross.
  • A message from outside the diagram, or out of it, goes to its own participant, with a comment saying so.

Mermaid has no colour for a participant, a note, a message, or a fragment that isn't a shaded area, so the app leaves those out. It says how many as the file downloads: "Mermaid has no participant and message colours; 3 were left out."

The PlantUML file and the sequence code file write every colour inline. See Colour and styling.

On this page