Commit | Line | Data |
---|---|---|
8b83c6cc RK |
1 | <html> |
2 | <head> | |
3 | <title>noise</title> | |
4 | <!--[if IE]> | |
5 | <script type="text/javascript" src="excanvas.js"></script> | |
6 | <![endif]--> | |
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> | |
12 | </head> | |
13 | <body> | |
437c0979 RK |
14 | <h3>Click the buttons to change the zoom level or just use the normal |
15 | click-and drag.</h3> | |
8b83c6cc RK |
16 | <h4>Window coordinates (in dates and values):</h4> |
17 | <div id = "dimensions"></div> | |
18 | <div id="div_g" style="width:600px; height:300px;"></div> | |
19 | ||
20 | <p><b>Zoom operations:</b></p> | |
21 | <p> | |
437c0979 RK |
22 | <input type="button" value="Y (3,5)" onclick="zoomGraphY(3,5)"> |
23 | <input type="button" value="Y (0,4)" onclick="zoomGraphY(0,4)"> | |
24 | <input type="button" value="Y (2,4)" onclick="zoomGraphY(2,4)"> | |
25 | <input type="button" value="Y (0,2)" onclick="zoomGraphY(0,2)"> | |
26 | <input type="button" value="Y (1,0)" onclick="zoomGraphY(1,0)"> | |
27 | <br> | |
28 | <input type="button" value="Oct 8-13" onclick="zoomGraphX(1160261979962, 1163905694248)"> | |
29 | <input type="button" value="Oct 22-28" onclick="zoomGraphX(1161489164461 , 1162008465957)"> | |
30 | <input type="button" value="Oct 23-24" onclick="zoomGraphX(1161575878860, 1161660991675)"> | |
31 | <input type="button" value="Oct 26 6AM-noon" onclick="zoomGraphX(1161770537840, 1161792063332)"> | |
32 | <br> | |
33 | <input type="button" value="Unzoom" onclick="unzoomGraph()"> | |
8b83c6cc RK |
34 | </p> |
35 | ||
36 | ||
37 | <script type="text/javascript"> | |
38 | g = new Dygraph( | |
39 | document.getElementById("div_g"), | |
40 | NoisyData, { | |
41 | zoomCallback : function(a,b,c,d) { showDimensions(a,b,c,d); } | |
42 | } | |
43 | ); | |
44 | ||
45 | // TODO(konigsberg): Implement a visualization that verifies that initial | |
46 | // displays also show correctly. | |
47 | ||
48 | // Pull an initial value for logging. | |
49 | var minDate = g.xAxisRange()[0]; | |
50 | var maxDate = g.xAxisRange()[1]; | |
51 | var minValue = g.yAxisRange()[0]; | |
52 | var maxValue = g.yAxisRange()[1]; | |
8b83c6cc RK |
53 | showDimensions(minDate, maxDate, minValue, maxValue); |
54 | ||
55 | function showDimensions(minDate, maxDate, minValue, maxValue) { | |
56 | var elem = document.getElementById("dimensions"); | |
57 | elem.innerHTML = | |
58 | "dateWindow : [" + minDate + " , "+ maxDate + "],<br>" + | |
59 | "valueRange : [" + minValue + " , "+ maxValue + "],"; | |
60 | } | |
61 | ||
437c0979 RK |
62 | function zoomGraphX(minDate, maxDate) { |
63 | g.doZoomXDates_(minDate, maxDate); | |
64 | } | |
65 | ||
66 | function zoomGraphY(minValue, maxValue) { | |
67 | g.doZoomYValues_(minValue, maxValue); | |
68 | } | |
69 | ||
70 | function unzoomGraph() { | |
71 | g.doUnzoom_(); | |
8b83c6cc RK |
72 | } |
73 | </script> | |
74 | ||
75 | </body> | |
76 | </html> |