* be considered a zoom. This makes it easier to zoom to the exact edge of the
* chart, a fairly common operation.
*/
-var DRAG_EDGE_MARGIN = 200;
+var DRAG_EDGE_MARGIN = 100;
/**
* A collection of functions to facilitate build custom interaction models.
context.regionWidth = regionWidth;
context.regionHeight = regionHeight;
-}
+};
/**
* Called in response to an interaction model operation that
* context.
*/
Dygraph.Interaction.endZoom = function(event, g, context) {
+ g.clearZoomRect_();
context.isZooming = false;
Dygraph.Interaction.maybeTreatMouseOpAsClick(event, g, context);
g.doZoomY_(top, bottom);
}
context.cancelNextDblclick = true;
- } else {
- if (context.zoomMoved) g.clearZoomRect_();
}
context.dragStartX = null;
context.dragStartY = null;
if (context.isZooming) {
// When the mouse moves >200px from the chart edge, cancel the zoom.
var d = distanceFromChart(event, g);
- if (d < 200) {
+ if (d < DRAG_EDGE_MARGIN) {
Dygraph.moveZoom(event, g, context);
} else {
if (context.dragEndX !== null) {