5

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?

ekrempe
  • 93
  • 1
  • 9

1 Answers1

2

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
David Soroko
  • 8,521
  • 2
  • 39
  • 51
  • 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. – ekrempe Jan 29 '20 at 07:40