Is it possible to add a note above/below a component in component diagram?

0 votes
asked Jul 23, 2021 in Question / help by atharvai (120 points)
I'm looking to add a few notes on a component diagram that is fairly flat. note right/left on middle components adds a lot of spacing and can cause arrows to cross over each other which seems ugly and makes the diagram less readable.

I'm wondering if there is a way to add note below a component or above a component.

1 Answer

+2 votes
answered Jul 23, 2021 by The-Lu (63,920 points)
selected Jul 23, 2021 by atharvai
 
Best answer

Hello A.,

You can use:

[Component] as C

note top of C: A top note

note bottom of C
  A bottom note can also
  be on several lines
end note

See also doc. here:

If that can help,
Regards,
Th.

commented Jul 23, 2021 by Martin (8,360 points)

@Th - the doc also mentions "A note can be also define(sic) alone with the note keywords, then linked to other objects using the .. symbol."  But I couldn't work out the syntax for that.  Can an example be added to the doc?

commented Jul 23, 2021 by The-Lu (63,920 points)

Hello M.,

It is now done, see:

And here is an example:

@startuml
[Component] as C

note as N
  A floating note can also
  be on several lines
end note

C .. N
@enduml

Regards,
Th.

commented Jul 23, 2021 by Martin (8,360 points)
Thank you!
(I thought I'd tried that combination but obviously not!)
...