Comments (6)
Not all points are solved (no box support, person does not support default sprite, ...) but a possible implementation could look like below
It can be tested with my extended branch
BR
Helmut
from c4-plantuml.
new implementation available on my extended branch, now it should support basically all possible options:
(C4 styled) Sequence diagram
C4-PlantUML does not offer a full sequence diagram support, but existing elements and relationships can be reused as as participants and calls in the corresponding styles
!!! Contrary to all other diagrams, please define boundaries without
{
and}
and mark a boundary end withBoundary_End()
!!!
-
Import:
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Sequence.puml
-
Macros (based on component diagram macros):
- Basically all element specific macros (Person, System, Container...) can be reused with following differences:
- element descriptions are not displayed (?descr argument is ignored); size would be too big
- element technology/type (?techn/?type) supports no line breaks
- boundaries have to be defined without
{
and}
and instead of}
theBoundary_End()
macro has to be called
- Additional (element specific) Macros:
Boundary_End()
- Only following 3 relationship specific macros are supported:
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
- The 5 index related macros (like the dynamic diagram)
- (lowercase)
increment($offset=1)
: increase current index (procedure which has no direct output) - (lowercase)
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)
- (lowercase)
- Basically all element specific macros (Person, System, Container...) can be reused with following differences:
-
(Typically additional used) PlantUML statements:
@Potherca, @mweagle: I have only one question: Should we defines the sequence diagram styles via variables (like now in all other diagrams) or should we define it only via styles in the themes? What do you think?
from c4-plantuml.
regarding variable:
a) if we use variables in sequence diagram it is more complex (e.g. If I (re)use the theme united
as base theme, then I would have to defined all (re)used colors as variables that I can reset it afterwards) and if the theme contains styles (e.g. font names, which are not modeled as variable at all) then I would have to use variables and styles.
In concrete I only updated the missing/"wrong" c4_united styles
' "C4 styled" default is no foot boxes
hide footbox
' fix wrong ReferenceHeaderFontColor
<style>
referenceHeader {
fontcolor $INFO
}
</style>
' fix invisible SequenceDelayFontColor
<style>
sequenceDiagram {
delay {
FontColor $DARK
}
}
</style>
b) In the e.g. component diagram I have to use variables, otherwise I could not calculate the legend,... but in the sequence diagram I have no "calculated dependencies"
therefore I end with the simpler solution
Regarding simple solution:
In last MR I introduced 3 new relationships Rel(..), RelIndex() and RelSpecialIndex() but I think the simpler solution is that we use only one call with 2 optional parameters Rel(..., ?index, ?rel).
In the dynamic diagram I will add the optional ?index too
from c4-plantuml.
nested boxes can be supported with the teoz layout (but stereotype support is still open), arrows supports stereotypes
e.g.
multi-level (more than 2) requires \n in the names (see); final logic not clear atm
from c4-plantuml.
Nice!
from c4-plantuml.
Regarding the variables yay/nay... In principle I am in favor of keeping things as consistent as possible but not at any price.
What is the impact?
from c4-plantuml.
Related Issues (20)
- Tags and sprites conflict in Rel (update: sprites have white background, should be transparent) HOT 4
- Image gets cut on the side HOT 1
- Adjust thickness of element border HOT 6
- C4_Dynamic no longer numbers all relationships HOT 6
- error a001 on all diagrams HOT 2
- Odd Legend Rendering for Sequence Diagrams HOT 5
- Question: How do I split functions over multiple lines? HOT 1
- Wrong rendering for Rel_R HOT 4
- AddNodeTag in C4_Deployment throws an error HOT 5
- Support of "all" PlantUML elements can be enabled HOT 4
- Line styling not recognized when using ELK HOT 2
- "Cannot open URL" on Online Server HOT 2
- Legend text includes unexpected properties (e.g. $lineStyle) HOT 3
- Wrong layout: "== Base Query" <<boundary>> as Base Query HOT 3
- C4_Container diagram not rendering properly HOT 3
- Java OutOfMemoryError with some Sequence diagrams HOT 6
- $baseShape="label" does not use the correct color (size, ...?) in combination with themes
- Descriptions for boundaries HOT 8
- Separating model and view HOT 5
- Single column properties or header lead to rendering error HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from c4-plantuml.