This is the code for Chapter 12, Figure 4 from D3.js in Action which requires a touch interface (or emulator) to see any effect. This example implements single-finger panning by storing the initial position of a touch from d3.touches() and adjusting the SVG g element’s transform attribute based on the current position of the touch.