plantuml-stdlib / C4-PlantUML

C4-PlantUML combines the benefits of PlantUML and the C4 model for providing a simple way of describing and communicate software architectures
MIT License
6.26k stars 1.09k forks source link

Lay_D too much space in most cases #205

Closed acristu closed 2 years ago

acristu commented 2 years ago

Hello, thanks for your work on this library.

If there is no Rel the spacing between containers looks good:

image

With one Rel there is too much space between the containers using Lay_D:

image

For a small diagram like the one above it is really not much of a problem, but large diagrams become unreadable:

image

@startuml 
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Deployment.puml

skinparam linetype polyline
skinparam linetype ortho

Deployment_Node(Node1, "Node1", "", "") {
  Container(container1_1, "container1-1", "bla bla")
  Container(container1_2, "container1-2", "bla bla")
  Container(container1_3, "container1-3", "bla bla")
  Container(container1_4, "container1-4", "bla bla")
  Container(container1_5, "container1-5", "bla bla")
}

Deployment_Node(Node3, "Node3", "", "") {
  Container(container3_1, "container3-1", "bla bla")
  Container(container3_2, "container3-2", "bla bla")
}

'Rel(container1_1, container3_1, "rel")
'Rel(container1_2, container3_2, "rel")

Lay_D(container1_1, container1_2)
Lay_D(container1_2, container1_3)
Lay_D(container1_3, container1_4)
Lay_D(container1_4, container1_5)

LAYOUT_WITH_LEGEND()

@enduml
kirchsth commented 2 years ago

Hello @acristu,

I'm happy that it is useful for you.

I cannot reproduce the problem with the extra "empty line", If I take your source it looks on the plantuml server like Or did I overseen something?

Are you using an older local PlantUML version? Maybe an update could help.

Related to the distance itself I found (maybe there are more)

' skinparam nodesep x (where x is an integer > 0) will increase the horizontal margin
' skinparam ranksep x affects the vertical margin

With that I can generated a diagram like (I used SHOW_LEGEND() that only the required entries are displayed)

@startuml
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Deployment.puml

' skinparam nodesep x (where x is an integer > 0) will increase the horizontal margin
' skinparam ranksep x affects the vertical margin
skinparam nodesep 1
skinparam ranksep 1

skinparam linetype polyline
skinparam linetype ortho

Deployment_Node(Node1, "Node1", "", "") {
  Container(container1_1, "container1-1", "bla bla")
  Container(container1_2, "container1-2", "bla bla")
  Container(container1_3, "container1-3", "bla bla")
  Container(container1_4, "container1-4", "bla bla")
  Container(container1_5, "container1-5", "bla bla")
}

Deployment_Node(Node3, "Node3", "", "") {
  Container(container3_1, "container3-1", "bla bla")
  Container(container3_2, "container3-2", "bla bla")
}

Rel(container1_1, container3_1, "rel")
Rel(container1_2, container3_2, "rel")

Lay_D(container1_1, container1_2)
Lay_D(container1_2, container1_3)
Lay_D(container1_3, container1_4)
Lay_D(container1_4, container1_5)

SHOW_LEGEND()
@enduml

Thank you and best regards Helmut

acristu commented 2 years ago

Hi, thank you for the quick reply. I am using a local kroki server, I will try to upgrade and check if the problems still persists...

kirchsth commented 2 years ago

Hi @acristu, did an update help? BR Helmut

acristu commented 2 years ago

Hi @kirchsth ,

It seems this setting does the trick even with our current older version skinparam ranksep 1.

Thanks, the issue is fixed for me.