Here's the change I made to NodeXL to handle the case of two overlapping edges, this works for my case since I only ever have at most two edges overlap:
In DrawBezierCurve() I adjusted this line:
Point oBezierControlPoint = GetBezierControlPoint(oGraphDrawingContext,
oEdgeEndpoint1, oEdgeEndpoint2, !oEdge.IsFlagged ? m_dBezierDisplacementFactor : m_dBezierDisplacementFactor * 3.1416);
I added the IsFlagged property to IEdge/Edge so that I could set a flag when an edge has an overlapping edge.
In the code where I create my list of edges I have:
List<string> commonedges = new List<string>();
foreach (var transition in xmlParser.Transitions)
oGraph.Vertices.Find(transition.From, out from);
oGraph.Vertices.Find(transition.To, out to);
IEdge oEdge = oEdges.Add(from, to, true);
//PointF pa = (PointF)oEdge.GetValue(ReservedMetadataKeys.PerEdgeIntermediateCurvePoints);
if (oEdge.Vertex1.ID > oEdge.Vertex2.ID)
vcomboname = oEdge.Vertex2.ID.ToString() + "+" + oEdge.Vertex1.ID.ToString();
vcomboname = oEdge.Vertex1.ID.ToString() + "+" + oEdge.Vertex2.ID.ToString();
oEdge.IsFlagged = true;
This is too simplistic as a general solution, but does the trick when you only have two edges overlap. I would prefer to see a solution along what I described earlier, but I needed to get something done fast. The overlapped edges handling belongs
in DrawGraph. If I had a couple more hours, a generic solution would have been possible. I'm sure those well versed with the code could come up with something even faster. Perhaps a delegate to handle how to "splay" the common vectors
with a few default ways of performing the splay operation (splay vectors across an oval, spheroid, square, etc.)? The user should only have to set splay delegate to a predefined operation type. DrawGraph would to the rest.
Thank you very much for such a great tool!!