From: Dan Vanderkam Date: Wed, 28 Dec 2016 21:37:08 +0000 (-0500) Subject: 2.0.0 release fixes (#815) X-Git-Tag: v2.0.0~7 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=fd6b8dadbaa0614671bef1508c23d6a932e25081;p=dygraphs.git 2.0.0 release fixes (#815) * Documentation / test cleanup * Remove deprecated avoidMinZero option * remove all references to dygraph-combined * Drop for..of and polyfill to save space * Check for strings in native format * Generate minified CSS * Get npm distribution working * Guard process access for rollup * Add ES6 example to home page * Update tests to source CSS from dist * update some references * Drop bower, bump version * index.es5.js * bump version --- diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index ee72da0..80d7cf2 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -7,13 +7,13 @@ It also helps if you include the non-compacted version of the JS on your page. For instance, instead of doing this: ```html - + ``` do this: ```html - + ``` This makes error messages and debugging simpler. The jsfiddle does this automatically. diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 75d0c7a..3bbac04 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -8,13 +8,13 @@ It also helps if you include the non-compacted version of the JS on your page. For instance, instead of doing this: ```html - + ``` do this: ```html - + ``` This makes error messages and debugging simpler. The jsfiddle does this automatically. diff --git a/.gitignore b/.gitignore index 121cd66..e97dd19 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ env dist coverage *.log +*.pyc diff --git a/README.md b/README.md index 9abb9a1..8e639e5 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,8 @@ Get help with dygraphs on ```html - + +
diff --git a/auto_tests/tests/formats.js b/auto_tests/tests/formats.js index f16cc6d..2548d99 100644 --- a/auto_tests/tests/formats.js +++ b/auto_tests/tests/formats.js @@ -77,6 +77,16 @@ it('testXValueParser', function() { assert.equal(6, g.getValue(3, 0)); }); +it('should throw on strings in native format', () => { + assert.throws(() => { + new Dygraph('graph', [['1', '10'], ['2', '20']]) + }, /expected number or date/i); + + assert.throws(() => { + new Dygraph('graph', [[new Date(), '10'], [new Date(), '20']]) + }, /expected number or array/i); +}); + var assertData = function(g) { var expected = dataArray; diff --git a/auto_tests/tests/pathological_cases.js b/auto_tests/tests/pathological_cases.js index 0fab200..326fefb 100644 --- a/auto_tests/tests/pathological_cases.js +++ b/auto_tests/tests/pathological_cases.js @@ -70,10 +70,6 @@ it('testCombinations', function() { var variantOpts = { none: {}, - avoidMinZero: { - avoidMinZero: true, - includeZero: true - }, padded: { includeZero: true, drawAxesAtZero: true, diff --git a/auto_tests/tests/range_tests.js b/auto_tests/tests/range_tests.js index 19d4294..f14d30f 100644 --- a/auto_tests/tests/range_tests.js +++ b/auto_tests/tests/range_tests.js @@ -19,7 +19,7 @@ // THE SOFTWARE. -/** +/** * @fileoverview Test valueRange and dateWindow changes. * * @author konigsberg@google.com (Robert Konigsberg) @@ -43,7 +43,7 @@ var ZERO_TO_FIFTY_STEPS = (function() { }()); var FIVE_TO_ONE_THOUSAND = [ - [ 1, 10 ], [ 2, 20 ], [ 3, 30 ], [ 4, 40 ] , [ 5, 50 ], + [ 1, 10 ], [ 2, 20 ], [ 3, 30 ], [ 4, 40 ] , [ 5, 50 ], [ 6, 60 ], [ 7, 70 ], [ 8, 80 ], [ 9, 90 ] , [ 10, 1000 ]]; describe("range-tests", function() { @@ -106,7 +106,7 @@ it('testRangeSetOperations', function() { g.updateOptions({ }); assert.deepEqual([12, 18], g.xAxisRange()); assert.deepEqual([10, 40], g.yAxisRange(0)); - + g.updateOptions({valueRange : null, axes: {y:{valueRange : [15, 20]}}}); assert.deepEqual([12, 18], g.xAxisRange()); assert.deepEqual([15, 20], g.yAxisRange(0)); @@ -182,7 +182,7 @@ it('testLogScaleExcludesZero', function() { labels: ['X', 'Y'] }); assert.deepEqual([10, 1099], g.yAxisRange(0)); - + g.updateOptions({ logscale : false }); assert.deepEqual([0, 1099], g.yAxisRange(0)); }); @@ -196,7 +196,7 @@ it('testIncludeZeroIncludesZero', function() { labels: ['X', 'Y'] }); assert.deepEqual([0, 1100], g.yAxisRange(0)); - + g.updateOptions({ includeZero : false }); assert.deepEqual([450, 1050], g.yAxisRange(0)); }); @@ -206,14 +206,14 @@ it('testIncludeZeroIncludesZero', function() { * Verify that includeZero range is properly specified per axis. */ it('testIncludeZeroPerAxis', function() { - var g = new Dygraph("graph", + var g = new Dygraph("graph", 'X,A,B\n'+ '0,50,50\n'+ '50,110,110\n', { drawPoints: true, pointSize:5, - series:{ + series:{ A: { axis: 'y', pointSize: 10 @@ -221,7 +221,7 @@ it('testIncludeZeroPerAxis', function() { B: { axis: 'y2' } - }, + }, axes: { 'y2': { includeZero: true } } @@ -242,7 +242,7 @@ it('testIncludeZeroPerAxis', function() { /** * Verify that very large Y ranges don't break things. - */ + */ it('testHugeRange', function() { var g = new Dygraph("graph", [[0, -1e120], [1, 1e230]], { includeZero: true, @@ -253,15 +253,6 @@ it('testHugeRange', function() { }); /** - * Verify old-style avoidMinZero option. - */ -it('testAvoidMinZero', function() { - var g = createGraph({ - avoidMinZero: true, - }, ZERO_TO_FIFTY_STEPS, [10, 20], [-5, 55]); -}); - -/** * Verify ranges with user-specified padding, implicit avoidMinZero. */ it('testPaddingAuto', function() { @@ -346,23 +337,6 @@ it('testLogscalePad', function() { }); /** - * Verify scrolling all-zero region, traditional. - */ -it('testZeroScroll', function() { - var g = new Dygraph( - document.getElementById("graph"), - "X,Y\n" + - "1,0\n" + - "8,0\n" + - "9,0.1\n", - { - drawAxesAtZero: true, - animatedZooms: true, - avoidMinZero: true - }); -}); - -/** * Verify scrolling all-zero region, new-style. */ it('testZeroScroll2', function() { diff --git a/bower.json b/bower.json deleted file mode 100644 index 6ebcc5c..0000000 --- a/bower.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "dygraphs", - "main": "dist/dygraph.js", - "ignore": [ - "Makefile", - "NOTES", - "auto_tests", - "common", - "data.js", - "docs", - "experimental", - "file-size-stats.sh", - "gadget.xml", - "gallery", - "generate-combined.sh", - "generate-documentation.py", - "generate-download.py", - "generate-jar.sh", - "generate-jsdoc.sh", - "gwt", - "jsTestDriver.conf", - "jsdoc-toolkit", - "lint.sh", - "node_modules", - "package.json", - "phantom-driver.js", - "phantom-perf.js", - "push-to-web.sh", - "release.sh", - "releases.json", - "screenshot.png", - "scripts", - "test.sh", - "tests", - "thumbnail.png" - ] -} diff --git a/docs/header.html b/docs/header.html index 870c84c..cc5881c 100644 --- a/docs/header.html +++ b/docs/header.html @@ -6,9 +6,10 @@ + - + - + @@ -33,14 +33,12 @@ - diff --git a/tests/annotation-native.html b/tests/annotation-native.html index 4e4538d..53ce249 100644 --- a/tests/annotation-native.html +++ b/tests/annotation-native.html @@ -1,7 +1,7 @@ - + Native format annotations diff --git a/tests/annotation.html b/tests/annotation.html index 002d4dd..c180070 100644 --- a/tests/annotation.html +++ b/tests/annotation.html @@ -1,15 +1,8 @@ - + demo - -