src/classes/sigma.classes.graph.js
function __bindGraphMethod(methodName, scope, fn) {
    var result = function() {
      var k,
          res;

      // Execute "before" bound functions:
      for (k in _methodBeforeBindings[methodName])
        _methodBeforeBindings[methodName][k].apply(scope, arguments);

      // Apply the method:
      res = fn.apply(scope, arguments);

      // Execute bound functions:
      for (k in _methodBindings[methodName])
        _methodBindings[methodName][k].apply(scope, arguments);

      // Return res:
      return res;
    };

    return result;
  }
function __bindGraphMethod(methodName, scope, fn) {
    var result = function() {
      var k,
          res;

      // Execute "before" bound functions:
      for (k in _methodBeforeBindings[methodName])
        _methodBeforeBindings[methodName][k].apply(scope, arguments);

      // Apply the method:
      res = fn.apply(scope, arguments);

      // Execute bound functions:
      for (k in _methodBindings[methodName])
        _methodBindings[methodName][k].apply(scope, arguments);

      // Return res:
      return res;
    };

    return result;
  }
function __bindGraphMethod ( methodName , scope , fn ) { var result = function ( ) { var k , res ; // Execute "before" bound functions: for ( k in _methodBeforeBindings [ methodName ] ) _methodBeforeBindings [ methodName ] [ k ] . apply ( scope , arguments ) ; // Apply the method: res = fn . apply ( scope , arguments ) ; // Execute bound functions: for ( k in _methodBindings [ methodName ] ) _methodBindings [ methodName ] [ k ] . apply ( scope , arguments ) ; // Return res: return res ; } ; return result ; }
A custom tool to bind methods such that function that are bound to it will
be executed anytime the method is called.

@param  {string}   methodName The name of the method to bind.
@param  {object}   scope      The scope where the method must be executed.
@param  {function} fn         The method itself.
@return {function}            The new method.
A custom tool to bind methods such that function that are bound to it will be executed anytime the method is called .