Add (C4 styled) Sequence Diagram support #308
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
related to #307
In the final solutions the sequence diagram supports descriptions, line breaks, links, ... of all elements.
The only main difference are
a) boundaries have to be defined without
{
and}
and instead of}
theBoundary_End()
macro has to be calledb) descriptions of the elements (person, system,... ) are deactivated; they can be activated via the layout option
SHOW_ELEMENT_DESCRIPTIONS(?show)
c) in contrast to a normal sequence diagram the foot boxes are deactivated; they can be activated via
SHOW_FOOT_BOXES(?show)
The C4 language itself is basically not extended, missing new features like Grouping messages have to added with native PlantUML syntax.
I have no useful sample at the moment, maybe someone can attach a more practical sample
(part of the new docu)
(C4 styled) Sequence diagram
C4-PlantUML does not offer a full sequence diagram support,
but existing elements and relationships can be reused as participants and calls in the corresponding styles.
Import:
!include https://raw.githubusercontent.com/kirchsth/C4-PlantUML/extended/C4_Sequence.puml
Additional Macros (based on component diagram macros):
{
and}
and instead of}
theBoundary_End()
macro has to be calledBoundary_End()
SHOW_ELEMENT_DESCRIPTIONS(?show)
SHOW_FOOT_BOXES(?show)
Rel($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
RelIndex($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
RelSpecialIndex($rel, $e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
:$rel
enables the definition of all PlantUML specific arrow types, details see e.g.All arrow types and
Slanted or odd arrows
increment($offset=1)
: increase current index (procedure which has no direct output)setIndex($new_index)
: set the new index (procedure which has no direct output)LastIndex()
: return the last used index (function which can be used as argument)Index($offset=1)
: returns current index and calculates next index (function which can be used as argument)SetIndex($new_index)
: returns new set index and calculates next index (function which can be used as argument)(Typically additional used) PlantUML statements:
(end of the new docu)
Themes supports sequence diagrams too (details see new section in Themes.md)
It can be tested via my extended branch
BR Helmut