ScottLogic/d3-financial-components — pull request #117 by tlsim (2014-12-08 14:54:17+00:00)
Title: Chart Zoom

Not for merging yet - looking for feedback.

The idea of chartZoom is that it should be easy to add panning/zooming to a chart made with components. It manages the creation of zoom-pane rects, creates a d3 zoom behavior and sets up a function that calls each component's zoom listener on zoom..

Usage looks something like this:
```javascript
var chartZoom = fc.utilities.chartZoom();

chartZoom
.xScale(xScale)
.yScale(yScale)
.width(chartLayout.innerWidth())
.height(chartLayout.innerHeight())
.components([
[candlestick, plotArea],
[xAxis, xAxisContainer],
[yAxis, yAxisContainer]
]);

chartLayout.getChartArea(chart)
.call(chartZoom);
```
Example: https://gist.github.com/tlsim/e14ca6928db0369678de

* Components can internally manage how they should be zoomed.
* Could have the y scale domain update automatically if series data is bound.
* It's compatible with components without zoom listeners - falls back to redraw.
* Should make progress on #19 easier.