How to prevent the Nodes and Edges from overlapping each other in GEF-Zest graph?

488 Views Asked by At

I've developed an eclipse plugin for generating Graph using GEF-Zest. I'm using SpringLayoutAlgorithm as the layout algorithm(I've also tried the other layouts), but still the nodes and edges overlap each other which creates a noisy graph. I need help in solving this problem.

1

There are 1 best solutions below

0
Matthias On

You can have a look at Eclipse Layout Kernel (ELK), they do provide sophisticated layout algorithms. Moreover, you can have a look at Graphviz. Both can be integrated as layout engines with GEF Zest. However, you need to implement GraphvizLayoutAlgorithm (delegating to Graphviz) or ElkLayoutAlgorithm (delegating to ELK).

There is an example of how to delegate layout to Graphviz dot in the official GEF repository: https://github.com/eclipse/gef/blob/master/org.eclipse.gef.dot.examples/src/org/eclipse/gef/dot/examples/DotLayoutExample.java

Apart from that, the SpringLayoutAlgorithm should not place nodes on top of each other, as can be seen when running the example: https://github.com/eclipse/gef/blob/master/org.eclipse.gef.layout.examples/src/org/eclipse/gef/layout/examples/SpringLayoutExample.java

If you want to resolve your problem with SpringLayoutAlgorithm, you need to share more insights w.r.t. your data and code. It would be best to have a short, self-contained, correct (compilable) example (SSCCE).