Giter Club home page Giter Club logo

Comments (6)

kirchsth avatar kirchsth commented on June 13, 2024 2

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.

kirchsth avatar kirchsth commented on June 13, 2024 1

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 with Boundary_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 } the Boundary_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)
  • (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.

kirchsth avatar kirchsth commented on June 13, 2024 1

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.

kirchsth avatar kirchsth commented on June 13, 2024

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.

Potherca avatar Potherca commented on June 13, 2024

Nice!

from c4-plantuml.

Potherca avatar Potherca commented on June 13, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.