settings.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. ;(function(undefined) {
  2. 'use strict';
  3. if (typeof sigma === 'undefined')
  4. throw 'sigma is not declared';
  5. // Initialize package:
  6. sigma.utils.pkg('sigma.settings');
  7. /**
  8. * Extended sigma settings for sigma.renderers.edgeLabels.
  9. */
  10. var settings = {
  11. /**
  12. * RENDERERS SETTINGS:
  13. * *******************
  14. */
  15. // {string}
  16. defaultEdgeLabelColor: '#000',
  17. // {string}
  18. defaultEdgeLabelActiveColor: '#000',
  19. // {string}
  20. defaultEdgeLabelSize: 10,
  21. // {string} Indicates how to choose the edge labels size. Available values:
  22. // "fixed", "proportional"
  23. edgeLabelSize: 'fixed',
  24. // {string} The opposite power ratio between the font size of the label and
  25. // the edge size:
  26. // Math.pow(size, -1 / edgeLabelSizePowRatio) * size * defaultEdgeLabelSize
  27. edgeLabelSizePowRatio: 1,
  28. // {number} The minimum size an edge must have to see its label displayed.
  29. edgeLabelThreshold: 1,
  30. };
  31. // Export the previously designed settings:
  32. sigma.settings = sigma.utils.extend(sigma.settings || {}, settings);
  33. // Override default settings:
  34. sigma.settings.drawEdgeLabels = true;
  35. }).call(this);