Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update C4-PlantUML to v2.9.0 #93

Merged
merged 2 commits into from
Feb 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 94 additions & 2 deletions C4/C4.puml
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
' C4-PlantUML

' Global pre-settings
' ##################################
' ENABLE_ALL_PLANT_ELEMENTS
' If ENABLE_ALL_PLANT_ELEMENTS is set BEFORE the first C4_* file is loaded, nearly "all" PlantUML elements can be used like
' Component(StorageA, "Storage A ", $baseShape="storage")
' ENABLE_ALL_PLANT_ELEMENTS can be set via
' !ENABLE_ALL_PLANT_ELEMENTS = 1
' or with additional command line argument -DENABLE_ALL_PLANT_ELEMENTS=1

'Version
' ##################################
!function C4Version()
' 2 spaces and ' are used as unique marker, that the release scripts makes the correct version update
!$c4Version = "2.8.0"
!$c4Version = "2.9.0"
!return $c4Version
!end function

Expand Down Expand Up @@ -159,6 +168,66 @@ skinparam actor {
style awesome
}

!if %variable_exists("ENABLE_ALL_PLANT_ELEMENTS")
skinparam agent {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}
skinparam artifact {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}
skinparam boundary {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}
skinparam card {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}
skinparam circle {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}
skinparam cloud {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}
skinparam collections {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}
skinparam control {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}
skinparam entity {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}
skinparam file {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}
skinparam folder {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}
skinparam frame {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}
skinparam hexagon {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}
skinparam interface {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}
skinparam label {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}
skinparam stack {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}
skinparam storage {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}
skinparam usecase {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}
skinparam person {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}
!endif

