PlantUML 和包注释

ekr*_*mpe 6 uml plantuml

我试图弄清楚 PlantUML 如何管理笔记。下面你可以看到一个小例子,其中的行为似乎有问题。

@startuml

package package{
    'note bottom : this seems to be the correct place, but brings an error

    artifact system
    note right : this links to the system as it should
}
note bottom: This should link to the \npackage, not the last element\nin the package list.

note "Link to the package" as test
test .- package

@enduml
Run Code Online (Sandbox Code Playgroud)

这段代码编译后如下图:

在此输入图像描述

正如您所看到的,我想向元素包添加注释。根据 wiki 2你可以使用

note bottom
Run Code Online (Sandbox Code Playgroud)

将注释附加到最后定义的元素。当我在打开包后立即尝试此操作时,我收到编译错误,因为没有任何内容可以附加注释。因此我尝试在包装关闭后直接添加注释底部。在这种情况下,注释将附加到包内创建的最后一个元素。

我知道我可以创建注释并将它们链接到每个元素,如上一个示例所示。但这里我无法使用right、left、top、bottom关键字来管理位置。有人知道这是一个错误还是我必须将注释放在代码中的其他位置吗?

Dav*_*oko 3

看起来您(和一些文档)丢失了,of如下所示note bottom of package

@startuml
package package {
    'note bottom : this seems to be the correct place, but brings an error

    artifact system
    note right : this links to the system as it should
}
note bottom of package: This should link to the \npackage, not the last element\nin the package list.


note "Link to the package" as test
test .- package
@enduml
Run Code Online (Sandbox Code Playgroud)