Welcome to PlantUML Q&A, where you can ask questions and receive answers from other members of the community.

You can also submit new features request and vote for them.

Activity beta: default arrow direction with one-branch if

0 votes

Hi,

With the new activity diagram syntax, the default direction of the 'if' and 'else' branches are left and right, respectively. As a consequence, diagrams tend to 'expand to the left' a lot.

A request for customizable directions exists, and would be very nice if it could be implemented in any case, but is so far not answered.

IMHO diagrams would already become more readable if the default direction would become 'down' instead for the 'if'-branch when there is no 'else' or the 'else' is empty (i.e. only present to put a label on the 'else'-branch, but no operations in it) or with only a 'stop'. Alternatively, if the 'if'-branch is empty or contains only a 'stop' (as in some branches of the example given by http://plantuml.sourceforge.net/qa/?qa=2961/activity-beta-drawing-improvements where the reversal is clearly used to improve the layout also) and the 'else'-branch is not, the 'else'-branch should go down instead.

This behaviour (the first part of it) is already default if there is an 'elseif' following the 'if', and for each 'elseif' as well, so should maybe not be too complicated to implement?

However, I understand that this is a matter of taste, so maybe the default behaviour should be configurable with a 'skinparam' option for the diagram?

asked Jul 28, 2016 in Wanted features by ivokrab (170 points)

2 Answers

0 votes
Ok, we like the idea.

We will implement a 'down' direction when 'then' or 'else' is either empty/only stop
This sound like a fair default behaviour.
If people complains about it, we will then introduce a new skinparam option to go back to the current implementation.

We need some time to do this, and we will post a message here when a beta will be ready.
So please be patient :-)

And thanks again for the suggestion!
answered Jul 28, 2016 by plantuml (117,910 points)
0 votes
Work is still in progress.
But you can find here a first beta version:
https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

Do not hesitate to make feedback!
answered Sep 1, 2016 by plantuml (117,910 points)
Finally got around to test the beta locally. Indeed 8048beta1 that I managed to download a while ago implements this behaviour nicely. However, in 8049beta19 which you made available for http://plantuml.sourceforge.net/qa/?qa=4819/activity-beta-any-way-to-put-text-on-arrow-going-to-elseif-node seem to have reverted to the old behaviour?
Yes, it was reverted because in some cases, it causes drawing artifacts.
(Sorry that we did not mention that)

Example of issue:
@startuml
start
:Hello;
if (dummy) then (foo)
    stop
endif
:Other;
@enduml

However, we have just put it back again in last beta (8049beta20):
https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

We are trying to properly finish this modification so that it will present in next official release.

Regards,
Support This Project Offer 250 Mo! Follow PlantUML on Twitter
...