This is a follow on from the simple scatterplot used as an example in the book D3 Tips and Tricks.
It is aimed at demonstrating the use of the .filter
statement in d3.js and should be taken in context with the text of the book which can be downloaded for free from Leanpub.
I think that the function you are looking for is the 'brush' function. I haven't used it for any of my examples, so Google will probably need to be youre friend. Good uck.