Skip to content

Commit 276a843

Browse files
committed
plantuml-stdlib#227 Boundaries can be styled via
1 parent 23ce598 commit 276a843

7 files changed

+227
-21
lines changed

C4.puml

+76-14
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ rectangle C4VersionDetailsArea <<legendArea>> [
4848
!global $LEGEND_DOTTED_LINE = "(dotted) "
4949
!global $LEGEND_DASHED_LINE = "(dashed) "
5050
!global $LEGEND_BOLD_LINE = "(bold) "
51+
!global $LEGEND_DASHED_BOUNDARY = "boundary (dashed) "
52+
!global $LEGEND_DASHED_TRANSPARENT_BOUNDARY = "boundary (dashed, transparent) "
5153

5254
!global $SKETCH_FOOTER_WARNING = "Warning:"
5355
!global $SKETCH_FOOTER_TEXT = "Created for discussion, needs to be validated"
@@ -115,21 +117,19 @@ skinparam person {
115117
}
116118

117119
' Some boundary skinparams have to be set as package skinparams too (PlantUML uses internal packages)
118-
skinparam package {
120+
' UpdateBoundaryStyle() called in boundary section below
121+
skinparam rectangle<<boundary>> {
122+
Shadowing false
119123
StereotypeFontSize 6
120124
StereotypeFontColor $BOUNDARY_BG_COLOR
121-
FontStyle plain
122-
BackgroundColor $BOUNDARY_BG_COLOR
125+
BorderStyle dashed
123126
}
124127

125-
skinparam rectangle<<boundary>> {
126-
Shadowing false
128+
skinparam package {
127129
StereotypeFontSize 6
128130
StereotypeFontColor $BOUNDARY_BG_COLOR
129-
FontColor $BOUNDARY_COLOR
130-
BorderColor $BOUNDARY_COLOR
131+
FontStyle plain
131132
BackgroundColor $BOUNDARY_BG_COLOR
132-
BorderStyle dashed
133133
}
134134

135135
' Legend and Tags
@@ -265,7 +265,7 @@ skinparam rectangle<<boundary>> {
265265
!function $elementTagSkinparams($element, $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape)
266266
!$elementSkin = "skinparam " + $element + "<<" + $tagStereo + ">> {" + %newline()
267267
!if ($fontColor != "")
268-
!if ($tagStereo != "boundary")
268+
!if (%strpos($tagStereo, "boundary") < 0)
269269
!$elementSkin = $elementSkin + " StereotypeFontColor " + $fontColor + %newline()
270270
!endif
271271
!$elementSkin = $elementSkin + " FontColor " + $fontColor + %newline()
@@ -304,9 +304,9 @@ skinparam rectangle<<boundary>> {
304304
' actor has style awesome, therefore $fontColor is ignored and text uses $bgColor too
305305
!$tagSkin = $tagSkin + $elementTagSkinparams("actor", $tagStereo, $bgColor, $bgColor, $borderColor, $shadowing, "")
306306
!$tagSkin = $tagSkin + $elementTagSkinparams("person", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "")
307-
!if ($tagStereo == "boundary" && $bgColor != "")
308-
!$tagSkin = $tagSkin + "skinparam package<<boundary>>StereotypeFontColor " + $bgColor + %newline()
309-
!$tagSkin = $tagSkin + "skinparam rectangle<<boundary>>StereotypeFontColor " + $bgColor + %newline()
307+
!if (%strpos($tagStereo, "boundary") >= 0 && $bgColor != "")
308+
!$tagSkin = $tagSkin + "skinparam package<<" + $tagStereo + ">>StereotypeFontColor " + $bgColor + %newline()
309+
!$tagSkin = $tagSkin + "skinparam rectangle<<" + $tagStereo + ">>StereotypeFontColor " + $bgColor + %newline()
310310
!endif
311311
$tagSkin
312312
!endprocedure
@@ -499,7 +499,26 @@ $elementSkin
499499
!$tagEntry = $tagEntry + $getSprite($legendSprite) + " "
500500
!endif
501501
!if ($legendText == "")
502-
!$tagEntry = $tagEntry + " " + $tagStereo + " "
502+
!if ($tagStereo == "boundary")
503+
!if ($bgColor == "#00000000" || %lower($bgColor) == "transparent")
504+
!$tagEntry = $tagEntry + " " + $LEGEND_DASHED_TRANSPARENT_BOUNDARY
505+
!else
506+
!$tagEntry = $tagEntry + " " + $LEGEND_DASHED_BOUNDARY
507+
!endif
508+
!elseif (%strpos($tagStereo, "boundary") >= 0)
509+
' if contains/ends with _boundary remove _boundary and add "boundary (dashed)"
510+
!$pos = %strpos($tagStereo, "_boundary")
511+
!if ($pos > 0)
512+
!$tagEntry = $tagEntry + " " + %substr($tagStereo, 0 ,$pos)
513+
!if ($bgColor == "#00000000" || %lower($bgColor) == "transparent")
514+
!$tagEntry = $tagEntry + " " + $LEGEND_DASHED_TRANSPARENT_BOUNDARY
515+
!else
516+
!$tagEntry = $tagEntry + " " + $LEGEND_DASHED_BOUNDARY
517+
!endif
518+
!endif
519+
!else
520+
!$tagEntry = $tagEntry + " " + $tagStereo + " "
521+
!endif
503522
!if ($shadowing == "true")
504523
!$tagEntry = $tagEntry + $LEGEND_SHADOW_TEXT
505524
!endif
@@ -1032,6 +1051,43 @@ $getLegendArea($alias, $hideStereotype)
10321051
' Boundaries
10331052
' ##################################
10341053

1054+
!unquoted procedure UpdateBoundaryStyle($elementName="", $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $type="", $legendText="")
1055+
!if ($elementName != "")
1056+
!$elementBoundary = $elementName + '_boundary'
1057+
UpdateElementStyle($elementBoundary, $bgColor, $fontColor, $borderColor, $shadowing, $shape, "", $type, $legendText, "")
1058+
!else
1059+
UpdateElementStyle("boundary", $bgColor, $fontColor, $borderColor, $shadowing, $shape, "", $type, $legendText, "")
1060+
' simulate color inheritance
1061+
UpdateBoundaryStyle("enterprise", $bgColor, $fontColor, $borderColor, $shadowing, $shape, "Enterprise", "")
1062+
UpdateBoundaryStyle("system", $bgColor, $fontColor, $borderColor, $shadowing, $shape, "System", "")
1063+
UpdateBoundaryStyle("container", $bgColor, $fontColor, $borderColor, $shadowing, $shape, "Container", "")
1064+
!endif
1065+
!endprocedure
1066+
1067+
!unquoted procedure AddBoundaryTag($tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $type="", $legendText="")
1068+
!$tagBoundary = $tagStereo + '_boundary'
1069+
AddElementTag($tagBoundary, $bgColor, $fontColor, $borderColor, $shadowing, $shape, "", $type, $legendText, "")
1070+
!endprocedure
1071+
1072+
' add _boundary to all tags that short tag version can be used
1073+
!unquoted function $addBoundaryPostfix($tags)
1074+
!if (%strlen($tags) == 0)
1075+
!return ''
1076+
!endif
1077+
!$boundaryTags = ''
1078+
!$brPos = %strpos($tags, "+")
1079+
!while ($brPos >= 0)
1080+
!$tag = %substr($tags, 0, $brPos)
1081+
!$boundaryTags = $boundaryTags + $tag + '_boundary+'
1082+
!$tags = %substr($tags, $brPos+1)
1083+
!$brPos = %strpos($tags, "+")
1084+
!endwhile
1085+
!if (%strlen($tags) > 0)
1086+
!$boundaryTags = $boundaryTags + $tags + '_boundary'
1087+
!endif
1088+
!return $boundaryTags
1089+
!endfunction
1090+
10351091
!function $getBoundary($label, $type)
10361092
!if ($type == "")
10371093
!return '==' + $label
@@ -1042,9 +1098,15 @@ $getLegendArea($alias, $hideStereotype)
10421098
!endfunction
10431099

10441100
!unquoted procedure Boundary($alias, $label, $type="", $tags="", $link="")
1045-
rectangle "$getBoundary($label, $type)" $toStereos("boundary", $tags) as $alias $getLink($link)
1101+
!$boundaryTags = $addBoundaryPostfix($tags)
1102+
' nodes $type reuses $techn definition of $boundaryTags
1103+
!$type=$toElementArg($type, $boundaryTags, "ElementTagTechn", "boundary")
1104+
rectangle "$getBoundary($label, $type)" $toStereos("boundary", $boundaryTags) as $alias $getLink($link)
10461105
!endprocedure
10471106

1107+
' Boundary Styling
1108+
UpdateBoundaryStyle("", $bgColor=$BOUNDARY_BG_COLOR, $fontColor=$BOUNDARY_COLOR, $borderColor=$BOUNDARY_COLOR)
1109+
10481110
' Relationship
10491111
' ##################################
10501112

C4_Component.puml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ UpdateElementStyle("external_component", $EXTERNAL_COMPONENT_BG_COLOR, $COMPONEN
3737
' Layout
3838
' ##################################
3939

40-
SetDefaultLegendEntries("person\nsystem\ncontainer\ncomponent\nexternal_person\nexternal_system\nexternal_container\nexternal_component")
40+
SetDefaultLegendEntries("person\nsystem\ncontainer\ncomponent\nexternal_person\nexternal_system\nexternal_container\nexternal_component\nenterprise_boundary\nsystem_boundary\ncontainer_boundary\nboundary")
4141

4242
!procedure LAYOUT_WITH_LEGEND()
4343
hide stereotype

C4_Container.puml

+14-2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
UpdateElementStyle("container", $CONTAINER_BG_COLOR, $ELEMENT_FONT_COLOR, $CONTAINER_BORDER_COLOR)
2424
UpdateElementStyle("external_container", $EXTERNAL_CONTAINER_BG_COLOR, $ELEMENT_FONT_COLOR, $EXTERNAL_CONTAINER_BORDER_COLOR)
2525

26+
UpdateBoundaryStyle("container", $bgColor=$BOUNDARY_BG_COLOR, $fontColor=$BOUNDARY_COLOR, $borderColor=$BOUNDARY_COLOR, $type="Container")
27+
2628
' shortcuts with default colors
2729
!unquoted procedure AddContainerTag($tagStereo, $bgColor=$CONTAINER_BG_COLOR, $fontColor=$ELEMENT_FONT_COLOR, $borderColor=$CONTAINER_BORDER_COLOR, $shadowing="", $shape="", $sprite="", $techn="", $legendText="", $legendSprite="")
2830
AddElementTag($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $techn, $legendText, $legendSprite)
@@ -31,10 +33,14 @@ UpdateElementStyle("external_container", $EXTERNAL_CONTAINER_BG_COLOR, $ELEMENT_
3133
AddElementTag($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $techn, $legendText, $legendSprite)
3234
!endprocedure
3335

36+
!unquoted procedure UpdateContainerBoundaryStyle($bgColor=$BOUNDARY_BG_COLOR, $fontColor=$BOUNDARY_COLOR, $borderColor=$BOUNDARY_COLOR, $shadowing="", $shape="", $type="Container", $legendText="")
37+
UpdateBoundaryStyle("container", $bgColor, $fontColor, $borderColor, $shadowing, $shape, $type, $legendText)
38+
!endprocedure
39+
3440
' Layout
3541
' ##################################
3642

37-
SetDefaultLegendEntries("person\nsystem\ncontainer\nexternal_person\nexternal_system\nexternal_container")
43+
SetDefaultLegendEntries("person\nsystem\ncontainer\nexternal_person\nexternal_system\nexternal_container\nenterprise_boundary\nsystem_boundary\ncontainer_boundary\nboundary")
3844

3945
!procedure LAYOUT_WITH_LEGEND()
4046
hide stereotype
@@ -107,5 +113,11 @@ queue "$getContainer($label, $techn, $descr, $sprite)$getProps()" $toStereos("ex
107113
' ##################################
108114

109115
!unquoted procedure Container_Boundary($alias, $label, $tags="", $link="")
110-
Boundary($alias, $label, "Container", $tags, $link)
116+
!if ($tags != "")
117+
!$allTags = $tags + '+container'
118+
!else
119+
!$allTags = 'container'
120+
!endif
121+
' $type defined via $tag style
122+
Boundary($alias, $label, "", $allTags, $link)
111123
!endprocedure

C4_Context.puml

+25-3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ UpdateElementStyle("external_person", $EXTERNAL_PERSON_BG_COLOR, $ELEMENT_FONT_C
3030
UpdateElementStyle("system", $SYSTEM_BG_COLOR, $ELEMENT_FONT_COLOR, $SYSTEM_BORDER_COLOR)
3131
UpdateElementStyle("external_system", $EXTERNAL_SYSTEM_BG_COLOR, $ELEMENT_FONT_COLOR, $EXTERNAL_SYSTEM_BORDER_COLOR)
3232

33+
UpdateBoundaryStyle("enterprise", $bgColor=$BOUNDARY_BG_COLOR, $fontColor=$BOUNDARY_COLOR, $borderColor=$BOUNDARY_COLOR, $type="Enterprise")
34+
UpdateBoundaryStyle("system", $bgColor=$BOUNDARY_BG_COLOR, $fontColor=$BOUNDARY_COLOR, $borderColor=$BOUNDARY_COLOR, $type="System")
35+
3336
' shortcuts with default colors
3437
!unquoted procedure AddPersonTag($tagStereo, $bgColor=$PERSON_BG_COLOR, $fontColor=$ELEMENT_FONT_COLOR, $borderColor=$PERSON_BORDER_COLOR, $shadowing="", $shape="", $sprite="", $legendText="", $legendSprite="")
3538
AddElementTag($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, "", $legendText, $legendSprite)
@@ -44,6 +47,13 @@ UpdateElementStyle("external_system", $EXTERNAL_SYSTEM_BG_COLOR, $ELEMENT_FONT_C
4447
AddElementTag($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, "", $legendText, $legendSprite)
4548
!endprocedure
4649

50+
!unquoted procedure UpdateEnterpriseBoundaryStyle($bgColor=$BOUNDARY_BG_COLOR, $fontColor=$BOUNDARY_COLOR, $borderColor=$BOUNDARY_COLOR, $shadowing="", $shape="", $type="Enterprise", $legendText="")
51+
UpdateBoundaryStyle("enterprise", $bgColor, $fontColor, $borderColor, $shadowing, $shape, $type, $legendText)
52+
!endprocedure
53+
!unquoted procedure UpdateSystemBoundaryStyle($bgColor=$BOUNDARY_BG_COLOR, $fontColor=$BOUNDARY_COLOR, $borderColor=$BOUNDARY_COLOR, $shadowing="", $shape="", $type="System", $legendText="")
54+
UpdateBoundaryStyle("system", $bgColor, $fontColor, $borderColor, $shadowing, $shape, $type, $legendText)
55+
!endprocedure
56+
4757
' Sprites
4858
' ##################################
4959

@@ -152,7 +162,7 @@ sprite $person2 [48x48/16] {
152162
' Layout
153163
' ##################################
154164

155-
SetDefaultLegendEntries("person\nsystem\nexternal_person\nexternal_system")
165+
SetDefaultLegendEntries("person\nsystem\nexternal_person\nexternal_system\nenterprise_boundary\nsystem_boundary\nboundary")
156166

157167
!procedure LAYOUT_WITH_LEGEND()
158168
hide stereotype
@@ -284,9 +294,21 @@ queue "$getSystem($label, $descr, $sprite)$getProps()" $toStereos("external_syst
284294
' ##################################
285295

286296
!unquoted procedure Enterprise_Boundary($alias, $label, $tags="", $link="")
287-
Boundary($alias, $label, "Enterprise", $tags, $link)
297+
!if ($tags != "")
298+
!$allTags = $tags + '+enterprise'
299+
!else
300+
!$allTags = 'enterprise'
301+
!endif
302+
' $type defined via $tag style
303+
Boundary($alias, $label, "", $allTags, $link)
288304
!endprocedure
289305

290306
!unquoted procedure System_Boundary($alias, $label, $tags="", $link="")
291-
Boundary($alias, $label, "System", $tags, $link)
307+
!if ($tags != "")
308+
!$allTags = $tags + '+system'
309+
!else
310+
!$allTags = 'system'
311+
!endif
312+
' $type defined via $tag style
313+
Boundary($alias, $label, "", $allTags, $link)
292314
!endprocedure

C4_Deployment.puml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ skinparam rectangle<<node>> {
3030
' ##################################
3131

3232
' comment if node should not be added to legend. No calculated legend extension required
33-
SetDefaultLegendEntries("person\nsystem\ncontainer\nexternal_person\nexternal_system\nexternal_container\nnode")
33+
SetDefaultLegendEntries("person\nsystem\ncontainer\nexternal_person\nexternal_system\nexternal_container\nnode\nenterprise_boundary\nsystem_boundary\ncontainer_boundary\nboundary")
3434

3535
' Line breaks
3636
' ##################################

README.md

+61
Original file line numberDiff line numberDiff line change
@@ -462,10 +462,15 @@ Additional tags/stereotypes can be added to the existing element stereotypes (co
462462
Introduces a new element tag. The styles of the tagged elements are updated and the tag is displayed in the calculated legend.
463463
* `AddRelTag(tagStereo, ?textColor, ?lineColor, ?lineStyle, ?sprite, ?techn, ?legendText, ?legendSprite)`:
464464
Introduces a new Relationship tag. The styles of the tagged relationships are updated and the tag is displayed in the calculated legend.
465+
* `AddBoundaryTag(tagStereo, ?bgColor, ?fontColor, ?borderColor, ?shadowing, ?shape, ?type, ?legendText)`:
466+
Introduces a new Boundary tag. The styles of the tagged boundaries are updated and the tag is displayed in the calculated legend.
465467
* `UpdateElementStyle(elementName, ?bgColor, ?fontColor, ?borderColor, ?shadowing, ?shape, ?sprite, ?techn, ?legendText, ?legendSprite)`:
466468
This call updates the default style of the elements (component, ...) and creates no additional legend entry.
467469
* `UpdateRelStyle(textColor, lineColor)`:
468470
This call updates the default relationship colors and creates no additional legend entry.
471+
* `UpdateBoundaryStyle(?elementName, ?bgColor, ?fontColor, ?borderColor, ?shadowing, ?shape, ?type, ?legendText)
472+
This call updates the default style of the existing boundaries and creates no additional legend entry.
473+
If the element name is "" then it updates generic, enterprise, system and container boundary style in on call.
469474
* `RoundedBoxShape()`: This call returns the name of the rounded box shape and can be used as ?shape argument.
470475
* `EightSidedShape()`: This call returns the name of the eight sided shape and can be used as ?shape argument.
471476
* `DashedLine()`: This call returns the name of the dashed line and can be used as ?lineStyle argument.
@@ -498,6 +503,13 @@ Following calls introduces new element tags with element specific default colors
498503
* `AddNodeTag(tagStereo, ?bgColor, ?fontColor, ?borderColor, ?shadowing, ?shape, ?sprite, ?techn, ?legendText, ?legendSprite)`
499504
(node specific: $type reuses $techn definition of $tags)
500505

506+
**Boundary specific tag definitions**
507+
508+
Like the element specific tag definitions exist boundary specific calls with their default colors **and type**:
509+
* `UpdateContainerBoundaryStyle(?bgColor, ?fontColor, ?borderColor, ?shadowing, ?shape, ?type, ?legendText)`
510+
* `UpdateSystemBoundaryStyle(?bgColor, ?fontColor, ?borderColor, ?shadowing, ?shape, ?type, ?legendText)`
511+
* `UpdateEnterpriseBoundaryStyle(?bgColor, ?fontColor, ?borderColor, ?shadowing, ?shape, ?type, ?legendText)`
512+
501513
**Comments**
502514

503515
* `SHOW_LEGEND()` supports the customized stereotypes
@@ -616,6 +628,55 @@ SHOW_LEGEND()
616628

617629
![tags with sprites and custom legend](https://www.plantuml.com/plantuml/png/dLJTRkCs4xttKt2DlN00nyewNxu0HRDOnqwxNJYRr3_DfJ0Inx9QYbH9AevHzDqxf6tHiPMVDbSHvvmpXpE7_c8iQ5iLelKXbwceEBAbjQNv8Oeqh7fPRfTLKXdKgP8MfUsbgeXA0T9nJetb8a-YuVzExztH_7OS5M0iQZgAXyI0NABkbKw_zO7ZWZwPCd1F1-_eCzHWbiYBNF9er-1KbIWDffNExHfqkimjfhRIs3_DYMks1i9rjksYeIeA9RsNu-BSa6SGObCEzH_LOf6d64rHFw8s4GSB2HYCZJ_u_39oaOjteA0iHPw2pPLy6Ko3JB6q9d88EeZtMA_15xd65GZnkTKQS7xpP55B4FVKLyaPP9qsI2NNXQfCZ4-stMKVJKbJnQksCX2xPSI9WFIFU0c-AZ13oMU4lGfKvd3j4zTXJpcjZ5K5waPH0Jh3EDEgAezaiqnZ1XPviowuC3IAGiLpsqsLKFfA8m_2qsQaIK7WrLclVn58HsvSjznOxKUzS-GirTdshbQO3CfotzRnNW-rYSC8nTAT4YaV2VDaNpI4hq4nb5-NTBaq-whke5dHbzYczBee5Gy6q13LGtKY6INmQ0fEVeB22-yYxBYMM4E_glR7mMHozn0FxyPt4ozBrAPIC5GhrOi_Vsdl0UlCRC8Nq-lfr9dtEUgozhLAl378pDN1OphP4ZiXqJlM58ek--LHIGpa-hq4thFirHrHInve7kHSJjV6OX5VgqfoqEjE-ed05jEbrNc2flUxQP_yrMBqLo-kGmbqwo7W0sLny6nHxM_m25tctexCsErlmowRgOBAxBBt5FflWt_oN7cKT3IAc2UaGulqcY3OQ9jF9t-xdluwPXUzYtqrdXmgTNnQ_Ts8z9EBu-QcRVSvc9tt0zj36wn8PVuK1F-kN4jdWasjqXiRIcPgTCtwlVuRHggIW_Khc6_-sms9NJgK3x8RHTYeaflH_DrgqH2EmXEcFpTedDhNsUn-6WH223q_vEY_2Xm6wj-AU9MQiBTXu8Ojj2eOICvMxhaPPfKJeub7tqRNb9vIQSlEpy_-lt4JTCA6dsaTmdPR38Zz_Qt89IkriYfLOjkiVtdswN9hEvw71RvXd53mbliWT-3_eRxy4IvSe7bSxxxE6DRnf7vWeJsLfb_fbszyy_FDzr7dfFK59QyAyGy0 "tags with sprites and custom legend")
618630

631+
**Sample with different boundary tag combinations**
632+
633+
```plantuml
634+
@startuml
635+
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Component.puml
636+
637+
' Update the generic boundary style and the "system", "enterprise", "container" boundaries styles too
638+
UpdateBoundaryStyle($bgColor="gold", $fontColor="brown", $borderColor="brown")
639+
' (Re-)Updates the system boundary styles; re-set $bgColor avoids '(no back color)' in legend too
640+
UpdateSystemBoundaryStyle($bgColor="gold", $fontColor="white", $borderColor="white")
641+
642+
Boundary(b, "A Boundary") {
643+
}
644+
645+
Container_Boundary(cb, "A Container Boundary") {
646+
}
647+
648+
System_Boundary(sb, "A System Boundary") {
649+
}
650+
651+
' defines a new border style incl. new border type
652+
AddBoundaryTag("repository", $bgColor="green", $fontColor="white", $borderColor="white", $shadowing="true", $shape = RoundedBoxShape(), $type="GitHub repository")
653+
654+
Boundary(c4Respository, "plantuml-stdlib/C4-PlantUML", $tags="repository") {
655+
Component(readMe, "README.md", "Markdown")
656+
}
657+
658+
' boundary tags are internally extended with '_boundary' that it uses a different name space
659+
' this enables different element and boundary styles for the same tag name
660+
AddBoundaryTag("v1", $bgColor="lightgreen", $fontColor="green", $borderColor="green")
661+
AddElementTag("v1", $bgColor="lightred", $fontColor="red", $borderColor="red")
662+
663+
Boundary(anotherBoundary, "Another Boundary", $type="BOUNDARY TYPE", $tags="v1") {
664+
Component(anotherComponent, "Another Component", $techn="COMPONENT TYPE", $tags="v1", $descr="Component and boundary use different tag name spaces that both v1 tags can use different styles")
665+
}
666+
667+
Lay_R(b, cb)
668+
Lay_R(cb, sb)
669+
670+
Lay_D(b, c4Respository)
671+
672+
Lay_R(c4Respository, anotherBoundary)
673+
674+
SHOW_LEGEND()
675+
@enduml
676+
```
677+
678+
![custom border tags](https://www.plantuml.com/plantuml/png/bLHHRzem47xFhxX5bKYa0ghKfqr8fO3QXm8Lj9hwX9puIAmcTcGxfMZQVvyF4vg6RTgUsllkxlEN--wuCPPfMvT5y4N8jAWvGcvjPRuEXvhj1fcmUPtK1dMgf4Lf1wagXrN19FNqZUM5I8QJw_uZGS_pXs79Z4NjeCr4bPMIr5CHVz23vuepYs1pX0mbQf52ech9cTw3iVi2WKb-I8TcxsZAy192Hu2wqi8WHII32TSRDgq2ZMysO9KA_1ktHzer9QAB99keGkbHcAc2EvgBhQCvGebMEqbOeZH7_GcDdUXeXVtOivg3DY-jezny0urzWnQQnu2zAS4Dz2Af867fAwG4npqG4WhCKFAMuFM1z3zaxt9XiIExGUCWQ9YYn0rj34qOnl0Z-1a4asQCcrDXwYjFcRCUB_6ZmVW63vzLzu3Zrl4OO21n1rxcqMPQjK4RjliAWp7d3SiJow9GOwMCiCgHNa9h61fH_liq23KvusedP3OAhQuRg48OmOfUHFVm-vgGA7OvKZCAxuIzhnDegMZFDRrUeMaoRX1_kOcGA5bcHkqleZ41d6uaqiZu71tHQZQUpcU3aWmFvqo_Sh-9DDEFfIC-O9f6QL5BLXHxm7UBz2sm4pQ7tgOfxe7DcGLXeJO7FxZORb6Zj21PYM0gbc90LS80IfOKQ5erM619VvdatQM7hTB-9eZ7QIB2SoFVhZuPM8WijxzpqMDT5pqQ4-lCI_aZgSRkcH3I9IIiRIMJokQecvYscf3s2PoMudRvl9YELo_mzF8uEnbBOZg6Dgmde4LxmWu4cEPo54wMyyVbOhPuEcEc_pcQr2dtZLqpoDQMNwwlvQlnvYVkPNYxydkJCjdfyNRwBNjW-ysAVZVI93u6gOkCYmxXz91hht_SD7MEeZDOLxQ-NtxVFCpkPejf50StABaxcLy0 "custom border tags")
679+
619680
**Custom schema definition**
620681

621682
If the custom (color) schema is defined via `UpdateElementStyle()` then the legend of existing elements is updated too.

0 commit comments

Comments
 (0)