hbmartin / graphviz2drawio

Convert graphviz (dot) files into draw.io / lucid (mxGraph) format
http://graphviz2drawio.rtfd.io
GNU General Public License v3.0
163 stars 33 forks source link

Support for compound=true #32

Closed mediapunk closed 5 days ago

mediapunk commented 4 years ago

The DOT guide (https://www.graphviz.org/pdf/dotguide.pdf) gives an example of a "compound" digraph, which renders with edges between two clusters and edges between nodes and clusters:

digraph G {
  compound=true;
  subgraph cluster0 {
    a -> b;
    a -> c;
    b -> d;
    c -> d;
  }
  subgraph cluster1 {
    e -> g;
    e -> f;
  }
  b -> f [lhead=cluster1];
  d -> e;
  c -> g [ltail=cluster0,lhead=cluster1];
  c -> e [ltail=cluster0];
  d -> h;
}

The DOT Guide rendering

When I convert this with graphviz2drawio, all the cluster information seems to get lost, and all the internal nodes are just connected together. Is there a way to get the conversion to keep the compound subgraph information? Or are you possibly planning on adding support for that?

The graphviz2drawio conversion:

Screen Shot 2020-03-12 at 9 05 48 PM

hbmartin commented 5 days ago

This is fixed in the upcoming 0.3 release and automated testing has been added for that file. Feel free to reopen or create a new issue if that release does not work as you expect. Thanks for the report!

Screenshot 2024-07-02 at 4 09 55 PM