@macallumharvey/first-test-wet 2.0.0 → 3.1.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 (369) hide show
  1. package/dist/WetButton.d.ts +1 -1
  2. package/dist/first-test-wet.cjs.development.js +5 -0
  3. package/dist/first-test-wet.cjs.development.js.map +1 -1
  4. package/dist/first-test-wet.cjs.production.min.js +1 -1
  5. package/dist/first-test-wet.cjs.production.min.js.map +1 -1
  6. package/dist/first-test-wet.esm.js +5 -1
  7. package/dist/first-test-wet.esm.js.map +1 -1
  8. package/dist/index.d.ts +1 -0
  9. package/package.json +1 -1
  10. package/src/WetButton.tsx +1 -1
  11. package/src/WetModal.tsx +1 -0
  12. package/src/index.tsx +1 -0
  13. package/src/theme-wet-boew/assets/favicon-mobile.png +0 -0
  14. package/src/theme-wet-boew/assets/favicon.ico +0 -0
  15. package/src/theme-wet-boew/assets/logo.png +0 -0
  16. package/src/theme-wet-boew/assets/logo.svg +14 -0
  17. package/src/theme-wet-boew/css/ie8-theme.css +17370 -0
  18. package/src/theme-wet-boew/css/ie8-theme.min.css +193 -0
  19. package/src/{wet-boew-cdn-4.0.81.1/js/ie8-wet-boew.js → theme-wet-boew/css/ie8-wet-boew.css} +12 -10
  20. package/src/{wet-boew-cdn-4.0.81.1/js/ie8-wet-boew2.min.js → theme-wet-boew/css/ie8-wet-boew.min.css} +7 -7
  21. package/src/theme-wet-boew/css/theme.css +11357 -0
  22. package/src/theme-wet-boew/css/theme.min.css +6 -0
  23. package/src/{wet-boew-cdn-4.0.81.1/js/ie8-wet-boew2.js → theme-wet-boew/css/wet-boew.css} +12 -10
  24. package/src/{wet-boew-cdn-4.0.81.1/js/ie8-wet-boew.min.js → theme-wet-boew/css/wet-boew.min.css} +6 -7
  25. package/src/theme-wet-boew/payload.json +66 -0
  26. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/assets/mediacontrols.html +32 -33
  27. package/src/wet-boew/assets/sprites_share.png +0 -0
  28. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/noscript.css +112 -112
  29. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/noscript.min.css +5 -5
  30. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/datalist.css +32 -32
  31. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/datepicker.css +47 -47
  32. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/details.css +28 -28
  33. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/mathml.css +16 -16
  34. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/meter.css +24 -24
  35. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/progress.css +8 -8
  36. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/slider.css +229 -229
  37. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/fonts/glyphicons-halflings-regular.svg +287 -287
  38. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/additional-methods.js +1511 -1511
  39. package/src/wet-boew/js/deps/additional-methods.min.js +9 -0
  40. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/geomap-lib.js +3758 -3770
  41. package/src/wet-boew/js/deps/geomap-lib.min.js +1 -0
  42. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/jquery.dataTables.js +15345 -15733
  43. package/src/wet-boew/js/deps/jquery.dataTables.min.js +4 -0
  44. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/jquery.flot.canvas.js +345 -345
  45. package/src/wet-boew/js/deps/jquery.flot.canvas.min.js +1 -0
  46. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/jquery.flot.js +3168 -3168
  47. package/src/wet-boew/js/deps/jquery.flot.min.js +1 -0
  48. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/jquery.flot.orderBars.js +282 -282
  49. package/src/wet-boew/js/deps/jquery.flot.orderBars.min.js +1 -0
  50. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/jquery.flot.pie.js +820 -820
  51. package/src/wet-boew/js/deps/jquery.flot.pie.min.js +1 -0
  52. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/jquery.magnific-popup.js +2060 -2060
  53. package/src/wet-boew/js/deps/jquery.magnific-popup.min.js +4 -0
  54. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/jquery.validate.js +1660 -1660
  55. package/src/wet-boew/js/deps/jquery.validate.min.js +9 -0
  56. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/json-patch.js +314 -314
  57. package/src/wet-boew/js/deps/json-patch.min.js +1 -0
  58. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/jsonpointer.js +349 -349
  59. package/src/wet-boew/js/deps/jsonpointer.min.js +1 -0
  60. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-apollo.js +53 -53
  61. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-basic.js +49 -49
  62. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-clj.js +64 -64
  63. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-css.js +160 -160
  64. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-dart.js +92 -92
  65. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-erlang.js +94 -94
  66. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-go.js +59 -59
  67. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-hs.js +102 -102
  68. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-lasso.js +67 -67
  69. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-lisp.js +95 -95
  70. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-llvm.js +63 -63
  71. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-logtalk.js +50 -50
  72. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-lua.js +60 -60
  73. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-matlab.js +183 -183
  74. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-matlab.min.js +1 -1
  75. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-ml.js +57 -57
  76. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-mumps.js +140 -140
  77. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-n.js +67 -67
  78. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-pascal.js +49 -49
  79. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-proto.js +37 -37
  80. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-r.js +59 -59
  81. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-rd.js +50 -50
  82. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-rust.js +81 -81
  83. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-scala.js +56 -56
  84. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-sql.js +59 -59
  85. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-swift.js +60 -60
  86. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-tcl.js +63 -63
  87. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-tex.js +49 -49
  88. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-vb.js +67 -67
  89. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-vhdl.js +51 -51
  90. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-wiki.js +55 -55
  91. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-xq.js +71 -71
  92. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-yaml.js +45 -45
  93. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/ol.js +1008 -1008
  94. package/src/wet-boew/js/deps/ol.min.js +1 -0
  95. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/prettify.js +1742 -1742
  96. package/src/wet-boew/js/deps/prettify.min.js +1 -0
  97. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/proj4.js +2 -2
  98. package/src/wet-boew/js/deps/proj4.min.js +1 -0
  99. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/run_prettify.js +1998 -1998
  100. package/src/wet-boew/js/deps/run_prettify.min.js +1 -0
  101. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/tableparser.js +2216 -2216
  102. package/src/wet-boew/js/deps/tableparser.min.js +1 -0
  103. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/unorm.js +452 -452
  104. package/src/wet-boew/js/deps/unorm.min.js +1 -0
  105. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/af.js +246 -254
  106. package/src/wet-boew/js/i18n/af.min.js +7 -0
  107. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/ar.js +284 -292
  108. package/src/wet-boew/js/i18n/ar.min.js +7 -0
  109. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/bg.js +284 -292
  110. package/src/wet-boew/js/i18n/bg.min.js +7 -0
  111. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/cs.js +285 -293
  112. package/src/wet-boew/js/i18n/cs.min.js +7 -0
  113. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/de.js +354 -362
  114. package/src/wet-boew/js/i18n/de.min.js +7 -0
  115. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/el.js +284 -292
  116. package/src/wet-boew/js/i18n/el.min.js +7 -0
  117. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/en.js +246 -254
  118. package/src/wet-boew/js/i18n/en.min.js +7 -0
  119. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/es.js +287 -295
  120. package/src/wet-boew/js/i18n/es.min.js +7 -0
  121. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/et.js +282 -290
  122. package/src/wet-boew/js/i18n/et.min.js +7 -0
  123. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/fr.js +313 -321
  124. package/src/wet-boew/js/i18n/fr.min.js +7 -0
  125. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/hi.js +246 -254
  126. package/src/wet-boew/js/i18n/hi.min.js +7 -0
  127. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/hu.js +284 -292
  128. package/src/wet-boew/js/i18n/hu.min.js +7 -0
  129. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/hy.js +246 -254
  130. package/src/wet-boew/js/i18n/hy.min.js +7 -0
  131. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/id.js +283 -291
  132. package/src/wet-boew/js/i18n/id.min.js +7 -0
  133. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/is.js +282 -290
  134. package/src/wet-boew/js/i18n/is.min.js +7 -0
  135. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/it.js +311 -319
  136. package/src/wet-boew/js/i18n/it.min.js +7 -0
  137. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/iu.js +246 -254
  138. package/src/wet-boew/js/i18n/iu.min.js +7 -0
  139. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/ja.js +285 -293
  140. package/src/wet-boew/js/i18n/ja.min.js +7 -0
  141. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/ko.js +284 -292
  142. package/src/wet-boew/js/i18n/ko.min.js +7 -0
  143. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/lt.js +284 -292
  144. package/src/wet-boew/js/i18n/lt.min.js +7 -0
  145. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/lv.js +284 -292
  146. package/src/wet-boew/js/i18n/lv.min.js +7 -0
  147. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/nl.js +318 -326
  148. package/src/wet-boew/js/i18n/nl.min.js +7 -0
  149. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/pl.js +287 -295
  150. package/src/wet-boew/js/i18n/pl.min.js +7 -0
  151. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/pt-BR.js +246 -254
  152. package/src/wet-boew/js/i18n/pt-BR.min.js +7 -0
  153. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/pt.js +270 -278
  154. package/src/wet-boew/js/i18n/pt.min.js +7 -0
  155. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/ru.js +284 -292
  156. package/src/wet-boew/js/i18n/ru.min.js +7 -0
  157. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/sk.js +282 -290
  158. package/src/wet-boew/js/i18n/sk.min.js +7 -0
  159. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/sq.js +246 -254
  160. package/src/wet-boew/js/i18n/sq.min.js +7 -0
  161. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/th.js +284 -292
  162. package/src/wet-boew/js/i18n/th.min.js +7 -0
  163. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/tr.js +286 -294
  164. package/src/wet-boew/js/i18n/tr.min.js +7 -0
  165. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/uk.js +284 -292
  166. package/src/wet-boew/js/i18n/uk.min.js +7 -0
  167. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/vi.js +284 -292
  168. package/src/wet-boew/js/i18n/vi.min.js +7 -0
  169. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/zh-Hans.js +246 -254
  170. package/src/wet-boew/js/i18n/zh-Hans.min.js +7 -0
  171. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/zh.js +285 -293
  172. package/src/wet-boew/js/i18n/zh.min.js +7 -0
  173. package/src/wet-boew/js/ie8-wet-boew.js +3992 -0
  174. package/src/wet-boew/js/ie8-wet-boew.min.js +7 -0
  175. package/src/wet-boew/js/ie8-wet-boew2.js +15294 -0
  176. package/src/wet-boew/js/ie8-wet-boew2.min.js +7 -0
  177. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/jquery/2.2.4/jquery.js +9814 -9814
  178. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/jquery/2.2.4/jquery.min.js +4 -4
  179. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/datalist.js +423 -419
  180. package/src/wet-boew/js/polyfills/datalist.min.js +8 -0
  181. package/src/wet-boew/js/polyfills/datalist.min.js.map +1 -0
  182. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/datalist_dynamic.js +50 -50
  183. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/datalist_dynamic.min.js +7 -7
  184. package/src/wet-boew/js/polyfills/datalist_dynamic.min.js.map +1 -0
  185. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/datepicker.js +338 -338
  186. package/src/wet-boew/js/polyfills/datepicker.min.js +8 -0
  187. package/src/wet-boew/js/polyfills/datepicker.min.js.map +1 -0
  188. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/details.js +126 -126
  189. package/src/wet-boew/js/polyfills/details.min.js +8 -0
  190. package/src/wet-boew/js/polyfills/details.min.js.map +1 -0
  191. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/jawsariafixes.js +47 -47
  192. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/jawsariafixes.min.js +15 -15
  193. package/src/wet-boew/js/polyfills/jawsariafixes.min.js.map +1 -0
  194. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/meter.js +140 -140
  195. package/src/wet-boew/js/polyfills/meter.min.js +8 -0
  196. package/src/wet-boew/js/polyfills/meter.min.js.map +1 -0
  197. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/mobile.js +783 -784
  198. package/src/wet-boew/js/polyfills/mobile.min.js +8 -0
  199. package/src/wet-boew/js/polyfills/mobile.min.js.map +1 -0
  200. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/progress.js +107 -107
  201. package/src/wet-boew/js/polyfills/progress.min.js +8 -0
  202. package/src/wet-boew/js/polyfills/progress.min.js.map +1 -0
  203. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/slider.js +1343 -1343
  204. package/src/wet-boew/js/polyfills/slider.min.js +9 -0
  205. package/src/wet-boew/js/polyfills/slider.min.js.map +1 -0
  206. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/slider_wrapper.js +73 -73
  207. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/slider_wrapper.min.js +7 -7
  208. package/src/wet-boew/js/polyfills/slider_wrapper.min.js.map +1 -0
  209. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/svg.js +29 -29
  210. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/svg.min.js +7 -7
  211. package/src/wet-boew/js/polyfills/svg.min.js.map +1 -0
  212. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/test.js +603 -603
  213. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/test.min.js +7 -7
  214. package/src/wet-boew/js/polyfills/test.min.js.map +1 -0
  215. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/wet-boew.js +17714 -20264
  216. package/src/wet-boew/js/wet-boew.min.js +9 -0
  217. package/src/wet-boew/js/wet-boew.min.js.map +1 -0
  218. package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/payload.json +1721 -1721
  219. package/src/wet-boew-cdn-4.0.81.1/Licence-fr.txt +0 -1
  220. package/src/wet-boew-cdn-4.0.81.1/License-en.txt +0 -1
  221. package/src/wet-boew-cdn-4.0.81.1/assets/sprites_share.png +0 -0
  222. package/src/wet-boew-cdn-4.0.81.1/js/deps/additional-methods.min.js +0 -9
  223. package/src/wet-boew-cdn-4.0.81.1/js/deps/geomap-lib.min.js +0 -1
  224. package/src/wet-boew-cdn-4.0.81.1/js/deps/jquery.dataTables.min.js +0 -4
  225. package/src/wet-boew-cdn-4.0.81.1/js/deps/jquery.flot.canvas.min.js +0 -1
  226. package/src/wet-boew-cdn-4.0.81.1/js/deps/jquery.flot.min.js +0 -1
  227. package/src/wet-boew-cdn-4.0.81.1/js/deps/jquery.flot.orderBars.min.js +0 -1
  228. package/src/wet-boew-cdn-4.0.81.1/js/deps/jquery.flot.pie.min.js +0 -1
  229. package/src/wet-boew-cdn-4.0.81.1/js/deps/jquery.magnific-popup.min.js +0 -4
  230. package/src/wet-boew-cdn-4.0.81.1/js/deps/jquery.validate.min.js +0 -9
  231. package/src/wet-boew-cdn-4.0.81.1/js/deps/json-patch.min.js +0 -1
  232. package/src/wet-boew-cdn-4.0.81.1/js/deps/jsonpointer.min.js +0 -1
  233. package/src/wet-boew-cdn-4.0.81.1/js/deps/ol.min.js +0 -1
  234. package/src/wet-boew-cdn-4.0.81.1/js/deps/prettify.min.js +0 -1
  235. package/src/wet-boew-cdn-4.0.81.1/js/deps/proj4.min.js +0 -1
  236. package/src/wet-boew-cdn-4.0.81.1/js/deps/run_prettify.min.js +0 -1
  237. package/src/wet-boew-cdn-4.0.81.1/js/deps/tableparser.min.js +0 -1
  238. package/src/wet-boew-cdn-4.0.81.1/js/deps/unorm.min.js +0 -1
  239. package/src/wet-boew-cdn-4.0.81.1/js/i18n/af.min.js +0 -7
  240. package/src/wet-boew-cdn-4.0.81.1/js/i18n/ar.min.js +0 -7
  241. package/src/wet-boew-cdn-4.0.81.1/js/i18n/bg.min.js +0 -7
  242. package/src/wet-boew-cdn-4.0.81.1/js/i18n/cs.min.js +0 -7
  243. package/src/wet-boew-cdn-4.0.81.1/js/i18n/de.min.js +0 -7
  244. package/src/wet-boew-cdn-4.0.81.1/js/i18n/el.min.js +0 -7
  245. package/src/wet-boew-cdn-4.0.81.1/js/i18n/en.min.js +0 -7
  246. package/src/wet-boew-cdn-4.0.81.1/js/i18n/es.min.js +0 -7
  247. package/src/wet-boew-cdn-4.0.81.1/js/i18n/et.min.js +0 -7
  248. package/src/wet-boew-cdn-4.0.81.1/js/i18n/fr.min.js +0 -7
  249. package/src/wet-boew-cdn-4.0.81.1/js/i18n/hi.min.js +0 -7
  250. package/src/wet-boew-cdn-4.0.81.1/js/i18n/hu.min.js +0 -7
  251. package/src/wet-boew-cdn-4.0.81.1/js/i18n/hy.min.js +0 -7
  252. package/src/wet-boew-cdn-4.0.81.1/js/i18n/id.min.js +0 -7
  253. package/src/wet-boew-cdn-4.0.81.1/js/i18n/is.min.js +0 -7
  254. package/src/wet-boew-cdn-4.0.81.1/js/i18n/it.min.js +0 -7
  255. package/src/wet-boew-cdn-4.0.81.1/js/i18n/iu.min.js +0 -7
  256. package/src/wet-boew-cdn-4.0.81.1/js/i18n/ja.min.js +0 -7
  257. package/src/wet-boew-cdn-4.0.81.1/js/i18n/ko.min.js +0 -7
  258. package/src/wet-boew-cdn-4.0.81.1/js/i18n/lt.min.js +0 -7
  259. package/src/wet-boew-cdn-4.0.81.1/js/i18n/lv.min.js +0 -7
  260. package/src/wet-boew-cdn-4.0.81.1/js/i18n/nl.min.js +0 -7
  261. package/src/wet-boew-cdn-4.0.81.1/js/i18n/pl.min.js +0 -7
  262. package/src/wet-boew-cdn-4.0.81.1/js/i18n/pt-BR.min.js +0 -7
  263. package/src/wet-boew-cdn-4.0.81.1/js/i18n/pt.min.js +0 -7
  264. package/src/wet-boew-cdn-4.0.81.1/js/i18n/ru.min.js +0 -7
  265. package/src/wet-boew-cdn-4.0.81.1/js/i18n/sk.min.js +0 -7
  266. package/src/wet-boew-cdn-4.0.81.1/js/i18n/sq.min.js +0 -7
  267. package/src/wet-boew-cdn-4.0.81.1/js/i18n/th.min.js +0 -7
  268. package/src/wet-boew-cdn-4.0.81.1/js/i18n/tr.min.js +0 -7
  269. package/src/wet-boew-cdn-4.0.81.1/js/i18n/uk.min.js +0 -7
  270. package/src/wet-boew-cdn-4.0.81.1/js/i18n/vi.min.js +0 -7
  271. package/src/wet-boew-cdn-4.0.81.1/js/i18n/zh-Hans.min.js +0 -7
  272. package/src/wet-boew-cdn-4.0.81.1/js/i18n/zh.min.js +0 -7
  273. package/src/wet-boew-cdn-4.0.81.1/js/ie8-wet-boew.min.js.map +0 -1
  274. package/src/wet-boew-cdn-4.0.81.1/js/ie8-wet-boew2.min.js.map +0 -1
  275. package/src/wet-boew-cdn-4.0.81.1/js/polyfills/datalist.min.js +0 -8
  276. package/src/wet-boew-cdn-4.0.81.1/js/polyfills/datalist.min.js.map +0 -1
  277. package/src/wet-boew-cdn-4.0.81.1/js/polyfills/datalist_dynamic.min.js.map +0 -1
  278. package/src/wet-boew-cdn-4.0.81.1/js/polyfills/datepicker.min.js +0 -8
  279. package/src/wet-boew-cdn-4.0.81.1/js/polyfills/datepicker.min.js.map +0 -1
  280. package/src/wet-boew-cdn-4.0.81.1/js/polyfills/details.min.js +0 -8
  281. package/src/wet-boew-cdn-4.0.81.1/js/polyfills/details.min.js.map +0 -1
  282. package/src/wet-boew-cdn-4.0.81.1/js/polyfills/jawsariafixes.min.js.map +0 -1
  283. package/src/wet-boew-cdn-4.0.81.1/js/polyfills/meter.min.js +0 -8
  284. package/src/wet-boew-cdn-4.0.81.1/js/polyfills/meter.min.js.map +0 -1
  285. package/src/wet-boew-cdn-4.0.81.1/js/polyfills/mobile.min.js +0 -8
  286. package/src/wet-boew-cdn-4.0.81.1/js/polyfills/mobile.min.js.map +0 -1
  287. package/src/wet-boew-cdn-4.0.81.1/js/polyfills/progress.min.js +0 -8
  288. package/src/wet-boew-cdn-4.0.81.1/js/polyfills/progress.min.js.map +0 -1
  289. package/src/wet-boew-cdn-4.0.81.1/js/polyfills/slider.min.js +0 -9
  290. package/src/wet-boew-cdn-4.0.81.1/js/polyfills/slider.min.js.map +0 -1
  291. package/src/wet-boew-cdn-4.0.81.1/js/polyfills/slider_wrapper.min.js.map +0 -1
  292. package/src/wet-boew-cdn-4.0.81.1/js/polyfills/svg.min.js.map +0 -1
  293. package/src/wet-boew-cdn-4.0.81.1/js/polyfills/test.min.js.map +0 -1
  294. package/src/wet-boew-cdn-4.0.81.1/js/wet-boew.min.js +0 -9
  295. package/src/wet-boew-cdn-4.0.81.1/js/wet-boew.min.js.map +0 -1
  296. package/src/wet-boew-cdn-4.0.81.1/package.json +0 -15
  297. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/assets/cloud-popup-relative.png +0 -0
  298. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/assets/fd-slider-sprite.png +0 -0
  299. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/assets/loading.png +0 -0
  300. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/assets/zoom-minus-mini.png +0 -0
  301. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/assets/zoom-plus-mini.png +0 -0
  302. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/assets/zoom-world-mini.png +0 -0
  303. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/datalist.min.css +0 -0
  304. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/datepicker.min.css +0 -0
  305. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/details.min.css +0 -0
  306. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/mathml.min.css +0 -0
  307. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/meter.min.css +0 -0
  308. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/progress.min.css +0 -0
  309. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/slider.min.css +0 -0
  310. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/fonts/glyphicons-halflings-regular.eot +0 -0
  311. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/fonts/glyphicons-halflings-regular.ttf +0 -0
  312. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/fonts/glyphicons-halflings-regular.woff +0 -0
  313. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/fonts/glyphicons-halflings-regular.woff2 +0 -0
  314. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/mml-chtml.js +0 -0
  315. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_AMS-Regular.woff +0 -0
  316. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Calligraphic-Bold.woff +0 -0
  317. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Calligraphic-Regular.woff +0 -0
  318. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Fraktur-Bold.woff +0 -0
  319. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Fraktur-Regular.woff +0 -0
  320. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Main-Bold.woff +0 -0
  321. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Main-Italic.woff +0 -0
  322. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Main-Regular.woff +0 -0
  323. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Math-BoldItalic.woff +0 -0
  324. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Math-Italic.woff +0 -0
  325. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Math-Regular.woff +0 -0
  326. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_SansSerif-Bold.woff +0 -0
  327. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_SansSerif-Italic.woff +0 -0
  328. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_SansSerif-Regular.woff +0 -0
  329. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Script-Regular.woff +0 -0
  330. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Size1-Regular.woff +0 -0
  331. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Size2-Regular.woff +0 -0
  332. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Size3-Regular.woff +0 -0
  333. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Size4-Regular.woff +0 -0
  334. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Typewriter-Regular.woff +0 -0
  335. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Vector-Bold.woff +0 -0
  336. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Vector-Regular.woff +0 -0
  337. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Zero.woff +0 -0
  338. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-apollo.min.js +0 -0
  339. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-basic.min.js +0 -0
  340. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-clj.min.js +0 -0
  341. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-css.min.js +0 -0
  342. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-dart.min.js +0 -0
  343. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-erlang.min.js +0 -0
  344. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-go.min.js +0 -0
  345. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-hs.min.js +0 -0
  346. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-lasso.min.js +0 -0
  347. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-lisp.min.js +0 -0
  348. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-llvm.min.js +0 -0
  349. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-logtalk.min.js +0 -0
  350. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-lua.min.js +0 -0
  351. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-ml.min.js +0 -0
  352. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-mumps.min.js +0 -0
  353. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-n.min.js +0 -0
  354. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-pascal.min.js +0 -0
  355. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-proto.min.js +0 -0
  356. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-r.min.js +0 -0
  357. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-rd.min.js +0 -0
  358. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-rust.min.js +0 -0
  359. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-scala.min.js +0 -0
  360. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-sql.min.js +0 -0
  361. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-swift.min.js +0 -0
  362. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-tcl.min.js +0 -0
  363. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-tex.min.js +0 -0
  364. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-vb.min.js +0 -0
  365. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-vhdl.min.js +0 -0
  366. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-wiki.min.js +0 -0
  367. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-xq.min.js +0 -0
  368. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-yaml.min.js +0 -0
  369. /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/jquery/2.2.4/jquery.min.map +0 -0
