Place text over arrows in state diagram?

+1 vote
asked May 25, 2021 in Question / help by anonymous

Hi,
when using a state diagram the text is always right of the arow.

If you have many arrows it is sometime unclear, to which arrow a text belongs.

With this small diagram the "Error" arrow is the middle one, but in more complex diagrams it would be easier, if the text is over the arrow

@startuml

[*] -[#black]down-> A
A --> B : foo
B --> C :Start
C --> B : Abort
B --> C :Error

@enduml

    

For example this way (beware ASCII Art)


  |
  |
Error 
  |
  v

Any way to change the position of the arrow's text?

Thanks

commented May 25, 2021 by The-Lu (89,080 points)

Hello A.,

Awaiting arrow's text management, a possible workaround is to use tabulation or space as:

@startuml
[*] -[#black]-> A
A --> B : foo
B --> C : Start
C --> B : Abort
B --> C : Error\t\t
@enduml

If that can help,
Regards,
Th.

1 Answer

0 votes
answered May 25, 2021 by anonymous
Hi The-Lu,

thanks for the lightning fast reply.

Not very elegant but a good and pragmatic way to tune the positions a little bit.

This helps a lot.

Thanks
...