dagrejs / dagre

Directed graph layout for JavaScript
MIT License
4.69k stars 602 forks source link

crossing edges #187

Open zstarczali opened 9 years ago

zstarczali commented 9 years ago

Thank you for this library it is very nice but I have a bit of a problem with edge crossings.

I generated the following graph and I have to generate crossing without graph.

capture

g.setNode(504); g.setNode(403); g.setNode(401); g.setNode(101); g.setNode(1); g.setNode(407); g.setNode(405); g.setNode(501); g.setNode(410); g.setNode(502);

g.setEdge(403,504); g.setEdge(401,403); g.setEdge(101,401); g.setEdge(1,101); g.setEdge(407,403); g.setEdge(405,504); g.setEdge(1,405); g.setEdge(501,405); g.setEdge(403,410); g.setEdge(405,502);

dagre.layout(g);

The data comes in this order. What should I do? Is this a bug or something else?

Thank you for your help.

kaonL0 commented 5 years ago

Hi,

Here is my own example for similar problem. I have plenty of them on my generated graph. I use v0.6.3

@zstarczali have you found anything to help ? @lutzroeder any advices about that ? how to improve ?

dagre_problem_crossing

And if I randomly change nodes order, I can get this diagram (where crossing can be observed upper).

problem_dagre_crossing2

Regards

danyflorez commented 3 years ago

Did you find any solution to this?