Skip to content

Rel styling $lineStyle does not work for sequence diagrams #369

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

Closed
papa-vova opened this issue Oct 17, 2024 · 28 comments
Closed

Rel styling $lineStyle does not work for sequence diagrams #369

papa-vova opened this issue Oct 17, 2024 · 28 comments
Labels
PlantUML v1.2024.8 fix in PlantUML release v1.2024.8 (beta5)
Milestone

Comments

@papa-vova
Copy link

papa-vova commented Oct 17, 2024

Hi! Thank you for a super awesome tool.

I have a line styling issue with sequence diagram.

The code:

@startuml
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Sequence.puml
AddRelTag("response", $lineStyle=DashedLine())

Container(a1, "a1")
Container(a2, "a2")
Rel(a1, a2, "request")
Rel(a2, a1, "response", $tags="response")

@enduml

produces the following output:
rel styling bug

I would expect the response line to be dashed. Am I doing something wrong? can't google up anything helpful.

I am not sure if the line «Only following (extended) relationship specific macros is supported:» from the README forbids styling like this.

For container diagrams the same styling works perfectly well.

Thanks!

p.s.
rel styling bug

@papa-vova
Copy link
Author

papa-vova commented Oct 17, 2024

also, when i change the include to the following:

!include <C4/C4_Sequence>

I get an error:
rel styling bug

but i guess it's another issue... if at all

@kirchsth
Copy link
Member

Hi @papa-vova,

A) related to !include <C4/C4_Sequence>:
I cannot reproduce the issue on the ex. online server.

https://www.plantuml.com/plantuml/uml/LS-noi8m50NWFK-HF_n30WLfoMYb4aSdAwuIcqiDfAdctWvzUzE2g6E-So3dDaWsqJG4zkTZ5oO7V6lqnkXh2yy9OWSxnlREdI2SRIz50doC4K4K_3_u22tD0Ug3nJkuOtvBfHXZxOm4W-mqaWl-Ld2ZBv3GZt7DpHZ9vdAIjYouiALGtrOjLcNBdwwDLTAo1-dDcPRePn3P7kkFADP0TFcs5m00

A1) Can you reproduce it online and add the link
A2) If only offline, can you past the whole sample (maybe there is a typo,...?)

B) related to $lineStyle=DashedLine(): I have to check , maybe it was never working

BR Helmut

@papa-vova
Copy link
Author

A) hmmm online everything works

here's the code:

@startuml
!include <C4/C4_Sequence>
AddRelTag("response", $lineStyle=DashedLine())

Container(a1, "a1")
Container(a2, "a2")
Rel(a1, a2, "request")
Rel(a2, a1, "response", $tags="response")

@enduml

@kirchsth
Copy link
Member

Can you create attach your *.puml file and create a *.preproc file and attach it too (e.g. if your file is "sequence.puml" then you can generate it with following line)

java -jar plantuml-mit-1.2024.7.jar ./sequence.puml

java -jar plantuml-mit-1.2024.7.jar -preproc ./sequence.puml

@papa-vova
Copy link
Author

rel styling bug.zip

@kirchsth
Copy link
Member

