mirror of
https://github.com/plantuml-stdlib/C4-PlantUML.git
synced 2022-10-18 01:14:54 +00:00
compatibility with plantuml.1.2019.6
This commit is contained in:
@@ -4,12 +4,12 @@
|
||||
' Colors
|
||||
' ##################################
|
||||
|
||||
!define ELEMENT_FONT_COLOR #FFFFFF
|
||||
!global $ELEMENT_FONT_COLOR = "#FFFFFF"
|
||||
|
||||
' Styling
|
||||
' ##################################
|
||||
|
||||
!define TECHN_FONT_SIZE 12
|
||||
!global $TECHN_FONT_SIZE = 12
|
||||
|
||||
skinparam defaultTextAlignment center
|
||||
|
||||
@@ -43,64 +43,133 @@ skinparam rectangle<<boundary>> {
|
||||
' Layout
|
||||
' ##################################
|
||||
|
||||
!definelong LAYOUT_AS_SKETCH
|
||||
!function LAYOUT_AS_SKETCH()
|
||||
skinparam backgroundColor #EEEBDC
|
||||
skinparam handwritten true
|
||||
skinparam defaultFontName "Comic Sans MS"
|
||||
center footer <font color=red>Warning:</font> Created for discussion, needs to be validated
|
||||
!enddefinelong
|
||||
!endfunction
|
||||
|
||||
!define LAYOUT_TOP_DOWN top to bottom direction
|
||||
!define LAYOUT_LEFT_RIGHT left to right direction
|
||||
!function LAYOUT_TOP_DOWN()
|
||||
top to bottom direction
|
||||
!endfunction
|
||||
|
||||
!function LAYOUT_LEFT_RIGHT()
|
||||
left to right direction
|
||||
!endfunction
|
||||
|
||||
' Boundaries
|
||||
' ##################################
|
||||
|
||||
!define Boundary(e_alias, e_label) rectangle "==e_label" <<boundary>> as e_alias
|
||||
!define Boundary(e_alias, e_label, e_type) rectangle "==e_label\n<size:TECHN_FONT_SIZE>[e_type]</size>" <<boundary>> as e_alias
|
||||
!unquoted function Boundary($alias, $label)
|
||||
!return 'rectangle "=='+$label+'" <<boundary>> as '+$alias
|
||||
!endfunction
|
||||
!unquoted function Boundary($alias, $label, $type)
|
||||
!return 'rectangle "=='+$label+'\n<size:'+$TECHN_FONT_SIZE+'>['+$type+']</size>" <<boundary>> as '+$alias
|
||||
!endfunction
|
||||
|
||||
' Relationship
|
||||
' ##################################
|
||||
|
||||
!define Rel_(e_alias1, e_alias2, e_label, e_direction="") e_alias1 e_direction e_alias2 : "===e_label"
|
||||
!define Rel_(e_alias1, e_alias2, e_label, e_techn, e_direction="") e_alias1 e_direction e_alias2 : "===e_label\n//<size:TECHN_FONT_SIZE>[e_techn]</size>//"
|
||||
!unquoted function Rel_($alias1, $alias2, $label, $direction="")
|
||||
$alias1 $direction $alias2 : **$label**
|
||||
!endfunction
|
||||
!unquoted function Rel_($alias1, $alias2, $label, $techn, $direction="")
|
||||
$alias1 $direction $alias2 : **$label**\n//<size:$TECHN_FONT_SIZE>[$techn]</size>//
|
||||
!endfunction
|
||||
|
||||
!define Rel(e_from,e_to, e_label) Rel_(e_from,e_to, e_label, "-->")
|
||||
!define Rel(e_from,e_to, e_label, e_techn) Rel_(e_from,e_to, e_label, e_techn, "-->")
|
||||
!unquoted function Rel($from, $to, $label)
|
||||
Rel_($from, $to, $label, "-->")
|
||||
!endfunction
|
||||
!unquoted function Rel($from, $to, $label, $techn)
|
||||
Rel_($from, $to, $label, $techn, "-->")
|
||||
!endfunction
|
||||
|
||||
!define Rel_Back(e_to, e_from, e_label) Rel_(e_to, e_from, e_label, "<--")
|
||||
!define Rel_Back(e_to, e_from, e_label, e_techn) Rel_(e_to, e_from, e_label, e_techn, "<--")
|
||||
!unquoted function Rel_Back($from, $to, $label)
|
||||
Rel_($from, $to, $label, "<--")
|
||||
!endfunction
|
||||
!unquoted function Rel_Back($from, $to, $label, $techn)
|
||||
Rel_($from, $to, $label, $techn, "<--")
|
||||
!endfunction
|
||||
|
||||
!define Rel_Neighbor(e_from,e_to, e_label) Rel_(e_from,e_to, e_label, "->")
|
||||
!define Rel_Neighbor(e_from,e_to, e_label, e_techn) Rel_(e_from,e_to, e_label, e_techn, "->")
|
||||
!unquoted function Rel_Neighbor($from, $to, $label)
|
||||
Rel_($from, $to, $label, "->")
|
||||
!endfunction
|
||||
!unquoted function Rel_Neighbor($from, $to, $label, $techn)
|
||||
Rel_($from, $to, $label, $techn, "->")
|
||||
!endfunction
|
||||
|
||||
!define Rel_Back_Neighbor(e_to, e_from, e_label) Rel_(e_to, e_from, e_label, "<-")
|
||||
!define Rel_Back_Neighbor(e_to, e_from, e_label, e_techn) Rel_(e_to, e_from, e_label, e_techn, "<-")
|
||||
!unquoted function Rel_Back_Neighbor($from, $to, $label)
|
||||
Rel_($from, $to, $label, "<-")
|
||||
!endfunction
|
||||
!unquoted function Rel_Back_Neighbor($from, $to, $label, $techn)
|
||||
Rel_($from, $to, $label, $techn, "<-")
|
||||
!endfunction
|
||||
|
||||
!define Rel_D(e_from,e_to, e_label) Rel_(e_from,e_to, e_label, "-DOWN->")
|
||||
!define Rel_D(e_from,e_to, e_label, e_techn) Rel_(e_from,e_to, e_label, e_techn, "-DOWN->")
|
||||
!define Rel_Down(e_from,e_to, e_label) Rel_D(e_from,e_to, e_label)
|
||||
!define Rel_Down(e_from,e_to, e_label, e_techn) Rel_D(e_from,e_to, e_label, e_techn)
|
||||
!unquoted function Rel_D($from, $to, $label)
|
||||
Rel_($from, $to, $label, "-DOWN->")
|
||||
!endfunction
|
||||
!unquoted function Rel_D($from, $to, $label, $techn)
|
||||
Rel_($from, $to, $label, $techn, "-DOWN->")
|
||||
!endfunction
|
||||
!unquoted function Rel_Down($from, $to, $label)
|
||||
Rel_($from, $to, $label, "-DOWN->")
|
||||
!endfunction
|
||||
!unquoted function Rel_Down($from, $to, $label, $techn)
|
||||
Rel_($from, $to, $label, $techn, "-DOWN->")
|
||||
!endfunction
|
||||
|
||||
!define Rel_U(e_from,e_to, e_label) Rel_(e_from,e_to, e_label, "-UP->")
|
||||
!define Rel_U(e_from,e_to, e_label, e_techn) Rel_(e_from,e_to, e_label, e_techn, "-UP->")
|
||||
!define Rel_Up(e_from,e_to, e_label) Rel_U(e_from,e_to, e_label)
|
||||
!define Rel_Up(e_from,e_to, e_label, e_techn) Rel_U(e_from,e_to, e_label, e_techn)
|
||||
!unquoted function Rel_U($from, $to, $label)
|
||||
Rel_($from, $to, $label, "-UP->")
|
||||
!endfunction
|
||||
!unquoted function Rel_U($from, $to, $label, $techn)
|
||||
Rel_($from, $to, $label, $techn, "-UP->")
|
||||
!endfunction
|
||||
!unquoted function Rel_Up($from, $to, $label)
|
||||
Rel_($from, $to, $label, "-UP->")
|
||||
!endfunction
|
||||
!unquoted function Rel_Up($from, $to, $label, $techn)
|
||||
Rel_($from, $to, $label, $techn, "-UP->")
|
||||
!endfunction
|
||||
|
||||
!define Rel_L(e_from,e_to, e_label) Rel_(e_from,e_to, e_label, "-LEFT->")
|
||||
!define Rel_L(e_from,e_to, e_label, e_techn) Rel_(e_from,e_to, e_label, e_techn, "-LEFT->")
|
||||
!define Rel_Left(e_from,e_to, e_label) Rel_L(e_from,e_to, e_label)
|
||||
!define Rel_Left(e_from,e_to, e_label, e_techn) Rel_L(e_from,e_to, e_label, e_techn)
|
||||
!unquoted function Rel_L($from, $to, $label)
|
||||
Rel_($from, $to, $label, "-LEFT->")
|
||||
!endfunction
|
||||
!unquoted function Rel_L($from, $to, $label, $techn)
|
||||
Rel_($from, $to, $label, $techn, "-LEFT->")
|
||||
!endfunction
|
||||
!unquoted function Rel_Left($from, $to, $label)
|
||||
Rel_($from, $to, $label, "-LEFT->")
|
||||
!endfunction
|
||||
!unquoted function Rel_Left($from, $to, $label, $techn)
|
||||
Rel_($from, $to, $label, $techn, "-LEFT->")
|
||||
!endfunction
|
||||
|
||||
!define Rel_R(e_from,e_to, e_label) Rel_(e_from,e_to, e_label, "-RIGHT->")
|
||||
!define Rel_R(e_from,e_to, e_label, e_techn) Rel_(e_from,e_to, e_label, e_techn, "-RIGHT->")
|
||||
!define Rel_Right(e_from,e_to, e_label) Rel_R(e_from,e_to, e_label)
|
||||
!define Rel_Right(e_from,e_to, e_label, e_techn) Rel_R(e_from,e_to, e_label, e_techn)
|
||||
!unquoted function Rel_R($from, $to, $label)
|
||||
Rel_($from, $to, $label, "-RIGHT->")
|
||||
!endfunction
|
||||
!unquoted function Rel_R($from, $to, $label, $techn)
|
||||
Rel_($from, $to, $label, $techn, "-RIGHT->")
|
||||
!endfunction
|
||||
!unquoted function Rel_Right($from, $to, $label)
|
||||
Rel_($from, $to, $label, "-RIGHT->")
|
||||
!endfunction
|
||||
!unquoted function Rel_Right($from, $to, $label, $techn)
|
||||
Rel_($from, $to, $label, $techn, "-RIGHT->")
|
||||
!endfunction
|
||||
|
||||
' Layout Helpers
|
||||
' ##################################
|
||||
|
||||
!define Lay_D(e_from, e_to) e_from -[hidden]D- e_to
|
||||
!define Lay_U(e_from, e_to) e_from -[hidden]U- e_to
|
||||
!define Lay_R(e_from, e_to) e_from -[hidden]R- e_to
|
||||
!define Lay_L(e_from, e_to) e_from -[hidden]L- e_to
|
||||
!unquoted function Lay_D($from, $to)
|
||||
$from -[hidden]D- $to
|
||||
!endfunction
|
||||
!unquoted function Lay_U($from, $to)
|
||||
$from -[hidden]U- $to
|
||||
!endfunction
|
||||
!unquoted function Lay_R($from, $to)
|
||||
$from -[hidden]R- $to
|
||||
!endfunction
|
||||
!unquoted function Lay_L($from, $to)
|
||||
$from -[hidden]L- $to
|
||||
!endfunction
|
||||
+26
-18
@@ -1,4 +1,4 @@
|
||||
!includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/master/C4_Container.puml
|
||||
!include https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/master/C4_Container.puml
|
||||
' uncomment the following line and comment the first to use locally
|
||||
' !include C4_Container.puml
|
||||
|
||||
@@ -10,46 +10,54 @@
|
||||
' Colors
|
||||
' ##################################
|
||||
|
||||
!define COMPONENT_BG_COLOR #85BBF0
|
||||
!global $COMPONENT_BG_COLOR = "#85BBF0"
|
||||
|
||||
' Styling
|
||||
' ##################################
|
||||
|
||||
skinparam rectangle<<component>> {
|
||||
StereotypeFontColor ELEMENT_FONT_COLOR
|
||||
StereotypeFontColor $ELEMENT_FONT_COLOR
|
||||
FontColor #000000
|
||||
BackgroundColor COMPONENT_BG_COLOR
|
||||
BackgroundColor $COMPONENT_BG_COLOR
|
||||
BorderColor #78A8D8
|
||||
}
|
||||
|
||||
skinparam database<<component>> {
|
||||
StereotypeFontColor ELEMENT_FONT_COLOR
|
||||
StereotypeFontColor $ELEMENT_FONT_COLOR
|
||||
FontColor #000000
|
||||
BackgroundColor COMPONENT_BG_COLOR
|
||||
BackgroundColor $COMPONENT_BG_COLOR
|
||||
BorderColor #78A8D8
|
||||
}
|
||||
|
||||
' Layout
|
||||
' ##################################
|
||||
|
||||
!definelong LAYOUT_WITH_LEGEND
|
||||
!function LAYOUT_WITH_LEGEND()
|
||||
hide stereotype
|
||||
legend right
|
||||
|= |= Type |
|
||||
|<PERSON_BG_COLOR> | person |
|
||||
|<EXTERNAL_PERSON_BG_COLOR> | external person |
|
||||
|<SYSTEM_BG_COLOR> | system |
|
||||
|<EXTERNAL_SYSTEM_BG_COLOR> | external system |
|
||||
|<CONTAINER_BG_COLOR> | container |
|
||||
|<COMPONENT_BG_COLOR> | component |
|
||||
|<$PERSON_BG_COLOR> | person |
|
||||
|<$EXTERNAL_PERSON_BG_COLOR> | external person |
|
||||
|<$SYSTEM_BG_COLOR> | system |
|
||||
|<$EXTERNAL_SYSTEM_BG_COLOR> | external system |
|
||||
|<$CONTAINER_BG_COLOR> | container |
|
||||
|<$COMPONENT_BG_COLOR> | component |
|
||||
endlegend
|
||||
!enddefinelong
|
||||
!endfunction
|
||||
|
||||
' Elements
|
||||
' ##################################
|
||||
|
||||
!define Component(e_alias, e_label, e_techn) rectangle "==e_label\n//<size:TECHN_FONT_SIZE>[e_techn]</size>//" <<component>> as e_alias
|
||||
!define Component(e_alias, e_label, e_techn, e_descr) rectangle "==e_label\n//<size:TECHN_FONT_SIZE>[e_techn]</size>//\n\n e_descr" <<component>> as e_alias
|
||||
!unquoted function Component($alias, $label, $techn)
|
||||
rectangle "==$label\n//<size:$TECHN_FONT_SIZE>[$techn]</size>//" <<component>> as $alias
|
||||
!endfunction
|
||||
!unquoted function Component($alias, $label, $techn, $descr)
|
||||
rectangle "==$label\n//<size:$TECHN_FONT_SIZE>[$techn]</size>//\n\n $descr" <<component>> as $alias
|
||||
!endfunction
|
||||
|
||||
!define ComponentDb(e_alias, e_label, e_techn) database "==e_label\n//<size:TECHN_FONT_SIZE>[e_techn]</size>//" <<component>> as e_alias
|
||||
!define ComponentDb(e_alias, e_label, e_techn, e_descr) database "==e_label\n//<size:TECHN_FONT_SIZE>[e_techn]</size>//\n\n e_descr" <<component>> as e_alias
|
||||
!unquoted function ComponentDb($alias, $label, $techn)
|
||||
database "==$label\n//<size:$TECHN_FONT_SIZE>[$techn]</size>//" <<component>> as $alias
|
||||
!endfunction
|
||||
!unquoted function ComponentDb($alias, $label, $techn, $descr)
|
||||
database "==$label\n//<size:$TECHN_FONT_SIZE>[$techn]</size>//\n\n $descr" <<component>> as $alias
|
||||
!endfunction
|
||||
+30
-20
@@ -1,4 +1,4 @@
|
||||
!includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/master/C4_Context.puml
|
||||
!include https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/master/C4_Context.puml
|
||||
' uncomment the following line and comment the first to use locally
|
||||
' !include C4_Context.puml
|
||||
|
||||
@@ -10,50 +10,60 @@
|
||||
' Colors
|
||||
' ##################################
|
||||
|
||||
!define CONTAINER_BG_COLOR #438DD5
|
||||
!global $CONTAINER_BG_COLOR = "#438DD5"
|
||||
|
||||
' Styling
|
||||
' ##################################
|
||||
|
||||
skinparam rectangle<<container>> {
|
||||
StereotypeFontColor ELEMENT_FONT_COLOR
|
||||
FontColor ELEMENT_FONT_COLOR
|
||||
BackgroundColor CONTAINER_BG_COLOR
|
||||
StereotypeFontColor $ELEMENT_FONT_COLOR
|
||||
FontColor $ELEMENT_FONT_COLOR
|
||||
BackgroundColor $CONTAINER_BG_COLOR
|
||||
BorderColor #3C7FC0
|
||||
}
|
||||
|
||||
skinparam database<<container>> {
|
||||
StereotypeFontColor ELEMENT_FONT_COLOR
|
||||
FontColor ELEMENT_FONT_COLOR
|
||||
BackgroundColor CONTAINER_BG_COLOR
|
||||
StereotypeFontColor $ELEMENT_FONT_COLOR
|
||||
FontColor $ELEMENT_FONT_COLOR
|
||||
BackgroundColor $CONTAINER_BG_COLOR
|
||||
BorderColor #3C7FC0
|
||||
}
|
||||
|
||||
' Layout
|
||||
' ##################################
|
||||
|
||||
!definelong LAYOUT_WITH_LEGEND
|
||||
!function LAYOUT_WITH_LEGEND()
|
||||
hide stereotype
|
||||
legend right
|
||||
|= |= Type |
|
||||
|<PERSON_BG_COLOR> | person |
|
||||
|<EXTERNAL_PERSON_BG_COLOR> | external person |
|
||||
|<SYSTEM_BG_COLOR> | system |
|
||||
|<EXTERNAL_SYSTEM_BG_COLOR> | external system |
|
||||
|<CONTAINER_BG_COLOR> | container |
|
||||
|<$PERSON_BG_COLOR> | person |
|
||||
|<$EXTERNAL_PERSON_BG_COLOR> | external person |
|
||||
|<$SYSTEM_BG_COLOR> | system |
|
||||
|<$EXTERNAL_SYSTEM_BG_COLOR> | external system |
|
||||
|<$CONTAINER_BG_COLOR> | container |
|
||||
endlegend
|
||||
!enddefinelong
|
||||
!endfunction
|
||||
|
||||
' Elements
|
||||
' ##################################
|
||||
|
||||
!define Container(e_alias, e_label, e_techn) rectangle "==e_label\n//<size:TECHN_FONT_SIZE>[e_techn]</size>//" <<container>> as e_alias
|
||||
!define Container(e_alias, e_label, e_techn, e_descr) rectangle "==e_label\n//<size:TECHN_FONT_SIZE>[e_techn]</size>//\n\n e_descr" <<container>> as e_alias
|
||||
!unquoted function Container($alias, $label, $techn)
|
||||
rectangle "==$label\n//<size:$TECHN_FONT_SIZE>[$techn]</size>//" <<container>> as $alias
|
||||
!endfunction
|
||||
!unquoted function Container($alias, $label, $techn, $descr)
|
||||
rectangle "==$label\n//<size:$TECHN_FONT_SIZE>[$techn]</size>//\n\n $descr" <<container>> as $alias
|
||||
!endfunction
|
||||
|
||||
!define ContainerDb(e_alias, e_label, e_techn) database "==e_label\n//<size:TECHN_FONT_SIZE>[e_techn]</size>//" <<container>> as e_alias
|
||||
!define ContainerDb(e_alias, e_label, e_techn, e_descr) database "==e_label\n//<size:TECHN_FONT_SIZE>[e_techn]</size>//\n\n e_descr" <<container>> as e_alias
|
||||
!unquoted function ContainerDb($alias, $label, $techn)
|
||||
database "==$label\n//<size:$TECHN_FONT_SIZE>[$techn]</size>//" <<container>> as $alias
|
||||
!endfunction
|
||||
!unquoted function ContainerDb($alias, $label, $techn, $descr)
|
||||
database "==$label\n//<size:$TECHN_FONT_SIZE>[$techn]</size>//\n\n $descr" <<container>> as $alias
|
||||
!endfunction
|
||||
|
||||
' Boundaries
|
||||
' ##################################
|
||||
|
||||
!define Container_Boundary(e_alias, e_label) Boundary(e_alias, e_label, "Container")
|
||||
!unquoted function Container_Boundary($alias, $label)
|
||||
!return Boundary($alias, $label, "Container")
|
||||
!endfunction
|
||||
|
||||
+77
-49
@@ -1,4 +1,4 @@
|
||||
!includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/master/C4.puml
|
||||
!include https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/master/C4.puml
|
||||
' uncomment the following line and comment the first to use locally
|
||||
' !include C4.puml
|
||||
|
||||
@@ -10,93 +10,121 @@
|
||||
' Colors
|
||||
' ##################################
|
||||
|
||||
!define PERSON_BG_COLOR #08427B
|
||||
!define EXTERNAL_PERSON_BG_COLOR #686868
|
||||
!define SYSTEM_BG_COLOR #1168BD
|
||||
!define EXTERNAL_SYSTEM_BG_COLOR #999999
|
||||
!global $PERSON_BG_COLOR = "#08427B"
|
||||
!global $EXTERNAL_PERSON_BG_COLOR = "#686868"
|
||||
!global $SYSTEM_BG_COLOR = "#1168BD"
|
||||
!global $EXTERNAL_SYSTEM_BG_COLOR = "#999999"
|
||||
|
||||
' Styling
|
||||
' ##################################
|
||||
|
||||
skinparam rectangle<<person>> {
|
||||
StereotypeFontColor ELEMENT_FONT_COLOR
|
||||
FontColor ELEMENT_FONT_COLOR
|
||||
BackgroundColor PERSON_BG_COLOR
|
||||
BorderColor #073B6F
|
||||
StereotypeFontColor $ELEMENT_FONT_COLOR
|
||||
FontColor $ELEMENT_FONT_COLOR
|
||||
BackgroundColor $PERSON_BG_COLOR
|
||||
BorderColor #073B6F
|
||||
}
|
||||
|
||||
skinparam rectangle<<external_person>> {
|
||||
StereotypeFontColor ELEMENT_FONT_COLOR
|
||||
FontColor ELEMENT_FONT_COLOR
|
||||
BackgroundColor EXTERNAL_PERSON_BG_COLOR
|
||||
BorderColor #8A8A8A
|
||||
StereotypeFontColor $ELEMENT_FONT_COLOR
|
||||
FontColor $ELEMENT_FONT_COLOR
|
||||
BackgroundColor $EXTERNAL_PERSON_BG_COLOR
|
||||
BorderColor #8A8A8A
|
||||
}
|
||||
|
||||
skinparam rectangle<<system>> {
|
||||
StereotypeFontColor ELEMENT_FONT_COLOR
|
||||
FontColor ELEMENT_FONT_COLOR
|
||||
BackgroundColor SYSTEM_BG_COLOR
|
||||
BorderColor #3C7FC0
|
||||
StereotypeFontColor $ELEMENT_FONT_COLOR
|
||||
FontColor $ELEMENT_FONT_COLOR
|
||||
BackgroundColor $SYSTEM_BG_COLOR
|
||||
BorderColor #3C7FC0
|
||||
}
|
||||
|
||||
skinparam rectangle<<external_system>> {
|
||||
StereotypeFontColor ELEMENT_FONT_COLOR
|
||||
FontColor ELEMENT_FONT_COLOR
|
||||
BackgroundColor EXTERNAL_SYSTEM_BG_COLOR
|
||||
BorderColor #8A8A8A
|
||||
StereotypeFontColor $ELEMENT_FONT_COLOR
|
||||
FontColor $ELEMENT_FONT_COLOR
|
||||
BackgroundColor $EXTERNAL_SYSTEM_BG_COLOR
|
||||
BorderColor #8A8A8A
|
||||
}
|
||||
|
||||
skinparam database<<system>> {
|
||||
StereotypeFontColor ELEMENT_FONT_COLOR
|
||||
FontColor ELEMENT_FONT_COLOR
|
||||
BackgroundColor SYSTEM_BG_COLOR
|
||||
BorderColor #3C7FC0
|
||||
StereotypeFontColor $ELEMENT_FONT_COLOR
|
||||
FontColor $ELEMENT_FONT_COLOR
|
||||
BackgroundColor $SYSTEM_BG_COLOR
|
||||
BorderColor #3C7FC0
|
||||
}
|
||||
|
||||
skinparam database<<external_system>> {
|
||||
StereotypeFontColor ELEMENT_FONT_COLOR
|
||||
FontColor ELEMENT_FONT_COLOR
|
||||
BackgroundColor EXTERNAL_SYSTEM_BG_COLOR
|
||||
BorderColor #8A8A8A
|
||||
StereotypeFontColor $ELEMENT_FONT_COLOR
|
||||
FontColor $ELEMENT_FONT_COLOR
|
||||
BackgroundColor $EXTERNAL_SYSTEM_BG_COLOR
|
||||
BorderColor #8A8A8A
|
||||
}
|
||||
|
||||
' Layout
|
||||
' ##################################
|
||||
|
||||
!definelong LAYOUT_WITH_LEGEND
|
||||
!function LAYOUT_WITH_LEGEND()
|
||||
hide stereotype
|
||||
legend right
|
||||
|= |= Type |
|
||||
|<PERSON_BG_COLOR> | person |
|
||||
|<EXTERNAL_PERSON_BG_COLOR> | external person |
|
||||
|<SYSTEM_BG_COLOR> | system |
|
||||
|<EXTERNAL_SYSTEM_BG_COLOR> | external system |
|
||||
|<$PERSON_BG_COLOR> | person |
|
||||
|<$EXTERNAL_PERSON_BG_COLOR> | external person |
|
||||
|<$SYSTEM_BG_COLOR> | system |
|
||||
|<$EXTERNAL_SYSTEM_BG_COLOR> | external system |
|
||||
endlegend
|
||||
!enddefinelong
|
||||
!endfunction
|
||||
|
||||
' Elements
|
||||
' ##################################
|
||||
|
||||
!define Person(e_alias, e_label) rectangle "==e_label" <<person>> as e_alias
|
||||
!define Person(e_alias, e_label, e_descr) rectangle "==e_label\n\n e_descr" <<person>> as e_alias
|
||||
!unquoted function Person($alias, $label)
|
||||
rectangle "==$label" <<person>> as $alias
|
||||
!endfunction
|
||||
!unquoted function Person($alias, $label, $descr)
|
||||
rectangle "==$label\n\n $descr" <<person>> as $alias
|
||||
!endfunction
|
||||
|
||||
!define Person_Ext(e_alias, e_label) rectangle "==e_label" <<external_person>> as e_alias
|
||||
!define Person_Ext(e_alias, e_label, e_descr) rectangle "==e_label\n\n e_descr" <<external_person>> as e_alias
|
||||
!unquoted function Person_Ext($alias, $label)
|
||||
rectangle "==$label" <<external_person>> as $alias
|
||||
!endfunction
|
||||
!unquoted function Person_Ext($alias, $label, $descr)
|
||||
rectangle "==$label\n\n $descr" <<external_person>> as $alias
|
||||
!endfunction
|
||||
|
||||
!define System(e_alias, e_label) rectangle "==e_label" <<system>> as e_alias
|
||||
!define System(e_alias, e_label, e_descr) rectangle "==e_label\n\n e_descr" <<system>> as e_alias
|
||||
!unquoted function System($alias, $label)
|
||||
rectangle "==$label" <<system>> as $alias
|
||||
!endfunction
|
||||
!unquoted function System($alias, $label, $descr)
|
||||
rectangle "==$label\n\n $descr" <<system>> as $alias
|
||||
!endfunction
|
||||
|
||||
!define System_Ext(e_alias, e_label) rectangle "==e_label" <<external_system>> as e_alias
|
||||
!define System_Ext(e_alias, e_label, e_descr) rectangle "==e_label\n\n e_descr" <<external_system>> as e_alias
|
||||
!unquoted function System_Ext($alias, $label)
|
||||
rectangle "==$label" <<external_system>> as $alias
|
||||
!endfunction
|
||||
!unquoted function System_Ext($alias, $label, $descr)
|
||||
rectangle "==$label\n\n $descr" <<external_system>> as $alias
|
||||
!endfunction
|
||||
|
||||
!define SystemDb(e_alias, e_label) database "==e_label" <<system>> as e_alias
|
||||
!define SystemDb(e_alias, e_label, e_descr) database "==e_label\n\n e_descr" <<system>> as e_alias
|
||||
!unquoted function SystemDb($alias, $label)
|
||||
database "==$label" <<system>> as $alias
|
||||
!endfunction
|
||||
!unquoted function SystemDb($alias, $label, $descr)
|
||||
database "==$label\n\n $descr" <<system>> as $alias
|
||||
!endfunction
|
||||
|
||||
!define SystemDb_Ext(e_alias, e_label) database "==e_label" <<external_system>> as e_alias
|
||||
!define SystemDb_Ext(e_alias, e_label, e_descr) database "==e_label\n\n e_descr" <<external_system>> as e_alias
|
||||
!unquoted function SystemDb_Ext($alias, $label)
|
||||
database "==$label" <<external_system>> as $alias
|
||||
!endfunction
|
||||
!unquoted function SystemDb_ext($alias, $label, $descr)
|
||||
database "==$label\n\n $descr" <<external_system>> as $alias
|
||||
!endfunction
|
||||
|
||||
' Boundaries
|
||||
' ##################################
|
||||
|
||||
!define Enterprise_Boundary(e_alias, e_label) Boundary(e_alias, e_label, "Enterprise")
|
||||
!define System_Boundary(e_alias, e_label) Boundary(e_alias, e_label, "System")
|
||||
!unquoted function Enterprise_Boundary($alias, $label)
|
||||
!return Boundary($alias, $label, "Enterprise")
|
||||
!endfunction
|
||||
!unquoted function System_Boundary($alias, $label)
|
||||
!return Boundary($alias, $label, "System")
|
||||
!endfunction
|
||||
|
||||
+16
-17
@@ -6,16 +6,16 @@ PlantUML uses [Graphviz](https://www.graphviz.org/) for his graph visualization.
|
||||
|
||||
For this reason, C4-PlantUML also comes with some layout options.
|
||||
|
||||
## LAYOUT_TOP_DOWN or LAYOUT_LEFT_RIGHT
|
||||
## LAYOUT_TOP_DOWN() or LAYOUT_LEFT_RIGHT()
|
||||
|
||||
With the two macros `LAYOUT_TOP_DOWN` and `LAYOUT_LEFT_RIGHT` it is possible to easily change the flow visualization of the diagram. `LAYOUT_TOP_DOWN` is the default.
|
||||
With the two macros `LAYOUT_TOP_DOWN()` and `LAYOUT_LEFT_RIGHT()` it is possible to easily change the flow visualization of the diagram. `LAYOUT_TOP_DOWN()` is the default.
|
||||
|
||||
```csharp
|
||||
@startuml LAYOUT_TOP_DOWN Sample
|
||||
!includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/master/C4_Container.puml
|
||||
!include https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/master/C4_Container.puml
|
||||
|
||||
/' Not needed because this is the default '/
|
||||
LAYOUT_TOP_DOWN
|
||||
LAYOUT_TOP_DOWN()
|
||||
|
||||
Person(admin, "Administrator")
|
||||
System_Boundary(c1, 'Sample') {
|
||||
@@ -34,9 +34,9 @@ Using `LAYOUT_LEFT_RIGHT`
|
||||
|
||||
```csharp
|
||||
@startuml LAYOUT_LEFT_RIGHT Sample
|
||||
!includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/master/C4_Container.puml
|
||||
!include https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/master/C4_Container.puml
|
||||
|
||||
LAYOUT_LEFT_RIGHT
|
||||
LAYOUT_LEFT_RIGHT()
|
||||
|
||||
Person(admin, "Administrator")
|
||||
System_Boundary(c1, 'Sample') {
|
||||
@@ -51,19 +51,19 @@ Rel(web_app, twitter, "Gets tweets from", "HTTPS")
|
||||
|
||||

|
||||
|
||||
## LAYOUT_WITH_LEGEND
|
||||
## LAYOUT_WITH_LEGEND()
|
||||
|
||||
Colors can help to add additional information or simply to make the diagram more aesthetically pleasing.
|
||||
It can also help to save some space.
|
||||
|
||||
All of that is the reason, C4-PlantUML uses colors and prefer also to enable a layout without `<<stereotypes>>` and with a legend.
|
||||
This can be enabled with `LAYOUT_WITH_LEGEND`.
|
||||
This can be enabled with `LAYOUT_WITH_LEGEND()`.
|
||||
|
||||
```csharp
|
||||
@startuml LAYOUT_WITH_LEGEND Sample
|
||||
!includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/master/C4_Container.puml
|
||||
!include https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/master/C4_Container.puml
|
||||
|
||||
LAYOUT_WITH_LEGEND
|
||||
LAYOUT_WITH_LEGEND()
|
||||
|
||||
Person(admin, "Administrator")
|
||||
System_Boundary(c1, 'Sample') {
|
||||
@@ -75,10 +75,9 @@ Rel(admin, web_app, "Uses", "HTTPS")
|
||||
Rel(web_app, twitter, "Gets tweets from", "HTTPS")
|
||||
@enduml
|
||||
```
|
||||
 Sample")
|
||||
|
||||

|
||||
|
||||
## LAYOUT_AS_SKETCH
|
||||
## LAYOUT_AS_SKETCH()
|
||||
|
||||
C4-PlantUML can be especially helpful during up-front design sessions.
|
||||
One thing which is often ignored is the fact, that these software architecture sketches are just sketches.
|
||||
@@ -90,13 +89,13 @@ Without any proof
|
||||
* if they keep what they promise
|
||||
|
||||
More often these sketches are used by many people as facts and are manifested into their documentations.
|
||||
With `LAYOUT_AS_SKETCH` you can make a difference.
|
||||
With `LAYOUT_AS_SKETCH()` you can make a difference.
|
||||
|
||||
```csharp
|
||||
@startuml LAYOUT_AS_SKETCH Sample
|
||||
!includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/master/C4_Container.puml
|
||||
!include https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/master/C4_Container.puml
|
||||
|
||||
LAYOUT_AS_SKETCH
|
||||
LAYOUT_AS_SKETCH()
|
||||
|
||||
Person(admin, "Administrator")
|
||||
System_Boundary(c1, 'Sample') {
|
||||
@@ -109,4 +108,4 @@ Rel(web_app, twitter, "Gets tweets from", "HTTPS")
|
||||
@enduml
|
||||
```
|
||||
|
||||

|
||||
 Sample")
|
||||
|
||||
@@ -14,6 +14,9 @@ C4-PlantUML includes macros, stereotypes, and other goodies (like VSCode Snippet
|
||||
* [Background](#background)
|
||||
* [License](#license)
|
||||
|
||||
>### Update notice
|
||||
>Supports PlantUML version 1.2019.6
|
||||
|
||||
## Getting Started
|
||||
|
||||
At the top of your C4 PlantUML `.puml` file, you need to include the `C4_Context.puml`, `C4_Container.puml` or `C4_Component.puml` file found in the `root` of this repo.
|
||||
@@ -29,7 +32,7 @@ Just remember to change the `!include` statements inside the top of the files.
|
||||
If you want to use the always up-to-date version in this repo, use the following:
|
||||
|
||||
```c#
|
||||
!includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/release/1-0/C4_Container.puml
|
||||
!include https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/release/1-1/C4_Container.puml
|
||||
```
|
||||
|
||||
Now let's create a C4 Container diagram:
|
||||
@@ -38,7 +41,7 @@ After you have included `C4_Container.puml` you can use the defined macro defini
|
||||
|
||||
```csharp
|
||||
@startuml C4_Elements
|
||||
!includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/release/1-0/C4_Container.puml
|
||||
!include https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/release/1-1/C4_Container.puml
|
||||
|
||||
Person(personAlias, "Label", "Optional Description")
|
||||
Container(containerAlias, "Label", "Technology", "Optional Description")
|
||||
@@ -56,7 +59,7 @@ Take a look a look at the following sample of a C4 Container Diagram:
|
||||
|
||||
```csharp
|
||||
@startuml Basic Sample
|
||||
!includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/release/1-0/C4_Container.puml
|
||||
!include https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/release/1-1/C4_Container.puml
|
||||
|
||||
Person(admin, "Administrator")
|
||||
System_Boundary(c1, "Sample System") {
|
||||
@@ -74,13 +77,13 @@ Rel(web_app, twitter, "Gets tweets from", "HTTPS")
|
||||
## Supported Diagram Types
|
||||
|
||||
* System Context & System Landscape diagrams
|
||||
* Import: `!includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/release/1-0/C4_Context.puml`
|
||||
* Import: `!include https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/release/1-1/C4_Context.puml`
|
||||
* Macros: `Person`, `Person_Ext`, `System`, `System_Ext`, `SystemDb`, `SystemDb_Ext`, `Boundary`, `System_Boundary`, `Enterprise_Boundary`
|
||||
* Container diagram
|
||||
* Import: `!includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/release/1-0/C4_Container.puml`
|
||||
* Import: `!include https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/release/1-1/C4_Container.puml`
|
||||
* Additional Macros: `Container`, `ContainerDb`, `Container_Boundary`
|
||||
* Component diagram
|
||||
* Import: `!includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/release/1-0/C4_Component.puml`
|
||||
* Import: `!include https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/release/1-1/C4_Component.puml`
|
||||
* Additional Macros: `Component`, `ComponentDb`
|
||||
|
||||
Take a look at each of the [C4 Model Diagram Samples](samples/C4CoreDiagrams.md).
|
||||
@@ -100,9 +103,9 @@ It is possible to save them directly inside VS Code: [Creating your own snippets
|
||||
|
||||
C4-PlantUML also comes with some layout options to make it easy and reuseable to create nice and useful diagrams:
|
||||
|
||||
* [LAYOUT_TOP_DOWN or LAYOUT_LEFT_RIGHT](LayoutOptions.md#layout_top_down-or-layout_left_right)
|
||||
* [LAYOUT_WITH_LEGEND](LayoutOptions.md#layout_with_legend)
|
||||
* [LAYOUT_AS_SKETCH](LayoutOptions.md#layout_as_sketch)
|
||||
* [LAYOUT_TOP_DOWN() or LAYOUT_LEFT_RIGHT()](LayoutOptions.md#layout_top_down-or-layout_left_right)
|
||||
* [LAYOUT_WITH_LEGEND()](LayoutOptions.md#layout_with_legend)
|
||||
* [LAYOUT_AS_SKETCH()](LayoutOptions.md#layout_as_sketch)
|
||||
|
||||
## Advanced Samples
|
||||
|
||||
|
||||
@@ -8,7 +8,8 @@ The following samples are reproductions with C4-PlantUML from [C4 model core dia
|
||||
|
||||
Source: [C4_Context Diagram Sample - bigbankplc.puml](C4_Context%20Diagram%20Sample%20-%20bigbankplc.puml)
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
### Container Diagram
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
@startuml
|
||||
!includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/master/C4_Component.puml
|
||||
!include https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/master/C4_Component.puml
|
||||
' uncomment the following line and comment the first to use locally
|
||||
' !include C4_Component.puml
|
||||
|
||||
LAYOUT_WITH_LEGEND
|
||||
LAYOUT_WITH_LEGEND()
|
||||
|
||||
title Component diagram for Internet Banking System - API Application
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
@startuml
|
||||
!includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/master/C4_Container.puml
|
||||
!include https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/master/C4_Container.puml
|
||||
' uncomment the following line and comment the first to use locally
|
||||
' !include C4_Container.puml
|
||||
|
||||
LAYOUT_TOP_DOWN
|
||||
'LAYOUT_AS_SKETCH
|
||||
LAYOUT_WITH_LEGEND
|
||||
' LAYOUT_TOP_DOWN()
|
||||
' LAYOUT_AS_SKETCH()
|
||||
LAYOUT_WITH_LEGEND()
|
||||
|
||||
title Container diagram for Internet Banking System
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
@startuml "bigbankplc"
|
||||
!includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/master/C4_Container.puml
|
||||
!include https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/master/C4_Container.puml
|
||||
' uncomment the following line and comment the first to use locally
|
||||
' !include C4_Container.puml
|
||||
|
||||
skinparam wrapWidth 200
|
||||
skinparam maxMessageSize 200
|
||||
|
||||
LAYOUT_TOP_DOWN
|
||||
'LAYOUT_AS_SKETCH
|
||||
LAYOUT_WITH_LEGEND
|
||||
LAYOUT_TOP_DOWN()
|
||||
'LAYOUT_AS_SKETCH()
|
||||
LAYOUT_WITH_LEGEND()
|
||||
|
||||
|
||||
Person(customer, Customer, "A customer")
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
@startuml "techtribesjs"
|
||||
!includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/master/C4_Container.puml
|
||||
!include https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/master/C4_Container.puml
|
||||
' uncomment the following line and comment the first to use locally
|
||||
' !include C4_Container.puml
|
||||
|
||||
LAYOUT_TOP_DOWN
|
||||
'LAYOUT_AS_SKETCH
|
||||
LAYOUT_WITH_LEGEND
|
||||
LAYOUT_TOP_DOWN()
|
||||
'LAYOUT_AS_SKETCH()
|
||||
LAYOUT_WITH_LEGEND()
|
||||
|
||||
|
||||
Person_Ext(anonymous_user, "Anonymous User")
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
@startuml
|
||||
!includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/master/C4_Context.puml
|
||||
!include https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/master/C4_Context.puml
|
||||
' uncomment the following line and comment the first to use locally
|
||||
' !include C4_Context.puml
|
||||
|
||||
'LAYOUT_TOP_DOWN
|
||||
'LAYOUT_AS_SKETCH
|
||||
LAYOUT_WITH_LEGEND
|
||||
'LAYOUT_TOP_DOWN()
|
||||
'LAYOUT_AS_SKETCH()
|
||||
LAYOUT_WITH_LEGEND()
|
||||
|
||||
title System Landscape diagram for Big Bank plc
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
@startuml
|
||||
!includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/master/C4_Context.puml
|
||||
!include https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/master/C4_Context.puml
|
||||
' uncomment the following line and comment the first to use locally
|
||||
' !include C4_Context.puml
|
||||
|
||||
LAYOUT_WITH_LEGEND
|
||||
LAYOUT_WITH_LEGEND()
|
||||
|
||||
title System Context diagram for Internet Banking System
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
@startuml "enterprise"
|
||||
!includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/master/C4_Context.puml
|
||||
!include https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/master/C4_Context.puml
|
||||
' uncomment the following line and comment the first to use locally
|
||||
' !include C4_Context.puml
|
||||
|
||||
LAYOUT_TOP_DOWN
|
||||
'LAYOUT_AS_SKETCH
|
||||
LAYOUT_WITH_LEGEND
|
||||
LAYOUT_TOP_DOWN()
|
||||
'LAYOUT_AS_SKETCH()
|
||||
LAYOUT_WITH_LEGEND()
|
||||
|
||||
Person(customer, "Customer", "A customer of Widgets Limited.")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user