DygraphOps.dispatchMouseMove(g, xRange[1], yRange[0]); // this is really necessary.
DygraphOps.dispatchMouseUp(g, xRange[1], yRange[0]);
DygraphOps.dispatchMouseMove(g, xRange[1], yRange[0]); // this is really necessary.
DygraphOps.dispatchMouseUp(g, xRange[1], yRange[0]);
- assertEqualsDelta(xRange, g.xAxisRange(), 0.2);
- // assertEqualsDelta(originalYRange, g.yAxisRange(0), 0.2); // Not true, it's something in the middle.
+ assert.closeTo(xRange, g.xAxisRange(), 0.2);
+ // assert.closeTo(originalYRange, g.yAxisRange(0), 0.2); // Not true, it's something in the middle.
var midX = (xRange[1] - xRange[0]) / 2;
DygraphOps.dispatchMouseDown(g, midX, yRange[0]);
DygraphOps.dispatchMouseMove(g, midX, yRange[1]); // this is really necessary.
DygraphOps.dispatchMouseUp(g, midX, yRange[1]);
var midX = (xRange[1] - xRange[0]) / 2;
DygraphOps.dispatchMouseDown(g, midX, yRange[0]);
DygraphOps.dispatchMouseMove(g, midX, yRange[1]); // this is really necessary.
DygraphOps.dispatchMouseUp(g, midX, yRange[1]);
- assertEqualsDelta(xRange, g.xAxisRange(), 0.2);
- assertEqualsDelta(yRange, g.yAxisRange(0), 0.2);
-}
+ assert.closeTo(xRange, g.xAxisRange(), 0.2);
+ assert.closeTo(yRange, g.yAxisRange(0), 0.2);
+});
+*/
/**
* This tests that when changing the interaction model so pan is used instead
* of zoom as the default behavior, a standard click method is still called.
*/
/**
* This tests that when changing the interaction model so pan is used instead
* of zoom as the default behavior, a standard click method is still called.
*/
DygraphOps.dispatchMouseMove_Point(g, 10, 10);
DygraphOps.dispatchMouseUp_Point(g, 10, 10);
DygraphOps.dispatchMouseMove_Point(g, 10, 10);
DygraphOps.dispatchMouseUp_Point(g, 10, 10);
/**
* This tests that when changing the interaction model so pan is used instead
* of zoom as the default behavior, a standard click method is still called.
*/
/**
* This tests that when changing the interaction model so pan is used instead
* of zoom as the default behavior, a standard click method is still called.
*/
DygraphOps.dispatchMouseMove_Point(g, 10, 10);
DygraphOps.dispatchMouseUp_Point(g, 10, 10);
DygraphOps.dispatchMouseMove_Point(g, 10, 10);
DygraphOps.dispatchMouseUp_Point(g, 10, 10);
DygraphOps.dispatchMouseDown(g, x, y);
DygraphOps.dispatchMouseMove(g, x, y);
DygraphOps.dispatchMouseUp(g, x, y);
DygraphOps.dispatchMouseDown(g, x, y);
DygraphOps.dispatchMouseMove(g, x, y);
DygraphOps.dispatchMouseUp(g, x, y);
DygraphOps.dispatchMouseMove_Point(g, 10, 10);
DygraphOps.dispatchMouseUp_Point(g, 10, 10);
DygraphOps.dispatchMouseMove_Point(g, 10, 10);
DygraphOps.dispatchMouseUp_Point(g, 10, 10);
var clicked;
var g = new Dygraph(document.getElementById("graph"), data2, {
pointClickCallback : function(event, point) {
var clicked;
var g = new Dygraph(document.getElementById("graph"), data2, {
pointClickCallback : function(event, point) {
- assertEquals(4, clicked.xval);
- assertEquals(40, clicked.yval);
-};
+ assert.equal(4, clicked.xval);
+ assert.equal(40, clicked.yval);
+});
var clicked;
var g = new Dygraph(document.getElementById("graph"), data2, {
pointClickCallback : function(event, point) {
var clicked;
var g = new Dygraph(document.getElementById("graph"), data2, {
pointClickCallback : function(event, point) {
- InteractionModelTestCase.clickAt(g, 4, 40);
- assertEquals(1, pointClicked);
- assertEquals(2, clicked);
-};
+ clickAt(g, 4, 40);
+ assert.equal(1, pointClicked);
+ assert.equal(2, clicked);
+});
var clicked;
var g = new Dygraph(document.getElementById("graph"), data2, {
clickCallback : function(event, point) {
var clicked;
var g = new Dygraph(document.getElementById("graph"), data2, {
clickCallback : function(event, point) {
- InteractionModelTestCase.clickAt(g, 4, 40);
- assertEquals(1, clicked);
-};
+ clickAt(g, 4, 40);
+ assert.equal(1, clicked);
+});
- assertFalse(g.isZoomed());
- assertFalse(g.isZoomed("x"));
- assertFalse(g.isZoomed("y"));
-};
+ assert.isFalse(g.isZoomed());
+ assert.isFalse(g.isZoomed("x"));
+ assert.isFalse(g.isZoomed("y"));
+});
var g = new Dygraph(document.getElementById("graph"), data2, {});
DygraphOps.dispatchMouseDown_Point(g, 100, 100);
DygraphOps.dispatchMouseMove_Point(g, 130, 100);
DygraphOps.dispatchMouseUp_Point(g, 130, 100);
var g = new Dygraph(document.getElementById("graph"), data2, {});
DygraphOps.dispatchMouseDown_Point(g, 100, 100);
DygraphOps.dispatchMouseMove_Point(g, 130, 100);
DygraphOps.dispatchMouseUp_Point(g, 130, 100);
- assertTrue(g.isZoomed());
- assertTrue(g.isZoomed("x"));
- assertFalse(g.isZoomed("y"));
-};
+ assert.isTrue(g.isZoomed());
+ assert.isTrue(g.isZoomed("x"));
+ assert.isFalse(g.isZoomed("y"));
+});
var g = new Dygraph(document.getElementById("graph"), data2, {});
DygraphOps.dispatchMouseDown_Point(g, 10, 10);
DygraphOps.dispatchMouseMove_Point(g, 10, 30);
DygraphOps.dispatchMouseUp_Point(g, 10, 30);
var g = new Dygraph(document.getElementById("graph"), data2, {});
DygraphOps.dispatchMouseDown_Point(g, 10, 10);
DygraphOps.dispatchMouseMove_Point(g, 10, 30);
DygraphOps.dispatchMouseUp_Point(g, 10, 30);
- assertTrue(g.isZoomed());
- assertFalse(g.isZoomed("x"));
- assertTrue(g.isZoomed("y"));
-};
+ assert.isTrue(g.isZoomed());
+ assert.isFalse(g.isZoomed("x"));
+ assert.isTrue(g.isZoomed("y"));
+});
- assertTrue(g.isZoomed());
- assertTrue(g.isZoomed("x"));
- assertTrue(g.isZoomed("y"));
-};
+ assert.isTrue(g.isZoomed());
+ assert.isTrue(g.isZoomed("x"));
+ assert.isTrue(g.isZoomed("y"));
+});
- assertFalse(g.isZoomed());
- assertFalse(g.isZoomed("x"));
- assertFalse(g.isZoomed("y"));
-};
+ assert.isFalse(g.isZoomed());
+ assert.isFalse(g.isZoomed("x"));
+ assert.isFalse(g.isZoomed("y"));
+});
var g = new Dygraph(document.getElementById("graph"), data2, {});
g.updateOptions({dateWindow: [-.5, .3]});
var g = new Dygraph(document.getElementById("graph"), data2, {});
g.updateOptions({dateWindow: [-.5, .3]});
- assertTrue(g.isZoomed());
- assertTrue(g.isZoomed("x"));
- assertFalse(g.isZoomed("y"));
-};
+ assert.isTrue(g.isZoomed());
+ assert.isTrue(g.isZoomed("x"));
+ assert.isFalse(g.isZoomed("y"));
+});
var g = new Dygraph(document.getElementById("graph"), data2, {});
g.updateOptions({valueRange: [1, 10]});
var g = new Dygraph(document.getElementById("graph"), data2, {});
g.updateOptions({valueRange: [1, 10]});
- assertTrue(g.isZoomed());
- assertFalse(g.isZoomed("x"));
- assertTrue(g.isZoomed("y"));
-};
+ assert.isTrue(g.isZoomed());
+ assert.isFalse(g.isZoomed("x"));
+ assert.isTrue(g.isZoomed("y"));
+});
var g = new Dygraph(document.getElementById("graph"), data2, {});
g.updateOptions({dateWindow: [-1, 1], valueRange: [1, 10]});
var g = new Dygraph(document.getElementById("graph"), data2, {});
g.updateOptions({dateWindow: [-1, 1], valueRange: [1, 10]});
- assertTrue(g.isZoomed());
- assertTrue(g.isZoomed("x"));
- assertTrue(g.isZoomed("y"));
-};
+ assert.isTrue(g.isZoomed());
+ assert.isTrue(g.isZoomed("x"));
+ assert.isTrue(g.isZoomed("y"));
+});
DygraphOps.dispatchMouseDown_Point(g, 100, 100);
DygraphOps.dispatchMouseMove_Point(g, 100, 130);
DygraphOps.dispatchMouseUp_Point(g, 100, 130);
DygraphOps.dispatchMouseDown_Point(g, 100, 100);
DygraphOps.dispatchMouseMove_Point(g, 100, 130);
DygraphOps.dispatchMouseUp_Point(g, 100, 130);
- assertNotEquals(1, currentXAxisRange[0]);
- assertNotEquals(10, currentXAxisRange[1]);
- assertNotEquals(1, currentYAxisRange[0]);
- assertNotEquals(50, currentYAxisRange[1]);
+ assert.notEqual(1, currentXAxisRange[0]);
+ assert.notEqual(10, currentXAxisRange[1]);
+ assert.notEqual(1, currentYAxisRange[0]);
+ assert.notEqual(50, currentYAxisRange[1]);
// unzoom by doubleclick. This is really the order in which a browser
// generates events, and we depend on it.
// unzoom by doubleclick. This is really the order in which a browser
// generates events, and we depend on it.
// check if range for y-axis was reset to original value
// TODO check if range for x-axis is correct.
// Currently not possible because dateRange is set to null and extremes are returned
// check if range for y-axis was reset to original value
// TODO check if range for x-axis is correct.
// Currently not possible because dateRange is set to null and extremes are returned
- newYAxisRange = g.yAxisRange();
- assertEquals(1, newYAxisRange[0]);
- assertEquals(50, newYAxisRange[1]);
-};
+ var newYAxisRange = g.yAxisRange();
+ assert.equal(1, newYAxisRange[0]);
+ assert.equal(50, newYAxisRange[1]);
+});
- assertEquals(2, clicked.xval);
- assertEquals(110, clicked.yval);
-};
+ assert.equal(2, clicked.xval);
+ assert.equal(110, clicked.yval);
+});
+
+});