Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add length parameter to Rel and Lay procedures #153

Closed
dannief opened this issue Jun 5, 2021 · 3 comments
Closed

Add length parameter to Rel and Lay procedures #153

dannief opened this issue Jun 5, 2021 · 3 comments

Comments

@dannief
Copy link

dannief commented Jun 5, 2021

For diagrams with a lot of elements, it would be helpful to have more control of the layout, by manipulating arrow lengths. See below

@startuml
!include <C4/C4_Context>

System(a, A)
System_Ext(b, B)
System_Ext(c, C)
System_Ext(d, D)
System_Ext(e, E)
System_Ext(f, F)
System_Ext(g, G)
System_Ext(h, H)
System_Ext(i, I)


Rel(a, b, " ")
Rel(a, c, " ")
Rel(a, d, " ")
Rel(a, e, " ")
Rel(a, f, " ")
Rel(a, g, " ")
Rel(a, h, " ")
Rel(a, i, " ")
@enduml

Diagram 1

After increasing the arrow length for some relations, the following diagram can be achieved.

@startuml
!include <C4/C4_Context>

System(a, A)
System_Ext(b, B)
System_Ext(c, C)
System_Ext(d, D)
System_Ext(e, E)
System_Ext(f, F)
System_Ext(g, G)
System_Ext(h, H)
System_Ext(i, I)


a --> b
a ---> c
a --> d
a ---> e
a --> f
a ---> g
a --> h
a ---> i
@enduml

Diagram 2

Using the nodesep skinparam, and longer arrows, the diagram can be further condensed.

@startuml
!include <C4/C4_Context>

skinparam nodesep 10

System(a, A)
System_Ext(b, B)
System_Ext(c, C)
System_Ext(d, D)
System_Ext(e, E)
System_Ext(f, F)
System_Ext(g, G)
System_Ext(h, H)
System_Ext(i, I)


a --> b
a ---> c
a ----> d
a --> e
a ---> f
a ----> g
a --> h
a ---> i
@enduml

Diagram 3

@kirchsth
Copy link
Member

kirchsth commented Jun 5, 2021

Lay_Distance() support is part of #143. PlantUML has a limitation and "distance" only work in layout direction (details see #134) and therefore I cannot make a solution which works in all directions.

In the meantime you can use my branch like below
BR Helmut

@startuml
!include https://raw.githubusercontent.com/kirchsth/C4-PlantUML/extended/C4_Context.puml
' !include <C4/C4_Context>

skinparam nodesep 10

System(a, A)
System_Ext(b, B)
System_Ext(c, C)
System_Ext(d, D)
System_Ext(e, E)
System_Ext(f, F)
System_Ext(g, G)
System_Ext(h, H)
System_Ext(i, I)

Rel(a, b, " ")
Rel(a, c, " ")
Rel(a, d, " ")
Rel(a, e, " ")
Rel(a, f, " ")
Rel(a, g, " ")
Rel(a, h, " ")
Rel(a, i, " ")

' Lay_Distance(a,b,0)
Lay_Distance(a,c,1)
Lay_Distance(a,d,2)
' Lay_Distance(a,e,0)
Lay_Distance(a,f,1)
Lay_Distance(a,g,2)
' Lay_Distance(a,h,0)
Lay_Distance(a,i,1)
@enduml

@dannief
Copy link
Author

dannief commented Jun 8, 2021

Did not realize that Lay_Distance could be used with Rel like this. Lay_Distance was what I was looking for.

@dannief dannief closed this as completed Jun 8, 2021
@Potherca Potherca added the wontfix This will not be worked on label Jun 13, 2021
@kirchsth
Copy link
Member

@Potherca: I wouldn't mark it with "wontfix" we have a working solution (workaround) for that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

3 participants