aw-highstock_rails 7.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (697) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +9 -0
  3. data/.travis.yml +7 -0
  4. data/CODE_OF_CONDUCT.md +74 -0
  5. data/Gemfile +6 -0
  6. data/Gemfile.lock +22 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +53 -0
  9. data/Rakefile +10 -0
  10. data/aw-highstock_rails.gemspec +28 -0
  11. data/bin/console +14 -0
  12. data/bin/setup +8 -0
  13. data/lib/aw/highstock_rails.rb +9 -0
  14. data/lib/aw/highstock_rails/version.rb +5 -0
  15. data/vendor/assets/javascripts/highstock/css/annotations/popup.css +229 -0
  16. data/vendor/assets/javascripts/highstock/css/annotations/popup.scss +235 -0
  17. data/vendor/assets/javascripts/highstock/css/highcharts.css +890 -0
  18. data/vendor/assets/javascripts/highstock/css/highcharts.scss +788 -0
  19. data/vendor/assets/javascripts/highstock/css/stocktools/gui.css +268 -0
  20. data/vendor/assets/javascripts/highstock/css/stocktools/gui.scss +270 -0
  21. data/vendor/assets/javascripts/highstock/css/themes/dark-unica.css +951 -0
  22. data/vendor/assets/javascripts/highstock/css/themes/dark-unica.scss +122 -0
  23. data/vendor/assets/javascripts/highstock/css/themes/grid-light.css +904 -0
  24. data/vendor/assets/javascripts/highstock/css/themes/grid-light.scss +33 -0
  25. data/vendor/assets/javascripts/highstock/css/themes/sand-signika.css +920 -0
  26. data/vendor/assets/javascripts/highstock/css/themes/sand-signika.scss +74 -0
  27. data/vendor/assets/javascripts/highstock/es-modules/annotations/ControlPoint.js +130 -0
  28. data/vendor/assets/javascripts/highstock/es-modules/annotations/MockPoint.js +415 -0
  29. data/vendor/assets/javascripts/highstock/es-modules/annotations/annotations.src.js +1231 -0
  30. data/vendor/assets/javascripts/highstock/es-modules/annotations/controllable/ControllableCircle.js +92 -0
  31. data/vendor/assets/javascripts/highstock/es-modules/annotations/controllable/ControllableImage.js +101 -0
  32. data/vendor/assets/javascripts/highstock/es-modules/annotations/controllable/ControllableLabel.js +452 -0
  33. data/vendor/assets/javascripts/highstock/es-modules/annotations/controllable/ControllablePath.js +175 -0
  34. data/vendor/assets/javascripts/highstock/es-modules/annotations/controllable/ControllableRect.js +93 -0
  35. data/vendor/assets/javascripts/highstock/es-modules/annotations/controllable/controllableMixin.js +411 -0
  36. data/vendor/assets/javascripts/highstock/es-modules/annotations/controllable/markerMixin.js +214 -0
  37. data/vendor/assets/javascripts/highstock/es-modules/annotations/eventEmitterMixin.js +271 -0
  38. data/vendor/assets/javascripts/highstock/es-modules/annotations/navigationBindings.js +1283 -0
  39. data/vendor/assets/javascripts/highstock/es-modules/annotations/popup.js +1069 -0
  40. data/vendor/assets/javascripts/highstock/es-modules/annotations/types/CrookedLine.js +191 -0
  41. data/vendor/assets/javascripts/highstock/es-modules/annotations/types/ElliottWave.js +76 -0
  42. data/vendor/assets/javascripts/highstock/es-modules/annotations/types/Fibonacci.js +247 -0
  43. data/vendor/assets/javascripts/highstock/es-modules/annotations/types/InfinityLine.js +185 -0
  44. data/vendor/assets/javascripts/highstock/es-modules/annotations/types/Measure.js +928 -0
  45. data/vendor/assets/javascripts/highstock/es-modules/annotations/types/Pitchfork.js +203 -0
  46. data/vendor/assets/javascripts/highstock/es-modules/annotations/types/Tunnel.js +242 -0
  47. data/vendor/assets/javascripts/highstock/es-modules/annotations/types/VerticalLine.js +157 -0
  48. data/vendor/assets/javascripts/highstock/es-modules/error-messages.js +128 -0
  49. data/vendor/assets/javascripts/highstock/es-modules/error.js +1 -0
  50. data/vendor/assets/javascripts/highstock/es-modules/indicators/acceleration-bands.src.js +199 -0
  51. data/vendor/assets/javascripts/highstock/es-modules/indicators/accumulation-distribution.src.js +129 -0
  52. data/vendor/assets/javascripts/highstock/es-modules/indicators/ao.src.js +206 -0
  53. data/vendor/assets/javascripts/highstock/es-modules/indicators/apo.src.js +148 -0
  54. data/vendor/assets/javascripts/highstock/es-modules/indicators/aroon-oscillator.src.js +128 -0
  55. data/vendor/assets/javascripts/highstock/es-modules/indicators/aroon.src.js +173 -0
  56. data/vendor/assets/javascripts/highstock/es-modules/indicators/atr.src.js +151 -0
  57. data/vendor/assets/javascripts/highstock/es-modules/indicators/bollinger-bands.src.js +209 -0
  58. data/vendor/assets/javascripts/highstock/es-modules/indicators/cci.src.js +131 -0
  59. data/vendor/assets/javascripts/highstock/es-modules/indicators/chaikin.src.js +167 -0
  60. data/vendor/assets/javascripts/highstock/es-modules/indicators/cmf.src.js +246 -0
  61. data/vendor/assets/javascripts/highstock/es-modules/indicators/dema.src.js +191 -0
  62. data/vendor/assets/javascripts/highstock/es-modules/indicators/dpo.src.js +138 -0
  63. data/vendor/assets/javascripts/highstock/es-modules/indicators/ema.src.js +166 -0
  64. data/vendor/assets/javascripts/highstock/es-modules/indicators/ichimoku-kinko-hyo.src.js +850 -0
  65. data/vendor/assets/javascripts/highstock/es-modules/indicators/indicators.src.js +425 -0
  66. data/vendor/assets/javascripts/highstock/es-modules/indicators/keltner-channels.src.js +193 -0
  67. data/vendor/assets/javascripts/highstock/es-modules/indicators/macd.src.js +417 -0
  68. data/vendor/assets/javascripts/highstock/es-modules/indicators/mfi.src.js +198 -0
  69. data/vendor/assets/javascripts/highstock/es-modules/indicators/momentum.src.js +119 -0
  70. data/vendor/assets/javascripts/highstock/es-modules/indicators/natr.src.js +74 -0
  71. data/vendor/assets/javascripts/highstock/es-modules/indicators/pivot-points.src.js +360 -0
  72. data/vendor/assets/javascripts/highstock/es-modules/indicators/ppo.src.js +152 -0
  73. data/vendor/assets/javascripts/highstock/es-modules/indicators/price-channel.src.js +149 -0
  74. data/vendor/assets/javascripts/highstock/es-modules/indicators/price-envelopes.src.js +251 -0
  75. data/vendor/assets/javascripts/highstock/es-modules/indicators/psar.src.js +307 -0
  76. data/vendor/assets/javascripts/highstock/es-modules/indicators/regressions.src.js +427 -0
  77. data/vendor/assets/javascripts/highstock/es-modules/indicators/roc.src.js +149 -0
  78. data/vendor/assets/javascripts/highstock/es-modules/indicators/rsi.src.js +163 -0
  79. data/vendor/assets/javascripts/highstock/es-modules/indicators/stochastic.src.js +193 -0
  80. data/vendor/assets/javascripts/highstock/es-modules/indicators/supertrend.src.js +544 -0
  81. data/vendor/assets/javascripts/highstock/es-modules/indicators/tema.src.js +247 -0
  82. data/vendor/assets/javascripts/highstock/es-modules/indicators/trix.src.js +96 -0
  83. data/vendor/assets/javascripts/highstock/es-modules/indicators/volume-by-price.src.js +671 -0
  84. data/vendor/assets/javascripts/highstock/es-modules/indicators/vwap.src.js +189 -0
  85. data/vendor/assets/javascripts/highstock/es-modules/indicators/williams-r.src.js +128 -0
  86. data/vendor/assets/javascripts/highstock/es-modules/indicators/wma.src.js +146 -0
  87. data/vendor/assets/javascripts/highstock/es-modules/indicators/zigzag.src.js +221 -0
  88. data/vendor/assets/javascripts/highstock/es-modules/masters/highcharts-3d.src.js +17 -0
  89. data/vendor/assets/javascripts/highstock/es-modules/masters/highcharts-more.src.js +22 -0
  90. data/vendor/assets/javascripts/highstock/es-modules/masters/highstock.src.js +11 -0
  91. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/acceleration-bands.src.js +11 -0
  92. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/accumulation-distribution.src.js +11 -0
  93. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/ao.src.js +11 -0
  94. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/apo.src.js +11 -0
  95. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/aroon-oscillator.src.js +11 -0
  96. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/aroon.src.js +11 -0
  97. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/atr.src.js +11 -0
  98. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/bollinger-bands.src.js +11 -0
  99. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/cci.src.js +11 -0
  100. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/chaikin.src.js +11 -0
  101. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/cmf.src.js +10 -0
  102. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/dema.src.js +11 -0
  103. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/dpo.src.js +11 -0
  104. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/ema.src.js +11 -0
  105. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/ichimoku-kinko-hyo.src.js +11 -0
  106. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/indicators-all.src.js +49 -0
  107. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/indicators.src.js +11 -0
  108. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/keltner-channels.src.js +11 -0
  109. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/macd.src.js +11 -0
  110. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/mfi.src.js +11 -0
  111. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/momentum.src.js +11 -0
  112. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/natr.src.js +11 -0
  113. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/pivot-points.src.js +11 -0
  114. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/ppo.src.js +11 -0
  115. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/price-channel.src.js +11 -0
  116. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/price-envelopes.src.js +11 -0
  117. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/psar.src.js +11 -0
  118. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/regressions.src.js +11 -0
  119. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/roc.src.js +11 -0
  120. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/rsi.src.js +11 -0
  121. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/stochastic.src.js +11 -0
  122. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/supertrend.src.js +11 -0
  123. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/tema.src.js +11 -0
  124. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/trix.src.js +11 -0
  125. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/volume-by-price.src.js +11 -0
  126. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/vwap.src.js +11 -0
  127. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/williams-r.src.js +11 -0
  128. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/wma.src.js +11 -0
  129. data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/zigzag.src.js +11 -0
  130. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/accessibility.src.js +13 -0
  131. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/annotations-advanced.src.js +20 -0
  132. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/annotations.src.js +12 -0
  133. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/arrow-symbols.src.js +10 -0
  134. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/boost-canvas.src.js +11 -0
  135. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/boost.src.js +11 -0
  136. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/bullet.src.js +11 -0
  137. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/current-date-indicator.src.js +10 -0
  138. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/cylinder.src.js +10 -0
  139. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/data.src.js +10 -0
  140. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/datagrouping.src.js +12 -0
  141. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/debugger.src.js +13 -0
  142. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/dependency-wheel.src.js +10 -0
  143. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/drag-panes.src.js +11 -0
  144. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/draggable-points.src.js +9 -0
  145. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/drilldown.src.js +10 -0
  146. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/export-data.src.js +10 -0
  147. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/exporting.src.js +10 -0
  148. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/full-screen.src.js +11 -0
  149. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/funnel.src.js +10 -0
  150. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/grid-axis.src.js +10 -0
  151. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/heatmap.src.js +11 -0
  152. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/histogram-bellcurve.src.js +11 -0
  153. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/item-series.src.js +11 -0
  154. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/networkgraph.src.js +10 -0
  155. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/no-data-to-display.src.js +11 -0
  156. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/offline-exporting.src.js +10 -0
  157. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/oldie-polyfills.src.js +11 -0
  158. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/oldie.src.js +11 -0
  159. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/overlapping-datalabels.src.js +9 -0
  160. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/parallel-coordinates.src.js +11 -0
  161. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/pareto.src.js +11 -0
  162. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/pathfinder.src.js +10 -0
  163. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/pattern-fill.src.js +11 -0
  164. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/price-indicator.src.js +11 -0
  165. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/sankey.src.js +10 -0
  166. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/series-label.src.js +9 -0
  167. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/solid-gauge.src.js +10 -0
  168. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/sonification.src.js +12 -0
  169. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/static-scale.src.js +10 -0
  170. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/stock-tools.src.js +12 -0
  171. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/stock.src.js +19 -0
  172. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/streamgraph.src.js +10 -0
  173. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/sunburst.src.js +10 -0
  174. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/tilemap.src.js +10 -0
  175. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/timeline.src.js +11 -0
  176. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/treegrid.src.js +10 -0
  177. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/treemap.src.js +10 -0
  178. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/variable-pie.src.js +11 -0
  179. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/variwide.src.js +10 -0
  180. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/vector.src.js +10 -0
  181. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/venn.src.js +10 -0
  182. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/windbarb.src.js +10 -0
  183. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/wordcloud.src.js +10 -0
  184. data/vendor/assets/javascripts/highstock/es-modules/masters/modules/xrange.src.js +10 -0
  185. data/vendor/assets/javascripts/highstock/es-modules/masters/themes/avocado.js +9 -0
  186. data/vendor/assets/javascripts/highstock/es-modules/masters/themes/avocado.src.js +9 -0
  187. data/vendor/assets/javascripts/highstock/es-modules/masters/themes/dark-blue.src.js +9 -0
  188. data/vendor/assets/javascripts/highstock/es-modules/masters/themes/dark-green.src.js +9 -0
  189. data/vendor/assets/javascripts/highstock/es-modules/masters/themes/dark-unica.src.js +9 -0
  190. data/vendor/assets/javascripts/highstock/es-modules/masters/themes/gray.src.js +9 -0
  191. data/vendor/assets/javascripts/highstock/es-modules/masters/themes/grid-light.src.js +9 -0
  192. data/vendor/assets/javascripts/highstock/es-modules/masters/themes/grid.src.js +9 -0
  193. data/vendor/assets/javascripts/highstock/es-modules/masters/themes/sand-signika.src.js +9 -0
  194. data/vendor/assets/javascripts/highstock/es-modules/masters/themes/skies.src.js +9 -0
  195. data/vendor/assets/javascripts/highstock/es-modules/masters/themes/sunset.js +9 -0
  196. data/vendor/assets/javascripts/highstock/es-modules/masters/themes/sunset.src.js +9 -0
  197. data/vendor/assets/javascripts/highstock/es-modules/mixins/ajax.js +123 -0
  198. data/vendor/assets/javascripts/highstock/es-modules/mixins/centered-series.js +116 -0
  199. data/vendor/assets/javascripts/highstock/es-modules/mixins/derived-series.js +150 -0
  200. data/vendor/assets/javascripts/highstock/es-modules/mixins/download-url.js +103 -0
  201. data/vendor/assets/javascripts/highstock/es-modules/mixins/draw-point.js +51 -0
  202. data/vendor/assets/javascripts/highstock/es-modules/mixins/geometry-circles.js +300 -0
  203. data/vendor/assets/javascripts/highstock/es-modules/mixins/geometry.js +50 -0
  204. data/vendor/assets/javascripts/highstock/es-modules/mixins/indicator-required.js +49 -0
  205. data/vendor/assets/javascripts/highstock/es-modules/mixins/multipe-lines.js +223 -0
  206. data/vendor/assets/javascripts/highstock/es-modules/mixins/navigation.js +59 -0
  207. data/vendor/assets/javascripts/highstock/es-modules/mixins/nodes.js +76 -0
  208. data/vendor/assets/javascripts/highstock/es-modules/mixins/on-series.js +167 -0
  209. data/vendor/assets/javascripts/highstock/es-modules/mixins/polygon.js +293 -0
  210. data/vendor/assets/javascripts/highstock/es-modules/mixins/reduce-array.js +53 -0
  211. data/vendor/assets/javascripts/highstock/es-modules/mixins/tree-series.js +256 -0
  212. data/vendor/assets/javascripts/highstock/es-modules/modules/a11y-i18n.src.js +524 -0
  213. data/vendor/assets/javascripts/highstock/es-modules/modules/annotations-legacy.src.js +1951 -0
  214. data/vendor/assets/javascripts/highstock/es-modules/modules/bellcurve.src.js +173 -0
  215. data/vendor/assets/javascripts/highstock/es-modules/modules/boost-canvas.src.js +732 -0
  216. data/vendor/assets/javascripts/highstock/es-modules/modules/boost.src.js +3730 -0
  217. data/vendor/assets/javascripts/highstock/es-modules/modules/bullet.src.js +361 -0
  218. data/vendor/assets/javascripts/highstock/es-modules/modules/cylinder.src.js +389 -0
  219. data/vendor/assets/javascripts/highstock/es-modules/modules/data.src.js +2417 -0
  220. data/vendor/assets/javascripts/highstock/es-modules/modules/debugger.src.js +109 -0
  221. data/vendor/assets/javascripts/highstock/es-modules/modules/dependency-wheel.src.js +199 -0
  222. data/vendor/assets/javascripts/highstock/es-modules/modules/drag-panes.src.js +624 -0
  223. data/vendor/assets/javascripts/highstock/es-modules/modules/draggable-points.src.js +2625 -0
  224. data/vendor/assets/javascripts/highstock/es-modules/modules/drilldown.src.js +1300 -0
  225. data/vendor/assets/javascripts/highstock/es-modules/modules/export-data.src.js +983 -0
  226. data/vendor/assets/javascripts/highstock/es-modules/modules/exporting.src.js +2149 -0
  227. data/vendor/assets/javascripts/highstock/es-modules/modules/full-screen.src.js +40 -0
  228. data/vendor/assets/javascripts/highstock/es-modules/modules/funnel.src.js +552 -0
  229. data/vendor/assets/javascripts/highstock/es-modules/modules/histogram.src.js +229 -0
  230. data/vendor/assets/javascripts/highstock/es-modules/modules/item-series.src.js +150 -0
  231. data/vendor/assets/javascripts/highstock/es-modules/modules/keyboard-navigation.src.js +1606 -0
  232. data/vendor/assets/javascripts/highstock/es-modules/modules/networkgraph/QuadTree.js +175 -0
  233. data/vendor/assets/javascripts/highstock/es-modules/modules/networkgraph/layouts.js +506 -0
  234. data/vendor/assets/javascripts/highstock/es-modules/modules/networkgraph/networkgraph.src.js +740 -0
  235. data/vendor/assets/javascripts/highstock/es-modules/modules/no-data-to-display.src.js +260 -0
  236. data/vendor/assets/javascripts/highstock/es-modules/modules/offline-exporting.src.js +710 -0
  237. data/vendor/assets/javascripts/highstock/es-modules/modules/oldie-polyfills.src.js +121 -0
  238. data/vendor/assets/javascripts/highstock/es-modules/modules/oldie.src.js +1556 -0
  239. data/vendor/assets/javascripts/highstock/es-modules/modules/overlapping-datalabels.src.js +250 -0
  240. data/vendor/assets/javascripts/highstock/es-modules/modules/parallel-coordinates.src.js +492 -0
  241. data/vendor/assets/javascripts/highstock/es-modules/modules/pareto.src.js +152 -0
  242. data/vendor/assets/javascripts/highstock/es-modules/modules/pattern-fill.src.js +607 -0
  243. data/vendor/assets/javascripts/highstock/es-modules/modules/price-indicator.src.js +149 -0
  244. data/vendor/assets/javascripts/highstock/es-modules/modules/sankey.src.js +809 -0
  245. data/vendor/assets/javascripts/highstock/es-modules/modules/screen-reader.src.js +954 -0
  246. data/vendor/assets/javascripts/highstock/es-modules/modules/series-label.src.js +1042 -0
  247. data/vendor/assets/javascripts/highstock/es-modules/modules/solid-gauge.src.js +486 -0
  248. data/vendor/assets/javascripts/highstock/es-modules/modules/sonification/Earcon.js +184 -0
  249. data/vendor/assets/javascripts/highstock/es-modules/modules/sonification/Instrument.js +582 -0
  250. data/vendor/assets/javascripts/highstock/es-modules/modules/sonification/Timeline.js +702 -0
  251. data/vendor/assets/javascripts/highstock/es-modules/modules/sonification/chartSonify.js +1026 -0
  252. data/vendor/assets/javascripts/highstock/es-modules/modules/sonification/instrumentDefinitions.js +37 -0
  253. data/vendor/assets/javascripts/highstock/es-modules/modules/sonification/musicalFrequencies.js +113 -0
  254. data/vendor/assets/javascripts/highstock/es-modules/modules/sonification/pointSonify.js +385 -0
  255. data/vendor/assets/javascripts/highstock/es-modules/modules/sonification/sonification.js +107 -0
  256. data/vendor/assets/javascripts/highstock/es-modules/modules/sonification/utilities.js +178 -0
  257. data/vendor/assets/javascripts/highstock/es-modules/modules/static-scale.src.js +88 -0
  258. data/vendor/assets/javascripts/highstock/es-modules/modules/stock-tools-bindings.js +1950 -0
  259. data/vendor/assets/javascripts/highstock/es-modules/modules/stock-tools-gui.js +1458 -0
  260. data/vendor/assets/javascripts/highstock/es-modules/modules/streamgraph.src.js +132 -0
  261. data/vendor/assets/javascripts/highstock/es-modules/modules/sunburst.src.js +1041 -0
  262. data/vendor/assets/javascripts/highstock/es-modules/modules/tilemap.src.js +769 -0
  263. data/vendor/assets/javascripts/highstock/es-modules/modules/timeline.src.js +750 -0
  264. data/vendor/assets/javascripts/highstock/es-modules/modules/treemap.src.js +1803 -0
  265. data/vendor/assets/javascripts/highstock/es-modules/modules/variable-pie.src.js +459 -0
  266. data/vendor/assets/javascripts/highstock/es-modules/modules/variwide.src.js +350 -0
  267. data/vendor/assets/javascripts/highstock/es-modules/modules/vector.src.js +354 -0
  268. data/vendor/assets/javascripts/highstock/es-modules/modules/venn.src.js +1192 -0
  269. data/vendor/assets/javascripts/highstock/es-modules/modules/windbarb.src.js +380 -0
  270. data/vendor/assets/javascripts/highstock/es-modules/modules/wordcloud.src.js +1103 -0
  271. data/vendor/assets/javascripts/highstock/es-modules/modules/xrange.src.js +761 -0
  272. data/vendor/assets/javascripts/highstock/es-modules/parts-3d/Axis.js +669 -0
  273. data/vendor/assets/javascripts/highstock/es-modules/parts-3d/Chart.js +1753 -0
  274. data/vendor/assets/javascripts/highstock/es-modules/parts-3d/Column.js +437 -0
  275. data/vendor/assets/javascripts/highstock/es-modules/parts-3d/Math.js +206 -0
  276. data/vendor/assets/javascripts/highstock/es-modules/parts-3d/Pie.js +207 -0
  277. data/vendor/assets/javascripts/highstock/es-modules/parts-3d/SVGRenderer.js +1002 -0
  278. data/vendor/assets/javascripts/highstock/es-modules/parts-3d/Scatter.js +154 -0
  279. data/vendor/assets/javascripts/highstock/es-modules/parts-3d/Series.js +73 -0
  280. data/vendor/assets/javascripts/highstock/es-modules/parts-3d/VMLRenderer.js +62 -0
  281. data/vendor/assets/javascripts/highstock/es-modules/parts-gantt/ArrowSymbols.js +198 -0
  282. data/vendor/assets/javascripts/highstock/es-modules/parts-gantt/CurrentDateIndicator.js +100 -0
  283. data/vendor/assets/javascripts/highstock/es-modules/parts-gantt/GanttChart.js +140 -0
  284. data/vendor/assets/javascripts/highstock/es-modules/parts-gantt/GanttSeries.js +415 -0
  285. data/vendor/assets/javascripts/highstock/es-modules/parts-gantt/GridAxis.js +961 -0
  286. data/vendor/assets/javascripts/highstock/es-modules/parts-gantt/Pathfinder.js +1298 -0
  287. data/vendor/assets/javascripts/highstock/es-modules/parts-gantt/PathfinderAlgorithms.js +816 -0
  288. data/vendor/assets/javascripts/highstock/es-modules/parts-gantt/Tree.js +158 -0
  289. data/vendor/assets/javascripts/highstock/es-modules/parts-gantt/TreeGrid.js +1003 -0
  290. data/vendor/assets/javascripts/highstock/es-modules/parts-map/ColorAxis.js +1103 -0
  291. data/vendor/assets/javascripts/highstock/es-modules/parts-map/ColorSeriesMixin.js +138 -0
  292. data/vendor/assets/javascripts/highstock/es-modules/parts-map/GeoJSON.js +435 -0
  293. data/vendor/assets/javascripts/highstock/es-modules/parts-map/HeatmapSeries.js +474 -0
  294. data/vendor/assets/javascripts/highstock/es-modules/parts-map/Map.js +477 -0
  295. data/vendor/assets/javascripts/highstock/es-modules/parts-map/MapAxis.js +124 -0
  296. data/vendor/assets/javascripts/highstock/es-modules/parts-map/MapBubbleSeries.js +274 -0
  297. data/vendor/assets/javascripts/highstock/es-modules/parts-map/MapLineSeries.js +143 -0
  298. data/vendor/assets/javascripts/highstock/es-modules/parts-map/MapNavigation.js +357 -0
  299. data/vendor/assets/javascripts/highstock/es-modules/parts-map/MapPointSeries.js +187 -0
  300. data/vendor/assets/javascripts/highstock/es-modules/parts-map/MapPointer.js +132 -0
  301. data/vendor/assets/javascripts/highstock/es-modules/parts-map/MapSeries.js +1294 -0
  302. data/vendor/assets/javascripts/highstock/es-modules/parts-more/AreaRangeSeries.js +725 -0
  303. data/vendor/assets/javascripts/highstock/es-modules/parts-more/AreaSplineRangeSeries.js +98 -0
  304. data/vendor/assets/javascripts/highstock/es-modules/parts-more/BoxPlotSeries.js +617 -0
  305. data/vendor/assets/javascripts/highstock/es-modules/parts-more/BubbleLegend.js +1167 -0
  306. data/vendor/assets/javascripts/highstock/es-modules/parts-more/BubbleSeries.js +661 -0
  307. data/vendor/assets/javascripts/highstock/es-modules/parts-more/ColumnPyramidSeries.js +288 -0
  308. data/vendor/assets/javascripts/highstock/es-modules/parts-more/ColumnRangeSeries.js +278 -0
  309. data/vendor/assets/javascripts/highstock/es-modules/parts-more/ErrorBarSeries.js +172 -0
  310. data/vendor/assets/javascripts/highstock/es-modules/parts-more/GaugeSeries.js +618 -0
  311. data/vendor/assets/javascripts/highstock/es-modules/parts-more/PackedBubbleSeries.js +567 -0
  312. data/vendor/assets/javascripts/highstock/es-modules/parts-more/Pane.js +399 -0
  313. data/vendor/assets/javascripts/highstock/es-modules/parts-more/Polar.js +634 -0
  314. data/vendor/assets/javascripts/highstock/es-modules/parts-more/PolygonSeries.js +151 -0
  315. data/vendor/assets/javascripts/highstock/es-modules/parts-more/RadialAxis.js +685 -0
  316. data/vendor/assets/javascripts/highstock/es-modules/parts-more/WaterfallSeries.js +765 -0
  317. data/vendor/assets/javascripts/highstock/es-modules/parts.js +684 -0
  318. data/vendor/assets/javascripts/highstock/es-modules/parts/AreaSeries.js +578 -0
  319. data/vendor/assets/javascripts/highstock/es-modules/parts/AreaSplineSeries.js +122 -0
  320. data/vendor/assets/javascripts/highstock/es-modules/parts/Axis.js +6453 -0
  321. data/vendor/assets/javascripts/highstock/es-modules/parts/BarSeries.js +153 -0
  322. data/vendor/assets/javascripts/highstock/es-modules/parts/CandlestickSeries.js +358 -0
  323. data/vendor/assets/javascripts/highstock/es-modules/parts/Chart.js +2307 -0
  324. data/vendor/assets/javascripts/highstock/es-modules/parts/Color.js +301 -0
  325. data/vendor/assets/javascripts/highstock/es-modules/parts/ColumnSeries.js +1125 -0
  326. data/vendor/assets/javascripts/highstock/es-modules/parts/DataGrouping.js +1115 -0
  327. data/vendor/assets/javascripts/highstock/es-modules/parts/DataLabels.js +1431 -0
  328. data/vendor/assets/javascripts/highstock/es-modules/parts/DateTimeAxis.js +134 -0
  329. data/vendor/assets/javascripts/highstock/es-modules/parts/Dynamics.js +1301 -0
  330. data/vendor/assets/javascripts/highstock/es-modules/parts/FlagsSeries.js +739 -0
  331. data/vendor/assets/javascripts/highstock/es-modules/parts/Globals.js +75 -0
  332. data/vendor/assets/javascripts/highstock/es-modules/parts/Html.js +539 -0
  333. data/vendor/assets/javascripts/highstock/es-modules/parts/Interaction.js +1299 -0
  334. data/vendor/assets/javascripts/highstock/es-modules/parts/Legend.js +1411 -0
  335. data/vendor/assets/javascripts/highstock/es-modules/parts/LogarithmicAxis.js +168 -0
  336. data/vendor/assets/javascripts/highstock/es-modules/parts/MSPointer.js +176 -0
  337. data/vendor/assets/javascripts/highstock/es-modules/parts/Navigator.js +2486 -0
  338. data/vendor/assets/javascripts/highstock/es-modules/parts/OHLCSeries.js +412 -0
  339. data/vendor/assets/javascripts/highstock/es-modules/parts/Options.js +3732 -0
  340. data/vendor/assets/javascripts/highstock/es-modules/parts/OrdinalAxis.js +962 -0
  341. data/vendor/assets/javascripts/highstock/es-modules/parts/PieSeries.js +1328 -0
  342. data/vendor/assets/javascripts/highstock/es-modules/parts/PlotBandSeries.experimental.js +74 -0
  343. data/vendor/assets/javascripts/highstock/es-modules/parts/PlotLineOrBand.js +1061 -0
  344. data/vendor/assets/javascripts/highstock/es-modules/parts/Point.js +681 -0
  345. data/vendor/assets/javascripts/highstock/es-modules/parts/Pointer.js +1332 -0
  346. data/vendor/assets/javascripts/highstock/es-modules/parts/RangeSelector.js +2063 -0
  347. data/vendor/assets/javascripts/highstock/es-modules/parts/Responsive.js +295 -0
  348. data/vendor/assets/javascripts/highstock/es-modules/parts/ScatterSeries.js +278 -0
  349. data/vendor/assets/javascripts/highstock/es-modules/parts/ScrollablePlotArea.js +266 -0
  350. data/vendor/assets/javascripts/highstock/es-modules/parts/Scrollbar.js +1134 -0
  351. data/vendor/assets/javascripts/highstock/es-modules/parts/Series.js +5864 -0
  352. data/vendor/assets/javascripts/highstock/es-modules/parts/SplineSeries.js +267 -0
  353. data/vendor/assets/javascripts/highstock/es-modules/parts/Stacking.js +604 -0
  354. data/vendor/assets/javascripts/highstock/es-modules/parts/StockChart.js +951 -0
  355. data/vendor/assets/javascripts/highstock/es-modules/parts/SvgRenderer.js +5109 -0
  356. data/vendor/assets/javascripts/highstock/es-modules/parts/Tick.js +746 -0
  357. data/vendor/assets/javascripts/highstock/es-modules/parts/Time.js +881 -0
  358. data/vendor/assets/javascripts/highstock/es-modules/parts/Tooltip.js +1318 -0
  359. data/vendor/assets/javascripts/highstock/es-modules/parts/TouchPointer.js +404 -0
  360. data/vendor/assets/javascripts/highstock/es-modules/parts/Utilities.js +2751 -0
  361. data/vendor/assets/javascripts/highstock/es-modules/themes/avocado.js +37 -0
  362. data/vendor/assets/javascripts/highstock/es-modules/themes/dark-blue.js +259 -0
  363. data/vendor/assets/javascripts/highstock/es-modules/themes/dark-green.js +261 -0
  364. data/vendor/assets/javascripts/highstock/es-modules/themes/dark-unica.js +220 -0
  365. data/vendor/assets/javascripts/highstock/es-modules/themes/gray.js +267 -0
  366. data/vendor/assets/javascripts/highstock/es-modules/themes/grid-light.js +81 -0
  367. data/vendor/assets/javascripts/highstock/es-modules/themes/grid.js +110 -0
  368. data/vendor/assets/javascripts/highstock/es-modules/themes/sand-signika.js +111 -0
  369. data/vendor/assets/javascripts/highstock/es-modules/themes/skies.js +100 -0
  370. data/vendor/assets/javascripts/highstock/es-modules/themes/sunset.js +36 -0
  371. data/vendor/assets/javascripts/highstock/highcharts-3d.js +85 -0
  372. data/vendor/assets/javascripts/highstock/highcharts-3d.js.map +1 -0
  373. data/vendor/assets/javascripts/highstock/highcharts-more.js +101 -0
  374. data/vendor/assets/javascripts/highstock/highcharts-more.js.map +1 -0
  375. data/vendor/assets/javascripts/highstock/highstock.js +583 -0
  376. data/vendor/assets/javascripts/highstock/highstock.js.map +1 -0
  377. data/vendor/assets/javascripts/highstock/indicators/acceleration-bands.js +16 -0
  378. data/vendor/assets/javascripts/highstock/indicators/acceleration-bands.js.map +1 -0
  379. data/vendor/assets/javascripts/highstock/indicators/acceleration-bands.src.js +448 -0
  380. data/vendor/assets/javascripts/highstock/indicators/accumulation-distribution.js +12 -0
  381. data/vendor/assets/javascripts/highstock/indicators/accumulation-distribution.js.map +1 -0
  382. data/vendor/assets/javascripts/highstock/indicators/accumulation-distribution.src.js +156 -0
  383. data/vendor/assets/javascripts/highstock/indicators/ao.js +13 -0
  384. data/vendor/assets/javascripts/highstock/indicators/ao.js.map +1 -0
  385. data/vendor/assets/javascripts/highstock/indicators/ao.src.js +233 -0
  386. data/vendor/assets/javascripts/highstock/indicators/apo.js +13 -0
  387. data/vendor/assets/javascripts/highstock/indicators/apo.js.map +1 -0
  388. data/vendor/assets/javascripts/highstock/indicators/apo.src.js +223 -0
  389. data/vendor/assets/javascripts/highstock/indicators/aroon-oscillator.js +15 -0
  390. data/vendor/assets/javascripts/highstock/indicators/aroon-oscillator.js.map +1 -0
  391. data/vendor/assets/javascripts/highstock/indicators/aroon-oscillator.src.js +426 -0
  392. data/vendor/assets/javascripts/highstock/indicators/aroon.js +16 -0
  393. data/vendor/assets/javascripts/highstock/indicators/aroon.js.map +1 -0
  394. data/vendor/assets/javascripts/highstock/indicators/aroon.src.js +423 -0
  395. data/vendor/assets/javascripts/highstock/indicators/atr.js +12 -0
  396. data/vendor/assets/javascripts/highstock/indicators/atr.js.map +1 -0
  397. data/vendor/assets/javascripts/highstock/indicators/atr.src.js +178 -0
  398. data/vendor/assets/javascripts/highstock/indicators/bollinger-bands.js +16 -0
  399. data/vendor/assets/javascripts/highstock/indicators/bollinger-bands.js.map +1 -0
  400. data/vendor/assets/javascripts/highstock/indicators/bollinger-bands.src.js +458 -0
  401. data/vendor/assets/javascripts/highstock/indicators/cci.js +12 -0
  402. data/vendor/assets/javascripts/highstock/indicators/cci.js.map +1 -0
  403. data/vendor/assets/javascripts/highstock/indicators/cci.src.js +158 -0
  404. data/vendor/assets/javascripts/highstock/indicators/chaikin.js +15 -0
  405. data/vendor/assets/javascripts/highstock/indicators/chaikin.js.map +1 -0
  406. data/vendor/assets/javascripts/highstock/indicators/chaikin.src.js +370 -0
  407. data/vendor/assets/javascripts/highstock/indicators/cmf.js +12 -0
  408. data/vendor/assets/javascripts/highstock/indicators/cmf.js.map +1 -0
  409. data/vendor/assets/javascripts/highstock/indicators/cmf.src.js +273 -0
  410. data/vendor/assets/javascripts/highstock/indicators/dema.js +13 -0
  411. data/vendor/assets/javascripts/highstock/indicators/dema.js.map +1 -0
  412. data/vendor/assets/javascripts/highstock/indicators/dema.src.js +266 -0
  413. data/vendor/assets/javascripts/highstock/indicators/dpo.js +12 -0
  414. data/vendor/assets/javascripts/highstock/indicators/dpo.js.map +1 -0
  415. data/vendor/assets/javascripts/highstock/indicators/dpo.src.js +166 -0
  416. data/vendor/assets/javascripts/highstock/indicators/ema.js +12 -0
  417. data/vendor/assets/javascripts/highstock/indicators/ema.js.map +1 -0
  418. data/vendor/assets/javascripts/highstock/indicators/ema.src.js +193 -0
  419. data/vendor/assets/javascripts/highstock/indicators/ichimoku-kinko-hyo.js +22 -0
  420. data/vendor/assets/javascripts/highstock/indicators/ichimoku-kinko-hyo.js.map +1 -0
  421. data/vendor/assets/javascripts/highstock/indicators/ichimoku-kinko-hyo.src.js +877 -0
  422. data/vendor/assets/javascripts/highstock/indicators/indicators-all.js +117 -0
  423. data/vendor/assets/javascripts/highstock/indicators/indicators-all.js.map +1 -0
  424. data/vendor/assets/javascripts/highstock/indicators/indicators-all.src.js +9389 -0
  425. data/vendor/assets/javascripts/highstock/indicators/indicators.js +17 -0
  426. data/vendor/assets/javascripts/highstock/indicators/indicators.js.map +1 -0
  427. data/vendor/assets/javascripts/highstock/indicators/indicators.src.js +500 -0
  428. data/vendor/assets/javascripts/highstock/indicators/keltner-channels.js +16 -0
  429. data/vendor/assets/javascripts/highstock/indicators/keltner-channels.js.map +1 -0
  430. data/vendor/assets/javascripts/highstock/indicators/keltner-channels.src.js +442 -0
  431. data/vendor/assets/javascripts/highstock/indicators/macd.js +18 -0
  432. data/vendor/assets/javascripts/highstock/indicators/macd.js.map +1 -0
  433. data/vendor/assets/javascripts/highstock/indicators/macd.src.js +444 -0
  434. data/vendor/assets/javascripts/highstock/indicators/mfi.js +13 -0
  435. data/vendor/assets/javascripts/highstock/indicators/mfi.js.map +1 -0
  436. data/vendor/assets/javascripts/highstock/indicators/mfi.src.js +225 -0
  437. data/vendor/assets/javascripts/highstock/indicators/momentum.js +12 -0
  438. data/vendor/assets/javascripts/highstock/indicators/momentum.js.map +1 -0
  439. data/vendor/assets/javascripts/highstock/indicators/momentum.src.js +146 -0
  440. data/vendor/assets/javascripts/highstock/indicators/natr.js +12 -0
  441. data/vendor/assets/javascripts/highstock/indicators/natr.js.map +1 -0
  442. data/vendor/assets/javascripts/highstock/indicators/natr.src.js +101 -0
  443. data/vendor/assets/javascripts/highstock/indicators/pivot-points.js +16 -0
  444. data/vendor/assets/javascripts/highstock/indicators/pivot-points.js.map +1 -0
  445. data/vendor/assets/javascripts/highstock/indicators/pivot-points.src.js +387 -0
  446. data/vendor/assets/javascripts/highstock/indicators/ppo.js +13 -0
  447. data/vendor/assets/javascripts/highstock/indicators/ppo.js.map +1 -0
  448. data/vendor/assets/javascripts/highstock/indicators/ppo.src.js +227 -0
  449. data/vendor/assets/javascripts/highstock/indicators/price-channel.js +16 -0
  450. data/vendor/assets/javascripts/highstock/indicators/price-channel.js.map +1 -0
  451. data/vendor/assets/javascripts/highstock/indicators/price-channel.src.js +450 -0
  452. data/vendor/assets/javascripts/highstock/indicators/price-envelopes.js +15 -0
  453. data/vendor/assets/javascripts/highstock/indicators/price-envelopes.js.map +1 -0
  454. data/vendor/assets/javascripts/highstock/indicators/price-envelopes.src.js +278 -0
  455. data/vendor/assets/javascripts/highstock/indicators/psar.js +13 -0
  456. data/vendor/assets/javascripts/highstock/indicators/psar.js.map +1 -0
  457. data/vendor/assets/javascripts/highstock/indicators/psar.src.js +334 -0
  458. data/vendor/assets/javascripts/highstock/indicators/regressions.js +14 -0
  459. data/vendor/assets/javascripts/highstock/indicators/regressions.js.map +1 -0
  460. data/vendor/assets/javascripts/highstock/indicators/regressions.src.js +454 -0
  461. data/vendor/assets/javascripts/highstock/indicators/roc.js +12 -0
  462. data/vendor/assets/javascripts/highstock/indicators/roc.js.map +1 -0
  463. data/vendor/assets/javascripts/highstock/indicators/roc.src.js +176 -0
  464. data/vendor/assets/javascripts/highstock/indicators/rsi.js +12 -0
  465. data/vendor/assets/javascripts/highstock/indicators/rsi.js.map +1 -0
  466. data/vendor/assets/javascripts/highstock/indicators/rsi.src.js +190 -0
  467. data/vendor/assets/javascripts/highstock/indicators/stochastic.js +17 -0
  468. data/vendor/assets/javascripts/highstock/indicators/stochastic.js.map +1 -0
  469. data/vendor/assets/javascripts/highstock/indicators/stochastic.src.js +494 -0
  470. data/vendor/assets/javascripts/highstock/indicators/supertrend.js +17 -0
  471. data/vendor/assets/javascripts/highstock/indicators/supertrend.js.map +1 -0
  472. data/vendor/assets/javascripts/highstock/indicators/supertrend.src.js +571 -0
  473. data/vendor/assets/javascripts/highstock/indicators/tema.js +14 -0
  474. data/vendor/assets/javascripts/highstock/indicators/tema.js.map +1 -0
  475. data/vendor/assets/javascripts/highstock/indicators/tema.src.js +322 -0
  476. data/vendor/assets/javascripts/highstock/indicators/trix.js +12 -0
  477. data/vendor/assets/javascripts/highstock/indicators/trix.js.map +1 -0
  478. data/vendor/assets/javascripts/highstock/indicators/trix.src.js +171 -0
  479. data/vendor/assets/javascripts/highstock/indicators/volume-by-price.js +21 -0
  480. data/vendor/assets/javascripts/highstock/indicators/volume-by-price.js.map +1 -0
  481. data/vendor/assets/javascripts/highstock/indicators/volume-by-price.src.js +698 -0
  482. data/vendor/assets/javascripts/highstock/indicators/vwap.js +12 -0
  483. data/vendor/assets/javascripts/highstock/indicators/vwap.js.map +1 -0
  484. data/vendor/assets/javascripts/highstock/indicators/vwap.src.js +216 -0
  485. data/vendor/assets/javascripts/highstock/indicators/williams-r.js +13 -0
  486. data/vendor/assets/javascripts/highstock/indicators/williams-r.js.map +1 -0
  487. data/vendor/assets/javascripts/highstock/indicators/williams-r.src.js +207 -0
  488. data/vendor/assets/javascripts/highstock/indicators/wma.js +12 -0
  489. data/vendor/assets/javascripts/highstock/indicators/wma.js.map +1 -0
  490. data/vendor/assets/javascripts/highstock/indicators/wma.src.js +173 -0
  491. data/vendor/assets/javascripts/highstock/indicators/zigzag.js +13 -0
  492. data/vendor/assets/javascripts/highstock/indicators/zigzag.js.map +1 -0
  493. data/vendor/assets/javascripts/highstock/indicators/zigzag.src.js +248 -0
  494. data/vendor/assets/javascripts/highstock/lib/canvg.js +130 -0
  495. data/vendor/assets/javascripts/highstock/lib/canvg.src.js +3073 -0
  496. data/vendor/assets/javascripts/highstock/lib/jspdf.js +283 -0
  497. data/vendor/assets/javascripts/highstock/lib/jspdf.src.js +21627 -0
  498. data/vendor/assets/javascripts/highstock/lib/rgbcolor.js +17 -0
  499. data/vendor/assets/javascripts/highstock/lib/rgbcolor.src.js +299 -0
  500. data/vendor/assets/javascripts/highstock/lib/svg2pdf.js +38 -0
  501. data/vendor/assets/javascripts/highstock/lib/svg2pdf.src.js +4390 -0
  502. data/vendor/assets/javascripts/highstock/modules/accessibility.js +73 -0
  503. data/vendor/assets/javascripts/highstock/modules/accessibility.js.map +1 -0
  504. data/vendor/assets/javascripts/highstock/modules/accessibility.src.js +3103 -0
  505. data/vendor/assets/javascripts/highstock/modules/annotations-advanced.js +132 -0
  506. data/vendor/assets/javascripts/highstock/modules/annotations-advanced.js.map +1 -0
  507. data/vendor/assets/javascripts/highstock/modules/annotations-advanced.src.js +8230 -0
  508. data/vendor/assets/javascripts/highstock/modules/annotations.js +94 -0
  509. data/vendor/assets/javascripts/highstock/modules/annotations.js.map +1 -0
  510. data/vendor/assets/javascripts/highstock/modules/annotations.src.js +6001 -0
  511. data/vendor/assets/javascripts/highstock/modules/arrow-symbols.js +11 -0
  512. data/vendor/assets/javascripts/highstock/modules/arrow-symbols.js.map +1 -0
  513. data/vendor/assets/javascripts/highstock/modules/arrow-symbols.src.js +225 -0
  514. data/vendor/assets/javascripts/highstock/modules/boost-canvas.js +23 -0
  515. data/vendor/assets/javascripts/highstock/modules/boost-canvas.js.map +1 -0
  516. data/vendor/assets/javascripts/highstock/modules/boost-canvas.src.js +756 -0
  517. data/vendor/assets/javascripts/highstock/modules/boost.js +65 -0
  518. data/vendor/assets/javascripts/highstock/modules/boost.js.map +1 -0
  519. data/vendor/assets/javascripts/highstock/modules/boost.src.js +3752 -0
  520. data/vendor/assets/javascripts/highstock/modules/bullet.js +14 -0
  521. data/vendor/assets/javascripts/highstock/modules/bullet.js.map +1 -0
  522. data/vendor/assets/javascripts/highstock/modules/bullet.src.js +388 -0
  523. data/vendor/assets/javascripts/highstock/modules/current-date-indicator.js +11 -0
  524. data/vendor/assets/javascripts/highstock/modules/current-date-indicator.js.map +1 -0
  525. data/vendor/assets/javascripts/highstock/modules/current-date-indicator.src.js +127 -0
  526. data/vendor/assets/javascripts/highstock/modules/cylinder.js +14 -0
  527. data/vendor/assets/javascripts/highstock/modules/cylinder.js.map +1 -0
  528. data/vendor/assets/javascripts/highstock/modules/cylinder.src.js +413 -0
  529. data/vendor/assets/javascripts/highstock/modules/data.js +37 -0
  530. data/vendor/assets/javascripts/highstock/modules/data.js.map +1 -0
  531. data/vendor/assets/javascripts/highstock/modules/data.src.js +2565 -0
  532. data/vendor/assets/javascripts/highstock/modules/datagrouping.js +25 -0
  533. data/vendor/assets/javascripts/highstock/modules/datagrouping.js.map +1 -0
  534. data/vendor/assets/javascripts/highstock/modules/datagrouping.src.js +1140 -0
  535. data/vendor/assets/javascripts/highstock/modules/debugger.js +28 -0
  536. data/vendor/assets/javascripts/highstock/modules/debugger.js.map +1 -0
  537. data/vendor/assets/javascripts/highstock/modules/debugger.src.js +267 -0
  538. data/vendor/assets/javascripts/highstock/modules/dependency-wheel.js +15 -0
  539. data/vendor/assets/javascripts/highstock/modules/dependency-wheel.js.map +1 -0
  540. data/vendor/assets/javascripts/highstock/modules/dependency-wheel.src.js +301 -0
  541. data/vendor/assets/javascripts/highstock/modules/drag-panes.js +18 -0
  542. data/vendor/assets/javascripts/highstock/modules/drag-panes.js.map +1 -0
  543. data/vendor/assets/javascripts/highstock/modules/drag-panes.src.js +649 -0
  544. data/vendor/assets/javascripts/highstock/modules/draggable-points.js +40 -0
  545. data/vendor/assets/javascripts/highstock/modules/draggable-points.js.map +1 -0
  546. data/vendor/assets/javascripts/highstock/modules/draggable-points.src.js +2650 -0
  547. data/vendor/assets/javascripts/highstock/modules/drilldown.js +29 -0
  548. data/vendor/assets/javascripts/highstock/modules/drilldown.js.map +1 -0
  549. data/vendor/assets/javascripts/highstock/modules/drilldown.src.js +1321 -0
  550. data/vendor/assets/javascripts/highstock/modules/export-data.js +27 -0
  551. data/vendor/assets/javascripts/highstock/modules/export-data.js.map +1 -0
  552. data/vendor/assets/javascripts/highstock/modules/export-data.src.js +1234 -0
  553. data/vendor/assets/javascripts/highstock/modules/exporting.js +35 -0
  554. data/vendor/assets/javascripts/highstock/modules/exporting.js.map +1 -0
  555. data/vendor/assets/javascripts/highstock/modules/exporting.src.js +2233 -0
  556. data/vendor/assets/javascripts/highstock/modules/full-screen.js +11 -0
  557. data/vendor/assets/javascripts/highstock/modules/full-screen.js.map +1 -0
  558. data/vendor/assets/javascripts/highstock/modules/full-screen.src.js +68 -0
  559. data/vendor/assets/javascripts/highstock/modules/funnel.js +14 -0
  560. data/vendor/assets/javascripts/highstock/modules/funnel.js.map +1 -0
  561. data/vendor/assets/javascripts/highstock/modules/funnel.src.js +576 -0
  562. data/vendor/assets/javascripts/highstock/modules/grid-axis.js +23 -0
  563. data/vendor/assets/javascripts/highstock/modules/grid-axis.js.map +1 -0
  564. data/vendor/assets/javascripts/highstock/modules/grid-axis.src.js +988 -0
  565. data/vendor/assets/javascripts/highstock/modules/heatmap.js +28 -0
  566. data/vendor/assets/javascripts/highstock/modules/heatmap.js.map +1 -0
  567. data/vendor/assets/javascripts/highstock/modules/heatmap.src.js +1731 -0
  568. data/vendor/assets/javascripts/highstock/modules/histogram-bellcurve.js +16 -0
  569. data/vendor/assets/javascripts/highstock/modules/histogram-bellcurve.js.map +1 -0
  570. data/vendor/assets/javascripts/highstock/modules/histogram-bellcurve.src.js +570 -0
  571. data/vendor/assets/javascripts/highstock/modules/item-series.js +13 -0
  572. data/vendor/assets/javascripts/highstock/modules/item-series.js.map +1 -0
  573. data/vendor/assets/javascripts/highstock/modules/item-series.src.js +176 -0
  574. data/vendor/assets/javascripts/highstock/modules/networkgraph.js +31 -0
  575. data/vendor/assets/javascripts/highstock/modules/networkgraph.js.map +1 -0
  576. data/vendor/assets/javascripts/highstock/modules/networkgraph.src.js +1348 -0
  577. data/vendor/assets/javascripts/highstock/modules/no-data-to-display.js +13 -0
  578. data/vendor/assets/javascripts/highstock/modules/no-data-to-display.js.map +1 -0
  579. data/vendor/assets/javascripts/highstock/modules/no-data-to-display.src.js +285 -0
  580. data/vendor/assets/javascripts/highstock/modules/offline-exporting.js +22 -0
  581. data/vendor/assets/javascripts/highstock/modules/offline-exporting.js.map +1 -0
  582. data/vendor/assets/javascripts/highstock/modules/offline-exporting.src.js +838 -0
  583. data/vendor/assets/javascripts/highstock/modules/oldie-polyfills.js +13 -0
  584. data/vendor/assets/javascripts/highstock/modules/oldie-polyfills.js.map +1 -0
  585. data/vendor/assets/javascripts/highstock/modules/oldie-polyfills.src.js +150 -0
  586. data/vendor/assets/javascripts/highstock/modules/oldie.js +35 -0
  587. data/vendor/assets/javascripts/highstock/modules/oldie.js.map +1 -0
  588. data/vendor/assets/javascripts/highstock/modules/oldie.src.js +1582 -0
  589. data/vendor/assets/javascripts/highstock/modules/overlapping-datalabels.js +9 -0
  590. data/vendor/assets/javascripts/highstock/modules/overlapping-datalabels.js.map +1 -0
  591. data/vendor/assets/javascripts/highstock/modules/overlapping-datalabels.src.js +22 -0
  592. data/vendor/assets/javascripts/highstock/modules/parallel-coordinates.js +18 -0
  593. data/vendor/assets/javascripts/highstock/modules/parallel-coordinates.js.map +1 -0
  594. data/vendor/assets/javascripts/highstock/modules/parallel-coordinates.src.js +517 -0
  595. data/vendor/assets/javascripts/highstock/modules/pareto.js +14 -0
  596. data/vendor/assets/javascripts/highstock/modules/pareto.js.map +1 -0
  597. data/vendor/assets/javascripts/highstock/modules/pareto.src.js +327 -0
  598. data/vendor/assets/javascripts/highstock/modules/pathfinder.js +34 -0
  599. data/vendor/assets/javascripts/highstock/modules/pathfinder.js.map +1 -0
  600. data/vendor/assets/javascripts/highstock/modules/pathfinder.src.js +2336 -0
  601. data/vendor/assets/javascripts/highstock/modules/pattern-fill.js +21 -0
  602. data/vendor/assets/javascripts/highstock/modules/pattern-fill.js.map +1 -0
  603. data/vendor/assets/javascripts/highstock/modules/pattern-fill.src.js +634 -0
  604. data/vendor/assets/javascripts/highstock/modules/price-indicator.js +13 -0
  605. data/vendor/assets/javascripts/highstock/modules/price-indicator.js.map +1 -0
  606. data/vendor/assets/javascripts/highstock/modules/price-indicator.src.js +176 -0
  607. data/vendor/assets/javascripts/highstock/modules/sankey.js +22 -0
  608. data/vendor/assets/javascripts/highstock/modules/sankey.js.map +1 -0
  609. data/vendor/assets/javascripts/highstock/modules/sankey.src.js +911 -0
  610. data/vendor/assets/javascripts/highstock/modules/series-label.js +23 -0
  611. data/vendor/assets/javascripts/highstock/modules/series-label.js.map +1 -0
  612. data/vendor/assets/javascripts/highstock/modules/series-label.src.js +1065 -0
  613. data/vendor/assets/javascripts/highstock/modules/solid-gauge.js +15 -0
  614. data/vendor/assets/javascripts/highstock/modules/solid-gauge.js.map +1 -0
  615. data/vendor/assets/javascripts/highstock/modules/solid-gauge.src.js +510 -0
  616. data/vendor/assets/javascripts/highstock/modules/sonification.js +53 -0
  617. data/vendor/assets/javascripts/highstock/modules/sonification.js.map +1 -0
  618. data/vendor/assets/javascripts/highstock/modules/sonification.src.js +3341 -0
  619. data/vendor/assets/javascripts/highstock/modules/static-scale.js +12 -0
  620. data/vendor/assets/javascripts/highstock/modules/static-scale.js.map +1 -0
  621. data/vendor/assets/javascripts/highstock/modules/static-scale.src.js +114 -0
  622. data/vendor/assets/javascripts/highstock/modules/stock-tools.js +65 -0
  623. data/vendor/assets/javascripts/highstock/modules/stock-tools.js.map +1 -0
  624. data/vendor/assets/javascripts/highstock/modules/stock-tools.src.js +3437 -0
  625. data/vendor/assets/javascripts/highstock/modules/stock.js +151 -0
  626. data/vendor/assets/javascripts/highstock/modules/stock.js.map +1 -0
  627. data/vendor/assets/javascripts/highstock/modules/stock.src.js +10907 -0
  628. data/vendor/assets/javascripts/highstock/modules/streamgraph.js +10 -0
  629. data/vendor/assets/javascripts/highstock/modules/streamgraph.js.map +1 -0
  630. data/vendor/assets/javascripts/highstock/modules/streamgraph.src.js +158 -0
  631. data/vendor/assets/javascripts/highstock/modules/sunburst.js +52 -0
  632. data/vendor/assets/javascripts/highstock/modules/sunburst.js.map +1 -0
  633. data/vendor/assets/javascripts/highstock/modules/sunburst.src.js +3174 -0
  634. data/vendor/assets/javascripts/highstock/modules/tilemap.js +26 -0
  635. data/vendor/assets/javascripts/highstock/modules/tilemap.js.map +1 -0
  636. data/vendor/assets/javascripts/highstock/modules/tilemap.src.js +1402 -0
  637. data/vendor/assets/javascripts/highstock/modules/timeline.js +23 -0
  638. data/vendor/assets/javascripts/highstock/modules/timeline.js.map +1 -0
  639. data/vendor/assets/javascripts/highstock/modules/timeline.src.js +778 -0
  640. data/vendor/assets/javascripts/highstock/modules/treegrid.js +50 -0
  641. data/vendor/assets/javascripts/highstock/modules/treegrid.js.map +1 -0
  642. data/vendor/assets/javascripts/highstock/modules/treegrid.src.js +2917 -0
  643. data/vendor/assets/javascripts/highstock/modules/treemap.js +39 -0
  644. data/vendor/assets/javascripts/highstock/modules/treemap.js.map +1 -0
  645. data/vendor/assets/javascripts/highstock/modules/treemap.src.js +2083 -0
  646. data/vendor/assets/javascripts/highstock/modules/variable-pie.js +16 -0
  647. data/vendor/assets/javascripts/highstock/modules/variable-pie.js.map +1 -0
  648. data/vendor/assets/javascripts/highstock/modules/variable-pie.src.js +485 -0
  649. data/vendor/assets/javascripts/highstock/modules/variwide.js +15 -0
  650. data/vendor/assets/javascripts/highstock/modules/variwide.js.map +1 -0
  651. data/vendor/assets/javascripts/highstock/modules/variwide.src.js +376 -0
  652. data/vendor/assets/javascripts/highstock/modules/vector.js +13 -0
  653. data/vendor/assets/javascripts/highstock/modules/vector.js.map +1 -0
  654. data/vendor/assets/javascripts/highstock/modules/vector.src.js +381 -0
  655. data/vendor/assets/javascripts/highstock/modules/venn.js +30 -0
  656. data/vendor/assets/javascripts/highstock/modules/venn.js.map +1 -0
  657. data/vendor/assets/javascripts/highstock/modules/venn.src.js +1624 -0
  658. data/vendor/assets/javascripts/highstock/modules/windbarb.js +17 -0
  659. data/vendor/assets/javascripts/highstock/modules/windbarb.js.map +1 -0
  660. data/vendor/assets/javascripts/highstock/modules/windbarb.src.js +574 -0
  661. data/vendor/assets/javascripts/highstock/modules/wordcloud.js +25 -0
  662. data/vendor/assets/javascripts/highstock/modules/wordcloud.js.map +1 -0
  663. data/vendor/assets/javascripts/highstock/modules/wordcloud.src.js +1475 -0
  664. data/vendor/assets/javascripts/highstock/modules/xrange.js +20 -0
  665. data/vendor/assets/javascripts/highstock/modules/xrange.js.map +1 -0
  666. data/vendor/assets/javascripts/highstock/modules/xrange.src.js +788 -0
  667. data/vendor/assets/javascripts/highstock/themes/avocado.js +9 -0
  668. data/vendor/assets/javascripts/highstock/themes/avocado.js.map +1 -0
  669. data/vendor/assets/javascripts/highstock/themes/avocado.src.js +63 -0
  670. data/vendor/assets/javascripts/highstock/themes/dark-blue.js +15 -0
  671. data/vendor/assets/javascripts/highstock/themes/dark-blue.js.map +1 -0
  672. data/vendor/assets/javascripts/highstock/themes/dark-blue.src.js +285 -0
  673. data/vendor/assets/javascripts/highstock/themes/dark-green.js +15 -0
  674. data/vendor/assets/javascripts/highstock/themes/dark-green.js.map +1 -0
  675. data/vendor/assets/javascripts/highstock/themes/dark-green.src.js +287 -0
  676. data/vendor/assets/javascripts/highstock/themes/dark-unica.js +14 -0
  677. data/vendor/assets/javascripts/highstock/themes/dark-unica.js.map +1 -0
  678. data/vendor/assets/javascripts/highstock/themes/dark-unica.src.js +246 -0
  679. data/vendor/assets/javascripts/highstock/themes/gray.js +15 -0
  680. data/vendor/assets/javascripts/highstock/themes/gray.js.map +1 -0
  681. data/vendor/assets/javascripts/highstock/themes/gray.src.js +293 -0
  682. data/vendor/assets/javascripts/highstock/themes/grid-light.js +11 -0
  683. data/vendor/assets/javascripts/highstock/themes/grid-light.js.map +1 -0
  684. data/vendor/assets/javascripts/highstock/themes/grid-light.src.js +107 -0
  685. data/vendor/assets/javascripts/highstock/themes/grid.js +11 -0
  686. data/vendor/assets/javascripts/highstock/themes/grid.js.map +1 -0
  687. data/vendor/assets/javascripts/highstock/themes/grid.src.js +136 -0
  688. data/vendor/assets/javascripts/highstock/themes/sand-signika.js +11 -0
  689. data/vendor/assets/javascripts/highstock/themes/sand-signika.js.map +1 -0
  690. data/vendor/assets/javascripts/highstock/themes/sand-signika.src.js +137 -0
  691. data/vendor/assets/javascripts/highstock/themes/skies.js +11 -0
  692. data/vendor/assets/javascripts/highstock/themes/skies.js.map +1 -0
  693. data/vendor/assets/javascripts/highstock/themes/skies.src.js +126 -0
  694. data/vendor/assets/javascripts/highstock/themes/sunset.js +9 -0
  695. data/vendor/assets/javascripts/highstock/themes/sunset.js.map +1 -0
  696. data/vendor/assets/javascripts/highstock/themes/sunset.src.js +62 -0
  697. metadata +781 -0
