cytoscape/cytoscape.js — pull request #700 by rmosca (2014-10-31 08:56:24+00:00)
Title: Implemented the 'spread' layout

Hi Max,

as requested I open the pull request here.

Thanks!
Roberto

As a reference:

The 'spread' layout is basically a force directed layout + a relaxation step that fixes clashes between nodes and enforce a minimum distance between them.
The force directed layout is implemented by using the 'foograph' library (https://code.google.com/p/foograph/), which is based on the Fruchterman-Reingold algorithm (doi:10.1002/spe.4380211102).
The relaxation step is based on Voronoi tassellation as described in Gansner and North (doi:10.1007/3-540-37623-2_28), and is implemented using the rhill-voronoi-library (https://github.com/gorhill/Javascript-Voronoi).
Finally, in order to use web workers, when available, I used the parallel.js library which actually needed a trick to find out the path of the eval.js file in order to work.