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.

71 lines
1.2 KiB

  1. sigma.plugins.animate
  2. =====================
  3. Plugin developed by [Alexis Jacomy](https://github.com/jacomyal).
  4. ---
  5. This plugin provides a method to animate a sigma instance by interpolating some node properties. Check the `sigma.plugins.animate` function doc or the `examples/animate.html` code sample to know more.
  6. Interpolate coordinates as follows:
  7. ```js
  8. sigma.plugins.animate(
  9. s,
  10. {
  11. x: 'target_x',
  12. y: 'target_y',
  13. }
  14. );
  15. ```
  16. Interpolate colors and sizes as follows:
  17. ```js
  18. sigma.plugins.animate(
  19. s,
  20. {
  21. size: 'target_size',
  22. color: 'target_color'
  23. }
  24. );
  25. ```
  26. Animate a subset of nodes as follows:
  27. ```js
  28. sigma.plugins.animate(
  29. s,
  30. {
  31. x: 'to_x',
  32. y: 'to_y',
  33. size: 'to_size',
  34. color: 'to_color'
  35. },
  36. {
  37. nodes: ['n0', 'n1', 'n2']
  38. }
  39. );
  40. ```
  41. Example using all options:
  42. ```js
  43. sigma.plugins.animate(
  44. s,
  45. {
  46. x: 'to_x',
  47. y: 'to_y',
  48. size: 'to_size',
  49. color: 'to_color'
  50. },
  51. {
  52. nodes: ['n0', 'n1', 'n2'],
  53. easing: 'cubicInOut',
  54. duration: 300,
  55. onComplete: function() {
  56. // do stuff here after animation is complete
  57. }
  58. }
  59. );
  60. ```