old_sql 1.16.0 → 1.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (273) hide show
  1. data/README.md +24 -13
  2. data/app/controllers/old_sql/report_controller.rb +3 -17
  3. data/app/views/layouts/old_sql/chart.html.erb +11 -0
  4. data/app/views/old_sql/report/chart.html.erb +8 -25
  5. data/lib/generators/old_sql/templates/user_design_template.csv +2 -3
  6. data/lib/generators/old_sql/templates/user_old_sql_demo_chart_design.yml +18 -9
  7. data/lib/old_sql/report_design/chart.rb +2 -2
  8. data/lib/old_sql/report_design/chart_item.rb +4 -4
  9. data/lib/old_sql/report_design/chart_parser.rb +2 -2
  10. data/public/javascripts/old_sql/chart.js +33 -0
  11. metadata +5 -265
  12. data/public/javascripts/old_sql/MochiKit-1.4.2/Changes +0 -362
  13. data/public/javascripts/old_sql/MochiKit-1.4.2/LICENSE.txt +0 -69
  14. data/public/javascripts/old_sql/MochiKit-1.4.2/MANIFEST +0 -179
  15. data/public/javascripts/old_sql/MochiKit-1.4.2/META.json +0 -17
  16. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Async.html +0 -814
  17. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Base.html +0 -1703
  18. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Color.html +0 -755
  19. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/DOM.html +0 -1197
  20. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/DateTime.html +0 -168
  21. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/DragAndDrop.html +0 -187
  22. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Format.html +0 -300
  23. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Iter.html +0 -524
  24. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Logging.html +0 -420
  25. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/LoggingPane.html +0 -142
  26. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Position.html +0 -38
  27. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Selector.html +0 -240
  28. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Signal.html +0 -508
  29. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Sortable.html +0 -244
  30. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Style.html +0 -385
  31. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/VersionHistory.html +0 -384
  32. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Visual.html +0 -1161
  33. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/index.html +0 -447
  34. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/js/toc.js +0 -113
  35. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Async.rst +0 -767
  36. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Base.rst +0 -1445
  37. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Color.rst +0 -651
  38. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/DOM.rst +0 -1143
  39. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/DateTime.rst +0 -145
  40. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/DragAndDrop.rst +0 -197
  41. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Format.rst +0 -258
  42. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Iter.rst +0 -454
  43. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Logging.rst +0 -348
  44. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/LoggingPane.rst +0 -128
  45. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Position.rst +0 -26
  46. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Selector.rst +0 -203
  47. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Signal.rst +0 -498
  48. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Sortable.rst +0 -186
  49. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Style.rst +0 -353
  50. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/VersionHistory.rst +0 -362
  51. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Visual.rst +0 -895
  52. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/index.rst +0 -83
  53. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/ajax_tables/ajax_tables.css +0 -69
  54. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/ajax_tables/ajax_tables.js +0 -401
  55. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/ajax_tables/domains.json +0 -10
  56. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/ajax_tables/domains.xml +0 -40
  57. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/ajax_tables/index.html +0 -96
  58. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/color_wheel/color_wheel.css +0 -4
  59. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/color_wheel/color_wheel.js +0 -95
  60. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/color_wheel/index.html +0 -31
  61. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/dnd_sortable.css +0 -23
  62. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/dropmarker.png +0 -0
  63. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/icon.png +0 -0
  64. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/index.html +0 -54
  65. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/sortable2_test.html +0 -150
  66. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/sortable3_test.html +0 -42
  67. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/sortable4_test.html +0 -90
  68. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/sortable5_test.html +0 -29
  69. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/sortable_test.html +0 -38
  70. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/sortable_tree_test.html +0 -189
  71. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/draggable/draggable.css +0 -28
  72. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/draggable/draggable.js +0 -73
  73. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/draggable/index.html +0 -38
  74. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_bigslide.html +0 -36
  75. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_blind.html +0 -65
  76. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_blindslide.html +0 -31
  77. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_combi.css +0 -18
  78. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_fadeappear.html +0 -61
  79. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_grow_shrink.html +0 -38
  80. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_onload.html +0 -67
  81. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_queue.html +0 -67
  82. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_queue_limit.html +0 -30
  83. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_scroll.html +0 -483
  84. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_slide.html +0 -62
  85. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/full.html +0 -71
  86. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/icon.png +0 -0
  87. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/index.html +0 -150
  88. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/interpreter/index.html +0 -88
  89. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/interpreter/interpreter.css +0 -54
  90. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/interpreter/interpreter.js +0 -373
  91. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/key_events/index.html +0 -78
  92. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/key_events/key_events.css +0 -5
  93. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/key_events/key_events.js +0 -85
  94. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/logging_pane/index.html +0 -46
  95. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/logging_pane/logging_pane.css +0 -78
  96. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/logging_pane/logging_pane.js +0 -11
  97. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/mochiregexp/index.html +0 -74
  98. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/mochiregexp/mochiregexp.css +0 -73
  99. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/mochiregexp/mochiregexp.js +0 -125
  100. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/mouse_events/index.html +0 -88
  101. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/mouse_events/mouse_events.css +0 -17
  102. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/mouse_events/mouse_events.js +0 -59
  103. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/rounded_corners/index.html +0 -28
  104. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/rounded_corners/rounded_corners.css +0 -3
  105. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/rounded_corners/rounded_corners.js +0 -19
  106. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/dnd_boxes.html +0 -45
  107. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/dnd_full.html +0 -119
  108. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/dnd_ghost.html +0 -40
  109. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/dnd_hoverclass.html +0 -43
  110. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/dnd_scroll.html +0 -91
  111. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/dnd_snap.html +0 -54
  112. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/index.html +0 -93
  113. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/simple_dnd.css +0 -64
  114. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/sortable_tables/index.html +0 -71
  115. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/sortable_tables/sortable_tables.css +0 -66
  116. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/sortable_tables/sortable_tables.js +0 -203
  117. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/SyntaxHighlighter.css +0 -177
  118. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/Tests.html +0 -339
  119. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushCSharp.js +0 -30
  120. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushDelphi.js +0 -31
  121. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushJScript.js +0 -22
  122. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushPhp.js +0 -23
  123. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushPython.js +0 -71
  124. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushSql.js +0 -40
  125. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushVb.js +0 -29
  126. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushXml.js +0 -61
  127. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shCore.js +0 -622
  128. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/view-source.css +0 -1
  129. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/view-source.html +0 -19
  130. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/view-source.js +0 -70
  131. data/public/javascripts/old_sql/MochiKit-1.4.2/include/_img/bg_docheader.gif +0 -0
  132. data/public/javascripts/old_sql/MochiKit-1.4.2/include/_img/g_bullet.gif +0 -0
  133. data/public/javascripts/old_sql/MochiKit-1.4.2/include/_img/g_logo_doc.gif +0 -0
  134. data/public/javascripts/old_sql/MochiKit-1.4.2/include/css/documentation.css +0 -130
  135. data/public/javascripts/old_sql/MochiKit-1.4.2/include/css/general.css +0 -48
  136. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Async.js +0 -682
  137. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Base.js +0 -1489
  138. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Color.js +0 -863
  139. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/DOM.js +0 -1256
  140. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/DateTime.js +0 -222
  141. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/DragAndDrop.js +0 -793
  142. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Format.js +0 -304
  143. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Iter.js +0 -844
  144. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Logging.js +0 -315
  145. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/LoggingPane.js +0 -353
  146. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/MochiKit.js +0 -188
  147. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/MockDOM.js +0 -115
  148. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Position.js +0 -236
  149. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Selector.js +0 -415
  150. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Signal.js +0 -897
  151. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Sortable.js +0 -589
  152. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Style.js +0 -594
  153. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Test.js +0 -162
  154. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Visual.js +0 -2026
  155. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/__package__.js +0 -18
  156. data/public/javascripts/old_sql/MochiKit-1.4.2/packed/MochiKit/MochiKit.js +0 -7829
  157. data/public/javascripts/old_sql/MochiKit-1.4.2/packed/MochiKit/__package__.js +0 -6
  158. data/public/javascripts/old_sql/MochiKit-1.4.2/packed/MochiKit/customize.html +0 -251
  159. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/FakeJSAN.js +0 -40
  160. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/SimpleTest/SimpleTest.js +0 -381
  161. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/SimpleTest/TestRunner.js +0 -159
  162. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/SimpleTest/test.css +0 -28
  163. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/cli.js +0 -6
  164. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/index.html +0 -25
  165. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/standalone.js +0 -16
  166. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_Base.js +0 -577
  167. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_Color.js +0 -137
  168. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_DateTime.js +0 -52
  169. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_DragAndDrop.js +0 -30
  170. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_Format.js +0 -89
  171. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_Iter.js +0 -186
  172. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_Logging.js +0 -88
  173. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Async.html +0 -408
  174. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Async.json +0 -1
  175. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Base.html +0 -34
  176. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Color.html +0 -84
  177. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-DOM-Safari.html +0 -48
  178. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-DOM.html +0 -363
  179. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-DateTime.html +0 -39
  180. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-DragAndDrop.html +0 -54
  181. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Format.html +0 -39
  182. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Iter.html +0 -38
  183. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-JSAN.html +0 -32
  184. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Logging.html +0 -40
  185. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-MochiKit.html +0 -18
  186. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Selector.html +0 -295
  187. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Signal.html +0 -43
  188. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Style.html +0 -223
  189. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Visual.html +0 -197
  190. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_Signal.js +0 -481
  191. data/public/javascripts/old_sql/plotkit-0.9.1/COPYING +0 -28
  192. data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/Base.js +0 -406
  193. data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/Canvas.js +0 -683
  194. data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/EasyPlot.js +0 -161
  195. data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/Layout.js +0 -756
  196. data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/PlotKit.js +0 -151
  197. data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/PlotKit_Packed.js +0 -2177
  198. data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/SVG.js +0 -705
  199. data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/SweetCanvas.js +0 -348
  200. data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/SweetSVG.js +0 -247
  201. data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/dummy.svg +0 -9
  202. data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/excanvas.js +0 -723
  203. data/public/javascripts/old_sql/plotkit-0.9.1/README +0 -1
  204. data/public/javascripts/old_sql/plotkit-0.9.1/doc/MochiKitAdditions.html +0 -2
  205. data/public/javascripts/old_sql/plotkit-0.9.1/doc/MochiKitAdditions.txt +0 -2
  206. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Base.html +0 -302
  207. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Base.txt +0 -139
  208. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Canvas.html +0 -172
  209. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Canvas.txt +0 -81
  210. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.EasyPlot.html +0 -155
  211. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.EasyPlot.txt +0 -50
  212. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Layout.html +0 -428
  213. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Layout.txt +0 -330
  214. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.QuickStart.html +0 -368
  215. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.QuickStart.txt +0 -256
  216. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Renderer.html +0 -436
  217. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Renderer.txt +0 -299
  218. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.SVG.html +0 -159
  219. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.SVG.txt +0 -64
  220. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.SweetCanvas.html +0 -131
  221. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.SweetCanvas.txt +0 -34
  222. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.SweetSVG.html +0 -131
  223. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.SweetSVG.txt +0 -34
  224. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.html +0 -334
  225. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.txt +0 -151
  226. data/public/javascripts/old_sql/plotkit-0.9.1/doc/SVGCanvasCompat.html +0 -304
  227. data/public/javascripts/old_sql/plotkit-0.9.1/doc/SVGCanvasCompat.txt +0 -144
  228. data/public/javascripts/old_sql/plotkit-0.9.1/doc/barsample.png +0 -0
  229. data/public/javascripts/old_sql/plotkit-0.9.1/doc/black.png +0 -0
  230. data/public/javascripts/old_sql/plotkit-0.9.1/doc/blue.png +0 -0
  231. data/public/javascripts/old_sql/plotkit-0.9.1/doc/cyan.png +0 -0
  232. data/public/javascripts/old_sql/plotkit-0.9.1/doc/doc.css +0 -62
  233. data/public/javascripts/old_sql/plotkit-0.9.1/doc/generate.py +0 -37
  234. data/public/javascripts/old_sql/plotkit-0.9.1/doc/green.png +0 -0
  235. data/public/javascripts/old_sql/plotkit-0.9.1/doc/orange.png +0 -0
  236. data/public/javascripts/old_sql/plotkit-0.9.1/doc/piesample.png +0 -0
  237. data/public/javascripts/old_sql/plotkit-0.9.1/doc/purple.png +0 -0
  238. data/public/javascripts/old_sql/plotkit-0.9.1/doc/red.png +0 -0
  239. data/public/javascripts/old_sql/plotkit-0.9.1/scripts/custom_rhino.jar +0 -0
  240. data/public/javascripts/old_sql/plotkit-0.9.1/scripts/pack.py +0 -58
  241. data/public/javascripts/old_sql/plotkit-0.9.1/tests/axis.html +0 -31
  242. data/public/javascripts/old_sql/plotkit-0.9.1/tests/basic.html +0 -25
  243. data/public/javascripts/old_sql/plotkit-0.9.1/tests/basic.js +0 -143
  244. data/public/javascripts/old_sql/plotkit-0.9.1/tests/debug.html +0 -56
  245. data/public/javascripts/old_sql/plotkit-0.9.1/tests/demo-svg.html +0 -58
  246. data/public/javascripts/old_sql/plotkit-0.9.1/tests/demo-svg.js +0 -133
  247. data/public/javascripts/old_sql/plotkit-0.9.1/tests/demo.html +0 -57
  248. data/public/javascripts/old_sql/plotkit-0.9.1/tests/demo.js +0 -136
  249. data/public/javascripts/old_sql/plotkit-0.9.1/tests/dynamic.html +0 -161
  250. data/public/javascripts/old_sql/plotkit-0.9.1/tests/img/firefox.png +0 -0
  251. data/public/javascripts/old_sql/plotkit-0.9.1/tests/img/konqueror.png +0 -0
  252. data/public/javascripts/old_sql/plotkit-0.9.1/tests/img/mozilla.ico +0 -0
  253. data/public/javascripts/old_sql/plotkit-0.9.1/tests/img/msie.gif +0 -0
  254. data/public/javascripts/old_sql/plotkit-0.9.1/tests/img/opera.ico +0 -0
  255. data/public/javascripts/old_sql/plotkit-0.9.1/tests/img/safari.gif +0 -0
  256. data/public/javascripts/old_sql/plotkit-0.9.1/tests/labels-img.html +0 -38
  257. data/public/javascripts/old_sql/plotkit-0.9.1/tests/labels.html +0 -43
  258. data/public/javascripts/old_sql/plotkit-0.9.1/tests/prototype_compat.html +0 -28
  259. data/public/javascripts/old_sql/plotkit-0.9.1/tests/quickstart-easy.html +0 -29
  260. data/public/javascripts/old_sql/plotkit-0.9.1/tests/quickstart-horiz.html +0 -53
  261. data/public/javascripts/old_sql/plotkit-0.9.1/tests/quickstart-neg.html +0 -29
  262. data/public/javascripts/old_sql/plotkit-0.9.1/tests/quickstart-svg.html +0 -61
  263. data/public/javascripts/old_sql/plotkit-0.9.1/tests/quickstart.html +0 -57
  264. data/public/javascripts/old_sql/plotkit-0.9.1/tests/sample.txt +0 -6
  265. data/public/javascripts/old_sql/plotkit-0.9.1/tests/svg-sweet.html +0 -29
  266. data/public/javascripts/old_sql/plotkit-0.9.1/tests/svg-sweet.js +0 -141
  267. data/public/javascripts/old_sql/plotkit-0.9.1/tests/svg.html +0 -26
  268. data/public/javascripts/old_sql/plotkit-0.9.1/tests/svg.js +0 -147
  269. data/public/javascripts/old_sql/plotkit-0.9.1/tests/sweet.html +0 -24
  270. data/public/javascripts/old_sql/plotkit-0.9.1/tests/sweet.js +0 -89
  271. data/public/javascripts/old_sql/plotkit-0.9.1/tests/tests.css +0 -66
  272. data/public/javascripts/old_sql/plotkit-0.9.1/tests/testsvg.html +0 -20
  273. data/public/javascripts/old_sql/plotkit-0.9.1/tests/testsvg.js +0 -31
