1

Another try at a semi-complicated deployment diagram (content is deployment:ish).

Background: I add components one by one, it works (see on plantuml server here) enter image description here

until I get to "aabb9" (i e a9)...

Problem: When I add aabb9 to be the target of an "up" arrow from aabb5, I expect aabb9 to be placed above aabb5, where there is space. Like this:

enter image description here

Instead, the diagram layout is almost completely redone by the engine, and seemingly, the previously defined relationships are no longer "respected". So the (bad) result becomes: enter image description here

Notice how the first nodes now come rightmost, and my relationships specified to be going to the right from those two (aabb1 & aabb2), are no longer "respected"/drawn as entered. Here is that same drawing with the line uncommented, and the "bad"/undesired result.

So, below here is the code that works, but if you uncomment the last line, it goes bananas and "relayouts" the whole thing.

Any clues to this? It would be cool to be able to create these simple diagrams with text...

Thanks! /mawi

@startuml
skinparam ranksep 5
skinparam nodesep 5

rectangle "aabb1" {
    node aabb1 as a1
    node aabb2 as a2
}
a1 --[hidden]> a2

control "aabb3" as a3
database "aabb4" as a4
queue "aabb5" as a5
control "aabb6" as a6
control "aabb7" as a7
database "aabb8" as a8
control "aabb9" as a9

a1 -right-> a3: Range
a2 -right-> a3: 3D Models
a3 -down-> a4: Range & Models
a3 -> a5: product.\nupsert

a5 -down-> a6: product.\nupsert
a6 -> a5: product.\nprocessed

a5 -> a7: product.processed
a7 -> a8: Data
a7 -> a5: product.\nstored

'a5 -up-> a9: product.stored

@enduml
Marcus Widerberg
  • 103
  • 1
  • 1
  • 8

1 Answers1

2

Ok, so I figured I'd continued experimenting a bit before giving up, and I found what works for this case, and a hypothesis, but no root cause...

What works?

So, if I add a relationship/flow from the new "free" node (i e "aabb9") and not to it, it works. So, if I do e g a9 -down-> a5: product.stored, it works as expected.

And once that is done, I can add the flow from the rest of the diagram to the new node, i e uncomment the last line.

So the key is that I need to do the down arrow first: To link from the new node to the rest of the diagram, before the up arrow line that was commented.

Then the engine will layout aabb9 correctly.

To achieve the exact result I was after, I can just reverse the arrowhead of that flow, so I get a9 <-down- a5: product.stored.

But it almost seems like a bug. :-)

Comments and thoughts welcome, hope this helps some poor plantuml explorer. :)

Edit: here's the code:

@startuml
skinparam ranksep 5
skinparam nodesep 5

rectangle "aabb1" {
    node aabb1 as a1
    node aabb2 as a2
}
a1 --[hidden]> a2

control "aabb3" as a3
database "aabb4" as a4
queue "aabb5" as a5
control "aabb6" as a6
control "aabb7" as a7
database "aabb8" as a8
control "aabb9" as a9

a1 -right-> a3: Range
a2 -right-> a3: 3D Models
a3 -down-> a4: Range & Models
a3 -> a5: product.\nupsert

a5 -down-> a6: product.\nupsert
a6 -> a5: product.\nprocessed

a5 -> a7: product.processed
a7 -> a8: Data
a7 -> a5: product.\nstored

a9 -down-> a5: product.stored
a5 -up-> a9: product.stored

@enduml

enter image description here

Fuhrmanator
  • 11,459
  • 6
  • 62
  • 111
Marcus Widerberg
  • 103
  • 1
  • 1
  • 8
  • Yep - "baby steps" is a classic pattern in modifying complicated systems. GraphViz is the underlying (seemingly non-deterministic) algorithm. My general approach is to avoid using horizontal directions (only use vertical `-->` arrows), then trying to walk the diagram back to something nicer using direction hints. – Fuhrmanator Aug 23 '22 at 20:32