2 * @fileoverview Tests input data which uses scientific notation.
3 * This is a regression test for
4 * http://code.google.com/p/dygraphs/issues/detail?id=186
6 * @author danvk@google.com (Dan Vanderkam)
8 describe("scientific-notation", function() {
10 beforeEach(function() {
11 document
.body
.innerHTML
= "<div id='graph'></div>";
14 afterEach(function() {
17 function getXValues(g
) {
19 for (var i
= 0; i
< g
.numRows(); i
++) {
20 xs
.push(g
.getValue(i
, 0));
25 it('testScientificInput', function() {
33 var graph
= document
.getElementById("graph");
34 var g
= new Dygraph(graph
, data
, {});
35 assertDeepCloseTo([10, 20, 30, 40], getXValues(g
), 1e-6);
38 it('testScientificInputPlus', function() {
46 var graph
= document
.getElementById("graph");
47 var g
= new Dygraph(graph
, data
, {});
48 assertDeepCloseTo([10, 20, 30, 40], getXValues(g
), 1e-6);
51 it('testScientificInputMinus', function() {
59 var graph
= document
.getElementById("graph");
60 var g
= new Dygraph(graph
, data
, {});
61 assertDeepCloseTo([0.1, 0.2, 0.3, 0.4], getXValues(g
), 1e-6);
64 it('testScientificInputMinusCap', function() {
72 var graph
= document
.getElementById("graph");
73 var g
= new Dygraph(graph
, data
, {});
74 assertDeepCloseTo([0.1, 0.2, 0.3, 0.4], getXValues(g
), 1e-6);