Permalink
Browse files

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
  • Loading branch information...
1 parent 627e054 commit fd6b8dadbaa0614671bef1508c23d6a932e25081 @danvk committed on GitHub Dec 28, 2016
Showing with 289 additions and 878 deletions.
  1. +2 −2 .github/CONTRIBUTING.md
  2. +2 −2 .github/ISSUE_TEMPLATE.md
  3. +1 −0 .gitignore
  4. +2 −1 README.md
  5. +10 −0 auto_tests/tests/formats.js
  6. +0 −4 auto_tests/tests/pathological_cases.js
  7. +9 −35 auto_tests/tests/range_tests.js
  8. +0 −37 bower.json
  9. +3 −2 docs/header.html
  10. +14 −2 docs/index.html
  11. +10 −5 docs/tutorial.html
  12. +9 −1 docs/versions.html
  13. +0 −61 gallery/avoid-min-zero.js
  14. +0 −84 gallery/edge-padding.js
  15. +1 −1 gallery/gallery.js
  16. +1 −3 gallery/index.html
  17. +1 −1 gwt/org/danvk/Dygraphs.java
  18. +2 −0 index.es5.js
  19. +1 −0 index.js
  20. +15 −11 package.json
  21. +15 −0 releases.json
  22. +9 −8 scripts/build.sh
  23. +1 −1 scripts/generate-documentation.py
  24. +8 −11 scripts/generate-download.py
  25. +1 −1 scripts/generate-jsdoc.sh
  26. +12 −15 scripts/push-to-web.sh
  27. +5 −20 scripts/release.sh
  28. +1 −1 scripts/weigh-in.sh
  29. +0 −1 src/dygraph-default-attrs.js
  30. +3 −7 src/dygraph-options-reference.js
  31. +6 −2 src/dygraph-options.js
  32. +39 −26 src/dygraph.js
  33. +6 −6 src/plugins/axes.js
  34. +6 −7 src/plugins/grid.js
  35. +0 −4 tests/annotation-gviz.html
  36. +1 −1 tests/annotation-native.html
  37. +1 −8 tests/annotation.html
  38. +0 −81 tests/avoidMinZero.html
  39. +1 −5 tests/border.html
  40. +1 −5 tests/callback.html
  41. +1 −5 tests/century-scale.html
  42. +1 −1 tests/charting-combinations.html
  43. +1 −5 tests/color-cycle.html
  44. +1 −5 tests/color-visibility.html
  45. +1 −5 tests/connect-separated.html
  46. +1 −5 tests/crosshair.html
  47. +1 −1 tests/css-positioning.html
  48. +1 −5 tests/custom-bars.html
  49. +1 −5 tests/custom-circles.html
  50. +1 −5 tests/customLabel.html
  51. +1 −5 tests/customLabelCss3.html
  52. +1 −5 tests/dateWindow.html
  53. +1 −5 tests/daylight-savings.html
  54. +2 −4 tests/demo.html
  55. +1 −1 tests/dense-fill.html
  56. +1 −5 tests/draw-points.html
  57. +1 −5 tests/drawing.html
  58. +1 −5 tests/dygraph-many-points-benchmark.html
  59. +1 −5 tests/dygraph.html
  60. +1 −5 tests/dynamic-update.html
  61. +1 −1 tests/exported-symbols.html
  62. +1 −5 tests/fillGraph-alpha.html
  63. +1 −5 tests/fillGraph.html
  64. +1 −5 tests/fractions.html
  65. +1 −5 tests/grid_dot.html
  66. +1 −5 tests/gviz-infinity.html
  67. +1 −5 tests/gviz-selection.html
  68. +1 −5 tests/gviz.html
  69. +1 −1 tests/hairlines.html
  70. +1 −5 tests/highlighted-region.html
  71. +1 −5 tests/hourly.html
  72. +1 −1 tests/iframe.html
  73. +1 −5 tests/independent-series.html
  74. +1 −5 tests/interaction.html
  75. +1 −5 tests/is-zoomed.html
  76. +1 −5 tests/isolated-points.html
  77. +1 −5 tests/label-div.html
  78. +0 −4 tests/labelsDateMilliseconds.html
  79. +1 −5 tests/labelsDateUTC.html
  80. +1 −5 tests/labelsKMB.html
  81. +1 −5 tests/layout-options.html
  82. +1 −1 tests/legend-formatter.html
  83. +1 −5 tests/legend-values.html
  84. +1 −5 tests/linear-regression-addseries.html
  85. +1 −5 tests/linear-regression-fractions.html
  86. +1 −5 tests/linear-regression.html
  87. +1 −5 tests/link-interaction.html
  88. +1 −5 tests/logscale.html
  89. +1 −5 tests/missing-data.html
  90. +1 −1 tests/multi-scale.html
  91. +5 −9 tests/native-format.html
  92. +1 −5 tests/negative.html
  93. +1 −5 tests/no-range.html
  94. +1 −5 tests/no-visibility.html
  95. +1 −5 tests/number-format.html
  96. +1 −5 tests/numeric-axis.html
  97. +1 −5 tests/numeric-gviz.html
  98. +1 −5 tests/out-of-order.html
  99. +1 −37 tests/per-series.html
  100. +1 −5 tests/perf.html
  101. +1 −5 tests/plotter.html
  102. +1 −1 tests/plotters.html
  103. +1 −1 tests/plugins.html
  104. +1 −5 tests/range-selector.html
  105. +1 −5 tests/resize.html
  106. +1 −5 tests/reverse-y-axis.html
  107. +1 −5 tests/series-highlight.html
  108. +1 −5 tests/small-range-zero.html
  109. +1 −1 tests/smooth-plots.html
  110. +1 −5 tests/spacing.html
  111. +1 −5 tests/stacked.html
  112. +1 −5 tests/steps.html
  113. +1 −5 tests/stock.html
  114. +1 −1 tests/straw-broom.html
  115. +1 −5 tests/styled-chart-labels.html
  116. +1 −5 tests/synchronize.html
  117. +1 −5 tests/temperature-sf-ny.html
  118. +1 −5 tests/two-axes-vr.html
  119. +1 −5 tests/two-axes.html
  120. +1 −5 tests/unboxed-spark.html
  121. +1 −5 tests/underlay-callback.html
  122. +1 −5 tests/value-axis-formatters.html
  123. +1 −5 tests/visibility.html
  124. +1 −5 tests/x-axis-formatter.html
  125. +1 −5 tests/zero-series.html
  126. +1 −5 tests/zoom.html
