maglev-webtools 0.2.1 → 1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (296) hide show
  1. data/README.rdoc +38 -29
  2. data/bin/webtools +22 -1
  3. data/lib/web_tools/code_browser.rb +156 -0
  4. data/lib/web_tools/debugger.rb +96 -199
  5. data/lib/web_tools/info.rb +1 -3
  6. data/lib/web_tools/method_list.rb +67 -0
  7. data/lib/web_tools/middleware/debugger.rb +10 -16
  8. data/lib/web_tools/object_log.rb +24 -0
  9. data/lib/web_tools/session_list.rb +119 -0
  10. data/lib/web_tools/shared_page_cache.rb +30 -0
  11. data/lib/web_tools/stat_process.rb +24 -0
  12. data/lib/web_tools/statistics.rb +14 -0
  13. data/lib/web_tools/support/app_model.rb +66 -101
  14. data/lib/web_tools/support/code_browser.rb +88 -86
  15. data/lib/web_tools/support/debugger.rb +303 -0
  16. data/lib/web_tools/support/error_log.rb +33 -0
  17. data/lib/web_tools/support/ruby.rb +60 -121
  18. data/lib/web_tools/support/service_helper.rb +38 -10
  19. data/lib/web_tools/support/smalltalk_extensions.rb +12 -0
  20. data/lib/web_tools/tool.rb +48 -0
  21. data/lib/web_tools/ui.rb +14 -53
  22. data/lib/web_tools/version_report.rb +29 -0
  23. data/lib/web_tools/workspace.rb +77 -0
  24. data/lib/web_tools.rb +14 -4
  25. data/public/CodeBrowser.html +51 -0
  26. data/public/CodeMirror/LICENSE +19 -0
  27. data/public/CodeMirror/css/codemirror.css +67 -0
  28. data/public/CodeMirror/css/default.css +18 -0
  29. data/public/CodeMirror/js/codemirror.js +2131 -0
  30. data/public/CodeMirror/js/ruby.js +195 -0
  31. data/public/CodeMirror/js/smalltalk.js +139 -0
  32. data/public/Debugger.html +28 -0
  33. data/public/MethodList.html +20 -0
  34. data/public/ObjectLog.html +20 -0
  35. data/public/SessionList.html +31 -0
  36. data/public/SharedPageCache.html +78 -0
  37. data/public/Statistics.html +64 -0
  38. data/public/VersionReport.html +50 -0
  39. data/public/Workspace.html +39 -0
  40. data/public/css/CodeBrowser.css +24 -0
  41. data/public/css/Debugger.css +32 -0
  42. data/public/css/MethodList.css +8 -0
  43. data/public/css/ObjectLog.css +5 -0
  44. data/public/css/SessionList.css +9 -0
  45. data/public/css/Statistics.css +24 -0
  46. data/public/{stylesheets → css}/base/images/ui-anim_basic_16x16.gif +0 -0
  47. data/public/{stylesheets → css}/base/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  48. data/public/{stylesheets → css}/base/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  49. data/public/{stylesheets → css}/base/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  50. data/public/{stylesheets → css}/base/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  51. data/public/{stylesheets → css}/base/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  52. data/public/{stylesheets → css}/base/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  53. data/public/{stylesheets → css}/base/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  54. data/public/{stylesheets → css}/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  55. data/public/{stylesheets → css}/base/images/ui-icons_222222_256x240.png +0 -0
  56. data/public/{stylesheets → css}/base/images/ui-icons_2e83ff_256x240.png +0 -0
  57. data/public/{stylesheets → css}/base/images/ui-icons_454545_256x240.png +0 -0
  58. data/public/{stylesheets → css}/base/images/ui-icons_888888_256x240.png +0 -0
  59. data/public/{stylesheets → css}/base/images/ui-icons_cd0a0a_256x240.png +0 -0
  60. data/public/{stylesheets → css}/base/jquery.ui.accordion.css +0 -0
  61. data/public/{stylesheets → css}/base/jquery.ui.all.css +0 -0
  62. data/public/{stylesheets → css}/base/jquery.ui.autocomplete.css +0 -0
  63. data/public/{stylesheets → css}/base/jquery.ui.base.css +0 -0
  64. data/public/{stylesheets → css}/base/jquery.ui.button.css +0 -0
  65. data/public/{stylesheets → css}/base/jquery.ui.core.css +0 -0
  66. data/public/{stylesheets → css}/base/jquery.ui.datepicker.css +0 -0
  67. data/public/{stylesheets → css}/base/jquery.ui.dialog.css +0 -0
  68. data/public/{stylesheets → css}/base/jquery.ui.progressbar.css +0 -0
  69. data/public/{stylesheets → css}/base/jquery.ui.resizable.css +0 -0
  70. data/public/{stylesheets → css}/base/jquery.ui.selectable.css +0 -0
  71. data/public/{stylesheets → css}/base/jquery.ui.slider.css +0 -0
  72. data/public/{stylesheets → css}/base/jquery.ui.tabs.css +0 -0
  73. data/public/{stylesheets → css}/base/jquery.ui.theme.css +0 -0
  74. data/public/css/editor.css +25 -0
  75. data/public/css/jjmenu.css +33 -0
  76. data/public/css/menuitem.gif +0 -0
  77. data/public/css/more.gif +0 -0
  78. data/public/{stylesheets → css}/reset.css +1 -1
  79. data/public/css/smoothness/images/ui-anim_basic_16x16.gif +0 -0
  80. data/public/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  81. data/public/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  82. data/public/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  83. data/public/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  84. data/public/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  85. data/public/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  86. data/public/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  87. data/public/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  88. data/public/css/smoothness/images/ui-icons_222222_256x240.png +0 -0
  89. data/public/css/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
  90. data/public/css/smoothness/images/ui-icons_454545_256x240.png +0 -0
  91. data/public/css/smoothness/images/ui-icons_888888_256x240.png +0 -0
  92. data/public/css/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
  93. data/public/css/smoothness/jquery-ui.css +489 -0
  94. data/public/css/ui-lightness/images/ui-anim_basic_16x16.gif +0 -0
  95. data/public/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  96. data/public/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  97. data/public/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
  98. data/public/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  99. data/public/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  100. data/public/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  101. data/public/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  102. data/public/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  103. data/public/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  104. data/public/css/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
  105. data/public/css/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
  106. data/public/css/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
  107. data/public/css/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
  108. data/public/css/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
  109. data/public/css/ui-lightness/jquery-ui.css +489 -0
  110. data/public/css/webtools.css +65 -0
  111. data/public/favicon.ico +0 -0
  112. data/public/flot/API.txt +1201 -0
  113. data/public/flot/FAQ.txt +76 -0
  114. data/public/flot/LICENSE.txt +22 -0
  115. data/public/flot/Makefile +9 -0
  116. data/public/flot/NEWS.txt +508 -0
  117. data/public/flot/PLUGINS.txt +137 -0
  118. data/public/flot/README.txt +90 -0
  119. data/public/flot/examples/ajax.html +143 -0
  120. data/public/flot/examples/annotating.html +75 -0
  121. data/public/flot/examples/arrow-down.gif +0 -0
  122. data/public/flot/examples/arrow-left.gif +0 -0
  123. data/public/flot/examples/arrow-right.gif +0 -0
  124. data/public/flot/examples/arrow-up.gif +0 -0
  125. data/public/flot/examples/basic.html +38 -0
  126. data/public/flot/examples/data-eu-gdp-growth-1.json +4 -0
  127. data/public/flot/examples/data-eu-gdp-growth-2.json +4 -0
  128. data/public/flot/examples/data-eu-gdp-growth-3.json +4 -0
  129. data/public/flot/examples/data-eu-gdp-growth-4.json +4 -0
  130. data/public/flot/examples/data-eu-gdp-growth-5.json +4 -0
  131. data/public/flot/examples/data-eu-gdp-growth.json +4 -0
  132. data/public/flot/examples/data-japan-gdp-growth.json +4 -0
  133. data/public/flot/examples/data-usa-gdp-growth.json +4 -0
  134. data/public/flot/examples/graph-types.html +75 -0
  135. data/public/flot/examples/hs-2004-27-a-large_web.jpg +0 -0
  136. data/public/flot/examples/image.html +45 -0
  137. data/public/flot/examples/index.html +44 -0
  138. data/public/flot/examples/interacting-axes.html +97 -0
  139. data/public/flot/examples/interacting.html +93 -0
  140. data/public/flot/examples/layout.css +6 -0
  141. data/public/flot/examples/multiple-axes.html +60 -0
  142. data/public/flot/examples/navigate.html +118 -0
  143. data/public/flot/examples/percentiles.html +57 -0
  144. data/public/flot/examples/pie.html +756 -0
  145. data/public/flot/examples/realtime.html +83 -0
  146. data/public/flot/examples/resize.html +61 -0
  147. data/public/flot/examples/selection.html +114 -0
  148. data/public/flot/examples/setting-options.html +61 -0
  149. data/public/flot/examples/stacking.html +77 -0
  150. data/public/flot/examples/symbols.html +49 -0
  151. data/public/flot/examples/thresholding.html +54 -0
  152. data/public/flot/examples/time.html +71 -0
  153. data/public/flot/examples/tracking.html +95 -0
  154. data/public/flot/examples/turning-series.html +98 -0
  155. data/public/flot/examples/visitors.html +90 -0
  156. data/public/flot/examples/zooming.html +98 -0
  157. data/public/flot/excanvas.js +1427 -0
  158. data/public/flot/excanvas.min.js +1 -0
  159. data/public/flot/jquery.colorhelpers.js +179 -0
  160. data/public/flot/jquery.colorhelpers.min.js +1 -0
  161. data/public/flot/jquery.flot.crosshair.js +167 -0
  162. data/public/flot/jquery.flot.crosshair.min.js +1 -0
  163. data/public/flot/jquery.flot.fillbetween.js +183 -0
  164. data/public/flot/jquery.flot.fillbetween.min.js +1 -0
  165. data/public/flot/jquery.flot.image.js +238 -0
  166. data/public/flot/jquery.flot.image.min.js +1 -0
  167. data/public/flot/jquery.flot.js +2599 -0
  168. data/public/flot/jquery.flot.min.js +6 -0
  169. data/public/flot/jquery.flot.navigate.js +336 -0
  170. data/public/flot/jquery.flot.navigate.min.js +1 -0
  171. data/public/flot/jquery.flot.pie.js +750 -0
  172. data/public/flot/jquery.flot.pie.min.js +1 -0
  173. data/public/flot/jquery.flot.resize.js +60 -0
  174. data/public/flot/jquery.flot.resize.min.js +1 -0
  175. data/public/flot/jquery.flot.selection.js +344 -0
  176. data/public/flot/jquery.flot.selection.min.js +1 -0
  177. data/public/flot/jquery.flot.stack.js +184 -0
  178. data/public/flot/jquery.flot.stack.min.js +1 -0
  179. data/public/flot/jquery.flot.symbol.js +70 -0
  180. data/public/flot/jquery.flot.symbol.min.js +1 -0
  181. data/public/flot/jquery.flot.threshold.js +103 -0
  182. data/public/flot/jquery.flot.threshold.min.js +1 -0
  183. data/public/flot/jquery.js +8316 -0
  184. data/public/flot/jquery.min.js +23 -0
  185. data/public/genPacking.pl +30 -0
  186. data/public/index.html +28 -0
  187. data/public/install.tpz +66 -0
  188. data/public/installAndRun.tpz +5 -0
  189. data/public/jsTree/jquery.jstree.js +3510 -0
  190. data/public/jsTree/themes/default/d.gif +0 -0
  191. data/public/jsTree/themes/default/d.png +0 -0
  192. data/public/jsTree/themes/default/style.css +73 -0
  193. data/public/jsTree/themes/default/throbber.gif +0 -0
  194. data/public/readMe.txt +9 -0
  195. data/public/scripts/CodeBrowser.js +645 -0
  196. data/public/scripts/Debugger.js +134 -0
  197. data/public/scripts/MethodList.js +72 -0
  198. data/public/scripts/ObjectLog.js +59 -0
  199. data/public/scripts/SessionList.js +164 -0
  200. data/public/scripts/Statistics.js +266 -0
  201. data/public/scripts/editor.js +430 -0
  202. data/public/scripts/jjmenu.js +375 -0
  203. data/public/scripts/jquery-ui.js +1012 -0
  204. data/public/scripts/jquery.js +154 -0
  205. data/public/scripts/webtools.js +374 -0
  206. data/public/src/CodeBrowser.gs +416 -0
  207. data/public/src/Debugger.gs +132 -0
  208. data/public/src/MethodList.gs +130 -0
  209. data/public/src/ObjectLog.gs +73 -0
  210. data/public/src/Server.gs +544 -0
  211. data/public/src/SessionList.gs +172 -0
  212. data/public/src/SharedPageCache.gs +66 -0
  213. data/public/src/StatProcess.gs +280 -0
  214. data/public/src/StatProcessType.gs +242 -0
  215. data/public/src/StatStatistic.gs +381 -0
  216. data/public/src/Statistics.gs +222 -0
  217. data/public/src/Statmonitor.gs +490 -0
  218. data/public/src/Tool.gs +86 -0
  219. data/public/src/VersionReport.gs +52 -0
  220. data/public/src/Workspace.gs +163 -0
  221. data/views/debugger.rhtml +6 -9
  222. metadata +344 -243
  223. data/lib/web_tools/#debugger.rb# +0 -212
  224. data/lib/web_tools/browser.rb +0 -45
  225. data/public/images/favicon.ico +0 -0
  226. data/public/javascript/CodeMirror/LICENSE +0 -23
  227. data/public/javascript/CodeMirror/css/Smalltalk.css +0 -34
  228. data/public/javascript/CodeMirror/js/codemirror.js +0 -582
  229. data/public/javascript/CodeMirror/js/editor.js +0 -1671
  230. data/public/javascript/CodeMirror/js/highlight.js +0 -68
  231. data/public/javascript/CodeMirror/js/parseSmalltalk.js +0 -126
  232. data/public/javascript/CodeMirror/js/parsedummy.js +0 -32
  233. data/public/javascript/CodeMirror/js/select.js +0 -699
  234. data/public/javascript/CodeMirror/js/stringstream.js +0 -159
  235. data/public/javascript/CodeMirror/js/tokenize.js +0 -57
  236. data/public/javascript/CodeMirror/js/undo.js +0 -413
  237. data/public/javascript/CodeMirror/js/util.js +0 -133
  238. data/public/javascript/CodeMirror/testSmalltalkParser.html +0 -116
  239. data/public/javascript/ace/ace-uncompressed.js +0 -17299
  240. data/public/javascript/ace/ace.js +0 -1
  241. data/public/javascript/ace/keybinding-emacs.js +0 -1
  242. data/public/javascript/ace/keybinding-vim.js +0 -1
  243. data/public/javascript/ace/mode-c_cpp.js +0 -1
  244. data/public/javascript/ace/mode-clojure.js +0 -1
  245. data/public/javascript/ace/mode-coffee.js +0 -1
  246. data/public/javascript/ace/mode-csharp.js +0 -1
  247. data/public/javascript/ace/mode-css.js +0 -1
  248. data/public/javascript/ace/mode-groovy.js +0 -1
  249. data/public/javascript/ace/mode-html.js +0 -1
  250. data/public/javascript/ace/mode-java.js +0 -1
  251. data/public/javascript/ace/mode-javascript.js +0 -1
  252. data/public/javascript/ace/mode-json.js +0 -1
  253. data/public/javascript/ace/mode-lua.js +0 -1
  254. data/public/javascript/ace/mode-markdown.js +0 -1
  255. data/public/javascript/ace/mode-ocaml.js +0 -1
  256. data/public/javascript/ace/mode-perl.js +0 -1
  257. data/public/javascript/ace/mode-php.js +0 -1
  258. data/public/javascript/ace/mode-python.js +0 -1
  259. data/public/javascript/ace/mode-ruby.js +0 -1
  260. data/public/javascript/ace/mode-scad.js +0 -1
  261. data/public/javascript/ace/mode-scala.js +0 -1
  262. data/public/javascript/ace/mode-scss.js +0 -1
  263. data/public/javascript/ace/mode-svg.js +0 -1
  264. data/public/javascript/ace/mode-textile.js +0 -1
  265. data/public/javascript/ace/mode-xml.js +0 -1
  266. data/public/javascript/ace/theme-clouds.js +0 -1
  267. data/public/javascript/ace/theme-clouds_midnight.js +0 -1
  268. data/public/javascript/ace/theme-cobalt.js +0 -1
  269. data/public/javascript/ace/theme-crimson_editor.js +0 -1
  270. data/public/javascript/ace/theme-dawn.js +0 -1
  271. data/public/javascript/ace/theme-eclipse.js +0 -1
  272. data/public/javascript/ace/theme-idle_fingers.js +0 -1
  273. data/public/javascript/ace/theme-kr_theme.js +0 -1
  274. data/public/javascript/ace/theme-merbivore.js +0 -1
  275. data/public/javascript/ace/theme-merbivore_soft.js +0 -1
  276. data/public/javascript/ace/theme-mono_industrial.js +0 -1
  277. data/public/javascript/ace/theme-monokai.js +0 -1
  278. data/public/javascript/ace/theme-pastel_on_dark.js +0 -1
  279. data/public/javascript/ace/theme-solarized_dark.js +0 -1
  280. data/public/javascript/ace/theme-solarized_light.js +0 -1
  281. data/public/javascript/ace/theme-textmate.js +0 -1
  282. data/public/javascript/ace/theme-twilight.js +0 -1
  283. data/public/javascript/ace/theme-vibrant_ink.js +0 -1
  284. data/public/javascript/ace/worker-coffee.js +0 -1
  285. data/public/javascript/ace/worker-css.js +0 -1
  286. data/public/javascript/ace/worker-javascript.js +0 -1
  287. data/public/javascript/webtools/browser.js +0 -260
  288. data/public/javascript/webtools/debugger.coffee +0 -286
  289. data/public/javascript/webtools/debugger.js +0 -366
  290. data/public/javascript/webtools/sessions.coffee +0 -17
  291. data/public/javascript/webtools/sessions.js +0 -27
  292. data/public/javascript/webtools/version.coffee +0 -14
  293. data/public/javascript/webtools/version.js +0 -20
  294. data/public/stylesheets/jquery.contextMenu.css +0 -62
  295. data/public/stylesheets/webtools.css +0 -53
  296. data/public/test.html +0 -47
