interaction.html's zoom was off. Zooming in and zooming out weren't
authorRobert Konigsberg <konigsberg@google.com>
Wed, 22 Dec 2010 22:25:26 +0000 (14:25 -0800)
committerRobert Konigsberg <konigsberg@google.com>
Wed, 22 Dec 2010 22:25:26 +0000 (14:25 -0800)
matching 1:1.

The rest of it is whitespace cleansing.

tests/interaction.html

index d768dd6..f4a1ff5 100644 (file)
@@ -72,7 +72,7 @@
 
       function dblClickV3(event, g, context) {
         if (event.ctrlKey) {
-          zoom(g, -(1/9));
+          zoom(g, -(1/8));
         } else {
           zoom(g, +.1);
         }
       }
 
       function zoom(g, percentage) {
-         // Adjusts [x, y] toward each other by percentage%
-         function adjustAxis(axis, percentage) {
-           var delta = axis[1] - axis[0];
-           var increment = delta * percentage;
-           return [ axis[0] + increment, axis[1] - increment ];
-         }
-
-         var yAxes = g.yAxisRanges();
-         var newYAxes = [];
-         for (var i = 0; i < yAxes.length; i++) {
-           newYAxes[i] = adjustAxis(yAxes[i], percentage);
-         }
-
-         g.updateOptions({
-           dateWindow: adjustAxis(g.xAxisRange(), percentage),
-           valueRange: newYAxes[0]
-           });
+        // Adjusts [x, y] toward each other by percentage%
+        function adjustAxis(axis, percentage) {
+          var delta = axis[1] - axis[0];
+          var increment = delta * percentage;
+          return [ axis[0] + increment, axis[1] - increment ];
+        }
+        var yAxes = g.yAxisRanges();
+        var newYAxes = [];
+        for (var i = 0; i < yAxes.length; i++) {
+          newYAxes[i] = adjustAxis(yAxes[i], percentage);
+        }
+
+        g.updateOptions({
+          dateWindow: adjustAxis(g.xAxisRange(), percentage),
+          valueRange: newYAxes[0]
+          });
       }
 
       var v4Active = false;