alchemy 1.0.2 → 8.4.4

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 (232) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +24 -17
  3. data/README.md +538 -4
  4. data/lib/alchemy.rb +3 -6
  5. metadata +61 -266
  6. data/Rakefile +0 -21
  7. data/app/assets/fonts/alchemy/LiberationSans-Bold-webfont.eot +0 -0
  8. data/app/assets/fonts/alchemy/LiberationSans-Bold-webfont.svg +0 -154
  9. data/app/assets/fonts/alchemy/LiberationSans-Bold-webfont.ttf +0 -0
  10. data/app/assets/fonts/alchemy/LiberationSans-Bold-webfont.woff +0 -0
  11. data/app/assets/fonts/alchemy/LiberationSans-BoldItalic-webfont.eot +0 -0
  12. data/app/assets/fonts/alchemy/LiberationSans-BoldItalic-webfont.svg +0 -154
  13. data/app/assets/fonts/alchemy/LiberationSans-BoldItalic-webfont.ttf +0 -0
  14. data/app/assets/fonts/alchemy/LiberationSans-BoldItalic-webfont.woff +0 -0
  15. data/app/assets/fonts/alchemy/LiberationSans-Italic-webfont.eot +0 -0
  16. data/app/assets/fonts/alchemy/LiberationSans-Italic-webfont.svg +0 -154
  17. data/app/assets/fonts/alchemy/LiberationSans-Italic-webfont.ttf +0 -0
  18. data/app/assets/fonts/alchemy/LiberationSans-Italic-webfont.woff +0 -0
  19. data/app/assets/fonts/alchemy/LiberationSans-Regular-webfont.eot +0 -0
  20. data/app/assets/fonts/alchemy/LiberationSans-Regular-webfont.svg +0 -154
  21. data/app/assets/fonts/alchemy/LiberationSans-Regular-webfont.ttf +0 -0
  22. data/app/assets/fonts/alchemy/LiberationSans-Regular-webfont.woff +0 -0
  23. data/app/assets/fonts/alchemy/Red Hat Liberation License.txt +0 -78
  24. data/app/assets/fonts/alchemy/overpass_bold-web.eot +0 -0
  25. data/app/assets/fonts/alchemy/overpass_bold-web.svg +0 -470
  26. data/app/assets/fonts/alchemy/overpass_bold-web.ttf +0 -0
  27. data/app/assets/fonts/alchemy/overpass_bold-web.woff +0 -0
  28. data/app/assets/fonts/alchemy/overpass_regular-web.eot +0 -0
  29. data/app/assets/fonts/alchemy/overpass_regular-web.svg +0 -470
  30. data/app/assets/fonts/alchemy/overpass_regular-web.ttf +0 -0
  31. data/app/assets/fonts/alchemy/overpass_regular-web.woff +0 -0
  32. data/app/assets/images/alchemy/icons/action-icons.png +0 -0
  33. data/app/assets/images/alchemy/icons/arrow_icon.png +0 -0
  34. data/app/assets/images/alchemy/icons/chosen-sprite.png +0 -0
  35. data/app/assets/images/alchemy/icons/error_icon.png +0 -0
  36. data/app/assets/images/alchemy/icons/objects.png +0 -0
  37. data/app/assets/images/alchemy/icons/spinner.gif +0 -0
  38. data/app/assets/images/alchemy/icons/spinner_head.gif +0 -0
  39. data/app/assets/images/alchemy/icons/success_icon.png +0 -0
  40. data/app/assets/images/alchemy/icons/warning_icon.png +0 -0
  41. data/app/assets/javascripts/alchemy/flash_messages.js +0 -12
  42. data/app/assets/javascripts/alchemy/forms.js +0 -25
  43. data/app/assets/javascripts/alchemy/i18n.js +0 -36
  44. data/app/assets/javascripts/alchemy/login.js +0 -130
  45. data/app/assets/javascripts/alchemy/password.js +0 -99
  46. data/app/assets/stylesheets/alchemy/components/_chosen.scss +0 -423
  47. data/app/assets/stylesheets/alchemy/components/_content.scss +0 -58
  48. data/app/assets/stylesheets/alchemy/components/_helpers.scss +0 -38
  49. data/app/assets/stylesheets/alchemy/components/_media.scss +0 -49
  50. data/app/assets/stylesheets/alchemy/components/_media_object.scss +0 -22
  51. data/app/assets/stylesheets/alchemy/components/_normalize.scss +0 -448
  52. data/app/assets/stylesheets/alchemy/components/_shared.scss +0 -18
  53. data/app/assets/stylesheets/alchemy/components/buttons/_buttons.scss +0 -241
  54. data/app/assets/stylesheets/alchemy/components/buttons/_buttons_vars.scss +0 -10
  55. data/app/assets/stylesheets/alchemy/components/flash_messages/_flash_messages.scss +0 -93
  56. data/app/assets/stylesheets/alchemy/components/flash_messages/_flash_messages_vars.scss +0 -3
  57. data/app/assets/stylesheets/alchemy/components/fonts/_liberation.scss +0 -44
  58. data/app/assets/stylesheets/alchemy/components/fonts/_overpass.scss +0 -24
  59. data/app/assets/stylesheets/alchemy/components/footer/_footer.scss +0 -53
  60. data/app/assets/stylesheets/alchemy/components/footer/_footer_vars.scss +0 -4
  61. data/app/assets/stylesheets/alchemy/components/forms/_forms.scss +0 -536
  62. data/app/assets/stylesheets/alchemy/components/forms/_forms_ie.scss +0 -45
  63. data/app/assets/stylesheets/alchemy/components/forms/_forms_mixins.scss +0 -18
  64. data/app/assets/stylesheets/alchemy/components/forms/_forms_responsive.scss +0 -161
  65. data/app/assets/stylesheets/alchemy/components/forms/_forms_vars.scss +0 -25
  66. data/app/assets/stylesheets/alchemy/components/header/_header.scss +0 -214
  67. data/app/assets/stylesheets/alchemy/components/header/_header_vars.scss +0 -11
  68. data/app/assets/stylesheets/alchemy/components/login/_login.scss +0 -169
  69. data/app/assets/stylesheets/alchemy/components/login/_login_mixins.scss +0 -7
  70. data/app/assets/stylesheets/alchemy/components/login/_login_vars.scss +0 -19
  71. data/app/assets/stylesheets/alchemy/components/sprites/_sprites.scss +0 -110
  72. data/app/assets/stylesheets/alchemy/components/sprites/_sprites_mixins.scss +0 -9
  73. data/app/assets/stylesheets/alchemy/components/text/_text.scss +0 -30
  74. data/app/assets/stylesheets/alchemy/components/text/_text_vars.scss +0 -1
  75. data/app/assets/stylesheets/alchemy/composites/content_elements.scss +0 -6
  76. data/app/assets/stylesheets/alchemy/composites/login.scss +0 -9
  77. data/app/assets/stylesheets/alchemy/composites/shell.scss +0 -4
  78. data/app/assets/stylesheets/alchemy/partials/_base.scss +0 -8
  79. data/app/assets/stylesheets/alchemy/partials/_colors.scss +0 -99
  80. data/app/assets/stylesheets/alchemy/partials/_mixins.scss +0 -24
  81. data/app/assets/stylesheets/alchemy/partials/_vars.scss +0 -31
  82. data/app/helpers/alchemy/gettext_translations.rb +0 -28
  83. data/app/helpers/alchemy/layout_helper.rb +0 -19
  84. data/app/helpers/alchemy/rails_translations.rb +0 -21
  85. data/app/helpers/alchemy/translation_helper.rb +0 -19
  86. data/app/views/alchemy/layouts/_change_password_layout.html.haml +0 -20
  87. data/app/views/alchemy/layouts/_common_i18n.haml +0 -4
  88. data/app/views/alchemy/layouts/_header_layout.haml +0 -13
  89. data/app/views/alchemy/layouts/_login_layout.html.haml +0 -58
  90. data/app/views/alchemy/layouts/_user_session_layout.haml +0 -17
  91. data/app/views/alchemy/layouts/base.html.haml +0 -20
  92. data/app/views/alchemy/layouts/shell_layout.haml +0 -10
  93. data/lib/alchemy/version.rb +0 -3
  94. data/test/alchemy_test.rb +0 -7
  95. data/test/test_helper.rb +0 -9
  96. data/vendor/assets/javascripts/alchemy/html5shiv.js +0 -298
  97. data/vendor/assets/javascripts/alchemy/jquery/jquery-1.6.2.js +0 -8981
  98. data/vendor/assets/javascripts/alchemy/jquery/plugins/chosen.jquery.js +0 -1003
  99. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/API.txt +0 -1201
  100. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/FAQ.txt +0 -76
  101. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/LICENSE.txt +0 -22
  102. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/Makefile +0 -9
  103. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/NEWS.txt +0 -508
  104. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/PLUGINS.txt +0 -137
  105. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/README.txt +0 -90
  106. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/examples/ajax.html +0 -143
  107. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/examples/annotating.html +0 -75
  108. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/examples/arrow-down.gif +0 -0
  109. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/examples/arrow-left.gif +0 -0
  110. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/examples/arrow-right.gif +0 -0
  111. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/examples/arrow-up.gif +0 -0
  112. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/examples/basic.html +0 -38
  113. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/examples/data-eu-gdp-growth-1.json +0 -4
  114. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/examples/data-eu-gdp-growth-2.json +0 -4
  115. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/examples/data-eu-gdp-growth-3.json +0 -4
  116. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/examples/data-eu-gdp-growth-4.json +0 -4
  117. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/examples/data-eu-gdp-growth-5.json +0 -4
  118. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/examples/data-eu-gdp-growth.json +0 -4
  119. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/examples/data-japan-gdp-growth.json +0 -4
  120. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/examples/data-usa-gdp-growth.json +0 -4
  121. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/examples/graph-types.html +0 -75
  122. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/examples/hs-2004-27-a-large_web.jpg +0 -0
  123. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/examples/image.html +0 -45
  124. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/examples/index.html +0 -44
  125. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/examples/interacting-axes.html +0 -97
  126. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/examples/interacting.html +0 -93
  127. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/examples/layout.css +0 -6
  128. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/examples/multiple-axes.html +0 -60
  129. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/examples/navigate.html +0 -118
  130. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/examples/percentiles.html +0 -57
  131. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/examples/pie.html +0 -756
  132. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/examples/realtime.html +0 -83
  133. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/examples/resize.html +0 -61
  134. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/examples/selection.html +0 -114
  135. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/examples/setting-options.html +0 -61
  136. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/examples/stacking.html +0 -77
  137. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/examples/symbols.html +0 -49
  138. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/examples/thresholding.html +0 -54
  139. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/examples/time.html +0 -71
  140. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/examples/tracking.html +0 -95
  141. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/examples/turning-series.html +0 -98
  142. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/examples/visitors.html +0 -90
  143. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/examples/zooming.html +0 -98
  144. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/excanvas.js +0 -1427
  145. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/excanvas.min.js +0 -1
  146. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.colorhelpers.js +0 -179
  147. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.colorhelpers.min.js +0 -1
  148. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.crosshair.js +0 -167
  149. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.crosshair.min.js +0 -1
  150. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.fillbetween.js +0 -183
  151. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.fillbetween.min.js +0 -1
  152. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.image.js +0 -238
  153. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.image.min.js +0 -1
  154. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.js +0 -2599
  155. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.min.js +0 -6
  156. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.navigate.js +0 -336
  157. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.navigate.min.js +0 -1
  158. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.pie.js +0 -750
  159. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.pie.min.js +0 -1
  160. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.resize.js +0 -60
  161. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.resize.min.js +0 -1
  162. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.selection.js +0 -344
  163. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.selection.min.js +0 -1
  164. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.stack.js +0 -184
  165. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.stack.min.js +0 -1
  166. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.symbol.js +0 -70
  167. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.symbol.min.js +0 -1
  168. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.threshold.js +0 -103
  169. data/vendor/assets/javascripts/alchemy/jquery/plugins/flot-0.7/jquery.flot.threshold.min.js +0 -1
  170. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/blank.svg +0 -3
  171. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/custom_test.js +0 -67
  172. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/jquery.svg.css +0 -9
  173. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/jquery.svg.js +0 -1101
  174. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/jquery.svg.min.js +0 -7
  175. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/jquery.svg.pack.js +0 -7
  176. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/jquery.svgfilter.js +0 -396
  177. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/jquery.svgfilter.min.js +0 -7
  178. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/jquery.svgfilter.pack.js +0 -7
  179. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/jquery.svggraph.js +0 -1337
  180. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/jquery.svggraph.min.js +0 -7
  181. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/jquery.svggraph.pack.js +0 -7
  182. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/lion.svg +0 -161
  183. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery-svg/test.js +0 -714
  184. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.ajaxfileupload.js +0 -205
  185. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.ba-bbq.js +0 -1137
  186. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.ba-resize.js +0 -246
  187. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.cookie.js +0 -92
  188. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.easing.1.3.js +0 -205
  189. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.fancyqueries.js +0 -106
  190. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.flash.js +0 -288
  191. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.form.js +0 -964
  192. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.hoverIntent.js +0 -106
  193. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.jeditable.ajaxupload.js +0 -62
  194. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.jeditable.js +0 -556
  195. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.jnotify.js +0 -210
  196. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.jscrollpane.js +0 -1390
  197. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.jscrollpane.min.js +0 -11
  198. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.linkHover.js +0 -89
  199. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.loadmask.min.js +0 -10
  200. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.mousewheel.js +0 -78
  201. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.multiselect.filter.js +0 -176
  202. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.multiselect.js +0 -668
  203. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.pack.js +0 -11
  204. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.periodicalupdater.js +0 -175
  205. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.sortElements.js +0 -75
  206. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.sparkline.min.js +0 -94
  207. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.text-overflow.js +0 -60
  208. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.timepickr.js +0 -214
  209. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.timers.js +0 -142
  210. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.tipsy.js +0 -358
  211. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.treeTable.js +0 -226
  212. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.trunk8.js +0 -203
  213. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.ui.multiselect.js +0 -338
  214. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.ui.totop.js +0 -58
  215. data/vendor/assets/javascripts/alchemy/jquery/plugins/jquery.uitablefilter.js +0 -95
  216. data/vendor/assets/javascripts/alchemy/jquery/plugins/ui.spinner.js +0 -683
  217. data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/css/custom-theme/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  218. data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/css/custom-theme/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  219. data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/css/custom-theme/images/ui-bg_highlight-hard_75_dadada_1x100.png +0 -0
  220. data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/css/custom-theme/images/ui-bg_highlight-hard_75_e6e6e6_1x100.png +0 -0
  221. data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/css/custom-theme/images/ui-bg_highlight-hard_95_ffffff_1x100.png +0 -0
  222. data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/css/custom-theme/images/ui-bg_highlight-soft_80_e0e0e0_1x100.png +0 -0
  223. data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/css/custom-theme/images/ui-bg_inset-hard_65_ffffff_1x100.png +0 -0
  224. data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/css/custom-theme/images/ui-bg_inset-soft_95_fef1ec_1x100.png +0 -0
  225. data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/css/custom-theme/images/ui-icons_8f8f8f_256x240.png +0 -0
  226. data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/css/custom-theme/images/ui-icons_97baed_256x240.png +0 -0
  227. data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/css/custom-theme/images/ui-icons_cd0a0a_256x240.png +0 -0
  228. data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/css/custom-theme/jquery-ui-1.8.11.custom.css +0 -573
  229. data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/js/jquery-1.5.1.min.js +0 -16
  230. data/vendor/assets/javascripts/alchemy/jquery-ui-1.8.11.custom/js/jquery-ui-1.8.11.custom.min.js +0 -783
  231. data/vendor/assets/javascripts/alchemy/rails.js +0 -331
  232. data/vendor/assets/javascripts/alchemy/underscore-1.3.1.js +0 -999
