(g, xRange, yRange)
| 120 | * updateOptions doesn't change the displayed ranges. |
| 121 | */ |
| 122 | var zoom = function(g, xRange, yRange) { |
| 123 | var originalXRange = g.xAxisRange(); |
| 124 | var originalYRange = g.yAxisRange(0); |
| 125 | |
| 126 | DygraphOps.dispatchMouseDown(g, xRange[0], yRange[0]); |
| 127 | DygraphOps.dispatchMouseMove(g, xRange[1], yRange[0]); // this is really necessary. |
| 128 | DygraphOps.dispatchMouseUp(g, xRange[1], yRange[0]); |
| 129 | |
| 130 | assertDeepCloseTo(xRange, g.xAxisRange(), 0.2); |
| 131 | // assert.closeTo(originalYRange, g.yAxisRange(0), 0.2); // Not true, it's something in the middle. |
| 132 | |
| 133 | var midX = (xRange[1] - xRange[0]) / 2; |
| 134 | DygraphOps.dispatchMouseDown(g, midX, yRange[0]); |
| 135 | DygraphOps.dispatchMouseMove(g, midX, yRange[1]); // this is really necessary. |
| 136 | DygraphOps.dispatchMouseUp(g, midX, yRange[1]); |
| 137 | |
| 138 | assertDeepCloseTo(xRange, g.xAxisRange(), 0.2); |
| 139 | assertDeepCloseTo(yRange, g.yAxisRange(0), 0.2); |
| 140 | } |
| 141 | |
| 142 | /** |
| 143 | * Verify that when zoomed in by mouse operations, an empty call to |
no test coverage detected