src/classes/sigma.classes.edgequad.js
function(n) {
      // Fitting to the curve is too costly, we compute a larger bounding box
      // using the control points:
      var cp = sigma.utils.getSelfLoopControlPoints(n.x, n.y, n.size);

      // Bounding box of the point and the two control points:
      var minX = Math.min(n.x, cp.x1, cp.x2),
          maxX = Math.max(n.x, cp.x1, cp.x2),
          minY = Math.min(n.y, cp.y1, cp.y2),
          maxY = Math.max(n.y, cp.y1, cp.y2);

      return {
        x1: minX - n.size,
        y1: minY - n.size,
        x2: maxX + n.size,
        y2: minY - n.size,
        height: maxY - minY + n.size * 2
      };
    }
function(n) {
      // Fitting to the curve is too costly, we compute a larger bounding box
      // using the control points:
      var cp = sigma.utils.getSelfLoopControlPoints(n.x, n.y, n.size);

      // Bounding box of the point and the two control points:
      var minX = Math.min(n.x, cp.x1, cp.x2),
          maxX = Math.max(n.x, cp.x1, cp.x2),
          minY = Math.min(n.y, cp.y1, cp.y2),
          maxY = Math.max(n.y, cp.y1, cp.y2);

      return {
        x1: minX - n.size,
        y1: minY - n.size,
        x2: maxX + n.size,
        y2: minY - n.size,
        height: maxY - minY + n.size * 2
      };
    }
function ( n ) { // Fitting to the curve is too costly, we compute a larger bounding box // using the control points: var cp = sigma . utils . getSelfLoopControlPoints ( n . x , n . y , n . size ) ; // Bounding box of the point and the two control points: var minX = Math . min ( n . x , cp . x1 , cp . x2 ) , maxX = Math . max ( n . x , cp . x1 , cp . x2 ) , minY = Math . min ( n . y , cp . y1 , cp . y2 ) , maxY = Math . max ( n . y , cp . y1 , cp . y2 ) ; return { x1 : minX - n . size , y1 : minY - n . size , x2 : maxX + n . size , y2 : minY - n . size , height : maxY - minY + n . size * 2 } ; }
Transforms a graph self loop into an axis-aligned square.

@param  {object} n A graph node with a point (x, y) and a size.
@return {object}   A square: two points (x1, y1), (x2, y2) and height.
Transforms a graph self loop into an axis - aligned square .