Avoid edge-node overlapping in cytoscape.js
Asked Answered
M

1

7

Created graph using cytoscape.js. I have set the layout to 'grid'. Need to resolve following problem: original graph-

enter image description here

There is edge from Host3 to Host1 as well as from Host5 to host1,Edge from Host 5 to Host 1 overlapping the edge from Host3 to Host1.

Overlapping edge should appear like:

enter image description here

How to do it? Thanks !

Mondragon answered 16/2, 2015 at 11:14 Comment(2)
I have come across this problem too, though using the dagre layout.Lamaism
Just want to add that this is only possible in some specific cases. There are graphs where you cannot find such a non-overlapping drawing in the 2D plane. If you want to know more about planar graphs in general, see for example en.wikipedia.org/wiki/Planar_graph and discretetext.oscarlevin.com/dmoi/sec_planar.html.Faeroese
S
3

That's a research problem in graph theory. You can

(1) use a different layout or parameters, or

(2) develop a layout with less overlap for your specific usecase, or

(3) invent and/or implement novel edge overlap avoidance algorithms.

Splash answered 13/3, 2015 at 21:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.