PlantUML and notes on packages
Asked Answered
W

1

6

I am trying to figure out how PlantUML manages notes. Below you can see a small example where the behavior seems buggy.

@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

This code compiles to the diagram below:

enter image description here

As you can see I want to add a note to a package of elements. According to the wiki 2 you could use

note bottom

to attach a note to the element last defined. When I try this right after the package was opened I get an compile error as nothing is present to attach the note to. Therefore I tried adding the note bottom directly after the package is closed. In this case the note is attached to the last element that was created inside the package.

I know that I can create notes and link them to every element as shown in the last example. But here I can't use the right, left, top, bottom keywords to manage the position. Does anybody know, if this is a bug or if I have to place my note somewhere else in the code?

Wargo answered 27/1, 2020 at 16:11 Comment(0)
P
3

Looks like you (and some of the documentation) are missing of as in 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
Pippo answered 28/1, 2020 at 12:51 Comment(1)
Thanks for your input. While this works it is not what I am looking for. As you can see in my example (node right : this links to the system...) and the wiki under "Notes and stereotypes" there is a way to attach notes to the last defined object. My problem is that the behavior what element is considered "last" seems strange.Wargo

© 2022 - 2024 — McMap. All rights reserved.