mbostock/d3 — pull request #1299 by mhsmith (2013-06-08 12:14:46+00:00)
Title: Add xExtent and yExtent to d3.behavior.zoom (fixes #1084)

These limit all actions to ensure the domain of the corresponding scale always stays within the given extent. As well as panning, zooming actions may also be limited in the zoom-out direction. If more than one of scaleExtent, xExtent and yExtent are provided, the effective bottom end of the scale extent will be the most restrictive of the three.

If scaleExtent and x/yExtent cannot be satisfied simultaneously (i.e. the lower scale limit implied by x/yExtent is above the scaleExtent), then x/yExtent will take priority.

Simple example: http://bl.ocks.org/mhsmith/5732011
Example with discontinuous and log scales: http://bl.ocks.org/mhsmith/5734904