sigma.canvas.edges.labels.curvedArrow.js 995 B

12345678910111213141516171819202122232425
  1. ;(function(undefined) {
  2. 'use strict';
  3. if (typeof sigma === 'undefined')
  4. throw 'sigma is not declared';
  5. // Initialize packages:
  6. sigma.utils.pkg('sigma.canvas.edges.labels');
  7. /**
  8. * This label renderer will just display the label on the curve of the edge.
  9. * The label is rendered at half distance of the edge extremities, and is
  10. * always oriented from left to right on the top side of the curve.
  11. *
  12. * @param {object} edge The edge object.
  13. * @param {object} source node The edge source node.
  14. * @param {object} target node The edge target node.
  15. * @param {CanvasRenderingContext2D} context The canvas context.
  16. * @param {configurable} settings The settings function.
  17. */
  18. sigma.canvas.edges.labels.curvedArrow =
  19. function(edge, source, target, context, settings) {
  20. sigma.canvas.edges.labels.curve(edge, source, target, context, settings);
  21. };
  22. }).call(this);