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

Support of "all" PlantUML elements can be enabled #337

Merged

Conversation

kirchsth
Copy link
Member

@kirchsth kirchsth commented Feb 10, 2024

related to #336.
The only difference is that the PlantUML elements can be defined via $baseShape
(I could be that I combine $baseShape with $shape in one of the next releases therefore $baseShape and not $renderAs)

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.
@startuml
!ENABLE_ALL_PLANT_ELEMENTS = 1
!include https://raw.githubusercontent.com/kirchsth/C4-PlantUML/extended/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":

@startuml
!ENABLE_ALL_PLANT_ELEMENTS = 1
!include https://raw.githubusercontent.com/kirchsth/C4-PlantUML/extended/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

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.

It can be tested via my extended branch

Sample with all PlantUML elements

(sometime the PlantUML server has no access to the referenced files, if this is the case please try it with your local system)
BR Helmut

@kirchsth kirchsth added this to the v2.9.0 milestone Feb 10, 2024
@kirchsth kirchsth merged commit 1db64bf into plantuml-stdlib:master Feb 10, 2024
1 check passed
@kirchsth kirchsth deleted the feature/all_plantuml_elements branch March 22, 2024 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant