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.
|Lines||Alice -> Bob
Alice <- Bob
|Draw a solid line (you can draw lines in both directions).|
|Alice -->||Draw a dotted line.|
|Alice -> Alice||Draw a solid arrow to and from a participant.|
|Lifelines||activate Alice||Start participant activation with lifeline.|
|deactivate Alice||End participant activation ending the lifeline.|
|-> >||Open arrow|
|Text||Alice->Bob: text||Add a label to messages between participants.|
|Notes||note left of Alice: text1||Add a note shape on the left of Alice (if there are only two characters, "of Alice" could be omitted).|
|note right of Alice:||Add a note shape on the right of Alice.|
|note over Alice: text3||Add a note shape displayed over Alice.|
|note over Alice, Bob:||Add a note shape displayed over Alice and Bob.|
|note over Bob, Alice: This is an example of a long note. End note||Add a note shape with multiple-lined notes, displayed over Alice and Bob.|
|Grouping||alt successful case: Bob -> Alice: data accepted; else some kind of failure. Bob -> Alice: data||Build a grouping message with "alt" (alternative) and "else" to show different situations.|
Alice -> Bob: text2
|Build a grouping message with the keyword "opt."
You can change "opt" to other keywords as well. We support four key words in this pattern:
Note: These four keywords don't support "else." Only the keyword "alt" can be paired with "else."
|Alias||participant A as Alice||Give participants aliases so you can write faster.|
|participant A as "Alice Jones"||Put quotation marks around alias to give participant an alias longer than one word.|
|Comments||'comment text||Single line comment|
|/' comment text '/||Multiple line comment|
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.