How to use dagre layout in cytoscape.js to draw a simple tree. I am putting layout{ name: 'dagre'} and added dagre.js file from https://github.com/cpettitt/dagre/blob/master/dist/dagre.js. It is not working.
Asked
Active
Viewed 2,647 times
3 Answers
2
I had the similar problem. I've used dagre.js from cytoscape package (https://github.com/cytoscape/cytoscape.js/blob/master/lib/dagre.js) and its working fine.
It seems like cytoscape dagre layout is not compatible with latest dagre.js (https://github.com/cpettitt/dagre) or something like this. It throws error on that line:
var g = new dagre.Digraph();

iliakolesnikov
- 66
- 3
1
Use the dagre library bundled with the distribution in the lib folder hosted on GitHub.

Dale Hurley
- 151
- 7
0
Please post an example. It works on the debug page and in the docs, so I suspect there's an issue with your code.

maxkfranz
- 11,896
- 1
- 27
- 36
-
2Your answer should be a comment. – Dale Hurley Feb 18 '15 at 23:57
-
Thanks @maxkfranz Its working now. Used https://github.com/cytoscape/cytoscape.js/blob/master/lib/dagre.js for dagre library. – smita chougale Feb 19 '15 at 05:28