I'm using GraphX for .Net library to build graph based on my data.
I have relations: obj1->obj2 (type1), obj2->obj3(type1), obj1->obj2(type2)
(type1 and type2 is a type of line, which connects two objects).
I'm adding DataVertex
this way:
var dataVertex = new DataVertex(obj1.Name);
dataGraph.AddVertex(dataVertex);
Then I'm adding DataEdges
:
var dataEdge = new DataEdge(obj1, obj2) { Text = "type1" };
dataGraph.AddEdge(dataEdge);
dataEdge = new DataEdge(obj2, obj3) { Text = "type1" };
dataGraph.AddEdge(dataEdge);
dataEdge = new DataEdge(obj1, obj2) { Text = "type2" };
dataGraph.AddEdge(dataEdge);
But when graph is generated (I'm using BidirectionalGraph
) I see only one relation between obj1 and obj2. What should I add to code to see both relations in generated graph? I need to see both relations and labels because they represent cables between two physical objects.
I suspect what two relations just overlay one each-other.
If I set allowParallelEdges
to false
, I see only first relation, if true
then only second relation.
I think you are close. Try setting the ParallelEdgeDistance to some value. For example: