projects
/
dygraphs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #171 from kberg/master
[dygraphs.git]
/
dygraph.js
diff --git
a/dygraph.js
b/dygraph.js
index
471e4ee
..
9d58201
100644
(file)
--- a/
dygraph.js
+++ b/
dygraph.js
@@
-408,6
+408,12
@@
Dygraph.prototype.__init__ = function(div, file, attrs) {
// TODO(nikhilk): Add any other stackedGraph checks here.
}
// TODO(nikhilk): Add any other stackedGraph checks here.
}
+ // These two options have a bad interaction. See issue 359.
+ if (attrs.showRangeSelector && attrs.animatedZooms) {
+ this.warn('You should not set animatedZooms=true when using the range selector.');
+ attrs.animatedZooms = false;
+ }
+
// Dygraphs has many options, some of which interact with one another.
// To keep track of everything, we maintain two sets of options:
//
// Dygraphs has many options, some of which interact with one another.
// To keep track of everything, we maintain two sets of options:
//
@@
-1310,7
+1316,7
@@
Dygraph.prototype.createDragInterface_ = function() {
context.tarp.uncover();
};
context.tarp.uncover();
};
- this.addEvent(
window
, 'mouseup', this.mouseUpHandler_);
+ this.addEvent(
document
, 'mouseup', this.mouseUpHandler_);
};
/**
};
/**
@@
-1530,7
+1536,8
@@
Dygraph.prototype.doUnzoom_ = function() {
newValueRanges = [];
for (i = 0; i < this.axes_.length; i++) {
var axis = this.axes_[i];
newValueRanges = [];
for (i = 0; i < this.axes_.length; i++) {
var axis = this.axes_[i];
- newValueRanges.push(axis.valueRange !== null ?
+ newValueRanges.push((axis.valueRange !== null &&
+ axis.valueRange !== undefined) ?
axis.valueRange : axis.extremeRange);
}
}
axis.valueRange : axis.extremeRange);
}
}
@@
-1663,7
+1670,7
@@
Dygraph.prototype.findClosestPoint = function(domX, domY) {
var minDist = Infinity;
var idx = -1;
var dist, dx, dy, point, closestPoint, closestSeries;
var minDist = Infinity;
var idx = -1;
var dist, dx, dy, point, closestPoint, closestSeries;
- for (
var setIdx = 0; setIdx < this.layout_.datasets.length; ++setIdx
) {
+ for (
var setIdx = this.layout_.datasets.length - 1 ; setIdx >= 0 ; --setIdx
) {
var points = this.layout_.points[setIdx];
for (var i = 0; i < points.length; ++i) {
var point = points[i];
var points = this.layout_.points[setIdx];
for (var i = 0; i < points.length; ++i) {
var point = points[i];
@@
-2355,7
+2362,6
@@
Dygraph.prototype.drawGraph_ = function() {
}
this.computeYAxisRanges_(extremes);
}
this.computeYAxisRanges_(extremes);
- console.log(extremes);
this.layout_.setYAxes(this.axes_);
this.addXTicks_();
this.layout_.setYAxes(this.axes_);
this.addXTicks_();
@@
-2931,7
+2937,8
@@
Dygraph.prototype.parseFloat_ = function(x, opt_line_no, opt_line) {
*/
Dygraph.prototype.parseCSV_ = function(data) {
var ret = [];
*/
Dygraph.prototype.parseCSV_ = function(data) {
var ret = [];
- var lines = data.split("\n");
+ var line_delimiter = Dygraph.detectLineDelimiter(data);
+ var lines = data.split(line_delimiter || "\n");
var vals, j;
// Use the default delimiter or fall back to a tab if that makes sense.
var vals, j;
// Use the default delimiter or fall back to a tab if that makes sense.
@@
-3287,7
+3294,8
@@
Dygraph.prototype.start_ = function() {
this.predraw_();
} else if (typeof data == 'string') {
// Heuristic: a newline means it's CSV data. Otherwise it's an URL.
this.predraw_();
} else if (typeof data == 'string') {
// Heuristic: a newline means it's CSV data. Otherwise it's an URL.
- if (data.indexOf('\n') >= 0) {
+ var line_delimiter = Dygraph.detectLineDelimiter(data);
+ if (line_delimiter) {
this.loadedEvent_(data);
} else {
var req = new XMLHttpRequest();
this.loadedEvent_(data);
} else {
var req = new XMLHttpRequest();