borken worker

This commit is contained in:
Oliver Gorwits
2017-12-14 07:57:55 +00:00
parent c327b28513
commit ebadebe69a
3 changed files with 71 additions and 31 deletions

View File

@@ -0,0 +1,12 @@
importScripts( 'http://localhost:5000/javascripts/d3-3.5.6.js' );
onmessage = function(event) {
var force = event.data.force;
for (var i = 0, n = Math.ceil(Math.log(0.001) / Math.log(1 - (1 - Math.pow(0.001, 1 / 300)))); i < n; ++i) {
postMessage({type: "tick", progress: i / n});
force.tick();
}
postMessage({type: "end", force: force});
};