Limit the number o edges between vertex in mxGraph

795 views Asked by At

Is there a function to prevent more than onde edge between two vertex in mxGraph? Actually I'm using mxGraph.multiplicities, however it limit the number of edges between all types of vertex and not between on type of edge.

1

There are 1 answers

0
gonchuki On

Usually you will want to accomplish this via setting setMultigraph to false.

However if you need to distinguish between different kinds of vertices or even having edges with a direction (allowing to connect both A->B and B->A), the way I did it in the past was by overloading getEdgeValidationError, where your logic can determine if and when 2 vertices can be connected.