' Some boundary skinparams have to be set as package skinparams too (PlantUML uses internal packages)
' UpdateBoundaryStyle() called in boundary section below
skinparam rectangle<<boundary>> {
Expand Down Expand Up @@ -378,6 +447,29 @@ skinparam package {
!$tagSkin = $tagSkin + "skinparam package<<" + $tagStereo + ">>StereotypeFontColor " + $bgColor + %newline()
!$tagSkin = $tagSkin + "skinparam rectangle<<" + $tagStereo + ">>StereotypeFontColor " + $bgColor + %newline()
!endif
!if %variable_exists("ENABLE_ALL_PLANT_ELEMENTS")
!$tagSkin = $tagSkin + $elementTagSkinparams("agent", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness)
!$tagSkin = $tagSkin + $elementTagSkinparams("artifact", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness)
!$tagSkin = $tagSkin + $elementTagSkinparams("card", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness)
!$tagSkin = $tagSkin + $elementTagSkinparams("cloud", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness)
!$tagSkin = $tagSkin + $elementTagSkinparams("collections", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness)
!$tagSkin = $tagSkin + $elementTagSkinparams("file", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness)
!$tagSkin = $tagSkin + $elementTagSkinparams("folder", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness)
!$tagSkin = $tagSkin + $elementTagSkinparams("frame", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness)
!$tagSkin = $tagSkin + $elementTagSkinparams("hexagon", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness)
!$tagSkin = $tagSkin + $elementTagSkinparams("package", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness)
!$tagSkin = $tagSkin + $elementTagSkinparams("stack", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness)
!$tagSkin = $tagSkin + $elementTagSkinparams("storage", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness)
!$tagSkin = $tagSkin + $elementTagSkinparams("usecase", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness)
' elements without background: font uses $bgColor
!$tagSkin = $tagSkin + $elementTagSkinparams("boundary", $tagStereo, $bgColor, $bgColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness)
!$tagSkin = $tagSkin + $elementTagSkinparams("circle", $tagStereo, $bgColor, $bgColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness)
!$tagSkin = $tagSkin + $elementTagSkinparams("control", $tagStereo, $bgColor, $bgColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness)
!$tagSkin = $tagSkin + $elementTagSkinparams("entity", $tagStereo, $bgColor, $bgColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness)
!$tagSkin = $tagSkin + $elementTagSkinparams("interface", $tagStereo, $bgColor, $bgColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness)
' label uses wrong font color? (should be $bgColor too)
!$tagSkin = $tagSkin + $elementTagSkinparams("label", $tagStereo, $bgColor, $bgColor, $borderColor, $shadowing, "", $borderStyle, $borderThickness)
!endif
$tagSkin
!endprocedure

Expand Down Expand Up @@ -1274,7 +1366,7 @@ SHOW_LEGEND($hideStereotype)
!endfunction

' enables that legend can be located in drawing area of the diagram. It has to be last call in diagram followed by Lay_Distance()
!unquoted procedure SHOW_FLOATING_LEGEND($alias=LEGEND(), $hideStereotype="true", $details=Normal())
!unquoted procedure SHOW_FLOATING_LEGEND($alias=LEGEND(), $hideStereotype="true", $details=Small())
$getLegendArea($alias, $hideStereotype, $details)
!endprocedure

Expand Down
8 changes: 4 additions & 4 deletions C4/C4_Component.puml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ endlegend
' Elements
' ##################################

!unquoted procedure Component($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
$getElementLine("rectangle", "component", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!unquoted procedure Component($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $baseShape="rectangle")
$getElementLine($baseShape, "component", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure ComponentDb($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
Expand All @@ -65,8 +65,8 @@ endlegend
$getElementLine("queue", "component", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure Component_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
$getElementLine("rectangle", "external_component", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!unquoted procedure Component_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $baseShape="rectangle")
$getElementLine($baseShape, "external_component", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure ComponentDb_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
Expand Down
8 changes: 4 additions & 4 deletions C4/C4_Container.puml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ endlegend
' Elements
' ##################################

!unquoted procedure Container($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
$getElementLine("rectangle", "container", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!unquoted procedure Container($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $baseShape="rectangle")
$getElementLine($baseShape , "container", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure ContainerDb($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
Expand All @@ -72,8 +72,8 @@ endlegend
$getElementLine("queue", "container", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure Container_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
$getElementLine("rectangle", "external_container", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!unquoted procedure Container_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $baseShape="rectangle")
$getElementLine($baseShape , "external_container", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure ContainerDb_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
Expand Down
8 changes: 4 additions & 4 deletions C4/C4_Context.puml
Original file line number Diff line number Diff line change
Expand Up @@ -375,9 +375,9 @@ rectangle "$getPerson($label, $type, $descr, $sprite)$getProps()" $toStereos("ex
!endif
!endprocedure

!unquoted procedure System($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="")
!unquoted procedure System($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="", $baseShape="rectangle")
' $type reuses $techn definition of $tags
$getElementLine("rectangle", "system", $alias, $label, $type, $descr, $sprite, $tags, $link)
$getElementLine($baseShape, "system", $alias, $label, $type, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure SystemDb($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="")
Expand All @@ -390,9 +390,9 @@ rectangle "$getPerson($label, $type, $descr, $sprite)$getProps()" $toStereos("ex
$getElementLine("queue", "system", $alias, $label, $type, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure System_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="")
!unquoted procedure System_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="", $baseShape="rectangle")
' $type reuses $techn definition of $tags
$getElementLine("rectangle", "external_system", $alias, $label, $type, $descr, $sprite, $tags, $link)
$getElementLine($baseShape , "external_system", $alias, $label, $type, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure SystemDb_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="")
Expand Down
2 changes: 1 addition & 1 deletion C4/C4_Deployment.puml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ skinparam rectangle<<node>> {
' node specific: $techn is only used in old scripts, new scripts uses $type ($techn has to remain, it could be called via named argument)
!unquoted procedure AddNodeTag($tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $sprite="", $type="", $legendText="", $legendSprite="", $techn="", $borderStyle="", $borderThickness="")
!$type=$type+$techn
$addElementTagInclReuse("node", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $type, $legendText, $legendSprite, "", $borderStyle, $borderThickness)
$addElementTagInclReuse("node", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $type, $legendText, $legendSprite, $borderStyle, $borderThickness)
!endprocedure

' Layout
Expand Down
12 changes: 6 additions & 6 deletions C4/C4_Sequence.puml
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ $calcDescr
$getParticipant("external_person", $alias, $label, $type, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure System($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="")
!unquoted procedure System($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="", $baseShape="rectangle")
' $type reuses $techn definition of $tags
$getParticipant("system", $alias, $label, $type, $descr, $sprite, $tags, $link)
!endprocedure
Expand All @@ -242,7 +242,7 @@ $calcDescr
$getParticipant("system", $alias, $label, $type, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure System_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="")
!unquoted procedure System_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="", $baseShape="rectangle")
' $type reuses $techn definition of $tags
$getParticipant("external_system", $alias, $label, $type, $descr, $sprite, $tags, $link)
!endprocedure
Expand All @@ -259,7 +259,7 @@ $calcDescr



!unquoted procedure Container($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
!unquoted procedure Container($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $baseShape="rectangle")
$getParticipant("container", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

Expand All @@ -271,7 +271,7 @@ $calcDescr
$getParticipant("container", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure Container_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
!unquoted procedure Container_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $baseShape="rectangle")
$getParticipant("external_container", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

Expand All @@ -285,7 +285,7 @@ $calcDescr



!unquoted procedure Component($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
!unquoted procedure Component($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $baseShape="rectangle")
$getParticipant("component", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

Expand All @@ -297,7 +297,7 @@ $calcDescr
$getParticipant("component", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure Component_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
!unquoted procedure Component_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $baseShape="rectangle")
$getParticipant("external_component", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

Expand Down
2 changes: 1 addition & 1 deletion C4/INFO
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
VERSION=2.8.0
VERSION=2.9.0
SOURCE=https://github.com/plantuml-stdlib/C4-PlantUML
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,37 @@ This example renders the following image:

![Example](http://www.plantuml.com/plantuml/proxy?idx=0&src=https%3A%2F%2Fraw.githubusercontent.com%2FRicardoNiepel%2FAzure-PlantUML%2Fmaster%2Fsamples%2FBasic%2520usage%2520-%2520Stream%2520processing%2520with%2520Azure%2520Stream%2520Analytics.puml "Example")

## C4 library (C4-PlantUML)

The C4 library enables a simple way of describing and communicate software architectures with an intuitive language.

It is the PlantUML integrated version of [C4-PlantUML](https://github.com/plantuml-stdlib/C4-PlantUML) and has the big advantage that it can be used without additional external includes.
(E.g. container diagrams can be drawn with `!include <C4/C4_Container>` and no `!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml` is required.)

Example of usage:

```plantuml
@startuml
!include <C4/C4_Container>
LAYOUT_LEFT_RIGHT()

Person(admin, "Administrator")
System_Boundary(c1, "Sample System") {
Container(web_app, "Web Application", "C#, ASP.NET Core 2.1 MVC", "Allows users to compare multiple Twitter timelines")
}
System(twitter, "Twitter")

Rel(admin, web_app, "Uses", "HTTPS")
Rel(web_app, twitter, "Gets tweets from", "HTTPS")

SHOW_LEGEND()
@enduml
```

This example renders the following image:

[![Example](https://www.plantuml.com/plantuml/png/JL1TQy9047o_Nx5DNn8GYyN7KanJgmMhOivAdyAPRE7WFiBT1f7I_zvDjTfxMUvcPcTk9f5KeCuQSQDTRRe6uQ4OtnNZgl2Eb7OO7iKY_rXjPRMOliXgypgRopGJOeqXUfUgncetW2JlfuuK5FcGPA8yHa9RFVdEDIeSqth4f5BPrY2Si2I3Bm5yBaxf0VULQbjcxd0FUTiQNIlItYNyLDmE82_Nm-LKiYGWt0z7yFPUz5XkZ3z4w2A62EIXzhPLJB6T8TrRoeCcmW2aBHhsYXpn-nmofHF8Uyuq1iK6pT_dhh6saPKyvrAkooJx9LtGwvePKkGhzkCpUFjV8ihvQiTTpgRBP-vnWgxX-dy0)](https://www.plantuml.com/plantuml/uml/JL1TQy9047o_Nx5DNn8GYyN7KanJgmMhOivAdyAPRE7WFiBT1f7I_zvDjTfxMUvcPcTk9f5KeCuQSQDTRRe6uQ4OtnNZgl2Eb7OO7iKY_rXjPRMOliXgypgRopGJOeqXUfUgncetW2JlfuuK5FcGPA8yHa9RFVdEDIeSqth4f5BPrY2Si2I3Bm5yBaxf0VULQbjcxd0FUTiQNIlItYNyLDmE82_Nm-LKiYGWt0z7yFPUz5XkZ3z4w2A62EIXzhPLJB6T8TrRoeCcmW2aBHhsYXpn-nmofHF8Uyuq1iK6pT_dhh6saPKyvrAkooJx9LtGwvePKkGhzkCpUFjV8ihvQiTTpgRBP-vnWgxX-dy0)

## Classy library

The Classy library allows for using an Object Oriented approach to diagramming
Expand Down