projects
/
dygraphs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update locations
[dygraphs.git]
/
dygraph.js
diff --git
a/dygraph.js
b/dygraph.js
index
7d64bb9
..
1ed103c
100644
(file)
--- a/
dygraph.js
+++ b/
dygraph.js
@@
-37,7
+37,7
@@
And error bars will be calculated automatically using a binomial distribution.
And error bars will be calculated automatically using a binomial distribution.
- For further documentation and examples, see http://
www.danvk.org/dygraphs
+ For further documentation and examples, see http://
dygraphs.com/
*/
*/
@@
-1086,7
+1086,7
@@
Dygraph.prototype.doZoomXDates_ = function(minDate, maxDate) {
this.dateWindow_ = [minDate, maxDate];
this.drawGraph_();
if (this.attr_("zoomCallback")) {
this.dateWindow_ = [minDate, maxDate];
this.drawGraph_();
if (this.attr_("zoomCallback")) {
- this.attr_("zoomCallback")(minDate, maxDate, this.yAxisRange());
+ this.attr_("zoomCallback")(minDate, maxDate, this.yAxisRange
s
());
}
};
}
};
@@
-2412,7
+2412,8
@@
Dygraph.prototype.parseCSV_ = function(data) {
// Parse the x as a float or return null if it's not a number.
var parseFloatOrNull = function(x) {
var val = parseFloat(x);
// Parse the x as a float or return null if it's not a number.
var parseFloatOrNull = function(x) {
var val = parseFloat(x);
- return isNaN(val) ? null : val;
+ // isFinite() returns false for NaN and +/-Infinity.
+ return isFinite(val) ? val : null;
};
var xParser;
};
var xParser;
@@
-2644,6
+2645,11
@@
Dygraph.prototype.parseDataTable_ = function(data) {
if (ret.length > 0 && row[0] < ret[ret.length - 1][0]) {
outOfOrder = true;
}
if (ret.length > 0 && row[0] < ret[ret.length - 1][0]) {
outOfOrder = true;
}
+
+ // Strip out infinities, which give dygraphs problems later on.
+ for (var j = 0; j < row.length; j++) {
+ if (!isFinite(row[j])) row[j] = null;
+ }
ret.push(row);
}
ret.push(row);
}