projects
/
dygraphs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add hash support.
[dygraphs.git]
/
dygraph-interaction-model.js
diff --git
a/dygraph-interaction-model.js
b/dygraph-interaction-model.js
index
3029025
..
98d1411
100644
(file)
--- a/
dygraph-interaction-model.js
+++ b/
dygraph-interaction-model.js
@@
-129,7
+129,7
@@
Dygraph.Interaction.movePan = function(event, g, context) {
var pixelsDragged = context.dragEndY - context.dragStartY;
var unitsDragged = pixelsDragged * axis.unitsPerPixel;
var pixelsDragged = context.dragEndY - context.dragStartY;
var unitsDragged = pixelsDragged * axis.unitsPerPixel;
-
+
var boundedValue = context.boundedValues ? context.boundedValues[i] : null;
// In log scale, maxValue and minValue are the logs of those values.
var boundedValue = context.boundedValues ? context.boundedValues[i] : null;
// In log scale, maxValue and minValue are the logs of those values.
@@
-266,7
+266,8
@@
Dygraph.Interaction.treatMouseOpAsClick = function(g, event, context) {
var p = g.selPoints_[i];
var distance = Math.pow(p.canvasx - context.dragEndX, 2) +
Math.pow(p.canvasy - context.dragEndY, 2);
var p = g.selPoints_[i];
var distance = Math.pow(p.canvasx - context.dragEndX, 2) +
Math.pow(p.canvasy - context.dragEndY, 2);
- if (closestIdx == -1 || distance < closestDistance) {
+ if (!isNaN(distance) &&
+ (closestIdx == -1 || distance < closestDistance)) {
closestDistance = distance;
closestIdx = i;
}
closestDistance = distance;
closestIdx = i;
}
@@
-322,7
+323,7
@@
Dygraph.Interaction.endZoom = function(event, g, context) {
g.doZoomY_(Math.min(context.dragStartY, context.dragEndY),
Math.max(context.dragStartY, context.dragEndY));
} else {
g.doZoomY_(Math.min(context.dragStartY, context.dragEndY),
Math.max(context.dragStartY, context.dragEndY));
} else {
- g.c
anvas_ctx_.clearRect(0, 0, g.canvas_.width, g.canvas_.height
);
+ g.c
learZoomRect_(
);
}
context.dragStartX = null;
context.dragStartY = null;
}
context.dragStartX = null;
context.dragStartY = null;