I've been learning Python for about a year and now I'm trying to improve my JavascriptJavaScript. I wrote this simple d3 visualization that shows your Facebook friends as a force-directed graph. Here's a live version and here's the source on GithubGitHub. It works well, but it can be slow.
I understand that the number of edges to calculate grows O(n^2n2) with nodes, so complexity increases quickly for users with lots of friends, but I'm wondering if
there are any obvious optimizations I could make,
what bad habits I might be importing from Python, and
how I might tweak the layout parameters to reach equilibrium faster.
I'm pretty new to programming and very new to JavascriptJavaScript, so I'm sure I'm making some mistakes. The relevant code is included below. Thanks!