Skip to content

Commit

Permalink
support all PlantUML elements - new argument is called $baseShape
Browse files Browse the repository at this point in the history
  • Loading branch information
kirchsth committed Feb 10, 2024
1 parent 2ef536e commit 1db64bf
Show file tree
Hide file tree
Showing 8 changed files with 112 additions and 112 deletions.
2 changes: 1 addition & 1 deletion C4.puml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
' ##################################
' 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 ", $plant="storage")
' 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
Expand Down
8 changes: 4 additions & 4 deletions C4_Component.puml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ endlegend
' Elements
' ##################################

!unquoted procedure Component($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $plant="rectangle")
$getElementLine($plant, "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 @@ -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="", $plant="rectangle")
$getElementLine($plant, "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_Container.puml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ endlegend
' Elements
' ##################################

!unquoted procedure Container($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $plant="rectangle")
$getElementLine($plant , "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 @@ -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="", $plant="rectangle")
$getElementLine($plant , "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_Context.puml
Original file line number Diff line number Diff line change
Expand Up @@ -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="", $plant="rectangle")
!unquoted procedure System($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="", $baseShape="rectangle")
' $type reuses $techn definition of $tags
$getElementLine($plant, "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 @@ -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="", $plant="rectangle")
!unquoted procedure System_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="", $baseShape="rectangle")
' $type reuses $techn definition of $tags
$getElementLine($plant , "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
12 changes: 6 additions & 6 deletions C4_Sequence.puml
Original file line number Diff line number Diff line change
Expand Up @@ -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="", $plant="rectangle")
!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 @@ -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="", $plant="rectangle")
!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 @@ -264,7 +264,7 @@ $calcDescr



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

Expand All @@ -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="", $plant="rectangle")
!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 @@ -290,7 +290,7 @@ $calcDescr



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

Expand All @@ -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="", $plant="rectangle")
!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
22 changes: 11 additions & 11 deletions LayoutOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -641,14 +641,14 @@ Rel(web_app, twitter, "Gets tweets from", "HTTPS")
## 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 `plant="...."` argument of the calls
They can be set via the new optional `baseShape="...."` argument of the calls

- `System(..., ?plant)`,
- `System_Ext(..., ?plant)`,
- `Container(..., ?plant)`,
- `Container_Ext(..., ?plant)`,
- `Component(..., ?plant)`,
- `Component_Ext(..., ?plant)`
- `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.

Expand Down Expand Up @@ -680,11 +680,11 @@ but the style is not correct displayed.
Component(comp, "Copy component")
Component(config, "Config component", $plant="package")
Component(config, "Config component", $baseShape="package")
ComponentDb(dbA, "DB A")
' alternative syntax for ComponentDb() with $plant="database"
Component(dbB, "DB B", $plant="database")
' 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")
Expand All @@ -694,7 +694,7 @@ SHOW_LEGEND()
@enduml
```

![Sample with PlantUML elements](https://www.plantuml.com/plantuml/png/NP1VQy8m5CNV-ockPJ05jGpsD11iDMmFiHF_u6D9cgXbRLAIspc__HBjIjtRpRs_Sy-vcLja1fkg30OaZHDAifZIR4tZT9SHIbOatMrX1Y_1e51vsGW9PyJQlaMHOPVfgS1pmnihJQuLIeNJN5THNJBbLquiYhBWqU9rilQj_Of65RCeZMjb2rtLMdbDxUs3xZtCNJM6SA7hA-H_tN3qYAXZSRf1lkXXOtYw-S_2ckLVx2GVX4i-53nskcK2iPiy0ojT7iMm-9PWhmhP3norWRvY11TtPxTNC6ISMHdsyWYUt9SclG0Tw19iP9djsyl-XM-C5C2lZl8GRQ5xp8ramiBHwAeTRxgnDpoO0gK5rDvY-_5vo2Xv9-boE0hcKWdthxy0)
![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

Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,10 @@ SHOW_LEGEND()
- Macros:
- `Person(alias, label, ?descr, ?sprite, ?tags, ?link, ?type)`
- `Person_Ext(alias, label, ?descr, ?sprite, ?tags, ?link, ?type)`
- `System(alias, label, ?descr, ?sprite, ?tags, ?link, ?type, ?plant)`
- `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, ?plant)`
- `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)`
Expand All @@ -256,10 +256,10 @@ 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, ?plant)`
- `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, ?plant)`
- `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)`
Expand All @@ -268,10 +268,10 @@ SHOW_LEGEND()

- 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, ?plant)`
- `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, ?plant)`
- `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)`

Expand Down
Loading

0 comments on commit 1db64bf

Please sign in to comment.