Slanted/crossing arrows in sequence diagrams

0 votes
asked Mar 19, 2019 in Wanted features by Dave Moon

The TEOZ feature of & to put two arrows in the same row is nice, but it doesn't handle the general problem.  Many people over the last six years have asked for sequence diagrams to allow arrows between different points in time, which would be rendered as slanted arrows.  I need this myself.  As far as I can tell there is no way to do this, whether using PUMA or TEOZ.

If you want a syntax suggestion, here is a very simple one:  append +N to an arrow specification to put the target N rows down, i.e. N steps later in time.  Also allow -N to put the target N rows up.

For example, if Alice and Bob concurrently send each other messages and the messages cross in the fabric, this description represents that situation and would render crossing arrows:

Alice -> Bob+1
& Bob -> Alice+1

It would be convenient, but not necessary, to allow a symbolic label for the destination row so authors don't have to count.

To me this seems easy to implement.  You just need to apply a rotation transform to the arrow line, the arrow head, and the attached text if any.

Let me know what you think.

commented Mar 25, 2019 by Medard
do not forget the following:
according to the UML specification, an open arrow (->) means an asynchronous message. It would be nice if one could slant it.
also: according to the UML specification, an triangular arrow means a synchronous message
(-|>). These must not be slanted.

Further: there should absolutely be introduced the possibility to make time annotation on the live lines of objects, e.g. if one slants an asyncronous message or e.g. if one wants to show a timeout constraint.
commented Mar 27, 2019 by Dave Moon
A better syntax would be
event ::= [ "&" | "@" label ] participant arrow participant [ "color" color ] [ text ]
participant ::=  "[" | "]" | participantName [ "@" label ]

1 Answer

0 votes
answered Mar 20, 2019 by plantuml (278,240 points)

No, you cannot do this right now. Sorry about this.

Somehow, this feature is connected to the "anchor" that have been implemented recently (see )

A possible syntax would be something like :

!pragma teoz true
{start} Alice -> Bob : start
Bob -> Max{start} : this arrow is slanted
Max{end} -> Bob : this arrow is also slanted
{end} Bob -> Alice : finish

However, you'll have to be patient : the implementation is not that simple and we are working on many other features...