Show Bidirectional Edges

Jan 16, 2013 at 11:42 AM

Hi,

I am using NodeXLClass Library in Window Application(c#).

I want to have bidirectional edges in graph . I know directed edges are possible in graph while adding them in Edges Collection. I wanna double ended arrow edges in graph instead of arrow at only single end.

Is it possible ??

Jan 16, 2013 at 8:53 PM

If you add two edges to a directed graph, one from A to B and the other from B to A, then NodeXL will draw them on top of each other so that you'll see what looks like one edge with two arrowheads.  In most cases this isn't what is desired, and we have plans to add an option for "separating" overlapping edges to make them visually distinguishable, but in your case it sounds like that's the effect you want.

So if you want something that looks like one bidirectional edge, try adding two edges that connect the same vertices, but in opposite order.

-- Tony

Jan 17, 2013 at 5:41 AM
Edited Jan 17, 2013 at 5:41 AM

Hi Tony,

Thanks for your suggestions, but we wanna to have only single edge between two nodes to avoid this overlapping problem.

I have seen we can set the edge direction only at the time we create it eg

 

                   IVertex EdgeVer1;
                    IVertex EdgeVer2;
                    dicVertex.TryGetValue(Counts.caller1.ToString(), out EdgeVer1);
                    
                    dicVertex.TryGetValue(Counts.caller2.ToString(), out EdgeVer2);
                                         
                    IEdge edgeMainGraph = OEdges.Add(EdgeVer1, EdgeVer2, true);

 

Here edge will be drawn with arrow heading toward EdgeVer2 side. 

Can we change its directions toward EdgeVer1  by setting any value or simply remove this edge directedness property in the graph at any time.

Jan 17, 2013 at 4:57 PM

No, you can't change an edge's direction or its directedness.  You can, however, remove it from the graph using Graph.Edges.Remove(IEdge edge), and then add another edge that swaps the two vertices.

-- Tony