Improvement suggestions for layout of state diagrams, especially large ones

0 votes
asked Jan 29 in Wanted features by dmf19 (380 points)
edited Jan 29 by dmf19

I have implemented some state diagram improvement suggestions in a github repo using some pre-processor magic, along with a plantuml fork to show example necessary tweaks.  If I could get similar results using standard plantuml that would be awesome.

1 Answer

0 votes
answered Jan 29 by plantuml (293,520 points)

Congratulation for your fork, you've succeeded in improving state diagram result, which is not easy...

The main issue is that graphviz/dot is not adapted for state diagram.

We have started some time ago a try with another algorithm using this paper.

Here some input:

Here we are talking about BPMN but somehow the same algorithm could be used for state diagram.

As you see, This is really a preliminary version which is far from working.

Unfortunately, we are not working on this, due to lack of time.

However, the code is not that hard. Everything is in this package.

What I mean is, since you've forked our repo, you should have a look on this bpm package?

It's more complex than tweaking the actual state diagram but it could give far better result.

commented Jan 31 by dmf19 (380 points)
Thanks you for your feedback!  Actually, I think graphviz does a reasonable job (with my changes) of state diagrams.  I have made another improvement to make the transition labels better appear part of the transition arrow.  I much prefer displaying labels on links this way (ie. as "part" of the link) rather than separately (per graphviz default).

Another change I want to make soon is improve the links to diamond "choice" elements so they only join at the points on the diamond (which looks more natural).

I may take a look at your BPMN work, but want to improve my current approach as much as possible first.
...