title: Cytoscape : multiple instances and no graph display
body: <p>I want to display several instances of cytoscape in a single page, in a time sequence: first one set of nodes are displayed on the graph, the user must interact with it (create edges), then he moves to a second graph (#cy0 is :hidden and #cy1 is :visible). </p>
  
  <p>For code optimisation sake I wish to use the same initialisation function to display different successive sets of nodes. My initialisation function works fine in the first instance, but the graph is not created (cy.initrender() == false) in the second session. A command is probably missing, I tested a couple, but I don't see what to do. </p>
  
  <p>Here is my code: </p>
  
  <p>//elements</p>
  
  <pre><code>$(function(){ // on dom ready
  var elesJson = {
  nodes: [
    { data: { id: 'S', faveShape: 'rectangle',} }
     ...
    ],
  
  edges: [
      { data: { id: 'loan', source: 'B', target: 'U' } },
      ...
          ],
  </code></pre>
  
  <p>};</p>
  
  <p>// instance index
      var indexLevel=0;</p>
  
  <p>// cy initialisation </p>
  
  <pre><code>$("#cy"+indexLevel).cytoscape({
  
  style: cytoscape.stylesheet()...
  
  elements: elesJson, 
  ready: function(){
      window.cy = this;});
  </code></pre>
  
  <p>// jQuery command to move from one instance to the other. </p>
  
  <pre><code>$('#next').click(function(){
  $("#cy"+indexLevel).css("visibility","hidden");
  indexLevel++;
  $("#cy"+indexLevel).css("visibility","visible");
  cy.load(elesJson);
  cy.ready(); 
  console.log(cy.initrender());
  });
  </code></pre>
  
  <p>I am able to generate my node.collection, it is not empty, but the canvas element is not created and/or displayed within the #cy div, and cy.initrender() returns "false". </p>
  
  <p>Any solution to this? </p>