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

Line styling not recognized when using ELK #340

Closed
StephanPirnbaum opened this issue Feb 28, 2024 · 5 comments
Closed

Line styling not recognized when using ELK #340

StephanPirnbaum opened this issue Feb 28, 2024 · 5 comments
Labels
PlantUML v1.2024.6 fix in PlantUML release v1.2024.6
Milestone

Comments

@StephanPirnbaum
Copy link

I'm using C4-PlantUML with ELK, as it regularly produces better outputs.
However, I ran into an issue when using e.g. lineColor or lineStyle.

In the following example, the relation defined using standard PlantUML syntax is correctly rendered, whereas using the C4-PlantUML it is not.

@startuml
!include <C4/C4_Component>
!pragma layout elk

AddRelTag("DEF", $legendText="Java-Abhängigkeit", $lineColor = "#blue", $lineStyle = DottedLine())

Component(A, "A")

Component(B, "B")

A -[#orange,dashed]-> B

Rel(A, B, "Test", $tags="DEF")
@enduml

This leads me to the conclusion that ELK itself has no issues with styling lines (which would have had me wonder, tbh).

When not using ELK, the example is working, however.

@startuml
!include <C4/C4_Component>

AddRelTag("DEF", $legendText="Java-Abhängigkeit", $lineColor = "#blue", $lineStyle = DottedLine())

Component(A, "A")

Component(B, "B")

A -[#orange,dashed]-> B

Rel(A, B, "Test", $tags="DEF")
@enduml

For me, that looks like an issue of the combination C4-PlantUML syntax and ELK.

@kirchsth
Copy link
Member

Hi @StephanPirnbaum,

thank you for the finding, but I think your conclusion is wrong. I think it is elk related, I can reproduce the problem without C4 too. Samples see below.

I entered a bug in the PlantUML forum

BR Helmut

@StephanPirnbaum
Copy link
Author

Hi @kirchsth

thank you for the fast investigation and reply. You're right, I was not considering using skinparam which would explain the difference to my example. I can confirm your conclusion.

@kirchsth kirchsth changed the title Styling not recognized when using ELK Line styling not recognized when using ELK Mar 9, 2024
@kirchsth kirchsth added the PlantUML/Forum/... issue Issue reported to PlantUML, Forum, ... wait for final solution label Apr 29, 2024
@kirchsth kirchsth added PlantUML/Forum/... issue Issue reported to PlantUML, Forum, ... wait for final solution and removed PlantUML/Forum/... issue Issue reported to PlantUML, Forum, ... wait for final solution labels May 27, 2024
@kirchsth
Copy link
Member

Hi @StephanPirnbaum,

the last PlantUML beta has a first fix: line color, thickness and style are correct (details see PlantUML PR - Elk: Allow full style on arrows (except fontcolor).

You can download a *.jar file from PlantUML Releases-snapshot - Assets section (I tested it with `plantuml-mit-SNAPSHOT.jar).

The $fontcolor is not correct supported, but if you use $textColor = $ARROW_FONT_COLOR then the legend uses the same $fontColor as the diagram itself.

e.g. following source

@startuml
!theme C4_united from <C4/themes>
!include <C4/C4_Component>
!pragma layout elk
'!pragma layout smetana

'known issue: $textColor is not working with elk/smetana
' AddRelTag("DEF", $legendText="Java-Abhängigkeit", $textColor = "#green", $lineColor = "#blue", $lineStyle = DottedLine(), $lineThickness=7)
' AddRelTag("DEF", $textColor = "#green", $lineColor = "#blue", $lineStyle = DottedLine(), $lineThickness=7)

' $textColor is not working, but if the unchanged color is defined then the legend displays the correct color again
AddRelTag("DEF", $textColor = $ARROW_FONT_COLOR, $lineColor = "#blue", $lineStyle = DottedLine(), $lineThickness=7)

Component(A, "A")
Component(B, "B")
A -[#orange,dashed]-> B
' WithoutPropertyHeader()
AddProperty("PropC1", "ValueC1")
AddProperty("PropC2", "ValueC2")
Rel(A, B, "Te<$person>st", $tags="DEF")

SHOW_LEGEND()
@enduml

produces following output

image

Can you please check the fix with your diagrams too?

Thank you and BR Helmut

@StephanPirnbaum
Copy link
Author

Hi @kirchsth

thanks for your work. The provided Snapshot resolved the issue for me.

Best
Stephan

@kirchsth
Copy link
Member

kirchsth commented Jun 26, 2024

Hi @StephanPirnbaum,

@arnaudroques create a fix for $fontColor too (details see plantuml/plantuml#1834) that the newest snapshot supports $fontColor too.

@startuml
!theme C4_united from <C4/themes>
!include <C4/C4_Component>
!pragma layout elk
'!pragma layout smetana

' $textColor is working
AddRelTag("DEF", $textColor = "#green", $lineColor = "#blue", $lineStyle = DottedLine(), $lineThickness=7)
' combined stereotypes/tags are working too
AddRelTag("DEF2",$lineColor = "#red")

Component(A, "A")
Component(B, "B")
A -[#orange,dashed]-> B
' WithoutPropertyHeader()
AddProperty("PropC1", "ValueC1")
AddProperty("PropC2", "ValueC2")
Rel(A, B, "Te<$person>st", $tags="DEF2+DEF")

SHOW_LEGEND()
@enduml

image

BR Helmut

@kirchsth kirchsth added this to the v2.10.0 milestone Jun 26, 2024
@kirchsth kirchsth added PlantUML v1.2024.6 fix in PlantUML release v1.2024.6 and removed PlantUML/Forum/... issue Issue reported to PlantUML, Forum, ... wait for final solution labels Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PlantUML v1.2024.6 fix in PlantUML release v1.2024.6
Projects
None yet
Development

No branches or pull requests

2 participants