Graph database Analysis of the Steam Network
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
2.5 KiB

  1. sigma.layout.forceAtlas2
  2. ========================
  3. Algorithm by [Mathieu Jacomy](https://github.com/jacomyma).
  4. Plugin by [Guillaume Plique](https://github.com/Yomguithereal).
  5. ---
  6. This plugin implements [ForceAtlas2](http://www.plosone.org/article/info%3Adoi%2F10.1371%2Fjournal.pone.0098679), a force-directed layout algorithm.
  7. For optimization purposes, the algorithm's computations are delegated to a web worker.
  8. ## Methods
  9. **sigma.startForceAtlas2**
  10. Starts or unpauses the layout. It is possible to pass a configuration if this is the first time you start the layout.
  11. ```js
  12. sigmaInstance.startForceAtlas2(config);
  13. ```
  14. **sigma.stopForceAtlas2**
  15. Pauses the layout.
  16. ```js
  17. sigmaInstance.stopForceAtlas2();
  18. ```
  19. **sigma.configForceAtlas2**
  20. Changes the layout's configuration.
  21. ```js
  22. sigmaInstance.configForceAtlas2(config);
  23. ```
  24. **sigma.killForceAtlas2**
  25. Completely stops the layout and terminates the assiociated worker. You can still restart it later, but a new worker will have to initialize.
  26. ```js
  27. sigmaInstance.killForceAtlas2();
  28. ```
  29. **sigma.isForceAtlas2Running**
  30. Returns whether ForceAtlas2 is running.
  31. ```js
  32. sigmaInstance.isForceAtlas2Running();
  33. ```
  34. ## Configuration
  35. *Algorithm configuration*
  36. * **linLogMode** *boolean* `false`: switch ForceAtlas' model from lin-lin to lin-log (tribute to Andreas Noack). Makes clusters more tight.
  37. * **outboundAttractionDistribution** *boolean* `false`
  38. * **adjustSizes** *boolean* `false`
  39. * **edgeWeightInfluence** *number* `0`: how much influence you give to the edges weight. 0 is "no influence" and 1 is "normal".
  40. * **scalingRatio** *number* `1`: how much repulsion you want. More makes a more sparse graph.
  41. * **strongGravityMode** *boolean* `false`
  42. * **gravity** *number* `1`: attracts nodes to the center. Prevents islands from drifting away.
  43. * **barnesHutOptimize** *boolean* `true`: should we use the algorithm's Barnes-Hut to improve repulsion's scalability (`O(n²)` to `O(nlog(n))`)? This is useful for large graph but harmful to small ones.
  44. * **barnesHutTheta** *number* `0.5`
  45. * **slowDown** *number* `1`
  46. * **startingIterations** *integer* `1`: number of iterations to be run before the first render.
  47. * **iterationsPerRender** *integer* `1`: number of iterations to be run before each render.
  48. *Supervisor configuration*
  49. * **worker** *boolean* `true`: should the layout use a web worker?
  50. * **workerUrl** *string* : path to the worker file if needed because your browser does not support blob workers.
  51. ## Notes
  52. 1. The layout won't stop by itself, so if you want it to stop, you will have to trigger it explicitly.