@@ -1,750 +0,0 @@
1
- /*
2
- Flot plugin for rendering pie charts. The plugin assumes the data is
3
- coming is as a single data value for each series, and each of those
4
- values is a positive value or zero (negative numbers don't make
5
- any sense and will cause strange effects). The data values do
6
- NOT need to be passed in as percentage values because it
7
- internally calculates the total and percentages.
8
-
9
- * Created by Brian Medendorp, June 2009
10
- * Updated November 2009 with contributions from: btburnett3, Anthony Aragues and Xavi Ivars
11
-
12
- * Changes:
13
- 2009-10-22: lineJoin set to round
14
- 2009-10-23: IE full circle fix, donut
15
- 2009-11-11: Added basic hover from btburnett3 - does not work in IE, and center is off in Chrome and Opera
16
- 2009-11-17: Added IE hover capability submitted by Anthony Aragues
17
- 2009-11-18: Added bug fix submitted by Xavi Ivars (issues with arrays when other JS libraries are included as well)
18
-
19
-
20
- Available options are:
21
- series: {
22
- pie: {
23
- show: true/false
24
- radius: 0-1 for percentage of fullsize, or a specified pixel length, or 'auto'
25
- innerRadius: 0-1 for percentage of fullsize or a specified pixel length, for creating a donut effect
26
- startAngle: 0-2 factor of PI used for starting angle (in radians) i.e 3/2 starts at the top, 0 and 2 have the same result
27
- tilt: 0-1 for percentage to tilt the pie, where 1 is no tilt, and 0 is completely flat (nothing will show)
28
- offset: {
29
- top: integer value to move the pie up or down
30
- left: integer value to move the pie left or right, or 'auto'
31
- },
32
- stroke: {
33
- color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#FFF')
34
- width: integer pixel width of the stroke
35
- },
36
- label: {
37
- show: true/false, or 'auto'
38
- formatter: a user-defined function that modifies the text/style of the label text
39
- radius: 0-1 for percentage of fullsize, or a specified pixel length
40
- background: {
41
- color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#000')
42
- opacity: 0-1
43
- },
44
- threshold: 0-1 for the percentage value at which to hide labels (if they're too small)
45
- },
46
- combine: {
47
- threshold: 0-1 for the percentage value at which to combine slices (if they're too small)
48
- color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#CCC'), if null, the plugin will automatically use the color of the first slice to be combined
49
- label: any text value of what the combined slice should be labeled
50
- }
51
- highlight: {
52
- opacity: 0-1
53
- }
54
- }
55
- }
56
-
57
- More detail and specific examples can be found in the included HTML file.
58
-
59
- */
60
-
61
- (function ($)
62
- {
63
- function init(plot) // this is the "body" of the plugin
64
- {
65
- var canvas = null;
66
- var target = null;
67
- var maxRadius = null;
68
- var centerLeft = null;
69
- var centerTop = null;
70
- var total = 0;
71
- var redraw = true;
72
- var redrawAttempts = 10;
73
- var shrink = 0.95;
74
- var legendWidth = 0;
75
- var processed = false;
76
- var raw = false;
77
-
78
- // interactive variables
79
- var highlights = [];
80
-
81
- // add hook to determine if pie plugin in enabled, and then perform necessary operations
82
- plot.hooks.processOptions.push(checkPieEnabled);
83
- plot.hooks.bindEvents.push(bindEvents);
84
-
85
- // check to see if the pie plugin is enabled
86
- function checkPieEnabled(plot, options)
87
- {
88
- if (options.series.pie.show)
89
- {
90
- //disable grid
91
- options.grid.show = false;
92
-
93
- // set labels.show
94
- if (options.series.pie.label.show=='auto')
95
- if (options.legend.show)
96
- options.series.pie.label.show = false;
97
- else
98
- options.series.pie.label.show = true;
99
-
100
- // set radius
101
- if (options.series.pie.radius=='auto')
102
- if (options.series.pie.label.show)
103
- options.series.pie.radius = 3/4;
104
- else
105
- options.series.pie.radius = 1;
106
-
107
- // ensure sane tilt
108
- if (options.series.pie.tilt>1)
109
- options.series.pie.tilt=1;
110
- if (options.series.pie.tilt<0)
111
- options.series.pie.tilt=0;
112
-
113
- // add processData hook to do transformations on the data
114
- plot.hooks.processDatapoints.push(processDatapoints);
115
- plot.hooks.drawOverlay.push(drawOverlay);
116
-
117
- // add draw hook
118
- plot.hooks.draw.push(draw);
119
- }
120
- }
121
-
122
- // bind hoverable events
123
- function bindEvents(plot, eventHolder)
124
- {
125
- var options = plot.getOptions();
126
-
127
- if (options.series.pie.show && options.grid.hoverable)
128
- eventHolder.unbind('mousemove').mousemove(onMouseMove);
129
-
130
- if (options.series.pie.show && options.grid.clickable)
131
- eventHolder.unbind('click').click(onClick);
132
- }
133
-
134
-
135
- // debugging function that prints out an object
136
- function alertObject(obj)
137
- {
138
- var msg = '';
139
- function traverse(obj, depth)
140
- {
141
- if (!depth)
142
- depth = 0;
143
- for (var i = 0; i < obj.length; ++i)
144
- {
145
- for (var j=0; j<depth; j++)
146
- msg += '\t';
147
-
148
- if( typeof obj[i] == "object")
149
- { // its an object
150
- msg += ''+i+':\n';
151
- traverse(obj[i], depth+1);
152
- }
153
- else
154
- { // its a value
155
- msg += ''+i+': '+obj[i]+'\n';
156
- }
157
- }
158
- }
159
- traverse(obj);
160
- alert(msg);
161
- }
162
-
163
- function calcTotal(data)
164
- {
165
- for (var i = 0; i < data.length; ++i)
166
- {
167
- var item = parseFloat(data[i].data[0][1]);
168
- if (item)
169
- total += item;
170
- }
171
- }
172
-
173
- function processDatapoints(plot, series, data, datapoints)
174
- {
175
- if (!processed)
176
- {
177
- processed = true;
178
-
179
- canvas = plot.getCanvas();
180
- target = $(canvas).parent();
181
- options = plot.getOptions();
182
-
183
- plot.setData(combine(plot.getData()));
184
- }
185
- }
186
-
187
- function setupPie()
188
- {
189
- legendWidth = target.children().filter('.legend').children().width();
190
-
191
- // calculate maximum radius and center point
192
- maxRadius = Math.min(canvas.width,(canvas.height/options.series.pie.tilt))/2;
193
- centerTop = (canvas.height/2)+options.series.pie.offset.top;
194
- centerLeft = (canvas.width/2);
195
-
196
- if (options.series.pie.offset.left=='auto')
197
- if (options.legend.position.match('w'))
198
- centerLeft += legendWidth/2;
199
- else
200
- centerLeft -= legendWidth/2;
201
- else
202
- centerLeft += options.series.pie.offset.left;
203
-
204
- if (centerLeft<maxRadius)
205
- centerLeft = maxRadius;
206
- else if (centerLeft>canvas.width-maxRadius)
207
- centerLeft = canvas.width-maxRadius;
208
- }
209
-
210
- function fixData(data)
211
- {
212
- for (var i = 0; i < data.length; ++i)
213
- {
214
- if (typeof(data[i].data)=='number')
215
- data[i].data = [[1,data[i].data]];
216
- else if (typeof(data[i].data)=='undefined' || typeof(data[i].data[0])=='undefined')
217
- {
218
- if (typeof(data[i].data)!='undefined' && typeof(data[i].data.label)!='undefined')
219
- data[i].label = data[i].data.label; // fix weirdness coming from flot
220
- data[i].data = [[1,0]];
221
-
222
- }
223
- }
224
- return data;
225
- }
226
-
227
- function combine(data)
228
- {
229
- data = fixData(data);
230
- calcTotal(data);
231
- var combined = 0;
232
- var numCombined = 0;
233
- var color = options.series.pie.combine.color;
234
-
235
- var newdata = [];
236
- for (var i = 0; i < data.length; ++i)
237
- {
238
- // make sure its a number
239
- data[i].data[0][1] = parseFloat(data[i].data[0][1]);
240
- if (!data[i].data[0][1])
241
- data[i].data[0][1] = 0;
242
-
243
- if (data[i].data[0][1]/total<=options.series.pie.combine.threshold)
244
- {
245
- combined += data[i].data[0][1];
246
- numCombined++;
247
- if (!color)
248
- color = data[i].color;
249
- }
250
- else
251
- {
252
- newdata.push({
253
- data: [[1,data[i].data[0][1]]],
254
- color: data[i].color,
255
- label: data[i].label,
256
- angle: (data[i].data[0][1]*(Math.PI*2))/total,
257
- percent: (data[i].data[0][1]/total*100)
258
- });
259
- }
260
- }
261
- if (numCombined>0)
262
- newdata.push({
263
- data: [[1,combined]],
264
- color: color,
265
- label: options.series.pie.combine.label,
266
- angle: (combined*(Math.PI*2))/total,
267
- percent: (combined/total*100)
268
- });
269
- return newdata;
270
- }
271
-
272
- function draw(plot, newCtx)
273
- {
274
- if (!target) return; // if no series were passed
275
- ctx = newCtx;
276
-
277
- setupPie();
278
- var slices = plot.getData();
279
-
280
- var attempts = 0;
281
- while (redraw && attempts<redrawAttempts)
282
- {
283
- redraw = false;
284
- if (attempts>0)
285
- maxRadius *= shrink;
286
- attempts += 1;
287
- clear();
288
- if (options.series.pie.tilt<=0.8)
289
- drawShadow();
290
- drawPie();
291
- }
292
- if (attempts >= redrawAttempts) {
293
- clear();
294
- target.prepend('<div class="error">Could not draw pie with labels contained inside canvas</div>');
295
- }
296
-
297
- if ( plot.setSeries && plot.insertLegend )
298
- {
299
- plot.setSeries(slices);
300
- plot.insertLegend();
301
- }
302
-
303
- // we're actually done at this point, just defining internal functions at this point
304
-
305
- function clear()
306
- {
307
- ctx.clearRect(0,0,canvas.width,canvas.height);
308
- target.children().filter('.pieLabel, .pieLabelBackground').remove();
309
- }
310
-
311
- function drawShadow()
312
- {
313
- var shadowLeft = 5;
314
- var shadowTop = 15;
315
- var edge = 10;
316
- var alpha = 0.02;
317
-
318
- // set radius
319
- if (options.series.pie.radius>1)
320
- var radius = options.series.pie.radius;
321
- else
322
- var radius = maxRadius * options.series.pie.radius;
323
-
324
- if (radius>=(canvas.width/2)-shadowLeft || radius*options.series.pie.tilt>=(canvas.height/2)-shadowTop || radius<=edge)
325
- return; // shadow would be outside canvas, so don't draw it
326
-
327
- ctx.save();
328
- ctx.translate(shadowLeft,shadowTop);
329
- ctx.globalAlpha = alpha;
330
- ctx.fillStyle = '#000';
331
-
332
- // center and rotate to starting position
333
- ctx.translate(centerLeft,centerTop);
334
- ctx.scale(1, options.series.pie.tilt);
335
-
336
- //radius -= edge;
337
- for (var i=1; i<=edge; i++)
338
- {
339
- ctx.beginPath();
340
- ctx.arc(0,0,radius,0,Math.PI*2,false);
341
- ctx.fill();
342
- radius -= i;
343
- }
344
-
345
- ctx.restore();
346
- }
347
-
348
- function drawPie()
349
- {
350
- startAngle = Math.PI*options.series.pie.startAngle;
351
-
352
- // set radius
353
- if (options.series.pie.radius>1)
354
- var radius = options.series.pie.radius;
355
- else
356
- var radius = maxRadius * options.series.pie.radius;
357
-
358
- // center and rotate to starting position
359
- ctx.save();
360
- ctx.translate(centerLeft,centerTop);
361
- ctx.scale(1, options.series.pie.tilt);
362
- //ctx.rotate(startAngle); // start at top; -- This doesn't work properly in Opera
363
-
364
- // draw slices
365
- ctx.save();
366
- var currentAngle = startAngle;
367
- for (var i = 0; i < slices.length; ++i)
368
- {
369
- slices[i].startAngle = currentAngle;
370
- drawSlice(slices[i].angle, slices[i].color, true);
371
- }
372
- ctx.restore();
373
-
374
- // draw slice outlines
375
- ctx.save();
376
- ctx.lineWidth = options.series.pie.stroke.width;
377
- currentAngle = startAngle;
378
- for (var i = 0; i < slices.length; ++i)
379
- drawSlice(slices[i].angle, options.series.pie.stroke.color, false);
380
- ctx.restore();
381
-
382
- // draw donut hole
383
- drawDonutHole(ctx);
384
-
385
- // draw labels
386
- if (options.series.pie.label.show)
387
- drawLabels();
388
-
389
- // restore to original state
390
- ctx.restore();
391
-
392
- function drawSlice(angle, color, fill)
393
- {
394
- if (angle<=0)
395
- return;
396
-
397
- if (fill)
398
- ctx.fillStyle = color;
399
- else
400
- {
401
- ctx.strokeStyle = color;
402
- ctx.lineJoin = 'round';
403
- }
404
-
405
- ctx.beginPath();
406
- if (Math.abs(angle - Math.PI*2) > 0.000000001)
407
- ctx.moveTo(0,0); // Center of the pie
408
- else if ($.browser.msie)
409
- angle -= 0.0001;
410
- //ctx.arc(0,0,radius,0,angle,false); // This doesn't work properly in Opera
411
- ctx.arc(0,0,radius,currentAngle,currentAngle+angle,false);
412
- ctx.closePath();
413
- //ctx.rotate(angle); // This doesn't work properly in Opera
414
- currentAngle += angle;
415
-
416
- if (fill)
417
- ctx.fill();
418
- else
419
- ctx.stroke();
420
- }
421
-
422
- function drawLabels()
423
- {
424
- var currentAngle = startAngle;
425
-
426
- // set radius
427
- if (options.series.pie.label.radius>1)
428
- var radius = options.series.pie.label.radius;
429
- else
430
- var radius = maxRadius * options.series.pie.label.radius;
431
-
432
- for (var i = 0; i < slices.length; ++i)
433
- {
434
- if (slices[i].percent >= options.series.pie.label.threshold*100)
435
- drawLabel(slices[i], currentAngle, i);
436
- currentAngle += slices[i].angle;
437
- }
438
-
439
- function drawLabel(slice, startAngle, index)
440
- {
441
- if (slice.data[0][1]==0)
442
- return;
443
-
444
- // format label text
445
- var lf = options.legend.labelFormatter, text, plf = options.series.pie.label.formatter;
446
- if (lf)
447
- text = lf(slice.label, slice);
448
- else
449
- text = slice.label;
450
- if (plf)
451
- text = plf(text, slice);
452
-
453
- var halfAngle = ((startAngle+slice.angle) + startAngle)/2;
454
- var x = centerLeft + Math.round(Math.cos(halfAngle) * radius);
455
- var y = centerTop + Math.round(Math.sin(halfAngle) * radius) * options.series.pie.tilt;
456
-
457
- var html = '<span class="pieLabel" id="pieLabel'+index+'" style="position:absolute;top:' + y + 'px;left:' + x + 'px;">' + text + "</span>";
458
- target.append(html);
459
- var label = target.children('#pieLabel'+index);
460
- var labelTop = (y - label.height()/2);
461
- var labelLeft = (x - label.width()/2);
462
- label.css('top', labelTop);
463
- label.css('left', labelLeft);
464
-
465
- // check to make sure that the label is not outside the canvas
466
- if (0-labelTop>0 || 0-labelLeft>0 || canvas.height-(labelTop+label.height())<0 || canvas.width-(labelLeft+label.width())<0)
467
- redraw = true;
468
-
469
- if (options.series.pie.label.background.opacity != 0) {
470
- // put in the transparent background separately to avoid blended labels and label boxes
471
- var c = options.series.pie.label.background.color;
472
- if (c == null) {
473
- c = slice.color;
474
- }
475
- var pos = 'top:'+labelTop+'px;left:'+labelLeft+'px;';
476
- $('<div class="pieLabelBackground" style="position:absolute;width:' + label.width() + 'px;height:' + label.height() + 'px;' + pos +'background-color:' + c + ';"> </div>').insertBefore(label).css('opacity', options.series.pie.label.background.opacity);
477
- }
478
- } // end individual label function
479
- } // end drawLabels function
480
- } // end drawPie function
481
- } // end draw function
482
-
483
- // Placed here because it needs to be accessed from multiple locations
484
- function drawDonutHole(layer)
485
- {
486
- // draw donut hole
487
- if(options.series.pie.innerRadius > 0)
488
- {
489
- // subtract the center
490
- layer.save();
491
- innerRadius = options.series.pie.innerRadius > 1 ? options.series.pie.innerRadius : maxRadius * options.series.pie.innerRadius;
492
- layer.globalCompositeOperation = 'destination-out'; // this does not work with excanvas, but it will fall back to using the stroke color
493
- layer.beginPath();
494
- layer.fillStyle = options.series.pie.stroke.color;
495
- layer.arc(0,0,innerRadius,0,Math.PI*2,false);
496
- layer.fill();
497
- layer.closePath();
498
- layer.restore();
499
-
500
- // add inner stroke
501
- layer.save();
502
- layer.beginPath();
503
- layer.strokeStyle = options.series.pie.stroke.color;
504
- layer.arc(0,0,innerRadius,0,Math.PI*2,false);
505
- layer.stroke();
506
- layer.closePath();
507
- layer.restore();
508
- // TODO: add extra shadow inside hole (with a mask) if the pie is tilted.
509
- }
510
- }
511
-
512
- //-- Additional Interactive related functions --
513
-
514
- function isPointInPoly(poly, pt)
515
- {
516
- for(var c = false, i = -1, l = poly.length, j = l - 1; ++i < l; j = i)
517
- ((poly[i][1] <= pt[1] && pt[1] < poly[j][1]) || (poly[j][1] <= pt[1] && pt[1]< poly[i][1]))
518
- && (pt[0] < (poly[j][0] - poly[i][0]) * (pt[1] - poly[i][1]) / (poly[j][1] - poly[i][1]) + poly[i][0])
519
- && (c = !c);
520
- return c;
521
- }
522
-
523
- function findNearbySlice(mouseX, mouseY)
524
- {
525
- var slices = plot.getData(),
526
- options = plot.getOptions(),
527
- radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;
528
-
529
- for (var i = 0; i < slices.length; ++i)
530
- {
531
- var s = slices[i];
532
-
533
- if(s.pie.show)
534
- {
535
- ctx.save();
536
- ctx.beginPath();
537
- ctx.moveTo(0,0); // Center of the pie
538
- //ctx.scale(1, options.series.pie.tilt); // this actually seems to break everything when here.
539
- ctx.arc(0,0,radius,s.startAngle,s.startAngle+s.angle,false);
540
- ctx.closePath();
541
- x = mouseX-centerLeft;
542
- y = mouseY-centerTop;
543
- if(ctx.isPointInPath)
544
- {
545
- if (ctx.isPointInPath(mouseX-centerLeft, mouseY-centerTop))
546
- {
547
- //alert('found slice!');
548
- ctx.restore();
549
- return {datapoint: [s.percent, s.data], dataIndex: 0, series: s, seriesIndex: i};
550
- }
551
- }
552
- else
553
- {
554
- // excanvas for IE doesn;t support isPointInPath, this is a workaround.
555
- p1X = (radius * Math.cos(s.startAngle));
556
- p1Y = (radius * Math.sin(s.startAngle));
557
- p2X = (radius * Math.cos(s.startAngle+(s.angle/4)));
558
- p2Y = (radius * Math.sin(s.startAngle+(s.angle/4)));
559
- p3X = (radius * Math.cos(s.startAngle+(s.angle/2)));
560
- p3Y = (radius * Math.sin(s.startAngle+(s.angle/2)));
561
- p4X = (radius * Math.cos(s.startAngle+(s.angle/1.5)));
562
- p4Y = (radius * Math.sin(s.startAngle+(s.angle/1.5)));
563
- p5X = (radius * Math.cos(s.startAngle+s.angle));
564
- p5Y = (radius * Math.sin(s.startAngle+s.angle));
565
- arrPoly = [[0,0],[p1X,p1Y],[p2X,p2Y],[p3X,p3Y],[p4X,p4Y],[p5X,p5Y]];
566
- arrPoint = [x,y];
567
- // TODO: perhaps do some mathmatical trickery here with the Y-coordinate to compensate for pie tilt?
568
- if(isPointInPoly(arrPoly, arrPoint))
569
- {
570
- ctx.restore();
571
- return {datapoint: [s.percent, s.data], dataIndex: 0, series: s, seriesIndex: i};
572
- }
573
- }
574
- ctx.restore();
575
- }
576
- }
577
-
578
- return null;
579
- }
580
-
581
- function onMouseMove(e)
582
- {
583
- triggerClickHoverEvent('plothover', e);
584
- }
585
-
586
- function onClick(e)
587
- {
588
- triggerClickHoverEvent('plotclick', e);
589
- }
590
-
591
- // trigger click or hover event (they send the same parameters so we share their code)
592
- function triggerClickHoverEvent(eventname, e)
593
- {
594
- var offset = plot.offset(),
595
- canvasX = parseInt(e.pageX - offset.left),
596
- canvasY = parseInt(e.pageY - offset.top),
597
- item = findNearbySlice(canvasX, canvasY);
598
-
599
- if (options.grid.autoHighlight)
600
- {
601
- // clear auto-highlights
602
- for (var i = 0; i < highlights.length; ++i)
603
- {
604
- var h = highlights[i];
605
- if (h.auto == eventname && !(item && h.series == item.series))
606
- unhighlight(h.series);
607
- }
608
- }
609
-
610
- // highlight the slice
611
- if (item)
612
- highlight(item.series, eventname);
613
-
614
- // trigger any hover bind events
615
- var pos = { pageX: e.pageX, pageY: e.pageY };
616
- target.trigger(eventname, [ pos, item ]);
617
- }
618
-
619
- function highlight(s, auto)
620
- {
621
- if (typeof s == "number")
622
- s = series[s];
623
-
624
- var i = indexOfHighlight(s);
625
- if (i == -1)
626
- {
627
- highlights.push({ series: s, auto: auto });
628
- plot.triggerRedrawOverlay();
629
- }
630
- else if (!auto)
631
- highlights[i].auto = false;
632
- }
633
-
634
- function unhighlight(s)
635
- {
636
- if (s == null)
637
- {
638
- highlights = [];
639
- plot.triggerRedrawOverlay();
640
- }
641
-
642
- if (typeof s == "number")
643
- s = series[s];
644
-
645
- var i = indexOfHighlight(s);
646
- if (i != -1)
647
- {
648
- highlights.splice(i, 1);
649
- plot.triggerRedrawOverlay();
650
- }
651
- }
652
-
653
- function indexOfHighlight(s)
654
- {
655
- for (var i = 0; i < highlights.length; ++i)
656
- {
657
- var h = highlights[i];
658
- if (h.series == s)
659
- return i;
660
- }
661
- return -1;
662
- }
663
-
664
- function drawOverlay(plot, octx)
665
- {
666
- //alert(options.series.pie.radius);
667
- var options = plot.getOptions();
668
- //alert(options.series.pie.radius);
669
-
670
- var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;
671
-
672
- octx.save();
673
- octx.translate(centerLeft, centerTop);
674
- octx.scale(1, options.series.pie.tilt);
675
-
676
- for (i = 0; i < highlights.length; ++i)
677
- drawHighlight(highlights[i].series);
678
-
679
- drawDonutHole(octx);
680
-
681
- octx.restore();
682
-
683
- function drawHighlight(series)
684
- {
685
- if (series.angle < 0) return;
686
-
687
- //octx.fillStyle = parseColor(options.series.pie.highlight.color).scale(null, null, null, options.series.pie.highlight.opacity).toString();
688
- octx.fillStyle = "rgba(255, 255, 255, "+options.series.pie.highlight.opacity+")"; // this is temporary until we have access to parseColor
689
-
690
- octx.beginPath();
691
- if (Math.abs(series.angle - Math.PI*2) > 0.000000001)
692
- octx.moveTo(0,0); // Center of the pie
693
- octx.arc(0,0,radius,series.startAngle,series.startAngle+series.angle,false);
694
- octx.closePath();
695
- octx.fill();
696
- }
697
-
698
- }
699
-
700
- } // end init (plugin body)
701
-
702
- // define pie specific options and their default values
703
- var options = {
704
- series: {
705
- pie: {
706
- show: false,
707
- radius: 'auto', // actual radius of the visible pie (based on full calculated radius if <=1, or hard pixel value)
708
- innerRadius:0, /* for donut */
709
- startAngle: 3/2,
710
- tilt: 1,
711
- offset: {
712
- top: 0,
713
- left: 'auto'
714
- },
715
- stroke: {
716
- color: '#FFF',
717
- width: 1
718
- },
719
- label: {
720
- show: 'auto',
721
- formatter: function(label, slice){
722
- return '<div style="font-size:x-small;text-align:center;padding:2px;color:'+slice.color+';">'+label+'<br/>'+Math.round(slice.percent)+'%</div>';
723
- }, // formatter function
724
- radius: 1, // radius at which to place the labels (based on full calculated radius if <=1, or hard pixel value)
725
- background: {
726
- color: null,
727
- opacity: 0
728
- },
729
- threshold: 0 // percentage at which to hide the label (i.e. the slice is too narrow)
730
- },
731
- combine: {
732
- threshold: -1, // percentage at which to combine little slices into one larger slice
733
- color: null, // color to give the new slice (auto-generated if null)
734
- label: 'Other' // label to give the new slice
735
- },
736
- highlight: {
737
- //color: '#FFF', // will add this functionality once parseColor is available
738
- opacity: 0.5
739
- }
740
- }
741
- }
742
- };
743
-
744
- $.plot.plugins.push({
745
- init: init,
746
- options: options,
747
- name: "pie",
748
- version: "1.0"
749
- });
750
- })(jQuery);