title: Drag issue in d3.js v5.4.0
body: <p>I am trying to implement <a href="https://bl.ocks.org/cjrd/6863459" rel="nofollow noreferrer">this</a> example using the <code>d3.js v5.4.0</code>.</p>
  
  <p>But as you can see <a href="https://jsfiddle.net/8kqoc0kf/" rel="nofollow noreferrer">here</a> and here:<a href="https://i.stack.imgur.com/RPBFl.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RPBFl.gif" alt="enter image description here"></a></p>
  
  <p>The previous image of the node does not become deleted after the drag even though there is no error thrown.</p>
  
  <p>I debugged the drag code stepping through the lines and was not able to find a reason for this. Will appreciate any help provided.</p>
  
  <p>I thinks that the problem may be somewhere over here:</p>
  
  <pre><code>thisGraph.drag = d3.drag()
              .subject(function(d){
                  return {x: d.x, y: d.y};
              })
              .on("drag", function(args){
                  thisGraph.state.justDragged = true;
                  thisGraph.dragmove.call(thisGraph, args);
              })
              .on("end", function() {
                  // todo check if edge-mode is selected
              });
  </code></pre>