This is document gives a few insights on how to add a zooming feature with d3.js. It is composed by several interactive examples, allowing to play with the code to understand better how it works.
d3.zoom()
clipPath
is used to avoid displaying the
circle outside the chart area.
all(brush.move, null)
is used to dismiss the
grey brushing area once the selection has been done.