Welcome to PlantUML Q&A, where you can ask questions and receive answers from other members of the community.

You can also submit new features request and vote for them.

How to move a node to left

0 votes

TH

How can I move Data Source  to THE LEFT of Proxy?

 

top to bottom direction
storage "Data Source" as DS
storage "Proxy" as P
storage "Reader" as R
storage "Writer" as W
storage "Records" as Rs
storage Consumer
 
database "Data Store" as Store
 
 
DS -r-> P
P .l.> DS
P -u-> R
W .u.>> P
R -> Rs
 
Rs -d-> Store
Store .l.>> W
Store -> Consumer

 

asked Apr 10, 2016 by huanle0610 (150 points)
Sometimes, I have the same problem. It is very damaging. It is the bigger problem of this so great tool.
Yeah, It's not adhere to my intuition. Maybe I need to read the source code of plantuml. PlantUml is an Venus, not perfect but really charming.

2 Answers

0 votes
 
Best answer

This issue is more related to the way GraphViz is doing its layout, and it's not easy to work arround.

Actually, there is an ugly workaround, using packages to force node's layout :

 

Source:

@startuml
skinparam package<<Layout>> {
  borderColor Transparent
  backgroundColor Transparent
  fontColor Transparent
  stereotypeFontColor Transparent
}
skinparam shadowing false

package foo <<Layout>> {
storage "Data Source" as DS
storage "Proxy" as P
}
storage "Reader" as R
storage "Writer" as W
storage "Records" as Rs
storage Consumer
 
database "Data Store" as Store
 
 
DS -r-> P
P .l.> DS
P -u-> R
W .u.>> P
R -> Rs
 
Rs -d-> Store
Store .l.>> W
Store -> Consumer
@enduml

 

This solution is really a dirty hack...

Maybe we should add an "together" kind of package in addition to package / node / folder / frame / cloud / database. This would create just an invisible package.

So you could have:

@startuml
together {
storage "Data Source" as DS
storage "Proxy" as P
}
storage "Reader" as R
storage "Writer" as W
storage "Records" as Rs
storage Consumer
 
database "Data Store" as Store
 
 
DS -r-> P
P .l.> DS
P -u-> R
W .u.>> P
R -> Rs
 
Rs -d-> Store
Store .l.>> W
Store -> Consumer
@enduml

 

What do you think about it ?

answered Apr 11, 2016 by plantuml (118,230 points)
selected Apr 11, 2016 by huanle0610
Well done! expecting wonderful chart with more simplicity.
In last beta https://dl.dropboxusercontent.com/u/13064071/plantuml.jar we have implemented the "together" keyword.

Just tell us if it helps!
0 votes
answered May 16, 2016 by plantuml (118,230 points)
Support This Project Offer 250 Mo! Follow PlantUML on Twitter
...