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

#110 Support properties and node description #111

Merged
merged 10 commits into from
Feb 7, 2021

Conversation

kirchsth
Copy link
Contributor

That I can create document a detailed documentation too. I added following extensions.

(Deployment_)Node elements are extended with following macros:

  • (Deployment_)Node() supports description and sprite
  • Node() is added as short version of Deployment_Node()
  • (Deployment_)Node() can be left/right aligned with (Deployment_)Node_L() and (Deployment_)Node_R()

Properties can be added with following macros:

  • SetPropertyHeader(col1Name, col2Name, ?col3Name, ?col4Name) : The properties table can have up to 4 columns. The default header uses the column names "Name", "Description".
  • WithoutPropertyHeader() If no header is used, then the second column is bold.
  • AddProperty(col1, col2, ?col3, ?col4)` (All columns of) a property which will be added to the next element.

and can be used like below

@startuml
!include https://raw.githubusercontent.com/kirchsth/C4-PlantUML/extended/C4_Deployment.puml

' default header Property, Value
AddProperty("Name", "Flash")
AddProperty("Organization", "Zootopia")
AddProperty("Tool", "Internet Explorer 7.0")
Person(personAlias, "Label", "Optional Description (with default property header)")

SetPropertyHeader("Property","Value", "Description")
AddProperty("Prop1", "Value1", "Details1")
AddProperty("Prop2", "Value2", "Details2")
Deployment_Node_L(nodeAlias, "Label", "Optional Type", "Optional Description (with custom property header)") {

  WithoutPropertyHeader()
  AddProperty("PropC1", "ValueC1")
  AddProperty("PropC2", "ValueC2")
  Container(containerAlias, "Label", "Technology", "Optional Description (without property header)")
}

System(systemAlias, "Label", "Optional Description (without properties)")

Rel(personAlias, containerAlias, "Label", "Optional Technology")
@enduml

properties sample

A preview of the PR can be found in my extended branch

The extensions are compatible with the .dotnet structurizr model and enables a detailed deployment diagram too.

BR Helmut

KIRCHSTH and others added 10 commits December 12, 2020 17:31
…-line-breaks-of-type-labels (2 - update link with updated C4_Deployment Diagram Sample)
…om tags/stereotypes support; dynamic legend supports custom colors, border and shadow; dynamic legend displays (only) used elements, tags/stereotypes.

New added macros: SHOW_DYNAMIC_LEGEND(), AddTagSupport(), UpdateSkinparamsAndLegendEntry(), elements macros are extended with $tags="..."
…om tags/stereotypes support; ... (2 - update macros docu with added $tags="...")
…line argument -DRELATIVE_INCLUDE="."

Update github workflow that local files are used
…line argument -DRELATIVE_INCLUDE="." (2 - fix !if)
…line argument -DRELATIVE_INCLUDE="."

Update github workflow that local files are used
(Deployment_)Node() supports description, sprite and left/right alignment via Node_L()/Node_R()
* Element properties can be defined via  SetPropertyHeader(), WithoutPropertyHeader() and AddProperty()
@adrianvlupu
Copy link
Member

These are some insane PlantUML skills 🤯

Copy link
Member

@adrianvlupu adrianvlupu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no doubt this will turn to hell when something changes in the PlantUML preprocessor but I can't help myself

@adrianvlupu adrianvlupu merged commit 6cc1023 into plantuml-stdlib:master Feb 7, 2021
@Potherca Potherca added this to the v2.1.0 milestone Apr 4, 2021
@kirchsth kirchsth deleted the feature/110 branch July 4, 2021 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants