/**
 * This plugin provides a method to drag & drop nodes. Check the
 * sigma.plugins.dragNodes function doc or the examples/basic.html &
 * examples/api-candy.html code samples to know more.
 */
(function() {
  'use strict';

  if (typeof sigma === 'undefined')
    throw 'sigma is not declared';

  sigma.utils.pkg('sigma.plugins');

  /**
   * This function will add `mousedown`, `mouseup` & `mousemove` events to the
   * nodes in the `overNode`event to perform drag & drop operations. It uses
   * `linear interpolation` [http://en.wikipedia.org/wiki/Linear_interpolation]
   * and `rotation matrix` [http://en.wikipedia.org/wiki/Rotation_matrix] to
   * calculate the X and Y coordinates from the `cam` or `renderer` node
   * attributes. These attributes represent the coordinates of the nodes in
   * the real container, not in canvas.
   *
   * Recognized parameters:
   * **********************
   * @param  {sigma}    s        The related sigma instance.
   * @param  {renderer} renderer The related renderer instance.
   */
  sigma.plugins.dragNodes = function(s, renderer) {
    // A quick hardcoded rule to prevent people from using this plugin with the
    // WebGL renderer (which is impossible at the moment):
    if (
      sigma.renderers.webgl &&
      renderer instanceof sigma.renderers.webgl
    )
      throw new Error(
        'The sigma.plugins.dragNodes is not compatible with the WebGL renderer'
      );

    var _body = document.body,
        _container = renderer.container,
        _mouse = _container.lastChild,
        _camera = renderer.camera,
        _node = null,
        _prefix = '',
        _isOverNode = [],
        _isMouseDown = false,
        _isMouseOverCanvas = false;

    // It removes the initial substring ('read_') if it's a WegGL renderer.
    if (renderer instanceof sigma.renderers.webgl) {
      _prefix = renderer.options.prefix.substr(5);
    } else {
      _prefix = renderer.options.prefix;
    }

    var nodeMouseOver = function(event) {
      // Deal with overNode being triggered multiple times
      if(!event.data.node.over) {
        event.data.node.over = true;
        // Add node to array of current nodes over
        _isOverNode.push(event.data.node);

        if(_isOverNode.length && ! _isMouseDown) {
          // Set the current node to be the last one in the array
          _node = _isOverNode[_isOverNode.length - 1];
          _mouse.addEventListener('mousedown', nodeMouseDown);
        }
      }
    };

    var treatOutNode = function(event) {
      // Deal with outNode being triggered multiple times
      if(event.data.node.over) {
        event.data.node.over = false;
        // Check if there is an index of the node in the array and remove it
        var indexCheck = _isOverNode.map(function(e) { return e; }).indexOf(event.data.node);
        _isOverNode.splice(indexCheck, 1);

        if(_isOverNode.length && ! _isMouseDown) {
          _node = _isOverNode[_isOverNode.length - 1];
        } else {
          _mouse.removeEventListener('mousedown', nodeMouseDown);
        }
      }
    };

    var nodeMouseDown = function(event) {
      _isMouseDown = true;
      var size = s.graph.nodes().length;
      if (size > 1) {
        _mouse.removeEventListener('mousedown', nodeMouseDown);
        _body.addEventListener('mousemove', nodeMouseMove);
        _body.addEventListener('mouseup', nodeMouseUp);

        // Deactivate drag graph.
        renderer.settings({mouseEnabled: false, enableHovering: false});
        s.refresh();
      }
    };

    var nodeMouseUp = function(event) {
      _isMouseDown = false;
      _mouse.addEventListener('mousedown', nodeMouseDown);
      _body.removeEventListener('mousemove', nodeMouseMove);
      _body.removeEventListener('mouseup', nodeMouseUp);

      // Activate drag graph.
      renderer.settings({mouseEnabled: true, enableHovering: true});
      s.refresh();
    };

    var nodeMouseMove = function(event) {
      var x = event.pageX - _container.offsetLeft,
          y = event.pageY - _container.offsetTop,
          cos = Math.cos(_camera.angle),
          sin = Math.sin(_camera.angle),
          nodes = s.graph.nodes(),
          ref = [];

      // Getting and derotating the reference coordinates.
      for (var i = 0; i < 2; i++) {
        var n = nodes[i];
        var aux = {
          x: n.x * cos + n.y * sin,
          y: n.y * cos - n.x * sin,
          renX: n[_prefix + 'x'],
          renY: n[_prefix + 'y'],
        };
        ref.push(aux);
      }

      // Applying linear interpolation.
      x = ((x - ref[0].renX) / (ref[1].renX - ref[0].renX)) *
        (ref[1].x - ref[0].x) + ref[0].x;
      y = ((y - ref[0].renY) / (ref[1].renY - ref[0].renY)) *
        (ref[1].y - ref[0].y) + ref[0].y;

      // Rotating the coordinates.
      _node.x = x * cos - y * sin;
      _node.y = y * cos + x * sin;

      s.refresh();
    };

    renderer.bind('overNode', nodeMouseOver);
    renderer.bind('outNode', treatOutNode);
  };

}).call(window);
@@ -2005,140 +2005,8 @@
   //
- Deal with overNode being triggered multiple times%0A      if(!event.data.node.over) %7B%0A        event.data.node.over = true;%0A        //
  Add
@@ -2042,18 +2042,16 @@
 es over%0A
-  
       _i
@@ -2082,34 +2082,32 @@
 a.node);%0A%0A      
-  
 if(_isOverNode.l
@@ -2125,34 +2125,32 @@
 _isMouseDown) %7B%0A
-  
         // Set t
@@ -2197,34 +2197,32 @@
 e array%0A        
- 
- 
 _node = _isOverN
@@ -2246,26 +2246,24 @@
 ength - 1%5D;%0A
-  
         _mou
@@ -2307,34 +2307,32 @@
 MouseDown);%0A
-  
       %7D%0A
       %7D%0A    
@@ -2315,32 +2315,24 @@
 n);%0A      %7D%0A
-      %7D%0A
     %7D;%0A%0A    
@@ -2380,139 +2380,8 @@
   //
- Deal with outNode being triggered multiple times%0A      if(event.data.node.over) %7B%0A        event.data.node.over = false;%0A        //
  Che
@@ -2443,18 +2443,16 @@
 move it%0A
-  
       va
@@ -2537,26 +2537,24 @@
 ode);%0A      
- 
- 
 _isOverNode.
@@ -2573,26 +2573,24 @@
 Check, 1);%0A%0A
-  
       if(_is
@@ -2622,26 +2622,24 @@
 ouseDown) %7B%0A
-  
         _nod
@@ -2685,18 +2685,16 @@
 ;%0A      
-  
 %7D else %7B
@@ -2690,26 +2690,24 @@
    %7D else %7B%0A
-  
         _mou
@@ -2762,18 +2762,8 @@
 n);%0A
-        %7D%0A
     

Remove check for over/outNode occurring multiple times. Unnecessary.