I am using graphviz to draw a construction of a tree step by step.
It shows like the following:
The tree should show from top to down, not left to right.
The constructing code of the above image:
digraph test1 {
subgraph cluster000005 {
node_1 [label="2, 4"]
node_2 [label=1]
node_1 -> node_2
node_3 [label=3]
node_1 -> node_3
node_4 [label=5]
node_1 -> node_4
label="add 5"
}
subgraph cluster000004 {
node_5 [label=2]
node_6 [label=1]
node_5 -> node_6
node_7 [label="3, 4"]
node_5 -> node_7
label="add 4"
}
subgraph cluster000003 {
node_8 [label=2]
node_9 [label=1]
node_8 -> node_9
node_10 [label=3]
node_8 -> node_10
label="add 3"
}
subgraph cluster000002 {
node_11 [label="1, 2"]
label="add 2"
}
subgraph cluster000001 {
node_12 [label=1]
label="add 1"
}
rankdir=LR
}
Is this what you are after?
remove rankdir statement
add invisible edges to stack clusters (vertically)
lots of fiddling to get clusters to align nicely - added surrounding clusters
This:
digraph test1 {
// added "invisible clusters" to get the "real clusters"
// to align vertically
// don't understand why this was necessary
subgraph clusterInvis1 {
subgraph cluster000005 {
node_1 [label="2, 4" ]
node_2 [label=1]
node_3 [label=3]
node_4 [label=5]
node_1 -> node_2
node_1 -> node_3
node_1 -> node_4
label="add 5"
}
subgraph clusterInvis2 {
subgraph cluster000004 {
node_5 [label=2]
node_6 [label=1]
node_7 [label="3, 4"]
node_5 -> node_6
node_5 -> node_7
label="add 4"
}
subgraph cluster000003 {
node_8 [label=2 ]
node_9 [label=1]
node_10 [label=3 ]
node_8 -> node_9
node_8 -> node_10
label="add 3"
}
peripheries=0 // place here for cluster only (not nodes)
}
peripheries=0 // place here for cluster only (not nodes)
}
subgraph cluster000002 {
node_11 [label="1, 2" ]
label="add 2"
}
subgraph cluster000001 {
node_12 [label=1 ]
label="add 1"
}
//rankdir=LR
edge [style=invis]
node_12 -> node_11 -> node_8
// shorthand to define two edges
{node_9 node_10} -> node_5
{node_6 node_7} -> node_1
}
Gives:
Related
In the image below, I want to represent the 'end' of process:
Here's my codes:
digraph anim_retargetting
{
layout=dot
compound=true
fontname="Verdana"
subgraph cluster_concept {
style=filled
color=lightgrey
label = "Concept"
edge [label=" needs"]
node [shape=Msquare]
"share skeleton animation" -> "same skeleton asset" -> "same skeleton"
}
subgraph cluster_setup_humanoid_rig
{
style=filled
color=lightgrey
label="Setup 'Humanoid Rig'"
"Pick 'Humanoid Rig'"
node [style=bold]
"Pick 'Humanoid Rig'" -> "Mapping bones with Skeleton and Rig."
}
subgraph cluster_setup_the_rig_relationship
{
style=filled
color=lightgrey
label="Setup the rig relationship"
"Are both skeletons the same?" -> "Yes"
"Are both skeletons the same?" -> "No" ->
"Pick 'UE4 Humanoid' skeleton" -> "Pick 'Mixamo' skeleton"
node [style=bold]
"Yes" -> "end"
"Pick 'Mixamo' skeleton" -> "end"
}
subgraph cluster_main_flow
{
label="Share Same Skeleton Animation"
"Setup the rig relationship" ->
"Pick the target skeleton Animation: 'Idle_Rifle_Hip_Break1'" ->
"Duplicate Asset and Retarget" ->
"set 'Mixamo' skeleton as target" ->
"'Select' to confirm"
node [style=bold]
"'Select' to confirm" -> "end"
}
"Setup the rig relationship" -> "Are both skeletons the same?" [dir=none lhead=cluster_setup_the_rig_relationship]
"Pick 'UE4 Humanoid' skeleton" -> "Pick 'Humanoid Rig'" [dir=none lhead=cluster_setup_humanoid_rig]
"Pick 'Mixamo' skeleton" -> "Pick 'Humanoid Rig'" [dir=none lhead=cluster_setup_humanoid_rig]
}
I placed 2 'end' nodes in cluster_setup_the_rig_relationship and cluster_main_flow subgraph.
How can I separate 2 'end' nodes by subgraph from connected by DOT ?
Or is there other way to express the same concept?
You use for the nodes in both cases the name and this is taken as node identifier as well. By giving separate identifiers you can solve this issue, I used emf and ere as identifiers and set the appropriate label:
digraph anim_retargetting
{
layout=dot
compound=true
fontname="Verdana"
subgraph cluster_concept {
style=filled
color=lightgrey
label = "Concept"
edge [label=" needs"]
node [shape=Msquare]
"share skeleton animation" -> "same skeleton asset" -> "same skeleton"
}
subgraph cluster_setup_humanoid_rig
{
style=filled
color=lightgrey
label="Setup 'Humanoid Rig'"
"Pick 'Humanoid Rig'"
node [style=bold]
"Pick 'Humanoid Rig'" -> "Mapping bones with Skeleton and Rig."
}
subgraph cluster_setup_the_rig_relationship
{
style=filled
color=lightgrey
label="Setup the rig relationship"
"Are both skeletons the same?" -> "Yes"
"Are both skeletons the same?" -> "No" ->
"Pick 'UE4 Humanoid' skeleton" -> "Pick 'Mixamo' skeleton"
node [style=bold]
ere[label="end"]
"Yes" -> ere
"Pick 'Mixamo' skeleton" -> ere
}
subgraph cluster_main_flow
{
label="Share Same Skeleton Animation"
"Setup the rig relationship" ->
"Pick the target skeleton Animation: 'Idle_Rifle_Hip_Break1'" ->
"Duplicate Asset and Retarget" ->
"set 'Mixamo' skeleton as target" ->
"'Select' to confirm"
node [style=bold]
emf[label="end"]
"'Select' to confirm" -> emf
}
"Setup the rig relationship" -> "Are both skeletons the same?" [dir=none lhead=cluster_setup_the_rig_relationship]
"Pick 'UE4 Humanoid' skeleton" -> "Pick 'Humanoid Rig'" [dir=none lhead=cluster_setup_humanoid_rig]
"Pick 'Mixamo' skeleton" -> "Pick 'Humanoid Rig'" [dir=none lhead=cluster_setup_humanoid_rig]
}
I want to create a graph that looks like this, i. e. where an edge goes from the node Manufacturer of means of production to the subgraph with the same name.
I wrote the following code for this:
digraph G {
rankdir=LR;
compound=true;
graph [fontname="Liberation Mono"];
node [fontname="Liberation Mono"];
edge [fontname="Liberation Mono"];
subgraph cluster0 {
label="System components";
mmp [label="Manufacturer of means of production", shape=box];
}
subgraph cluster1 {
t1start [label="Start of tact 1", shape=point]
t1end [label="End of tact 1", shape=point ]
subgraph cluster1_mmp {
label="Manufacturer of means of production"
cluster1_1 [label="Node 1", color=white]
subgraph cluster1_1_1 {
label="Technological cycle 1"
cluster1_1_1 [label="Node 2", color=white]
}
subgraph cluster1_1_2 {
label="Technological cycle 2"
cluster1_1_2 [label="Node 2", color=white]
}
}
}
subgraph cluster2 {
label="Такт 2"
t2start [label="Start of tact 2", shape=point]
t2end [label="End of tact 2", shape=point]
}
t1end -> t2start
mmp -> cluster1_1 [ltail=cluster1_mmp];
}
If I try to compile this code ("C:\Program Files (x86)\Graphviz2.38\bin\"dot.exe -Tpng -ograph.png graph.dot ), I get the warning Warning: mmp -> cluster1_1: tail not inside tail cluster cluster1_mmp.
How can I fix it and make the edge go to the subgraph?
Update 1:
Below you can find the image of the expected result -- an edge that goes from a node to a subgraph (subgraph, not a node inside the subgraph). This edge is red in the image below.
Update 2: Changed the code like shown below.
digraph G {
rankdir=LR;
compound=true;
graph [fontname="Liberation Mono"];
node [fontname="Liberation Mono"];
edge [fontname="Liberation Mono"];
subgraph cluster0 {
label="System components";
mmp [label="Manufacturer of means of production", shape=box];
}
subgraph cluster1 {
t1start [label="Start of tact 1", shape=point]
t1end [label="End of tact 1", shape=point ]
subgraph cluster1_mmp {
label="Manufacturer of means of production"
testNode [label="Node 1", color=white]
subgraph cluster1_1_1 {
label="Technological cycle 1"
cluster1_1_1 [label="Node 2", color=white]
}
subgraph cluster1_1_2 {
label="Technological cycle 2"
cluster1_1_2 [label="Node 2", color=white]
}
}
}
subgraph cluster2 {
label="Такт 2"
t2start [label="Start of tact 2", shape=point]
t2end [label="End of tact 2", shape=point]
}
t1end -> t2start
mmp -> cluster1 [ltail=cluster0, lhead=cluster1, label=" "];
}
You need to change your last line
mmp -> cluster1_1 [ltail=cluster1_mmp];
to
mmp -> cluster1_1 [lhead=cluster1 label=" "]
And then the graph comes as expected
Also if you want the edge to start from outside the box then you would do
mmp -> cluster1_1 [ltail=cluster0 lhead=cluster1 label=" "];
Edit
The final code used
digraph G {
rankdir=LR;
compound=true;
graph [fontname="Liberation Mono"];
node [fontname="Liberation Mono"];
edge [fontname="Liberation Mono"];
subgraph cluster0 {
label="System components";
mmp [label="Manufacturer of means of production", shape=box];
}
subgraph cluster1 {
t1start [label="Start of tact 1", shape=point]
t1end [label="End of tact 1", shape=point ]
subgraph cluster1_mmp {
label="Manufacturer of means of production"
cluster1_1 [label="Node 1", color=white]
subgraph cluster1_1_1 {
label="Technological cycle 1"
cluster1_1_1 [label="Node 2", color=white]
}
subgraph cluster1_1_2 {
label="Technological cycle 2"
cluster1_1_2 [label="Node 2", color=white]
}
}
}
subgraph cluster2 {
label="Такт 2"
t2start [label="Start of tact 2", shape=point]
t2end [label="End of tact 2", shape=point]
}
t1end -> t2start
mmp -> cluster1_1 [lhead=cluster1 label=" "]
}
The fiddle link for the same
Urm, did you just mean "lhead=cluster1_mmp" rather than ltail?
Your edge is specified as:
mmp -> cluster1_1 [ltail=cluster1_mmp];
The error message you have is "Warning: mmp -> cluster1_1: tail not inside tail cluster cluster1_mmp"
This says that your tail is not inside the tail cluster. The tail cluster is cluster1_mmp. cluster1_1, which is what you're trying to connect to is definitely inside cluster1_mmp. This explains your confusion.
Only after much investigation with a GraphvizFiddle did I eventually remember that with an arrow the pointy end is the head (that is, the syntax is tail -> head).
So, cluster1_1, the node you're trying to says is in cluster1_mmp is the head of the arrow. That's why your ltail specification isn't working. Changing it to lhead gets rid of the error message and generates a graph that looks like your picture. The arrow goes to the subgraph, exactly what you asked for in your question.
Here's are two GraphvizFiddles, one of the original code generating the original error and one with ltail changed to lhead which matches your picture.
(I'm sure I've spent ages debugging the same problem in my own graphs. Perhaps Graphviz could get an update to check if the the ltail parameter would make sense for the arrow head and vice versa and spit out a more helpful error message.)
I'm trying to position elements in a form of an automatically generated flow-diagram.
In general, inputs (green) should be on the very left, outputs (red) on the very right and the rest should be placed in the center according to the layout.
I'm using rank=source and rank=sink for this.
Within a standard graph it works nicely.
However, when I start nesting graphs, the rank=source seems not to work. I expect the three inputs of the <> (electricity, switch, room_temperature) to be placed on the very left (as it's happening within the subgraphs) and the subgraphs + states (brown circles) and blue boxes between inputs and outputs.
Is there a way to specify "rank=center" (or something similar?)
I have gone through the documentation but did not find the correct attributes (and where to specify them).
digraph MyGraph {
node [fontsize=8 margin=".1,.01" width=.5 height=.5 shape=box]
edge [fontsize=8]
rankdir=LR;
ranksep = .25;
nodesep= .5;
subgraph cluster_4386357488 {
label = " <<GrowLamp>>"
style=solid
{rank=source;
4386357544 [label="electricity" style=filled fillcolor="#b5fed9"]
4386357712 [label="room_temperature" style=filled fillcolor="#b5fed9"]
4386357768 [label="switch" style=filled fillcolor="#b5fed9"]
}
{
4386357880 [label="off" style=filled fillcolor="#e2cbc1" shape=doublecircle]
4386357936 [label="on" style=filled fillcolor="#e2cbc1" shape=circle]
4386357656 [label="on_time" style=filled fillcolor="#d2ceef"]
}
{rank=sink;
4386357600 [label="light" style=filled fillcolor="#fcc5b3"]
4386357824 [label="temperature" style=filled fillcolor="#fcc5b3"]
}
4386357880 -> 4386357936
4386357936 -> 4386357880
{
subgraph cluster_4386357992 {
label = "<<Adder>>"
style=dashed
{rank=source;
4386358048 [label="heat_in" style=filled fillcolor="#b5fed9"]
4386358104 [label="room_temp_in" style=filled fillcolor="#b5fed9"]
}
{
4386358216 [label="state" style=filled fillcolor="#e2cbc1" shape=doublecircle]
}
{rank=sink;
4386358160 [label="temperature" style=filled fillcolor="#fcc5b3"]
}
4386358216 -> 4386358160 [style="dashed"]
}
subgraph cluster_4386358328 {
label = "<<HeatElement>>"
style=solid
{rank=source;
4386358384 [label="electricity" style=filled fillcolor="#b5fed9"]
}
{
4386358496 [label="on" style=filled fillcolor="#e2cbc1" shape=doublecircle]
}
{rank=sink;
4386358440 [label="heat" style=filled fillcolor="#fcc5b3"]
}
4386358496 -> 4386358440 [style="dashed"]
}
subgraph cluster_4386358608 {
label = "<<LightElement>>"
style=solid
{rank=source;
4386358664 [label="electricity" style=filled fillcolor="#b5fed9"]
}
{
4386358776 [label="off" style=filled fillcolor="#e2cbc1" shape=doublecircle]
4386358832 [label="on" style=filled fillcolor="#e2cbc1" shape=circle]
}
{rank=sink;
4386358720 [label="light" style=filled fillcolor="#fcc5b3"]
}
4386358776 -> 4386358832
4386358832 -> 4386358776
4386358776 -> 4386358720 [style="dashed"]
4386358832 -> 4386358720 [style="dashed"]
}
4386358160 -> 4386357824
4386357712 -> 4386358104
4386358440 -> 4386358048
4386358720 -> 4386357600
4386357936 -> 4386358384 [style="dashed"]
4386357936 -> 4386358664 [style="dashed"]
4386357936 -> 4386357656 [style="dashed"]
}
}
Hopeful solution:
Here is what I would like to end up with. Note how the green boxes are all on the left within their respective subgraphs, and the red boxes are on the right. Between there should be the rest of the elements, positioned by graphviz.
You can get the layout you want by adding invisible edges to connect the three inputs to the rest of the diagram so that the graphviz layout algorithm can calculate their rank correctly. You can make any edge invisible by adding style=invis to the edge formatting.
digraph MyGraph {
node [fontsize=8 margin=".1,.01" width=.5 height=.5 shape=box]
edge [fontsize=8]
rankdir=LR;
ranksep = .25;
nodesep= .5;
subgraph cluster_4386357488 {
label = " <<GrowLamp>>"
style=solid
{rank=source;
4386357544 [label="electricity" style=filled fillcolor="#b5fed9"]
4386357712 [label="room_temperature" style=filled fillcolor="#b5fed9"]
4386357768 [label="switch" style=filled fillcolor="#b5fed9"]
}
{
4386357880 [label="off" style=filled fillcolor="#e2cbc1" shape=doublecircle]
4386357936 [label="on" style=filled fillcolor="#e2cbc1" shape=circle]
4386357656 [label="on_time" style=filled fillcolor="#d2ceef"]
}
{rank=sink;
4386357600 [label="light" style=filled fillcolor="#fcc5b3"]
4386357824 [label="temperature" style=filled fillcolor="#fcc5b3"]
}
4386357880 -> 4386357936
4386357936 -> 4386357880
#invisible edges added to achieve correct layout
4386357544 -> 4386357880 [style="invis"]
4386357712 -> 4386357880 [style="invis"]
4386357768 -> 4386357880 [style="invis"]
{
subgraph cluster_4386357992 {
label = "<<Adder>>"
style=dashed
{rank=source;
4386358048 [label="heat_in" style=filled fillcolor="#b5fed9"]
4386358104 [label="room_temp_in" style=filled fillcolor="#b5fed9"]
}
{
4386358216 [label="state" style=filled fillcolor="#e2cbc1" shape=doublecircle]
}
{rank=sink;
4386358160 [label="temperature" style=filled fillcolor="#fcc5b3"]
}
4386358216 -> 4386358160 [style="dashed"]
}
subgraph cluster_4386358328 {
label = "<<HeatElement>>"
style=solid
{rank=source;
4386358384 [label="electricity" style=filled fillcolor="#b5fed9"]
}
{
4386358496 [label="on" style=filled fillcolor="#e2cbc1" shape=doublecircle]
}
{rank=sink;
4386358440 [label="heat" style=filled fillcolor="#fcc5b3"]
}
4386358496 -> 4386358440 [style="dashed"]
}
subgraph cluster_4386358608 {
label = "<<LightElement>>"
style=solid
{rank=source;
4386358664 [label="electricity" style=filled fillcolor="#b5fed9"]
}
{
4386358776 [label="off" style=filled fillcolor="#e2cbc1" shape=doublecircle]
4386358832 [label="on" style=filled fillcolor="#e2cbc1" shape=circle]
}
{rank=sink;
4386358720 [label="light" style=filled fillcolor="#fcc5b3"]
}
4386358776 -> 4386358832
4386358832 -> 4386358776
4386358776 -> 4386358720 [style="dashed"]
4386358832 -> 4386358720 [style="dashed"]
}
4386358160 -> 4386357824
4386357712 -> 4386358104
4386358440 -> 4386358048
4386358720 -> 4386357600
4386357936 -> 4386358384 [style="dashed"]
4386357936 -> 4386358664 [style="dashed"]
4386357936 -> 4386357656 [style="dashed"]
}
}
}
With dot.exe version 2.38 you should get a graph like:
The goal is to render an org-chart, where certain individuals have extra colored "labels" attached to them, representing their role in the scenario. Those labels are supposed to be directly to the left of the individual.
By making the individual and their labels part of a sub-graph, and then telling it that the labels and the person node are all {rank=same;...}, I was able to force the labels to appear where I wanted them.
However, there is a huge distance between the labels and the node that they are annotating. Nothing I have tried seems to fix it.
How do I make it so that the "label" nodes are as close to the node they are supposed to label as they are to one another?
digraph scenario {
outputorder=edgesfirst
rankdir=TB
graph [ splines=true ]
subgraph cluster_spec {
ranksep="0.25 equally"
style="filled";
bgcolor="#f7f7f7";
node [
style="filled",
fillcolor="#f7f7f7",
fontname="sans-serif",
fontsize="10",
shape=circle,
width="0.75in",
fixedsize="shape",
color="black"
]
manager [ label="manager", fillcolor="#00a000", fontcolor="#ffffff" ];
accessor [ label="accessor", fillcolor="#a00000", fontcolor="#ffffff" ];
submitter [ label="submitter", fillcolor="#ffff00", fontcolor="#000000" ];
owner [ label="owner", fillcolor="#0000a0", fontcolor="#ffffff" ];
backup [ label="backup", fillcolor="#a000a0", fontcolor="#ffffff" ];
{rank=same; "submitter" -> "accessor" [ color="#808080", dir="both" ]}
"manager" -> "submitter" [ color="black" ]
"owner" -> "submitter" [ color="black" ]
{rank=same; "submitter" -> "backup" [ color="#808080", dir="both" ]}
"manager" -> "accessor" [ color="black" ]
"owner" -> "accessor" [ color="black" ]
{rank=same; "accessor" -> "backup" [ label="same", color="red:green", dir="both" ]}
{rank=same; "manager" -> "owner" [ label="same", color="red:green", dir="both" ]}
"manager" -> "backup" [ color="black" ]
"owner" -> "backup" [ color="black" ]
}
subgraph cluster_final {
color=white;
ranksep="0.25 equally"
nodesep="0.125"
node [
fontname="sans-serif"
shape=circle,
style="filled",
fillcolor="#e7e7e7",
width="1.5in",
fixedsize=shape,
]
edge [
color="#000080",
headclip=true,
tailclip=true
]
subgraph "cluster_emma-7246-roles" {
{ rank=same;
"emma-7246-submitter" [ shape="cds", label="submitter", style="filled", fillcolor="#ffff00", height="0.75in", width="1.5in", fontcolor="#000000", fontsize="24"]
"emma-7246" [ label="emma-7246" ]
"emma-7246-submitter" -> "emma-7246" [ color="#f0f0f0", len="0.125" ];
}
}
subgraph "cluster_edmund-0712-roles" {
{ rank=same;
"edmund-0712-accessor" [ shape="cds", label="accessor", style="filled", fillcolor="#a00000", height="0.75in", width="1.5in", fontcolor="#ffffff", fontsize="24"]
"edmund-0712-backup" [ shape="cds", label="backup", style="filled", fillcolor="#a000a0", height="0.75in", width="1.5in", fontcolor="#ffffff", fontsize="24"]
"edmund-0712" [ label="edmund-0712" ]
"edmund-0712-accessor" -> "edmund-0712" [ color="#f0f0f0", len="0.125" ];
"edmund-0712-backup" -> "edmund-0712" [ color="#f0f0f0", len="0.125" ];
}
}
subgraph "cluster_emma-8949-roles" {
{ rank=same;
"emma-8949-manager" [ shape="cds", label="manager", style="filled", fillcolor="#00a000", height="0.75in", width="1.5in", fontcolor="#ffffff", fontsize="24"]
"emma-8949-owner" [ shape="cds", label="owner", style="filled", fillcolor="#0000a0", height="0.75in", width="1.5in", fontcolor="#ffffff", fontsize="24"]
"emma-8949" [ label="emma-8949" ]
"emma-8949-manager" -> "emma-8949" [ color="#f0f0f0", len="0.125" ];
"emma-8949-owner" -> "emma-8949" [ color="#f0f0f0", len="0.125" ];
}
}
"edmund-9898" -> "emma-8949"
"emma-8949" -> "edmund-0712"
"emma-8949" -> "emma-7246"
}
}
NOTE: If I take out the first subgraph, then the second one renders the way I expect it to. Something about the presence of the first subgraph is interfering with the layout and rendering of the second one.
I have a graph file like this:
digraph {
"Step1" -> "Step2" -> "Step3";
subgraph step2detail {
"Step2" -> "note1";
"Step2" -> "note2";
"Step2" -> "note3";
"Step2" -> "note4";
rankdir=TB
}
}
I want the subgraph step2detail to hang off to the right of 'Step2'.
Right now it looks like this:
I want Step1, Step2 and Step3 to all be vertically under each other and in 1 column.
The trick to get the graph you described is to use two subgraphs and link from one to the other. The invisible edges in "details" are what keep the notes aligned.
digraph {
rankdir="LR";
subgraph steps {
rank="same";
"Step1" -> "Step2" -> "Step3";
}
subgraph details {
rank="same";
edge[style="invisible",dir="none"];
"note1" -> "note2" -> "note3" -> "note4";
}
"Step2" -> "note1";
"Step2" -> "note2";
"Step2" -> "note3";
"Step2" -> "note4";
}
The result is:
Here's as simple as it gets - just use the group attribute to have graphviz prefer straight
edges:
digraph {
node[group=a, fontname="Arial", fontsize=14];
"Step1" -> "Step2" -> "Step3";
node[group=""];
"Step2" -> "note1";
"Step2" -> "note2";
"Step2" -> "note3";
"Step2" -> "note4";
}
By grouping the Step nodes into a clustered subgraph, the output is as follows:
digraph {
subgraph cluster_0 {
color=invis;
"Step1" -> "Step2" -> "Step3";
}
subgraph cluster_1 {
color=invis;
"Step2" -> "note4";
"Step2" -> "note3";
"Step2" -> "note2";
"Step2" -> "note1";
}
}
color=invis removes the border that would otherwise be drawn around the cluster
rankdir doesn't work directly in the subgraph, but if you add another set of curly braces - whatever that's called - rankdir works:
digraph {
"Step1" -> "Step2" -> "Step3";
subgraph step2detail {
{
"Step2" -> "note1";
"Step2" -> "note2";
"Step2" -> "note3";
"Step2" -> "note4";
rankdir=TB
rank=same
}
}
}
Use the command: rankdir=LR;
digraph {
rankdir=LR;
"Step1" -> "Step2" -> "Step3";
subgraph step2detail {
"Step2" -> "note1";
"Step2" -> "note2";
"Step2" -> "note3";
"Step2" -> "note4";
rankdir=TB
}
}