plantuml / plantuml

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

Change port placements in component diagrams: portin on the left, portout on the right #1765

Open travkin79 opened 1 week ago

travkin79 commented 1 week ago

Issue I expect component diagrams to be (usually) read from left to right, i.e. I expect the components and ports to be placed in such a way that in-ports are placed on the left border of a component and out-ports on the right (the data flows from left to right). Instead, in-ports are placed on the top border of a component and out-ports on the bottom.

Steps to reproduce Take the following diagram example and render it, e.g. in the PlantUML online server:

@startuml
'left to right direction

[A]
component C {
  portin p1
  portin p2
  portin p3
  portout po1
  portout po2
  portout po3
  component C1 {
    portin c1p1
    portin c1p2
    portout c1po1
    portout c1po2
  }
  component C2 {
    portin c2p1
    portout c2po1
  }
  component C3 {
    portin c3p1
    portout c3po1
  }
}
[B]

A --> p1
A --> p2
A --> p3
p1 --> c1p1
p2 --> c1p2
po1 --> B
po2 --> B
po3 --> B
c1po1 --> po1
c1po2 --> c2p1
c1po2 --> c3p1
c2po1 --> po2
c3po1 --> po3
@enduml

Expected behavior Components and ports should be placed starting on the left and going to the right, in-ports should be placed on the components' left border, out-ports on the right, like in the following example.

Please also note: ports in a component should be placed from top to bottom, e.g. p1 should be above p2, p3 should be below p2 (that's not correct in the following example).

image

Actual behavior Compoenents and ports are placed from top to bottom like in the following example:

image

Remarks I know, we can change the layout to (almost) what I suggest with the left to right direction instruction, but I think, positioning from left to right should be the default for component diagrams.