@@ -1,820 +1,820 @@
1
- /* Flot plugin for rendering pie charts.
2
-
3
- Copyright (c) 2007-2014 IOLA and Ole Laursen.
4
- Licensed under the MIT license.
5
-
6
- The plugin assumes that each series has a single data value, and that each
7
- value is a positive integer or zero. Negative numbers don't make sense for a
8
- pie chart, and have unpredictable results. The values do NOT need to be
9
- passed in as percentages; the plugin will calculate the total and per-slice
10
- percentages internally.
11
-
12
- * Created by Brian Medendorp
13
-
14
- * Updated with contributions from btburnett3, Anthony Aragues and Xavi Ivars
15
-
16
- The plugin supports these options:
17
-
18
- series: {
19
- pie: {
20
- show: true/false
21
- radius: 0-1 for percentage of fullsize, or a specified pixel length, or 'auto'
22
- innerRadius: 0-1 for percentage of fullsize or a specified pixel length, for creating a donut effect
23
- 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
24
- tilt: 0-1 for percentage to tilt the pie, where 1 is no tilt, and 0 is completely flat (nothing will show)
25
- offset: {
26
- top: integer value to move the pie up or down
27
- left: integer value to move the pie left or right, or 'auto'
28
- },
29
- stroke: {
30
- color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#FFF')
31
- width: integer pixel width of the stroke
32
- },
33
- label: {
34
- show: true/false, or 'auto'
35
- formatter: a user-defined function that modifies the text/style of the label text
36
- radius: 0-1 for percentage of fullsize, or a specified pixel length
37
- background: {
38
- color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#000')
39
- opacity: 0-1
40
- },
41
- threshold: 0-1 for the percentage value at which to hide labels (if they're too small)
42
- },
43
- combine: {
44
- threshold: 0-1 for the percentage value at which to combine slices (if they're too small)
45
- 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
46
- label: any text value of what the combined slice should be labeled
47
- }
48
- highlight: {
49
- opacity: 0-1
50
- }
51
- }
52
- }
53
-
54
- More detail and specific examples can be found in the included HTML file.
55
-
56
- */
57
-
58
- (function($) {
59
-
60
- // Maximum redraw attempts when fitting labels within the plot
61
-
62
- var REDRAW_ATTEMPTS = 10;
63
-
64
- // Factor by which to shrink the pie when fitting labels within the plot
65
-
66
- var REDRAW_SHRINK = 0.95;
67
-
68
- function init(plot) {
69
-
70
- var canvas = null,
71
- target = null,
72
- options = null,
73
- maxRadius = null,
74
- centerLeft = null,
75
- centerTop = null,
76
- processed = false,
77
- ctx = null;
78
-
79
- // interactive variables
80
-
81
- var highlights = [];
82
-
83
- // add hook to determine if pie plugin in enabled, and then perform necessary operations
84
-
85
- plot.hooks.processOptions.push(function(plot, options) {
86
- if (options.series.pie.show) {
87
-
88
- options.grid.show = false;
89
-
90
- // set labels.show
91
-
92
- if (options.series.pie.label.show == "auto") {
93
- if (options.legend.show) {
94
- options.series.pie.label.show = false;
95
- } else {
96
- options.series.pie.label.show = true;
97
- }
98
- }
99
-
100
- // set radius
101
-
102
- if (options.series.pie.radius == "auto") {
103
- if (options.series.pie.label.show) {
104
- options.series.pie.radius = 3/4;
105
- } else {
106
- options.series.pie.radius = 1;
107
- }
108
- }
109
-
110
- // ensure sane tilt
111
-
112
- if (options.series.pie.tilt > 1) {
113
- options.series.pie.tilt = 1;
114
- } else if (options.series.pie.tilt < 0) {
115
- options.series.pie.tilt = 0;
116
- }
117
- }
118
- });
119
-
120
- plot.hooks.bindEvents.push(function(plot, eventHolder) {
121
- var options = plot.getOptions();
122
- if (options.series.pie.show) {
123
- if (options.grid.hoverable) {
124
- eventHolder.unbind("mousemove").mousemove(onMouseMove);
125
- }
126
- if (options.grid.clickable) {
127
- eventHolder.unbind("click").click(onClick);
128
- }
129
- }
130
- });
131
-
132
- plot.hooks.processDatapoints.push(function(plot, series, data, datapoints) {
133
- var options = plot.getOptions();
134
- if (options.series.pie.show) {
135
- processDatapoints(plot, series, data, datapoints);
136
- }
137
- });
138
-
139
- plot.hooks.drawOverlay.push(function(plot, octx) {
140
- var options = plot.getOptions();
141
- if (options.series.pie.show) {
142
- drawOverlay(plot, octx);
143
- }
144
- });
145
-
146
- plot.hooks.draw.push(function(plot, newCtx) {
147
- var options = plot.getOptions();
148
- if (options.series.pie.show) {
149
- draw(plot, newCtx);
150
- }
151
- });
152
-
153
- function processDatapoints(plot, series, datapoints) {
154
- if (!processed) {
155
- processed = true;
156
- canvas = plot.getCanvas();
157
- target = $(canvas).parent();
158
- options = plot.getOptions();
159
- plot.setData(combine(plot.getData()));
160
- }
161
- }
162
-
163
- function combine(data) {
164
-
165
- var total = 0,
166
- combined = 0,
167
- numCombined = 0,
168
- color = options.series.pie.combine.color,
169
- newdata = [];
170
-
171
- // Fix up the raw data from Flot, ensuring the data is numeric
172
-
173
- for (var i = 0; i < data.length; ++i) {
174
-
175
- var value = data[i].data;
176
-
177
- // If the data is an array, we'll assume that it's a standard
178
- // Flot x-y pair, and are concerned only with the second value.
179
-
180
- // Note how we use the original array, rather than creating a
181
- // new one; this is more efficient and preserves any extra data
182
- // that the user may have stored in higher indexes.
183
-
184
- if ($.isArray(value) && value.length == 1) {
185
- value = value[0];
186
- }
187
-
188
- if ($.isArray(value)) {
189
- // Equivalent to $.isNumeric() but compatible with jQuery < 1.7
190
- if (!isNaN(parseFloat(value[1])) && isFinite(value[1])) {
191
- value[1] = +value[1];
192
- } else {
193
- value[1] = 0;
194
- }
195
- } else if (!isNaN(parseFloat(value)) && isFinite(value)) {
196
- value = [1, +value];
197
- } else {
198
- value = [1, 0];
199
- }
200
-
201
- data[i].data = [value];
202
- }
203
-
204
- // Sum up all the slices, so we can calculate percentages for each
205
-
206
- for (var i = 0; i < data.length; ++i) {
207
- total += data[i].data[0][1];
208
- }
209
-
210
- // Count the number of slices with percentages below the combine
211
- // threshold; if it turns out to be just one, we won't combine.
212
-
213
- for (var i = 0; i < data.length; ++i) {
214
- var value = data[i].data[0][1];
215
- if (value / total <= options.series.pie.combine.threshold) {
216
- combined += value;
217
- numCombined++;
218
- if (!color) {
219
- color = data[i].color;
220
- }
221
- }
222
- }
223
-
224
- for (var i = 0; i < data.length; ++i) {
225
- var value = data[i].data[0][1];
226
- if (numCombined < 2 || value / total > options.series.pie.combine.threshold) {
227
- newdata.push(
228
- $.extend(data[i], { /* extend to allow keeping all other original data values
229
- and using them e.g. in labelFormatter. */
230
- data: [[1, value]],
231
- color: data[i].color,
232
- label: data[i].label,
233
- angle: value * Math.PI * 2 / total,
234
- percent: value / (total / 100)
235
- })
236
- );
237
- }
238
- }
239
-
240
- if (numCombined > 1) {
241
- newdata.push({
242
- data: [[1, combined]],
243
- color: color,
244
- label: options.series.pie.combine.label,
245
- angle: combined * Math.PI * 2 / total,
246
- percent: combined / (total / 100)
247
- });
248
- }
249
-
250
- return newdata;
251
- }
252
-
253
- function draw(plot, newCtx) {
254
-
255
- if (!target) {
256
- return; // if no series were passed
257
- }
258
-
259
- var canvasWidth = plot.getPlaceholder().width(),
260
- canvasHeight = plot.getPlaceholder().height(),
261
- legendWidth = target.children().filter(".legend").children().width() || 0;
262
-
263
- ctx = newCtx;
264
-
265
- // WARNING: HACK! REWRITE THIS CODE AS SOON AS POSSIBLE!
266
-
267
- // When combining smaller slices into an 'other' slice, we need to
268
- // add a new series. Since Flot gives plugins no way to modify the
269
- // list of series, the pie plugin uses a hack where the first call
270
- // to processDatapoints results in a call to setData with the new
271
- // list of series, then subsequent processDatapoints do nothing.
272
-
273
- // The plugin-global 'processed' flag is used to control this hack;
274
- // it starts out false, and is set to true after the first call to
275
- // processDatapoints.
276
-
277
- // Unfortunately this turns future setData calls into no-ops; they
278
- // call processDatapoints, the flag is true, and nothing happens.
279
-
280
- // To fix this we'll set the flag back to false here in draw, when
281
- // all series have been processed, so the next sequence of calls to
282
- // processDatapoints once again starts out with a slice-combine.
283
- // This is really a hack; in 0.9 we need to give plugins a proper
284
- // way to modify series before any processing begins.
285
-
286
- processed = false;
287
-
288
- // calculate maximum radius and center point
289
-
290
- maxRadius = Math.min(canvasWidth, canvasHeight / options.series.pie.tilt) / 2;
291
- centerTop = canvasHeight / 2 + options.series.pie.offset.top;
292
- centerLeft = canvasWidth / 2;
293
-
294
- if (options.series.pie.offset.left == "auto") {
295
- if (options.legend.position.match("w")) {
296
- centerLeft += legendWidth / 2;
297
- } else {
298
- centerLeft -= legendWidth / 2;
299
- }
300
- if (centerLeft < maxRadius) {
301
- centerLeft = maxRadius;
302
- } else if (centerLeft > canvasWidth - maxRadius) {
303
- centerLeft = canvasWidth - maxRadius;
304
- }
305
- } else {
306
- centerLeft += options.series.pie.offset.left;
307
- }
308
-
309
- var slices = plot.getData(),
310
- attempts = 0;
311
-
312
- // Keep shrinking the pie's radius until drawPie returns true,
313
- // indicating that all the labels fit, or we try too many times.
314
-
315
- do {
316
- if (attempts > 0) {
317
- maxRadius *= REDRAW_SHRINK;
318
- }
319
- attempts += 1;
320
- clear();
321
- if (options.series.pie.tilt <= 0.8) {
322
- drawShadow();
323
- }
324
- } while (!drawPie() && attempts < REDRAW_ATTEMPTS)
325
-
326
- if (attempts >= REDRAW_ATTEMPTS) {
327
- clear();
328
- target.prepend("<div class='error'>Could not draw pie with labels contained inside canvas</div>");
329
- }
330
-
331
- if (plot.setSeries && plot.insertLegend) {
332
- plot.setSeries(slices);
333
- plot.insertLegend();
334
- }
335
-
336
- // we're actually done at this point, just defining internal functions at this point
337
-
338
- function clear() {
339
- ctx.clearRect(0, 0, canvasWidth, canvasHeight);
340
- target.children().filter(".pieLabel, .pieLabelBackground").remove();
341
- }
342
-
343
- function drawShadow() {
344
-
345
- var shadowLeft = options.series.pie.shadow.left;
346
- var shadowTop = options.series.pie.shadow.top;
347
- var edge = 10;
348
- var alpha = options.series.pie.shadow.alpha;
349
- var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;
350
-
351
- if (radius >= canvasWidth / 2 - shadowLeft || radius * options.series.pie.tilt >= canvasHeight / 2 - shadowTop || radius <= edge) {
352
- return; // shadow would be outside canvas, so don't draw it
353
- }
354
-
355
- ctx.save();
356
- ctx.translate(shadowLeft,shadowTop);
357
- ctx.globalAlpha = alpha;
358
- ctx.fillStyle = "#000";
359
-
360
- // center and rotate to starting position
361
-
362
- ctx.translate(centerLeft,centerTop);
363
- ctx.scale(1, options.series.pie.tilt);
364
-
365
- //radius -= edge;
366
-
367
- for (var i = 1; i <= edge; i++) {
368
- ctx.beginPath();
369
- ctx.arc(0, 0, radius, 0, Math.PI * 2, false);
370
- ctx.fill();
371
- radius -= i;
372
- }
373
-
374
- ctx.restore();
375
- }
376
-
377
- function drawPie() {
378
-
379
- var startAngle = Math.PI * options.series.pie.startAngle;
380
- var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;
381
-
382
- // center and rotate to starting position
383
-
384
- ctx.save();
385
- ctx.translate(centerLeft,centerTop);
386
- ctx.scale(1, options.series.pie.tilt);
387
- //ctx.rotate(startAngle); // start at top; -- This doesn't work properly in Opera
388
-
389
- // draw slices
390
-
391
- ctx.save();
392
- var currentAngle = startAngle;
393
- for (var i = 0; i < slices.length; ++i) {
394
- slices[i].startAngle = currentAngle;
395
- drawSlice(slices[i].angle, slices[i].color, true);
396
- }
397
- ctx.restore();
398
-
399
- // draw slice outlines
400
-
401
- if (options.series.pie.stroke.width > 0) {
402
- ctx.save();
403
- ctx.lineWidth = options.series.pie.stroke.width;
404
- currentAngle = startAngle;
405
- for (var i = 0; i < slices.length; ++i) {
406
- drawSlice(slices[i].angle, options.series.pie.stroke.color, false);
407
- }
408
- ctx.restore();
409
- }
410
-
411
- // draw donut hole
412
-
413
- drawDonutHole(ctx);
414
-
415
- ctx.restore();
416
-
417
- // Draw the labels, returning true if they fit within the plot
418
-
419
- if (options.series.pie.label.show) {
420
- return drawLabels();
421
- } else return true;
422
-
423
- function drawSlice(angle, color, fill) {
424
-
425
- if (angle <= 0 || isNaN(angle)) {
426
- return;
427
- }
428
-
429
- if (fill) {
430
- ctx.fillStyle = color;
431
- } else {
432
- ctx.strokeStyle = color;
433
- ctx.lineJoin = "round";
434
- }
435
-
436
- ctx.beginPath();
437
- if (Math.abs(angle - Math.PI * 2) > 0.000000001) {
438
- ctx.moveTo(0, 0); // Center of the pie
439
- }
440
-
441
- //ctx.arc(0, 0, radius, 0, angle, false); // This doesn't work properly in Opera
442
- ctx.arc(0, 0, radius,currentAngle, currentAngle + angle / 2, false);
443
- ctx.arc(0, 0, radius,currentAngle + angle / 2, currentAngle + angle, false);
444
- ctx.closePath();
445
- //ctx.rotate(angle); // This doesn't work properly in Opera
446
- currentAngle += angle;
447
-
448
- if (fill) {
449
- ctx.fill();
450
- } else {
451
- ctx.stroke();
452
- }
453
- }
454
-
455
- function drawLabels() {
456
-
457
- var currentAngle = startAngle;
458
- var radius = options.series.pie.label.radius > 1 ? options.series.pie.label.radius : maxRadius * options.series.pie.label.radius;
459
-
460
- for (var i = 0; i < slices.length; ++i) {
461
- if (slices[i].percent >= options.series.pie.label.threshold * 100) {
462
- if (!drawLabel(slices[i], currentAngle, i)) {
463
- return false;
464
- }
465
- }
466
- currentAngle += slices[i].angle;
467
- }
468
-
469
- return true;
470
-
471
- function drawLabel(slice, startAngle, index) {
472
-
473
- if (slice.data[0][1] == 0) {
474
- return true;
475
- }
476
-
477
- // format label text
478
-
479
- var lf = options.legend.labelFormatter, text, plf = options.series.pie.label.formatter;
480
-
481
- if (lf) {
482
- text = lf(slice.label, slice);
483
- } else {
484
- text = slice.label;
485
- }
486
-
487
- if (plf) {
488
- text = plf(text, slice);
489
- }
490
-
491
- var halfAngle = ((startAngle + slice.angle) + startAngle) / 2;
492
- var x = centerLeft + Math.round(Math.cos(halfAngle) * radius);
493
- var y = centerTop + Math.round(Math.sin(halfAngle) * radius) * options.series.pie.tilt;
494
-
495
- var html = "<span class='pieLabel' id='pieLabel" + index + "' style='position:absolute;top:" + y + "px;left:" + x + "px;'>" + text + "</span>";
496
- target.append(html);
497
-
498
- var label = target.children("#pieLabel" + index);
499
- var labelTop = (y - label.height() / 2);
500
- var labelLeft = (x - label.width() / 2);
501
-
502
- label.css("top", labelTop);
503
- label.css("left", labelLeft);
504
-
505
- // check to make sure that the label is not outside the canvas
506
-
507
- if (0 - labelTop > 0 || 0 - labelLeft > 0 || canvasHeight - (labelTop + label.height()) < 0 || canvasWidth - (labelLeft + label.width()) < 0) {
508
- return false;
509
- }
510
-
511
- if (options.series.pie.label.background.opacity != 0) {
512
-
513
- // put in the transparent background separately to avoid blended labels and label boxes
514
-
515
- var c = options.series.pie.label.background.color;
516
-
517
- if (c == null) {
518
- c = slice.color;
519
- }
520
-
521
- var pos = "top:" + labelTop + "px;left:" + labelLeft + "px;";
522
- $("<div class='pieLabelBackground' style='position:absolute;width:" + label.width() + "px;height:" + label.height() + "px;" + pos + "background-color:" + c + ";'></div>")
523
- .css("opacity", options.series.pie.label.background.opacity)
524
- .insertBefore(label);
525
- }
526
-
527
- return true;
528
- } // end individual label function
529
- } // end drawLabels function
530
- } // end drawPie function
531
- } // end draw function
532
-
533
- // Placed here because it needs to be accessed from multiple locations
534
-
535
- function drawDonutHole(layer) {
536
- if (options.series.pie.innerRadius > 0) {
537
-
538
- // subtract the center
539
-
540
- layer.save();
541
- var innerRadius = options.series.pie.innerRadius > 1 ? options.series.pie.innerRadius : maxRadius * options.series.pie.innerRadius;
542
- layer.globalCompositeOperation = "destination-out"; // this does not work with excanvas, but it will fall back to using the stroke color
543
- layer.beginPath();
544
- layer.fillStyle = options.series.pie.stroke.color;
545
- layer.arc(0, 0, innerRadius, 0, Math.PI * 2, false);
546
- layer.fill();
547
- layer.closePath();
548
- layer.restore();
549
-
550
- // add inner stroke
551
-
552
- layer.save();
553
- layer.beginPath();
554
- layer.strokeStyle = options.series.pie.stroke.color;
555
- layer.arc(0, 0, innerRadius, 0, Math.PI * 2, false);
556
- layer.stroke();
557
- layer.closePath();
558
- layer.restore();
559
-
560
- // TODO: add extra shadow inside hole (with a mask) if the pie is tilted.
561
- }
562
- }
563
-
564
- //-- Additional Interactive related functions --
565
-
566
- function isPointInPoly(poly, pt) {
567
- for(var c = false, i = -1, l = poly.length, j = l - 1; ++i < l; j = i)
568
- ((poly[i][1] <= pt[1] && pt[1] < poly[j][1]) || (poly[j][1] <= pt[1] && pt[1]< poly[i][1]))
569
- && (pt[0] < (poly[j][0] - poly[i][0]) * (pt[1] - poly[i][1]) / (poly[j][1] - poly[i][1]) + poly[i][0])
570
- && (c = !c);
571
- return c;
572
- }
573
-
574
- function findNearbySlice(mouseX, mouseY) {
575
-
576
- var slices = plot.getData(),
577
- options = plot.getOptions(),
578
- radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius,
579
- x, y;
580
-
581
- for (var i = 0; i < slices.length; ++i) {
582
-
583
- var s = slices[i];
584
-
585
- if (s.pie.show) {
586
-
587
- ctx.save();
588
- ctx.beginPath();
589
- ctx.moveTo(0, 0); // Center of the pie
590
- //ctx.scale(1, options.series.pie.tilt); // this actually seems to break everything when here.
591
- ctx.arc(0, 0, radius, s.startAngle, s.startAngle + s.angle / 2, false);
592
- ctx.arc(0, 0, radius, s.startAngle + s.angle / 2, s.startAngle + s.angle, false);
593
- ctx.closePath();
594
- x = mouseX - centerLeft;
595
- y = mouseY - centerTop;
596
-
597
- if (ctx.isPointInPath) {
598
- if (ctx.isPointInPath(mouseX - centerLeft, mouseY - centerTop)) {
599
- ctx.restore();
600
- return {
601
- datapoint: [s.percent, s.data],
602
- dataIndex: 0,
603
- series: s,
604
- seriesIndex: i
605
- };
606
- }
607
- } else {
608
-
609
- // excanvas for IE doesn;t support isPointInPath, this is a workaround.
610
-
611
- var p1X = radius * Math.cos(s.startAngle),
612
- p1Y = radius * Math.sin(s.startAngle),
613
- p2X = radius * Math.cos(s.startAngle + s.angle / 4),
614
- p2Y = radius * Math.sin(s.startAngle + s.angle / 4),
615
- p3X = radius * Math.cos(s.startAngle + s.angle / 2),
616
- p3Y = radius * Math.sin(s.startAngle + s.angle / 2),
617
- p4X = radius * Math.cos(s.startAngle + s.angle / 1.5),
618
- p4Y = radius * Math.sin(s.startAngle + s.angle / 1.5),
619
- p5X = radius * Math.cos(s.startAngle + s.angle),
620
- p5Y = radius * Math.sin(s.startAngle + s.angle),
621
- arrPoly = [[0, 0], [p1X, p1Y], [p2X, p2Y], [p3X, p3Y], [p4X, p4Y], [p5X, p5Y]],
622
- arrPoint = [x, y];
623
-
624
- // TODO: perhaps do some mathmatical trickery here with the Y-coordinate to compensate for pie tilt?
625
-
626
- if (isPointInPoly(arrPoly, arrPoint)) {
627
- ctx.restore();
628
- return {
629
- datapoint: [s.percent, s.data],
630
- dataIndex: 0,
631
- series: s,
632
- seriesIndex: i
633
- };
634
- }
635
- }
636
-
637
- ctx.restore();
638
- }
639
- }
640
-
641
- return null;
642
- }
643
-
644
- function onMouseMove(e) {
645
- triggerClickHoverEvent("plothover", e);
646
- }
647
-
648
- function onClick(e) {
649
- triggerClickHoverEvent("plotclick", e);
650
- }
651
-
652
- // trigger click or hover event (they send the same parameters so we share their code)
653
-
654
- function triggerClickHoverEvent(eventname, e) {
655
-
656
- var offset = plot.offset();
657
- var canvasX = parseInt(e.pageX - offset.left);
658
- var canvasY = parseInt(e.pageY - offset.top);
659
- var item = findNearbySlice(canvasX, canvasY);
660
-
661
- if (options.grid.autoHighlight) {
662
-
663
- // clear auto-highlights
664
-
665
- for (var i = 0; i < highlights.length; ++i) {
666
- var h = highlights[i];
667
- if (h.auto == eventname && !(item && h.series == item.series)) {
668
- unhighlight(h.series);
669
- }
670
- }
671
- }
672
-
673
- // highlight the slice
674
-
675
- if (item) {
676
- highlight(item.series, eventname);
677
- }
678
-
679
- // trigger any hover bind events
680
-
681
- var pos = { pageX: e.pageX, pageY: e.pageY };
682
- target.trigger(eventname, [pos, item]);
683
- }
684
-
685
- function highlight(s, auto) {
686
- //if (typeof s == "number") {
687
- // s = series[s];
688
- //}
689
-
690
- var i = indexOfHighlight(s);
691
-
692
- if (i == -1) {
693
- highlights.push({ series: s, auto: auto });
694
- plot.triggerRedrawOverlay();
695
- } else if (!auto) {
696
- highlights[i].auto = false;
697
- }
698
- }
699
-
700
- function unhighlight(s) {
701
- if (s == null) {
702
- highlights = [];
703
- plot.triggerRedrawOverlay();
704
- }
705
-
706
- //if (typeof s == "number") {
707
- // s = series[s];
708
- //}
709
-
710
- var i = indexOfHighlight(s);
711
-
712
- if (i != -1) {
713
- highlights.splice(i, 1);
714
- plot.triggerRedrawOverlay();
715
- }
716
- }
717
-
718
- function indexOfHighlight(s) {
719
- for (var i = 0; i < highlights.length; ++i) {
720
- var h = highlights[i];
721
- if (h.series == s)
722
- return i;
723
- }
724
- return -1;
725
- }
726
-
727
- function drawOverlay(plot, octx) {
728
-
729
- var options = plot.getOptions();
730
-
731
- var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;
732
-
733
- octx.save();
734
- octx.translate(centerLeft, centerTop);
735
- octx.scale(1, options.series.pie.tilt);
736
-
737
- for (var i = 0; i < highlights.length; ++i) {
738
- drawHighlight(highlights[i].series);
739
- }
740
-
741
- drawDonutHole(octx);
742
-
743
- octx.restore();
744
-
745
- function drawHighlight(series) {
746
-
747
- if (series.angle <= 0 || isNaN(series.angle)) {
748
- return;
749
- }
750
-
751
- //octx.fillStyle = parseColor(options.series.pie.highlight.color).scale(null, null, null, options.series.pie.highlight.opacity).toString();
752
- octx.fillStyle = "rgba(255, 255, 255, " + options.series.pie.highlight.opacity + ")"; // this is temporary until we have access to parseColor
753
- octx.beginPath();
754
- if (Math.abs(series.angle - Math.PI * 2) > 0.000000001) {
755
- octx.moveTo(0, 0); // Center of the pie
756
- }
757
- octx.arc(0, 0, radius, series.startAngle, series.startAngle + series.angle / 2, false);
758
- octx.arc(0, 0, radius, series.startAngle + series.angle / 2, series.startAngle + series.angle, false);
759
- octx.closePath();
760
- octx.fill();
761
- }
762
- }
763
- } // end init (plugin body)
764
-
765
- // define pie specific options and their default values
766
-
767
- var options = {
768
- series: {
769
- pie: {
770
- show: false,
771
- radius: "auto", // actual radius of the visible pie (based on full calculated radius if <=1, or hard pixel value)
772
- innerRadius: 0, /* for donut */
773
- startAngle: 3/2,
774
- tilt: 1,
775
- shadow: {
776
- left: 5, // shadow left offset
777
- top: 15, // shadow top offset
778
- alpha: 0.02 // shadow alpha
779
- },
780
- offset: {
781
- top: 0,
782
- left: "auto"
783
- },
784
- stroke: {
785
- color: "#fff",
786
- width: 1
787
- },
788
- label: {
789
- show: "auto",
790
- formatter: function(label, slice) {
791
- return "<div style='font-size:x-small;text-align:center;padding:2px;color:" + slice.color + ";'>" + label + "<br/>" + Math.round(slice.percent) + "%</div>";
792
- }, // formatter function
793
- radius: 1, // radius at which to place the labels (based on full calculated radius if <=1, or hard pixel value)
794
- background: {
795
- color: null,
796
- opacity: 0
797
- },
798
- threshold: 0 // percentage at which to hide the label (i.e. the slice is too narrow)
799
- },
800
- combine: {
801
- threshold: -1, // percentage at which to combine little slices into one larger slice
802
- color: null, // color to give the new slice (auto-generated if null)
803
- label: "Other" // label to give the new slice
804
- },
805
- highlight: {
806
- //color: "#fff", // will add this functionality once parseColor is available
807
- opacity: 0.5
808
- }
809
- }
810
- }
811
- };
812
-
813
- $.plot.plugins.push({
814
- init: init,
815
- options: options,
816
- name: "pie",
817
- version: "1.1"
818
- });
819
-
820
- })(jQuery);
1
+ /* Flot plugin for rendering pie charts.
2
+
3
+ Copyright (c) 2007-2014 IOLA and Ole Laursen.
4
+ Licensed under the MIT license.
5
+
6
+ The plugin assumes that each series has a single data value, and that each
7
+ value is a positive integer or zero. Negative numbers don't make sense for a
8
+ pie chart, and have unpredictable results. The values do NOT need to be
9
+ passed in as percentages; the plugin will calculate the total and per-slice
10
+ percentages internally.
11
+
12
+ * Created by Brian Medendorp
13
+
14
+ * Updated with contributions from btburnett3, Anthony Aragues and Xavi Ivars
15
+
16
+ The plugin supports these options:
17
+
18
+ series: {
19
+ pie: {
20
+ show: true/false
21
+ radius: 0-1 for percentage of fullsize, or a specified pixel length, or 'auto'
22
+ innerRadius: 0-1 for percentage of fullsize or a specified pixel length, for creating a donut effect
23
+ 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
24
+ tilt: 0-1 for percentage to tilt the pie, where 1 is no tilt, and 0 is completely flat (nothing will show)
25
+ offset: {
26
+ top: integer value to move the pie up or down
27
+ left: integer value to move the pie left or right, or 'auto'
28
+ },
29
+ stroke: {
30
+ color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#FFF')
31
+ width: integer pixel width of the stroke
32
+ },
33
+ label: {
34
+ show: true/false, or 'auto'
35
+ formatter: a user-defined function that modifies the text/style of the label text
36
+ radius: 0-1 for percentage of fullsize, or a specified pixel length
37
+ background: {
38
+ color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#000')
39
+ opacity: 0-1
40
+ },
41
+ threshold: 0-1 for the percentage value at which to hide labels (if they're too small)
42
+ },
43
+ combine: {
44
+ threshold: 0-1 for the percentage value at which to combine slices (if they're too small)
45
+ 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
46
+ label: any text value of what the combined slice should be labeled
47
+ }
48
+ highlight: {
49
+ opacity: 0-1
50
+ }
51
+ }
52
+ }
53
+
54
+ More detail and specific examples can be found in the included HTML file.
55
+
56
+ */
57
+
58
+ (function($) {
59
+
60
+ // Maximum redraw attempts when fitting labels within the plot
61
+
62
+ var REDRAW_ATTEMPTS = 10;
63
+
64
+ // Factor by which to shrink the pie when fitting labels within the plot
65
+
66
+ var REDRAW_SHRINK = 0.95;
67
+
68
+ function init(plot) {
69
+
70
+ var canvas = null,
71
+ target = null,
72
+ options = null,
73
+ maxRadius = null,
74
+ centerLeft = null,
75
+ centerTop = null,
76
+ processed = false,
77
+ ctx = null;
78
+
79
+ // interactive variables
80
+
81
+ var highlights = [];
82
+
83
+ // add hook to determine if pie plugin in enabled, and then perform necessary operations
84
+
85
+ plot.hooks.processOptions.push(function(plot, options) {
86
+ if (options.series.pie.show) {
87
+
88
+ options.grid.show = false;
89
+
90
+ // set labels.show
91
+
92
+ if (options.series.pie.label.show == "auto") {
93
+ if (options.legend.show) {
94
+ options.series.pie.label.show = false;
95
+ } else {
96
+ options.series.pie.label.show = true;
97
+ }
98
+ }
99
+
100
+ // set radius
101
+
102
+ if (options.series.pie.radius == "auto") {
103
+ if (options.series.pie.label.show) {
104
+ options.series.pie.radius = 3/4;
105
+ } else {
106
+ options.series.pie.radius = 1;
107
+ }
108
+ }
109
+
110
+ // ensure sane tilt
111
+
112
+ if (options.series.pie.tilt > 1) {
113
+ options.series.pie.tilt = 1;
114
+ } else if (options.series.pie.tilt < 0) {
115
+ options.series.pie.tilt = 0;
116
+ }
117
+ }
118
+ });
119
+
120
+ plot.hooks.bindEvents.push(function(plot, eventHolder) {
121
+ var options = plot.getOptions();
122
+ if (options.series.pie.show) {
123
+ if (options.grid.hoverable) {
124
+ eventHolder.unbind("mousemove").mousemove(onMouseMove);
125
+ }
126
+ if (options.grid.clickable) {
127
+ eventHolder.unbind("click").click(onClick);
128
+ }
129
+ }
130
+ });
131
+
132
+ plot.hooks.processDatapoints.push(function(plot, series, data, datapoints) {
133
+ var options = plot.getOptions();
134
+ if (options.series.pie.show) {
135
+ processDatapoints(plot, series, data, datapoints);
136
+ }
137
+ });
138
+
139
+ plot.hooks.drawOverlay.push(function(plot, octx) {
140
+ var options = plot.getOptions();
141
+ if (options.series.pie.show) {
142
+ drawOverlay(plot, octx);
143
+ }
144
+ });
145
+
146
+ plot.hooks.draw.push(function(plot, newCtx) {
147
+ var options = plot.getOptions();
148
+ if (options.series.pie.show) {
149
+ draw(plot, newCtx);
150
+ }
151
+ });
152
+
153
+ function processDatapoints(plot, series, datapoints) {
154
+ if (!processed) {
155
+ processed = true;
156
+ canvas = plot.getCanvas();
157
+ target = $(canvas).parent();
158
+ options = plot.getOptions();
159
+ plot.setData(combine(plot.getData()));
160
+ }
161
+ }
162
+
163
+ function combine(data) {
164
+
165
+ var total = 0,
166
+ combined = 0,
167
+ numCombined = 0,
168
+ color = options.series.pie.combine.color,
169
+ newdata = [];
170
+
171
+ // Fix up the raw data from Flot, ensuring the data is numeric
172
+
173
+ for (var i = 0; i < data.length; ++i) {
174
+
175
+ var value = data[i].data;
176
+
177
+ // If the data is an array, we'll assume that it's a standard
178
+ // Flot x-y pair, and are concerned only with the second value.
179
+
180
+ // Note how we use the original array, rather than creating a
181
+ // new one; this is more efficient and preserves any extra data
182
+ // that the user may have stored in higher indexes.
183
+
184
+ if ($.isArray(value) && value.length == 1) {
185
+ value = value[0];
186
+ }
187
+
188
+ if ($.isArray(value)) {
189
+ // Equivalent to $.isNumeric() but compatible with jQuery < 1.7
190
+ if (!isNaN(parseFloat(value[1])) && isFinite(value[1])) {
191
+ value[1] = +value[1];
192
+ } else {
193
+ value[1] = 0;
194
+ }
195
+ } else if (!isNaN(parseFloat(value)) && isFinite(value)) {
196
+ value = [1, +value];
197
+ } else {
198
+ value = [1, 0];
199
+ }
200
+
201
+ data[i].data = [value];
202
+ }
203
+
204
+ // Sum up all the slices, so we can calculate percentages for each
205
+
206
+ for (var i = 0; i < data.length; ++i) {
207
+ total += data[i].data[0][1];
208
+ }
209
+
210
+ // Count the number of slices with percentages below the combine
211
+ // threshold; if it turns out to be just one, we won't combine.
212
+
213
+ for (var i = 0; i < data.length; ++i) {
214
+ var value = data[i].data[0][1];
215
+ if (value / total <= options.series.pie.combine.threshold) {
216
+ combined += value;
217
+ numCombined++;
218
+ if (!color) {
219
+ color = data[i].color;
220
+ }
221
+ }
222
+ }
223
+
224
+ for (var i = 0; i < data.length; ++i) {
225
+ var value = data[i].data[0][1];
226
+ if (numCombined < 2 || value / total > options.series.pie.combine.threshold) {
227
+ newdata.push(
228
+ $.extend(data[i], { /* extend to allow keeping all other original data values
229
+ and using them e.g. in labelFormatter. */
230
+ data: [[1, value]],
231
+ color: data[i].color,
232
+ label: data[i].label,
233
+ angle: value * Math.PI * 2 / total,
234
+ percent: value / (total / 100)
235
+ })
236
+ );
237
+ }
238
+ }
239
+
240
+ if (numCombined > 1) {
241
+ newdata.push({
242
+ data: [[1, combined]],
243
+ color: color,
244
+ label: options.series.pie.combine.label,
245
+ angle: combined * Math.PI * 2 / total,
246
+ percent: combined / (total / 100)
247
+ });
248
+ }
249
+
250
+ return newdata;
251
+ }
252
+
253
+ function draw(plot, newCtx) {
254
+
255
+ if (!target) {
256
+ return; // if no series were passed
257
+ }
258
+
259
+ var canvasWidth = plot.getPlaceholder().width(),
260
+ canvasHeight = plot.getPlaceholder().height(),
261
+ legendWidth = target.children().filter(".legend").children().width() || 0;
262
+
263
+ ctx = newCtx;
264
+
265
+ // WARNING: HACK! REWRITE THIS CODE AS SOON AS POSSIBLE!
266
+
267
+ // When combining smaller slices into an 'other' slice, we need to
268
+ // add a new series. Since Flot gives plugins no way to modify the
269
+ // list of series, the pie plugin uses a hack where the first call
270
+ // to processDatapoints results in a call to setData with the new
271
+ // list of series, then subsequent processDatapoints do nothing.
272
+
273
+ // The plugin-global 'processed' flag is used to control this hack;
274
+ // it starts out false, and is set to true after the first call to
275
+ // processDatapoints.
276
+
277
+ // Unfortunately this turns future setData calls into no-ops; they
278
+ // call processDatapoints, the flag is true, and nothing happens.
279
+
280
+ // To fix this we'll set the flag back to false here in draw, when
281
+ // all series have been processed, so the next sequence of calls to
282
+ // processDatapoints once again starts out with a slice-combine.
283
+ // This is really a hack; in 0.9 we need to give plugins a proper
284
+ // way to modify series before any processing begins.
285
+
286
+ processed = false;
287
+
288
+ // calculate maximum radius and center point
289
+
290
+ maxRadius = Math.min(canvasWidth, canvasHeight / options.series.pie.tilt) / 2;
291
+ centerTop = canvasHeight / 2 + options.series.pie.offset.top;
292
+ centerLeft = canvasWidth / 2;
293
+
294
+ if (options.series.pie.offset.left == "auto") {
295
+ if (options.legend.position.match("w")) {
296
+ centerLeft += legendWidth / 2;
297
+ } else {
298
+ centerLeft -= legendWidth / 2;
299
+ }
300
+ if (centerLeft < maxRadius) {
301
+ centerLeft = maxRadius;
302
+ } else if (centerLeft > canvasWidth - maxRadius) {
303
+ centerLeft = canvasWidth - maxRadius;
304
+ }
305
+ } else {
306
+ centerLeft += options.series.pie.offset.left;
307
+ }
308
+
309
+ var slices = plot.getData(),
310
+ attempts = 0;
311
+
312
+ // Keep shrinking the pie's radius until drawPie returns true,
313
+ // indicating that all the labels fit, or we try too many times.
314
+
315
+ do {
316
+ if (attempts > 0) {
317
+ maxRadius *= REDRAW_SHRINK;
318
+ }
319
+ attempts += 1;
320
+ clear();
321
+ if (options.series.pie.tilt <= 0.8) {
322
+ drawShadow();
323
+ }
324
+ } while (!drawPie() && attempts < REDRAW_ATTEMPTS)
325
+
326
+ if (attempts >= REDRAW_ATTEMPTS) {
327
+ clear();
328
+ target.prepend("<div class='error'>Could not draw pie with labels contained inside canvas</div>");
329
+ }
330
+
331
+ if (plot.setSeries && plot.insertLegend) {
332
+ plot.setSeries(slices);
333
+ plot.insertLegend();
334
+ }
335
+
336
+ // we're actually done at this point, just defining internal functions at this point
337
+
338
+ function clear() {
339
+ ctx.clearRect(0, 0, canvasWidth, canvasHeight);
340
+ target.children().filter(".pieLabel, .pieLabelBackground").remove();
341
+ }
342
+
343
+ function drawShadow() {
344
+
345
+ var shadowLeft = options.series.pie.shadow.left;
346
+ var shadowTop = options.series.pie.shadow.top;
347
+ var edge = 10;
348
+ var alpha = options.series.pie.shadow.alpha;
349
+ var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;
350
+
351
+ if (radius >= canvasWidth / 2 - shadowLeft || radius * options.series.pie.tilt >= canvasHeight / 2 - shadowTop || radius <= edge) {
352
+ return; // shadow would be outside canvas, so don't draw it
353
+ }
354
+
355
+ ctx.save();
356
+ ctx.translate(shadowLeft,shadowTop);
357
+ ctx.globalAlpha = alpha;
358
+ ctx.fillStyle = "#000";
359
+
360
+ // center and rotate to starting position
361
+
362
+ ctx.translate(centerLeft,centerTop);
363
+ ctx.scale(1, options.series.pie.tilt);
364
+
365
+ //radius -= edge;
366
+
367
+ for (var i = 1; i <= edge; i++) {
368
+ ctx.beginPath();
369
+ ctx.arc(0, 0, radius, 0, Math.PI * 2, false);
370
+ ctx.fill();
371
+ radius -= i;
372
+ }
373
+
374
+ ctx.restore();
375
+ }
376
+
377
+ function drawPie() {
378
+
379
+ var startAngle = Math.PI * options.series.pie.startAngle;
380
+ var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;
381
+
382
+ // center and rotate to starting position
383
+
384
+ ctx.save();
385
+ ctx.translate(centerLeft,centerTop);
386
+ ctx.scale(1, options.series.pie.tilt);
387
+ //ctx.rotate(startAngle); // start at top; -- This doesn't work properly in Opera
388
+
389
+ // draw slices
390
+
391
+ ctx.save();
392
+ var currentAngle = startAngle;
393
+ for (var i = 0; i < slices.length; ++i) {
394
+ slices[i].startAngle = currentAngle;
395
+ drawSlice(slices[i].angle, slices[i].color, true);
396
+ }
397
+ ctx.restore();
398
+
399
+ // draw slice outlines
400
+
401
+ if (options.series.pie.stroke.width > 0) {
402
+ ctx.save();
403
+ ctx.lineWidth = options.series.pie.stroke.width;
404
+ currentAngle = startAngle;
405
+ for (var i = 0; i < slices.length; ++i) {
406
+ drawSlice(slices[i].angle, options.series.pie.stroke.color, false);
407
+ }
408
+ ctx.restore();
409
+ }
410
+
411
+ // draw donut hole
412
+
413
+ drawDonutHole(ctx);
414
+
415
+ ctx.restore();
416
+
417
+ // Draw the labels, returning true if they fit within the plot
418
+
419
+ if (options.series.pie.label.show) {
420
+ return drawLabels();
421
+ } else return true;
422
+
423
+ function drawSlice(angle, color, fill) {
424
+
425
+ if (angle <= 0 || isNaN(angle)) {
426
+ return;
427
+ }
428
+
429
+ if (fill) {
430
+ ctx.fillStyle = color;
431
+ } else {
432
+ ctx.strokeStyle = color;
433
+ ctx.lineJoin = "round";
434
+ }
435
+
436
+ ctx.beginPath();
437
+ if (Math.abs(angle - Math.PI * 2) > 0.000000001) {
438
+ ctx.moveTo(0, 0); // Center of the pie
439
+ }
440
+
441
+ //ctx.arc(0, 0, radius, 0, angle, false); // This doesn't work properly in Opera
442
+ ctx.arc(0, 0, radius,currentAngle, currentAngle + angle / 2, false);
443
+ ctx.arc(0, 0, radius,currentAngle + angle / 2, currentAngle + angle, false);
444
+ ctx.closePath();
445
+ //ctx.rotate(angle); // This doesn't work properly in Opera
446
+ currentAngle += angle;
447
+
448
+ if (fill) {
449
+ ctx.fill();
450
+ } else {
451
+ ctx.stroke();
452
+ }
453
+ }
454
+
455
+ function drawLabels() {
456
+
457
+ var currentAngle = startAngle;
458
+ var radius = options.series.pie.label.radius > 1 ? options.series.pie.label.radius : maxRadius * options.series.pie.label.radius;
459
+
460
+ for (var i = 0; i < slices.length; ++i) {
461
+ if (slices[i].percent >= options.series.pie.label.threshold * 100) {
462
+ if (!drawLabel(slices[i], currentAngle, i)) {
463
+ return false;
464
+ }
465
+ }
466
+ currentAngle += slices[i].angle;
467
+ }
468
+
469
+ return true;
470
+
471
+ function drawLabel(slice, startAngle, index) {
472
+
473
+ if (slice.data[0][1] == 0) {
474
+ return true;
475
+ }
476
+
477
+ // format label text
478
+
479
+ var lf = options.legend.labelFormatter, text, plf = options.series.pie.label.formatter;
480
+
481
+ if (lf) {
482
+ text = lf(slice.label, slice);
483
+ } else {
484
+ text = slice.label;
485
+ }
486
+
487
+ if (plf) {
488
+ text = plf(text, slice);
489
+ }
490
+
491
+ var halfAngle = ((startAngle + slice.angle) + startAngle) / 2;
492
+ var x = centerLeft + Math.round(Math.cos(halfAngle) * radius);
493
+ var y = centerTop + Math.round(Math.sin(halfAngle) * radius) * options.series.pie.tilt;
494
+
495
+ var html = "<span class='pieLabel' id='pieLabel" + index + "' style='position:absolute;top:" + y + "px;left:" + x + "px;'>" + text + "</span>";
496
+ target.append(html);
497
+
498
+ var label = target.children("#pieLabel" + index);
499
+ var labelTop = (y - label.height() / 2);
500
+ var labelLeft = (x - label.width() / 2);
501
+
502
+ label.css("top", labelTop);
503
+ label.css("left", labelLeft);
504
+
505
+ // check to make sure that the label is not outside the canvas
506
+
507
+ if (0 - labelTop > 0 || 0 - labelLeft > 0 || canvasHeight - (labelTop + label.height()) < 0 || canvasWidth - (labelLeft + label.width()) < 0) {
508
+ return false;
509
+ }
510
+
511
+ if (options.series.pie.label.background.opacity != 0) {
512
+
513
+ // put in the transparent background separately to avoid blended labels and label boxes
514
+
515
+ var c = options.series.pie.label.background.color;
516
+
517
+ if (c == null) {
518
+ c = slice.color;
519
+ }
520
+
521
+ var pos = "top:" + labelTop + "px;left:" + labelLeft + "px;";
522
+ $("<div class='pieLabelBackground' style='position:absolute;width:" + label.width() + "px;height:" + label.height() + "px;" + pos + "background-color:" + c + ";'></div>")
523
+ .css("opacity", options.series.pie.label.background.opacity)
524
+ .insertBefore(label);
525
+ }
526
+
527
+ return true;
528
+ } // end individual label function
529
+ } // end drawLabels function
530
+ } // end drawPie function
531
+ } // end draw function
532
+
533
+ // Placed here because it needs to be accessed from multiple locations
534
+
535
+ function drawDonutHole(layer) {
536
+ if (options.series.pie.innerRadius > 0) {
537
+
538
+ // subtract the center
539
+
540
+ layer.save();
541
+ var innerRadius = options.series.pie.innerRadius > 1 ? options.series.pie.innerRadius : maxRadius * options.series.pie.innerRadius;
542
+ layer.globalCompositeOperation = "destination-out"; // this does not work with excanvas, but it will fall back to using the stroke color
543
+ layer.beginPath();
544
+ layer.fillStyle = options.series.pie.stroke.color;
545
+ layer.arc(0, 0, innerRadius, 0, Math.PI * 2, false);
546
+ layer.fill();
547
+ layer.closePath();
548
+ layer.restore();
549
+
550
+ // add inner stroke
551
+
552
+ layer.save();
553
+ layer.beginPath();
554
+ layer.strokeStyle = options.series.pie.stroke.color;
555
+ layer.arc(0, 0, innerRadius, 0, Math.PI * 2, false);
556
+ layer.stroke();
557
+ layer.closePath();
558
+ layer.restore();
559
+
560
+ // TODO: add extra shadow inside hole (with a mask) if the pie is tilted.
561
+ }
562
+ }
563
+
564
+ //-- Additional Interactive related functions --
565
+
566
+ function isPointInPoly(poly, pt) {
567
+ for(var c = false, i = -1, l = poly.length, j = l - 1; ++i < l; j = i)
568
+ ((poly[i][1] <= pt[1] && pt[1] < poly[j][1]) || (poly[j][1] <= pt[1] && pt[1]< poly[i][1]))
569
+ && (pt[0] < (poly[j][0] - poly[i][0]) * (pt[1] - poly[i][1]) / (poly[j][1] - poly[i][1]) + poly[i][0])
570
+ && (c = !c);
571
+ return c;
572
+ }
573
+
574
+ function findNearbySlice(mouseX, mouseY) {
575
+
576
+ var slices = plot.getData(),
577
+ options = plot.getOptions(),
578
+ radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius,
579
+ x, y;
580
+
581
+ for (var i = 0; i < slices.length; ++i) {
582
+
583
+ var s = slices[i];
584
+
585
+ if (s.pie.show) {
586
+
587
+ ctx.save();
588
+ ctx.beginPath();
589
+ ctx.moveTo(0, 0); // Center of the pie
590
+ //ctx.scale(1, options.series.pie.tilt); // this actually seems to break everything when here.
591
+ ctx.arc(0, 0, radius, s.startAngle, s.startAngle + s.angle / 2, false);
592
+ ctx.arc(0, 0, radius, s.startAngle + s.angle / 2, s.startAngle + s.angle, false);
593
+ ctx.closePath();
594
+ x = mouseX - centerLeft;
595
+ y = mouseY - centerTop;
596
+
597
+ if (ctx.isPointInPath) {
598
+ if (ctx.isPointInPath(mouseX - centerLeft, mouseY - centerTop)) {
599
+ ctx.restore();
600
+ return {
601
+ datapoint: [s.percent, s.data],
602
+ dataIndex: 0,
603
+ series: s,
604
+ seriesIndex: i
605
+ };
606
+ }
607
+ } else {
608
+
609
+ // excanvas for IE doesn;t support isPointInPath, this is a workaround.
610
+
611
+ var p1X = radius * Math.cos(s.startAngle),
612
+ p1Y = radius * Math.sin(s.startAngle),
613
+ p2X = radius * Math.cos(s.startAngle + s.angle / 4),
614
+ p2Y = radius * Math.sin(s.startAngle + s.angle / 4),
615
+ p3X = radius * Math.cos(s.startAngle + s.angle / 2),
616
+ p3Y = radius * Math.sin(s.startAngle + s.angle / 2),
617
+ p4X = radius * Math.cos(s.startAngle + s.angle / 1.5),
618
+ p4Y = radius * Math.sin(s.startAngle + s.angle / 1.5),
619
+ p5X = radius * Math.cos(s.startAngle + s.angle),
620
+ p5Y = radius * Math.sin(s.startAngle + s.angle),
621
+ arrPoly = [[0, 0], [p1X, p1Y], [p2X, p2Y], [p3X, p3Y], [p4X, p4Y], [p5X, p5Y]],
622
+ arrPoint = [x, y];
623
+
624
+ // TODO: perhaps do some mathmatical trickery here with the Y-coordinate to compensate for pie tilt?
625
+
626
+ if (isPointInPoly(arrPoly, arrPoint)) {
627
+ ctx.restore();
628
+ return {
629
+ datapoint: [s.percent, s.data],
630
+ dataIndex: 0,
631
+ series: s,
632
+ seriesIndex: i
633
+ };
634
+ }
635
+ }
636
+
637
+ ctx.restore();
638
+ }
639
+ }
640
+
641
+ return null;
642
+ }
643
+
644
+ function onMouseMove(e) {
645
+ triggerClickHoverEvent("plothover", e);
646
+ }
647
+
648
+ function onClick(e) {
649
+ triggerClickHoverEvent("plotclick", e);
650
+ }
651
+
652
+ // trigger click or hover event (they send the same parameters so we share their code)
653
+
654
+ function triggerClickHoverEvent(eventname, e) {
655
+
656
+ var offset = plot.offset();
657
+ var canvasX = parseInt(e.pageX - offset.left);
658
+ var canvasY = parseInt(e.pageY - offset.top);
659
+ var item = findNearbySlice(canvasX, canvasY);
660
+
661
+ if (options.grid.autoHighlight) {
662
+
663
+ // clear auto-highlights
664
+
665
+ for (var i = 0; i < highlights.length; ++i) {
666
+ var h = highlights[i];
667
+ if (h.auto == eventname && !(item && h.series == item.series)) {
668
+ unhighlight(h.series);
669
+ }
670
+ }
671
+ }
672
+
673
+ // highlight the slice
674
+
675
+ if (item) {
676
+ highlight(item.series, eventname);
677
+ }
678
+
679
+ // trigger any hover bind events
680
+
681
+ var pos = { pageX: e.pageX, pageY: e.pageY };
682
+ target.trigger(eventname, [pos, item]);
683
+ }
684
+
685
+ function highlight(s, auto) {
686
+ //if (typeof s == "number") {
687
+ // s = series[s];
688
+ //}
689
+
690
+ var i = indexOfHighlight(s);
691
+
692
+ if (i == -1) {
693
+ highlights.push({ series: s, auto: auto });
694
+ plot.triggerRedrawOverlay();
695
+ } else if (!auto) {
696
+ highlights[i].auto = false;
697
+ }
698
+ }
699
+
700
+ function unhighlight(s) {
701
+ if (s == null) {
702
+ highlights = [];
703
+ plot.triggerRedrawOverlay();
704
+ }
705
+
706
+ //if (typeof s == "number") {
707
+ // s = series[s];
708
+ //}
709
+
710
+ var i = indexOfHighlight(s);
711
+
712
+ if (i != -1) {
713
+ highlights.splice(i, 1);
714
+ plot.triggerRedrawOverlay();
715
+ }
716
+ }
717
+
718
+ function indexOfHighlight(s) {
719
+ for (var i = 0; i < highlights.length; ++i) {
720
+ var h = highlights[i];
721
+ if (h.series == s)
722
+ return i;
723
+ }
724
+ return -1;
725
+ }
726
+
727
+ function drawOverlay(plot, octx) {
728
+
729
+ var options = plot.getOptions();
730
+
731
+ var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;
732
+
733
+ octx.save();
734
+ octx.translate(centerLeft, centerTop);
735
+ octx.scale(1, options.series.pie.tilt);
736
+
737
+ for (var i = 0; i < highlights.length; ++i) {
738
+ drawHighlight(highlights[i].series);
739
+ }
740
+
741
+ drawDonutHole(octx);
742
+
743
+ octx.restore();
744
+
745
+ function drawHighlight(series) {
746
+
747
+ if (series.angle <= 0 || isNaN(series.angle)) {
748
+ return;
749
+ }
750
+
751
+ //octx.fillStyle = parseColor(options.series.pie.highlight.color).scale(null, null, null, options.series.pie.highlight.opacity).toString();
752
+ octx.fillStyle = "rgba(255, 255, 255, " + options.series.pie.highlight.opacity + ")"; // this is temporary until we have access to parseColor
753
+ octx.beginPath();
754
+ if (Math.abs(series.angle - Math.PI * 2) > 0.000000001) {
755
+ octx.moveTo(0, 0); // Center of the pie
756
+ }
757
+ octx.arc(0, 0, radius, series.startAngle, series.startAngle + series.angle / 2, false);
758
+ octx.arc(0, 0, radius, series.startAngle + series.angle / 2, series.startAngle + series.angle, false);
759
+ octx.closePath();
760
+ octx.fill();
761
+ }
762
+ }
763
+ } // end init (plugin body)
764
+
765
+ // define pie specific options and their default values
766
+
767
+ var options = {
768
+ series: {
769
+ pie: {
770
+ show: false,
771
+ radius: "auto", // actual radius of the visible pie (based on full calculated radius if <=1, or hard pixel value)
772
+ innerRadius: 0, /* for donut */
773
+ startAngle: 3/2,
774
+ tilt: 1,
775
+ shadow: {
776
+ left: 5, // shadow left offset
777
+ top: 15, // shadow top offset
778
+ alpha: 0.02 // shadow alpha
779
+ },
780
+ offset: {
781
+ top: 0,
782
+ left: "auto"
783
+ },
784
+ stroke: {
785
+ color: "#fff",
786
+ width: 1
787
+ },
788
+ label: {
789
+ show: "auto",
790
+ formatter: function(label, slice) {
791
+ return "<div style='font-size:x-small;text-align:center;padding:2px;color:" + slice.color + ";'>" + label + "<br/>" + Math.round(slice.percent) + "%</div>";
792
+ }, // formatter function
793
+ radius: 1, // radius at which to place the labels (based on full calculated radius if <=1, or hard pixel value)
794
+ background: {
795
+ color: null,
796
+ opacity: 0
797
+ },
798
+ threshold: 0 // percentage at which to hide the label (i.e. the slice is too narrow)
799
+ },
800
+ combine: {
801
+ threshold: -1, // percentage at which to combine little slices into one larger slice
802
+ color: null, // color to give the new slice (auto-generated if null)
803
+ label: "Other" // label to give the new slice
804
+ },
805
+ highlight: {
806
+ //color: "#fff", // will add this functionality once parseColor is available
807
+ opacity: 0.5
808
+ }
809
+ }
810
+ }
811
+ };
812
+
813
+ $.plot.plugins.push({
814
+ init: init,
815
+ options: options,
816
+ name: "pie",
817
+ version: "1.1"
818
+ });
819
+
820
+ })(jQuery);