Skip to content

Adjust thickness and styles of element and boundary borders #319

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

Merged

Conversation

kirchsth
Copy link
Member

related to #315

All element and boundary specific tags support $borderStyle and $borderThickness arguments (like the relationships with $lineStyle and $lineThickness).

UpdateElementStyle(...,?borderStyle, ?borderThickness)
AddElementTag(...,?borderStyle, ?borderThickness)
UpdateBoundaryStyle(...,?borderStyle, ?borderThickness)
AddBoundaryTag(...,?borderStyle, ?borderThickness)

All element and boundary specific Add...Tag(...,?borderStyle, ?borderThickness)or Update...Style(...,?borderStyle, ?borderThickness) calls (like AddPersonTag() or UpdateEnterpriseBoundaryStyle()) are extended too.

Additional a new border style SolidLine() is supported and can be used as $lineStyle= SolidLine() or $borderStyle=SolidLine() (like the already existing DashedLine(), DottedLine() and BoldLine() styles). It enables a reset of dashed boundaries).

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

SHOW_PERSON_OUTLINE() 

' all (default) persons have a dotted line
UpdateElementStyle("person", $borderStyle=DottedLine(), $borderThickness=5)

' reset dashed back to solid (and set red border color) for all admin 
AddPersonTag("admin", $borderStyle=SolidLine(), $borderColor="red")

' set the (default) boundary thisckness to 3 (and use it for all persons) 
UpdateBoundaryStyle($borderThickness=3)
' persons should get a new dottet boundary 
AddBoundaryTag("persons", $borderStyle=DottedLine(), $bgColor=$BOUNDARY_BG_COLOR, $fontColor=$BOUNDARY_COLOR)

' system boundaries should use solid styles 
UpdateSystemBoundaryStyle($borderStyle=SolidLine(), $borderThickness=1)

' default components should use dotted styles 
UpdateElementStyle("component", $borderStyle=DashedLine(), $borderThickness="8")
' admin specific components: reset to solud and red border color
AddComponentTag("admin component", $borderStyle=SolidLine(), $borderThickness=1, $borderColor=red)

Boundary(B, "All involved persons", $tags="persons") {
  Person(P,"person")
  Person(ADMIN, "Admin", $tags="admin")
}

System_Boundary(S, "System") {
  Component(C,"Component","techn")
  Component(ADMIN_C,"Admin Component","techn", $tags="admin component")
}

AddRelTag("admin call", $lineStyle=DashedLine(), $lineThickness=2, $textColor="red", $lineColor="red")
Rel(P,C,"uses")
Rel(ADMIN,ADMIN_C,"uses",$tags="admin call")

SHOW_LEGEND()
@enduml

It can be tested via my extended branch

BR Helmut

@kirchsth kirchsth requested a review from Potherca August 15, 2023 11:22
@kirchsth kirchsth added this to the v2.8.0 milestone Aug 15, 2023
@kirchsth kirchsth linked an issue Aug 15, 2023 that may be closed by this pull request
Copy link
Member

@Potherca Potherca left a comment

Choose a reason for hiding this comment

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

Great work!

@kirchsth kirchsth merged commit 7424ad9 into plantuml-stdlib:master Sep 2, 2023
@kirchsth kirchsth deleted the feature/315_element_border 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
Status: Done
Development

Successfully merging this pull request may close these issues.

Adjust thickness of element border
2 participants