add HTML5 doctype to all tests
[dygraphs.git] / tests / interaction.html
CommitLineData
54425b14 1<!DOCTYPE html>
885c13e4
RK
2<html>
3 <head>
4 <title>interaction model</title>
5 <!--[if IE]>
6 <script type="text/javascript" src="../excanvas.js"></script>
7 <![endif]-->
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>
9e9ca2eb 13 <script type="text/javascript" src="interaction.js"></script>
885c13e4
RK
14 </head>
15 <body>
16 <table border='1'>
17 <tr><td>
18 <b>Default interaction model</b>
19 <div id="div_g" style="width:600px; height:300px;"></div>
20 </td><td>Zoom: click-drag<br/>Pan: shift-click-drag<br/>Restore zoom level: double-click<br/>
21 </td></tr>
22 <tr><td>
23 <b>No interaction model</b>
24 <div id="div_g2" style="width:600px; height:300px;"></div>
25 </td><td>Click and drag all you like, it won't do anything!</td></tr>
26 <tr><td>
27 <b>Custom interaction model</b>
28
b4012e63 29 <input type="button" value="Restore position" onclick="restorePositioning(g3)">
885c13e4
RK
30 <div id="div_g3" style="width:600px; height:300px;"></div>
31 </td><td>
32 Zoom in: double-click, scroll wheel<br/>
33 Zoom out: ctrl-double-click, scroll wheel<br/>
1f237ed6
RK
34 Standard Zoom: shift-click-drag
35 Standard Pan: click-drag<br/>
885c13e4
RK
36 Restore zoom level: press button<br/>
37 </td></tr>
38 <tr><td>
39 <b>Fun model!</b>
40 <div id="div_g4" style="width:600px; height:300px;"></div>
41 </td><td>
42 Keep the mouse button pressed, and hover over all points
43 to mark them.
44 </td></tr>
45
46 </table>
1f237ed6 47
885c13e4 48 <script type="text/javascript">
9d10bca3
RK
49 Dygraph.addEvent(document, "mousewheel", function() { lastClickedGraph = null; });
50 Dygraph.addEvent(document, "click", function() { lastClickedGraph = null; });
885c13e4
RK
51 var g = new Dygraph(document.getElementById("div_g"),
52 NoisyData, { errorBars : true });
53 var g2 = new Dygraph(document.getElementById("div_g2"),
54 NoisyData, { errorBars : true, interactionModel : {} });
55 var g3 = new Dygraph(document.getElementById("div_g3"),
56 NoisyData, { errorBars : true, interactionModel : {
57 'mousedown' : downV3,
58 'mousemove' : moveV3,
59 'mouseup' : upV3,
9d10bca3 60 'click' : clickV3,
885c13e4
RK
61 'dblclick' : dblClickV3,
62 'mousewheel' : scrollV3
63 }});
64 var g4 = new Dygraph(document.getElementById("div_g4"),
65 NoisyData, { errorBars : true, drawPoints : true, interactionModel : {
66 'mousedown' : downV4,
67 'mousemove' : moveV4,
68 'mouseup' : upV4,
69 'dblclick' : dblClickV4,
70 },
71 underlayCallback : captureCanvas
72 });
885c13e4
RK
73 </script>
74
75 </body>
76</html>