-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Proposal: Add support for lineThickness in AddRelTag #218
Proposal: Add support for lineThickness in AddRelTag #218
Conversation
thank you for the PR, Can you reduce your changes to the thickness and avoid changes of the color definitions at all? BR Helmut @startuml
' independent colors not working
'!include https://raw.githubusercontent.com/netrounds-fredrik/C4-PlantUML/patch-1/C4.puml
' independent colors working
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4.puml
UpdateRelStyle(green, green)
AddRelTag("service1", $textColor="red")
AddRelTag("service2", $lineColor="red")
AddRelTag("service1&service2", $textColor="red", $lineColor="red")
' AddRelTag("tag1", $lineStyle="3;15", $lineThickness=3)
' AddRelTag("tag2", $lineColor="#blue", $lineStyle=DottedLine(), $lineThickness=8)
AddRelTag("tag1", $lineStyle=Bold())
AddRelTag("tag2", $lineColor="#blue", $lineStyle=DottedLine())
[a]
[b]
[c]
Rel(a, b, "3-15 - thick 3 (green, green)", $tags="tag1")
Rel(b, c, ".... - thick 8 (green, blue)", $tags="tag2")
Rel_R(spaAdmin, spaAdmin2, "no style (green, green)", "https")
Rel_D(api, services, "uses service1 via this call (red, green)", $tags="service1")
Rel_D(api, services, "uses service2 via this call (green, red) ", $tags="service2")
Rel_D(services, fileStorage, "both services stores via this call (red, red)", $tags="service1&service2+service1+service2")
SHOW_LEGEND()
@enduml current implementation With your changes |
I have made a fix for |
I checked your implementation and I think we can use a simpler implementation which requires no default colors like below. This means, the last Plantuml versions supports the combination of old skinparam with new styles too (and we get/got direct plantuml support if we would found some problems)
But I checked it with an old PlantUML versions 2021.13 too and with this version the combination of styles and skinprams is not 100% working (both tag combinations produces the gray color font). If it is defined via skinparam it works without any problems. Additional I know there are some style related bugfixes in PlantUML 2022.2 (the plantuml team fixed it for me) which enables the simpler handling. Based on that I would not mix styles and skinparams in the C4-PlantUML default implementation. I would suggest another solution: I add a new (experimental) "StyledTags.puml" files which contains style based features. And if the latest Plantuml version is used then it can be included/activated and the relationship tags with line thickness can be used. @netrounds-fredrik and @Potherca: What do you think? BR Helmut |
This issue has been automatically marked as stale because it has not had activity in the past 60 days. It will be closed in seven days if no further activity occurs. Thank you for your contributions. |
This is a proposal how to add support for specifying the line thickness in AddRelTag. It used
style
rather thanskinparam
for the tag. Not sure if this can cause some other issues, for example with older versions of PlantUML.I tried to visualize the thickness in the legend, and it kind of works for values between 1 and 8. The line is not vertically centered for higher values though.
It also exposes the more flexible
lineStyle
in the newstyle
method.Here is an example: