X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;ds=inline;f=tests%2Fzoom.html;h=286e1b30f4dfbc4d60a1f3f47f4c65e52c93ac46;hb=916a000e22d330b5f8690af07f561da1bdf7f8e3;hp=62252a15727920f87d9c98f47c442266e9807379;hpb=a6cc9f3e09748d3764320481753c44e579a7661a;p=dygraphs.git
diff --git a/tests/zoom.html b/tests/zoom.html
index 62252a1..286e1b3 100644
--- a/tests/zoom.html
+++ b/tests/zoom.html
@@ -1,8 +1,10 @@
+
+
zoom
@@ -16,8 +18,14 @@
buttons are useful for testing.
Window coordinates (in dates and values):
+
+
Zoomed: False
+
Zoomed X: False
+
Zoomed Y: False
+
+
Zoom operations:
@@ -25,13 +33,17 @@
-
+
-
+
+
+
+
+
@@ -40,7 +52,14 @@
document.getElementById("div_g"),
NoisyData, {
errorBars: true,
- zoomCallback : function(a,b,c,d) { showDimensions(a,b,c,d); }
+ 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,11 +71,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) {
- showXDimensions(minDate, maxDate);
- showYDimensions(minValue, maxValue);
+ function showDimensions(minDate, maxDate, yRanges) {
+ showXDimensions(minDate, maxDate);
+ showYDimensions(yRanges);
}
function showXDimensions(first, second) {
@@ -64,23 +83,23 @@
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) {
g.updateOptions({
dateWindow: [minDate, maxDate]
});
- showXDimensions(minDate, maxDate);
+ showXDimensions(minDate, maxDate);
}
function zoomGraphY(minValue, maxValue) {
g.updateOptions({
valueRange: [minValue, maxValue]
});
- showYDimensions(minValue, maxValue);
+ showYDimensions(g.yAxisRanges());
}
function unzoomGraph() {
@@ -89,6 +108,10 @@
valueRange: null
});
}
+
+ function panEdgeFraction(value) {
+ g.updateOptions({ panEdgeFraction : value });
+ }