2

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.

smita chougale
  • 235
  • 5
  • 19

3 Answers3

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();
1

Use the dagre library bundled with the distribution in the lib folder hosted on GitHub.

GitHub Link to working Dagre.js for Cytoscape.js

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