@@ -0,0 +1,83 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
+ <title>Flot Examples</title>
6
+ <link href="layout.css" rel="stylesheet" type="text/css">
7
+ <!--[if lte IE 8]><script language="javascript" type="text/javascript" src="../excanvas.min.js"></script><![endif]-->
8
+ <script language="javascript" type="text/javascript" src="../jquery.js"></script>
9
+ <script language="javascript" type="text/javascript" src="../jquery.flot.js"></script>
10
+ </head>
11
+ <body>
12
+ <h1>Flot Examples</h1>
13
+
14
+ <div id="placeholder" style="width:600px;height:300px;"></div>
15
+
16
+ <p>You can update a chart periodically to get a real-time effect
17
+ by using a timer to insert the new data in the plot and redraw it.</p>
18
+
19
+ <p>Time between updates: <input id="updateInterval" type="text" value="" style="text-align: right; width:5em"> milliseconds</p>
20
+
21
+ <script type="text/javascript">
22
+ $(function () {
23
+ // we use an inline data source in the example, usually data would
24
+ // be fetched from a server
25
+ var data = [], totalPoints = 300;
26
+ function getRandomData() {
27
+ if (data.length > 0)
28
+ data = data.slice(1);
29
+
30
+ // do a random walk
31
+ while (data.length < totalPoints) {
32
+ var prev = data.length > 0 ? data[data.length - 1] : 50;
33
+ var y = prev + Math.random() * 10 - 5;
34
+ if (y < 0)
35
+ y = 0;
36
+ if (y > 100)
37
+ y = 100;
38
+ data.push(y);
39
+ }
40
+
41
+ // zip the generated y values with the x values
42
+ var res = [];
43
+ for (var i = 0; i < data.length; ++i)
44
+ res.push([i, data[i]])
45
+ return res;
46
+ }
47
+
48
+ // setup control widget
49
+ var updateInterval = 30;
50
+ $("#updateInterval").val(updateInterval).change(function () {
51
+ var v = $(this).val();
52
+ if (v && !isNaN(+v)) {
53
+ updateInterval = +v;
54
+ if (updateInterval < 1)
55
+ updateInterval = 1;
56
+ if (updateInterval > 2000)
57
+ updateInterval = 2000;
58
+ $(this).val("" + updateInterval);
59
+ }
60
+ });
61
+
62
+ // setup plot
63
+ var options = {
64
+ series: { shadowSize: 0 }, // drawing is faster without shadows
65
+ yaxis: { min: 0, max: 100 },
66
+ xaxis: { show: false }
67
+ };
68
+ var plot = $.plot($("#placeholder"), [ getRandomData() ], options);
69
+
70
+ function update() {
71
+ plot.setData([ getRandomData() ]);
72
+ // since the axes don't change, we don't need to call plot.setupGrid()
73
+ plot.draw();
74
+
75
+ setTimeout(update, updateInterval);
76
+ }
77
+
78
+ update();
79
+ });
80
+ </script>
81
+
82
+ </body>
83
+ </html>
@@ -0,0 +1,61 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
+ <title>Flot Examples</title>
6
+ <link href="layout.css" rel="stylesheet" type="text/css">
7
+ <!--[if lte IE 8]><script language="javascript" type="text/javascript" src="../excanvas.min.js"></script><![endif]-->
8
+ <script language="javascript" type="text/javascript" src="../jquery.js"></script>
9
+ <script language="javascript" type="text/javascript" src="../jquery.flot.js"></script>
10
+ <script language="javascript" type="text/javascript" src="../jquery.flot.resize.js"></script>
11
+ <style type="text/css">
12
+ html, body {
13
+ height: 100%; /* make the percentage height on placeholder work */
14
+ }
15
+ .message {
16
+ padding-left: 50px;
17
+ font-size: smaller;
18
+ }
19
+ </style>
20
+ </head>
21
+ <body>
22
+ <h1>Flot Examples</h1>
23
+
24
+ <div id="placeholder" style="width:80%;height:40%;"></div>
25
+
26
+ <p class="message"></p>
27
+
28
+ <p>Sometimes it makes more sense to just let the plot take up the
29
+ available space. In that case, we need to redraw the plot each
30
+ time the placeholder changes its size. If you include the resize
31
+ plugin, this is handled automatically.</p>
32
+
33
+ <p>Try resizing the window.</p>
34
+
35
+
36
+ <script type="text/javascript">
37
+ $(function () {
38
+ var d1 = [];
39
+ for (var i = 0; i < 14; i += 0.5)
40
+ d1.push([i, Math.sin(i)]);
41
+
42
+ var d2 = [[0, 3], [4, 8], [8, 5], [9, 13]];
43
+ var d3 = [[0, 12], [7, 12], null, [7, 2.5], [12, 2.5]];
44
+
45
+ var placeholder = $("#placeholder");
46
+
47
+ var plot = $.plot(placeholder, [d1, d2, d3]);
48
+
49
+ // the plugin includes a jQuery plugin for adding resize events to
50
+ // any element, let's just add a callback so we can display the
51
+ // placeholder size
52
+ placeholder.resize(function () {
53
+ $(".message").text("Placeholder is now "
54
+ + $(this).width() + "x" + $(this).height()
55
+ + " pixels");
56
+ });
57
+ });
58
+ </script>
59
+
60
+ </body>
61
+ </html>
@@ -0,0 +1,114 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
+ <title>Flot Examples</title>
6
+ <link href="layout.css" rel="stylesheet" type="text/css">
7
+ <!--[if lte IE 8]><script language="javascript" type="text/javascript" src="../excanvas.min.js"></script><![endif]-->
8
+ <script language="javascript" type="text/javascript" src="../jquery.js"></script>
9
+ <script language="javascript" type="text/javascript" src="../jquery.flot.js"></script>
10
+ <script language="javascript" type="text/javascript" src="../jquery.flot.selection.js"></script>
11
+ </head>
12
+ <body>
13
+ <h1>Flot Examples</h1>
14
+
15
+ <div id="placeholder" style="width:600px;height:300px"></div>
16
+
17
+ <p>1000 kg. CO<sub>2</sub> emissions per year per capita for various countries (source: <a href="http://en.wikipedia.org/wiki/List_of_countries_by_carbon_dioxide_emissions_per_capita">Wikipedia</a>).</p>
18
+
19
+ <p>Flot supports selections through the selection plugin.
20
+ You can enable rectangular selection
21
+ or one-dimensional selection if the user should only be able to
22
+ select on one axis. Try left-click and drag on the plot above
23
+ where selection on the x axis is enabled.</p>
24
+
25
+ <p>You selected: <span id="selection"></span></p>
26
+
27
+ <p>The plot command returns a plot object you can use to control
28
+ the selection. Click the buttons below.</p>
29
+
30
+ <p><input id="clearSelection" type="button" value="Clear selection" />
31
+ <input id="setSelection" type="button" value="Select year 1994" /></p>
32
+
33
+ <p>Selections are really useful for zooming. Just replot the
34
+ chart with min and max values for the axes set to the values
35
+ in the "plotselected" event triggered. Enable the checkbox
36
+ below and select a region again.</p>
37
+
38
+ <p><label><input id="zoom" type="checkbox" />Zoom to selection.</label></p>
39
+
40
+ <script type="text/javascript">
41
+ $(function () {
42
+ var data = [
43
+ {
44
+ label: "United States",
45
+ data: [[1990, 18.9], [1991, 18.7], [1992, 18.4], [1993, 19.3], [1994, 19.5], [1995, 19.3], [1996, 19.4], [1997, 20.2], [1998, 19.8], [1999, 19.9], [2000, 20.4], [2001, 20.1], [2002, 20.0], [2003, 19.8], [2004, 20.4]]
46
+ },
47
+ {
48
+ label: "Russia",
49
+ data: [[1992, 13.4], [1993, 12.2], [1994, 10.6], [1995, 10.2], [1996, 10.1], [1997, 9.7], [1998, 9.5], [1999, 9.7], [2000, 9.9], [2001, 9.9], [2002, 9.9], [2003, 10.3], [2004, 10.5]]
50
+ },
51
+ {
52
+ label: "United Kingdom",
53
+ data: [[1990, 10.0], [1991, 11.3], [1992, 9.9], [1993, 9.6], [1994, 9.5], [1995, 9.5], [1996, 9.9], [1997, 9.3], [1998, 9.2], [1999, 9.2], [2000, 9.5], [2001, 9.6], [2002, 9.3], [2003, 9.4], [2004, 9.79]]
54
+ },
55
+ {
56
+ label: "Germany",
57
+ data: [[1990, 12.4], [1991, 11.2], [1992, 10.8], [1993, 10.5], [1994, 10.4], [1995, 10.2], [1996, 10.5], [1997, 10.2], [1998, 10.1], [1999, 9.6], [2000, 9.7], [2001, 10.0], [2002, 9.7], [2003, 9.8], [2004, 9.79]]
58
+ },
59
+ {
60
+ label: "Denmark",
61
+ data: [[1990, 9.7], [1991, 12.1], [1992, 10.3], [1993, 11.3], [1994, 11.7], [1995, 10.6], [1996, 12.8], [1997, 10.8], [1998, 10.3], [1999, 9.4], [2000, 8.7], [2001, 9.0], [2002, 8.9], [2003, 10.1], [2004, 9.80]]
62
+ },
63
+ {
64
+ label: "Sweden",
65
+ data: [[1990, 5.8], [1991, 6.0], [1992, 5.9], [1993, 5.5], [1994, 5.7], [1995, 5.3], [1996, 6.1], [1997, 5.4], [1998, 5.4], [1999, 5.1], [2000, 5.2], [2001, 5.4], [2002, 6.2], [2003, 5.9], [2004, 5.89]]
66
+ },
67
+ {
68
+ label: "Norway",
69
+ data: [[1990, 8.3], [1991, 8.3], [1992, 7.8], [1993, 8.3], [1994, 8.4], [1995, 5.9], [1996, 6.4], [1997, 6.7], [1998, 6.9], [1999, 7.6], [2000, 7.4], [2001, 8.1], [2002, 12.5], [2003, 9.9], [2004, 19.0]]
70
+ }
71
+ ];
72
+
73
+ var options = {
74
+ series: {
75
+ lines: { show: true },
76
+ points: { show: true }
77
+ },
78
+ legend: { noColumns: 2 },
79
+ xaxis: { tickDecimals: 0 },
80
+ yaxis: { min: 0 },
81
+ selection: { mode: "x" }
82
+ };
83
+
84
+ var placeholder = $("#placeholder");
85
+
86
+ placeholder.bind("plotselected", function (event, ranges) {
87
+ $("#selection").text(ranges.xaxis.from.toFixed(1) + " to " + ranges.xaxis.to.toFixed(1));
88
+
89
+ var zoom = $("#zoom").attr("checked");
90
+ if (zoom)
91
+ plot = $.plot(placeholder, data,
92
+ $.extend(true, {}, options, {
93
+ xaxis: { min: ranges.xaxis.from, max: ranges.xaxis.to }
94
+ }));
95
+ });
96
+
97
+ placeholder.bind("plotunselected", function (event) {
98
+ $("#selection").text("");
99
+ });
100
+
101
+ var plot = $.plot(placeholder, data, options);
102
+
103
+ $("#clearSelection").click(function () {
104
+ plot.clearSelection();
105
+ });
106
+
107
+ $("#setSelection").click(function () {
108
+ plot.setSelection({ xaxis: { from: 1994, to: 1995 } });
109
+ });
110
+ });
111
+ </script>
112
+
113
+ </body>
114
+ </html>
@@ -0,0 +1,61 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
+ <title>Flot Examples</title>
6
+ <link href="layout.css" rel="stylesheet" type="text/css">
7
+ <!--[if lte IE 8]><script language="javascript" type="text/javascript" src="../excanvas.min.js"></script><![endif]-->
8
+ <script language="javascript" type="text/javascript" src="../jquery.js"></script>
9
+ <script language="javascript" type="text/javascript" src="../jquery.flot.js"></script>
10
+ </head>
11
+ <body>
12
+ <h1>Flot Examples</h1>
13
+
14
+ <div id="placeholder" style="width:600px;height:300px"></div>
15
+
16
+ <p>There are plenty of options you can set to control the precise
17
+ looks of your plot. You can control the ticks on the axes, the
18
+ legend, the graph type, etc. The idea is that Flot goes to great
19
+ lengths to provide sensible defaults so that you don't have to
20
+ customize much for a good result.</p>
21
+
22
+ <script type="text/javascript">
23
+ $(function () {
24
+ var d1 = [];
25
+ for (var i = 0; i < Math.PI * 2; i += 0.25)
26
+ d1.push([i, Math.sin(i)]);
27
+
28
+ var d2 = [];
29
+ for (var i = 0; i < Math.PI * 2; i += 0.25)
30
+ d2.push([i, Math.cos(i)]);
31
+
32
+ var d3 = [];
33
+ for (var i = 0; i < Math.PI * 2; i += 0.1)
34
+ d3.push([i, Math.tan(i)]);
35
+
36
+ $.plot($("#placeholder"), [
37
+ { label: "sin(x)", data: d1},
38
+ { label: "cos(x)", data: d2},
39
+ { label: "tan(x)", data: d3}
40
+ ], {
41
+ series: {
42
+ lines: { show: true },
43
+ points: { show: true }
44
+ },
45
+ xaxis: {
46
+ ticks: [0, [Math.PI/2, "\u03c0/2"], [Math.PI, "\u03c0"], [Math.PI * 3/2, "3\u03c0/2"], [Math.PI * 2, "2\u03c0"]]
47
+ },
48
+ yaxis: {
49
+ ticks: 10,
50
+ min: -2,
51
+ max: 2
52
+ },
53
+ grid: {
54
+ backgroundColor: { colors: ["#fff", "#eee"] }
55
+ }
56
+ });
57
+ });
58
+ </script>
59
+
60
+ </body>
61
+ </html>
@@ -0,0 +1,77 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
+ <title>Flot Examples</title>
6
+ <link href="layout.css" rel="stylesheet" type="text/css">
7
+ <!--[if lte IE 8]><script language="javascript" type="text/javascript" src="../excanvas.min.js"></script><![endif]-->
8
+ <script language="javascript" type="text/javascript" src="../jquery.js"></script>
9
+ <script language="javascript" type="text/javascript" src="../jquery.flot.js"></script>
10
+ <script language="javascript" type="text/javascript" src="../jquery.flot.stack.js"></script>
11
+ </head>
12
+ <body>
13
+ <h1>Flot Examples</h1>
14
+
15
+ <div id="placeholder" style="width:600px;height:300px;"></div>
16
+
17
+ <p>With the stack plugin, you can have Flot stack the
18
+ series. This is useful if you wish to display both a total and the
19
+ constituents it is made of. The only requirement is that you provide
20
+ the input sorted on x.</p>
21
+
22
+ <p class="stackControls">
23
+ <input type="button" value="With stacking">
24
+ <input type="button" value="Without stacking">
25
+ </p>
26
+
27
+ <p class="graphControls">
28
+ <input type="button" value="Bars">
29
+ <input type="button" value="Lines">
30
+ <input type="button" value="Lines with steps">
31
+ </p>
32
+
33
+ <script id="source">
34
+ $(function () {
35
+ var d1 = [];
36
+ for (var i = 0; i <= 10; i += 1)
37
+ d1.push([i, parseInt(Math.random() * 30)]);
38
+
39
+ var d2 = [];
40
+ for (var i = 0; i <= 10; i += 1)
41
+ d2.push([i, parseInt(Math.random() * 30)]);
42
+
43
+ var d3 = [];
44
+ for (var i = 0; i <= 10; i += 1)
45
+ d3.push([i, parseInt(Math.random() * 30)]);
46
+
47
+ var stack = 0, bars = true, lines = false, steps = false;
48
+
49
+ function plotWithOptions() {
50
+ $.plot($("#placeholder"), [ d1, d2, d3 ], {
51
+ series: {
52
+ stack: stack,
53
+ lines: { show: lines, fill: true, steps: steps },
54
+ bars: { show: bars, barWidth: 0.6 }
55
+ }
56
+ });
57
+ }
58
+
59
+ plotWithOptions();
60
+
61
+ $(".stackControls input").click(function (e) {
62
+ e.preventDefault();
63
+ stack = $(this).val() == "With stacking" ? true : null;
64
+ plotWithOptions();
65
+ });
66
+ $(".graphControls input").click(function (e) {
67
+ e.preventDefault();
68
+ bars = $(this).val().indexOf("Bars") != -1;
69
+ lines = $(this).val().indexOf("Lines") != -1;
70
+ steps = $(this).val().indexOf("steps") != -1;
71
+ plotWithOptions();
72
+ });
73
+ });
74
+ </script>
75
+
76
+ </body>
77
+ </html>
@@ -0,0 +1,49 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
+ <title>Flot Examples</title>
6
+ <link href="layout.css" rel="stylesheet" type="text/css">
7
+ <!--[if lte IE 8]><script language="javascript" type="text/javascript" src="../excanvas.min.js"></script><![endif]-->
8
+ <script language="javascript" type="text/javascript" src="../jquery.js"></script>
9
+ <script language="javascript" type="text/javascript" src="../jquery.flot.js"></script>
10
+ <script language="javascript" type="text/javascript" src="../jquery.flot.symbol.js"></script>
11
+ </head>
12
+ <body>
13
+ <h1>Flot Examples</h1>
14
+
15
+ <div id="placeholder" style="width:600px;height:300px"></div>
16
+
17
+ <p>Various point types. Circles are built-in. For other
18
+ point types, you can define a little callback function to draw the
19
+ symbol; some common ones are available in the symbol plugin.</p>
20
+
21
+ <script type="text/javascript">
22
+ $(function () {
23
+ function generate(offset, amplitude) {
24
+ var res = [];
25
+ var start = 0, end = 10;
26
+ for (var i = 0; i <= 50; ++i) {
27
+ var x = start + i / 50 * (end - start);
28
+ res.push([x, amplitude * Math.sin(x + offset)]);
29
+ }
30
+ return res;
31
+ }
32
+
33
+ var data = [
34
+ { data: generate(2, 1.8), points: { symbol: "circle" } },
35
+ { data: generate(3, 1.5), points: { symbol: "square" } },
36
+ { data: generate(4, 0.9), points: { symbol: "diamond" } },
37
+ { data: generate(6, 1.4), points: { symbol: "triangle" } },
38
+ { data: generate(7, 1.1), points: { symbol: "cross" } }
39
+ ];
40
+
41
+ $.plot($("#placeholder"), data, {
42
+ series: { points: { show: true, radius: 3 } },
43
+ grid: { hoverable: true }
44
+ });
45
+ });
46
+ </script>
47
+
48
+ </body>
49
+ </html>