@@ -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
-<script type="text/javascript" src="dygraph-combined.js"></script>
+<script type="text/javascript" src="dygraph.min.js"></script>
```
do this:
```html
-<script type="text/javascript" src="dygraph-combined.dev.js"></script>
+<script type="text/javascript" src="dygraph.js"></script>
```
This makes error messages and debugging simpler. The jsfiddle does this automatically.
@@ -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
-<script type="text/javascript" src="dygraph-combined.js"></script>
+<script type="text/javascript" src="dygraph.min.js"></script>
```
do this:
```html
-<script type="text/javascript" src="dygraph-combined.dev.js"></script>
+<script type="text/javascript" src="dygraph.js"></script>
```
This makes error messages and debugging simpler. The jsfiddle does this automatically.
View
@@ -5,3 +5,4 @@ env
dist
coverage
*.log
+*.pyc
View
@@ -24,7 +24,8 @@ Get help with dygraphs on
```html
<html>
<head>
-<script type="text/javascript" src="dygraph-combined.js"></script>
+<script type="text/javascript" src="dygraph.js"></script>
+<link rel="stylesheet" href="dygraph.css" />
</head>
<body>
<div id="graphdiv"></div>
@@ -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;
@@ -70,10 +70,6 @@ it('testCombinations', function() {
var variantOpts = {
none: {},
- avoidMinZero: {
- avoidMinZero: true,
- includeZero: true
- },
padded: {
includeZero: true,
drawAxesAtZero: true,
@@ -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,22 +206,22 @@ 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
},
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() {
View
@@ -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"
- ]
-}
View
@@ -6,9 +6,10 @@
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<link rel="stylesheet" href="bootstrap.min.css">
<link rel="stylesheet" href="site.css">
+ <link rel="stylesheet" href="dygraph.css">
<script src="bootstrap.min.js"></script>
- <script type="text/javascript" src="dygraph-combined.js"></script>
+ <script type="text/javascript" src="dygraph.min.js"></script>
</head>
<body>
<!--
@@ -28,7 +29,7 @@
<h1 class="navbar-brand"><a href="/">dygraphs</a></h1>
-
+
<!-- Place everything within .navbar-collapse to hide it until above 768px -->
<div class="nav-collapse collapse navbar-responsive-collapse">
View
@@ -26,7 +26,7 @@
<div id="demodiv"></div>
</div>
</div>
-
+
<script type="text/javascript">
g = new Dygraph(
@@ -61,6 +61,18 @@
<p>Start by <a href="download.html">downloading dygraphs</a>. Then read the <a href="tutorial.html">Tutorial</a> to learn how to use it, or just <a href="http://dygraphs.com/fiddle">play with dygraphs</a> on jsFiddle.</p>
<p>Once you've got your feet wet, look for inspiration in the <a href="gallery/">demo gallery</a> or check out our <a href="users.html">list of users</a>.</p>
+
+ <p>If you're using npm and a bundler like webpack, browserify or rollup, you can install dygraphs via:</p>
+
+ <pre>npm install --save dygraphs</pre>
+
+ and use it via:
+
+ <pre class="prettyprint">import Dygraph from 'dygraphs';
+// or: const Dygraph = require('dygraphs');
+const g = new Dygraph(div, data, {});</pre>
+
+ <p>Check out the <a href="https://github.com/danvk/dygraphs-es6">dygraphs ES6 sample project</a> for more details on this approach.</p>
</div>
<div class="col-lg-4">
@@ -79,5 +91,5 @@
</div>
</div>
-
+
<!--#include virtual="footer.html" -->
View
@@ -6,7 +6,8 @@
}
</style>
-<p>To use dygraphs, include the <code><a href="download.html">dygraph-combined-dev.js</a></code> JavaScript file and instantiate a <code>Dygraph</code> object.</p>
+<p>To use dygraphs, include the <code><a href="download.html">dygraph.js</a></code> JavaScript file
+and <code>dygraph.css</code> CSS file. Then instantiate a <code>Dygraph</code> object.</p>
<p>Here's a basic example to get things started:</p>
@@ -17,7 +18,8 @@ <h3 style="text-align:center">HTML</h3>
&lt;html&gt;
&lt;head&gt;
&lt;script type=&quot;text/javascript&quot;
- src=&quot;dygraph-combined-dev.js&quot;&gt;&lt;/script&gt;
+ src=&quot;dygraph.js&quot;&gt;&lt;/script&gt;
+&lt;link rel=&quot;stylesheet&quot; src=&quot;dygraph.css&quot; /&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id=&quot;graphdiv&quot;&gt;&lt;/div&gt;
@@ -69,7 +71,8 @@ <h3 style="text-align:center">HTML</h3>
&lt;html&gt;
&lt;head&gt;
&lt;script type=&quot;text/javascript&quot;
- src=&quot;dygraph-combined-dev.js&quot;&gt;&lt;/script&gt;
+ src=&quot;dygraph.js&quot;&gt;&lt;/script&gt;
+&lt;link rel=&quot;stylesheet&quot; src=&quot;dygraph.css&quot; /&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id=&quot;graphdiv2&quot;
@@ -120,7 +123,8 @@ <h3 style="text-align:center">HTML</h3>
&lt;html&gt;
&lt;head&gt;
&lt;script type=&quot;text/javascript&quot;
- src=&quot;dygraph-combined-dev.js&quot;&gt;&lt;/script&gt;
+ src=&quot;dygraph.js&quot;&gt;&lt;/script&gt;
+&lt;link rel=&quot;stylesheet&quot; src=&quot;dygraph.css&quot; /&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id=&quot;graphdiv3&quot;
@@ -170,7 +174,8 @@ <h3 style="text-align:center">HTML</h3>
&lt;html&gt;
&lt;head&gt;
&lt;script type=&quot;text/javascript&quot;
- src=&quot;combined.js&quot;&gt;&lt;/script&gt;
+ src=&quot;dygraph.js&quot;&gt;&lt;/script&gt;
+&lt;link rel=&quot;stylesheet&quot; src=&quot;dygraph.css&quot; /&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id=&quot;graphdiv4&quot;
View
@@ -28,6 +28,14 @@
<table class="versions">
<tr>
+ <td>1.1.1<p class="date">2015-06-01</p></td>
+ <td class="notes">
+ <ul>
+ <li>Set <code>this</code> to the dygraph in all callbacks.</li>
+ <li>Minor bug fixes.</li>
+ </ul>
+ </td>
+
<td>1.1.0<p class="date">2014-12-03</p></td>
<td class="notes">
Highlights include:
@@ -42,7 +50,7 @@
<li>"this" is set to the dygraph in all callbacks.
<li>dygraphs has shrunk, because we moved some stuff into "extras" (133kb→122kb)
</ul>
-
+
This will be the last major release to support browsers without a native &lt;canvas&gt; implementation. See <a href="http://blog.dygraphs.com/2014/12/dygraphs-110.html">blog post</a> for more details.
</td>
</tr>
Oops, something went wrong.

0 comments on commit fd6b8da

Please sign in to comment.