block by emeeks fe2e5b31716e5142bff7

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

Full Screen

This is the code for Chapter 12, Figure 6 from D3.js in Action which requires a touch interface (or emulator) to see any effect. This example uses data from d3.touches() to implement pinch zoom by calculating the initial distance between two touches and scaling an SVG g element based on the current distance between the two touches.

index.html