| 1 | |
| 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> |
| 13 | <script type="text/javascript" src="interaction.js"></script> |
| 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 | |
| 29 | <input type="button" value="Unzoom" onclick="unzoomGraph(g3)"> |
| 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/> |
| 34 | Standard Zoom: shift-click-drag |
| 35 | Standard Pan: click-drag<br/> |
| 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> |
| 47 | |
| 48 | <script type="text/javascript"> |
| 49 | var g = new Dygraph(document.getElementById("div_g"), |
| 50 | NoisyData, { errorBars : true }); |
| 51 | var g2 = new Dygraph(document.getElementById("div_g2"), |
| 52 | NoisyData, { errorBars : true, interactionModel : {} }); |
| 53 | var g3 = new Dygraph(document.getElementById("div_g3"), |
| 54 | NoisyData, { errorBars : true, interactionModel : { |
| 55 | 'mousedown' : downV3, |
| 56 | 'mousemove' : moveV3, |
| 57 | 'mouseup' : upV3, |
| 58 | 'dblclick' : dblClickV3, |
| 59 | 'mousewheel' : scrollV3 |
| 60 | }}); |
| 61 | var g4 = new Dygraph(document.getElementById("div_g4"), |
| 62 | NoisyData, { errorBars : true, drawPoints : true, interactionModel : { |
| 63 | 'mousedown' : downV4, |
| 64 | 'mousemove' : moveV4, |
| 65 | 'mouseup' : upV4, |
| 66 | 'dblclick' : dblClickV4, |
| 67 | }, |
| 68 | underlayCallback : captureCanvas |
| 69 | }); |
| 70 | </script> |
| 71 | |
| 72 | </body> |
| 73 | </html> |