Merge branch 'master' of https://github.com/kberg/dygraphs
authorDan Vanderkam <danvk@google.com>
Mon, 22 Nov 2010 15:49:03 +0000 (10:49 -0500)
committerDan Vanderkam <danvk@google.com>
Mon, 22 Nov 2010 15:49:03 +0000 (10:49 -0500)
1  2 
dygraph.js

diff --combined dygraph.js
@@@ -1086,8 -1086,7 +1086,7 @@@ Dygraph.prototype.doZoomXDates_ = funct
    this.dateWindow_ = [minDate, maxDate];
    this.drawGraph_();
    if (this.attr_("zoomCallback")) {
-     var yRange = this.yAxisRange();
-     this.attr_("zoomCallback")(minDate, maxDate, yRange[0], yRange[1]);
+     this.attr_("zoomCallback")(minDate, maxDate, this.yAxisRanges());
    }
  };
  
@@@ -2413,8 -2412,7 +2412,8 @@@ Dygraph.prototype.parseCSV_ = function(
    // 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;
@@@ -2646,11 -2644,6 +2645,11 @@@ Dygraph.prototype.parseDataTable_ = fun
      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);
    }