title: Drag, drop and fix a node in D3JS
body: <p>I have a HTML File to display graphs using D3JS. The JSFiddle is in <a href="https://jsfiddle.net/vgy1s8k3/" rel="nofollow">this link here</a>. I know that I must use the function to enable the fixing of node position on dragging and dropping:</p>
  
  <pre><code>var drag = force.drag()
  .on("dragstart", dragstart);
  
  function dragstart(d) {
    d3.select(this).classed("fixed", d.fixed = true);
  }
  </code></pre>
  
  <p>However, on dragging and dropping a node, I am unable to fix the position. I want the same functionality as shown in <a href="http://bl.ocks.org/norrs/2883411" rel="nofollow">this link</a> .I don't want the node to revert to its original position. How do I change it?</p>