microsoft/automatic-graph-layout

Crash on collapsing subgraphs

Closed this issue · 1 comments

Hi, I want to report an crash with collapsing a sub graph.

I use the current version of the repository (commit b199357).

Note:
It broke in commit: 0cc1abe
In the commit before it worked.

You can reproduce it with following example:

grafik

While you can collapse Model C the other crash. I think it happens when the edge goes to the cluster itself and not to an inner node.

The exception occurs in the file SplineRouter in method CalculatePortsToShapes.
grafik

I used following lines to build the graph:

          Subgraph subGraph = null;
          Subgraph parentSubGraph = null;
          Node newNode = null;
          var graph = new Graph("test");
          var structA = new Subgraph("StructA");
          var modelC = new Subgraph("ModelC");
          var modelB = new Subgraph("ModelB");
          graph.RootSubgraph.AddSubgraph(structA);
          graph.RootSubgraph.AddSubgraph(modelC);
          graph.RootSubgraph.AddSubgraph(modelB);
          newNode = graph.AddNode("Fill");
          parentSubGraph = structA;
          parentSubGraph.AddNode(newNode);
          newNode = graph.AddNode("MethodOnModelC");
          parentSubGraph = modelC;
          parentSubGraph.AddNode(newNode);
          newNode = graph.AddNode("_structA");
          parentSubGraph = modelB;
          parentSubGraph.AddNode(newNode);
          graph.AddEdge("Fill", "ModelB");
          graph.AddEdge("MethodOnModelC", "ModelB");
          graph.AddEdge("_structA", "StructA");

Fixed by d098806.