How to restrict dragging a node above view-port bounds

I want to restrict dragging a node above the view-port bounds of diagram. Exactly left and top should not be dragged, the node should remain inside the view-port. For right and bottom we can enable scroll.

To limit where a node may be dragged, you need to customize the DraggingTool, either by overriding DraggingTool | GoJS API or more commonly by supplying Part | GoJS API.

Note the sample code in the documentation for the latter property. You can adapt the code for your own requirements.