Align text on arrows of sequence digrams

0 votes
asked Nov 23, 2018 in Wanted features by redihokuto (140 points)
Hi,

now the text alignment on arrows of sequence diagrams is set at global level only.

I would like to align the text on single arrow ending or beginning. A solution could be to align the text close to the first participant mentioned.

@startuml
participant alpha
participant beta

alpha -> beta: a1
beta <- alpha: a2

beta -> alpha: b1
alpha <- beta: b2

@enduml

In this example, a1 and b2 are put on arrow stemming off alpha; while a2 and b1 are put close to beta. This new feature can be enabled via a new setting of sequenceMessageAlign to be fully back compatible.

On top of this automatic alignment, a local attribute could be added to specify something different.

1 Answer

+1 vote
answered Nov 23, 2018 by plantuml (294,960 points)
selected Nov 26, 2018 by redihokuto
 
Best answer

Thanks for your suggestion and your snipset : it really helps!

With last beta http://beta.plantuml.net/plantuml.jar you can now have :

@startuml
skinparam SequenceMessageAlign first
participant alpha
participant beta

alpha -> beta: a1
beta <- alpha: a2

beta -> alpha: b1
alpha <- beta: b2
@enduml

Is this what you were looking for ?

commented Nov 26, 2018 by redihokuto (140 points)
Yes! It works perfectly.
With this feature is possible to align arrow text on the source or the target just reverting the text.
Out of curiosity, writing "alpha -> beta " instead of "beta <- alpha" has other effects? I came to the conclusion it was the same empirically, can you confirm/deny?

Really thanks!
commented Nov 26, 2018 by plantuml (294,960 points)
> writing "alpha -> beta " instead of "beta <- alpha" has other effects ?
No, it used to have really exactly the same effect.
This "skinparam SequenceMessageAlign first" is the only diff now.
commented Nov 26, 2018 by redihokuto (140 points)
Thanks for your confirmation. I was worried  to clash with another feature I didn't know about :).
commented Aug 12, 2023 by mskurumi

Hi, 

I'd like to have for Activity Diagram. 

pict

...