@@ -1,28 +0,0 @@
1
- Copyright (c) 2006, Alastair Tse
2
- All rights reserved.
3
-
4
- Redistribution and use in source and binary forms, with or without
5
- modification, are permitted provided that the following conditions are
6
- met:
7
-
8
- * Redistributions of source code must retain the above copyright
9
- notice, this list of conditions and the following disclaimer.
10
- * Redistributions in binary form must reproduce the above
11
- copyright notice, this list of conditions and the following
12
- disclaimer in the documentation and/or other materials provided
13
- with the distribution.
14
- * Neither the name of the Alastair Tse nor the names of its
15
- contributors may be used to endorse or promote products derived
16
- from this software without specific prior written permission.
17
-
18
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -1,406 +0,0 @@
1
- /*
2
- PlotKit
3
- =======
4
- PlotKit is a collection of Javascript classes that allows
5
- you to quickly visualise data using different types of charts.
6
-
7
- For license/info/documentation: http://www.liquidx.net/plotkit/
8
-
9
- Copyright
10
- ---------
11
- Copyright 2005,2006 (c) Alastair Tse <alastair^liquidx.net>
12
- For use under the BSD license. <http://www.liquidx.net/plotkit>
13
- */
14
-
15
- // --------------------------------------------------------------------
16
- // Check required components
17
- // --------------------------------------------------------------------
18
-
19
- try {
20
- if (typeof(MochiKit.Base) == 'undefined' ||
21
- typeof(MochiKit.DOM) == 'undefined' ||
22
- typeof(MochiKit.Color) == 'undefined' ||
23
- typeof(MochiKit.Format) == 'undefined')
24
- {
25
- throw "";
26
- }
27
- }
28
- catch (e) {
29
- throw "PlotKit depends on MochiKit.{Base,Color,DOM,Format}"
30
- }
31
-
32
- // -------------------------------------------------------------------
33
- // Inject Common Shortcuts we use into MochiKit.Color.Color
34
- // -------------------------------------------------------------------
35
-
36
- MochiKit.Base.update(MochiKit.Color.Color.prototype, {
37
- asFillColor: function() {
38
- return this.lighterColorWithLevel(0.3);
39
- },
40
-
41
- asStrokeColor: function() {
42
- return this.darkerColorWithLevel(0.1);
43
- },
44
-
45
- asPointColor: function() {
46
- return this.lighterColorWithLevel(0.1);
47
- }
48
- });
49
-
50
-
51
- // -------------------------------------------------------------------
52
- // Define our own PlotKit namespace
53
- // -------------------------------------------------------------------
54
-
55
- if (typeof(PlotKit) == 'undefined') {
56
- PlotKit = {};
57
- }
58
-
59
- PlotKit.NAME = "PlotKit";
60
- PlotKit.VERSION = "0.8";
61
- PlotKit.__repr__ = function() {
62
- return "[" + this.NAME + " " + this.VERSION + "]";
63
- };
64
-
65
- PlotKit.toString = function() {
66
- return this.__repr__();
67
- }
68
-
69
- // -------------------------------------------------------------------
70
- // Encapsulate all our utility function into it's own namespace.
71
- // -------------------------------------------------------------------
72
-
73
- if (typeof(PlotKit.Base) == 'undefined') {
74
- PlotKit.Base = {};
75
- }
76
-
77
- PlotKit.Base.NAME = 'PlotKit.Base';
78
- PlotKit.Base.VERSION = PlotKit.VERSION;
79
-
80
- PlotKit.Base.__repr__ = function() {
81
- return "[" + this.NAME + " " + this.VERSION + "]";
82
- };
83
-
84
- PlotKit.Base.toString = function() {
85
- return this.__repr__();
86
- }
87
-
88
-
89
- // Detect whether we are using prototype.js
90
- PlotKit.Base.usingPrototype = function() {
91
- try {
92
- return (typeof(Object.extend) == 'function');
93
- }
94
- catch (e) {
95
- return false;
96
- }
97
- }
98
-
99
-
100
- MochiKit.Base.update(PlotKit.Base, {
101
- roundInterval: function(range, intervals, precision) {
102
- // We want to make the interval look regular,
103
- var trunc = MochiKit.Format.roundToFixed;
104
- var sep = range/intervals;
105
- return parseFloat(trunc(sep, precision));
106
- },
107
-
108
- collapse: function(lst) {
109
- var m = MochiKit.Base;
110
- var biggerList = new Array();
111
- for (var i = 0; i < lst.length; i++) {
112
- biggerList = m.concat(biggerList, lst[i]);
113
- }
114
- if (PlotKit.Base.usingPrototype()) {
115
- delete biggerList.extend;
116
- delete biggerList.from;
117
- delete biggerList.inspect;
118
- }
119
-
120
- return biggerList;
121
- },
122
-
123
- uniq: function(sortedList) {
124
- // get unique elements in list, exactly the same as unix shell's uniq.
125
- var m = MochiKit.Base;
126
-
127
- if (!m.isArrayLike(sortedList) || (sortedList.length < 1))
128
- return new Array();
129
-
130
- var uniq = new Array();
131
- var lastElem = sortedList[0];
132
- uniq.push(sortedList[0]);
133
- for (var i = 1; i < sortedList.length; i++) {
134
- if (m.compare(sortedList[i], lastElem) != 0) {
135
- lastElem = sortedList[i];
136
- uniq.push(sortedList[i]);
137
- }
138
- }
139
- return uniq;
140
- },
141
-
142
- colorScheme: function() {
143
- var mb = MochiKit.Base;
144
- var mc = MochiKit.Color
145
- var scheme = ["red", "orange", "yellow", "green", "cyan", "blue", "purple", "magenta"];
146
-
147
- var makeColor = function(name) {
148
- return mc.Color[name + "Color"]()
149
- };
150
-
151
- return mb.map(makeColor, scheme);
152
- },
153
-
154
- baseDarkPrimaryColors: function () {
155
- var hexColor = MochiKit.Color.Color.fromHexString;
156
- return [hexColor("#ad3f40"),
157
- hexColor("#ddac2c"),
158
- hexColor("#dfdd0c"),
159
- hexColor("#5276c4"),
160
- hexColor("#739c5a")];
161
- },
162
-
163
- basePrimaryColors: function () {
164
- var hexColor = MochiKit.Color.Color.fromHexString;
165
- return [hexColor("#d24c4d"),
166
- hexColor("#f2b32f"),
167
- hexColor("#ece90e"),
168
- hexColor("#5d83da"),
169
- hexColor("#78a15d")];
170
- },
171
-
172
- baseBlueColors: function () {
173
- var hexColor = MochiKit.Color.Color.fromHexString;
174
- return [hexColor("#4b6b94"), hexColor("#5d81b4"), hexColor("#acbad2")];
175
- },
176
-
177
- palette: function(baseColor, fromLevel, toLevel, increment) {
178
- var isNil = MochiKit.Base.isUndefinedOrNull;
179
- var fractions = new Array();
180
- if (isNil(increment))
181
- increment = 0.1;
182
- if (isNil(toLevel))
183
- toLevel = 0.4;
184
- if (isNil(fromLevel))
185
- fromLevel = -0.2;
186
-
187
- var level = fromLevel;
188
- while (level <= toLevel) {
189
- fractions.push(level);
190
- level += increment;
191
- }
192
-
193
- var makeColor = function(color, fraction) {
194
- return color.lighterColorWithLevel(fraction);
195
- };
196
- return MochiKit.Base.map(partial(makeColor, baseColor), fractions);
197
- },
198
-
199
- excanvasSupported: function() {
200
- if (/MSIE/.test(navigator.userAgent) && !window.opera) {
201
- return true;
202
- }
203
- return false;
204
- },
205
-
206
- // The following functions are from quirksmode.org
207
- // http://www.quirksmode.org/js/findpos.html
208
-
209
- findPosX: function(obj) {
210
- var curleft = 0;
211
- if (obj.offsetParent) {
212
- while (obj.offsetParent) {
213
- curleft += obj.offsetLeft
214
- obj = obj.offsetParent;
215
- }
216
- }
217
- else if (obj.x)
218
- curleft += obj.x;
219
- return curleft;
220
- },
221
-
222
- findPosY: function(obj) {
223
- var curtop = 0;
224
- if (obj.offsetParent) {
225
- while (obj.offsetParent) {
226
- curtop += obj.offsetTop
227
- obj = obj.offsetParent;
228
- }
229
- }
230
- else if (obj.y)
231
- curtop += obj.y;
232
- return curtop;
233
- },
234
-
235
- isFuncLike: function(obj) {
236
- return (typeof(obj) == 'function');
237
- }
238
- });
239
-
240
- //
241
- // Prototype.js aware (crippled) versions of map and items.
242
- //
243
-
244
- PlotKit.Base.map = function(fn, lst) {
245
- if (PlotKit.Base.usingPrototype()) {
246
- var rval = [];
247
- for (var x in lst) {
248
- if (typeof(lst[x]) == 'function') continue;
249
- rval.push(fn(lst[x]));
250
- }
251
- return rval;
252
- }
253
- else {
254
- return MochiKit.Base.map(fn, lst);
255
- }
256
- };
257
-
258
- PlotKit.Base.items = function(lst) {
259
- if (PlotKit.Base.usingPrototype()) {
260
- var rval = [];
261
- for (var x in lst) {
262
- if (typeof(lst[x]) == 'function') continue;
263
- rval.push([x, lst[x]]);
264
- }
265
- return rval;
266
- }
267
- else {
268
- return MochiKit.Base.items(lst);
269
- }
270
- };
271
-
272
- PlotKit.Base.keys = function(lst) {
273
- if (PlotKit.Base.usingPrototype()) {
274
- var rval = [];
275
- for (var x in lst) {
276
- if (typeof(lst[x]) == 'function') continue;
277
- rval.push(x);
278
- }
279
- return rval;
280
- }
281
- else {
282
- return MochiKit.Base.keys(lst);
283
- }
284
- };
285
-
286
- //
287
- // colour schemes
288
- //
289
-
290
- PlotKit.Base.baseColors = function () {
291
- var hexColor = MochiKit.Color.Color.fromHexString;
292
- return [hexColor("#476fb2"),
293
- hexColor("#be2c2b"),
294
- hexColor("#85b730"),
295
- hexColor("#734a99"),
296
- hexColor("#26a1c5"),
297
- hexColor("#fb8707"),
298
- hexColor("#000000")];
299
- };
300
-
301
- PlotKit.Base.officeBaseStyle = {
302
- "axisLineWidth": 2.0,
303
- "axisLabelColor": Color.grayColor(),
304
- "axisLineColor": Color.whiteColor(),
305
- "padding": {top: 5, bottom: 10, left: 30, right: 30}
306
- };
307
-
308
- MochiKit.Base.update(PlotKit.Base,{
309
- officeBlue: function() {
310
- var r = {
311
- "colorScheme": PlotKit.Base.palette(PlotKit.Base.baseColors()[0]),
312
- "backgroundColor": PlotKit.Base.baseColors()[0].lighterColorWithLevel(0.45)
313
- };
314
- MochiKit.Base.update(r, PlotKit.Base.officeBaseStyle);
315
- return r;
316
- },
317
- officeRed: function() {
318
- var r = {
319
- "colorScheme": PlotKit.Base.palette(PlotKit.Base.baseColors()[1]),
320
- "backgroundColor": PlotKit.Base.baseColors()[1].lighterColorWithLevel(0.5)
321
- };
322
- MochiKit.Base.update(r, PlotKit.Base.officeBaseStyle);
323
- return r;
324
- },
325
- officeGreen: function() {
326
- var r = {
327
- "colorScheme": PlotKit.Base.palette(PlotKit.Base.baseColors()[2]),
328
- "backgroundColor": PlotKit.Base.baseColors()[2].lighterColorWithLevel(0.5)
329
- };
330
- MochiKit.Base.update(r, PlotKit.Base.officeBaseStyle);
331
- return r;
332
- },
333
- officePurple: function() {
334
- var r = {
335
- "colorScheme": PlotKit.Base.palette(PlotKit.Base.baseColors()[3]),
336
- "backgroundColor": PlotKit.Base.baseColors()[3].lighterColorWithLevel(0.5)
337
- };
338
- MochiKit.Base.update(r, PlotKit.Base.officeBaseStyle);
339
- return r;
340
- },
341
-
342
- officeCyan: function() {
343
- var r = {
344
- "colorScheme": PlotKit.Base.palette(PlotKit.Base.baseColors()[4]),
345
- "backgroundColor": PlotKit.Base.baseColors()[4].lighterColorWithLevel(0.5)
346
- };
347
- MochiKit.Base.update(r, PlotKit.Base.officeBaseStyle);
348
- return r;
349
- },
350
-
351
- officeOrange: function() {
352
- var r = {
353
- "colorScheme": PlotKit.Base.palette(PlotKit.Base.baseColors()[5]),
354
- "backgroundColor": PlotKit.Base.baseColors()[5].lighterColorWithLevel(0.4)
355
- };
356
- MochiKit.Base.update(r, PlotKit.Base.officeBaseStyle);
357
- return r;
358
- },
359
-
360
- officeBlack: function() {
361
- var r = {
362
- "colorScheme": PlotKit.Base.palette(PlotKit.Base.baseColors()[6], 0.0, 0.6),
363
- "backgroundColor": PlotKit.Base.baseColors()[6].lighterColorWithLevel(0.9)
364
- };
365
- MochiKit.Base.update(r, PlotKit.Base.officeBaseStyle);
366
- return r;
367
- }
368
- });
369
-
370
-
371
- PlotKit.Base.EXPORT = [
372
- "baseColors",
373
- "collapse",
374
- "colorScheme",
375
- "findPosX",
376
- "findPosY",
377
- "officeBaseStyle",
378
- "officeBlue",
379
- "officeRed",
380
- "officeGreen",
381
- "officePurple",
382
- "officeCyan",
383
- "officeOrange",
384
- "officeBlack",
385
- "roundInterval",
386
- "uniq",
387
- "isFuncLike",
388
- "excanvasSupported"
389
- ];
390
-
391
- PlotKit.Base.EXPORT_OK = [];
392
-
393
- PlotKit.Base.__new__ = function() {
394
- var m = MochiKit.Base;
395
-
396
- m.nameFunctions(this);
397
-
398
- this.EXPORT_TAGS = {
399
- ":common": this.EXPORT,
400
- ":all": m.concat(this.EXPORT, this.EXPORT_OK)
401
- };
402
- };
403
-
404
- PlotKit.Base.__new__();
405
- MochiKit.Base._exportSymbols(this, PlotKit.Base);
406
-
@@ -1,683 +0,0 @@
1
- /*
2
- PlotKit Canvas
3
- ==============
4
-
5
- Provides HTML Canvas Renderer. This is supported under:
6
-
7
- - Safari 2.0
8
- - Mozilla Firefox 1.5
9
- - Opera 9.0 preview 2
10
- - IE 6 (via VML Emulation)
11
-
12
- It uses DIVs for labels.
13
-
14
- Copyright
15
- ---------
16
- Copyright 2005,2006 (c) Alastair Tse <alastair^liquidx.net>
17
- For use under the BSD license. <http://www.liquidx.net/plotkit>
18
-
19
- */
20
- // --------------------------------------------------------------------
21
- // Check required components
22
- // --------------------------------------------------------------------
23
-
24
- try {
25
- if ((typeof(PlotKit.Base) == 'undefined') ||
26
- (typeof(PlotKit.Layout) == 'undefined'))
27
- {
28
- throw "";
29
- }
30
- }
31
- catch (e) {
32
- throw "PlotKit.Layout depends on MochiKit.{Base,Color,DOM,Format} and PlotKit.{Base,Layout}"
33
- }
34
-
35
-
36
- // ------------------------------------------------------------------------
37
- // Defines the renderer class
38
- // ------------------------------------------------------------------------
39
-
40
- if (typeof(PlotKit.CanvasRenderer) == 'undefined') {
41
- PlotKit.CanvasRenderer = {};
42
- }
43
-
44
- PlotKit.CanvasRenderer.NAME = "PlotKit.CanvasRenderer";
45
- PlotKit.CanvasRenderer.VERSION = PlotKit.VERSION;
46
-
47
- PlotKit.CanvasRenderer.__repr__ = function() {
48
- return "[" + this.NAME + " " + this.VERSION + "]";
49
- };
50
-
51
- PlotKit.CanvasRenderer.toString = function() {
52
- return this.__repr__();
53
- }
54
-
55
- PlotKit.CanvasRenderer = function(element, layout, options) {
56
- if (arguments.length > 0)
57
- this.__init__(element, layout, options);
58
- };
59
-
60
- PlotKit.CanvasRenderer.prototype.__init__ = function(element, layout, options) {
61
- var isNil = MochiKit.Base.isUndefinedOrNull;
62
- var Color = MochiKit.Color.Color;
63
-
64
- // default options
65
- this.options = {
66
- "drawBackground": true,
67
- "backgroundColor": Color.whiteColor(),
68
- "padding": {left: 30, right: 30, top: 5, bottom: 10},
69
- "colorScheme": PlotKit.Base.palette(PlotKit.Base.baseColors()[0]),
70
- "strokeColor": Color.whiteColor(),
71
- "strokeColorTransform": "asStrokeColor",
72
- "strokeWidth": 0.5,
73
- "shouldFill": true,
74
- "shouldStroke": true,
75
- "drawXAxis": true,
76
- "drawYAxis": true,
77
- "axisLineColor": Color.blackColor(),
78
- "axisLineWidth": 0.5,
79
- "axisTickSize": 3,
80
- "axisLabelColor": Color.blackColor(),
81
- "axisLabelFont": "Arial",
82
- "axisLabelFontSize": 9,
83
- "axisLabelWidth": 50,
84
- "pieRadius": 0.4,
85
- "enableEvents": true
86
- };
87
- MochiKit.Base.update(this.options, options ? options : {});
88
-
89
- this.layout = layout;
90
- this.element = MochiKit.DOM.getElement(element);
91
- this.container = this.element.parentNode;
92
-
93
- // Stuff relating to Canvas on IE support
94
- this.isIE = PlotKit.Base.excanvasSupported();
95
-
96
- if (this.isIE && !isNil(G_vmlCanvasManager)) {
97
- this.IEDelay = 0.5;
98
- this.maxTries = 5;
99
- this.renderDelay = null;
100
- this.clearDelay = null;
101
- this.element = G_vmlCanvasManager.initElement(this.element);
102
- }
103
-
104
- this.height = this.element.height;
105
- this.width = this.element.width;
106
-
107
- // --- check whether everything is ok before we return
108
-
109
- if (isNil(this.element))
110
- throw "CanvasRenderer() - passed canvas is not found";
111
-
112
- if (!this.isIE && !(PlotKit.CanvasRenderer.isSupported(this.element)))
113
- throw "CanvasRenderer() - Canvas is not supported.";
114
-
115
- if (isNil(this.container) || (this.container.nodeName.toLowerCase() != "div"))
116
- throw "CanvasRenderer() - <canvas> needs to be enclosed in <div>";
117
-
118
- // internal state
119
- this.xlabels = new Array();
120
- this.ylabels = new Array();
121
- this.isFirstRender = true;
122
-
123
- this.area = {
124
- x: this.options.padding.left,
125
- y: this.options.padding.top,
126
- w: this.width - this.options.padding.left - this.options.padding.right,
127
- h: this.height - this.options.padding.top - this.options.padding.bottom
128
- };
129
-
130
- MochiKit.DOM.updateNodeAttributes(this.container,
131
- {"style":{ "position": "relative", "width": this.width + "px"}});
132
-
133
- // load event system if we have Signals
134
- /* Disabled until we have a proper implementation
135
- try {
136
- this.event_isinside = null;
137
- if (MochiKit.Signal && this.options.enableEvents) {
138
- this._initialiseEvents();
139
- }
140
- }
141
- catch (e) {
142
- // still experimental
143
- }
144
- */
145
- };
146
-
147
- PlotKit.CanvasRenderer.prototype.render = function() {
148
- if (this.isIE) {
149
- // VML takes a while to start up, so we just poll every this.IEDelay
150
- try {
151
- if (this.renderDelay) {
152
- this.renderDelay.cancel();
153
- this.renderDelay = null;
154
- }
155
- var context = this.element.getContext("2d");
156
- }
157
- catch (e) {
158
- this.isFirstRender = false;
159
- if (this.maxTries-- > 0) {
160
- this.renderDelay = MochiKit.Async.wait(this.IEDelay);
161
- this.renderDelay.addCallback(bind(this.render, this));
162
- }
163
- return;
164
- }
165
- }
166
-
167
- if (this.options.drawBackground)
168
- this._renderBackground();
169
-
170
- if (this.layout.style == "bar") {
171
- this._renderBarChart();
172
- this._renderBarAxis();
173
- }
174
- else if (this.layout.style == "pie") {
175
- this._renderPieChart();
176
- this._renderPieAxis();
177
- }
178
- else if (this.layout.style == "line") {
179
- this._renderLineChart();
180
- this._renderLineAxis();
181
- }
182
- };
183
-
184
- PlotKit.CanvasRenderer.prototype._renderBarChartWrap = function(data, plotFunc) {
185
- var context = this.element.getContext("2d");
186
- var colorCount = this.options.colorScheme.length;
187
- var colorScheme = this.options.colorScheme;
188
- var setNames = MochiKit.Base.keys(this.layout.datasets);
189
- var setCount = setNames.length;
190
-
191
- for (var i = 0; i < setCount; i++) {
192
- var setName = setNames[i];
193
- var color = colorScheme[i%colorCount];
194
- context.save();
195
- context.fillStyle = color.toRGBString();
196
- if (this.options.strokeColor)
197
- context.strokeStyle = this.options.strokeColor.toRGBString();
198
- else if (this.options.strokeColorTransform)
199
- context.strokeStyle = color[this.options.strokeColorTransform]().toRGBString();
200
-
201
- context.lineWidth = this.options.strokeWidth;
202
- var forEachFunc = function(obj) {
203
- if (obj.name == setName)
204
- plotFunc(context, obj);
205
- };
206
-
207
- MochiKit.Iter.forEach(data, bind(forEachFunc, this));
208
- context.restore();
209
- }
210
- };
211
-
212
- PlotKit.CanvasRenderer.prototype._renderBarChart = function() {
213
- var bind = MochiKit.Base.bind;
214
-
215
- var drawRect = function(context, bar) {
216
- var x = this.area.w * bar.x + this.area.x;
217
- var y = this.area.h * bar.y + this.area.y;
218
- var w = this.area.w * bar.w;
219
- var h = this.area.h * bar.h;
220
- if ((w < 1) || (h < 1))
221
- return;
222
- if (this.options.shouldFill)
223
- context.fillRect(x, y, w, h);
224
- if (this.options.shouldStroke)
225
- context.strokeRect(x, y, w, h);
226
- };
227
- this._renderBarChartWrap(this.layout.bars, bind(drawRect, this));
228
- };
229
-
230
- PlotKit.CanvasRenderer.prototype._renderLineChart = function() {
231
- var context = this.element.getContext("2d");
232
- var colorCount = this.options.colorScheme.length;
233
- var colorScheme = this.options.colorScheme;
234
- var setNames = MochiKit.Base.keys(this.layout.datasets);
235
- var setCount = setNames.length;
236
- var bind = MochiKit.Base.bind;
237
- var partial = MochiKit.Base.partial;
238
-
239
- for (var i = 0; i < setCount; i++) {
240
- var setName = setNames[i];
241
- var color = colorScheme[i%colorCount];
242
- var strokeX = this.options.strokeColorTransform;
243
-
244
- // setup graphics context
245
- context.save();
246
- context.fillStyle = color.toRGBString();
247
- if (this.options.strokeColor)
248
- context.strokeStyle = this.options.strokeColor.toRGBString();
249
- else if (this.options.strokeColorTransform)
250
- context.strokeStyle = color[strokeX]().toRGBString();
251
-
252
- context.lineWidth = this.options.strokeWidth;
253
-
254
- // create paths
255
- var makePath = function(ctx) {
256
- ctx.beginPath();
257
- ctx.moveTo(this.area.x, this.area.y + this.area.h);
258
- var addPoint = function(ctx_, point) {
259
- if (point.name == setName)
260
- ctx_.lineTo(this.area.w * point.x + this.area.x,
261
- this.area.h * point.y + this.area.y);
262
- };
263
- MochiKit.Iter.forEach(this.layout.points, partial(addPoint, ctx), this);
264
- ctx.lineTo(this.area.w + this.area.x,
265
- this.area.h + this.area.y);
266
- ctx.lineTo(this.area.x, this.area.y + this.area.h);
267
- ctx.closePath();
268
- };
269
-
270
- if (this.options.shouldFill) {
271
- bind(makePath, this)(context);
272
- context.fill();
273
- }
274
- if (this.options.shouldStroke) {
275
- bind(makePath, this)(context);
276
- context.stroke();
277
- }
278
-
279
- context.restore();
280
- }
281
- };
282
-
283
- PlotKit.CanvasRenderer.prototype._renderPieChart = function() {
284
- var context = this.element.getContext("2d");
285
- var colorCount = this.options.colorScheme.length;
286
- var slices = this.layout.slices;
287
-
288
- var centerx = this.area.x + this.area.w * 0.5;
289
- var centery = this.area.y + this.area.h * 0.5;
290
- var radius = Math.min(this.area.w * this.options.pieRadius,
291
- this.area.h * this.options.pieRadius);
292
-
293
- if (this.isIE) {
294
- centerx = parseInt(centerx);
295
- centery = parseInt(centery);
296
- radius = parseInt(radius);
297
- }
298
-
299
-
300
- // NOTE NOTE!! Canvas Tag draws the circle clockwise from the y = 0, x = 1
301
- // so we have to subtract 90 degrees to make it start at y = 1, x = 0
302
-
303
- for (var i = 0; i < slices.length; i++) {
304
- var color = this.options.colorScheme[i%colorCount];
305
- context.save();
306
- context.fillStyle = color.toRGBString();
307
-
308
- var makePath = function() {
309
- context.beginPath();
310
- context.moveTo(centerx, centery);
311
- context.arc(centerx, centery, radius,
312
- slices[i].startAngle - Math.PI/2,
313
- slices[i].endAngle - Math.PI/2,
314
- false);
315
- context.lineTo(centerx, centery);
316
- context.closePath();
317
- };
318
-
319
- if (Math.abs(slices[i].startAngle - slices[i].endAngle) > 0.001) {
320
- if (this.options.shouldFill) {
321
- makePath();
322
- context.fill();
323
- }
324
-
325
- if (this.options.shouldStroke) {
326
- makePath();
327
- context.lineWidth = this.options.strokeWidth;
328
- if (this.options.strokeColor)
329
- context.strokeStyle = this.options.strokeColor.toRGBString();
330
- else if (this.options.strokeColorTransform)
331
- context.strokeStyle = color[this.options.strokeColorTransform]().toRGBString();
332
- context.stroke();
333
- }
334
- }
335
- context.restore();
336
- }
337
- };
338
-
339
- PlotKit.CanvasRenderer.prototype._renderBarAxis = function() {
340
- this._renderAxis();
341
- }
342
-
343
- PlotKit.CanvasRenderer.prototype._renderLineAxis = function() {
344
- this._renderAxis();
345
- };
346
-
347
-
348
- PlotKit.CanvasRenderer.prototype._renderAxis = function() {
349
- if (!this.options.drawXAxis && !this.options.drawYAxis)
350
- return;
351
-
352
- var context = this.element.getContext("2d");
353
-
354
- var labelStyle = {"style":
355
- {"position": "absolute",
356
- "fontSize": this.options.axisLabelFontSize + "px",
357
- "zIndex": 10,
358
- "color": this.options.axisLabelColor.toRGBString(),
359
- "width": this.options.axisLabelWidth + "px",
360
- "overflow": "hidden"
361
- }
362
- };
363
-
364
- // axis lines
365
- context.save();
366
- context.strokeStyle = this.options.axisLineColor.toRGBString();
367
- context.lineWidth = this.options.axisLineWidth;
368
-
369
-
370
- if (this.options.drawYAxis) {
371
- if (this.layout.yticks) {
372
- var drawTick = function(tick) {
373
- if (typeof(tick) == "function") return;
374
- var x = this.area.x;
375
- var y = this.area.y + tick[0] * this.area.h;
376
- context.beginPath();
377
- context.moveTo(x, y);
378
- context.lineTo(x - this.options.axisTickSize, y);
379
- context.closePath();
380
- context.stroke();
381
-
382
- var label = DIV(labelStyle, tick[1]);
383
- label.style.top = (y - this.options.axisLabelFontSize) + "px";
384
- label.style.left = (x - this.options.padding.left - this.options.axisTickSize) + "px";
385
- label.style.textAlign = "right";
386
- label.style.width = (this.options.padding.left - this.options.axisTickSize * 2) + "px";
387
- MochiKit.DOM.appendChildNodes(this.container, label);
388
- this.ylabels.push(label);
389
- };
390
-
391
- MochiKit.Iter.forEach(this.layout.yticks, bind(drawTick, this));
392
- }
393
-
394
- context.beginPath();
395
- context.moveTo(this.area.x, this.area.y);
396
- context.lineTo(this.area.x, this.area.y + this.area.h);
397
- context.closePath();
398
- context.stroke();
399
- }
400
-
401
- if (this.options.drawXAxis) {
402
- if (this.layout.xticks) {
403
- var drawTick = function(tick) {
404
- if (typeof(dataset) == "function") return;
405
-
406
- var x = this.area.x + tick[0] * this.area.w;
407
- var y = this.area.y + this.area.h;
408
- context.beginPath();
409
- context.moveTo(x, y);
410
- context.lineTo(x, y + this.options.axisTickSize);
411
- context.closePath();
412
- context.stroke();
413
-
414
- var label = DIV(labelStyle, tick[1]);
415
- label.style.top = (y + this.options.axisTickSize) + "px";
416
- label.style.left = (x - this.options.axisLabelWidth/2) + "px";
417
- label.style.textAlign = "center";
418
- label.style.width = this.options.axisLabelWidth + "px";
419
- MochiKit.DOM.appendChildNodes(this.container, label);
420
- this.xlabels.push(label);
421
- };
422
-
423
- MochiKit.Iter.forEach(this.layout.xticks, bind(drawTick, this));
424
- }
425
-
426
- context.beginPath();
427
- context.moveTo(this.area.x, this.area.y + this.area.h);
428
- context.lineTo(this.area.x + this.area.w, this.area.y + this.area.h);
429
- context.closePath();
430
- context.stroke();
431
- }
432
-
433
- context.restore();
434
-
435
- };
436
-
437
- PlotKit.CanvasRenderer.prototype._renderPieAxis = function() {
438
- if (!this.options.drawXAxis)
439
- return;
440
-
441
- if (this.layout.xticks) {
442
- // make a lookup dict for x->slice values
443
- var lookup = new Array();
444
- for (var i = 0; i < this.layout.slices.length; i++) {
445
- lookup[this.layout.slices[i].xval] = this.layout.slices[i];
446
- }
447
-
448
- var centerx = this.area.x + this.area.w * 0.5;
449
- var centery = this.area.y + this.area.h * 0.5;
450
- var radius = Math.min(this.area.w * this.options.pieRadius,
451
- this.area.h * this.options.pieRadius);
452
- var labelWidth = this.options.axisLabelWidth;
453
-
454
- for (var i = 0; i < this.layout.xticks.length; i++) {
455
- var slice = lookup[this.layout.xticks[i][0]];
456
- if (MochiKit.Base.isUndefinedOrNull(slice))
457
- continue;
458
-
459
-
460
- var angle = (slice.startAngle + slice.endAngle)/2;
461
- // normalize the angle
462
- var normalisedAngle = angle;
463
- if (normalisedAngle > Math.PI * 2)
464
- normalisedAngle = normalisedAngle - Math.PI * 2;
465
- else if (normalisedAngle < 0)
466
- normalisedAngle = normalisedAngle + Math.PI * 2;
467
-
468
- var labelx = centerx + Math.sin(normalisedAngle) * (radius + 10);
469
- var labely = centery - Math.cos(normalisedAngle) * (radius + 10);
470
-
471
- var attrib = {"position": "absolute",
472
- "zIndex": 11,
473
- "width": labelWidth + "px",
474
- "fontSize": this.options.axisLabelFontSize + "px",
475
- "overflow": "hidden",
476
- "color": this.options.axisLabelColor.toHexString()
477
- };
478
-
479
- if (normalisedAngle <= Math.PI * 0.5) {
480
- // text on top and align left
481
- attrib["textAlign"] = "left";
482
- attrib["verticalAlign"] = "top";
483
- attrib["left"] = labelx + "px";
484
- attrib["top"] = (labely - this.options.axisLabelFontSize) + "px";
485
- }
486
- else if ((normalisedAngle > Math.PI * 0.5) && (normalisedAngle <= Math.PI)) {
487
- // text on bottom and align left
488
- attrib["textAlign"] = "left";
489
- attrib["verticalAlign"] = "bottom";
490
- attrib["left"] = labelx + "px";
491
- attrib["top"] = labely + "px";
492
-
493
- }
494
- else if ((normalisedAngle > Math.PI) && (normalisedAngle <= Math.PI*1.5)) {
495
- // text on bottom and align right
496
- attrib["textAlign"] = "right";
497
- attrib["verticalAlign"] = "bottom";
498
- attrib["left"] = (labelx - labelWidth) + "px";
499
- attrib["top"] = labely + "px";
500
- }
501
- else {
502
- // text on top and align right
503
- attrib["textAlign"] = "right";
504
- attrib["verticalAlign"] = "bottom";
505
- attrib["left"] = (labelx - labelWidth) + "px";
506
- attrib["top"] = (labely - this.options.axisLabelFontSize) + "px";
507
- }
508
-
509
- var label = DIV({'style': attrib}, this.layout.xticks[i][1]);
510
- this.xlabels.push(label);
511
- MochiKit.DOM.appendChildNodes(this.container, label);
512
- }
513
-
514
- }
515
- };
516
-
517
- PlotKit.CanvasRenderer.prototype._renderBackground = function() {
518
- var context = this.element.getContext("2d");
519
- context.save();
520
- context.fillStyle = this.options.backgroundColor.toRGBString();
521
- context.fillRect(0, 0, this.width, this.height);
522
- context.restore();
523
- };
524
-
525
- PlotKit.CanvasRenderer.prototype.clear = function() {
526
- if (this.isIE) {
527
- // VML takes a while to start up, so we just poll every this.IEDelay
528
- try {
529
- if (this.clearDelay) {
530
- this.clearDelay.cancel();
531
- this.clearDelay = null;
532
- }
533
- var context = this.element.getContext("2d");
534
- }
535
- catch (e) {
536
- this.isFirstRender = false;
537
- this.clearDelay = MochiKit.Async.wait(this.IEDelay);
538
- this.clearDelay.addCallback(bind(this.clear, this));
539
- return;
540
- }
541
- }
542
-
543
- var context = this.element.getContext("2d");
544
- context.clearRect(0, 0, this.width, this.height);
545
-
546
- MochiKit.Iter.forEach(this.xlabels, MochiKit.DOM.removeElement);
547
- MochiKit.Iter.forEach(this.ylabels, MochiKit.DOM.removeElement);
548
- this.xlabels = new Array();
549
- this.ylabels = new Array();
550
- };
551
-
552
- // ----------------------------------------------------------------
553
- // Everything below here is experimental and undocumented.
554
- // ----------------------------------------------------------------
555
-
556
- PlotKit.CanvasRenderer.prototype._initialiseEvents = function() {
557
- var connect = MochiKit.Signal.connect;
558
- var bind = MochiKit.Base.bind;
559
- //MochiKit.Signal.registerSignals(this, ['onmouseover', 'onclick', 'onmouseout', 'onmousemove']);
560
- //connect(this.element, 'onmouseover', bind(this.onmouseover, this));
561
- //connect(this.element, 'onmouseout', bind(this.onmouseout, this));
562
- //connect(this.element, 'onmousemove', bind(this.onmousemove, this));
563
- connect(this.element, 'onclick', bind(this.onclick, this));
564
- };
565
-
566
- PlotKit.CanvasRenderer.prototype._resolveObject = function(e) {
567
- // does not work in firefox
568
- //var x = (e.event().offsetX - this.area.x) / this.area.w;
569
- //var y = (e.event().offsetY - this.area.y) / this.area.h;
570
-
571
- var x = (e.mouse().page.x - PlotKit.Base.findPosX(this.element) - this.area.x) / this.area.w;
572
- var y = (e.mouse().page.y - PlotKit.Base.findPosY(this.element) - this.area.y) / this.area.h;
573
-
574
- //log(x, y);
575
-
576
- var isHit = this.layout.hitTest(x, y);
577
- if (isHit)
578
- return isHit;
579
- return null;
580
- };
581
-
582
- PlotKit.CanvasRenderer.prototype._createEventObject = function(layoutObj, e) {
583
- if (layoutObj == null) {
584
- return null;
585
- }
586
-
587
- e.chart = layoutObj
588
- return e;
589
- };
590
-
591
-
592
- PlotKit.CanvasRenderer.prototype.onclick = function(e) {
593
- var layoutObject = this._resolveObject(e);
594
- var eventObject = this._createEventObject(layoutObject, e);
595
- if (eventObject != null)
596
- MochiKit.Signal.signal(this, "onclick", eventObject);
597
- };
598
-
599
- PlotKit.CanvasRenderer.prototype.onmouseover = function(e) {
600
- var layoutObject = this._resolveObject(e);
601
- var eventObject = this._createEventObject(layoutObject, e);
602
- if (eventObject != null)
603
- signal(this, "onmouseover", eventObject);
604
- };
605
-
606
- PlotKit.CanvasRenderer.prototype.onmouseout = function(e) {
607
- var layoutObject = this._resolveObject(e);
608
- var eventObject = this._createEventObject(layoutObject, e);
609
- if (eventObject == null)
610
- signal(this, "onmouseout", e);
611
- else
612
- signal(this, "onmouseout", eventObject);
613
-
614
- };
615
-
616
- PlotKit.CanvasRenderer.prototype.onmousemove = function(e) {
617
- var layoutObject = this._resolveObject(e);
618
- var eventObject = this._createEventObject(layoutObject, e);
619
-
620
- if ((layoutObject == null) && (this.event_isinside == null)) {
621
- // TODO: should we emit an event anyway?
622
- return;
623
- }
624
-
625
- if ((layoutObject != null) && (this.event_isinside == null))
626
- signal(this, "onmouseover", eventObject);
627
-
628
- if ((layoutObject == null) && (this.event_isinside != null))
629
- signal(this, "onmouseout", eventObject);
630
-
631
- if ((layoutObject != null) && (this.event_isinside != null))
632
- signal(this, "onmousemove", eventObject);
633
-
634
- this.event_isinside = layoutObject;
635
- //log("move", x, y);
636
- };
637
-
638
- PlotKit.CanvasRenderer.isSupported = function(canvasName) {
639
- var canvas = null;
640
- try {
641
- if (MochiKit.Base.isUndefinedOrNull(canvasName))
642
- canvas = MochiKit.DOM.CANVAS({});
643
- else
644
- canvas = MochiKit.DOM.getElement(canvasName);
645
- var context = canvas.getContext("2d");
646
- }
647
- catch (e) {
648
- var ie = navigator.appVersion.match(/MSIE (\d\.\d)/);
649
- var opera = (navigator.userAgent.toLowerCase().indexOf("opera") != -1);
650
- if ((!ie) || (ie[1] < 6) || (opera))
651
- return false;
652
- return true;
653
- }
654
- return true;
655
- };
656
-
657
- // Namespace Iniitialisation
658
-
659
- PlotKit.Canvas = {}
660
- PlotKit.Canvas.CanvasRenderer = PlotKit.CanvasRenderer;
661
-
662
- PlotKit.Canvas.EXPORT = [
663
- "CanvasRenderer"
664
- ];
665
-
666
- PlotKit.Canvas.EXPORT_OK = [
667
- "CanvasRenderer"
668
- ];
669
-
670
- PlotKit.Canvas.__new__ = function() {
671
- var m = MochiKit.Base;
672
-
673
- m.nameFunctions(this);
674
-
675
- this.EXPORT_TAGS = {
676
- ":common": this.EXPORT,
677
- ":all": m.concat(this.EXPORT, this.EXPORT_OK)
678
- };
679
- };
680
-
681
- PlotKit.Canvas.__new__();
682
- MochiKit.Base._exportSymbols(this, PlotKit.Canvas);
683
-