For now, I am using this workaround of explicitly listing multiple boxes with a vertical ellipsis.
digraph {
node [shape="box"]
rankdir="LR"
external1 [label="" shape="none"]
external1 -> "Coordinator" [label="Write"]
# external2 [label="" shape="none"]
# external2 -> "Coordinator" [label="Read"]
internal1 [label="" shape="none"]
{rank="same" internal1;"Coordinator"}
internal1 -> "Coordinator" [label="Timeout" ]
internal2 [label="Cleanup" shape="none"]
internal2 -> "Participant#0" [label=""]
"Participant#0"
"Participant#1" [label="⋮" shape="none"]
"Participant#2"
"Participant#0" -> "Participant#1" -> "Participant#2" [style="invisible" arrowhead="none"]
{rank="same" "internal2" "Participant#0";"Participant#1";"Participant#2";}
"Coordinator" -> "Participant#0" [label="Prepare, Abort, Commit" tooltip="asdfasf" URL="https://fizzbee.io"]
"Coordinator" -> "Participant#2" [label="Prepare, Abort, Commit" tooltip="naothetr " edgeURL="https://fizzbee.io"]
}
[dot]
digraph {
node [shape=“box”]
rankdir=“LR”
external1 [label="" shape="none"]
external1 -> "Coordinator" [label="Write"]
# external2 [label="" shape="none"]
# external2 -> "Coordinator" [label="Read"]
internal1 [label="" shape="none"]
{rank="same" internal1;"Coordinator"}
internal1 -> "Coordinator" [label="Timeout" ]
internal2 [label="Cleanup" shape="none"]
internal2 -> "Participant#0" [label=""]
"Participant#0"
"Participant#1" [label="⋮" shape="none"]
"Participant#2"
"Participant#0" -> "Participant#1" -> "Participant#2" [style="invisible" arrowhead="none"]
{rank="same" "internal2" "Participant#0";"Participant#1";"Participant#2";}
"Coordinator" -> "Participant#0" [label="Prepare, Abort, Commit" tooltip="asdfasf" URL="https://fizzbee.io"]
"Coordinator" -> "Participant#2" [label="Prepare, Abort, Commit" tooltip="naothetr " edgeURL="https://fizzbee.io"]
}
[/dot]
This mostly works.
The incoming arrows from the left implies actions/requests from external service, the incoming arrows from the top implies internal operations.
I want to be sure, if this pattern of placing 3 nodes vertically will be consistent, if I add more nodes and edges into these participants. So this doesn’t get too ugly. Here,
"Participant#0" -> "Participant#1" -> "Participant#2" [style="invisible" arrowhead="none"]
line seems to ensure this works.
I tried another variant by grouping the Participants into a cluster.
digraph {
node [shape="box"]
rankdir="LR"
external1 [label="" shape="none"]
external1 -> "Coordinator" [label="Write"]
# external2 [label="" shape="none"]
# external2 -> "Coordinator" [label="Read"]
internal1 [label="" shape="none"]
{rank="same" internal1;"Coordinator"}
internal1 -> "Coordinator" [label="Timeout" ]
internal2 [label="" shape="none"]
internal2 -> "Participant#0" [label="Cleanup"]
subgraph "cluster_Participant" {
style="dashed"
"Participant#0"
"Participant#1" [label="⋮" shape="none"]
"Participant#2"
# Adding this messes up the order of the placeholder.
# "Participant#0" -> "Participant#1" -> "Participant#2" [style="invisible" arrowhead="none"]
{rank="min" "Participant#0";"Participant#1";"Participant#2";}
}
"Coordinator" -> "Participant#0" [label="Prepare, Abort, Commit" tooltip="asdfasf" URL="https://fizzbee.io"]
"Coordinator" -> "Participant#2" [label="Prepare, Abort, Commit" tooltip="naothetr " edgeURL="https://fizzbee.io"]
}
[dot]
digraph {
node [shape=“box”]
rankdir=“LR”
external1 [label="" shape="none"]
external1 -> "Coordinator" [label="Write"]
# external2 [label="" shape="none"]
# external2 -> "Coordinator" [label="Read"]
internal1 [label="" shape="none"]
{rank="same" internal1;"Coordinator"}
internal1 -> "Coordinator" [label="Timeout" ]
internal2 [label="" shape="none"]
internal2 -> "Participant#0" [label="Cleanup"]
subgraph "cluster_Participant" {
style="dashed"
"Participant#0"
"Participant#1" [label="⋮" shape="none"]
"Participant#2"
# Adding this messes up the order of the placeholder. Commenting this line works
"Participant#0" -> "Participant#1" -> "Participant#2" [style="invisible" arrowhead="none"]
{rank="min" "Participant#0";"Participant#1";"Participant#2";}
}
"Coordinator" -> "Participant#0" [label="Prepare, Abort, Commit" tooltip="asdfasf" URL="https://fizzbee.io"]
"Coordinator" -> "Participant#2" [label="Prepare, Abort, Commit" tooltip="naothetr " edgeURL="https://fizzbee.io"]
}
[/dot]
In this version, the order of the elipses node is messed up. The same line that was required in the previous version, is breaking the order here.
"Participant#0" -> "Participant#1" -> "Participant#2" [style="invisible" arrowhead="none"]
If I comment this line out, it works.
Again, I want to understand, why this happens? Second, is there any way to guarantee the order of nodes within a subgraph
One minor issue is, I am not able to get the Cleanup action from the top. rank=“same” does not work when the nodes are across clusters. Is there a way to ensure it works?
A node shape like stackedbox would make it a lot simpler, I am not sure how much effort it is to add that. Is there a way I can get some help on that?