Your attached *.preproc file is too small with 1.6kB (many lines are missing, but I don't know why); my local has ~39kB.
Maybe PlantUML has problems with your used codepage or an invisible char (but I didn't found one).
(the *.preproc file itself is a valid *.puml file, only all preprocessor commands are resolved)

Can you compile my file?

workingOnMyMachine.zip

If my file is working on your machine too, I would retype your file manually and check if the new *.puml is working.

PS.: I attached my *.preproc output from your file too that you can see the expected result

@kirchsth
Copy link
Member

For the dotted line problem I have a workaround (but maybe I find a final solution over the weekend)

@startuml
!include <C4/C4_Sequence>

 ' defines a workaround arrow, with the a logical matching name "$response" that it can be used by the $rel argument
!$response = "-->"
....
Rel(a2, a1, "response", $rel = $response)

full sample

@startuml
!include <C4/C4_Sequence>

' defines a woraround arrow, with the a logical matching name "$response" that it can be used by the $rel argument
!$response = "-->"

AddRelTag("response", $textColor=$ARROW_COLOR, $lineColor=#red, $lineStyle=DashedLine())


System(c4stdlib, C4Version())

Container(a1, "a1")
Container(a2, "a2")
Rel(a1, a2, "request")

' legend not working legend
Rel(a2, a1, "response", $rel = $response)

Rel(a1, a2, "request2", $rel = $response)


' for a working legend you have to define the $tags too
Rel(a2, a1, "response2", $tags="response", $rel = $response)

SHOW_LEGEND()
@enduml

@kirchsth
Copy link
Member

kirchsth commented Oct 17, 2024

Based on following check, only the $lineStyle is not working. All other works

@startuml
!include <C4/C4_Sequence>

AddRelTag("response", $textColor="#green", $lineColor="red", $sprite="&envelope-closed", $techn="HTTPS", $legendSprite="&envelope-open", $legendText="response\nchanged", $lineStyle=DottedLine(), $lineThickness=3)

System(c4stdlib, C4Version())

Container(a1, "a1")

Rel(a1, a2, "request")
Rel(a2, a1, "response", $tags="response")

SHOW_LEGEND()
@enduml

@papa-vova
Copy link
Author

papa-vova commented Oct 17, 2024

If my file is working on your machine too, I would retype your file manually and check if the new *.puml is working.

hmmm
sequence.puml does not work for me (

strange. i have notepad++ as an editor, and the box in win10. the encoding is utf-8

image

Based on following check, only the $lineStyle is not working. All other works

yes i also checked colors & stuff before posting, only the line style seems to be off

@papa-vova
Copy link
Author

I have a workaround

yes it works for me (quoting the original file where i've got this problem)

image

thanks! owe you one )

@papa-vova
Copy link
Author

btw

full sample

i realized that stuff like $textColor=$ARROW_COLOR would not work as well, but $textColor=#red works

@kirchsth
Copy link
Member

In the meantime I think you have a problem in your (downloaded) *.jar file or a problem with the encoding of your *.puml.
a) can you try to store your *.puml as ANSI
b) can you try it with an other/older, ex. plantuml-mit-1.2024.6.jar

PS.: $textColor=$ARROW_COLOR does no really change the color - because it is the same, it avoids only the "last text color" in the default text of the legend image
Ex. with $textColor=$LEGEND_DARK_COLOR or $textColor=$SKETCH_WARNING_COLOR you should see the difference

@papa-vova
Copy link
Author

can you try to store your *.puml as ANSI

papavova@Thinker:/mnt/c/Users/papa.vova/Downloads$ file rel\ styling\ bug.puml
rel styling bug.puml: ASCII text, with CRLF line terminators

does not seem to help (

can you try it with an other/older, ex. plantuml-mit-1.2024.6.jar

does not seem to help either (( error's exactly the same as far as i can tell:

image

@startuml
!include <C4/C4_Sequence>

Container(a1, "a1")
Container(a2, "a2")
Rel(a1, a2, "request")
Rel(a2, a1, "response")

@enduml

HOWEVER! i did have a jar that was 11Mb instead of 21+! that's what win explorer showed to me anyway. mystery how it even worked. maybe i should fully move to wsl or linux (

thanks anyway
i think it's a problem on my side, will try to figure it out
please do not bother any more. sorry (

@The-Lum
Copy link

The-Lum commented Oct 18, 2024

Hi @papa-vova, @kirchsth

Here is a clue, from your screenshot:

image

  • What are the characters before !include?

If that can help,
Regards,
Th.

@papa-vova
Copy link
Author

Hi @The-Lum ! Yes I've noticed that, but I can't spot those characters anywhere.

Well anyway, here's what i did now:

  1. fully retyped the original file (with Sequence)
  2. got the same error
  3. replaced Sequence with Container
  4. got a proper diagram

(PlantUML runs on Win, the shell is on WSL2 which does not have Java, sorry about the mess)

image

@kirchsth
Copy link
Member

I still think it is the *.jar file. Could it be that your downloaded *.zip or the unpacked *.puml is blocked?''
https://superuser.com/questions/590787/what-does-it-mean-when-a-file-is-blocked-in-windows

PS.: And yes, If the size of your .jar file is wrong then the content is wrong and then also the internal stored <C4/C4:....> could have an issue.

@papa-vova
Copy link
Author

papa-vova commented Oct 18, 2024

Oh man, I thought they would not let me move blocked files around, but apparently they do.
The file was blocked, but unblocking did not change the outcome (

The size seems to be correct.

I am certain the issue is with the jar, i just can't spot it.

Could anybody point me to the manual as to how to check the .asc signature? I found this one, apparently i need to add some public key to some keyring, installing gpg before that, meh...

@papa-vova
Copy link
Author

They don't seem to have anything except asc pgp stuff. All the googling points to gpg, so maybe i should bite the bullet (and find out where's the public key etc)

I am not sure how to use certutil, maybe this is something really straightforward but i'm a bit old new to stis stuff, here's what i get:

image

@kirchsth
Copy link
Member

I think "certutil" is not the correct tool, therefore I deleted my comment.
But if you have a wrong file size then the file is wrong independent of the signatur.

Did you try to download the *.zip again, *unblock the .zip and then try to extract the file maybe then you have a working version

@papa-vova
Copy link
Author

downloaded the jar from github, unblocked, moved around, tried to rebuild — still no luck

i still think that win is messing with the file somehow

either that, or the include file for the sequence has some obscure bug which shows only on windows (?)

for the size, they have literally 21.1Mb which this time looks not incorrect )

@kirchsth
Copy link
Member

I checked it with win10 too->no problems; Maybe you have to unblock the *.jar file too

@papa-vova
Copy link
Author

papa-vova commented Oct 18, 2024

that's the only thing i have: the jar file
no zip archives

image

image

@kirchsth
Copy link
Member

Sorry you are right, the *.zip was the file which you gave me.
If you still get the same *preproc file then (I think) still the old *.jar is used, otherwise I would expect a difference.

But back to the original problem: I found already an issue in the forum that sequence diagrams do not support line styles, maybe I get a fast bugfix and then I will update my implementation too.

@kirchsth kirchsth added the PlantUML/Forum/... issue Issue reported to PlantUML, Forum, ... wait for final solution label Oct 19, 2024
@kirchsth kirchsth added this to the v2.11.0 milestone Oct 19, 2024
@arnaudroques
Copy link

But back to the original problem: I found already an issue in the forum that sequence diagrams do not support line styles, maybe I get a fast bugfix and then I will update my implementation too.

The plantuml/plantuml@64ea232 commit may fix it...
Please test it and tell us :-)

@kirchsth
Copy link
Member

Hi @arnaudroques,
thank you, yes it works perfect; Even backward compatible with (old) skinparam I don't need to change anything in my code.
BR Helmut
PS.: I will update the forum entry too

@kirchsth
Copy link
Member

kirchsth commented Oct 19, 2024

Hi @papa-vova,

$lineStyle works with the last beta5 (below an image, created with the new version).

image

If you download the latest PlantUML beta v1.2024.8beta5 plantuml-mit-SNAPSHOT.jar (and unblock it) then you can test it locally on your machine. (I hope you have no old *.jar file with the same name on your local system , if yes I would try a different license that you have a file with a complete new name).

I hope it works for you too. (otherwise you have to wait until the online server is updated; you can check it with following code - the brackets creates a new component and its label is the version number)

@startuml
[%version()]
@enduml

BR Helmut

@kirchsth kirchsth added PlantUML v1.2024.8 fix in PlantUML release v1.2024.8 (beta5) and removed PlantUML/Forum/... issue Issue reported to PlantUML, Forum, ... wait for final solution labels Oct 19, 2024
@papa-vova
Copy link
Author

Whoa! thanks )))

rel styling bug

the code (the variant with !include <C4/C4_Sequence> still fails):

@startuml
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Sequence.puml
AddRelTag("response", $lineStyle=DashedLine())

Container(a1, "a1")
Container(a2, "a2")
Rel(a1, a2, "request")
Rel(a2, a1, "response", $tags="response")

@enduml

@kirchsth kirchsth changed the title Rel styling would not work for sequence diagrams Rel styling $lineStyle does not work for sequence diagrams Oct 19, 2024
@kirchsth
Copy link
Member

It is fixed with PlantUML v1.2024.8 (beta5)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PlantUML v1.2024.8 fix in PlantUML release v1.2024.8 (beta5)
Projects
None yet
Development

No branches or pull requests

4 participants