"latedef": true,
"nonbsp": true,
"undef": true,
+ "sub": true,
"browser": true,
"devel": true,
--- /dev/null
+{
+ "extends": "../.jshintrc",
+
+ "asi": true,
+ "mocha": true,
+ "strict": false,
+
+ "laxbreak": true,
+
+ "globals": {
+ "assert": true,
+ "Dygraph": true,
+ "DygraphOps": true,
+ "Util": true,
+ "CanvasAssertions": true,
+ "PixelSampler": true,
+ "smoothPlotter": true,
+ "$": true,
+ "DygraphCanvasRenderer": true,
+ "DygraphOptions": true
+ }
+}
basePath: '../',
frameworks: ['mocha', 'chai', 'chai-as-promised', 'sinon-chai', 'chai-things', 'dirty-chai'],
files: [
- 'auto_tests/**.js',
+ 'auto_tests/**/*.js',
'dist/dygraph-combined.dev.js',
'src/extras/smooth-plotter.js',
],
}
return s + "}";
};
- fail("Can't find a line drawn between " + p1 +
- " and " + p2 + " with attributes " + toString(predicate));
+ throw "Can't find a line drawn between " + p1 +
+ " and " + p2 + " with attributes " + toString(predicate);
};
/**
* Assert that all elements have a certain style property.
*/
Util.assertStyleOfChildren = function(selector, property, expectedValue) {
- assertTrue(selector.length > 0);
+ assert.isTrue(selector.length > 0);
$.each(selector, function(idx, child) {
- assertEquals(expectedValue, $(child).css(property));
+ assert.isEqual(expectedValue, $(child).css(property));
});
};
this.responseText = data;
};
FakeXMLHttpRequest.restore = function() {
- XMLHttpRequest = originalXMLHttpRequest;
+ window.XMLHttpRequest = originalXMLHttpRequest;
};
FakeXMLHttpRequest.respond = function() {
for (var i = 0; i < requests.length; i++) {
}
FakeXMLHttpRequest.restore();
};
- XMLHttpRequest = FakeXMLHttpRequest;
+ window.XMLHttpRequest = FakeXMLHttpRequest;
return FakeXMLHttpRequest;
};
*
* @author danvk@google.com (Dan Vanderkam)
*/
-var AnnotationsTestCase = TestCase("annotations");
+describe("annotations", function() {
-AnnotationsTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
-};
+});
-AnnotationsTestCase.prototype.tearDown = function() {
-};
+afterEach(function() {
+});
-AnnotationsTestCase.prototype.testAnnotationsDrawn = function() {
+it('testAnnotationsDrawn', function() {
var opts = {
width: 480,
height: 320
}
]);
- assertEquals(2, g.annotations().length);
+ assert.equal(2, g.annotations().length);
var a1 = document.getElementsByClassName('ann1');
- assertEquals(1, a1.length);
+ assert.equal(1, a1.length);
a1 = a1[0];
- assertEquals('A', a1.textContent);
+ assert.equal('A', a1.textContent);
var a2 = document.getElementsByClassName('ann2');
- assertEquals(1, a2.length);
+ assert.equal(1, a2.length);
a2 = a2[0];
- assertEquals('B', a2.textContent);
-};
+ assert.equal('B', a2.textContent);
+});
// Some errors that should be flagged:
// 1. Invalid series name (e.g. 'X' or 'non-existent')
// 2. Passing a string as 'x' instead of a number (e.g. x: '1')
-AnnotationsTestCase.prototype.testAnnotationsDontDisappearOnResize = function() {
+it('testAnnotationsDontDisappearOnResize', function() {
var opts = {
};
var data = "X,Y\n" +
]);
// Check that it displays at all
- assertEquals(1, g.annotations().length);
+ assert.equal(1, g.annotations().length);
var a1 = document.getElementsByClassName('ann1');
- assertEquals(1, a1.length);
+ assert.equal(1, a1.length);
a1 = a1[0];
- assertEquals('A', a1.textContent);
+ assert.equal('A', a1.textContent);
// ... and that resizing doesn't kill it.
g.resize(400, 300);
- assertEquals(1, g.annotations().length);
+ assert.equal(1, g.annotations().length);
var a1 = document.getElementsByClassName('ann1');
- assertEquals(1, a1.length);
+ assert.equal(1, a1.length);
a1 = a1[0];
- assertEquals('A', a1.textContent);
-};
+ assert.equal('A', a1.textContent);
+});
// Verify that annotations outside of the visible x-range are not shown.
-AnnotationsTestCase.prototype.testAnnotationsOutOfRangeX = function() {
+it('testAnnotationsOutOfRangeX', function() {
var opts = {
};
var data = "X,Y\n" +
]);
// Check that it displays at all
- assertEquals(1, g.annotations().length);
+ assert.equal(1, g.annotations().length);
var a1 = document.getElementsByClassName('ann1');
- assertEquals(1, a1.length);
+ assert.equal(1, a1.length);
a1 = a1[0];
- assertEquals('A', a1.textContent);
+ assert.equal('A', a1.textContent);
// ... and that panning right removes the annotation.
g.updateOptions({dateWindow: [2, 6]});
- assertEquals(1, g.annotations().length);
+ assert.equal(1, g.annotations().length);
a1 = document.getElementsByClassName('ann1');
- assertEquals(0, a1.length);
+ assert.equal(0, a1.length);
// ... and that panning left brings it back.
g.updateOptions({dateWindow: [0, 4]});
- assertEquals(1, g.annotations().length);
+ assert.equal(1, g.annotations().length);
a1 = document.getElementsByClassName('ann1');
- assertEquals(1, a1.length);
-};
+ assert.equal(1, a1.length);
+});
// Verify that annotations outside of the visible y-range are not shown.
-AnnotationsTestCase.prototype.testAnnotationsOutOfRangeY = function() {
+it('testAnnotationsOutOfRangeY', function() {
var opts = {
};
var data = "X,Y\n" +
// ... check that panning up removes the annotation.
g.updateOptions({valueRange: [0.5, 2.5]});
- assertEquals(1, g.annotations().length);
- a1 = document.getElementsByClassName('ann1');
- assertEquals(0, a1.length);
+ assert.equal(1, g.annotations().length);
+ var a1 = document.getElementsByClassName('ann1');
+ assert.equal(0, a1.length);
// ... and that panning down brings it back.
g.updateOptions({valueRange: [-1, 1]});
- assertEquals(1, g.annotations().length);
+ assert.equal(1, g.annotations().length);
a1 = document.getElementsByClassName('ann1');
- assertEquals(1, a1.length);
-};
+ assert.equal(1, a1.length);
+});
-AnnotationsTestCase.prototype.testAnnotationsDrawnInDrawCallback = function() {
+it('testAnnotationsDrawnInDrawCallback', function() {
var data = "X,Y\n" +
"0,-1\n" +
"1,0\n" +
}
});
- assertEquals([true, false], calls);
-};
+ assert.deepEqual([true, false], calls);
+});
// Test that annotations on the same point are stacked.
// Regression test for http://code.google.com/p/dygraphs/issues/detail?id=256
-AnnotationsTestCase.prototype.testAnnotationsStacked = function() {
+it('testAnnotationsStacked', function() {
var data = 'X,Y1,Y2\n' +
'0,1,2\n' +
'1,2,3\n';
g.setAnnotations(annotations);
var annEls = document.getElementsByClassName('dygraphDefaultAnnotation');
- assertEquals(2, annEls.length);
+ assert.equal(2, annEls.length);
- assertEquals(annEls[0].offsetLeft, annEls[1].offsetLeft);
+ assert.equal(annEls[0].offsetLeft, annEls[1].offsetLeft);
assert(annEls[1].offsetTop < annEls[0].offsetTop - 10);
-};
+});
// Test the .ready() method, which is most often used with setAnnotations().
-AnnotationsTestCase.prototype.testReady = function() {
+it('testReady', function() {
var data = 'X,Y1,Y2\n' +
'0,1,2\n' +
'1,2,3\n';
var ready_calls = 0;
g.ready(function() { ready_calls++; });
- assertEquals(0, ready_calls);
+ assert.equal(0, ready_calls);
mockXhr.respond();
- assertEquals(1, ready_calls);
+ assert.equal(1, ready_calls);
// Make sure that ready isn't called on redraws.
g.updateOptions({});
- assertEquals(1, ready_calls);
+ assert.equal(1, ready_calls);
// Or data changes.
g.updateOptions({file: data});
- assertEquals(1, ready_calls);
-};
+ assert.equal(1, ready_calls);
+});
+
+});
*
* @author dan@dygraphs.com (Dan Vanderkam)
*/
-var DeprecatedAxisLabelsTestCase = TestCase("axis-labels-deprecated");
+describe("axis-labels-deprecated", function() {
-DeprecatedAxisLabelsTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
-};
+});
-DeprecatedAxisLabelsTestCase.prototype.tearDown = function() {
-};
+afterEach(function() {
+});
-DeprecatedAxisLabelsTestCase.prototype.testDeprecatedDeprecatedXAxisTimeLabelFormatter = function() {
+it('testDeprecatedDeprecatedXAxisTimeLabelFormatter', function() {
var opts = {
width: 480,
height: 320
}
});
- assertEquals(["00:05:00","00:05:12","00:05:24","00:05:36","00:05:48"], Util.getXLabels());
+ assert.deepEqual(["00:05:00","00:05:12","00:05:24","00:05:36","00:05:48"], Util.getXLabels());
// The legend does not use the xAxisLabelFormatter:
g.setSelection(1);
- assertEquals('5.1: Y1: 1', Util.getLegend());
-};
+ assert.equal('5.1: Y1: 1', Util.getLegend());
+});
-DeprecatedAxisLabelsTestCase.prototype.testDeprecatedAxisLabelFormatter = function () {
+it('testDeprecatedAxisLabelFormatter', function() {
var opts = {
width: 480,
height: 320,
axes : {
x : {
axisLabelFormatter: function(x, granularity, opts, dg) {
- assertEquals('number', typeof(x));
- assertEquals('number', typeof(granularity));
- assertEquals('function', typeof(opts));
- assertEquals('[Dygraph graph]', dg.toString());
+ assert.equal('number', typeof(x));
+ assert.equal('number', typeof(granularity));
+ assert.equal('function', typeof(opts));
+ assert.equal('[Dygraph graph]', dg.toString());
return 'x' + x;
}
},
y : {
axisLabelFormatter: function(y, granularity, opts, dg) {
- assertEquals('number', typeof(y));
- assertEquals('number', typeof(granularity));
- assertEquals('function', typeof(opts));
- assertEquals('[Dygraph graph]', dg.toString());
+ assert.equal('number', typeof(y));
+ assert.equal('number', typeof(granularity));
+ assert.equal('function', typeof(opts));
+ assert.equal('[Dygraph graph]', dg.toString());
return 'y' + y;
}
}
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
- assertEquals(['x0','x2','x4','x6','x8'], Util.getXLabels());
- assertEquals(["y0","y5","y10","y15"], Util.getYLabels());
+ assert.deepEqual(['x0','x2','x4','x6','x8'], Util.getXLabels());
+ assert.deepEqual(["y0","y5","y10","y15"], Util.getYLabels());
g.setSelection(2);
- assertEquals("2: y: 4", Util.getLegend());
-};
+ assert.equal("2: y: 4", Util.getLegend());
+});
-DeprecatedAxisLabelsTestCase.prototype.testDeprecatedDateAxisLabelFormatter = function () {
+it('testDeprecatedDateAxisLabelFormatter', function() {
var opts = {
width: 480,
height: 320,
axes : {
x : {
axisLabelFormatter: function(x, granularity, opts, dg) {
- assertTrue(Dygraph.isDateLike(x));
- assertEquals('number', typeof(granularity));
- assertEquals('function', typeof(opts));
- assertEquals('[Dygraph graph]', dg.toString());
+ assert.isTrue(Dygraph.isDateLike(x));
+ assert.equal('number', typeof(granularity));
+ assert.equal('function', typeof(opts));
+ assert.equal('[Dygraph graph]', dg.toString());
return 'x' + Util.formatDate(x);
},
pixelsPerLabel: 60
},
y : {
axisLabelFormatter: function(y, granularity, opts, dg) {
- assertEquals('number', typeof(y));
- assertEquals('number', typeof(granularity));
- assertEquals('function', typeof(opts));
- assertEquals('[Dygraph graph]', dg.toString());
+ assert.equal('number', typeof(y));
+ assert.equal('number', typeof(granularity));
+ assert.equal('function', typeof(opts));
+ assert.equal('[Dygraph graph]', dg.toString());
return 'y' + y;
}
}
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
- assertEquals(["x2011/01/02","x2011/01/04","x2011/01/06","x2011/01/08"], Util.getXLabels());
- assertEquals(["y5","y10","y15"], Util.getYLabels());
+ assert.deepEqual(["x2011/01/02","x2011/01/04","x2011/01/06","x2011/01/08"], Util.getXLabels());
+ assert.deepEqual(["y5","y10","y15"], Util.getYLabels());
g.setSelection(0);
- assertEquals("2011/01/01: y: 2", Util.getLegend());
-};
+ assert.equal("2011/01/01: y: 2", Util.getLegend());
+});
// This test verifies that when a valueFormatter is set (but not an
// axisLabelFormatter), then the valueFormatter is used to format the axis
// labels.
-DeprecatedAxisLabelsTestCase.prototype.testDeprecatedValueFormatter = function () {
+it('testDeprecatedValueFormatter', function() {
var opts = {
width: 480,
height: 320,
axes : {
x : {
valueFormatter: function(x, opts, series_name, dg) {
- assertEquals('number', typeof(x));
- assertEquals('function', typeof(opts));
- assertEquals('string', typeof(series_name));
- assertEquals('[Dygraph graph]', dg.toString());
+ assert.equal('number', typeof(x));
+ assert.equal('function', typeof(opts));
+ assert.equal('string', typeof(series_name));
+ assert.equal('[Dygraph graph]', dg.toString());
return 'x' + x;
}
},
y : {
valueFormatter: function(y, opts, series_name, dg) {
- assertEquals('number', typeof(y));
- assertEquals('function', typeof(opts));
- assertEquals('string', typeof(series_name));
- assertEquals('[Dygraph graph]', dg.toString());
+ assert.equal('number', typeof(y));
+ assert.equal('function', typeof(opts));
+ assert.equal('string', typeof(series_name));
+ assert.equal('[Dygraph graph]', dg.toString());
return 'y' + y;
}
}
var g = new Dygraph(graph, data, opts);
// the valueFormatter options do not affect the ticks.
- assertEquals(['0','2','4','6','8'], Util.getXLabels());
- assertEquals(["0","5","10","15"], Util.getYLabels());
+ assert.deepEqual(['0','2','4','6','8'], Util.getXLabels());
+ assert.deepEqual(["0","5","10","15"], Util.getYLabels());
// they do affect the legend, however.
g.setSelection(2);
- assertEquals("x2: y: y4", Util.getLegend());
-};
+ assert.equal("x2: y: y4", Util.getLegend());
+});
-DeprecatedAxisLabelsTestCase.prototype.testDeprecatedDateValueFormatter = function () {
+it('testDeprecatedDateValueFormatter', function() {
var opts = {
width: 480,
height: 320,
axes : {
x : {
valueFormatter: function(x, opts, series_name, dg) {
- assertEquals('number', typeof(x));
- assertEquals('function', typeof(opts));
- assertEquals('string', typeof(series_name));
- assertEquals('[Dygraph graph]', dg.toString());
+ assert.equal('number', typeof(x));
+ assert.equal('function', typeof(opts));
+ assert.equal('string', typeof(series_name));
+ assert.equal('[Dygraph graph]', dg.toString());
return 'x' + Util.formatDate(x);
},
pixelsPerLabel: 60
},
y : {
valueFormatter: function(y, opts, series_name, dg) {
- assertEquals('number', typeof(y));
- assertEquals('function', typeof(opts));
- assertEquals('string', typeof(series_name));
- assertEquals('[Dygraph graph]', dg.toString());
+ assert.equal('number', typeof(y));
+ assert.equal('function', typeof(opts));
+ assert.equal('string', typeof(series_name));
+ assert.equal('[Dygraph graph]', dg.toString());
return 'y' + y;
}
}
var g = new Dygraph(graph, data, opts);
// valueFormatters do not affect ticks.
- assertEquals(["02 Jan","04 Jan","06 Jan","08 Jan"], Util.getXLabels());
- assertEquals(["5","10","15"], Util.getYLabels());
+ assert.deepEqual(["02 Jan","04 Jan","06 Jan","08 Jan"], Util.getXLabels());
+ assert.deepEqual(["5","10","15"], Util.getYLabels());
// the valueFormatter options also affect the legend.
g.setSelection(2);
- assertEquals('x2011/01/03: y: y6', Util.getLegend());
-};
+ assert.equal('x2011/01/03: y: y6', Util.getLegend());
+});
// This test verifies that when both a valueFormatter and an axisLabelFormatter
// are specified, the axisLabelFormatter takes precedence.
-DeprecatedAxisLabelsTestCase.prototype.testDeprecatedAxisLabelFormatterPrecedence = function () {
+it('testDeprecatedAxisLabelFormatterPrecedence', function() {
var opts = {
width: 480,
height: 320,
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
- assertEquals(['x0','x2','x4','x6','x8'], Util.getXLabels());
- assertEquals(["y0","y5","y10","y15"], Util.getYLabels());
+ assert.deepEqual(['x0','x2','x4','x6','x8'], Util.getXLabels());
+ assert.deepEqual(["y0","y5","y10","y15"], Util.getYLabels());
g.setSelection(9);
- assertEquals("xvf9: y: yvf18", Util.getLegend());
-};
+ assert.equal("xvf9: y: yvf18", Util.getLegend());
+});
// This is the same as the previous test, except that options are added
// one-by-one.
-DeprecatedAxisLabelsTestCase.prototype.testDeprecatedAxisLabelFormatterIncremental = function () {
+it('testDeprecatedAxisLabelFormatterIncremental', function() {
var opts = {
width: 480,
height: 320,
}
});
- assertEquals(["x0","x2","x4","x6","x8"], Util.getXLabels());
- assertEquals(["y0","y5","y10","y15"], Util.getYLabels());
+ assert.deepEqual(["x0","x2","x4","x6","x8"], Util.getXLabels());
+ assert.deepEqual(["y0","y5","y10","y15"], Util.getYLabels());
g.setSelection(9);
- assertEquals("xvf9: y: yvf18", Util.getLegend());
-};
+ assert.equal("xvf9: y: yvf18", Util.getLegend());
+});
+
+});
*
* @author dan@dygraphs.com (Dan Vanderkam)
*/
-var AxisLabelsTestCase = TestCase("axis-labels");
+describe("axis-labels", function() {
-AxisLabelsTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
-};
+});
-AxisLabelsTestCase.prototype.tearDown = function() {
-};
+afterEach(function() {
+});
var simpleData =
"X,Y,Y2\n" +
var kCloseFloat = 1.0e-10;
-AxisLabelsTestCase.prototype.testMinusOneToOne = function() {
+it('testMinusOneToOne', function() {
var opts = {
width: 480,
height: 320
var g = new Dygraph(graph, data, opts);
// TODO(danvk): would ['-1.0','-0.5','0.0','0.5','1.0'] be better?
- assertEquals(['-1','-0.5','0','0.5','1'], Util.getYLabels());
+ assert.deepEqual(['-1','-0.5','0','0.5','1'], Util.getYLabels());
// Go up to 2
data += "4,2\n";
g.updateOptions({file: data});
- assertEquals(['-1','-0.5','0','0.5','1','1.5','2'], Util.getYLabels());
+ assert.deepEqual(['-1','-0.5','0','0.5','1','1.5','2'], Util.getYLabels());
// Now 10
data += "5,10\n";
g.updateOptions({file: data});
- assertEquals(['-2','0','2','4','6','8','10'], Util.getYLabels());
+ assert.deepEqual(['-2','0','2','4','6','8','10'], Util.getYLabels());
// Now 100
data += "6,100\n";
g.updateOptions({file: data});
- assertEquals(['0','20','40','60','80','100'], Util.getYLabels());
+ assert.deepEqual(['0','20','40','60','80','100'], Util.getYLabels());
g.setSelection(0);
- assertEquals('0: Y: -1', Util.getLegend());
-};
+ assert.equal('0: Y: -1', Util.getLegend());
+});
-AxisLabelsTestCase.prototype.testSmallRangeNearZero = function() {
+it('testSmallRangeNearZero', function() {
var opts = {
drawAxesAtZero: true,
width: 480,
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
- assertEqualsDelta([-0.1,-0.05,0,0.05],
+ assert.equalsDelta([-0.1,-0.05,0,0.05],
Util.makeNumbers(Util.getYLabels()), kCloseFloat);
opts.valueRange = [-0.05, 0.05];
g.updateOptions(opts);
- assertEquals([-0.04,-0.02,0,0.02,0.04],
+ assert.deepEqual([-0.04,-0.02,0,0.02,0.04],
Util.makeNumbers(Util.getYLabels()));
opts.valueRange = [-0.01, 0.01];
g.updateOptions(opts);
- assertEquals([-0.01,-0.005,0,0.005],
+ assert.deepEqual([-0.01,-0.005,0,0.005],
Util.makeNumbers(Util.getYLabels()));
g.setSelection(1);
- assertEquals('1: Y: 0', Util.getLegend());
-};
+ assert.equal('1: Y: 0', Util.getLegend());
+});
-AxisLabelsTestCase.prototype.testSmallRangeAwayFromZero = function() {
+it('testSmallRangeAwayFromZero', function() {
var opts = {
width: 480,
height: 320
opts.valueRange = [9.9, 10.1];
var g = new Dygraph(graph, data, opts);
- assertEquals(["9.9","9.92","9.94","9.96","9.98","10","10.02","10.04","10.06","10.08"], Util.getYLabels());
+ assert.deepEqual(["9.9","9.92","9.94","9.96","9.98","10","10.02","10.04","10.06","10.08"], Util.getYLabels());
opts.valueRange = [9.99, 10.01];
g.updateOptions(opts);
// TODO(danvk): this is bad
- assertEquals(["9.99","9.99","9.99","10","10","10","10","10","10.01","10.01"], Util.getYLabels());
+ assert.deepEqual(["9.99","9.99","9.99","10","10","10","10","10","10.01","10.01"], Util.getYLabels());
opts.valueRange = [9.999, 10.001];
g.updateOptions(opts);
// TODO(danvk): this is even worse!
- assertEquals(["10","10","10","10"], Util.getYLabels());
+ assert.deepEqual(["10","10","10","10"], Util.getYLabels());
g.setSelection(1);
- assertEquals('1: Y: 0', Util.getLegend());
-};
+ assert.equal('1: Y: 0', Util.getLegend());
+});
-AxisLabelsTestCase.prototype.testXAxisTimeLabelFormatter = function() {
+it('testXAxisTimeLabelFormatter', function() {
var opts = {
width: 480,
height: 320
}
});
- assertEquals(["00:05:00","00:05:12","00:05:24","00:05:36","00:05:48"], Util.getXLabels());
+ assert.deepEqual(["00:05:00","00:05:12","00:05:24","00:05:36","00:05:48"], Util.getXLabels());
// The legend does not use the axisLabelFormatter:
g.setSelection(1);
- assertEquals('5.1: Y1: 1', Util.getLegend());
-};
+ assert.equal('5.1: Y1: 1', Util.getLegend());
+});
-AxisLabelsTestCase.prototype.testAxisLabelFormatter = function () {
+it('testAxisLabelFormatter', function() {
var opts = {
width: 480,
height: 320,
axes : {
x : {
axisLabelFormatter : function(x, granularity, opts, dg) {
- assertEquals('number', typeof(x));
- assertEquals('number', typeof(granularity));
- assertEquals('function', typeof(opts));
- assertEquals('[Dygraph graph]', dg.toString());
+ assert.equal('number', typeof(x));
+ assert.equal('number', typeof(granularity));
+ assert.equal('function', typeof(opts));
+ assert.equal('[Dygraph graph]', dg.toString());
return 'x' + x;
}
},
y : {
axisLabelFormatter : function(y, granularity, opts, dg) {
- assertEquals('number', typeof(y));
- assertEquals('number', typeof(granularity));
- assertEquals('function', typeof(opts));
- assertEquals('[Dygraph graph]', dg.toString());
+ assert.equal('number', typeof(y));
+ assert.equal('number', typeof(granularity));
+ assert.equal('function', typeof(opts));
+ assert.equal('[Dygraph graph]', dg.toString());
return 'y' + y;
}
}
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
- assertEquals(['x0','x2','x4','x6','x8'], Util.getXLabels());
- assertEquals(["y0","y5","y10","y15"], Util.getYLabels());
+ assert.deepEqual(['x0','x2','x4','x6','x8'], Util.getXLabels());
+ assert.deepEqual(["y0","y5","y10","y15"], Util.getYLabels());
g.setSelection(2);
- assertEquals("2: y: 4", Util.getLegend());
-};
+ assert.equal("2: y: 4", Util.getLegend());
+});
-AxisLabelsTestCase.prototype.testDateAxisLabelFormatter = function () {
+it('testDateAxisLabelFormatter', function() {
var opts = {
width: 480,
height: 320,
x : {
pixelsPerLabel: 60,
axisLabelFormatter : function(x, granularity, opts, dg) {
- assertTrue(Dygraph.isDateLike(x));
- assertEquals('number', typeof(granularity));
- assertEquals('function', typeof(opts));
- assertEquals('[Dygraph graph]', dg.toString());
+ assert.isTrue(Dygraph.isDateLike(x));
+ assert.equal('number', typeof(granularity));
+ assert.equal('function', typeof(opts));
+ assert.equal('[Dygraph graph]', dg.toString());
return 'x' + Util.formatDate(x);
}
},
y : {
axisLabelFormatter : function(y, granularity, opts, dg) {
- assertEquals('number', typeof(y));
- assertEquals('number', typeof(granularity));
- assertEquals('function', typeof(opts));
- assertEquals('[Dygraph graph]', dg.toString());
+ assert.equal('number', typeof(y));
+ assert.equal('number', typeof(granularity));
+ assert.equal('function', typeof(opts));
+ assert.equal('[Dygraph graph]', dg.toString());
return 'y' + y;
}
}
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
- assertEquals(["x2011/01/02","x2011/01/04","x2011/01/06","x2011/01/08"], Util.getXLabels());
- assertEquals(["y5","y10","y15"], Util.getYLabels());
+ assert.deepEqual(["x2011/01/02","x2011/01/04","x2011/01/06","x2011/01/08"], Util.getXLabels());
+ assert.deepEqual(["y5","y10","y15"], Util.getYLabels());
g.setSelection(0);
- assertEquals("2011/01/01: y: 2", Util.getLegend());
-};
+ assert.equal("2011/01/01: y: 2", Util.getLegend());
+});
// This test verifies that when a valueFormatter is set (but not an
// axisLabelFormatter), then the valueFormatter is used to format the axis
// labels.
-AxisLabelsTestCase.prototype.testValueFormatter = function () {
+it('testValueFormatter', function() {
var opts = {
width: 480,
height: 320,
axes: {
x: {
valueFormatter: function(x, opts, series_name, dg, row, col) {
- assertEquals('number', typeof(x));
- assertEquals('function', typeof(opts));
- assertEquals('string', typeof(series_name));
- assertEquals('[Dygraph graph]', dg.toString());
- assertEquals('number', typeof(row));
- assertEquals('number', typeof(col));
- assertEquals(dg, this);
+ assert.equal('number', typeof(x));
+ assert.equal('function', typeof(opts));
+ assert.equal('string', typeof(series_name));
+ assert.equal('[Dygraph graph]', dg.toString());
+ assert.equal('number', typeof(row));
+ assert.equal('number', typeof(col));
+ assert.equal(dg, this);
return 'x' + x;
}
},
y: {
valueFormatter: function(y, opts, series_name, dg, row, col) {
- assertEquals('number', typeof(y));
- assertEquals('function', typeof(opts));
- assertEquals('string', typeof(series_name));
- assertEquals('[Dygraph graph]', dg.toString());
- assertEquals('number', typeof(row));
- assertEquals('number', typeof(col));
- assertEquals(dg, this);
+ assert.equal('number', typeof(y));
+ assert.equal('function', typeof(opts));
+ assert.equal('string', typeof(series_name));
+ assert.equal('[Dygraph graph]', dg.toString());
+ assert.equal('number', typeof(row));
+ assert.equal('number', typeof(col));
+ assert.equal(dg, this);
return 'y' + y;
}
}
var g = new Dygraph(graph, data, opts);
// the valueFormatter options do not affect the ticks.
- assertEquals(['0','2','4','6','8'], Util.getXLabels());
- assertEquals(["0","5","10","15"],
+ assert.deepEqual(['0','2','4','6','8'], Util.getXLabels());
+ assert.deepEqual(["0","5","10","15"],
Util.getYLabels());
// they do affect the legend, however.
g.setSelection(2);
- assertEquals("x2: y: y4", Util.getLegend());
-};
+ assert.equal("x2: y: y4", Util.getLegend());
+});
-AxisLabelsTestCase.prototype.testDateValueFormatter = function () {
+it('testDateValueFormatter', function() {
var opts = {
width: 480,
height: 320,
x : {
pixelsPerLabel: 60,
valueFormatter: function(x, opts, series_name, dg, row, col) {
- assertEquals('number', typeof(x));
- assertEquals('function', typeof(opts));
- assertEquals('string', typeof(series_name));
- assertEquals('[Dygraph graph]', dg.toString());
- assertEquals('number', typeof(row));
- assertEquals('number', typeof(col));
- assertEquals(dg, this);
+ assert.equal('number', typeof(x));
+ assert.equal('function', typeof(opts));
+ assert.equal('string', typeof(series_name));
+ assert.equal('[Dygraph graph]', dg.toString());
+ assert.equal('number', typeof(row));
+ assert.equal('number', typeof(col));
+ assert.equal(dg, this);
return 'x' + Util.formatDate(x);
}
},
y : {
valueFormatter: function(y, opts, series_name, dg, row, col) {
- assertEquals('number', typeof(y));
- assertEquals('function', typeof(opts));
- assertEquals('string', typeof(series_name));
- assertEquals('[Dygraph graph]', dg.toString());
- assertEquals('number', typeof(row));
- assertEquals('number', typeof(col));
- assertEquals(dg, this);
+ assert.equal('number', typeof(y));
+ assert.equal('function', typeof(opts));
+ assert.equal('string', typeof(series_name));
+ assert.equal('[Dygraph graph]', dg.toString());
+ assert.equal('number', typeof(row));
+ assert.equal('number', typeof(col));
+ assert.equal(dg, this);
return 'y' + y;
}
}
var g = new Dygraph(graph, data, opts);
// valueFormatters do not affect ticks.
- assertEquals(["02 Jan","04 Jan","06 Jan","08 Jan"], Util.getXLabels());
- assertEquals(["5","10","15"], Util.getYLabels());
+ assert.deepEqual(["02 Jan","04 Jan","06 Jan","08 Jan"], Util.getXLabels());
+ assert.deepEqual(["5","10","15"], Util.getYLabels());
// the valueFormatter options also affect the legend.
g.setSelection(2);
- assertEquals('x2011/01/03: y: y6', Util.getLegend());
-};
+ assert.equal('x2011/01/03: y: y6', Util.getLegend());
+});
// This test verifies that when both a valueFormatter and an axisLabelFormatter
// are specified, the axisLabelFormatter takes precedence.
-AxisLabelsTestCase.prototype.testAxisLabelFormatterPrecedence = function () {
+it('testAxisLabelFormatterPrecedence', function() {
var opts = {
width: 480,
height: 320,
axes : {
x : {
valueFormatter: function(x) {
- assertEquals('[Dygraph graph]', this.toString());
+ assert.equal('[Dygraph graph]', this.toString());
return 'xvf' + x;
},
axisLabelFormatter: function(x, granularity) {
- assertEquals('[Dygraph graph]', this.toString());
+ assert.equal('[Dygraph graph]', this.toString());
return 'x' + x;
}
},
y : {
valueFormatter: function(y) {
- assertEquals('[Dygraph graph]', this.toString());
+ assert.equal('[Dygraph graph]', this.toString());
return 'yvf' + y;
},
axisLabelFormatter: function(y) {
- assertEquals('[Dygraph graph]', this.toString());
+ assert.equal('[Dygraph graph]', this.toString());
return 'y' + y;
}
}
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
- assertEquals(['x0','x2','x4','x6','x8'], Util.getXLabels());
- assertEquals(["y0","y5","y10","y15"], Util.getYLabels());
+ assert.deepEqual(['x0','x2','x4','x6','x8'], Util.getXLabels());
+ assert.deepEqual(["y0","y5","y10","y15"], Util.getYLabels());
g.setSelection(9);
- assertEquals("xvf9: y: yvf18", Util.getLegend());
-};
+ assert.equal("xvf9: y: yvf18", Util.getLegend());
+});
// This is the same as the previous test, except that options are added
// one-by-one.
-AxisLabelsTestCase.prototype.testAxisLabelFormatterIncremental = function () {
+it('testAxisLabelFormatterIncremental', function() {
var opts = {
width: 480,
height: 320,
}
});
- assertEquals(["x0","x2","x4","x6","x8"], Util.getXLabels());
- assertEquals(["y0","y5","y10","y15"], Util.getYLabels());
+ assert.deepEqual(["x0","x2","x4","x6","x8"], Util.getXLabels());
+ assert.deepEqual(["y0","y5","y10","y15"], Util.getYLabels());
g.setSelection(9);
- assertEquals("xvf9: y: yvf18", Util.getLegend());
-};
+ assert.equal("xvf9: y: yvf18", Util.getLegend());
+});
-AxisLabelsTestCase.prototype.testGlobalFormatters = function() {
+it('testGlobalFormatters', function() {
var opts = {
width: 480,
height: 320,
labels: ['x', 'y'],
valueFormatter: function(x) {
- assertEquals('[Dygraph graph]', this);
+ assert.equal('[Dygraph graph]', this);
return 'vf' + x;
},
axisLabelFormatter: function(x) {
- assertEquals('[Dygraph graph]', this);
+ assert.equal('[Dygraph graph]', this);
return 'alf' + x;
}
};
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
- assertEquals(['alf0','alf2','alf4','alf6','alf8'], Util.getXLabels());
- assertEquals(["alf0","alf5","alf10","alf15"], Util.getYLabels());
+ assert.deepEqual(['alf0','alf2','alf4','alf6','alf8'], Util.getXLabels());
+ assert.deepEqual(["alf0","alf5","alf10","alf15"], Util.getYLabels());
g.setSelection(9);
- assertEquals("vf9: y: vf18", Util.getLegend());
-};
+ assert.equal("vf9: y: vf18", Util.getLegend());
+});
-AxisLabelsTestCase.prototype.testValueFormatterParameters = function() {
+it('testValueFormatterParameters', function() {
var calls = [];
// change any functions in list to 'fn' -- functions can't be asserted.
var killFunctions = function(list) {
var graph = document.getElementById('graph');
var g = new Dygraph(graph, data, opts);
- assertEquals([], calls);
+ assert.deepEqual([], calls);
g.setSelection(0);
- assertEquals([
+ assert.deepEqual([
// num or millis, opts, series, dygraph, row, col
[ 'x', g, 0, 'fn', 'x', g, 0, 0],
[ 'y', g, 1, 'fn', 'y1', g, 0, 1],
calls = [];
g.setSelection(1);
- assertEquals([
+ assert.deepEqual([
[ 'x', g, 1, 'fn', 'x', g, 1, 0],
[ 'y', g, 3, 'fn', 'y1', g, 1, 1],
['y2', g, 4, 'fn', 'y2', g, 1, 2]
], calls);
-};
+});
-AxisLabelsTestCase.prototype.testSeriesOrder = function() {
+it('testSeriesOrder', function() {
var opts = {
width: 480,
height: 320
var g = new Dygraph(graph, data, opts);
g.setSelection(2);
- assertEquals('2: 00: 103 01: 203 10: 303 11: 403', Util.getLegend());
+ assert.equal('2: 00: 103 01: 203 10: 303 11: 403', Util.getLegend());
// Sanity checks for indexFromSetName
- assertEquals(0, g.indexFromSetName("x"));
- assertEquals(1, g.indexFromSetName("00"));
- assertEquals(null, g.indexFromSetName("abcde"));
+ assert.equal(0, g.indexFromSetName("x"));
+ assert.equal(1, g.indexFromSetName("00"));
+ assert.equal(null, g.indexFromSetName("abcde"));
// Verify that we get the label list back in the right order
- assertEquals(["x", "00", "01", "10", "11"], g.getLabels());
-};
+ assert.deepEqual(["x", "00", "01", "10", "11"], g.getLabels());
+});
-AxisLabelsTestCase.prototype.testLabelKMB = function() {
+it('testLabelKMB', function() {
var data = [];
data.push([0,0]);
data.push([1,2000]);
}
);
- assertEquals(["0", "500", "1K", "1.5K", "2K"], Util.getYLabels());
-};
+ assert.deepEqual(["0", "500", "1K", "1.5K", "2K"], Util.getYLabels());
+});
-AxisLabelsTestCase.prototype.testLabelKMG2 = function() {
+it('testLabelKMG2', function() {
var data = [];
data.push([0,0]);
data.push([1,2000]);
}
);
- assertEquals(
+ assert.equal(
["0","256","512","768","1k","1.25k","1.5k","1.75k","2k"],
Util.getYLabels());
-};
+});
// Same as testLabelKMG2 but specifies the option at the
// top of the option dictionary.
-AxisLabelsTestCase.prototype.testLabelKMG2_top = function() {
+it('testLabelKMG2_top', function() {
var data = [];
data.push([0,0]);
data.push([1,2000]);
}
);
- assertEquals(
+ assert.equal(
["0","256","512","768","1k","1.25k","1.5k","1.75k","2k"],
Util.getYLabels());
-};
+});
/**
* Verify that log scale axis range is properly specified.
*/
-AxisLabelsTestCase.prototype.testLogScale = function() {
+it('testLogScale', function() {
var g = new Dygraph("graph", [[0, 5], [1, 1000]], { logscale : true });
var nonEmptyLabels = Util.getYLabels().filter(function(x) { return x.length > 0; });
- assertEquals(["5","10","20","50","100","200","500","1000"], nonEmptyLabels);
+ assert.deepEqual(["5","10","20","50","100","200","500","1000"], nonEmptyLabels);
g.updateOptions({ logscale : false });
- assertEquals(['0','200','400','600','800','1000'], Util.getYLabels());
-}
+ assert.deepEqual(['0','200','400','600','800','1000'], Util.getYLabels());
+});
/**
* Verify that include zero range is properly specified.
*/
-AxisLabelsTestCase.prototype.testIncludeZero = function() {
+it('testIncludeZero', function() {
var g = new Dygraph("graph", [[0, 500], [1, 1000]], { includeZero : true });
- assertEquals(['0','200','400','600','800','1000'], Util.getYLabels());
+ assert.deepEqual(['0','200','400','600','800','1000'], Util.getYLabels());
g.updateOptions({ includeZero : false });
- assertEquals(['500','600','700','800','900','1000'], Util.getYLabels());
-}
+ assert.deepEqual(['500','600','700','800','900','1000'], Util.getYLabels());
+});
-AxisLabelsTestCase.prototype.testAxisLabelFontSize = function() {
+it('testAxisLabelFontSize', function() {
var graph = document.getElementById("graph");
var g = new Dygraph(graph, simpleData, {});
// Be sure we're dealing with a 14-point default.
- assertEquals(14, Dygraph.DEFAULT_ATTRS.axisLabelFontSize);
+ assert.equal(14, Dygraph.DEFAULT_ATTRS.axisLabelFontSize);
var assertFontSize = function(selector, expected) {
Util.assertStyleOfChildren(selector, "font-size", expected);
assertFontSize($(".dygraph-axis-label-x"), "5px");
assertFontSize($(".dygraph-axis-label-y1"), "20px");
assertFontSize($(".dygraph-axis-label-y2"), "12px");
-}
+});
-AxisLabelsTestCase.prototype.testAxisLabelFontSizeNull = function() {
+it('testAxisLabelFontSizeNull', function() {
var graph = document.getElementById("graph");
var g = new Dygraph(graph, simpleData,
{
};
// Be sure we're dealing with a 14-point default.
- assertEquals(14, Dygraph.DEFAULT_ATTRS.axisLabelFontSize);
+ assert.equal(14, Dygraph.DEFAULT_ATTRS.axisLabelFontSize);
assertFontSize($(".dygraph-axis-label-x"), "14px");
assertFontSize($(".dygraph-axis-label-y"), "14px");
-}
+});
-AxisLabelsTestCase.prototype.testAxisLabelColor = function() {
+it('testAxisLabelColor', function() {
var graph = document.getElementById("graph");
var g = new Dygraph(graph, simpleData, {});
// Be sure we're dealing with a black default.
- assertEquals("black", Dygraph.DEFAULT_ATTRS.axisLabelColor);
+ assert.equal("black", Dygraph.DEFAULT_ATTRS.axisLabelColor);
var assertColor = function(selector, expected) {
Util.assertStyleOfChildren(selector, "color", expected);
assertColor($(".dygraph-axis-label-x"), "rgb(0, 0, 255)");
assertColor($(".dygraph-axis-label-y1"), "rgb(0, 128, 0)");
assertColor($(".dygraph-axis-label-y2"), "rgb(255, 255, 0)");
-}
+});
-AxisLabelsTestCase.prototype.testAxisLabelColorNull = function() {
+it('testAxisLabelColorNull', function() {
var graph = document.getElementById("graph");
var g = new Dygraph(graph, simpleData,
{
}
// Be sure we're dealing with a 14-point default.
- assertEquals(14, Dygraph.DEFAULT_ATTRS.axisLabelFontSize);
+ assert.equal(14, Dygraph.DEFAULT_ATTRS.axisLabelFontSize);
assertColor($(".dygraph-axis-label-x"), "rgb(0, 0, 0)");
assertColor($(".dygraph-axis-label-y"), "rgb(0, 0, 0)");
-}
+});
/*
* This test shows that the label formatter overrides labelsKMB for all values.
*/
-AxisLabelsTestCase.prototype.testLabelFormatterOverridesLabelsKMB = function() {
+it('testLabelFormatterOverridesLabelsKMB', function() {
var g = new Dygraph(
document.getElementById("graph"),
"X,a,b\n" +
return v + ":X";
}
});
- assertEquals(["0:X","500:X","1000:X","1500:X","2000:X"], Util.getYLabels());
- assertEquals(["1:X","2:X","3:X"], Util.getXLabels());
-}
+ assert.deepEqual(["0:X","500:X","1000:X","1500:X","2000:X"], Util.getYLabels());
+ assert.deepEqual(["1:X","2:X","3:X"], Util.getXLabels());
+});
/*
* This test shows that you can override labelsKMB on the axis level.
*/
-AxisLabelsTestCase.prototype.testLabelsKMBPerAxis = function() {
+it('testLabelsKMBPerAxis', function() {
var g = new Dygraph(
document.getElementById("graph"),
"x,a,b\n" +
// labelsKMB doesn't apply to the x axis. This value should be different.
// BUG : https://code.google.com/p/dygraphs/issues/detail?id=488
- assertEquals(["1000","2000","3000"], Util.getXLabels());
- assertEquals( ["0","500","1000","1500","2000"], Util.getYLabels(1));
- assertEquals(["0","500","1K","1.5K","2K"], Util.getYLabels(2));
-};
+ assert.deepEqual(["1000","2000","3000"], Util.getXLabels());
+ assert.equal( ["0","500","1000","1500","2000"], Util.getYLabels(1));
+ assert.deepEqual(["0","500","1K","1.5K","2K"], Util.getYLabels(2));
+});
/*
* This test shows that you can override labelsKMG2 on the axis level.
*/
-AxisLabelsTestCase.prototype.testLabelsKMBG2IPerAxis = function() {
+it('testLabelsKMBG2IPerAxis', function() {
var g = new Dygraph(
document.getElementById("graph"),
"x,a,b\n" +
// Plus I can't be sure they're doing the same thing as they're done in different
// bits of code.
// BUG : https://code.google.com/p/dygraphs/issues/detail?id=488
- assertEquals(["1024","2048","3072"], Util.getXLabels());
- assertEquals( ["0","500","1000","1500","2000"], Util.getYLabels(1));
- assertEquals(["0","500","1000","1.46k","1.95k"], Util.getYLabels(2));
-};
+ assert.deepEqual(["1024","2048","3072"], Util.getXLabels());
+ assert.equal( ["0","500","1000","1500","2000"], Util.getYLabels(1));
+ assert.deepEqual(["0","500","1000","1.46k","1.95k"], Util.getYLabels(2));
+});
/**
* This test shows you can override sigFigs on the axis level.
*/
-AxisLabelsTestCase.prototype.testSigFigsPerAxis = function() {
+it('testSigFigsPerAxis', function() {
var g = new Dygraph(
document.getElementById("graph"),
"x,a,b\n" +
});
// sigFigs doesn't apply to the x axis. This value should be different.
// BUG : https://code.google.com/p/dygraphs/issues/detail?id=488
- assertEquals(["1000","2000","3000"], Util.getXLabels());
- assertEquals(["0.0","5.0e+2","1.0e+3","1.5e+3","2.0e+3"], Util.getYLabels(1));
- assertEquals(["0.00000","500.000","1000.00","1500.00","2000.00"], Util.getYLabels(2));
-}
+ assert.deepEqual(["1000","2000","3000"], Util.getXLabels());
+ assert.deepEqual(["0.0","5.0e+2","1.0e+3","1.5e+3","2.0e+3"], Util.getYLabels(1));
+ assert.deepEqual(["0.00000","500.000","1000.00","1500.00","2000.00"], Util.getYLabels(2));
+});
/**
* This test shows you can override digitsAfterDecimal on the axis level.
*/
-AxisLabelsTestCase.prototype.testDigitsAfterDecimalPerAxis = function() {
+it('testDigitsAfterDecimalPerAxis', function() {
var g = new Dygraph(
document.getElementById("graph"),
"x,a,b\n" +
});
g.updateOptions({ axes: { y: { digitsAfterDecimal: 3 }}});
- assertEquals(["0.001","0.002","0.002","0.003","0.003","0.004","0.004"], Util.getYLabels(1));
+ assert.deepEqual(["0.001","0.002","0.002","0.003","0.003","0.004","0.004"], Util.getYLabels(1));
g.updateOptions({ axes: { y: { digitsAfterDecimal: 4 }}});
- assertEquals(["0.001","0.0015","0.002","0.0025","0.003","0.0035","0.004"], Util.getYLabels(1));
+ assert.deepEqual(["0.001","0.0015","0.002","0.0025","0.003","0.0035","0.004"], Util.getYLabels(1));
g.updateOptions({ axes: { y: { digitsAfterDecimal: 5 }}});
- assertEquals(["0.001","0.0015","0.002","0.0025","0.003","0.0035","0.004"], Util.getYLabels(1));
+ assert.deepEqual(["0.001","0.0015","0.002","0.0025","0.003","0.0035","0.004"], Util.getYLabels(1));
g.updateOptions({ axes: { y: { digitsAfterDecimal: null }}});
- assertEquals(["1e-3","2e-3","2e-3","3e-3","3e-3","4e-3","4e-3"], Util.getYLabels(1));
+ assert.deepEqual(["1e-3","2e-3","2e-3","3e-3","3e-3","4e-3","4e-3"], Util.getYLabels(1));
g.updateOptions({ axes: { y2: { digitsAfterDecimal: 3 }}});
- assertEquals(["0.005","0.006","0.006","0.007","0.007","0.008","0.008"], Util.getYLabels(2));
+ assert.deepEqual(["0.005","0.006","0.006","0.007","0.007","0.008","0.008"], Util.getYLabels(2));
g.updateOptions({ axes: { y2: { digitsAfterDecimal: 4 }}});
- assertEquals(["0.005","0.0055","0.006","0.0065","0.007","0.0075","0.008"], Util.getYLabels(2));
+ assert.deepEqual(["0.005","0.0055","0.006","0.0065","0.007","0.0075","0.008"], Util.getYLabels(2));
g.updateOptions({ axes: { y2: { digitsAfterDecimal: 5 }}});
- assertEquals(["0.005","0.0055","0.006","0.0065","0.007","0.0075","0.008"], Util.getYLabels(2));
+ assert.deepEqual(["0.005","0.0055","0.006","0.0065","0.007","0.0075","0.008"], Util.getYLabels(2));
g.updateOptions({ axes: { y2: { digitsAfterDecimal: null }}});
- assertEquals(["5e-3","6e-3","6e-3","7e-3","7e-3","7e-3","8e-3"], Util.getYLabels(2));
+ assert.deepEqual(["5e-3","6e-3","6e-3","7e-3","7e-3","7e-3","8e-3"], Util.getYLabels(2));
// digitsAfterDecimal is ignored for the x-axis.
// BUG : https://code.google.com/p/dygraphs/issues/detail?id=488
g.updateOptions({ axes: { x: { digitsAfterDecimal: 3 }}});
- assertEquals(["0.006","0.007","0.008"], Util.getXLabels());
+ assert.deepEqual(["0.006","0.007","0.008"], Util.getXLabels());
g.updateOptions({ axes: { x: { digitsAfterDecimal: 4 }}});
- assertEquals(["0.006","0.007","0.008"], Util.getXLabels());
+ assert.deepEqual(["0.006","0.007","0.008"], Util.getXLabels());
g.updateOptions({ axes: { x: { digitsAfterDecimal: 5 }}});
- assertEquals(["0.006","0.007","0.008"], Util.getXLabels());
+ assert.deepEqual(["0.006","0.007","0.008"], Util.getXLabels());
g.updateOptions({ axes: { x: { digitsAfterDecimal: null }}});
- assertEquals(["0.006","0.007","0.008"], Util.getXLabels());
-}
+ assert.deepEqual(["0.006","0.007","0.008"], Util.getXLabels());
+});
/**
* This test shows you can override digitsAfterDecimal on the axis level.
*/
-AxisLabelsTestCase.prototype.testMaxNumberWidthPerAxis = function() {
+it('testMaxNumberWidthPerAxis', function() {
var g = new Dygraph(
document.getElementById("graph"),
"x,a,b\n" +
});
g.updateOptions({ axes: { y: { maxNumberWidth: 4 }}});
- assertEquals(["1.26e+4","1.26e+4","1.26e+4","1.26e+4","1.26e+4","1.26e+4","1.26e+4"] , Util.getYLabels(1));
+ assert.deepEqual(["1.26e+4","1.26e+4","1.26e+4","1.26e+4","1.26e+4","1.26e+4","1.26e+4"] , Util.getYLabels(1));
g.updateOptions({ axes: { y: { maxNumberWidth: 5 }}});
- assertEquals(["12601","12601.5","12602","12602.5","12603","12603.5","12604"] , Util.getYLabels(1));
+ assert.deepEqual(["12601","12601.5","12602","12602.5","12603","12603.5","12604"] , Util.getYLabels(1));
g.updateOptions({ axes: { y: { maxNumberWidth: null }}});
- assertEquals(["1.26e+4","1.26e+4","1.26e+4","1.26e+4","1.26e+4","1.26e+4","1.26e+4"] , Util.getYLabels(1));
+ assert.deepEqual(["1.26e+4","1.26e+4","1.26e+4","1.26e+4","1.26e+4","1.26e+4","1.26e+4"] , Util.getYLabels(1));
g.updateOptions({ axes: { y2: { maxNumberWidth: 4 }}});
- assertEquals(["1.28e+4","1.28e+4","1.28e+4","1.28e+4","1.28e+4","1.28e+4","1.28e+4"], Util.getYLabels(2));
+ assert.deepEqual(["1.28e+4","1.28e+4","1.28e+4","1.28e+4","1.28e+4","1.28e+4","1.28e+4"], Util.getYLabels(2));
g.updateOptions({ axes: { y2: { maxNumberWidth: 5 }}});
- assertEquals(["12801","12801.5","12802","12802.5","12803","12803.5","12804"], Util.getYLabels(2));
+ assert.deepEqual(["12801","12801.5","12802","12802.5","12803","12803.5","12804"], Util.getYLabels(2));
g.updateOptions({ axes: { y2: { maxNumberWidth: null }}});
- assertEquals(["1.28e+4","1.28e+4","1.28e+4","1.28e+4","1.28e+4","1.28e+4","1.28e+4"], Util.getYLabels(2));
+ assert.deepEqual(["1.28e+4","1.28e+4","1.28e+4","1.28e+4","1.28e+4","1.28e+4","1.28e+4"], Util.getYLabels(2));
// maxNumberWidth is ignored for the x-axis.
// BUG : https://code.google.com/p/dygraphs/issues/detail?id=488
g.updateOptions({ axes: { x: { maxNumberWidth: 4 }}});
- assertEquals(["12401","12402","12403"], Util.getXLabels());
+ assert.deepEqual(["12401","12402","12403"], Util.getXLabels());
g.updateOptions({ axes: { x: { maxNumberWidth: 5 }}});
- assertEquals(["12401","12402","12403"], Util.getXLabels());
+ assert.deepEqual(["12401","12402","12403"], Util.getXLabels());
g.updateOptions({ axes: { x: { maxNumberWidth: null }}});
- assertEquals(["12401","12402","12403"], Util.getXLabels());
-}
+ assert.deepEqual(["12401","12402","12403"], Util.getXLabels());
+});
/*
// Regression test for http://code.google.com/p/dygraphs/issues/detail?id=147
// Checks that axis labels stay sane across a DST change.
-AxisLabelsTestCase.prototype.testLabelsCrossDstChange = function() {
+it('testLabelsCrossDstChange', function() {
// (From tests/daylight-savings.html)
var g = new Dygraph(
document.getElementById("graph"),
var xLabels = Util.getXLabels();
for (var i = 0; i < xLabels.length; i++) {
- assertTrue(okLabels[xLabels[i]]);
+ assert.isTrue(okLabels[xLabels[i]]);
}
// This range had issues of its own on tests/daylight-savings.html.
});
xLabels = Util.getXLabels();
for (var i = 0; i < xLabels.length; i++) {
- assertTrue(okLabels[xLabels[i]]);
+ assert.isTrue(okLabels[xLabels[i]]);
}
-};
+});
// Tests data which crosses a "fall back" at a high enough frequency that you
// can see both 1:00 A.M.s.
-AxisLabelsTestCase.prototype.testLabelsCrossDstChangeHighFreq = function() {
+it('testLabelsCrossDstChangeHighFreq', function() {
// Generate data which crosses the EST/EDT boundary.
var dst_data = [];
var base_ms = 1383454200000;
{ width: 1024, labels: ['Date', 'Value'] }
);
- assertEquals([
+ assert.deepEqual([
'00:50', '00:55',
'01:00', '01:05', '01:10', '01:15', '01:20', '01:25',
'01:30', '01:35', '01:40', '01:45', '01:50', '01:55',
g.updateOptions({
dateWindow: [1383454200000 + 15*60*1000, g.xAxisExtremes()[1]]}
);
- assertEquals([
+ assert.deepEqual([
'01:05', '01:10', '01:15', '01:20', '01:25',
'01:30', '01:35', '01:40', '01:45', '01:50', '01:55',
'01:00', '01:05' // 1 AM number two!
], Util.getXLabels());
-};
+});
// Tests data which crosses a "spring forward" at a low frequency.
// Regression test for http://code.google.com/p/dygraphs/issues/detail?id=433
-AxisLabelsTestCase.prototype.testLabelsCrossSpringForward = function() {
+it('testLabelsCrossSpringForward', function() {
var g = new Dygraph(
document.getElementById("graph"),
"Date/Time,Purchases\n" +
var xLabels = Util.getXLabels();
for (var i = 0; i < xLabels.length; i++) {
- assertTrue(okLabels[xLabels[i]]);
+ assert.isTrue(okLabels[xLabels[i]]);
}
-};
+});
-AxisLabelsTestCase.prototype.testLabelsCrossSpringForwardHighFreq = function() {
+it('testLabelsCrossSpringForwardHighFreq', function() {
var base_ms_spring = 1299999000000;
var dst_data_spring = [];
for (var x = base_ms_spring; x < base_ms_spring + 1000 * 60 * 80; x += 1000) {
{ width: 1024, labels: ['Date', 'Value'] }
);
- assertEquals([
+ assert.deepEqual([
'01:50', '01:55',
'03:00', '03:05', '03:10', '03:15', '03:20', '03:25',
'03:30', '03:35', '03:40', '03:45', '03:50', '03:55',
'04:00', '04:05'
], Util.getXLabels());
-};
+});
*/
+
+});
* @author uemit.seren@gmail.com (Ãœmit Seren)
*/
-var CallbackTestCase = TestCase("callback");
+describe("callback", function() {
var xhr, styleSheet;
-CallbackTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div><div id='selection'></div>";
xhr = XMLHttpRequest;
styleSheet = document.createElement("style");
styleSheet.type = "text/css";
document.getElementsByTagName("head")[0].appendChild(styleSheet);
-};
+});
-CallbackTestCase.prototype.tearDown = function() {
- XMLHttpRequest = xhr;
-};
+afterEach(function() {
+ window.XMLHttpRequest = xhr;
+});
-var data = "X,a\,b,c\n" +
+var data = "X,a,b,c\n" +
"10,-1,1,2\n" +
"11,0,3,1\n" +
"12,1,4,2\n" +
* is properly called when the first series is hidden (setVisibility = false)
*
*/
-CallbackTestCase.prototype.testHighlightCallbackIsCalled = function() {
+it('testHighlightCallbackIsCalled', function() {
var h_row;
var h_pts;
var highlightCallback = function(e, x, pts, row) {
- assertEquals(g, this);
+ assert.equal(g, this);
h_row = row;
h_pts = pts;
};
DygraphOps.dispatchMouseMove(g, 13, 10);
//check correct row is returned
- assertEquals(3, h_row);
+ assert.equal(3, h_row);
//check there are only two points (because first series is hidden)
- assertEquals(2, h_pts.length);
-};
+ assert.equal(2, h_pts.length);
+});
/**
* Test that drawPointCallback isn't called when drawPoints is false
*/
-CallbackTestCase.prototype.testDrawPointCallback_disabled = function() {
+it('testDrawPointCallback_disabled', function() {
var called = false;
var callback = function() {
- assertEquals(g, this);
+ assert.equal(g, this);
called = true;
};
drawPointCallback: callback,
});
- assertFalse(called);
-};
+ assert.isFalse(called);
+});
/**
* Test that drawPointCallback is called when drawPoints is true
*/
-CallbackTestCase.prototype.testDrawPointCallback_enabled = function() {
+it('testDrawPointCallback_enabled', function() {
var called = false;
var callbackThis = null;
drawPointCallback: callback
});
- assertTrue(called);
- assertEquals(g, callbackThis);
-};
+ assert.isTrue(called);
+ assert.equal(g, callbackThis);
+});
/**
* Test that drawPointCallback is called when drawPoints is true
*/
-CallbackTestCase.prototype.testDrawPointCallback_pointSize = function() {
+it('testDrawPointCallback_pointSize', function() {
var pointSize = 0;
var count = 0;
var callback = function(g, seriesName, canvasContext, cx, cy, color, pointSizeParam) {
- assertEquals(g, this);
+ assert.equal(g, this);
pointSize = pointSizeParam;
count++;
};
drawPointCallback: callback
});
- assertEquals(1.5, pointSize);
- assertEquals(12, count); // one call per data point.
+ assert.equal(1.5, pointSize);
+ assert.equal(12, count); // one call per data point.
var g = new Dygraph(graph, data, {
drawPoints: true,
pointSize: 8
});
- assertEquals(8, pointSize);
-};
+ assert.equal(8, pointSize);
+});
/**
* Test that drawPointCallback is called for isolated points when
* drawPoints is false, and also for gap points if that's enabled.
*/
-CallbackTestCase.prototype.testDrawPointCallback_isolated = function() {
+it('testDrawPointCallback_isolated', function() {
var xvalues = [];
var g;
var callback = function(g, seriesName, canvasContext, cx, cy, color, pointSizeParam) {
- assertEquals(g, this);
+ assert.equal(g, this);
var dx = g.toDataXCoord(cx);
xvalues.push(dx);
Dygraph.Circles.DEFAULT.apply(this, arguments);
// Test that isolated points get drawn
g = new Dygraph(graph, testdata, graphOpts);
- assertEquals(2, xvalues.length);
- assertEquals(13, xvalues[0]);
- assertEquals(15, xvalues[1]);
+ assert.equal(2, xvalues.length);
+ assert.equal(13, xvalues[0]);
+ assert.equal(15, xvalues[1]);
// Test that isolated points + gap points get drawn when
// drawGapEdgePoints is set. This should add one point at the right
xvalues = []; // Reset for new test
graphOpts.drawGapEdgePoints = true;
g = new Dygraph(graph, testdata, graphOpts);
- assertEquals(3, xvalues.length);
- assertEquals(11, xvalues[0]);
- assertEquals(13, xvalues[1]);
- assertEquals(15, xvalues[2]);
-};
+ assert.equal(3, xvalues.length);
+ assert.equal(11, xvalues[0]);
+ assert.equal(13, xvalues[1]);
+ assert.equal(15, xvalues[2]);
+});
/**
* This tests that when the function idxToRow_ returns the proper row and the onHiglightCallback
* is properly called when the first series is hidden (setVisibility = false)
*
*/
-CallbackTestCase.prototype.testDrawHighlightPointCallbackIsCalled = function() {
+it('testDrawHighlightPointCallbackIsCalled', function() {
var called = false;
var drawHighlightPointCallback = function() {
- assertEquals(g, this);
+ assert.equal(g, this);
called = true;
};
drawHighlightPointCallback: drawHighlightPointCallback
});
- assertFalse(called);
+ assert.isFalse(called);
DygraphOps.dispatchMouseMove(g, 13, 10);
- assertTrue(called);
-};
+ assert.isTrue(called);
+});
/**
* Test the closest-series highlighting methods for normal and stacked modes.
});
var highlightCallback = function(e, x, pts, row, set) {
- assertEquals(g, this);
+ assert.equal(g, this);
h_row = row;
h_pts = pts;
h_series = set;
if (isStacked) {
DygraphOps.dispatchMouseMove(g, 11.45, 1.4);
- assertEquals(1, h_row);
- assertEquals('c', h_series);
+ assert.equal(1, h_row);
+ assert.equal('c', h_series);
//now move up in the same row
DygraphOps.dispatchMouseMove(g, 11.45, 1.5);
- assertEquals(1, h_row);
- assertEquals('b', h_series);
+ assert.equal(1, h_row);
+ assert.equal('b', h_series);
//and a bit to the right
DygraphOps.dispatchMouseMove(g, 11.55, 1.5);
- assertEquals(2, h_row);
- assertEquals('c', h_series);
+ assert.equal(2, h_row);
+ assert.equal('c', h_series);
} else {
DygraphOps.dispatchMouseMove(g, 11, 1.5);
- assertEquals(1, h_row);
- assertEquals('c', h_series);
+ assert.equal(1, h_row);
+ assert.equal('c', h_series);
//now move up in the same row
DygraphOps.dispatchMouseMove(g, 11, 2.5);
- assertEquals(1, h_row);
- assertEquals('b', h_series);
+ assert.equal(1, h_row);
+ assert.equal('b', h_series);
}
return g;
/**
* Test basic closest-point highlighting.
*/
-CallbackTestCase.prototype.testClosestPointCallback = function() {
+it('testClosestPointCallback', function() {
runClosestTest(false, 1, 3);
-}
+});
/**
* Test setSelection() with series name
*/
-CallbackTestCase.prototype.testSetSelection = function() {
+it('testSetSelection', function() {
var g = runClosestTest(false, 1, 3);
- assertEquals(1, g.attr_('strokeWidth', 'c'));
+ assert.equal(1, g.attr_('strokeWidth', 'c'));
g.setSelection(false, 'c');
- assertEquals(3, g.attr_('strokeWidth', 'c'));
-}
+ assert.equal(3, g.attr_('strokeWidth', 'c'));
+});
/**
* Test closest-point highlighting for stacked graph
*/
-CallbackTestCase.prototype.testClosestPointStackedCallback = function() {
+it('testClosestPointStackedCallback', function() {
runClosestTest(true, 1, 3);
-}
+});
/**
* Closest-point highlighting with legend CSS - border around active series.
*/
-CallbackTestCase.prototype.testClosestPointCallbackCss1 = function() {
+it('testClosestPointCallbackCss1', function() {
var css = "div.dygraph-legend > span { display: block; }\n" +
"div.dygraph-legend > span.highlight { border: 1px solid grey; }\n";
styleSheet.innerHTML = css;
runClosestTest(false, 2, 4);
styleSheet.innerHTML = '';
-}
+});
/**
* Closest-point highlighting with legend CSS - show only closest series.
*/
-CallbackTestCase.prototype.testClosestPointCallbackCss2 = function() {
+it('testClosestPointCallbackCss2', function() {
var css = "div.dygraph-legend > span { display: none; }\n" +
"div.dygraph-legend > span.highlight { display: inline; }\n";
styleSheet.innerHTML = css;
runClosestTest(false, 10, 15);
styleSheet.innerHTML = '';
// TODO(klausw): verify that the highlighted line is drawn on top?
-}
+});
/**
* Closest-point highlighting with locked series.
*/
-CallbackTestCase.prototype.testSetSelectionLocking = function() {
+it('testSetSelectionLocking', function() {
var g = runClosestTest(false, 2, 4);
// Default behavior, 'b' is closest
DygraphOps.dispatchMouseMove(g, 11, 4);
- assertEquals('b', g.getHighlightSeries());
+ assert.equal('b', g.getHighlightSeries());
// Now lock selection to 'c'
g.setSelection(false, 'c', true);
DygraphOps.dispatchMouseMove(g, 11, 4);
- assertEquals('c', g.getHighlightSeries());
+ assert.equal('c', g.getHighlightSeries());
// Unlock, should be back to 'b'
g.clearSelection();
DygraphOps.dispatchMouseMove(g, 11, 4);
- assertEquals('b', g.getHighlightSeries());
-}
+ assert.equal('b', g.getHighlightSeries());
+});
/**
* This tests that closest point searches work for data containing NaNs.
* It's intended to catch a regression where a NaN Y value confuses the
* closest-point algorithm, treating it as closer as any previous point.
*/
-CallbackTestCase.prototype.testNaNData = function() {
+it('testNaNData', function() {
var dataNaN = [
[9, -1, NaN, NaN],
[10, -1, 1, 2],
var h_pts;
var highlightCallback = function(e, x, pts, row) {
- assertEquals(g, this);
+ assert.equal(g, this);
h_row = row;
h_pts = pts;
};
DygraphOps.dispatchMouseMove(g, 10.1, 0.9);
//check correct row is returned
- assertEquals(1, h_row);
+ assert.equal(1, h_row);
// Explicitly test closest point algorithms
var dom = g.toDomCoords(10.1, 0.9);
- assertEquals(1, g.findClosestRow(dom[0]));
+ assert.equal(1, g.findClosestRow(dom[0]));
var res = g.findClosestPoint(dom[0], dom[1]);
- assertEquals(1, res.row);
- assertEquals('b', res.seriesName);
+ assert.equal(1, res.row);
+ assert.equal('b', res.seriesName);
res = g.findStackedPoint(dom[0], dom[1]);
- assertEquals(1, res.row);
- assertEquals('c', res.seriesName);
-};
+ assert.equal(1, res.row);
+ assert.equal('c', res.seriesName);
+});
/**
* This tests that stacked point searches work for data containing NaNs.
*/
-CallbackTestCase.prototype.testNaNDataStack = function() {
+it('testNaNDataStack', function() {
var dataNaN = [
[9, -1, NaN, NaN],
[10, -1, 1, 2],
var h_pts;
var highlightCallback = function(e, x, pts, row) {
- assertEquals(g, this);
+ assert.equal(g, this);
h_row = row;
h_pts = pts;
};
DygraphOps.dispatchMouseMove(g, 10.1, 0.9);
//check correct row is returned
- assertEquals(1, h_row);
+ assert.equal(1, h_row);
// Explicitly test stacked point algorithm.
var dom = g.toDomCoords(10.1, 0.9);
var res = g.findStackedPoint(dom[0], dom[1]);
- assertEquals(1, res.row);
- assertEquals('c', res.seriesName);
+ assert.equal(1, res.row);
+ assert.equal('c', res.seriesName);
// All-NaN area at left, should get no points.
dom = g.toDomCoords(9.1, 0.9);
res = g.findStackedPoint(dom[0], dom[1]);
- assertEquals(0, res.row);
- assertEquals(undefined, res.seriesName);
+ assert.equal(0, res.row);
+ assert.equal(undefined, res.seriesName);
// First gap, get 'c' since it's non-NaN.
dom = g.toDomCoords(12.1, 0.9);
res = g.findStackedPoint(dom[0], dom[1]);
- assertEquals(3, res.row);
- assertEquals('c', res.seriesName);
+ assert.equal(3, res.row);
+ assert.equal('c', res.seriesName);
// Second gap, get 'b' since 'c' is NaN.
dom = g.toDomCoords(15.1, 0.9);
res = g.findStackedPoint(dom[0], dom[1]);
- assertEquals(6, res.row);
- assertEquals('b', res.seriesName);
+ assert.equal(6, res.row);
+ assert.equal('b', res.seriesName);
// Isolated points should work, finding series b in this case.
dom = g.toDomCoords(15.9, 3.1);
res = g.findStackedPoint(dom[0], dom[1]);
- assertEquals(7, res.row);
- assertEquals('b', res.seriesName);
-};
+ assert.equal(7, res.row);
+ assert.equal('b', res.seriesName);
+});
-CallbackTestCase.prototype.testGapHighlight = function() {
+it('testGapHighlight', function() {
var dataGap = [
[1, null, 3],
[2, 2, null],
var h_pts;
var highlightCallback = function(e, x, pts, row) {
- assertEquals(g, this);
+ assert.equal(g, this);
h_row = row;
h_pts = pts;
};
DygraphOps.dispatchMouseMove(g, 1.1, 10);
//point from series B
- assertEquals(0, h_row);
- assertEquals(1, h_pts.length);
- assertEquals(3, h_pts[0].yval);
- assertEquals('B', h_pts[0].name);
+ assert.equal(0, h_row);
+ assert.equal(1, h_pts.length);
+ assert.equal(3, h_pts[0].yval);
+ assert.equal('B', h_pts[0].name);
DygraphOps.dispatchMouseMove(g, 6.1, 10);
// A is NaN at x=6
- assertEquals(1, h_pts.length);
+ assert.equal(1, h_pts.length);
assert(isNaN(h_pts[0].yval));
- assertEquals('A', h_pts[0].name);
+ assert.equal('A', h_pts[0].name);
DygraphOps.dispatchMouseMove(g, 8.1, 10);
//point from series A
- assertEquals(6, h_row);
- assertEquals(1, h_pts.length);
- assertEquals(8, h_pts[0].yval);
- assertEquals('A', h_pts[0].name);
-};
+ assert.equal(6, h_row);
+ assert.equal(1, h_pts.length);
+ assert.equal(8, h_pts[0].yval);
+ assert.equal('A', h_pts[0].name);
+});
-CallbackTestCase.prototype.testFailedResponse = function() {
+it('testFailedResponse', function() {
// Fake out the XMLHttpRequest so it doesn't do anything.
XMLHttpRequest = function () {};
XMLHttpRequest.prototype.send = function () {};
var highlightCallback = function(e, x, pts, row) {
- fail("should not reach here");
+ throw "should not reach here";
};
var graph = document.getElementById("graph");
DygraphOps.dispatchMouseOut_Point(g, 800, 800); // This call should not throw an exception.
- assertFalse("exception thrown during mouseout", failed);
-};
+ assert.isFalse("exception thrown during mouseout", failed);
+});
// Regression test for http://code.google.com/p/dygraphs/issues/detail?id=355
-CallbackTestCase.prototype.testHighlightCallbackRow = function() {
+it('testHighlightCallbackRow', function() {
var highlightRow;
var highlightCallback = function(e, x, pts, row) {
- assertEquals(g, this);
+ assert.equal(g, this);
highlightRow = row;
};
// Mouse over each of the points
DygraphOps.dispatchMouseOver_Point(g, 0, 0);
DygraphOps.dispatchMouseMove_Point(g, 0, 0);
- assertEquals(0, highlightRow);
+ assert.equal(0, highlightRow);
DygraphOps.dispatchMouseMove_Point(g, 100, 0);
- assertEquals(1, highlightRow);
+ assert.equal(1, highlightRow);
DygraphOps.dispatchMouseMove_Point(g, 200, 0);
- assertEquals(2, highlightRow);
+ assert.equal(2, highlightRow);
DygraphOps.dispatchMouseMove_Point(g, 300, 0);
- assertEquals(3, highlightRow);
+ assert.equal(3, highlightRow);
DygraphOps.dispatchMouseMove_Point(g, 400, 0);
- assertEquals(4, highlightRow);
+ assert.equal(4, highlightRow);
// Now zoom and verify that the row numbers still refer to rows in the data
// array.
g.updateOptions({dateWindow: [2, 4]});
DygraphOps.dispatchMouseOver_Point(g, 0, 0);
DygraphOps.dispatchMouseMove_Point(g, 0, 0);
- assertEquals(2, highlightRow);
- assertEquals('2: Y: 3 Z: 4', Util.getLegend());
-};
+ assert.equal(2, highlightRow);
+ assert.equal('2: Y: 3 Z: 4', Util.getLegend());
+});
/**
* Test that underlay callback is called even when there are no series,
* and that the y axis ranges are not NaN.
*/
-CallbackTestCase.prototype.testUnderlayCallback_noSeries = function() {
+it('testUnderlayCallback_noSeries', function() {
var called = false;
var yMin, yMax;
var callback = function(canvas, area, g) {
- assertEquals(g, this);
+ assert.equal(g, this);
called = true;
yMin = g.yAxisRange(0)[0];
yMax = g.yAxisRange(0)[1];
underlayCallback: callback
});
- assertTrue(called);
- assertFalse(isNaN(yMin));
- assertFalse(isNaN(yMax));
-};
+ assert.isTrue(called);
+ assert.isFalse(isNaN(yMin));
+ assert.isFalse(isNaN(yMax));
+});
/**
* Test that underlay callback receives the correct y-axis range.
*/
-CallbackTestCase.prototype.testUnderlayCallback_yAxisRange = function() {
+it('testUnderlayCallback_yAxisRange', function() {
var called = false;
var yMin, yMax;
var callback = function(canvas, area, g) {
- assertEquals(g, this);
+ assert.equal(g, this);
yMin = g.yAxisRange(0)[0];
yMax = g.yAxisRange(0)[1];
};
underlayCallback: callback
});
- assertEquals(0, yMin);
- assertEquals(10, yMax);
-};
+ assert.equal(0, yMin);
+ assert.equal(10, yMax);
+});
/**
* Test that drawPointCallback is called for isolated points and correct idx for the point is returned.
*/
-CallbackTestCase.prototype.testDrawPointCallback_idx = function() {
+it('testDrawPointCallback_idx', function() {
var indices = [];
var g;
var callback = function(g, seriesName, canvasContext, cx, cy, color, pointSizeParam,idx) {
- assertEquals(g, this);
+ assert.equal(g, this);
indices.push(idx);
Dygraph.Circles.DEFAULT.apply(this, arguments);
};
// Test that correct idx for isolated points are passed to the callback.
g = new Dygraph(graph, testdata, graphOpts);
- assertEquals(2, indices.length);
- assertEquals([3, 5],indices);
+ assert.equal(2, indices.length);
+ assert.deepEqual([3, 5],indices);
// Test that correct indices for isolated points + gap points are passed to the callback when
// drawGapEdgePoints is set. This should add one point at the right
indices = []; // Reset for new test
graphOpts.drawGapEdgePoints = true;
g = new Dygraph(graph, testdata, graphOpts);
- assertEquals(3, indices.length);
- assertEquals([1, 3, 5],indices);
+ assert.equal(3, indices.length);
+ assert.deepEqual([1, 3, 5],indices);
//Test that correct indices are passed to the callback when zoomed in.
graphOpts.drawPoints = true;
testdata = [[10, 2], [11, 3], [12, 4], [13, 2], [14, 5], [15, 3]];
g = new Dygraph(graph, testdata, graphOpts);
- assertEquals(3, indices.length);
- assertEquals([2, 3, 4],indices);
-};
+ assert.equal(3, indices.length);
+ assert.deepEqual([2, 3, 4],indices);
+});
/**
* Test that the correct idx is returned for the point in the onHiglightCallback.
*/
-CallbackTestCase.prototype.testDrawHighlightPointCallback_idx = function() {
+it('testDrawHighlightPointCallback_idx', function() {
var idxToCheck = null;
var drawHighlightPointCallback = function(g, seriesName, canvasContext, cx, cy, color, pointSizeParam,idx) {
- assertEquals(g, this);
+ assert.equal(g, this);
idxToCheck = idx;
};
var testdata = [[1, 2], [2, 3], [3, NaN], [4, 2], [5, NaN], [6, 3]];
drawHighlightPointCallback : drawHighlightPointCallback
});
- assertNull(idxToCheck);
+ assert.isNull(idxToCheck);
DygraphOps.dispatchMouseMove(g, 3, 0);
// check that NaN point is not highlighted
- assertNull(idxToCheck);
+ assert.isNull(idxToCheck);
DygraphOps.dispatchMouseMove(g, 1, 2);
// check that correct index is returned
- assertEquals(0,idxToCheck);
+ assert.equal(0,idxToCheck);
DygraphOps.dispatchMouseMove(g, 6, 3);
- assertEquals(5,idxToCheck);
-};
+ assert.equal(5,idxToCheck);
+});
+
+});
*
* @author julian.eichstaedt@ch.sauter-bc.com (Fr. Sauter AG)
*/
-var ConnectSeparatedPointsTestCase = TestCase("connect-separated-points");
+describe("connect-separated-points", function() {
-ConnectSeparatedPointsTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
-};
+});
var origFunc = Dygraph.getContext;
-ConnectSeparatedPointsTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
Dygraph.getContext = function(canvas) {
return new Proxy(origFunc(canvas));
};
-};
+});
-ConnectSeparatedPointsTestCase.prototype.tearDown = function() {
+afterEach(function() {
Dygraph.getContext = origFunc;
-};
+});
-ConnectSeparatedPointsTestCase.prototype.testEdgePointsSimple = function() {
+it('testEdgePointsSimple', function() {
var opts = {
width: 480,
height: 320,
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
- htx = g.hidden_ctx_;
+ var htx = g.hidden_ctx_;
var attrs = {};
// Check if both points are connected at the right edge of the canvas and if the option "connectSeparatedPoints" works properly
// even if the point is outside the visible range and only one series has a valid value for this point.
CanvasAssertions.assertLineDrawn(htx, xy1, xy2, attrs);
-};
+});
-ConnectSeparatedPointsTestCase.prototype.testEdgePointsCustomBars = function() {
+it('testEdgePointsCustomBars', function() {
var opts = {
width: 480,
height: 320,
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
- htx = g.hidden_ctx_;
+ var htx = g.hidden_ctx_;
var attrs = {};
// Check if both points are connected at the right edge of the canvas and if the option "connectSeparatedPoints" works properly
// even if the point is outside the visible range and only one series has a valid value for this point.
CanvasAssertions.assertLineDrawn(htx, xy1, xy2, attrs);
-};
+});
-ConnectSeparatedPointsTestCase.prototype.testEdgePointsErrorBars = function() {
+it('testEdgePointsErrorBars', function() {
var opts = {
width: 480,
height: 320,
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
- htx = g.hidden_ctx_;
+ var htx = g.hidden_ctx_;
var attrs = {};
// Check if both points are connected at the right edge of the canvas and if the option "connectSeparatedPoints" works properly
// even if the point is outside the visible range and only one series has a valid value for this point.
CanvasAssertions.assertLineDrawn(htx, xy1, xy2, attrs);
-};
+});
-ConnectSeparatedPointsTestCase.prototype.testConnectSeparatedPointsPerSeries = function() {
+it('testConnectSeparatedPointsPerSeries', function() {
var assertExpectedLinesDrawnPerSeries = function(htx, expectedSeries1, expectedSeries2, expectedSeries3) {
var expected = [expectedSeries1, expectedSeries2, expectedSeries3];
var actual = [
CanvasAssertions.numLinesDrawn(htx, "#ff0000"),
CanvasAssertions.numLinesDrawn(htx, "#00ff00"),
CanvasAssertions.numLinesDrawn(htx, "#0000ff")];
- assertEquals(expected, actual);
+ assert.equal(expected, actual);
}
var g = new Dygraph(document.getElementById("graph"),
colors: ["#ff0000", "#00ff00", "#0000ff"]
});
- htx = g.hidden_ctx_;
+ var htx = g.hidden_ctx_;
assertExpectedLinesDrawnPerSeries(htx, 4, 1, 2);
Proxy.reset(htx);
}
});
assertExpectedLinesDrawnPerSeries(htx, 4, 3, 3);
-}
+});
-ConnectSeparatedPointsTestCase.prototype.testNaNErrorBars = function() {
+it('testNaNErrorBars', function() {
var data = [
[0,[1,2,3]],
[1,[2,3,4]],
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
- htx = g.hidden_ctx_;
+ var htx = g.hidden_ctx_;
var attrs = {};
// No line across the NaN gap, and a single line (not two)
// across the null gap.
- assertEquals(8, CanvasAssertions.numLinesDrawn(htx, '#ff0000'));
-};
+ assert.equal(8, CanvasAssertions.numLinesDrawn(htx, '#ff0000'));
+});
+
+});
* @fileoverview Regression test based on some strange customBars data.
* @author danvk@google.com (Dan Vanderkam)
*/
-var CssTestCase = TestCase("css");
+describe("css", function() {
var data = "X,Y,Z\n1,2,3\n4,5,6\n";
var styleSheet;
-CssTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
styleSheet = document.createElement("style");
styleSheet.type = "text/css";
document.getElementsByTagName("head")[0].appendChild(styleSheet);
-};
+});
-CssTestCase.prototype.tearDown = function() {
-};
+afterEach(function() {
+});
// Verifies that an unstyled, unsized dygraph gets a default size.
-CssTestCase.prototype.testDefaultSize = function() {
+it('testDefaultSize', function() {
var opts = {
};
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
- assertEquals(480, graph.offsetWidth);
- assertEquals(320, graph.offsetHeight);
- assertEquals({width: 480, height: 320}, g.size());
-};
+ assert.equal(480, graph.offsetWidth);
+ assert.equal(320, graph.offsetHeight);
+ assert.deepEqual({width: 480, height: 320}, g.size());
+});
// Verifies that the width/height parameters work.
-CssTestCase.prototype.testExplicitParamSize = function() {
+it('testExplicitParamSize', function() {
var opts = {
width: 640,
height: 480
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
- assertEquals(640, graph.offsetWidth);
- assertEquals(480, graph.offsetHeight);
- assertEquals({width: 640, height: 480}, g.size());
-};
+ assert.equal(640, graph.offsetWidth);
+ assert.equal(480, graph.offsetHeight);
+ assert.deepEqual({width: 640, height: 480}, g.size());
+});
// Verifies that setting a style on the div works.
-CssTestCase.prototype.testExplicitStyleSize = function() {
+it('testExplicitStyleSize', function() {
var opts = {
};
var graph = document.getElementById("graph");
graph.style.height = '400px';
var g = new Dygraph(graph, data, opts);
- assertEquals(600, graph.offsetWidth);
- assertEquals(400, graph.offsetHeight);
- assertEquals({width: 600, height: 400}, g.size());
-};
+ assert.equal(600, graph.offsetWidth);
+ assert.equal(400, graph.offsetHeight);
+ assert.deepEqual({width: 600, height: 400}, g.size());
+});
// Verifies that CSS pixel styles on the div trump explicit parameters.
-CssTestCase.prototype.testPixelStyleWins = function() {
+it('testPixelStyleWins', function() {
var opts = {
width: 987,
height: 654
graph.style.height = '400px';
var g = new Dygraph(graph, data, opts);
- assertEquals(600, graph.offsetWidth);
- assertEquals(400, graph.offsetHeight);
- assertEquals({width: 600, height: 400}, g.size());
-};
+ assert.equal(600, graph.offsetWidth);
+ assert.equal(400, graph.offsetHeight);
+ assert.deepEqual({width: 600, height: 400}, g.size());
+});
// Verifies that a CSS percentage size works.
-CssTestCase.prototype.testPercentageSize = function() {
+it('testPercentageSize', function() {
document.body.innerHTML =
'<div style="width: 600px; height: 400px;">' +
'<div id="graph"></div></div>';
graph.style.height = '50%';
var g = new Dygraph(graph, data, opts);
- assertEquals(300, graph.offsetWidth);
- assertEquals(200, graph.offsetHeight);
- assertEquals({width: 300, height: 200}, g.size());
-};
+ assert.equal(300, graph.offsetWidth);
+ assert.equal(200, graph.offsetHeight);
+ assert.deepEqual({width: 300, height: 200}, g.size());
+});
// Verifies that a CSS class size works.
-CssTestCase.prototype.testClassPixelSize = function() {
+it('testClassPixelSize', function() {
styleSheet.innerHTML = '.chart { width: 456px; height: 345px; }';
var opts = {
var graph = document.getElementById("graph");
graph.className = "chart";
var g = new Dygraph(graph, data, opts);
- assertEquals(456, graph.offsetWidth);
- assertEquals(345, graph.offsetHeight);
- assertEquals({width: 456, height: 345}, g.size());
-};
+ assert.equal(456, graph.offsetWidth);
+ assert.equal(345, graph.offsetHeight);
+ assert.deepEqual({width: 456, height: 345}, g.size());
+});
// An invisible chart div shouldn't produce an error.
-CssTestCase.prototype.testInvisibleChart = function() {
+it('testInvisibleChart', function() {
document.body.innerHTML =
'<div style="display:none;">' +
'<div id="graph" style="width: 640px; height: 480px;"></div>' +
'</div>';
var graph = document.getElementById("graph");
- g = new Dygraph(graph, data, {});
-};
+ new Dygraph(graph, data, {});
+});
// An invisible chart div shouldn't produce an error.
-CssTestCase.prototype.testInvisibleChartDate = function() {
+it('testInvisibleChartDate', function() {
document.body.innerHTML =
'<div style="display:none;">' +
'<div id="graph" style="width: 640px; height: 480px;"></div>' +
'</div>';
var graph = document.getElementById("graph");
- g = new Dygraph(graph,
+ new Dygraph(graph,
"Date,Y\n" +
"2010/01/01,100\n" +
"2010/02/01,200\n" +
"2010/03/01,300\n" +
"2010/04/01,400\n" +
"2010/05/01,300\n" +
- "2010/06/01,100\n"
- , {});
-};
+ "2010/06/01,100\n",
+ {});
+});
// An invisible chart div that becomes visible.
-CssTestCase.prototype.testInvisibleThenVisibleChart = function() {
+it('testInvisibleThenVisibleChart', function() {
document.body.innerHTML =
'<div id="x" style="display:none;">' +
'<div id="graph" style="width: 640px; height: 480px;"></div>' +
'</div>';
var graph = document.getElementById("graph");
- g = new Dygraph(graph,
+ var g = new Dygraph(graph,
"Date,Y\n" +
"2010/01/01,100\n" +
"2010/02/01,200\n" +
// or visibility so we need to let it know ourselves.
g.resize();
- assertEquals(640, graph.offsetWidth);
- assertEquals(480, graph.offsetHeight);
- assertEquals({width: 640, height: 480}, g.size());
-};
+ assert.equal(640, graph.offsetWidth);
+ assert.equal(480, graph.offsetHeight);
+ assert.deepEqual({width: 640, height: 480}, g.size());
+});
// Verifies that a div resize gets picked up.
/*
this one isn't quite ready yet.
-CssTestCase.prototype.testDivResize = function() {
+it('testDivResize', function() {
var opts = {
};
var graph = document.getElementById("graph");
graph.style.height = '480px';
var g = new Dygraph(graph, data, opts);
- assertEquals(640, graph.offsetWidth);
- assertEquals(480, graph.offsetHeight);
- assertEquals({width: 640, height: 480}, g.size());
+ assert.equal(640, graph.offsetWidth);
+ assert.equal(480, graph.offsetHeight);
+ assert.deepEqual({width: 640, height: 480}, g.size());
graph.style.width = '650px';
graph.style.height = '490px';
- assertEquals(650, graph.offsetWidth);
- assertEquals(490, graph.offsetHeight);
- assertEquals({width: 650, height: 490}, g.size());
-};
+ assert.equal(650, graph.offsetWidth);
+ assert.equal(490, graph.offsetHeight);
+ assert.deepEqual({width: 650, height: 490}, g.size());
+});
*/
+
+});
* @fileoverview Regression test based on some strange customBars data.
* @author danvk@google.com (Dan Vanderkam)
*/
-var CustomBarsTestCase = TestCase("custom-bars");
+describe("custom-bars", function() {
-_origFunc = Dygraph.getContext;
-CustomBarsTestCase.prototype.setUp = function() {
+var _origFunc = Dygraph.getContext;
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
Dygraph.getContext = function(canvas) {
return new Proxy(_origFunc(canvas));
}
-};
+});
-CustomBarsTestCase.prototype.tearDown = function() {
+afterEach(function() {
Dygraph.getContext = _origFunc;
-};
+});
// This test used to reliably produce an infinite loop.
-CustomBarsTestCase.prototype.testCustomBarsNoHang = function() {
+it('testCustomBarsNoHang', function() {
var opts = {
width: 480,
height: 320,
"35,,0;22437620;0\n";
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
-};
+});
// Regression test for http://code.google.com/p/dygraphs/issues/detail?id=201
-CustomBarsTestCase.prototype.testCustomBarsZero = function() {
+it('testCustomBarsZero', function() {
var opts = {
customBars: true
};
var g = new Dygraph(graph, data, opts);
var range = g.yAxisRange();
- assertTrue('y-axis must include 0', range[0] <= 0);
- assertTrue('y-axis must include 5', range[1] >= 5);
-};
+ assert.isTrue('y-axis must include 0', range[0] <= 0);
+ assert.isTrue('y-axis must include 5', range[1] >= 5);
+});
// Regression test for http://code.google.com/p/dygraphs/issues/detail?id=229
-CustomBarsTestCase.prototype.testCustomBarsAtTop = function() {
+it('testCustomBarsAtTop', function() {
var g = new Dygraph(document.getElementById("graph"),
[
[1, [10, 10, 100]],
});
var sampler = new PixelSampler(g);
- assertEquals([0, 255, 0, 38], sampler.colorAtCoordinate(5, 60));
-};
+ assert.deepEqual([0, 255, 0, 38], sampler.colorAtCoordinate(5, 60));
+});
// Tests that custom bars work with log scale.
-CustomBarsTestCase.prototype.testCustomBarsLogScale = function() {
+it('testCustomBarsLogScale', function() {
var g = new Dygraph(document.getElementById("graph"),
[
[1, [10, 10, 100]],
[495, 181.66450704318103],
[247.5, 152.02209814465604]],
{ fillStyle: "#00ff00" });
-};
+});
-CustomBarsTestCase.prototype.testCustomBarsWithNegativeValuesInLogScale =
- function() {
+it('testCustomBarsWithNegativeValuesInLogScale', function() {
var graph = document.getElementById("graph");
var count = 0;
});
// Normally all three points would be drawn.
- assertEquals(3, count);
+ assert.equal(3, count);
count = 0;
// In log scale, the third point shouldn't be shown.
g.updateOptions({ logscale : true });
- assertEquals(2, count);
-};
+ assert.equal(2, count);
+});
+
+});
*
* @author danvdk@gmail.com (Dan Vanderkam)
*/
-var dataApiTestCase = TestCase("data-api");
+describe("data-api", function() {
var opts, graphDiv;
-dataApiTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
opts = {
width: 480,
};
graphDiv = document.getElementById("graph");
-};
+});
-dataApiTestCase.prototype.tearDown = function() {
-};
+afterEach(function() {
+});
-dataApiTestCase.prototype.testBasicAccessors = function() {
+it('testBasicAccessors', function() {
var g = new Dygraph(graphDiv, temperature_data, opts);
- assertEquals(365, g.numRows());
- assertEquals(3, g.numColumns());
+ assert.equal(365, g.numRows());
+ assert.equal(3, g.numColumns());
// 2007-01-01,62,39
- assertEquals(62, g.getValue(0, 1));
- assertEquals(39, g.getValue(0, 2));
+ assert.equal(62, g.getValue(0, 1));
+ assert.equal(39, g.getValue(0, 2));
// 2007-12-31,57,42
- assertEquals(57, g.getValue(364, 1));
- assertEquals(42, g.getValue(364, 2));
-};
+ assert.equal(57, g.getValue(364, 1));
+ assert.equal(42, g.getValue(364, 2));
+});
-dataApiTestCase.prototype.testAccessorsCustomBars = function() {
+it('testAccessorsCustomBars', function() {
var g = new Dygraph(graphDiv, data_temp_high_low, {
customBars: true
});
- assertEquals(1070, g.numRows());
- assertEquals(3, g.numColumns());
+ assert.equal(1070, g.numRows());
+ assert.equal(3, g.numColumns());
// 2007-01-01,46;51;56,43;45;48
- assertEquals([46, 51, 56], g.getValue(0, 1));
- assertEquals([43, 45, 48], g.getValue(0, 2));
+ assert.deepEqual([46, 51, 56], g.getValue(0, 1));
+ assert.deepEqual([43, 45, 48], g.getValue(0, 2));
// 2009-12-05,37;42;47 (i.e. missing second column)
- assertEquals([37, 42, 47], g.getValue(1069, 1));
- assertEquals([null, null, null], g.getValue(1069, 2));
-};
+ assert.deepEqual([37, 42, 47], g.getValue(1069, 1));
+ assert.deepEqual([null, null, null], g.getValue(1069, 2));
+});
// Regression test for #554.
-dataApiTestCase.prototype.testGetRowForX = function() {
+it('testGetRowForX', function() {
var g = new Dygraph(graphDiv, [
"x,y",
"1,2",
"9,10"
].join('\n'), opts);
- assertEquals(null, g.getRowForX(0));
- assertEquals(0, g.getRowForX(1));
- assertEquals(null, g.getRowForX(2));
- assertEquals(1, g.getRowForX(3));
- assertEquals(null, g.getRowForX(4));
- assertEquals(2, g.getRowForX(5));
- assertEquals(null, g.getRowForX(6));
- assertEquals(3, g.getRowForX(7));
- assertEquals(null, g.getRowForX(8));
- assertEquals(4, g.getRowForX(9));
- assertEquals(null, g.getRowForX(10));
-};
+ assert.equal(null, g.getRowForX(0));
+ assert.equal(0, g.getRowForX(1));
+ assert.equal(null, g.getRowForX(2));
+ assert.equal(1, g.getRowForX(3));
+ assert.equal(null, g.getRowForX(4));
+ assert.equal(2, g.getRowForX(5));
+ assert.equal(null, g.getRowForX(6));
+ assert.equal(3, g.getRowForX(7));
+ assert.equal(null, g.getRowForX(8));
+ assert.equal(4, g.getRowForX(9));
+ assert.equal(null, g.getRowForX(10));
+});
// If there are rows with identical x-values, getRowForX promises that it will
// return the first one.
-dataApiTestCase.prototype.testGetRowForXDuplicates = function() {
+it('testGetRowForXDuplicates', function() {
var g = new Dygraph(graphDiv, [
"x,y",
"1,2", // 0
"9,10"
].join('\n'), opts);
- assertEquals(0, g.getRowForX(1));
- assertEquals(null, g.getRowForX(2));
- assertEquals(5, g.getRowForX(9));
-};
+ assert.equal(0, g.getRowForX(1));
+ assert.equal(null, g.getRowForX(2));
+ assert.equal(5, g.getRowForX(9));
+});
+
+});
*
* @author dan@dygraphs.com (Dan Vanderkam)
*/
-var dateFormatsTestCase = TestCase("date-formats");
+describe("date-formats", function() {
-dateFormatsTestCase.prototype.setUp = function() {
-};
+beforeEach(function() {
+});
-dateFormatsTestCase.prototype.tearDown = function() {
-};
+afterEach(function() {
+});
-dateFormatsTestCase.prototype.testISO8601 = function() {
+it('testISO8601', function() {
// Format: YYYY-MM-DDTHH:MM:SS.ddddddZ
// The "Z" indicates UTC, so this test should pass regardless of the time
// zone of the machine on which it is run.
// Firefox <4 does not support this format:
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/parse
if (navigator.userAgent.indexOf("Firefox/3.5") == -1) {
- assertEquals(946816496789, Dygraph.dateParser("2000-01-02T12:34:56.789012Z"));
+ assert.equal(946816496789, Dygraph.dateParser("2000-01-02T12:34:56.789012Z"));
}
-};
+});
-dateFormatsTestCase.prototype.testHyphenatedDate = function() {
+it('testHyphenatedDate', function() {
// Format: YYYY-MM-DD HH:MM
// Midnight February 2, 2000, UTC
zp(d.getDate()) + ' ' +
zp(d.getHours()) + ':' +
zp(d.getMinutes());
- assertEquals(Date.UTC(2000, 1, 2), Dygraph.dateParser(str));
-};
+ assert.equal(Date.UTC(2000, 1, 2), Dygraph.dateParser(str));
+});
+
+});
* @author danvdk@gmail.com (Dan Vanderkam)
*/
-var DateTickerTestCase = TestCase("date-ticker-tests");
+describe("date-ticker-tests", function() {
-DateTickerTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
-};
+});
var createOptionsViewForAxis = function(axis, dict) {
return function (x) {
}
}
-DateTickerTestCase.prototype.testBasicDateTicker = function() {
+it('testBasicDateTicker', function() {
var opts = {labelsUTC: true};
var options = createOptionsViewForAxis('x', opts);
{"v": 631152000000, "label":"1990"},
{"v": 946684800000, "label":"2000"}
];
- assertEquals(expected_ticks, ticks);
+ assert.equal(expected_ticks, ticks);
var start = Date.UTC(1999, 11, 31, 14, 0, 0);
var end = Date.UTC(2000, 0, 1, 12, 0, 0);
{v: Date.UTC(2000, 0, 1, 10, 0, 0), label: '10:00'},
{v: Date.UTC(2000, 0, 1, 12, 0, 0), label: '12:00'}
];
- assertEquals(expected_ticks, ticks);
-};
+ assert.equal(expected_ticks, ticks);
+});
-DateTickerTestCase.prototype.testAllDateTickers = function() {
+it('testAllDateTickers', function() {
var opts = {labelsUTC: true, pixelsPerLabel: 60};
var options = createOptionsViewForAxis('x', opts);
return ticks;
};
- assertEquals([{"v":-1577923200000,"label":"1920"},{"v":-1262304000000,"label":"1930"},{"v":-946771200000,"label":"1940"},{"v":-631152000000,"label":"1950"},{"v":-315619200000,"label":"1960"},{"v":0,"label":"1970"},{"v":315532800000,"label":"1980"},{"v":631152000000,"label":"1990"},{"v":946684800000,"label":"2000"}], ticker(-1797552000000, 1255561200000, 800, options));
- assertEquals([{"v":-5364662400000,"label":"1800"},{"v":-2208988800000,"label":"1900"}], ticker(-6122044800000, 189302400000, 480, options));
- assertEquals([{"v":1041120000000,"label":"29 Dec"},{"v":1041724800000,"label":"05 Jan"},{"v":1042329600000,"label":"12 Jan"},{"v":1042934400000,"label":"19 Jan"},{"v":1043539200000,"label":"26 Jan"},{"v":1044144000000,"label":"02 Feb"},{"v":1044748800000,"label":"09 Feb"},{"v":1045353600000,"label":"16 Feb"}], ticker(1041120000000, 1045353600000, 640, options));
- assertEquals([{"v":1041379200000,"label":"Jan 2003"},{"v":1072915200000,"label":"Jan 2004"},{"v":1104537600000,"label":"Jan 2005"},{"v":1136073600000,"label":"Jan 2006"},{"v":1167609600000,"label":"Jan 2007"},{"v":1199145600000,"label":"Jan 2008"},{"v":1230768000000,"label":"Jan 2009"},{"v":1262304000000,"label":"Jan 2010"},{"v":1293840000000,"label":"Jan 2011"}], ticker(1041120000000, 1307833200000, 800, options));
- assertEquals([{"v":1159660800000,"label":"01 Oct"},{"v":1160265600000,"label":"08 Oct"},{"v":1160870400000,"label":"15 Oct"},{"v":1161475200000,"label":"22 Oct"},{"v":1162080000000,"label":"29 Oct"}], ticker(1159657200000, 1162252800000, 480, options));
- assertEquals([{"v":1159660800000,"label":"01 Oct"},{"v":1160265600000,"label":"08 Oct"},{"v":1160870400000,"label":"15 Oct"},{"v":1161475200000,"label":"22 Oct"},{"v":1162080000000,"label":"29 Oct"}], ticker(1159657200000, 1162252800000, 640, options));
- assertEquals([{"v":1159660800000,"label":"01 Oct"},{"v":1160265600000,"label":"08 Oct"},{"v":1160870400000,"label":"15 Oct"},{"v":1161475200000,"label":"22 Oct"},{"v":1162080000000,"label":"29 Oct"},{"v":1162684800000,"label":"05 Nov"},{"v":1163289600000,"label":"12 Nov"},{"v":1163894400000,"label":"19 Nov"},{"v":1164499200000,"label":"26 Nov"}], ticker(1159657200000, 1164758400000, 1150, options));
- assertEquals([{"v":1159660800000,"label":"Oct 2006"},{"v":1162339200000,"label":"Nov 2006"}], ticker(1159657200000, 1164758400000, 400, options));
- assertEquals([{"v":1159660800000,"label":"01 Oct"},{"v":1160265600000,"label":"08 Oct"},{"v":1160870400000,"label":"15 Oct"},{"v":1161475200000,"label":"22 Oct"},{"v":1162080000000,"label":"29 Oct"},{"v":1162684800000,"label":"05 Nov"},{"v":1163289600000,"label":"12 Nov"},{"v":1163894400000,"label":"19 Nov"},{"v":1164499200000,"label":"26 Nov"}], ticker(1159657200000, 1164758400000, 500, options));
- assertEquals([{"v":1159660800000,"label":"01 Oct"},{"v":1160265600000,"label":"08 Oct"},{"v":1160870400000,"label":"15 Oct"},{"v":1161475200000,"label":"22 Oct"},{"v":1162080000000,"label":"29 Oct"},{"v":1162684800000,"label":"05 Nov"},{"v":1163289600000,"label":"12 Nov"},{"v":1163894400000,"label":"19 Nov"},{"v":1164499200000,"label":"26 Nov"}], ticker(1159657200000, 1164758400000, 600, options));
- assertEquals([{"v":1160265600000,"label":"08 Oct"},{"v":1160870400000,"label":"15 Oct"},{"v":1161475200000,"label":"22 Oct"},{"v":1162080000000,"label":"29 Oct"},{"v":1162684800000,"label":"05 Nov"},{"v":1163289600000,"label":"12 Nov"}], ticker(1160243979962, 1163887694248, 600, options));
+ assert.deepEqual([{"v":-1577923200000,"label":"1920"},{"v":-1262304000000,"label":"1930"},{"v":-946771200000,"label":"1940"},{"v":-631152000000,"label":"1950"},{"v":-315619200000,"label":"1960"},{"v":0,"label":"1970"},{"v":315532800000,"label":"1980"},{"v":631152000000,"label":"1990"},{"v":946684800000,"label":"2000"}], ticker(-1797552000000, 1255561200000, 800, options));
+ assert.deepEqual([{"v":-5364662400000,"label":"1800"},{"v":-2208988800000,"label":"1900"}], ticker(-6122044800000, 189302400000, 480, options));
+ assert.deepEqual([{"v":1041120000000,"label":"29 Dec"},{"v":1041724800000,"label":"05 Jan"},{"v":1042329600000,"label":"12 Jan"},{"v":1042934400000,"label":"19 Jan"},{"v":1043539200000,"label":"26 Jan"},{"v":1044144000000,"label":"02 Feb"},{"v":1044748800000,"label":"09 Feb"},{"v":1045353600000,"label":"16 Feb"}], ticker(1041120000000, 1045353600000, 640, options));
+ assert.deepEqual([{"v":1041379200000,"label":"Jan 2003"},{"v":1072915200000,"label":"Jan 2004"},{"v":1104537600000,"label":"Jan 2005"},{"v":1136073600000,"label":"Jan 2006"},{"v":1167609600000,"label":"Jan 2007"},{"v":1199145600000,"label":"Jan 2008"},{"v":1230768000000,"label":"Jan 2009"},{"v":1262304000000,"label":"Jan 2010"},{"v":1293840000000,"label":"Jan 2011"}], ticker(1041120000000, 1307833200000, 800, options));
+ assert.deepEqual([{"v":1159660800000,"label":"01 Oct"},{"v":1160265600000,"label":"08 Oct"},{"v":1160870400000,"label":"15 Oct"},{"v":1161475200000,"label":"22 Oct"},{"v":1162080000000,"label":"29 Oct"}], ticker(1159657200000, 1162252800000, 480, options));
+ assert.deepEqual([{"v":1159660800000,"label":"01 Oct"},{"v":1160265600000,"label":"08 Oct"},{"v":1160870400000,"label":"15 Oct"},{"v":1161475200000,"label":"22 Oct"},{"v":1162080000000,"label":"29 Oct"}], ticker(1159657200000, 1162252800000, 640, options));
+ assert.deepEqual([{"v":1159660800000,"label":"01 Oct"},{"v":1160265600000,"label":"08 Oct"},{"v":1160870400000,"label":"15 Oct"},{"v":1161475200000,"label":"22 Oct"},{"v":1162080000000,"label":"29 Oct"},{"v":1162684800000,"label":"05 Nov"},{"v":1163289600000,"label":"12 Nov"},{"v":1163894400000,"label":"19 Nov"},{"v":1164499200000,"label":"26 Nov"}], ticker(1159657200000, 1164758400000, 1150, options));
+ assert.deepEqual([{"v":1159660800000,"label":"Oct 2006"},{"v":1162339200000,"label":"Nov 2006"}], ticker(1159657200000, 1164758400000, 400, options));
+ assert.deepEqual([{"v":1159660800000,"label":"01 Oct"},{"v":1160265600000,"label":"08 Oct"},{"v":1160870400000,"label":"15 Oct"},{"v":1161475200000,"label":"22 Oct"},{"v":1162080000000,"label":"29 Oct"},{"v":1162684800000,"label":"05 Nov"},{"v":1163289600000,"label":"12 Nov"},{"v":1163894400000,"label":"19 Nov"},{"v":1164499200000,"label":"26 Nov"}], ticker(1159657200000, 1164758400000, 500, options));
+ assert.deepEqual([{"v":1159660800000,"label":"01 Oct"},{"v":1160265600000,"label":"08 Oct"},{"v":1160870400000,"label":"15 Oct"},{"v":1161475200000,"label":"22 Oct"},{"v":1162080000000,"label":"29 Oct"},{"v":1162684800000,"label":"05 Nov"},{"v":1163289600000,"label":"12 Nov"},{"v":1163894400000,"label":"19 Nov"},{"v":1164499200000,"label":"26 Nov"}], ticker(1159657200000, 1164758400000, 600, options));
+ assert.deepEqual([{"v":1160265600000,"label":"08 Oct"},{"v":1160870400000,"label":"15 Oct"},{"v":1161475200000,"label":"22 Oct"},{"v":1162080000000,"label":"29 Oct"},{"v":1162684800000,"label":"05 Nov"},{"v":1163289600000,"label":"12 Nov"}], ticker(1160243979962, 1163887694248, 600, options));
- assertEquals([{"v":1160611200000,"label":"12 Oct"},{"v":1160784000000,"label":"14 Oct"},{"v":1160956800000,"label":"16 Oct"},{"v":1161129600000,"label":"18 Oct"}], ticker(1160521200000, 1161298800000, 480, options));
- assertEquals([{"v":1161475200000,"label":"22 Oct"},{"v":1161561600000,"label":"23 Oct"},{"v":1161648000000,"label":"24 Oct"},{"v":1161734400000,"label":"25 Oct"},{"v":1161820800000,"label":"26 Oct"},{"v":1161907200000,"label":"27 Oct"},{"v":1161993600000,"label":"28 Oct"}], ticker(1161471164461, 1161994065957, 600, options));
- assertEquals([{"v":1161561600000,"label":"23 Oct"},{"v":1161583200000,"label":"06:00"},{"v":1161604800000,"label":"12:00"},{"v":1161626400000,"label":"18:00"}], ticker(1161557878860, 1161642991675, 600, options));
- assertEquals([{"v":1161756000000,"label":"06:00"},{"v":1161759600000,"label":"07:00"},{"v":1161763200000,"label":"08:00"},{"v":1161766800000,"label":"09:00"},{"v":1161770400000,"label":"10:00"},{"v":1161774000000,"label":"11:00"},{"v":1161777600000,"label":"12:00"}], ticker(1161752537840, 1161777663332, 600, options));
- assertEquals([{"v":1167609600000,"label":"01 Jan"},{"v":1167696000000,"label":"02 Jan"},{"v":1167782400000,"label":"03 Jan"},{"v":1167868800000,"label":"04 Jan"},{"v":1167955200000,"label":"05 Jan"},{"v":1168041600000,"label":"06 Jan"},{"v":1168128000000,"label":"07 Jan"},{"v":1168214400000,"label":"08 Jan"},{"v":1168300800000,"label":"09 Jan"}], ticker(1167609600000, 1168300800000, 480, options));
- assertEquals([{"v":1167609600000,"label":"Jan 2007"}], ticker(1167609600000, 1199059200000, 100, options));
- assertEquals([{"v":1167609600000,"label":"Jan 2007"},{"v":1175385600000,"label":"Apr 2007"},{"v":1183248000000,"label":"Jul 2007"},{"v":1191196800000,"label":"Oct 2007"}], ticker(1167609600000, 1199059200000, 300, options));
- assertEquals([{"v":1167609600000,"label":"Jan 2007"},{"v":1175385600000,"label":"Apr 2007"},{"v":1183248000000,"label":"Jul 2007"},{"v":1191196800000,"label":"Oct 2007"}], ticker(1167609600000, 1199059200000, 480, options));
- assertEquals([{"v":1167609600000,"label":"Jan 2007"},{"v":1175385600000,"label":"Apr 2007"},{"v":1183248000000,"label":"Jul 2007"},{"v":1191196800000,"label":"Oct 2007"}], ticker(1167609600000, 1199059200000, 600, options));
- assertEquals([{"v":1160611200000,"label":"12 Oct"},{"v":1160784000000,"label":"14 Oct"},{"v":1160956800000,"label":"16 Oct"},{"v":1161129600000,"label":"18 Oct"}], ticker(1160521200000, 1161298800000, 480, options));
- assertEquals([{"v":1167609600000,"label":"Jan 2007"},{"v":1170288000000,"label":"Feb 2007"},{"v":1172707200000,"label":"Mar 2007"},{"v":1175385600000,"label":"Apr 2007"},{"v":1177977600000,"label":"May 2007"},{"v":1180656000000,"label":"Jun 2007"},{"v":1183248000000,"label":"Jul 2007"},{"v":1185926400000,"label":"Aug 2007"},{"v":1188604800000,"label":"Sep 2007"},{"v":1191196800000,"label":"Oct 2007"},{"v":1193875200000,"label":"Nov 2007"},{"v":1196467200000,"label":"Dec 2007"}], ticker(1167609600000, 1199059200000, 800, options));
+ assert.deepEqual([{"v":1160611200000,"label":"12 Oct"},{"v":1160784000000,"label":"14 Oct"},{"v":1160956800000,"label":"16 Oct"},{"v":1161129600000,"label":"18 Oct"}], ticker(1160521200000, 1161298800000, 480, options));
+ assert.deepEqual([{"v":1161475200000,"label":"22 Oct"},{"v":1161561600000,"label":"23 Oct"},{"v":1161648000000,"label":"24 Oct"},{"v":1161734400000,"label":"25 Oct"},{"v":1161820800000,"label":"26 Oct"},{"v":1161907200000,"label":"27 Oct"},{"v":1161993600000,"label":"28 Oct"}], ticker(1161471164461, 1161994065957, 600, options));
+ assert.deepEqual([{"v":1161561600000,"label":"23 Oct"},{"v":1161583200000,"label":"06:00"},{"v":1161604800000,"label":"12:00"},{"v":1161626400000,"label":"18:00"}], ticker(1161557878860, 1161642991675, 600, options));
+ assert.deepEqual([{"v":1161756000000,"label":"06:00"},{"v":1161759600000,"label":"07:00"},{"v":1161763200000,"label":"08:00"},{"v":1161766800000,"label":"09:00"},{"v":1161770400000,"label":"10:00"},{"v":1161774000000,"label":"11:00"},{"v":1161777600000,"label":"12:00"}], ticker(1161752537840, 1161777663332, 600, options));
+ assert.deepEqual([{"v":1167609600000,"label":"01 Jan"},{"v":1167696000000,"label":"02 Jan"},{"v":1167782400000,"label":"03 Jan"},{"v":1167868800000,"label":"04 Jan"},{"v":1167955200000,"label":"05 Jan"},{"v":1168041600000,"label":"06 Jan"},{"v":1168128000000,"label":"07 Jan"},{"v":1168214400000,"label":"08 Jan"},{"v":1168300800000,"label":"09 Jan"}], ticker(1167609600000, 1168300800000, 480, options));
+ assert.deepEqual([{"v":1167609600000,"label":"Jan 2007"}], ticker(1167609600000, 1199059200000, 100, options));
+ assert.deepEqual([{"v":1167609600000,"label":"Jan 2007"},{"v":1175385600000,"label":"Apr 2007"},{"v":1183248000000,"label":"Jul 2007"},{"v":1191196800000,"label":"Oct 2007"}], ticker(1167609600000, 1199059200000, 300, options));
+ assert.deepEqual([{"v":1167609600000,"label":"Jan 2007"},{"v":1175385600000,"label":"Apr 2007"},{"v":1183248000000,"label":"Jul 2007"},{"v":1191196800000,"label":"Oct 2007"}], ticker(1167609600000, 1199059200000, 480, options));
+ assert.deepEqual([{"v":1167609600000,"label":"Jan 2007"},{"v":1175385600000,"label":"Apr 2007"},{"v":1183248000000,"label":"Jul 2007"},{"v":1191196800000,"label":"Oct 2007"}], ticker(1167609600000, 1199059200000, 600, options));
+ assert.deepEqual([{"v":1160611200000,"label":"12 Oct"},{"v":1160784000000,"label":"14 Oct"},{"v":1160956800000,"label":"16 Oct"},{"v":1161129600000,"label":"18 Oct"}], ticker(1160521200000, 1161298800000, 480, options));
+ assert.deepEqual([{"v":1167609600000,"label":"Jan 2007"},{"v":1170288000000,"label":"Feb 2007"},{"v":1172707200000,"label":"Mar 2007"},{"v":1175385600000,"label":"Apr 2007"},{"v":1177977600000,"label":"May 2007"},{"v":1180656000000,"label":"Jun 2007"},{"v":1183248000000,"label":"Jul 2007"},{"v":1185926400000,"label":"Aug 2007"},{"v":1188604800000,"label":"Sep 2007"},{"v":1191196800000,"label":"Oct 2007"},{"v":1193875200000,"label":"Nov 2007"},{"v":1196467200000,"label":"Dec 2007"}], ticker(1167609600000, 1199059200000, 800, options));
- assertEquals([{"v":1293840000000,"label":"Jan 2011"},{"v":1296518400000,"label":"Feb 2011"},{"v":1298937600000,"label":"Mar 2011"},{"v":1301616000000,"label":"Apr 2011"},{"v":1304208000000,"label":"May 2011"},{"v":1306886400000,"label":"Jun 2011"},{"v":1309478400000,"label":"Jul 2011"},{"v":1312156800000,"label":"Aug 2011"}], ticker(1293753600000, 1312844400000, 727, options));
- assertEquals([{"v":1201824000000,"label":"01 Feb"},{"v":1201910400000,"label":"02 Feb"},{"v":1201996800000,"label":"03 Feb"},{"v":1202083200000,"label":"04 Feb"},{"v":1202169600000,"label":"05 Feb"},{"v":1202256000000,"label":"06 Feb"}], ticker(1201824000000, 1202256000000, 700, options));
- assertEquals([{"v":1210118400000,"label":"07 May"},{"v":1210140000000,"label":"06:00"},{"v":1210161600000,"label":"12:00"},{"v":1210183200000,"label":"18:00"},{"v":1210204800000,"label":"08 May"},{"v":1210226400000,"label":"06:00"},{"v":1210248000000,"label":"12:00"},{"v":1210269600000,"label":"18:00"},{"v":1210291200000,"label":"09 May"}], ticker(1210114800000, 1210291200000, 480, options));
- assertEquals([{"v":1210118400000,"label":"07 May"},{"v":1210204800000,"label":"08 May"},{"v":1210291200000,"label":"09 May"},{"v":1210377600000,"label":"10 May"},{"v":1210464000000,"label":"11 May"}], ticker(1210114800000, 1210464000000, 480, options));
- assertEquals([{"v":1210118400000,"label":"07 May"},{"v":1210204800000,"label":"08 May"},{"v":1210291200000,"label":"09 May"},{"v":1210377600000,"label":"10 May"},{"v":1210464000000,"label":"11 May"},{"v":1210550400000,"label":"12 May"}], ticker(1210114800000, 1210550400000, 480, options));
- assertEquals([{"v":1214870400000,"label":"01 Jul"},{"v":1214872200000,"label":"00:30"},{"v":1214874000000,"label":"01:00"},{"v":1214875800000,"label":"01:30"}], ticker(1214870400000, 1214877599000, 600, options));
- assertEquals([{"v":1214870400000,"label":"Jul 2008"},{"v":1217548800000,"label":"Aug 2008"},{"v":1220227200000,"label":"Sep 2008"}], ticker(1214866800000, 1222747200000, 600, options));
- assertEquals([{"v":1215820800000,"label":"12 Jul"},{"v":1215842400000,"label":"06:00"},{"v":1215864000000,"label":"12:00"},{"v":1215885600000,"label":"18:00"},{"v":1215907200000,"label":"13 Jul"},{"v":1215928800000,"label":"06:00"},{"v":1215950400000,"label":"12:00"},{"v":1215972000000,"label":"18:00"}], ticker(1215817200000, 1215989940000, 600, options));
- assertEquals([{"v":1246752000000,"label":"05 Jul"},{"v":1247356800000,"label":"12 Jul"},{"v":1247961600000,"label":"19 Jul"}], ticker(1246402800000, 1248217200000, 600, options));
- assertEquals([{"v":1246752000000,"label":"05 Jul"},{"v":1247356800000,"label":"12 Jul"},{"v":1247961600000,"label":"19 Jul"},{"v":1248566400000,"label":"26 Jul"},{"v":1249171200000,"label":"02 Aug"}], ticker(1246402800000, 1249340400000, 600, options));
- assertEquals([{"v":1247356800000,"label":"12 Jul"},{"v":1247360400000,"label":"01:00"},{"v":1247364000000,"label":"02:00"},{"v":1247367600000,"label":"03:00"},{"v":1247371200000,"label":"04:00"},{"v":1247374800000,"label":"05:00"},{"v":1247378400000,"label":"06:00"}], ticker(1247356800000, 1247378400000, 600, options));
+ assert.deepEqual([{"v":1293840000000,"label":"Jan 2011"},{"v":1296518400000,"label":"Feb 2011"},{"v":1298937600000,"label":"Mar 2011"},{"v":1301616000000,"label":"Apr 2011"},{"v":1304208000000,"label":"May 2011"},{"v":1306886400000,"label":"Jun 2011"},{"v":1309478400000,"label":"Jul 2011"},{"v":1312156800000,"label":"Aug 2011"}], ticker(1293753600000, 1312844400000, 727, options));
+ assert.deepEqual([{"v":1201824000000,"label":"01 Feb"},{"v":1201910400000,"label":"02 Feb"},{"v":1201996800000,"label":"03 Feb"},{"v":1202083200000,"label":"04 Feb"},{"v":1202169600000,"label":"05 Feb"},{"v":1202256000000,"label":"06 Feb"}], ticker(1201824000000, 1202256000000, 700, options));
+ assert.deepEqual([{"v":1210118400000,"label":"07 May"},{"v":1210140000000,"label":"06:00"},{"v":1210161600000,"label":"12:00"},{"v":1210183200000,"label":"18:00"},{"v":1210204800000,"label":"08 May"},{"v":1210226400000,"label":"06:00"},{"v":1210248000000,"label":"12:00"},{"v":1210269600000,"label":"18:00"},{"v":1210291200000,"label":"09 May"}], ticker(1210114800000, 1210291200000, 480, options));
+ assert.deepEqual([{"v":1210118400000,"label":"07 May"},{"v":1210204800000,"label":"08 May"},{"v":1210291200000,"label":"09 May"},{"v":1210377600000,"label":"10 May"},{"v":1210464000000,"label":"11 May"}], ticker(1210114800000, 1210464000000, 480, options));
+ assert.deepEqual([{"v":1210118400000,"label":"07 May"},{"v":1210204800000,"label":"08 May"},{"v":1210291200000,"label":"09 May"},{"v":1210377600000,"label":"10 May"},{"v":1210464000000,"label":"11 May"},{"v":1210550400000,"label":"12 May"}], ticker(1210114800000, 1210550400000, 480, options));
+ assert.deepEqual([{"v":1214870400000,"label":"01 Jul"},{"v":1214872200000,"label":"00:30"},{"v":1214874000000,"label":"01:00"},{"v":1214875800000,"label":"01:30"}], ticker(1214870400000, 1214877599000, 600, options));
+ assert.deepEqual([{"v":1214870400000,"label":"Jul 2008"},{"v":1217548800000,"label":"Aug 2008"},{"v":1220227200000,"label":"Sep 2008"}], ticker(1214866800000, 1222747200000, 600, options));
+ assert.deepEqual([{"v":1215820800000,"label":"12 Jul"},{"v":1215842400000,"label":"06:00"},{"v":1215864000000,"label":"12:00"},{"v":1215885600000,"label":"18:00"},{"v":1215907200000,"label":"13 Jul"},{"v":1215928800000,"label":"06:00"},{"v":1215950400000,"label":"12:00"},{"v":1215972000000,"label":"18:00"}], ticker(1215817200000, 1215989940000, 600, options));
+ assert.deepEqual([{"v":1246752000000,"label":"05 Jul"},{"v":1247356800000,"label":"12 Jul"},{"v":1247961600000,"label":"19 Jul"}], ticker(1246402800000, 1248217200000, 600, options));
+ assert.deepEqual([{"v":1246752000000,"label":"05 Jul"},{"v":1247356800000,"label":"12 Jul"},{"v":1247961600000,"label":"19 Jul"},{"v":1248566400000,"label":"26 Jul"},{"v":1249171200000,"label":"02 Aug"}], ticker(1246402800000, 1249340400000, 600, options));
+ assert.deepEqual([{"v":1247356800000,"label":"12 Jul"},{"v":1247360400000,"label":"01:00"},{"v":1247364000000,"label":"02:00"},{"v":1247367600000,"label":"03:00"},{"v":1247371200000,"label":"04:00"},{"v":1247374800000,"label":"05:00"},{"v":1247378400000,"label":"06:00"}], ticker(1247356800000, 1247378400000, 600, options));
- assertEquals([{"v":1247356800000,"label":"12 Jul"},{"v":1247360400000,"label":"01:00"},{"v":1247364000000,"label":"02:00"},{"v":1247367600000,"label":"03:00"},{"v":1247371200000,"label":"04:00"},{"v":1247374800000,"label":"05:00"},{"v":1247378400000,"label":"06:00"}], ticker(1247356800000, 1247378400000, 600, options));
- assertEquals([{"v":1254268800000,"label":"30 Sep"},{"v":1254355200000,"label":"01 Oct"},{"v":1254441600000,"label":"02 Oct"},{"v":1254528000000,"label":"03 Oct"},{"v":1254614400000,"label":"04 Oct"},{"v":1254700800000,"label":"05 Oct"},{"v":1254787200000,"label":"06 Oct"},{"v":1254873600000,"label":"07 Oct"},{"v":1254960000000,"label":"08 Oct"},{"v":1255046400000,"label":"09 Oct"},{"v":1255132800000,"label":"10 Oct"}], ticker(1254222000000, 1255172400000, 900, options));
- assertEquals([{"v":1254441600000,"label":"02 Oct"},{"v":1254528000000,"label":"03 Oct"},{"v":1254614400000,"label":"04 Oct"},{"v":1254700800000,"label":"05 Oct"},{"v":1254787200000,"label":"06 Oct"},{"v":1254873600000,"label":"07 Oct"},{"v":1254960000000,"label":"08 Oct"}], ticker(1254394800000, 1254999600000, 900, options));
- assertEquals([{"v":1259625600000,"label":"01 Dec"},{"v":1259712000000,"label":"02 Dec"},{"v":1259798400000,"label":"03 Dec"},{"v":1259884800000,"label":"04 Dec"},{"v":1259971200000,"label":"05 Dec"},{"v":1260057600000,"label":"06 Dec"},{"v":1260144000000,"label":"07 Dec"}], ticker(1259625600000, 1260144000000, 480, options));
- assertEquals([{"v":1259625600000,"label":"01 Dec"},{"v":1259712000000,"label":"02 Dec"},{"v":1259798400000,"label":"03 Dec"},{"v":1259884800000,"label":"04 Dec"},{"v":1259971200000,"label":"05 Dec"},{"v":1260057600000,"label":"06 Dec"},{"v":1260144000000,"label":"07 Dec"}], ticker(1259625600000, 1260144000000, 600, options));
- assertEquals([{"v":1260057600000,"label":"06 Dec"},{"v":1260662400000,"label":"13 Dec"},{"v":1261267200000,"label":"20 Dec"},{"v":1261872000000,"label":"27 Dec"},{"v":1262476800000,"label":"03 Jan"},{"v":1263081600000,"label":"10 Jan"},{"v":1263686400000,"label":"17 Jan"},{"v":1264291200000,"label":"24 Jan"}], ticker(1260057600000, 1264291200000, 640, options));
- assertEquals([{"v":1262304000000,"label":"Jan 2010"},{"v":1264982400000,"label":"Feb 2010"},{"v":1267401600000,"label":"Mar 2010"},{"v":1270080000000,"label":"Apr 2010"}], ticker(1262304000000, 1270857600000, 640, options));
- assertEquals([{"v":1288915200000,"label":"05 Nov"},{"v":1288936800000,"label":"06:00"},{"v":1288958400000,"label":"12:00"},{"v":1288980000000,"label":"18:00"},{"v":1289001600000,"label":"06 Nov"},{"v":1289023200000,"label":"06:00"},{"v":1289044800000,"label":"12:00"},{"v":1289066400000,"label":"18:00"},{"v":1289088000000,"label":"07 Nov"},{"v":1289109600000,"label":"06:00"},{"v":1289131200000,"label":"12:00"},{"v":1289152800000,"label":"18:00"},{"v":1289174400000,"label":"08 Nov"},{"v":1289196000000,"label":"06:00"},{"v":1289217600000,"label":"12:00"},{"v":1289239200000,"label":"18:00"},{"v":1289260800000,"label":"09 Nov"}], ticker(1288911600000, 1289260800000, 1024, options));
- assertEquals([{"v":1291161600000,"label":"01 Dec"},{"v":1291248000000,"label":"02 Dec"},{"v":1291334400000,"label":"03 Dec"},{"v":1291420800000,"label":"04 Dec"},{"v":1291507200000,"label":"05 Dec"},{"v":1291593600000,"label":"06 Dec"},{"v":1291680000000,"label":"07 Dec"},{"v":1291766400000,"label":"08 Dec"},{"v":1291852800000,"label":"09 Dec"}], ticker(1291161600000, 1291852800000, 600, options));
- assertEquals([{"v":1294358400000,"label":"07 Jan"},{"v":1294444800000,"label":"08 Jan"},{"v":1294531200000,"label":"09 Jan"},{"v":1294617600000,"label":"10 Jan"},{"v":1294704000000,"label":"11 Jan"},{"v":1294790400000,"label":"12 Jan"},{"v":1294876800000,"label":"13 Jan"},{"v":1294963200000,"label":"14 Jan"}], ticker(1294358400000, 1294963200000, 480, options));
- assertEquals([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"}], ticker(1307908000112, 1307908050165, 800, options));
- assertEquals([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"}], ticker(1307908000112, 1307908051166, 800, options));
- assertEquals([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"}], ticker(1307908000112, 1307908052167, 800, options));
- assertEquals([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"}], ticker(1307908000112, 1307908053167, 800, options));
- assertEquals([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"}], ticker(1307908000112, 1307908054168, 800, options));
- assertEquals([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"}], ticker(1307908000112, 1307908055169, 800, options));
- assertEquals([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"}], ticker(1307908000112, 1307908056169, 800, options));
- assertEquals([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"}], ticker(1307908000112, 1307908057170, 800, options));
- assertEquals([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"}], ticker(1307908000112, 1307908058171, 800, options));
- assertEquals([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"}], ticker(1307908000112, 1307908059172, 800, options));
- assertEquals([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"},{"v":1307908060000,"label":"19:47:40"}], ticker(1307908000112, 1307908060172, 800, options));
- assertEquals([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"},{"v":1307908060000,"label":"19:47:40"}], ticker(1307908000112, 1307908061174, 800, options));
- assertEquals([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"},{"v":1307908060000,"label":"19:47:40"}], ticker(1307908000112, 1307908062176, 800, options));
- assertEquals([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"},{"v":1307908060000,"label":"19:47:40"}], ticker(1307908000112, 1307908063177, 800, options));
- assertEquals([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"},{"v":1307908060000,"label":"19:47:40"}], ticker(1307908000112, 1307908064178, 800, options));
- assertEquals([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908065000,"label":"19:47:45"}], ticker(1307908000112, 1307908065178, 800, options));
- assertEquals([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908065000,"label":"19:47:45"}], ticker(1307908000112, 1307908066178, 800, options));
- assertEquals([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908065000,"label":"19:47:45"}], ticker(1307908000112, 1307908067179, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"}], ticker(1307908000112, 1307908068179, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"}], ticker(1307908000112, 1307908069179, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908070180, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908071180, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908072181, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908073181, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908074182, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908075182, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908076183, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908077183, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908078184, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908079185, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908080186, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908081187, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908082188, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908083188, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908084189, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908085190, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908086191, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908087192, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908088192, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908089193, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908090194, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908091194, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908092196, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908093196, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908094197, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908095197, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908096198, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908097199, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908098200, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908099200, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908100201, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908101201, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908102202, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908103203, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908104204, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908105205, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908106205, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908107206, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908108209, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908109209, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908110209, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908111210, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908112211, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908113211, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908114212, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908115213, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908116214, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908117214, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908118215, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908119215, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908120217, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908121218, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908122219, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908123219, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908124220, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908125221, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908126222, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908127222, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908128223, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908129223, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"},{"v":1307908130000,"label":"19:48:50"}], ticker(1307908000112, 1307908130224, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"},{"v":1307908130000,"label":"19:48:50"}], ticker(1307908000112, 1307908131225, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"},{"v":1307908130000,"label":"19:48:50"}], ticker(1307908000112, 1307908132226, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"},{"v":1307908130000,"label":"19:48:50"}], ticker(1307908000112, 1307908133227, 800, options));
- assertEquals([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"},{"v":1307908130000,"label":"19:48:50"}], ticker(1307908000112, 1307908134227, 800, options));
- assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908135227, 800, options));
- assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908136228, 800, options));
- assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908137230, 800, options));
- assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908138231, 800, options));
- assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908139232, 800, options));
- assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908140233, 800, options));
- assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908141233, 800, options));
- assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908142234, 800, options));
- assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908143240, 800, options));
- assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908144240, 800, options));
- assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908145240, 800, options));
- assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908146241, 800, options));
- assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908147241, 800, options));
- assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908148242, 800, options));
- assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908149243, 800, options));
- assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908150243, 800, options));
- assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908151244, 800, options));
- assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908152245, 800, options));
- assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908153245, 800, options));
- assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908154246, 800, options));
- assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908155247, 800, options));
- assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908156247, 800, options));
- assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908157248, 800, options));
- assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908158249, 800, options));
- assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908159250, 800, options));
- assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908160251, 800, options));
- assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908161252, 800, options));
- assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908162252, 800, options));
- assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908163253, 800, options));
- assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908164254, 800, options));
- assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908165254, 800, options));
- assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908166255, 800, options));
- assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908167256, 800, options));
- assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908168256, 800, options));
- assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908169257, 800, options));
- assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"},{"v":1307908170000,"label":"19:49:30"}], ticker(1307908000112, 1307908170258, 800, options));
- assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"},{"v":1307908170000,"label":"19:49:30"}], ticker(1307908000112, 1307908171258, 800, options));
- assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"},{"v":1307908170000,"label":"19:49:30"}], ticker(1307908000112, 1307908172259, 800, options));
- assertEquals([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"},{"v":1307908170000,"label":"19:49:30"}], ticker(1307908000112, 1307908173260, 800, options));
- assertEquals([{"v":978307200000,"label":"Jan 2001"},{"v":986083200000,"label":"Apr 2001"},{"v":993945600000,"label":"Jul 2001"},{"v":1001894400000,"label":"Oct 2001"}], ticker(978307200000, 1001894400000, 400, options));
-};
+ assert.deepEqual([{"v":1247356800000,"label":"12 Jul"},{"v":1247360400000,"label":"01:00"},{"v":1247364000000,"label":"02:00"},{"v":1247367600000,"label":"03:00"},{"v":1247371200000,"label":"04:00"},{"v":1247374800000,"label":"05:00"},{"v":1247378400000,"label":"06:00"}], ticker(1247356800000, 1247378400000, 600, options));
+ assert.deepEqual([{"v":1254268800000,"label":"30 Sep"},{"v":1254355200000,"label":"01 Oct"},{"v":1254441600000,"label":"02 Oct"},{"v":1254528000000,"label":"03 Oct"},{"v":1254614400000,"label":"04 Oct"},{"v":1254700800000,"label":"05 Oct"},{"v":1254787200000,"label":"06 Oct"},{"v":1254873600000,"label":"07 Oct"},{"v":1254960000000,"label":"08 Oct"},{"v":1255046400000,"label":"09 Oct"},{"v":1255132800000,"label":"10 Oct"}], ticker(1254222000000, 1255172400000, 900, options));
+ assert.deepEqual([{"v":1254441600000,"label":"02 Oct"},{"v":1254528000000,"label":"03 Oct"},{"v":1254614400000,"label":"04 Oct"},{"v":1254700800000,"label":"05 Oct"},{"v":1254787200000,"label":"06 Oct"},{"v":1254873600000,"label":"07 Oct"},{"v":1254960000000,"label":"08 Oct"}], ticker(1254394800000, 1254999600000, 900, options));
+ assert.deepEqual([{"v":1259625600000,"label":"01 Dec"},{"v":1259712000000,"label":"02 Dec"},{"v":1259798400000,"label":"03 Dec"},{"v":1259884800000,"label":"04 Dec"},{"v":1259971200000,"label":"05 Dec"},{"v":1260057600000,"label":"06 Dec"},{"v":1260144000000,"label":"07 Dec"}], ticker(1259625600000, 1260144000000, 480, options));
+ assert.deepEqual([{"v":1259625600000,"label":"01 Dec"},{"v":1259712000000,"label":"02 Dec"},{"v":1259798400000,"label":"03 Dec"},{"v":1259884800000,"label":"04 Dec"},{"v":1259971200000,"label":"05 Dec"},{"v":1260057600000,"label":"06 Dec"},{"v":1260144000000,"label":"07 Dec"}], ticker(1259625600000, 1260144000000, 600, options));
+ assert.deepEqual([{"v":1260057600000,"label":"06 Dec"},{"v":1260662400000,"label":"13 Dec"},{"v":1261267200000,"label":"20 Dec"},{"v":1261872000000,"label":"27 Dec"},{"v":1262476800000,"label":"03 Jan"},{"v":1263081600000,"label":"10 Jan"},{"v":1263686400000,"label":"17 Jan"},{"v":1264291200000,"label":"24 Jan"}], ticker(1260057600000, 1264291200000, 640, options));
+ assert.deepEqual([{"v":1262304000000,"label":"Jan 2010"},{"v":1264982400000,"label":"Feb 2010"},{"v":1267401600000,"label":"Mar 2010"},{"v":1270080000000,"label":"Apr 2010"}], ticker(1262304000000, 1270857600000, 640, options));
+ assert.deepEqual([{"v":1288915200000,"label":"05 Nov"},{"v":1288936800000,"label":"06:00"},{"v":1288958400000,"label":"12:00"},{"v":1288980000000,"label":"18:00"},{"v":1289001600000,"label":"06 Nov"},{"v":1289023200000,"label":"06:00"},{"v":1289044800000,"label":"12:00"},{"v":1289066400000,"label":"18:00"},{"v":1289088000000,"label":"07 Nov"},{"v":1289109600000,"label":"06:00"},{"v":1289131200000,"label":"12:00"},{"v":1289152800000,"label":"18:00"},{"v":1289174400000,"label":"08 Nov"},{"v":1289196000000,"label":"06:00"},{"v":1289217600000,"label":"12:00"},{"v":1289239200000,"label":"18:00"},{"v":1289260800000,"label":"09 Nov"}], ticker(1288911600000, 1289260800000, 1024, options));
+ assert.deepEqual([{"v":1291161600000,"label":"01 Dec"},{"v":1291248000000,"label":"02 Dec"},{"v":1291334400000,"label":"03 Dec"},{"v":1291420800000,"label":"04 Dec"},{"v":1291507200000,"label":"05 Dec"},{"v":1291593600000,"label":"06 Dec"},{"v":1291680000000,"label":"07 Dec"},{"v":1291766400000,"label":"08 Dec"},{"v":1291852800000,"label":"09 Dec"}], ticker(1291161600000, 1291852800000, 600, options));
+ assert.deepEqual([{"v":1294358400000,"label":"07 Jan"},{"v":1294444800000,"label":"08 Jan"},{"v":1294531200000,"label":"09 Jan"},{"v":1294617600000,"label":"10 Jan"},{"v":1294704000000,"label":"11 Jan"},{"v":1294790400000,"label":"12 Jan"},{"v":1294876800000,"label":"13 Jan"},{"v":1294963200000,"label":"14 Jan"}], ticker(1294358400000, 1294963200000, 480, options));
+ assert.deepEqual([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"}], ticker(1307908000112, 1307908050165, 800, options));
+ assert.deepEqual([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"}], ticker(1307908000112, 1307908051166, 800, options));
+ assert.deepEqual([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"}], ticker(1307908000112, 1307908052167, 800, options));
+ assert.deepEqual([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"}], ticker(1307908000112, 1307908053167, 800, options));
+ assert.deepEqual([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"}], ticker(1307908000112, 1307908054168, 800, options));
+ assert.deepEqual([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"}], ticker(1307908000112, 1307908055169, 800, options));
+ assert.deepEqual([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"}], ticker(1307908000112, 1307908056169, 800, options));
+ assert.deepEqual([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"}], ticker(1307908000112, 1307908057170, 800, options));
+ assert.deepEqual([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"}], ticker(1307908000112, 1307908058171, 800, options));
+ assert.deepEqual([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"}], ticker(1307908000112, 1307908059172, 800, options));
+ assert.deepEqual([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"},{"v":1307908060000,"label":"19:47:40"}], ticker(1307908000112, 1307908060172, 800, options));
+ assert.deepEqual([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"},{"v":1307908060000,"label":"19:47:40"}], ticker(1307908000112, 1307908061174, 800, options));
+ assert.deepEqual([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"},{"v":1307908060000,"label":"19:47:40"}], ticker(1307908000112, 1307908062176, 800, options));
+ assert.deepEqual([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"},{"v":1307908060000,"label":"19:47:40"}], ticker(1307908000112, 1307908063177, 800, options));
+ assert.deepEqual([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"},{"v":1307908060000,"label":"19:47:40"}], ticker(1307908000112, 1307908064178, 800, options));
+ assert.deepEqual([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908065000,"label":"19:47:45"}], ticker(1307908000112, 1307908065178, 800, options));
+ assert.deepEqual([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908065000,"label":"19:47:45"}], ticker(1307908000112, 1307908066178, 800, options));
+ assert.deepEqual([{"v":1307908005000,"label":"19:46:45"},{"v":1307908010000,"label":"19:46:50"},{"v":1307908015000,"label":"19:46:55"},{"v":1307908020000,"label":"19:47"},{"v":1307908025000,"label":"19:47:05"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908035000,"label":"19:47:15"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908045000,"label":"19:47:25"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908055000,"label":"19:47:35"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908065000,"label":"19:47:45"}], ticker(1307908000112, 1307908067179, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"}], ticker(1307908000112, 1307908068179, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"}], ticker(1307908000112, 1307908069179, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908070180, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908071180, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908072181, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908073181, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908074182, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908075182, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908076183, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908077183, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908078184, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"}], ticker(1307908000112, 1307908079185, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908080186, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908081187, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908082188, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908083188, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908084189, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908085190, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908086191, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908087192, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908088192, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"}], ticker(1307908000112, 1307908089193, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908090194, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908091194, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908092196, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908093196, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908094197, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908095197, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908096198, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908097199, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908098200, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"}], ticker(1307908000112, 1307908099200, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908100201, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908101201, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908102202, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908103203, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908104204, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908105205, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908106205, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908107206, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908108209, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"}], ticker(1307908000112, 1307908109209, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908110209, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908111210, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908112211, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908113211, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908114212, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908115213, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908116214, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908117214, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908118215, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908119215, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908120217, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908121218, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908122219, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908123219, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908124220, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908125221, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908126222, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908127222, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908128223, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"}], ticker(1307908000112, 1307908129223, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"},{"v":1307908130000,"label":"19:48:50"}], ticker(1307908000112, 1307908130224, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"},{"v":1307908130000,"label":"19:48:50"}], ticker(1307908000112, 1307908131225, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"},{"v":1307908130000,"label":"19:48:50"}], ticker(1307908000112, 1307908132226, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"},{"v":1307908130000,"label":"19:48:50"}], ticker(1307908000112, 1307908133227, 800, options));
+ assert.deepEqual([{"v":1307908010000,"label":"19:46:50"},{"v":1307908020000,"label":"19:47"},{"v":1307908030000,"label":"19:47:10"},{"v":1307908040000,"label":"19:47:20"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908060000,"label":"19:47:40"},{"v":1307908070000,"label":"19:47:50"},{"v":1307908080000,"label":"19:48"},{"v":1307908090000,"label":"19:48:10"},{"v":1307908100000,"label":"19:48:20"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908120000,"label":"19:48:40"},{"v":1307908130000,"label":"19:48:50"}], ticker(1307908000112, 1307908134227, 800, options));
+ assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908135227, 800, options));
+ assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908136228, 800, options));
+ assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908137230, 800, options));
+ assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908138231, 800, options));
+ assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"}], ticker(1307908000112, 1307908139232, 800, options));
+ assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908140233, 800, options));
+ assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908141233, 800, options));
+ assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908142234, 800, options));
+ assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908143240, 800, options));
+ assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908144240, 800, options));
+ assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908145240, 800, options));
+ assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908146241, 800, options));
+ assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908147241, 800, options));
+ assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908148242, 800, options));
+ assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908149243, 800, options));
+ assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908150243, 800, options));
+ assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908151244, 800, options));
+ assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908152245, 800, options));
+ assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908153245, 800, options));
+ assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908154246, 800, options));
+ assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908155247, 800, options));
+ assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908156247, 800, options));
+ assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908157248, 800, options));
+ assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908158249, 800, options));
+ assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908159250, 800, options));
+ assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908160251, 800, options));
+ assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908161252, 800, options));
+ assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908162252, 800, options));
+ assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908163253, 800, options));
+ assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908164254, 800, options));
+ assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908165254, 800, options));
+ assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908166255, 800, options));
+ assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908167256, 800, options));
+ assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908168256, 800, options));
+ assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"}], ticker(1307908000112, 1307908169257, 800, options));
+ assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"},{"v":1307908170000,"label":"19:49:30"}], ticker(1307908000112, 1307908170258, 800, options));
+ assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"},{"v":1307908170000,"label":"19:49:30"}], ticker(1307908000112, 1307908171258, 800, options));
+ assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"},{"v":1307908170000,"label":"19:49:30"}], ticker(1307908000112, 1307908172259, 800, options));
+ assert.deepEqual([{"v":1307908020000,"label":"19:47"},{"v":1307908050000,"label":"19:47:30"},{"v":1307908080000,"label":"19:48"},{"v":1307908110000,"label":"19:48:30"},{"v":1307908140000,"label":"19:49"},{"v":1307908170000,"label":"19:49:30"}], ticker(1307908000112, 1307908173260, 800, options));
+ assert.deepEqual([{"v":978307200000,"label":"Jan 2001"},{"v":986083200000,"label":"Apr 2001"},{"v":993945600000,"label":"Jul 2001"},{"v":1001894400000,"label":"Oct 2001"}], ticker(978307200000, 1001894400000, 400, options));
+});
+
+});
/**
* @fileoverview Test cases for DygraphOptions.
*/
-var DygraphOptionsTestCase = TestCase("dygraph-options-tests");
+describe("dygraph-options-tests", function() {
-DygraphOptionsTestCase.prototype.setUp = function() {
+var graph;
+
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
-};
+ graph = document.getElementById("graph");
+});
-DygraphOptionsTestCase.prototype.tearDown = function() {
-};
+afterEach(function() {
+});
/*
* Pathalogical test to ensure getSeriesNames works
*/
-DygraphOptionsTestCase.prototype.testGetSeriesNames = function() {
+it('testGetSeriesNames', function() {
var opts = {
width: 480,
height: 320
"0,-1,0,0";
// Kind of annoying that you need a DOM to test the object.
- var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
// We don't need to get at g's attributes_ object just
// to test DygraphOptions.
var o = new DygraphOptions(g);
- assertEquals(["Y", "Y2", "Y3"], o.seriesNames());
-};
+ assert.deepEqual(["Y", "Y2", "Y3"], o.seriesNames());
+});
/*
* Ensures that even if logscale is set globally, it doesn't impact the
* x axis.
*/
-DygraphOptionsTestCase.prototype.testGetLogscaleForX = function() {
+it('testGetLogscaleForX', function() {
var opts = {
width: 480,
height: 320
"1,-1,2,3";
// Kind of annoying that you need a DOM to test the object.
- var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
- assertFalse(!!g.getOptionForAxis('logscale', 'x'));
- assertFalse(!!g.getOptionForAxis('logscale', 'y'));
+ assert.isFalse(!!g.getOptionForAxis('logscale', 'x'));
+ assert.isFalse(!!g.getOptionForAxis('logscale', 'y'));
g.updateOptions({ logscale : true });
- assertFalse(!!g.getOptionForAxis('logscale', 'x'));
- assertTrue(!!g.getOptionForAxis('logscale', 'y'));
-};
+ assert.isFalse(!!g.getOptionForAxis('logscale', 'x'));
+ assert.isTrue(!!g.getOptionForAxis('logscale', 'y'));
+});
// Helper to gather all warnings emitted by Dygraph constructor.
// Removes everything after the first open parenthesis in each warning.
return warnings;
};
-DygraphOptionsTestCase.prototype.testLogWarningForNonexistentOption = function() {
+it('testLogWarningForNonexistentOption', function() {
if (typeof(Dygraph.OPTIONS_REFERENCE) === 'undefined') {
return; // this test won't pass in non-debug mode.
}
- var graph = document.getElementById("graph");
var data = "X,Y,Y2,Y3\n" +
"1,-1,2,3";
var expectWarning = function(opts, badOptionName) {
DygraphOptions.resetWarnings_();
var warnings = getWarnings(graph, data, opts);
- assertEquals(['Unknown option ' + badOptionName], warnings);
+ assert.deepEqual(['Unknown option ' + badOptionName], warnings);
};
var expectNoWarning = function(opts) {
DygraphOptions.resetWarnings_();
var warnings = getWarnings(graph, data, opts);
- assertEquals([], warnings);
+ assert.deepEqual([], warnings);
};
expectNoWarning({});
expectWarning({highlightSeriesOpts: {anotherNonExistentOption: true}}, 'anotherNonExistentOption');
expectNoWarning({highlightSeriesOpts: {strokeWidth: 20}});
expectNoWarning({strokeWidth: 20});
-};
+});
-DygraphOptionsTestCase.prototype.testOnlyLogsEachWarningOnce = function() {
+it('testOnlyLogsEachWarningOnce', function() {
if (typeof(Dygraph.OPTIONS_REFERENCE) === 'undefined') {
return; // this test won't pass in non-debug mode.
}
- var graph = document.getElementById("graph");
var data = "X,Y,Y2,Y3\n" +
"1,-1,2,3";
var warnings1 = getWarnings(graph, data, {nonExistent: true});
var warnings2 = getWarnings(graph, data, {nonExistent: true});
- assertEquals(['Unknown option nonExistent'], warnings1);
- assertEquals([], warnings2);
-};
+ assert.deepEqual(['Unknown option nonExistent'], warnings1);
+ assert.deepEqual([], warnings2);
+});
+
+});
*
* @author danvk@google.com (Dan Vanderkam)
*/
-var errorBarsTestCase = TestCase("error-bars");
+describe("error-bars", function() {
-errorBarsTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
-};
+});
var _origFunc = Dygraph.getContext;
-errorBarsTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
Dygraph.getContext = function(canvas) {
return new Proxy(_origFunc(canvas));
}
-};
+});
-errorBarsTestCase.prototype.tearDown = function() {
+afterEach(function() {
Dygraph.getContext = _origFunc;
-};
+});
-errorBarsTestCase.prototype.testErrorBarsDrawn = function() {
+it('testErrorBarsDrawn', function() {
var opts = {
width: 480,
height: 320,
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
- htx = g.hidden_ctx_;
+ var htx = g.hidden_ctx_;
var attrs = {}; // TODO(danvk): fill in
}
g.destroy(); // Restore balanced saves and restores.
CanvasAssertions.assertBalancedSaveRestore(htx);
-};
+});
-errorBarsTestCase.prototype.testErrorBarsCorrectColors = function() {
+it('testErrorBarsCorrectColors', function() {
// Two constant series with constant error.
var data = [
[0, [100, 50], [200, 50]],
// 249-299: empty (white)
// TODO(danvk): test the edges of these regions.
- assertEquals([0, 0, 255, 38], Util.samplePixel(g.hidden_, 200, 75));
- assertEquals([0, 0, 255, 38], Util.samplePixel(g.hidden_, 200, 125));
- assertEquals([0, 255, 0, 38], Util.samplePixel(g.hidden_, 200, 175));
- assertEquals([0, 255, 0, 38], Util.samplePixel(g.hidden_, 200, 225));
-};
+ assert.deepEqual([0, 0, 255, 38], Util.samplePixel(g.hidden_, 200, 75));
+ assert.deepEqual([0, 0, 255, 38], Util.samplePixel(g.hidden_, 200, 125));
+ assert.deepEqual([0, 255, 0, 38], Util.samplePixel(g.hidden_, 200, 175));
+ assert.deepEqual([0, 255, 0, 38], Util.samplePixel(g.hidden_, 200, 225));
+});
// Regression test for http://code.google.com/p/dygraphs/issues/detail?id=392
-errorBarsTestCase.prototype.testRollingAveragePreservesNaNs = function() {
+it('testRollingAveragePreservesNaNs', function() {
var graph = document.getElementById("graph");
var data =
[
var in_series = g.dataHandler_.extractSeries(data, 1, g.attributes_);
- assertEquals(null, in_series[4][1]);
- assertEquals(null, in_series[4][2][0]);
- assertEquals(null, in_series[4][2][1]);
- assertNaN(in_series[5][1]);
- assertNaN(in_series[5][2][0]);
- assertNaN(in_series[5][2][1]);
+ assert.equal(null, in_series[4][1]);
+ assert.equal(null, in_series[4][2][0]);
+ assert.equal(null, in_series[4][2][1]);
+ assert.isNaN(in_series[5][1]);
+ assert.isNaN(in_series[5][2][0]);
+ assert.isNaN(in_series[5][2][1]);
var out_series = g.dataHandler_.rollingAverage(in_series, 1, g.attributes_);
- assertNaN(out_series[5][1]);
- assertNaN(out_series[5][2][0]);
- assertNaN(out_series[5][2][1]);
- assertEquals(null, out_series[4][1]);
- assertEquals(null, out_series[4][2][0]);
- assertEquals(null, out_series[4][2][1]);
-};
+ assert.isNaN(out_series[5][1]);
+ assert.isNaN(out_series[5][2][0]);
+ assert.isNaN(out_series[5][2][1]);
+ assert.equal(null, out_series[4][1]);
+ assert.equal(null, out_series[4][2][0]);
+ assert.equal(null, out_series[4][2][1]);
+});
+
+});
*
* @author danvdk@gmail.com (Dan Vanderkam)
*/
-var fastCanvasProxyTestCase = TestCase("fast-canvas-proxy");
+describe("fast-canvas-proxy", function() {
-fastCanvasProxyTestCase.prototype.setUp = function() {
-};
+beforeEach(function() {
+});
-fastCanvasProxyTestCase.prototype.tearDown = function() {
-};
+afterEach(function() {
+});
var fakeCanvasContext = {
moveTo: function() {},
return out;
}
-fastCanvasProxyTestCase.prototype.testExtraMoveTosElided = function() {
+it('testExtraMoveTosElided', function() {
var htx = new Proxy(fakeCanvasContext);
var fastProxy = DygraphCanvasRenderer._fastCanvasProxy(htx);
fastProxy.moveTo(3, 1);
fastProxy.stroke();
- assertEquals([['moveTo', 1, 1],
+ assert.deepEqual([['moveTo', 1, 1],
['lineTo', 2, 1],
['lineTo', 3, 1]], extractMoveToAndLineToCalls(htx));
-};
+});
-fastCanvasProxyTestCase.prototype.testConsecutiveMoveTosElided = function() {
+it('testConsecutiveMoveTosElided', function() {
var htx = new Proxy(fakeCanvasContext);
var fastProxy = DygraphCanvasRenderer._fastCanvasProxy(htx);
fastProxy.moveTo(3.2, 3);
fastProxy.stroke();
- assertEquals([['moveTo', 1, 1],
+ assert.deepEqual([['moveTo', 1, 1],
['lineTo', 2, 1],
['moveTo', 3.2, 3]], extractMoveToAndLineToCalls(htx));
-};
+});
-fastCanvasProxyTestCase.prototype.testSuperfluousSegmentsElided = function() {
+it('testSuperfluousSegmentsElided', function() {
var htx = new Proxy(fakeCanvasContext);
var fastProxy = DygraphCanvasRenderer._fastCanvasProxy(htx);
fastProxy.moveTo(3, 0); // dodge the "don't touch the last pixel" rule.
fastProxy.stroke();
- assertEquals([['moveTo', 0.6, 1],
+ assert.deepEqual([['moveTo', 0.6, 1],
['lineTo', 1.0, 5],
['lineTo', 1.2, 0],
['lineTo', 1.7, 30],
['lineTo', 1.8, -30],
['moveTo', 3, 0]], extractMoveToAndLineToCalls(htx));
-};
+});
+
+});
*
* @author benoitboivin.pro@gmail.com (Benoit Boivin)
*/
-var fillStepPlotTestCase = TestCase("fill-step-plot");
+describe("fill-step-plot", function() {
-fillStepPlotTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
-};
+});
var origFunc = Dygraph.getContext;
-fillStepPlotTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
Dygraph.getContext = function(canvas) {
return new Proxy(origFunc(canvas));
};
-};
+});
-fillStepPlotTestCase.prototype.tearDown = function() {
+afterEach(function() {
Dygraph.getContext = origFunc;
-};
+});
-fillStepPlotTestCase.prototype.testFillStepPlotNullValues = function() {
+it('testFillStepPlotNullValues', function() {
var opts = {
labels: ["x","y"],
width: 480,
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
- htx = g.hidden_ctx_;
+ var htx = g.hidden_ctx_;
var x1 = data[3][0];
var y1 = data[2][1];
var x2 = data[3][0];
// Check if a line is drawn between the previous y and the bottom of the chart
CanvasAssertions.assertLineDrawn(htx, xy1, xy2, {});
-};
+});
+
+});
*
* @author konigsberg@google.com (Robert Konigsberg)
*/
-var FormatsTestCase = TestCase("formats");
+describe("formats", function() {
-FormatsTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
-};
+});
-FormatsTestCase.prototype.tearDown = function() {
-};
+afterEach(function() {
+});
var dataString =
"X,Y\n" +
[2,1],
[3,0]];
-FormatsTestCase.prototype.testCsv = function() {
+it('testCsv', function() {
var data = dataString;
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, {});
assertData(g);
-};
+});
-FormatsTestCase.prototype.testArray = function() {
+it('testArray', function() {
var data = dataArray;
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, {});
assertData(g);
-};
+});
-FormatsTestCase.prototype.testFunctionReturnsCsv = function() {
+it('testFunctionReturnsCsv', function() {
var string = dataString;
var data = function() { return string; };
var g = new Dygraph(graph, data, {});
// assertData(g);
console.log("x");
-};
+});
-FormatsTestCase.prototype.testFunctionDefinesArray = function() {
+it('testFunctionDefinesArray', function() {
var array = dataArray;
var data = function() { return array; }
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, {});
assertData(g);
-};
+});
-FormatsTestCase.prototype.testXValueParser = function() {
+it('testXValueParser', function() {
var data =
"X,Y\n" +
"d,-1\n" +
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, {
xValueParser : function(str) {
- assertEquals(1, str.length);
+ assert.equal(1, str.length);
return str.charCodeAt(0) - "a".charCodeAt(0);
}
});
- assertEquals(3, g.getValue(0, 0));
- assertEquals(4, g.getValue(1, 0));
- assertEquals(5, g.getValue(2, 0));
- assertEquals(6, g.getValue(3, 0));
-};
+ assert.equal(3, g.getValue(0, 0));
+ assert.equal(4, g.getValue(1, 0));
+ assert.equal(5, g.getValue(2, 0));
+ assert.equal(6, g.getValue(3, 0));
+});
var assertData = function(g) {
var expected = dataArray;
- assertEquals(4, g.numRows());
- assertEquals(2, g.numColumns());
+ assert.equal(4, g.numRows());
+ assert.equal(2, g.numColumns());
for (var i = 0; i < 4; i++) {
for (var j = 0; j < 2; j++) {
- assertEquals(expected[i][j], g.getValue(i, j));
+ assert.equal(expected[i][j], g.getValue(i, j));
}
}
};
+
+});
*
* @author david.eberlein@ch.sauter-bc.com (Fr. Sauter AG)
*/
-var GridPerAxisTestCase = TestCase("grid-per-axis");
+describe("grid-per-axis", function() {
-GridPerAxisTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
-};
+});
var origFunc = Dygraph.getContext;
-GridPerAxisTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
Dygraph.getContext = function(canvas) {
return new Proxy(origFunc(canvas));
};
-};
+});
-GridPerAxisTestCase.prototype.tearDown = function() {
+afterEach(function() {
Dygraph.getContext = origFunc;
-};
+});
-GridPerAxisTestCase.prototype.testIndependentGrids = function() {
+it('testIndependentGrids', function() {
var opts = {
width : 480,
height : 320,
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
- htx = g.hidden_ctx_;
+ var htx = g.hidden_ctx_;
// The expected gridlines
var yGridlines = [ 0, 20, 40, 60, 80, 100, 120 ];
for ( var i = 0; i < gridlines[axis].length; i++) {
// Check the labels:
var labels = Util.getYLabels(axis + 1);
- assertEquals("Expected label not found.", gridlines[axis][i], labels[i]);
+ assert.equal("Expected label not found.", gridlines[axis][i], labels[i]);
// Check that the grid was drawn.
y = halfDown(g.toDomYCoord(gridlines[axis][i], axis));
CanvasAssertions.assertLineDrawn(htx, p1, p2, attrs);
}
}
-};
+});
-GridPerAxisTestCase.prototype.testPerAxisGridColors = function() {
+it('testPerAxisGridColors', function() {
var opts = {
width : 480,
height : 320,
[ 5, 110, 333 ] ];
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
- htx = g.hidden_ctx_;
+ var htx = g.hidden_ctx_;
// The expected gridlines
var yGridlines = [ 20, 40, 60, 80, 100, 120 ];
for ( var i = 0; i < gridlines[axis].length; i++) {
y = halfDown(g.toDomYCoord(gridlines[axis][i], axis));
// Check the grid colors.
- assertEquals("Unexpected grid color found at pixel: x: " + x + "y: " + y,
+ assert.equal("Unexpected grid color found at pixel: x: " + x + "y: " + y,
gridColors[axis], Util.samplePixel(g.hidden_, x, y));
}
}
-};
-GridPerAxisTestCase.prototype.testPerAxisGridWidth = function() {
+});
+it('testPerAxisGridWidth', function() {
var opts = {
width : 480,
height : 320,
[ 5, 110, 333 ] ];
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
- htx = g.hidden_ctx_;
+ var htx = g.hidden_ctx_;
// The expected gridlines
var yGridlines = [ 20, 40, 60, 80 ];
// Check the grid width.
switch (axis) {
case 0: // y with 2 pixels width
- assertEquals("Unexpected y-grid color found at pixel: x: " + x + "y: "
+ assert.equal("Unexpected y-grid color found at pixel: x: " + x + "y: "
+ y, emptyColor, drawnPixeldown2);
- assertEquals("Unexpected y-grid color found at pixel: x: " + x + "y: "
+ assert.equal("Unexpected y-grid color found at pixel: x: " + x + "y: "
+ y, gridColor, drawnPixeldown1);
- assertEquals("Unexpected y-grid color found at pixel: x: " + x + "y: "
+ assert.equal("Unexpected y-grid color found at pixel: x: " + x + "y: "
+ y, gridColor, drawnPixel);
- assertEquals("Unexpected y-grid color found at pixel: x: " + x + "y: "
+ assert.equal("Unexpected y-grid color found at pixel: x: " + x + "y: "
+ y, gridColor, drawnPixelup1);
- assertEquals("Unexpected y-grid color found at pixel: x: " + x + "y: "
+ assert.equal("Unexpected y-grid color found at pixel: x: " + x + "y: "
+ y, emptyColor, drawnPixelup2);
break;
case 1: // y2 with 1 pixel width
- assertEquals("Unexpected y2-grid color found at pixel: x: " + x + "y: "
+ assert.equal("Unexpected y2-grid color found at pixel: x: " + x + "y: "
+ y, emptyColor, drawnPixeldown1);
- assertEquals("Unexpected y2-grid color found at pixel: x: " + x + "y: "
+ assert.equal("Unexpected y2-grid color found at pixel: x: " + x + "y: "
+ y, gridColor, drawnPixel);
- assertEquals("Unexpected y2-grid color found at pixel: x: " + x + "y: "
+ assert.equal("Unexpected y2-grid color found at pixel: x: " + x + "y: "
+ y, emptyColor, drawnPixelup1);
break;
}
y = halfDown(g.plotter_.area.y) + 10;
for ( var i = 0; i < xGridlines.length; i++) {
x = halfUp(g.toDomXCoord(xGridlines[i]));
- assertEquals("Unexpected x-grid color found at pixel: x: " + x + "y: " + y,
+ assert.equal("Unexpected x-grid color found at pixel: x: " + x + "y: " + y,
emptyColor, Util.samplePixel(g.hidden_, x - 4, y).slice(0, 3));
- assertEquals("Unexpected x-grid color found at pixel: x: " + x + "y: " + y,
+ assert.equal("Unexpected x-grid color found at pixel: x: " + x + "y: " + y,
gridColor, Util.samplePixel(g.hidden_, x - 3, y).slice(0, 3));
- assertEquals("Unexpected x-grid color found at pixel: x: " + x + "y: " + y,
+ assert.equal("Unexpected x-grid color found at pixel: x: " + x + "y: " + y,
gridColor, Util.samplePixel(g.hidden_, x - 2, y).slice(0, 3));
- assertEquals("Unexpected x-grid color found at pixel: x: " + x + "y: " + y,
+ assert.equal("Unexpected x-grid color found at pixel: x: " + x + "y: " + y,
gridColor, Util.samplePixel(g.hidden_, x - 1, y).slice(0, 3));
- assertEquals("Unexpected x-grid color found at pixel: x: " + x + "y: " + y,
+ assert.equal("Unexpected x-grid color found at pixel: x: " + x + "y: " + y,
gridColor, Util.samplePixel(g.hidden_, x, y).slice(0, 3));
- assertEquals("Unexpected x-grid color found at pixel: x: " + x + "y: " + y,
+ assert.equal("Unexpected x-grid color found at pixel: x: " + x + "y: " + y,
gridColor, Util.samplePixel(g.hidden_, x + 1, y).slice(0, 3));
- assertEquals("Unexpected x-grid color found at pixel: x: " + x + "y: " + y,
+ assert.equal("Unexpected x-grid color found at pixel: x: " + x + "y: " + y,
emptyColor, Util.samplePixel(g.hidden_, x + 2, y).slice(0, 3));
}
-};
+});
-GridPerAxisTestCase.prototype.testGridLinePattern = function() {
+it('testGridLinePattern', function() {
var opts = {
width : 120,
height : 320,
[ 5, 110, 333 ] ];
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
- htx = g.hidden_ctx_;
+ var htx = g.hidden_ctx_;
// The expected gridlines
var yGridlines = [ 0, 20, 40, 60, 80, 100, 120 ];
var pattern = (Math.floor((x) / 10)) % 2;
switch (pattern) {
case 0: // fill
- assertEquals("Unexpected filled grid-pattern color found at pixel: x: " + x + " y: "
+ assert.equal("Unexpected filled grid-pattern color found at pixel: x: " + x + " y: "
+ y, [ 0, 0, 255 ], drawnPixel);
break;
case 1: // no fill
- assertEquals("Unexpected empty grid-pattern color found at pixel: x: " + x + " y: "
+ assert.equal("Unexpected empty grid-pattern color found at pixel: x: " + x + " y: "
+ y, [ 0, 0, 0 ], drawnPixel);
break;
}
}
}
-};
+});
+
+});
*
* @author danvdk@gmail.com (Dan Vanderkam)
*/
-var hidpiTestCase = TestCase("hidpi");
+describe("hidpi", function() {
var savePixelRatio;
-hidpiTestCase.prototype.setUp = function() {
+beforeEach(function() {
savePixelRatio = window.devicePixelRatio;
window.devicePixelRatio = 2;
document.body.innerHTML = "<div id='graph'></div>";
-};
+});
-hidpiTestCase.prototype.tearDown = function() {
+afterEach(function() {
window.devicePixelRatio = savePixelRatio;
-};
+});
-hidpiTestCase.prototype.testDoesntCreateScrollbars = function() {
+it('testDoesntCreateScrollbars', function() {
var sw = document.body.scrollWidth;
var cw = document.body.clientWidth;
// Adding the graph shouldn't cause the width of the page to change.
// (essentially, we're checking that we don't end up with a scrollbar)
// See http://stackoverflow.com/a/2146905/388951
- assertEquals(cw, document.body.clientWidth);
- assertEquals(sw, document.body.scrollWidth);
-};
+ assert.equal(cw, document.body.clientWidth);
+ assert.equal(sw, document.body.scrollWidth);
+});
+
+});
*
* @author konigsberg@google.com (Robert Konigsbrg)
*/
-var InteractionModelTestCase = TestCase("interaction-model");
+describe("interaction-model", function() {
-InteractionModelTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
-};
+});
-InteractionModelTestCase.prototype.tearDown = function() {
-};
+afterEach(function() {
+});
var data1 = "X,Y\n" +
"20,-1\n" +
return ary;
}
-InteractionModelTestCase.prototype.testPan = function(g, xRange, yRange) {
+/*
+it('testPan', function() {
var originalXRange = g.xAxisRange();
var originalYRange = g.yAxisRange(0);
DygraphOps.dispatchMouseMove(g, xRange[1], yRange[0]); // this is really necessary.
DygraphOps.dispatchMouseUp(g, xRange[1], yRange[0]);
- assertEqualsDelta(xRange, g.xAxisRange(), 0.2);
- // assertEqualsDelta(originalYRange, g.yAxisRange(0), 0.2); // Not true, it's something in the middle.
+ assert.equalsDelta(xRange, g.xAxisRange(), 0.2);
+ // assert.equalsDelta(originalYRange, g.yAxisRange(0), 0.2); // Not true, it's something in the middle.
var midX = (xRange[1] - xRange[0]) / 2;
DygraphOps.dispatchMouseDown(g, midX, yRange[0]);
DygraphOps.dispatchMouseMove(g, midX, yRange[1]); // this is really necessary.
DygraphOps.dispatchMouseUp(g, midX, yRange[1]);
- assertEqualsDelta(xRange, g.xAxisRange(), 0.2);
- assertEqualsDelta(yRange, g.yAxisRange(0), 0.2);
-}
+ assert.equalsDelta(xRange, g.xAxisRange(), 0.2);
+ assert.equalsDelta(yRange, g.yAxisRange(0), 0.2);
+});
+*/
/**
* This tests that when changing the interaction model so pan is used instead
* of zoom as the default behavior, a standard click method is still called.
*/
-InteractionModelTestCase.prototype.testClickCallbackIsCalled = function() {
+it('testClickCallbackIsCalled', function() {
var clicked;
var clickCallback = function(event, x) {
DygraphOps.dispatchMouseMove_Point(g, 10, 10);
DygraphOps.dispatchMouseUp_Point(g, 10, 10);
- assertEquals(20, clicked);
-};
+ assert.equal(20, clicked);
+});
/**
* This tests that when changing the interaction model so pan is used instead
* of zoom as the default behavior, a standard click method is still called.
*/
-InteractionModelTestCase.prototype.testClickCallbackIsCalledOnCustomPan = function() {
+it('testClickCallbackIsCalledOnCustomPan', function() {
var clicked;
var clickCallback = function(event, x) {
DygraphOps.dispatchMouseMove_Point(g, 10, 10);
DygraphOps.dispatchMouseUp_Point(g, 10, 10);
- assertEquals(20, clicked);
-};
+ assert.equal(20, clicked);
+});
var clickAt = function(g, x, y) {
DygraphOps.dispatchMouseDown(g, x, y);
/**
* This tests that clickCallback is still called with the nonInteractiveModel.
*/
-InteractionModelTestCase.prototype.testClickCallbackIsCalledWithNonInteractiveModel = function() {
+it('testClickCallbackIsCalledWithNonInteractiveModel', function() {
var clicked;
// TODO(danvk): also test pointClickCallback here.
DygraphOps.dispatchMouseMove_Point(g, 10, 10);
DygraphOps.dispatchMouseUp_Point(g, 10, 10);
- assertEquals(20, clicked);
-};
+ assert.equal(20, clicked);
+});
/**
* A sanity test to ensure pointClickCallback is called.
*/
-InteractionModelTestCase.prototype.testPointClickCallback = function() {
+it('testPointClickCallback', function() {
var clicked;
var g = new Dygraph(document.getElementById("graph"), data2, {
pointClickCallback : function(event, point) {
clickAt(g, 4, 40);
- assertEquals(4, clicked.xval);
- assertEquals(40, clicked.yval);
-};
+ assert.equal(4, clicked.xval);
+ assert.equal(40, clicked.yval);
+});
/**
* A sanity test to ensure pointClickCallback is not called when out of range.
*/
-InteractionModelTestCase.prototype.testNoPointClickCallbackWhenOffPoint = function() {
+it('testNoPointClickCallbackWhenOffPoint', function() {
var clicked;
var g = new Dygraph(document.getElementById("graph"), data2, {
pointClickCallback : function(event, point) {
clickAt(g, 5, 40);
- assertUndefined(clicked);
-};
+ assert.isUndefined(clicked);
+});
/**
* Ensures pointClickCallback circle size is taken into account.
*/
-InteractionModelTestCase.prototype.testPointClickCallback_circleSize = function() {
+it('testPointClickCallback_circleSize', function() {
// TODO(konigsberg): Implement.
-};
+});
/**
* Ensures that pointClickCallback is called prior to clickCallback
*/
-InteractionModelTestCase.prototype.testPointClickCallbackCalledPriorToClickCallback = function() {
+it('testPointClickCallbackCalledPriorToClickCallback', function() {
var counter = 0;
var pointClicked;
var clicked;
});
clickAt(g, 4, 40);
- assertEquals(1, pointClicked);
- assertEquals(2, clicked);
-};
+ assert.equal(1, pointClicked);
+ assert.equal(2, clicked);
+});
/**
* Ensures that when there's no pointClickCallback, clicking on a point still calls
* clickCallback
*/
-InteractionModelTestCase.prototype.testClickCallback_clickOnPoint = function() {
+it('testClickCallback_clickOnPoint', function() {
var clicked;
var g = new Dygraph(document.getElementById("graph"), data2, {
clickCallback : function(event, point) {
});
clickAt(g, 4, 40);
- assertEquals(1, clicked);
-};
+ assert.equal(1, clicked);
+});
-InteractionModelTestCase.prototype.testIsZoomed_none = function() {
+it('testIsZoomed_none', function() {
var g = new Dygraph(document.getElementById("graph"), data2, {});
- assertFalse(g.isZoomed());
- assertFalse(g.isZoomed("x"));
- assertFalse(g.isZoomed("y"));
-};
+ assert.isFalse(g.isZoomed());
+ assert.isFalse(g.isZoomed("x"));
+ assert.isFalse(g.isZoomed("y"));
+});
-InteractionModelTestCase.prototype.testIsZoomed_x = function() {
+it('testIsZoomed_x', function() {
var g = new Dygraph(document.getElementById("graph"), data2, {});
DygraphOps.dispatchMouseDown_Point(g, 100, 100);
DygraphOps.dispatchMouseMove_Point(g, 130, 100);
DygraphOps.dispatchMouseUp_Point(g, 130, 100);
- assertTrue(g.isZoomed());
- assertTrue(g.isZoomed("x"));
- assertFalse(g.isZoomed("y"));
-};
+ assert.isTrue(g.isZoomed());
+ assert.isTrue(g.isZoomed("x"));
+ assert.isFalse(g.isZoomed("y"));
+});
-InteractionModelTestCase.prototype.testIsZoomed_y = function() {
+it('testIsZoomed_y', function() {
var g = new Dygraph(document.getElementById("graph"), data2, {});
DygraphOps.dispatchMouseDown_Point(g, 10, 10);
DygraphOps.dispatchMouseMove_Point(g, 10, 30);
DygraphOps.dispatchMouseUp_Point(g, 10, 30);
- assertTrue(g.isZoomed());
- assertFalse(g.isZoomed("x"));
- assertTrue(g.isZoomed("y"));
-};
+ assert.isTrue(g.isZoomed());
+ assert.isFalse(g.isZoomed("x"));
+ assert.isTrue(g.isZoomed("y"));
+});
-InteractionModelTestCase.prototype.testIsZoomed_both = function() {
+it('testIsZoomed_both', function() {
var g = new Dygraph(document.getElementById("graph"), data2, {});
// Zoom x axis
DygraphOps.dispatchMouseUp_Point(g, 100, 130);
- assertTrue(g.isZoomed());
- assertTrue(g.isZoomed("x"));
- assertTrue(g.isZoomed("y"));
-};
+ assert.isTrue(g.isZoomed());
+ assert.isTrue(g.isZoomed("x"));
+ assert.isTrue(g.isZoomed("y"));
+});
-InteractionModelTestCase.prototype.testIsZoomed_updateOptions_none = function() {
+it('testIsZoomed_updateOptions_none', function() {
var g = new Dygraph(document.getElementById("graph"), data2, {});
g.updateOptions({});
- assertFalse(g.isZoomed());
- assertFalse(g.isZoomed("x"));
- assertFalse(g.isZoomed("y"));
-};
+ assert.isFalse(g.isZoomed());
+ assert.isFalse(g.isZoomed("x"));
+ assert.isFalse(g.isZoomed("y"));
+});
-InteractionModelTestCase.prototype.testIsZoomed_updateOptions_x = function() {
+it('testIsZoomed_updateOptions_x', function() {
var g = new Dygraph(document.getElementById("graph"), data2, {});
g.updateOptions({dateWindow: [-.5, .3]});
- assertTrue(g.isZoomed());
- assertTrue(g.isZoomed("x"));
- assertFalse(g.isZoomed("y"));
-};
+ assert.isTrue(g.isZoomed());
+ assert.isTrue(g.isZoomed("x"));
+ assert.isFalse(g.isZoomed("y"));
+});
-InteractionModelTestCase.prototype.testIsZoomed_updateOptions_y = function() {
+it('testIsZoomed_updateOptions_y', function() {
var g = new Dygraph(document.getElementById("graph"), data2, {});
g.updateOptions({valueRange: [1, 10]});
- assertTrue(g.isZoomed());
- assertFalse(g.isZoomed("x"));
- assertTrue(g.isZoomed("y"));
-};
+ assert.isTrue(g.isZoomed());
+ assert.isFalse(g.isZoomed("x"));
+ assert.isTrue(g.isZoomed("y"));
+});
-InteractionModelTestCase.prototype.testIsZoomed_updateOptions_both = function() {
+it('testIsZoomed_updateOptions_both', function() {
var g = new Dygraph(document.getElementById("graph"), data2, {});
g.updateOptions({dateWindow: [-1, 1], valueRange: [1, 10]});
- assertTrue(g.isZoomed());
- assertTrue(g.isZoomed("x"));
- assertTrue(g.isZoomed("y"));
-};
+ assert.isTrue(g.isZoomed());
+ assert.isTrue(g.isZoomed("x"));
+ assert.isTrue(g.isZoomed("y"));
+});
-InteractionModelTestCase.prototype.testCorrectAxisValueRangeAfterUnzoom = function() {
+it('testCorrectAxisValueRangeAfterUnzoom', function() {
var g = new Dygraph(document.getElementById("graph"),
data2, {
valueRange: [1, 50],
DygraphOps.dispatchMouseDown_Point(g, 100, 100);
DygraphOps.dispatchMouseMove_Point(g, 100, 130);
DygraphOps.dispatchMouseUp_Point(g, 100, 130);
- currentYAxisRange = g.yAxisRange();
- currentXAxisRange = g.xAxisRange();
+ var currentYAxisRange = g.yAxisRange();
+ var currentXAxisRange = g.xAxisRange();
//check that the range for the axis has changed
- assertNotEquals(1, currentXAxisRange[0]);
- assertNotEquals(10, currentXAxisRange[1]);
- assertNotEquals(1, currentYAxisRange[0]);
- assertNotEquals(50, currentYAxisRange[1]);
+ assert.notEqual(1, currentXAxisRange[0]);
+ assert.notEqual(10, currentXAxisRange[1]);
+ assert.notEqual(1, currentYAxisRange[0]);
+ assert.notEqual(50, currentYAxisRange[1]);
// unzoom by doubleclick. This is really the order in which a browser
// generates events, and we depend on it.
// check if range for y-axis was reset to original value
// TODO check if range for x-axis is correct.
// Currently not possible because dateRange is set to null and extremes are returned
- newYAxisRange = g.yAxisRange();
- assertEquals(1, newYAxisRange[0]);
- assertEquals(50, newYAxisRange[1]);
-};
+ var newYAxisRange = g.yAxisRange();
+ assert.equal(1, newYAxisRange[0]);
+ assert.equal(50, newYAxisRange[1]);
+});
/**
* Ensures pointClickCallback is called when some points along the y-axis don't
* exist.
*/
-InteractionModelTestCase.prototype.testPointClickCallback_missingData = function() {
+it('testPointClickCallback_missingData', function() {
// There's a B-value at 2, but no A-value.
var data =
clickAt(g, 2, 110);
- assertEquals(2, clicked.xval);
- assertEquals(110, clicked.yval);
-};
+ assert.equal(2, clicked.xval);
+ assert.equal(110, clicked.yval);
+});
+
+});
*/
var ZERO_TO_FIFTY = [[ 10, 0 ] , [ 20, 50 ]];
-var MissingPointsTestCase = TestCase("missing-points");
+describe("missing-points", function() {
var _origFunc = Dygraph.getContext;
-MissingPointsTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
Dygraph.getContext = function(canvas) {
return new Proxy(_origFunc(canvas));
}
-};
+});
-MissingPointsTestCase.prototype.tearDown = function() {
+afterEach(function() {
Dygraph.getContext = _origFunc;
-};
+});
-MissingPointsTestCase.prototype.testSeparatedPointsDontDraw = function() {
+it('testSeparatedPointsDontDraw', function() {
var graph = document.getElementById("graph");
var g = new Dygraph(
graph,
[3, 12, 13]],
{ colors: ['red', 'blue']});
var htx = g.hidden_ctx_;
- assertEquals(2, CanvasAssertions.numLinesDrawn(htx, '#ff0000'));
- assertEquals(0, CanvasAssertions.numLinesDrawn(htx, '#0000ff'));
-};
+ assert.equal(2, CanvasAssertions.numLinesDrawn(htx, '#ff0000'));
+ assert.equal(0, CanvasAssertions.numLinesDrawn(htx, '#0000ff'));
+});
-MissingPointsTestCase.prototype.testSeparatedPointsDontDraw_expanded = function() {
+it('testSeparatedPointsDontDraw_expanded', function() {
var graph = document.getElementById("graph");
var g = new Dygraph(
graph,
{ colors: ['blue']});
var htx = g.hidden_ctx_;
- assertEquals(2, CanvasAssertions.numLinesDrawn(htx, '#0000ff'));
+ assert.equal(2, CanvasAssertions.numLinesDrawn(htx, '#0000ff'));
CanvasAssertions.assertLineDrawn(htx, [56, 275], [161, 212],
{ strokeStyle: '#0000ff', });
CanvasAssertions.assertLineDrawn(htx, [370, 87], [475, 25],
{ strokeStyle: '#0000ff', });
-};
+});
-MissingPointsTestCase.prototype.testSeparatedPointsDontDraw_expanded_connected = function() {
+it('testSeparatedPointsDontDraw_expanded_connected', function() {
var graph = document.getElementById("graph");
var g = new Dygraph(
graph,
var htx = g.hidden_ctx_;
var num_lines = 0;
- assertEquals(3, CanvasAssertions.numLinesDrawn(htx, '#0000ff'));
+ assert.equal(3, CanvasAssertions.numLinesDrawn(htx, '#0000ff'));
CanvasAssertions.assertConsecutiveLinesDrawn(htx,
[[56, 275], [161, 212], [370, 87], [475, 25]],
{ strokeStyle: '#0000ff' });
-};
+});
/**
* At the time of writing this test, the blue series is only points, and not lines.
*/
-MissingPointsTestCase.prototype.testConnectSeparatedPoints = function() {
+it('testConnectSeparatedPoints', function() {
var g = new Dygraph(
document.getElementById("graph"),
[
var htx = g.hidden_ctx_;
- assertEquals(2, CanvasAssertions.numLinesDrawn(htx, '#0000ff'));
+ assert.equal(2, CanvasAssertions.numLinesDrawn(htx, '#0000ff'));
CanvasAssertions.assertConsecutiveLinesDrawn(htx,
[[56, 225], [223, 25], [391, 125]],
{ strokeStyle: '#0000ff' });
- assertEquals(2, CanvasAssertions.numLinesDrawn(htx, '#ff0000'));
+ assert.equal(2, CanvasAssertions.numLinesDrawn(htx, '#ff0000'));
CanvasAssertions.assertConsecutiveLinesDrawn(htx,
[[140, 275], [307, 125], [475, 225]],
{ strokeStyle: '#ff0000' });
-};
+});
/**
* At the time of writing this test, the blue series is only points, and not lines.
*/
-MissingPointsTestCase.prototype.testConnectSeparatedPointsWithNan = function() {
+it('testConnectSeparatedPointsWithNan', function() {
var g = new Dygraph(
document.getElementById("graph"),
"x,A,B \n" +
var htx = g.hidden_ctx_;
// Red has two disconnected line segments
- assertEquals(2, CanvasAssertions.numLinesDrawn(htx, '#ff0000'));
+ assert.equal(2, CanvasAssertions.numLinesDrawn(htx, '#ff0000'));
CanvasAssertions.assertLineDrawn(htx, [102, 275], [195, 212], { strokeStyle: '#ff0000' });
CanvasAssertions.assertLineDrawn(htx, [381, 87], [475, 25], { strokeStyle: '#ff0000' });
// Blue's lines are consecutive, however.
- assertEquals(2, CanvasAssertions.numLinesDrawn(htx, '#0000ff'));
+ assert.equal(2, CanvasAssertions.numLinesDrawn(htx, '#0000ff'));
CanvasAssertions.assertConsecutiveLinesDrawn(htx,
[[56, 244], [149, 181], [242, 118]],
{ strokeStyle: '#0000ff' });
-};
+});
/* These lines contain awesome powa!
var lines = CanvasAssertions.getLinesDrawn(htx, {strokeStyle: "#0000ff"});
}
*/
-MissingPointsTestCase.prototype.testErrorBarsWithMissingPoints = function() {
+it('testErrorBarsWithMissingPoints', function() {
var data = [
[1, [2,1]],
[2, [3,1]],
var htx = g.hidden_ctx_;
- assertEquals(2, CanvasAssertions.numLinesDrawn(htx, '#ff0000'));
+ assert.equal(2, CanvasAssertions.numLinesDrawn(htx, '#ff0000'));
var p0 = g.toDomCoords(data[0][0], data[0][1][0]);
var p1 = g.toDomCoords(data[1][0], data[1][1][0]);
[p0, p1], { strokeStyle: '#ff0000' });
CanvasAssertions.assertConsecutiveLinesDrawn(htx,
[p2, p3], { strokeStyle: '#ff0000' });
-};
+});
-MissingPointsTestCase.prototype.testErrorBarsWithMissingPointsConnected = function() {
+it('testErrorBarsWithMissingPointsConnected', function() {
var data = [
[1, [null,1]],
[2, [2,1]],
var htx = g.hidden_ctx_;
- assertEquals(2, CanvasAssertions.numLinesDrawn(htx, '#ff0000'));
+ assert.equal(2, CanvasAssertions.numLinesDrawn(htx, '#ff0000'));
var p1 = g.toDomCoords(data[1][0], data[1][1][0]);
var p2 = g.toDomCoords(data[3][0], data[3][1][0]);
CanvasAssertions.assertConsecutiveLinesDrawn(htx,
[p1, p2, p3],
{ strokeStyle: '#ff0000' });
-};
-MissingPointsTestCase.prototype.testCustomBarsWithMissingPoints = function() {
+});
+it('testCustomBarsWithMissingPoints', function() {
var data = [
[1, [1,2,3]],
[2, [2,3,4]],
var htx = g.hidden_ctx_;
- assertEquals(4, CanvasAssertions.numLinesDrawn(htx, '#ff0000'));
+ assert.equal(4, CanvasAssertions.numLinesDrawn(htx, '#ff0000'));
var p0 = g.toDomCoords(data[0][0], data[0][1][1]);
var p1 = g.toDomCoords(data[1][0], data[1][1][1]);
p0 = g.toDomCoords(data[9][0], data[9][1][1]);
p1 = g.toDomCoords(data[10][0], data[10][1][1]);
CanvasAssertions.assertLineDrawn(htx, p0, p1, { strokeStyle: '#ff0000' });
-};
+});
-MissingPointsTestCase.prototype.testCustomBarsWithMissingPointsConnected = function() {
+it('testCustomBarsWithMissingPointsConnected', function() {
var data = [
[1, [1,null,1]],
[2, [1,2,3]],
var htx = g.hidden_ctx_;
- assertEquals(2, CanvasAssertions.numLinesDrawn(htx, '#ff0000'));
+ assert.equal(2, CanvasAssertions.numLinesDrawn(htx, '#ff0000'));
var p1 = g.toDomCoords(data[1][0], data[1][1][1]);
var p2 = g.toDomCoords(data[3][0], data[3][1][1]);
CanvasAssertions.assertConsecutiveLinesDrawn(htx,
[p1, p2, p3],
{ strokeStyle: '#ff0000' });
-};
+});
-MissingPointsTestCase.prototype.testLeftBoundaryWithMisingPoints = function() {
+it('testLeftBoundaryWithMisingPoints', function() {
var data = [
[1, null, 3],
[2, 1, null],
}
);
g.updateOptions({ dateWindow : [ 2.5, 4.5 ] });
- assertEquals(1, g.getLeftBoundary_(0));
- assertEquals(0, g.getLeftBoundary_(1));
+ assert.equal(1, g.getLeftBoundary_(0));
+ assert.equal(0, g.getLeftBoundary_(1));
var domX = g.toDomXCoord(1.9);
var closestRow = g.findClosestRow(domX);
- assertEquals(1, closestRow);
+ assert.equal(1, closestRow);
g.setSelection(closestRow);
- assertEquals(1, g.selPoints_.length);
- assertEquals(1, g.selPoints_[0].yval);
+ assert.equal(1, g.selPoints_.length);
+ assert.equal(1, g.selPoints_[0].yval);
g.setSelection(3);
- assertEquals(2, g.selPoints_.length);
- assertEquals(g.selPoints_[0].xval, g.selPoints_[1].xval);
- assertEquals(2, g.selPoints_[0].yval);
- assertEquals(1, g.selPoints_[1].yval);
-};
+ assert.equal(2, g.selPoints_.length);
+ assert.equal(g.selPoints_[0].xval, g.selPoints_[1].xval);
+ assert.equal(2, g.selPoints_[0].yval);
+ assert.equal(1, g.selPoints_[1].yval);
+});
// Regression test for issue #411
-MissingPointsTestCase.prototype.testEmptySeries = function() {
+it('testEmptySeries', function() {
var graphDiv = document.getElementById("graph");
var g = new Dygraph(
graphDiv,
});
g.setSelection(6);
- assertEquals("1381134466: Series 2: 94", Util.getLegend(graphDiv));
-};
+ assert.equal("1381134466: Series 2: 94", Util.getLegend(graphDiv));
+});
// Regression test for issue #485
-MissingPointsTestCase.prototype.testMissingFill = function() {
+it('testMissingFill', function() {
var graphDiv = document.getElementById("graph");
var N = null;
var g = new Dygraph(
var call = htx.calls__[i];
if ((call.name == 'moveTo' || call.name == 'lineTo') && call.args) {
for (var j = 0; j < call.args.length; j++) {
- assertFalse(isNaN(call.args[j]));
+ assert.isFalse(isNaN(call.args[j]));
}
}
}
-};
+});
+
+});
*
* @author dan@dygraphs.com (Dan Vanderkam)
*/
-var MultiCsvTestCase = TestCase("multi-csv");
+describe("multi-csv", function() {
-MultiCsvTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
-};
+});
-MultiCsvTestCase.prototype.tearDown = function() {
-};
+afterEach(function() {
+});
function getXLabels() {
var x_labels = document.getElementsByClassName("dygraph-axis-label-x");
return ary;
}
-MultiCsvTestCase.prototype.testOneCSV = function() {
+it('testOneCSV', function() {
var opts = {
width: 480,
height: 320
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
- assertEquals(['0', '1', '2'], getXLabels());
-};
+ assert.deepEqual(['0', '1', '2'], getXLabels());
+});
-MultiCsvTestCase.prototype.testTwoCSV = function() {
+it('testTwoCSV', function() {
var opts = {
width: 480,
height: 320
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
- assertEquals(['0', '1', '2'], getXLabels());
+ assert.deepEqual(['0', '1', '2'], getXLabels());
g.updateOptions({file: data});
- assertEquals(['0', '1', '2'], getXLabels());
-};
+ assert.deepEqual(['0', '1', '2'], getXLabels());
+});
+
+});
* @author danvdk@gmail.com (Dan Vanderkam)
*/
-var MultipleAxesTestCase = TestCase("multiple-axes-tests");
+describe("multiple-axes-tests", function() {
-MultipleAxesTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
-};
+});
var getData = function() {
var data = [];
return data;
};
-MultipleAxesTestCase.prototype.testBasicMultipleAxes = function() {
+it('testBasicMultipleAxes', function() {
var data = getData();
var g = new Dygraph(
}
);
- assertEquals(["0","20","40","60","80","100"], Util.getYLabels("1"));
- assertEquals(["900K","1.12M","1.34M","1.55M","1.77M","1.99M"], Util.getYLabels("2"));
-};
+ assert.deepEqual(["0","20","40","60","80","100"], Util.getYLabels("1"));
+ assert.deepEqual(["900K","1.12M","1.34M","1.55M","1.77M","1.99M"], Util.getYLabels("2"));
+});
-MultipleAxesTestCase.prototype.testTwoAxisVisibility = function() {
+it('testTwoAxisVisibility', function() {
var data = [];
data.push([0,0,0]);
data.push([1,2,2000]);
}
);
- assertTrue(document.getElementsByClassName("dygraph-axis-label-y").length > 0);
- assertTrue(document.getElementsByClassName("dygraph-axis-label-y2").length > 0);
+ assert.isTrue(document.getElementsByClassName("dygraph-axis-label-y").length > 0);
+ assert.isTrue(document.getElementsByClassName("dygraph-axis-label-y2").length > 0);
g.setVisibility(0, false);
- assertTrue(document.getElementsByClassName("dygraph-axis-label-y").length > 0);
- assertTrue(document.getElementsByClassName("dygraph-axis-label-y2").length > 0);
+ assert.isTrue(document.getElementsByClassName("dygraph-axis-label-y").length > 0);
+ assert.isTrue(document.getElementsByClassName("dygraph-axis-label-y2").length > 0);
g.setVisibility(0, true);
g.setVisibility(1, false);
- assertTrue(document.getElementsByClassName("dygraph-axis-label-y").length > 0);
- assertTrue(document.getElementsByClassName("dygraph-axis-label-y2").length > 0);
-};
+ assert.isTrue(document.getElementsByClassName("dygraph-axis-label-y").length > 0);
+ assert.isTrue(document.getElementsByClassName("dygraph-axis-label-y2").length > 0);
+});
// verifies that all four chart labels (title, x-, y-, y2-axis label) can be
// used simultaneously.
-MultipleAxesTestCase.prototype.testMultiChartLabels = function() {
+it('testMultiChartLabels', function() {
var data = getData();
var el = document.getElementById("graph");
}
);
- assertEquals(["Chart title", "x-axis", "y-axis", "y2-axis"],
+ assert.deepEqual(["Chart title", "x-axis", "y-axis", "y2-axis"],
Util.getClassTexts("dygraph-label"));
- assertEquals(["Chart title"], Util.getClassTexts("dygraph-title"));
- assertEquals(["x-axis"], Util.getClassTexts("dygraph-xlabel"));
- assertEquals(["y-axis"], Util.getClassTexts("dygraph-ylabel"));
- assertEquals(["y2-axis"], Util.getClassTexts("dygraph-y2label"));
+ assert.deepEqual(["Chart title"], Util.getClassTexts("dygraph-title"));
+ assert.deepEqual(["x-axis"], Util.getClassTexts("dygraph-xlabel"));
+ assert.deepEqual(["y-axis"], Util.getClassTexts("dygraph-ylabel"));
+ assert.deepEqual(["y2-axis"], Util.getClassTexts("dygraph-y2label"));
// TODO(danvk): check relative positioning here: title on top, y left of y2.
-};
+});
// Check that a chart w/o a secondary y-axis will not get a y2label, even if one
// is specified.
-MultipleAxesTestCase.prototype.testNoY2LabelWithoutSecondaryAxis = function() {
+it('testNoY2LabelWithoutSecondaryAxis', function() {
var g = new Dygraph(
document.getElementById("graph"),
getData(),
}
);
- assertEquals(["Chart title", "x-axis", "y-axis"],
+ assert.deepEqual(["Chart title", "x-axis", "y-axis"],
Util.getClassTexts("dygraph-label"));
- assertEquals(["Chart title"], Util.getClassTexts("dygraph-title"));
- assertEquals(["x-axis"], Util.getClassTexts("dygraph-xlabel"));
- assertEquals(["y-axis"], Util.getClassTexts("dygraph-ylabel"));
- assertEquals([], Util.getClassTexts("dygraph-y2label"));
-};
+ assert.deepEqual(["Chart title"], Util.getClassTexts("dygraph-title"));
+ assert.deepEqual(["x-axis"], Util.getClassTexts("dygraph-xlabel"));
+ assert.deepEqual(["y-axis"], Util.getClassTexts("dygraph-ylabel"));
+ assert.deepEqual([], Util.getClassTexts("dygraph-y2label"));
+});
-MultipleAxesTestCase.prototype.testValueRangePerAxisOptions = function() {
+it('testValueRangePerAxisOptions', function() {
var data = getData();
- g = new Dygraph(
+ var g = new Dygraph(
document.getElementById("graph"),
data,
{
y2label: 'Secondary y-axis',
}
);
- assertEquals(["40", "45", "50", "55", "60", "65"], Util.getYLabels("1"));
- assertEquals(["900K","1.1M","1.3M","1.5M","1.7M","1.9M"], Util.getYLabels("2"));
+ assert.deepEqual(["40", "45", "50", "55", "60", "65"], Util.getYLabels("1"));
+ assert.deepEqual(["900K","1.1M","1.3M","1.5M","1.7M","1.9M"], Util.getYLabels("2"));
g.updateOptions(
{
}
}
);
- assertEquals(["40", "45", "50", "55", "60", "65", "70", "75"], Util.getYLabels("1"));
- assertEquals(["1M", "1.02M", "1.05M", "1.08M", "1.1M", "1.13M", "1.15M", "1.18M"], Util.getYLabels("2"));
-};
+ assert.deepEqual(["40", "45", "50", "55", "60", "65", "70", "75"], Util.getYLabels("1"));
+ assert.deepEqual(["1M", "1.02M", "1.05M", "1.08M", "1.1M", "1.13M", "1.15M", "1.18M"], Util.getYLabels("2"));
+});
-MultipleAxesTestCase.prototype.testDrawPointCallback = function() {
+it('testDrawPointCallback', function() {
var data = getData();
var results = { y : {}, y2 : {}};
Dygraph.Circles.DEFAULT(g, seriesName, ctx, canvasx, canvasy, color, radius);
};
- g = new Dygraph(
+ var g = new Dygraph(
document.getElementById("graph"),
data,
{
}
);
- assertEquals(1, results.y["Y1"]);
- assertEquals(1, results.y["Y2"]);
- assertEquals(1, results.y2["Y3"]);
- assertEquals(1, results.y2["Y4"]);
-};
+ assert.equal(1, results.y["Y1"]);
+ assert.equal(1, results.y["Y2"]);
+ assert.equal(1, results.y2["Y3"]);
+ assert.equal(1, results.y2["Y4"]);
+});
// Test for http://code.google.com/p/dygraphs/issues/detail?id=436
-MultipleAxesTestCase.prototype.testRemovingSecondAxis = function() {
+it('testRemovingSecondAxis', function() {
var data = getData();
var results = { y : {}, y2 : {}};
- g = new Dygraph(
+ var g = new Dygraph(
document.getElementById("graph"),
data,
{
);
g.updateOptions({ series : { Y4 : { axis : 'y' } } });
-};
+});
+
+});
*
* @author danvk@google.com (Dan Vanderkam)
*/
-var noHoursTestCase = TestCase("no-hours");
+describe("no-hours", function() {
-noHoursTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
-};
+});
-noHoursTestCase.prototype.tearDown = function() {
-};
+afterEach(function() {
+});
-noHoursTestCase.prototype.testNoHours = function() {
+it('testNoHours', function() {
var opts = {
width: 480,
height: 320
var g = new Dygraph(graph, data, opts);
g.setSelection(0);
- assertEquals("2012/03/13: Y: -1", Util.getLegend());
+ assert.equal("2012/03/13: Y: -1", Util.getLegend());
g.setSelection(1);
- assertEquals("2012/03/14: Y: 0", Util.getLegend());
+ assert.equal("2012/03/14: Y: 0", Util.getLegend());
g.setSelection(2);
- assertEquals("2012/03/15: Y: 1", Util.getLegend());
+ assert.equal("2012/03/15: Y: 1", Util.getLegend());
g.setSelection(3);
- assertEquals("2012/03/16: Y: 0", Util.getLegend());
-};
+ assert.equal("2012/03/16: Y: 0", Util.getLegend());
+});
-noHoursTestCase.prototype.testNoHoursDashed = function() {
+it('testNoHoursDashed', function() {
var opts = {
width: 480,
height: 320
var g = new Dygraph(graph, data, opts);
g.setSelection(0);
- assertEquals("2012/03/13: Y: -1", Util.getLegend());
+ assert.equal("2012/03/13: Y: -1", Util.getLegend());
g.setSelection(1);
- assertEquals("2012/03/14: Y: 0", Util.getLegend());
+ assert.equal("2012/03/14: Y: 0", Util.getLegend());
g.setSelection(2);
- assertEquals("2012/03/15: Y: 1", Util.getLegend());
+ assert.equal("2012/03/15: Y: 1", Util.getLegend());
g.setSelection(3);
- assertEquals("2012/03/16: Y: 0", Util.getLegend());
-};
+ assert.equal("2012/03/16: Y: 0", Util.getLegend());
+});
+
+});
* @author danvdk@gmail.com (Dan Vanderkam)
*/
-var NumericTickerTestCase = TestCase("numeric-ticker-tests");
+describe("numeric-ticker-tests", function() {
-NumericTickerTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
-};
+});
var createOptionsViewForAxis = function(axis, dict) {
return function (x) {
};
};
-NumericTickerTestCase.prototype.testBasicNumericTicker = function() {
+it('testBasicNumericTicker', function() {
var opts = {"logscale":null,"labelsKMG2":false,"labelsKMB":false};
var options = createOptionsViewForAxis('y', opts);
{"v":3.5,"label":"3.5"},
{"v":4,"label":"4"},
{"v":4.5,"label":"4.5"}];
- assertEquals(expected_ticks, ticks);
+ assert.equal(expected_ticks, ticks);
ticks = Dygraph.numericTicks(1, 84, 540, options);
var expected_ticks = [
{"v":80,"label":"80"},
{"v":85,"label":"85"}
];
- assertEquals(expected_ticks, ticks);
-};
+ assert.equal(expected_ticks, ticks);
+});
/*
-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, 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})));
-};
+it('testAllNumericTickers', function() {
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"v":0,"label":"0"}], Dygraph.numericTicks(26.185714285714287, 90.81428571428572, 20, createOptionsViewForAxis('y',{"logscale":null,"labelsKMG2":false,"labelsKMB":false})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+ assert.deepEqual([{"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})));
+});
*/
+
+});
*
* @author danvk@google.com (Dan Vanderkam)
*/
-var parserTestCase = TestCase("parser");
+describe("parser", function() {
-parserTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
-};
+});
-parserTestCase.prototype.tearDown = function() {
-};
+afterEach(function() {
+});
-parserTestCase.prototype.testDetectLineDelimiter = function() {
+it('testDetectLineDelimiter', function() {
var data = "X,Y\r" +
"0,-1\r" +
"1,0\r" +
"2,1\r" +
"3,0\r"
;
- assertEquals("\r", Dygraph.detectLineDelimiter(data));
+ assert.equal("\r", Dygraph.detectLineDelimiter(data));
data = "X,Y\n" +
"0,-1\n" +
"2,1\n" +
"3,0\n"
;
- assertEquals("\n", Dygraph.detectLineDelimiter(data));
+ assert.equal("\n", Dygraph.detectLineDelimiter(data));
data = "X,Y\n\r" +
"0,-1\n\r" +
"2,1\n\r" +
"3,0\n\r"
;
- assertEquals("\n\r", Dygraph.detectLineDelimiter(data));
-};
+ assert.equal("\n\r", Dygraph.detectLineDelimiter(data));
+});
-parserTestCase.prototype.testParseDosNewlines = function() {
+it('testParseDosNewlines', function() {
var opts = {
width: 480,
height: 320
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
- assertEquals(0, g.getValue(0, 0));
- assertEquals(-1, g.getValue(0, 1));
- assertEquals(1, g.getValue(1, 0));
- assertEquals(0, g.getValue(1, 1));
- assertEquals(['X', 'Y'], g.getLabels());
-};
+ assert.equal(0, g.getValue(0, 0));
+ assert.equal(-1, g.getValue(0, 1));
+ assert.equal(1, g.getValue(1, 0));
+ assert.equal(0, g.getValue(1, 1));
+ assert.deepEqual(['X', 'Y'], g.getLabels());
+});
+
+});
*
* @author dan@dygraphs.com (Dan Vanderkam)
*/
-var pathologicalCasesTestCase = TestCase("pathological-cases");
+describe("pathological-cases", function() {
-pathologicalCasesTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
-};
+});
-pathologicalCasesTestCase.prototype.tearDown = function() {
-};
+afterEach(function() {
+});
-pathologicalCasesTestCase.prototype.testZeroPoint = function() {
+it('testZeroPoint', function() {
var opts = {
width: 480,
height: 320
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
-};
+});
-pathologicalCasesTestCase.prototype.testOnePoint = function() {
+it('testOnePoint', function() {
var opts = {
width: 480,
height: 320
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
-};
+});
-pathologicalCasesTestCase.prototype.testCombinations = function() {
+it('testCombinations', function() {
var dataSets = {
empty: [],
onePoint: [[10, 2]],
}
}
}
-};
+});
-pathologicalCasesTestCase.prototype.testNullLegend = function() {
+it('testNullLegend', function() {
var opts = {
width: 480,
height: 320,
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
-};
+});
-pathologicalCasesTestCase.prototype.testDivAsString = function() {
+it('testDivAsString', function() {
var data = "X,Y\n" +
"1,2\n";
var g = new Dygraph('graph', data, {});
-};
+});
-pathologicalCasesTestCase.prototype.testConstantSeriesNegative = function() {
+it('testConstantSeriesNegative', function() {
var data = "X,Y\n" +
"1,-1\n" +
"2,-1\n";
- g = new Dygraph('graph', data, {});
+ var g = new Dygraph('graph', data, {});
// This check could be loosened to
// g.yAxisRange()[0] < g.yAxisRange()[1] if it breaks in the future.
- assertEquals([-1.1, -0.9], g.yAxisRange());
-};
+ assert.deepEqual([-1.1, -0.9], g.yAxisRange());
+});
-pathologicalCasesTestCase.prototype.testConstantSeriesNegativeIncludeZero = function() {
+it('testConstantSeriesNegativeIncludeZero', function() {
var data = "X,Y\n" +
"1,-1\n" +
"2,-1\n";
- g = new Dygraph('graph', data, {includeZero: true});
+ var g = new Dygraph('graph', data, {includeZero: true});
// This check could be loosened to
// g.yAxisRange()[0] < g.yAxisRange()[1] if it breaks in the future.
- assertEquals([-1.1, 0], g.yAxisRange());
-};
+ assert.deepEqual([-1.1, 0], g.yAxisRange());
+});
+
+});
*
* @author konigsberg@google.com (Robert Konigsberg)
*/
-var perAxisTestCase = TestCase("per-axis");
+describe("per-axis", function() {
var _origGetContext = Dygraph.getContext;
var g, graph;
-perAxisTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
Dygraph.getContext = function(canvas) {
return new Proxy(_origGetContext(canvas));
;
graph = document.getElementById('graph');
g = new Dygraph(graph, data, opts);
-};
+});
-perAxisTestCase.prototype.tearDown = function() {
+afterEach(function() {
Dygraph.getContext = _origGetContext;
-};
+});
-perAxisTestCase.prototype.testDrawXAxis = function() {
+it('testDrawXAxis', function() {
g.updateOptions({ axes : { x : { drawAxis: true }} });
- assertTrue(graph.getElementsByClassName('dygraph-axis-label-x').length > 0);
- assertTrue(graph.getElementsByClassName('dygraph-axis-label-y').length == 0);
-}
+ assert.isTrue(graph.getElementsByClassName('dygraph-axis-label-x').length > 0);
+ assert.isTrue(graph.getElementsByClassName('dygraph-axis-label-y').length == 0);
+});
-perAxisTestCase.prototype.testDrawYAxis = function() {
+it('testDrawYAxis', function() {
g.updateOptions({ axes : { y : { drawAxis: true }} });
- assertTrue(graph.getElementsByClassName('dygraph-axis-label-x').length ==0);
- assertTrue(graph.getElementsByClassName('dygraph-axis-label-y').length > 0);
-}
+ assert.isTrue(graph.getElementsByClassName('dygraph-axis-label-x').length ==0);
+ assert.isTrue(graph.getElementsByClassName('dygraph-axis-label-y').length > 0);
+});
-perAxisTestCase.prototype.testDrawXGrid = function() {
+it('testDrawXGrid', function() {
g.updateOptions({ axes : { x : { drawGrid : true }}});
var htx = g.hidden_ctx_;
- assertTrue(CanvasAssertions.numLinesDrawn(htx, xAxisLineColor) > 0);
- assertTrue(CanvasAssertions.numLinesDrawn(htx, yAxisLineColor) == 0);
-}
+ assert.isTrue(CanvasAssertions.numLinesDrawn(htx, xAxisLineColor) > 0);
+ assert.isTrue(CanvasAssertions.numLinesDrawn(htx, yAxisLineColor) == 0);
+});
-perAxisTestCase.prototype.testDrawYGrid = function() {
+it('testDrawYGrid', function() {
g.updateOptions({ axes : { y : { drawGrid : true }}});
var htx = g.hidden_ctx_;
- assertTrue(CanvasAssertions.numLinesDrawn(htx, xAxisLineColor) == 0);
- assertTrue(CanvasAssertions.numLinesDrawn(htx, yAxisLineColor) > 0);
-}
+ assert.isTrue(CanvasAssertions.numLinesDrawn(htx, xAxisLineColor) == 0);
+ assert.isTrue(CanvasAssertions.numLinesDrawn(htx, yAxisLineColor) > 0);
+});
+
+});
*
* @author danvk@google.com (Dan Vanderkam)
*/
-var perSeriesTestCase = TestCase("per-series");
+describe("per-series", function() {
-perSeriesTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
-};
+});
-perSeriesTestCase.prototype.tearDown = function() {
-};
+afterEach(function() {
+});
-perSeriesTestCase.prototype.testPerSeriesFill = function() {
+it('testPerSeriesFill', function() {
var opts = {
width: 480,
height: 320,
;
var graph = document.getElementById("graph");
- g = new Dygraph(graph, data, opts);
+ var g = new Dygraph(graph, data, opts);
var sampler = new PixelSampler(g);
// Inside of the "Z" bump -- no fill.
- assertEquals([0,0,0,0], sampler.colorAtCoordinate(2.5, 0.5));
+ assert.deepEqual([0,0,0,0], sampler.colorAtCoordinate(2.5, 0.5));
// Inside of the "Y" bump -- filled in.
- assertEquals([255,0,0,38], sampler.colorAtCoordinate(6.5, 0.5));
-};
+ assert.deepEqual([255,0,0,38], sampler.colorAtCoordinate(6.5, 0.5));
+});
-perSeriesTestCase.prototype.testNewStyleSeries = function() {
+it('testNewStyleSeries', function() {
var opts = {
pointSize : 5,
series : {
};
var graph = document.getElementById("graph");
var data = "X,Y,Z\n1,0,0\n";
- g = new Dygraph(graph, data, opts);
+ var g = new Dygraph(graph, data, opts);
- assertEquals(5, g.getOption("pointSize"));
- assertEquals(4, g.getOption("pointSize", "Y"));
- assertEquals(5, g.getOption("pointSize", "Z"));
-};
+ assert.equal(5, g.getOption("pointSize"));
+ assert.equal(4, g.getOption("pointSize", "Y"));
+ assert.equal(5, g.getOption("pointSize", "Z"));
+});
// TODO(konigsberg): move to multiple_axes.js
-perSeriesTestCase.prototype.testAxisInNewSeries = function() {
+it('testAxisInNewSeries', function() {
var opts = {
series : {
D : { axis : 'y2' },
};
var graph = document.getElementById("graph");
var data = "X,A,B,C,D,E\n0,1,2,3,4,5\n";
- g = new Dygraph(graph, data, opts);
+ var g = new Dygraph(graph, data, opts);
- assertEquals(["A", "B", "E"], g.attributes_.seriesForAxis(0));
- assertEquals(["C", "D"], g.attributes_.seriesForAxis(1));
-};
+ assert.deepEqual(["A", "B", "E"], g.attributes_.seriesForAxis(0));
+ assert.deepEqual(["C", "D"], g.attributes_.seriesForAxis(1));
+});
// TODO(konigsberg): move to multiple_axes.js
-perSeriesTestCase.prototype.testAxisInNewSeries_withAxes = function() {
+it('testAxisInNewSeries_withAxes', function() {
var opts = {
series : {
D : { axis : 'y2' },
};
var graph = document.getElementById("graph");
var data = "X,A,B,C,D,E\n0,1,2,3,4,5\n";
- g = new Dygraph(graph, data, opts);
+ var g = new Dygraph(graph, data, opts);
- assertEquals(["A", "B", "E"], g.attributes_.seriesForAxis(0));
- assertEquals(["C", "D"], g.attributes_.seriesForAxis(1));
+ assert.deepEqual(["A", "B", "E"], g.attributes_.seriesForAxis(0));
+ assert.deepEqual(["C", "D"], g.attributes_.seriesForAxis(1));
- assertEquals(1.5, g.getOption("pointSize"));
- assertEquals(7, g.getOption("pointSize", "A"));
- assertEquals(7, g.getOption("pointSize", "B"));
- assertEquals(6, g.getOption("pointSize", "C"));
- assertEquals(6, g.getOption("pointSize", "D"));
- assertEquals(7, g.getOption("pointSize", "E"));
-};
+ assert.equal(1.5, g.getOption("pointSize"));
+ assert.equal(7, g.getOption("pointSize", "A"));
+ assert.equal(7, g.getOption("pointSize", "B"));
+ assert.equal(6, g.getOption("pointSize", "C"));
+ assert.equal(6, g.getOption("pointSize", "D"));
+ assert.equal(7, g.getOption("pointSize", "E"));
+});
// TODO(konigsberg): move to multiple_axes.js
-perSeriesTestCase.prototype.testOldAxisSpecInNewSeriesThrows = function() {
+it('testOldAxisSpecInNewSeriesThrows', function() {
var opts = {
series : {
D : { axis : {} },
threw = true;
}
- assertTrue(threw);
-}
+ assert.isTrue(threw);
+});
-perSeriesTestCase.prototype.testColorOption = function() {
+it('testColorOption', function() {
var graph = document.getElementById("graph");
var data = "X,A,B,C\n0,1,2,3\n";
var g = new Dygraph(graph, data, {});
- assertEquals(['rgb(64,128,0)', 'rgb(64,0,128)', 'rgb(0,128,128)'], g.getColors());
+ assert.deepEqual(['rgb(64,128,0)', 'rgb(64,0,128)', 'rgb(0,128,128)'], g.getColors());
g.updateOptions({series : { B : { color : 'purple' }}});
- assertEquals(['rgb(64,128,0)', 'purple', 'rgb(0,128,128)'], g.getColors());
-}
+ assert.deepEqual(['rgb(64,128,0)', 'purple', 'rgb(0,128,128)'], g.getColors());
+});
+
+});
*
* @author konigsberg@google.com (Robert Konigsberg)
*/
-var pluginsTestCase = TestCase("plugins");
+describe("plugins", function() {
var data;
-pluginsTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
data = "X,Y1,Y2\n" +
"2,1,2\n" +
"3,2,1\n"
;
-};
+});
-pluginsTestCase.prototype.tearDown = function() {
-};
+afterEach(function() {
+});
-pluginsTestCase.prototype.testWillDrawChart = function() {
+it('testWillDrawChart', function() {
var draw = 0;
var plugin = (function() {
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, {plugins: [plugin]});
- assertEquals(1, draw);
-};
+ assert.equal(1, draw);
+});
-pluginsTestCase.prototype.testPassingInstance = function() {
+it('testPassingInstance', function() {
// You can also pass an instance of a plugin instead of a Plugin class.
var draw = 0;
var p = {
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, {plugins: [p]});
- assertEquals(1, draw);
-};
+ assert.equal(1, draw);
+});
-pluginsTestCase.prototype.testPreventDefault = function() {
+it('testPreventDefault', function() {
var data1 = "X,Y\n" +
"20,-1\n" +
"21,0\n" +
p.pointClickPreventDefault = false;
p.clickPreventDefault = false;
clickOnPoint();
- assertEquals([
+ assert.deepEqual([
['plugin.pointClick', 20, -1],
['pointClickCallback', 20, -1],
['plugin.click', 20],
p.pointClickPreventDefault = true;
p.clickPreventDefault = false;
clickOnPoint();
- assertEquals([
+ assert.deepEqual([
['plugin.pointClick', 20, -1]
], events);
p.pointClickPreventDefault = false;
p.clickPreventDefault = true;
clickOnPoint();
- assertEquals([
+ assert.deepEqual([
['plugin.pointClick', 20, -1],
['pointClickCallback', 20, -1],
['plugin.click', 20]
], events);
-};
+});
-pluginsTestCase.prototype.testEventSequence = function() {
+it('testEventSequence', function() {
var events = [];
var eventLogger = function(name) {
var g = new Dygraph(graph, data, {plugins: [p]});
// Initial draw sequence
- assertEquals([
+ assert.deepEqual([
"dataDidUpdate", // should dataWillUpdate be called here, too?
"predraw",
"clearChart",
// An options change triggers a redraw, but doesn't change the data.
events = [];
g.updateOptions({series: {Y1: {color: 'blue'}}});
- assertEquals([
+ assert.deepEqual([
"predraw",
"clearChart",
"willDrawChart",
DygraphOps.dispatchMouseDown_Point(g, 100, 100, {shiftKey: true});
DygraphOps.dispatchMouseMove_Point(g, 200, 100, {shiftKey: true});
DygraphOps.dispatchMouseUp_Point(g, 200, 100, {shiftKey: true});
- assertEquals([
+ assert.deepEqual([
"clearChart",
"willDrawChart",
"didDrawChart"
// New data triggers the full sequence.
events = [];
g.updateOptions({file: data + '\n4,1,2'});
- assertEquals([
+ assert.deepEqual([
"dataWillUpdate",
"dataDidUpdate",
"predraw",
"willDrawChart",
"didDrawChart"
], events);
-};
+});
-pluginsTestCase.prototype.testDestroyCalledInOrder = function() {
+it('testDestroyCalledInOrder', function() {
var destructions = [];
var makePlugin = function(name) {
return {
plugins: [makePlugin('p'), makePlugin('q')]
});
- assertEquals([], destructions);
+ assert.deepEqual([], destructions);
g.destroy();
- assertEquals(['q', 'p'], destructions);
-};
+ assert.deepEqual(['q', 'p'], destructions);
+});
+
+});
*
* @author akiya.mizukoshi@gmail.com (Akiyah)
*/
-var pluginsLegendTestCase = TestCase("plugins-legend");
+describe("plugins-legend", function() {
-pluginsLegendTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
-};
+});
-pluginsLegendTestCase.prototype.tearDown = function() {
-};
+afterEach(function() {
+});
-pluginsLegendTestCase.prototype.testLegendEscape = function() {
+it('testLegendEscape', function() {
var opts = {
width: 480,
height: 320
legendPlugin.select(e);
var legendSpan = $(legendPlugin.legend_div_).find("span b span");
- assertEquals("<script>alert('XSS')</script>", legendSpan.html());
-};
+ assert.equal("<script>alert('XSS')</script>", legendSpan.html());
+});
+
+});
* @fileoverview Regression tests for range selector.
* @author paul.eric.felix@gmail.com (Paul Felix)
*/
-var RangeSelectorTestCase = TestCase("range-selector");
+describe("range-selector", function() {
-RangeSelectorTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
-};
+});
-RangeSelectorTestCase.prototype.tearDown = function() {
-};
+afterEach(function() {
+});
-RangeSelectorTestCase.prototype.testRangeSelector = function() {
+it('testRangeSelector', function() {
var opts = {
width: 480,
height: 320,
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
assertGraphExistence(g, graph);
-};
+});
-RangeSelectorTestCase.prototype.testRangeSelectorWithErrorBars = function() {
+it('testRangeSelectorWithErrorBars', function() {
var opts = {
width: 480,
height: 320,
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
assertGraphExistence(g, graph);
-};
+});
-RangeSelectorTestCase.prototype.testRangeSelectorWithCustomBars = function() {
+it('testRangeSelectorWithCustomBars', function() {
var opts = {
width: 480,
height: 320,
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
assertGraphExistence(g, graph);
-};
+});
-RangeSelectorTestCase.prototype.testRangeSelectorWithLogScale = function() {
+it('testRangeSelectorWithLogScale', function() {
var opts = {
width: 480,
height: 320,
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
assertGraphExistence(g, graph);
-};
+});
-RangeSelectorTestCase.prototype.testRangeSelectorOptions = function() {
+it('testRangeSelectorOptions', function() {
var opts = {
width: 480,
height: 320,
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
assertGraphExistence(g, graph);
-};
+});
-RangeSelectorTestCase.prototype.testAdditionalRangeSelectorOptions = function() {
+it('testAdditionalRangeSelectorOptions', function() {
var opts = {
width: 480,
height: 320,
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
assertGraphExistence(g, graph);
-};
+});
-RangeSelectorTestCase.prototype.testRangeSelectorEnablingAfterCreation = function() {
+it('testRangeSelectorEnablingAfterCreation', function() {
var opts = {
width: 480,
height: 320,
var g = new Dygraph(graph, data, opts);
g.updateOptions({showRangeSelector: true});
assertGraphExistence(g, graph);
-};
+});
// The animatedZooms option does not work with the range selector. Make sure it gets turned off.
-RangeSelectorTestCase.prototype.testRangeSelectorWithAnimatedZoomsOption = function() {
+it('testRangeSelectorWithAnimatedZoomsOption', function() {
var opts = {
width: 480,
height: 320,
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
assertGraphExistence(g, graph);
- assertFalse(g.getOption('animatedZooms'));
-};
+ assert.isFalse(g.getOption('animatedZooms'));
+});
-RangeSelectorTestCase.prototype.testRangeSelectorWithAnimatedZoomsOption2 = function() {
+it('testRangeSelectorWithAnimatedZoomsOption2', function() {
var opts = {
width: 480,
height: 320,
var g = new Dygraph(graph, data, opts);
g.updateOptions({showRangeSelector: true});
assertGraphExistence(g, graph);
- assertFalse(g.getOption('animatedZooms'));
-};
+ assert.isFalse(g.getOption('animatedZooms'));
+});
-RangeSelectorTestCase.prototype.testRangeSelectorInteraction = function() {
+it('testRangeSelectorInteraction', function() {
var opts = {
width: 480,
height: 320,
var newXRange = g.xAxisRange().slice();
assert('left zoomhandle should have moved: '+newXRange[0]+'>'+xRange[0], newXRange[0] > xRange[0]);
- assertEquals('right zoomhandle should not have moved', xRange[1], newXRange[1]);
+ assert.equal('right zoomhandle should not have moved', xRange[1], newXRange[1]);
// Move right zoomhandle in
xRange = newXRange;
var newXRange = g.xAxisRange().slice();
assert('right zoomhandle should have moved: '+newXRange[1]+'<'+xRange[1], newXRange[1] < xRange[1]);
- assertEquals('left zoomhandle should not have moved', xRange[0], newXRange[0]);
+ assert.equal('left zoomhandle should not have moved', xRange[0], newXRange[0]);
// Pan left
xRange = newXRange;
var newXRange = g.xAxisRange().slice();
assert(newXRange[0]+'<'+xRange[0], newXRange[0] < xRange[0]);
assert(newXRange[1]+'<'+xRange[1], newXRange[1] < xRange[1]);
-};
+});
-RangeSelectorTestCase.prototype.testRangeSelectorPositionIfXAxisNotDrawn = function() {
+it('testRangeSelectorPositionIfXAxisNotDrawn', function() {
var opts = {
width: 480,
height: 100,
// xAxis shouldn't be reserved since it isn't drawn.
assertGraphExistence(g, graph);
var bgcanvas = graph.getElementsByClassName('dygraph-rangesel-bgcanvas')[0];
- assertEquals("Range selector is not at the expected position.","70px", bgcanvas.style.top);
+ assert.equal("Range selector is not at the expected position.","70px", bgcanvas.style.top);
var fgcanvas = graph.getElementsByClassName('dygraph-rangesel-fgcanvas')[0];
- assertEquals("Range selector is not at the expected position.","70px", fgcanvas.style.top);
-};
+ assert.equal("Range selector is not at the expected position.","70px", fgcanvas.style.top);
+});
-RangeSelectorTestCase.prototype.testMiniPlotDrawn = function() {
+it('testMiniPlotDrawn', function() {
// Install Proxy to track canvas calls.
var origFunc = Dygraph.getContext;
var miniHtx;
var g = new Dygraph(graph, data, opts);
// TODO(danvk): more precise tests.
- assertNotNull(miniHtx);
- assertTrue(0 < CanvasAssertions.numLinesDrawn(miniHtx, '#ff0000'));
+ assert.isNotNull(miniHtx);
+ assert.isTrue(0 < CanvasAssertions.numLinesDrawn(miniHtx, '#ff0000'));
Dygraph.getContext = origFunc;
-};
+});
// Tests data computation for the mini plot with a single series.
-RangeSelectorTestCase.prototype.testSingleCombinedSeries = function() {
+it('testSingleCombinedSeries', function() {
var opts = {
showRangeSelector: true,
labels: ['X', 'Y1']
var g = new Dygraph(graph, data, opts);
var rangeSelector = g.getPluginInstance_(Dygraph.Plugins.RangeSelector);
- assertNotNull(rangeSelector);
+ assert.isNotNull(rangeSelector);
var combinedSeries = rangeSelector.computeCombinedSeriesAndLimits_();
- assertEquals({
+ assert.deepEqual({
yMin: 1 - 7 * 0.25, // 25% padding
yMax: 8 + 7 * 0.25,
data: [
[10, 8]
]
}, combinedSeries);
-};
+});
// Tests that multiple series are averaged for the miniplot.
-RangeSelectorTestCase.prototype.testCombinedSeries = function() {
+it('testCombinedSeries', function() {
var opts = {
showRangeSelector: true,
labels: ['X', 'Y1', 'Y2']
var g = new Dygraph(graph, data, opts);
var rangeSelector = g.getPluginInstance_(Dygraph.Plugins.RangeSelector);
- assertNotNull(rangeSelector);
+ assert.isNotNull(rangeSelector);
var combinedSeries = rangeSelector.computeCombinedSeriesAndLimits_();
- assertEquals({
+ assert.deepEqual({
yMin: 2 - 6 * 0.25, // 25% padding on combined series range.
yMax: 8 + 6 * 0.25,
data: [
[10, 8]
]
}, combinedSeries);
-};
+});
// Tests selection of a specific series to average for the mini plot.
-RangeSelectorTestCase.prototype.testSelectedCombinedSeries = function() {
+it('testSelectedCombinedSeries', function() {
var opts = {
showRangeSelector: true,
labels: ['X', 'Y1', 'Y2', 'Y3', 'Y4'],
var g = new Dygraph(graph, data, opts);
var rangeSelector = g.getPluginInstance_(Dygraph.Plugins.RangeSelector);
- assertNotNull(rangeSelector);
+ assert.isNotNull(rangeSelector);
var combinedSeries = rangeSelector.computeCombinedSeriesAndLimits_();
- assertEquals({
+ assert.deepEqual({
yMin: 4 - 5 * 0.25, // 25% padding on combined series range.
yMax: 9 + 5 * 0.25,
data: [
[10, 5]
]
}, combinedSeries);
-};
+});
// Tests data computation for the mini plot with a single error bar series.
-RangeSelectorTestCase.prototype.testSingleCombinedSeriesCustomBars = function() {
+it('testSingleCombinedSeriesCustomBars', function() {
var opts = {
customBars: true,
showRangeSelector: true,
var g = new Dygraph(graph, data, opts);
var rangeSelector = g.getPluginInstance_(Dygraph.Plugins.RangeSelector);
- assertNotNull(rangeSelector);
+ assert.isNotNull(rangeSelector);
var combinedSeries = rangeSelector.computeCombinedSeriesAndLimits_();
- assertEquals({
+ assert.deepEqual({
yMin: 1 - 7 * 0.25, // 25% padding
yMax: 8 + 7 * 0.25,
data: [
[10, 8]
]
}, combinedSeries);
-};
+});
-RangeSelectorTestCase.prototype.testSingleCombinedSeriesErrorBars = function() {
+it('testSingleCombinedSeriesErrorBars', function() {
var opts = {
errorBars: true,
showRangeSelector: true,
var g = new Dygraph(graph, data, opts);
var rangeSelector = g.getPluginInstance_(Dygraph.Plugins.RangeSelector);
- assertNotNull(rangeSelector);
+ assert.isNotNull(rangeSelector);
var combinedSeries = rangeSelector.computeCombinedSeriesAndLimits_();
- assertEquals({
+ assert.deepEqual({
yMin: 1 - 7 * 0.25, // 25% padding
yMax: 8 + 7 * 0.25,
data: [
[10, 8]
]
}, combinedSeries);
-};
+});
// Tests data computation for the mini plot with two custom bar series.
-RangeSelectorTestCase.prototype.testTwoCombinedSeriesCustomBars = function() {
+it('testTwoCombinedSeriesCustomBars', function() {
var opts = {
customBars: true,
showRangeSelector: true,
var g = new Dygraph(graph, data, opts);
var rangeSelector = g.getPluginInstance_(Dygraph.Plugins.RangeSelector);
- assertNotNull(rangeSelector);
+ assert.isNotNull(rangeSelector);
var combinedSeries = rangeSelector.computeCombinedSeriesAndLimits_();
- assertEquals({
+ assert.deepEqual({
yMin: 3 - 7 * 0.25, // 25% padding
yMax: 10 + 7 * 0.25,
data: [
[10, 10]
]
}, combinedSeries);
-};
+});
var assertGraphExistence = function(g, graph) {
- assertNotNull(g);
+ assert.isNotNull(g);
var zoomhandles = graph.getElementsByClassName('dygraph-rangesel-zoomhandle');
- assertEquals(2, zoomhandles.length);
+ assert.equal(2, zoomhandles.length);
var bgcanvas = graph.getElementsByClassName('dygraph-rangesel-bgcanvas');
- assertEquals(1, bgcanvas.length);
+ assert.equal(1, bgcanvas.length);
var fgcanvas = graph.getElementsByClassName('dygraph-rangesel-fgcanvas');
- assertEquals(1, fgcanvas.length);
+ assert.equal(1, fgcanvas.length);
};
+
+});
* @author konigsberg@google.com (Robert Konigsberg)
*/
var ZERO_TO_FIFTY = [[ 10, 0 ] , [ 20, 50 ]];
-var ZERO_TO_FIFTY_STEPS = function() {
+var ZERO_TO_FIFTY_STEPS = (function() {
var a = [];
var x = 10;
var y = 0;
a.push([x + (step * .2), y + step]);
}
return a;
-} ();
+}());
+
var FIVE_TO_ONE_THOUSAND = [
[ 1, 10 ], [ 2, 20 ], [ 3, 30 ], [ 4, 40 ] , [ 5, 50 ],
[ 6, 60 ], [ 7, 70 ], [ 8, 80 ], [ 9, 90 ] , [ 10, 1000 ]];
-var RangeTestCase = TestCase("range-tests");
+describe("range-tests", function() {
-RangeTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
-};
+});
var createGraph = function(opts, data, expectRangeX, expectRangeY) {
if (data === undefined) data = ZERO_TO_FIFTY_STEPS;
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
- assertEqualsDelta(expectRangeX, g.xAxisRange(), 0.01);
- assertEqualsDelta(expectRangeY, g.yAxisRange(0), 0.01);
+ assert.equalsDelta(expectRangeX, g.xAxisRange(), 0.01);
+ assert.equalsDelta(expectRangeY, g.yAxisRange(0), 0.01);
return g;
};
* Test that changes to valueRange and dateWindow are reflected
* appropriately.
*/
-RangeTestCase.prototype.testRangeSetOperations = function() {
+it('testRangeSetOperations', function() {
var g = createGraph({valueRange : [ 0, 55 ]});
g.updateOptions({ dateWindow : [ 12, 18 ] });
- assertEquals([12, 18], g.xAxisRange());
- assertEquals([0, 55], g.yAxisRange(0));
+ assert.deepEqual([12, 18], g.xAxisRange());
+ assert.deepEqual([0, 55], g.yAxisRange(0));
g.updateOptions({ valueRange : [ 10, 40 ] });
- assertEquals([12, 18], g.xAxisRange());
- assertEquals([10, 40], g.yAxisRange(0));
+ assert.deepEqual([12, 18], g.xAxisRange());
+ assert.deepEqual([10, 40], g.yAxisRange(0));
g.updateOptions({ valueRange: [10, NaN] });
- assertEquals([12, 18], g.xAxisRange());
- assertEquals([10, 44.2], g.yAxisRange(0));
+ assert.deepEqual([12, 18], g.xAxisRange());
+ assert.deepEqual([10, 44.2], g.yAxisRange(0));
g.updateOptions({ valueRange: [10, 40] });
- assertEquals([12, 18], g.xAxisRange());
- assertEquals([10, 40], g.yAxisRange(0));
+ assert.deepEqual([12, 18], g.xAxisRange());
+ assert.deepEqual([10, 40], g.yAxisRange(0));
g.updateOptions({ valueRange: [10, null] });
- assertEquals([12, 18], g.xAxisRange());
- assertEquals([10, 44.2], g.yAxisRange(0));
+ assert.deepEqual([12, 18], g.xAxisRange());
+ assert.deepEqual([10, 44.2], g.yAxisRange(0));
g.updateOptions({ valueRange: [10, 40] });
- assertEquals([12, 18], g.xAxisRange());
- assertEquals([10, 40], g.yAxisRange(0));
+ assert.deepEqual([12, 18], g.xAxisRange());
+ assert.deepEqual([10, 40], g.yAxisRange(0));
g.updateOptions({ valueRange: [10, undefined] });
- assertEquals([12, 18], g.xAxisRange());
- assertEquals([10, 44.2], g.yAxisRange(0));
+ assert.deepEqual([12, 18], g.xAxisRange());
+ assert.deepEqual([10, 44.2], g.yAxisRange(0));
g.updateOptions({ valueRange: [10, 40] });
- assertEquals([12, 18], g.xAxisRange());
- assertEquals([10, 40], g.yAxisRange(0));
+ assert.deepEqual([12, 18], g.xAxisRange());
+ assert.deepEqual([10, 40], g.yAxisRange(0));
g.updateOptions({ });
- assertEquals([12, 18], g.xAxisRange());
- assertEquals([10, 40], g.yAxisRange(0));
+ assert.deepEqual([12, 18], g.xAxisRange());
+ assert.deepEqual([10, 40], g.yAxisRange(0));
g.updateOptions({valueRange : null, axes: {y:{valueRange : [15, 20]}}});
- assertEquals([12, 18], g.xAxisRange());
- assertEquals([15, 20], g.yAxisRange(0));
+ assert.deepEqual([12, 18], g.xAxisRange());
+ assert.deepEqual([15, 20], g.yAxisRange(0));
g.updateOptions({ dateWindow : null, valueRange : null, axes: null });
- assertEquals([10, 20], g.xAxisRange());
- assertEquals([0, 55], g.yAxisRange(0));
-};
+ assert.deepEqual([10, 20], g.xAxisRange());
+ assert.deepEqual([0, 55], g.yAxisRange(0));
+});
/**
* Verify that when zoomed in by mouse operations, an empty call to
DygraphOps.dispatchMouseMove(g, xRange[1], yRange[0]); // this is really necessary.
DygraphOps.dispatchMouseUp(g, xRange[1], yRange[0]);
- assertEqualsDelta(xRange, g.xAxisRange(), 0.2);
- // assertEqualsDelta(originalYRange, g.yAxisRange(0), 0.2); // Not true, it's something in the middle.
+ assert.equalsDelta(xRange, g.xAxisRange(), 0.2);
+ // assert.equalsDelta(originalYRange, g.yAxisRange(0), 0.2); // Not true, it's something in the middle.
var midX = (xRange[1] - xRange[0]) / 2;
DygraphOps.dispatchMouseDown(g, midX, yRange[0]);
DygraphOps.dispatchMouseMove(g, midX, yRange[1]); // this is really necessary.
DygraphOps.dispatchMouseUp(g, midX, yRange[1]);
- assertEqualsDelta(xRange, g.xAxisRange(), 0.2);
- assertEqualsDelta(yRange, g.yAxisRange(0), 0.2);
+ assert.equalsDelta(xRange, g.xAxisRange(), 0.2);
+ assert.equalsDelta(yRange, g.yAxisRange(0), 0.2);
}
* Verify that when zoomed in by mouse operations, an empty call to
* updateOptions doesn't change the displayed ranges.
*/
-RangeTestCase.prototype.testEmptyUpdateOptions_doesntUnzoom = function() {
+it('testEmptyUpdateOptions_doesntUnzoom', function() {
var g = createGraph();
zoom(g, [ 11, 18 ], [ 35, 40 ]);
- assertEqualsDelta([11, 18], g.xAxisRange(), 0.1);
- assertEqualsDelta([35, 40], g.yAxisRange(0), 0.2);
+ assert.equalsDelta([11, 18], g.xAxisRange(), 0.1);
+ assert.equalsDelta([35, 40], g.yAxisRange(0), 0.2);
g.updateOptions({});
- assertEqualsDelta([11, 18], g.xAxisRange(), 0.1);
- assertEqualsDelta([35, 40], g.yAxisRange(0), 0.2);
-}
+ assert.equalsDelta([11, 18], g.xAxisRange(), 0.1);
+ assert.equalsDelta([35, 40], g.yAxisRange(0), 0.2);
+});
/**
* Verify that when zoomed in by mouse operations, a call to
* updateOptions({ dateWindow : null, valueRange : null }) fully
* unzooms.
*/
-RangeTestCase.prototype.testRestoreOriginalRanges_viaUpdateOptions = function() {
+it('testRestoreOriginalRanges_viaUpdateOptions', function() {
var g = createGraph();
zoom(g, [ 11, 18 ], [ 35, 40 ]);
g.updateOptions({ dateWindow : null, valueRange : null });
- assertEquals([0, 55], g.yAxisRange(0));
- assertEquals([10, 20], g.xAxisRange());
-}
+ assert.deepEqual([0, 55], g.yAxisRange(0));
+ assert.deepEqual([10, 20], g.xAxisRange());
+});
/**
* Verify that log scale axis range is properly specified.
*/
-RangeTestCase.prototype.testLogScaleExcludesZero = function() {
+it('testLogScaleExcludesZero', function() {
var g = new Dygraph("graph", FIVE_TO_ONE_THOUSAND, { logscale : true });
- assertEquals([10, 1099], g.yAxisRange(0));
+ assert.deepEqual([10, 1099], g.yAxisRange(0));
g.updateOptions({ logscale : false });
- assertEquals([0, 1099], g.yAxisRange(0));
-}
+ assert.deepEqual([0, 1099], g.yAxisRange(0));
+});
/**
* Verify that includeZero range is properly specified.
*/
-RangeTestCase.prototype.testIncludeZeroIncludesZero = function() {
+it('testIncludeZeroIncludesZero', function() {
var g = new Dygraph("graph", [[0, 500], [500, 1000]], { includeZero : true });
- assertEquals([0, 1100], g.yAxisRange(0));
+ assert.deepEqual([0, 1100], g.yAxisRange(0));
g.updateOptions({ includeZero : false });
- assertEquals([450, 1050], g.yAxisRange(0));
-}
+ assert.deepEqual([450, 1050], g.yAxisRange(0));
+});
/**
* Verify that includeZero range is properly specified per axis.
*/
-RangeTestCase.prototype.testIncludeZeroPerAxis = function() {
+it('testIncludeZeroPerAxis', function() {
var g = new Dygraph("graph",
'X,A,B\n'+
'0,50,50\n'+
});
- assertEquals([44, 116], g.yAxisRange(0));
- assertEquals([0, 121], g.yAxisRange(1));
+ assert.deepEqual([44, 116], g.yAxisRange(0));
+ assert.deepEqual([0, 121], g.yAxisRange(1));
g.updateOptions({
axes: {
}
});
- assertEquals([44, 116], g.yAxisRange(1));
-}
+ assert.deepEqual([44, 116], g.yAxisRange(1));
+});
/**
* Verify that very large Y ranges don't break things.
*/
-RangeTestCase.prototype.testHugeRange = function() {
+it('testHugeRange', function() {
var g = new Dygraph("graph", [[0, -1e120], [1, 1e230]], { includeZero : true });
- assertEqualsDelta(1, -1e229 / g.yAxisRange(0)[0], 0.001);
- assertEqualsDelta(1, 1.1e230 / g.yAxisRange(0)[1], 0.001);
-}
+ assert.equalsDelta(1, -1e229 / g.yAxisRange(0)[0], 0.001);
+ assert.equalsDelta(1, 1.1e230 / g.yAxisRange(0)[1], 0.001);
+});
/**
* Verify old-style avoidMinZero option.
*/
-RangeTestCase.prototype.testAvoidMinZero = function() {
+it('testAvoidMinZero', function() {
var g = createGraph({
avoidMinZero: true,
}, ZERO_TO_FIFTY_STEPS, [10, 20], [-5, 55]);
-};
+});
/**
* Verify ranges with user-specified padding, implicit avoidMinZero.
*/
-RangeTestCase.prototype.testPaddingAuto = function() {
+it('testPaddingAuto', function() {
var g = createGraph({
xRangePad: 42,
yRangePad: 30
}, ZERO_TO_FIFTY_STEPS, [9, 21], [-5, 55]);
-};
+});
/**
* Verify auto range with drawAxesAtZero.
*/
-RangeTestCase.prototype.testPaddingAutoAxisAtZero = function() {
+it('testPaddingAutoAxisAtZero', function() {
var g = createGraph({
drawAxesAtZero: true,
}, ZERO_TO_FIFTY_STEPS, [10, 20], [0, 55]);
-};
+});
/**
* Verify user-specified range with padding and drawAxesAtZero options.
* Try explicit range matching the auto range, should have identical results.
*/
-RangeTestCase.prototype.testPaddingRange1 = function() {
+it('testPaddingRange1', function() {
var g = createGraph({
valueRange: [0, 50],
xRangePad: 42,
yRangePad: 30,
drawAxesAtZero: true
}, ZERO_TO_FIFTY_STEPS, [9, 21], [-5, 55]);
-};
+});
/**
* Verify user-specified range with padding and drawAxesAtZero options.
* User-supplied range differs from the auto range.
*/
-RangeTestCase.prototype.testPaddingRange2 = function() {
+it('testPaddingRange2', function() {
var g = createGraph({
valueRange: [10, 60],
xRangePad: 42,
yRangePad: 30,
drawAxesAtZero: true,
}, ZERO_TO_FIFTY_STEPS, [9, 21], [5, 65]);
-};
+});
/**
* Verify drawAxesAtZero and includeZero.
*/
-RangeTestCase.prototype.testPaddingYAtZero = function() {
+it('testPaddingYAtZero', function() {
var g = createGraph({
includeZero: true,
xRangePad: 42,
[10, 20],
[30, 50]
], [-14, 34], [-5, 55]);
-};
+});
/**
* Verify logscale, compat mode.
*/
-RangeTestCase.prototype.testLogscaleCompat = function() {
+it('testLogscaleCompat', function() {
var g = createGraph({
logscale: true
},
[[-10, 10], [10, 10], [30, 1000]],
[-10, 30], [10, 1099]);
-};
+});
/**
* Verify logscale, new mode.
*/
-RangeTestCase.prototype.testLogscalePad = function() {
+it('testLogscalePad', function() {
var g = createGraph({
logscale: true,
yRangePad: 30
},
[[-10, 10], [10, 10], [30, 1000]],
[-10, 30], [5.01691, 1993.25801]);
-};
+});
/**
* Verify scrolling all-zero region, traditional.
*/
-RangeTestCase.prototype.testZeroScroll = function() {
- g = new Dygraph(
+it('testZeroScroll', function() {
+ var g = new Dygraph(
document.getElementById("graph"),
"X,Y\n" +
"1,0\n" +
animatedZooms: true,
avoidMinZero: true
});
-};
+});
/**
* Verify scrolling all-zero region, new-style.
*/
-RangeTestCase.prototype.testZeroScroll2 = function() {
- g = new Dygraph(
+it('testZeroScroll2', function() {
+ var g = new Dygraph(
document.getElementById("graph"),
"X,Y\n" +
"1,0\n" +
xRangePad: 4,
yRangePad: 4
});
-};
+});
+
+});
*
* @author konigsberg@google.com (Robert Konigsberg)
*/
-var ResizeTestCase = TestCase("resize");
+describe("resize", function() {
var data =
"X,Y\n" +
"5,300\n" +
"6,100\n";
-ResizeTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
-};
+});
-ResizeTestCase.prototype.tearDown = function() {
-};
+afterEach(function() {
+});
-ResizeTestCase.prototype.testResizeMaintainsMouseOperations = function() {
+it('testResizeMaintainsMouseOperations', function() {
document.body.innerHTML =
'<div id="graph" style="width: 640px; height: 480px;"></div>' +
'</div>';
DygraphOps.dispatchMouseUp_Point(g, x2 - 1, y);
}
- g = new Dygraph(graph, data, {highlightCallback: callback});
+ var g = new Dygraph(graph, data, {highlightCallback: callback});
strum(g, 300, 640);
- assertEquals(6, callbackCount);
+ assert.equal(6, callbackCount);
document.getElementById("graph").style.width = "500px";
g.resize();
callbackCount = 0;
strum(g, 300, 500);
- assertEquals(6, callbackCount);
-};
+ assert.equal(6, callbackCount);
+});
/**
* Tests that a graph created in a not-displayed div works as expected
* if the graph options include height and width. Resize not needed.
*/
-ResizeTestCase.prototype.testHiddenDivWithSizedGraph = function() {
+it('testHiddenDivWithSizedGraph', function() {
var div = document.getElementById("graph");
div.style.display = 'none';
div.style.display = '';
var area = g.getArea();
- assertTrue(area.w > 0);
- assertTrue(area.h > 0);
-};
+ assert.isTrue(area.w > 0);
+ assert.isTrue(area.h > 0);
+});
/**
* Tests that a graph created in a not-displayed div with
* expected. The user needs to call resize() on it after displaying
* it.
*/
-ResizeTestCase.prototype.testHiddenDivWithResize = function() {
+it('testHiddenDivWithResize', function() {
var div = document.getElementById("graph");
div.style.display = 'none';
div.style.display = '';
g.resize();
- area = g.getArea();
- assertTrue(area.w > 0);
- assertTrue(area.h > 0);
+ var area = g.getArea();
+ assert.isTrue(area.w > 0);
+ assert.isTrue(area.h > 0);
// Regression test: check that graph remains visible after no-op resize.
g.resize();
var x = Math.floor(g.toDomXCoord(2));
var y = Math.floor(g.toDomYCoord(200));
- assertEquals("Unexpected grid color found at pixel: x: " + x + " y: " + y,
+ assert.equal("Unexpected grid color found at pixel: x: " + x + " y: " + y,
[0, 128, 128, 255], Util.samplePixel(g.hidden_, x, y));
-};
+});
+
+});
*
* @author danvk@google.com (Dan Vanderkam)
*/
-var rollingAverageTestCase = TestCase("rolling-average");
+describe("rolling-average", function() {
-rollingAverageTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
-};
+});
-rollingAverageTestCase.prototype.tearDown = function() {
-};
+afterEach(function() {
+});
-rollingAverageTestCase.prototype.testRollingAverage = function() {
+it('testRollingAverage', function() {
var opts = {
width: 480,
height: 320,
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
- g.setSelection(0); assertEquals("0: Y: 0", Util.getLegend());
- g.setSelection(1); assertEquals("1: Y: 1", Util.getLegend());
- g.setSelection(2); assertEquals("2: Y: 2", Util.getLegend());
- g.setSelection(3); assertEquals("3: Y: 3", Util.getLegend());
- assertEquals(1, g.rollPeriod());
+ g.setSelection(0); assert.equal("0: Y: 0", Util.getLegend());
+ g.setSelection(1); assert.equal("1: Y: 1", Util.getLegend());
+ g.setSelection(2); assert.equal("2: Y: 2", Util.getLegend());
+ g.setSelection(3); assert.equal("3: Y: 3", Util.getLegend());
+ assert.equal(1, g.rollPeriod());
g.updateOptions({rollPeriod: 2});
- g.setSelection(0); assertEquals("0: Y: 0", Util.getLegend());
- g.setSelection(1); assertEquals("1: Y: 0.5", Util.getLegend());
- g.setSelection(2); assertEquals("2: Y: 1.5", Util.getLegend());
- g.setSelection(3); assertEquals("3: Y: 2.5", Util.getLegend());
- assertEquals(2, g.rollPeriod());
+ g.setSelection(0); assert.equal("0: Y: 0", Util.getLegend());
+ g.setSelection(1); assert.equal("1: Y: 0.5", Util.getLegend());
+ g.setSelection(2); assert.equal("2: Y: 1.5", Util.getLegend());
+ g.setSelection(3); assert.equal("3: Y: 2.5", Util.getLegend());
+ assert.equal(2, g.rollPeriod());
g.updateOptions({rollPeriod: 3});
- g.setSelection(0); assertEquals("0: Y: 0", Util.getLegend());
- g.setSelection(1); assertEquals("1: Y: 0.5", Util.getLegend());
- g.setSelection(2); assertEquals("2: Y: 1", Util.getLegend());
- g.setSelection(3); assertEquals("3: Y: 2", Util.getLegend());
- assertEquals(3, g.rollPeriod());
+ g.setSelection(0); assert.equal("0: Y: 0", Util.getLegend());
+ g.setSelection(1); assert.equal("1: Y: 0.5", Util.getLegend());
+ g.setSelection(2); assert.equal("2: Y: 1", Util.getLegend());
+ g.setSelection(3); assert.equal("3: Y: 2", Util.getLegend());
+ assert.equal(3, g.rollPeriod());
g.updateOptions({rollPeriod: 4});
- g.setSelection(0); assertEquals("0: Y: 0", Util.getLegend());
- g.setSelection(1); assertEquals("1: Y: 0.5", Util.getLegend());
- g.setSelection(2); assertEquals("2: Y: 1", Util.getLegend());
- g.setSelection(3); assertEquals("3: Y: 1.5", Util.getLegend());
- assertEquals(4, g.rollPeriod());
-};
-
-rollingAverageTestCase.prototype.testRollBoxDoesntDisapper = function() {
+ g.setSelection(0); assert.equal("0: Y: 0", Util.getLegend());
+ g.setSelection(1); assert.equal("1: Y: 0.5", Util.getLegend());
+ g.setSelection(2); assert.equal("2: Y: 1", Util.getLegend());
+ g.setSelection(3); assert.equal("3: Y: 1.5", Util.getLegend());
+ assert.equal(4, g.rollPeriod());
+});
+
+it('testRollBoxDoesntDisapper', function() {
var opts = {
showRoller: true
};
var g = new Dygraph(graph, data, opts);
var roll_box = graph.getElementsByTagName("input");
- assertEquals(1, roll_box.length);
- assertEquals("1", roll_box[0].value);
+ assert.equal(1, roll_box.length);
+ assert.equal("1", roll_box[0].value);
graph.style.width = "500px";
g.resize();
- assertEquals(1, roll_box.length);
- assertEquals("1", roll_box[0].value);
-};
+ assert.equal(1, roll_box.length);
+ assert.equal("1", roll_box[0].value);
+});
// Regression test for http://code.google.com/p/dygraphs/issues/detail?id=426
-rollingAverageTestCase.prototype.testRollShortFractions = function() {
+it('testRollShortFractions', function() {
var opts = {
customBars: true,
labels: ['x', 'A']
var rolled1 = g.dataHandler_.rollingAverage(data1, 1, g);
var rolled2 = g.dataHandler_.rollingAverage(data2, 1, g);
- assertEquals(rolled1[0], rolled2[0]);
-};
+ assert.equal(rolled1[0], rolled2[0]);
+});
-rollingAverageTestCase.prototype.testRollCustomBars = function() {
+it('testRollCustomBars', function() {
var opts = {
customBars: true,
rollPeriod: 2,
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
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]);
- assertEquals([4, 35, [1, 45]], rolled[3]);
-};
+ assert.deepEqual([1, 10, [1, 20]], rolled[0]);
+ assert.deepEqual([2, 15, [1, 25]], rolled[1]);
+ assert.deepEqual([3, 25, [1, 35]], rolled[2]);
+ assert.deepEqual([4, 35, [1, 45]], rolled[3]);
+});
-rollingAverageTestCase.prototype.testRollErrorBars = function() {
+it('testRollErrorBars', function() {
var opts = {
errorBars: true,
rollPeriod: 2,
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
var rolled = getRolledData(g, data, 1, 2);
- assertEquals([1, 10, [8, 12]], rolled[0]);
+ assert.deepEqual([1, 10, [8, 12]], rolled[0]);
// variance = sqrt( pow(error) * rollPeriod)
var variance = Math.sqrt(2);
for (var i=1;i<data.length;i++) {
var value = data[i][1][0] - 5;
- assertEquals("unexpected rolled average", value, rolled[i][1]);
- assertEquals("unexpected rolled min", value - variance, rolled[i][2][0]);
- assertEquals("unexpected rolled max", value + variance, rolled[i][2][1]);
+ assert.equal("unexpected rolled average", value, rolled[i][1]);
+ assert.equal("unexpected rolled min", value - variance, rolled[i][2][0]);
+ assert.equal("unexpected rolled max", value + variance, rolled[i][2][1]);
}
-};
+});
-rollingAverageTestCase.prototype.testRollFractions = function() {
+it('testRollFractions', function() {
var opts = {
fractions: true,
rollPeriod: 2,
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
var rolled = getRolledData(g, data, 1, 2);
- assertEquals([1, 10], rolled[0]);
- assertEquals([2, 15], rolled[1]);
- assertEquals([3, 25], rolled[2]);
- assertEquals([4, 35], rolled[3]);
-};
+ assert.deepEqual([1, 10], rolled[0]);
+ assert.deepEqual([2, 15], rolled[1]);
+ assert.deepEqual([3, 25], rolled[2]);
+ assert.deepEqual([4, 35], rolled[3]);
+});
-rollingAverageTestCase.prototype.testRollFractionsBars = function() {
+it('testRollFractionsBars', function() {
var opts = {
fractions: true,
errorBars: true,
var highs = [29, 31, 44, 56];
for (var i=0;i<data.length;i++) {
- assertEquals("unexpected rolled average", values[i], Math.round(rolled[i][1]));
- assertEquals("unexpected rolled min", lows[i], Math.round(rolled[i][2][0]));
- assertEquals("unexpected rolled max", highs[i], Math.round(rolled[i][2][1]));
+ assert.equal("unexpected rolled average", values[i], Math.round(rolled[i][1]));
+ assert.equal("unexpected rolled min", lows[i], Math.round(rolled[i][2][0]));
+ assert.equal("unexpected rolled max", highs[i], Math.round(rolled[i][2][1]));
}
-};
+});
-rollingAverageTestCase.prototype.testRollFractionsBarsWilson = function() {
+it('testRollFractionsBarsWilson', function() {
var opts = {
fractions: true,
errorBars: true,
var highs = [41, 37, 47, 57];
for (var i=0;i<data.length;i++) {
- assertEquals("unexpected rolled average", values[i], Math.round(rolled[i][1]));
- assertEquals("unexpected rolled min", lows[i], Math.round(rolled[i][2][0]));
- assertEquals("unexpected rolled max", highs[i], Math.round(rolled[i][2][1]));
+ assert.equal("unexpected rolled average", values[i], Math.round(rolled[i][1]));
+ assert.equal("unexpected rolled min", lows[i], Math.round(rolled[i][2][0]));
+ assert.equal("unexpected rolled max", highs[i], Math.round(rolled[i][2][1]));
}
-};
+});
var getRolledData = function(g, data, seriesIdx, rollPeriod){
var options = g.attributes_;
return g.dataHandler_.rollingAverage(g.dataHandler_.extractSeries(data, seriesIdx, options), rollPeriod, options);
};
+
+});
var DEAD_SIMPLE_DATA = [[ 10, 2100 ]];
var ZERO_TO_FIFTY = [[ 10, 0 ] , [ 20, 50 ]];
-var SanityTestCase = TestCase("dygraphs-sanity");
+describe("dygraphs-sanity", function() {
-SanityTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
-};
+});
/**
* The sanity test of sanity tests.
*/
-SanityTestCase.prototype.testTrue = function() {
- assertTrue(true);
-};
+it('testTrue', function() {
+ assert.isTrue(true);
+});
/**
* Sanity test that ensures the graph element exists.
*/
-SanityTestCase.prototype.testGraphExists = function() {
+it('testGraphExists', function() {
var graph = document.getElementById("graph");
- assertNotNull(graph);
-};
+ assert.isNotNull(graph);
+});
// TODO(konigsberg): Move the following tests to a new package that
// tests all kinds of toDomCoords, toDataCoords, toPercent, et cetera.
* A sanity test of sorts, by ensuring the dygraph is created, and
* isn't just some piece of junk object.
*/
-SanityTestCase.prototype.testToString = function() {
+it('testToString', function() {
var graph = document.getElementById("graph");
var g = new Dygraph(graph, DEAD_SIMPLE_DATA, {});
- assertNotNull(g);
- assertEquals("[Dygraph graph]", g.toString());
-};
+ assert.isNotNull(g);
+ assert.equal("[Dygraph graph]", g.toString());
+});
/**
* Test that when no valueRange is specified, the y axis range is
* adjusted by 10% on top.
*/
-SanityTestCase.prototype.testYAxisRange_default = function() {
+it('testYAxisRange_default', function() {
var graph = document.getElementById("graph");
- assertEquals(0, graph.style.length);
+ assert.equal(0, graph.style.length);
var g = new Dygraph(graph, ZERO_TO_FIFTY, {});
- assertEquals([0, 55], g.yAxisRange(0));
-};
+ assert.deepEqual([0, 55], g.yAxisRange(0));
+});
/**
* Test that valueRange matches the y-axis range specifically.
*/
-SanityTestCase.prototype.testYAxisRange_custom = function() {
+it('testYAxisRange_custom', function() {
var graph = document.getElementById("graph");
var g = new Dygraph(graph, ZERO_TO_FIFTY, { valueRange: [0,50] });
- assertEquals([0, 50], g.yAxisRange(0));
+ assert.deepEqual([0, 50], g.yAxisRange(0));
g.updateOptions({valueRange: null, axes: {y: {valueRange: [10, 40]}}});
- assertEquals([10, 40], g.yAxisRange(0));
-};
+ assert.deepEqual([10, 40], g.yAxisRange(0));
+});
/**
* Test that valueRange matches the y-axis range specifically.
* axis label and tick marks.
* TODO(konigsberg): change yAxisLabelWidth to 0 (or 20) and try again.
*/
-SanityTestCase.prototype.testToDomYCoord = function() {
+it('testToDomYCoord', function() {
var graph = document.getElementById("graph");
var g = new Dygraph(graph, ZERO_TO_FIFTY, { height: 70, valueRange: [0,50] });
- assertEquals(50, g.toDomYCoord(0));
- assertEquals(0, g.toDomYCoord(50));
+ assert.equal(50, g.toDomYCoord(0));
+ assert.equal(0, g.toDomYCoord(50));
for (var x = 0; x <= 50; x++) {
- assertEqualsDelta(50 - x, g.toDomYCoord(x), 0.00001);
+ assert.equalsDelta(50 - x, g.toDomYCoord(x), 0.00001);
}
g.updateOptions({valueRange: null, axes: {y: {valueRange: [0, 50]}}});
- assertEquals(50, g.toDomYCoord(0));
- assertEquals(0, g.toDomYCoord(50));
+ assert.equal(50, g.toDomYCoord(0));
+ assert.equal(0, g.toDomYCoord(50));
for (var x = 0; x <= 50; x++) {
- assertEqualsDelta(50 - x, g.toDomYCoord(x), 0.00001);
+ assert.equalsDelta(50 - x, g.toDomYCoord(x), 0.00001);
}
-};
+});
/**
* Test that the two-argument form of the constructor (no options) works.
*/
-SanityTestCase.prototype.testTwoArgumentConstructor = function() {
+it('testTwoArgumentConstructor', function() {
var graph = document.getElementById("graph");
new Dygraph(graph, ZERO_TO_FIFTY);
-};
+});
// Here is the first of a series of tests that just ensure the graph is drawn
// without exception.
//TODO(konigsberg): Move to its own test case.
-SanityTestCase.prototype.testFillStack1 = function() {
+it('testFillStack1', function() {
var graph = document.getElementById("graph");
new Dygraph(graph, ZERO_TO_FIFTY, { stackedGraph: true });
-}
+});
-SanityTestCase.prototype.testFillStack2 = function() {
+it('testFillStack2', function() {
var graph = document.getElementById("graph");
new Dygraph(graph, ZERO_TO_FIFTY, { stackedGraph: true, fillGraph: true });
-}
+});
-SanityTestCase.prototype.testFillStack3 = function() {
+it('testFillStack3', function() {
var graph = document.getElementById("graph");
new Dygraph(graph, ZERO_TO_FIFTY, { fillGraph: true });
-}
+});
+
+});
*
* @author danvk@google.com (Dan Vanderkam)
*/
-var scientificNotationTestCase = TestCase("scientific-notation");
+describe("scientific-notation", function() {
-scientificNotationTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
-};
+});
-scientificNotationTestCase.prototype.tearDown = function() {
-};
+afterEach(function() {
+});
function getXValues(g) {
var xs = [];
return xs;
}
-scientificNotationTestCase.prototype.testScientificInput = function() {
+it('testScientificInput', function() {
var data = "X,Y\n" +
"1.0e1,-1\n" +
"2.0e1,0\n" +
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, {});
- assertEqualsDelta([10, 20, 30, 40], getXValues(g), 1e-6);
-};
+ assert.equalsDelta([10, 20, 30, 40], getXValues(g), 1e-6);
+});
-scientificNotationTestCase.prototype.testScientificInputPlus = function() {
+it('testScientificInputPlus', function() {
var data = "X,Y\n" +
"1.0e+1,-1\n" +
"2.0e+1,0\n" +
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, {});
- assertEqualsDelta([10, 20, 30, 40], getXValues(g), 1e-6);
-};
+ assert.equalsDelta([10, 20, 30, 40], getXValues(g), 1e-6);
+});
-scientificNotationTestCase.prototype.testScientificInputMinus = function() {
+it('testScientificInputMinus', function() {
var data = "X,Y\n" +
"1.0e-1,-1\n" +
"2.0e-1,0\n" +
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, {});
- assertEqualsDelta([0.1, 0.2, 0.3, 0.4], getXValues(g), 1e-6);
-};
+ assert.equalsDelta([0.1, 0.2, 0.3, 0.4], getXValues(g), 1e-6);
+});
-scientificNotationTestCase.prototype.testScientificInputMinusCap = function() {
+it('testScientificInputMinusCap', function() {
var data = "X,Y\n" +
"1.0E-1,-1\n" +
"2.0E-1,0\n" +
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, {});
- assertEqualsDelta([0.1, 0.2, 0.3, 0.4], getXValues(g), 1e-6);
-};
+ assert.equalsDelta([0.1, 0.2, 0.3, 0.4], getXValues(g), 1e-6);
+});
+
+});
*
* @author konigsberg@google.com (Robert Konigsbrg)
*/
-var ScrollingDivTestCase = TestCase("scrolling-div");
+describe("scrolling-div", function() {
var point, g;
-ScrollingDivTestCase.prototype.setUp = function() {
+beforeEach(function() {
var LOREM_IPSUM =
"<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod\n" +
}
);
-};
+});
// This is usually something like 15, but for OS X Lion and its auto-hiding
// scrollbars, it's 0. This is a large enough difference that we need to
return scrollbarWidth;
};
-ScrollingDivTestCase.prototype.tearDown = function() {
-};
+afterEach(function() {
+});
/**
* This tests that when the nested div is unscrolled, things work normally.
*/
-ScrollingDivTestCase.prototype.testUnscrolledDiv = function() {
+it('testUnscrolledDiv', function() {
document.getElementById('scroller').scrollTop = 0;
DygraphOps.dispatchCanvasEvent(g, DygraphOps.createEvent(clickOn4_40, { type : 'mousedown' }));
DygraphOps.dispatchCanvasEvent(g, DygraphOps.createEvent(clickOn4_40, { type : 'mouseup' }));
- assertEquals(40, point.xval);
- assertEquals(4, point.yval);
-};
+ assert.equal(40, point.xval);
+ assert.equal(4, point.yval);
+});
/**
* This tests that when the nested div is scrolled, things work normally.
*/
-ScrollingDivTestCase.prototype.testScrolledDiv = function() {
+it('testScrolledDiv', function() {
document.getElementById('scroller').scrollTop = 117;
var clickOn4_40 = {
DygraphOps.dispatchCanvasEvent(g, DygraphOps.createEvent(clickOn4_40, { type : 'mousedown' }));
DygraphOps.dispatchCanvasEvent(g, DygraphOps.createEvent(clickOn4_40, { type : 'mouseup' }));
- assertEquals(40, point.xval);
- assertEquals(4, point.yval);
-};
+ assert.equal(40, point.xval);
+ assert.equal(4, point.yval);
+});
+
+});
* @author danvk@google.com (Dan Vanderkam)
*/
-var SelectionTestCase = TestCase("selection");
+describe("selection", function() {
-SelectionTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
-};
+});
-SelectionTestCase.prototype.testSetGetSelection = function() {
+it('testSetGetSelection', function() {
var graph = document.getElementById("graph");
var g = new Dygraph(graph,
"X,Y\n" +
);
g.setSelection(0);
- assertEquals(0, g.getSelection());
+ assert.equal(0, g.getSelection());
g.setSelection(1);
- assertEquals(1, g.getSelection());
+ assert.equal(1, g.getSelection());
g.setSelection(2);
- assertEquals(2, g.getSelection());
-};
+ assert.equal(2, g.getSelection());
+});
-SelectionTestCase.prototype.testSetGetSelectionDense = function() {
+it('testSetGetSelectionDense', function() {
var graph = document.getElementById("graph");
var g = new Dygraph(graph,
"X,Y\n" +
);
g.setSelection(0);
- assertEquals(0, g.getSelection());
+ assert.equal(0, g.getSelection());
g.setSelection(1);
- assertEquals(1, g.getSelection());
+ assert.equal(1, g.getSelection());
g.setSelection(2);
- assertEquals(2, g.getSelection());
+ assert.equal(2, g.getSelection());
g.setSelection(3);
- assertEquals(3, g.getSelection());
-};
+ assert.equal(3, g.getSelection());
+});
-SelectionTestCase.prototype.testSetGetSelectionMissingPoints = function() {
- dataHandler = function() {};
+it('testSetGetSelectionMissingPoints', function() {
+ var dataHandler = function() {};
dataHandler.prototype = new Dygraph.DataHandlers.DefaultHandler();
dataHandler.prototype.seriesToPoints = function(series, setName, boundaryIdStart) {
var val = null;
);
g.setSelection(0);
- assertEquals(0, g.getSelection());
+ assert.equal(0, g.getSelection());
g.setSelection(1);
- assertEquals(1, g.getSelection());
+ assert.equal(1, g.getSelection());
g.setSelection(2);
- assertEquals(2, g.getSelection());
-};
+ assert.equal(2, g.getSelection());
+});
+
+});
*/
var ZERO_TO_FIFTY = [[ 10, 0 ] , [ 20, 50 ]];
-var SimpleDrawingTestCase = TestCase("simple-drawing");
+describe("simple-drawing", function() {
var _origFunc = Dygraph.getContext;
-SimpleDrawingTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
Dygraph.getContext = function(canvas) {
return new Proxy(_origFunc(canvas));
}
-};
+});
-SimpleDrawingTestCase.prototype.tearDown = function() {
+afterEach(function() {
Dygraph.getContext = _origFunc;
-};
+});
-SimpleDrawingTestCase.prototype.testDrawSimpleRangePlusOne = function() {
+it('testDrawSimpleRangePlusOne', function() {
var opts = {
axes : {
x : {
});
g.destroy(); // to balance context saves and destroys.
CanvasAssertions.assertBalancedSaveRestore(htx);
-};
+});
// See http://code.google.com/p/dygraphs/issues/detail?id=185
-SimpleDrawingTestCase.prototype.testDrawSimpleRangeZeroToFifty = function() {
+it('testDrawSimpleRangeZeroToFifty', function() {
var opts = {
axes : {
x : {
strokeStyle: "#008080",
lineWidth: 1
});
- assertEquals(1, lines.length);
+ assert.equal(1, lines.length);
g.destroy(); // to balance context saves and destroys.
CanvasAssertions.assertBalancedSaveRestore(htx);
-};
+});
-SimpleDrawingTestCase.prototype.testDrawWithAxis = function() {
+it('testDrawWithAxis', function() {
var graph = document.getElementById("graph");
var g = new Dygraph(graph, ZERO_TO_FIFTY);
var htx = g.hidden_ctx_;
g.destroy(); // to balance context saves and destroys.
CanvasAssertions.assertBalancedSaveRestore(htx);
-};
+});
/**
* Tests that it is drawing dashes, and it remember the dash history between
* points.
*/
-SimpleDrawingTestCase.prototype.testDrawSimpleDash = function() {
+it('testDrawSimpleDash', function() {
var opts = {
axes: {
x: {
graph.style.width='480px';
graph.style.height='320px';
var g = new Dygraph(graph, [[1, 4], [2, 5], [3, 3], [4, 7], [5, 9]], opts);
- htx = g.hidden_ctx_;
+ var htx = g.hidden_ctx_;
// TODO(danvk): figure out a good way to restore this test.
- // assertEquals(29, CanvasAssertions.numLinesDrawn(htx, "#ff0000"));
+ // assert.equal(29, CanvasAssertions.numLinesDrawn(htx, "#ff0000"));
g.destroy(); // to balance context saves and destroys.
CanvasAssertions.assertBalancedSaveRestore(htx);
-};
+});
/**
* Tests that thick lines are drawn continuously.
* Regression test for http://code.google.com/p/dygraphs/issues/detail?id=328
*/
-SimpleDrawingTestCase.prototype.testDrawThickLine = function() {
+it('testDrawThickLine', function() {
var opts = {
axes : {
x : {
graph.style.width='480px';
graph.style.height='320px';
var g = new Dygraph(graph, [[1, 2], [2, 5], [3, 2], [4, 7], [5, 0]], opts);
- htx = g.hidden_ctx_;
+ var htx = g.hidden_ctx_;
// There's a big gap in the line at (2, 5)
// If the bug is fixed, then there should be some red going up from here.
var x = Math.round(xy[0]), y = Math.round(xy[1]);
var sampler = new PixelSampler(g);
- assertEquals([255,0,0,255], sampler.colorAtPixel(x, y));
- assertEquals([255,0,0,255], sampler.colorAtPixel(x, y - 1));
- assertEquals([255,0,0,255], sampler.colorAtPixel(x, y - 2));
+ assert.deepEqual([255,0,0,255], sampler.colorAtPixel(x, y));
+ assert.deepEqual([255,0,0,255], sampler.colorAtPixel(x, y - 1));
+ assert.deepEqual([255,0,0,255], sampler.colorAtPixel(x, y - 2));
// TODO(danvk): figure out a good way to restore this test.
- // assertEquals(29, CanvasAssertions.numLinesDrawn(htx, "#ff0000"));
+ // assert.equal(29, CanvasAssertions.numLinesDrawn(htx, "#ff0000"));
g.destroy(); // to balance context saves and destroys.
CanvasAssertions.assertBalancedSaveRestore(htx);
-};
+});
+
+});
*
* @author danvdk@gmail.com (Dan Vanderkam)
*/
-var smoothPlotterTestCase = TestCase("smooth-plotter");
+describe("smooth-plotter", function() {
var getControlPoints = smoothPlotter._getControlPoints;
-smoothPlotterTestCase.prototype.setUp = function() {
-};
+beforeEach(function() {
+});
-smoothPlotterTestCase.prototype.tearDown = function() {
-};
+afterEach(function() {
+});
-smoothPlotterTestCase.prototype.testNoSmoothing = function() {
+it('testNoSmoothing', function() {
var lastPt = {x: 10, y: 0},
pt = {x: 11, y: 1},
nextPt = {x: 12, y: 0},
alpha = 0;
- assertEquals([11, 1, 11, 1], getControlPoints(lastPt, pt, nextPt, alpha));
-};
+ assert.deepEqual([11, 1, 11, 1], getControlPoints(lastPt, pt, nextPt, alpha));
+});
-smoothPlotterTestCase.prototype.testHalfSmoothing = function() {
+it('testHalfSmoothing', function() {
var lastPt = {x: 10, y: 0},
pt = {x: 11, y: 1},
nextPt = {x: 12, y: 0},
alpha = 0.5;
- assertEquals([10.5, 1, 11.5, 1], getControlPoints(lastPt, pt, nextPt, alpha));
-}
+ assert.deepEqual([10.5, 1, 11.5, 1], getControlPoints(lastPt, pt, nextPt, alpha));
+});
-smoothPlotterTestCase.prototype.testExtrema = function() {
+it('testExtrema', function() {
var lastPt = {x: 10, y: 0},
pt = {x: 11, y: 1},
nextPt = {x: 12, y: 1},
alpha = 0.5;
- assertEquals([10.5, 0.75, 11.5, 1.25],
+ assert.deepEqual([10.5, 0.75, 11.5, 1.25],
getControlPoints(lastPt, pt, nextPt, alpha, true));
- assertEquals([10.5, 1, 11.5, 1],
+ assert.deepEqual([10.5, 1, 11.5, 1],
getControlPoints(lastPt, pt, nextPt, alpha, false));
-}
+});
+
+});
*
* @author dan@dygraphs.com (Dan Vanderkam)
*/
-var stackedTestCase = TestCase("stacked");
+describe("stacked", function() {
var _origGetContext = Dygraph.getContext;
-stackedTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
Dygraph.getContext = function(canvas) {
return new Proxy(_origGetContext(canvas));
}
-};
+});
-stackedTestCase.prototype.tearDown = function() {
+afterEach(function() {
Dygraph.getContext = _origGetContext;
-};
+});
-stackedTestCase.prototype.testCorrectColors = function() {
+it('testCorrectColors', function() {
var opts = {
width: 400,
height: 300,
// y pixels 0-99 = nothing (white)
// 38 = round(0.15 * 255)
- assertEquals([0, 0, 255, 38], Util.samplePixel(g.hidden_, 200, 250));
- assertEquals([0, 255, 0, 38], Util.samplePixel(g.hidden_, 200, 150));
-};
+ assert.deepEqual([0, 0, 255, 38], Util.samplePixel(g.hidden_, 200, 250));
+ assert.deepEqual([0, 255, 0, 38], Util.samplePixel(g.hidden_, 200, 150));
+});
// Regression test for http://code.google.com/p/dygraphs/issues/detail?id=358
-stackedTestCase.prototype.testSelectionValues = function() {
+it('testSelectionValues', function() {
var opts = {
stackedGraph: true
};
;
var graph = document.getElementById("graph");
- g = new Dygraph(graph, data, opts);
+ var g = new Dygraph(graph, data, opts);
g.setSelection(0);
- assertEquals("0: Y1: 1 Y2: 1", Util.getLegend());
+ assert.equal("0: Y1: 1 Y2: 1", Util.getLegend());
// Verify that the behavior is correct with highlightSeriesOpts as well.
g.updateOptions({
}
});
g.setSelection(0);
- assertEquals("0: Y1: 1 Y2: 1", Util.getLegend());
+ assert.equal("0: Y1: 1 Y2: 1", Util.getLegend());
g.setSelection(1);
- assertEquals("1: Y1: 1 Y2: 1", Util.getLegend());
+ assert.equal("1: Y1: 1 Y2: 1", Util.getLegend());
g.setSelection(0, 'Y2');
- assertEquals("0: Y1: 1 Y2: 1", Util.getLegend());
-};
+ assert.equal("0: Y1: 1 Y2: 1", Util.getLegend());
+});
// Regression test for http://code.google.com/p/dygraphs/issues/detail?id=176
-stackedTestCase.prototype.testDuplicatedXValue = function() {
+it('testDuplicatedXValue', function() {
var opts = {
stackedGraph: true,
fillAlpha: 0.15,
;
var graph = document.getElementById("graph");
- g = new Dygraph(graph, data, opts);
+ var g = new Dygraph(graph, data, opts);
assert(g.yAxisRange()[1] < 2);
- assertEquals([0, 255, 0, 38], Util.samplePixel(g.hidden_, 200, 250));
- assertEquals([0, 255, 0, 38], Util.samplePixel(g.hidden_, 317, 250));
-}
+ assert.deepEqual([0, 255, 0, 38], Util.samplePixel(g.hidden_, 200, 250));
+ assert.deepEqual([0, 255, 0, 38], Util.samplePixel(g.hidden_, 317, 250));
+});
// Validates regression when null values in stacked graphs show up
// incorrectly in the legend.
-stackedTestCase.prototype.testNullValues = function() {
+it('testNullValues', function() {
var opts = {
stackedGraph: true,
stepPlot:true
;
var graph = document.getElementById("graph");
- g = new Dygraph(graph, data, opts);
+ var g = new Dygraph(graph, data, opts);
g.setSelection(0);
- assertEquals("0: Y1: -5 Y2: -1 Y3: 1", Util.getLegend());
+ assert.equal("0: Y1: -5 Y2: -1 Y3: 1", Util.getLegend());
g.setSelection(1);
- assertEquals("1: Y1: 1 Y3: 1", Util.getLegend());
+ assert.equal("1: Y1: 1 Y3: 1", Util.getLegend());
g.setSelection(2);
- assertEquals("2: Y1: 1 Y2: 2 Y3: 3", Util.getLegend());
+ assert.equal("2: Y1: 1 Y2: 2 Y3: 3", Util.getLegend());
g.setSelection(3);
- assertEquals("3: Y1: 3 Y3: 4", Util.getLegend());
+ assert.equal("3: Y1: 3 Y3: 4", Util.getLegend());
g.setSelection(4);
- assertEquals("4: Y1: 3 Y2: 2 Y3: 3", Util.getLegend());
-};
+ assert.equal("4: Y1: 3 Y2: 2 Y3: 3", Util.getLegend());
+});
// Regression test for http://code.google.com/p/dygraphs/issues/detail?id=438
-stackedTestCase.prototype.testMissingValueAtZero = function() {
+it('testMissingValueAtZero', function() {
var opts = {
stackedGraph: true
};
;
var graph = document.getElementById("graph");
- g = new Dygraph(graph, data, opts);
+ var g = new Dygraph(graph, data, opts);
g.setSelection(0);
- assertEquals("0: Y2: 1", Util.getLegend());
+ assert.equal("0: Y2: 1", Util.getLegend());
g.setSelection(1);
- assertEquals("1: Y1: 1 Y2: 2", Util.getLegend());
+ assert.equal("1: Y1: 1 Y2: 2", Util.getLegend());
g.setSelection(2);
- assertEquals("2: Y2: 3", Util.getLegend());
-};
+ assert.equal("2: Y2: 3", Util.getLegend());
+});
-stackedTestCase.prototype.testInterpolation = function() {
+it('testInterpolation', function() {
var opts = {
colors: ['#ff0000', '#00ff00', '#0000ff'],
stackedGraph: true
[109, 1, N, N, N]];
var graph = document.getElementById("graph");
- g = new Dygraph(graph, data, opts);
+ var g = new Dygraph(graph, data, opts);
var htx = g.hidden_ctx_;
var attrs = {};
// Check that the expected number of line segments gets drawn
// for each series. Gaps don't get a line.
- assertEquals(7, CanvasAssertions.numLinesDrawn(htx, '#ff0000'));
- assertEquals(4, CanvasAssertions.numLinesDrawn(htx, '#00ff00'));
- assertEquals(2, CanvasAssertions.numLinesDrawn(htx, '#0000ff'));
+ assert.equal(7, CanvasAssertions.numLinesDrawn(htx, '#ff0000'));
+ assert.equal(4, CanvasAssertions.numLinesDrawn(htx, '#00ff00'));
+ assert.equal(2, CanvasAssertions.numLinesDrawn(htx, '#0000ff'));
// Check that the selection returns the original (non-stacked)
// values and skips gaps.
g.setSelection(1);
- assertEquals("101: Y1: 1 Y2: 2 Y3: 2", Util.getLegend());
+ assert.equal("101: Y1: 1 Y2: 2 Y3: 2", Util.getLegend());
g.setSelection(8);
- assertEquals("108: Y1: 1 Y2: 2 Y3: 9", Util.getLegend());
+ assert.equal("108: Y1: 1 Y2: 2 Y3: 9", Util.getLegend());
g.setSelection(9);
- assertEquals("109: Y1: 1", Util.getLegend());
-};
+ assert.equal("109: Y1: 1", Util.getLegend());
+});
-stackedTestCase.prototype.testInterpolationOptions = function() {
+it('testInterpolationOptions', function() {
var opts = {
colors: ['#ff0000', '#00ff00', '#0000ff'],
stackedGraph: true
for (var i = 0; i < choices.length; ++i) {
var graph = document.getElementById("graph");
opts['stackedGraphNaNFill'] = choices[i];
- g = new Dygraph(graph, data, opts);
+ var g = new Dygraph(graph, data, opts);
var htx = g.hidden_ctx_;
var attrs = {};
{strokeStyle: '#ff0000'});
}
}
-};
+});
-stackedTestCase.prototype.testMultiAxisInterpolation = function() {
+it('testMultiAxisInterpolation', function() {
// Setting 2 axes to test that each axis stacks separately
var opts = {
colors: ['#ff0000', '#00ff00', '#0000ff'],
[109, 1, N, N, N]];
var graph = document.getElementById("graph");
- g = new Dygraph(graph, data, opts);
+ var g = new Dygraph(graph, data, opts);
var htx = g.hidden_ctx_;
var attrs = {};
// Check that the expected number of line segments gets drawn
// for each series. Gaps don't get a line.
- assertEquals(7, CanvasAssertions.numLinesDrawn(htx, '#ff0000'));
- assertEquals(4, CanvasAssertions.numLinesDrawn(htx, '#00ff00'));
- assertEquals(2, CanvasAssertions.numLinesDrawn(htx, '#0000ff'));
+ assert.equal(7, CanvasAssertions.numLinesDrawn(htx, '#ff0000'));
+ assert.equal(4, CanvasAssertions.numLinesDrawn(htx, '#00ff00'));
+ assert.equal(2, CanvasAssertions.numLinesDrawn(htx, '#0000ff'));
// Check that the selection returns the original (non-stacked)
// values and skips gaps.
g.setSelection(1);
- assertEquals("101: Y1: 1 Y2: 2 Y3: 2", Util.getLegend());
+ assert.equal("101: Y1: 1 Y2: 2 Y3: 2", Util.getLegend());
g.setSelection(8);
- assertEquals("108: Y1: 1 Y2: 2 Y3: 9", Util.getLegend());
+ assert.equal("108: Y1: 1 Y2: 2 Y3: 9", Util.getLegend());
g.setSelection(9);
- assertEquals("109: Y1: 1", Util.getLegend());
-};
+ assert.equal("109: Y1: 1", Util.getLegend());
+});
+
+});
*
* @author julian.eichstaedt@ch.sauter-bc.com (Fr. Sauter AG)
*/
-var StepTestCase = TestCase("step-plot-per-series");
+describe("step-plot-per-series", function() {
-StepTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
-};
+});
-origFunc = Dygraph.getContext;
+var origFunc = Dygraph.getContext;
-StepTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
Dygraph.getContext = function(canvas) {
return new Proxy(origFunc(canvas));
};
-};
+});
-StepTestCase.prototype.tearDown = function() {
+afterEach(function() {
Dygraph.getContext = origFunc;
-};
+});
-StepTestCase.prototype.testMixedModeStepAndLineFilled = function() {
+it('testMixedModeStepAndLineFilled', function() {
var opts = {
width: 480,
height: 320,
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
- htx = g.hidden_ctx_;
+ var htx = g.hidden_ctx_;
var attrs = {};
xy2 = g.toDomCoords(x2, y2);
CanvasAssertions.assertLineDrawn(htx, xy1, xy2, attrs);
}
-};
+});
-StepTestCase.prototype.testMixedModeStepAndLineStackedAndFilled = function() {
+it('testMixedModeStepAndLineStackedAndFilled', function() {
var opts = {
width: 480,
height: 320,
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
- htx = g.hidden_ctx_;
+ var htx = g.hidden_ctx_;
var attrs = {};
// The last edge can not be tested via assertLineDrawn since it wasn't drawn as a line but via clossePath.
// But a rectangle is completely tested with three of its four edges.
}
-};
+});
-StepTestCase.prototype.testMixedModeStepAndLineErrorBars = function() {
+it('testMixedModeStepAndLineErrorBars', function() {
var opts = {
width: 480,
height: 320,
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
- htx = g.hidden_ctx_;
+ var htx = g.hidden_ctx_;
var attrs = {};
CanvasAssertions.assertLineDrawn(htx, xy1, xy2, attrs);
}
-};
+});
-StepTestCase.prototype.testMixedModeStepAndLineCustomBars = function() {
+it('testMixedModeStepAndLineCustomBars', function() {
var opts = {
width: 480,
height: 320,
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
- htx = g.hidden_ctx_;
+ var htx = g.hidden_ctx_;
var attrs = {};
xy2 = g.toDomCoords(data[i + 1][0], data[i + 1][2][1]);
CanvasAssertions.assertLineDrawn(htx, xy1, xy2, attrs);
}
-};
+});
+
+});
* @author danvk@google.com (Dan Vanderkam)
*/
-var ToDomCoordsTestCase = TestCase("to-dom-coords");
+describe("to-dom-coords", function() {
var origFunc = Dygraph.getContext;
-ToDomCoordsTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
Dygraph.getContext = function(canvas) {
return new Proxy(origFunc(canvas));
}
-};
+});
-ToDomCoordsTestCase.prototype.tearDown = function() {
+afterEach(function() {
Dygraph.getContext = origFunc;
-};
+});
// Checks that toDomCoords and toDataCoords are inverses of one another.
var checkForInverses = function(g) {
var x = x_range[0] + i / 10.0 * (x_range[1] - x_range[0]);
for (var j = 0; j <= 10; j++) {
var y = y_range[0] + j / 10.0 * (y_range[1] - y_range[0]);
- assertEquals(x, g.toDataXCoord(g.toDomXCoord(x)));
- assertEquals(y, g.toDataYCoord(g.toDomYCoord(y)));
+ assert.equal(x, g.toDataXCoord(g.toDomXCoord(x)));
+ assert.equal(y, g.toDataYCoord(g.toDomYCoord(y)));
}
}
};
-ToDomCoordsTestCase.prototype.testPlainChart = function() {
+it('testPlainChart', function() {
var opts = {
axes : {
x : {
}
var graph = document.getElementById("graph");
- g = new Dygraph(graph, [ [0,0], [100,100] ], opts);
+ var g = new Dygraph(graph, [ [0,0], [100,100] ], opts);
- assertEquals([0, 100], g.toDataCoords(0, 0));
- assertEquals([0, 0], g.toDataCoords(0, 400));
- assertEquals([100, 100], g.toDataCoords(400, 0));
- assertEquals([100, 0], g.toDataCoords(400, 400));
+ assert.deepEqual([0, 100], g.toDataCoords(0, 0));
+ assert.deepEqual([0, 0], g.toDataCoords(0, 400));
+ assert.deepEqual([100, 100], g.toDataCoords(400, 0));
+ assert.deepEqual([100, 0], g.toDataCoords(400, 400));
checkForInverses(g);
// TODO(konigsberg): This doesn't really belong here. Move to its own test.
var htx = g.hidden_ctx_;
- assertEquals(1, CanvasAssertions.numLinesDrawn(htx, '#ff0000'));
-}
+ assert.equal(1, CanvasAssertions.numLinesDrawn(htx, '#ff0000'));
+});
-ToDomCoordsTestCase.prototype.testChartWithAxes = function() {
+it('testChartWithAxes', function() {
var opts = {
axes : {
x : {
}
var graph = document.getElementById("graph");
- g = new Dygraph(graph, [ [0,0], [100,100] ], opts);
+ var g = new Dygraph(graph, [ [0,0], [100,100] ], opts);
- assertEquals([0, 100], g.toDataCoords(100, 0));
- assertEquals([0, 0], g.toDataCoords(100, 400));
- assertEquals([100, 100], g.toDataCoords(500, 0));
- assertEquals([100, 0], g.toDataCoords(500, 400));
+ assert.deepEqual([0, 100], g.toDataCoords(100, 0));
+ assert.deepEqual([0, 0], g.toDataCoords(100, 400));
+ assert.deepEqual([100, 100], g.toDataCoords(500, 0));
+ assert.deepEqual([100, 0], g.toDataCoords(500, 400));
checkForInverses(g);
-}
+});
-ToDomCoordsTestCase.prototype.testChartWithAxesAndLabels = function() {
+it('testChartWithAxesAndLabels', function() {
var opts = {
axes : {
x : {
}
var graph = document.getElementById("graph");
- g = new Dygraph(graph, [ [0,0], [100,100] ], opts);
+ var g = new Dygraph(graph, [ [0,0], [100,100] ], opts);
- assertEquals([0, 100], g.toDataCoords(100, 25));
- assertEquals([0, 0], g.toDataCoords(100, 425));
- assertEquals([100, 100], g.toDataCoords(500, 25));
- assertEquals([100, 0], g.toDataCoords(500, 425));
+ assert.deepEqual([0, 100], g.toDataCoords(100, 25));
+ assert.deepEqual([0, 0], g.toDataCoords(100, 425));
+ assert.deepEqual([100, 100], g.toDataCoords(500, 25));
+ assert.deepEqual([100, 0], g.toDataCoords(500, 425));
checkForInverses(g);
-}
+});
-ToDomCoordsTestCase.prototype.testYAxisLabelWidth = function() {
+it('testYAxisLabelWidth', function() {
var opts = {
axes: { y: { axisLabelWidth: 100 } },
axisTickSize: 0,
}
var graph = document.getElementById("graph");
- g = new Dygraph(graph, [ [0,0], [100,100] ], opts);
+ var g = new Dygraph(graph, [ [0,0], [100,100] ], opts);
- assertEquals([100, 0], g.toDomCoords(0, 100));
- assertEquals([500, 486], g.toDomCoords(100, 0));
+ assert.deepEqual([100, 0], g.toDomCoords(0, 100));
+ assert.deepEqual([500, 486], g.toDomCoords(100, 0));
g.updateOptions({
axes: { y: { axisLabelWidth: 50 }},
});
- assertEquals([50, 0], g.toDomCoords(0, 100));
- assertEquals([500, 486], g.toDomCoords(100, 0));
-}
+ assert.deepEqual([50, 0], g.toDomCoords(0, 100));
+ assert.deepEqual([500, 486], g.toDomCoords(100, 0));
+});
-ToDomCoordsTestCase.prototype.testAxisTickSize = function() {
+it('testAxisTickSize', function() {
var opts = {
axes: { y: { axisLabelWidth: 100 } },
axisTickSize: 0,
}
var graph = document.getElementById("graph");
- g = new Dygraph(graph, [ [0,0], [100,100] ], opts);
+ var g = new Dygraph(graph, [ [0,0], [100,100] ], opts);
- assertEquals([100, 0], g.toDomCoords(0, 100));
- assertEquals([500, 486], g.toDomCoords(100, 0));
+ assert.deepEqual([100, 0], g.toDomCoords(0, 100));
+ assert.deepEqual([500, 486], g.toDomCoords(100, 0));
g.updateOptions({ axisTickSize : 50 });
- assertEquals([200, 0], g.toDomCoords(0, 100));
- assertEquals([500, 386], g.toDomCoords(100, 0));
-}
+ assert.deepEqual([200, 0], g.toDomCoords(0, 100));
+ assert.deepEqual([500, 386], g.toDomCoords(100, 0));
+});
-ToDomCoordsTestCase.prototype.testChartLogarithmic_YAxis = function() {
+it('testChartLogarithmic_YAxis', function() {
var opts = {
rightGap: 0,
valueRange: [1, 4],
}
var graph = document.getElementById("graph");
- g = new Dygraph(graph, [ [1,1], [4,4] ], opts);
+ var g = new Dygraph(graph, [ [1,1], [4,4] ], opts);
var epsilon = 1e-8;
- assertEqualsDelta([0, 4], g.toDataCoords(0, 0), epsilon);
- assertEqualsDelta([0, 1], g.toDataCoords(0, 400), epsilon);
- assertEqualsDelta([10, 4], g.toDataCoords(400, 0), epsilon);
- assertEqualsDelta([10, 1], g.toDataCoords(400, 400), epsilon);
- assertEqualsDelta([10, 2], g.toDataCoords(400, 200), epsilon);
+ assert.equalsDelta([0, 4], g.toDataCoords(0, 0), epsilon);
+ assert.equalsDelta([0, 1], g.toDataCoords(0, 400), epsilon);
+ assert.equalsDelta([10, 4], g.toDataCoords(400, 0), epsilon);
+ assert.equalsDelta([10, 1], g.toDataCoords(400, 400), epsilon);
+ assert.equalsDelta([10, 2], g.toDataCoords(400, 200), epsilon);
- assertEquals([0, 0], g.toDomCoords(0, 4));
- assertEquals([0, 400], g.toDomCoords(0, 1));
- assertEquals([400, 0], g.toDomCoords(10, 4));
- assertEquals([400, 400], g.toDomCoords(10, 1));
- assertEquals([400, 200], g.toDomCoords(10, 2));
-}
-
-ToDomCoordsTestCase.prototype.testChartLogarithmic_XAxis = function() {
+ assert.deepEqual([0, 0], g.toDomCoords(0, 4));
+ assert.deepEqual([0, 400], g.toDomCoords(0, 1));
+ assert.deepEqual([400, 0], g.toDomCoords(10, 4));
+ assert.deepEqual([400, 400], g.toDomCoords(10, 1));
+ assert.deepEqual([400, 200], g.toDomCoords(10, 2));
+});
+
+it('testChartLogarithmic_XAxis', function() {
var opts = {
rightGap: 0,
valueRange: [1, 1000],
}
var graph = document.getElementById("graph");
- g = new Dygraph(graph, [ [1,1], [10, 10], [100,100], [1000,1000] ], opts);
+ var g = new Dygraph(graph, [ [1,1], [10, 10], [100,100], [1000,1000] ], opts);
var epsilon = 1e-8;
- assertEqualsDelta(1, g.toDataXCoord(0), epsilon);
- assertEqualsDelta(5.623413251903489, g.toDataXCoord(100), epsilon);
- assertEqualsDelta(31.62277660168378, g.toDataXCoord(200), epsilon);
- assertEqualsDelta(177.8279410038921, g.toDataXCoord(300), epsilon);
- assertEqualsDelta(1000, g.toDataXCoord(400), epsilon);
-
- assertEqualsDelta(0, g.toDomXCoord(1), epsilon);
- assertEqualsDelta(3.6036036036036037, g.toDomXCoord(10), epsilon);
- assertEqualsDelta(39.63963963963964, g.toDomXCoord(100), epsilon);
- assertEqualsDelta(400, g.toDomXCoord(1000), epsilon);
-
- assertEqualsDelta(0, g.toPercentXCoord(1), epsilon);
- assertEqualsDelta(0.3333333333, g.toPercentXCoord(10), epsilon);
- assertEqualsDelta(0.6666666666, g.toPercentXCoord(100), epsilon);
- assertEqualsDelta(1, g.toPercentXCoord(1000), epsilon);
+ assert.equalsDelta(1, g.toDataXCoord(0), epsilon);
+ assert.equalsDelta(5.623413251903489, g.toDataXCoord(100), epsilon);
+ assert.equalsDelta(31.62277660168378, g.toDataXCoord(200), epsilon);
+ assert.equalsDelta(177.8279410038921, g.toDataXCoord(300), epsilon);
+ assert.equalsDelta(1000, g.toDataXCoord(400), epsilon);
+
+ assert.equalsDelta(0, g.toDomXCoord(1), epsilon);
+ assert.equalsDelta(3.6036036036036037, g.toDomXCoord(10), epsilon);
+ assert.equalsDelta(39.63963963963964, g.toDomXCoord(100), epsilon);
+ assert.equalsDelta(400, g.toDomXCoord(1000), epsilon);
+
+ assert.equalsDelta(0, g.toPercentXCoord(1), epsilon);
+ assert.equalsDelta(0.3333333333, g.toPercentXCoord(10), epsilon);
+ assert.equalsDelta(0.6666666666, g.toPercentXCoord(100), epsilon);
+ assert.equalsDelta(1, g.toPercentXCoord(1000), epsilon);
// Now zoom in and ensure that the methods return reasonable values.
g.updateOptions({dateWindow: [ 10, 100 ]});
- assertEqualsDelta(10, g.toDataXCoord(0), epsilon);
- assertEqualsDelta(17.78279410038923, g.toDataXCoord(100), epsilon);
- assertEqualsDelta(31.62277660168379, g.toDataXCoord(200), epsilon);
- assertEqualsDelta(56.23413251903491, g.toDataXCoord(300), epsilon);
- assertEqualsDelta(100, g.toDataXCoord(400), epsilon);
-
- assertEqualsDelta(-40, g.toDomXCoord(1), epsilon);
- assertEqualsDelta(0, g.toDomXCoord(10), epsilon);
- assertEqualsDelta(400, g.toDomXCoord(100), epsilon);
- assertEqualsDelta(4400, g.toDomXCoord(1000), epsilon);
-
- assertEqualsDelta(-1, g.toPercentXCoord(1), epsilon);
- assertEqualsDelta(0, g.toPercentXCoord(10), epsilon);
- assertEqualsDelta(1, g.toPercentXCoord(100), epsilon);
- assertEqualsDelta(2, g.toPercentXCoord(1000), epsilon);
-}
+ assert.equalsDelta(10, g.toDataXCoord(0), epsilon);
+ assert.equalsDelta(17.78279410038923, g.toDataXCoord(100), epsilon);
+ assert.equalsDelta(31.62277660168379, g.toDataXCoord(200), epsilon);
+ assert.equalsDelta(56.23413251903491, g.toDataXCoord(300), epsilon);
+ assert.equalsDelta(100, g.toDataXCoord(400), epsilon);
+
+ assert.equalsDelta(-40, g.toDomXCoord(1), epsilon);
+ assert.equalsDelta(0, g.toDomXCoord(10), epsilon);
+ assert.equalsDelta(400, g.toDomXCoord(100), epsilon);
+ assert.equalsDelta(4400, g.toDomXCoord(1000), epsilon);
+
+ assert.equalsDelta(-1, g.toPercentXCoord(1), epsilon);
+ assert.equalsDelta(0, g.toPercentXCoord(10), epsilon);
+ assert.equalsDelta(1, g.toPercentXCoord(100), epsilon);
+ assert.equalsDelta(2, g.toPercentXCoord(1000), epsilon);
+});
+
+});
*
* @author gmadrid@gmail.com (George Madrid)
*/
-var TwoDigitYearsTestCase = TestCase("two-digit-years");
+describe("two-digit-years", function() {
-TwoDigitYearsTestCase.prototype.testTwoDigitYears = function() {
+it('testTwoDigitYears', function() {
// A date with a one digit year: '9 AD'.
var start = new Date(9, 2, 3);
// A date with a two digit year: '11 AD'.
});
// This breaks in Firefox & Safari:
- // assertEquals([{"v":-61875345600000,"label":"Apr 9"},{"v":-61867483200000,"label":"Jul 9"},{"v":-61859534400000,"label":"Oct 9"},{"v":-61851582000000,"label":"Jan 10"},{"v":-61843809600000,"label":"Apr 10"},{"v":-61835947200000,"label":"Jul 10"},{"v":-61827998400000,"label":"Oct 10"},{"v":-61820046000000,"label":"Jan 11"},{"v":-61812273600000,"label":"Apr 11"}], ticks);
-};
+ // assert.deepEqual([{"v":-61875345600000,"label":"Apr 9"},{"v":-61867483200000,"label":"Jul 9"},{"v":-61859534400000,"label":"Oct 9"},{"v":-61851582000000,"label":"Jan 10"},{"v":-61843809600000,"label":"Apr 10"},{"v":-61835947200000,"label":"Jul 10"},{"v":-61827998400000,"label":"Oct 10"},{"v":-61820046000000,"label":"Jan 11"},{"v":-61812273600000,"label":"Apr 11"}], ticks);
+});
+
+});
* @fileoverview Tests for the updateOptions function.
* @author antrob@google.com (Anthony Robledo)
*/
-var UpdateOptionsTestCase = TestCase("update-options");
+describe("update-options", function() {
var opts = {
width: 480,
"2011-04-04,9,5\n" +
"2011-05-05,8,3\n";
-UpdateOptionsTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div><div id='labels'></div>";
-};
+});
-UpdateOptionsTestCase.prototype.tearDown = function() {
-};
+afterEach(function() {
+});
/*
* Tweaks the dygraph so it sets g._testDrawCalled to true when internal method
g.drawGraph_ = g._oldDrawGraph;
}
-UpdateOptionsTestCase.prototype.testStrokeAll = function() {
+it('testStrokeAll', function() {
var graphDiv = document.getElementById("graph");
var graph = new Dygraph(graphDiv, data, opts);
var updatedOptions = { };
wrapDrawGraph(graph);
graph.updateOptions(updatedOptions);
unwrapDrawGraph(graph);
- assertFalse(graph._testDrawCalled);
-};
+ assert.isFalse(graph._testDrawCalled);
+});
-UpdateOptionsTestCase.prototype.testStrokeSingleSeries = function() {
+it('testStrokeSingleSeries', function() {
var graphDiv = document.getElementById("graph");
var graph = new Dygraph(graphDiv, data, opts);
var updatedOptions = { };
wrapDrawGraph(graph);
graph.updateOptions(updatedOptions);
unwrapDrawGraph(graph);
- assertFalse(graph._testDrawCalled);
-};
+ assert.isFalse(graph._testDrawCalled);
+});
-UpdateOptionsTestCase.prototype.testSingleSeriesRequiresNewPoints = function() {
+it('testSingleSeriesRequiresNewPoints', function() {
var graphDiv = document.getElementById("graph");
var graph = new Dygraph(graphDiv, data, opts);
var updatedOptions = {
wrapDrawGraph(graph);
graph.updateOptions(updatedOptions);
unwrapDrawGraph(graph);
- assertTrue(graph._testDrawCalled);
-};
+ assert.isTrue(graph._testDrawCalled);
+});
-UpdateOptionsTestCase.prototype.testWidthChangeNeedsNewPoints = function() {
+it('testWidthChangeNeedsNewPoints', function() {
var graphDiv = document.getElementById("graph");
var graph = new Dygraph(graphDiv, data, opts);
var updatedOptions = { };
wrapDrawGraph(graph);
graph.updateOptions(updatedOptions);
unwrapDrawGraph(graph);
- assertTrue(graph._testDrawCalled);
-};
+ assert.isTrue(graph._testDrawCalled);
+});
// Test https://github.com/danvk/dygraphs/issues/87
-UpdateOptionsTestCase.prototype.testUpdateLabelsDivDoesntInfiniteLoop = function() {
+it('testUpdateLabelsDivDoesntInfiniteLoop', function() {
var graphDiv = document.getElementById("graph");
var labelsDiv = document.getElementById("labels");
var graph = new Dygraph(graphDiv, data, opts);
graph.updateOptions({labelsDiv : labelsDiv});
-}
+});
// Test https://github.com/danvk/dygraphs/issues/247
-UpdateOptionsTestCase.prototype.testUpdateColors = function() {
+it('testUpdateColors', function() {
var graphDiv = document.getElementById("graph");
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());
+ assert.deepEqual(["rgb(0,128,0)", "rgb(0,0,128)"], graph.getColors());
var colors1 = [ "#aaa", "#bbb" ];
graph.updateOptions({ colors: colors1 });
- assertEquals(colors1, graph.getColors());
+ assert.equal(colors1, graph.getColors());
// extra colors are ignored until you add additional data series.
var colors2 = [ "#ddd", "#eee", "#fff" ];
graph.updateOptions({ colors: colors2 });
- assertEquals(["#ddd", "#eee"], graph.getColors());
+ assert.deepEqual(["#ddd", "#eee"], graph.getColors());
graph.updateOptions({ file:
"X,Y1,Y2,Y3\n" +
"2011-01-01,2,3,4\n" +
"2011-02-02,5,3,2\n"
});
- assertEquals(colors2, graph.getColors());
+ assert.equal(colors2, graph.getColors());
graph.updateOptions({ colors: null, file: data });
- assertEquals(defaultColors, graph.getColors());
-}
+ assert.equal(defaultColors, graph.getColors());
+});
// Regression test for http://code.google.com/p/dygraphs/issues/detail?id=249
// Verifies that setting 'legend: always' via update immediately shows the
// legend.
-UpdateOptionsTestCase.prototype.testUpdateLegendAlways = function() {
+it('testUpdateLegendAlways', function() {
var graphDiv = document.getElementById("graph");
var graph = new Dygraph(graphDiv, data, opts);
var legend = document.getElementsByClassName("dygraph-legend");
- assertEquals(1, legend.length);
+ assert.equal(1, legend.length);
legend = legend[0];
- assertEquals("", legend.innerHTML);
+ assert.equal("", legend.innerHTML);
graph.updateOptions({legend: 'always'});
legend = document.getElementsByClassName("dygraph-legend");
- assertEquals(1, legend.length);
+ assert.equal(1, legend.length);
legend = legend[0];
- assertNotEquals(-1, legend.textContent.indexOf("Y1"));
- assertNotEquals(-1, legend.textContent.indexOf("Y2"));
-};
+ assert.notEqual(-1, legend.textContent.indexOf("Y1"));
+ assert.notEqual(-1, legend.textContent.indexOf("Y2"));
+});
+
+});
*
* @author dan@dygraphs.com (Dan Vanderkam)
*/
-var updateWhilePanningTestCase = TestCase("update-while-panning");
+describe("update-while-panning", function() {
-updateWhilePanningTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
-};
+});
-updateWhilePanningTestCase.prototype.tearDown = function() {
-};
+afterEach(function() {
+});
// This tests the following sequence:
// 1. Begin dragging a chart (x-panning)
// 2. Do a data update (updateOptions({file: ...}))
// 3. Verify that the y-axis is still well-defined.
-updateWhilePanningTestCase.prototype.testUpdateWhilePanning = function() {
+it('testUpdateWhilePanning', function() {
var sinewave = function(start, limit, step) {
var data = [];
for (var x = start; x < limit; x += step) {
var graph = document.getElementById("graph");
var g = new Dygraph(graph, sinewave(0, 6, 0.1), opts);
- assertEquals([-2, 2], g.yAxisRange());
+ assert.deepEqual([-2, 2], g.yAxisRange());
// Start a pan, but don't finish it yet.
DygraphOps.dispatchMouseDown_Point(g, 200, 100, {shiftKey: true});
DygraphOps.dispatchMouseMove_Point(g, 100, 100, {shiftKey: true});
- assertEquals([-2, 2], g.yAxisRange());
+ assert.deepEqual([-2, 2], g.yAxisRange());
// Now do a data update. y-axis should remain the same.
g.updateOptions({file: sinewave(0, 7, 0.1)});
- assertEquals([-2, 2], g.yAxisRange());
+ assert.deepEqual([-2, 2], g.yAxisRange());
// Keep the pan going.
DygraphOps.dispatchMouseMove_Point(g, 50, 100, {shiftKey: true});
- assertEquals([-2, 2], g.yAxisRange());
+ assert.deepEqual([-2, 2], g.yAxisRange());
// Now finish the pan.
DygraphOps.dispatchMouseUp_Point(g, 100, 100, {shiftKey: true});
- assertEquals([-2, 2], g.yAxisRange());
-};
+ assert.deepEqual([-2, 2], g.yAxisRange());
+});
+
+});
* @author danvdk@gmail.com (Dan Vanderkam)
*/
-var UtilsTestCase = TestCase("utils-tests");
+describe("utils-tests", function() {
-UtilsTestCase.prototype.testUpdate = function() {
+it('testUpdate', function() {
var a = {
a: 1,
b: [1, 2, 3],
c: { x: 1, y: 2},
d: { f: 10, g: 20}
};
- assertEquals(1, a['a']);
- assertEquals([1, 2, 3], a['b']);
- assertEquals({x: 1, y: 2}, a['c']);
- assertEquals({f: 10, g: 20}, a['d']);
+ assert.equal(1, a['a']);
+ assert.deepEqual([1, 2, 3], a['b']);
+ assert.deepEqual({x: 1, y: 2}, a['c']);
+ assert.deepEqual({f: 10, g: 20}, a['d']);
Dygraph.update(a, { c: { x: 2 } });
- assertEquals({x: 2}, a['c']);
+ assert.deepEqual({x: 2}, a['c']);
Dygraph.update(a, { d: null });
- assertEquals(null, a['d']);
+ assert.equal(null, a['d']);
Dygraph.update(a, { a: 10, b: [1, 2] });
- assertEquals(10, a['a']);
- assertEquals([1, 2], a['b']);
- assertEquals({x: 2}, a['c']);
- assertEquals(null, a['d']);
-};
+ assert.equal(10, a['a']);
+ assert.deepEqual([1, 2], a['b']);
+ assert.deepEqual({x: 2}, a['c']);
+ assert.equal(null, a['d']);
+});
-UtilsTestCase.prototype.testUpdateDeep = function() {
+it('testUpdateDeep', function() {
var a = {
a: 1,
b: [1, 2, 3],
c: { x: 1, y: 2},
d: { f: 10, g: 20}
};
- assertEquals(1, a['a']);
- assertEquals([1, 2, 3], a['b']);
- assertEquals({x: 1, y: 2}, a['c']);
- assertEquals({f: 10, g: 20}, a['d']);
+ assert.equal(1, a['a']);
+ assert.deepEqual([1, 2, 3], a['b']);
+ assert.deepEqual({x: 1, y: 2}, a['c']);
+ assert.deepEqual({f: 10, g: 20}, a['d']);
Dygraph.updateDeep(a, { c: { x: 2 } });
- assertEquals({x: 2, y: 2}, a['c']);
+ assert.deepEqual({x: 2, y: 2}, a['c']);
Dygraph.updateDeep(a, { d: null });
- assertEquals(null, a['d']);
+ assert.equal(null, a['d']);
Dygraph.updateDeep(a, { a: 10, b: [1, 2] });
- assertEquals(10, a['a']);
- assertEquals([1, 2], a['b']);
- assertEquals({x: 2, y: 2}, a['c']);
- assertEquals(null, a['d']);
-};
+ assert.equal(10, a['a']);
+ assert.deepEqual([1, 2], a['b']);
+ assert.deepEqual({x: 2, y: 2}, a['c']);
+ assert.equal(null, a['d']);
+});
-UtilsTestCase.prototype.testUpdateDeepDecoupled = function() {
+it('testUpdateDeepDecoupled', function() {
var a = {
a: 1,
b: [1, 2, 3],
Dygraph.updateDeep(b, a);
b.a = 2;
- assertEquals(1, a.a);
+ assert.equal(1, a.a);
b.b[0] = 2;
- assertEquals(1, a.b[0]);
+ assert.equal(1, a.b[0]);
b.c.x = "new value";
- assertEquals("original", a.c.x);
-};
+ assert.equal("original", a.c.x);
+});
-UtilsTestCase.prototype.testIterator_nopredicate = function() {
+it('testIterator_nopredicate', function() {
var array = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'];
var iter = Dygraph.createIterator(array, 1, 4);
- assertTrue(iter.hasNext);
- assertEquals('b', iter.peek);
- assertEquals('b', iter.next());
- assertTrue(iter.hasNext);
+ assert.isTrue(iter.hasNext);
+ assert.equal('b', iter.peek);
+ assert.equal('b', iter.next());
+ assert.isTrue(iter.hasNext);
- assertEquals('c', iter.peek);
- assertEquals('c', iter.next());
+ assert.equal('c', iter.peek);
+ assert.equal('c', iter.next());
- assertTrue(iter.hasNext);
- assertEquals('d', iter.next());
+ assert.isTrue(iter.hasNext);
+ assert.equal('d', iter.next());
- assertTrue(iter.hasNext);
- assertEquals('e', iter.next());
+ assert.isTrue(iter.hasNext);
+ assert.equal('e', iter.next());
- assertFalse(iter.hasNext);
-};
+ assert.isFalse(iter.hasNext);
+});
-UtilsTestCase.prototype.testIterator_predicate = function() {
+it('testIterator_predicate', function() {
var array = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'];
var iter = Dygraph.createIterator(array, 1, 4,
function(array, idx) { return array[idx] !== 'd' });
- assertTrue(iter.hasNext);
- assertEquals('b', iter.peek);
- assertEquals('b', iter.next());
- assertTrue(iter.hasNext);
+ assert.isTrue(iter.hasNext);
+ assert.equal('b', iter.peek);
+ assert.equal('b', iter.next());
+ assert.isTrue(iter.hasNext);
- assertEquals('c', iter.peek);
- assertEquals('c', iter.next());
+ assert.equal('c', iter.peek);
+ assert.equal('c', iter.next());
- assertTrue(iter.hasNext);
- assertEquals('e', iter.next());
+ assert.isTrue(iter.hasNext);
+ assert.equal('e', iter.next());
- assertFalse(iter.hasNext);
-}
+ assert.isFalse(iter.hasNext);
+});
-UtilsTestCase.prototype.testIterator_empty = function() {
+it('testIterator_empty', function() {
var array = [];
var iter = Dygraph.createIterator([], 0, 0);
- assertFalse(iter.hasNext);
-};
+ assert.isFalse(iter.hasNext);
+});
-UtilsTestCase.prototype.testIterator_outOfRange = function() {
+it('testIterator_outOfRange', function() {
var array = ['a', 'b', 'c'];
var iter = Dygraph.createIterator(array, 1, 4,
function(array, idx) { return array[idx] !== 'd' });
- assertTrue(iter.hasNext);
- assertEquals('b', iter.peek);
- assertEquals('b', iter.next());
- assertTrue(iter.hasNext);
+ assert.isTrue(iter.hasNext);
+ assert.equal('b', iter.peek);
+ assert.equal('b', iter.next());
+ assert.isTrue(iter.hasNext);
- assertEquals('c', iter.peek);
- assertEquals('c', iter.next());
+ assert.equal('c', iter.peek);
+ assert.equal('c', iter.next());
- assertFalse(iter.hasNext);
-};
+ assert.isFalse(iter.hasNext);
+});
// Makes sure full array is tested, and that the predicate isn't called
// with invalid boundaries.
-UtilsTestCase.prototype.testIterator_whole_array = function() {
+it('testIterator_whole_array', function() {
var array = ['a', 'b', 'c'];
var iter = Dygraph.createIterator(array, 0, array.length,
function(array, idx) {
throw "err";
} else {
return true;
- };
+ }
});
- assertTrue(iter.hasNext);
- assertEquals('a', iter.next());
- assertTrue(iter.hasNext);
- assertEquals('b', iter.next());
- assertTrue(iter.hasNext);
- assertEquals('c', iter.next());
- assertFalse(iter.hasNext);
- assertNull(iter.next());
-};
-
-UtilsTestCase.prototype.testIterator_no_args = function() {
+ assert.isTrue(iter.hasNext);
+ assert.equal('a', iter.next());
+ assert.isTrue(iter.hasNext);
+ assert.equal('b', iter.next());
+ assert.isTrue(iter.hasNext);
+ assert.equal('c', iter.next());
+ assert.isFalse(iter.hasNext);
+ assert.isNull(iter.next());
+});
+
+it('testIterator_no_args', function() {
var array = ['a', 'b', 'c'];
var iter = Dygraph.createIterator(array);
- assertTrue(iter.hasNext);
- assertEquals('a', iter.next());
- assertTrue(iter.hasNext);
- assertEquals('b', iter.next());
- assertTrue(iter.hasNext);
- assertEquals('c', iter.next());
- assertFalse(iter.hasNext);
- assertNull(iter.next());
-};
-
-UtilsTestCase.prototype.testToRGB = function() {
- assertEquals({r: 255, g: 200, b: 150}, Dygraph.toRGB_('rgb(255,200,150)'));
- assertEquals({r: 255, g: 200, b: 150}, Dygraph.toRGB_('#FFC896'));
- assertEquals({r: 255, g: 0, b: 0}, Dygraph.toRGB_('red'));
-};
-
-UtilsTestCase.prototype.testIsPixelChangingOptionList = function() {
+ assert.isTrue(iter.hasNext);
+ assert.equal('a', iter.next());
+ assert.isTrue(iter.hasNext);
+ assert.equal('b', iter.next());
+ assert.isTrue(iter.hasNext);
+ assert.equal('c', iter.next());
+ assert.isFalse(iter.hasNext);
+ assert.isNull(iter.next());
+});
+
+it('testToRGB', function() {
+ assert.deepEqual({r: 255, g: 200, b: 150}, Dygraph.toRGB_('rgb(255,200,150)'));
+ assert.deepEqual({r: 255, g: 200, b: 150}, Dygraph.toRGB_('#FFC896'));
+ assert.deepEqual({r: 255, g: 0, b: 0}, Dygraph.toRGB_('red'));
+});
+
+it('testIsPixelChangingOptionList', function() {
var isPx = Dygraph.isPixelChangingOptionList;
- assertTrue(isPx([], { axes: { y: { digitsAfterDecimal: 3 }}}));
- assertFalse(isPx([], { axes: { y: { axisLineColor: 'blue' }}}));
-};
+ assert.isTrue(isPx([], { axes: { y: { digitsAfterDecimal: 3 }}}));
+ assert.isFalse(isPx([], { axes: { y: { axisLineColor: 'blue' }}}));
+});
/*
-UtilsTestCase.prototype.testDateSet = function() {
+it('testDateSet', function() {
var base = new Date(1383455100000);
var d = new Date(base);
// A one hour shift -- this is surprising behavior!
d.setMilliseconds(10);
- assertEquals(3600010, d.getTime() - base.getTime());
+ assert.equal(3600010, d.getTime() - base.getTime());
// setDateSameTZ compensates for this surprise.
d = new Date(base);
Dygraph.setDateSameTZ(d, {ms: 10});
- assertEquals(10, d.getTime() - base.getTime());
-};
+ assert.equal(10, d.getTime() - base.getTime());
+});
*/
+
+});
* @author sergeyslepian@gmail.com
*/
-var VisibilityTestCase = TestCase("visibility");
+describe("visibility", function() {
-VisibilityTestCase.prototype.setUp = function() {
+beforeEach(function() {
document.body.innerHTML = "<div id='graph'></div>";
-};
+});
-VisibilityTestCase.prototype.tearDown = function() {
-};
+afterEach(function() {
+});
/**
* Does a bunch of the shared busywork of setting up a graph and changing its visibility.
return Util.getLegend();
};
-VisibilityTestCase.prototype.testDefaultCases = function() {
- assertEquals(' A B C D E', getVisibleSeries(true, [[], true]));
- assertEquals('', getVisibleSeries(false, [[], true]));
-};
+it('testDefaultCases', function() {
+ assert.equal(' A B C D E', getVisibleSeries(true, [[], true]));
+ assert.equal('', getVisibleSeries(false, [[], true]));
+});
-VisibilityTestCase.prototype.testSingleSeriesHide = function() {
- assertEquals(' A C D E', getVisibleSeries(true, [1, false]));
-};
+it('testSingleSeriesHide', function() {
+ assert.equal(' A C D E', getVisibleSeries(true, [1, false]));
+});
-VisibilityTestCase.prototype.testSingleSeriesShow = function() {
- assertEquals(' E', getVisibleSeries(false, [4, true]));
-};
+it('testSingleSeriesShow', function() {
+ assert.equal(' E', getVisibleSeries(false, [4, true]));
+});
-VisibilityTestCase.prototype.testMultiSeriesHide = function() {
- assertEquals(' A E', getVisibleSeries(true, [[1,2,3], false]));
-};
+it('testMultiSeriesHide', function() {
+ assert.equal(' A E', getVisibleSeries(true, [[1,2,3], false]));
+});
-VisibilityTestCase.prototype.testMultiSeriesShow = function() {
- assertEquals(' B D', getVisibleSeries(false, [[1,3], true]));
-};
+it('testMultiSeriesShow', function() {
+ assert.equal(' B D', getVisibleSeries(false, [[1,3], true]));
+});
+
+});
"gulp-sourcemaps": "^1.3.0",
"gulp-uglify": "^1.0.2",
"jshint": "^2.5.10",
- "karma": "^0.12.28",
- "karma-coverage": "^0.2.7",
+ "karma": "^0.12.31",
"karma-chai-plugins": "git+https://github.com/cthrax/karma-chai-plugins.git#c44bd9c2026bcbaf5bb56a9ee35a13d216e44d20",
+ "karma-chrome-launcher": "^0.1.7",
+ "karma-coverage": "^0.2.7",
"karma-mocha": "^0.1.10",
"karma-phantomjs-launcher": "^0.1.4",
"karma-spec-reporter": "0.0.16",