This is the code for Chapter 11, Figure 14 from D3.js in Action demonstrating d3.svg.brush() XY-brushing that uses d3.geom.quadtree() to dramatically improve spatial query performance.