Setting delay time for dragging tool

We are having few nodes in diagram, which can be draggable.
Now they are instantly moving once the user press and drag.
Instead of that, we want the user to press and hold it for 2 seconds then only it should be draggable.

I tried by setting
myDiagram.toolManager.draggingTool.delay = 2000;

But it’s not working. I also tried it on sample http://www.gojs.net/latest/samples/htmlDragDrop.html.

Is there any other setting needed achieve this ?

Yes, the DraggingTool.delay property only applies to touch events.

I overrode the DraggingTool.canStart method in samples/minimal.html to get that behavior for mouse events:

    myDiagram = $(go.Diagram, "myDiagram",
                  {
                    initialContentAlignment: go.Spot.Center,  // center the content
                    "draggingTool.delay": 2000,
                    "undoManager.isEnabled": true  // enable undo & redo
                  });

    var tool = myDiagram.toolManager.draggingTool;
    tool.canStart = function() {
      var result = go.DraggingTool.prototype.canStart.call(tool);
      // must wait for "delay" milliseconds before this tool can run
      if (result && (tool.diagram.lastInput.timestamp -
                     tool.diagram.firstInput.timestamp) < tool.delay) return false;
      return result;
    };

However I must say that using a delay of 2000 milliseconds is way too long for comfortable use. It seems you have to hold it stationary “forever” before you can move the mouse and get a dragging operation instead of a panning operation.

Thanks for the solution walter,
We are having drag selection tool also, some times accidentally nodes get dragged.
So we want user’s to long press/click the node for at least for 1 to 2 seconds before dragging.