Merge branch 'master' of https://github.com/kberg/dygraphs
authorDan Vanderkam <danvk@google.com>
Tue, 21 Dec 2010 18:46:40 +0000 (13:46 -0500)
committerDan Vanderkam <danvk@google.com>
Tue, 21 Dec 2010 18:46:40 +0000 (13:46 -0500)
tests/interaction.html
tests/zoom.html

index 082a54e..d768dd6 100644 (file)
@@ -30,7 +30,8 @@
     </td><td>
     Zoom in: double-click, scroll wheel<br/>
     Zoom out: ctrl-double-click, scroll wheel<br/>
-    Pan: click-drag<br/>
+    Standard Zoom: shift-click-drag
+    Standard Pan: click-drag<br/>
     Restore zoom level: press button<br/>
     </td></tr>
     <tr><td>
     </td></tr>
 
     </table>
-
+        
     <script type="text/javascript">
       function downV3(event, g, context) {
         context.initializeMouseDown(event, g, context);
-        Dygraph.startPan(event, g, context);
+        if (event.altKey || event.shiftKey) {
+          Dygraph.startZoom(event, g, context);
+        } else {
+          Dygraph.startPan(event, g, context);
+        }
       }
 
       function moveV3(event, g, context) {
         if (context.isPanning) {
           Dygraph.movePan(event, g, context);
+        } else if (context.isZooming) {
+          Dygraph.moveZoom(event, g, context);
         }
       }
 
       function upV3(event, g, context) {
         if (context.isPanning) {
           Dygraph.endPan(event, g, context);
+        } else if (context.isZooming) {
+          Dygraph.endZoom(event, g, context);
         }
       }
 
index 2f0cf98..ad0bc9d 100644 (file)
@@ -41,8 +41,8 @@
             NoisyData, {
               errorBars: true,
               zoomCallback : function(minDate, maxDate, yRanges) {
-               showDimensions(minDate, maxDate, yRanges);
-             }
+                showDimensions(minDate, maxDate, yRanges);
+              }
             }
           );