plantuml / plantuml

Generate diagrams from textual description
https://plantuml.com
Other
9.73k stars 881 forks source link

Introduce port placement instructions to component diagrams #1766

Open travkin79 opened 1 week ago

travkin79 commented 1 week ago

Issue Some component diagram layout look really messy. Take the following example.

@startuml
left to right direction

component Component {
  port p1
  port p2
  port p3
  port p4
  port p5
  port p6
}

() A --> p1
() B --> p2
() C --> p3
p4 --> () X
p5 --> () Y
p6 --> () Z

@enduml

image

Feature request I suggest to introduce port placement instructions that allow for explicitly deciding on which side of a component (top, bottom, left, or right) a port is to be placed. Similar to arrow direction instructions like A -u-> B or A-up->B we could introduce port placement instructions like port[t] p1 or port[top] p1 and use directions top (or t), bottom (or b), left (or l), and right (or r), e.g.

...
component Component {
  port[l] p1
  port[left] p2
  port[t] p3
  port[top] p4
  port[bottom] p5
  port[right] p6
}
...

With these instructions I would expect the diagram to be rendered roughly like the following:

components

The textual notation above is just one suggestion. There might be better syntax alternatives.

The-Lum commented 1 week ago

Hi @travkin79, and all,

Thanks for the report or the wanted feature,

[Just for traceability,] See also pseudo-similar issues/requests here:

Regards, Th.