--- /dev/null
+Filing a bug report? Please include the following:
+
+1. Link to a page which demonstrates the problem, preferably a jsfiddle (use [this jsfiddle](http://dygraphs.com/fiddle) as a template)
+2. Browser and Operating System that exhibit the problem
+
+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>
+```
+
+do this:
+
+```html
+<script type="text/javascript" src="dygraph-dev.js"></script>
+```
+
+This makes error messages and debugging simpler. The jsfiddle does this automatically.
+
+Sending a Pull Request? See our [guide to making dygraphs contributions](http://dygraphs.com/changes.html).
test:
@./test.sh
+ @./check-combined-unaffected.sh
test-combined: move-combined test clean-combined-test
g.setSelection(3);
assertEquals(3, g.getSelection());
};
+
+SelectionTestCase.prototype.testSetGetSelectionMissingPoints = function() {
+ dataHandler = function() {};
+ dataHandler.prototype = new Dygraph.DataHandlers.DefaultHandler();
+ dataHandler.prototype.seriesToPoints = function(series, setName, boundaryIdStart) {
+ var val = null;
+ if (setName == 'A') {
+ val = 1;
+ } else if (setName == 'B') {
+ val = 2;
+ } else if (setName == 'C') {
+ val = 3;
+ }
+ return [{
+ x: NaN,
+ y: NaN,
+ xval: val,
+ yval: val,
+ name: setName,
+ idx: val - 1
+ }];
+ };
+ var graph = document.getElementById("graph");
+ var g = new Dygraph(graph,
+ "X,A,B,C\n" +
+ "1,1,null,null\n" +
+ "2,null,2,null\n" +
+ "3,null,null,3\n",
+ {
+ dataHandler: dataHandler
+ }
+ );
+
+ g.setSelection(0);
+ assertEquals(0, g.getSelection());
+ g.setSelection(1);
+ assertEquals(1, g.getSelection());
+ g.setSelection(2);
+ assertEquals(2, g.getSelection());
+};
--- /dev/null
+{
+ "name": "dygraphs",
+ "version": "v1.0.1+bower",
+ "main": "dygraph-combined.js",
+ "ignore": [
+ "Makefile",
+ "NOTES",
+ "auto_tests",
+ "closure-todo.txt",
+ "common",
+ "compile-with-closure.sh",
+ "dashed-canvas.js",
+ "data.js",
+ "datahandler",
+ "docs",
+ "experimental",
+ "file-size-stats.sh",
+ "gadget.xml",
+ "gallery",
+ "generate-combined.sh",
+ "generate-documentation.py",
+ "generate-download.py",
+ "generate-jar.sh",
+ "generate-jsdoc.sh",
+ "gviz-api.js",
+ "gwt",
+ "jsTestDriver.conf",
+ "jsdoc-toolkit",
+ "jshint",
+ "lint.sh",
+ "node_modules",
+ "package.json",
+ "phantom-driver.js",
+ "phantom-perf.js",
+ "push-to-web.sh",
+ "release.sh",
+ "releases.json",
+ "screenshot.png",
+ "stacktrace.js",
+ "test.sh",
+ "tests",
+ "thumbnail.png",
+ "yuicompressor-2.4.2.jar"
+ ]
+}
--- /dev/null
+#!/bin/bash
+# Ensures that dygraph-combined.js is unaffected.
+# Helpful for pull requests, where this is a common mistake.
+
+grep 'var' dygraph-combined.js > /dev/null
+if [ $? -eq 0 ]; then
+ echo 'Please revert changes to dygraph-combined.js' >&2
+ echo 'You can do this by running: ' >& 2
+ echo '' >& 2
+ echo ' git checkout dygraph-combined.js' >&2
+ echo '' >& 2
+ exit 1
+fi
+
+exit 0
};
/**
- * Converts a series to a Point array.
+ * Converts a series to a Point array. The resulting point array must be
+ * returned in increasing order of idx property.
*
* @param {!Array.<[!number,?number,?]>} series The series in the unified
* data format where series[i] = [x,y,{extras}].
<ul id="menu3" class="dropdown-menu" role="menu" aria-labelledby="drop6">
<li role="presentation"><a role="menuitem" tabindex="-1" href="changes.html">Contributors Guide</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="http://github.com/danvk/dygraphs">Source (Github)</a></li>
- <li role="presentation"><a role="menuitem" tabindex="-1" href="https://code.google.com/p/dygraphs/issues/list">Issue Tracker</a></li>
- <li role="presentation"><a role="menuitem" tabindex="-1" href="https://code.google.com/p/dygraphs/issues/entry">Report a Bug</a></li>
+ <li role="presentation"><a role="menuitem" tabindex="-1" href="https://github.com/danvk/dygraphs/issues">Issue Tracker</a></li>
+ <li role="presentation"><a role="menuitem" tabindex="-1" href="https://github.com/danvk/dygraphs/issues/new">Report a Bug</a></li>
</ul>
</li>
</ul> <!-- /tabs -->
*/
Dygraph.getContextPixelRatio = function(context) {
try {
- var devicePixelRatio = window.devicePixelRatio || 1,
- backingStoreRatio = context.webkitBackingStorePixelRatio ||
+ var devicePixelRatio = window.devicePixelRatio;
+ var backingStoreRatio = context.webkitBackingStorePixelRatio ||
context.mozBackingStorePixelRatio ||
context.msBackingStorePixelRatio ||
context.oBackingStorePixelRatio ||
- context.backingStorePixelRatio || 1;
- return devicePixelRatio / backingStoreRatio;
+ context.backingStorePixelRatio;
+ if (devicePixelRatio !== undefined &&
+ backingStorePixelRatio !== undefined) {
+ return devicePixelRatio / backingStoreRatio;
+ } else {
+ // If either value is undefined, the ratio is meaningless so we want to
+ // return 1.
+ return 1;
+ }
} catch (e) {
return 1;
}
this.lastRow_ = row;
for (var setIdx = 0; setIdx < this.layout_.points.length; ++setIdx) {
var points = this.layout_.points[setIdx];
+ // Check if the point at the appropriate index is the point we're looking
+ // for. If it is, just use it, otherwise search the array for a point
+ // in the proper place.
var setRow = row - this.getLeftBoundary_(setIdx);
- if (setRow < points.length) {
+ if (setRow < points.length && points[setRow].idx == row) {
var point = points[setRow];
if (point.yval !== null) this.selPoints_.push(point);
+ } else {
+ for (var pointIdx = 0; pointIdx < points.length; ++pointIdx) {
+ var point = points[pointIdx];
+ if (point.idx == row) {
+ if (point.yval !== null) {
+ this.selPoints_.push(point);
+ }
+ break;
+ }
+ }
}
}
} else {
exit 1
fi
+grep "$VERSION" package.json
+if [ $? -ne 0 ]; then
+ echo "Version in package.json doesn't match command line argument." >&2
+ exit 1
+fi
+
+grep "v$VERSION" bower.json
+if [ $? -ne 0 ]; then
+ echo "Version in bower.json doesn't match command line argument." >&2
+ exit 1
+fi
+
make lint test test-combined
if [ $? -ne 0 ]; then
echo "Tests failed. Won't release!" >&2