pt icon indicating copy to clipboard operation
pt copied to clipboard

Add force-directed graph

Open tofuness opened this issue 7 years ago • 3 comments

Let's get this party started 🎊

  • I've added a very simple demo.
  • I've changed the demo/index.html file and the gulpfile.js to make this easier to review. Just run gulp extend and check out the demo to get started 😄 .

Problems:

  • In the ForceDirectedGraph file, I have multiple classes implemented.
    • Ideally:
      • We'd like Graph to maybe extend PointSet
      • We'd like Edge to maybe extend Pair
  • No live (force) simulation. I am unsure how to approach this. I initially thought just moving a vertex and running the algorithm again would be an option, but it gets super jittery.
  • The current Edge implementation is bad and looks like that because I wanted it to be compatible with Form.lines.

Let me know your thoughts. Please take a look at this when you have time and sorry for not splitting it into multiple commits 💦 ..

tofuness avatar Sep 20 '16 00:09 tofuness

Exciting! Will review soon, thanks :)

williamngan avatar Sep 20 '16 09:09 williamngan

Sorry for keeping this PR stale 🙏 I've been thinking about the implementation and I think I need to revisit this algorithm. Fruchterman & Reingold (current implementation) runs on O(n^2) and is horribly slow.

I lost my (half-working) implementation of this 😭 http://www.wisdom.weizmann.ac.il/~harel/papers/highdimensionalGD.pdf

I've also looked into FADE (that builds on the Barnes-Hut simulation): http://crpit.com/confpapers/CRPITV9Pulo.pdf

I am not sure what I should do at the moment. Maybe try and take a stab at FADE? What do you think?

tofuness avatar Dec 15 '16 03:12 tofuness

@tofuness Wow these papers are intense. I would suggest you pick an implementation since you probably know way more about this than I do.

I appreciate your contribution, even if it's O(n^2). It's a start!

williamngan avatar Dec 16 '16 10:12 williamngan