src/classes/sigma.classes.edgequad.js
function _quadInsert(el, sizedPoint, quad) {
    if (quad.level < quad.maxLevel) {

      // Searching appropriate quads
      var indexes = _quadIndexes(sizedPoint, quad.corners);

      // Iterating
      for (var i = 0, l = indexes.length; i < l; i++) {

        // Subdividing if necessary
        if (quad.nodes[indexes[i]] === undefined)
          quad.nodes[indexes[i]] = _quadSubdivide(indexes[i], quad);

        // Recursion
        _quadInsert(el, sizedPoint, quad.nodes[indexes[i]]);
      }
    }
    else {

      // Pushing the element in a leaf node
      quad.elements.push(el);
    }
  }
function _quadInsert(el, sizedPoint, quad) {
    if (quad.level < quad.maxLevel) {

      // Searching appropriate quads
      var indexes = _quadIndexes(sizedPoint, quad.corners);

      // Iterating
      for (var i = 0, l = indexes.length; i < l; i++) {

        // Subdividing if necessary
        if (quad.nodes[indexes[i]] === undefined)
          quad.nodes[indexes[i]] = _quadSubdivide(indexes[i], quad);

        // Recursion
        _quadInsert(el, sizedPoint, quad.nodes[indexes[i]]);
      }
    }
    else {

      // Pushing the element in a leaf node
      quad.elements.push(el);
    }
  }
function _quadInsert ( el , sizedPoint , quad ) { if ( quad . level < quad . maxLevel ) { // Searching appropriate quads var indexes = _quadIndexes ( sizedPoint , quad . corners ) ; // Iterating for ( var i = 0 , l = indexes . length ; i < l ; i ++ ) { // Subdividing if necessary if ( quad . nodes [ indexes [ i ] ] === undefined ) quad . nodes [ indexes [ i ] ] = _quadSubdivide ( indexes [ i ] , quad ) ; // Recursion _quadInsert ( el , sizedPoint , quad . nodes [ indexes [ i ] ] ) ; } } else { // Pushing the element in a leaf node quad . elements . push ( el ) ; } }
Recursively insert an element into the quadtree. Only points
with size, i.e. axis-aligned squares, may be inserted with this
method.

@param  {object}  el         The element to insert in the quadtree.
@param  {object}  sizedPoint A sized point defined by two top points
(x1, y1), (x2, y2) and height.
@param  {object}  quad       The quad in which to insert the element.
@return {undefined}          The function does not return anything.
Recursively insert an element into the quadtree . Only points with size i . e . axis - aligned squares may be inserted with this method .