From 319d0361d2e512ed8049dfedffd79254e491201c Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Sat, 21 Mar 2015 16:49:34 -0400 Subject: [PATCH] test tweaks to facilitate conversion --- auto_tests/tests/axis_labels.js | 14 +- auto_tests/tests/callback.js | 24 +-- auto_tests/tests/connect_separated_points.js | 6 +- auto_tests/tests/css.js | 28 ++-- auto_tests/tests/custom_bars.js | 6 +- auto_tests/tests/data_api.js | 18 ++- auto_tests/tests/date_ticker.js | 6 +- auto_tests/tests/error_bars.js | 6 +- auto_tests/tests/fill_step_plot.js | 8 +- auto_tests/tests/formats.js | 26 +-- auto_tests/tests/grid_per_axis.js | 6 +- auto_tests/tests/interaction_model.js | 16 +- auto_tests/tests/missing_points.js | 6 +- auto_tests/tests/multiple_axes.js | 14 +- auto_tests/tests/numeric_ticker.js | 228 +++++++++++++-------------- auto_tests/tests/per_axis.js | 50 +++--- auto_tests/tests/plugins.js | 14 +- auto_tests/tests/range_selector.js | 26 +-- auto_tests/tests/range_tests.js | 30 ++-- auto_tests/tests/resize.js | 8 +- auto_tests/tests/rolling_average.js | 12 +- auto_tests/tests/scrolling_div.js | 33 ++-- auto_tests/tests/simple_drawing.js | 6 +- auto_tests/tests/stacked.js | 6 +- auto_tests/tests/step_plot_per_series.js | 6 +- auto_tests/tests/to_dom_coords.js | 18 +-- auto_tests/tests/update_options.js | 42 ++--- auto_tests/tests/visibility.js | 16 +- 28 files changed, 345 insertions(+), 334 deletions(-) diff --git a/auto_tests/tests/axis_labels.js b/auto_tests/tests/axis_labels.js index fd29235..abde4b8 100644 --- a/auto_tests/tests/axis_labels.js +++ b/auto_tests/tests/axis_labels.js @@ -12,14 +12,14 @@ AxisLabelsTestCase.prototype.setUp = function() { AxisLabelsTestCase.prototype.tearDown = function() { }; -AxisLabelsTestCase.simpleData = +var simpleData = "X,Y,Y2\n" + "0,-1,.5\n" + "1,0,.7\n" + "2,1,.4\n" + "3,0,.98\n"; -AxisLabelsTestCase.prototype.kCloseFloat = 1.0e-10; +var kCloseFloat = 1.0e-10; AxisLabelsTestCase.prototype.testMinusOneToOne = function() { var opts = { @@ -75,7 +75,7 @@ AxisLabelsTestCase.prototype.testSmallRangeNearZero = function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); assertEqualsDelta([-0.1,-0.05,0,0.05], - Util.makeNumbers(Util.getYLabels()), this.kCloseFloat); + Util.makeNumbers(Util.getYLabels()), kCloseFloat); opts.valueRange = [-0.05, 0.05]; g.updateOptions(opts); @@ -645,7 +645,7 @@ AxisLabelsTestCase.prototype.testIncludeZero = function() { AxisLabelsTestCase.prototype.testAxisLabelFontSize = function() { var graph = document.getElementById("graph"); - var g = new Dygraph(graph, AxisLabelsTestCase.simpleData, {}); + var g = new Dygraph(graph, simpleData, {}); // Be sure we're dealing with a 14-point default. assertEquals(14, Dygraph.DEFAULT_ATTRS.axisLabelFontSize); @@ -696,7 +696,7 @@ AxisLabelsTestCase.prototype.testAxisLabelFontSize = function() { AxisLabelsTestCase.prototype.testAxisLabelFontSizeNull = function() { var graph = document.getElementById("graph"); - var g = new Dygraph(graph, AxisLabelsTestCase.simpleData, + var g = new Dygraph(graph, simpleData, { axisLabelFontSize: null }); @@ -714,7 +714,7 @@ AxisLabelsTestCase.prototype.testAxisLabelFontSizeNull = function() { AxisLabelsTestCase.prototype.testAxisLabelColor = function() { var graph = document.getElementById("graph"); - var g = new Dygraph(graph, AxisLabelsTestCase.simpleData, {}); + var g = new Dygraph(graph, simpleData, {}); // Be sure we're dealing with a black default. assertEquals("black", Dygraph.DEFAULT_ATTRS.axisLabelColor); @@ -765,7 +765,7 @@ AxisLabelsTestCase.prototype.testAxisLabelColor = function() { AxisLabelsTestCase.prototype.testAxisLabelColorNull = function() { var graph = document.getElementById("graph"); - var g = new Dygraph(graph, AxisLabelsTestCase.simpleData, + var g = new Dygraph(graph, simpleData, { axisLabelColor: null }); diff --git a/auto_tests/tests/callback.js b/auto_tests/tests/callback.js index 5fe1739..7958c3f 100644 --- a/auto_tests/tests/callback.js +++ b/auto_tests/tests/callback.js @@ -6,16 +6,18 @@ var CallbackTestCase = TestCase("callback"); +var xhr, styleSheet; + CallbackTestCase.prototype.setUp = function() { document.body.innerHTML = "
"; - this.xhr = XMLHttpRequest; - this.styleSheet = document.createElement("style"); - this.styleSheet.type = "text/css"; - document.getElementsByTagName("head")[0].appendChild(this.styleSheet); + xhr = XMLHttpRequest; + styleSheet = document.createElement("style"); + styleSheet.type = "text/css"; + document.getElementsByTagName("head")[0].appendChild(styleSheet); }; CallbackTestCase.prototype.tearDown = function() { - XMLHttpRequest = this.xhr; + XMLHttpRequest = xhr; }; var data = "X,a\,b,c\n" + @@ -295,9 +297,9 @@ CallbackTestCase.prototype.testClosestPointStackedCallback = function() { CallbackTestCase.prototype.testClosestPointCallbackCss1 = function() { var css = "div.dygraph-legend > span { display: block; }\n" + "div.dygraph-legend > span.highlight { border: 1px solid grey; }\n"; - this.styleSheet.innerHTML = css; + styleSheet.innerHTML = css; runClosestTest(false, 2, 4); - this.styleSheet.innerHTML = ''; + styleSheet.innerHTML = ''; } /** @@ -306,9 +308,9 @@ CallbackTestCase.prototype.testClosestPointCallbackCss1 = function() { CallbackTestCase.prototype.testClosestPointCallbackCss2 = function() { var css = "div.dygraph-legend > span { display: none; }\n" + "div.dygraph-legend > span.highlight { display: inline; }\n"; - this.styleSheet.innerHTML = css; + styleSheet.innerHTML = css; runClosestTest(false, 10, 15); - this.styleSheet.innerHTML = ''; + styleSheet.innerHTML = ''; // TODO(klausw): verify that the highlighted line is drawn on top? } @@ -589,7 +591,7 @@ CallbackTestCase.prototype.testHighlightCallbackRow = function() { * Test that underlay callback is called even when there are no series, * and that the y axis ranges are not NaN. */ -CallbackTestCase.prototype.underlayCallback_noSeries = function() { +CallbackTestCase.prototype.testUnderlayCallback_noSeries = function() { var called = false; var yMin, yMax; @@ -613,7 +615,7 @@ CallbackTestCase.prototype.underlayCallback_noSeries = function() { /** * Test that underlay callback receives the correct y-axis range. */ -CallbackTestCase.prototype.underlayCallback_yAxisRange = function() { +CallbackTestCase.prototype.testUnderlayCallback_yAxisRange = function() { var called = false; var yMin, yMax; diff --git a/auto_tests/tests/connect_separated_points.js b/auto_tests/tests/connect_separated_points.js index bec5a52..d18a7b1 100644 --- a/auto_tests/tests/connect_separated_points.js +++ b/auto_tests/tests/connect_separated_points.js @@ -9,17 +9,17 @@ ConnectSeparatedPointsTestCase.prototype.setUp = function() { document.body.innerHTML = "
"; }; -ConnectSeparatedPointsTestCase.origFunc = Dygraph.getContext; +var origFunc = Dygraph.getContext; ConnectSeparatedPointsTestCase.prototype.setUp = function() { document.body.innerHTML = "
"; Dygraph.getContext = function(canvas) { - return new Proxy(ConnectSeparatedPointsTestCase.origFunc(canvas)); + return new Proxy(origFunc(canvas)); }; }; ConnectSeparatedPointsTestCase.prototype.tearDown = function() { - Dygraph.getContext = ConnectSeparatedPointsTestCase.origFunc; + Dygraph.getContext = origFunc; }; ConnectSeparatedPointsTestCase.prototype.testEdgePointsSimple = function() { diff --git a/auto_tests/tests/css.js b/auto_tests/tests/css.js index b2b0010..9348f49 100644 --- a/auto_tests/tests/css.js +++ b/auto_tests/tests/css.js @@ -6,13 +6,15 @@ */ var CssTestCase = TestCase("css"); -CssTestCase.data = "X,Y,Z\n1,2,3\n4,5,6\n"; +var data = "X,Y,Z\n1,2,3\n4,5,6\n"; + +var styleSheet; CssTestCase.prototype.setUp = function() { document.body.innerHTML = "
"; - this.styleSheet = document.createElement("style"); - this.styleSheet.type = "text/css"; - document.getElementsByTagName("head")[0].appendChild(this.styleSheet); + styleSheet = document.createElement("style"); + styleSheet.type = "text/css"; + document.getElementsByTagName("head")[0].appendChild(styleSheet); }; CssTestCase.prototype.tearDown = function() { @@ -23,7 +25,7 @@ CssTestCase.prototype.testDefaultSize = function() { var opts = { }; var graph = document.getElementById("graph"); - var g = new Dygraph(graph, CssTestCase.data, opts); + var g = new Dygraph(graph, data, opts); assertEquals(480, graph.offsetWidth); assertEquals(320, graph.offsetHeight); @@ -37,7 +39,7 @@ CssTestCase.prototype.testExplicitParamSize = function() { height: 480 }; var graph = document.getElementById("graph"); - var g = new Dygraph(graph, CssTestCase.data, opts); + var g = new Dygraph(graph, data, opts); assertEquals(640, graph.offsetWidth); assertEquals(480, graph.offsetHeight); @@ -52,7 +54,7 @@ CssTestCase.prototype.testExplicitStyleSize = function() { graph.style.width = '600px'; graph.style.height = '400px'; - var g = new Dygraph(graph, CssTestCase.data, opts); + var g = new Dygraph(graph, data, opts); assertEquals(600, graph.offsetWidth); assertEquals(400, graph.offsetHeight); assertEquals({width: 600, height: 400}, g.size()); @@ -68,7 +70,7 @@ CssTestCase.prototype.testPixelStyleWins = function() { graph.style.width = '600px'; graph.style.height = '400px'; - var g = new Dygraph(graph, CssTestCase.data, opts); + var g = new Dygraph(graph, data, opts); assertEquals(600, graph.offsetWidth); assertEquals(400, graph.offsetHeight); assertEquals({width: 600, height: 400}, g.size()); @@ -85,7 +87,7 @@ CssTestCase.prototype.testPercentageSize = function() { graph.style.width = '50%'; graph.style.height = '50%'; - var g = new Dygraph(graph, CssTestCase.data, opts); + var g = new Dygraph(graph, data, opts); assertEquals(300, graph.offsetWidth); assertEquals(200, graph.offsetHeight); assertEquals({width: 300, height: 200}, g.size()); @@ -93,13 +95,13 @@ CssTestCase.prototype.testPercentageSize = function() { // Verifies that a CSS class size works. CssTestCase.prototype.testClassPixelSize = function() { - this.styleSheet.innerHTML = '.chart { width: 456px; height: 345px; }'; + styleSheet.innerHTML = '.chart { width: 456px; height: 345px; }'; var opts = { }; var graph = document.getElementById("graph"); graph.className = "chart"; - var g = new Dygraph(graph, CssTestCase.data, opts); + var g = new Dygraph(graph, data, opts); assertEquals(456, graph.offsetWidth); assertEquals(345, graph.offsetHeight); assertEquals({width: 456, height: 345}, g.size()); @@ -112,7 +114,7 @@ CssTestCase.prototype.testInvisibleChart = function() { '
' + ''; var graph = document.getElementById("graph"); - g = new Dygraph(graph, CssTestCase.data, {}); + g = new Dygraph(graph, data, {}); }; // An invisible chart div shouldn't produce an error. @@ -172,7 +174,7 @@ CssTestCase.prototype.testDivResize = function() { var graph = document.getElementById("graph"); graph.style.width = '640px'; graph.style.height = '480px'; - var g = new Dygraph(graph, CssTestCase.data, opts); + var g = new Dygraph(graph, data, opts); assertEquals(640, graph.offsetWidth); assertEquals(480, graph.offsetHeight); diff --git a/auto_tests/tests/custom_bars.js b/auto_tests/tests/custom_bars.js index e8af214..5b7fd4b 100644 --- a/auto_tests/tests/custom_bars.js +++ b/auto_tests/tests/custom_bars.js @@ -6,16 +6,16 @@ */ var CustomBarsTestCase = TestCase("custom-bars"); -CustomBarsTestCase._origFunc = Dygraph.getContext; +_origFunc = Dygraph.getContext; CustomBarsTestCase.prototype.setUp = function() { document.body.innerHTML = "
"; Dygraph.getContext = function(canvas) { - return new Proxy(CustomBarsTestCase._origFunc(canvas)); + return new Proxy(_origFunc(canvas)); } }; CustomBarsTestCase.prototype.tearDown = function() { - Dygraph.getContext = CustomBarsTestCase._origFunc; + Dygraph.getContext = _origFunc; }; // This test used to reliably produce an infinite loop. diff --git a/auto_tests/tests/data_api.js b/auto_tests/tests/data_api.js index f3180f5..90c6ca5 100644 --- a/auto_tests/tests/data_api.js +++ b/auto_tests/tests/data_api.js @@ -5,21 +5,23 @@ */ var dataApiTestCase = TestCase("data-api"); +var opts, graphDiv; + dataApiTestCase.prototype.setUp = function() { document.body.innerHTML = "
"; - this.opts = { + opts = { width: 480, height: 320 }; - this.graphDiv = document.getElementById("graph"); + graphDiv = document.getElementById("graph"); }; dataApiTestCase.prototype.tearDown = function() { }; dataApiTestCase.prototype.testBasicAccessors = function() { - var g = new Dygraph(this.graphDiv, temperature_data, this.opts); + var g = new Dygraph(graphDiv, temperature_data, opts); assertEquals(365, g.numRows()); assertEquals(3, g.numColumns()); @@ -35,7 +37,7 @@ dataApiTestCase.prototype.testBasicAccessors = function() { dataApiTestCase.prototype.testAccessorsCustomBars = function() { - var g = new Dygraph(this.graphDiv, data_temp_high_low, { + var g = new Dygraph(graphDiv, data_temp_high_low, { customBars: true }); @@ -54,14 +56,14 @@ dataApiTestCase.prototype.testAccessorsCustomBars = function() { // Regression test for #554. dataApiTestCase.prototype.testGetRowForX = function() { - var g = new Dygraph(this.graphDiv, [ + var g = new Dygraph(graphDiv, [ "x,y", "1,2", "3,4", "5,6", "7,8", "9,10" - ].join('\n'), this.opts); + ].join('\n'), opts); assertEquals(null, g.getRowForX(0)); assertEquals(0, g.getRowForX(1)); @@ -79,7 +81,7 @@ dataApiTestCase.prototype.testGetRowForX = function() { // If there are rows with identical x-values, getRowForX promises that it will // return the first one. dataApiTestCase.prototype.testGetRowForXDuplicates = function() { - var g = new Dygraph(this.graphDiv, [ + var g = new Dygraph(graphDiv, [ "x,y", "1,2", // 0 "1,4", // 1 @@ -91,7 +93,7 @@ dataApiTestCase.prototype.testGetRowForXDuplicates = function() { "9,6", "9,8", "9,10" - ].join('\n'), this.opts); + ].join('\n'), opts); assertEquals(0, g.getRowForX(1)); assertEquals(null, g.getRowForX(2)); diff --git a/auto_tests/tests/date_ticker.js b/auto_tests/tests/date_ticker.js index 0c381c9..7abcc0f 100644 --- a/auto_tests/tests/date_ticker.js +++ b/auto_tests/tests/date_ticker.js @@ -12,7 +12,7 @@ DateTickerTestCase.prototype.setUp = function() { document.body.innerHTML = "
"; }; -DateTickerTestCase.prototype.createOptionsViewForAxis = function(axis, dict) { +var createOptionsViewForAxis = function(axis, dict) { return function (x) { if (dict && dict.hasOwnProperty(x)) { return dict[x]; @@ -39,7 +39,7 @@ function changeNbspToSpace(ticks) { DateTickerTestCase.prototype.testBasicDateTicker = function() { var opts = {labelsUTC: true}; - var options = this.createOptionsViewForAxis('x', opts); + var options = createOptionsViewForAxis('x', opts); var ticks = Dygraph.dateTicker(-1797534000000, 1255579200000, 800, options); var expected_ticks = [ @@ -79,7 +79,7 @@ DateTickerTestCase.prototype.testBasicDateTicker = function() { DateTickerTestCase.prototype.testAllDateTickers = function() { var opts = {labelsUTC: true, pixelsPerLabel: 60}; - var options = this.createOptionsViewForAxis('x', opts); + var options = createOptionsViewForAxis('x', opts); // For granularities finer than MONTHLY, the first tick returned tick // could lie outside [start_time, end_time] range in the original code. diff --git a/auto_tests/tests/error_bars.js b/auto_tests/tests/error_bars.js index 2bcee2f..8adc075 100644 --- a/auto_tests/tests/error_bars.js +++ b/auto_tests/tests/error_bars.js @@ -9,16 +9,16 @@ errorBarsTestCase.prototype.setUp = function() { document.body.innerHTML = "
"; }; -errorBarsTestCase._origFunc = Dygraph.getContext; +var _origFunc = Dygraph.getContext; errorBarsTestCase.prototype.setUp = function() { document.body.innerHTML = "
"; Dygraph.getContext = function(canvas) { - return new Proxy(errorBarsTestCase._origFunc(canvas)); + return new Proxy(_origFunc(canvas)); } }; errorBarsTestCase.prototype.tearDown = function() { - Dygraph.getContext = errorBarsTestCase._origFunc; + Dygraph.getContext = _origFunc; }; errorBarsTestCase.prototype.testErrorBarsDrawn = function() { diff --git a/auto_tests/tests/fill_step_plot.js b/auto_tests/tests/fill_step_plot.js index f40f8a5..be1302b 100644 --- a/auto_tests/tests/fill_step_plot.js +++ b/auto_tests/tests/fill_step_plot.js @@ -10,17 +10,17 @@ fillStepPlotTestCase.prototype.setUp = function() { document.body.innerHTML = "
"; }; -fillStepPlotTestCase.origFunc = Dygraph.getContext; +var origFunc = Dygraph.getContext; fillStepPlotTestCase.prototype.setUp = function() { document.body.innerHTML = "
"; Dygraph.getContext = function(canvas) { - return new Proxy(fillStepPlotTestCase.origFunc(canvas)); + return new Proxy(origFunc(canvas)); }; }; fillStepPlotTestCase.prototype.tearDown = function() { - Dygraph.getContext = fillStepPlotTestCase.origFunc; + Dygraph.getContext = origFunc; }; @@ -55,4 +55,4 @@ fillStepPlotTestCase.prototype.testFillStepPlotNullValues = function() { // Check if a line is drawn between the previous y and the bottom of the chart CanvasAssertions.assertLineDrawn(htx, xy1, xy2, {}); -}; \ No newline at end of file +}; diff --git a/auto_tests/tests/formats.js b/auto_tests/tests/formats.js index 38ba88e..0866a26 100644 --- a/auto_tests/tests/formats.js +++ b/auto_tests/tests/formats.js @@ -12,50 +12,50 @@ FormatsTestCase.prototype.setUp = function() { FormatsTestCase.prototype.tearDown = function() { }; -FormatsTestCase.prototype.dataString = +var dataString = "X,Y\n" + "0,-1\n" + "1,0\n" + "2,1\n" + "3,0\n"; -FormatsTestCase.prototype.dataArray = +var dataArray = [[0,-1], [1,0], [2,1], [3,0]]; FormatsTestCase.prototype.testCsv = function() { - var data = this.dataString; + var data = dataString; var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, {}); - this.assertData(g); + assertData(g); }; FormatsTestCase.prototype.testArray = function() { - var data = this.dataArray; + var data = dataArray; var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, {}); - this.assertData(g); + assertData(g); }; FormatsTestCase.prototype.testFunctionReturnsCsv = function() { - var string = this.dataString; + var string = dataString; var data = function() { return string; }; var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, {}); - // this.assertData(g); + // assertData(g); console.log("x"); }; FormatsTestCase.prototype.testFunctionDefinesArray = function() { - var array = this.dataArray; + var array = dataArray; var data = function() { return array; } var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, {}); - this.assertData(g); + assertData(g); }; FormatsTestCase.prototype.testXValueParser = function() { @@ -80,8 +80,8 @@ FormatsTestCase.prototype.testXValueParser = function() { assertEquals(6, g.getValue(3, 0)); }; -FormatsTestCase.prototype.assertData = function(g) { - var expected = this.dataArray; +var assertData = function(g) { + var expected = dataArray; assertEquals(4, g.numRows()); assertEquals(2, g.numColumns()); @@ -91,4 +91,4 @@ FormatsTestCase.prototype.assertData = function(g) { assertEquals(expected[i][j], g.getValue(i, j)); } } -} +}; diff --git a/auto_tests/tests/grid_per_axis.js b/auto_tests/tests/grid_per_axis.js index defe25f..3173cf3 100644 --- a/auto_tests/tests/grid_per_axis.js +++ b/auto_tests/tests/grid_per_axis.js @@ -10,17 +10,17 @@ GridPerAxisTestCase.prototype.setUp = function() { document.body.innerHTML = "
"; }; -GridPerAxisTestCase.origFunc = Dygraph.getContext; +var origFunc = Dygraph.getContext; GridPerAxisTestCase.prototype.setUp = function() { document.body.innerHTML = "
"; Dygraph.getContext = function(canvas) { - return new Proxy(GridPerAxisTestCase.origFunc(canvas)); + return new Proxy(origFunc(canvas)); }; }; GridPerAxisTestCase.prototype.tearDown = function() { - Dygraph.getContext = GridPerAxisTestCase.origFunc; + Dygraph.getContext = origFunc; }; GridPerAxisTestCase.prototype.testIndependentGrids = function() { diff --git a/auto_tests/tests/interaction_model.js b/auto_tests/tests/interaction_model.js index e36c20b..600ab6c 100644 --- a/auto_tests/tests/interaction_model.js +++ b/auto_tests/tests/interaction_model.js @@ -38,7 +38,7 @@ function getXLabels() { return ary; } -InteractionModelTestCase.prototype.pan = function(g, xRange, yRange) { +InteractionModelTestCase.prototype.testPan = function(g, xRange, yRange) { var originalXRange = g.xAxisRange(); var originalYRange = g.yAxisRange(0); @@ -129,11 +129,11 @@ InteractionModelTestCase.prototype.testClickCallbackIsCalledOnCustomPan = functi assertEquals(20, clicked); }; -InteractionModelTestCase.clickAt = function(g, x, y) { +var clickAt = function(g, x, y) { DygraphOps.dispatchMouseDown(g, x, y); DygraphOps.dispatchMouseMove(g, x, y); DygraphOps.dispatchMouseUp(g, x, y); -} +}; /** * This tests that clickCallback is still called with the nonInteractiveModel. @@ -174,7 +174,7 @@ InteractionModelTestCase.prototype.testPointClickCallback = function() { } }); - InteractionModelTestCase.clickAt(g, 4, 40); + clickAt(g, 4, 40); assertEquals(4, clicked.xval); assertEquals(40, clicked.yval); @@ -191,7 +191,7 @@ InteractionModelTestCase.prototype.testNoPointClickCallbackWhenOffPoint = functi } }); - InteractionModelTestCase.clickAt(g, 5, 40); + clickAt(g, 5, 40); assertUndefined(clicked); }; @@ -221,7 +221,7 @@ InteractionModelTestCase.prototype.testPointClickCallbackCalledPriorToClickCallb } }); - InteractionModelTestCase.clickAt(g, 4, 40); + clickAt(g, 4, 40); assertEquals(1, pointClicked); assertEquals(2, clicked); }; @@ -238,7 +238,7 @@ InteractionModelTestCase.prototype.testClickCallback_clickOnPoint = function() { } }); - InteractionModelTestCase.clickAt(g, 4, 40); + clickAt(g, 4, 40); assertEquals(1, clicked); }; @@ -397,7 +397,7 @@ InteractionModelTestCase.prototype.testPointClickCallback_missingData = function } }); - InteractionModelTestCase.clickAt(g, 2, 110); + clickAt(g, 2, 110); assertEquals(2, clicked.xval); assertEquals(110, clicked.yval); diff --git a/auto_tests/tests/missing_points.js b/auto_tests/tests/missing_points.js index eb1c575..835a301 100644 --- a/auto_tests/tests/missing_points.js +++ b/auto_tests/tests/missing_points.js @@ -27,16 +27,16 @@ var ZERO_TO_FIFTY = [[ 10, 0 ] , [ 20, 50 ]]; var MissingPointsTestCase = TestCase("missing-points"); -MissingPointsTestCase._origFunc = Dygraph.getContext; +var _origFunc = Dygraph.getContext; MissingPointsTestCase.prototype.setUp = function() { document.body.innerHTML = "
"; Dygraph.getContext = function(canvas) { - return new Proxy(MissingPointsTestCase._origFunc(canvas)); + return new Proxy(_origFunc(canvas)); } }; MissingPointsTestCase.prototype.tearDown = function() { - Dygraph.getContext = MissingPointsTestCase._origFunc; + Dygraph.getContext = _origFunc; }; MissingPointsTestCase.prototype.testSeparatedPointsDontDraw = function() { diff --git a/auto_tests/tests/multiple_axes.js b/auto_tests/tests/multiple_axes.js index 5b544be..a83b8f4 100644 --- a/auto_tests/tests/multiple_axes.js +++ b/auto_tests/tests/multiple_axes.js @@ -10,7 +10,7 @@ MultipleAxesTestCase.prototype.setUp = function() { document.body.innerHTML = "
"; }; -MultipleAxesTestCase.getData = function() { +var getData = function() { var data = []; for (var i = 1; i <= 100; i++) { var m = "01", d = i; @@ -29,7 +29,7 @@ MultipleAxesTestCase.getData = function() { }; MultipleAxesTestCase.prototype.testBasicMultipleAxes = function() { - var data = MultipleAxesTestCase.getData(); + var data = getData(); var g = new Dygraph( document.getElementById("graph"), @@ -101,7 +101,7 @@ MultipleAxesTestCase.prototype.testTwoAxisVisibility = function() { // verifies that all four chart labels (title, x-, y-, y2-axis label) can be // used simultaneously. MultipleAxesTestCase.prototype.testMultiChartLabels = function() { - var data = MultipleAxesTestCase.getData(); + var data = getData(); var el = document.getElementById("graph"); el.style.border = '1px solid black'; @@ -145,7 +145,7 @@ MultipleAxesTestCase.prototype.testMultiChartLabels = function() { MultipleAxesTestCase.prototype.testNoY2LabelWithoutSecondaryAxis = function() { var g = new Dygraph( document.getElementById("graph"), - MultipleAxesTestCase.getData(), + getData(), { labels: [ 'Date', 'Y1', 'Y2', 'Y3', 'Y4' ], width: 640, @@ -166,7 +166,7 @@ MultipleAxesTestCase.prototype.testNoY2LabelWithoutSecondaryAxis = function() { }; MultipleAxesTestCase.prototype.testValueRangePerAxisOptions = function() { - var data = MultipleAxesTestCase.getData(); + var data = getData(); g = new Dygraph( document.getElementById("graph"), @@ -215,7 +215,7 @@ MultipleAxesTestCase.prototype.testValueRangePerAxisOptions = function() { }; MultipleAxesTestCase.prototype.testDrawPointCallback = function() { - var data = MultipleAxesTestCase.getData(); + var data = getData(); var results = { y : {}, y2 : {}}; var firstCallback = function(g, seriesName, ctx, canvasx, canvasy, color, radius) { @@ -260,7 +260,7 @@ MultipleAxesTestCase.prototype.testDrawPointCallback = function() { // Test for http://code.google.com/p/dygraphs/issues/detail?id=436 MultipleAxesTestCase.prototype.testRemovingSecondAxis = function() { - var data = MultipleAxesTestCase.getData(); + var data = getData(); var results = { y : {}, y2 : {}}; diff --git a/auto_tests/tests/numeric_ticker.js b/auto_tests/tests/numeric_ticker.js index 737e4b5..da29e09 100644 --- a/auto_tests/tests/numeric_ticker.js +++ b/auto_tests/tests/numeric_ticker.js @@ -12,7 +12,7 @@ NumericTickerTestCase.prototype.setUp = function() { document.body.innerHTML = "
"; }; -NumericTickerTestCase.prototype.createOptionsViewForAxis = function(axis, dict) { +var createOptionsViewForAxis = function(axis, dict) { return function (x) { if (dict && dict.hasOwnProperty(x)) { return dict[x]; @@ -30,7 +30,7 @@ NumericTickerTestCase.prototype.createOptionsViewForAxis = function(axis, dict) NumericTickerTestCase.prototype.testBasicNumericTicker = function() { var opts = {"logscale":null,"labelsKMG2":false,"labelsKMB":false}; - var options = this.createOptionsViewForAxis('y', opts); + var options = createOptionsViewForAxis('y', opts); var ticks = Dygraph.numericTicks(-0.4, 4.4, 320, options); var expected_ticks = [ @@ -73,117 +73,117 @@ NumericTickerTestCase.prototype.testBasicNumericTicker = function() { /* NumericTickerTestCase.prototype.testAllNumericTickers = function() { - assertEquals([{"v":-0.5,"label":"-0.5"},{"v":0,"label":"0"},{"v":0.5,"label":"0.5"},{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"},{"v":4,"label":"4"}], Dygraph.numericTicks(-0.4, 4.4, 320, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":-1.5,"label":"-1.5"},{"v":-1,"label":"-1"},{"v":-0.5,"label":"-0.5"},{"v":0,"label":"0"},{"v":0.5,"label":"0.5"},{"v":1,"label":"1"}], Dygraph.numericTicks(-1.4157430939856124, 1.4157430939856124, 400, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":-10,"label":"-10"},{"v":-8,"label":"-8"},{"v":-6,"label":"-6"},{"v":-4,"label":"-4"},{"v":-2,"label":"-2"},{"v":0,"label":"0"},{"v":2,"label":"2"},{"v":4,"label":"4"},{"v":6,"label":"6"},{"v":8,"label":"8"}], Dygraph.numericTicks(-10, 9.98046875, 400, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":-200,"label":"-200"},{"v":0,"label":"0"},{"v":200,"label":"200"},{"v":400,"label":"400"},{"v":600,"label":"600"},{"v":800,"label":"800"},{"v":-17999000,"label":"1000"}], Dygraph.numericTicks(-101.10000000000001, 1100.1, 300, this.createOptionsViewForAxis('y',{"logscale":false,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":-20,"label":"-20"},{"v":-10,"label":"-10"},{"v":0,"label":"0"},{"v":10,"label":"10"},{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"}], Dygraph.numericTicks(-11.687459005175139, 42.287459005175144, 320, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":-15,"label":"-15"},{"v":-10,"label":"-10"},{"v":-5,"label":"-5"},{"v":0,"label":"0"},{"v":5,"label":"5"},{"v":10,"label":"10"}], Dygraph.numericTicks(-12, 12, 320, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":-15,"label":"-15"},{"v":-10,"label":"-10"},{"v":-5,"label":"-5"},{"v":0,"label":"0"},{"v":5,"label":"5"},{"v":10,"label":"10"}], Dygraph.numericTicks(-13.19792086872138, 13.197062407353386, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":-220,"label":"-220"},{"v":-200,"label":"-200"},{"v":-180,"label":"-180"},{"v":-160,"label":"-160"},{"v":-140,"label":"-140"},{"v":-120,"label":"-120"}], Dygraph.numericTicks(-220, -100, 200, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":-40,"label":"-40"},{"v":-20,"label":"-20"},{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"},{"v":100,"label":"100"},{"v":120,"label":"120"}], Dygraph.numericTicks(-32.8, 132.8, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":-40,"label":"-40"},{"v":-30,"label":"-30"},{"v":-20,"label":"-20"},{"v":-10,"label":"-10"},{"v":0,"label":"0"},{"v":10,"label":"10"},{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"}], Dygraph.numericTicks(-34.309, 89.279, 400, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":-60,"label":"-60"},{"v":-40,"label":"-40"},{"v":-20,"label":"-20"},{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"}], Dygraph.numericTicks(-60, 60, 200, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":-60,"label":"-60"},{"v":-40,"label":"-40"},{"v":-20,"label":"-20"},{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"}], Dygraph.numericTicks(-60, 60, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":0.0001,"label":"1.00e-4"},{"v":0.0002,"label":"2.00e-4"},{"v":-17999999,"label":"3.00e-4"},{"v":0.0004,"label":"4.00e-4"},{"v":0.0005,"label":"5.00e-4"}], Dygraph.numericTicks(0, 0.00055, 320, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":0},{"v":0.0001,"label":0.0001},{"v":0.0002,"label":0.0002},{"v":-17999999,"label":0.0003},{"v":0.0004,"label":0.0004},{"v":0.0005,"label":0.0005}], Dygraph.numericTicks(0, 0.00055, 320, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":0.2,"label":"0.2"},{"v":0.4,"label":"0.4"},{"v":-17999999,"label":"0.6"},{"v":0.8,"label":"0.8"}], Dygraph.numericTicks(0, 1, 200, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":0.2,"label":"0.2"},{"v":0.4,"label":"0.4"},{"v":-17999999,"label":"0.6"},{"v":0.8,"label":"0.8"}], Dygraph.numericTicks(0, 1, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":0.1,"label":"0.1"},{"v":0.2,"label":"0.2"},{"v":-17999999,"label":"0.3"},{"v":0.4,"label":"0.4"},{"v":0.5,"label":"0.5"},{"v":-17999999,"label":"0.6"},{"v":-17999999,"label":"0.7"},{"v":0.8,"label":"0.8"},{"v":0.9,"label":"0.9"},{"v":1,"label":"1"},{"v":1.1,"label":"1.1"},{"v":-17999998,"label":"1.2"}], Dygraph.numericTicks(0, 1.2, 400, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":10,"label":"10"},{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"},{"v":90,"label":"90"}], Dygraph.numericTicks(0, 100, 400, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"},{"v":100,"label":"100"}], Dygraph.numericTicks(0, 104.53192180924043, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"},{"v":100,"label":"100"}], Dygraph.numericTicks(0, 109.9856877755916, 320, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":2,"label":"2"},{"v":4,"label":"4"},{"v":6,"label":"6"},{"v":8,"label":"8"},{"v":10,"label":"10"}], Dygraph.numericTicks(0, 11, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"},{"v":100,"label":"100"}], Dygraph.numericTicks(0, 110, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"},{"v":100,"label":"100"}], Dygraph.numericTicks(0, 110, 320, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":10,"label":"10"},{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"},{"v":90,"label":"90"},{"v":100,"label":"100"}], Dygraph.numericTicks(0, 110, 350, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":200,"label":"200"},{"v":400,"label":"400"},{"v":600,"label":"600"},{"v":800,"label":"800"},{"v":-17999000,"label":"1000"}], Dygraph.numericTicks(0, 1100, 300, this.createOptionsViewForAxis('y',{"logscale":false,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":-17000000,"label":"1M"},{"v":-16000000,"label":"2M"},{"v":-15000000,"label":"3M"},{"v":-14000000,"label":"4M"},{"v":-13000000,"label":"5M"},{"v":-12000000,"label":"6M"},{"v":-11000000,"label":"7M"},{"v":-10000000,"label":"8M"},{"v":-9000000,"label":"9M"},{"v":-8000000,"label":"10M"}], Dygraph.numericTicks(0, 11000000, 480, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":true}))); - assertEquals([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"},{"v":100,"label":"100"}], Dygraph.numericTicks(0, 119, 320, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"},{"v":100,"label":"100"},{"v":120,"label":"120"}], Dygraph.numericTicks(0, 130.9, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"},{"v":100,"label":"100"},{"v":120,"label":"120"}], Dygraph.numericTicks(0, 131, 320, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":-17998000,"label":"2000"},{"v":-17996000,"label":"4000"},{"v":-17994000,"label":"6000"},{"v":-17992000,"label":"8000"},{"v":-17990000,"label":"10000"},{"v":-17988000,"label":"12000"},{"v":-17986000,"label":"14000"},{"v":-17984000,"label":"16000"}], Dygraph.numericTicks(0, 16977.4, 320, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":0.5,"label":"0.5"},{"v":1,"label":"1"},{"v":1.5,"label":"1.5"}], Dygraph.numericTicks(0, 2, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":0.2,"label":"0.2"},{"v":0.4,"label":"0.4"},{"v":-17999999,"label":"0.6"},{"v":0.8,"label":"0.8"},{"v":1,"label":"1"},{"v":-17999998,"label":"1.2"},{"v":-17999998,"label":"1.4"},{"v":1.6,"label":"1.6"},{"v":1.8,"label":"1.8"}], Dygraph.numericTicks(0, 2, 400, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":0.5,"label":"0.5"},{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"}], Dygraph.numericTicks(0, 2.2, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":-17800000,"label":"200K"},{"v":-17600000,"label":"400K"},{"v":-17400000,"label":"600K"},{"v":-17200000,"label":"800K"},{"v":-17000000,"label":"1M"},{"v":-16800000,"label":"1.2M"},{"v":-16600000,"label":"1.4M"},{"v":-16400000,"label":"1.6M"},{"v":-16200000,"label":"1.8M"},{"v":-16000000,"label":"2M"}], Dygraph.numericTicks(0, 2200000, 350, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":true}))); - assertEquals([{"v":0,"label":"0"},{"v":50,"label":"50"},{"v":100,"label":"100"},{"v":150,"label":"150"},{"v":200,"label":"200"}], Dygraph.numericTicks(0, 249, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":500,"label":"500"},{"v":-17999000,"label":"1000"},{"v":1500,"label":"1500"},{"v":-17998000,"label":"2000"},{"v":2500,"label":"2500"}], Dygraph.numericTicks(0, 2747.9970998900817, 320, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":200,"label":"200"},{"v":400,"label":"400"},{"v":600,"label":"600"},{"v":800,"label":"800"},{"v":-17999000,"label":"1K"},{"v":1200,"label":"1.2K"},{"v":1400,"label":"1.4K"},{"v":1600,"label":"1.6K"},{"v":1800,"label":"1.8K"},{"v":-17998000,"label":"2K"},{"v":2200,"label":"2.2K"},{"v":2400,"label":"2.4K"},{"v":2600,"label":"2.6K"}], Dygraph.numericTicks(0, 2747.9970998900817, 480, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":true}))); - assertEquals([{"v":0,"label":"0"},{"v":5,"label":"5"},{"v":10,"label":"10"},{"v":15,"label":"15"},{"v":20,"label":"20"},{"v":25,"label":"25"},{"v":30,"label":"30"}], Dygraph.numericTicks(0, 32.698942321287205, 320, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":-17500000,"label":"500000"},{"v":-17000000,"label":"1.00e+6"},{"v":-16500000,"label":"1.50e+6"},{"v":-16000000,"label":"2.00e+6"},{"v":-15500000,"label":"2.50e+6"},{"v":-15000000,"label":"3.00e+6"}], Dygraph.numericTicks(0, 3263100.6418021005, 480, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":5,"label":"5"},{"v":10,"label":"10"},{"v":15,"label":"15"},{"v":20,"label":"20"},{"v":25,"label":"25"},{"v":30,"label":"30"}], Dygraph.numericTicks(0, 33.16213467701236, 320, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":0.5,"label":"0.5"},{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"}], Dygraph.numericTicks(0, 4, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":0.5,"label":"0.5"},{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"},{"v":4,"label":"4"}], Dygraph.numericTicks(0, 4.4, 320, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":5,"label":"5"},{"v":10,"label":"10"},{"v":15,"label":"15"},{"v":20,"label":"20"},{"v":25,"label":"25"},{"v":30,"label":"30"},{"v":35,"label":"35"},{"v":40,"label":"40"}], Dygraph.numericTicks(0, 42, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":true}))); - assertEquals([{"v":0,"label":"0"},{"v":8,"label":"8"},{"v":16,"label":"16"},{"v":24,"label":"24"},{"v":32,"label":"32"},{"v":40,"label":"40"}], Dygraph.numericTicks(0, 42, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":true,"labelsKMB":false}))); - assertEquals([{"v":0,"label":0},{"v":8,"label":8},{"v":16,"label":16},{"v":24,"label":24},{"v":32,"label":32},{"v":40,"label":40}], Dygraph.numericTicks(0, 42, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":true,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":999982000000,"label":"1T"},{"v":1999982000000,"label":"2T"},{"v":2999982000000,"label":"3T"},{"v":3999982000000,"label":"4T"}], Dygraph.numericTicks(0, 4837851162214.3, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":true}))); - assertEquals([{"v":0,"label":"0"},{"v":549755813888,"label":"512G"},{"v":1099511627776,"label":"1T"},{"v":1649267441664,"label":"1.5T"},{"v":2199023255552,"label":"2T"},{"v":2748779069440,"label":"2.5T"},{"v":3298534883328,"label":"3T"},{"v":3848290697216,"label":"3.5T"},{"v":4398046511104,"label":"4T"}], Dygraph.numericTicks(0, 4837851162214.3, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":true,"labelsKMB":false}))); - assertEquals([{"v":0,"label":0},{"v":549755813888,"label":"512G"},{"v":1099511627776,"label":"1T"},{"v":1649267441664,"label":"1.5T"},{"v":2199023255552,"label":"2T"},{"v":2748779069440,"label":"2.5T"},{"v":3298534883328,"label":"3T"},{"v":3848290697216,"label":"3.5T"},{"v":4398046511104,"label":"4T"}], Dygraph.numericTicks(0, 4837851162214.3, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":true,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":-17999000,"label":"1000"},{"v":-17998000,"label":"2000"},{"v":-17997000,"label":"3000"},{"v":-17996000,"label":"4000"},{"v":-17995000,"label":"5000"}], Dygraph.numericTicks(0, 5451.6, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":100,"label":"100"},{"v":200,"label":"200"},{"v":300,"label":"300"},{"v":400,"label":"400"},{"v":500,"label":"500"}], Dygraph.numericTicks(0, 550, 320, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":10,"label":"10"},{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"}], Dygraph.numericTicks(0, 64.9, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":100,"label":"100"},{"v":200,"label":"200"},{"v":300,"label":"300"},{"v":400,"label":"400"},{"v":500,"label":"500"},{"v":600,"label":"600"}], Dygraph.numericTicks(0, 667.9, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":1,"label":"1"},{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"},{"v":6,"label":"6"},{"v":7,"label":"7"}], Dygraph.numericTicks(0, 7.7, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":1,"label":"1"},{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"},{"v":6,"label":"6"},{"v":7,"label":"7"}], Dygraph.numericTicks(0, 7.9347329768293005, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":10,"label":"10"},{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"}], Dygraph.numericTicks(0, 72.6, 320, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"}], Dygraph.numericTicks(0, 99, 200, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"}], Dygraph.numericTicks(0, 99, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":10,"label":"10"},{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"},{"v":90,"label":"90"}], Dygraph.numericTicks(0, 99, 320, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":200,"label":"200"},{"v":400,"label":"400"},{"v":600,"label":"600"},{"v":800,"label":"800"}], Dygraph.numericTicks(0, 999, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0.000001,"label":"1.00e-6"},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":"1.00e-5"},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":0.0001,"label":"1.00e-4"},{"v":0.0002,"label":""},{"v":-17999999,"label":""},{"v":0.0004,"label":""},{"v":0.0005,"label":""},{"v":-17999999,"label":""},{"v":0.0007,"label":""},{"v":0.0008,"label":""},{"v":-17999999,"label":""},{"v":0.001,"label":"1.00e-3"},{"v":0.002,"label":""},{"v":0.003,"label":""},{"v":0.004,"label":""},{"v":0.005,"label":""},{"v":0.006,"label":""},{"v":0.007,"label":""},{"v":0.008,"label":""},{"v":-17999999,"label":""},{"v":0.01,"label":"0.01"},{"v":0.02,"label":""},{"v":0.03,"label":""},{"v":0.04,"label":""},{"v":0.05,"label":""},{"v":0.06,"label":""},{"v":0.07,"label":""},{"v":0.08,"label":""},{"v":0.09,"label":""},{"v":0.1,"label":"0.1"},{"v":0.2,"label":""},{"v":-17999999,"label":""},{"v":0.4,"label":""},{"v":0.5,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":0.8,"label":""},{"v":0.9,"label":""},{"v":1,"label":"1"},{"v":2,"label":""},{"v":3,"label":""},{"v":4,"label":""},{"v":5,"label":""},{"v":6,"label":""},{"v":7,"label":""},{"v":8,"label":""},{"v":9,"label":""},{"v":10,"label":"10"},{"v":20,"label":""},{"v":30,"label":""},{"v":40,"label":""},{"v":50,"label":""},{"v":60,"label":""},{"v":70,"label":""},{"v":80,"label":""},{"v":90,"label":""},{"v":100,"label":"100"},{"v":200,"label":""},{"v":300,"label":""},{"v":400,"label":""},{"v":500,"label":""},{"v":600,"label":""},{"v":700,"label":""},{"v":800,"label":""},{"v":900,"label":""},{"v":-17999000,"label":"1000"}], Dygraph.numericTicks(0.000001, 1099.9999999, 300, this.createOptionsViewForAxis('y',{"logscale":true,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":1,"label":"1"},{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"}], Dygraph.numericTicks(0.6, 5.4, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0.5,"label":"0.5"},{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"},{"v":4,"label":"4"},{"v":4.5,"label":"4.5"}], Dygraph.numericTicks(0.6373123361267239, 4.824406504982038, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0.5,"label":"0.5"},{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"},{"v":4,"label":"4"},{"v":4.5,"label":"4.5"}], Dygraph.numericTicks(0.6373123361267239, 4.824406504982038, 353, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0.6000000000000001,"label":"0.6"},{"v":0.8,"label":"0.8"},{"v":1,"label":"1"},{"v":-17999998,"label":"1.2"},{"v":-17999998,"label":"1.4"},{"v":1.6,"label":"1.6"},{"v":-17999998,"label":"1.8"},{"v":2,"label":"2"},{"v":2.2,"label":"2.2"},{"v":-17999997,"label":"2.4"},{"v":2.6,"label":"2.6"},{"v":-17999997,"label":"2.8"},{"v":-17999997,"label":"3"},{"v":3.2,"label":"3.2"},{"v":-17999996,"label":"3.4"},{"v":3.6,"label":"3.6"},{"v":-17999996,"label":"3.8"},{"v":4,"label":"4"},{"v":4.2,"label":"4.2"},{"v":4.4,"label":"4.4"},{"v":4.6,"label":"4.6"},{"v":-17999995,"label":"4.8"}], Dygraph.numericTicks(0.6373123361267239, 4.824406504982038, 743, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0.5,"label":"0.5"},{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"},{"v":4,"label":"4"},{"v":4.5,"label":"4.5"}], Dygraph.numericTicks(0.6386658954698001, 4.8095173522082, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0.5,"label":"0.5"},{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"},{"v":4,"label":"4"}], Dygraph.numericTicks(0.7101014279158788, 4.023726495301334, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"},{"v":100,"label":"100"}], Dygraph.numericTicks(1, 109, 320, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"}], Dygraph.numericTicks(1, 3, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"}], Dygraph.numericTicks(1, 4, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"}], Dygraph.numericTicks(1, 4, 320, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"},{"v":4,"label":"4"},{"v":4.5,"label":"4.5"}], Dygraph.numericTicks(1, 5, 320, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":1,"label":1},{"v":1.5,"label":1.5},{"v":2,"label":2},{"v":2.5,"label":2.5},{"v":3,"label":3},{"v":3.5,"label":3.5},{"v":4,"label":4},{"v":4.5,"label":4.5}], Dygraph.numericTicks(1, 5, 320, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":1,"label":"1"},{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"}], Dygraph.numericTicks(1, 6, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":1,"label":"1"},{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"},{"v":6,"label":"6"}], Dygraph.numericTicks(1, 7, 320, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":1,"label":"1"},{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"},{"v":6,"label":"6"},{"v":7,"label":"7"},{"v":8,"label":"8"}], Dygraph.numericTicks(1, 9, 300, this.createOptionsViewForAxis('y',{"logscale":false,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":1,"label":"1"},{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"},{"v":6,"label":""},{"v":7,"label":"7"},{"v":8,"label":""},{"v":9,"label":"9"}], Dygraph.numericTicks(1, 9, 300, this.createOptionsViewForAxis('y',{"logscale":true,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":1,"label":"1"},{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"},{"v":6,"label":"6"},{"v":7,"label":"7"},{"v":8,"label":"8"}], Dygraph.numericTicks(1, 9, 320, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":2,"label":"2"},{"v":4,"label":"4"},{"v":6,"label":"6"},{"v":8,"label":"8"},{"v":10,"label":"10"}], Dygraph.numericTicks(1.2, 10.8, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"},{"v":4,"label":"4"},{"v":4.5,"label":"4.5"}], Dygraph.numericTicks(1.2872947778969237, 4.765317192093838, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":1,"label":"1"},{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"},{"v":6,"label":"6"},{"v":7,"label":"7"}], Dygraph.numericTicks(1.5, 7.5, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":5,"label":"5"},{"v":10,"label":"10"},{"v":15,"label":"15"},{"v":20,"label":"20"},{"v":25,"label":"25"}], Dygraph.numericTicks(1.7999999999999998, 28.2, 320, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":10,"label":"10"},{"v":10.1,"label":"10.1"},{"v":10.2,"label":"10.2"},{"v":10.3,"label":"10.3"},{"v":10.4,"label":"10.4"},{"v":10.5,"label":"10.5"},{"v":10.6,"label":"10.6"},{"v":10.7,"label":"10.7"},{"v":10.8,"label":"10.8"},{"v":10.9,"label":"10.9"}], Dygraph.numericTicks(10, 11, 480, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":100,"label":"100"},{"v":120,"label":"120"},{"v":140,"label":"140"},{"v":160,"label":"160"},{"v":180,"label":"180"}], Dygraph.numericTicks(100, 200, 200, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":10000,"label":"10000"},{"v":-17988000,"label":"12000"},{"v":-17986000,"label":"14000"},{"v":-17984000,"label":"16000"},{"v":-17982000,"label":"18000"},{"v":-17980000,"label":"20000"},{"v":-17978000,"label":"22000"},{"v":-17976000,"label":"24000"},{"v":-17974000,"label":"26000"},{"v":-17972000,"label":"28000"},{"v":-17970000,"label":"30000"},{"v":-17968000,"label":"32000"},{"v":-17966000,"label":"34000"},{"v":-17964000,"label":"36000"}], Dygraph.numericTicks(10122.8, 36789.2, 480, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":11000,"label":"11000"},{"v":11200,"label":"11200"},{"v":11400,"label":"11400"},{"v":11600,"label":"11600"},{"v":11800,"label":"11800"},{"v":-17988000,"label":"12000"},{"v":12200,"label":"12200"},{"v":12400,"label":"12400"},{"v":12600,"label":"12600"},{"v":12800,"label":"12800"},{"v":-17987000,"label":"13000"},{"v":13200,"label":"13200"},{"v":13400,"label":"13400"}], Dygraph.numericTicks(11110.5, 13579.5, 480, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":162000,"label":"162000"},{"v":-17836000,"label":"164000"},{"v":-17834000,"label":"166000"},{"v":-17832000,"label":"168000"},{"v":-17830000,"label":"170000"},{"v":-17828000,"label":"172000"},{"v":-17826000,"label":"174000"},{"v":-17824000,"label":"176000"},{"v":-17822000,"label":"178000"}], Dygraph.numericTicks(163038.4, 179137.6, 320, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"}], Dygraph.numericTicks(2, 4, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"},{"v":6,"label":"6"},{"v":7,"label":"7"}], Dygraph.numericTicks(2.6, 7.4, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"},{"v":90,"label":"90"}], Dygraph.numericTicks(21.7, 97.3, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"},{"v":90,"label":"90"}], Dygraph.numericTicks(21.7, 97.3, 320, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"},{"v":90,"label":"90"}], Dygraph.numericTicks(24, 96, 320, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"}], Dygraph.numericTicks(26.185714285714287, 90.81428571428572, 20, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"},{"v":90,"label":"90"}], Dygraph.numericTicks(26.185714285714287, 90.81428571428572, 200, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false,pixelsPerLabel:20}))); - assertEquals([{"v":25,"label":"25"},{"v":30,"label":"30"},{"v":35,"label":"35"},{"v":40,"label":"40"},{"v":45,"label":"45"},{"v":50,"label":"50"},{"v":55,"label":"55"},{"v":60,"label":"60"},{"v":65,"label":"65"},{"v":70,"label":"70"},{"v":75,"label":"75"},{"v":80,"label":"80"},{"v":85,"label":"85"},{"v":90,"label":"90"}], Dygraph.numericTicks(26.185714285714287, 90.81428571428572, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false,pixelsPerLabel:20}))); - assertEquals([{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"},{"v":90,"label":"90"}], Dygraph.numericTicks(26.185714285714287, 90.81428571428572, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"}], Dygraph.numericTicks(28.33333333333333, 88.33333333333334, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":3,"label":"3"},{"v":3.5,"label":"3.5"},{"v":4,"label":"4"},{"v":4.5,"label":"4.5"}], Dygraph.numericTicks(3, 5, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":3000,"label":"3K"},{"v":2500,"label":"2.5K"},{"v":-17998000,"label":"2K"},{"v":1500,"label":"1.5K"},{"v":-17999000,"label":"1K"},{"v":500,"label":"500"}], Dygraph.numericTicks(3000, 0, 320, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":true}))); - assertEquals([{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"}], Dygraph.numericTicks(33.11333333333334, 83.75333333333333, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"}], Dygraph.numericTicks(36.921241050119335, 88.32696897374701, 320, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":50,"label":""},{"v":60,"label":"60"},{"v":70,"label":""},{"v":80,"label":""},{"v":90,"label":""},{"v":100,"label":"100"},{"v":200,"label":""},{"v":300,"label":"300"},{"v":400,"label":""},{"v":500,"label":""},{"v":600,"label":"600"},{"v":700,"label":""},{"v":800,"label":""},{"v":900,"label":""},{"v":-17999000,"label":"1000"},{"v":-17998000,"label":""},{"v":-17997000,"label":"3000"},{"v":-17996000,"label":""},{"v":-17995000,"label":""},{"v":-17994000,"label":"6000"},{"v":-17993000,"label":""},{"v":-17992000,"label":""},{"v":-17991000,"label":""},{"v":-17990000,"label":"10000"}], Dygraph.numericTicks(41.220000000000084, 15576.828000000018, 400, this.createOptionsViewForAxis('y',{"logscale":true,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"},{"v":90,"label":"90"}], Dygraph.numericTicks(44.5, 98.5, 320, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":5,"label":"5"},{"v":6,"label":""},{"v":7,"label":""},{"v":8,"label":""},{"v":9,"label":""},{"v":10,"label":"10"},{"v":20,"label":"20"},{"v":30,"label":""},{"v":40,"label":""},{"v":50,"label":"50"},{"v":60,"label":""},{"v":70,"label":""},{"v":80,"label":""},{"v":90,"label":""},{"v":100,"label":"100"},{"v":200,"label":"200"},{"v":300,"label":""},{"v":400,"label":""},{"v":500,"label":"500"},{"v":600,"label":""},{"v":700,"label":""},{"v":800,"label":""},{"v":900,"label":""},{"v":-17999000,"label":"1000"}], Dygraph.numericTicks(5, 1099.5, 300, this.createOptionsViewForAxis('y',{"logscale":true,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":50,"label":"50"},{"v":55,"label":"55"},{"v":60,"label":"60"},{"v":65,"label":"65"},{"v":70,"label":"70"},{"v":75,"label":"75"},{"v":80,"label":"80"}], Dygraph.numericTicks(52.5, 82.5, 320, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":68,"label":"68"},{"v":70,"label":"70"},{"v":72,"label":"72"},{"v":74,"label":"74"},{"v":76,"label":"76"},{"v":78,"label":"78"},{"v":80,"label":"80"}], Dygraph.numericTicks(69, 81, 320, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":0,"label":"0"},{"v":-17980000,"label":"20K"},{"v":-17960000,"label":"40K"},{"v":-17940000,"label":"60K"},{"v":-17920000,"label":"80K"}], Dygraph.numericTicks(7921.099999999999, 81407.9, 240, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":true}))); - assertEquals([{"v":8,"label":"8"},{"v":10,"label":"10"},{"v":12,"label":"12"},{"v":14,"label":"14"},{"v":16,"label":"16"},{"v":18,"label":"18"},{"v":20,"label":"20"}], Dygraph.numericTicks(9, 21, 300, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":8,"label":"8"},{"v":10,"label":"10"},{"v":12,"label":"12"},{"v":14,"label":"14"},{"v":16,"label":"16"},{"v":18,"label":"18"},{"v":20,"label":"20"}], Dygraph.numericTicks(9, 21, 320, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":9,"label":"9"},{"v":10,"label":"10"},{"v":11,"label":"11"},{"v":12,"label":"12"},{"v":13,"label":"13"},{"v":14,"label":"14"},{"v":15,"label":"15"},{"v":16,"label":"16"},{"v":17,"label":"17"},{"v":18,"label":"18"}], Dygraph.numericTicks(9.2, 18.8, 320, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":80,"label":"80"},{"v":100,"label":"100"},{"v":120,"label":"120"},{"v":140,"label":"140"},{"v":160,"label":"160"},{"v":180,"label":"180"},{"v":200,"label":"200"}], Dygraph.numericTicks(90, 210, 320, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":true}))); - assertEquals([{"v":95,"label":"95"},{"v":96,"label":"96"},{"v":97,"label":"97"},{"v":98,"label":"98"},{"v":99,"label":"99"},{"v":100,"label":"100"},{"v":101,"label":"101"},{"v":102,"label":"102"},{"v":103,"label":"103"},{"v":104,"label":"104"}], Dygraph.numericTicks(95.71121718377088, 104.23150357995226, 320, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); - assertEquals([{"v":950,"label":"950"},{"v":-17999000,"label":"1000"},{"v":1050,"label":"1050"},{"v":1100,"label":"1100"},{"v":1150,"label":"1150"},{"v":1200,"label":"1200"}], Dygraph.numericTicks(980.1, 1218.9, 200, this.createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":-0.5,"label":"-0.5"},{"v":0,"label":"0"},{"v":0.5,"label":"0.5"},{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"},{"v":4,"label":"4"}], Dygraph.numericTicks(-0.4, 4.4, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":-1.5,"label":"-1.5"},{"v":-1,"label":"-1"},{"v":-0.5,"label":"-0.5"},{"v":0,"label":"0"},{"v":0.5,"label":"0.5"},{"v":1,"label":"1"}], Dygraph.numericTicks(-1.4157430939856124, 1.4157430939856124, 400, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":-10,"label":"-10"},{"v":-8,"label":"-8"},{"v":-6,"label":"-6"},{"v":-4,"label":"-4"},{"v":-2,"label":"-2"},{"v":0,"label":"0"},{"v":2,"label":"2"},{"v":4,"label":"4"},{"v":6,"label":"6"},{"v":8,"label":"8"}], Dygraph.numericTicks(-10, 9.98046875, 400, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":-200,"label":"-200"},{"v":0,"label":"0"},{"v":200,"label":"200"},{"v":400,"label":"400"},{"v":600,"label":"600"},{"v":800,"label":"800"},{"v":-17999000,"label":"1000"}], Dygraph.numericTicks(-101.10000000000001, 1100.1, 300, createOptionsViewForAxis('y',{"logscale":false,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":-20,"label":"-20"},{"v":-10,"label":"-10"},{"v":0,"label":"0"},{"v":10,"label":"10"},{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"}], Dygraph.numericTicks(-11.687459005175139, 42.287459005175144, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":-15,"label":"-15"},{"v":-10,"label":"-10"},{"v":-5,"label":"-5"},{"v":0,"label":"0"},{"v":5,"label":"5"},{"v":10,"label":"10"}], Dygraph.numericTicks(-12, 12, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":-15,"label":"-15"},{"v":-10,"label":"-10"},{"v":-5,"label":"-5"},{"v":0,"label":"0"},{"v":5,"label":"5"},{"v":10,"label":"10"}], Dygraph.numericTicks(-13.19792086872138, 13.197062407353386, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":-220,"label":"-220"},{"v":-200,"label":"-200"},{"v":-180,"label":"-180"},{"v":-160,"label":"-160"},{"v":-140,"label":"-140"},{"v":-120,"label":"-120"}], Dygraph.numericTicks(-220, -100, 200, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":-40,"label":"-40"},{"v":-20,"label":"-20"},{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"},{"v":100,"label":"100"},{"v":120,"label":"120"}], Dygraph.numericTicks(-32.8, 132.8, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":-40,"label":"-40"},{"v":-30,"label":"-30"},{"v":-20,"label":"-20"},{"v":-10,"label":"-10"},{"v":0,"label":"0"},{"v":10,"label":"10"},{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"}], Dygraph.numericTicks(-34.309, 89.279, 400, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":-60,"label":"-60"},{"v":-40,"label":"-40"},{"v":-20,"label":"-20"},{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"}], Dygraph.numericTicks(-60, 60, 200, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":-60,"label":"-60"},{"v":-40,"label":"-40"},{"v":-20,"label":"-20"},{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"}], Dygraph.numericTicks(-60, 60, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":0.0001,"label":"1.00e-4"},{"v":0.0002,"label":"2.00e-4"},{"v":-17999999,"label":"3.00e-4"},{"v":0.0004,"label":"4.00e-4"},{"v":0.0005,"label":"5.00e-4"}], Dygraph.numericTicks(0, 0.00055, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":0},{"v":0.0001,"label":0.0001},{"v":0.0002,"label":0.0002},{"v":-17999999,"label":0.0003},{"v":0.0004,"label":0.0004},{"v":0.0005,"label":0.0005}], Dygraph.numericTicks(0, 0.00055, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":0.2,"label":"0.2"},{"v":0.4,"label":"0.4"},{"v":-17999999,"label":"0.6"},{"v":0.8,"label":"0.8"}], Dygraph.numericTicks(0, 1, 200, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":0.2,"label":"0.2"},{"v":0.4,"label":"0.4"},{"v":-17999999,"label":"0.6"},{"v":0.8,"label":"0.8"}], Dygraph.numericTicks(0, 1, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":0.1,"label":"0.1"},{"v":0.2,"label":"0.2"},{"v":-17999999,"label":"0.3"},{"v":0.4,"label":"0.4"},{"v":0.5,"label":"0.5"},{"v":-17999999,"label":"0.6"},{"v":-17999999,"label":"0.7"},{"v":0.8,"label":"0.8"},{"v":0.9,"label":"0.9"},{"v":1,"label":"1"},{"v":1.1,"label":"1.1"},{"v":-17999998,"label":"1.2"}], Dygraph.numericTicks(0, 1.2, 400, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":10,"label":"10"},{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"},{"v":90,"label":"90"}], Dygraph.numericTicks(0, 100, 400, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"},{"v":100,"label":"100"}], Dygraph.numericTicks(0, 104.53192180924043, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"},{"v":100,"label":"100"}], Dygraph.numericTicks(0, 109.9856877755916, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":2,"label":"2"},{"v":4,"label":"4"},{"v":6,"label":"6"},{"v":8,"label":"8"},{"v":10,"label":"10"}], Dygraph.numericTicks(0, 11, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"},{"v":100,"label":"100"}], Dygraph.numericTicks(0, 110, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"},{"v":100,"label":"100"}], Dygraph.numericTicks(0, 110, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":10,"label":"10"},{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"},{"v":90,"label":"90"},{"v":100,"label":"100"}], Dygraph.numericTicks(0, 110, 350, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":200,"label":"200"},{"v":400,"label":"400"},{"v":600,"label":"600"},{"v":800,"label":"800"},{"v":-17999000,"label":"1000"}], Dygraph.numericTicks(0, 1100, 300, createOptionsViewForAxis('y',{"logscale":false,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":-17000000,"label":"1M"},{"v":-16000000,"label":"2M"},{"v":-15000000,"label":"3M"},{"v":-14000000,"label":"4M"},{"v":-13000000,"label":"5M"},{"v":-12000000,"label":"6M"},{"v":-11000000,"label":"7M"},{"v":-10000000,"label":"8M"},{"v":-9000000,"label":"9M"},{"v":-8000000,"label":"10M"}], Dygraph.numericTicks(0, 11000000, 480, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":true}))); + assertEquals([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"},{"v":100,"label":"100"}], Dygraph.numericTicks(0, 119, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"},{"v":100,"label":"100"},{"v":120,"label":"120"}], Dygraph.numericTicks(0, 130.9, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"},{"v":100,"label":"100"},{"v":120,"label":"120"}], Dygraph.numericTicks(0, 131, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":-17998000,"label":"2000"},{"v":-17996000,"label":"4000"},{"v":-17994000,"label":"6000"},{"v":-17992000,"label":"8000"},{"v":-17990000,"label":"10000"},{"v":-17988000,"label":"12000"},{"v":-17986000,"label":"14000"},{"v":-17984000,"label":"16000"}], Dygraph.numericTicks(0, 16977.4, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":0.5,"label":"0.5"},{"v":1,"label":"1"},{"v":1.5,"label":"1.5"}], Dygraph.numericTicks(0, 2, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":0.2,"label":"0.2"},{"v":0.4,"label":"0.4"},{"v":-17999999,"label":"0.6"},{"v":0.8,"label":"0.8"},{"v":1,"label":"1"},{"v":-17999998,"label":"1.2"},{"v":-17999998,"label":"1.4"},{"v":1.6,"label":"1.6"},{"v":1.8,"label":"1.8"}], Dygraph.numericTicks(0, 2, 400, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":0.5,"label":"0.5"},{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"}], Dygraph.numericTicks(0, 2.2, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":-17800000,"label":"200K"},{"v":-17600000,"label":"400K"},{"v":-17400000,"label":"600K"},{"v":-17200000,"label":"800K"},{"v":-17000000,"label":"1M"},{"v":-16800000,"label":"1.2M"},{"v":-16600000,"label":"1.4M"},{"v":-16400000,"label":"1.6M"},{"v":-16200000,"label":"1.8M"},{"v":-16000000,"label":"2M"}], Dygraph.numericTicks(0, 2200000, 350, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":true}))); + assertEquals([{"v":0,"label":"0"},{"v":50,"label":"50"},{"v":100,"label":"100"},{"v":150,"label":"150"},{"v":200,"label":"200"}], Dygraph.numericTicks(0, 249, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":500,"label":"500"},{"v":-17999000,"label":"1000"},{"v":1500,"label":"1500"},{"v":-17998000,"label":"2000"},{"v":2500,"label":"2500"}], Dygraph.numericTicks(0, 2747.9970998900817, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":200,"label":"200"},{"v":400,"label":"400"},{"v":600,"label":"600"},{"v":800,"label":"800"},{"v":-17999000,"label":"1K"},{"v":1200,"label":"1.2K"},{"v":1400,"label":"1.4K"},{"v":1600,"label":"1.6K"},{"v":1800,"label":"1.8K"},{"v":-17998000,"label":"2K"},{"v":2200,"label":"2.2K"},{"v":2400,"label":"2.4K"},{"v":2600,"label":"2.6K"}], Dygraph.numericTicks(0, 2747.9970998900817, 480, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":true}))); + assertEquals([{"v":0,"label":"0"},{"v":5,"label":"5"},{"v":10,"label":"10"},{"v":15,"label":"15"},{"v":20,"label":"20"},{"v":25,"label":"25"},{"v":30,"label":"30"}], Dygraph.numericTicks(0, 32.698942321287205, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":-17500000,"label":"500000"},{"v":-17000000,"label":"1.00e+6"},{"v":-16500000,"label":"1.50e+6"},{"v":-16000000,"label":"2.00e+6"},{"v":-15500000,"label":"2.50e+6"},{"v":-15000000,"label":"3.00e+6"}], Dygraph.numericTicks(0, 3263100.6418021005, 480, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":5,"label":"5"},{"v":10,"label":"10"},{"v":15,"label":"15"},{"v":20,"label":"20"},{"v":25,"label":"25"},{"v":30,"label":"30"}], Dygraph.numericTicks(0, 33.16213467701236, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":0.5,"label":"0.5"},{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"}], Dygraph.numericTicks(0, 4, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":0.5,"label":"0.5"},{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"},{"v":4,"label":"4"}], Dygraph.numericTicks(0, 4.4, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":5,"label":"5"},{"v":10,"label":"10"},{"v":15,"label":"15"},{"v":20,"label":"20"},{"v":25,"label":"25"},{"v":30,"label":"30"},{"v":35,"label":"35"},{"v":40,"label":"40"}], Dygraph.numericTicks(0, 42, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":true}))); + assertEquals([{"v":0,"label":"0"},{"v":8,"label":"8"},{"v":16,"label":"16"},{"v":24,"label":"24"},{"v":32,"label":"32"},{"v":40,"label":"40"}], Dygraph.numericTicks(0, 42, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":true,"labelsKMB":false}))); + assertEquals([{"v":0,"label":0},{"v":8,"label":8},{"v":16,"label":16},{"v":24,"label":24},{"v":32,"label":32},{"v":40,"label":40}], Dygraph.numericTicks(0, 42, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":true,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":999982000000,"label":"1T"},{"v":1999982000000,"label":"2T"},{"v":2999982000000,"label":"3T"},{"v":3999982000000,"label":"4T"}], Dygraph.numericTicks(0, 4837851162214.3, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":true}))); + assertEquals([{"v":0,"label":"0"},{"v":549755813888,"label":"512G"},{"v":1099511627776,"label":"1T"},{"v":1649267441664,"label":"1.5T"},{"v":2199023255552,"label":"2T"},{"v":2748779069440,"label":"2.5T"},{"v":3298534883328,"label":"3T"},{"v":3848290697216,"label":"3.5T"},{"v":4398046511104,"label":"4T"}], Dygraph.numericTicks(0, 4837851162214.3, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":true,"labelsKMB":false}))); + assertEquals([{"v":0,"label":0},{"v":549755813888,"label":"512G"},{"v":1099511627776,"label":"1T"},{"v":1649267441664,"label":"1.5T"},{"v":2199023255552,"label":"2T"},{"v":2748779069440,"label":"2.5T"},{"v":3298534883328,"label":"3T"},{"v":3848290697216,"label":"3.5T"},{"v":4398046511104,"label":"4T"}], Dygraph.numericTicks(0, 4837851162214.3, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":true,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":-17999000,"label":"1000"},{"v":-17998000,"label":"2000"},{"v":-17997000,"label":"3000"},{"v":-17996000,"label":"4000"},{"v":-17995000,"label":"5000"}], Dygraph.numericTicks(0, 5451.6, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":100,"label":"100"},{"v":200,"label":"200"},{"v":300,"label":"300"},{"v":400,"label":"400"},{"v":500,"label":"500"}], Dygraph.numericTicks(0, 550, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":10,"label":"10"},{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"}], Dygraph.numericTicks(0, 64.9, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":100,"label":"100"},{"v":200,"label":"200"},{"v":300,"label":"300"},{"v":400,"label":"400"},{"v":500,"label":"500"},{"v":600,"label":"600"}], Dygraph.numericTicks(0, 667.9, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":1,"label":"1"},{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"},{"v":6,"label":"6"},{"v":7,"label":"7"}], Dygraph.numericTicks(0, 7.7, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":1,"label":"1"},{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"},{"v":6,"label":"6"},{"v":7,"label":"7"}], Dygraph.numericTicks(0, 7.9347329768293005, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":10,"label":"10"},{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"}], Dygraph.numericTicks(0, 72.6, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"}], Dygraph.numericTicks(0, 99, 200, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"}], Dygraph.numericTicks(0, 99, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":10,"label":"10"},{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"},{"v":90,"label":"90"}], Dygraph.numericTicks(0, 99, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":200,"label":"200"},{"v":400,"label":"400"},{"v":600,"label":"600"},{"v":800,"label":"800"}], Dygraph.numericTicks(0, 999, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0.000001,"label":"1.00e-6"},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":"1.00e-5"},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":0.0001,"label":"1.00e-4"},{"v":0.0002,"label":""},{"v":-17999999,"label":""},{"v":0.0004,"label":""},{"v":0.0005,"label":""},{"v":-17999999,"label":""},{"v":0.0007,"label":""},{"v":0.0008,"label":""},{"v":-17999999,"label":""},{"v":0.001,"label":"1.00e-3"},{"v":0.002,"label":""},{"v":0.003,"label":""},{"v":0.004,"label":""},{"v":0.005,"label":""},{"v":0.006,"label":""},{"v":0.007,"label":""},{"v":0.008,"label":""},{"v":-17999999,"label":""},{"v":0.01,"label":"0.01"},{"v":0.02,"label":""},{"v":0.03,"label":""},{"v":0.04,"label":""},{"v":0.05,"label":""},{"v":0.06,"label":""},{"v":0.07,"label":""},{"v":0.08,"label":""},{"v":0.09,"label":""},{"v":0.1,"label":"0.1"},{"v":0.2,"label":""},{"v":-17999999,"label":""},{"v":0.4,"label":""},{"v":0.5,"label":""},{"v":-17999999,"label":""},{"v":-17999999,"label":""},{"v":0.8,"label":""},{"v":0.9,"label":""},{"v":1,"label":"1"},{"v":2,"label":""},{"v":3,"label":""},{"v":4,"label":""},{"v":5,"label":""},{"v":6,"label":""},{"v":7,"label":""},{"v":8,"label":""},{"v":9,"label":""},{"v":10,"label":"10"},{"v":20,"label":""},{"v":30,"label":""},{"v":40,"label":""},{"v":50,"label":""},{"v":60,"label":""},{"v":70,"label":""},{"v":80,"label":""},{"v":90,"label":""},{"v":100,"label":"100"},{"v":200,"label":""},{"v":300,"label":""},{"v":400,"label":""},{"v":500,"label":""},{"v":600,"label":""},{"v":700,"label":""},{"v":800,"label":""},{"v":900,"label":""},{"v":-17999000,"label":"1000"}], Dygraph.numericTicks(0.000001, 1099.9999999, 300, createOptionsViewForAxis('y',{"logscale":true,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":1,"label":"1"},{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"}], Dygraph.numericTicks(0.6, 5.4, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0.5,"label":"0.5"},{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"},{"v":4,"label":"4"},{"v":4.5,"label":"4.5"}], Dygraph.numericTicks(0.6373123361267239, 4.824406504982038, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0.5,"label":"0.5"},{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"},{"v":4,"label":"4"},{"v":4.5,"label":"4.5"}], Dygraph.numericTicks(0.6373123361267239, 4.824406504982038, 353, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0.6000000000000001,"label":"0.6"},{"v":0.8,"label":"0.8"},{"v":1,"label":"1"},{"v":-17999998,"label":"1.2"},{"v":-17999998,"label":"1.4"},{"v":1.6,"label":"1.6"},{"v":-17999998,"label":"1.8"},{"v":2,"label":"2"},{"v":2.2,"label":"2.2"},{"v":-17999997,"label":"2.4"},{"v":2.6,"label":"2.6"},{"v":-17999997,"label":"2.8"},{"v":-17999997,"label":"3"},{"v":3.2,"label":"3.2"},{"v":-17999996,"label":"3.4"},{"v":3.6,"label":"3.6"},{"v":-17999996,"label":"3.8"},{"v":4,"label":"4"},{"v":4.2,"label":"4.2"},{"v":4.4,"label":"4.4"},{"v":4.6,"label":"4.6"},{"v":-17999995,"label":"4.8"}], Dygraph.numericTicks(0.6373123361267239, 4.824406504982038, 743, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0.5,"label":"0.5"},{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"},{"v":4,"label":"4"},{"v":4.5,"label":"4.5"}], Dygraph.numericTicks(0.6386658954698001, 4.8095173522082, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0.5,"label":"0.5"},{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"},{"v":4,"label":"4"}], Dygraph.numericTicks(0.7101014279158788, 4.023726495301334, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":20,"label":"20"},{"v":40,"label":"40"},{"v":60,"label":"60"},{"v":80,"label":"80"},{"v":100,"label":"100"}], Dygraph.numericTicks(1, 109, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"}], Dygraph.numericTicks(1, 3, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"}], Dygraph.numericTicks(1, 4, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"}], Dygraph.numericTicks(1, 4, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"},{"v":4,"label":"4"},{"v":4.5,"label":"4.5"}], Dygraph.numericTicks(1, 5, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":1,"label":1},{"v":1.5,"label":1.5},{"v":2,"label":2},{"v":2.5,"label":2.5},{"v":3,"label":3},{"v":3.5,"label":3.5},{"v":4,"label":4},{"v":4.5,"label":4.5}], Dygraph.numericTicks(1, 5, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":1,"label":"1"},{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"}], Dygraph.numericTicks(1, 6, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":1,"label":"1"},{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"},{"v":6,"label":"6"}], Dygraph.numericTicks(1, 7, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":1,"label":"1"},{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"},{"v":6,"label":"6"},{"v":7,"label":"7"},{"v":8,"label":"8"}], Dygraph.numericTicks(1, 9, 300, createOptionsViewForAxis('y',{"logscale":false,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":1,"label":"1"},{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"},{"v":6,"label":""},{"v":7,"label":"7"},{"v":8,"label":""},{"v":9,"label":"9"}], Dygraph.numericTicks(1, 9, 300, createOptionsViewForAxis('y',{"logscale":true,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":1,"label":"1"},{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"},{"v":6,"label":"6"},{"v":7,"label":"7"},{"v":8,"label":"8"}], Dygraph.numericTicks(1, 9, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":2,"label":"2"},{"v":4,"label":"4"},{"v":6,"label":"6"},{"v":8,"label":"8"},{"v":10,"label":"10"}], Dygraph.numericTicks(1.2, 10.8, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":1,"label":"1"},{"v":1.5,"label":"1.5"},{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"},{"v":4,"label":"4"},{"v":4.5,"label":"4.5"}], Dygraph.numericTicks(1.2872947778969237, 4.765317192093838, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":1,"label":"1"},{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"},{"v":6,"label":"6"},{"v":7,"label":"7"}], Dygraph.numericTicks(1.5, 7.5, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":5,"label":"5"},{"v":10,"label":"10"},{"v":15,"label":"15"},{"v":20,"label":"20"},{"v":25,"label":"25"}], Dygraph.numericTicks(1.7999999999999998, 28.2, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":10,"label":"10"},{"v":10.1,"label":"10.1"},{"v":10.2,"label":"10.2"},{"v":10.3,"label":"10.3"},{"v":10.4,"label":"10.4"},{"v":10.5,"label":"10.5"},{"v":10.6,"label":"10.6"},{"v":10.7,"label":"10.7"},{"v":10.8,"label":"10.8"},{"v":10.9,"label":"10.9"}], Dygraph.numericTicks(10, 11, 480, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":100,"label":"100"},{"v":120,"label":"120"},{"v":140,"label":"140"},{"v":160,"label":"160"},{"v":180,"label":"180"}], Dygraph.numericTicks(100, 200, 200, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":10000,"label":"10000"},{"v":-17988000,"label":"12000"},{"v":-17986000,"label":"14000"},{"v":-17984000,"label":"16000"},{"v":-17982000,"label":"18000"},{"v":-17980000,"label":"20000"},{"v":-17978000,"label":"22000"},{"v":-17976000,"label":"24000"},{"v":-17974000,"label":"26000"},{"v":-17972000,"label":"28000"},{"v":-17970000,"label":"30000"},{"v":-17968000,"label":"32000"},{"v":-17966000,"label":"34000"},{"v":-17964000,"label":"36000"}], Dygraph.numericTicks(10122.8, 36789.2, 480, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":11000,"label":"11000"},{"v":11200,"label":"11200"},{"v":11400,"label":"11400"},{"v":11600,"label":"11600"},{"v":11800,"label":"11800"},{"v":-17988000,"label":"12000"},{"v":12200,"label":"12200"},{"v":12400,"label":"12400"},{"v":12600,"label":"12600"},{"v":12800,"label":"12800"},{"v":-17987000,"label":"13000"},{"v":13200,"label":"13200"},{"v":13400,"label":"13400"}], Dygraph.numericTicks(11110.5, 13579.5, 480, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":162000,"label":"162000"},{"v":-17836000,"label":"164000"},{"v":-17834000,"label":"166000"},{"v":-17832000,"label":"168000"},{"v":-17830000,"label":"170000"},{"v":-17828000,"label":"172000"},{"v":-17826000,"label":"174000"},{"v":-17824000,"label":"176000"},{"v":-17822000,"label":"178000"}], Dygraph.numericTicks(163038.4, 179137.6, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":2,"label":"2"},{"v":2.5,"label":"2.5"},{"v":3,"label":"3"},{"v":3.5,"label":"3.5"}], Dygraph.numericTicks(2, 4, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":2,"label":"2"},{"v":3,"label":"3"},{"v":4,"label":"4"},{"v":5,"label":"5"},{"v":6,"label":"6"},{"v":7,"label":"7"}], Dygraph.numericTicks(2.6, 7.4, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"},{"v":90,"label":"90"}], Dygraph.numericTicks(21.7, 97.3, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"},{"v":90,"label":"90"}], Dygraph.numericTicks(21.7, 97.3, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"},{"v":90,"label":"90"}], Dygraph.numericTicks(24, 96, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"}], Dygraph.numericTicks(26.185714285714287, 90.81428571428572, 20, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"},{"v":90,"label":"90"}], Dygraph.numericTicks(26.185714285714287, 90.81428571428572, 200, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false,pixelsPerLabel:20}))); + assertEquals([{"v":25,"label":"25"},{"v":30,"label":"30"},{"v":35,"label":"35"},{"v":40,"label":"40"},{"v":45,"label":"45"},{"v":50,"label":"50"},{"v":55,"label":"55"},{"v":60,"label":"60"},{"v":65,"label":"65"},{"v":70,"label":"70"},{"v":75,"label":"75"},{"v":80,"label":"80"},{"v":85,"label":"85"},{"v":90,"label":"90"}], Dygraph.numericTicks(26.185714285714287, 90.81428571428572, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false,pixelsPerLabel:20}))); + assertEquals([{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"},{"v":90,"label":"90"}], Dygraph.numericTicks(26.185714285714287, 90.81428571428572, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":20,"label":"20"},{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"}], Dygraph.numericTicks(28.33333333333333, 88.33333333333334, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":3,"label":"3"},{"v":3.5,"label":"3.5"},{"v":4,"label":"4"},{"v":4.5,"label":"4.5"}], Dygraph.numericTicks(3, 5, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":3000,"label":"3K"},{"v":2500,"label":"2.5K"},{"v":-17998000,"label":"2K"},{"v":1500,"label":"1.5K"},{"v":-17999000,"label":"1K"},{"v":500,"label":"500"}], Dygraph.numericTicks(3000, 0, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":true}))); + assertEquals([{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"}], Dygraph.numericTicks(33.11333333333334, 83.75333333333333, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":30,"label":"30"},{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"}], Dygraph.numericTicks(36.921241050119335, 88.32696897374701, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":50,"label":""},{"v":60,"label":"60"},{"v":70,"label":""},{"v":80,"label":""},{"v":90,"label":""},{"v":100,"label":"100"},{"v":200,"label":""},{"v":300,"label":"300"},{"v":400,"label":""},{"v":500,"label":""},{"v":600,"label":"600"},{"v":700,"label":""},{"v":800,"label":""},{"v":900,"label":""},{"v":-17999000,"label":"1000"},{"v":-17998000,"label":""},{"v":-17997000,"label":"3000"},{"v":-17996000,"label":""},{"v":-17995000,"label":""},{"v":-17994000,"label":"6000"},{"v":-17993000,"label":""},{"v":-17992000,"label":""},{"v":-17991000,"label":""},{"v":-17990000,"label":"10000"}], Dygraph.numericTicks(41.220000000000084, 15576.828000000018, 400, createOptionsViewForAxis('y',{"logscale":true,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":40,"label":"40"},{"v":50,"label":"50"},{"v":60,"label":"60"},{"v":70,"label":"70"},{"v":80,"label":"80"},{"v":90,"label":"90"}], Dygraph.numericTicks(44.5, 98.5, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":5,"label":"5"},{"v":6,"label":""},{"v":7,"label":""},{"v":8,"label":""},{"v":9,"label":""},{"v":10,"label":"10"},{"v":20,"label":"20"},{"v":30,"label":""},{"v":40,"label":""},{"v":50,"label":"50"},{"v":60,"label":""},{"v":70,"label":""},{"v":80,"label":""},{"v":90,"label":""},{"v":100,"label":"100"},{"v":200,"label":"200"},{"v":300,"label":""},{"v":400,"label":""},{"v":500,"label":"500"},{"v":600,"label":""},{"v":700,"label":""},{"v":800,"label":""},{"v":900,"label":""},{"v":-17999000,"label":"1000"}], Dygraph.numericTicks(5, 1099.5, 300, createOptionsViewForAxis('y',{"logscale":true,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":50,"label":"50"},{"v":55,"label":"55"},{"v":60,"label":"60"},{"v":65,"label":"65"},{"v":70,"label":"70"},{"v":75,"label":"75"},{"v":80,"label":"80"}], Dygraph.numericTicks(52.5, 82.5, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":68,"label":"68"},{"v":70,"label":"70"},{"v":72,"label":"72"},{"v":74,"label":"74"},{"v":76,"label":"76"},{"v":78,"label":"78"},{"v":80,"label":"80"}], Dygraph.numericTicks(69, 81, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":0,"label":"0"},{"v":-17980000,"label":"20K"},{"v":-17960000,"label":"40K"},{"v":-17940000,"label":"60K"},{"v":-17920000,"label":"80K"}], Dygraph.numericTicks(7921.099999999999, 81407.9, 240, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":true}))); + assertEquals([{"v":8,"label":"8"},{"v":10,"label":"10"},{"v":12,"label":"12"},{"v":14,"label":"14"},{"v":16,"label":"16"},{"v":18,"label":"18"},{"v":20,"label":"20"}], Dygraph.numericTicks(9, 21, 300, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":8,"label":"8"},{"v":10,"label":"10"},{"v":12,"label":"12"},{"v":14,"label":"14"},{"v":16,"label":"16"},{"v":18,"label":"18"},{"v":20,"label":"20"}], Dygraph.numericTicks(9, 21, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":9,"label":"9"},{"v":10,"label":"10"},{"v":11,"label":"11"},{"v":12,"label":"12"},{"v":13,"label":"13"},{"v":14,"label":"14"},{"v":15,"label":"15"},{"v":16,"label":"16"},{"v":17,"label":"17"},{"v":18,"label":"18"}], Dygraph.numericTicks(9.2, 18.8, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":80,"label":"80"},{"v":100,"label":"100"},{"v":120,"label":"120"},{"v":140,"label":"140"},{"v":160,"label":"160"},{"v":180,"label":"180"},{"v":200,"label":"200"}], Dygraph.numericTicks(90, 210, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":true}))); + assertEquals([{"v":95,"label":"95"},{"v":96,"label":"96"},{"v":97,"label":"97"},{"v":98,"label":"98"},{"v":99,"label":"99"},{"v":100,"label":"100"},{"v":101,"label":"101"},{"v":102,"label":"102"},{"v":103,"label":"103"},{"v":104,"label":"104"}], Dygraph.numericTicks(95.71121718377088, 104.23150357995226, 320, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); + assertEquals([{"v":950,"label":"950"},{"v":-17999000,"label":"1000"},{"v":1050,"label":"1050"},{"v":1100,"label":"1100"},{"v":1150,"label":"1150"},{"v":1200,"label":"1200"}], Dygraph.numericTicks(980.1, 1218.9, 200, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false}))); }; */ diff --git a/auto_tests/tests/per_axis.js b/auto_tests/tests/per_axis.js index 279765e..a3bdbad 100644 --- a/auto_tests/tests/per_axis.js +++ b/auto_tests/tests/per_axis.js @@ -5,28 +5,30 @@ */ var perAxisTestCase = TestCase("per-axis"); -perAxisTestCase._origGetContext = Dygraph.getContext; +var _origGetContext = Dygraph.getContext; + +var xAxisLineColor = "#00ffff"; +var yAxisLineColor = "#ffff00"; + +var g, graph; perAxisTestCase.prototype.setUp = function() { document.body.innerHTML = "
"; Dygraph.getContext = function(canvas) { - return new Proxy(perAxisTestCase._origGetContext(canvas)); + return new Proxy(_origGetContext(canvas)); } - this.xAxisLineColor = "#00ffff"; - this.yAxisLineColor = "#ffff00"; - var opts = { axes : { x : { drawAxis : false, drawGrid : false, - gridLineColor : this.xAxisLineColor + gridLineColor : xAxisLineColor }, y : { drawAxis : false, drawGrid : false, - gridLineColor : this.yAxisLineColor + gridLineColor : yAxisLineColor } }, colors: [ '#ff0000', '#0000ff' ] @@ -36,36 +38,36 @@ perAxisTestCase.prototype.setUp = function() { "1,1,0\n" + "8,0,1\n" ; - this.graph = document.getElementById('graph'); - this.g = new Dygraph(this.graph, data, opts); + graph = document.getElementById('graph'); + g = new Dygraph(graph, data, opts); }; perAxisTestCase.prototype.tearDown = function() { - Dygraph.getContext = perAxisTestCase._origGetContext; + Dygraph.getContext = _origGetContext; }; perAxisTestCase.prototype.testDrawXAxis = function() { - this.g.updateOptions({ axes : { x : { drawAxis: true }} }); - assertTrue(this.graph.getElementsByClassName('dygraph-axis-label-x').length > 0); - assertTrue(this.graph.getElementsByClassName('dygraph-axis-label-y').length == 0); + g.updateOptions({ axes : { x : { drawAxis: true }} }); + assertTrue(graph.getElementsByClassName('dygraph-axis-label-x').length > 0); + assertTrue(graph.getElementsByClassName('dygraph-axis-label-y').length == 0); } perAxisTestCase.prototype.testDrawYAxis = function() { - this.g.updateOptions({ axes : { y : { drawAxis: true }} }); - assertTrue(this.graph.getElementsByClassName('dygraph-axis-label-x').length ==0); - assertTrue(this.graph.getElementsByClassName('dygraph-axis-label-y').length > 0); + g.updateOptions({ axes : { y : { drawAxis: true }} }); + assertTrue(graph.getElementsByClassName('dygraph-axis-label-x').length ==0); + assertTrue(graph.getElementsByClassName('dygraph-axis-label-y').length > 0); } perAxisTestCase.prototype.testDrawXGrid = function() { - this.g.updateOptions({ axes : { x : { drawGrid : true }}}); - var htx = this.g.hidden_ctx_; - assertTrue(CanvasAssertions.numLinesDrawn(htx, this.xAxisLineColor) > 0); - assertTrue(CanvasAssertions.numLinesDrawn(htx, this.yAxisLineColor) == 0); + g.updateOptions({ axes : { x : { drawGrid : true }}}); + var htx = g.hidden_ctx_; + assertTrue(CanvasAssertions.numLinesDrawn(htx, xAxisLineColor) > 0); + assertTrue(CanvasAssertions.numLinesDrawn(htx, yAxisLineColor) == 0); } perAxisTestCase.prototype.testDrawYGrid = function() { - this.g.updateOptions({ axes : { y : { drawGrid : true }}}); - var htx = this.g.hidden_ctx_; - assertTrue(CanvasAssertions.numLinesDrawn(htx, this.xAxisLineColor) == 0); - assertTrue(CanvasAssertions.numLinesDrawn(htx, this.yAxisLineColor) > 0); + g.updateOptions({ axes : { y : { drawGrid : true }}}); + var htx = g.hidden_ctx_; + assertTrue(CanvasAssertions.numLinesDrawn(htx, xAxisLineColor) == 0); + assertTrue(CanvasAssertions.numLinesDrawn(htx, yAxisLineColor) > 0); } diff --git a/auto_tests/tests/plugins.js b/auto_tests/tests/plugins.js index 3605113..ee3e940 100644 --- a/auto_tests/tests/plugins.js +++ b/auto_tests/tests/plugins.js @@ -5,10 +5,12 @@ */ var pluginsTestCase = TestCase("plugins"); +var data; + pluginsTestCase.prototype.setUp = function() { document.body.innerHTML = "
"; - this.data = "X,Y1,Y2\n" + + data = "X,Y1,Y2\n" + "0,1,2\n" + "1,2,1\n" + "2,1,2\n" + @@ -40,7 +42,7 @@ pluginsTestCase.prototype.testWillDrawChart = function() { })(); var graph = document.getElementById("graph"); - var g = new Dygraph(graph, this.data, {plugins: [plugin]}); + var g = new Dygraph(graph, data, {plugins: [plugin]}); assertEquals(1, draw); }; @@ -60,7 +62,7 @@ pluginsTestCase.prototype.testPassingInstance = function() { }; var graph = document.getElementById("graph"); - var g = new Dygraph(graph, this.data, {plugins: [p]}); + var g = new Dygraph(graph, data, {plugins: [p]}); assertEquals(1, draw); }; @@ -168,7 +170,7 @@ pluginsTestCase.prototype.testEventSequence = function() { }; var graph = document.getElementById("graph"); - var g = new Dygraph(graph, this.data, {plugins: [p]}); + var g = new Dygraph(graph, data, {plugins: [p]}); // Initial draw sequence assertEquals([ @@ -202,7 +204,7 @@ pluginsTestCase.prototype.testEventSequence = function() { // New data triggers the full sequence. events = []; - g.updateOptions({file: this.data + '\n4,1,2'}); + g.updateOptions({file: data + '\n4,1,2'}); assertEquals([ "dataWillUpdate", "dataDidUpdate", @@ -225,7 +227,7 @@ pluginsTestCase.prototype.testDestroyCalledInOrder = function() { }; var graph = document.getElementById("graph"); - var g = new Dygraph(graph, this.data, { + var g = new Dygraph(graph, data, { plugins: [makePlugin('p'), makePlugin('q')] }); diff --git a/auto_tests/tests/range_selector.js b/auto_tests/tests/range_selector.js index 3349ab5..aa7bd60 100644 --- a/auto_tests/tests/range_selector.js +++ b/auto_tests/tests/range_selector.js @@ -33,7 +33,7 @@ RangeSelectorTestCase.prototype.testRangeSelector = function() { ]; var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - this.assertGraphExistence(g, graph); + assertGraphExistence(g, graph); }; RangeSelectorTestCase.prototype.testRangeSelectorWithErrorBars = function() { @@ -57,7 +57,7 @@ RangeSelectorTestCase.prototype.testRangeSelectorWithErrorBars = function() { ]; var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - this.assertGraphExistence(g, graph); + assertGraphExistence(g, graph); }; RangeSelectorTestCase.prototype.testRangeSelectorWithCustomBars = function() { @@ -81,7 +81,7 @@ RangeSelectorTestCase.prototype.testRangeSelectorWithCustomBars = function() { ]; var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - this.assertGraphExistence(g, graph); + assertGraphExistence(g, graph); }; RangeSelectorTestCase.prototype.testRangeSelectorWithLogScale = function() { @@ -105,7 +105,7 @@ RangeSelectorTestCase.prototype.testRangeSelectorWithLogScale = function() { ]; var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - this.assertGraphExistence(g, graph); + assertGraphExistence(g, graph); }; RangeSelectorTestCase.prototype.testRangeSelectorOptions = function() { @@ -131,7 +131,7 @@ RangeSelectorTestCase.prototype.testRangeSelectorOptions = function() { ]; var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - this.assertGraphExistence(g, graph); + assertGraphExistence(g, graph); }; RangeSelectorTestCase.prototype.testAdditionalRangeSelectorOptions = function() { @@ -161,7 +161,7 @@ RangeSelectorTestCase.prototype.testAdditionalRangeSelectorOptions = function() ]; var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - this.assertGraphExistence(g, graph); + assertGraphExistence(g, graph); }; RangeSelectorTestCase.prototype.testRangeSelectorEnablingAfterCreation = function() { @@ -184,7 +184,7 @@ RangeSelectorTestCase.prototype.testRangeSelectorEnablingAfterCreation = functio var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); g.updateOptions({showRangeSelector: true}); - this.assertGraphExistence(g, graph); + assertGraphExistence(g, graph); }; // The animatedZooms option does not work with the range selector. Make sure it gets turned off. @@ -209,7 +209,7 @@ RangeSelectorTestCase.prototype.testRangeSelectorWithAnimatedZoomsOption = funct ]; var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - this.assertGraphExistence(g, graph); + assertGraphExistence(g, graph); assertFalse(g.getOption('animatedZooms')); }; @@ -234,7 +234,7 @@ RangeSelectorTestCase.prototype.testRangeSelectorWithAnimatedZoomsOption2 = func var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); g.updateOptions({showRangeSelector: true}); - this.assertGraphExistence(g, graph); + assertGraphExistence(g, graph); assertFalse(g.getOption('animatedZooms')); }; @@ -258,7 +258,7 @@ RangeSelectorTestCase.prototype.testRangeSelectorInteraction = function() { ]; var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - this.assertGraphExistence(g, graph); + assertGraphExistence(g, graph); var zoomhandles = graph.getElementsByClassName('dygraph-rangesel-zoomhandle'); // Move left zoomhandle in @@ -377,7 +377,7 @@ RangeSelectorTestCase.prototype.testRangeSelectorPositionIfXAxisNotDrawn = funct //assert, that the range selector is at top position 70 since the 30px of the // xAxis shouldn't be reserved since it isn't drawn. - this.assertGraphExistence(g, graph); + assertGraphExistence(g, graph); var bgcanvas = graph.getElementsByClassName('dygraph-rangesel-bgcanvas')[0]; assertEquals("Range selector is not at the expected position.","70px", bgcanvas.style.top); var fgcanvas = graph.getElementsByClassName('dygraph-rangesel-fgcanvas')[0]; @@ -604,7 +604,7 @@ RangeSelectorTestCase.prototype.testTwoCombinedSeriesCustomBars = function() { }; -RangeSelectorTestCase.prototype.assertGraphExistence = function(g, graph) { +var assertGraphExistence = function(g, graph) { assertNotNull(g); var zoomhandles = graph.getElementsByClassName('dygraph-rangesel-zoomhandle'); assertEquals(2, zoomhandles.length); @@ -612,4 +612,4 @@ RangeSelectorTestCase.prototype.assertGraphExistence = function(g, graph) { assertEquals(1, bgcanvas.length); var fgcanvas = graph.getElementsByClassName('dygraph-rangesel-fgcanvas'); assertEquals(1, fgcanvas.length); -} +}; diff --git a/auto_tests/tests/range_tests.js b/auto_tests/tests/range_tests.js index 051c1e3..1612f41 100644 --- a/auto_tests/tests/range_tests.js +++ b/auto_tests/tests/range_tests.js @@ -45,7 +45,7 @@ RangeTestCase.prototype.setUp = function() { document.body.innerHTML = "
"; }; -RangeTestCase.prototype.createGraph = function(opts, data, expectRangeX, expectRangeY) { +var createGraph = function(opts, data, expectRangeX, expectRangeY) { if (data === undefined) data = ZERO_TO_FIFTY_STEPS; if (expectRangeX === undefined) expectRangeX = [10, 20]; if (expectRangeY === undefined) expectRangeY = [0, 55]; @@ -63,7 +63,7 @@ RangeTestCase.prototype.createGraph = function(opts, data, expectRangeX, expectR * appropriately. */ RangeTestCase.prototype.testRangeSetOperations = function() { - var g = this.createGraph({valueRange : [ 0, 55 ]}); + var g = createGraph({valueRange : [ 0, 55 ]}); g.updateOptions({ dateWindow : [ 12, 18 ] }); assertEquals([12, 18], g.xAxisRange()); @@ -114,7 +114,7 @@ RangeTestCase.prototype.testRangeSetOperations = function() { * Verify that when zoomed in by mouse operations, an empty call to * updateOptions doesn't change the displayed ranges. */ -RangeTestCase.prototype.zoom = function(g, xRange, yRange) { +var zoom = function(g, xRange, yRange) { var originalXRange = g.xAxisRange(); var originalYRange = g.yAxisRange(0); @@ -140,8 +140,8 @@ RangeTestCase.prototype.zoom = function(g, xRange, yRange) { * updateOptions doesn't change the displayed ranges. */ RangeTestCase.prototype.testEmptyUpdateOptions_doesntUnzoom = function() { - var g = this.createGraph(); - this.zoom(g, [ 11, 18 ], [ 35, 40 ]); + var g = createGraph(); + zoom(g, [ 11, 18 ], [ 35, 40 ]); assertEqualsDelta([11, 18], g.xAxisRange(), 0.1); assertEqualsDelta([35, 40], g.yAxisRange(0), 0.2); @@ -158,8 +158,8 @@ RangeTestCase.prototype.testEmptyUpdateOptions_doesntUnzoom = function() { * unzooms. */ RangeTestCase.prototype.testRestoreOriginalRanges_viaUpdateOptions = function() { - var g = this.createGraph(); - this.zoom(g, [ 11, 18 ], [ 35, 40 ]); + var g = createGraph(); + zoom(g, [ 11, 18 ], [ 35, 40 ]); g.updateOptions({ dateWindow : null, valueRange : null }); @@ -241,7 +241,7 @@ RangeTestCase.prototype.testHugeRange = function() { * Verify old-style avoidMinZero option. */ RangeTestCase.prototype.testAvoidMinZero = function() { - var g = this.createGraph({ + var g = createGraph({ avoidMinZero: true, }, ZERO_TO_FIFTY_STEPS, [10, 20], [-5, 55]); }; @@ -250,7 +250,7 @@ RangeTestCase.prototype.testAvoidMinZero = function() { * Verify ranges with user-specified padding, implicit avoidMinZero. */ RangeTestCase.prototype.testPaddingAuto = function() { - var g = this.createGraph({ + var g = createGraph({ xRangePad: 42, yRangePad: 30 }, ZERO_TO_FIFTY_STEPS, [9, 21], [-5, 55]); @@ -260,7 +260,7 @@ RangeTestCase.prototype.testPaddingAuto = function() { * Verify auto range with drawAxesAtZero. */ RangeTestCase.prototype.testPaddingAutoAxisAtZero = function() { - var g = this.createGraph({ + var g = createGraph({ drawAxesAtZero: true, }, ZERO_TO_FIFTY_STEPS, [10, 20], [0, 55]); }; @@ -270,7 +270,7 @@ RangeTestCase.prototype.testPaddingAutoAxisAtZero = function() { * Try explicit range matching the auto range, should have identical results. */ RangeTestCase.prototype.testPaddingRange1 = function() { - var g = this.createGraph({ + var g = createGraph({ valueRange: [0, 50], xRangePad: 42, yRangePad: 30, @@ -283,7 +283,7 @@ RangeTestCase.prototype.testPaddingRange1 = function() { * User-supplied range differs from the auto range. */ RangeTestCase.prototype.testPaddingRange2 = function() { - var g = this.createGraph({ + var g = createGraph({ valueRange: [10, 60], xRangePad: 42, yRangePad: 30, @@ -295,7 +295,7 @@ RangeTestCase.prototype.testPaddingRange2 = function() { * Verify drawAxesAtZero and includeZero. */ RangeTestCase.prototype.testPaddingYAtZero = function() { - var g = this.createGraph({ + var g = createGraph({ includeZero: true, xRangePad: 42, yRangePad: 30, @@ -311,7 +311,7 @@ RangeTestCase.prototype.testPaddingYAtZero = function() { * Verify logscale, compat mode. */ RangeTestCase.prototype.testLogscaleCompat = function() { - var g = this.createGraph({ + var g = createGraph({ logscale: true }, [[-10, 10], [10, 10], [30, 1000]], @@ -322,7 +322,7 @@ RangeTestCase.prototype.testLogscaleCompat = function() { * Verify logscale, new mode. */ RangeTestCase.prototype.testLogscalePad = function() { - var g = this.createGraph({ + var g = createGraph({ logscale: true, yRangePad: 30 }, diff --git a/auto_tests/tests/resize.js b/auto_tests/tests/resize.js index 3ce99ad..5a996d2 100644 --- a/auto_tests/tests/resize.js +++ b/auto_tests/tests/resize.js @@ -5,7 +5,7 @@ */ var ResizeTestCase = TestCase("resize"); -ResizeTestCase.data = +var data = "X,Y\n" + "1,100\n" + "2,200\n" + @@ -41,7 +41,7 @@ ResizeTestCase.prototype.testResizeMaintainsMouseOperations = function() { DygraphOps.dispatchMouseUp_Point(g, x2 - 1, y); } - g = new Dygraph(graph, ResizeTestCase.data, {highlightCallback: callback}); + g = new Dygraph(graph, data, {highlightCallback: callback}); strum(g, 300, 640); assertEquals(6, callbackCount); @@ -62,7 +62,7 @@ ResizeTestCase.prototype.testHiddenDivWithSizedGraph = function() { var div = document.getElementById("graph"); div.style.display = 'none'; - var g = new Dygraph(div, ResizeTestCase.data, {width: 400, height: 300}); + var g = new Dygraph(div, data, {width: 400, height: 300}); div.style.display = ''; var area = g.getArea(); @@ -85,7 +85,7 @@ ResizeTestCase.prototype.testHiddenDivWithResize = function() { // Setting strokeWidth 3 removes any ambiguitiy from the pixel sampling // request, below. - var g = new Dygraph(div, ResizeTestCase.data, {strokeWidth: 3}); + var g = new Dygraph(div, data, {strokeWidth: 3}); div.style.display = ''; g.resize(); diff --git a/auto_tests/tests/rolling_average.js b/auto_tests/tests/rolling_average.js index 86b3e3c..696a49a 100644 --- a/auto_tests/tests/rolling_average.js +++ b/auto_tests/tests/rolling_average.js @@ -115,7 +115,7 @@ rollingAverageTestCase.prototype.testRollCustomBars = function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - var rolled = this.getRolledData(g, data, 1, 2); + var rolled = getRolledData(g, data, 1, 2); assertEquals([1, 10, [1, 20]], rolled[0]); assertEquals([2, 15, [1, 25]], rolled[1]); assertEquals([3, 25, [1, 35]], rolled[2]); @@ -136,7 +136,7 @@ rollingAverageTestCase.prototype.testRollErrorBars = function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - var rolled = this.getRolledData(g, data, 1, 2); + var rolled = getRolledData(g, data, 1, 2); assertEquals([1, 10, [8, 12]], rolled[0]); // variance = sqrt( pow(error) * rollPeriod) @@ -163,7 +163,7 @@ rollingAverageTestCase.prototype.testRollFractions = function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - var rolled = this.getRolledData(g, data, 1, 2); + var rolled = getRolledData(g, data, 1, 2); assertEquals([1, 10], rolled[0]); assertEquals([2, 15], rolled[1]); assertEquals([3, 25], rolled[2]); @@ -186,7 +186,7 @@ rollingAverageTestCase.prototype.testRollFractionsBars = function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - var rolled = this.getRolledData(g, data, 1, 2); + var rolled = getRolledData(g, data, 1, 2); // precalculated rounded values expected var values = [10, 15, 25, 35]; @@ -216,7 +216,7 @@ rollingAverageTestCase.prototype.testRollFractionsBarsWilson = function() { var graph = document.getElementById("graph"); var g = new Dygraph(graph, data, opts); - var rolled = this.getRolledData(g, data, 1, 2); + var rolled = getRolledData(g, data, 1, 2); //precalculated rounded values expected var values = [10, 15, 25, 35]; @@ -230,7 +230,7 @@ rollingAverageTestCase.prototype.testRollFractionsBarsWilson = function() { } }; -rollingAverageTestCase.prototype.getRolledData = function(g, data, seriesIdx, rollPeriod){ +var getRolledData = function(g, data, seriesIdx, rollPeriod){ var options = g.attributes_; return g.dataHandler_.rollingAverage(g.dataHandler_.extractSeries(data, seriesIdx, options), rollPeriod, options); }; diff --git a/auto_tests/tests/scrolling_div.js b/auto_tests/tests/scrolling_div.js index ceb2a3d..763504c 100644 --- a/auto_tests/tests/scrolling_div.js +++ b/auto_tests/tests/scrolling_div.js @@ -5,6 +5,8 @@ */ var ScrollingDivTestCase = TestCase("scrolling-div"); +var point, g; + ScrollingDivTestCase.prototype.setUp = function() { var LOREM_IPSUM = @@ -35,15 +37,14 @@ var LOREM_IPSUM = var graph = document.getElementById("graph"); - this.point = null; - var self = this; - this.g = new Dygraph(graph, data, + point = null; + g = new Dygraph(graph, data, { labels : ['a', 'b'], drawPoints : true, highlightCircleSize : 6, pointClickCallback : function(evt, point) { - self.point = point; + point = point; } } ); @@ -54,7 +55,7 @@ var LOREM_IPSUM = // scrollbars, it's 0. This is a large enough difference that we need to // consider it when synthesizing clicks. // Adapted from http://davidwalsh.name/detect-scrollbar-width -ScrollingDivTestCase.prototype.detectScrollbarWidth = function() { +var detectScrollbarWidth = function() { // Create the measurement node var scrollDiv = document.createElement("div"); scrollDiv.style.width = "100px"; @@ -90,12 +91,12 @@ ScrollingDivTestCase.prototype.testUnscrolledDiv = function() { screenY: 320 }; - DygraphOps.dispatchCanvasEvent(this.g, DygraphOps.createEvent(clickOn4_40, { type : 'mousemove' })); - DygraphOps.dispatchCanvasEvent(this.g, DygraphOps.createEvent(clickOn4_40, { type : 'mousedown' })); - DygraphOps.dispatchCanvasEvent(this.g, DygraphOps.createEvent(clickOn4_40, { type : 'mouseup' })); + DygraphOps.dispatchCanvasEvent(g, DygraphOps.createEvent(clickOn4_40, { type : 'mousemove' })); + DygraphOps.dispatchCanvasEvent(g, DygraphOps.createEvent(clickOn4_40, { type : 'mousedown' })); + DygraphOps.dispatchCanvasEvent(g, DygraphOps.createEvent(clickOn4_40, { type : 'mouseup' })); - assertEquals(40, this.point.xval); - assertEquals(4, this.point.yval); + assertEquals(40, point.xval); + assertEquals(4, point.yval); }; /** @@ -106,15 +107,15 @@ ScrollingDivTestCase.prototype.testScrolledDiv = function() { var clickOn4_40 = { clientX: 244, - clientY: 30 - this.detectScrollbarWidth(), + clientY: 30 - detectScrollbarWidth(), screenX: 416, screenY: 160 }; - DygraphOps.dispatchCanvasEvent(this.g, DygraphOps.createEvent(clickOn4_40, { type : 'mousemove' })); - DygraphOps.dispatchCanvasEvent(this.g, DygraphOps.createEvent(clickOn4_40, { type : 'mousedown' })); - DygraphOps.dispatchCanvasEvent(this.g, DygraphOps.createEvent(clickOn4_40, { type : 'mouseup' })); + DygraphOps.dispatchCanvasEvent(g, DygraphOps.createEvent(clickOn4_40, { type : 'mousemove' })); + DygraphOps.dispatchCanvasEvent(g, DygraphOps.createEvent(clickOn4_40, { type : 'mousedown' })); + DygraphOps.dispatchCanvasEvent(g, DygraphOps.createEvent(clickOn4_40, { type : 'mouseup' })); - assertEquals(40, this.point.xval); - assertEquals(4, this.point.yval); + assertEquals(40, point.xval); + assertEquals(4, point.yval); }; diff --git a/auto_tests/tests/simple_drawing.js b/auto_tests/tests/simple_drawing.js index 5ffe532..9eb23e6 100644 --- a/auto_tests/tests/simple_drawing.js +++ b/auto_tests/tests/simple_drawing.js @@ -27,16 +27,16 @@ var ZERO_TO_FIFTY = [[ 10, 0 ] , [ 20, 50 ]]; var SimpleDrawingTestCase = TestCase("simple-drawing"); -SimpleDrawingTestCase._origFunc = Dygraph.getContext; +var _origFunc = Dygraph.getContext; SimpleDrawingTestCase.prototype.setUp = function() { document.body.innerHTML = "
"; Dygraph.getContext = function(canvas) { - return new Proxy(SimpleDrawingTestCase._origFunc(canvas)); + return new Proxy(_origFunc(canvas)); } }; SimpleDrawingTestCase.prototype.tearDown = function() { - Dygraph.getContext = SimpleDrawingTestCase._origFunc; + Dygraph.getContext = _origFunc; }; SimpleDrawingTestCase.prototype.testDrawSimpleRangePlusOne = function() { diff --git a/auto_tests/tests/stacked.js b/auto_tests/tests/stacked.js index a041d7d..ef80c2f 100644 --- a/auto_tests/tests/stacked.js +++ b/auto_tests/tests/stacked.js @@ -5,17 +5,17 @@ */ var stackedTestCase = TestCase("stacked"); -stackedTestCase._origGetContext = Dygraph.getContext; +var _origGetContext = Dygraph.getContext; stackedTestCase.prototype.setUp = function() { document.body.innerHTML = "
"; Dygraph.getContext = function(canvas) { - return new Proxy(stackedTestCase._origGetContext(canvas)); + return new Proxy(_origGetContext(canvas)); } }; stackedTestCase.prototype.tearDown = function() { - Dygraph.getContext = stackedTestCase._origGetContext; + Dygraph.getContext = _origGetContext; }; stackedTestCase.prototype.testCorrectColors = function() { diff --git a/auto_tests/tests/step_plot_per_series.js b/auto_tests/tests/step_plot_per_series.js index 9d278a2..f5db2be 100644 --- a/auto_tests/tests/step_plot_per_series.js +++ b/auto_tests/tests/step_plot_per_series.js @@ -14,17 +14,17 @@ StepTestCase.prototype.setUp = function() { document.body.innerHTML = "
"; }; -StepTestCase.origFunc = Dygraph.getContext; +origFunc = Dygraph.getContext; StepTestCase.prototype.setUp = function() { document.body.innerHTML = "
"; Dygraph.getContext = function(canvas) { - return new Proxy(StepTestCase.origFunc(canvas)); + return new Proxy(origFunc(canvas)); }; }; StepTestCase.prototype.tearDown = function() { - Dygraph.getContext = StepTestCase.origFunc; + Dygraph.getContext = origFunc; }; StepTestCase.prototype.testMixedModeStepAndLineFilled = function() { diff --git a/auto_tests/tests/to_dom_coords.js b/auto_tests/tests/to_dom_coords.js index 5bfab1b..557d22c 100644 --- a/auto_tests/tests/to_dom_coords.js +++ b/auto_tests/tests/to_dom_coords.js @@ -6,20 +6,20 @@ var ToDomCoordsTestCase = TestCase("to-dom-coords"); -ToDomCoordsTestCase._origFunc = Dygraph.getContext; +var origFunc = Dygraph.getContext; ToDomCoordsTestCase.prototype.setUp = function() { document.body.innerHTML = "
"; Dygraph.getContext = function(canvas) { - return new Proxy(ToDomCoordsTestCase._origFunc(canvas)); + return new Proxy(origFunc(canvas)); } }; ToDomCoordsTestCase.prototype.tearDown = function() { - Dygraph.getContext = ToDomCoordsTestCase._origFunc; + Dygraph.getContext = origFunc; }; // Checks that toDomCoords and toDataCoords are inverses of one another. -ToDomCoordsTestCase.prototype.checkForInverses = function(g) { +var checkForInverses = function(g) { var x_range = g.xAxisRange(); var y_range = g.yAxisRange(); for (var i = 0; i <= 10; i++) { @@ -30,7 +30,7 @@ ToDomCoordsTestCase.prototype.checkForInverses = function(g) { assertEquals(y, g.toDataYCoord(g.toDomYCoord(y))); } } -} +}; ToDomCoordsTestCase.prototype.testPlainChart = function() { var opts = { @@ -60,7 +60,7 @@ ToDomCoordsTestCase.prototype.testPlainChart = function() { assertEquals([100, 100], g.toDataCoords(400, 0)); assertEquals([100, 0], g.toDataCoords(400, 400)); - this.checkForInverses(g); + checkForInverses(g); // TODO(konigsberg): This doesn't really belong here. Move to its own test. var htx = g.hidden_ctx_; @@ -98,7 +98,7 @@ ToDomCoordsTestCase.prototype.testChartWithAxes = function() { assertEquals([100, 100], g.toDataCoords(500, 0)); assertEquals([100, 0], g.toDataCoords(500, 400)); - this.checkForInverses(g); + checkForInverses(g); } ToDomCoordsTestCase.prototype.testChartWithAxesAndLabels = function() { @@ -137,7 +137,7 @@ ToDomCoordsTestCase.prototype.testChartWithAxesAndLabels = function() { assertEquals([100, 100], g.toDataCoords(500, 25)); assertEquals([100, 0], g.toDataCoords(500, 425)); - this.checkForInverses(g); + checkForInverses(g); } ToDomCoordsTestCase.prototype.testYAxisLabelWidth = function() { @@ -283,4 +283,4 @@ ToDomCoordsTestCase.prototype.testChartLogarithmic_XAxis = function() { assertEqualsDelta(0, g.toPercentXCoord(10), epsilon); assertEqualsDelta(1, g.toPercentXCoord(100), epsilon); assertEqualsDelta(2, g.toPercentXCoord(1000), epsilon); -} \ No newline at end of file +} diff --git a/auto_tests/tests/update_options.js b/auto_tests/tests/update_options.js index faf8f25..557dac8 100644 --- a/auto_tests/tests/update_options.js +++ b/auto_tests/tests/update_options.js @@ -6,12 +6,12 @@ */ var UpdateOptionsTestCase = TestCase("update-options"); -UpdateOptionsTestCase.prototype.opts = { +var opts = { width: 480, height: 320, }; -UpdateOptionsTestCase.prototype.data = "X,Y1,Y2\n" + +var data = "X,Y1,Y2\n" + "2011-01-01,2,3\n" + "2011-02-02,5,3\n" + "2011-03-03,6,1\n" + @@ -29,40 +29,40 @@ UpdateOptionsTestCase.prototype.tearDown = function() { * Tweaks the dygraph so it sets g._testDrawCalled to true when internal method * drawGraph_ is called. Call unWrapDrawGraph when done with this. */ -UpdateOptionsTestCase.prototype.wrapDrawGraph = function(g) { +var wrapDrawGraph = function(g) { g._testDrawCalled = false; g._oldDrawGraph = g.drawGraph_; g.drawGraph_ = function() { g._testDrawCalled = true; g._oldDrawGraph.call(g); } -} +}; /* * See wrapDrawGraph */ -UpdateOptionsTestCase.prototype.unwrapDrawGraph = function(g) { +var unwrapDrawGraph = function(g) { g.drawGraph_ = g._oldDrawGraph; } UpdateOptionsTestCase.prototype.testStrokeAll = function() { var graphDiv = document.getElementById("graph"); - var graph = new Dygraph(graphDiv, this.data, this.opts); + var graph = new Dygraph(graphDiv, data, opts); var updatedOptions = { }; updatedOptions['strokeWidth'] = 3; // These options will allow us to jump to renderGraph_() // drawGraph_() will be skipped. - this.wrapDrawGraph(graph); + wrapDrawGraph(graph); graph.updateOptions(updatedOptions); - this.unwrapDrawGraph(graph); + unwrapDrawGraph(graph); assertFalse(graph._testDrawCalled); }; UpdateOptionsTestCase.prototype.testStrokeSingleSeries = function() { var graphDiv = document.getElementById("graph"); - var graph = new Dygraph(graphDiv, this.data, this.opts); + var graph = new Dygraph(graphDiv, data, opts); var updatedOptions = { }; var optionsForY1 = { }; @@ -71,15 +71,15 @@ UpdateOptionsTestCase.prototype.testStrokeSingleSeries = function() { // These options will allow us to jump to renderGraph_() // drawGraph_() will be skipped. - this.wrapDrawGraph(graph); + wrapDrawGraph(graph); graph.updateOptions(updatedOptions); - this.unwrapDrawGraph(graph); + unwrapDrawGraph(graph); assertFalse(graph._testDrawCalled); }; UpdateOptionsTestCase.prototype.testSingleSeriesRequiresNewPoints = function() { var graphDiv = document.getElementById("graph"); - var graph = new Dygraph(graphDiv, this.data, this.opts); + var graph = new Dygraph(graphDiv, data, opts); var updatedOptions = { series: { Y1: { @@ -93,15 +93,15 @@ UpdateOptionsTestCase.prototype.testSingleSeriesRequiresNewPoints = function() { // These options will not allow us to jump to renderGraph_() // drawGraph_() must be called - this.wrapDrawGraph(graph); + wrapDrawGraph(graph); graph.updateOptions(updatedOptions); - this.unwrapDrawGraph(graph); + unwrapDrawGraph(graph); assertTrue(graph._testDrawCalled); }; UpdateOptionsTestCase.prototype.testWidthChangeNeedsNewPoints = function() { var graphDiv = document.getElementById("graph"); - var graph = new Dygraph(graphDiv, this.data, this.opts); + var graph = new Dygraph(graphDiv, data, opts); var updatedOptions = { }; // This will require new points. @@ -109,9 +109,9 @@ UpdateOptionsTestCase.prototype.testWidthChangeNeedsNewPoints = function() { // These options will not allow us to jump to renderGraph_() // drawGraph_() must be called - this.wrapDrawGraph(graph); + wrapDrawGraph(graph); graph.updateOptions(updatedOptions); - this.unwrapDrawGraph(graph); + unwrapDrawGraph(graph); assertTrue(graph._testDrawCalled); }; @@ -119,14 +119,14 @@ UpdateOptionsTestCase.prototype.testWidthChangeNeedsNewPoints = function() { UpdateOptionsTestCase.prototype.testUpdateLabelsDivDoesntInfiniteLoop = function() { var graphDiv = document.getElementById("graph"); var labelsDiv = document.getElementById("labels"); - var graph = new Dygraph(graphDiv, this.data, this.opts); + var graph = new Dygraph(graphDiv, data, opts); graph.updateOptions({labelsDiv : labelsDiv}); } // Test https://github.com/danvk/dygraphs/issues/247 UpdateOptionsTestCase.prototype.testUpdateColors = function() { var graphDiv = document.getElementById("graph"); - var graph = new Dygraph(graphDiv, this.data, this.opts); + var graph = new Dygraph(graphDiv, data, opts); var defaultColors = ["rgb(0,128,0)", "rgb(0,0,128)"]; assertEquals(["rgb(0,128,0)", "rgb(0,0,128)"], graph.getColors()); @@ -147,7 +147,7 @@ UpdateOptionsTestCase.prototype.testUpdateColors = function() { }); assertEquals(colors2, graph.getColors()); - graph.updateOptions({ colors: null, file: this.data }); + graph.updateOptions({ colors: null, file: data }); assertEquals(defaultColors, graph.getColors()); } @@ -156,7 +156,7 @@ UpdateOptionsTestCase.prototype.testUpdateColors = function() { // legend. UpdateOptionsTestCase.prototype.testUpdateLegendAlways = function() { var graphDiv = document.getElementById("graph"); - var graph = new Dygraph(graphDiv, this.data, this.opts); + var graph = new Dygraph(graphDiv, data, opts); var legend = document.getElementsByClassName("dygraph-legend"); assertEquals(1, legend.length); diff --git a/auto_tests/tests/visibility.js b/auto_tests/tests/visibility.js index 77f2ea6..11c8b7a 100644 --- a/auto_tests/tests/visibility.js +++ b/auto_tests/tests/visibility.js @@ -18,7 +18,7 @@ VisibilityTestCase.prototype.tearDown = function() { * @param {*[]} setVisibilityArgs An array of arguments to be passed directly to setVisibility() * @returns {string} The output of Util.getLegend() called after the visibility is set */ -VisibilityTestCase.prototype.getVisibleSeries = function(startingVisibility, setVisibilityArgs) { +var getVisibleSeries = function(startingVisibility, setVisibilityArgs) { var opts = { width: 480, height: 320, @@ -47,22 +47,22 @@ VisibilityTestCase.prototype.getVisibleSeries = function(startingVisibility, set }; VisibilityTestCase.prototype.testDefaultCases = function() { - assertEquals(' A B C D E', this.getVisibleSeries(true, [[], true])); - assertEquals('', this.getVisibleSeries(false, [[], true])); + assertEquals(' A B C D E', getVisibleSeries(true, [[], true])); + assertEquals('', getVisibleSeries(false, [[], true])); }; VisibilityTestCase.prototype.testSingleSeriesHide = function() { - assertEquals(' A C D E', this.getVisibleSeries(true, [1, false])); + assertEquals(' A C D E', getVisibleSeries(true, [1, false])); }; VisibilityTestCase.prototype.testSingleSeriesShow = function() { - assertEquals(' E', this.getVisibleSeries(false, [4, true])); + assertEquals(' E', getVisibleSeries(false, [4, true])); }; VisibilityTestCase.prototype.testMultiSeriesHide = function() { - assertEquals(' A E', this.getVisibleSeries(true, [[1,2,3], false])); + assertEquals(' A E', getVisibleSeries(true, [[1,2,3], false])); }; VisibilityTestCase.prototype.testMultiSeriesShow = function() { - assertEquals(' B D', this.getVisibleSeries(false, [[1,3], true])); -}; \ No newline at end of file + assertEquals(' B D', getVisibleSeries(false, [[1,3], true])); +}; -- 2.7.4