All examples By author By category About

emeeks

Ch. 12, Fig. 4 - D3.js in Action

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.