Open martint opened 10 years ago
I had similar problems when using dagre. I’d love to have some option to make the layout looks nicer.
From: Martin Traverso [mailto:notifications@github.com] Sent: Wednesday, October 29, 2014 9:11 PM To: cpettitt/dagre-d3 Subject: [dagre-d3] Weird-looking layout (#108)
For a graph with the following shape:
digraph G { "0.0"; "0.1"; "0.2"; "0.3"; "1.0"; "1.1"; "1.2"; "1.3"; "2.0"; "2.1"; "2.2"; "2.3"; "3.0"; "3.1"; "3.2"; "3.3"; "1.0"->"0.0"; "1.1"->"0.0"; "1.2"->"0.0"; "1.3"->"0.0"; "1.0"->"0.1"; "1.1"->"0.1"; "1.2"->"0.1"; "1.3"->"0.1"; "1.0"->"0.2"; "1.1"->"0.2"; "1.2"->"0.2"; "1.3"->"0.2"; "1.0"->"0.3"; "1.1"->"0.3"; "1.2"->"0.3"; "1.3"->"0.3"; "2.0"->"1.0"; "2.1"->"1.0"; "2.2"->"1.0"; "2.3"->"1.0"; "2.0"->"1.1"; "2.1"->"1.1"; "2.2"->"1.1"; "2.3"->"1.1"; "2.0"->"1.2"; "2.1"->"1.2"; "2.2"->"1.2"; "2.3"->"1.2"; "2.0"->"1.3"; "2.1"->"1.3"; "2.2"->"1.3"; "2.3"->"1.3"; "3.0"->"2.0"; "3.1"->"2.0"; "3.2"->"2.0"; "3.3"->"2.0"; "3.0"->"2.1"; "3.1"->"2.1"; "3.2"->"2.1"; "3.3"->"2.1"; "3.0"->"2.2"; "3.1"->"2.2"; "3.2"->"2.2"; "3.3"->"2.2"; "3.0"->"2.3"; "3.1"->"2.3"; "3.2"->"2.3"; "3.3"->"2.3"; }
graphviz produces this layout: https://cloud.githubusercontent.com/assets/14387/4838489/41b0cda6-5fea-11e4-907b-d37337c626ec.png
while dagre produces this one: https://cloud.githubusercontent.com/assets/14387/4838492/571f86d2-5fea-11e4-9997-7b0c65ddbd70.png
Is this expected? Is there any way to force dagre to produce something closer to graphviz for this case?
— Reply to this email directly or view it on GitHub https://github.com/cpettitt/dagre-d3/issues/108 . https://github.com/notifications/beacon/AHCd_yzwMcQlsrxory4UWLKwadkXx4Yaks5nIbG3gaJpZM4C0vKE.gif
I'm new to Dagre myself, but did you try these properties?
graph nodesep 50 Number of pixels that separate nodes horizontally in the layout. graph edgesep 10 Number of pixels that separate edges horizontally in the layout. graph ranksep 50 Number of pixels between each rank in the layout.
A somewhat simplified example of the ever expanding split, for debugging purposes:
For a graph with the following shape:
graphviz produces this layout:
while dagre produces this one:
Is this expected? Is there any way to force dagre to produce something closer to graphviz for this case?