如何使 PlantUML 左/右/上/下箭头更长

发布于 2025-01-15 12:46:45 字数 313 浏览 5 评论 0原文

PlantUML 中切换箭头方向的语法很清晰。可以使用 -left->、-right->、-up->、-down-> 等符号。分别实现左、右、上、下方向性。文档同样清楚地表明,在语法上,可以通过增加 UML 代码中箭头中的虚线数量来增加渲染时箭头的长度(例如 --> 增加为 ---> 或 --- ->)。

当还包含方向性时,这似乎不起作用(至少在 Jebbs 的 Visual Studio Code 扩展中)。因此,例如,-left--->不会增加箭头的长度。这是预期的行为吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

独木成林 2025-01-22 12:46:46

我发现您可以通过关联上的空白标签来控制行的长度:

Foo -r->;酒吧:“”

Foo -u->栏:“\n\n\n\n”

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"

好久不见√ 2025-01-22 12:46:46

使用最新的在线服务器,这个code 不会产生一致的结果(它仅适用于 updown)。看起来像一个错误。

@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

输入图片此处描述

编辑: 添加 skinparam Nodesep 50 (该数字增加了所有类的水平分隔)是解决此错误的可能方法。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文