This is the code for Chapter 11, Figure 12 from D3.js in Action demonstrating d3.svg.brush() XY-brushing as well as a simple selection of elements that fall within the region brushed.