aw-highstock_rails 7.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.travis.yml +7 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +22 -0
- data/LICENSE.txt +21 -0
- data/README.md +53 -0
- data/Rakefile +10 -0
- data/aw-highstock_rails.gemspec +28 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/aw/highstock_rails.rb +9 -0
- data/lib/aw/highstock_rails/version.rb +5 -0
- data/vendor/assets/javascripts/highstock/css/annotations/popup.css +229 -0
- data/vendor/assets/javascripts/highstock/css/annotations/popup.scss +235 -0
- data/vendor/assets/javascripts/highstock/css/highcharts.css +890 -0
- data/vendor/assets/javascripts/highstock/css/highcharts.scss +788 -0
- data/vendor/assets/javascripts/highstock/css/stocktools/gui.css +268 -0
- data/vendor/assets/javascripts/highstock/css/stocktools/gui.scss +270 -0
- data/vendor/assets/javascripts/highstock/css/themes/dark-unica.css +951 -0
- data/vendor/assets/javascripts/highstock/css/themes/dark-unica.scss +122 -0
- data/vendor/assets/javascripts/highstock/css/themes/grid-light.css +904 -0
- data/vendor/assets/javascripts/highstock/css/themes/grid-light.scss +33 -0
- data/vendor/assets/javascripts/highstock/css/themes/sand-signika.css +920 -0
- data/vendor/assets/javascripts/highstock/css/themes/sand-signika.scss +74 -0
- data/vendor/assets/javascripts/highstock/es-modules/annotations/ControlPoint.js +130 -0
- data/vendor/assets/javascripts/highstock/es-modules/annotations/MockPoint.js +415 -0
- data/vendor/assets/javascripts/highstock/es-modules/annotations/annotations.src.js +1231 -0
- data/vendor/assets/javascripts/highstock/es-modules/annotations/controllable/ControllableCircle.js +92 -0
- data/vendor/assets/javascripts/highstock/es-modules/annotations/controllable/ControllableImage.js +101 -0
- data/vendor/assets/javascripts/highstock/es-modules/annotations/controllable/ControllableLabel.js +452 -0
- data/vendor/assets/javascripts/highstock/es-modules/annotations/controllable/ControllablePath.js +175 -0
- data/vendor/assets/javascripts/highstock/es-modules/annotations/controllable/ControllableRect.js +93 -0
- data/vendor/assets/javascripts/highstock/es-modules/annotations/controllable/controllableMixin.js +411 -0
- data/vendor/assets/javascripts/highstock/es-modules/annotations/controllable/markerMixin.js +214 -0
- data/vendor/assets/javascripts/highstock/es-modules/annotations/eventEmitterMixin.js +271 -0
- data/vendor/assets/javascripts/highstock/es-modules/annotations/navigationBindings.js +1283 -0
- data/vendor/assets/javascripts/highstock/es-modules/annotations/popup.js +1069 -0
- data/vendor/assets/javascripts/highstock/es-modules/annotations/types/CrookedLine.js +191 -0
- data/vendor/assets/javascripts/highstock/es-modules/annotations/types/ElliottWave.js +76 -0
- data/vendor/assets/javascripts/highstock/es-modules/annotations/types/Fibonacci.js +247 -0
- data/vendor/assets/javascripts/highstock/es-modules/annotations/types/InfinityLine.js +185 -0
- data/vendor/assets/javascripts/highstock/es-modules/annotations/types/Measure.js +928 -0
- data/vendor/assets/javascripts/highstock/es-modules/annotations/types/Pitchfork.js +203 -0
- data/vendor/assets/javascripts/highstock/es-modules/annotations/types/Tunnel.js +242 -0
- data/vendor/assets/javascripts/highstock/es-modules/annotations/types/VerticalLine.js +157 -0
- data/vendor/assets/javascripts/highstock/es-modules/error-messages.js +128 -0
- data/vendor/assets/javascripts/highstock/es-modules/error.js +1 -0
- data/vendor/assets/javascripts/highstock/es-modules/indicators/acceleration-bands.src.js +199 -0
- data/vendor/assets/javascripts/highstock/es-modules/indicators/accumulation-distribution.src.js +129 -0
- data/vendor/assets/javascripts/highstock/es-modules/indicators/ao.src.js +206 -0
- data/vendor/assets/javascripts/highstock/es-modules/indicators/apo.src.js +148 -0
- data/vendor/assets/javascripts/highstock/es-modules/indicators/aroon-oscillator.src.js +128 -0
- data/vendor/assets/javascripts/highstock/es-modules/indicators/aroon.src.js +173 -0
- data/vendor/assets/javascripts/highstock/es-modules/indicators/atr.src.js +151 -0
- data/vendor/assets/javascripts/highstock/es-modules/indicators/bollinger-bands.src.js +209 -0
- data/vendor/assets/javascripts/highstock/es-modules/indicators/cci.src.js +131 -0
- data/vendor/assets/javascripts/highstock/es-modules/indicators/chaikin.src.js +167 -0
- data/vendor/assets/javascripts/highstock/es-modules/indicators/cmf.src.js +246 -0
- data/vendor/assets/javascripts/highstock/es-modules/indicators/dema.src.js +191 -0
- data/vendor/assets/javascripts/highstock/es-modules/indicators/dpo.src.js +138 -0
- data/vendor/assets/javascripts/highstock/es-modules/indicators/ema.src.js +166 -0
- data/vendor/assets/javascripts/highstock/es-modules/indicators/ichimoku-kinko-hyo.src.js +850 -0
- data/vendor/assets/javascripts/highstock/es-modules/indicators/indicators.src.js +425 -0
- data/vendor/assets/javascripts/highstock/es-modules/indicators/keltner-channels.src.js +193 -0
- data/vendor/assets/javascripts/highstock/es-modules/indicators/macd.src.js +417 -0
- data/vendor/assets/javascripts/highstock/es-modules/indicators/mfi.src.js +198 -0
- data/vendor/assets/javascripts/highstock/es-modules/indicators/momentum.src.js +119 -0
- data/vendor/assets/javascripts/highstock/es-modules/indicators/natr.src.js +74 -0
- data/vendor/assets/javascripts/highstock/es-modules/indicators/pivot-points.src.js +360 -0
- data/vendor/assets/javascripts/highstock/es-modules/indicators/ppo.src.js +152 -0
- data/vendor/assets/javascripts/highstock/es-modules/indicators/price-channel.src.js +149 -0
- data/vendor/assets/javascripts/highstock/es-modules/indicators/price-envelopes.src.js +251 -0
- data/vendor/assets/javascripts/highstock/es-modules/indicators/psar.src.js +307 -0
- data/vendor/assets/javascripts/highstock/es-modules/indicators/regressions.src.js +427 -0
- data/vendor/assets/javascripts/highstock/es-modules/indicators/roc.src.js +149 -0
- data/vendor/assets/javascripts/highstock/es-modules/indicators/rsi.src.js +163 -0
- data/vendor/assets/javascripts/highstock/es-modules/indicators/stochastic.src.js +193 -0
- data/vendor/assets/javascripts/highstock/es-modules/indicators/supertrend.src.js +544 -0
- data/vendor/assets/javascripts/highstock/es-modules/indicators/tema.src.js +247 -0
- data/vendor/assets/javascripts/highstock/es-modules/indicators/trix.src.js +96 -0
- data/vendor/assets/javascripts/highstock/es-modules/indicators/volume-by-price.src.js +671 -0
- data/vendor/assets/javascripts/highstock/es-modules/indicators/vwap.src.js +189 -0
- data/vendor/assets/javascripts/highstock/es-modules/indicators/williams-r.src.js +128 -0
- data/vendor/assets/javascripts/highstock/es-modules/indicators/wma.src.js +146 -0
- data/vendor/assets/javascripts/highstock/es-modules/indicators/zigzag.src.js +221 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/highcharts-3d.src.js +17 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/highcharts-more.src.js +22 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/highstock.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/acceleration-bands.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/accumulation-distribution.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/ao.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/apo.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/aroon-oscillator.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/aroon.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/atr.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/bollinger-bands.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/cci.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/chaikin.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/cmf.src.js +10 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/dema.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/dpo.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/ema.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/ichimoku-kinko-hyo.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/indicators-all.src.js +49 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/indicators.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/keltner-channels.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/macd.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/mfi.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/momentum.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/natr.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/pivot-points.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/ppo.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/price-channel.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/price-envelopes.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/psar.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/regressions.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/roc.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/rsi.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/stochastic.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/supertrend.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/tema.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/trix.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/volume-by-price.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/vwap.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/williams-r.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/wma.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/indicators/zigzag.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/accessibility.src.js +13 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/annotations-advanced.src.js +20 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/annotations.src.js +12 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/arrow-symbols.src.js +10 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/boost-canvas.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/boost.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/bullet.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/current-date-indicator.src.js +10 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/cylinder.src.js +10 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/data.src.js +10 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/datagrouping.src.js +12 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/debugger.src.js +13 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/dependency-wheel.src.js +10 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/drag-panes.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/draggable-points.src.js +9 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/drilldown.src.js +10 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/export-data.src.js +10 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/exporting.src.js +10 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/full-screen.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/funnel.src.js +10 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/grid-axis.src.js +10 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/heatmap.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/histogram-bellcurve.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/item-series.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/networkgraph.src.js +10 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/no-data-to-display.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/offline-exporting.src.js +10 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/oldie-polyfills.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/oldie.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/overlapping-datalabels.src.js +9 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/parallel-coordinates.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/pareto.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/pathfinder.src.js +10 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/pattern-fill.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/price-indicator.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/sankey.src.js +10 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/series-label.src.js +9 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/solid-gauge.src.js +10 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/sonification.src.js +12 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/static-scale.src.js +10 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/stock-tools.src.js +12 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/stock.src.js +19 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/streamgraph.src.js +10 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/sunburst.src.js +10 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/tilemap.src.js +10 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/timeline.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/treegrid.src.js +10 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/treemap.src.js +10 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/variable-pie.src.js +11 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/variwide.src.js +10 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/vector.src.js +10 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/venn.src.js +10 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/windbarb.src.js +10 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/wordcloud.src.js +10 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/modules/xrange.src.js +10 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/themes/avocado.js +9 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/themes/avocado.src.js +9 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/themes/dark-blue.src.js +9 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/themes/dark-green.src.js +9 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/themes/dark-unica.src.js +9 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/themes/gray.src.js +9 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/themes/grid-light.src.js +9 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/themes/grid.src.js +9 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/themes/sand-signika.src.js +9 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/themes/skies.src.js +9 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/themes/sunset.js +9 -0
- data/vendor/assets/javascripts/highstock/es-modules/masters/themes/sunset.src.js +9 -0
- data/vendor/assets/javascripts/highstock/es-modules/mixins/ajax.js +123 -0
- data/vendor/assets/javascripts/highstock/es-modules/mixins/centered-series.js +116 -0
- data/vendor/assets/javascripts/highstock/es-modules/mixins/derived-series.js +150 -0
- data/vendor/assets/javascripts/highstock/es-modules/mixins/download-url.js +103 -0
- data/vendor/assets/javascripts/highstock/es-modules/mixins/draw-point.js +51 -0
- data/vendor/assets/javascripts/highstock/es-modules/mixins/geometry-circles.js +300 -0
- data/vendor/assets/javascripts/highstock/es-modules/mixins/geometry.js +50 -0
- data/vendor/assets/javascripts/highstock/es-modules/mixins/indicator-required.js +49 -0
- data/vendor/assets/javascripts/highstock/es-modules/mixins/multipe-lines.js +223 -0
- data/vendor/assets/javascripts/highstock/es-modules/mixins/navigation.js +59 -0
- data/vendor/assets/javascripts/highstock/es-modules/mixins/nodes.js +76 -0
- data/vendor/assets/javascripts/highstock/es-modules/mixins/on-series.js +167 -0
- data/vendor/assets/javascripts/highstock/es-modules/mixins/polygon.js +293 -0
- data/vendor/assets/javascripts/highstock/es-modules/mixins/reduce-array.js +53 -0
- data/vendor/assets/javascripts/highstock/es-modules/mixins/tree-series.js +256 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/a11y-i18n.src.js +524 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/annotations-legacy.src.js +1951 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/bellcurve.src.js +173 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/boost-canvas.src.js +732 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/boost.src.js +3730 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/bullet.src.js +361 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/cylinder.src.js +389 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/data.src.js +2417 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/debugger.src.js +109 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/dependency-wheel.src.js +199 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/drag-panes.src.js +624 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/draggable-points.src.js +2625 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/drilldown.src.js +1300 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/export-data.src.js +983 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/exporting.src.js +2149 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/full-screen.src.js +40 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/funnel.src.js +552 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/histogram.src.js +229 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/item-series.src.js +150 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/keyboard-navigation.src.js +1606 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/networkgraph/QuadTree.js +175 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/networkgraph/layouts.js +506 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/networkgraph/networkgraph.src.js +740 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/no-data-to-display.src.js +260 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/offline-exporting.src.js +710 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/oldie-polyfills.src.js +121 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/oldie.src.js +1556 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/overlapping-datalabels.src.js +250 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/parallel-coordinates.src.js +492 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/pareto.src.js +152 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/pattern-fill.src.js +607 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/price-indicator.src.js +149 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/sankey.src.js +809 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/screen-reader.src.js +954 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/series-label.src.js +1042 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/solid-gauge.src.js +486 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/sonification/Earcon.js +184 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/sonification/Instrument.js +582 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/sonification/Timeline.js +702 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/sonification/chartSonify.js +1026 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/sonification/instrumentDefinitions.js +37 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/sonification/musicalFrequencies.js +113 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/sonification/pointSonify.js +385 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/sonification/sonification.js +107 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/sonification/utilities.js +178 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/static-scale.src.js +88 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/stock-tools-bindings.js +1950 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/stock-tools-gui.js +1458 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/streamgraph.src.js +132 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/sunburst.src.js +1041 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/tilemap.src.js +769 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/timeline.src.js +750 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/treemap.src.js +1803 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/variable-pie.src.js +459 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/variwide.src.js +350 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/vector.src.js +354 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/venn.src.js +1192 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/windbarb.src.js +380 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/wordcloud.src.js +1103 -0
- data/vendor/assets/javascripts/highstock/es-modules/modules/xrange.src.js +761 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-3d/Axis.js +669 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-3d/Chart.js +1753 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-3d/Column.js +437 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-3d/Math.js +206 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-3d/Pie.js +207 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-3d/SVGRenderer.js +1002 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-3d/Scatter.js +154 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-3d/Series.js +73 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-3d/VMLRenderer.js +62 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-gantt/ArrowSymbols.js +198 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-gantt/CurrentDateIndicator.js +100 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-gantt/GanttChart.js +140 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-gantt/GanttSeries.js +415 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-gantt/GridAxis.js +961 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-gantt/Pathfinder.js +1298 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-gantt/PathfinderAlgorithms.js +816 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-gantt/Tree.js +158 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-gantt/TreeGrid.js +1003 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-map/ColorAxis.js +1103 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-map/ColorSeriesMixin.js +138 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-map/GeoJSON.js +435 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-map/HeatmapSeries.js +474 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-map/Map.js +477 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-map/MapAxis.js +124 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-map/MapBubbleSeries.js +274 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-map/MapLineSeries.js +143 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-map/MapNavigation.js +357 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-map/MapPointSeries.js +187 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-map/MapPointer.js +132 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-map/MapSeries.js +1294 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-more/AreaRangeSeries.js +725 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-more/AreaSplineRangeSeries.js +98 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-more/BoxPlotSeries.js +617 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-more/BubbleLegend.js +1167 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-more/BubbleSeries.js +661 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-more/ColumnPyramidSeries.js +288 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-more/ColumnRangeSeries.js +278 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-more/ErrorBarSeries.js +172 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-more/GaugeSeries.js +618 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-more/PackedBubbleSeries.js +567 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-more/Pane.js +399 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-more/Polar.js +634 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-more/PolygonSeries.js +151 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-more/RadialAxis.js +685 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts-more/WaterfallSeries.js +765 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts.js +684 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/AreaSeries.js +578 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/AreaSplineSeries.js +122 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/Axis.js +6453 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/BarSeries.js +153 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/CandlestickSeries.js +358 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/Chart.js +2307 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/Color.js +301 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/ColumnSeries.js +1125 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/DataGrouping.js +1115 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/DataLabels.js +1431 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/DateTimeAxis.js +134 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/Dynamics.js +1301 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/FlagsSeries.js +739 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/Globals.js +75 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/Html.js +539 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/Interaction.js +1299 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/Legend.js +1411 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/LogarithmicAxis.js +168 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/MSPointer.js +176 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/Navigator.js +2486 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/OHLCSeries.js +412 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/Options.js +3732 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/OrdinalAxis.js +962 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/PieSeries.js +1328 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/PlotBandSeries.experimental.js +74 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/PlotLineOrBand.js +1061 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/Point.js +681 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/Pointer.js +1332 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/RangeSelector.js +2063 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/Responsive.js +295 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/ScatterSeries.js +278 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/ScrollablePlotArea.js +266 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/Scrollbar.js +1134 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/Series.js +5864 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/SplineSeries.js +267 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/Stacking.js +604 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/StockChart.js +951 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/SvgRenderer.js +5109 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/Tick.js +746 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/Time.js +881 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/Tooltip.js +1318 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/TouchPointer.js +404 -0
- data/vendor/assets/javascripts/highstock/es-modules/parts/Utilities.js +2751 -0
- data/vendor/assets/javascripts/highstock/es-modules/themes/avocado.js +37 -0
- data/vendor/assets/javascripts/highstock/es-modules/themes/dark-blue.js +259 -0
- data/vendor/assets/javascripts/highstock/es-modules/themes/dark-green.js +261 -0
- data/vendor/assets/javascripts/highstock/es-modules/themes/dark-unica.js +220 -0
- data/vendor/assets/javascripts/highstock/es-modules/themes/gray.js +267 -0
- data/vendor/assets/javascripts/highstock/es-modules/themes/grid-light.js +81 -0
- data/vendor/assets/javascripts/highstock/es-modules/themes/grid.js +110 -0
- data/vendor/assets/javascripts/highstock/es-modules/themes/sand-signika.js +111 -0
- data/vendor/assets/javascripts/highstock/es-modules/themes/skies.js +100 -0
- data/vendor/assets/javascripts/highstock/es-modules/themes/sunset.js +36 -0
- data/vendor/assets/javascripts/highstock/highcharts-3d.js +85 -0
- data/vendor/assets/javascripts/highstock/highcharts-3d.js.map +1 -0
- data/vendor/assets/javascripts/highstock/highcharts-more.js +101 -0
- data/vendor/assets/javascripts/highstock/highcharts-more.js.map +1 -0
- data/vendor/assets/javascripts/highstock/highstock.js +583 -0
- data/vendor/assets/javascripts/highstock/highstock.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/acceleration-bands.js +16 -0
- data/vendor/assets/javascripts/highstock/indicators/acceleration-bands.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/acceleration-bands.src.js +448 -0
- data/vendor/assets/javascripts/highstock/indicators/accumulation-distribution.js +12 -0
- data/vendor/assets/javascripts/highstock/indicators/accumulation-distribution.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/accumulation-distribution.src.js +156 -0
- data/vendor/assets/javascripts/highstock/indicators/ao.js +13 -0
- data/vendor/assets/javascripts/highstock/indicators/ao.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/ao.src.js +233 -0
- data/vendor/assets/javascripts/highstock/indicators/apo.js +13 -0
- data/vendor/assets/javascripts/highstock/indicators/apo.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/apo.src.js +223 -0
- data/vendor/assets/javascripts/highstock/indicators/aroon-oscillator.js +15 -0
- data/vendor/assets/javascripts/highstock/indicators/aroon-oscillator.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/aroon-oscillator.src.js +426 -0
- data/vendor/assets/javascripts/highstock/indicators/aroon.js +16 -0
- data/vendor/assets/javascripts/highstock/indicators/aroon.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/aroon.src.js +423 -0
- data/vendor/assets/javascripts/highstock/indicators/atr.js +12 -0
- data/vendor/assets/javascripts/highstock/indicators/atr.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/atr.src.js +178 -0
- data/vendor/assets/javascripts/highstock/indicators/bollinger-bands.js +16 -0
- data/vendor/assets/javascripts/highstock/indicators/bollinger-bands.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/bollinger-bands.src.js +458 -0
- data/vendor/assets/javascripts/highstock/indicators/cci.js +12 -0
- data/vendor/assets/javascripts/highstock/indicators/cci.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/cci.src.js +158 -0
- data/vendor/assets/javascripts/highstock/indicators/chaikin.js +15 -0
- data/vendor/assets/javascripts/highstock/indicators/chaikin.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/chaikin.src.js +370 -0
- data/vendor/assets/javascripts/highstock/indicators/cmf.js +12 -0
- data/vendor/assets/javascripts/highstock/indicators/cmf.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/cmf.src.js +273 -0
- data/vendor/assets/javascripts/highstock/indicators/dema.js +13 -0
- data/vendor/assets/javascripts/highstock/indicators/dema.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/dema.src.js +266 -0
- data/vendor/assets/javascripts/highstock/indicators/dpo.js +12 -0
- data/vendor/assets/javascripts/highstock/indicators/dpo.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/dpo.src.js +166 -0
- data/vendor/assets/javascripts/highstock/indicators/ema.js +12 -0
- data/vendor/assets/javascripts/highstock/indicators/ema.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/ema.src.js +193 -0
- data/vendor/assets/javascripts/highstock/indicators/ichimoku-kinko-hyo.js +22 -0
- data/vendor/assets/javascripts/highstock/indicators/ichimoku-kinko-hyo.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/ichimoku-kinko-hyo.src.js +877 -0
- data/vendor/assets/javascripts/highstock/indicators/indicators-all.js +117 -0
- data/vendor/assets/javascripts/highstock/indicators/indicators-all.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/indicators-all.src.js +9389 -0
- data/vendor/assets/javascripts/highstock/indicators/indicators.js +17 -0
- data/vendor/assets/javascripts/highstock/indicators/indicators.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/indicators.src.js +500 -0
- data/vendor/assets/javascripts/highstock/indicators/keltner-channels.js +16 -0
- data/vendor/assets/javascripts/highstock/indicators/keltner-channels.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/keltner-channels.src.js +442 -0
- data/vendor/assets/javascripts/highstock/indicators/macd.js +18 -0
- data/vendor/assets/javascripts/highstock/indicators/macd.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/macd.src.js +444 -0
- data/vendor/assets/javascripts/highstock/indicators/mfi.js +13 -0
- data/vendor/assets/javascripts/highstock/indicators/mfi.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/mfi.src.js +225 -0
- data/vendor/assets/javascripts/highstock/indicators/momentum.js +12 -0
- data/vendor/assets/javascripts/highstock/indicators/momentum.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/momentum.src.js +146 -0
- data/vendor/assets/javascripts/highstock/indicators/natr.js +12 -0
- data/vendor/assets/javascripts/highstock/indicators/natr.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/natr.src.js +101 -0
- data/vendor/assets/javascripts/highstock/indicators/pivot-points.js +16 -0
- data/vendor/assets/javascripts/highstock/indicators/pivot-points.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/pivot-points.src.js +387 -0
- data/vendor/assets/javascripts/highstock/indicators/ppo.js +13 -0
- data/vendor/assets/javascripts/highstock/indicators/ppo.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/ppo.src.js +227 -0
- data/vendor/assets/javascripts/highstock/indicators/price-channel.js +16 -0
- data/vendor/assets/javascripts/highstock/indicators/price-channel.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/price-channel.src.js +450 -0
- data/vendor/assets/javascripts/highstock/indicators/price-envelopes.js +15 -0
- data/vendor/assets/javascripts/highstock/indicators/price-envelopes.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/price-envelopes.src.js +278 -0
- data/vendor/assets/javascripts/highstock/indicators/psar.js +13 -0
- data/vendor/assets/javascripts/highstock/indicators/psar.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/psar.src.js +334 -0
- data/vendor/assets/javascripts/highstock/indicators/regressions.js +14 -0
- data/vendor/assets/javascripts/highstock/indicators/regressions.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/regressions.src.js +454 -0
- data/vendor/assets/javascripts/highstock/indicators/roc.js +12 -0
- data/vendor/assets/javascripts/highstock/indicators/roc.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/roc.src.js +176 -0
- data/vendor/assets/javascripts/highstock/indicators/rsi.js +12 -0
- data/vendor/assets/javascripts/highstock/indicators/rsi.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/rsi.src.js +190 -0
- data/vendor/assets/javascripts/highstock/indicators/stochastic.js +17 -0
- data/vendor/assets/javascripts/highstock/indicators/stochastic.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/stochastic.src.js +494 -0
- data/vendor/assets/javascripts/highstock/indicators/supertrend.js +17 -0
- data/vendor/assets/javascripts/highstock/indicators/supertrend.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/supertrend.src.js +571 -0
- data/vendor/assets/javascripts/highstock/indicators/tema.js +14 -0
- data/vendor/assets/javascripts/highstock/indicators/tema.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/tema.src.js +322 -0
- data/vendor/assets/javascripts/highstock/indicators/trix.js +12 -0
- data/vendor/assets/javascripts/highstock/indicators/trix.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/trix.src.js +171 -0
- data/vendor/assets/javascripts/highstock/indicators/volume-by-price.js +21 -0
- data/vendor/assets/javascripts/highstock/indicators/volume-by-price.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/volume-by-price.src.js +698 -0
- data/vendor/assets/javascripts/highstock/indicators/vwap.js +12 -0
- data/vendor/assets/javascripts/highstock/indicators/vwap.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/vwap.src.js +216 -0
- data/vendor/assets/javascripts/highstock/indicators/williams-r.js +13 -0
- data/vendor/assets/javascripts/highstock/indicators/williams-r.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/williams-r.src.js +207 -0
- data/vendor/assets/javascripts/highstock/indicators/wma.js +12 -0
- data/vendor/assets/javascripts/highstock/indicators/wma.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/wma.src.js +173 -0
- data/vendor/assets/javascripts/highstock/indicators/zigzag.js +13 -0
- data/vendor/assets/javascripts/highstock/indicators/zigzag.js.map +1 -0
- data/vendor/assets/javascripts/highstock/indicators/zigzag.src.js +248 -0
- data/vendor/assets/javascripts/highstock/lib/canvg.js +130 -0
- data/vendor/assets/javascripts/highstock/lib/canvg.src.js +3073 -0
- data/vendor/assets/javascripts/highstock/lib/jspdf.js +283 -0
- data/vendor/assets/javascripts/highstock/lib/jspdf.src.js +21627 -0
- data/vendor/assets/javascripts/highstock/lib/rgbcolor.js +17 -0
- data/vendor/assets/javascripts/highstock/lib/rgbcolor.src.js +299 -0
- data/vendor/assets/javascripts/highstock/lib/svg2pdf.js +38 -0
- data/vendor/assets/javascripts/highstock/lib/svg2pdf.src.js +4390 -0
- data/vendor/assets/javascripts/highstock/modules/accessibility.js +73 -0
- data/vendor/assets/javascripts/highstock/modules/accessibility.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/accessibility.src.js +3103 -0
- data/vendor/assets/javascripts/highstock/modules/annotations-advanced.js +132 -0
- data/vendor/assets/javascripts/highstock/modules/annotations-advanced.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/annotations-advanced.src.js +8230 -0
- data/vendor/assets/javascripts/highstock/modules/annotations.js +94 -0
- data/vendor/assets/javascripts/highstock/modules/annotations.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/annotations.src.js +6001 -0
- data/vendor/assets/javascripts/highstock/modules/arrow-symbols.js +11 -0
- data/vendor/assets/javascripts/highstock/modules/arrow-symbols.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/arrow-symbols.src.js +225 -0
- data/vendor/assets/javascripts/highstock/modules/boost-canvas.js +23 -0
- data/vendor/assets/javascripts/highstock/modules/boost-canvas.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/boost-canvas.src.js +756 -0
- data/vendor/assets/javascripts/highstock/modules/boost.js +65 -0
- data/vendor/assets/javascripts/highstock/modules/boost.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/boost.src.js +3752 -0
- data/vendor/assets/javascripts/highstock/modules/bullet.js +14 -0
- data/vendor/assets/javascripts/highstock/modules/bullet.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/bullet.src.js +388 -0
- data/vendor/assets/javascripts/highstock/modules/current-date-indicator.js +11 -0
- data/vendor/assets/javascripts/highstock/modules/current-date-indicator.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/current-date-indicator.src.js +127 -0
- data/vendor/assets/javascripts/highstock/modules/cylinder.js +14 -0
- data/vendor/assets/javascripts/highstock/modules/cylinder.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/cylinder.src.js +413 -0
- data/vendor/assets/javascripts/highstock/modules/data.js +37 -0
- data/vendor/assets/javascripts/highstock/modules/data.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/data.src.js +2565 -0
- data/vendor/assets/javascripts/highstock/modules/datagrouping.js +25 -0
- data/vendor/assets/javascripts/highstock/modules/datagrouping.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/datagrouping.src.js +1140 -0
- data/vendor/assets/javascripts/highstock/modules/debugger.js +28 -0
- data/vendor/assets/javascripts/highstock/modules/debugger.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/debugger.src.js +267 -0
- data/vendor/assets/javascripts/highstock/modules/dependency-wheel.js +15 -0
- data/vendor/assets/javascripts/highstock/modules/dependency-wheel.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/dependency-wheel.src.js +301 -0
- data/vendor/assets/javascripts/highstock/modules/drag-panes.js +18 -0
- data/vendor/assets/javascripts/highstock/modules/drag-panes.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/drag-panes.src.js +649 -0
- data/vendor/assets/javascripts/highstock/modules/draggable-points.js +40 -0
- data/vendor/assets/javascripts/highstock/modules/draggable-points.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/draggable-points.src.js +2650 -0
- data/vendor/assets/javascripts/highstock/modules/drilldown.js +29 -0
- data/vendor/assets/javascripts/highstock/modules/drilldown.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/drilldown.src.js +1321 -0
- data/vendor/assets/javascripts/highstock/modules/export-data.js +27 -0
- data/vendor/assets/javascripts/highstock/modules/export-data.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/export-data.src.js +1234 -0
- data/vendor/assets/javascripts/highstock/modules/exporting.js +35 -0
- data/vendor/assets/javascripts/highstock/modules/exporting.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/exporting.src.js +2233 -0
- data/vendor/assets/javascripts/highstock/modules/full-screen.js +11 -0
- data/vendor/assets/javascripts/highstock/modules/full-screen.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/full-screen.src.js +68 -0
- data/vendor/assets/javascripts/highstock/modules/funnel.js +14 -0
- data/vendor/assets/javascripts/highstock/modules/funnel.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/funnel.src.js +576 -0
- data/vendor/assets/javascripts/highstock/modules/grid-axis.js +23 -0
- data/vendor/assets/javascripts/highstock/modules/grid-axis.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/grid-axis.src.js +988 -0
- data/vendor/assets/javascripts/highstock/modules/heatmap.js +28 -0
- data/vendor/assets/javascripts/highstock/modules/heatmap.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/heatmap.src.js +1731 -0
- data/vendor/assets/javascripts/highstock/modules/histogram-bellcurve.js +16 -0
- data/vendor/assets/javascripts/highstock/modules/histogram-bellcurve.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/histogram-bellcurve.src.js +570 -0
- data/vendor/assets/javascripts/highstock/modules/item-series.js +13 -0
- data/vendor/assets/javascripts/highstock/modules/item-series.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/item-series.src.js +176 -0
- data/vendor/assets/javascripts/highstock/modules/networkgraph.js +31 -0
- data/vendor/assets/javascripts/highstock/modules/networkgraph.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/networkgraph.src.js +1348 -0
- data/vendor/assets/javascripts/highstock/modules/no-data-to-display.js +13 -0
- data/vendor/assets/javascripts/highstock/modules/no-data-to-display.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/no-data-to-display.src.js +285 -0
- data/vendor/assets/javascripts/highstock/modules/offline-exporting.js +22 -0
- data/vendor/assets/javascripts/highstock/modules/offline-exporting.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/offline-exporting.src.js +838 -0
- data/vendor/assets/javascripts/highstock/modules/oldie-polyfills.js +13 -0
- data/vendor/assets/javascripts/highstock/modules/oldie-polyfills.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/oldie-polyfills.src.js +150 -0
- data/vendor/assets/javascripts/highstock/modules/oldie.js +35 -0
- data/vendor/assets/javascripts/highstock/modules/oldie.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/oldie.src.js +1582 -0
- data/vendor/assets/javascripts/highstock/modules/overlapping-datalabels.js +9 -0
- data/vendor/assets/javascripts/highstock/modules/overlapping-datalabels.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/overlapping-datalabels.src.js +22 -0
- data/vendor/assets/javascripts/highstock/modules/parallel-coordinates.js +18 -0
- data/vendor/assets/javascripts/highstock/modules/parallel-coordinates.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/parallel-coordinates.src.js +517 -0
- data/vendor/assets/javascripts/highstock/modules/pareto.js +14 -0
- data/vendor/assets/javascripts/highstock/modules/pareto.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/pareto.src.js +327 -0
- data/vendor/assets/javascripts/highstock/modules/pathfinder.js +34 -0
- data/vendor/assets/javascripts/highstock/modules/pathfinder.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/pathfinder.src.js +2336 -0
- data/vendor/assets/javascripts/highstock/modules/pattern-fill.js +21 -0
- data/vendor/assets/javascripts/highstock/modules/pattern-fill.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/pattern-fill.src.js +634 -0
- data/vendor/assets/javascripts/highstock/modules/price-indicator.js +13 -0
- data/vendor/assets/javascripts/highstock/modules/price-indicator.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/price-indicator.src.js +176 -0
- data/vendor/assets/javascripts/highstock/modules/sankey.js +22 -0
- data/vendor/assets/javascripts/highstock/modules/sankey.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/sankey.src.js +911 -0
- data/vendor/assets/javascripts/highstock/modules/series-label.js +23 -0
- data/vendor/assets/javascripts/highstock/modules/series-label.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/series-label.src.js +1065 -0
- data/vendor/assets/javascripts/highstock/modules/solid-gauge.js +15 -0
- data/vendor/assets/javascripts/highstock/modules/solid-gauge.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/solid-gauge.src.js +510 -0
- data/vendor/assets/javascripts/highstock/modules/sonification.js +53 -0
- data/vendor/assets/javascripts/highstock/modules/sonification.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/sonification.src.js +3341 -0
- data/vendor/assets/javascripts/highstock/modules/static-scale.js +12 -0
- data/vendor/assets/javascripts/highstock/modules/static-scale.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/static-scale.src.js +114 -0
- data/vendor/assets/javascripts/highstock/modules/stock-tools.js +65 -0
- data/vendor/assets/javascripts/highstock/modules/stock-tools.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/stock-tools.src.js +3437 -0
- data/vendor/assets/javascripts/highstock/modules/stock.js +151 -0
- data/vendor/assets/javascripts/highstock/modules/stock.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/stock.src.js +10907 -0
- data/vendor/assets/javascripts/highstock/modules/streamgraph.js +10 -0
- data/vendor/assets/javascripts/highstock/modules/streamgraph.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/streamgraph.src.js +158 -0
- data/vendor/assets/javascripts/highstock/modules/sunburst.js +52 -0
- data/vendor/assets/javascripts/highstock/modules/sunburst.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/sunburst.src.js +3174 -0
- data/vendor/assets/javascripts/highstock/modules/tilemap.js +26 -0
- data/vendor/assets/javascripts/highstock/modules/tilemap.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/tilemap.src.js +1402 -0
- data/vendor/assets/javascripts/highstock/modules/timeline.js +23 -0
- data/vendor/assets/javascripts/highstock/modules/timeline.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/timeline.src.js +778 -0
- data/vendor/assets/javascripts/highstock/modules/treegrid.js +50 -0
- data/vendor/assets/javascripts/highstock/modules/treegrid.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/treegrid.src.js +2917 -0
- data/vendor/assets/javascripts/highstock/modules/treemap.js +39 -0
- data/vendor/assets/javascripts/highstock/modules/treemap.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/treemap.src.js +2083 -0
- data/vendor/assets/javascripts/highstock/modules/variable-pie.js +16 -0
- data/vendor/assets/javascripts/highstock/modules/variable-pie.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/variable-pie.src.js +485 -0
- data/vendor/assets/javascripts/highstock/modules/variwide.js +15 -0
- data/vendor/assets/javascripts/highstock/modules/variwide.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/variwide.src.js +376 -0
- data/vendor/assets/javascripts/highstock/modules/vector.js +13 -0
- data/vendor/assets/javascripts/highstock/modules/vector.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/vector.src.js +381 -0
- data/vendor/assets/javascripts/highstock/modules/venn.js +30 -0
- data/vendor/assets/javascripts/highstock/modules/venn.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/venn.src.js +1624 -0
- data/vendor/assets/javascripts/highstock/modules/windbarb.js +17 -0
- data/vendor/assets/javascripts/highstock/modules/windbarb.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/windbarb.src.js +574 -0
- data/vendor/assets/javascripts/highstock/modules/wordcloud.js +25 -0
- data/vendor/assets/javascripts/highstock/modules/wordcloud.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/wordcloud.src.js +1475 -0
- data/vendor/assets/javascripts/highstock/modules/xrange.js +20 -0
- data/vendor/assets/javascripts/highstock/modules/xrange.js.map +1 -0
- data/vendor/assets/javascripts/highstock/modules/xrange.src.js +788 -0
- data/vendor/assets/javascripts/highstock/themes/avocado.js +9 -0
- data/vendor/assets/javascripts/highstock/themes/avocado.js.map +1 -0
- data/vendor/assets/javascripts/highstock/themes/avocado.src.js +63 -0
- data/vendor/assets/javascripts/highstock/themes/dark-blue.js +15 -0
- data/vendor/assets/javascripts/highstock/themes/dark-blue.js.map +1 -0
- data/vendor/assets/javascripts/highstock/themes/dark-blue.src.js +285 -0
- data/vendor/assets/javascripts/highstock/themes/dark-green.js +15 -0
- data/vendor/assets/javascripts/highstock/themes/dark-green.js.map +1 -0
- data/vendor/assets/javascripts/highstock/themes/dark-green.src.js +287 -0
- data/vendor/assets/javascripts/highstock/themes/dark-unica.js +14 -0
- data/vendor/assets/javascripts/highstock/themes/dark-unica.js.map +1 -0
- data/vendor/assets/javascripts/highstock/themes/dark-unica.src.js +246 -0
- data/vendor/assets/javascripts/highstock/themes/gray.js +15 -0
- data/vendor/assets/javascripts/highstock/themes/gray.js.map +1 -0
- data/vendor/assets/javascripts/highstock/themes/gray.src.js +293 -0
- data/vendor/assets/javascripts/highstock/themes/grid-light.js +11 -0
- data/vendor/assets/javascripts/highstock/themes/grid-light.js.map +1 -0
- data/vendor/assets/javascripts/highstock/themes/grid-light.src.js +107 -0
- data/vendor/assets/javascripts/highstock/themes/grid.js +11 -0
- data/vendor/assets/javascripts/highstock/themes/grid.js.map +1 -0
- data/vendor/assets/javascripts/highstock/themes/grid.src.js +136 -0
- data/vendor/assets/javascripts/highstock/themes/sand-signika.js +11 -0
- data/vendor/assets/javascripts/highstock/themes/sand-signika.js.map +1 -0
- data/vendor/assets/javascripts/highstock/themes/sand-signika.src.js +137 -0
- data/vendor/assets/javascripts/highstock/themes/skies.js +11 -0
- data/vendor/assets/javascripts/highstock/themes/skies.js.map +1 -0
- data/vendor/assets/javascripts/highstock/themes/skies.src.js +126 -0
- data/vendor/assets/javascripts/highstock/themes/sunset.js +9 -0
- data/vendor/assets/javascripts/highstock/themes/sunset.js.map +1 -0
- data/vendor/assets/javascripts/highstock/themes/sunset.src.js +62 -0
- metadata +781 -0
@@ -0,0 +1,404 @@
|
|
1
|
+
/**
|
2
|
+
* (c) 2010-2019 Torstein Honsi
|
3
|
+
*
|
4
|
+
* License: www.highcharts.com/license
|
5
|
+
*/
|
6
|
+
|
7
|
+
'use strict';
|
8
|
+
|
9
|
+
import H from './Globals.js';
|
10
|
+
import './Utilities.js';
|
11
|
+
|
12
|
+
var charts = H.charts,
|
13
|
+
extend = H.extend,
|
14
|
+
noop = H.noop,
|
15
|
+
pick = H.pick,
|
16
|
+
Pointer = H.Pointer;
|
17
|
+
|
18
|
+
// Support for touch devices
|
19
|
+
extend(Pointer.prototype, /** @lends Pointer.prototype */ {
|
20
|
+
|
21
|
+
/**
|
22
|
+
* Run translation operations
|
23
|
+
*
|
24
|
+
* @private
|
25
|
+
* @function Highcharts.Pointer#pinchTranslate
|
26
|
+
*
|
27
|
+
* @param {Array<*>} pinchDown
|
28
|
+
*
|
29
|
+
* @param {Array<*>} touches
|
30
|
+
*
|
31
|
+
* @param {*} transform
|
32
|
+
*
|
33
|
+
* @param {*} selectionMarker
|
34
|
+
*
|
35
|
+
* @param {*} clip
|
36
|
+
*
|
37
|
+
* @param {*} lastValidTouch
|
38
|
+
*/
|
39
|
+
pinchTranslate: function (
|
40
|
+
pinchDown,
|
41
|
+
touches,
|
42
|
+
transform,
|
43
|
+
selectionMarker,
|
44
|
+
clip,
|
45
|
+
lastValidTouch
|
46
|
+
) {
|
47
|
+
if (this.zoomHor) {
|
48
|
+
this.pinchTranslateDirection(
|
49
|
+
true,
|
50
|
+
pinchDown,
|
51
|
+
touches,
|
52
|
+
transform,
|
53
|
+
selectionMarker,
|
54
|
+
clip,
|
55
|
+
lastValidTouch
|
56
|
+
);
|
57
|
+
}
|
58
|
+
if (this.zoomVert) {
|
59
|
+
this.pinchTranslateDirection(
|
60
|
+
false,
|
61
|
+
pinchDown,
|
62
|
+
touches,
|
63
|
+
transform,
|
64
|
+
selectionMarker,
|
65
|
+
clip,
|
66
|
+
lastValidTouch
|
67
|
+
);
|
68
|
+
}
|
69
|
+
},
|
70
|
+
|
71
|
+
/**
|
72
|
+
* Run translation operations for each direction (horizontal and vertical)
|
73
|
+
* independently.
|
74
|
+
*
|
75
|
+
* @private
|
76
|
+
* @function Highcharts.Pointer#pinchTranslateDirection
|
77
|
+
*
|
78
|
+
* @param {boolean} horiz
|
79
|
+
*
|
80
|
+
* @param {Array<*>} pinchDown
|
81
|
+
*
|
82
|
+
* @param {Array<*>} touches
|
83
|
+
*
|
84
|
+
* @param {*} transform
|
85
|
+
*
|
86
|
+
* @param {*} selectionMarker
|
87
|
+
*
|
88
|
+
* @param {*} clip
|
89
|
+
*
|
90
|
+
* @param {*} lastValidTouch
|
91
|
+
*
|
92
|
+
* @param {number|undefined} [forcedScale=1]
|
93
|
+
*/
|
94
|
+
pinchTranslateDirection: function (
|
95
|
+
horiz,
|
96
|
+
pinchDown,
|
97
|
+
touches,
|
98
|
+
transform,
|
99
|
+
selectionMarker,
|
100
|
+
clip,
|
101
|
+
lastValidTouch,
|
102
|
+
forcedScale
|
103
|
+
) {
|
104
|
+
var chart = this.chart,
|
105
|
+
xy = horiz ? 'x' : 'y',
|
106
|
+
XY = horiz ? 'X' : 'Y',
|
107
|
+
sChartXY = 'chart' + XY,
|
108
|
+
wh = horiz ? 'width' : 'height',
|
109
|
+
plotLeftTop = chart['plot' + (horiz ? 'Left' : 'Top')],
|
110
|
+
selectionWH,
|
111
|
+
selectionXY,
|
112
|
+
clipXY,
|
113
|
+
scale = forcedScale || 1,
|
114
|
+
inverted = chart.inverted,
|
115
|
+
bounds = chart.bounds[horiz ? 'h' : 'v'],
|
116
|
+
singleTouch = pinchDown.length === 1,
|
117
|
+
touch0Start = pinchDown[0][sChartXY],
|
118
|
+
touch0Now = touches[0][sChartXY],
|
119
|
+
touch1Start = !singleTouch && pinchDown[1][sChartXY],
|
120
|
+
touch1Now = !singleTouch && touches[1][sChartXY],
|
121
|
+
outOfBounds,
|
122
|
+
transformScale,
|
123
|
+
scaleKey,
|
124
|
+
setScale = function () {
|
125
|
+
// Don't zoom if fingers are too close on this axis
|
126
|
+
if (!singleTouch && Math.abs(touch0Start - touch1Start) > 20) {
|
127
|
+
scale = forcedScale ||
|
128
|
+
Math.abs(touch0Now - touch1Now) /
|
129
|
+
Math.abs(touch0Start - touch1Start);
|
130
|
+
}
|
131
|
+
|
132
|
+
clipXY = ((plotLeftTop - touch0Now) / scale) + touch0Start;
|
133
|
+
selectionWH = chart['plot' + (horiz ? 'Width' : 'Height')] /
|
134
|
+
scale;
|
135
|
+
};
|
136
|
+
|
137
|
+
// Set the scale, first pass
|
138
|
+
setScale();
|
139
|
+
|
140
|
+
// The clip position (x or y) is altered if out of bounds, the selection
|
141
|
+
// position is not
|
142
|
+
selectionXY = clipXY;
|
143
|
+
|
144
|
+
// Out of bounds
|
145
|
+
if (selectionXY < bounds.min) {
|
146
|
+
selectionXY = bounds.min;
|
147
|
+
outOfBounds = true;
|
148
|
+
} else if (selectionXY + selectionWH > bounds.max) {
|
149
|
+
selectionXY = bounds.max - selectionWH;
|
150
|
+
outOfBounds = true;
|
151
|
+
}
|
152
|
+
|
153
|
+
// Is the chart dragged off its bounds, determined by dataMin and
|
154
|
+
// dataMax?
|
155
|
+
if (outOfBounds) {
|
156
|
+
|
157
|
+
// Modify the touchNow position in order to create an elastic drag
|
158
|
+
// movement. This indicates to the user that the chart is responsive
|
159
|
+
// but can't be dragged further.
|
160
|
+
touch0Now -= 0.8 * (touch0Now - lastValidTouch[xy][0]);
|
161
|
+
if (!singleTouch) {
|
162
|
+
touch1Now -= 0.8 * (touch1Now - lastValidTouch[xy][1]);
|
163
|
+
}
|
164
|
+
|
165
|
+
// Set the scale, second pass to adapt to the modified touchNow
|
166
|
+
// positions
|
167
|
+
setScale();
|
168
|
+
|
169
|
+
} else {
|
170
|
+
lastValidTouch[xy] = [touch0Now, touch1Now];
|
171
|
+
}
|
172
|
+
|
173
|
+
// Set geometry for clipping, selection and transformation
|
174
|
+
if (!inverted) {
|
175
|
+
clip[xy] = clipXY - plotLeftTop;
|
176
|
+
clip[wh] = selectionWH;
|
177
|
+
}
|
178
|
+
scaleKey = inverted ? (horiz ? 'scaleY' : 'scaleX') : 'scale' + XY;
|
179
|
+
transformScale = inverted ? 1 / scale : scale;
|
180
|
+
|
181
|
+
selectionMarker[wh] = selectionWH;
|
182
|
+
selectionMarker[xy] = selectionXY;
|
183
|
+
transform[scaleKey] = scale;
|
184
|
+
transform['translate' + XY] = (transformScale * plotLeftTop) +
|
185
|
+
(touch0Now - (transformScale * touch0Start));
|
186
|
+
},
|
187
|
+
|
188
|
+
/**
|
189
|
+
* Handle touch events with two touches
|
190
|
+
*
|
191
|
+
* @private
|
192
|
+
* @function Highcharts.Pointer#pinch
|
193
|
+
*
|
194
|
+
* @param {Highcharts.PointerEvent} e
|
195
|
+
*/
|
196
|
+
pinch: function (e) {
|
197
|
+
|
198
|
+
var self = this,
|
199
|
+
chart = self.chart,
|
200
|
+
pinchDown = self.pinchDown,
|
201
|
+
touches = e.touches,
|
202
|
+
touchesLength = touches.length,
|
203
|
+
lastValidTouch = self.lastValidTouch,
|
204
|
+
hasZoom = self.hasZoom,
|
205
|
+
selectionMarker = self.selectionMarker,
|
206
|
+
transform = {},
|
207
|
+
fireClickEvent = touchesLength === 1 && (
|
208
|
+
(
|
209
|
+
self.inClass(e.target, 'highcharts-tracker') &&
|
210
|
+
chart.runTrackerClick
|
211
|
+
) ||
|
212
|
+
self.runChartClick
|
213
|
+
),
|
214
|
+
clip = {};
|
215
|
+
|
216
|
+
// Don't initiate panning until the user has pinched. This prevents us
|
217
|
+
// from blocking page scrolling as users scroll down a long page
|
218
|
+
// (#4210).
|
219
|
+
if (touchesLength > 1) {
|
220
|
+
self.initiated = true;
|
221
|
+
}
|
222
|
+
|
223
|
+
// On touch devices, only proceed to trigger click if a handler is
|
224
|
+
// defined
|
225
|
+
if (hasZoom && self.initiated && !fireClickEvent) {
|
226
|
+
e.preventDefault();
|
227
|
+
}
|
228
|
+
|
229
|
+
// Normalize each touch
|
230
|
+
[].map.call(touches, function (e) {
|
231
|
+
return self.normalize(e);
|
232
|
+
});
|
233
|
+
|
234
|
+
// Register the touch start position
|
235
|
+
if (e.type === 'touchstart') {
|
236
|
+
[].forEach.call(touches, function (e, i) {
|
237
|
+
pinchDown[i] = { chartX: e.chartX, chartY: e.chartY };
|
238
|
+
});
|
239
|
+
lastValidTouch.x = [pinchDown[0].chartX, pinchDown[1] &&
|
240
|
+
pinchDown[1].chartX];
|
241
|
+
lastValidTouch.y = [pinchDown[0].chartY, pinchDown[1] &&
|
242
|
+
pinchDown[1].chartY];
|
243
|
+
|
244
|
+
// Identify the data bounds in pixels
|
245
|
+
chart.axes.forEach(function (axis) {
|
246
|
+
if (axis.zoomEnabled) {
|
247
|
+
var bounds = chart.bounds[axis.horiz ? 'h' : 'v'],
|
248
|
+
minPixelPadding = axis.minPixelPadding,
|
249
|
+
min = axis.toPixels(
|
250
|
+
pick(axis.options.min, axis.dataMin)
|
251
|
+
),
|
252
|
+
max = axis.toPixels(
|
253
|
+
pick(axis.options.max, axis.dataMax)
|
254
|
+
),
|
255
|
+
absMin = Math.min(min, max),
|
256
|
+
absMax = Math.max(min, max);
|
257
|
+
|
258
|
+
// Store the bounds for use in the touchmove handler
|
259
|
+
bounds.min = Math.min(axis.pos, absMin - minPixelPadding);
|
260
|
+
bounds.max = Math.max(
|
261
|
+
axis.pos + axis.len,
|
262
|
+
absMax + minPixelPadding
|
263
|
+
);
|
264
|
+
}
|
265
|
+
});
|
266
|
+
self.res = true; // reset on next move
|
267
|
+
|
268
|
+
// Optionally move the tooltip on touchmove
|
269
|
+
} else if (self.followTouchMove && touchesLength === 1) {
|
270
|
+
this.runPointActions(self.normalize(e));
|
271
|
+
|
272
|
+
// Event type is touchmove, handle panning and pinching
|
273
|
+
} else if (pinchDown.length) { // can be 0 when releasing, if touchend
|
274
|
+
// fires first
|
275
|
+
|
276
|
+
|
277
|
+
// Set the marker
|
278
|
+
if (!selectionMarker) {
|
279
|
+
self.selectionMarker = selectionMarker = extend({
|
280
|
+
destroy: noop,
|
281
|
+
touch: true
|
282
|
+
}, chart.plotBox);
|
283
|
+
}
|
284
|
+
|
285
|
+
self.pinchTranslate(
|
286
|
+
pinchDown,
|
287
|
+
touches,
|
288
|
+
transform,
|
289
|
+
selectionMarker,
|
290
|
+
clip,
|
291
|
+
lastValidTouch
|
292
|
+
);
|
293
|
+
|
294
|
+
self.hasPinched = hasZoom;
|
295
|
+
|
296
|
+
// Scale and translate the groups to provide visual feedback during
|
297
|
+
// pinching
|
298
|
+
self.scaleGroups(transform, clip);
|
299
|
+
|
300
|
+
if (self.res) {
|
301
|
+
self.res = false;
|
302
|
+
this.reset(false, 0);
|
303
|
+
}
|
304
|
+
}
|
305
|
+
},
|
306
|
+
|
307
|
+
/**
|
308
|
+
* General touch handler shared by touchstart and touchmove.
|
309
|
+
*
|
310
|
+
* @private
|
311
|
+
* @function Highcharts.Pointer#touch
|
312
|
+
*
|
313
|
+
* @param {Highcharts.PointerEvent} e
|
314
|
+
*
|
315
|
+
* @param {boolean} start
|
316
|
+
*/
|
317
|
+
touch: function (e, start) {
|
318
|
+
var chart = this.chart,
|
319
|
+
hasMoved,
|
320
|
+
pinchDown,
|
321
|
+
isInside;
|
322
|
+
|
323
|
+
if (chart.index !== H.hoverChartIndex) {
|
324
|
+
this.onContainerMouseLeave({ relatedTarget: true });
|
325
|
+
}
|
326
|
+
H.hoverChartIndex = chart.index;
|
327
|
+
|
328
|
+
if (e.touches.length === 1) {
|
329
|
+
|
330
|
+
e = this.normalize(e);
|
331
|
+
|
332
|
+
isInside = chart.isInsidePlot(
|
333
|
+
e.chartX - chart.plotLeft,
|
334
|
+
e.chartY - chart.plotTop
|
335
|
+
);
|
336
|
+
if (isInside && !chart.openMenu) {
|
337
|
+
|
338
|
+
// Run mouse events and display tooltip etc
|
339
|
+
if (start) {
|
340
|
+
this.runPointActions(e);
|
341
|
+
}
|
342
|
+
|
343
|
+
// Android fires touchmove events after the touchstart even if
|
344
|
+
// the finger hasn't moved, or moved only a pixel or two. In iOS
|
345
|
+
// however, the touchmove doesn't fire unless the finger moves
|
346
|
+
// more than ~4px. So we emulate this behaviour in Android by
|
347
|
+
// checking how much it moved, and cancelling on small
|
348
|
+
// distances. #3450.
|
349
|
+
if (e.type === 'touchmove') {
|
350
|
+
pinchDown = this.pinchDown;
|
351
|
+
hasMoved = pinchDown[0] ? Math.sqrt( // #5266
|
352
|
+
Math.pow(pinchDown[0].chartX - e.chartX, 2) +
|
353
|
+
Math.pow(pinchDown[0].chartY - e.chartY, 2)
|
354
|
+
) >= 4 : false;
|
355
|
+
}
|
356
|
+
|
357
|
+
if (pick(hasMoved, true)) {
|
358
|
+
this.pinch(e);
|
359
|
+
}
|
360
|
+
|
361
|
+
} else if (start) {
|
362
|
+
// Hide the tooltip on touching outside the plot area (#1203)
|
363
|
+
this.reset();
|
364
|
+
}
|
365
|
+
|
366
|
+
} else if (e.touches.length === 2) {
|
367
|
+
this.pinch(e);
|
368
|
+
}
|
369
|
+
},
|
370
|
+
|
371
|
+
/**
|
372
|
+
* @private
|
373
|
+
* @function Highcharts.Pointer#onContainerTouchStart
|
374
|
+
*
|
375
|
+
* @param {Highcharts.PointerEvent} e
|
376
|
+
*/
|
377
|
+
onContainerTouchStart: function (e) {
|
378
|
+
this.zoomOption(e);
|
379
|
+
this.touch(e, true);
|
380
|
+
},
|
381
|
+
|
382
|
+
/**
|
383
|
+
* @private
|
384
|
+
* @function Highcharts.Pointer#onContainerTouchMove
|
385
|
+
*
|
386
|
+
* @param {Highcharts.PointerEvent} e
|
387
|
+
*/
|
388
|
+
onContainerTouchMove: function (e) {
|
389
|
+
this.touch(e);
|
390
|
+
},
|
391
|
+
|
392
|
+
/**
|
393
|
+
* @private
|
394
|
+
* @function Highcharts.Pointer#onDocumentTouchEnd
|
395
|
+
*
|
396
|
+
* @param {Highcharts.PointerEvent} e
|
397
|
+
*/
|
398
|
+
onDocumentTouchEnd: function (e) {
|
399
|
+
if (charts[H.hoverChartIndex]) {
|
400
|
+
charts[H.hoverChartIndex].pointer.drop(e);
|
401
|
+
}
|
402
|
+
}
|
403
|
+
|
404
|
+
});
|
@@ -0,0 +1,2751 @@
|
|
1
|
+
/* *
|
2
|
+
*
|
3
|
+
* (c) 2010-2019 Torstein Honsi
|
4
|
+
*
|
5
|
+
* License: www.highcharts.com/license
|
6
|
+
*
|
7
|
+
* */
|
8
|
+
|
9
|
+
/**
|
10
|
+
* An animation configuration. Animation configurations can also be defined as
|
11
|
+
* booleans, where `false` turns off animation and `true` defaults to a duration
|
12
|
+
* of 500ms.
|
13
|
+
*
|
14
|
+
* @interface Highcharts.AnimationOptionsObject
|
15
|
+
*//**
|
16
|
+
* A callback function to exectute when the animation finishes.
|
17
|
+
* @name Highcharts.AnimationOptionsObject#complete
|
18
|
+
* @type {Function|undefined}
|
19
|
+
*//**
|
20
|
+
* The animation duration in milliseconds.
|
21
|
+
* @name Highcharts.AnimationOptionsObject#duration
|
22
|
+
* @type {number}
|
23
|
+
*//**
|
24
|
+
* The name of an easing function as defined on the `Math` object.
|
25
|
+
* @name Highcharts.AnimationOptionsObject#easing
|
26
|
+
* @type {string|undefined}
|
27
|
+
*//**
|
28
|
+
* A callback function to execute on each step of each attribute or CSS property
|
29
|
+
* that's being animated. The first argument contains information about the
|
30
|
+
* animation and progress.
|
31
|
+
* @name Highcharts.AnimationOptionsObject#step
|
32
|
+
* @type {Function|undefined}
|
33
|
+
*/
|
34
|
+
|
35
|
+
/**
|
36
|
+
* A style object with camel case property names to define visual appearance of
|
37
|
+
* a SVG element or HTML element. The properties can be whatever styles are
|
38
|
+
* supported on the given SVG or HTML element.
|
39
|
+
*
|
40
|
+
* @example
|
41
|
+
* {
|
42
|
+
* fontFamily: 'monospace',
|
43
|
+
* fontSize: '1.2em'
|
44
|
+
* }
|
45
|
+
*
|
46
|
+
* @interface Highcharts.CSSObject
|
47
|
+
*//**
|
48
|
+
* @name Highcharts.CSSObject#[key:string]
|
49
|
+
* @type {boolean|number|string|undefined}
|
50
|
+
*//**
|
51
|
+
* Background style for the element.
|
52
|
+
* @name Highcharts.CSSObject#background
|
53
|
+
* @type {string|undefined}
|
54
|
+
*//**
|
55
|
+
* Background color of the element.
|
56
|
+
* @name Highcharts.CSSObject#backgroundColor
|
57
|
+
* @type {Highcharts.ColorString|undefined}
|
58
|
+
*//**
|
59
|
+
* Border style for the element.
|
60
|
+
* @name Highcharts.CSSObject#border
|
61
|
+
* @type {string|undefined}
|
62
|
+
*//**
|
63
|
+
* Radius of the element border.
|
64
|
+
* @name Highcharts.CSSObject#borderRadius
|
65
|
+
* @type {number|undefined}
|
66
|
+
*//**
|
67
|
+
* Color used in the element. The "contrast" option is a Highcharts custom
|
68
|
+
* property that results in black or white, depending on the background of the
|
69
|
+
* element.
|
70
|
+
* @name Highcharts.CSSObject#color
|
71
|
+
* @type {"contrast"|Highcharts.ColorString|undefined}
|
72
|
+
*//**
|
73
|
+
* Style of the mouse cursor when resting over the element.
|
74
|
+
* @name Highcharts.CSSObject#cursor
|
75
|
+
* @type {Highcharts.CursorType|undefined}
|
76
|
+
*//**
|
77
|
+
* Font family of the element text. Multiple values have to be in decreasing
|
78
|
+
* preference order and separated by comma.
|
79
|
+
* @name Highcharts.CSSObject#fontFamily
|
80
|
+
* @type {string|undefined}
|
81
|
+
*//**
|
82
|
+
* Font size of the element text.
|
83
|
+
* @name Highcharts.CSSObject#fontSize
|
84
|
+
* @type {string|undefined}
|
85
|
+
*//**
|
86
|
+
* Font weight of the element text.
|
87
|
+
* @name Highcharts.CSSObject#fontWeight
|
88
|
+
* @type {string|undefined}
|
89
|
+
*//**
|
90
|
+
* Height of the element.
|
91
|
+
* @name Highcharts.CSSObject#height
|
92
|
+
* @type {number|undefined}
|
93
|
+
*//**
|
94
|
+
* Width of the element border.
|
95
|
+
* @name Highcharts.CSSObject#lineWidth
|
96
|
+
* @type {number|undefined}
|
97
|
+
*//**
|
98
|
+
* Opacity of the element.
|
99
|
+
* @name Highcharts.CSSObject#opacity
|
100
|
+
* @type {number|undefined}
|
101
|
+
*//**
|
102
|
+
* Space around the element content.
|
103
|
+
* @name Highcharts.CSSObject#padding
|
104
|
+
* @type {string|undefined}
|
105
|
+
*//**
|
106
|
+
* Behaviour of the element when the mouse cursor rests over it.
|
107
|
+
* @name Highcharts.CSSObject#pointerEvents
|
108
|
+
* @type {string|undefined}
|
109
|
+
*//**
|
110
|
+
* Positioning of the element.
|
111
|
+
* @name Highcharts.CSSObject#position
|
112
|
+
* @type {string|undefined}
|
113
|
+
*//**
|
114
|
+
* Alignment of the element text.
|
115
|
+
* @name Highcharts.CSSObject#textAlign
|
116
|
+
* @type {string|undefined}
|
117
|
+
*//**
|
118
|
+
* Outline style of the element text.
|
119
|
+
* @name Highcharts.CSSObject#textOutline
|
120
|
+
* @type {string|undefined}
|
121
|
+
*//**
|
122
|
+
* Additional decoration of the element text.
|
123
|
+
* @name Highcharts.CSSObject#textDecoration
|
124
|
+
* @type {string|undefined}
|
125
|
+
*//**
|
126
|
+
* Line break style of the element text. Highcharts SVG elements support
|
127
|
+
* `ellipsis` when a `width` is set.
|
128
|
+
* @name Highcharts.CSSObject#textOverflow
|
129
|
+
* @type {string|undefined}
|
130
|
+
*//**
|
131
|
+
* Top spacing of the element relative to the parent element.
|
132
|
+
* @name Highcharts.CSSObject#top
|
133
|
+
* @type {string|undefined}
|
134
|
+
*//**
|
135
|
+
* Animated transition of selected element properties.
|
136
|
+
* @name Highcharts.CSSObject#transition
|
137
|
+
* @type {string|undefined}
|
138
|
+
*//**
|
139
|
+
* Line break style of the element text.
|
140
|
+
* @name Highcharts.CSSObject#whiteSpace
|
141
|
+
* @type {string|undefined}
|
142
|
+
*//**
|
143
|
+
* Width of the element.
|
144
|
+
* @name Highcharts.CSSObject#width
|
145
|
+
* @type {number|undefined}
|
146
|
+
*/
|
147
|
+
|
148
|
+
/**
|
149
|
+
* All possible cursor styles.
|
150
|
+
*
|
151
|
+
* @typedef {"alias"|"all-scroll"|"auto"|"cell"|"col-resize"|"context-menu"|"copy"|"crosshair"|"default"|"e-resize"|"ew-resize"|"grab"|"grabbing"|"help"|"move"|"n-resize"|"ne-resize"|"nesw-resize"|"no-drop"|"none"|"not-allowed"|"ns-resize"|"nw-resize"|"nwse-resize"|"pointer"|"progress"|"row-resize"|"s-resize"|"se-resize"|"sw-resize"|"text"|"vertical-text"|"w-resize"|"wait"|"zoom-in"|"zoom-out"} Highcharts.CursorType
|
152
|
+
*/
|
153
|
+
|
154
|
+
/**
|
155
|
+
* All possible dash styles.
|
156
|
+
*
|
157
|
+
* @typedef {"Dash"|"DashDot"|"Dot"|"LongDash"|"LongDashDot"|"LongDashDotDot"|"ShortDash"|"ShortDashDot"|"ShortDashDotDot"|"ShortDot"|"Solid"} Highcharts.DashStyleType
|
158
|
+
*/
|
159
|
+
|
160
|
+
/**
|
161
|
+
* Generic dictionary in TypeScript notation.
|
162
|
+
*
|
163
|
+
* @interface Highcharts.Dictionary<T>
|
164
|
+
*//**
|
165
|
+
* @name Highcharts.Dictionary<T>#[key:string]
|
166
|
+
* @type {T}
|
167
|
+
*/
|
168
|
+
|
169
|
+
/**
|
170
|
+
* The function callback to execute when the event is fired. The `this` context
|
171
|
+
* contains the instance, that fired the event.
|
172
|
+
*
|
173
|
+
* @callback Highcharts.EventCallbackFunction<T>
|
174
|
+
*
|
175
|
+
* @param {T} this
|
176
|
+
*
|
177
|
+
* @param {Highcharts.Dictionary<*>} [eventArguments]
|
178
|
+
* Event arguments.
|
179
|
+
*/
|
180
|
+
|
181
|
+
/**
|
182
|
+
* The event options for adding function callback.
|
183
|
+
*
|
184
|
+
* @interface Highcharts.EventOptionsObject
|
185
|
+
*//**
|
186
|
+
* The order the event handler should be called. This opens for having one
|
187
|
+
* handler be called before another, independent of in which order they were
|
188
|
+
* added.
|
189
|
+
* @name Highcharts.EventOptionsObject#order
|
190
|
+
* @type {number}
|
191
|
+
*/
|
192
|
+
|
193
|
+
/**
|
194
|
+
* Formats data as a string. Usually the data is accessible throught the `this`
|
195
|
+
* keyword.
|
196
|
+
*
|
197
|
+
* @callback Highcharts.FormatterCallbackFunction<T>
|
198
|
+
*
|
199
|
+
* @param {T} this
|
200
|
+
*
|
201
|
+
* @return {string}
|
202
|
+
*/
|
203
|
+
|
204
|
+
/**
|
205
|
+
* An object of key-value pairs for HTML attributes.
|
206
|
+
*
|
207
|
+
* @typedef {Highcharts.Dictionary<boolean|number|string>} Highcharts.HTMLAttributes
|
208
|
+
*/
|
209
|
+
|
210
|
+
/**
|
211
|
+
* An HTML DOM element. The type is a reference to the regular HTMLElement in
|
212
|
+
* the global scope.
|
213
|
+
*
|
214
|
+
* @typedef {global.HTMLElement} Highcharts.HTMLDOMElement
|
215
|
+
*
|
216
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement
|
217
|
+
*/
|
218
|
+
|
219
|
+
/**
|
220
|
+
* The iterator callback.
|
221
|
+
*
|
222
|
+
* @callback Highcharts.ObjectEachCallbackFunction
|
223
|
+
*
|
224
|
+
* @param {*} value
|
225
|
+
* The property value.
|
226
|
+
*
|
227
|
+
* @param {string} key
|
228
|
+
* The property key.
|
229
|
+
*
|
230
|
+
* @param {*} obj
|
231
|
+
* The object that objectEach is being applied to.
|
232
|
+
*/
|
233
|
+
|
234
|
+
/**
|
235
|
+
* An object containing `left` and `top` properties for the position in the
|
236
|
+
* page.
|
237
|
+
*
|
238
|
+
* @interface Highcharts.OffsetObject
|
239
|
+
*//**
|
240
|
+
* Left distance to the page border.
|
241
|
+
* @name Highcharts.OffsetObject#left
|
242
|
+
* @type {number}
|
243
|
+
*//**
|
244
|
+
* Top distance to the page border.
|
245
|
+
* @name Highcharts.OffsetObject#top
|
246
|
+
* @type {number}
|
247
|
+
*/
|
248
|
+
|
249
|
+
/**
|
250
|
+
* If a number is given, it defines the pixel length. If a percentage string is
|
251
|
+
* given, like for example `'50%'`, the setting defines a length relative to a
|
252
|
+
* base size, for example the size of a container.
|
253
|
+
*
|
254
|
+
* @typedef {number|string} Highcharts.RelativeSize
|
255
|
+
*/
|
256
|
+
|
257
|
+
/**
|
258
|
+
* An object of key-value pairs for SVG attributes. Attributes in Highcharts
|
259
|
+
* elements for the most parts correspond to SVG, but some are specific to
|
260
|
+
* Highcharts, like `zIndex`, `rotation`, `rotationOriginX`,
|
261
|
+
* `rotationOriginY`, `translateX`, `translateY`, `scaleX` and `scaleY`. SVG
|
262
|
+
* attributes containing a hyphen are _not_ camel-cased, they should be
|
263
|
+
* quoted to preserve the hyphen.
|
264
|
+
*
|
265
|
+
* @example
|
266
|
+
* {
|
267
|
+
* 'stroke': '#ff0000', // basic
|
268
|
+
* 'stroke-width': 2, // hyphenated
|
269
|
+
* 'rotation': 45 // custom
|
270
|
+
* 'd': ['M', 10, 10, 'L', 30, 30, 'z'] // path definition, note format
|
271
|
+
* }
|
272
|
+
*
|
273
|
+
* @interface Highcharts.SVGAttributes
|
274
|
+
*//**
|
275
|
+
* @name Highcharts.SVGAttributes#[key:string]
|
276
|
+
* @type {boolean|number|string|Array<number|string>|Dictionary<boolean|number|string|undefined>|undefined}
|
277
|
+
*//**
|
278
|
+
* @name Highcharts.SVGAttributes#d
|
279
|
+
* @type {string|Highcharts.SVGPathArray|undefined}
|
280
|
+
*//**
|
281
|
+
* @name Highcharts.SVGAttributes#inverted
|
282
|
+
* @type {boolean|undefined}
|
283
|
+
*//**
|
284
|
+
* @name Highcharts.SVGAttributes#matrix
|
285
|
+
* @type {Array<number>|undefined}
|
286
|
+
*//**
|
287
|
+
* @name Highcharts.SVGAttributes#rotation
|
288
|
+
* @type {string|undefined}
|
289
|
+
*//**
|
290
|
+
* @name Highcharts.SVGAttributes#rotationOriginX
|
291
|
+
* @type {number|undefined}
|
292
|
+
*//**
|
293
|
+
* @name Highcharts.SVGAttributes#rotationOriginY
|
294
|
+
* @type {number|undefined}
|
295
|
+
*//**
|
296
|
+
* @name Highcharts.SVGAttributes#scaleX
|
297
|
+
* @type {number|undefined}
|
298
|
+
*//**
|
299
|
+
* @name Highcharts.SVGAttributes#scaleY
|
300
|
+
* @type {number|undefined}
|
301
|
+
*//**
|
302
|
+
* @name Highcharts.SVGAttributes#stroke
|
303
|
+
* @type {Highcharts.ColorString|undefined}
|
304
|
+
*//**
|
305
|
+
* @name Highcharts.SVGAttributes#style
|
306
|
+
* @type {string|Highcharts.CSSObject|undefined}
|
307
|
+
*//**
|
308
|
+
* @name Highcharts.SVGAttributes#translateX
|
309
|
+
* @type {number|undefined}
|
310
|
+
*//**
|
311
|
+
* @name Highcharts.SVGAttributes#translateY
|
312
|
+
* @type {number|undefined}
|
313
|
+
*//**
|
314
|
+
* @name Highcharts.SVGAttributes#zIndex
|
315
|
+
* @type {number|undefined}
|
316
|
+
*/
|
317
|
+
|
318
|
+
/**
|
319
|
+
* An SVG DOM element. The type is a reference to the regular SVGElement in the
|
320
|
+
* global scope.
|
321
|
+
*
|
322
|
+
* @typedef {globals.GlobalSVGElement} Highcharts.SVGDOMElement
|
323
|
+
*
|
324
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGElement
|
325
|
+
*/
|
326
|
+
|
327
|
+
/**
|
328
|
+
* Array of path commands, that will go into the `d` attribute of an SVG
|
329
|
+
* element.
|
330
|
+
*
|
331
|
+
* @typedef {Array<number|Highcharts.SVGPathCommand>} Highcharts.SVGPathArray
|
332
|
+
*/
|
333
|
+
|
334
|
+
/**
|
335
|
+
* Possible path commands in a SVG path array.
|
336
|
+
*
|
337
|
+
* @typedef {string} Highcharts.SVGPathCommand
|
338
|
+
* @validvalue ["a","c","h","l","m","q","s","t","v","z","A","C","H","L","M","Q","S","T","V","Z"]
|
339
|
+
*/
|
340
|
+
|
341
|
+
'use strict';
|
342
|
+
|
343
|
+
import H from './Globals.js';
|
344
|
+
|
345
|
+
/**
|
346
|
+
* The Highcharts object is the placeholder for all other members, and various
|
347
|
+
* utility functions. The most important member of the namespace would be the
|
348
|
+
* chart constructor.
|
349
|
+
*
|
350
|
+
* @example
|
351
|
+
* var chart = Highcharts.chart('container', { ... });
|
352
|
+
*
|
353
|
+
* @namespace Highcharts
|
354
|
+
*/
|
355
|
+
|
356
|
+
H.timers = [];
|
357
|
+
|
358
|
+
var charts = H.charts,
|
359
|
+
doc = H.doc,
|
360
|
+
win = H.win;
|
361
|
+
|
362
|
+
/**
|
363
|
+
* Provide error messages for debugging, with links to online explanation. This
|
364
|
+
* function can be overridden to provide custom error handling.
|
365
|
+
*
|
366
|
+
* @sample highcharts/chart/highcharts-error/
|
367
|
+
* Custom error handler
|
368
|
+
*
|
369
|
+
* @function Highcharts.error
|
370
|
+
*
|
371
|
+
* @param {number|string} code
|
372
|
+
* The error code. See
|
373
|
+
* [errors.xml](https://github.com/highcharts/highcharts/blob/master/errors/errors.xml)
|
374
|
+
* for available codes. If it is a string, the error message is printed
|
375
|
+
* directly in the console.
|
376
|
+
*
|
377
|
+
* @param {boolean} [stop=false]
|
378
|
+
* Whether to throw an error or just log a warning in the console.
|
379
|
+
*
|
380
|
+
* @param {Highcharts.Chart} [chart]
|
381
|
+
* Reference to the chart that causes the error. Used in 'debugger'
|
382
|
+
* module to display errors directly on the chart.
|
383
|
+
* Important note: This argument is undefined for errors that lack
|
384
|
+
* access to the Chart instance.
|
385
|
+
*/
|
386
|
+
H.error = function (code, stop, chart) {
|
387
|
+
var msg = H.isNumber(code) ?
|
388
|
+
'Highcharts error #' + code + ': www.highcharts.com/errors/' + code :
|
389
|
+
code;
|
390
|
+
|
391
|
+
if (chart) {
|
392
|
+
H.fireEvent(chart, 'displayError', { code: code });
|
393
|
+
}
|
394
|
+
if (stop) {
|
395
|
+
throw new Error(msg);
|
396
|
+
}
|
397
|
+
// else ...
|
398
|
+
if (win.console) {
|
399
|
+
console.log(msg); // eslint-disable-line no-console
|
400
|
+
}
|
401
|
+
};
|
402
|
+
|
403
|
+
/**
|
404
|
+
* An animator object used internally. One instance applies to one property
|
405
|
+
* (attribute or style prop) on one element. Animation is always initiated
|
406
|
+
* through {@link SVGElement#animate}.
|
407
|
+
*
|
408
|
+
* @example
|
409
|
+
* var rect = renderer.rect(0, 0, 10, 10).add();
|
410
|
+
* rect.animate({ width: 100 });
|
411
|
+
*
|
412
|
+
* @private
|
413
|
+
* @class Highcharts.Fx
|
414
|
+
*
|
415
|
+
* @param {Highcharts.HTMLDOMElement|Highcharts.SVGElement} elem
|
416
|
+
* The element to animate.
|
417
|
+
*
|
418
|
+
* @param {Highcharts.AnimationOptionsObject} options
|
419
|
+
* Animation options.
|
420
|
+
*
|
421
|
+
* @param {string} prop
|
422
|
+
* The single attribute or CSS property to animate.
|
423
|
+
*/
|
424
|
+
H.Fx = function (elem, options, prop) {
|
425
|
+
this.options = options;
|
426
|
+
this.elem = elem;
|
427
|
+
this.prop = prop;
|
428
|
+
};
|
429
|
+
H.Fx.prototype = {
|
430
|
+
|
431
|
+
/**
|
432
|
+
* Set the current step of a path definition on SVGElement.
|
433
|
+
*
|
434
|
+
* @function Highcharts.Fx#dSetter
|
435
|
+
*/
|
436
|
+
dSetter: function () {
|
437
|
+
var start = this.paths[0],
|
438
|
+
end = this.paths[1],
|
439
|
+
ret = [],
|
440
|
+
now = this.now,
|
441
|
+
i = start.length,
|
442
|
+
startVal;
|
443
|
+
|
444
|
+
// Land on the final path without adjustment points appended in the ends
|
445
|
+
if (now === 1) {
|
446
|
+
ret = this.toD;
|
447
|
+
|
448
|
+
} else if (i === end.length && now < 1) {
|
449
|
+
while (i--) {
|
450
|
+
startVal = parseFloat(start[i]);
|
451
|
+
ret[i] =
|
452
|
+
isNaN(startVal) ? // a letter instruction like M or L
|
453
|
+
end[i] :
|
454
|
+
now * (parseFloat(end[i] - startVal)) + startVal;
|
455
|
+
|
456
|
+
}
|
457
|
+
// If animation is finished or length not matching, land on right value
|
458
|
+
} else {
|
459
|
+
ret = end;
|
460
|
+
}
|
461
|
+
this.elem.attr('d', ret, null, true);
|
462
|
+
},
|
463
|
+
|
464
|
+
/**
|
465
|
+
* Update the element with the current animation step.
|
466
|
+
*
|
467
|
+
* @function Highcharts.Fx#update
|
468
|
+
*/
|
469
|
+
update: function () {
|
470
|
+
var elem = this.elem,
|
471
|
+
prop = this.prop, // if destroyed, it is null
|
472
|
+
now = this.now,
|
473
|
+
step = this.options.step;
|
474
|
+
|
475
|
+
// Animation setter defined from outside
|
476
|
+
if (this[prop + 'Setter']) {
|
477
|
+
this[prop + 'Setter']();
|
478
|
+
|
479
|
+
// Other animations on SVGElement
|
480
|
+
} else if (elem.attr) {
|
481
|
+
if (elem.element) {
|
482
|
+
elem.attr(prop, now, null, true);
|
483
|
+
}
|
484
|
+
|
485
|
+
// HTML styles, raw HTML content like container size
|
486
|
+
} else {
|
487
|
+
elem.style[prop] = now + this.unit;
|
488
|
+
}
|
489
|
+
|
490
|
+
if (step) {
|
491
|
+
step.call(elem, now, this);
|
492
|
+
}
|
493
|
+
|
494
|
+
},
|
495
|
+
|
496
|
+
/**
|
497
|
+
* Run an animation.
|
498
|
+
*
|
499
|
+
* @function Highcharts.Fx#run
|
500
|
+
*
|
501
|
+
* @param {number} from
|
502
|
+
* The current value, value to start from.
|
503
|
+
*
|
504
|
+
* @param {number} to
|
505
|
+
* The end value, value to land on.
|
506
|
+
*
|
507
|
+
* @param {string} [unit]
|
508
|
+
* The property unit, for example `px`.
|
509
|
+
*/
|
510
|
+
run: function (from, to, unit) {
|
511
|
+
var self = this,
|
512
|
+
options = self.options,
|
513
|
+
timer = function (gotoEnd) {
|
514
|
+
return timer.stopped ? false : self.step(gotoEnd);
|
515
|
+
},
|
516
|
+
requestAnimationFrame =
|
517
|
+
win.requestAnimationFrame ||
|
518
|
+
function (step) {
|
519
|
+
setTimeout(step, 13);
|
520
|
+
},
|
521
|
+
step = function () {
|
522
|
+
for (var i = 0; i < H.timers.length; i++) {
|
523
|
+
if (!H.timers[i]()) {
|
524
|
+
H.timers.splice(i--, 1);
|
525
|
+
}
|
526
|
+
}
|
527
|
+
|
528
|
+
if (H.timers.length) {
|
529
|
+
requestAnimationFrame(step);
|
530
|
+
}
|
531
|
+
};
|
532
|
+
|
533
|
+
if (from === to && !this.elem['forceAnimate:' + this.prop]) {
|
534
|
+
delete options.curAnim[this.prop];
|
535
|
+
if (options.complete && Object.keys(options.curAnim).length === 0) {
|
536
|
+
options.complete.call(this.elem);
|
537
|
+
}
|
538
|
+
} else { // #7166
|
539
|
+
this.startTime = +new Date();
|
540
|
+
this.start = from;
|
541
|
+
this.end = to;
|
542
|
+
this.unit = unit;
|
543
|
+
this.now = this.start;
|
544
|
+
this.pos = 0;
|
545
|
+
|
546
|
+
timer.elem = this.elem;
|
547
|
+
timer.prop = this.prop;
|
548
|
+
|
549
|
+
if (timer() && H.timers.push(timer) === 1) {
|
550
|
+
requestAnimationFrame(step);
|
551
|
+
}
|
552
|
+
}
|
553
|
+
},
|
554
|
+
|
555
|
+
/**
|
556
|
+
* Run a single step in the animation.
|
557
|
+
*
|
558
|
+
* @function Highcharts.Fx#step
|
559
|
+
*
|
560
|
+
* @param {boolean} [gotoEnd]
|
561
|
+
* Whether to go to the endpoint of the animation after abort.
|
562
|
+
*
|
563
|
+
* @return {boolean}
|
564
|
+
* Returns `true` if animation continues.
|
565
|
+
*/
|
566
|
+
step: function (gotoEnd) {
|
567
|
+
var t = +new Date(),
|
568
|
+
ret,
|
569
|
+
done,
|
570
|
+
options = this.options,
|
571
|
+
elem = this.elem,
|
572
|
+
complete = options.complete,
|
573
|
+
duration = options.duration,
|
574
|
+
curAnim = options.curAnim;
|
575
|
+
|
576
|
+
if (elem.attr && !elem.element) { // #2616, element is destroyed
|
577
|
+
ret = false;
|
578
|
+
|
579
|
+
} else if (gotoEnd || t >= duration + this.startTime) {
|
580
|
+
this.now = this.end;
|
581
|
+
this.pos = 1;
|
582
|
+
this.update();
|
583
|
+
|
584
|
+
curAnim[this.prop] = true;
|
585
|
+
|
586
|
+
done = true;
|
587
|
+
|
588
|
+
H.objectEach(curAnim, function (val) {
|
589
|
+
if (val !== true) {
|
590
|
+
done = false;
|
591
|
+
}
|
592
|
+
});
|
593
|
+
|
594
|
+
if (done && complete) {
|
595
|
+
complete.call(elem);
|
596
|
+
}
|
597
|
+
ret = false;
|
598
|
+
|
599
|
+
} else {
|
600
|
+
this.pos = options.easing((t - this.startTime) / duration);
|
601
|
+
this.now = this.start + ((this.end - this.start) * this.pos);
|
602
|
+
this.update();
|
603
|
+
ret = true;
|
604
|
+
}
|
605
|
+
return ret;
|
606
|
+
},
|
607
|
+
|
608
|
+
/**
|
609
|
+
* Prepare start and end values so that the path can be animated one to one.
|
610
|
+
*
|
611
|
+
* @function Highcharts.Fx#initPath
|
612
|
+
*
|
613
|
+
* @param {Highcharts.SVGElement} elem
|
614
|
+
* The SVGElement item.
|
615
|
+
*
|
616
|
+
* @param {string} fromD
|
617
|
+
* Starting path definition.
|
618
|
+
*
|
619
|
+
* @param {Highcharts.SVGPathArray} toD
|
620
|
+
* Ending path definition.
|
621
|
+
*
|
622
|
+
* @return {Array<Highcharts.SVGPathArray>}
|
623
|
+
* An array containing start and end paths in array form so that
|
624
|
+
* they can be animated in parallel.
|
625
|
+
*/
|
626
|
+
initPath: function (elem, fromD, toD) {
|
627
|
+
fromD = fromD || '';
|
628
|
+
var shift,
|
629
|
+
startX = elem.startX,
|
630
|
+
endX = elem.endX,
|
631
|
+
bezier = fromD.indexOf('C') > -1,
|
632
|
+
numParams = bezier ? 7 : 3,
|
633
|
+
fullLength,
|
634
|
+
slice,
|
635
|
+
i,
|
636
|
+
start = fromD.split(' '),
|
637
|
+
end = toD.slice(), // copy
|
638
|
+
isArea = elem.isArea,
|
639
|
+
positionFactor = isArea ? 2 : 1,
|
640
|
+
reverse;
|
641
|
+
|
642
|
+
/**
|
643
|
+
* In splines make moveTo and lineTo points have six parameters like
|
644
|
+
* bezier curves, to allow animation one-to-one.
|
645
|
+
*/
|
646
|
+
function sixify(arr) {
|
647
|
+
var isOperator,
|
648
|
+
nextIsOperator;
|
649
|
+
|
650
|
+
i = arr.length;
|
651
|
+
while (i--) {
|
652
|
+
|
653
|
+
// Fill in dummy coordinates only if the next operator comes
|
654
|
+
// three places behind (#5788)
|
655
|
+
isOperator = arr[i] === 'M' || arr[i] === 'L';
|
656
|
+
nextIsOperator = /[a-zA-Z]/.test(arr[i + 3]);
|
657
|
+
if (isOperator && nextIsOperator) {
|
658
|
+
arr.splice(
|
659
|
+
i + 1, 0,
|
660
|
+
arr[i + 1], arr[i + 2],
|
661
|
+
arr[i + 1], arr[i + 2]
|
662
|
+
);
|
663
|
+
}
|
664
|
+
}
|
665
|
+
}
|
666
|
+
|
667
|
+
/**
|
668
|
+
* Insert an array at the given position of another array
|
669
|
+
*/
|
670
|
+
function insertSlice(arr, subArr, index) {
|
671
|
+
[].splice.apply(
|
672
|
+
arr,
|
673
|
+
[index, 0].concat(subArr)
|
674
|
+
);
|
675
|
+
}
|
676
|
+
|
677
|
+
/**
|
678
|
+
* If shifting points, prepend a dummy point to the end path.
|
679
|
+
*/
|
680
|
+
function prepend(arr, other) {
|
681
|
+
while (arr.length < fullLength) {
|
682
|
+
|
683
|
+
// Move to, line to or curve to?
|
684
|
+
arr[0] = other[fullLength - arr.length];
|
685
|
+
|
686
|
+
// Prepend a copy of the first point
|
687
|
+
insertSlice(arr, arr.slice(0, numParams), 0);
|
688
|
+
|
689
|
+
// For areas, the bottom path goes back again to the left, so we
|
690
|
+
// need to append a copy of the last point.
|
691
|
+
if (isArea) {
|
692
|
+
insertSlice(
|
693
|
+
arr,
|
694
|
+
arr.slice(arr.length - numParams), arr.length
|
695
|
+
);
|
696
|
+
i--;
|
697
|
+
}
|
698
|
+
}
|
699
|
+
arr[0] = 'M';
|
700
|
+
}
|
701
|
+
|
702
|
+
/**
|
703
|
+
* Copy and append last point until the length matches the end length.
|
704
|
+
*/
|
705
|
+
function append(arr, other) {
|
706
|
+
var i = (fullLength - arr.length) / numParams;
|
707
|
+
|
708
|
+
while (i > 0 && i--) {
|
709
|
+
|
710
|
+
// Pull out the slice that is going to be appended or inserted.
|
711
|
+
// In a line graph, the positionFactor is 1, and the last point
|
712
|
+
// is sliced out. In an area graph, the positionFactor is 2,
|
713
|
+
// causing the middle two points to be sliced out, since an area
|
714
|
+
// path starts at left, follows the upper path then turns and
|
715
|
+
// follows the bottom back.
|
716
|
+
slice = arr.slice().splice(
|
717
|
+
(arr.length / positionFactor) - numParams,
|
718
|
+
numParams * positionFactor
|
719
|
+
);
|
720
|
+
|
721
|
+
// Move to, line to or curve to?
|
722
|
+
slice[0] = other[fullLength - numParams - (i * numParams)];
|
723
|
+
|
724
|
+
// Disable first control point
|
725
|
+
if (bezier) {
|
726
|
+
slice[numParams - 6] = slice[numParams - 2];
|
727
|
+
slice[numParams - 5] = slice[numParams - 1];
|
728
|
+
}
|
729
|
+
|
730
|
+
// Now insert the slice, either in the middle (for areas) or at
|
731
|
+
// the end (for lines)
|
732
|
+
insertSlice(arr, slice, arr.length / positionFactor);
|
733
|
+
|
734
|
+
if (isArea) {
|
735
|
+
i--;
|
736
|
+
}
|
737
|
+
}
|
738
|
+
}
|
739
|
+
|
740
|
+
if (bezier) {
|
741
|
+
sixify(start);
|
742
|
+
sixify(end);
|
743
|
+
}
|
744
|
+
|
745
|
+
// For sideways animation, find out how much we need to shift to get the
|
746
|
+
// start path Xs to match the end path Xs.
|
747
|
+
if (startX && endX) {
|
748
|
+
for (i = 0; i < startX.length; i++) {
|
749
|
+
// Moving left, new points coming in on right
|
750
|
+
if (startX[i] === endX[0]) {
|
751
|
+
shift = i;
|
752
|
+
break;
|
753
|
+
// Moving right
|
754
|
+
} else if (startX[0] ===
|
755
|
+
endX[endX.length - startX.length + i]) {
|
756
|
+
shift = i;
|
757
|
+
reverse = true;
|
758
|
+
break;
|
759
|
+
}
|
760
|
+
}
|
761
|
+
if (shift === undefined) {
|
762
|
+
start = [];
|
763
|
+
}
|
764
|
+
}
|
765
|
+
|
766
|
+
if (start.length && H.isNumber(shift)) {
|
767
|
+
|
768
|
+
// The common target length for the start and end array, where both
|
769
|
+
// arrays are padded in opposite ends
|
770
|
+
fullLength = end.length + shift * positionFactor * numParams;
|
771
|
+
|
772
|
+
if (!reverse) {
|
773
|
+
prepend(end, start);
|
774
|
+
append(start, end);
|
775
|
+
} else {
|
776
|
+
prepend(start, end);
|
777
|
+
append(end, start);
|
778
|
+
}
|
779
|
+
}
|
780
|
+
|
781
|
+
return [start, end];
|
782
|
+
},
|
783
|
+
|
784
|
+
/**
|
785
|
+
* Handle animation of the color attributes directly.
|
786
|
+
*
|
787
|
+
* @function Highcharts.Fx#fillSetter
|
788
|
+
*/
|
789
|
+
fillSetter: function () {
|
790
|
+
H.Fx.prototype.strokeSetter.apply(this, arguments);
|
791
|
+
},
|
792
|
+
|
793
|
+
/**
|
794
|
+
* Handle animation of the color attributes directly.
|
795
|
+
*
|
796
|
+
* @function Highcharts.Fx#strokeSetter
|
797
|
+
*/
|
798
|
+
strokeSetter: function () {
|
799
|
+
this.elem.attr(
|
800
|
+
this.prop,
|
801
|
+
H.color(this.start).tweenTo(H.color(this.end), this.pos),
|
802
|
+
null,
|
803
|
+
true
|
804
|
+
);
|
805
|
+
}
|
806
|
+
|
807
|
+
}; // End of Fx prototype
|
808
|
+
|
809
|
+
|
810
|
+
/**
|
811
|
+
* Utility function to deep merge two or more objects and return a third object.
|
812
|
+
* The merge function can also be used with a single object argument to create a
|
813
|
+
* deep copy of an object.
|
814
|
+
*
|
815
|
+
* @function Highcharts.merge
|
816
|
+
*
|
817
|
+
* @param {*} a
|
818
|
+
* The first object to extend. When only this is given, the function
|
819
|
+
* returns a deep copy.
|
820
|
+
*
|
821
|
+
* @param {*} [n]
|
822
|
+
* An object to merge into the previous one.
|
823
|
+
*
|
824
|
+
* @return {*}
|
825
|
+
* The merged object. If the first argument is true, the return is the
|
826
|
+
* same as the second argument.
|
827
|
+
*//**
|
828
|
+
* Utility function to deep merge two or more objects and return a third object.
|
829
|
+
* If the first argument is true, the contents of the second object is copied
|
830
|
+
* into the first object. The merge function can also be used with a single
|
831
|
+
* object argument to create a deep copy of an object.
|
832
|
+
*
|
833
|
+
* @function Highcharts.merge
|
834
|
+
*
|
835
|
+
* @param {boolean} extend
|
836
|
+
* Whether to extend the left-side object (a) or return a whole new
|
837
|
+
* object.
|
838
|
+
*
|
839
|
+
* @param {*} a
|
840
|
+
* The first object to extend. When only this is given, the function
|
841
|
+
* returns a deep copy.
|
842
|
+
*
|
843
|
+
* @param {*} [n]
|
844
|
+
* An object to merge into the previous one.
|
845
|
+
*
|
846
|
+
* @return {*}
|
847
|
+
* The merged object. If the first argument is true, the return is the
|
848
|
+
* same as the second argument.
|
849
|
+
*/
|
850
|
+
H.merge = function () {
|
851
|
+
var i,
|
852
|
+
args = arguments,
|
853
|
+
len,
|
854
|
+
ret = {},
|
855
|
+
doCopy = function (copy, original) {
|
856
|
+
// An object is replacing a primitive
|
857
|
+
if (typeof copy !== 'object') {
|
858
|
+
copy = {};
|
859
|
+
}
|
860
|
+
|
861
|
+
H.objectEach(original, function (value, key) {
|
862
|
+
|
863
|
+
// Copy the contents of objects, but not arrays or DOM nodes
|
864
|
+
if (H.isObject(value, true) &&
|
865
|
+
!H.isClass(value) &&
|
866
|
+
!H.isDOMElement(value)
|
867
|
+
) {
|
868
|
+
copy[key] = doCopy(copy[key] || {}, value);
|
869
|
+
|
870
|
+
// Primitives and arrays are copied over directly
|
871
|
+
} else {
|
872
|
+
copy[key] = original[key];
|
873
|
+
}
|
874
|
+
});
|
875
|
+
return copy;
|
876
|
+
};
|
877
|
+
|
878
|
+
// If first argument is true, copy into the existing object. Used in
|
879
|
+
// setOptions.
|
880
|
+
if (args[0] === true) {
|
881
|
+
ret = args[1];
|
882
|
+
args = Array.prototype.slice.call(args, 2);
|
883
|
+
}
|
884
|
+
|
885
|
+
// For each argument, extend the return
|
886
|
+
len = args.length;
|
887
|
+
for (i = 0; i < len; i++) {
|
888
|
+
ret = doCopy(ret, args[i]);
|
889
|
+
}
|
890
|
+
|
891
|
+
return ret;
|
892
|
+
};
|
893
|
+
|
894
|
+
/**
|
895
|
+
* Shortcut for parseInt
|
896
|
+
*
|
897
|
+
* @private
|
898
|
+
* @function Highcharts.pInt
|
899
|
+
*
|
900
|
+
* @param {*} s
|
901
|
+
*
|
902
|
+
* @param {number} mag
|
903
|
+
* Magnitude
|
904
|
+
*
|
905
|
+
* @return {number}
|
906
|
+
*/
|
907
|
+
H.pInt = function (s, mag) {
|
908
|
+
return parseInt(s, mag || 10);
|
909
|
+
};
|
910
|
+
|
911
|
+
/**
|
912
|
+
* Utility function to check for string type.
|
913
|
+
*
|
914
|
+
* @function Highcharts.isString
|
915
|
+
*
|
916
|
+
* @param {*} s
|
917
|
+
* The item to check.
|
918
|
+
*
|
919
|
+
* @return {boolean}
|
920
|
+
* True if the argument is a string.
|
921
|
+
*/
|
922
|
+
H.isString = function (s) {
|
923
|
+
return typeof s === 'string';
|
924
|
+
};
|
925
|
+
|
926
|
+
/**
|
927
|
+
* Utility function to check if an item is an array.
|
928
|
+
*
|
929
|
+
* @function Highcharts.isArray
|
930
|
+
*
|
931
|
+
* @param {*} obj
|
932
|
+
* The item to check.
|
933
|
+
*
|
934
|
+
* @return {boolean}
|
935
|
+
* True if the argument is an array.
|
936
|
+
*/
|
937
|
+
H.isArray = function (obj) {
|
938
|
+
var str = Object.prototype.toString.call(obj);
|
939
|
+
|
940
|
+
return str === '[object Array]' || str === '[object Array Iterator]';
|
941
|
+
};
|
942
|
+
|
943
|
+
/**
|
944
|
+
* Utility function to check if an item is of type object.
|
945
|
+
*
|
946
|
+
* @function Highcharts.isObject
|
947
|
+
*
|
948
|
+
* @param {*} obj
|
949
|
+
* The item to check.
|
950
|
+
*
|
951
|
+
* @param {boolean} [strict=false]
|
952
|
+
* Also checks that the object is not an array.
|
953
|
+
*
|
954
|
+
* @return {boolean}
|
955
|
+
* True if the argument is an object.
|
956
|
+
*/
|
957
|
+
H.isObject = function (obj, strict) {
|
958
|
+
return !!obj && typeof obj === 'object' && (!strict || !H.isArray(obj));
|
959
|
+
};
|
960
|
+
|
961
|
+
/**
|
962
|
+
* Utility function to check if an Object is a HTML Element.
|
963
|
+
*
|
964
|
+
* @function Highcharts.isDOMElement
|
965
|
+
*
|
966
|
+
* @param {*} obj
|
967
|
+
* The item to check.
|
968
|
+
*
|
969
|
+
* @return {boolean}
|
970
|
+
* True if the argument is a HTML Element.
|
971
|
+
*/
|
972
|
+
H.isDOMElement = function (obj) {
|
973
|
+
return H.isObject(obj) && typeof obj.nodeType === 'number';
|
974
|
+
};
|
975
|
+
|
976
|
+
/**
|
977
|
+
* Utility function to check if an Object is an class.
|
978
|
+
*
|
979
|
+
* @function Highcharts.isClass
|
980
|
+
*
|
981
|
+
* @param {*} obj
|
982
|
+
* The item to check.
|
983
|
+
*
|
984
|
+
* @return {boolean}
|
985
|
+
* True if the argument is an class.
|
986
|
+
*/
|
987
|
+
H.isClass = function (obj) {
|
988
|
+
var c = obj && obj.constructor;
|
989
|
+
|
990
|
+
return !!(
|
991
|
+
H.isObject(obj, true) &&
|
992
|
+
!H.isDOMElement(obj) &&
|
993
|
+
(c && c.name && c.name !== 'Object')
|
994
|
+
);
|
995
|
+
};
|
996
|
+
|
997
|
+
/**
|
998
|
+
* Utility function to check if an item is a number and it is finite (not NaN,
|
999
|
+
* Infinity or -Infinity).
|
1000
|
+
*
|
1001
|
+
* @function Highcharts.isNumber
|
1002
|
+
*
|
1003
|
+
* @param {*} n
|
1004
|
+
* The item to check.
|
1005
|
+
*
|
1006
|
+
* @return {boolean}
|
1007
|
+
* True if the item is a finite number
|
1008
|
+
*/
|
1009
|
+
H.isNumber = function (n) {
|
1010
|
+
return typeof n === 'number' && !isNaN(n) && n < Infinity && n > -Infinity;
|
1011
|
+
};
|
1012
|
+
|
1013
|
+
/**
|
1014
|
+
* Remove the last occurence of an item from an array.
|
1015
|
+
*
|
1016
|
+
* @function Highcharts.erase
|
1017
|
+
*
|
1018
|
+
* @param {Array} arr
|
1019
|
+
* The array.
|
1020
|
+
*
|
1021
|
+
* @param {*} item
|
1022
|
+
* The item to remove.
|
1023
|
+
*/
|
1024
|
+
H.erase = function (arr, item) {
|
1025
|
+
var i = arr.length;
|
1026
|
+
|
1027
|
+
while (i--) {
|
1028
|
+
if (arr[i] === item) {
|
1029
|
+
arr.splice(i, 1);
|
1030
|
+
break;
|
1031
|
+
}
|
1032
|
+
}
|
1033
|
+
};
|
1034
|
+
|
1035
|
+
/**
|
1036
|
+
* Check if an object is null or undefined.
|
1037
|
+
*
|
1038
|
+
* @function Highcharts.defined
|
1039
|
+
*
|
1040
|
+
* @param {*} obj
|
1041
|
+
* The object to check.
|
1042
|
+
*
|
1043
|
+
* @return {boolean}
|
1044
|
+
* False if the object is null or undefined, otherwise true.
|
1045
|
+
*/
|
1046
|
+
H.defined = function (obj) {
|
1047
|
+
return obj !== undefined && obj !== null;
|
1048
|
+
};
|
1049
|
+
|
1050
|
+
/**
|
1051
|
+
* Set or get an attribute or an object of attributes. To use as a setter, pass
|
1052
|
+
* a key and a value, or let the second argument be a collection of keys and
|
1053
|
+
* values. To use as a getter, pass only a string as the second argument.
|
1054
|
+
*
|
1055
|
+
* @function Highcharts.attr
|
1056
|
+
*
|
1057
|
+
* @param {Highcharts.HTMLDOMElement|Highcharts.SVGDOMElement} elem
|
1058
|
+
* The DOM element to receive the attribute(s).
|
1059
|
+
*
|
1060
|
+
* @param {string|Highcharts.HTMLAttributes|Highcharts.SVGAttributes} [prop]
|
1061
|
+
* The property or an object of key-value pairs.
|
1062
|
+
*
|
1063
|
+
* @param {string} [value]
|
1064
|
+
* The value if a single property is set.
|
1065
|
+
*
|
1066
|
+
* @return {*}
|
1067
|
+
* When used as a getter, return the value.
|
1068
|
+
*/
|
1069
|
+
H.attr = function (elem, prop, value) {
|
1070
|
+
var ret;
|
1071
|
+
|
1072
|
+
// if the prop is a string
|
1073
|
+
if (H.isString(prop)) {
|
1074
|
+
// set the value
|
1075
|
+
if (H.defined(value)) {
|
1076
|
+
elem.setAttribute(prop, value);
|
1077
|
+
|
1078
|
+
// get the value
|
1079
|
+
} else if (elem && elem.getAttribute) {
|
1080
|
+
ret = elem.getAttribute(prop);
|
1081
|
+
|
1082
|
+
// IE7 and below cannot get class through getAttribute (#7850)
|
1083
|
+
if (!ret && prop === 'class') {
|
1084
|
+
ret = elem.getAttribute(prop + 'Name');
|
1085
|
+
}
|
1086
|
+
}
|
1087
|
+
|
1088
|
+
// else if prop is defined, it is a hash of key/value pairs
|
1089
|
+
} else if (H.defined(prop) && H.isObject(prop)) {
|
1090
|
+
H.objectEach(prop, function (val, key) {
|
1091
|
+
elem.setAttribute(key, val);
|
1092
|
+
});
|
1093
|
+
}
|
1094
|
+
return ret;
|
1095
|
+
};
|
1096
|
+
|
1097
|
+
/**
|
1098
|
+
* Check if an element is an array, and if not, make it into an array.
|
1099
|
+
*
|
1100
|
+
* @function Highcharts.splat
|
1101
|
+
*
|
1102
|
+
* @param {*} obj
|
1103
|
+
* The object to splat.
|
1104
|
+
*
|
1105
|
+
* @return {Array}
|
1106
|
+
* The produced or original array.
|
1107
|
+
*/
|
1108
|
+
H.splat = function (obj) {
|
1109
|
+
return H.isArray(obj) ? obj : [obj];
|
1110
|
+
};
|
1111
|
+
|
1112
|
+
/**
|
1113
|
+
* Set a timeout if the delay is given, otherwise perform the function
|
1114
|
+
* synchronously.
|
1115
|
+
*
|
1116
|
+
* @function Highcharts.syncTimeout
|
1117
|
+
*
|
1118
|
+
* @param {Function} fn
|
1119
|
+
* The function callback.
|
1120
|
+
*
|
1121
|
+
* @param {number} delay
|
1122
|
+
* Delay in milliseconds.
|
1123
|
+
*
|
1124
|
+
* @param {*} [parameter]
|
1125
|
+
* An optional parameter to send to the function callback.
|
1126
|
+
*
|
1127
|
+
* @return {number}
|
1128
|
+
* An identifier for the timeout that can later be cleared with
|
1129
|
+
* Highcharts.clearTimeout.
|
1130
|
+
*/
|
1131
|
+
H.syncTimeout = function (fn, delay, context) {
|
1132
|
+
if (delay) {
|
1133
|
+
return setTimeout(fn, delay, context);
|
1134
|
+
}
|
1135
|
+
fn.call(0, context);
|
1136
|
+
};
|
1137
|
+
|
1138
|
+
/**
|
1139
|
+
* Internal clear timeout. The function checks that the `id` was not removed
|
1140
|
+
* (e.g. by `chart.destroy()`). For the details see
|
1141
|
+
* [issue #7901](https://github.com/highcharts/highcharts/issues/7901).
|
1142
|
+
*
|
1143
|
+
* @function Highcharts.clearTimeout
|
1144
|
+
*
|
1145
|
+
* @param {number} id
|
1146
|
+
* Id of a timeout.
|
1147
|
+
*/
|
1148
|
+
H.clearTimeout = function (id) {
|
1149
|
+
if (H.defined(id)) {
|
1150
|
+
clearTimeout(id);
|
1151
|
+
}
|
1152
|
+
};
|
1153
|
+
|
1154
|
+
/**
|
1155
|
+
* Utility function to extend an object with the members of another.
|
1156
|
+
*
|
1157
|
+
* @function Highcharts.extend
|
1158
|
+
*
|
1159
|
+
* @param {Highcharts.Dictionary<*>} a
|
1160
|
+
* The object to be extended.
|
1161
|
+
*
|
1162
|
+
* @param {Highcharts.Dictionary<*>} b
|
1163
|
+
* The object to add to the first one.
|
1164
|
+
*
|
1165
|
+
* @return {Highcharts.Dictionary<*>}
|
1166
|
+
* Object a, the original object.
|
1167
|
+
*/
|
1168
|
+
H.extend = function (a, b) {
|
1169
|
+
var n;
|
1170
|
+
|
1171
|
+
if (!a) {
|
1172
|
+
a = {};
|
1173
|
+
}
|
1174
|
+
for (n in b) {
|
1175
|
+
a[n] = b[n];
|
1176
|
+
}
|
1177
|
+
return a;
|
1178
|
+
};
|
1179
|
+
|
1180
|
+
|
1181
|
+
/**
|
1182
|
+
* Return the first value that is not null or undefined.
|
1183
|
+
*
|
1184
|
+
* @function Highcharts.pick
|
1185
|
+
*
|
1186
|
+
* @param {...*} items
|
1187
|
+
* Variable number of arguments to inspect.
|
1188
|
+
*
|
1189
|
+
* @return {*}
|
1190
|
+
* The value of the first argument that is not null or undefined.
|
1191
|
+
*/
|
1192
|
+
H.pick = function () {
|
1193
|
+
var args = arguments,
|
1194
|
+
i,
|
1195
|
+
arg,
|
1196
|
+
length = args.length;
|
1197
|
+
|
1198
|
+
for (i = 0; i < length; i++) {
|
1199
|
+
arg = args[i];
|
1200
|
+
if (arg !== undefined && arg !== null) {
|
1201
|
+
return arg;
|
1202
|
+
}
|
1203
|
+
}
|
1204
|
+
};
|
1205
|
+
|
1206
|
+
/**
|
1207
|
+
* Set CSS on a given element.
|
1208
|
+
*
|
1209
|
+
* @function Highcharts.css
|
1210
|
+
*
|
1211
|
+
* @param {Highcharts.HTMLDOMElement} el
|
1212
|
+
* An HTML DOM element.
|
1213
|
+
*
|
1214
|
+
* @param {Highcharts.CSSObject} styles
|
1215
|
+
* Style object with camel case property names.
|
1216
|
+
*/
|
1217
|
+
H.css = function (el, styles) {
|
1218
|
+
if (H.isMS && !H.svg) { // #2686
|
1219
|
+
if (styles && styles.opacity !== undefined) {
|
1220
|
+
styles.filter = 'alpha(opacity=' + (styles.opacity * 100) + ')';
|
1221
|
+
}
|
1222
|
+
}
|
1223
|
+
H.extend(el.style, styles);
|
1224
|
+
};
|
1225
|
+
|
1226
|
+
/**
|
1227
|
+
* Utility function to create an HTML element with attributes and styles.
|
1228
|
+
*
|
1229
|
+
* @function Highcharts.createElement
|
1230
|
+
*
|
1231
|
+
* @param {string} tag
|
1232
|
+
* The HTML tag.
|
1233
|
+
*
|
1234
|
+
* @param {Highcharts.HTMLAttributes} [attribs]
|
1235
|
+
* Attributes as an object of key-value pairs.
|
1236
|
+
*
|
1237
|
+
* @param {Highcharts.CSSObject} [styles]
|
1238
|
+
* Styles as an object of key-value pairs.
|
1239
|
+
*
|
1240
|
+
* @param {Highcharts.HTMLDOMElement} [parent]
|
1241
|
+
* The parent HTML object.
|
1242
|
+
*
|
1243
|
+
* @param {boolean} [nopad=false]
|
1244
|
+
* If true, remove all padding, border and margin.
|
1245
|
+
*
|
1246
|
+
* @return {Highcharts.HTMLDOMElement}
|
1247
|
+
* The created DOM element.
|
1248
|
+
*/
|
1249
|
+
H.createElement = function (tag, attribs, styles, parent, nopad) {
|
1250
|
+
var el = doc.createElement(tag),
|
1251
|
+
css = H.css;
|
1252
|
+
|
1253
|
+
if (attribs) {
|
1254
|
+
H.extend(el, attribs);
|
1255
|
+
}
|
1256
|
+
if (nopad) {
|
1257
|
+
css(el, { padding: 0, border: 'none', margin: 0 });
|
1258
|
+
}
|
1259
|
+
if (styles) {
|
1260
|
+
css(el, styles);
|
1261
|
+
}
|
1262
|
+
if (parent) {
|
1263
|
+
parent.appendChild(el);
|
1264
|
+
}
|
1265
|
+
return el;
|
1266
|
+
};
|
1267
|
+
|
1268
|
+
/**
|
1269
|
+
* Extend a prototyped class by new members.
|
1270
|
+
*
|
1271
|
+
* @function Highcharts.extendClass
|
1272
|
+
*
|
1273
|
+
* @param {*} parent
|
1274
|
+
* The parent prototype to inherit.
|
1275
|
+
*
|
1276
|
+
* @param {Highcharts.Dictionary<*>} members
|
1277
|
+
* A collection of prototype members to add or override compared to the
|
1278
|
+
* parent prototype.
|
1279
|
+
*
|
1280
|
+
* @return {*}
|
1281
|
+
* A new prototype.
|
1282
|
+
*/
|
1283
|
+
H.extendClass = function (parent, members) {
|
1284
|
+
var object = function () {};
|
1285
|
+
|
1286
|
+
object.prototype = new parent(); // eslint-disable-line new-cap
|
1287
|
+
H.extend(object.prototype, members);
|
1288
|
+
return object;
|
1289
|
+
};
|
1290
|
+
|
1291
|
+
/**
|
1292
|
+
* Left-pad a string to a given length by adding a character repetetively.
|
1293
|
+
*
|
1294
|
+
* @function Highcharts.pad
|
1295
|
+
*
|
1296
|
+
* @param {number} number
|
1297
|
+
* The input string or number.
|
1298
|
+
*
|
1299
|
+
* @param {number} length
|
1300
|
+
* The desired string length.
|
1301
|
+
*
|
1302
|
+
* @param {string} [padder=0]
|
1303
|
+
* The character to pad with.
|
1304
|
+
*
|
1305
|
+
* @return {string}
|
1306
|
+
* The padded string.
|
1307
|
+
*/
|
1308
|
+
H.pad = function (number, length, padder) {
|
1309
|
+
return new Array(
|
1310
|
+
(length || 2) +
|
1311
|
+
1 -
|
1312
|
+
String(number)
|
1313
|
+
.replace('-', '')
|
1314
|
+
.length
|
1315
|
+
).join(padder || 0) + number;
|
1316
|
+
};
|
1317
|
+
|
1318
|
+
/**
|
1319
|
+
* Return a length based on either the integer value, or a percentage of a base.
|
1320
|
+
*
|
1321
|
+
* @function Highcharts.relativeLength
|
1322
|
+
*
|
1323
|
+
* @param {Highcharts.RelativeSize} value
|
1324
|
+
* A percentage string or a number.
|
1325
|
+
*
|
1326
|
+
* @param {number} base
|
1327
|
+
* The full length that represents 100%.
|
1328
|
+
*
|
1329
|
+
* @param {number} [offset=0]
|
1330
|
+
* A pixel offset to apply for percentage values. Used internally in
|
1331
|
+
* axis positioning.
|
1332
|
+
*
|
1333
|
+
* @return {number}
|
1334
|
+
* The computed length.
|
1335
|
+
*/
|
1336
|
+
H.relativeLength = function (value, base, offset) {
|
1337
|
+
return (/%$/).test(value) ?
|
1338
|
+
(base * parseFloat(value) / 100) + (offset || 0) :
|
1339
|
+
parseFloat(value);
|
1340
|
+
};
|
1341
|
+
|
1342
|
+
/**
|
1343
|
+
* Wrap a method with extended functionality, preserving the original function.
|
1344
|
+
*
|
1345
|
+
* @function Highcharts.wrap
|
1346
|
+
*
|
1347
|
+
* @param {*} obj
|
1348
|
+
* The context object that the method belongs to. In real cases, this is
|
1349
|
+
* often a prototype.
|
1350
|
+
*
|
1351
|
+
* @param {string} method
|
1352
|
+
* The name of the method to extend.
|
1353
|
+
*
|
1354
|
+
* @param {Function} func
|
1355
|
+
* A wrapper function callback. This function is called with the same
|
1356
|
+
* arguments as the original function, except that the original function
|
1357
|
+
* is unshifted and passed as the first argument.
|
1358
|
+
*/
|
1359
|
+
H.wrap = function (obj, method, func) {
|
1360
|
+
var proceed = obj[method];
|
1361
|
+
|
1362
|
+
obj[method] = function () {
|
1363
|
+
var args = Array.prototype.slice.call(arguments),
|
1364
|
+
outerArgs = arguments,
|
1365
|
+
ctx = this,
|
1366
|
+
ret;
|
1367
|
+
|
1368
|
+
ctx.proceed = function () {
|
1369
|
+
proceed.apply(ctx, arguments.length ? arguments : outerArgs);
|
1370
|
+
};
|
1371
|
+
args.unshift(proceed);
|
1372
|
+
ret = func.apply(this, args);
|
1373
|
+
ctx.proceed = null;
|
1374
|
+
return ret;
|
1375
|
+
};
|
1376
|
+
};
|
1377
|
+
|
1378
|
+
|
1379
|
+
/**
|
1380
|
+
* Recursively converts all Date properties to timestamps.
|
1381
|
+
*
|
1382
|
+
* @param {Object} object - any object to convert properties of
|
1383
|
+
*/
|
1384
|
+
H.datePropsToTimestamps = function (object) {
|
1385
|
+
H.objectEach(object, function (val, key) {
|
1386
|
+
if (H.isObject(val) && typeof val.getTime === 'function') {
|
1387
|
+
object[key] = val.getTime();
|
1388
|
+
} else if (H.isObject(val) || H.isArray(val)) {
|
1389
|
+
H.datePropsToTimestamps(val);
|
1390
|
+
}
|
1391
|
+
});
|
1392
|
+
};
|
1393
|
+
|
1394
|
+
/**
|
1395
|
+
* Format a single variable. Similar to sprintf, without the % prefix.
|
1396
|
+
*
|
1397
|
+
* @example
|
1398
|
+
* formatSingle('.2f', 5); // => '5.00'.
|
1399
|
+
*
|
1400
|
+
* @function Highcharts.formatSingle
|
1401
|
+
*
|
1402
|
+
* @param {string} format
|
1403
|
+
* The format string.
|
1404
|
+
*
|
1405
|
+
* @param {*} val
|
1406
|
+
* The value.
|
1407
|
+
*
|
1408
|
+
* @param {Highcharts.Time} [time]
|
1409
|
+
* A `Time` instance that determines the date formatting, for example
|
1410
|
+
* for applying time zone corrections to the formatted date.
|
1411
|
+
*
|
1412
|
+
* @return {string}
|
1413
|
+
* The formatted representation of the value.
|
1414
|
+
*/
|
1415
|
+
H.formatSingle = function (format, val, time) {
|
1416
|
+
var floatRegex = /f$/,
|
1417
|
+
decRegex = /\.([0-9])/,
|
1418
|
+
lang = H.defaultOptions.lang,
|
1419
|
+
decimals;
|
1420
|
+
|
1421
|
+
if (floatRegex.test(format)) { // float
|
1422
|
+
decimals = format.match(decRegex);
|
1423
|
+
decimals = decimals ? decimals[1] : -1;
|
1424
|
+
if (val !== null) {
|
1425
|
+
val = H.numberFormat(
|
1426
|
+
val,
|
1427
|
+
decimals,
|
1428
|
+
lang.decimalPoint,
|
1429
|
+
format.indexOf(',') > -1 ? lang.thousandsSep : ''
|
1430
|
+
);
|
1431
|
+
}
|
1432
|
+
} else {
|
1433
|
+
val = (time || H.time).dateFormat(format, val);
|
1434
|
+
}
|
1435
|
+
return val;
|
1436
|
+
};
|
1437
|
+
|
1438
|
+
/**
|
1439
|
+
* Format a string according to a subset of the rules of Python's String.format
|
1440
|
+
* method.
|
1441
|
+
*
|
1442
|
+
* @example
|
1443
|
+
* var s = Highcharts.format(
|
1444
|
+
* 'The {color} fox was {len:.2f} feet long',
|
1445
|
+
* { color: 'red', len: Math.PI }
|
1446
|
+
* );
|
1447
|
+
* // => The red fox was 3.14 feet long
|
1448
|
+
*
|
1449
|
+
* @function Highcharts.format
|
1450
|
+
*
|
1451
|
+
* @param {string} str
|
1452
|
+
* The string to format.
|
1453
|
+
*
|
1454
|
+
* @param {*} ctx
|
1455
|
+
* The context, a collection of key-value pairs where each key is
|
1456
|
+
* replaced by its value.
|
1457
|
+
*
|
1458
|
+
* @param {Highcharts.Time} [time]
|
1459
|
+
* A `Time` instance that determines the date formatting, for example
|
1460
|
+
* for applying time zone corrections to the formatted date.
|
1461
|
+
*
|
1462
|
+
* @return {string}
|
1463
|
+
* The formatted string.
|
1464
|
+
*/
|
1465
|
+
H.format = function (str, ctx, time) {
|
1466
|
+
var splitter = '{',
|
1467
|
+
isInside = false,
|
1468
|
+
segment,
|
1469
|
+
valueAndFormat,
|
1470
|
+
path,
|
1471
|
+
i,
|
1472
|
+
len,
|
1473
|
+
ret = [],
|
1474
|
+
val,
|
1475
|
+
index;
|
1476
|
+
|
1477
|
+
while (str) {
|
1478
|
+
index = str.indexOf(splitter);
|
1479
|
+
if (index === -1) {
|
1480
|
+
break;
|
1481
|
+
}
|
1482
|
+
|
1483
|
+
segment = str.slice(0, index);
|
1484
|
+
if (isInside) { // we're on the closing bracket looking back
|
1485
|
+
|
1486
|
+
valueAndFormat = segment.split(':');
|
1487
|
+
path = valueAndFormat.shift().split('.'); // get first and leave
|
1488
|
+
len = path.length;
|
1489
|
+
val = ctx;
|
1490
|
+
|
1491
|
+
// Assign deeper paths
|
1492
|
+
for (i = 0; i < len; i++) {
|
1493
|
+
if (val) {
|
1494
|
+
val = val[path[i]];
|
1495
|
+
}
|
1496
|
+
}
|
1497
|
+
|
1498
|
+
// Format the replacement
|
1499
|
+
if (valueAndFormat.length) {
|
1500
|
+
val = H.formatSingle(valueAndFormat.join(':'), val, time);
|
1501
|
+
}
|
1502
|
+
|
1503
|
+
// Push the result and advance the cursor
|
1504
|
+
ret.push(val);
|
1505
|
+
|
1506
|
+
} else {
|
1507
|
+
ret.push(segment);
|
1508
|
+
|
1509
|
+
}
|
1510
|
+
str = str.slice(index + 1); // the rest
|
1511
|
+
isInside = !isInside; // toggle
|
1512
|
+
splitter = isInside ? '}' : '{'; // now look for next matching bracket
|
1513
|
+
}
|
1514
|
+
ret.push(str);
|
1515
|
+
return ret.join('');
|
1516
|
+
};
|
1517
|
+
|
1518
|
+
/**
|
1519
|
+
* Get the magnitude of a number.
|
1520
|
+
*
|
1521
|
+
* @function Highcharts.getMagnitude
|
1522
|
+
*
|
1523
|
+
* @param {number} number
|
1524
|
+
* The number.
|
1525
|
+
*
|
1526
|
+
* @return {number}
|
1527
|
+
* The magnitude, where 1-9 are magnitude 1, 10-99 magnitude 2 etc.
|
1528
|
+
*/
|
1529
|
+
H.getMagnitude = function (num) {
|
1530
|
+
return Math.pow(10, Math.floor(Math.log(num) / Math.LN10));
|
1531
|
+
};
|
1532
|
+
|
1533
|
+
/**
|
1534
|
+
* Take an interval and normalize it to multiples of round numbers.
|
1535
|
+
*
|
1536
|
+
* @deprecated
|
1537
|
+
* @function Highcharts.normalizeTickInterval
|
1538
|
+
*
|
1539
|
+
* @param {number} interval
|
1540
|
+
* The raw, un-rounded interval.
|
1541
|
+
*
|
1542
|
+
* @param {Array} [multiples]
|
1543
|
+
* Allowed multiples.
|
1544
|
+
*
|
1545
|
+
* @param {number} [magnitude]
|
1546
|
+
* The magnitude of the number.
|
1547
|
+
*
|
1548
|
+
* @param {boolean} [allowDecimals]
|
1549
|
+
* Whether to allow decimals.
|
1550
|
+
*
|
1551
|
+
* @param {boolean} [hasTickAmount]
|
1552
|
+
* If it has tickAmount, avoid landing on tick intervals lower than
|
1553
|
+
* original.
|
1554
|
+
*
|
1555
|
+
* @return {number}
|
1556
|
+
* The normalized interval.
|
1557
|
+
*
|
1558
|
+
* @todo
|
1559
|
+
* Move this function to the Axis prototype. It is here only for historical
|
1560
|
+
* reasons.
|
1561
|
+
*/
|
1562
|
+
H.normalizeTickInterval = function (
|
1563
|
+
interval,
|
1564
|
+
multiples,
|
1565
|
+
magnitude,
|
1566
|
+
allowDecimals,
|
1567
|
+
hasTickAmount
|
1568
|
+
) {
|
1569
|
+
var normalized,
|
1570
|
+
i,
|
1571
|
+
retInterval = interval;
|
1572
|
+
|
1573
|
+
// round to a tenfold of 1, 2, 2.5 or 5
|
1574
|
+
magnitude = H.pick(magnitude, 1);
|
1575
|
+
normalized = interval / magnitude;
|
1576
|
+
|
1577
|
+
// multiples for a linear scale
|
1578
|
+
if (!multiples) {
|
1579
|
+
multiples = hasTickAmount ?
|
1580
|
+
// Finer grained ticks when the tick amount is hard set, including
|
1581
|
+
// when alignTicks is true on multiple axes (#4580).
|
1582
|
+
[1, 1.2, 1.5, 2, 2.5, 3, 4, 5, 6, 8, 10] :
|
1583
|
+
|
1584
|
+
// Else, let ticks fall on rounder numbers
|
1585
|
+
[1, 2, 2.5, 5, 10];
|
1586
|
+
|
1587
|
+
|
1588
|
+
// the allowDecimals option
|
1589
|
+
if (allowDecimals === false) {
|
1590
|
+
if (magnitude === 1) {
|
1591
|
+
multiples = multiples.filter(function (num) {
|
1592
|
+
return num % 1 === 0;
|
1593
|
+
});
|
1594
|
+
} else if (magnitude <= 0.1) {
|
1595
|
+
multiples = [1 / magnitude];
|
1596
|
+
}
|
1597
|
+
}
|
1598
|
+
}
|
1599
|
+
|
1600
|
+
// normalize the interval to the nearest multiple
|
1601
|
+
for (i = 0; i < multiples.length; i++) {
|
1602
|
+
retInterval = multiples[i];
|
1603
|
+
// only allow tick amounts smaller than natural
|
1604
|
+
if (
|
1605
|
+
(
|
1606
|
+
hasTickAmount &&
|
1607
|
+
retInterval * magnitude >= interval
|
1608
|
+
) ||
|
1609
|
+
(
|
1610
|
+
!hasTickAmount &&
|
1611
|
+
(
|
1612
|
+
normalized <=
|
1613
|
+
(
|
1614
|
+
multiples[i] +
|
1615
|
+
(multiples[i + 1] || multiples[i])
|
1616
|
+
) / 2
|
1617
|
+
)
|
1618
|
+
)
|
1619
|
+
) {
|
1620
|
+
break;
|
1621
|
+
}
|
1622
|
+
}
|
1623
|
+
|
1624
|
+
// Multiply back to the correct magnitude. Correct floats to appropriate
|
1625
|
+
// precision (#6085).
|
1626
|
+
retInterval = H.correctFloat(
|
1627
|
+
retInterval * magnitude,
|
1628
|
+
-Math.round(Math.log(0.001) / Math.LN10)
|
1629
|
+
);
|
1630
|
+
|
1631
|
+
return retInterval;
|
1632
|
+
};
|
1633
|
+
|
1634
|
+
|
1635
|
+
/**
|
1636
|
+
* Sort an object array and keep the order of equal items. The ECMAScript
|
1637
|
+
* standard does not specify the behaviour when items are equal.
|
1638
|
+
*
|
1639
|
+
* @function Highcharts.stableSort
|
1640
|
+
*
|
1641
|
+
* @param {Array} arr
|
1642
|
+
* The array to sort.
|
1643
|
+
*
|
1644
|
+
* @param {Function} sortFunction
|
1645
|
+
* The function to sort it with, like with regular Array.prototype.sort.
|
1646
|
+
*/
|
1647
|
+
H.stableSort = function (arr, sortFunction) {
|
1648
|
+
|
1649
|
+
// @todo It seems like Chrome since v70 sorts in a stable way internally,
|
1650
|
+
// plus all other browsers do it, so over time we may be able to remove this
|
1651
|
+
// function
|
1652
|
+
var length = arr.length,
|
1653
|
+
sortValue,
|
1654
|
+
i;
|
1655
|
+
|
1656
|
+
// Add index to each item
|
1657
|
+
for (i = 0; i < length; i++) {
|
1658
|
+
arr[i].safeI = i; // stable sort index
|
1659
|
+
}
|
1660
|
+
|
1661
|
+
arr.sort(function (a, b) {
|
1662
|
+
sortValue = sortFunction(a, b);
|
1663
|
+
return sortValue === 0 ? a.safeI - b.safeI : sortValue;
|
1664
|
+
});
|
1665
|
+
|
1666
|
+
// Remove index from items
|
1667
|
+
for (i = 0; i < length; i++) {
|
1668
|
+
delete arr[i].safeI; // stable sort index
|
1669
|
+
}
|
1670
|
+
};
|
1671
|
+
|
1672
|
+
/**
|
1673
|
+
* Non-recursive method to find the lowest member of an array. `Math.min` raises
|
1674
|
+
* a maximum call stack size exceeded error in Chrome when trying to apply more
|
1675
|
+
* than 150.000 points. This method is slightly slower, but safe.
|
1676
|
+
*
|
1677
|
+
* @function Highcharts.arrayMin
|
1678
|
+
*
|
1679
|
+
* @param {Array} data
|
1680
|
+
* An array of numbers.
|
1681
|
+
*
|
1682
|
+
* @return {number}
|
1683
|
+
* The lowest number.
|
1684
|
+
*/
|
1685
|
+
H.arrayMin = function (data) {
|
1686
|
+
var i = data.length,
|
1687
|
+
min = data[0];
|
1688
|
+
|
1689
|
+
while (i--) {
|
1690
|
+
if (data[i] < min) {
|
1691
|
+
min = data[i];
|
1692
|
+
}
|
1693
|
+
}
|
1694
|
+
return min;
|
1695
|
+
};
|
1696
|
+
|
1697
|
+
/**
|
1698
|
+
* Non-recursive method to find the lowest member of an array. `Math.max` raises
|
1699
|
+
* a maximum call stack size exceeded error in Chrome when trying to apply more
|
1700
|
+
* than 150.000 points. This method is slightly slower, but safe.
|
1701
|
+
*
|
1702
|
+
* @function Highcharts.arrayMax
|
1703
|
+
*
|
1704
|
+
* @param {Array} data
|
1705
|
+
* An array of numbers.
|
1706
|
+
*
|
1707
|
+
* @return {number}
|
1708
|
+
* The highest number.
|
1709
|
+
*/
|
1710
|
+
H.arrayMax = function (data) {
|
1711
|
+
var i = data.length,
|
1712
|
+
max = data[0];
|
1713
|
+
|
1714
|
+
while (i--) {
|
1715
|
+
if (data[i] > max) {
|
1716
|
+
max = data[i];
|
1717
|
+
}
|
1718
|
+
}
|
1719
|
+
return max;
|
1720
|
+
};
|
1721
|
+
|
1722
|
+
/**
|
1723
|
+
* Utility method that destroys any SVGElement instances that are properties on
|
1724
|
+
* the given object. It loops all properties and invokes destroy if there is a
|
1725
|
+
* destroy method. The property is then delete.
|
1726
|
+
*
|
1727
|
+
* @function Highcharts.destroyObjectProperties
|
1728
|
+
*
|
1729
|
+
* @param {*} obj
|
1730
|
+
* The object to destroy properties on.
|
1731
|
+
*
|
1732
|
+
* @param {*} [except]
|
1733
|
+
* Exception, do not destroy this property, only delete it.
|
1734
|
+
*/
|
1735
|
+
H.destroyObjectProperties = function (obj, except) {
|
1736
|
+
H.objectEach(obj, function (val, n) {
|
1737
|
+
// If the object is non-null and destroy is defined
|
1738
|
+
if (val && val !== except && val.destroy) {
|
1739
|
+
// Invoke the destroy
|
1740
|
+
val.destroy();
|
1741
|
+
}
|
1742
|
+
|
1743
|
+
// Delete the property from the object.
|
1744
|
+
delete obj[n];
|
1745
|
+
});
|
1746
|
+
};
|
1747
|
+
|
1748
|
+
|
1749
|
+
/**
|
1750
|
+
* Discard a HTML element by moving it to the bin and delete.
|
1751
|
+
*
|
1752
|
+
* @function Highcharts.discardElement
|
1753
|
+
*
|
1754
|
+
* @param {Highcharts.HTMLDOMElement} element
|
1755
|
+
* The HTML node to discard.
|
1756
|
+
*/
|
1757
|
+
H.discardElement = function (element) {
|
1758
|
+
var garbageBin = H.garbageBin;
|
1759
|
+
|
1760
|
+
// create a garbage bin element, not part of the DOM
|
1761
|
+
if (!garbageBin) {
|
1762
|
+
garbageBin = H.createElement('div');
|
1763
|
+
}
|
1764
|
+
|
1765
|
+
// move the node and empty bin
|
1766
|
+
if (element) {
|
1767
|
+
garbageBin.appendChild(element);
|
1768
|
+
}
|
1769
|
+
garbageBin.innerHTML = '';
|
1770
|
+
};
|
1771
|
+
|
1772
|
+
/**
|
1773
|
+
* Fix JS round off float errors.
|
1774
|
+
*
|
1775
|
+
* @function Highcharts.correctFloat
|
1776
|
+
*
|
1777
|
+
* @param {number} num
|
1778
|
+
* A float number to fix.
|
1779
|
+
*
|
1780
|
+
* @param {number} [prec=14]
|
1781
|
+
* The precision.
|
1782
|
+
*
|
1783
|
+
* @return {number}
|
1784
|
+
* The corrected float number.
|
1785
|
+
*/
|
1786
|
+
H.correctFloat = function (num, prec) {
|
1787
|
+
return parseFloat(
|
1788
|
+
num.toPrecision(prec || 14)
|
1789
|
+
);
|
1790
|
+
};
|
1791
|
+
|
1792
|
+
/**
|
1793
|
+
* Set the global animation to either a given value, or fall back to the given
|
1794
|
+
* chart's animation option.
|
1795
|
+
*
|
1796
|
+
* @function Highcharts.setAnimation
|
1797
|
+
*
|
1798
|
+
* @param {boolean|Highcharts.AnimationOptionsObject} animation
|
1799
|
+
* The animation object.
|
1800
|
+
*
|
1801
|
+
* @param {Highcharts.Chart} chart
|
1802
|
+
* The chart instance.
|
1803
|
+
*
|
1804
|
+
* @todo
|
1805
|
+
* This function always relates to a chart, and sets a property on the renderer,
|
1806
|
+
* so it should be moved to the SVGRenderer.
|
1807
|
+
*/
|
1808
|
+
H.setAnimation = function (animation, chart) {
|
1809
|
+
chart.renderer.globalAnimation = H.pick(
|
1810
|
+
animation,
|
1811
|
+
chart.options.chart.animation,
|
1812
|
+
true
|
1813
|
+
);
|
1814
|
+
};
|
1815
|
+
|
1816
|
+
/**
|
1817
|
+
* Get the animation in object form, where a disabled animation is always
|
1818
|
+
* returned as `{ duration: 0 }`.
|
1819
|
+
*
|
1820
|
+
* @function Highcharts.animObject
|
1821
|
+
*
|
1822
|
+
* @param {boolean|Highcharts.AnimationOptionsObject} animation
|
1823
|
+
* An animation setting. Can be an object with duration, complete and
|
1824
|
+
* easing properties, or a boolean to enable or disable.
|
1825
|
+
*
|
1826
|
+
* @return {Highcharts.AnimationOptionsObject}
|
1827
|
+
* An object with at least a duration property.
|
1828
|
+
*/
|
1829
|
+
H.animObject = function (animation) {
|
1830
|
+
return H.isObject(animation) ?
|
1831
|
+
H.merge(animation) :
|
1832
|
+
{ duration: animation ? 500 : 0 };
|
1833
|
+
};
|
1834
|
+
|
1835
|
+
/**
|
1836
|
+
* The time unit lookup
|
1837
|
+
*
|
1838
|
+
* @ignore
|
1839
|
+
*/
|
1840
|
+
H.timeUnits = {
|
1841
|
+
millisecond: 1,
|
1842
|
+
second: 1000,
|
1843
|
+
minute: 60000,
|
1844
|
+
hour: 3600000,
|
1845
|
+
day: 24 * 3600000,
|
1846
|
+
week: 7 * 24 * 3600000,
|
1847
|
+
month: 28 * 24 * 3600000,
|
1848
|
+
year: 364 * 24 * 3600000
|
1849
|
+
};
|
1850
|
+
|
1851
|
+
/**
|
1852
|
+
* Format a number and return a string based on input settings.
|
1853
|
+
*
|
1854
|
+
* @sample highcharts/members/highcharts-numberformat/
|
1855
|
+
* Custom number format
|
1856
|
+
*
|
1857
|
+
* @function Highcharts.numberFormat
|
1858
|
+
*
|
1859
|
+
* @param {number} number
|
1860
|
+
* The input number to format.
|
1861
|
+
*
|
1862
|
+
* @param {number} decimals
|
1863
|
+
* The amount of decimals. A value of -1 preserves the amount in the
|
1864
|
+
* input number.
|
1865
|
+
*
|
1866
|
+
* @param {string} [decimalPoint]
|
1867
|
+
* The decimal point, defaults to the one given in the lang options, or
|
1868
|
+
* a dot.
|
1869
|
+
*
|
1870
|
+
* @param {string} [thousandsSep]
|
1871
|
+
* The thousands separator, defaults to the one given in the lang
|
1872
|
+
* options, or a space character.
|
1873
|
+
*
|
1874
|
+
* @return {string}
|
1875
|
+
* The formatted number.
|
1876
|
+
*/
|
1877
|
+
H.numberFormat = function (number, decimals, decimalPoint, thousandsSep) {
|
1878
|
+
number = +number || 0;
|
1879
|
+
decimals = +decimals;
|
1880
|
+
|
1881
|
+
var lang = H.defaultOptions.lang,
|
1882
|
+
origDec = (number.toString().split('.')[1] || '').split('e')[0].length,
|
1883
|
+
strinteger,
|
1884
|
+
thousands,
|
1885
|
+
ret,
|
1886
|
+
roundedNumber,
|
1887
|
+
exponent = number.toString().split('e'),
|
1888
|
+
fractionDigits;
|
1889
|
+
|
1890
|
+
if (decimals === -1) {
|
1891
|
+
// Preserve decimals. Not huge numbers (#3793).
|
1892
|
+
decimals = Math.min(origDec, 20);
|
1893
|
+
} else if (!H.isNumber(decimals)) {
|
1894
|
+
decimals = 2;
|
1895
|
+
} else if (decimals && exponent[1] && exponent[1] < 0) {
|
1896
|
+
// Expose decimals from exponential notation (#7042)
|
1897
|
+
fractionDigits = decimals + +exponent[1];
|
1898
|
+
if (fractionDigits >= 0) {
|
1899
|
+
// remove too small part of the number while keeping the notation
|
1900
|
+
exponent[0] = (+exponent[0]).toExponential(fractionDigits)
|
1901
|
+
.split('e')[0];
|
1902
|
+
decimals = fractionDigits;
|
1903
|
+
} else {
|
1904
|
+
// fractionDigits < 0
|
1905
|
+
exponent[0] = exponent[0].split('.')[0] || 0;
|
1906
|
+
|
1907
|
+
if (decimals < 20) {
|
1908
|
+
// use number instead of exponential notation (#7405)
|
1909
|
+
number = (exponent[0] * Math.pow(10, exponent[1]))
|
1910
|
+
.toFixed(decimals);
|
1911
|
+
} else {
|
1912
|
+
// or zero
|
1913
|
+
number = 0;
|
1914
|
+
}
|
1915
|
+
exponent[1] = 0;
|
1916
|
+
}
|
1917
|
+
}
|
1918
|
+
|
1919
|
+
// Add another decimal to avoid rounding errors of float numbers. (#4573)
|
1920
|
+
// Then use toFixed to handle rounding.
|
1921
|
+
roundedNumber = (
|
1922
|
+
Math.abs(exponent[1] ? exponent[0] : number) +
|
1923
|
+
Math.pow(10, -Math.max(decimals, origDec) - 1)
|
1924
|
+
).toFixed(decimals);
|
1925
|
+
|
1926
|
+
// A string containing the positive integer component of the number
|
1927
|
+
strinteger = String(H.pInt(roundedNumber));
|
1928
|
+
|
1929
|
+
// Leftover after grouping into thousands. Can be 0, 1 or 2.
|
1930
|
+
thousands = strinteger.length > 3 ? strinteger.length % 3 : 0;
|
1931
|
+
|
1932
|
+
// Language
|
1933
|
+
decimalPoint = H.pick(decimalPoint, lang.decimalPoint);
|
1934
|
+
thousandsSep = H.pick(thousandsSep, lang.thousandsSep);
|
1935
|
+
|
1936
|
+
// Start building the return
|
1937
|
+
ret = number < 0 ? '-' : '';
|
1938
|
+
|
1939
|
+
// Add the leftover after grouping into thousands. For example, in the
|
1940
|
+
// number 42 000 000, this line adds 42.
|
1941
|
+
ret += thousands ? strinteger.substr(0, thousands) + thousandsSep : '';
|
1942
|
+
|
1943
|
+
// Add the remaining thousands groups, joined by the thousands separator
|
1944
|
+
ret += strinteger
|
1945
|
+
.substr(thousands)
|
1946
|
+
.replace(/(\d{3})(?=\d)/g, '$1' + thousandsSep);
|
1947
|
+
|
1948
|
+
// Add the decimal point and the decimal component
|
1949
|
+
if (decimals) {
|
1950
|
+
// Get the decimal component
|
1951
|
+
ret += decimalPoint + roundedNumber.slice(-decimals);
|
1952
|
+
}
|
1953
|
+
|
1954
|
+
if (exponent[1] && +ret !== 0) {
|
1955
|
+
ret += 'e' + exponent[1];
|
1956
|
+
}
|
1957
|
+
|
1958
|
+
return ret;
|
1959
|
+
};
|
1960
|
+
|
1961
|
+
/**
|
1962
|
+
* Easing definition
|
1963
|
+
*
|
1964
|
+
* @private
|
1965
|
+
* @function Math.easeInOutSine
|
1966
|
+
*
|
1967
|
+
* @param {number} pos
|
1968
|
+
* Current position, ranging from 0 to 1.
|
1969
|
+
*
|
1970
|
+
* @return {number}
|
1971
|
+
*/
|
1972
|
+
Math.easeInOutSine = function (pos) {
|
1973
|
+
return -0.5 * (Math.cos(Math.PI * pos) - 1);
|
1974
|
+
};
|
1975
|
+
|
1976
|
+
/**
|
1977
|
+
* Get the computed CSS value for given element and property, only for numerical
|
1978
|
+
* properties. For width and height, the dimension of the inner box (excluding
|
1979
|
+
* padding) is returned. Used for fitting the chart within the container.
|
1980
|
+
*
|
1981
|
+
* @function Highcharts.getStyle
|
1982
|
+
*
|
1983
|
+
* @param {Highcharts.HTMLDOMElement} el
|
1984
|
+
* An HTML element.
|
1985
|
+
*
|
1986
|
+
* @param {string} prop
|
1987
|
+
* The property name.
|
1988
|
+
*
|
1989
|
+
* @param {boolean} [toInt=true]
|
1990
|
+
* Parse to integer.
|
1991
|
+
*
|
1992
|
+
* @return {number}
|
1993
|
+
* The numeric value.
|
1994
|
+
*/
|
1995
|
+
H.getStyle = function (el, prop, toInt) {
|
1996
|
+
|
1997
|
+
var style;
|
1998
|
+
|
1999
|
+
// For width and height, return the actual inner pixel size (#4913)
|
2000
|
+
if (prop === 'width') {
|
2001
|
+
return Math.max(
|
2002
|
+
0, // #8377
|
2003
|
+
(
|
2004
|
+
Math.min(
|
2005
|
+
el.offsetWidth,
|
2006
|
+
el.scrollWidth,
|
2007
|
+
(
|
2008
|
+
el.getBoundingClientRect &&
|
2009
|
+
// #9871, getBoundingClientRect doesn't handle
|
2010
|
+
// transforms, so avoid that
|
2011
|
+
H.getStyle(el, 'transform', false) === 'none'
|
2012
|
+
) ?
|
2013
|
+
Math.floor(el.getBoundingClientRect().width) : // #6427
|
2014
|
+
Infinity
|
2015
|
+
) -
|
2016
|
+
H.getStyle(el, 'padding-left') -
|
2017
|
+
H.getStyle(el, 'padding-right')
|
2018
|
+
)
|
2019
|
+
);
|
2020
|
+
}
|
2021
|
+
|
2022
|
+
if (prop === 'height') {
|
2023
|
+
return Math.max(
|
2024
|
+
0, // #8377
|
2025
|
+
Math.min(el.offsetHeight, el.scrollHeight) -
|
2026
|
+
H.getStyle(el, 'padding-top') -
|
2027
|
+
H.getStyle(el, 'padding-bottom')
|
2028
|
+
);
|
2029
|
+
}
|
2030
|
+
|
2031
|
+
if (!win.getComputedStyle) {
|
2032
|
+
// SVG not supported, forgot to load oldie.js?
|
2033
|
+
H.error(27, true);
|
2034
|
+
}
|
2035
|
+
|
2036
|
+
// Otherwise, get the computed style
|
2037
|
+
style = win.getComputedStyle(el, undefined);
|
2038
|
+
if (style) {
|
2039
|
+
style = style.getPropertyValue(prop);
|
2040
|
+
if (H.pick(toInt, prop !== 'opacity')) {
|
2041
|
+
style = H.pInt(style);
|
2042
|
+
}
|
2043
|
+
}
|
2044
|
+
return style;
|
2045
|
+
};
|
2046
|
+
|
2047
|
+
/**
|
2048
|
+
* Search for an item in an array.
|
2049
|
+
*
|
2050
|
+
* @function Highcharts.inArray
|
2051
|
+
*
|
2052
|
+
* @deprecated
|
2053
|
+
*
|
2054
|
+
* @param {*} item
|
2055
|
+
* The item to search for.
|
2056
|
+
*
|
2057
|
+
* @param {Array} arr
|
2058
|
+
* The array or node collection to search in.
|
2059
|
+
*
|
2060
|
+
* @param {number} [fromIndex=0]
|
2061
|
+
* The index to start searching from.
|
2062
|
+
*
|
2063
|
+
* @return {number}
|
2064
|
+
* The index within the array, or -1 if not found.
|
2065
|
+
*/
|
2066
|
+
H.inArray = function (item, arr, fromIndex) {
|
2067
|
+
return arr.indexOf(item, fromIndex);
|
2068
|
+
};
|
2069
|
+
|
2070
|
+
/**
|
2071
|
+
* Return the value of the first element in the array that satisfies the
|
2072
|
+
* provided testing function.
|
2073
|
+
*
|
2074
|
+
* @function Highcharts.find
|
2075
|
+
*
|
2076
|
+
* @param {Array} arr
|
2077
|
+
* The array to test.
|
2078
|
+
*
|
2079
|
+
* @param {Function} callback
|
2080
|
+
* The callback function. The function receives the item as the first
|
2081
|
+
* argument. Return `true` if this item satisfies the condition.
|
2082
|
+
*
|
2083
|
+
* @return {*}
|
2084
|
+
* The value of the element.
|
2085
|
+
*/
|
2086
|
+
H.find = Array.prototype.find ?
|
2087
|
+
function (arr, callback) {
|
2088
|
+
return arr.find(callback);
|
2089
|
+
} :
|
2090
|
+
// Legacy implementation. PhantomJS, IE <= 11 etc. #7223.
|
2091
|
+
function (arr, fn) {
|
2092
|
+
var i,
|
2093
|
+
length = arr.length;
|
2094
|
+
|
2095
|
+
for (i = 0; i < length; i++) {
|
2096
|
+
if (fn(arr[i], i)) {
|
2097
|
+
return arr[i];
|
2098
|
+
}
|
2099
|
+
}
|
2100
|
+
};
|
2101
|
+
|
2102
|
+
/**
|
2103
|
+
* Returns an array of a given object's own properties.
|
2104
|
+
*
|
2105
|
+
* @function Highcharts.keys
|
2106
|
+
* @deprecated
|
2107
|
+
*
|
2108
|
+
* @param {*} obj
|
2109
|
+
* The object of which the properties are to be returned.
|
2110
|
+
*
|
2111
|
+
* @return {Array<string>}
|
2112
|
+
* An array of strings that represents all the properties.
|
2113
|
+
*/
|
2114
|
+
H.keys = Object.keys;
|
2115
|
+
|
2116
|
+
/**
|
2117
|
+
* Get the element's offset position, corrected for `overflow: auto`.
|
2118
|
+
*
|
2119
|
+
* @function Highcharts.offset
|
2120
|
+
*
|
2121
|
+
* @param {Highcharts.HTMLDOMElement} el
|
2122
|
+
* The HTML element.
|
2123
|
+
*
|
2124
|
+
* @return {Highcharts.OffsetObject}
|
2125
|
+
* An object containing `left` and `top` properties for the position in
|
2126
|
+
* the page.
|
2127
|
+
*/
|
2128
|
+
H.offset = function (el) {
|
2129
|
+
var docElem = doc.documentElement,
|
2130
|
+
box = (el.parentElement || el.parentNode) ?
|
2131
|
+
el.getBoundingClientRect() :
|
2132
|
+
{ top: 0, left: 0 };
|
2133
|
+
|
2134
|
+
return {
|
2135
|
+
top: box.top + (win.pageYOffset || docElem.scrollTop) -
|
2136
|
+
(docElem.clientTop || 0),
|
2137
|
+
left: box.left + (win.pageXOffset || docElem.scrollLeft) -
|
2138
|
+
(docElem.clientLeft || 0)
|
2139
|
+
};
|
2140
|
+
};
|
2141
|
+
|
2142
|
+
/**
|
2143
|
+
* Stop running animation.
|
2144
|
+
*
|
2145
|
+
* @function Highcharts.stop
|
2146
|
+
*
|
2147
|
+
* @param {Highcharts.SVGElement} el
|
2148
|
+
* The SVGElement to stop animation on.
|
2149
|
+
*
|
2150
|
+
* @param {string} [prop]
|
2151
|
+
* The property to stop animating. If given, the stop method will stop a
|
2152
|
+
* single property from animating, while others continue.
|
2153
|
+
*
|
2154
|
+
* @todo
|
2155
|
+
* A possible extension to this would be to stop a single property, when
|
2156
|
+
* we want to continue animating others. Then assign the prop to the timer
|
2157
|
+
* in the Fx.run method, and check for the prop here. This would be an
|
2158
|
+
* improvement in all cases where we stop the animation from .attr. Instead of
|
2159
|
+
* stopping everything, we can just stop the actual attributes we're setting.
|
2160
|
+
*/
|
2161
|
+
H.stop = function (el, prop) {
|
2162
|
+
|
2163
|
+
var i = H.timers.length;
|
2164
|
+
|
2165
|
+
// Remove timers related to this element (#4519)
|
2166
|
+
while (i--) {
|
2167
|
+
if (H.timers[i].elem === el && (!prop || prop === H.timers[i].prop)) {
|
2168
|
+
H.timers[i].stopped = true; // #4667
|
2169
|
+
}
|
2170
|
+
}
|
2171
|
+
};
|
2172
|
+
|
2173
|
+
/**
|
2174
|
+
* Iterate over object key pairs in an object.
|
2175
|
+
*
|
2176
|
+
* @function Highcharts.objectEach
|
2177
|
+
*
|
2178
|
+
* @param {*} obj
|
2179
|
+
* The object to iterate over.
|
2180
|
+
*
|
2181
|
+
* @param {Highcharts.ObjectEachCallbackFunction} fn
|
2182
|
+
* The iterator callback. It passes three arguments:
|
2183
|
+
* * value - The property value.
|
2184
|
+
* * key - The property key.
|
2185
|
+
* * obj - The object that objectEach is being applied to.
|
2186
|
+
*
|
2187
|
+
* @param {*} [ctx]
|
2188
|
+
* The context.
|
2189
|
+
*/
|
2190
|
+
H.objectEach = function (obj, fn, ctx) {
|
2191
|
+
for (var key in obj) {
|
2192
|
+
if (obj.hasOwnProperty(key)) {
|
2193
|
+
fn.call(ctx || obj[key], obj[key], key, obj);
|
2194
|
+
}
|
2195
|
+
}
|
2196
|
+
};
|
2197
|
+
|
2198
|
+
/**
|
2199
|
+
* Iterate over an array.
|
2200
|
+
*
|
2201
|
+
* @deprecated
|
2202
|
+
* @function Highcharts.each
|
2203
|
+
*
|
2204
|
+
* @param {Array<*>} arr
|
2205
|
+
* The array to iterate over.
|
2206
|
+
*
|
2207
|
+
* @param {Function} fn
|
2208
|
+
* The iterator callback. It passes three arguments:
|
2209
|
+
* - `item`: The array item.
|
2210
|
+
* - `index`: The item's index in the array.
|
2211
|
+
* - `arr`: The array that each is being applied to.
|
2212
|
+
*
|
2213
|
+
* @param {*} [ctx]
|
2214
|
+
* The context.
|
2215
|
+
*/
|
2216
|
+
|
2217
|
+
/**
|
2218
|
+
* Filter an array by a callback.
|
2219
|
+
*
|
2220
|
+
* @deprecated
|
2221
|
+
* @function Highcharts.grep
|
2222
|
+
*
|
2223
|
+
* @param {Array<*>} arr
|
2224
|
+
* The array to filter.
|
2225
|
+
*
|
2226
|
+
* @param {Function} callback
|
2227
|
+
* The callback function. The function receives the item as the first
|
2228
|
+
* argument. Return `true` if the item is to be preserved.
|
2229
|
+
*
|
2230
|
+
* @return {Array<*>}
|
2231
|
+
* A new, filtered array.
|
2232
|
+
*/
|
2233
|
+
|
2234
|
+
/**
|
2235
|
+
* Map an array by a callback.
|
2236
|
+
*
|
2237
|
+
* @deprecated
|
2238
|
+
* @function Highcharts.map
|
2239
|
+
*
|
2240
|
+
* @param {Array<*>} arr
|
2241
|
+
* The array to map.
|
2242
|
+
*
|
2243
|
+
* @param {Function} fn
|
2244
|
+
* The callback function. Return the new value for the new array.
|
2245
|
+
*
|
2246
|
+
* @return {Array<*>}
|
2247
|
+
* A new array item with modified items.
|
2248
|
+
*/
|
2249
|
+
|
2250
|
+
/**
|
2251
|
+
* Reduce an array to a single value.
|
2252
|
+
*
|
2253
|
+
* @deprecated
|
2254
|
+
* @function Highcharts.reduce
|
2255
|
+
*
|
2256
|
+
* @param {Array} arr
|
2257
|
+
* The array to reduce.
|
2258
|
+
*
|
2259
|
+
* @param {Function} fn
|
2260
|
+
* The callback function. Return the reduced value. Receives 4
|
2261
|
+
* arguments: Accumulated/reduced value, current value, current array
|
2262
|
+
* index, and the array.
|
2263
|
+
*
|
2264
|
+
* @param {*} initialValue
|
2265
|
+
* The initial value of the accumulator.
|
2266
|
+
*
|
2267
|
+
* @return {*}
|
2268
|
+
* The reduced value.
|
2269
|
+
*/
|
2270
|
+
|
2271
|
+
/**
|
2272
|
+
* Test whether at least one element in the array passes the test implemented by
|
2273
|
+
* the provided function.
|
2274
|
+
*
|
2275
|
+
* @deprecated
|
2276
|
+
* @function Highcharts.some
|
2277
|
+
*
|
2278
|
+
* @param {Array<*>} arr
|
2279
|
+
* The array to test
|
2280
|
+
*
|
2281
|
+
* @param {Function} fn
|
2282
|
+
* The function to run on each item. Return truty to pass the test.
|
2283
|
+
* Receives arguments `currentValue`, `index` and `array`.
|
2284
|
+
*
|
2285
|
+
* @param {*} ctx
|
2286
|
+
* The context.
|
2287
|
+
*
|
2288
|
+
* @return {boolean}
|
2289
|
+
*/
|
2290
|
+
H.objectEach({
|
2291
|
+
map: 'map',
|
2292
|
+
each: 'forEach',
|
2293
|
+
grep: 'filter',
|
2294
|
+
reduce: 'reduce',
|
2295
|
+
some: 'some'
|
2296
|
+
}, function (val, key) {
|
2297
|
+
H[key] = function (arr) {
|
2298
|
+
return Array.prototype[val].apply(
|
2299
|
+
arr,
|
2300
|
+
[].slice.call(arguments, 1)
|
2301
|
+
);
|
2302
|
+
};
|
2303
|
+
});
|
2304
|
+
|
2305
|
+
/**
|
2306
|
+
* Add an event listener.
|
2307
|
+
*
|
2308
|
+
* @function Highcharts.addEvent<T>
|
2309
|
+
*
|
2310
|
+
* @param {T} el
|
2311
|
+
* The element or object to add a listener to. It can be a
|
2312
|
+
* {@link HTMLDOMElement}, an {@link SVGElement} or any other object.
|
2313
|
+
*
|
2314
|
+
* @param {string} type
|
2315
|
+
* The event type.
|
2316
|
+
*
|
2317
|
+
* @param {Highcharts.EventCallbackFunction<T>} fn
|
2318
|
+
* The function callback to execute when the event is fired.
|
2319
|
+
*
|
2320
|
+
* @param {Highcharts.EventOptionsObject} [options]
|
2321
|
+
* Options for adding the event.
|
2322
|
+
*
|
2323
|
+
* @return {Function}
|
2324
|
+
* A callback function to remove the added event.
|
2325
|
+
*/
|
2326
|
+
H.addEvent = function (el, type, fn, options) {
|
2327
|
+
|
2328
|
+
var events,
|
2329
|
+
addEventListener = el.addEventListener || H.addEventListenerPolyfill;
|
2330
|
+
|
2331
|
+
// If we're setting events directly on the constructor, use a separate
|
2332
|
+
// collection, `protoEvents` to distinguish it from the item events in
|
2333
|
+
// `hcEvents`.
|
2334
|
+
if (typeof el === 'function' && el.prototype) {
|
2335
|
+
events = el.prototype.protoEvents = el.prototype.protoEvents || {};
|
2336
|
+
} else {
|
2337
|
+
events = el.hcEvents = el.hcEvents || {};
|
2338
|
+
}
|
2339
|
+
|
2340
|
+
// Allow click events added to points, otherwise they will be prevented by
|
2341
|
+
// the TouchPointer.pinch function after a pinch zoom operation (#7091).
|
2342
|
+
if (H.Point && el instanceof H.Point && el.series && el.series.chart) {
|
2343
|
+
el.series.chart.runTrackerClick = true;
|
2344
|
+
}
|
2345
|
+
|
2346
|
+
// Handle DOM events
|
2347
|
+
if (addEventListener) {
|
2348
|
+
addEventListener.call(el, type, fn, false);
|
2349
|
+
}
|
2350
|
+
|
2351
|
+
if (!events[type]) {
|
2352
|
+
events[type] = [];
|
2353
|
+
}
|
2354
|
+
|
2355
|
+
events[type].push(fn);
|
2356
|
+
|
2357
|
+
// Order the calls
|
2358
|
+
if (options && H.isNumber(options.order)) {
|
2359
|
+
fn.order = options.order;
|
2360
|
+
events[type].sort(function (a, b) {
|
2361
|
+
return a.order - b.order;
|
2362
|
+
});
|
2363
|
+
}
|
2364
|
+
|
2365
|
+
// Return a function that can be called to remove this event.
|
2366
|
+
return function () {
|
2367
|
+
H.removeEvent(el, type, fn);
|
2368
|
+
};
|
2369
|
+
};
|
2370
|
+
|
2371
|
+
/**
|
2372
|
+
* Remove an event that was added with {@link Highcharts#addEvent}.
|
2373
|
+
*
|
2374
|
+
* @function Highcharts.removeEvent<T>
|
2375
|
+
*
|
2376
|
+
* @param {T} el
|
2377
|
+
* The element to remove events on.
|
2378
|
+
*
|
2379
|
+
* @param {string} [type]
|
2380
|
+
* The type of events to remove. If undefined, all events are removed
|
2381
|
+
* from the element.
|
2382
|
+
*
|
2383
|
+
* @param {Highcharts.EventCallbackFunction<T>} [fn]
|
2384
|
+
* The specific callback to remove. If undefined, all events that match
|
2385
|
+
* the element and optionally the type are removed.
|
2386
|
+
*/
|
2387
|
+
H.removeEvent = function (el, type, fn) {
|
2388
|
+
|
2389
|
+
var events,
|
2390
|
+
index;
|
2391
|
+
|
2392
|
+
function removeOneEvent(type, fn) {
|
2393
|
+
var removeEventListener =
|
2394
|
+
el.removeEventListener || H.removeEventListenerPolyfill;
|
2395
|
+
|
2396
|
+
if (removeEventListener) {
|
2397
|
+
removeEventListener.call(el, type, fn, false);
|
2398
|
+
}
|
2399
|
+
}
|
2400
|
+
|
2401
|
+
function removeAllEvents(eventCollection) {
|
2402
|
+
var types,
|
2403
|
+
len;
|
2404
|
+
|
2405
|
+
if (!el.nodeName) {
|
2406
|
+
return; // break on non-DOM events
|
2407
|
+
}
|
2408
|
+
|
2409
|
+
if (type) {
|
2410
|
+
types = {};
|
2411
|
+
types[type] = true;
|
2412
|
+
} else {
|
2413
|
+
types = eventCollection;
|
2414
|
+
}
|
2415
|
+
|
2416
|
+
H.objectEach(types, function (val, n) {
|
2417
|
+
if (eventCollection[n]) {
|
2418
|
+
len = eventCollection[n].length;
|
2419
|
+
while (len--) {
|
2420
|
+
removeOneEvent(n, eventCollection[n][len]);
|
2421
|
+
}
|
2422
|
+
}
|
2423
|
+
});
|
2424
|
+
}
|
2425
|
+
|
2426
|
+
['protoEvents', 'hcEvents'].forEach(function (coll) {
|
2427
|
+
var eventCollection = el[coll];
|
2428
|
+
|
2429
|
+
if (eventCollection) {
|
2430
|
+
if (type) {
|
2431
|
+
events = eventCollection[type] || [];
|
2432
|
+
if (fn) {
|
2433
|
+
index = events.indexOf(fn);
|
2434
|
+
if (index > -1) {
|
2435
|
+
events.splice(index, 1);
|
2436
|
+
eventCollection[type] = events;
|
2437
|
+
}
|
2438
|
+
removeOneEvent(type, fn);
|
2439
|
+
|
2440
|
+
} else {
|
2441
|
+
removeAllEvents(eventCollection);
|
2442
|
+
eventCollection[type] = [];
|
2443
|
+
}
|
2444
|
+
} else {
|
2445
|
+
removeAllEvents(eventCollection);
|
2446
|
+
el[coll] = {};
|
2447
|
+
}
|
2448
|
+
}
|
2449
|
+
});
|
2450
|
+
};
|
2451
|
+
|
2452
|
+
/**
|
2453
|
+
* Fire an event that was registered with {@link Highcharts#addEvent}.
|
2454
|
+
*
|
2455
|
+
* @function Highcharts.fireEvent
|
2456
|
+
*
|
2457
|
+
* @param {*} el
|
2458
|
+
* The object to fire the event on. It can be a {@link HTMLDOMElement},
|
2459
|
+
* an {@link SVGElement} or any other object.
|
2460
|
+
*
|
2461
|
+
* @param {string} type
|
2462
|
+
* The type of event.
|
2463
|
+
*
|
2464
|
+
* @param {Highcharts.Dictionary<*>} [eventArguments]
|
2465
|
+
* Custom event arguments that are passed on as an argument to the event
|
2466
|
+
* handler.
|
2467
|
+
*
|
2468
|
+
* @param {Function} [defaultFunction]
|
2469
|
+
* The default function to execute if the other listeners haven't
|
2470
|
+
* returned false.
|
2471
|
+
*/
|
2472
|
+
H.fireEvent = function (el, type, eventArguments, defaultFunction) {
|
2473
|
+
var e,
|
2474
|
+
events,
|
2475
|
+
len,
|
2476
|
+
i,
|
2477
|
+
fn;
|
2478
|
+
|
2479
|
+
eventArguments = eventArguments || {};
|
2480
|
+
|
2481
|
+
if (doc.createEvent && (el.dispatchEvent || el.fireEvent)) {
|
2482
|
+
e = doc.createEvent('Events');
|
2483
|
+
e.initEvent(type, true, true);
|
2484
|
+
|
2485
|
+
H.extend(e, eventArguments);
|
2486
|
+
|
2487
|
+
if (el.dispatchEvent) {
|
2488
|
+
el.dispatchEvent(e);
|
2489
|
+
} else {
|
2490
|
+
el.fireEvent(type, e);
|
2491
|
+
}
|
2492
|
+
|
2493
|
+
} else {
|
2494
|
+
|
2495
|
+
['protoEvents', 'hcEvents'].forEach(function (coll) {
|
2496
|
+
|
2497
|
+
if (el[coll]) {
|
2498
|
+
events = el[coll][type] || [];
|
2499
|
+
len = events.length;
|
2500
|
+
|
2501
|
+
if (!eventArguments.target) { // We're running a custom event
|
2502
|
+
|
2503
|
+
H.extend(eventArguments, {
|
2504
|
+
// Attach a simple preventDefault function to skip
|
2505
|
+
// default handler if called. The built-in
|
2506
|
+
// defaultPrevented property is not overwritable (#5112)
|
2507
|
+
preventDefault: function () {
|
2508
|
+
eventArguments.defaultPrevented = true;
|
2509
|
+
},
|
2510
|
+
// Setting target to native events fails with clicking
|
2511
|
+
// the zoom-out button in Chrome.
|
2512
|
+
target: el,
|
2513
|
+
// If the type is not set, we're running a custom event
|
2514
|
+
// (#2297). If it is set, we're running a browser event,
|
2515
|
+
// and setting it will cause en error in IE8 (#2465).
|
2516
|
+
type: type
|
2517
|
+
});
|
2518
|
+
}
|
2519
|
+
|
2520
|
+
|
2521
|
+
for (i = 0; i < len; i++) {
|
2522
|
+
fn = events[i];
|
2523
|
+
|
2524
|
+
// If the event handler return false, prevent the default
|
2525
|
+
// handler from executing
|
2526
|
+
if (fn && fn.call(el, eventArguments) === false) {
|
2527
|
+
eventArguments.preventDefault();
|
2528
|
+
}
|
2529
|
+
}
|
2530
|
+
}
|
2531
|
+
});
|
2532
|
+
}
|
2533
|
+
|
2534
|
+
// Run the default if not prevented
|
2535
|
+
if (defaultFunction && !eventArguments.defaultPrevented) {
|
2536
|
+
defaultFunction.call(el, eventArguments);
|
2537
|
+
}
|
2538
|
+
};
|
2539
|
+
|
2540
|
+
/**
|
2541
|
+
* The global animate method, which uses Fx to create individual animators.
|
2542
|
+
*
|
2543
|
+
* @function Highcharts.animate
|
2544
|
+
*
|
2545
|
+
* @param {Highcharts.HTMLDOMElement|Highcharts.SVGElement} el
|
2546
|
+
* The element to animate.
|
2547
|
+
*
|
2548
|
+
* @param {Highcharts.HTMLAttributes|Highcharts.SVGAttributes} params
|
2549
|
+
* An object containing key-value pairs of the properties to animate.
|
2550
|
+
* Supports numeric as pixel-based CSS properties for HTML objects and
|
2551
|
+
* attributes for SVGElements.
|
2552
|
+
*
|
2553
|
+
* @param {Highcharts.AnimationOptionsObject} [opt]
|
2554
|
+
* Animation options.
|
2555
|
+
*/
|
2556
|
+
H.animate = function (el, params, opt) {
|
2557
|
+
var start,
|
2558
|
+
unit = '',
|
2559
|
+
end,
|
2560
|
+
fx,
|
2561
|
+
args;
|
2562
|
+
|
2563
|
+
if (!H.isObject(opt)) { // Number or undefined/null
|
2564
|
+
args = arguments;
|
2565
|
+
opt = {
|
2566
|
+
duration: args[2],
|
2567
|
+
easing: args[3],
|
2568
|
+
complete: args[4]
|
2569
|
+
};
|
2570
|
+
}
|
2571
|
+
if (!H.isNumber(opt.duration)) {
|
2572
|
+
opt.duration = 400;
|
2573
|
+
}
|
2574
|
+
opt.easing = typeof opt.easing === 'function' ?
|
2575
|
+
opt.easing :
|
2576
|
+
(Math[opt.easing] || Math.easeInOutSine);
|
2577
|
+
opt.curAnim = H.merge(params);
|
2578
|
+
|
2579
|
+
H.objectEach(params, function (val, prop) {
|
2580
|
+
// Stop current running animation of this property
|
2581
|
+
H.stop(el, prop);
|
2582
|
+
|
2583
|
+
fx = new H.Fx(el, opt, prop);
|
2584
|
+
end = null;
|
2585
|
+
|
2586
|
+
if (prop === 'd') {
|
2587
|
+
fx.paths = fx.initPath(
|
2588
|
+
el,
|
2589
|
+
el.d,
|
2590
|
+
params.d
|
2591
|
+
);
|
2592
|
+
fx.toD = params.d;
|
2593
|
+
start = 0;
|
2594
|
+
end = 1;
|
2595
|
+
} else if (el.attr) {
|
2596
|
+
start = el.attr(prop);
|
2597
|
+
} else {
|
2598
|
+
start = parseFloat(H.getStyle(el, prop)) || 0;
|
2599
|
+
if (prop !== 'opacity') {
|
2600
|
+
unit = 'px';
|
2601
|
+
}
|
2602
|
+
}
|
2603
|
+
|
2604
|
+
if (!end) {
|
2605
|
+
end = val;
|
2606
|
+
}
|
2607
|
+
if (end && end.match && end.match('px')) {
|
2608
|
+
end = end.replace(/px/g, ''); // #4351
|
2609
|
+
}
|
2610
|
+
fx.run(start, end, unit);
|
2611
|
+
});
|
2612
|
+
};
|
2613
|
+
|
2614
|
+
/**
|
2615
|
+
* Factory to create new series prototypes.
|
2616
|
+
*
|
2617
|
+
* @function Highcharts.seriesType
|
2618
|
+
*
|
2619
|
+
* @param {string} type
|
2620
|
+
* The series type name.
|
2621
|
+
*
|
2622
|
+
* @param {string} parent
|
2623
|
+
* The parent series type name. Use `line` to inherit from the basic
|
2624
|
+
* {@link Series} object.
|
2625
|
+
*
|
2626
|
+
* @param {*} options
|
2627
|
+
* The additional default options that is merged with the parent's
|
2628
|
+
* options.
|
2629
|
+
*
|
2630
|
+
* @param {*} props
|
2631
|
+
* The properties (functions and primitives) to set on the new
|
2632
|
+
* prototype.
|
2633
|
+
*
|
2634
|
+
* @param {*} [pointProps]
|
2635
|
+
* Members for a series-specific extension of the {@link Point}
|
2636
|
+
* prototype if needed.
|
2637
|
+
*
|
2638
|
+
* @return {Highcharts.Series}
|
2639
|
+
* The newly created prototype as extended from {@link Series} or its
|
2640
|
+
* derivatives.
|
2641
|
+
*/
|
2642
|
+
// docs: add to API + extending Highcharts
|
2643
|
+
H.seriesType = function (type, parent, options, props, pointProps) {
|
2644
|
+
var defaultOptions = H.getOptions(),
|
2645
|
+
seriesTypes = H.seriesTypes;
|
2646
|
+
|
2647
|
+
// Merge the options
|
2648
|
+
defaultOptions.plotOptions[type] = H.merge(
|
2649
|
+
defaultOptions.plotOptions[parent],
|
2650
|
+
options
|
2651
|
+
);
|
2652
|
+
|
2653
|
+
// Create the class
|
2654
|
+
seriesTypes[type] = H.extendClass(seriesTypes[parent] ||
|
2655
|
+
function () {}, props);
|
2656
|
+
seriesTypes[type].prototype.type = type;
|
2657
|
+
|
2658
|
+
// Create the point class if needed
|
2659
|
+
if (pointProps) {
|
2660
|
+
seriesTypes[type].prototype.pointClass =
|
2661
|
+
H.extendClass(H.Point, pointProps);
|
2662
|
+
}
|
2663
|
+
|
2664
|
+
return seriesTypes[type];
|
2665
|
+
};
|
2666
|
+
|
2667
|
+
/**
|
2668
|
+
* Get a unique key for using in internal element id's and pointers. The key is
|
2669
|
+
* composed of a random hash specific to this Highcharts instance, and a
|
2670
|
+
* counter.
|
2671
|
+
*
|
2672
|
+
* @example
|
2673
|
+
* var id = H.uniqueKey(); // => 'highcharts-x45f6hp-0'
|
2674
|
+
*
|
2675
|
+
* @function Highcharts.uniqueKey
|
2676
|
+
*
|
2677
|
+
* @return {string}
|
2678
|
+
* A unique key.
|
2679
|
+
*/
|
2680
|
+
H.uniqueKey = (function () {
|
2681
|
+
|
2682
|
+
var uniqueKeyHash = Math.random().toString(36).substring(2, 9),
|
2683
|
+
idCounter = 0;
|
2684
|
+
|
2685
|
+
return function () {
|
2686
|
+
return 'highcharts-' + uniqueKeyHash + '-' + idCounter++;
|
2687
|
+
};
|
2688
|
+
}());
|
2689
|
+
|
2690
|
+
H.isFunction = function (obj) {
|
2691
|
+
return typeof obj === 'function';
|
2692
|
+
};
|
2693
|
+
|
2694
|
+
// Register Highcharts as a plugin in jQuery
|
2695
|
+
if (win.jQuery) {
|
2696
|
+
|
2697
|
+
/**
|
2698
|
+
* Highcharts-extended JQuery.
|
2699
|
+
*
|
2700
|
+
* @external JQuery
|
2701
|
+
*/
|
2702
|
+
|
2703
|
+
/**
|
2704
|
+
* Helper function to return the chart of the current JQuery selector
|
2705
|
+
* element.
|
2706
|
+
*
|
2707
|
+
* @function external:JQuery#highcharts
|
2708
|
+
*
|
2709
|
+
* @return {Highcharts.Chart}
|
2710
|
+
* The chart that is linked to the JQuery selector element.
|
2711
|
+
*//**
|
2712
|
+
* Factory function to create a chart in the current JQuery selector
|
2713
|
+
* element.
|
2714
|
+
*
|
2715
|
+
* @function external:JQuery#highcharts
|
2716
|
+
*
|
2717
|
+
* @param {"Chart"|"Map"|"StockChart"|string} [className]
|
2718
|
+
* Name of the factory class in the Highcharts namespace.
|
2719
|
+
*
|
2720
|
+
* @param {Highcharts.Options} [options]
|
2721
|
+
* The chart options structure.
|
2722
|
+
*
|
2723
|
+
* @param {Highcharts.ChartCallbackFunction} [callback]
|
2724
|
+
* Function to run when the chart has loaded and and all external
|
2725
|
+
* images are loaded. Defining a
|
2726
|
+
* [chart.events.load](https://api.highcharts.com/highcharts/chart.events.load)
|
2727
|
+
* handler is equivalent.
|
2728
|
+
*
|
2729
|
+
* @return {JQuery}
|
2730
|
+
* The current JQuery selector.
|
2731
|
+
*/
|
2732
|
+
win.jQuery.fn.highcharts = function () {
|
2733
|
+
var args = [].slice.call(arguments);
|
2734
|
+
|
2735
|
+
if (this[0]) { // this[0] is the renderTo div
|
2736
|
+
|
2737
|
+
// Create the chart
|
2738
|
+
if (args[0]) {
|
2739
|
+
new H[ // eslint-disable-line no-new
|
2740
|
+
// Constructor defaults to Chart
|
2741
|
+
H.isString(args[0]) ? args.shift() : 'Chart'
|
2742
|
+
](this[0], args[0], args[1]);
|
2743
|
+
return this;
|
2744
|
+
}
|
2745
|
+
|
2746
|
+
// When called without parameters or with the return argument,
|
2747
|
+
// return an existing chart
|
2748
|
+
return charts[H.attr(this[0], 'data-highcharts-chart')];
|
2749
|
+
}
|
2750
|
+
};
|
2751
|
+
}
|