Hacker News new | ask | show | jobs
by Groxx 4726 days ago
The latter. Have you seen this tool? https://github.com/mbostock/d3/wiki/Force-Layout Try e.g. the 'build your own' demo, and add a few hundred nodes. There are quite a few demos out there using this layout and canvas, SVG, etc, that perform extremely well. Otherwise, further in the past I've seen some that offload calculation onto a webworker pool, some of them handling several thousand nodes (not all tightly connected, but still) without noticeably delaying the page. But I can't find those at the moment :/

Without profiling, I'd guess the biggest speedup is from the Barnes-Hut approximation [1], which is simple enough conceptually that you might even be able to implement it by hand (if you have control over your current layout algorithm).

[1]: http://en.wikipedia.org/wiki/Barnes%E2%80%93Hut_simulation

edit: hm, and it's noticeably quicker in Chrome than Firefox. That's a little surprising, given that I'm running the nightly build, and it's usually competitive :/

edit2: ah, you are using that. strange... I wonder where the slowdown is.