forked from plantuml-stdlib/C4-PlantUML
-
Notifications
You must be signed in to change notification settings - Fork 28
/
C4.puml
249 lines (213 loc) · 6.84 KB
/
C4.puml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
' C4-PlantUML
' https://github.com/adrianvlupu/C4-PlantUML
' Colors
' ##################################
!global $ELEMENT_FONT_COLOR = "#FFFFFF"
!global $LEGEND_FONT_COLOR = "#FFFFFF"
!global $LEGEND_TITLE_COLOR = "#000000"
' Styling
' ##################################
!global $TECHN_FONT_SIZE = 12
skinparam defaultTextAlignment center
skinparam wrapWidth 200
skinparam maxMessageSize 150
skinparam LegendBorderColor transparent
skinparam LegendBackgroundColor transparent
skinparam LegendFontColor $LEGEND_FONT_COLOR
skinparam rectangle {
StereotypeFontSize 12
shadowing false
}
skinparam database {
StereotypeFontSize 12
shadowing false
}
skinparam queue {
StereotypeFontSize 12
shadowing false
}
skinparam Arrow {
Color #666666
FontColor #666666
FontSize 12
}
skinparam rectangle<<boundary>> {
Shadowing false
StereotypeFontSize 0
FontColor #444444
BorderColor #444444
BorderStyle dashed
}
' Layout
' ##################################
!procedure HIDE_STEREOTYPE()
hide stereotype
!endprocedure
!procedure 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
!endprocedure
!procedure LAYOUT_TOP_DOWN()
top to bottom direction
!endprocedure
!procedure LAYOUT_LEFT_RIGHT()
left to right direction
!endprocedure
' Boundaries
' ##################################
!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
' ##################################
!unquoted procedure Rel_($alias1, $alias2, $label, $direction="")
$alias1 $direction $alias2 : **$label**
!endprocedure
!unquoted procedure Rel_($alias1, $alias2, $label, $techn, $direction="")
$alias1 $direction $alias2 : **$label**\n//<size:$TECHN_FONT_SIZE>[$techn]</size>//
!endprocedure
!unquoted procedure Rel($from, $to, $label)
Rel_($from, $to, $label, "-->>")
!endprocedure
!unquoted procedure Rel($from, $to, $label, $techn)
Rel_($from, $to, $label, $techn, "-->>")
!endprocedure
!unquoted procedure BiRel($from, $to, $label)
Rel_($from, $to, $label, "<<-->>")
!endprocedure
!unquoted procedure BiRel($from, $to, $label, $techn)
Rel_($from, $to, $label, $techn, "<<-->>")
!endprocedure
!unquoted procedure Rel_Back($from, $to, $label)
Rel_($from, $to, $label, "<<--")
!endprocedure
!unquoted procedure Rel_Back($from, $to, $label, $techn)
Rel_($from, $to, $label, $techn, "<<--")
!endprocedure
!unquoted procedure Rel_Neighbor($from, $to, $label)
Rel_($from, $to, $label, "->>")
!endprocedure
!unquoted procedure Rel_Neighbor($from, $to, $label, $techn)
Rel_($from, $to, $label, $techn, "->>")
!endprocedure
!unquoted procedure Rel_Back_Neighbor($from, $to, $label)
Rel_($from, $to, $label, "<<-")
!endprocedure
!unquoted procedure Rel_Back_Neighbor($from, $to, $label, $techn)
Rel_($from, $to, $label, $techn, "<<-")
!endprocedure
!unquoted procedure Rel_D($from, $to, $label)
Rel_($from, $to, $label, "-DOWN->>")
!endprocedure
!unquoted procedure Rel_D($from, $to, $label, $techn)
Rel_($from, $to, $label, $techn, "-DOWN->>")
!endprocedure
!unquoted procedure Rel_Down($from, $to, $label)
Rel_($from, $to, $label, "-DOWN->>")
!endprocedure
!unquoted procedure Rel_Down($from, $to, $label, $techn)
Rel_($from, $to, $label, $techn, "-DOWN->>")
!endprocedure
!unquoted procedure BiRel_D($from, $to, $label)
Rel_($from, $to, $label, "<<-DOWN->>")
!endprocedure
!unquoted procedure BiRel_D($from, $to, $label, $techn)
Rel_($from, $to, $label, $techn, "<<-DOWN->>")
!endprocedure
!unquoted procedure BiRel_Down($from, $to, $label)
Rel_($from, $to, $label, "<<-DOWN->>")
!endprocedure
!unquoted procedure BiRel_Down($from, $to, $label, $techn)
Rel_($from, $to, $label, $techn, "<<-DOWN->>")
!endprocedure
!unquoted procedure Rel_U($from, $to, $label)
Rel_($from, $to, $label, "-UP->>")
!endprocedure
!unquoted procedure Rel_U($from, $to, $label, $techn)
Rel_($from, $to, $label, $techn, "-UP->>")
!endprocedure
!unquoted procedure Rel_Up($from, $to, $label)
Rel_($from, $to, $label, "-UP->>")
!endprocedure
!unquoted procedure Rel_Up($from, $to, $label, $techn)
Rel_($from, $to, $label, $techn, "-UP->>")
!endprocedure
!unquoted procedure BiRel_U($from, $to, $label)
Rel_($from, $to, $label, "<<-UP->>")
!endprocedure
!unquoted procedure BiRel_U($from, $to, $label, $techn)
Rel_($from, $to, $label, $techn, "<<-UP->>")
!endprocedure
!unquoted procedure BiRel_Up($from, $to, $label)
Rel_($from, $to, $label, "<<-UP->>")
!endprocedure
!unquoted procedure BiRel_Up($from, $to, $label, $techn)
Rel_($from, $to, $label, $techn, "<<-UP->>")
!endprocedure
!unquoted procedure Rel_L($from, $to, $label)
Rel_($from, $to, $label, "-LEFT->>")
!endprocedure
!unquoted procedure Rel_L($from, $to, $label, $techn)
Rel_($from, $to, $label, $techn, "-LEFT->>")
!endprocedure
!unquoted procedure Rel_Left($from, $to, $label)
Rel_($from, $to, $label, "-LEFT->>")
!endprocedure
!unquoted procedure Rel_Left($from, $to, $label, $techn)
Rel_($from, $to, $label, $techn, "-LEFT->>")
!endprocedure
!unquoted procedure BiRel_L($from, $to, $label)
Rel_($from, $to, $label, "<<-LEFT->>")
!endprocedure
!unquoted procedure BiRel_L($from, $to, $label, $techn)
Rel_($from, $to, $label, $techn, "<<-LEFT->>")
!endprocedure
!unquoted procedure BiRel_Left($from, $to, $label)
Rel_($from, $to, $label, "<<-LEFT->>")
!endprocedure
!unquoted procedure BiRel_Left($from, $to, $label, $techn)
Rel_($from, $to, $label, $techn, "<<-LEFT->>")
!endprocedure
!unquoted procedure Rel_R($from, $to, $label)
Rel_($from, $to, $label, "-RIGHT->>")
!endprocedure
!unquoted procedure Rel_R($from, $to, $label, $techn)
Rel_($from, $to, $label, $techn, "-RIGHT->>")
!endprocedure
!unquoted procedure Rel_Right($from, $to, $label)
Rel_($from, $to, $label, "-RIGHT->>")
!endprocedure
!unquoted procedure Rel_Right($from, $to, $label, $techn)
Rel_($from, $to, $label, $techn, "-RIGHT->>")
!endprocedure
!unquoted procedure BiRel_R($from, $to, $label)
Rel_($from, $to, $label, "<<-RIGHT->>")
!endprocedure
!unquoted procedure BiRel_R($from, $to, $label, $techn)
Rel_($from, $to, $label, $techn, "<<-RIGHT->>")
!endprocedure
!unquoted procedure BiRel_Right($from, $to, $label)
Rel_($from, $to, $label, "<<-RIGHT->>")
!endprocedure
!unquoted procedure BiRel_Right($from, $to, $label, $techn)
Rel_($from, $to, $label, $techn, "<<-RIGHT->>")
!endprocedure
' Layout Helpers
' ##################################
!unquoted procedure Lay_D($from, $to)
$from -[hidden]D- $to
!endprocedure
!unquoted procedure Lay_U($from, $to)
$from -[hidden]U- $to
!endprocedure
!unquoted procedure Lay_R($from, $to)
$from -[hidden]R- $to
!endprocedure
!unquoted procedure Lay_L($from, $to)
$from -[hidden]L- $to
!endprocedure