Created by Christopher Manning
This creates a graph with the number of nodes you specify and random edges based on the probability selected. The number indicates how many edges are connected to that node. Red nodes are not connected to any other nodes.
Inspired by this tweet from @ChicagoCDO
Nodes are added to the graph along the path of an Archimedean spiral. This is more pleasing than adding nodes at random locations. This also prevents new nodes from chaotically bouncing around since now they are always placed at a reasonable distance from each other.
forked from christophermanning's block: Erdős–Rényi Force Directed Graph
https://cdnjs.cloudflare.com/ajax/libs/d3/2.10.0/d3.v2.min.js
https://cdnjs.cloudflare.com/ajax/libs/dat-gui/0.5/dat.gui.min.js