Back to Blog
Plantuml sequence diagram5/16/2023 ![]() 7 participants all calling each other\nconditioned by 'alt' conditions:\nall 'alt' blocks become 'global': what a mess ! Note over C: this simplified example still looks pretty\nnow think of e.g. Note over C: reason (my guess): the arrows between B,C and D Note over C: but the logic appears all over B,C and D Note over B: the alt block visually includes B\nbut B is not part of the logic\n -> bad!Īlt this alt logic is coded exclusively in 'C' Note over C: some if-else logic in C should be horizontally limited to its scope: 'C' Is there any way to control the horizontal size of such 'alt' blocks ? I now kind of adapt the logic I want to document just in order to get my diagrams, which is of course not what documentation should do. Unfortunately that makes the diagram unreadable. Since routines may have multiple calls to other participants and as well have more than one return statement my 'alt' blocks are printed much bigger than I'd like to see: they include all participants called from within the 'alt' and all callers being returned to from within the 'alt' block. Unfortunately the size of these alt blocks seems to be determined as well by all arrows within an 'alt' and its closing 'end' statement. It appears essential that within 'participants' some logic needs to be expressed.Ĭurrently I am using 'alt'. basic.I am about to document quite some procedures using sequence diagrams. ![]() For instance, my Markdown doc is named basic.md and when I export all diagrams (there are three) as SVG, three image files are generated: You also have the option to export all diagrams within a Markdown document (command palette option "PlantUML: Export Current File Diagrams"), which will create separate image files for each diagram. You can choose PNG, SVG, or other formats.** Here's the PNG and SVG versions of the diagram shown in the Preview pane, above: PNG SVG Choose "PlantUML: Export Current Diagram".open the command palette (Ctrl-Shift-P on my PC) or right click and select Command Palette.place your cursor within the desired PlantUML text,. ![]() Unlike plantuml, it is not a VS Code extension, but an executable. It works in conjunction with the plantuml extension installed earlier. In order to export individual diagrams, I need to install GraphViz, which is "open source graph visualization software". That's great, but what if you want to export a diagram from within the Markdown? For that you'll need a little help from your friends. What's more, the diagram in the Preview pane is kept in sync with the UML as described the Markdown document. I can include as many plantuml segments as I want in my Markdown, and the diagrams can be of any type supported by backgroundColor #EEEBDCĬustomer -> "login()" : username
0 Comments
Read More
Leave a Reply. |