diff --git a/C4.puml b/C4.puml index ba361acb..d8ebbce3 100644 --- a/C4.puml +++ b/C4.puml @@ -1,5 +1,14 @@ ' 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() @@ -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<> { @@ -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 diff --git a/C4_Component.puml b/C4_Component.puml index c7acf421..f1ffcf70 100644 --- a/C4_Component.puml +++ b/C4_Component.puml @@ -58,8 +58,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="") @@ -70,8 +70,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="") diff --git a/C4_Container.puml b/C4_Container.puml index f179a585..caab6182 100644 --- a/C4_Container.puml +++ b/C4_Container.puml @@ -65,8 +65,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="") @@ -77,8 +77,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="") diff --git a/C4_Context.puml b/C4_Context.puml index 68c8711c..664b2a67 100644 --- a/C4_Context.puml +++ b/C4_Context.puml @@ -380,9 +380,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="") @@ -395,9 +395,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="") diff --git a/C4_Sequence.puml b/C4_Sequence.puml index 2da951c1..158a594e 100644 --- a/C4_Sequence.puml +++ b/C4_Sequence.puml @@ -232,7 +232,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 @@ -247,7 +247,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 @@ -264,7 +264,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 @@ -276,7 +276,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 @@ -290,7 +290,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 @@ -302,7 +302,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 diff --git a/LayoutOptions.md b/LayoutOptions.md index f1df309a..7df4694c 100644 --- a/LayoutOptions.md +++ b/LayoutOptions.md @@ -22,6 +22,8 @@ C4-PlantUML comes with some layout options. - [SHOW_ELEMENT_DESCRIPTIONS(?show)](#show_element_descriptionsshow) - [SHOW_FOOT_BOXES(?show)](#show_foot_boxesshow) - [SHOW_INDEX(?show)](#show_indexshow) + - [Optional support of additional PlantUML elements](#optional-support-of-additional-plantuml-elements) + - [List of supported PlantUML elements](#list-of-supported-plantuml-elements) - [📄 Themes](Themes.md#themes) - samples - [📄 C4 Model Diagrams](samples/C4CoreDiagrams.md#c4-model-diagrams) @@ -83,7 +85,7 @@ Rel(web_app, twitter, "Gets tweets from", "HTTPS") ![LAYOUT_TOP_DOWN Sample](https://www.plantuml.com/plantuml/png/JL1DZzCm4BtxLmpba5Jg9bh4YTE6WE2msqOaPSKfSk8fjUGFovuegX3_dR4eBRayPTx7FCzJ8XbfiKQyqMusYq8u4uNqeQwZNAkVcixBj2ICitU4ZghPspeOwRBd8P4oUghRzmzT7XrVdcih4s7aqTYoGsg7iGevNzG5x3s1GrIeOC9PSYxGMIVGYH51uKakXg2enNFput0Snk7GZPyEh_joAqI7CNbNIcMrsy6coQWJHKa-RhQYl_1YEtxqYrCoNihvSGT5BsqmM6pXbm3-RfNA5QTHXi0vhpX14uBHioJjtOP7xTiTD7rNxJyFR8a8xwf7UFdUPgunngy9yacuj0U-Hv0iiLnSyouOLas44KXRDBmhSRVVrtOb_IKvvofZKdn3y-zLzrh7n4x6hyFGzQpAeXjxZ_c2bFWNCvoYj_zRdj0fllmV "LAYOUT_TOP_DOWN Sample") -`LAYOUT_LEFT_RIGHT()` rotates the flow visualization to *from Left to Right* and directed relations like `Rel_Left()`, `Rel_Right()`, `Rel_Up()` and `Rel_Down()` are rotated too. +`LAYOUT_LEFT_RIGHT()` rotates the flow visualization to _from Left to Right_ and directed relations like `Rel_Left()`, `Rel_Right()`, `Rel_Up()` and `Rel_Down()` are rotated too. ```plantuml @startuml LAYOUT_LEFT_RIGHT Sample @@ -104,7 +106,7 @@ Rel(web_app, twitter, "Gets tweets from", "HTTPS") ![LAYOUT_LEFT_RIGHT Sample](https://www.plantuml.com/plantuml/png/JKzDR-8m4BtdLtZP0q62HApsj2Uo4OLAq4OajEefSf9fiUGFonuhGbN_UySgXVeoyhoFUM_baJiCIYQ_XEvb682T4At_b-UEZzcRm5FeWWVN6usWCUkDogtaEceM7WSfkhpykwZYwhZVvOfx14UhjYG55nfSPgD_iYjU7ezDkrlVDUtXVhDjqbcILE2yqIaVbD1pDYdY51uTH-CciwG-avjg_vkW1-xEQR-SisdDbPKmdR7tXD6xtab7w5fkBVayGySAQwNeEGgZ9xGgVyzPKLVPmxeXYGFs9rko_LCPiK9ACteMUtg6Xb59oucYWaH1jrWp2gHQ38K2IRSyPVkuf4ln2oIV2ut0v03okzKjrj6JakQsQQgQM95qHMys6q1FNuZZrHdrKx82FGGbFm40 "LAYOUT_LEFT_RIGHT Sample") -`LAYOUT_LANDSCAPE()` rotates the default flow visualization to *from Left to Right* like `LAYOUT_LEFT_RIGHT()` additional **directed relations** like Rel_Left(), Rel_Right(), Rel_Up() and Rel_Down() **are not rotated** anymore. +`LAYOUT_LANDSCAPE()` rotates the default flow visualization to _from Left to Right_ like `LAYOUT_LEFT_RIGHT()` additional **directed relations** like Rel_Left(), Rel_Right(), Rel_Up() and Rel_Down() **are not rotated** anymore. ```plantuml @startuml LAYOUT_LANDSCAPE Sample @@ -209,9 +211,9 @@ Legend labels and details can be defined via `\n` in `$legendTest` arguments too !else !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml !endif -' $legendText with \n defines the label and details of the legend entry ("backend container" is label, "eight sided shape" is details) +' $legendText with \n defines the label and details of the legend entry ("backend container" is label, "eight sided shape" is details) AddElementTag("backendContainer", $fontColor=$ELEMENT_FONT_COLOR, $bgColor="#335DA5", $shape=EightSidedShape(), $legendText="backend container\neight sided shape") -' $legendText without \n defines only a label +' $legendText without \n defines only a label AddRelTag("async", $textColor=$ARROW_FONT_COLOR, $lineColor=$ARROW_COLOR, $lineStyle=DashedLine(), $legendText="async call") ' if no $legendText defined, $tag is automatically the label and all additional displayed properties are the details AddRelTag("sync/async", $textColor=$ARROW_FONT_COLOR, $lineColor=$ARROW_COLOR, $lineStyle=DottedLine()) @@ -241,9 +243,9 @@ Legend details can be deactivated via `SHOW_LEGEND($details=None())` !else !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml !endif -' $legendText with \n defines the label and details of the legend entry ("backend container" is label, "eight sided shape" is details) +' $legendText with \n defines the label and details of the legend entry ("backend container" is label, "eight sided shape" is details) AddElementTag("backendContainer", $fontColor=$ELEMENT_FONT_COLOR, $bgColor="#335DA5", $shape=EightSidedShape(), $legendText="backend container\neight sided shape") -' $legendText without \n defines only a label +' $legendText without \n defines only a label AddRelTag("async", $textColor=$ARROW_FONT_COLOR, $lineColor=$ARROW_COLOR, $lineStyle=DashedLine(), $legendText="async call") ' if no $legendText defined, $tag is automatically the label and all additional displayed properties are the details AddRelTag("sync/async", $textColor=$ARROW_FONT_COLOR, $lineColor=$ARROW_COLOR, $lineStyle=DottedLine()) @@ -636,3 +638,97 @@ Rel(web_app, twitter, "Gets tweets from", "HTTPS") ![SHOW_INDEX() Sample](https://www.plantuml.com/plantuml/png/LL1DRzD04BtlhnZ28OwKsYhYnAaXH1I9bWYxb9irzawRbVPZsPsLLI7-ExEYeU3Bo3Fluxszoeo9YxFgbV6pBPhWn1ppkwvBkBIFXazbAfdI73oJvtOEheiMVULSPDRMJDt-xSMnhkvkFdSECrEIrTZJZq9-fZPMUTLVVxaVFzr-E7nlDaeTAUNW6zJE-2siTdMQp0avfDL6zK-YuiRteNYDwQcPBxUmxj55I-kD0ldsaWUDfzGiD8qOewZSqmIx6AsPaKtmArdjNszXrn_RsyCWb4Jmfhs4cs_xUjjP6vOCjLq63Y3L8Wh45Sj6d61O34iPOEF8YbUMP6im7X3oSpdG1XyJEZX77GzUDniuOPM4YQgy5exqGGtX0U0d_5B_eSzr6_xZ9z6UdSLFVILxVgQNfdTPmiYy7ePZBwWA-djzaVb8dEMNwdX8mVrBkIAlYxE_0G00 "SHOW_INDEX() Sample") +## Optional support of additional PlantUML elements + +More often a full support of all PlantUML elements are requested. +They can be set via the new optional `baseShape="...."` argument of the calls + +- `System(..., ?baseShape)`, +- `System_Ext(..., ?baseShape)`, +- `Container(..., ?baseShape)`, +- `Container_Ext(..., ?baseShape)`, +- `Component(..., ?baseShape)`, +- `Component_Ext(..., ?baseShape)` + +The already specified `...Db...()` and `...Queue...()` calls are not extended. + +But based on the additional (internal) overhead it has to be explicit enabled +via `ENABLE_ALL_PLANT_ELEMENTS`. It can be set with following 2 options + +- `!ENABLE_ALL_PLANT_ELEMENTS = 1` directly in the scripts file + BEFORE the first C4\_\* file is loaded, like e.g. + +```plantuml +@startuml +!ENABLE_ALL_PLANT_ELEMENTS = 1 +!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Component.puml +... +@enduml +``` + +- or via additional command line parameter `-DENABLE_ALL_PLANT_ELEMENTS=1` + +If `ENABLE_ALL_PLANT_ELEMENTS` is not set, the diagrams displays the requested "PlantUML element" +but the style is not correct displayed. + +**A simple sample with additional "PlantUML elements":** + +```plantuml +@startuml +!ENABLE_ALL_PLANT_ELEMENTS = 1 +!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Component.puml + +Component(comp, "Copy component") + +Component(config, "Config component", $baseShape="package") + +ComponentDb(dbA, "DB A") +' alternative syntax for ComponentDb() with $baseShape="database" +Component(dbB, "DB B", $baseShape="database") + +Rel_U(comp, config, "Configured by") +Rel_L(comp, dbA, "Reads from") +Rel_R(comp, dbB, "Writes to") + +SHOW_LEGEND() +@enduml +``` + +![Sample with PlantUML elements](https://www.plantuml.com/plantuml/png/NOzFQy904CNl-HHZA5H13OMU2eA9XlQmfk8VF8P9CcfeiXjs9xL---vMQqrly-VttioR6aRDRLrvlJW98n6deH3fKeJ99er5l8YJpHecyEJrIfbNRK5mP6xCIn1eF8qF9H_Rh3MaSoMP98zpLGTDXT9PZWmNLPa5i-VHqess2n7KQ9Yq7QKpLJTAEatZpdktlf_RQWZ-J3Ldo7-d_g2Bo7rvSD1FSOSDuI53G-iZDZJn6ym_y40TyJph5rbejVC8Ghjv1AoOj4GkFmdCMJ9-mLvfk5SCu6IpThmBP7Ij_sTjZQEBSNHxf0kxJrPKfTjhodz1Maq5P6TBEKXSeSkxAyB2m5wh-hfUtTRkw4wNJ0POkHFhj_TTAkBNE9dt1zwKPD7MrJS0) + +### List of supported PlantUML elements + +| PlantUML element | Support | Comment | +| ---------------- | -------- | --------------------------------------------------------------------------------------------------------------------- | +| rectangle | ✅ | already supported (works even without ENABLE_ALL_PLANT_ELEMENTS) | +| database | ✅ | already supported (works even without ENABLE_ALL_PLANT_ELEMENTS) | +| queue | ✅ | already supported (works even without ENABLE_ALL_PLANT_ELEMENTS) | +| node | ❌ | **should not be used**, already defined for Node() (works even without ENABLE_ALL_PLANT_ELEMENTS) | +| person | ❌ | **should not be used**, already defined for Person() (works even without ENABLE_ALL_PLANT_ELEMENTS) | +| | | | +| actor | ☑ | requires ENABLE_ALL_PLANT_ELEMENTS | +| agent | ☑ | requires ENABLE_ALL_PLANT_ELEMENTS | +| artifact | ☑ | requires ENABLE_ALL_PLANT_ELEMENTS | +| boundary | ☑ | requires ENABLE_ALL_PLANT_ELEMENTS | +| card | ☑ | requires ENABLE_ALL_PLANT_ELEMENTS | +| circle | ☑ | requires ENABLE_ALL_PLANT_ELEMENTS | +| cloud | ☑ | requires ENABLE_ALL_PLANT_ELEMENTS | +| collections | ☑ | requires ENABLE_ALL_PLANT_ELEMENTS | +| control | ☑ | requires ENABLE_ALL_PLANT_ELEMENTS | +| entity | ☑ | requires ENABLE_ALL_PLANT_ELEMENTS | +| file | ☑ | requires ENABLE_ALL_PLANT_ELEMENTS | +| folder | ☑ | requires ENABLE_ALL_PLANT_ELEMENTS | +| frame | ☑ | requires ENABLE_ALL_PLANT_ELEMENTS | +| hexagon | ☑ | requires ENABLE_ALL_PLANT_ELEMENTS | +| interface | ☑ | requires ENABLE_ALL_PLANT_ELEMENTS | +| package | ☑ | requires ENABLE_ALL_PLANT_ELEMENTS | +| stack | ☑ | requires ENABLE_ALL_PLANT_ELEMENTS | +| storage | ☑ | requires ENABLE_ALL_PLANT_ELEMENTS | +| usecase | ☑ | requires ENABLE_ALL_PLANT_ELEMENTS | +| usecase/ | ☑ | requires ENABLE_ALL_PLANT_ELEMENTS | +| | | | +| actor/ | ❌ | requires ENABLE_ALL_PLANT_ELEMENTS, not working (font color not changed to $bkColor) - and/or conflict with existing? | +| label | ❌ | requires ENABLE_ALL_PLANT_ELEMENTS, not working (font color not changed to $bkColor) | + +If `ENABLE_ALL_PLANT_ELEMENTS` is not set, the diagrams displays the requested "PlantUML element" +but the style is not correct. diff --git a/README.md b/README.md index dc4ed771..0f8b0003 100644 --- a/README.md +++ b/README.md @@ -234,16 +234,16 @@ SHOW_LEGEND() - Import: `!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Context.puml` - Macros: - `Person(alias, label, ?descr, ?sprite, ?tags, ?link, ?type)` - - `Person_Ext` - - `System(alias, label, ?descr, ?sprite, ?tags, ?link, ?type)` - - `SystemDb` - - `SystemQueue` - - `System_Ext` - - `SystemDb_Ext` - - `SystemQueue_Ext` + - `Person_Ext(alias, label, ?descr, ?sprite, ?tags, ?link, ?type)` + - `System(alias, label, ?descr, ?sprite, ?tags, ?link, ?type, ?baseShape)` + - `SystemDb(alias, label, ?descr, ?sprite, ?tags, ?link, ?type)` + - `SystemQueue(alias, label, ?descr, ?sprite, ?tags, ?link, ?type)` + - `System_Ext(alias, label, ?descr, ?sprite, ?tags, ?link, ?type, ?baseShape)` + - `SystemDb_Ext(alias, label, ?descr, ?sprite, ?tags, ?link, ?type)` + - `SystemQueue_Ext(alias, label, ?descr, ?sprite, ?tags, ?link, ?type)` - `Boundary(alias, label, ?type, ?tags, ?link)` - `Enterprise_Boundary(alias, label, ?tags, ?link)` - - `System_Boundary` + - `System_Boundary(alias, label, ?tags, ?link)` - Sprites: - `person` - `person2` @@ -256,24 +256,24 @@ SHOW_LEGEND() - Import: `!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml` - Additional Macros (based on context diagram macros): - - `Container(alias, label, ?techn, ?descr, ?sprite, ?tags, ?link)` - - `ContainerDb` - - `ContainerQueue` - - `Container_Ext` - - `ContainerDb_Ext` - - `ContainerQueue_Ext` + - `Container(alias, label, ?techn, ?descr, ?sprite, ?tags, ?link, ?baseShape)` + - `ContainerDb(alias, label, ?techn, ?descr, ?sprite, ?tags, ?link)` + - `ContainerQueue(alias, label, ?techn, ?descr, ?sprite, ?tags, ?link)` + - `Container_Ext(alias, label, ?techn, ?descr, ?sprite, ?tags, ?link, ?baseShape)` + - `ContainerDb_Ext(alias, label, ?techn, ?descr, ?sprite, ?tags, ?link)` + - `ContainerQueue_Ext(alias, label, ?techn, ?descr, ?sprite, ?tags, ?link)` - `Container_Boundary(alias, label, ?tags, ?link)` ### Component diagram - Import: `!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Component.puml` - Additional Macros (based on container diagram macros): - - `Component(alias, label, ?techn, ?descr, ?sprite, ?tags, ?link)` - - `ComponentDb` - - `ComponentQueue` - - `Component_Ext` - - `ComponentDb_Ext` - - `ComponentQueue_Ext` + - `Component(alias, label, ?techn, ?descr, ?sprite, ?tags, ?link, ?baseShape)` + - `ComponentDb(alias, label, ?techn, ?descr, ?sprite, ?tags, ?link)` + - `ComponentQueue(alias, label, ?techn, ?descr, ?sprite, ?tags, ?link)` + - `Component_Ext(alias, label, ?techn, ?descr, ?sprite, ?tags, ?link, ?baseShape)` + - `ComponentDb_Ext(alias, label, ?techn, ?descr, ?sprite, ?tags, ?link)` + - `ComponentQueue_Ext(alias, label, ?techn, ?descr, ?sprite, ?tags, ?link)` ### Dynamic diagram diff --git a/percy/TestAllPlantUmlElements.puml b/percy/TestAllPlantUmlElements.puml new file mode 100644 index 00000000..4e24888e --- /dev/null +++ b/percy/TestAllPlantUmlElements.puml @@ -0,0 +1,112 @@ + @startuml + +' 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 = 1 + +' convert it with additional command line argument -DRELATIVE_INCLUDE="./.." to use locally +!if %variable_exists("RELATIVE_INCLUDE") + ' percy runs (sometimes) with 1.2023.7 + ' !theme C4_united from %get_variable_value("RELATIVE_INCLUDE")/themes + !theme C4_united from ./../themes + ' !theme C4_green from ./../themes + !include ./../C4_Component.puml +!else + !theme C4_united from https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/themes + ' !theme C4_green from https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/themes + !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Component.puml +!endif + +LAYOUT_TOP_DOWN() + +' default is rectangle +Component(Component, "Container", "", "A component") +' already supported: rectangle, database, queue +Component(rectangleComponent, "Container rectangle", "rectangle", "A component with rectangle element", $baseShape="rectangle") +Component(databaseComponent, "Container database", "database", "A component with database element", $baseShape="database") +Component(queueComponent, "Container queue", "queue", "A component with queue element", $baseShape="queue") + +' already supported: rectangle, database, queue +' already defined (via other): +' node has a different style (cannot changed automatically) +' actor/ not working (font color not changed to $bkColor) - and/or conflict with existing? +' label not working (font color not changed to $bkColor) + +Component(actorComponent, "Component actor", "actor", "A component with actor element", $baseShape="actor") +Component(actorBCComponent, "Component actor/", "actor/", "A component with actor/ element", $baseShape="actor/") +Component(agentComponent, "Component agent", "agent", "A component with agent element", $baseShape="agent") +Component(artifactComponent, "Component artifact", "artifact", "A component with artifact element", $baseShape="artifact") +Component(boundaryComponent, "Component boundary", "boundary", "A component with boundary element", $baseShape="boundary") +Component(cardComponent, "Component card", "card", "A component with card element", $baseShape="card") +Component(circleComponent, "Component circle", "circle", "A component with circle element", $baseShape="circle") +Component(cloudComponent, "Component cloud", "cloud", "A component with cloud element", $baseShape="cloud") +Component(collectionsComponent, "Component collections", "collections", "A component with collections element", $baseShape="collections") +Component(controlComponent, "Component control", "control", "A component with control element", $baseShape="control") +Component(entityComponent, "Component entity", "entity", "A component with entity element", $baseShape="entity") +Component(fileComponent, "Component file", "file", "A component with file element", $baseShape="file") +Component(folderComponent, "Component folder", "folder", "A component with folder element", $baseShape="folder") +Component(frameComponent, "Component frame", "frame", "A component with frame element", $baseShape="frame") +Component(hexagonComponent, "Component hexagon", "hexagon", "A component with hexagon element", $baseShape="hexagon") +Component(interfaceComponent, "Component interface", "interface", "A component with interface element", $baseShape="interface") +Component(labelComponent, "Component label", "label", "A component with label element", $baseShape="label") +Component(nodeComponent, "Component node", "node", "A component with node element", $baseShape="node") +Component(packageComponent, "Component package", "package", "A component with package element", $baseShape="package") +Component(personComponent, "Component person", "person", "A component with person element", $baseShape="person") +Component(stackComponent, "Component stack", "stack", "A component with stack element", $baseShape="stack") +Component(storageComponent, "Component storage", "storage", "A component with storage element", $baseShape="storage") +Component(usecaseComponent, "Component usecase", "usecase", "A component with usecase element", $baseShape="usecase") +Component(usecaseBCComponent, "Component usecase/", "usecase/", "A component with usecase/ element", $baseShape="usecase/") + +Container(actorContainer, "Container actor", "actor", "A Container with actor element", $baseShape="actor") +Container(actorBCContainer, "Container actor/", "actor/", "A Container with actor/ element", $baseShape="actor/") +Container(agentContainer, "Container agent", "agent", "A Container with agent element", $baseShape="agent") +Container(artifactContainer, "Container artifact", "artifact", "A Container with artifact element", $baseShape="artifact") +Container(boundaryContainer, "Container boundary", "boundary", "A Container with boundary element", $baseShape="boundary") +Container(cardContainer, "Container card", "card", "A Container with card element", $baseShape="card") +Container(circleContainer, "Container circle", "circle", "A Container with circle element", $baseShape="circle") +Container(cloudContainer, "Container cloud", "cloud", "A Container with cloud element", $baseShape="cloud") +Container(collectionsContainer, "Container collections", "collections", "A Container with collections element", $baseShape="collections") +Container(controlContainer, "Container control", "control", "A Container with control element", $baseShape="control") +Container(entityContainer, "Container entity", "entity", "A Container with entity element", $baseShape="entity") +Container(fileContainer, "Container file", "file", "A Container with file element", $baseShape="file") +Container(folderContainer, "Container folder", "folder", "A Container with folder element", $baseShape="folder") +Container(frameContainer, "Container frame", "frame", "A Container with frame element", $baseShape="frame") +Container(hexagonContainer, "Container hexagon", "hexagon", "A Container with hexagon element", $baseShape="hexagon") +Container(interfaceContainer, "Container interface", "interface", "A Container with interface element", $baseShape="interface") +Container(labelContainer, "Container label", "label", "A Container with label element", $baseShape="label") +Container(nodeContainer, "Container node", "node", "A Container with node element", $baseShape="node") +Container(packageContainer, "Container package", "package", "A Container with package element", $baseShape="package") +Container(personContainer, "Container person", "person", "A Container with person element", $baseShape="person") +Container(stackContainer, "Container stack", "stack", "A Container with stack element", $baseShape="stack") +Container(storageContainer, "Container storage", "storage", "A Container with storage element", $baseShape="storage") +Container(usecaseContainer, "Container usecase", "usecase", "A Container with usecase element", $baseShape="usecase") +Container(usecaseBCContainer, "Container usecase/", "usecase/", "A Container with usecase/ element", $baseShape="usecase/") + +System(actorSystem, "System actor", "actor", "A System with actor element", $baseShape="actor") +System(actorBCSystem, "System actor/", "actor/", "A System with actor/ element", $baseShape="actor/") +System(agentSystem, "System agent", "agent", "A System with agent element", $baseShape="agent") +System(artifactSystem, "System artifact", "artifact", "A System with artifact element", $baseShape="artifact") +System(boundarySystem, "System boundary", "boundary", "A System with boundary element", $baseShape="boundary") +System(cardSystem, "System card", "card", "A System with card element", $baseShape="card") +System(circleSystem, "System circle", "circle", "A System with circle element", $baseShape="circle") +System(cloudSystem, "System cloud", "cloud", "A System with cloud element", $baseShape="cloud") +System(collectionsSystem, "System collections", "collections", "A System with collections element", $baseShape="collections") +System(controlSystem, "System control", "control", "A System with control element", $baseShape="control") +System(entitySystem, "System entity", "entity", "A System with entity element", $baseShape="entity") +System(fileSystem, "System file", "file", "A System with file element", $baseShape="file") +System(folderSystem, "System folder", "folder", "A System with folder element", $baseShape="folder") +System(frameSystem, "System frame", "frame", "A System with frame element", $baseShape="frame") +System(hexagonSystem, "System hexagon", "hexagon", "A System with hexagon element", $baseShape="hexagon") +System(interfaceSystem, "System interface", "interface", "A System with interface element", $baseShape="interface") +System(labelSystem, "System label", "label", "A System with label element", $baseShape="label") +System(nodeSystem, "System node", "node", "A System with node element", $baseShape="node") +System(packageSystem, "System package", "package", "A System with package element", $baseShape="package") +System(personSystem, "System person", "person", "A System with person element", $baseShape="person") +System(stackSystem, "System stack", "stack", "A System with stack element", $baseShape="stack") +System(storageSystem, "System storage", "storage", "A System with storage element", $baseShape="storage") +System(usecaseSystem, "System usecase", "usecase", "A System with usecase element", $baseShape="usecase") +System(usecaseBCSystem, "System usecase/", "usecase/", "A System with usecase/ element", $baseShape="usecase/") + +SHOW_LEGEND() +@enduml \ No newline at end of file