Q001 Adding an edge by code - acarv/automatic-graph-layout GitHub Wiki

Q001 - Adding an edge by code, between two existent nodes, to the graph editor without having to reload layout ?

On former versions one was able to add an edge between two nodes, in code. Now it seems that the editor is only dealing with drag between nodes approach. Is there any proper way to add edges programaticaly? I used to use this : Microsoft.Msagl.Drawing.IViewerEdge dEdge = (fGViewer as IViewer).CreateEdge(nodeFound.Node, node1);
this.fGViewer.AddEdge(dEdge, false);

Now I've tried to use
Microsoft.Msagl.Drawing.Edge dEdge = this.fGViewer.Graph.AddEdge(nodeFound.Node.Id, node1.Id);
IViewerEdge vEdge = fGViewer.RouteEdge(dEdge);
this.fGViewer.AddEdge(vEdge, false);

But results are not so good...

I've also tried to create a GeometryEdge
Microsoft.Msagl.Routing.StraightLineEdges.CreateSimpleEdgeCurveWithUnderlyingPolyline(geomEdge);
But I got Ports problems.

thanks for any help