cytoscape.jsdagre

Dagre layout for simple tree in cytoscape.js


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.


Solution

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