plantuml / plantuml

Generate diagrams from textual description
https://plantuml.com
Other
10.46k stars 951 forks source link

Issues with switch in the activity diagram #722

Open mpusz opened 2 years ago

mpusz commented 2 years ago

It seems that switch has some issues. I am unable to create a branch with a name if there is no activity inside. Also, I cannot name the returning arrow from the activity. See this:

@startuml

:text 1;

switch ()
case (case 1)
    :text 2;
case (case 2)
    :text 3;
    ->this is invisible;
case (this is invisible as well)
endswitch

stop

@enduml
arnaudroques commented 2 years ago

Thanks for the report. This should be fixed in last beta http://beta.plantuml.net/plantuml.jar and on the online server. Tell us if you find other issues!

mpusz commented 2 years ago

Great, thanks!

mpusz commented 2 years ago

Tell us if you find other issues!

Sure, see #727 😉

pascalchap commented 2 years ago

Hello, I found 2 cases where the rendering is not good:

Case 1: text overlap

@startuml start switch (test) case (case 2) case () endswitch @enduml

image

and Case 2: missing text

@startuml start switch () case () case () -> tr; endswitch @enduml

image

Congratulations you for your work.

Pascal

arnaudroques commented 2 years ago

@pascalchap Thanks for the feedback.

We are currently completely redesign the layout engine use for activity diagram, so we won't fix those issues right now. But we are confident that the new design will be available in the incoming months. Those issues will then be fixed at that time. We'll post a message here when this will be ready. Thanks to be patient!

pascalchap commented 2 years ago

Not sure if it is relevant here, but as you mention that you are redesigning the layout engine, I take the opportunity to submit an idea I had for a long time. During design, I am generally satisfied with the automatic layout generated by plantuml and the few capabilities to control it. AT the end of the design, when there are less risk that major changes occur, I would like to have more control on the layout. I was thinking that it could be very interesting if we could assign some (or each) elements to grid cells in a similar way as it is done in some GUI libraries. For example the grid layout of python/tkinter is rather easy to use and offers some flexibility with the properties rowspan and colspan that allow to define areas that covers several elementary cells. image

I imagine that we could defined such a grid, and assign some of the diagram element to cells

The-Lum commented 1 year ago

Hi all,

[This is an Issue Review]

  1. For the initial issue: This is now fixed. 👍
    • Thanks @mpusz for the report.
    • Thanks PlantUML team for your work.

  1. It remains only the @pascalchap's issue :bug::
@startuml text_overlap
start
switch (test)
case (case 2)
case ()
endswitch
@enduml
@startuml missing_text
start
switch ()
case ()
case ()
-> tr;
endswitch
@enduml

  1. And for the @pascalchap's comment :bulb::

See:

Regards.