How to make PlantUML left/right/up/down arrow longer
Asked Answered
E

2

7

The syntax for switching the directionality of the arrows in PlantUML is clear. One can use an -left->, -right->, -up->, -down-> to achieve left, right, up, and down directionality respectively. The documentation is equally clear that increasing the length of an arrow on rendering can be done syntactically through increasing the number of dashed in the arrow in the UML code (eg. --> is increased to ---> or ---->).

This doesn't seem to work (at least in the Visual Studio Code extension by Jebbs) when there is also directionality included. So, for example, -left---> does not increase the length of the arrow. Is this expected behavior?

Eldrida answered 19/3, 2022 at 20:58 Comment(1)
A workaround is to add a blank label with some number of spaces A -left-> B : " "Hysterics
H
3

Using the latest online server, this code doesn't produce consistent results (it only works for up and down). Seems like a bug.

@startuml
skinparam style strictuml
hide empty methods
hide empty members

A -r-> B
A1 --r--> B1

C -l-> D
C1 -l--> D1

E -u-> F
E1 -u--> F1

G -d-> H
G1 -d--> H1

@enduml

enter image description here

EDIT: adding skinparam nodesep 50 (the number increases horizontal separation for all classes) is a possible work-around to this bug.

Hysterics answered 18/8, 2022 at 22:38 Comment(0)
L
3

I've found you can control the length of the lines is via a blank label on the association:

Foo -r-> Bar : " "

or

Foo -u-> Bar : "\n\n\n\n"

Libre answered 17/8, 2023 at 16:21 Comment(1)
A shady workaround, but it works :DAverse

© 2022 - 2024 — McMap. All rights reserved.