@@ -0,0 +1,53 @@
1
+ /*
2
+ Highcharts JS v7.0.3 (2019-02-06)
3
+ Sonification module
4
+
5
+ (c) 2012-2019 ystein Moseng
6
+
7
+ License: www.highcharts.com/license
8
+ */
9
+ (function(l){"object"===typeof module&&module.exports?(l["default"]=l,module.exports=l):"function"===typeof define&&define.amd?define(function(){return l}):l("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(l){var t=function(c){function f(c){this.init(c)}var g={type:"oscillator",playCallbackInterval:20,oscillator:{waveformShape:"sine"}};f.prototype.init=function(b){this.initAudioContext()?(this.options=c.merge(g,b),this.id=this.options.id=b&&b.id||c.uniqueKey(),b=c.audioContext,this.gainNode=
10
+ b.createGain(),this.setGain(0),(this.panNode=b.createStereoPanner&&b.createStereoPanner())?(this.setPan(0),this.gainNode.connect(this.panNode),this.panNode.connect(b.destination)):this.gainNode.connect(b.destination),"oscillator"===this.options.type&&this.initOscillator(this.options.oscillator),this.playCallbackTimers=[]):c.error(29)};f.prototype.copy=function(b){return new f(c.merge(this.options,{id:null},b))};f.prototype.initAudioContext=function(){var b=c.win.AudioContext||c.win.webkitAudioContext,
11
+ d=!!c.audioContext;return b?(c.audioContext=c.audioContext||new b,!d&&c.audioContext&&"running"===c.audioContext.state&&c.audioContext.suspend(),!!(c.audioContext&&c.audioContext.createOscillator&&c.audioContext.createGain)):!1};f.prototype.initOscillator=function(b){this.oscillator=c.audioContext.createOscillator();this.oscillator.type=b.waveformShape;this.oscillator.connect(this.gainNode);this.oscillatorStarted=!1};f.prototype.setPan=function(b){this.panNode&&this.panNode.pan.setValueAtTime(b,c.audioContext.currentTime)};
12
+ f.prototype.setGain=function(b,d){this.gainNode&&(1.2<b&&(console.warn("Highcharts sonification warning: Volume of instrument set too high."),b=1.2),d?(this.gainNode.gain.setValueAtTime(this.gainNode.gain.value,c.audioContext.currentTime),this.gainNode.gain.linearRampToValueAtTime(b,c.audioContext.currentTime+d/1E3)):this.gainNode.gain.setValueAtTime(b,c.audioContext.currentTime))};f.prototype.cancelGainRamp=function(){this.gainNode&&this.gainNode.gain.cancelScheduledValues(0)};f.prototype.getValidFrequency=
13
+ function(b,d,a){var e=this.options.allowedFrequencies,g=c.pick(a,Infinity),f=c.pick(d,-Infinity);return e&&e.length?e.reduce(function(a,d){return Math.abs(d-b)<Math.abs(a-b)&&d<g&&d>f?d:a},Infinity):b};f.prototype.clearPlayCallbackTimers=function(){this.playCallbackTimers.forEach(function(c){clearInterval(c)});this.playCallbackTimers=[]};f.prototype.setFrequency=function(c,d){d=d||{};c=this.getValidFrequency(c,d.min,d.max);"oscillator"===this.options.type&&this.oscillatorPlay(c)};f.prototype.oscillatorPlay=
14
+ function(b){this.oscillatorStarted||(this.oscillator.start(),this.oscillatorStarted=!0);this.oscillator.frequency.setValueAtTime(b,c.audioContext.currentTime)};f.prototype.preparePlay=function(){this.setGain(.001);"suspended"===c.audioContext.state&&c.audioContext.resume();this.oscillator&&!this.oscillatorStarted&&(this.oscillator.start(),this.oscillatorStarted=!0)};f.prototype.play=function(b){var d=this,a=b.duration||0,e=function(a,c,e){var g=b.duration,f=0,q=d.options.playCallbackInterval;if("function"===
15
+ typeof a){var n=setInterval(function(){f++;var b=f*q/g;if(1<=b)d[c](a(1),e),clearInterval(n);else d[c](a(b),e)},q);d.playCallbackTimers.push(n)}else d[c](a,e)};if(d.id)if("suspended"===c.audioContext.state||this.oscillator&&!this.oscillatorStarted)d.preparePlay(),setTimeout(function(){d.play(b)},10);else{d.playCallbackTimers.length&&d.clearPlayCallbackTimers();d.cancelGainRamp();d.stopOscillatorTimeout&&(clearTimeout(d.stopOscillatorTimeout),delete d.stopOscillatorTimeout);d.stopTimeout&&(clearTimeout(d.stopTimeout),
16
+ delete d.stopTimeout,d.stopCallback&&(d._play=d.play,d.play=function(){},d.stopCallback("cancelled"),d.play=d._play));var g=a<c.sonification.fadeOutDuration+20;d.stopCallback=b.onEnd;var f=function(){delete d.stopTimeout;d.stop(g)};a?(d.stopTimeout=setTimeout(f,g?a:a-c.sonification.fadeOutDuration),e(b.frequency,"setFrequency",null,{minFrequency:b.minFrequency,maxFrequency:b.maxFrequency}),e(c.pick(b.volume,1),"setGain",4),e(c.pick(b.pan,0),"setPan")):f()}};f.prototype.mute=function(){this.setGain(.0001,
17
+ .8*c.sonification.fadeOutDuration)};f.prototype.stop=function(b,d,a){var e=this,g=function(){e.stopOscillatorTimeout&&delete e.stopOscillatorTimeout;try{e.oscillator.stop()}catch(p){}e.oscillator.disconnect(e.gainNode);e.initOscillator(e.options.oscillator);d&&d(a);e.stopCallback&&e.stopCallback(a)};e.playCallbackTimers.length&&e.clearPlayCallbackTimers();e.stopTimeout&&clearTimeout(e.stopTimeout);b?(e.setGain(0),g()):(e.mute(),e.stopOscillatorTimeout=setTimeout(g,c.sonification.fadeOutDuration+100))};
18
+ return f}(l),r=function(c){function f(c){this.init(c||[])}f.prototype.init=function(c){this.supportedSignals=c;this.signals={}};f.prototype.registerSignalCallbacks=function(c){var b=this;b.supportedSignals.forEach(function(d){c[d]&&(b.signals[d]=b.signals[d]||[]).push(c[d])})};f.prototype.clearSignalCallbacks=function(c){var b=this;c?c.forEach(function(c){b.signals[c]&&delete b.signals[c]}):b.signals={}};f.prototype.emitSignal=function(c,b){var d;this.signals[c]&&this.signals[c].forEach(function(c){c=
19
+ c(b);d=void 0!==c?c:d});return d};return{musicalFrequencies:c,SignalHandler:f,getMusicalScale:function(f){return c.filter(function(c,d){var a=d%12+1;return f.some(function(c){return c===a})})},calculateDataExtremes:function(c,b){return c.series.reduce(function(c,a){a.points.forEach(function(a){a=void 0!==a[b]?a[b]:a.options[b];c.min=Math.min(c.min,a);c.max=Math.max(c.max,a)});return c},{min:Infinity,max:-Infinity})},virtualAxisTranslate:function(c,b,d){var a=b.max-b.min;c=d.min+(d.max-d.min)*(c-b.min)/
20
+ a;return 0<a?Math.max(Math.min(c,d.max),d.min):d.min}}}([16.351597831287414,17.323914436054505,18.354047994837977,19.445436482630058,20.601722307054366,21.826764464562746,23.12465141947715,24.499714748859326,25.956543598746574,27.5,29.13523509488062,30.86770632850775,32.70319566257483,34.64782887210901,36.70809598967594,38.890872965260115,41.20344461410875,43.653528929125486,46.2493028389543,48.999429497718666,51.91308719749314,55,58.27047018976124,61.7354126570155,65.40639132514966,69.29565774421802,
21
+ 73.41619197935188,77.78174593052023,82.4068892282175,87.30705785825097,92.4986056779086,97.99885899543733,103.82617439498628,110,116.54094037952248,123.47082531403103,130.8127826502993,138.59131548843604,146.8323839587038,155.56349186104046,164.81377845643496,174.61411571650194,184.9972113558172,195.99771799087463,207.65234878997256,220,233.08188075904496,246.94165062806206,261.6255653005986,277.1826309768721,293.6647679174076,311.1269837220809,329.6275569128699,349.2282314330039,369.9944227116344,
22
+ 391.99543598174927,415.3046975799451,440,466.1637615180899,493.8833012561241,523.2511306011972,554.3652619537442,587.3295358348151,622.2539674441618,659.2551138257398,698.4564628660078,739.9888454232688,783.9908719634985,830.6093951598903,880,932.3275230361799,987.7666025122483,1046.5022612023945,1108.7305239074883,1174.6590716696303,1244.5079348883237,1318.5102276514797,1396.9129257320155,1479.9776908465376,1567.981743926997,1661.2187903197805,1760,1864.6550460723597,1975.533205024496,2093.004522404789,
23
+ 2217.4610478149766,2349.31814333926,2489.0158697766474,2637.02045530296,2793.825851464031,2959.955381693075,3135.9634878539946,3322.437580639561,3520,3729.3100921447194,3951.066410048992,4186.009044809578]),w=function(c,f){var g={};["sine","square","triangle","sawtooth"].forEach(function(b){g[b]=new c({oscillator:{waveformShape:b}});g[b+"Musical"]=new c({allowedFrequencies:f.musicalFrequencies,oscillator:{waveformShape:b}});g[b+"Major"]=new c({allowedFrequencies:f.getMusicalScale([1,3,5,6,8,10,12]),
24
+ oscillator:{waveformShape:b}})});return g}(t,r),x=function(c){function f(c){this.init(c||{})}f.prototype.init=function(f){this.options=f;this.options.id||(this.options.id=this.id=c.uniqueKey());this.instrumentsPlaying={}};f.prototype.sonify=function(f){var b=c.merge(this.options,f),d=c.pick(b.volume,1),a=b.pan,e=this,h=f&&f.onEnd,g=e.options.onEnd;b.instruments.forEach(function(b){var f="string"===typeof b.instrument?c.sonification.instruments[b.instrument]:b.instrument,q=c.merge(b.playOptions),k,
25
+ p;f&&f.play?b.playOptions&&("function"!==typeof b.playOptions.volume&&(q.volume=c.pick(d,1)*c.pick(b.playOptions.volume,1)),q.pan=c.pick(a,q.pan),k=q.onEnd,q.onEnd=function(){delete e.instrumentsPlaying[p];k&&k.apply(this,arguments);Object.keys(e.instrumentsPlaying).length||(h&&h.apply(this,arguments),g&&g.apply(this,arguments))},b=f.copy(),p=b.id,e.instrumentsPlaying[p]=b,b.play(q)):c.error(30)})};f.prototype.cancelSonify=function(c){var b=this.instrumentsPlaying,d=b&&Object.keys(b);d&&d.length&&
26
+ (d.forEach(function(a){b[a].stop(!c,null,"cancelled")}),this.instrumentsPlaying={})};return f}(l),y=function(c,f){var g={minDuration:20,maxDuration:2E3,minVolume:.1,maxVolume:1,minPan:-1,maxPan:1,minFrequency:220,maxFrequency:2200};return{pointSonify:function(b){var d=this,a=d.series.chart,e=b.dataExtremes||{},h=function(a,b,h,g){if("number"===typeof a||void 0===a)return a;if("function"===typeof a)return b?function(c){return a(d,e,c)}:a(d,e);if("string"===typeof a)return e[a]=e[a]||f.calculateDataExtremes(d.series.chart,
27
+ a),f.virtualAxisTranslate(c.pick(d[a],d.options[a]),e[a],h,g)};a.sonification.currentlyPlayingPoint=d;d.sonification=d.sonification||{};d.sonification.instrumentsPlaying=d.sonification.instrumentsPlaying||{};var p=d.sonification.signalHandler=d.sonification.signalHandler||new f.SignalHandler(["onEnd"]);p.clearSignalCallbacks();p.registerSignalCallbacks({onEnd:b.onEnd});!d.isNull&&d.visible&&d.series.visible?b.instruments.forEach(function(b){var e="string"===typeof b.instrument?c.sonification.instruments[b.instrument]:
28
+ b.instrument,f=b.instrumentMapping||{},k=c.merge(g,b.instrumentOptions),q=e.id,l=function(c){b.onEnd&&b.onEnd.apply(this,arguments);a.sonification&&a.sonification.currentlyPlayingPoint&&delete a.sonification.currentlyPlayingPoint;d.sonification&&d.sonification.instrumentsPlaying&&(delete d.sonification.instrumentsPlaying[q],Object.keys(d.sonification.instrumentsPlaying).length||p.emitSignal("onEnd",c))};e&&e.play?(d.sonification.instrumentsPlaying[e.id]=e,e.play({frequency:h(f.frequency,!0,{min:k.minFrequency,
29
+ max:k.maxFrequency}),duration:h(f.duration,!1,{min:k.minDuration,max:k.maxDuration}),pan:h(f.pan,!0,{min:k.minPan,max:k.maxPan}),volume:h(f.volume,!0,{min:k.minVolume,max:k.maxVolume}),onEnd:l,minFrequency:k.minFrequency,maxFrequency:k.maxFrequency})):c.error(30)}):p.emitSignal("onEnd")},pointCancelSonify:function(c){var b=this.sonification&&this.sonification.instrumentsPlaying,a=b&&Object.keys(b);a&&a.length&&(a.forEach(function(a){b[a].stop(!c,null,"cancelled")}),this.sonification.instrumentsPlaying=
30
+ {},this.sonification.signalHandler.emitSignal("onEnd","cancelled"))}}}(l,r),A=function(c,f){function g(a,b){return"function"===typeof b?b(a):c.pick(a[b],a.options[b])}function b(c,a){return c.points.reduce(function(c,b){b=g(b,a);c.min=Math.min(c.min,b);c.max=Math.max(c.max,b);return c},{min:Infinity,max:-Infinity})}function d(a,b,d){return(b||[]).reduce(function(c,b){Object.keys(b.instrumentMapping||{}).forEach(function(d){d=b.instrumentMapping[d];"string"!==typeof d||c[d]||(c[d]=f.calculateDataExtremes(a,
31
+ d))});return c},c.merge(d))}function a(a,b){return b.reduce(function(b,d){var e=d.earcon;d.condition?(d=d.condition(a),d instanceof c.sonification.Earcon?b.push(d):d&&b.push(e)):d.onPoint&&a.id===d.onPoint&&b.push(e);return b},[])}function e(a){return a.map(function(a){var b=a.instrument,b=("string"===typeof b?c.sonification.instruments[b]:b).copy();return c.merge(a,{instrument:b})})}function h(n,m){var h=m.timeExtremes||b(n,m.pointPlayTime,m.dataExtremes),z=d(n.chart,m.instruments,m.dataExtremes),
32
+ p=e(m.instruments),k=n.points.reduce(function(b,d){var e=a(d,m.earcons||[]),n=f.virtualAxisTranslate(g(d,m.pointPlayTime),h,{min:0,max:m.duration});return b.concat(new c.sonification.TimelineEvent({eventObject:d,time:n,id:d.id,playOptions:{instruments:p,dataExtremes:z}}),e.map(function(a){return new c.sonification.TimelineEvent({eventObject:a,time:n})}))},[]);return new c.sonification.TimelinePath({events:k,onStart:function(){if(m.onStart)m.onStart(n)},onEventStart:function(a){var b=a.options&&a.options.eventObject;
33
+ if(b instanceof c.Point){if(!b.series.visible&&!b.series.chart.series.some(function(c){return c.visible}))return a.timelinePath.timeline.pause(),a.timelinePath.timeline.resetCursor(),!1;if(m.onPointStart)m.onPointStart(a,b)}},onEventEnd:function(a){var b=a.event&&a.event.options&&a.event.options.eventObject;if(b instanceof c.Point&&m.onPointEnd)m.onPointEnd(a.event,b)},onEnd:function(){if(m.onEnd)m.onEnd(n)}})}function p(a,d,e){var f=e.seriesOptions||{};return c.merge({dataExtremes:d,timeExtremes:b(a,
34
+ e.pointPlayTime),instruments:e.instruments,onStart:e.onSeriesStart,onEnd:e.onSeriesEnd,earcons:e.earcons},c.isArray(f)?c.find(f,function(b){return b.id===c.pick(a.id,a.options.id)})||{}:f,{pointPlayTime:e.pointPlayTime})}function q(a,b,d){var e;"sequential"===a||"simultaneous"===a?(e=b.series.reduce(function(a,c){c.visible&&a.push({series:c,seriesOptions:d(c)});return a},[]),"simultaneous"===a&&(e=[e])):e=a.reduce(function(a,e){e=c.splat(e).reduce(function(a,e){var f;if("string"===typeof e){var n=
35
+ b.get(e);n.visible&&(f={series:n,seriesOptions:d(n)})}else e instanceof c.sonification.Earcon&&(f=new c.sonification.TimelinePath({events:[new c.sonification.TimelineEvent({eventObject:e})]}));e.silentWait&&(f=new c.sonification.TimelinePath({silentWait:e.silentWait}));f&&a.push(f);return a},[]);e.length&&a.push(e);return a},[]);return e}function l(a,b){return b?a.reduce(function(d,e,f){e=c.splat(e);d.push(e);f<a.length-1&&e.some(function(a){return a.series})&&d.push(new c.sonification.TimelinePath({silentWait:b}));
36
+ return d},[]):a}function u(a){return a.reduce(function(a,b){b=c.splat(b);return a+(1===b.length&&b[0].options&&b[0].options.silentWait||0)},0)}function k(a){var b=a.reduce(function(a,c){(c=c.events)&&c.length&&(a.min=Math.min(c[0].time,a.min),a.max=Math.max(c[c.length-1].time,a.max));return a},{min:Infinity,max:-Infinity});a.forEach(function(a){var d=a.events,e=d&&d.length,f=[];e&&d[0].time<=b.min||f.push(new c.sonification.TimelineEvent({time:b.min}));e&&d[d.length-1].time>=b.max||f.push(new c.sonification.TimelineEvent({time:b.max}));
37
+ f.length&&a.addTimelineEvents(f)})}function v(a){return a.reduce(function(a,b){return a+c.splat(b).reduce(function(a,c){return(c=c.series&&c.seriesOptions&&c.seriesOptions.timeExtremes)?Math.max(a,c.max-c.min):a},0)},0)}function r(a,b){var d=Math.max(b-u(a),0),e=v(a);return a.reduce(function(a,b){b=c.splat(b).reduce(function(a,b){b instanceof c.sonification.TimelinePath?a.push(b):b.series&&(b.seriesOptions.duration=b.seriesOptions.duration||f.virtualAxisTranslate(b.seriesOptions.timeExtremes.max-
38
+ b.seriesOptions.timeExtremes.min,{min:0,max:e},{min:0,max:d}),a.push(h(b.series,b.seriesOptions)));return a},[]);a.push(b);return a},[])}return{chartSonify:function(a){this.sonification.timeline&&this.sonification.timeline.pause();var b=d(this,a.instruments,a.dataExtremes),e=q(a.order,this,function(c){return p(c,b,a)}),e=l(e,a.afterSeriesWait||0),e=r(e,a.duration);e.forEach(function(a){k(a)});this.sonification.timeline=new c.sonification.Timeline({paths:e,onEnd:a.onEnd});this.sonification.timeline.play()},
39
+ seriesSonify:function(a){a=h(this,a);var b=this.chart.sonification;b.timeline&&b.timeline.pause();b.timeline=new c.sonification.Timeline({paths:[a]});b.timeline.play()},pause:function(a){this.sonification.timeline?this.sonification.timeline.pause(c.pick(a,!0)):this.sonification.currentlyPlayingPoint&&this.sonification.currentlyPlayingPoint.cancelSonify(a)},resume:function(a){this.sonification.timeline&&this.sonification.timeline.play(a)},rewind:function(a){this.sonification.timeline&&this.sonification.timeline.rewind(a)},
40
+ cancel:function(a){this.pauseSonify(a);this.resetSonifyCursor()},getCurrentPoints:function(){var a;return this.sonification.timeline?(a=this.sonification.timeline.getCursor(),Object.keys(a).map(function(b){return a[b].eventObject}).filter(function(a){return a instanceof c.Point})):[]},setCursor:function(a){var b=this.sonification.timeline;b&&c.splat(a).forEach(function(a){b.setCursor(a.id)})},resetCursor:function(){this.sonification.timeline&&this.sonification.timeline.resetCursor()},resetCursorEnd:function(){this.sonification.timeline&&
41
+ this.sonification.timeline.resetCursorEnd()}}}(l,r),B=function(c,f){function g(a){this.init(a||{})}function b(a){this.init(a)}function d(a){this.init(a||{})}g.prototype.init=function(a){this.options=a;this.time=a.time||0;this.id=this.options.id=a.id||c.uniqueKey()};g.prototype.play=function(a){var b=this.options.eventObject,d=this.options.onEnd,f=a&&a.onEnd,g=this.options.playOptions&&this.options.playOptions.onEnd;a=c.merge(this.options.playOptions,a);b&&b.sonify?(a.onEnd=d||f||g?function(){var a=
42
+ arguments;[d,f,g].forEach(function(b){b&&b.apply(this,a)})}:void 0,b.sonify(a)):(f&&f(),d&&d())};g.prototype.cancel=function(a){this.options.eventObject.cancelSonify(a)};b.prototype.init=function(a){this.options=a;this.id=this.options.id=a.id||c.uniqueKey();this.cursor=0;this.eventsPlaying={};this.events=a.silentWait?[new g({time:0}),new g({time:a.silentWait})]:this.options.events;this.sortEvents();this.updateEventIdMap();this.signalHandler=new f.SignalHandler(["playOnEnd","masterOnEnd","onStart",
43
+ "onEventStart","onEventEnd"]);this.signalHandler.registerSignalCallbacks(c.merge(a,{masterOnEnd:a.onEnd}))};b.prototype.sortEvents=function(){this.events=this.events.sort(function(a,b){return a.time-b.time})};b.prototype.updateEventIdMap=function(){this.eventIdMap=this.events.reduce(function(a,b,c){a[b.id]=c;return a},{})};b.prototype.addTimelineEvents=function(a){this.events=this.events.concat(a);this.sortEvents();this.updateEventIdMap()};b.prototype.getCursor=function(){return this.events[this.cursor]};
44
+ b.prototype.setCursor=function(a){a=this.eventIdMap[a];return void 0!==a?(this.cursor=a,!0):!1};b.prototype.play=function(a){this.pause();this.signalHandler.emitSignal("onStart");this.signalHandler.clearSignalCallbacks(["playOnEnd"]);this.signalHandler.registerSignalCallbacks({playOnEnd:a});this.playEvents(1)};b.prototype.rewind=function(a){this.pause();this.signalHandler.emitSignal("onStart");this.signalHandler.clearSignalCallbacks(["playOnEnd"]);this.signalHandler.registerSignalCallbacks({playOnEnd:a});
45
+ this.playEvents(-1)};b.prototype.resetCursor=function(){this.cursor=0};b.prototype.resetCursorEnd=function(){this.cursor=this.events.length-1};b.prototype.pause=function(a){var b=this;clearTimeout(b.nextScheduledPlay);Object.keys(b.eventsPlaying).forEach(function(c){b.eventsPlaying[c]&&b.eventsPlaying[c].cancel(a)});b.eventsPlaying={}};b.prototype.playEvents=function(a){var b=this,c=b.events[this.cursor],d=b.events[this.cursor+a],f,g=function(a){b.signalHandler.emitSignal("masterOnEnd",a);b.signalHandler.emitSignal("playOnEnd",
46
+ a)};c.timelinePath=b;!1===b.signalHandler.emitSignal("onEventStart",c)?g({event:c,cancelled:!0}):(b.eventsPlaying[c.id]=c,c.play({onEnd:function(a){a={event:c,cancelled:!!a};delete b.eventsPlaying[c.id];b.signalHandler.emitSignal("onEventEnd",a);d||g(a)}}),d&&(f=Math.abs(d.time-c.time),1>f?(b.cursor+=a,b.playEvents(a)):this.nextScheduledPlay=setTimeout(function(){b.cursor+=a;b.playEvents(a)},f)))};d.prototype.init=function(a){this.options=a;this.cursor=0;this.paths=a.paths;this.pathsPlaying={};this.signalHandler=
47
+ new f.SignalHandler(["playOnEnd","masterOnEnd","onPathStart","onPathEnd"]);this.signalHandler.registerSignalCallbacks(c.merge(a,{masterOnEnd:a.onEnd}))};d.prototype.play=function(a){this.pause();this.signalHandler.clearSignalCallbacks(["playOnEnd"]);this.signalHandler.registerSignalCallbacks({playOnEnd:a});this.playPaths(1)};d.prototype.rewind=function(a){this.pause();this.signalHandler.clearSignalCallbacks(["playOnEnd"]);this.signalHandler.registerSignalCallbacks({playOnEnd:a});this.playPaths(-1)};
48
+ d.prototype.playPaths=function(a){var b=c.splat(this.paths[this.cursor]),d=this.paths[this.cursor+a],f=this,g=this.signalHandler,l=0,r=function(e){g.emitSignal("onPathStart",e);f.pathsPlaying[e.id]=e;e[0<a?"play":"rewind"](function(h){h=h&&h.cancelled;var k={path:e,cancelled:h};delete f.pathsPlaying[e.id];g.emitSignal("onPathEnd",k);l++;l>=b.length&&(d&&!h?(f.cursor+=a,c.splat(d).forEach(function(b){b[0<a?"resetCursor":"resetCursorEnd"]()}),f.playPaths(a)):(g.emitSignal("playOnEnd",k),g.emitSignal("masterOnEnd",
49
+ k)))})};b.forEach(function(a){a&&(a.timeline=f,setTimeout(function(){r(a)},c.sonification.fadeOutTime))})};d.prototype.pause=function(a){var b=this;Object.keys(b.pathsPlaying).forEach(function(c){b.pathsPlaying[c]&&b.pathsPlaying[c].pause(a)});b.pathsPlaying={}};d.prototype.resetCursor=function(){this.paths.forEach(function(a){c.splat(a).forEach(function(a){a.resetCursor()})});this.cursor=0};d.prototype.resetCursorEnd=function(){this.paths.forEach(function(a){c.splat(a).forEach(function(a){a.resetCursorEnd()})});
50
+ this.cursor=this.paths.length-1};d.prototype.setCursor=function(a){return this.paths.some(function(b){return c.splat(b).some(function(b){return b.setCursor(a)})})};d.prototype.getCursor=function(){return this.getCurrentPlayingPaths().reduce(function(a,b){a[b.id]=b.getCursor();return a},{})};d.prototype.atStart=function(){return!this.getCurrentPlayingPaths().some(function(a){return a.cursor})};d.prototype.getCurrentPlayingPaths=function(){return c.splat(this.paths[this.cursor])};return{TimelineEvent:g,
51
+ TimelinePath:b,Timeline:d}}(l,r);(function(c,f,g,b,d,a,e,h){c.sonification={fadeOutDuration:20,utilities:e,Instrument:f,instruments:g,Earcon:b,TimelineEvent:h.TimelineEvent,TimelinePath:h.TimelinePath,Timeline:h.Timeline};c.Point.prototype.sonify=d.pointSonify;c.Point.prototype.cancelSonify=d.pointCancelSonify;c.Series.prototype.sonify=a.seriesSonify;c.extend(c.Chart.prototype,{sonify:a.chartSonify,pauseSonify:a.pause,resumeSonify:a.resume,rewindSonify:a.rewind,cancelSonify:a.cancel,getCurrentSonifyPoints:a.getCurrentPoints,
52
+ setSonifyCursor:a.setCursor,resetSonifyCursor:a.resetCursor,resetSonifyCursorEnd:a.resetCursorEnd,sonification:{}})})(l,t,w,x,y,A,r,B)});
53
+ //# sourceMappingURL=sonification.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sonification.js.map","lineCount":52,"mappings":"A;;;;;;;;AASC,SAAS,CAACA,CAAD,CAAU,CACM,QAAtB,GAAI,MAAOC,OAAX,EAAkCA,MAAAC,QAAlC,EACIF,CAAA,CAAQ,SAAR,CACA,CADqBA,CACrB,CAAAC,MAAAC,QAAA,CAAiBF,CAFrB,EAG6B,UAAtB,GAAI,MAAOG,OAAX,EAAoCA,MAAAC,IAApC,CACHD,MAAA,CAAO,QAAS,EAAG,CACf,MAAOH,EADQ,CAAnB,CADG,CAKHA,CAAA,CAA8B,WAAtB,GAAA,MAAOK,WAAP,CAAoCA,UAApC,CAAiDC,IAAAA,EAAzD,CATY,CAAnB,CAAA,CAWC,QAAS,CAACD,CAAD,CAAa,CACpB,IAAIE,EAAc,QAAS,CAACC,CAAD,CAAI,CA4I3BD,QAASA,EAAU,CAACE,CAAD,CAAU,CACzB,IAAAC,KAAA,CAAUD,CAAV,CADyB,CA1B7B,IAAIE,EAAiB,CACjBC,KAAM,YADW,CAEjBC,qBAAsB,EAFL,CAGjBC,WAAY,CACRC,cAAe,MADP,CAHK,CA6BrBR,EAAAS,UAAAN,KAAA,CAA4BO,QAAS,CAACR,CAAD,CAAU,CACtC,IAAAS,iBAAA,EAAL,EAIA,IAAAT,QAuBA,CAvBeD,CAAAW,MAAA,CAAQR,CAAR,CAAwBF,CAAxB,CAuBf,CAtBA,IAAAW,GAsBA,CAtBU,IAAAX,QAAAW,GAsBV,CAtB4BX,CAsB5B,EAtBuCA,CAAAW,GAsBvC,EAtBqDZ,CAAAa,UAAA,EAsBrD,CAnBIC,CAmBJ,CAnBUd,CAAAe,aAmBV,CAjBA,IAAAC,SAiBA;AA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UxB7M,aAAc,EAVU,CAA5B,CAvFmH,CAAtH,CAAA,CAoGCjH,CApGD,CAoGaE,CApGb,CAoGyB0K,CApGzB,CAoGsCE,CApGtC,CAoG8C0B,CApG9C,CAoGoEuB,CApGpE,CAoG0F5F,CApG1F,CAoGqG4L,CApGrG,CA7oGmB,CAXvB;","sources":["sonification.src.js"],"names":["factory","module","exports","define","amd","Highcharts","undefined","Instrument","H","options","init","defaultOptions","type","playCallbackInterval","oscillator","waveformShape","prototype","Instrument.prototype.init","initAudioContext","merge","id","uniqueKey","ctx","audioContext","gainNode","createGain","setGain","panNode","createStereoPanner","setPan","connect","destination","initOscillator","playCallbackTimers","error","copy","Instrument.prototype.copy","Instrument.prototype.initAudioContext","Context","win","AudioContext","webkitAudioContext","hasOldContext","state","suspend","createOscillator","Instrument.prototype.initOscillator","oscillatorStarted","Instrument.prototype.setPan","panValue","pan","setValueAtTime","currentTime","Instrument.prototype.setGain","gainValue","rampTime","console","warn","gain","value","linearRampToValueAtTime","cancelGainRamp","Instrument.prototype.cancelGainRamp","cancelScheduledValues","getValidFrequency","Instrument.prototype.getValidFrequency","frequency","min","max","validFrequencies","allowedFrequencies","maximum","pick","Infinity","minimum","length","reduce","acc","cur","Math","abs","clearPlayCallbackTimers","Instrument.prototype.clearPlayCallbackTimers","forEach","timer","clearInterval","setFrequency","Instrument.prototype.setFrequency","frequencyLimits","limits","validFrequency","oscillatorPlay","Instrument.prototype.oscillatorPlay","start","preparePlay","Instrument.prototype.preparePlay","resume","play","Instrument.prototype.play","instrument","duration","setOrStartTimer","setter","setterData","target","currentDurationIx","callbackInterval","setInterval","curTime","push","setTimeout","stopOscillatorTimeout","clearTimeout","stopTimeout","stopCallback","_play","instrument.play","immediate","sonification","fadeOutDuration","onEnd","onStop","stop","minFrequency","maxFrequency","volume","mute","Instrument.prototype.mute","Instrument.prototype.stop","immediately","onStopped","callbackData","instr","reset","e","disconnect","utilities","musicalFrequencies","SignalHandler","supportedSignals","SignalHandler.prototype.init","signals","registerSignalCallbacks","SignalHandler.prototype.registerSignalCallbacks","signalHandler","supportedSignal","clearSignalCallbacks","SignalHandler.prototype.clearSignalCallbacks","signalNames","signalName","emitSignal","SignalHandler.prototype.emitSignal","data","retval","handler","result","getMusicalScale","semitones","filter","freq","i","interval","some","allowedInterval","calculateDataExtremes","chart","prop","series","extremes","points","point","val","virtualAxisTranslate","dataExtremes","lenValueAxis","virtualAxisValue","frequencies","instruments","waveform","Earcon","Earcon.prototype.init","instrumentsPlaying","sonify","Earcon.prototype.sonify","playOptions","masterVolume","masterPan","earcon","playOnEnd","masterOnEnd","opts","instrumentOpts","instrOnEnd","copyId","instrumentOpts.onEnd","apply","arguments","Object","keys","instrumentCopy","cancelSonify","Earcon.prototype.cancelSonify","fadeOut","playing","instrIds","pointSonifyFunctions","defaultInstrumentOptions","minDuration","maxDuration","minVolume","maxVolume","minPan","maxPan","pointSonify","getMappingValue","makeFunction","allowedExtremes","allowedValues","time","currentlyPlayingPoint","isNull","visible","instrumentDefinition","mapping","instrumentMapping","instrumentOptions","cancelled","pointCancelSonify","chartSonifyFunctions","getPointTimeValue","timeProp","getTimeExtremes","getExtremesForInstrumentProps","newExtremes","instrumentParameter","getPointEarcons","earconDefinitions","earcons","earconDefinition","condition","cond","onPoint","makeInstrumentCopies","map","instrumentDef","buildTimelinePathFromSeries","timeExtremes","pointPlayTime","timelineEvents","events","concat","TimelineEvent","eventObject","TimelinePath","onStart","onEventStart","event","Point","timelinePath","timeline","pause","resetCursor","onPointStart","onEventEnd","eventData","onPointEnd","buildSeriesOptions","chartSonifyOptions","seriesOptions","onSeriesStart","onSeriesEnd","isArray","find","optEntry","buildPathOrder","orderOptions","seriesOptionsCallback","order","seriesList","orderList","orderDef","simulItems","splat","items","item","itemObject","get","silentWait","addAfterSeriesWaits","wait","newOrder","simultaneousPaths","getWaitTime","waitTime","def","syncSimultaneousPaths","paths","path","hasEvents","eventsToAdd","addTimelineEvents","getSimulPathDurationTotal","durationTotal","maxPathDuration","buildPathsFromOrder","totalAvailableDurationMs","totalUsedDuration","allPaths","simulPaths","chartSonify","afterSeriesWait","Timeline","seriesSonify","chartSonification","rewind","cancel","pauseSonify","resetSonifyCursor","getCurrentPoints","cursorObj","getCursor","eventObj","setCursor","resetCursorEnd","timelineClasses","TimelineEvent.prototype.init","TimelineEvent.prototype.play","playOptionsOnEnd","args","TimelineEvent.prototype.cancel","TimelinePath.prototype.init","cursor","eventsPlaying","sortEvents","updateEventIdMap","TimelinePath.prototype.sortEvents","sort","a","b","TimelinePath.prototype.updateEventIdMap","eventIdMap","TimelinePath.prototype.addTimelineEvents","newEvents","TimelinePath.prototype.getCursor","TimelinePath.prototype.setCursor","eventId","ix","TimelinePath.prototype.play","playEvents","TimelinePath.prototype.rewind","TimelinePath.prototype.resetCursor","TimelinePath.prototype.resetCursorEnd","TimelinePath.prototype.pause","nextScheduledPlay","TimelinePath.prototype.playEvents","direction","curEvent","nextEvent","timeDiff","signalData","Timeline.prototype.init","pathsPlaying","Timeline.prototype.play","playPaths","Timeline.prototype.rewind","Timeline.prototype.playPaths","curPaths","nextPaths","pathsEnded","playPath","nextPath","fadeOutTime","Timeline.prototype.pause","Timeline.prototype.resetCursor","Timeline.prototype.resetCursorEnd","Timeline.prototype.setCursor","Timeline.prototype.getCursor","getCurrentPlayingPaths","atStart","Timeline.prototype.atStart","Timeline.prototype.getCurrentPlayingPaths","TimelineClasses","Series","extend","Chart","resumeSonify","rewindSonify","getCurrentSonifyPoints","setSonifyCursor","resetSonifyCursorEnd"]}
@@ -0,0 +1,3341 @@
1
+ /**
2
+ * @license Highcharts JS v7.0.3 (2019-02-06)
3
+ * Sonification module
4
+ *
5
+ * (c) 2012-2019 Øystein Moseng
6
+ *
7
+ * License: www.highcharts.com/license
8
+ */
9
+ 'use strict';
10
+ (function (factory) {
11
+ if (typeof module === 'object' && module.exports) {
12
+ factory['default'] = factory;
13
+ module.exports = factory;
14
+ } else if (typeof define === 'function' && define.amd) {
15
+ define(function () {
16
+ return factory;
17
+ });
18
+ } else {
19
+ factory(typeof Highcharts !== 'undefined' ? Highcharts : undefined);
20
+ }
21
+ }(function (Highcharts) {
22
+ var Instrument = (function (H) {
23
+ /* *
24
+ *
25
+ * (c) 2009-2019 Øystein Moseng
26
+ *
27
+ * Instrument class for sonification module.
28
+ *
29
+ * License: www.highcharts.com/license
30
+ *
31
+ * */
32
+
33
+
34
+ /**
35
+ * A set of options for the Instrument class.
36
+ *
37
+ * @requires module:modules/sonification
38
+ *
39
+ * @interface Highcharts.InstrumentOptionsObject
40
+ *//**
41
+ * The type of instrument. Currently only `oscillator` is supported. Defaults
42
+ * to `oscillator`.
43
+ * @name Highcharts.InstrumentOptionsObject#type
44
+ * @type {string|undefined}
45
+ *//**
46
+ * The unique ID of the instrument. Generated if not supplied.
47
+ * @name Highcharts.InstrumentOptionsObject#id
48
+ * @type {string|undefined}
49
+ *//**
50
+ * When using functions to determine frequency or other parameters during
51
+ * playback, this options specifies how often to call the callback functions.
52
+ * Number given in milliseconds. Defaults to 20.
53
+ * @name Highcharts.InstrumentOptionsObject#playCallbackInterval
54
+ * @type {number|undefined}
55
+ *//**
56
+ * A list of allowed frequencies for this instrument. If trying to play a
57
+ * frequency not on this list, the closest frequency will be used. Set to `null`
58
+ * to allow all frequencies to be used. Defaults to `null`.
59
+ * @name Highcharts.InstrumentOptionsObject#allowedFrequencies
60
+ * @type {Array<number>|undefined}
61
+ *//**
62
+ * Options specific to oscillator instruments.
63
+ * @name Highcharts.InstrumentOptionsObject#oscillator
64
+ * @type {Highcharts.OscillatorOptionsObject|undefined}
65
+ */
66
+
67
+
68
+ /**
69
+ * Options for playing an instrument.
70
+ *
71
+ * @requires module:modules/sonification
72
+ *
73
+ * @interface Highcharts.InstrumentPlayOptionsObject
74
+ *//**
75
+ * The frequency of the note to play. Can be a fixed number, or a function. The
76
+ * function receives one argument: the relative time of the note playing (0
77
+ * being the start, and 1 being the end of the note). It should return the
78
+ * frequency number for each point in time. The poll interval of this function
79
+ * is specified by the Instrument.playCallbackInterval option.
80
+ * @name Highcharts.InstrumentPlayOptionsObject#frequency
81
+ * @type {number|Function}
82
+ *//**
83
+ * The duration of the note in milliseconds.
84
+ * @name Highcharts.InstrumentPlayOptionsObject#duration
85
+ * @type {number}
86
+ *//**
87
+ * The minimum frequency to allow. If the instrument has a set of allowed
88
+ * frequencies, the closest frequency is used by default. Use this option to
89
+ * stop too low frequencies from being used.
90
+ * @name Highcharts.InstrumentPlayOptionsObject#minFrequency
91
+ * @type {number|undefined}
92
+ *//**
93
+ * The maximum frequency to allow. If the instrument has a set of allowed
94
+ * frequencies, the closest frequency is used by default. Use this option to
95
+ * stop too high frequencies from being used.
96
+ * @name Highcharts.InstrumentPlayOptionsObject#maxFrequency
97
+ * @type {number|undefined}
98
+ *//**
99
+ * The volume of the instrument. Can be a fixed number between 0 and 1, or a
100
+ * function. The function receives one argument: the relative time of the note
101
+ * playing (0 being the start, and 1 being the end of the note). It should
102
+ * return the volume for each point in time. The poll interval of this function
103
+ * is specified by the Instrument.playCallbackInterval option. Defaults to 1.
104
+ * @name Highcharts.InstrumentPlayOptionsObject#volume
105
+ * @type {number|Function|undefined}
106
+ *//**
107
+ * The panning of the instrument. Can be a fixed number between -1 and 1, or a
108
+ * function. The function receives one argument: the relative time of the note
109
+ * playing (0 being the start, and 1 being the end of the note). It should
110
+ * return the panning value for each point in time. The poll interval of this
111
+ * function is specified by the Instrument.playCallbackInterval option.
112
+ * Defaults to 0.
113
+ * @name Highcharts.InstrumentPlayOptionsObject#pan
114
+ * @type {number|Function|undefined}
115
+ *//**
116
+ * Callback function to be called when the play is completed.
117
+ * @name Highcharts.InstrumentPlayOptionsObject#onEnd
118
+ * @type {Function|undefined}
119
+ */
120
+
121
+
122
+ /**
123
+ * @requires module:modules/sonification
124
+ *
125
+ * @interface Highcharts.OscillatorOptionsObject
126
+ *//**
127
+ * The waveform shape to use for oscillator instruments. Defaults to `sine`.
128
+ * @name Highcharts.OscillatorOptionsObject#waveformShape
129
+ * @type {string|undefined}
130
+ */
131
+
132
+
133
+
134
+
135
+ // Default options for Instrument constructor
136
+ var defaultOptions = {
137
+ type: 'oscillator',
138
+ playCallbackInterval: 20,
139
+ oscillator: {
140
+ waveformShape: 'sine'
141
+ }
142
+ };
143
+
144
+
145
+ /**
146
+ * The Instrument class. Instrument objects represent an instrument capable of
147
+ * playing a certain pitch for a specified duration.
148
+ *
149
+ * @sample highcharts/sonification/instrument/
150
+ * Using Instruments directly
151
+ * @sample highcharts/sonification/instrument-advanced/
152
+ * Using callbacks for instrument parameters
153
+ *
154
+ * @requires module:modules/sonification
155
+ *
156
+ * @class
157
+ * @name Highcharts.Instrument
158
+ *
159
+ * @param {Highcharts.InstrumentOptionsObject} options
160
+ * Options for the instrument instance.
161
+ */
162
+ function Instrument(options) {
163
+ this.init(options);
164
+ }
165
+ Instrument.prototype.init = function (options) {
166
+ if (!this.initAudioContext()) {
167
+ H.error(29);
168
+ return;
169
+ }
170
+ this.options = H.merge(defaultOptions, options);
171
+ this.id = this.options.id = options && options.id || H.uniqueKey();
172
+
173
+ // Init the audio nodes
174
+ var ctx = H.audioContext;
175
+
176
+ this.gainNode = ctx.createGain();
177
+ this.setGain(0);
178
+ this.panNode = ctx.createStereoPanner && ctx.createStereoPanner();
179
+ if (this.panNode) {
180
+ this.setPan(0);
181
+ this.gainNode.connect(this.panNode);
182
+ this.panNode.connect(ctx.destination);
183
+ } else {
184
+ this.gainNode.connect(ctx.destination);
185
+ }
186
+
187
+ // Oscillator initialization
188
+ if (this.options.type === 'oscillator') {
189
+ this.initOscillator(this.options.oscillator);
190
+ }
191
+
192
+ // Init timer list
193
+ this.playCallbackTimers = [];
194
+ };
195
+
196
+
197
+ /**
198
+ * Return a copy of an instrument. Only one instrument instance can play at a
199
+ * time, so use this to get a new copy of the instrument that can play alongside
200
+ * it. The new instrument copy will receive a new ID unless one is supplied in
201
+ * options.
202
+ *
203
+ * @function Highcharts.Instrument#copy
204
+ *
205
+ * @param {Highcharts.InstrumentOptionsObject} [options]
206
+ * Options to merge in for the copy.
207
+ *
208
+ * @return {Highcharts.Instrument}
209
+ * A new Instrument instance with the same options.
210
+ */
211
+ Instrument.prototype.copy = function (options) {
212
+ return new Instrument(H.merge(this.options, { id: null }, options));
213
+ };
214
+
215
+
216
+ /**
217
+ * Init the audio context, if we do not have one.
218
+ * @private
219
+ * @return {boolean} True if successful, false if not.
220
+ */
221
+ Instrument.prototype.initAudioContext = function () {
222
+ var Context = H.win.AudioContext || H.win.webkitAudioContext,
223
+ hasOldContext = !!H.audioContext;
224
+
225
+ if (Context) {
226
+ H.audioContext = H.audioContext || new Context();
227
+ if (
228
+ !hasOldContext &&
229
+ H.audioContext &&
230
+ H.audioContext.state === 'running'
231
+ ) {
232
+ H.audioContext.suspend(); // Pause until we need it
233
+ }
234
+ return !!(
235
+ H.audioContext &&
236
+ H.audioContext.createOscillator &&
237
+ H.audioContext.createGain
238
+ );
239
+ }
240
+ return false;
241
+ };
242
+
243
+
244
+ /**
245
+ * Init an oscillator instrument.
246
+ * @private
247
+ * @param {object} oscillatorOptions - The oscillator options passed to
248
+ * Highcharts.Instrument#init.
249
+ */
250
+ Instrument.prototype.initOscillator = function (options) {
251
+ var ctx = H.audioContext;
252
+
253
+ this.oscillator = ctx.createOscillator();
254
+ this.oscillator.type = options.waveformShape;
255
+ this.oscillator.connect(this.gainNode);
256
+ this.oscillatorStarted = false;
257
+ };
258
+
259
+
260
+ /**
261
+ * Set pan position.
262
+ * @private
263
+ * @param {number} panValue - The pan position to set for the instrument.
264
+ */
265
+ Instrument.prototype.setPan = function (panValue) {
266
+ if (this.panNode) {
267
+ this.panNode.pan.setValueAtTime(panValue, H.audioContext.currentTime);
268
+ }
269
+ };
270
+
271
+
272
+ /**
273
+ * Set gain level. A maximum of 1.2 is allowed before we emit a warning. The
274
+ * actual volume is not set above this level regardless of input.
275
+ * @private
276
+ * @param {number} gainValue - The gain level to set for the instrument.
277
+ * @param {number} [rampTime=0] - Gradually change the gain level, time given in
278
+ * milliseconds.
279
+ */
280
+ Instrument.prototype.setGain = function (gainValue, rampTime) {
281
+ if (this.gainNode) {
282
+ if (gainValue > 1.2) {
283
+ console.warn( // eslint-disable-line
284
+ 'Highcharts sonification warning: ' +
285
+ 'Volume of instrument set too high.'
286
+ );
287
+ gainValue = 1.2;
288
+ }
289
+ if (rampTime) {
290
+ this.gainNode.gain.setValueAtTime(
291
+ this.gainNode.gain.value, H.audioContext.currentTime
292
+ );
293
+ this.gainNode.gain.linearRampToValueAtTime(
294
+ gainValue,
295
+ H.audioContext.currentTime + rampTime / 1000
296
+ );
297
+ } else {
298
+ this.gainNode.gain.setValueAtTime(
299
+ gainValue, H.audioContext.currentTime
300
+ );
301
+ }
302
+ }
303
+ };
304
+
305
+
306
+ /**
307
+ * Cancel ongoing gain ramps.
308
+ * @private
309
+ */
310
+ Instrument.prototype.cancelGainRamp = function () {
311
+ if (this.gainNode) {
312
+ this.gainNode.gain.cancelScheduledValues(0);
313
+ }
314
+ };
315
+
316
+
317
+ /**
318
+ * Get the closest valid frequency for this instrument.
319
+ * @private
320
+ * @param {number} frequency - The target frequency.
321
+ * @param {number} [min] - Minimum frequency to return.
322
+ * @param {number} [max] - Maximum frequency to return.
323
+ * @return {number} The closest valid frequency to the input frequency.
324
+ */
325
+ Instrument.prototype.getValidFrequency = function (frequency, min, max) {
326
+ var validFrequencies = this.options.allowedFrequencies,
327
+ maximum = H.pick(max, Infinity),
328
+ minimum = H.pick(min, -Infinity);
329
+
330
+ return !validFrequencies || !validFrequencies.length ?
331
+ // No valid frequencies for this instrument, return the target
332
+ frequency :
333
+ // Use the valid frequencies and return the closest match
334
+ validFrequencies.reduce(function (acc, cur) {
335
+ // Find the closest allowed value
336
+ return Math.abs(cur - frequency) < Math.abs(acc - frequency) &&
337
+ cur < maximum && cur > minimum ?
338
+ cur : acc;
339
+ }, Infinity);
340
+ };
341
+
342
+
343
+ /**
344
+ * Clear existing play callback timers.
345
+ * @private
346
+ */
347
+ Instrument.prototype.clearPlayCallbackTimers = function () {
348
+ this.playCallbackTimers.forEach(function (timer) {
349
+ clearInterval(timer);
350
+ });
351
+ this.playCallbackTimers = [];
352
+ };
353
+
354
+
355
+ /**
356
+ * Set the current frequency being played by the instrument. The closest valid
357
+ * frequency between the frequency limits is used.
358
+ * @param {number} frequency - The frequency to set.
359
+ * @param {object} [frequencyLimits] - Object with maxFrequency and minFrequency
360
+ */
361
+ Instrument.prototype.setFrequency = function (frequency, frequencyLimits) {
362
+ var limits = frequencyLimits || {},
363
+ validFrequency = this.getValidFrequency(
364
+ frequency, limits.min, limits.max
365
+ );
366
+
367
+ if (this.options.type === 'oscillator') {
368
+ this.oscillatorPlay(validFrequency);
369
+ }
370
+ };
371
+
372
+
373
+ /**
374
+ * Play oscillator instrument.
375
+ * @private
376
+ * @param {number} frequency - The frequency to play.
377
+ */
378
+ Instrument.prototype.oscillatorPlay = function (frequency) {
379
+ if (!this.oscillatorStarted) {
380
+ this.oscillator.start();
381
+ this.oscillatorStarted = true;
382
+ }
383
+
384
+ this.oscillator.frequency.setValueAtTime(
385
+ frequency, H.audioContext.currentTime
386
+ );
387
+ };
388
+
389
+
390
+ /**
391
+ * Prepare instrument before playing. Resumes the audio context and starts the
392
+ * oscillator.
393
+ * @private
394
+ */
395
+ Instrument.prototype.preparePlay = function () {
396
+ this.setGain(0.001);
397
+ if (H.audioContext.state === 'suspended') {
398
+ H.audioContext.resume();
399
+ }
400
+ if (this.oscillator && !this.oscillatorStarted) {
401
+ this.oscillator.start();
402
+ this.oscillatorStarted = true;
403
+ }
404
+ };
405
+
406
+
407
+ /**
408
+ * Play the instrument according to options.
409
+ *
410
+ * @sample highcharts/sonification/instrument/
411
+ * Using Instruments directly
412
+ * @sample highcharts/sonification/instrument-advanced/
413
+ * Using callbacks for instrument parameters
414
+ *
415
+ * @function Highcharts.Instrument#play
416
+ *
417
+ * @param {Highcharts.InstrumentPlayOptionsObject} options
418
+ * Options for the playback of the instrument.
419
+ */
420
+ Instrument.prototype.play = function (options) {
421
+ var instrument = this,
422
+ duration = options.duration || 0,
423
+ // Set a value, or if it is a function, set it continously as a timer.
424
+ // Pass in the value/function to set, the setter function, and any
425
+ // additional data to pass through to the setter function.
426
+ setOrStartTimer = function (value, setter, setterData) {
427
+ var target = options.duration,
428
+ currentDurationIx = 0,
429
+ callbackInterval = instrument.options.playCallbackInterval;
430
+
431
+ if (typeof value === 'function') {
432
+ var timer = setInterval(function () {
433
+ currentDurationIx++;
434
+ var curTime = currentDurationIx * callbackInterval / target;
435
+
436
+ if (curTime >= 1) {
437
+ instrument[setter](value(1), setterData);
438
+ clearInterval(timer);
439
+ } else {
440
+ instrument[setter](value(curTime), setterData);
441
+ }
442
+ }, callbackInterval);
443
+
444
+ instrument.playCallbackTimers.push(timer);
445
+ } else {
446
+ instrument[setter](value, setterData);
447
+ }
448
+ };
449
+
450
+ if (!instrument.id) {
451
+ // No audio support - do nothing
452
+ return;
453
+ }
454
+
455
+ // If the AudioContext is suspended we have to resume it before playing
456
+ if (
457
+ H.audioContext.state === 'suspended' ||
458
+ this.oscillator && !this.oscillatorStarted
459
+ ) {
460
+ instrument.preparePlay();
461
+ // Try again in 10ms
462
+ setTimeout(function () {
463
+ instrument.play(options);
464
+ }, 10);
465
+ return;
466
+ }
467
+
468
+ // Clear any existing play timers
469
+ if (instrument.playCallbackTimers.length) {
470
+ instrument.clearPlayCallbackTimers();
471
+ }
472
+
473
+ // Clear any gain ramps
474
+ instrument.cancelGainRamp();
475
+
476
+ // Clear stop oscillator timer
477
+ if (instrument.stopOscillatorTimeout) {
478
+ clearTimeout(instrument.stopOscillatorTimeout);
479
+ delete instrument.stopOscillatorTimeout;
480
+ }
481
+
482
+ // If a note is playing right now, clear the stop timeout, and call the
483
+ // callback.
484
+ if (instrument.stopTimeout) {
485
+ clearTimeout(instrument.stopTimeout);
486
+ delete instrument.stopTimeout;
487
+ if (instrument.stopCallback) {
488
+ // We have a callback for the play we are interrupting. We do not
489
+ // allow this callback to start a new play, because that leads to
490
+ // chaos. We pass in 'cancelled' to indicate that this note did not
491
+ // finish, but still stopped.
492
+ instrument._play = instrument.play;
493
+ instrument.play = function () { };
494
+ instrument.stopCallback('cancelled');
495
+ instrument.play = instrument._play;
496
+ }
497
+ }
498
+
499
+ // Stop the note without fadeOut if the duration is too short to hear the
500
+ // note otherwise.
501
+ var immediate = duration < H.sonification.fadeOutDuration + 20;
502
+
503
+ // Stop the instrument after the duration of the note
504
+ instrument.stopCallback = options.onEnd;
505
+ var onStop = function () {
506
+ delete instrument.stopTimeout;
507
+ instrument.stop(immediate);
508
+ };
509
+
510
+ if (duration) {
511
+ instrument.stopTimeout = setTimeout(
512
+ onStop,
513
+ immediate ? duration :
514
+ duration - H.sonification.fadeOutDuration
515
+ );
516
+
517
+ // Play the note
518
+ setOrStartTimer(options.frequency, 'setFrequency', null, {
519
+ minFrequency: options.minFrequency,
520
+ maxFrequency: options.maxFrequency
521
+ });
522
+
523
+ // Set the volume and panning
524
+ setOrStartTimer(H.pick(options.volume, 1), 'setGain', 4); // Slight ramp
525
+ setOrStartTimer(H.pick(options.pan, 0), 'setPan');
526
+ } else {
527
+ // No note duration, so just stop immediately
528
+ onStop();
529
+ }
530
+ };
531
+
532
+
533
+ /**
534
+ * Mute an instrument that is playing. If the instrument is not currently
535
+ * playing, this function does nothing.
536
+ *
537
+ * @function Highcharts.Instrument#mute
538
+ */
539
+ Instrument.prototype.mute = function () {
540
+ this.setGain(0.0001, H.sonification.fadeOutDuration * 0.8);
541
+ };
542
+
543
+
544
+ /**
545
+ * Stop the instrument playing.
546
+ *
547
+ * @function Highcharts.Instrument#stop
548
+ *
549
+ * @param {boolean} immediately
550
+ * Whether to do the stop immediately or fade out.
551
+ *
552
+ * @param {Function} onStopped
553
+ * Callback function to be called when the stop is completed.
554
+ *
555
+ * @param {*} callbackData
556
+ * Data to send to the onEnd callback functions.
557
+ */
558
+ Instrument.prototype.stop = function (immediately, onStopped, callbackData) {
559
+ var instr = this,
560
+ reset = function () {
561
+ // Remove timeout reference
562
+ if (instr.stopOscillatorTimeout) {
563
+ delete instr.stopOscillatorTimeout;
564
+ }
565
+ // The oscillator may have stopped in the meantime here, so allow
566
+ // this function to fail if so.
567
+ try {
568
+ instr.oscillator.stop();
569
+ } catch (e) {}
570
+ instr.oscillator.disconnect(instr.gainNode);
571
+ // We need a new oscillator in order to restart it
572
+ instr.initOscillator(instr.options.oscillator);
573
+ // Done stopping, call the callback from the stop
574
+ if (onStopped) {
575
+ onStopped(callbackData);
576
+ }
577
+ // Call the callback for the play we finished
578
+ if (instr.stopCallback) {
579
+ instr.stopCallback(callbackData);
580
+ }
581
+ };
582
+
583
+ // Clear any existing timers
584
+ if (instr.playCallbackTimers.length) {
585
+ instr.clearPlayCallbackTimers();
586
+ }
587
+ if (instr.stopTimeout) {
588
+ clearTimeout(instr.stopTimeout);
589
+ }
590
+ if (immediately) {
591
+ instr.setGain(0);
592
+ reset();
593
+ } else {
594
+ instr.mute();
595
+ // Stop the oscillator after the mute fade-out has finished
596
+ instr.stopOscillatorTimeout =
597
+ setTimeout(reset, H.sonification.fadeOutDuration + 100);
598
+ }
599
+ };
600
+
601
+
602
+
603
+ return Instrument;
604
+ }(Highcharts));
605
+ var frequencies = (function () {
606
+ /* *
607
+ *
608
+ * (c) 2009-2019 Øystein Moseng
609
+ *
610
+ * List of musical frequencies from C0 to C8.
611
+ *
612
+ * License: www.highcharts.com/license
613
+ *
614
+ * */
615
+
616
+
617
+ var frequencies = [
618
+ 16.351597831287414, // C0
619
+ 17.323914436054505,
620
+ 18.354047994837977,
621
+ 19.445436482630058,
622
+ 20.601722307054366,
623
+ 21.826764464562746,
624
+ 23.12465141947715,
625
+ 24.499714748859326,
626
+ 25.956543598746574,
627
+ 27.5, // A0
628
+ 29.13523509488062,
629
+ 30.86770632850775,
630
+ 32.70319566257483, // C1
631
+ 34.64782887210901,
632
+ 36.70809598967594,
633
+ 38.890872965260115,
634
+ 41.20344461410875,
635
+ 43.653528929125486,
636
+ 46.2493028389543,
637
+ 48.999429497718666,
638
+ 51.91308719749314,
639
+ 55, // A1
640
+ 58.27047018976124,
641
+ 61.7354126570155,
642
+ 65.40639132514966, // C2
643
+ 69.29565774421802,
644
+ 73.41619197935188,
645
+ 77.78174593052023,
646
+ 82.4068892282175,
647
+ 87.30705785825097,
648
+ 92.4986056779086,
649
+ 97.99885899543733,
650
+ 103.82617439498628,
651
+ 110, // A2
652
+ 116.54094037952248,
653
+ 123.47082531403103,
654
+ 130.8127826502993, // C3
655
+ 138.59131548843604,
656
+ 146.8323839587038,
657
+ 155.56349186104046,
658
+ 164.81377845643496,
659
+ 174.61411571650194,
660
+ 184.9972113558172,
661
+ 195.99771799087463,
662
+ 207.65234878997256,
663
+ 220, // A3
664
+ 233.08188075904496,
665
+ 246.94165062806206,
666
+ 261.6255653005986, // C4
667
+ 277.1826309768721,
668
+ 293.6647679174076,
669
+ 311.1269837220809,
670
+ 329.6275569128699,
671
+ 349.2282314330039,
672
+ 369.9944227116344,
673
+ 391.99543598174927,
674
+ 415.3046975799451,
675
+ 440, // A4
676
+ 466.1637615180899,
677
+ 493.8833012561241,
678
+ 523.2511306011972, // C5
679
+ 554.3652619537442,
680
+ 587.3295358348151,
681
+ 622.2539674441618,
682
+ 659.2551138257398,
683
+ 698.4564628660078,
684
+ 739.9888454232688,
685
+ 783.9908719634985,
686
+ 830.6093951598903,
687
+ 880, // A5
688
+ 932.3275230361799,
689
+ 987.7666025122483,
690
+ 1046.5022612023945, // C6
691
+ 1108.7305239074883,
692
+ 1174.6590716696303,
693
+ 1244.5079348883237,
694
+ 1318.5102276514797,
695
+ 1396.9129257320155,
696
+ 1479.9776908465376,
697
+ 1567.981743926997,
698
+ 1661.2187903197805,
699
+ 1760, // A6
700
+ 1864.6550460723597,
701
+ 1975.533205024496,
702
+ 2093.004522404789, // C7
703
+ 2217.4610478149766,
704
+ 2349.31814333926,
705
+ 2489.0158697766474,
706
+ 2637.02045530296,
707
+ 2793.825851464031,
708
+ 2959.955381693075,
709
+ 3135.9634878539946,
710
+ 3322.437580639561,
711
+ 3520, // A7
712
+ 3729.3100921447194,
713
+ 3951.066410048992,
714
+ 4186.009044809578 // C8
715
+ ];
716
+
717
+
718
+ return frequencies;
719
+ }());
720
+ var utilities = (function (musicalFrequencies) {
721
+ /* *
722
+ *
723
+ * (c) 2009-2019 Øystein Moseng
724
+ *
725
+ * Utility functions for sonification.
726
+ *
727
+ * License: www.highcharts.com/license
728
+ *
729
+ * */
730
+
731
+
732
+
733
+
734
+ /**
735
+ * The SignalHandler class. Stores signal callbacks (event handlers), and
736
+ * provides an interface to register them, and emit signals. The word "event" is
737
+ * not used to avoid confusion with TimelineEvents.
738
+ *
739
+ * @requires module:modules/sonification
740
+ *
741
+ * @private
742
+ * @class
743
+ * @name Highcharts.SignalHandler
744
+ *
745
+ * @param {Array<string>} supportedSignals
746
+ * List of supported signal names.
747
+ */
748
+ function SignalHandler(supportedSignals) {
749
+ this.init(supportedSignals || []);
750
+ }
751
+ SignalHandler.prototype.init = function (supportedSignals) {
752
+ this.supportedSignals = supportedSignals;
753
+ this.signals = {};
754
+ };
755
+
756
+
757
+ /**
758
+ * Register a set of signal callbacks with this SignalHandler.
759
+ * Multiple signal callbacks can be registered for the same signal.
760
+ * @private
761
+ * @param {object} signals - An object that contains a mapping from the signal
762
+ * name to the callbacks. Only supported events are considered.
763
+ */
764
+ SignalHandler.prototype.registerSignalCallbacks = function (signals) {
765
+ var signalHandler = this;
766
+
767
+ signalHandler.supportedSignals.forEach(function (supportedSignal) {
768
+ if (signals[supportedSignal]) {
769
+ (
770
+ signalHandler.signals[supportedSignal] =
771
+ signalHandler.signals[supportedSignal] || []
772
+ ).push(
773
+ signals[supportedSignal]
774
+ );
775
+ }
776
+ });
777
+ };
778
+
779
+
780
+ /**
781
+ * Clear signal callbacks, optionally by name.
782
+ * @private
783
+ * @param {Array<string>} [signalNames] - A list of signal names to clear. If
784
+ * not supplied, all signal callbacks are removed.
785
+ */
786
+ SignalHandler.prototype.clearSignalCallbacks = function (signalNames) {
787
+ var signalHandler = this;
788
+
789
+ if (signalNames) {
790
+ signalNames.forEach(function (signalName) {
791
+ if (signalHandler.signals[signalName]) {
792
+ delete signalHandler.signals[signalName];
793
+ }
794
+ });
795
+ } else {
796
+ signalHandler.signals = {};
797
+ }
798
+ };
799
+
800
+
801
+ /**
802
+ * Emit a signal. Does nothing if the signal does not exist, or has no
803
+ * registered callbacks.
804
+ * @private
805
+ * @param {string} signalNames - Name of signal to emit.
806
+ * @param {*} data - Data to pass to the callback.
807
+ */
808
+ SignalHandler.prototype.emitSignal = function (signalName, data) {
809
+ var retval;
810
+
811
+ if (this.signals[signalName]) {
812
+ this.signals[signalName].forEach(function (handler) {
813
+ var result = handler(data);
814
+
815
+ retval = result !== undefined ? result : retval;
816
+ });
817
+ }
818
+ return retval;
819
+ };
820
+
821
+
822
+ var utilities = {
823
+
824
+ // List of musical frequencies from C0 to C8
825
+ musicalFrequencies: musicalFrequencies,
826
+
827
+ // SignalHandler class
828
+ SignalHandler: SignalHandler,
829
+
830
+ /**
831
+ * Get a musical scale by specifying the semitones from 1-12 to include.
832
+ * 1: C, 2: C#, 3: D, 4: D#, 5: E, 6: F,
833
+ * 7: F#, 8: G, 9: G#, 10: A, 11: Bb, 12: B
834
+ * @private
835
+ * @param {Array<number>} semitones - Array of semitones from 1-12 to
836
+ * include in the scale. Duplicate entries are ignored.
837
+ * @return {Array<number>} Array of frequencies from C0 to C8 that are
838
+ * included in this scale.
839
+ */
840
+ getMusicalScale: function (semitones) {
841
+ return musicalFrequencies.filter(function (freq, i) {
842
+ var interval = i % 12 + 1;
843
+
844
+ return semitones.some(function (allowedInterval) {
845
+ return allowedInterval === interval;
846
+ });
847
+ });
848
+ },
849
+
850
+ /**
851
+ * Calculate the extreme values in a chart for a data prop.
852
+ * @private
853
+ * @param {Highcharts.Chart} chart - The chart
854
+ * @param {string} prop - The data prop to find extremes for
855
+ * @return {object} Object with min and max properties
856
+ */
857
+ calculateDataExtremes: function (chart, prop) {
858
+ return chart.series.reduce(function (extremes, series) {
859
+ // We use cropped points rather than series.data here, to allow
860
+ // users to zoom in for better fidelity.
861
+ series.points.forEach(function (point) {
862
+ var val = point[prop] !== undefined ?
863
+ point[prop] : point.options[prop];
864
+
865
+ extremes.min = Math.min(extremes.min, val);
866
+ extremes.max = Math.max(extremes.max, val);
867
+ });
868
+ return extremes;
869
+ }, {
870
+ min: Infinity,
871
+ max: -Infinity
872
+ });
873
+ },
874
+
875
+ /**
876
+ * Translate a value on a virtual axis. Creates a new, virtual, axis with a
877
+ * min and max, and maps the relative value onto this axis.
878
+ * @private
879
+ * @param {number} value - The relative data value to translate.
880
+ * @param {object} dataExtremes - The possible extremes for this value.
881
+ * @param {object} limits - Limits for the virtual axis.
882
+ * @return {number} The value mapped to the virtual axis.
883
+ */
884
+ virtualAxisTranslate: function (value, dataExtremes, limits) {
885
+ var lenValueAxis = dataExtremes.max - dataExtremes.min,
886
+ lenVirtualAxis = limits.max - limits.min,
887
+ virtualAxisValue = limits.min +
888
+ lenVirtualAxis * (value - dataExtremes.min) / lenValueAxis;
889
+
890
+ return lenValueAxis > 0 ?
891
+ Math.max(Math.min(virtualAxisValue, limits.max), limits.min) :
892
+ limits.min;
893
+ }
894
+ };
895
+
896
+
897
+ return utilities;
898
+ }(frequencies));
899
+ var instruments = (function (Instrument, utilities) {
900
+ /* *
901
+ *
902
+ * (c) 2009-2019 Øystein Moseng
903
+ *
904
+ * Instrument definitions for sonification module.
905
+ *
906
+ * License: www.highcharts.com/license
907
+ *
908
+ * */
909
+
910
+
911
+
912
+ var instruments = {};
913
+
914
+ ['sine', 'square', 'triangle', 'sawtooth'].forEach(function (waveform) {
915
+ // Add basic instruments
916
+ instruments[waveform] = new Instrument({
917
+ oscillator: { waveformShape: waveform }
918
+ });
919
+
920
+ // Add musical instruments
921
+ instruments[waveform + 'Musical'] = new Instrument({
922
+ allowedFrequencies: utilities.musicalFrequencies,
923
+ oscillator: { waveformShape: waveform }
924
+ });
925
+
926
+ // Add scaled instruments
927
+ instruments[waveform + 'Major'] = new Instrument({
928
+ allowedFrequencies: utilities.getMusicalScale([1, 3, 5, 6, 8, 10, 12]),
929
+ oscillator: { waveformShape: waveform }
930
+ });
931
+ });
932
+
933
+
934
+ return instruments;
935
+ }(Instrument, utilities));
936
+ var Earcon = (function (H) {
937
+ /* *
938
+ *
939
+ * (c) 2009-2019 Øystein Moseng
940
+ *
941
+ * Earcons for the sonification module in Highcharts.
942
+ *
943
+ * License: www.highcharts.com/license
944
+ *
945
+ * */
946
+
947
+
948
+
949
+ /**
950
+ * Define an Instrument and the options for playing it.
951
+ *
952
+ * @requires module:modules/sonification
953
+ *
954
+ * @interface Highcharts.EarconInstrument
955
+ *//**
956
+ * An instrument instance or the name of the instrument in the
957
+ * Highcharts.sonification.instruments map.
958
+ * @name Highcharts.EarconInstrument#instrument
959
+ * @type {Highcharts.Instrument|String}
960
+ *//**
961
+ * The options to pass to Instrument.play.
962
+ * @name Highcharts.EarconInstrument#playOptions
963
+ * @type {object}
964
+ */
965
+
966
+
967
+ /**
968
+ * Options for an Earcon.
969
+ *
970
+ * @requires module:modules/sonification
971
+ *
972
+ * @interface Highcharts.EarconOptionsObject
973
+ *//**
974
+ * The instruments and their options defining this earcon.
975
+ * @name Highcharts.EarconOptionsObject#instruments
976
+ * @type {Array<Highcharts.EarconInstrument>}
977
+ *//**
978
+ * The unique ID of the Earcon. Generated if not supplied.
979
+ * @name Highcharts.EarconOptionsObject#id
980
+ * @type {string|undefined}
981
+ *//**
982
+ * Global panning of all instruments. Overrides all panning on individual
983
+ * instruments. Can be a number between -1 and 1.
984
+ * @name Highcharts.EarconOptionsObject#pan
985
+ * @type {number|undefined}
986
+ *//**
987
+ * Master volume for all instruments. Volume settings on individual instruments
988
+ * can still be used for relative volume between the instruments. This setting
989
+ * does not affect volumes set by functions in individual instruments. Can be a
990
+ * number between 0 and 1. Defaults to 1.
991
+ * @name Highcharts.EarconOptionsObject#volume
992
+ * @type {number|undefined}
993
+ *//**
994
+ * Callback function to call when earcon has finished playing.
995
+ * @name Highcharts.EarconOptionsObject#onEnd
996
+ * @type {Function|undefined}
997
+ */
998
+
999
+ /**
1000
+ * The Earcon class. Earcon objects represent a certain sound consisting of
1001
+ * one or more instruments playing a predefined sound.
1002
+ *
1003
+ * @sample highcharts/sonification/earcon/
1004
+ * Using earcons directly
1005
+ *
1006
+ * @requires module:modules/sonification
1007
+ *
1008
+ * @class
1009
+ * @name Highcharts.Earcon
1010
+ *
1011
+ * @param {Highcharts.EarconOptionsObject} options
1012
+ * Options for the Earcon instance.
1013
+ */
1014
+ function Earcon(options) {
1015
+ this.init(options || {});
1016
+ }
1017
+ Earcon.prototype.init = function (options) {
1018
+ this.options = options;
1019
+ if (!this.options.id) {
1020
+ this.options.id = this.id = H.uniqueKey();
1021
+ }
1022
+ this.instrumentsPlaying = {};
1023
+ };
1024
+
1025
+
1026
+ /**
1027
+ * Play the earcon, optionally overriding init options.
1028
+ *
1029
+ * @sample highcharts/sonification/earcon/
1030
+ * Using earcons directly
1031
+ *
1032
+ * @function Highcharts.Earcon#sonify
1033
+ *
1034
+ * @param {Highcharts.EarconOptionsObject} options
1035
+ * Override existing options.
1036
+ */
1037
+ Earcon.prototype.sonify = function (options) {
1038
+ var playOptions = H.merge(this.options, options);
1039
+
1040
+ // Find master volume/pan settings
1041
+ var masterVolume = H.pick(playOptions.volume, 1),
1042
+ masterPan = playOptions.pan,
1043
+ earcon = this,
1044
+ playOnEnd = options && options.onEnd,
1045
+ masterOnEnd = earcon.options.onEnd;
1046
+
1047
+ // Go through the instruments and play them
1048
+ playOptions.instruments.forEach(function (opts) {
1049
+ var instrument = typeof opts.instrument === 'string' ?
1050
+ H.sonification.instruments[opts.instrument] : opts.instrument,
1051
+ instrumentOpts = H.merge(opts.playOptions),
1052
+ instrOnEnd,
1053
+ instrumentCopy,
1054
+ copyId;
1055
+
1056
+ if (instrument && instrument.play) {
1057
+ if (opts.playOptions) {
1058
+ // Handle master pan/volume
1059
+ if (typeof opts.playOptions.volume !== 'function') {
1060
+ instrumentOpts.volume = H.pick(masterVolume, 1) *
1061
+ H.pick(opts.playOptions.volume, 1);
1062
+ }
1063
+ instrumentOpts.pan = H.pick(masterPan, instrumentOpts.pan);
1064
+
1065
+ // Handle onEnd
1066
+ instrOnEnd = instrumentOpts.onEnd;
1067
+ instrumentOpts.onEnd = function () {
1068
+ delete earcon.instrumentsPlaying[copyId];
1069
+ if (instrOnEnd) {
1070
+ instrOnEnd.apply(this, arguments);
1071
+ }
1072
+ if (!Object.keys(earcon.instrumentsPlaying).length) {
1073
+ if (playOnEnd) {
1074
+ playOnEnd.apply(this, arguments);
1075
+ }
1076
+ if (masterOnEnd) {
1077
+ masterOnEnd.apply(this, arguments);
1078
+ }
1079
+ }
1080
+ };
1081
+
1082
+ // Play the instrument. Use a copy so we can play multiple at
1083
+ // the same time.
1084
+ instrumentCopy = instrument.copy();
1085
+ copyId = instrumentCopy.id;
1086
+ earcon.instrumentsPlaying[copyId] = instrumentCopy;
1087
+ instrumentCopy.play(instrumentOpts);
1088
+ }
1089
+ } else {
1090
+ H.error(30);
1091
+ }
1092
+ });
1093
+ };
1094
+
1095
+
1096
+ /**
1097
+ * Cancel any current sonification of the Earcon. Calls onEnd functions.
1098
+ *
1099
+ * @function Highcharts.Earcon#cancelSonify
1100
+ *
1101
+ * @param {boolean} [fadeOut=false]
1102
+ * Whether or not to fade out as we stop. If false, the earcon is
1103
+ * cancelled synchronously.
1104
+ */
1105
+ Earcon.prototype.cancelSonify = function (fadeOut) {
1106
+ var playing = this.instrumentsPlaying,
1107
+ instrIds = playing && Object.keys(playing);
1108
+
1109
+ if (instrIds && instrIds.length) {
1110
+ instrIds.forEach(function (instr) {
1111
+ playing[instr].stop(!fadeOut, null, 'cancelled');
1112
+ });
1113
+ this.instrumentsPlaying = {};
1114
+ }
1115
+ };
1116
+
1117
+
1118
+
1119
+ return Earcon;
1120
+ }(Highcharts));
1121
+ var pointSonifyFunctions = (function (H, utilities) {
1122
+ /* *
1123
+ *
1124
+ * (c) 2009-2019 Øystein Moseng
1125
+ *
1126
+ * Code for sonifying single points.
1127
+ *
1128
+ * License: www.highcharts.com/license
1129
+ *
1130
+ * */
1131
+
1132
+
1133
+ /**
1134
+ * Define the parameter mapping for an instrument.
1135
+ *
1136
+ * @requires module:modules/sonification
1137
+ *
1138
+ * @interface Highcharts.PointInstrumentMappingObject
1139
+ *//**
1140
+ * Define the volume of the instrument. This can be a string with a data
1141
+ * property name, e.g. `'y'`, in which case this data property is used to define
1142
+ * the volume relative to the `y`-values of the other points. A higher `y` value
1143
+ * would then result in a higher volume. This option can also be a fixed number
1144
+ * or a function. If it is a function, this function is called in regular
1145
+ * intervals while the note is playing. It receives three arguments: The point,
1146
+ * the dataExtremes, and the current relative time - where 0 is the beginning of
1147
+ * the note and 1 is the end. The function should return the volume of the note
1148
+ * as a number between 0 and 1.
1149
+ * @name Highcharts.PointInstrumentMappingObject#volume
1150
+ * @type {string|number|Function}
1151
+ *//**
1152
+ * Define the duration of the notes for this instrument. This can be a string
1153
+ * with a data property name, e.g. `'y'`, in which case this data property is
1154
+ * used to define the duration relative to the `y`-values of the other points. A
1155
+ * higher `y` value would then result in a longer duration. This option can also
1156
+ * be a fixed number or a function. If it is a function, this function is called
1157
+ * once before the note starts playing, and should return the duration in
1158
+ * milliseconds. It receives two arguments: The point, and the dataExtremes.
1159
+ * @name Highcharts.PointInstrumentMappingObject#duration
1160
+ * @type {string|number|Function}
1161
+ *//**
1162
+ * Define the panning of the instrument. This can be a string with a data
1163
+ * property name, e.g. `'x'`, in which case this data property is used to define
1164
+ * the panning relative to the `x`-values of the other points. A higher `x`
1165
+ * value would then result in a higher panning value (panned further to the
1166
+ * right). This option can also be a fixed number or a function. If it is a
1167
+ * function, this function is called in regular intervals while the note is
1168
+ * playing. It receives three arguments: The point, the dataExtremes, and the
1169
+ * current relative time - where 0 is the beginning of the note and 1 is the
1170
+ * end. The function should return the panning of the note as a number between
1171
+ * -1 and 1.
1172
+ * @name Highcharts.PointInstrumentMappingObject#pan
1173
+ * @type {string|number|Function|undefined}
1174
+ *//**
1175
+ * Define the frequency of the instrument. This can be a string with a data
1176
+ * property name, e.g. `'y'`, in which case this data property is used to define
1177
+ * the frequency relative to the `y`-values of the other points. A higher `y`
1178
+ * value would then result in a higher frequency. This option can also be a
1179
+ * fixed number or a function. If it is a function, this function is called in
1180
+ * regular intervals while the note is playing. It receives three arguments:
1181
+ * The point, the dataExtremes, and the current relative time - where 0 is the
1182
+ * beginning of the note and 1 is the end. The function should return the
1183
+ * frequency of the note as a number (in Hz).
1184
+ * @name Highcharts.PointInstrumentMappingObject#frequency
1185
+ * @type {string|number|Function}
1186
+ */
1187
+
1188
+
1189
+ /**
1190
+ * @requires module:modules/sonification
1191
+ *
1192
+ * @interface Highcharts.PointInstrumentOptionsObject
1193
+ *//**
1194
+ * The minimum duration for a note when using a data property for duration. Can
1195
+ * be overridden by using either a fixed number or a function for
1196
+ * instrumentMapping.duration. Defaults to 20.
1197
+ * @name Highcharts.PointInstrumentOptionsObject#minDuration
1198
+ * @type {number|undefined}
1199
+ *//**
1200
+ * The maximum duration for a note when using a data property for duration. Can
1201
+ * be overridden by using either a fixed number or a function for
1202
+ * instrumentMapping.duration. Defaults to 2000.
1203
+ * @name Highcharts.PointInstrumentOptionsObject#maxDuration
1204
+ * @type {number|undefined}
1205
+ *//**
1206
+ * The minimum pan value for a note when using a data property for panning. Can
1207
+ * be overridden by using either a fixed number or a function for
1208
+ * instrumentMapping.pan. Defaults to -1 (fully left).
1209
+ * @name Highcharts.PointInstrumentOptionsObject#minPan
1210
+ * @type {number|undefined}
1211
+ *//**
1212
+ * The maximum pan value for a note when using a data property for panning. Can
1213
+ * be overridden by using either a fixed number or a function for
1214
+ * instrumentMapping.pan. Defaults to 1 (fully right).
1215
+ * @name Highcharts.PointInstrumentOptionsObject#maxPan
1216
+ * @type {number|undefined}
1217
+ *//**
1218
+ * The minimum volume for a note when using a data property for volume. Can be
1219
+ * overridden by using either a fixed number or a function for
1220
+ * instrumentMapping.volume. Defaults to 0.1.
1221
+ * @name Highcharts.PointInstrumentOptionsObject#minVolume
1222
+ * @type {number|undefined}
1223
+ *//**
1224
+ * The maximum volume for a note when using a data property for volume. Can be
1225
+ * overridden by using either a fixed number or a function for
1226
+ * instrumentMapping.volume. Defaults to 1.
1227
+ * @name Highcharts.PointInstrumentOptionsObject#maxVolume
1228
+ * @type {number|undefined}
1229
+ *//**
1230
+ * The minimum frequency for a note when using a data property for frequency.
1231
+ * Can be overridden by using either a fixed number or a function for
1232
+ * instrumentMapping.frequency. Defaults to 220.
1233
+ * @name Highcharts.PointInstrumentOptionsObject#minFrequency
1234
+ * @type {number|undefined}
1235
+ *//**
1236
+ * The maximum frequency for a note when using a data property for frequency.
1237
+ * Can be overridden by using either a fixed number or a function for
1238
+ * instrumentMapping.frequency. Defaults to 2200.
1239
+ * @name Highcharts.PointInstrumentOptionsObject#maxFrequency
1240
+ * @type {number|undefined}
1241
+ */
1242
+
1243
+
1244
+ /**
1245
+ * An instrument definition for a point, specifying the instrument to play and
1246
+ * how to play it.
1247
+ *
1248
+ * @interface Highcharts.PointInstrumentObject
1249
+ *//**
1250
+ * An Instrument instance or the name of the instrument in the
1251
+ * Highcharts.sonification.instruments map.
1252
+ * @name Highcharts.PointInstrumentObject#instrument
1253
+ * @type {Highcharts.Instrument|string}
1254
+ *//**
1255
+ * Mapping of instrument parameters for this instrument.
1256
+ * @name Highcharts.PointInstrumentObject#instrumentMapping
1257
+ * @type {Highcharts.PointInstrumentMappingObject}
1258
+ *//**
1259
+ * Options for this instrument.
1260
+ * @name Highcharts.PointInstrumentObject#instrumentOptions
1261
+ * @type {Highcharts.PointInstrumentOptionsObject|undefined}
1262
+ *//**
1263
+ * Callback to call when the instrument has stopped playing.
1264
+ * @name Highcharts.PointInstrumentObject#onEnd
1265
+ * @type {Function|undefined}
1266
+ */
1267
+
1268
+
1269
+ /**
1270
+ * Options for sonifying a point.
1271
+ * @interface Highcharts.PointSonifyOptionsObject
1272
+ *//**
1273
+ * The instrument definitions for this point.
1274
+ * @name Highcharts.PointSonifyOptionsObject#instruments
1275
+ * @type {Array<Highcharts.PointInstrumentObject>}
1276
+ *//**
1277
+ * Optionally provide the minimum/maximum values for the points. If this is not
1278
+ * supplied, it is calculated from the points in the chart on demand. This
1279
+ * option is supplied in the following format, as a map of point data properties
1280
+ * to objects with min/max values:
1281
+ * ```js
1282
+ * dataExtremes: {
1283
+ * y: {
1284
+ * min: 0,
1285
+ * max: 100
1286
+ * },
1287
+ * z: {
1288
+ * min: -10,
1289
+ * max: 10
1290
+ * }
1291
+ * // Properties used and not provided are calculated on demand
1292
+ * }
1293
+ * ```
1294
+ * @name Highcharts.PointSonifyOptionsObject#dataExtremes
1295
+ * @type {object|undefined}
1296
+ *//**
1297
+ * Callback called when the sonification has finished.
1298
+ * @name Highcharts.PointSonifyOptionsObject#onEnd
1299
+ * @type {Function|undefined}
1300
+ */
1301
+
1302
+
1303
+
1304
+
1305
+ // Defaults for the instrument options
1306
+ // NOTE: Also change defaults in Highcharts.PointInstrumentOptionsObject if
1307
+ // making changes here.
1308
+ var defaultInstrumentOptions = {
1309
+ minDuration: 20,
1310
+ maxDuration: 2000,
1311
+ minVolume: 0.1,
1312
+ maxVolume: 1,
1313
+ minPan: -1,
1314
+ maxPan: 1,
1315
+ minFrequency: 220,
1316
+ maxFrequency: 2200
1317
+ };
1318
+
1319
+
1320
+ /**
1321
+ * Sonify a single point.
1322
+ *
1323
+ * @sample highcharts/sonification/point-basic/
1324
+ * Click on points to sonify
1325
+ * @sample highcharts/sonification/point-advanced/
1326
+ * Sonify bubbles
1327
+ *
1328
+ * @requires module:modules/sonification
1329
+ *
1330
+ * @function Highcharts.Point#sonify
1331
+ *
1332
+ * @param {Highcharts.PointSonifyOptionsObject} options
1333
+ * Options for the sonification of the point.
1334
+ */
1335
+ function pointSonify(options) {
1336
+ var point = this,
1337
+ chart = point.series.chart,
1338
+ dataExtremes = options.dataExtremes || {},
1339
+ // Get the value to pass to instrument.play from the mapping value
1340
+ // passed in.
1341
+ getMappingValue = function (
1342
+ value, makeFunction, allowedExtremes, allowedValues
1343
+ ) {
1344
+ // Fixed number, just use that
1345
+ if (typeof value === 'number' || value === undefined) {
1346
+ return value;
1347
+ }
1348
+ // Function. Return new function if we try to use callback,
1349
+ // otherwise call it now and return result.
1350
+ if (typeof value === 'function') {
1351
+ return makeFunction ?
1352
+ function (time) {
1353
+ return value(point, dataExtremes, time);
1354
+ } :
1355
+ value(point, dataExtremes);
1356
+ }
1357
+ // String, this is a data prop.
1358
+ if (typeof value === 'string') {
1359
+ // Find data extremes if we don't have them
1360
+ dataExtremes[value] = dataExtremes[value] ||
1361
+ utilities.calculateDataExtremes(
1362
+ point.series.chart, value
1363
+ );
1364
+ // Find the value
1365
+ return utilities.virtualAxisTranslate(
1366
+ H.pick(point[value], point.options[value]),
1367
+ dataExtremes[value],
1368
+ allowedExtremes,
1369
+ allowedValues
1370
+ );
1371
+ }
1372
+ };
1373
+
1374
+ // Register playing point on chart
1375
+ chart.sonification.currentlyPlayingPoint = point;
1376
+
1377
+ // Keep track of instruments playing
1378
+ point.sonification = point.sonification || {};
1379
+ point.sonification.instrumentsPlaying =
1380
+ point.sonification.instrumentsPlaying || {};
1381
+
1382
+ // Register signal handler for the point
1383
+ var signalHandler = point.sonification.signalHandler =
1384
+ point.sonification.signalHandler ||
1385
+ new utilities.SignalHandler(['onEnd']);
1386
+
1387
+ signalHandler.clearSignalCallbacks();
1388
+ signalHandler.registerSignalCallbacks({ onEnd: options.onEnd });
1389
+
1390
+ // If we have a null point or invisible point, just return
1391
+ if (point.isNull || !point.visible || !point.series.visible) {
1392
+ signalHandler.emitSignal('onEnd');
1393
+ return;
1394
+ }
1395
+
1396
+ // Go through instruments and play them
1397
+ options.instruments.forEach(function (instrumentDefinition) {
1398
+ var instrument = typeof instrumentDefinition.instrument === 'string' ?
1399
+ H.sonification.instruments[instrumentDefinition.instrument] :
1400
+ instrumentDefinition.instrument,
1401
+ mapping = instrumentDefinition.instrumentMapping || {},
1402
+ extremes = H.merge(
1403
+ defaultInstrumentOptions,
1404
+ instrumentDefinition.instrumentOptions
1405
+ ),
1406
+ id = instrument.id,
1407
+ onEnd = function (cancelled) {
1408
+ // Instrument on end
1409
+ if (instrumentDefinition.onEnd) {
1410
+ instrumentDefinition.onEnd.apply(this, arguments);
1411
+ }
1412
+
1413
+ // Remove currently playing point reference on chart
1414
+ if (
1415
+ chart.sonification &&
1416
+ chart.sonification.currentlyPlayingPoint
1417
+ ) {
1418
+ delete chart.sonification.currentlyPlayingPoint;
1419
+ }
1420
+
1421
+ // Remove reference from instruments playing
1422
+ if (
1423
+ point.sonification && point.sonification.instrumentsPlaying
1424
+ ) {
1425
+ delete point.sonification.instrumentsPlaying[id];
1426
+
1427
+ // This was the last instrument?
1428
+ if (
1429
+ !Object.keys(
1430
+ point.sonification.instrumentsPlaying
1431
+ ).length
1432
+ ) {
1433
+ signalHandler.emitSignal('onEnd', cancelled);
1434
+ }
1435
+ }
1436
+ };
1437
+
1438
+ // Play the note on the instrument
1439
+ if (instrument && instrument.play) {
1440
+ point.sonification.instrumentsPlaying[instrument.id] = instrument;
1441
+ instrument.play({
1442
+ frequency: getMappingValue(
1443
+ mapping.frequency,
1444
+ true,
1445
+ { min: extremes.minFrequency, max: extremes.maxFrequency }
1446
+ ),
1447
+ duration: getMappingValue(
1448
+ mapping.duration,
1449
+ false,
1450
+ { min: extremes.minDuration, max: extremes.maxDuration }
1451
+ ),
1452
+ pan: getMappingValue(
1453
+ mapping.pan,
1454
+ true,
1455
+ { min: extremes.minPan, max: extremes.maxPan }
1456
+ ),
1457
+ volume: getMappingValue(
1458
+ mapping.volume,
1459
+ true,
1460
+ { min: extremes.minVolume, max: extremes.maxVolume }
1461
+ ),
1462
+ onEnd: onEnd,
1463
+ minFrequency: extremes.minFrequency,
1464
+ maxFrequency: extremes.maxFrequency
1465
+ });
1466
+ } else {
1467
+ H.error(30);
1468
+ }
1469
+ });
1470
+ }
1471
+
1472
+
1473
+ /**
1474
+ * Cancel sonification of a point. Calls onEnd functions.
1475
+ *
1476
+ * @requires module:modules/sonification
1477
+ *
1478
+ * @function Highcharts.Point#cancelSonify
1479
+ *
1480
+ * @param {boolean} [fadeOut=false]
1481
+ * Whether or not to fade out as we stop. If false, the points are
1482
+ * cancelled synchronously.
1483
+ */
1484
+ function pointCancelSonify(fadeOut) {
1485
+ var playing = this.sonification && this.sonification.instrumentsPlaying,
1486
+ instrIds = playing && Object.keys(playing);
1487
+
1488
+ if (instrIds && instrIds.length) {
1489
+ instrIds.forEach(function (instr) {
1490
+ playing[instr].stop(!fadeOut, null, 'cancelled');
1491
+ });
1492
+ this.sonification.instrumentsPlaying = {};
1493
+ this.sonification.signalHandler.emitSignal('onEnd', 'cancelled');
1494
+ }
1495
+ }
1496
+
1497
+
1498
+ var pointSonifyFunctions = {
1499
+ pointSonify: pointSonify,
1500
+ pointCancelSonify: pointCancelSonify
1501
+ };
1502
+
1503
+
1504
+ return pointSonifyFunctions;
1505
+ }(Highcharts, utilities));
1506
+ var chartSonifyFunctions = (function (H, utilities) {
1507
+ /* *
1508
+ *
1509
+ * (c) 2009-2019 Øystein Moseng
1510
+ *
1511
+ * Sonification functions for chart/series.
1512
+ *
1513
+ * License: www.highcharts.com/license
1514
+ *
1515
+ * */
1516
+
1517
+
1518
+ /**
1519
+ * An Earcon configuration, specifying an Earcon and when to play it.
1520
+ *
1521
+ * @requires module:modules/sonification
1522
+ *
1523
+ * @interface Highcharts.EarconConfiguration
1524
+ *//**
1525
+ * An Earcon instance.
1526
+ * @name Highcharts.EarconConfiguration#earcon
1527
+ * @type {Highcharts.Earcon}
1528
+ *//**
1529
+ * The ID of the point to play the Earcon on.
1530
+ * @name Highcharts.EarconConfiguration#onPoint
1531
+ * @type {string|undefined}
1532
+ *//**
1533
+ * A function to determine whether or not to play this earcon on a point. The
1534
+ * function is called for every point, receiving that point as parameter. It
1535
+ * should return either a boolean indicating whether or not to play the earcon,
1536
+ * or a new Earcon instance - in which case the new Earcon will be played.
1537
+ * @name Highcharts.EarconConfiguration#condition
1538
+ * @type {Function|undefined}
1539
+ */
1540
+
1541
+ /**
1542
+ * Options for sonifying a series.
1543
+ *
1544
+ * @requires module:modules/sonification
1545
+ *
1546
+ * @interface Highcharts.SonifySeriesOptionsObject
1547
+ *//**
1548
+ * The duration for playing the points. Note that points might continue to play
1549
+ * after the duration has passed, but no new points will start playing.
1550
+ * @name Highcharts.SonifySeriesOptionsObject#duration
1551
+ * @type {number}
1552
+ *//**
1553
+ * The axis to use for when to play the points. Can be a string with a data
1554
+ * property (e.g. `x`), or a function. If it is a function, this function
1555
+ * receives the point as argument, and should return a numeric value. The points
1556
+ * with the lowest numeric values are then played first, and the time between
1557
+ * points will be proportional to the distance between the numeric values.
1558
+ * @name Highcharts.SonifySeriesOptionsObject#pointPlayTime
1559
+ * @type {string|Function}
1560
+ *//**
1561
+ * The instrument definitions for the points in this series.
1562
+ * @name Highcharts.SonifySeriesOptionsObject#instruments
1563
+ * @type {Array<Highcharts.PointInstrumentObject>}
1564
+ *//**
1565
+ * Earcons to add to the series.
1566
+ * @name Highcharts.SonifySeriesOptionsObject#earcons
1567
+ * @type {Array<Highcharts.EarconConfiguration>|undefined}
1568
+ *//**
1569
+ * Optionally provide the minimum/maximum data values for the points. If this is
1570
+ * not supplied, it is calculated from all points in the chart on demand. This
1571
+ * option is supplied in the following format, as a map of point data properties
1572
+ * to objects with min/max values:
1573
+ * ```js
1574
+ * dataExtremes: {
1575
+ * y: {
1576
+ * min: 0,
1577
+ * max: 100
1578
+ * },
1579
+ * z: {
1580
+ * min: -10,
1581
+ * max: 10
1582
+ * }
1583
+ * // Properties used and not provided are calculated on demand
1584
+ * }
1585
+ * ```
1586
+ * @name Highcharts.SonifySeriesOptionsObject#dataExtremes
1587
+ * @type {object|undefined}
1588
+ *//**
1589
+ * Callback before a point is played.
1590
+ * @name Highcharts.SonifySeriesOptionsObject#onPointStart
1591
+ * @type {Function|undefined}
1592
+ *//**
1593
+ * Callback after a point has finished playing.
1594
+ * @name Highcharts.SonifySeriesOptionsObject#onPointEnd
1595
+ * @type {Function|undefined}
1596
+ *//**
1597
+ * Callback after the series has played.
1598
+ * @name Highcharts.SonifySeriesOptionsObject#onEnd
1599
+ * @type {Function|undefined}
1600
+ */
1601
+
1602
+
1603
+
1604
+
1605
+ /**
1606
+ * Get the relative time value of a point.
1607
+ * @private
1608
+ * @param {Highcharts.Point} point - The point.
1609
+ * @param {Function|string} timeProp - The time axis data prop or the time
1610
+ * function.
1611
+ * @return {number} The time value.
1612
+ */
1613
+ function getPointTimeValue(point, timeProp) {
1614
+ return typeof timeProp === 'function' ?
1615
+ timeProp(point) :
1616
+ H.pick(point[timeProp], point.options[timeProp]);
1617
+ }
1618
+
1619
+
1620
+ /**
1621
+ * Get the time extremes of this series. This is handled outside of the
1622
+ * dataExtremes, as we always want to just sonify the visible points, and we
1623
+ * always want the extremes to be the extremes of the visible points.
1624
+ * @private
1625
+ * @param {Highcharts.Series} series - The series to compute on.
1626
+ * @param {Function|string} timeProp - The time axis data prop or the time
1627
+ * function.
1628
+ * @return {object} Object with min/max extremes for the time values.
1629
+ */
1630
+ function getTimeExtremes(series, timeProp) {
1631
+ // Compute the extremes from the visible points.
1632
+ return series.points.reduce(function (acc, point) {
1633
+ var value = getPointTimeValue(point, timeProp);
1634
+
1635
+ acc.min = Math.min(acc.min, value);
1636
+ acc.max = Math.max(acc.max, value);
1637
+ return acc;
1638
+ }, {
1639
+ min: Infinity,
1640
+ max: -Infinity
1641
+ });
1642
+ }
1643
+
1644
+
1645
+ /**
1646
+ * Calculate value extremes for used instrument data properties.
1647
+ * @private
1648
+ * @param {Highcharts.Chart} chart - The chart to calculate extremes from.
1649
+ * @param {Array<Highcharts.PointInstrumentObject>} instruments - The instrument
1650
+ * definitions used.
1651
+ * @param {object} [dataExtremes] - Predefined extremes for each data prop.
1652
+ * @return {object} New extremes with data properties mapped to min/max objects.
1653
+ */
1654
+ function getExtremesForInstrumentProps(chart, instruments, dataExtremes) {
1655
+ return (
1656
+ instruments || []
1657
+ ).reduce(function (newExtremes, instrumentDefinition) {
1658
+ Object.keys(instrumentDefinition.instrumentMapping || {}).forEach(
1659
+ function (instrumentParameter) {
1660
+ var value = instrumentDefinition.instrumentMapping[
1661
+ instrumentParameter
1662
+ ];
1663
+
1664
+ if (typeof value === 'string' && !newExtremes[value]) {
1665
+ // This instrument parameter is mapped to a data prop.
1666
+ // If we don't have predefined data extremes, find them.
1667
+ newExtremes[value] = utilities.calculateDataExtremes(
1668
+ chart, value
1669
+ );
1670
+ }
1671
+ }
1672
+ );
1673
+ return newExtremes;
1674
+ }, H.merge(dataExtremes));
1675
+ }
1676
+
1677
+
1678
+ /**
1679
+ * Get earcons for the point if there are any.
1680
+ * @private
1681
+ * @param {Highcharts.Point} point - The point to find earcons for.
1682
+ * @param {Array<Highcharts.EarconConfiguration>} earconDefinitions - Earcons to
1683
+ * check.
1684
+ * @return {Array<Highcharts.Earcon>} Array of earcons to be played with this
1685
+ * point.
1686
+ */
1687
+ function getPointEarcons(point, earconDefinitions) {
1688
+ return earconDefinitions.reduce(
1689
+ function (earcons, earconDefinition) {
1690
+ var cond,
1691
+ earcon = earconDefinition.earcon;
1692
+
1693
+ if (earconDefinition.condition) {
1694
+ // We have a condition. This overrides onPoint
1695
+ cond = earconDefinition.condition(point);
1696
+ if (cond instanceof H.sonification.Earcon) {
1697
+ // Condition returned an earcon
1698
+ earcons.push(cond);
1699
+ } else if (cond) {
1700
+ // Condition returned true
1701
+ earcons.push(earcon);
1702
+ }
1703
+ } else if (
1704
+ earconDefinition.onPoint &&
1705
+ point.id === earconDefinition.onPoint
1706
+ ) {
1707
+ // We have earcon onPoint
1708
+ earcons.push(earcon);
1709
+ }
1710
+ return earcons;
1711
+ }, []
1712
+ );
1713
+ }
1714
+
1715
+
1716
+ /**
1717
+ * Utility function to get a new list of instrument options where all the
1718
+ * instrument references are copies.
1719
+ * @private
1720
+ * @param {Array<Highcharts.PointInstrumentObject>} instruments - The instrument
1721
+ * options.
1722
+ * @return {Array<Highcharts.PointInstrumentObject>} Array of copied instrument
1723
+ * options.
1724
+ */
1725
+ function makeInstrumentCopies(instruments) {
1726
+ return instruments.map(function (instrumentDef) {
1727
+ var instrument = instrumentDef.instrument,
1728
+ copy = (typeof instrument === 'string' ?
1729
+ H.sonification.instruments[instrument] :
1730
+ instrument).copy();
1731
+
1732
+ return H.merge(instrumentDef, { instrument: copy });
1733
+ });
1734
+ }
1735
+
1736
+
1737
+ /**
1738
+ * Create a TimelinePath from a series. Takes the same options as seriesSonify.
1739
+ * To intuitively allow multiple series to play simultaneously we make copies of
1740
+ * the instruments for each series.
1741
+ * @private
1742
+ * @param {Highcharts.Series} series - The series to build from.
1743
+ * @param {object} options - The options for building the TimelinePath.
1744
+ * @return {Highcharts.TimelinePath} A timeline path with events.
1745
+ */
1746
+ function buildTimelinePathFromSeries(series, options) {
1747
+ // options.timeExtremes is internal and used so that the calculations from
1748
+ // chart.sonify can be reused.
1749
+ var timeExtremes = options.timeExtremes || getTimeExtremes(
1750
+ series, options.pointPlayTime, options.dataExtremes
1751
+ ),
1752
+ // Get time offset for a point, relative to duration
1753
+ pointToTime = function (point) {
1754
+ return utilities.virtualAxisTranslate(
1755
+ getPointTimeValue(point, options.pointPlayTime),
1756
+ timeExtremes,
1757
+ { min: 0, max: options.duration }
1758
+ );
1759
+ },
1760
+ // Compute any data extremes that aren't defined yet
1761
+ dataExtremes = getExtremesForInstrumentProps(
1762
+ series.chart, options.instruments, options.dataExtremes
1763
+ ),
1764
+ // Make copies of the instruments used for this series, to allow
1765
+ // multiple series with the same instrument to play together
1766
+ instruments = makeInstrumentCopies(options.instruments),
1767
+ // Go through the points, convert to events, optionally add Earcons
1768
+ timelineEvents = series.points.reduce(function (events, point) {
1769
+ var earcons = getPointEarcons(point, options.earcons || []),
1770
+ time = pointToTime(point);
1771
+
1772
+ return events.concat(
1773
+ // Event object for point
1774
+ new H.sonification.TimelineEvent({
1775
+ eventObject: point,
1776
+ time: time,
1777
+ id: point.id,
1778
+ playOptions: {
1779
+ instruments: instruments,
1780
+ dataExtremes: dataExtremes
1781
+ }
1782
+ }),
1783
+ // Earcons
1784
+ earcons.map(function (earcon) {
1785
+ return new H.sonification.TimelineEvent({
1786
+ eventObject: earcon,
1787
+ time: time
1788
+ });
1789
+ })
1790
+ );
1791
+ }, []);
1792
+
1793
+ // Build the timeline path
1794
+ return new H.sonification.TimelinePath({
1795
+ events: timelineEvents,
1796
+ onStart: function () {
1797
+ if (options.onStart) {
1798
+ options.onStart(series);
1799
+ }
1800
+ },
1801
+ onEventStart: function (event) {
1802
+ var eventObject = event.options && event.options.eventObject;
1803
+
1804
+ if (eventObject instanceof H.Point) {
1805
+ // Check for hidden series
1806
+ if (
1807
+ !eventObject.series.visible &&
1808
+ !eventObject.series.chart.series.some(function (series) {
1809
+ return series.visible;
1810
+ })
1811
+ ) {
1812
+ // We have no visible series, stop the path.
1813
+ event.timelinePath.timeline.pause();
1814
+ event.timelinePath.timeline.resetCursor();
1815
+ return false;
1816
+ }
1817
+ // Emit onPointStart
1818
+ if (options.onPointStart) {
1819
+ options.onPointStart(event, eventObject);
1820
+ }
1821
+ }
1822
+ },
1823
+ onEventEnd: function (eventData) {
1824
+ var eventObject = eventData.event && eventData.event.options &&
1825
+ eventData.event.options.eventObject;
1826
+
1827
+ if (eventObject instanceof H.Point && options.onPointEnd) {
1828
+ options.onPointEnd(eventData.event, eventObject);
1829
+ }
1830
+ },
1831
+ onEnd: function () {
1832
+ if (options.onEnd) {
1833
+ options.onEnd(series);
1834
+ }
1835
+ }
1836
+ });
1837
+ }
1838
+
1839
+ /**
1840
+ * Sonify a series.
1841
+ *
1842
+ * @sample highcharts/sonification/series-basic/
1843
+ * Click on series to sonify
1844
+ * @sample highcharts/sonification/series-earcon/
1845
+ * Series with earcon
1846
+ * @sample highcharts/sonification/point-play-time/
1847
+ * Play y-axis by time
1848
+ * @sample highcharts/sonification/earcon-on-point/
1849
+ * Earcon set on point
1850
+ *
1851
+ * @requires module:modules/sonification
1852
+ *
1853
+ * @function Highcharts.Series#sonify
1854
+ *
1855
+ * @param {Highcharts.SonifySeriesOptionsObject} options
1856
+ * The options for sonifying this series.
1857
+ */
1858
+ function seriesSonify(options) {
1859
+ var timelinePath = buildTimelinePathFromSeries(this, options),
1860
+ chartSonification = this.chart.sonification;
1861
+
1862
+ // Only one timeline can play at a time. If we want multiple series playing
1863
+ // at the same time, use chart.sonify.
1864
+ if (chartSonification.timeline) {
1865
+ chartSonification.timeline.pause();
1866
+ }
1867
+
1868
+ // Create new timeline for this series, and play it.
1869
+ chartSonification.timeline = new H.sonification.Timeline({
1870
+ paths: [timelinePath]
1871
+ });
1872
+
1873
+ chartSonification.timeline.play();
1874
+ }
1875
+
1876
+
1877
+ /**
1878
+ * Utility function to assemble options for creating a TimelinePath from a
1879
+ * series when sonifying an entire chart.
1880
+ * @private
1881
+ * @param {Highcharts.Series} series - The series to return options for.
1882
+ * @param {object} dataExtremes - Pre-calculated data extremes for the chart.
1883
+ * @param {object} chartSonifyOptions - Options passed in to chart.sonify.
1884
+ * @return {object} Options for buildTimelinePathFromSeries.
1885
+ */
1886
+ function buildSeriesOptions(series, dataExtremes, chartSonifyOptions) {
1887
+ var seriesOptions = chartSonifyOptions.seriesOptions || {};
1888
+
1889
+ return H.merge(
1890
+ {
1891
+ // Calculated dataExtremes for chart
1892
+ dataExtremes: dataExtremes,
1893
+ // We need to get timeExtremes for each series. We pass this
1894
+ // in when building the TimelinePath objects to avoid
1895
+ // calculating twice.
1896
+ timeExtremes: getTimeExtremes(
1897
+ series, chartSonifyOptions.pointPlayTime
1898
+ ),
1899
+ // Some options we just pass on
1900
+ instruments: chartSonifyOptions.instruments,
1901
+ onStart: chartSonifyOptions.onSeriesStart,
1902
+ onEnd: chartSonifyOptions.onSeriesEnd,
1903
+ earcons: chartSonifyOptions.earcons
1904
+ },
1905
+ // Merge in the specific series options by ID
1906
+ H.isArray(seriesOptions) ? (
1907
+ H.find(seriesOptions, function (optEntry) {
1908
+ return optEntry.id === H.pick(series.id, series.options.id);
1909
+ }) || {}
1910
+ ) : seriesOptions,
1911
+ {
1912
+ // Forced options
1913
+ pointPlayTime: chartSonifyOptions.pointPlayTime
1914
+ }
1915
+ );
1916
+ }
1917
+
1918
+
1919
+ /**
1920
+ * Utility function to normalize the ordering of timeline paths when sonifying
1921
+ * a chart.
1922
+ * @private
1923
+ * @param {string|Array<string|Highcharts.Earcon|Array<string|Highcharts.Earcon>>} orderOptions -
1924
+ * Order options for the sonification.
1925
+ * @param {Highcharts.Chart} chart - The chart we are sonifying.
1926
+ * @param {Function} seriesOptionsCallback - A function that takes a series as
1927
+ * argument, and returns the series options for that series to be used with
1928
+ * buildTimelinePathFromSeries.
1929
+ * @return {Array<object|Array<object|Highcharts.TimelinePath>>} If order is
1930
+ * sequential, we return an array of objects to create series paths from. If
1931
+ * order is simultaneous we return an array of an array with the same. If there
1932
+ * is a custom order, we return an array of arrays of either objects (for
1933
+ * series) or TimelinePaths (for earcons and delays).
1934
+ */
1935
+ function buildPathOrder(orderOptions, chart, seriesOptionsCallback) {
1936
+ var order;
1937
+
1938
+ if (orderOptions === 'sequential' || orderOptions === 'simultaneous') {
1939
+ // Just add the series from the chart
1940
+ order = chart.series.reduce(function (seriesList, series) {
1941
+ if (series.visible) {
1942
+ seriesList.push({
1943
+ series: series,
1944
+ seriesOptions: seriesOptionsCallback(series)
1945
+ });
1946
+ }
1947
+ return seriesList;
1948
+ }, []);
1949
+
1950
+ // If order is simultaneous, group all series together
1951
+ if (orderOptions === 'simultaneous') {
1952
+ order = [order];
1953
+ }
1954
+ } else {
1955
+ // We have a specific order, and potentially custom items - like
1956
+ // earcons or silent waits.
1957
+ order = orderOptions.reduce(function (orderList, orderDef) {
1958
+ // Return set of items to play simultaneously. Could be only one.
1959
+ var simulItems = H.splat(orderDef).reduce(function (items, item) {
1960
+ var itemObject;
1961
+
1962
+ // Is this item a series ID?
1963
+ if (typeof item === 'string') {
1964
+ var series = chart.get(item);
1965
+
1966
+ if (series.visible) {
1967
+ itemObject = {
1968
+ series: series,
1969
+ seriesOptions: seriesOptionsCallback(series)
1970
+ };
1971
+ }
1972
+
1973
+ // Is it an earcon? If so, just create the path.
1974
+ } else if (item instanceof H.sonification.Earcon) {
1975
+ // Path with a single event
1976
+ itemObject = new H.sonification.TimelinePath({
1977
+ events: [new H.sonification.TimelineEvent({
1978
+ eventObject: item
1979
+ })]
1980
+ });
1981
+
1982
+ }
1983
+
1984
+ // Is this item a silent wait? If so, just create the path.
1985
+ if (item.silentWait) {
1986
+ itemObject = new H.sonification.TimelinePath({
1987
+ silentWait: item.silentWait
1988
+ });
1989
+ }
1990
+
1991
+ // Add to items to play simultaneously
1992
+ if (itemObject) {
1993
+ items.push(itemObject);
1994
+ }
1995
+ return items;
1996
+ }, []);
1997
+
1998
+ // Add to order list
1999
+ if (simulItems.length) {
2000
+ orderList.push(simulItems);
2001
+ }
2002
+ return orderList;
2003
+ }, []);
2004
+ }
2005
+ return order;
2006
+ }
2007
+
2008
+
2009
+ /**
2010
+ * Utility function to add a silent wait after all series.
2011
+ * @private
2012
+ * @param {Array<object|Array<object|TimelinePath>>} order - The order of items.
2013
+ * @param {number} wait - The wait in milliseconds to add.
2014
+ * @return {Array<object|Array<object|TimelinePath>>} The order with waits inserted.
2015
+ */
2016
+ function addAfterSeriesWaits(order, wait) {
2017
+ if (!wait) {
2018
+ return order;
2019
+ }
2020
+
2021
+ return order.reduce(function (newOrder, orderDef, i) {
2022
+ var simultaneousPaths = H.splat(orderDef);
2023
+
2024
+ newOrder.push(simultaneousPaths);
2025
+
2026
+ // Go through the simultaneous paths and see if there is a series there
2027
+ if (
2028
+ i < order.length - 1 && // Do not add wait after last series
2029
+ simultaneousPaths.some(function (item) {
2030
+ return item.series;
2031
+ })
2032
+ ) {
2033
+ // We have a series, meaning we should add a wait after these
2034
+ // paths have finished.
2035
+ newOrder.push(new H.sonification.TimelinePath({
2036
+ silentWait: wait
2037
+ }));
2038
+ }
2039
+
2040
+ return newOrder;
2041
+ }, []);
2042
+ }
2043
+
2044
+
2045
+ /**
2046
+ * Utility function to find the total amout of wait time in the TimelinePaths.
2047
+ * @private
2048
+ * @param {Array<object|Array<object|TimelinePath>>} order - The order of
2049
+ * TimelinePaths/items.
2050
+ * @return {number} The total time in ms spent on wait paths between playing.
2051
+ */
2052
+ function getWaitTime(order) {
2053
+ return order.reduce(function (waitTime, orderDef) {
2054
+ var def = H.splat(orderDef);
2055
+
2056
+ return waitTime + (
2057
+ def.length === 1 && def[0].options && def[0].options.silentWait || 0
2058
+ );
2059
+ }, 0);
2060
+ }
2061
+
2062
+
2063
+ /**
2064
+ * Utility function to ensure simultaneous paths have start/end events at the
2065
+ * same time, to sync them.
2066
+ * @private
2067
+ * @param {Array<Highcharts.TimelinePath>} paths - The paths to sync.
2068
+ */
2069
+ function syncSimultaneousPaths(paths) {
2070
+ // Find the extremes for these paths
2071
+ var extremes = paths.reduce(function (extremes, path) {
2072
+ var events = path.events;
2073
+
2074
+ if (events && events.length) {
2075
+ extremes.min = Math.min(events[0].time, extremes.min);
2076
+ extremes.max = Math.max(
2077
+ events[events.length - 1].time, extremes.max
2078
+ );
2079
+ }
2080
+ return extremes;
2081
+ }, {
2082
+ min: Infinity,
2083
+ max: -Infinity
2084
+ });
2085
+
2086
+ // Go through the paths and add events to make them fit the same timespan
2087
+ paths.forEach(function (path) {
2088
+ var events = path.events,
2089
+ hasEvents = events && events.length,
2090
+ eventsToAdd = [];
2091
+
2092
+ if (!(hasEvents && events[0].time <= extremes.min)) {
2093
+ eventsToAdd.push(new H.sonification.TimelineEvent({
2094
+ time: extremes.min
2095
+ }));
2096
+ }
2097
+ if (!(hasEvents && events[events.length - 1].time >= extremes.max)) {
2098
+ eventsToAdd.push(new H.sonification.TimelineEvent({
2099
+ time: extremes.max
2100
+ }));
2101
+ }
2102
+ if (eventsToAdd.length) {
2103
+ path.addTimelineEvents(eventsToAdd);
2104
+ }
2105
+ });
2106
+ }
2107
+
2108
+
2109
+ /**
2110
+ * Utility function to find the total duration span for all simul path sets
2111
+ * that include series.
2112
+ * @private
2113
+ * @param {Array<object|Array<object|Highcharts.TimelinePath>>} order - The
2114
+ * order of TimelinePaths/items.
2115
+ * @return {number} The total time value span difference for all series.
2116
+ */
2117
+ function getSimulPathDurationTotal(order) {
2118
+ return order.reduce(function (durationTotal, orderDef) {
2119
+ return durationTotal + H.splat(orderDef).reduce(
2120
+ function (maxPathDuration, item) {
2121
+ var timeExtremes = item.series && item.seriesOptions &&
2122
+ item.seriesOptions.timeExtremes;
2123
+
2124
+ return timeExtremes ?
2125
+ Math.max(
2126
+ maxPathDuration, timeExtremes.max - timeExtremes.min
2127
+ ) : maxPathDuration;
2128
+ },
2129
+ 0
2130
+ );
2131
+ }, 0);
2132
+ }
2133
+
2134
+
2135
+ /**
2136
+ * Function to calculate the duration in ms for a series.
2137
+ * @private
2138
+ * @param {number} seriesValueDuration - The duration of the series in value
2139
+ * difference.
2140
+ * @param {number} totalValueDuration - The total duration of all (non
2141
+ * simultaneous) series in value difference.
2142
+ * @param {number} totalDurationMs - The desired total duration for all series
2143
+ * in milliseconds.
2144
+ * @return {number} The duration for the series in milliseconds.
2145
+ */
2146
+ function getSeriesDurationMs(
2147
+ seriesValueDuration, totalValueDuration, totalDurationMs
2148
+ ) {
2149
+ // A series spanning the whole chart would get the full duration.
2150
+ return utilities.virtualAxisTranslate(
2151
+ seriesValueDuration,
2152
+ { min: 0, max: totalValueDuration },
2153
+ { min: 0, max: totalDurationMs }
2154
+ );
2155
+ }
2156
+
2157
+
2158
+ /**
2159
+ * Convert series building objects into paths and return a new list of
2160
+ * TimelinePaths.
2161
+ * @private
2162
+ * @param {Array<object|Array<object|Highcharts.TimelinePath>>} order - The
2163
+ * order list.
2164
+ * @param {number} duration - Total duration to aim for in milliseconds.
2165
+ * @return {Array<Array<Highcharts.TimelinePath>>} Array of TimelinePath objects
2166
+ * to play.
2167
+ */
2168
+ function buildPathsFromOrder(order, duration) {
2169
+ // Find time used for waits (custom or after series), and subtract it from
2170
+ // available duration.
2171
+ var totalAvailableDurationMs = Math.max(
2172
+ duration - getWaitTime(order), 0
2173
+ ),
2174
+ // Add up simultaneous path durations to find total value span duration
2175
+ // of everything
2176
+ totalUsedDuration = getSimulPathDurationTotal(order);
2177
+
2178
+ // Go through the order list and convert the items
2179
+ return order.reduce(function (allPaths, orderDef) {
2180
+ var simultaneousPaths = H.splat(orderDef).reduce(
2181
+ function (simulPaths, item) {
2182
+ if (item instanceof H.sonification.TimelinePath) {
2183
+ // This item is already a path object
2184
+ simulPaths.push(item);
2185
+ } else if (item.series) {
2186
+ // We have a series.
2187
+ // We need to set the duration of the series
2188
+ item.seriesOptions.duration =
2189
+ item.seriesOptions.duration || getSeriesDurationMs(
2190
+ item.seriesOptions.timeExtremes.max -
2191
+ item.seriesOptions.timeExtremes.min,
2192
+ totalUsedDuration,
2193
+ totalAvailableDurationMs
2194
+ );
2195
+
2196
+ // Add the path
2197
+ simulPaths.push(buildTimelinePathFromSeries(
2198
+ item.series,
2199
+ item.seriesOptions
2200
+ ));
2201
+ }
2202
+ return simulPaths;
2203
+ }, []
2204
+ );
2205
+
2206
+ // Add in the simultaneous paths
2207
+ allPaths.push(simultaneousPaths);
2208
+ return allPaths;
2209
+ }, []);
2210
+ }
2211
+
2212
+
2213
+ /**
2214
+ * Options for sonifying a chart.
2215
+ *
2216
+ * @requires module:modules/sonification
2217
+ *
2218
+ * @interface Highcharts.SonifyChartOptionsObject
2219
+ *//**
2220
+ * Duration for sonifying the entire chart. The duration is distributed across
2221
+ * the different series intelligently, but does not take earcons into account.
2222
+ * It is also possible to set the duration explicitly per series, using
2223
+ * `seriesOptions`. Note that points may continue to play after the duration has
2224
+ * passed, but no new points will start playing.
2225
+ * @name Highcharts.SonifyChartOptionsObject#duration
2226
+ * @type {number}
2227
+ *//**
2228
+ * Define the order to play the series in. This can be given as a string, or an
2229
+ * array specifying a custom ordering. If given as a string, valid values are
2230
+ * `sequential` - where each series is played in order - or `simultaneous`,
2231
+ * where all series are played at once. For custom ordering, supply an array as
2232
+ * the order. Each element in the array can be either a string with a series ID,
2233
+ * an Earcon object, or an object with a numeric `silentWait` property
2234
+ * designating a number of milliseconds to wait before continuing. Each element
2235
+ * of the array will be played in order. To play elements simultaneously, group
2236
+ * the elements in an array.
2237
+ * @name Highcharts.SonifyChartOptionsObject#order
2238
+ * @type {string|Array<string|Highcharts.Earcon|Array<string|Highcharts.Earcon>>}
2239
+ *//**
2240
+ * The axis to use for when to play the points. Can be a string with a data
2241
+ * property (e.g. `x`), or a function. If it is a function, this function
2242
+ * receives the point as argument, and should return a numeric value. The points
2243
+ * with the lowest numeric values are then played first, and the time between
2244
+ * points will be proportional to the distance between the numeric values. This
2245
+ * option can not be overridden per series.
2246
+ * @name Highcharts.SonifyChartOptionsObject#pointPlayTime
2247
+ * @type {string|Function}
2248
+ *//**
2249
+ * Milliseconds of silent waiting to add between series. Note that waiting time
2250
+ * is considered part of the sonify duration.
2251
+ * @name Highcharts.SonifyChartOptionsObject#afterSeriesWait
2252
+ * @type {number|undefined}
2253
+ *//**
2254
+ * Options as given to `series.sonify` to override options per series. If the
2255
+ * option is supplied as an array of options objects, the `id` property of the
2256
+ * object should correspond to the series' id. If the option is supplied as a
2257
+ * single object, the options apply to all series.
2258
+ * @name Highcharts.SonifyChartOptionsObject#seriesOptions
2259
+ * @type {Object|Array<object>|undefined}
2260
+ *//**
2261
+ * The instrument definitions for the points in this chart.
2262
+ * @name Highcharts.SonifyChartOptionsObject#instruments
2263
+ * @type {Array<Highcharts.PointInstrumentObject>|undefined}
2264
+ *//**
2265
+ * Earcons to add to the chart. Note that earcons can also be added per series
2266
+ * using `seriesOptions`.
2267
+ * @name Highcharts.SonifyChartOptionsObject#earcons
2268
+ * @type {Array<Highcharts.EarconConfiguration>|undefined}
2269
+ *//**
2270
+ * Optionally provide the minimum/maximum data values for the points. If this is
2271
+ * not supplied, it is calculated from all points in the chart on demand. This
2272
+ * option is supplied in the following format, as a map of point data properties
2273
+ * to objects with min/max values:
2274
+ * ```js
2275
+ * dataExtremes: {
2276
+ * y: {
2277
+ * min: 0,
2278
+ * max: 100
2279
+ * },
2280
+ * z: {
2281
+ * min: -10,
2282
+ * max: 10
2283
+ * }
2284
+ * // Properties used and not provided are calculated on demand
2285
+ * }
2286
+ * ```
2287
+ * @name Highcharts.SonifyChartOptionsObject#dataExtremes
2288
+ * @type {object|undefined}
2289
+ *//**
2290
+ * Callback before a series is played.
2291
+ * @name Highcharts.SonifyChartOptionsObject#onSeriesStart
2292
+ * @type {Function|undefined}
2293
+ *//**
2294
+ * Callback after a series has finished playing.
2295
+ * @name Highcharts.SonifyChartOptionsObject#onSeriesEnd
2296
+ * @type {Function|undefined}
2297
+ *//**
2298
+ * Callback after the chart has played.
2299
+ * @name Highcharts.SonifyChartOptionsObject#onEnd
2300
+ * @type {Function|undefined}
2301
+ */
2302
+
2303
+
2304
+ /**
2305
+ * Sonify a chart.
2306
+ *
2307
+ * @sample highcharts/sonification/chart-sequential/
2308
+ * Sonify a basic chart
2309
+ * @sample highcharts/sonification/chart-simultaneous/
2310
+ * Sonify series simultaneously
2311
+ * @sample highcharts/sonification/chart-custom-order/
2312
+ * Custom defined order of series
2313
+ * @sample highcharts/sonification/chart-earcon/
2314
+ * Earcons on chart
2315
+ * @sample highcharts/sonification/chart-events/
2316
+ * Sonification events on chart
2317
+ *
2318
+ * @requires module:modules/sonification
2319
+ *
2320
+ * @function Highcharts.Chart#sonify
2321
+ *
2322
+ * @param {Highcharts.SonifyChartOptionsObject} options
2323
+ * The options for sonifying this chart.
2324
+ */
2325
+ function chartSonify(options) {
2326
+ // Only one timeline can play at a time.
2327
+ if (this.sonification.timeline) {
2328
+ this.sonification.timeline.pause();
2329
+ }
2330
+
2331
+ // Calculate data extremes for the props used
2332
+ var dataExtremes = getExtremesForInstrumentProps(
2333
+ this, options.instruments, options.dataExtremes
2334
+ );
2335
+
2336
+ // Figure out ordering of series and custom paths
2337
+ var order = buildPathOrder(options.order, this, function (series) {
2338
+ return buildSeriesOptions(series, dataExtremes, options);
2339
+ });
2340
+
2341
+ // Add waits after simultaneous paths with series in them.
2342
+ order = addAfterSeriesWaits(order, options.afterSeriesWait || 0);
2343
+
2344
+ // We now have a list of either TimelinePath objects or series that need to
2345
+ // be converted to TimelinePath objects. Convert everything to paths.
2346
+ var paths = buildPathsFromOrder(order, options.duration);
2347
+
2348
+ // Sync simultaneous paths
2349
+ paths.forEach(function (simultaneousPaths) {
2350
+ syncSimultaneousPaths(simultaneousPaths);
2351
+ });
2352
+
2353
+ // We have a set of paths. Create the timeline, and play it.
2354
+ this.sonification.timeline = new H.sonification.Timeline({
2355
+ paths: paths,
2356
+ onEnd: options.onEnd
2357
+ });
2358
+ this.sonification.timeline.play();
2359
+ }
2360
+
2361
+
2362
+ /**
2363
+ * Get a list of the points currently under cursor.
2364
+ *
2365
+ * @requires module:modules/sonification
2366
+ *
2367
+ * @function Highcharts.Chart#getCurrentSonifyPoints
2368
+ *
2369
+ * @return {Array<Highcharts.Point>}
2370
+ * The points currently under the cursor.
2371
+ */
2372
+ function getCurrentPoints() {
2373
+ var cursorObj;
2374
+
2375
+ if (this.sonification.timeline) {
2376
+ cursorObj = this.sonification.timeline.getCursor(); // Cursor per pathID
2377
+ return Object.keys(cursorObj).map(function (path) {
2378
+ // Get the event objects under cursor for each path
2379
+ return cursorObj[path].eventObject;
2380
+ }).filter(function (eventObj) {
2381
+ // Return the events that are points
2382
+ return eventObj instanceof H.Point;
2383
+ });
2384
+ }
2385
+ return [];
2386
+ }
2387
+
2388
+
2389
+ /**
2390
+ * Set the cursor to a point or set of points in different series.
2391
+ *
2392
+ * @requires module:modules/sonification
2393
+ *
2394
+ * @function Highcharts.Chart#setSonifyCursor
2395
+ *
2396
+ * @param {Highcharts.Point|Array<Highcharts.Point>} points
2397
+ * The point or points to set the cursor to. If setting multiple points
2398
+ * under the cursor, the points have to be in different series that are
2399
+ * being played simultaneously.
2400
+ */
2401
+ function setCursor(points) {
2402
+ var timeline = this.sonification.timeline;
2403
+
2404
+ if (timeline) {
2405
+ H.splat(points).forEach(function (point) {
2406
+ // We created the events with the ID of the points, which makes
2407
+ // this easy. Just call setCursor for each ID.
2408
+ timeline.setCursor(point.id);
2409
+ });
2410
+ }
2411
+ }
2412
+
2413
+
2414
+ /**
2415
+ * Pause the running sonification.
2416
+ *
2417
+ * @requires module:modules/sonification
2418
+ *
2419
+ * @function Highcharts.Chart#pauseSonify
2420
+ *
2421
+ * @param {boolean} [fadeOut=true]
2422
+ * Fade out as we pause to avoid clicks.
2423
+ */
2424
+ function pause(fadeOut) {
2425
+ if (this.sonification.timeline) {
2426
+ this.sonification.timeline.pause(H.pick(fadeOut, true));
2427
+ } else if (this.sonification.currentlyPlayingPoint) {
2428
+ this.sonification.currentlyPlayingPoint.cancelSonify(fadeOut);
2429
+ }
2430
+ }
2431
+
2432
+
2433
+ /**
2434
+ * Resume the currently running sonification. Requires series.sonify or
2435
+ * chart.sonify to have been played at some point earlier.
2436
+ *
2437
+ * @requires module:modules/sonification
2438
+ *
2439
+ * @function Highcharts.Chart#resumeSonify
2440
+ *
2441
+ * @param {Function} onEnd
2442
+ * Callback to call when play finished.
2443
+ */
2444
+ function resume(onEnd) {
2445
+ if (this.sonification.timeline) {
2446
+ this.sonification.timeline.play(onEnd);
2447
+ }
2448
+ }
2449
+
2450
+
2451
+ /**
2452
+ * Play backwards from cursor. Requires series.sonify or chart.sonify to have
2453
+ * been played at some point earlier.
2454
+ *
2455
+ * @requires module:modules/sonification
2456
+ *
2457
+ * @function Highcharts.Chart#rewindSonify
2458
+ *
2459
+ * @param {Function} onEnd
2460
+ * Callback to call when play finished.
2461
+ */
2462
+ function rewind(onEnd) {
2463
+ if (this.sonification.timeline) {
2464
+ this.sonification.timeline.rewind(onEnd);
2465
+ }
2466
+ }
2467
+
2468
+
2469
+ /**
2470
+ * Cancel current sonification and reset cursor.
2471
+ *
2472
+ * @requires module:modules/sonification
2473
+ *
2474
+ * @function Highcharts.Chart#cancelSonify
2475
+ *
2476
+ * @param {boolean} [fadeOut=true]
2477
+ * Fade out as we pause to avoid clicks.
2478
+ */
2479
+ function cancel(fadeOut) {
2480
+ this.pauseSonify(fadeOut);
2481
+ this.resetSonifyCursor();
2482
+ }
2483
+
2484
+
2485
+ /**
2486
+ * Reset cursor to start. Requires series.sonify or chart.sonify to have been
2487
+ * played at some point earlier.
2488
+ *
2489
+ * @requires module:modules/sonification
2490
+ *
2491
+ * @function Highcharts.Chart#resetSonifyCursor
2492
+ */
2493
+ function resetCursor() {
2494
+ if (this.sonification.timeline) {
2495
+ this.sonification.timeline.resetCursor();
2496
+ }
2497
+ }
2498
+
2499
+
2500
+ /**
2501
+ * Reset cursor to end. Requires series.sonify or chart.sonify to have been
2502
+ * played at some point earlier.
2503
+ *
2504
+ * @requires module:modules/sonification
2505
+ *
2506
+ * @function Highcharts.Chart#resetSonifyCursorEnd
2507
+ */
2508
+ function resetCursorEnd() {
2509
+ if (this.sonification.timeline) {
2510
+ this.sonification.timeline.resetCursorEnd();
2511
+ }
2512
+ }
2513
+
2514
+
2515
+ // Export functions
2516
+ var chartSonifyFunctions = {
2517
+ chartSonify: chartSonify,
2518
+ seriesSonify: seriesSonify,
2519
+ pause: pause,
2520
+ resume: resume,
2521
+ rewind: rewind,
2522
+ cancel: cancel,
2523
+ getCurrentPoints: getCurrentPoints,
2524
+ setCursor: setCursor,
2525
+ resetCursor: resetCursor,
2526
+ resetCursorEnd: resetCursorEnd
2527
+ };
2528
+
2529
+
2530
+ return chartSonifyFunctions;
2531
+ }(Highcharts, utilities));
2532
+ var timelineClasses = (function (H, utilities) {
2533
+ /* *
2534
+ *
2535
+ * (c) 2009-2019 Øystein Moseng
2536
+ *
2537
+ * TimelineEvent class definition.
2538
+ *
2539
+ * License: www.highcharts.com/license
2540
+ *
2541
+ * */
2542
+
2543
+ /**
2544
+ * A set of options for the TimelineEvent class.
2545
+ *
2546
+ * @requires module:modules/sonification
2547
+ *
2548
+ * @private
2549
+ * @interface Highcharts.TimelineEventOptionsObject
2550
+ *//**
2551
+ * The object we want to sonify when playing the TimelineEvent. Can be any
2552
+ * object that implements the `sonify` and `cancelSonify` functions. If this is
2553
+ * not supplied, the TimelineEvent is considered a silent event, and the onEnd
2554
+ * event is immediately called.
2555
+ * @name Highcharts.TimelineEventOptionsObject#eventObject
2556
+ * @type {*}
2557
+ *//**
2558
+ * Options to pass on to the eventObject when playing it.
2559
+ * @name Highcharts.TimelineEventOptionsObject#playOptions
2560
+ * @type {object|undefined}
2561
+ *//**
2562
+ * The time at which we want this event to play (in milliseconds offset). This
2563
+ * is not used for the TimelineEvent.play function, but rather intended as a
2564
+ * property to decide when to call TimelineEvent.play. Defaults to 0.
2565
+ * @name Highcharts.TimelineEventOptionsObject#time
2566
+ * @type {number|undefined}
2567
+ *//**
2568
+ * Unique ID for the event. Generated automatically if not supplied.
2569
+ * @name Highcharts.TimelineEventOptionsObject#id
2570
+ * @type {string|undefined}
2571
+ *//**
2572
+ * Callback called when the play has finished.
2573
+ * @name Highcharts.TimelineEventOptionsObject#onEnd
2574
+ * @type {Function|undefined}
2575
+ */
2576
+
2577
+
2578
+
2579
+
2580
+
2581
+ /**
2582
+ * The TimelineEvent class. Represents a sound event on a timeline.
2583
+ *
2584
+ * @requires module:modules/sonification
2585
+ *
2586
+ * @private
2587
+ * @class
2588
+ * @name Highcharts.TimelineEvent
2589
+ *
2590
+ * @param {Highcharts.TimelineEventOptionsObject} options
2591
+ * Options for the TimelineEvent.
2592
+ */
2593
+ function TimelineEvent(options) {
2594
+ this.init(options || {});
2595
+ }
2596
+ TimelineEvent.prototype.init = function (options) {
2597
+ this.options = options;
2598
+ this.time = options.time || 0;
2599
+ this.id = this.options.id = options.id || H.uniqueKey();
2600
+ };
2601
+
2602
+
2603
+ /**
2604
+ * Play the event. Does not take the TimelineEvent.time option into account,
2605
+ * and plays the event immediately.
2606
+ *
2607
+ * @function Highcharts.TimelineEvent#play
2608
+ *
2609
+ * @param {Highcharts.TimelineEventOptionsObject} [options]
2610
+ * Options to pass in to the eventObject when playing it.
2611
+ */
2612
+ TimelineEvent.prototype.play = function (options) {
2613
+ var eventObject = this.options.eventObject,
2614
+ masterOnEnd = this.options.onEnd,
2615
+ playOnEnd = options && options.onEnd,
2616
+ playOptionsOnEnd = this.options.playOptions &&
2617
+ this.options.playOptions.onEnd,
2618
+ playOptions = H.merge(this.options.playOptions, options);
2619
+
2620
+ if (eventObject && eventObject.sonify) {
2621
+ // If we have multiple onEnds defined, use all
2622
+ playOptions.onEnd = masterOnEnd || playOnEnd || playOptionsOnEnd ?
2623
+ function () {
2624
+ var args = arguments;
2625
+
2626
+ [masterOnEnd, playOnEnd, playOptionsOnEnd].forEach(
2627
+ function (onEnd) {
2628
+ if (onEnd) {
2629
+ onEnd.apply(this, args);
2630
+ }
2631
+ }
2632
+ );
2633
+ } : undefined;
2634
+
2635
+ eventObject.sonify(playOptions);
2636
+ } else {
2637
+ if (playOnEnd) {
2638
+ playOnEnd();
2639
+ }
2640
+ if (masterOnEnd) {
2641
+ masterOnEnd();
2642
+ }
2643
+ }
2644
+ };
2645
+
2646
+
2647
+ /**
2648
+ * Cancel the sonification of this event. Does nothing if the event is not
2649
+ * currently sonifying.
2650
+ *
2651
+ * @function Highcharts.TimelineEvent#cancel
2652
+ *
2653
+ * @param {boolean} [fadeOut=false]
2654
+ * Whether or not to fade out as we stop. If false, the event is
2655
+ * cancelled synchronously.
2656
+ */
2657
+ TimelineEvent.prototype.cancel = function (fadeOut) {
2658
+ this.options.eventObject.cancelSonify(fadeOut);
2659
+ };
2660
+
2661
+
2662
+ /**
2663
+ * A set of options for the TimelinePath class.
2664
+ *
2665
+ * @requires module:modules/
2666
+ *
2667
+ * @private
2668
+ * @interface Highcharts.TimelinePathOptionsObject
2669
+ *//**
2670
+ * List of TimelineEvents to play on this track.
2671
+ * @name Highcharts.TimelinePathOptionsObject#events
2672
+ * @type {Array<Highcharts.TimelineEvent>}
2673
+ *//**
2674
+ * If this option is supplied, this path ignores all events and just waits for
2675
+ * the specified number of milliseconds before calling onEnd.
2676
+ * @name Highcharts.TimelinePathOptionsObject#silentWait
2677
+ * @type {number|undefined}
2678
+ *//**
2679
+ * Unique ID for this timeline path. Automatically generated if not supplied.
2680
+ * @name Highcharts.TimelinePathOptionsObject#id
2681
+ * @type {string|undefined}
2682
+ *//**
2683
+ * Callback called before the path starts playing.
2684
+ * @name Highcharts.TimelinePathOptionsObject#onStart
2685
+ * @type {Function|undefined}
2686
+ *//**
2687
+ * Callback function to call before an event plays.
2688
+ * @name Highcharts.TimelinePathOptionsObject#onEventStart
2689
+ * @type {Function|undefined}
2690
+ *//**
2691
+ * Callback function to call after an event has stopped playing.
2692
+ * @name Highcharts.TimelinePathOptionsObject#onEventEnd
2693
+ * @type {Function|undefined}
2694
+ *//**
2695
+ * Callback called when the whole path is finished.
2696
+ * @name Highcharts.TimelinePathOptionsObject#onEnd
2697
+ * @type {Function|undefined}
2698
+ */
2699
+
2700
+
2701
+ /**
2702
+ * The TimelinePath class. Represents a track on a timeline with a list of
2703
+ * sound events to play at certain times relative to each other.
2704
+ *
2705
+ * @requires module:modules/sonification
2706
+ *
2707
+ * @private
2708
+ * @class
2709
+ * @name Highcharts.TimelinePath
2710
+ *
2711
+ * @param {Highcharts.TimelinePathOptionsObject} options
2712
+ * Options for the TimelinePath.
2713
+ */
2714
+ function TimelinePath(options) {
2715
+ this.init(options);
2716
+ }
2717
+ TimelinePath.prototype.init = function (options) {
2718
+ this.options = options;
2719
+ this.id = this.options.id = options.id || H.uniqueKey();
2720
+ this.cursor = 0;
2721
+ this.eventsPlaying = {};
2722
+
2723
+ // Handle silent wait, otherwise use events from options
2724
+ this.events = options.silentWait ?
2725
+ [
2726
+ new TimelineEvent({ time: 0 }),
2727
+ new TimelineEvent({ time: options.silentWait })
2728
+ ] :
2729
+ this.options.events;
2730
+
2731
+ // We need to sort our events by time
2732
+ this.sortEvents();
2733
+
2734
+ // Get map from event ID to index
2735
+ this.updateEventIdMap();
2736
+
2737
+ // Signal events to fire
2738
+ this.signalHandler = new utilities.SignalHandler(
2739
+ ['playOnEnd', 'masterOnEnd', 'onStart', 'onEventStart', 'onEventEnd']
2740
+ );
2741
+ this.signalHandler.registerSignalCallbacks(
2742
+ H.merge(options, { masterOnEnd: options.onEnd })
2743
+ );
2744
+ };
2745
+
2746
+
2747
+ /**
2748
+ * Sort the internal event list by time.
2749
+ * @private
2750
+ */
2751
+ TimelinePath.prototype.sortEvents = function () {
2752
+ this.events = this.events.sort(function (a, b) {
2753
+ return a.time - b.time;
2754
+ });
2755
+ };
2756
+
2757
+
2758
+ /**
2759
+ * Update the internal eventId to index map.
2760
+ * @private
2761
+ */
2762
+ TimelinePath.prototype.updateEventIdMap = function () {
2763
+ this.eventIdMap = this.events.reduce(function (acc, cur, i) {
2764
+ acc[cur.id] = i;
2765
+ return acc;
2766
+ }, {});
2767
+ };
2768
+
2769
+
2770
+ /**
2771
+ * Add events to the path. Should not be done while the path is playing.
2772
+ * The new events are inserted according to their time property.
2773
+ * @private
2774
+ * @param {Array<Highcharts.TimelineEvent>} newEvents - The new timeline events
2775
+ * to add.
2776
+ */
2777
+ TimelinePath.prototype.addTimelineEvents = function (newEvents) {
2778
+ this.events = this.events.concat(newEvents);
2779
+ this.sortEvents(); // Sort events by time
2780
+ this.updateEventIdMap(); // Update the event ID to index map
2781
+ };
2782
+
2783
+
2784
+ /**
2785
+ * Get the current TimelineEvent under the cursor.
2786
+ * @private
2787
+ * @return {Highcharts.TimelineEvent} The current timeline event.
2788
+ */
2789
+ TimelinePath.prototype.getCursor = function () {
2790
+ return this.events[this.cursor];
2791
+ };
2792
+
2793
+
2794
+ /**
2795
+ * Set the current TimelineEvent under the cursor.
2796
+ * @private
2797
+ * @param {string} eventId - The ID of the timeline event to set as current.
2798
+ * @return {boolean} True if there is an event with this ID in the path. False
2799
+ * otherwise.
2800
+ */
2801
+ TimelinePath.prototype.setCursor = function (eventId) {
2802
+ var ix = this.eventIdMap[eventId];
2803
+
2804
+ if (ix !== undefined) {
2805
+ this.cursor = ix;
2806
+ return true;
2807
+ }
2808
+ return false;
2809
+ };
2810
+
2811
+
2812
+ /**
2813
+ * Play the timeline from the current cursor.
2814
+ * @private
2815
+ * @param {Function} onEnd - Callback to call when play finished. Does not
2816
+ * override other onEnd callbacks.
2817
+ */
2818
+ TimelinePath.prototype.play = function (onEnd) {
2819
+ this.pause();
2820
+ this.signalHandler.emitSignal('onStart');
2821
+ this.signalHandler.clearSignalCallbacks(['playOnEnd']);
2822
+ this.signalHandler.registerSignalCallbacks({ playOnEnd: onEnd });
2823
+ this.playEvents(1);
2824
+ };
2825
+
2826
+
2827
+ /**
2828
+ * Play the timeline backwards from the current cursor.
2829
+ * @private
2830
+ * @param {Function} onEnd - Callback to call when play finished. Does not
2831
+ * override other onEnd callbacks.
2832
+ */
2833
+ TimelinePath.prototype.rewind = function (onEnd) {
2834
+ this.pause();
2835
+ this.signalHandler.emitSignal('onStart');
2836
+ this.signalHandler.clearSignalCallbacks(['playOnEnd']);
2837
+ this.signalHandler.registerSignalCallbacks({ playOnEnd: onEnd });
2838
+ this.playEvents(-1);
2839
+ };
2840
+
2841
+
2842
+ /**
2843
+ * Reset the cursor to the beginning.
2844
+ * @private
2845
+ */
2846
+ TimelinePath.prototype.resetCursor = function () {
2847
+ this.cursor = 0;
2848
+ };
2849
+
2850
+
2851
+ /**
2852
+ * Reset the cursor to the end.
2853
+ * @private
2854
+ */
2855
+ TimelinePath.prototype.resetCursorEnd = function () {
2856
+ this.cursor = this.events.length - 1;
2857
+ };
2858
+
2859
+
2860
+ /**
2861
+ * Cancel current playing. Leaves the cursor intact.
2862
+ * @private
2863
+ * @param {boolean} [fadeOut=false] - Whether or not to fade out as we stop. If
2864
+ * false, the path is cancelled synchronously.
2865
+ */
2866
+ TimelinePath.prototype.pause = function (fadeOut) {
2867
+ var timelinePath = this;
2868
+
2869
+ // Cancel next scheduled play
2870
+ clearTimeout(timelinePath.nextScheduledPlay);
2871
+
2872
+ // Cancel currently playing events
2873
+ Object.keys(timelinePath.eventsPlaying).forEach(function (id) {
2874
+ if (timelinePath.eventsPlaying[id]) {
2875
+ timelinePath.eventsPlaying[id].cancel(fadeOut);
2876
+ }
2877
+ });
2878
+ timelinePath.eventsPlaying = {};
2879
+ };
2880
+
2881
+
2882
+ /**
2883
+ * Play the events, starting from current cursor, and going in specified
2884
+ * direction.
2885
+ * @private
2886
+ * @param {number} direction - The direction to play, 1 for forwards and -1 for
2887
+ * backwards.
2888
+ */
2889
+ TimelinePath.prototype.playEvents = function (direction) {
2890
+ var timelinePath = this,
2891
+ curEvent = timelinePath.events[this.cursor],
2892
+ nextEvent = timelinePath.events[this.cursor + direction],
2893
+ timeDiff,
2894
+ onEnd = function (signalData) {
2895
+ timelinePath.signalHandler.emitSignal(
2896
+ 'masterOnEnd', signalData
2897
+ );
2898
+ timelinePath.signalHandler.emitSignal(
2899
+ 'playOnEnd', signalData
2900
+ );
2901
+ };
2902
+
2903
+ // Store reference to path on event
2904
+ curEvent.timelinePath = timelinePath;
2905
+
2906
+ // Emit event, cancel if returns false
2907
+ if (
2908
+ timelinePath.signalHandler.emitSignal(
2909
+ 'onEventStart', curEvent
2910
+ ) === false
2911
+ ) {
2912
+ onEnd({
2913
+ event: curEvent,
2914
+ cancelled: true
2915
+ });
2916
+ return;
2917
+ }
2918
+
2919
+ // Play the current event
2920
+ timelinePath.eventsPlaying[curEvent.id] = curEvent;
2921
+ curEvent.play({
2922
+ onEnd: function (cancelled) {
2923
+ var signalData = {
2924
+ event: curEvent,
2925
+ cancelled: !!cancelled
2926
+ };
2927
+
2928
+ // Keep track of currently playing events for cancelling
2929
+ delete timelinePath.eventsPlaying[curEvent.id];
2930
+
2931
+ // Handle onEventEnd
2932
+ timelinePath.signalHandler.emitSignal('onEventEnd', signalData);
2933
+
2934
+ // Reached end of path?
2935
+ if (!nextEvent) {
2936
+ onEnd(signalData);
2937
+ }
2938
+ }
2939
+ });
2940
+
2941
+ // Schedule next
2942
+ if (nextEvent) {
2943
+ timeDiff = Math.abs(nextEvent.time - curEvent.time);
2944
+ if (timeDiff < 1) {
2945
+ // Play immediately
2946
+ timelinePath.cursor += direction;
2947
+ timelinePath.playEvents(direction);
2948
+ } else {
2949
+ // Schedule after the difference in ms
2950
+ this.nextScheduledPlay = setTimeout(function () {
2951
+ timelinePath.cursor += direction;
2952
+ timelinePath.playEvents(direction);
2953
+ }, timeDiff);
2954
+ }
2955
+ }
2956
+ };
2957
+
2958
+
2959
+ /* ************************************************************************** *
2960
+ * TIMELINE *
2961
+ * ************************************************************************** */
2962
+
2963
+
2964
+ /**
2965
+ * A set of options for the Timeline class.
2966
+ *
2967
+ * @requires module:modules/sonification
2968
+ *
2969
+ * @private
2970
+ * @interface Highcharts.TimelineOptionsObject
2971
+ *//**
2972
+ * List of TimelinePaths to play. Multiple paths can be grouped together and
2973
+ * played simultaneously by supplying an array of paths in place of a single
2974
+ * path.
2975
+ * @name Highcharts.TimelineOptionsObject#paths
2976
+ * @type {Array<Highcharts.TimelinePath|Array<Highcharts.TimelinePath>>}
2977
+ *//**
2978
+ * Callback function to call before a path plays.
2979
+ * @name Highcharts.TimelineOptionsObject#onPathStart
2980
+ * @type {Function|undefined}
2981
+ *//**
2982
+ * Callback function to call after a path has stopped playing.
2983
+ * @name Highcharts.TimelineOptionsObject#onPathEnd
2984
+ * @type {Function|undefined}
2985
+ *//**
2986
+ * Callback called when the whole path is finished.
2987
+ * @name Highcharts.TimelineOptionsObject#onEnd
2988
+ * @type {Function|undefined}
2989
+ */
2990
+
2991
+
2992
+ /**
2993
+ * The Timeline class. Represents a sonification timeline with a list of
2994
+ * timeline paths with events to play at certain times relative to each other.
2995
+ *
2996
+ * @requires module:modules/sonification
2997
+ *
2998
+ * @private
2999
+ * @class
3000
+ * @name Highcharts.Timeline
3001
+ *
3002
+ * @param {Highcharts.TimelineOptionsObject} options
3003
+ * Options for the Timeline.
3004
+ */
3005
+ function Timeline(options) {
3006
+ this.init(options || {});
3007
+ }
3008
+ Timeline.prototype.init = function (options) {
3009
+ this.options = options;
3010
+ this.cursor = 0;
3011
+ this.paths = options.paths;
3012
+ this.pathsPlaying = {};
3013
+ this.signalHandler = new utilities.SignalHandler(
3014
+ ['playOnEnd', 'masterOnEnd', 'onPathStart', 'onPathEnd']
3015
+ );
3016
+ this.signalHandler.registerSignalCallbacks(
3017
+ H.merge(options, { masterOnEnd: options.onEnd })
3018
+ );
3019
+ };
3020
+
3021
+
3022
+ /**
3023
+ * Play the timeline forwards from cursor.
3024
+ * @private
3025
+ * @param {Function} onEnd - Callback to call when play finished. Does not
3026
+ * override other onEnd callbacks.
3027
+ */
3028
+ Timeline.prototype.play = function (onEnd) {
3029
+ this.pause();
3030
+ this.signalHandler.clearSignalCallbacks(['playOnEnd']);
3031
+ this.signalHandler.registerSignalCallbacks({ playOnEnd: onEnd });
3032
+ this.playPaths(1);
3033
+ };
3034
+
3035
+
3036
+ /**
3037
+ * Play the timeline backwards from cursor.
3038
+ * @private
3039
+ * @param {Function} onEnd - Callback to call when play finished. Does not
3040
+ * override other onEnd callbacks.
3041
+ */
3042
+ Timeline.prototype.rewind = function (onEnd) {
3043
+ this.pause();
3044
+ this.signalHandler.clearSignalCallbacks(['playOnEnd']);
3045
+ this.signalHandler.registerSignalCallbacks({ playOnEnd: onEnd });
3046
+ this.playPaths(-1);
3047
+ };
3048
+
3049
+
3050
+ /**
3051
+ * Play the timeline in the specified direction.
3052
+ * @private
3053
+ * @param {number} direction - Direction to play in. 1 for forwards, -1 for
3054
+ * backwards.
3055
+ */
3056
+ Timeline.prototype.playPaths = function (direction) {
3057
+ var curPaths = H.splat(this.paths[this.cursor]),
3058
+ nextPaths = this.paths[this.cursor + direction],
3059
+ timeline = this,
3060
+ signalHandler = this.signalHandler,
3061
+ pathsEnded = 0,
3062
+ // Play a path
3063
+ playPath = function (path) {
3064
+ // Emit signal and set playing state
3065
+ signalHandler.emitSignal('onPathStart', path);
3066
+ timeline.pathsPlaying[path.id] = path;
3067
+ // Do the play
3068
+ path[direction > 0 ? 'play' : 'rewind'](function (callbackData) {
3069
+ // Play ended callback
3070
+ // Data to pass to signal callbacks
3071
+ var cancelled = callbackData && callbackData.cancelled,
3072
+ signalData = {
3073
+ path: path,
3074
+ cancelled: cancelled
3075
+ };
3076
+
3077
+ // Clear state and send signal
3078
+ delete timeline.pathsPlaying[path.id];
3079
+ signalHandler.emitSignal('onPathEnd', signalData);
3080
+
3081
+ // Handle next paths
3082
+ pathsEnded++;
3083
+ if (pathsEnded >= curPaths.length) {
3084
+ // We finished all of the current paths for cursor.
3085
+ if (nextPaths && !cancelled) {
3086
+ // We have more paths, move cursor along
3087
+ timeline.cursor += direction;
3088
+ // Reset upcoming path cursors before playing
3089
+ H.splat(nextPaths).forEach(function (nextPath) {
3090
+ nextPath[
3091
+ direction > 0 ? 'resetCursor' : 'resetCursorEnd'
3092
+ ]();
3093
+ });
3094
+ // Play next
3095
+ timeline.playPaths(direction);
3096
+ } else {
3097
+ // If it is the last path in this direction, call onEnd
3098
+ signalHandler.emitSignal('playOnEnd', signalData);
3099
+ signalHandler.emitSignal('masterOnEnd', signalData);
3100
+ }
3101
+ }
3102
+ });
3103
+ };
3104
+
3105
+ // Go through the paths under cursor and play them
3106
+ curPaths.forEach(function (path) {
3107
+ if (path) {
3108
+ // Store reference to timeline
3109
+ path.timeline = timeline;
3110
+
3111
+ // Leave a timeout to let notes fade out before next play
3112
+ setTimeout(function () {
3113
+ playPath(path);
3114
+ }, H.sonification.fadeOutTime);
3115
+ }
3116
+ });
3117
+ };
3118
+
3119
+
3120
+ /**
3121
+ * Stop the playing of the timeline. Cancels all current sounds, but does not
3122
+ * affect the cursor.
3123
+ * @private
3124
+ * @param {boolean} [fadeOut=false] - Whether or not to fade out as we stop. If
3125
+ * false, the timeline is cancelled synchronously.
3126
+ */
3127
+ Timeline.prototype.pause = function (fadeOut) {
3128
+ var timeline = this;
3129
+
3130
+ // Cancel currently playing events
3131
+ Object.keys(timeline.pathsPlaying).forEach(function (id) {
3132
+ if (timeline.pathsPlaying[id]) {
3133
+ timeline.pathsPlaying[id].pause(fadeOut);
3134
+ }
3135
+ });
3136
+ timeline.pathsPlaying = {};
3137
+ };
3138
+
3139
+
3140
+ /**
3141
+ * Reset the cursor to the beginning of the timeline.
3142
+ * @private
3143
+ */
3144
+ Timeline.prototype.resetCursor = function () {
3145
+ this.paths.forEach(function (paths) {
3146
+ H.splat(paths).forEach(function (path) {
3147
+ path.resetCursor();
3148
+ });
3149
+ });
3150
+ this.cursor = 0;
3151
+ };
3152
+
3153
+
3154
+ /**
3155
+ * Reset the cursor to the end of the timeline.
3156
+ * @private
3157
+ */
3158
+ Timeline.prototype.resetCursorEnd = function () {
3159
+ this.paths.forEach(function (paths) {
3160
+ H.splat(paths).forEach(function (path) {
3161
+ path.resetCursorEnd();
3162
+ });
3163
+ });
3164
+ this.cursor = this.paths.length - 1;
3165
+ };
3166
+
3167
+
3168
+ /**
3169
+ * Set the current TimelineEvent under the cursor. If multiple paths are being
3170
+ * played at the same time, this function only affects a single path (the one
3171
+ * that contains the eventId that is passed in).
3172
+ * @private
3173
+ * @param {string} eventId - The ID of the timeline event to set as current.
3174
+ * @return {boolean} True if the cursor was set, false if no TimelineEvent was
3175
+ * found for this ID.
3176
+ */
3177
+ Timeline.prototype.setCursor = function (eventId) {
3178
+ return this.paths.some(function (paths) {
3179
+ return H.splat(paths).some(function (path) {
3180
+ return path.setCursor(eventId);
3181
+ });
3182
+ });
3183
+ };
3184
+
3185
+
3186
+ /**
3187
+ * Get the current TimelineEvents under the cursors. This function will return
3188
+ * the event under the cursor for each currently playing path, as an object
3189
+ * where the path ID is mapped to the TimelineEvent under that path's cursor.
3190
+ * @private
3191
+ * @return {object} The TimelineEvents under each path's cursors.
3192
+ */
3193
+ Timeline.prototype.getCursor = function () {
3194
+ return this.getCurrentPlayingPaths().reduce(function (acc, cur) {
3195
+ acc[cur.id] = cur.getCursor();
3196
+ return acc;
3197
+ }, {});
3198
+ };
3199
+
3200
+
3201
+ /**
3202
+ * Check if timeline is reset or at start.
3203
+ * @private
3204
+ * @return {boolean} True if timeline is at the beginning.
3205
+ */
3206
+ Timeline.prototype.atStart = function () {
3207
+ return !this.getCurrentPlayingPaths().some(function (path) {
3208
+ return path.cursor;
3209
+ });
3210
+ };
3211
+
3212
+
3213
+ /**
3214
+ * Get the current TimelinePaths being played.
3215
+ * @private
3216
+ * @return {Array<Highcharts.TimelinePath>} The TimelinePaths currently being
3217
+ * played.
3218
+ */
3219
+ Timeline.prototype.getCurrentPlayingPaths = function () {
3220
+ return H.splat(this.paths[this.cursor]);
3221
+ };
3222
+
3223
+
3224
+ // Export the classes
3225
+ var timelineClasses = {
3226
+ TimelineEvent: TimelineEvent,
3227
+ TimelinePath: TimelinePath,
3228
+ Timeline: Timeline
3229
+ };
3230
+
3231
+
3232
+ return timelineClasses;
3233
+ }(Highcharts, utilities));
3234
+ (function (H, Instrument, instruments, Earcon, pointSonifyFunctions, chartSonifyFunctions, utilities, TimelineClasses) {
3235
+ /* *
3236
+ *
3237
+ * (c) 2009-2019 Øystein Moseng
3238
+ *
3239
+ * Sonification module for Highcharts
3240
+ *
3241
+ * License: www.highcharts.com/license
3242
+ *
3243
+ * */
3244
+
3245
+
3246
+
3247
+ // Expose on the Highcharts object
3248
+
3249
+ /**
3250
+ * Global classes and objects related to sonification.
3251
+ *
3252
+ * @requires module:modules/sonification
3253
+ *
3254
+ * @name Highcharts.sonification
3255
+ * @type {Highcharts.SonificationObject}
3256
+ */
3257
+
3258
+ /**
3259
+ * Global classes and objects related to sonification.
3260
+ *
3261
+ * @requires module:modules/sonification
3262
+ *
3263
+ * @interface Highcharts.SonificationObject
3264
+ *//**
3265
+ * Note fade-out-time in milliseconds. Most notes are faded out quickly by
3266
+ * default if there is time. This is to avoid abrupt stops which will cause
3267
+ * perceived clicks.
3268
+ * @name Highcharts.SonificationObject#fadeOutDuration
3269
+ * @type {number}
3270
+ *//**
3271
+ * Utility functions.
3272
+ * @name Highcharts.SonificationObject#utilities
3273
+ * @private
3274
+ * @type {object}
3275
+ *//**
3276
+ * The Instrument class.
3277
+ * @name Highcharts.SonificationObject#Instrument
3278
+ * @type {Function}
3279
+ *//**
3280
+ * Predefined instruments, given as an object with a map between the instrument
3281
+ * name and the Highcharts.Instrument object.
3282
+ * @name Highcharts.SonificationObject#instruments
3283
+ * @type {Object}
3284
+ *//**
3285
+ * The Earcon class.
3286
+ * @name Highcharts.SonificationObject#Earcon
3287
+ * @type {Function}
3288
+ *//**
3289
+ * The TimelineEvent class.
3290
+ * @private
3291
+ * @name Highcharts.SonificationObject#TimelineEvent
3292
+ * @type {Function}
3293
+ *//**
3294
+ * The TimelinePath class.
3295
+ * @private
3296
+ * @name Highcharts.SonificationObject#TimelinePath
3297
+ * @type {Function}
3298
+ *//**
3299
+ * The Timeline class.
3300
+ * @private
3301
+ * @name Highcharts.SonificationObject#Timeline
3302
+ * @type {Function}
3303
+ */
3304
+ H.sonification = {
3305
+ fadeOutDuration: 20,
3306
+
3307
+ // Classes and functions
3308
+ utilities: utilities,
3309
+ Instrument: Instrument,
3310
+ instruments: instruments,
3311
+ Earcon: Earcon,
3312
+ TimelineEvent: TimelineClasses.TimelineEvent,
3313
+ TimelinePath: TimelineClasses.TimelinePath,
3314
+ Timeline: TimelineClasses.Timeline
3315
+ };
3316
+
3317
+ // Chart specific
3318
+ H.Point.prototype.sonify = pointSonifyFunctions.pointSonify;
3319
+ H.Point.prototype.cancelSonify = pointSonifyFunctions.pointCancelSonify;
3320
+ H.Series.prototype.sonify = chartSonifyFunctions.seriesSonify;
3321
+ H.extend(H.Chart.prototype, {
3322
+ sonify: chartSonifyFunctions.chartSonify,
3323
+ pauseSonify: chartSonifyFunctions.pause,
3324
+ resumeSonify: chartSonifyFunctions.resume,
3325
+ rewindSonify: chartSonifyFunctions.rewind,
3326
+ cancelSonify: chartSonifyFunctions.cancel,
3327
+ getCurrentSonifyPoints: chartSonifyFunctions.getCurrentPoints,
3328
+ setSonifyCursor: chartSonifyFunctions.setCursor,
3329
+ resetSonifyCursor: chartSonifyFunctions.resetCursor,
3330
+ resetSonifyCursorEnd: chartSonifyFunctions.resetCursorEnd,
3331
+ sonification: {}
3332
+ });
3333
+
3334
+ }(Highcharts, Instrument, instruments, Earcon, pointSonifyFunctions, chartSonifyFunctions, utilities, timelineClasses));
3335
+ return (function () {
3336
+
3337
+
3338
+
3339
+
3340
+ }());
3341
+ }));