5 <script type=
"text/javascript" src=
"excanvas.js"></script>
7 <script type=
"text/javascript" src=
"../strftime/strftime-min.js"></script>
8 <script type=
"text/javascript" src=
"../rgbcolor/rgbcolor.js"></script>
9 <script type=
"text/javascript" src=
"../dygraph-canvas.js"></script>
10 <script type=
"text/javascript" src=
"../dygraph.js"></script>
11 <script type=
"text/javascript" src=
"data.js"></script>
14 <h3>Click the buttons to change the zoom level or just use the normal
15 click-and drag. While zoom typically works by click-and-drag, the
16 buttons are useful for testing.
</h3>
17 <h4>Window coordinates (in dates and values):
</h4>
18 <div id=
"xdimensions"></div> <div id=
"ydimensions"></div>
19 <div id=
"div_g" style=
"width:600px; height:300px;"></div>
21 <p><b>Zoom operations:
</b></p>
23 <input type=
"button" value=
"Y (3,5)" onclick=
"zoomGraphY(3,5)">
24 <input type=
"button" value=
"Y (0,4)" onclick=
"zoomGraphY(0,4)">
25 <input type=
"button" value=
"Y (2,4)" onclick=
"zoomGraphY(2,4)">
26 <input type=
"button" value=
"Y (0,2)" onclick=
"zoomGraphY(0,2)">
27 <input type=
"button" value=
"Y (0,1)" onclick=
"zoomGraphY(0,1)">
29 <input type=
"button" value=
"Oct 8-13" onclick=
"zoomGraphX(1160261979962, 1163905694248)">
30 <input type=
"button" value=
"Oct 22-28" onclick=
"zoomGraphX(1161489164461 , 1162008465957)">
31 <input type=
"button" value=
"Oct 23-24" onclick=
"zoomGraphX(1161575878860, 1161660991675)">
32 <input type=
"button" value=
"Oct 26 6AM-noon" onclick=
"zoomGraphX(1161770537840, 1161792063332)">
34 <input type=
"button" value=
"Unzoom" onclick=
"unzoomGraph()">
38 <script type=
"text/javascript">
40 document.getElementById(
"div_g"),
43 zoomCallback : function(a,b,c,d) { showDimensions(a,b,c,d); }
47 // TODO(konigsberg): Implement a visualization that verifies that initial
48 // displays also show correctly.
50 // Pull an initial value for logging.
51 var minDate = g.xAxisRange()[
0];
52 var maxDate = g.xAxisRange()[
1];
53 var minValue = g.yAxisRange()[
0];
54 var maxValue = g.yAxisRange()[
1];
55 showDimensions(minDate, maxDate, minValue, maxValue);
57 function showDimensions(minDate, maxDate, minValue, maxValue) {
58 showXDimensions(minDate, maxDate);
59 showYDimensions(minValue, maxValue);
62 function showXDimensions(first, second) {
63 var elem = document.getElementById(
"xdimensions");
64 elem.innerHTML =
"dateWindow : [" + first +
", "+ second +
"]";
67 function showYDimensions(first, second) {
68 var elem = document.getElementById(
"ydimensions");
69 elem.innerHTML =
"valueRange : [" + first +
", "+ second +
"]";
72 function zoomGraphX(minDate, maxDate) {
74 dateWindow: [minDate, maxDate]
76 showXDimensions(minDate, maxDate);
79 function zoomGraphY(minValue, maxValue) {
81 valueRange: [minValue, maxValue]
83 showYDimensions(minValue, maxValue);
86 function unzoomGraph() {