6 <script type=
"text/javascript" src=
"../excanvas.js"></script>
8 <script type=
"text/javascript" src=
"../strftime/strftime-min.js"></script>
9 <script type=
"text/javascript" src=
"../rgbcolor/rgbcolor.js"></script>
10 <script type=
"text/javascript" src=
"../dygraph-canvas.js"></script>
11 <script type=
"text/javascript" src=
"../dygraph.js"></script>
12 <script type=
"text/javascript" src=
"data.js"></script>
15 <h3>Click the buttons to change the zoom level or just use the normal
16 click-and drag. While zoom typically works by click-and-drag, the
17 buttons are useful for testing.
</h3>
18 <h4>Window coordinates (in dates and values):
</h4>
19 <div id=
"xdimensions"></div> <div id=
"ydimensions"></div>
20 <div id=
"div_g" style=
"width:600px; height:300px;"></div>
22 <p><b>Zoom operations:
</b></p>
24 <input type=
"button" value=
"Y (3,5)" onclick=
"zoomGraphY(3,5)">
25 <input type=
"button" value=
"Y (0,4)" onclick=
"zoomGraphY(0,4)">
26 <input type=
"button" value=
"Y (2,4)" onclick=
"zoomGraphY(2,4)">
27 <input type=
"button" value=
"Y (0,2)" onclick=
"zoomGraphY(0,2)">
28 <input type=
"button" value=
"Y (0,1)" onclick=
"zoomGraphY(0,1)">
30 <input type=
"button" value=
"Oct 8-13" onclick=
"zoomGraphX(1160261979962, 1163905694248)">
31 <input type=
"button" value=
"Oct 22-28" onclick=
"zoomGraphX(1161489164461 , 1162008465957)">
32 <input type=
"button" value=
"Oct 23-24" onclick=
"zoomGraphX(1161575878860, 1161660991675)">
33 <input type=
"button" value=
"Oct 26 6AM-noon" onclick=
"zoomGraphX(1161770537840, 1161792063332)">
35 <input type=
"button" value=
"Unzoom" onclick=
"unzoomGraph()">
39 <script type=
"text/javascript">
41 document.getElementById(
"div_g"),
44 zoomCallback : function(minDate, maxDate, yRanges) {
45 showDimensions(minDate, maxDate, yRanges);
50 // TODO(konigsberg): Implement a visualization that verifies that initial
51 // displays also show correctly.
53 // Pull an initial value for logging.
54 var minDate = g.xAxisRange()[
0];
55 var maxDate = g.xAxisRange()[
1];
56 var minValue = g.yAxisRange()[
0];
57 var maxValue = g.yAxisRange()[
1];
58 showDimensions(minDate, maxDate, [minValue, maxValue]);
60 function showDimensions(minDate, maxDate, yRanges) {
61 showXDimensions(minDate, maxDate);
62 showYDimensions(yRanges);
65 function showXDimensions(first, second) {
66 var elem = document.getElementById(
"xdimensions");
67 elem.innerHTML =
"dateWindow : [" + first +
", "+ second +
"]";
70 function showYDimensions(ranges) {
71 var elem = document.getElementById(
"ydimensions");
72 elem.innerHTML =
"valueRange : [" + ranges +
"]";
75 function zoomGraphX(minDate, maxDate) {
77 dateWindow: [minDate, maxDate]
79 showXDimensions(minDate, maxDate);
82 function zoomGraphY(minValue, maxValue) {
84 valueRange: [minValue, maxValue]
86 showYDimensions(g.yAxisRanges());
89 function unzoomGraph() {