title: D3: Force layout + blocking work
body: <p>How would one do a blocking work on other thread (e.g. loading data) while using a force layout?</p>
  
  <p>With the simplest possible example of force layout (<a href="http://bl.ocks.org/mbostock/4062045" rel="nofollow">http://bl.ocks.org/mbostock/4062045</a>), I tried two things:</p>
  
  <pre><code>setInterval(function() {
    console.debug('BEGIN');
    for (var i = 0; i &lt; 1000000000; ++ i);
    console.debug('END');
  }, 2000);
  </code></pre>
  
  <p>and: </p>
  
  <pre><code>var run = function() {
    console.debug('BEGIN');
    for (var i = 0; i &lt; 1000000000; ++ i);
    console.debug('END');
  
    d3.timer(run, 500);
  
    return true;
  };
  
  d3.timer(run, 500);
  </code></pre>
  
  <p>But unfortunately, both seem to do the same. Block force layout's tick. This can be seen here: <a href="http://bl.ocks.org/mfolnovic/8193673" rel="nofollow">http://bl.ocks.org/mfolnovic/8193673</a>.</p>
  
  <p>I've read <a href="http://ejohn.org/blog/how-javascript-timers-work/" rel="nofollow">http://ejohn.org/blog/how-javascript-timers-work/</a>, and I think I understand why this happens. Is there a different way to work around this issue?</p>