5

I use pyreverse to create class diagrams from python code and this results in graphs like this:

enter image description here

as can be seen, some classes are not related. I would like to have the subgraphs laid out below each other so that I can include the image in a document.

Is there a simple way to modify a dot file so that disconnected parts of a graph are placed below each other?

MatthewMartin
  • 32,326
  • 33
  • 105
  • 164
oarfish
  • 4,116
  • 4
  • 37
  • 66

1 Answers1

2

Connect the disconnected parts with invisible edges:

digraph so
{
    node[ shape = box ];
    A[ label = "Message" ];
    B[ label = "MetaMessage" ];
    C[ label = "TrainingMessage" ];
    D[ label = "MessageBundle" ];

    A -> { B C };
    { B C } -> D[ style = invis ];
}

yields

enter image description here

vaettchen
  • 7,299
  • 22
  • 41