With our sequence markup tool, you can create and edit sequence diagrams with ease. Since Lucidchart auto-generates a sequence diagram from the text you enter, you can use the time you save to return to your code… or watch Star Wars.
Follow these steps, and Lucidchart will auto-generate a sequence diagram for you:
- Activate the UML shape library. Click “Shapes” at the top of the Toolbar or use the hotkey “M.” Under the Software section, check “UML” or “UML Sequence.” Hit “Save.”
- Under the “UML Sequence” category in the Toolbar, click “Use Markup.”
- In the pop-over, type your markup.
- Click “Build” when you are ready to generate the diagram.
To create a new diagram, click “Use Markup” in the UML Sequence shape library again.
Don’t worry if your sequence diagram isn’t perfect on the first try. You can still edit the markup of a diagram you have already built, as long as you have not manually adjusted or ungrouped the diagram on the canvas.
Simply click on the diagram, and the sequence markup dialogue will appear on the left side of the editor.
Select the sequence diagram, and use the Properties bar at the top of the editor to style your diagram. If you would like to style individual blocks/elements on your diagram, you must first ungroup the diagram. Select the diagram, right-click, and select “Ungroup.”
Note: If you ungroup your diagram, you will not be able to edit the markup again.
We currently support the following markup, provided by PlantUML, and will add more markup types as the need arises.
To draw a message between two participants, use:
-> for a solid line (Alice->Bob)
→ for a dotted line (Bob-->Alice)
To add a label to messages between participants, use a colon (:) followed by the label.
To include a line break in the text, use \n to break the label.
Alice->Bob: text\nmore text
You can list out the participants and give them aliases so you can write your markup faster. Put each participant on a new line using the following format:
participant A as Alice
participant B as Bob
In this example, you could use A to refer to Alice and B to refer to Bob throughout your markup. To give the participant an alias longer than one word, place the alias inside quotation marks.
participant A as "Alice Jones"
To include a message to self, use the markup Alice->Alice.
We currently support three arrow styles:
Closed arrow: ->
Open arrow: ->>
No arrow: -
To group messages together, use one of the following keywords followed by the label you wish to use:
To include text in the grouping, continue onto the next line and enter the text to go inside the label. On a third line, type “End.”