mbostock/d3 — pull request #799 by GerHobbelt (2012-09-05 21:39:15+00:00)
Title: export force.drag instance so user can access it by calling force.drag()...

... with no arguments; the drag events have been namespaced as .force, similar to the other force events: mouseover.force and mouseout.force.

It is very useful for the user to be able to get access to the force layout's drag instance, so we can override/augment the drag behaviour easily (using namespaced events, f.e.); again http://bl.ocks.org/3616279 is one case where such ability is used to add a kind of 'pinning' behaviour for dragged nodes when SHIFT/CTRL has been pressed on mouse release.

The way this 'drag' instance reference is obtained is in line with other D3 functions, where calling it with no arguments returns the drag instance. (The documented use of drag via selection.call() happens to always call it with arguments, so that pans out nicely here :-) )