mbostock/d3 — pull request #1173 by jisaacks (2013-03-29 17:09:02+00:00)
Title: Allow setting the type of constraint to use when dragging a brush

Add a `dragConstraints` method to **brush** that excepts the following options:

- _closed_ The default and constrains the extent to be entirely within the range
- _open_ Constrians the extent to where it can can go just outside the range
- _halfopen_ Constrains the extent to where half of it can go outside the range
- _loose_ No constraints, can drag the extent well beyond the range

I specifically needed the `halfopen` setting because my graph is a list of reports and whichever report is in the center of the range is *selected*. So I needed the ability to drag the extent halfway past the range to allow for this:

I have an example of this here: http://bl.ocks.org/jisaacks/5271235 you will notice if you make a brush and drag it all the way to the left or right it will allow you to keep dragging until the beginning/end of the graph is in the center.

Currently in D3 there was no way to specify this behavior.

I added the other settings for completeness.