I have to create process diagramms multiple times a week. I looked into graphviz to make the process less cumbersome. I just started out learning it and it is truly great. However, I cannot figure out how to use subplots to create the layout I want.
I tried fiddling around with subgraphs, but that did not work. Is there some way I can achieve this? Here is the code for an example. I also added a picture to illustrate what I want to achieve:
digraph{
graph[rankdir =LR]
// the steps
subgraph steps{
node[shape = box]
S_1[label="Step 1"];
S_2[label = "Step 2"];
S_3[label = "Step ..."];
S_4[label = "Step k"]
S_1 -> S_2 -> S_3 -> S_4;
}
// the problems
subgraph problem {
node[shape = box, color = "red",fontsize = 8]
S_1p[label= "This is not working\nat all. People simply skip this\nstep."]
S_3p[label = "Instead of changing\nthe session setting,\nusers simply call colleagues via phone"]
S_1p->S_1 //argh
S_3p -> S_3 //argh
}
//the notes
subgraph notes{
node[shape = plaintext, color = "black",fontsize = 8]
S_1n[label="This is really important additional information"]
S_3n[label="This one as well"]
S_1n -> S_1;
S_3n -> S_3;
}
}
// graph[rankdir =LR] << use default TB
graph [newrank=true] // dang, does not help the curvy edges
// the steps
subgraph cluster_steps{
{
rank=same // keep horizontal
node[shape = box]
S_1[label="Step 1"];
S_2[label = "Step 2"];
S_3[label = "Step ..."];
S_4[label = "Step k"]
invisA[shape=point style=invis group=I]
invisA -> S_1 [style=invis]
//edge [constraint=false]
S_1 -> S_2 -> S_3 -> S_4;
}
}
// the problems
subgraph cluster_problem {
{
rank=same // keep horizontal
node[shape = box, color = "red",fontsize = 8]
S_1p[label= "This is not working\nat all. People simply skip this\nstep."]
S_3p[label = "Instead of changing\nthe session setting,\nusers simply call colleagues via phone"]
invisB[shape=point style=invis group=I]
invisB-> S_1p [style=invis]
edge [constraint=false color=red]
S_1p->S_1 //argh << pirate talk??
S_3p -> S_3 //argh
}
}
//the notes
subgraph cluster_notes{
{
rank=same // keep horizontal
node[shape = plaintext, color = "black",fontsize = 8]
S_1n[label="This is really important additional information"]
S_3n[label="This one as well"]
invisC[shape=point style=invis group=I]
invisC-> S_1n [style=invis]
edge [constraint=false color=purple]
S_1n -> S_1;
S_3n -> S_3;
}
}
edge[style=invis]
invisA -> invisB -> invisC
}