X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;ds=inline;f=tests%2Fzoom.html;h=a835dc379102c2e24d3c5365e3fedfc4a5b37c47;hb=3adf4a6f00d3577b925338891a0b021ebc5ae325;hp=a7ebae30ed2bb0a7ba6f45f9754056f039b13a40;hpb=b6ce9a7e87720d481aa18cbce14532c6432ad2b1;p=dygraphs.git
diff --git a/tests/zoom.html b/tests/zoom.html
index a7ebae3..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 @@
-
+
-
+
+
+
+
+
@@ -40,8 +54,13 @@
document.getElementById("div_g"),
NoisyData, {
errorBars: true,
- zoomCallback : function(minDate, maxDate, minValue, maxValue) {
- showDimensions(minDate, maxDate, minValue, maxValue);
+ 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");
}
}
);
@@ -54,11 +73,11 @@
var maxDate = g.xAxisRange()[1];
var minValue = g.yAxisRange()[0];
var maxValue = g.yAxisRange()[1];
- showDimensions(minDate, maxDate, minValue, maxValue);
+ showDimensions(minDate, maxDate, [minValue, maxValue]);
- function showDimensions(minDate, maxDate, minValue, maxValue) {
+ function showDimensions(minDate, maxDate, yRanges) {
showXDimensions(minDate, maxDate);
- showYDimensions(minValue, maxValue);
+ showYDimensions(yRanges);
}
function showXDimensions(first, second) {
@@ -66,9 +85,9 @@
elem.innerHTML = "dateWindow : [" + first + ", "+ second + "]";
}
- function showYDimensions(first, second) {
+ function showYDimensions(ranges) {
var elem = document.getElementById("ydimensions");
- elem.innerHTML = "valueRange : [" + first + ", " + second + "]";
+ elem.innerHTML = "valueRange : [" + ranges + "]";
}
function zoomGraphX(minDate, maxDate) {
@@ -82,7 +101,7 @@
g.updateOptions({
valueRange: [minValue, maxValue]
});
- showYDimensions(minValue, maxValue);
+ showYDimensions(g.yAxisRanges());
}
function unzoomGraph() {
@@ -91,6 +110,10 @@
valueRange: null
});
}
+
+ function panEdgeFraction(value) {
+ g.updateOptions({ panEdgeFraction : value });
+ }