X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;ds=inline;f=tests%2Fzoom.html;h=a835dc379102c2e24d3c5365e3fedfc4a5b37c47;hb=94ea5744c9541f9c91ee2d150d06024e430c967e;hp=10b0457f5a8270be8664339a2ec3611fd811ec92;hpb=62ac7bd0768c8899e2561ebbbe23f33ad4d59568;p=dygraphs.git
diff --git a/tests/zoom.html b/tests/zoom.html
index 10b0457..a835dc3 100644
--- a/tests/zoom.html
+++ b/tests/zoom.html
@@ -1,13 +1,17 @@
+
+
zoom
-
-
-
-
+
+
+
@@ -16,8 +20,14 @@
buttons are useful for testing.
Window coordinates (in dates and values):
+
+
Zoomed: False
+
Zoomed X: False
+
Zoomed Y: False
+
+
Zoom operations:
@@ -25,13 +35,17 @@
-
+
-
+
+
+
+
+
@@ -42,6 +56,11 @@
errorBars: true,
zoomCallback : function(minDate, maxDate, yRange) {
showDimensions(minDate, maxDate, yRange);
+ },
+ drawCallback: function(me, initial) {
+ document.getElementById("zoomed").innerHTML = "" + me.isZoomed();
+ document.getElementById("zoomedX").innerHTML = "" + me.isZoomed("x");
+ document.getElementById("zoomedY").innerHTML = "" + me.isZoomed("y");
}
}
);
@@ -52,12 +71,13 @@
// Pull an initial value for logging.
var minDate = g.xAxisRange()[0];
var maxDate = g.xAxisRange()[1];
- var minValue = g.yAxisRange();
- showDimensions(minDate, maxDate, yAxisRange);
+ var minValue = g.yAxisRange()[0];
+ var maxValue = g.yAxisRange()[1];
+ showDimensions(minDate, maxDate, [minValue, maxValue]);
- function showDimensions(minDate, maxDate, yAxisRange) {
+ function showDimensions(minDate, maxDate, yRanges) {
showXDimensions(minDate, maxDate);
- showYDimensions(yAxisRange);
+ showYDimensions(yRanges);
}
function showXDimensions(first, second) {
@@ -65,9 +85,9 @@
elem.innerHTML = "dateWindow : [" + first + ", "+ second + "]";
}
- function showYDimensions(range) {
+ function showYDimensions(ranges) {
var elem = document.getElementById("ydimensions");
- elem.innerHTML = "valueRange : [" + range + "]";
+ elem.innerHTML = "valueRange : [" + ranges + "]";
}
function zoomGraphX(minDate, maxDate) {
@@ -81,7 +101,7 @@
g.updateOptions({
valueRange: [minValue, maxValue]
});
- showYDimensions(minValue, maxValue);
+ showYDimensions(g.yAxisRanges());
}
function unzoomGraph() {
@@ -90,6 +110,10 @@
valueRange: null
});
}
+
+ function panEdgeFraction(value) {
+ g.updateOptions({ panEdgeFraction : value });
+ }