'Rendering speed of cola-layout in cytoscape.js

I applied cola-layout from cytoscape.js on a data set of over 500 nodes and edges. The layout renders the graph and takes more than 10 minutes to settle down to an open-graph.

My question is whether or not this is the amount of time, cola would take to display a graph with such complexity?

In order to get a visually pleasing (balanced) graph like this infinite:true

within cytoscape.js file that I had downloaded from here.

I had set,

infinite: true; // for cola layout

Without which it would settled down to an entangled graph like this : infinite:false

Here is the javascript code:

$(function()
{
  $('#cy').cytoscape
  ({
    style: cytoscape.stylesheet()
      .selector('node').css({'content': 'data(name)'})
      .selector('edge').css({'target-arrow-shape': 'triangle'})
      .selector(':selected').css({'line-color': 'black'})
    elements: {
      nodes: [
        { data: { id: '2335', name: '2335' } },
      //.
      //. data from www.briandunning.com/sample-data/ca-500.zip

    },
],
  edges: [
    { data: { source:'2335', target:'Canton' }
      //.
      //. data from www.briandunning.com/sample-data/ca-500.zip
    }]
},
  layout: { name: 'cola'},
  ready: function()
  {
    window.cy = this;
  }
});


}); 


Solution 1:[1]

I think you may have answered your own question! If you set infinite: true, then the layout will run infinitely. So, of course in that case it will run a long time, and in fact it will never stop unless you make API calls to do so explicitly.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 maxkfranz