I am trying to make a dot script generator for a homework problem, it's going well except I have this issue where some nodes that are not defined in subgraphs are being placed in them. For example the following dot script:
digraph dg {
compound=true;
labelloc="t";
label="test.cpp";
Vehicle;
Make;
subgraph clusterFord {
label="Ford"
Ford[shape="none"][style="invis"][label=""];
Mustang -> Vehicle [label="private"];
Thunderbird -> Vehicle [label="private"];
}
Ford -> Make [label="public"][ltail ="clusterFord"];
subgraph clusterChevrolet {
label="Chevrolet"
Chevrolet[shape="none"][style="invis"][label=""];
Camero -> Vehicle [label="private"];
}
Chevrolet -> Make [label="public"][ltail ="clusterChevrolet"];
}
Generates this image:
The "Vehicle" node is supposed to be outside of the "Ford" subrgraph. What am I missing here?