title: Opening 500+ nodes at once in d3.js
body: <p>Currently I am trying to expand a d3.js tree which contains over 100,000 nodes. Many leafs exist under multiple parents, as they fit multiple sections/items/regions. Searches performed by the user results in the tree opening up to all leafs with that node ID. This can result in the graph trying to open up, on rare occasions, up to 2000 leaf nodes at once. Currently, I have found the only way to do this without crashing Chrome is to use the following <code>setInterval</code> code.</p>
  
  <pre><code>var timeout = setInterval(function(){
      for(var j = i; j &lt; i + 10 ; j++){
          makeEl(d[j]);
          Search.rules += (j+1) + ") " + Graph.findNode(d[j]) + "&lt;br&gt;&lt;br&gt;";
          highlightPathTo(d[j].id);
          if(j &gt;= d.length - 1){
              //When all of the elements have been itterated through.
              clearInterval(timeout);
              highlight.selected = d; 
              $('#highlights').removeClass('empty'); 
              break;
          }
      }
      i+=10;
  }, 500);
  </code></pre>
  
  <p>However, this takes minutes and is very laggy. I there any other way to accomplish opening this number of nodes in one go that would result in a quicker completion?</p>