Implement panning while keeping nodes draggable in d3 force layout
问题 I use the d3.layout.force to visualize graph structures. And I want both node dragging feature and panning feature. (By 'panning', I mean something like google maps behavior.) As shown in several d3 examples, nodes can be made draggable by nodes.call(force.drag) . And panning can be implemented by d3.behavior.drag . However, it seems they can not be used simultaneously. Here is a code example: var width = 400, height = 300; var svg = d3.select('body').append('svg').attr({width: width, height: