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)
9 import Dygraph from
'../../src/dygraph';
10 import {assertDeepCloseTo
} from
'./custom_asserts';
12 describe("scientific-notation", function() {
16 function getXValues(g
) {
18 for (var i
= 0; i
< g
.numRows(); i
++) {
19 xs
.push(g
.getValue(i
, 0));
24 it('testScientificInput', function() {
32 var graph
= document
.getElementById("graph");
33 var g
= new Dygraph(graph
, data
, {});
34 assertDeepCloseTo([10, 20, 30, 40], getXValues(g
), 1e-6);
37 it('testScientificInputPlus', function() {
45 var graph
= document
.getElementById("graph");
46 var g
= new Dygraph(graph
, data
, {});
47 assertDeepCloseTo([10, 20, 30, 40], getXValues(g
), 1e-6);
50 it('testScientificInputMinus', function() {
58 var graph
= document
.getElementById("graph");
59 var g
= new Dygraph(graph
, data
, {});
60 assertDeepCloseTo([0.1, 0.2, 0.3, 0.4], getXValues(g
), 1e-6);
63 it('testScientificInputMinusCap', function() {
71 var graph
= document
.getElementById("graph");
72 var g
= new Dygraph(graph
, data
, {});
73 assertDeepCloseTo([0.1, 0.2, 0.3, 0.4], getXValues(g
), 1e-6);