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,3730 @@
|
|
1
|
+
/**
|
2
|
+
* License: www.highcharts.com/license
|
3
|
+
* Author: Christer Vasseng, Torstein Honsi
|
4
|
+
*
|
5
|
+
* This is a Highcharts module that draws long data series on a cannvas in order
|
6
|
+
* to increase performance of the initial load time and tooltip responsiveness.
|
7
|
+
*
|
8
|
+
* Compatible with WebGL compatible browsers (not IE < 11).
|
9
|
+
*
|
10
|
+
* If this module is taken in as part of the core
|
11
|
+
* - All the loading logic should be merged with core. Update styles in the
|
12
|
+
* core.
|
13
|
+
* - Most of the method wraps should probably be added directly in parent
|
14
|
+
* methods.
|
15
|
+
*
|
16
|
+
* Notes for boost mode
|
17
|
+
* - Area lines are not drawn
|
18
|
+
* - Lines are not drawn on scatter charts
|
19
|
+
* - Zones and negativeColor don't work
|
20
|
+
* - Dash styles are not rendered on lines.
|
21
|
+
* - Columns are always one pixel wide. Don't set the threshold too low.
|
22
|
+
* - Disable animations
|
23
|
+
* - Marker shapes are not supported: markers will always be circles
|
24
|
+
*
|
25
|
+
* Optimizing tips for users
|
26
|
+
* - Set extremes (min, max) explicitly on the axes in order for Highcharts to
|
27
|
+
* avoid computing extremes.
|
28
|
+
* - Set enableMouseTracking to false on the series to improve total rendering
|
29
|
+
* time.
|
30
|
+
* - The default threshold is set based on one series. If you have multiple,
|
31
|
+
* dense series, the combined number of points drawn gets higher, and you may
|
32
|
+
* want to set the threshold lower in order to use optimizations.
|
33
|
+
* - If drawing large scatter charts, it's beneficial to set the marker radius
|
34
|
+
* to a value less than 1. This is to add additional spacing to make the chart
|
35
|
+
* more readable.
|
36
|
+
* - If the value increments on both the X and Y axis aren't small, consider
|
37
|
+
* setting useGPUTranslations to true on the boost settings object. If you do
|
38
|
+
* this and the increments are small (e.g. datetime axis with small time
|
39
|
+
* increments) it may cause rendering issues due to floating point rounding
|
40
|
+
* errors, so your millage may vary.
|
41
|
+
*
|
42
|
+
* Settings
|
43
|
+
* There are two ways of setting the boost threshold:
|
44
|
+
* - Per series: boost based on number of points in individual series
|
45
|
+
* - Per chart: boost based on the number of series
|
46
|
+
*
|
47
|
+
* To set the series boost threshold, set seriesBoostThreshold on the chart
|
48
|
+
* object.
|
49
|
+
* To set the series-specific threshold, set boostThreshold on the series
|
50
|
+
* object.
|
51
|
+
*
|
52
|
+
* In addition, the following can be set in the boost object:
|
53
|
+
* {
|
54
|
+
* //Wether or not to use alpha blending
|
55
|
+
* useAlpha: boolean - default: true
|
56
|
+
* //Set to true to perform translations on the GPU.
|
57
|
+
* //Much faster, but may cause rendering issues
|
58
|
+
* //when using values far from 0 due to floating point
|
59
|
+
* //rounding issues
|
60
|
+
* useGPUTranslations: boolean - default: false
|
61
|
+
* //Use pre-allocated buffers, much faster,
|
62
|
+
* //but may cause rendering issues with some data sets
|
63
|
+
* usePreallocated: boolean - default: false
|
64
|
+
* }
|
65
|
+
*/
|
66
|
+
|
67
|
+
/**
|
68
|
+
* Options for the Boost module. The Boost module allows certain series types
|
69
|
+
* to be rendered by WebGL instead of the default SVG. This allows hundreds of
|
70
|
+
* thousands of data points to be rendered in milliseconds. In addition to the
|
71
|
+
* WebGL rendering it saves time by skipping processing and inspection of the
|
72
|
+
* data wherever possible. This introduces some limitations to what features are
|
73
|
+
* available in Boost mode. See [the docs](
|
74
|
+
* https://www.highcharts.com/docs/advanced-chart-features/boost-module) for
|
75
|
+
* details.
|
76
|
+
*
|
77
|
+
* In addition to the global `boost` option, each series has a
|
78
|
+
* [boostThreshold](#plotOptions.series.boostThreshold) that defines when the
|
79
|
+
* boost should kick in.
|
80
|
+
*
|
81
|
+
* Requires the `modules/boost.js` module.
|
82
|
+
*
|
83
|
+
* @sample {highstock} highcharts/boost/line-series-heavy-stock
|
84
|
+
* Stock chart
|
85
|
+
* @sample {highstock} highcharts/boost/line-series-heavy-dynamic
|
86
|
+
* Dynamic stock chart
|
87
|
+
* @sample highcharts/boost/line
|
88
|
+
* Line chart
|
89
|
+
* @sample highcharts/boost/line-series-heavy
|
90
|
+
* Line chart with hundreds of series
|
91
|
+
* @sample highcharts/boost/scatter
|
92
|
+
* Scatter chart
|
93
|
+
* @sample highcharts/boost/area
|
94
|
+
* Area chart
|
95
|
+
* @sample highcharts/boost/arearange
|
96
|
+
* Area range chart
|
97
|
+
* @sample highcharts/boost/column
|
98
|
+
* Column chart
|
99
|
+
* @sample highcharts/boost/columnrange
|
100
|
+
* Column range chart
|
101
|
+
* @sample highcharts/boost/bubble
|
102
|
+
* Bubble chart
|
103
|
+
* @sample highcharts/boost/heatmap
|
104
|
+
* Heat map
|
105
|
+
* @sample highcharts/boost/treemap
|
106
|
+
* Tree map
|
107
|
+
*
|
108
|
+
* @product highcharts highstock
|
109
|
+
* @apioption boost
|
110
|
+
*/
|
111
|
+
|
112
|
+
/**
|
113
|
+
* Set the series threshold for when the boost should kick in globally.
|
114
|
+
*
|
115
|
+
* Setting to e.g. 20 will cause the whole chart to enter boost mode
|
116
|
+
* if there are 20 or more series active. When the chart is in boost mode,
|
117
|
+
* every series in it will be rendered to a common canvas. This offers
|
118
|
+
* a significant speed improvment in charts with a very high
|
119
|
+
* amount of series.
|
120
|
+
*
|
121
|
+
* @type {number|null}
|
122
|
+
* @default null
|
123
|
+
* @apioption boost.seriesThreshold
|
124
|
+
*/
|
125
|
+
|
126
|
+
/**
|
127
|
+
* Enable or disable boost on a chart.
|
128
|
+
*
|
129
|
+
* @type {boolean}
|
130
|
+
* @default true
|
131
|
+
* @apioption boost.enabled
|
132
|
+
*/
|
133
|
+
|
134
|
+
/**
|
135
|
+
* Debugging options for boost.
|
136
|
+
* Useful for benchmarking, and general timing.
|
137
|
+
*
|
138
|
+
* @apioption boost.debug
|
139
|
+
*/
|
140
|
+
|
141
|
+
/**
|
142
|
+
* Time the series rendering.
|
143
|
+
*
|
144
|
+
* This outputs the time spent on actual rendering in the console when
|
145
|
+
* set to true.
|
146
|
+
*
|
147
|
+
* @type {boolean}
|
148
|
+
* @default false
|
149
|
+
* @apioption boost.debug.timeRendering
|
150
|
+
*/
|
151
|
+
|
152
|
+
/**
|
153
|
+
* Time the series processing.
|
154
|
+
*
|
155
|
+
* This outputs the time spent on transforming the series data to
|
156
|
+
* vertex buffers when set to true.
|
157
|
+
*
|
158
|
+
* @type {boolean}
|
159
|
+
* @default false
|
160
|
+
* @apioption boost.debug.timeSeriesProcessing
|
161
|
+
*/
|
162
|
+
|
163
|
+
/**
|
164
|
+
* Time the the WebGL setup.
|
165
|
+
*
|
166
|
+
* This outputs the time spent on setting up the WebGL context,
|
167
|
+
* creating shaders, and textures.
|
168
|
+
*
|
169
|
+
* @type {boolean}
|
170
|
+
* @default false
|
171
|
+
* @apioption boost.debug.timeSetup
|
172
|
+
*/
|
173
|
+
|
174
|
+
/**
|
175
|
+
* Time the building of the k-d tree.
|
176
|
+
*
|
177
|
+
* This outputs the time spent building the k-d tree used for
|
178
|
+
* markers etc.
|
179
|
+
*
|
180
|
+
* Note that the k-d tree is built async, and runs post-rendering.
|
181
|
+
* Following, it does not affect the performance of the rendering itself.
|
182
|
+
*
|
183
|
+
* @type {boolean}
|
184
|
+
* @default false
|
185
|
+
* @apioption boost.debug.timeKDTree
|
186
|
+
*/
|
187
|
+
|
188
|
+
/**
|
189
|
+
* Show the number of points skipped through culling.
|
190
|
+
*
|
191
|
+
* When set to true, the number of points skipped in series processing
|
192
|
+
* is outputted. Points are skipped if they are closer than 1 pixel from
|
193
|
+
* each other.
|
194
|
+
*
|
195
|
+
* @type {boolean}
|
196
|
+
* @default false
|
197
|
+
* @apioption boost.debug.showSkipSummary
|
198
|
+
*/
|
199
|
+
|
200
|
+
/**
|
201
|
+
* Time the WebGL to SVG buffer copy
|
202
|
+
*
|
203
|
+
* After rendering, the result is copied to an image which is injected
|
204
|
+
* into the SVG.
|
205
|
+
*
|
206
|
+
* If this property is set to true, the time it takes for the buffer copy
|
207
|
+
* to complete is outputted.
|
208
|
+
*
|
209
|
+
* @type {boolean}
|
210
|
+
* @default false
|
211
|
+
* @apioption boost.debug.timeBufferCopy
|
212
|
+
*/
|
213
|
+
|
214
|
+
/**
|
215
|
+
* Enable or disable GPU translations. GPU translations are faster than doing
|
216
|
+
* the translation in JavaScript.
|
217
|
+
*
|
218
|
+
* This option may cause rendering issues with certain datasets.
|
219
|
+
* Namely, if your dataset has large numbers with small increments (such as
|
220
|
+
* timestamps), it won't work correctly. This is due to floating point
|
221
|
+
* precission.
|
222
|
+
*
|
223
|
+
* @type {boolean}
|
224
|
+
* @default false
|
225
|
+
* @apioption boost.useGPUTranslations
|
226
|
+
*/
|
227
|
+
|
228
|
+
/**
|
229
|
+
* Enable or disable pre-allocation of vertex buffers.
|
230
|
+
*
|
231
|
+
* Enabling this will make it so that the binary data arrays required for
|
232
|
+
* storing the series data will be allocated prior to transforming the data
|
233
|
+
* to a WebGL-compatible format.
|
234
|
+
*
|
235
|
+
* This saves a copy operation on the order of O(n) and so is significantly more
|
236
|
+
* performant. However, this is currently an experimental option, and may cause
|
237
|
+
* visual artifacts with some datasets.
|
238
|
+
*
|
239
|
+
* As such, care should be taken when using this setting to make sure that
|
240
|
+
* it doesn't cause any rendering glitches with the given use-case.
|
241
|
+
*
|
242
|
+
* @type {boolean}
|
243
|
+
* @default false
|
244
|
+
* @apioption boost.usePreallocated
|
245
|
+
*/
|
246
|
+
|
247
|
+
/**
|
248
|
+
* Set the point threshold for when a series should enter boost mode.
|
249
|
+
*
|
250
|
+
* Setting it to e.g. 2000 will cause the series to enter boost mode when there
|
251
|
+
* are 2000 or more points in the series.
|
252
|
+
*
|
253
|
+
* To disable boosting on the series, set the `boostThreshold` to 0. Setting it
|
254
|
+
* to 1 will force boosting.
|
255
|
+
*
|
256
|
+
* Note that the [cropThreshold](plotOptions.series.cropThreshold) also affects
|
257
|
+
* this setting. When zooming in on a series that has fewer points than the
|
258
|
+
* `cropThreshold`, all points are rendered although outside the visible plot
|
259
|
+
* area, and the `boostThreshold` won't take effect.
|
260
|
+
*
|
261
|
+
* Requires `modules/boost.js`.
|
262
|
+
*
|
263
|
+
* @type {number}
|
264
|
+
* @default 5000
|
265
|
+
* @apioption plotOptions.series.boostThreshold
|
266
|
+
*/
|
267
|
+
|
268
|
+
/**
|
269
|
+
* If set to true, the whole chart will be boosted if one of the series
|
270
|
+
* crosses its threshold, and all the series can be boosted.
|
271
|
+
*
|
272
|
+
* @type {boolean}
|
273
|
+
* @default true
|
274
|
+
* @apioption boost.allowForce
|
275
|
+
*/
|
276
|
+
|
277
|
+
/**
|
278
|
+
* Sets the color blending in the boost module.
|
279
|
+
*
|
280
|
+
* @type {string}
|
281
|
+
* @default undefined
|
282
|
+
* @validvalue ["add", "multiply", "darken"]
|
283
|
+
* @apioption plotOptions.series.boostBlending
|
284
|
+
*/
|
285
|
+
|
286
|
+
/* global Float32Array */
|
287
|
+
|
288
|
+
'use strict';
|
289
|
+
|
290
|
+
import H from '../parts/Globals.js';
|
291
|
+
import '../parts/Utilities.js';
|
292
|
+
import '../parts/Color.js';
|
293
|
+
import '../parts/Series.js';
|
294
|
+
import '../parts/Options.js';
|
295
|
+
import '../parts/Point.js';
|
296
|
+
import '../parts/Interaction.js';
|
297
|
+
|
298
|
+
var win = H.win,
|
299
|
+
doc = win.document,
|
300
|
+
noop = function () {},
|
301
|
+
Chart = H.Chart,
|
302
|
+
Color = H.Color,
|
303
|
+
Series = H.Series,
|
304
|
+
seriesTypes = H.seriesTypes,
|
305
|
+
objEach = H.objectEach,
|
306
|
+
extend = H.extend,
|
307
|
+
addEvent = H.addEvent,
|
308
|
+
fireEvent = H.fireEvent,
|
309
|
+
isNumber = H.isNumber,
|
310
|
+
merge = H.merge,
|
311
|
+
pick = H.pick,
|
312
|
+
wrap = H.wrap,
|
313
|
+
plotOptions = H.getOptions().plotOptions,
|
314
|
+
CHUNK_SIZE = 30000,
|
315
|
+
mainCanvas = doc.createElement('canvas'),
|
316
|
+
index,
|
317
|
+
boostable = [
|
318
|
+
'area',
|
319
|
+
'arearange',
|
320
|
+
'column',
|
321
|
+
'columnrange',
|
322
|
+
'bar',
|
323
|
+
'line',
|
324
|
+
'scatter',
|
325
|
+
'heatmap',
|
326
|
+
'bubble',
|
327
|
+
'treemap'
|
328
|
+
],
|
329
|
+
boostableMap = {};
|
330
|
+
|
331
|
+
boostable.forEach(function (item) {
|
332
|
+
boostableMap[item] = 1;
|
333
|
+
});
|
334
|
+
|
335
|
+
// Register color names since GL can't render those directly.
|
336
|
+
Color.prototype.names = {
|
337
|
+
aliceblue: '#f0f8ff',
|
338
|
+
antiquewhite: '#faebd7',
|
339
|
+
aqua: '#00ffff',
|
340
|
+
aquamarine: '#7fffd4',
|
341
|
+
azure: '#f0ffff',
|
342
|
+
beige: '#f5f5dc',
|
343
|
+
bisque: '#ffe4c4',
|
344
|
+
black: '#000000',
|
345
|
+
blanchedalmond: '#ffebcd',
|
346
|
+
blue: '#0000ff',
|
347
|
+
blueviolet: '#8a2be2',
|
348
|
+
brown: '#a52a2a',
|
349
|
+
burlywood: '#deb887',
|
350
|
+
cadetblue: '#5f9ea0',
|
351
|
+
chartreuse: '#7fff00',
|
352
|
+
chocolate: '#d2691e',
|
353
|
+
coral: '#ff7f50',
|
354
|
+
cornflowerblue: '#6495ed',
|
355
|
+
cornsilk: '#fff8dc',
|
356
|
+
crimson: '#dc143c',
|
357
|
+
cyan: '#00ffff',
|
358
|
+
darkblue: '#00008b',
|
359
|
+
darkcyan: '#008b8b',
|
360
|
+
darkgoldenrod: '#b8860b',
|
361
|
+
darkgray: '#a9a9a9',
|
362
|
+
darkgreen: '#006400',
|
363
|
+
darkkhaki: '#bdb76b',
|
364
|
+
darkmagenta: '#8b008b',
|
365
|
+
darkolivegreen: '#556b2f',
|
366
|
+
darkorange: '#ff8c00',
|
367
|
+
darkorchid: '#9932cc',
|
368
|
+
darkred: '#8b0000',
|
369
|
+
darksalmon: '#e9967a',
|
370
|
+
darkseagreen: '#8fbc8f',
|
371
|
+
darkslateblue: '#483d8b',
|
372
|
+
darkslategray: '#2f4f4f',
|
373
|
+
darkturquoise: '#00ced1',
|
374
|
+
darkviolet: '#9400d3',
|
375
|
+
deeppink: '#ff1493',
|
376
|
+
deepskyblue: '#00bfff',
|
377
|
+
dimgray: '#696969',
|
378
|
+
dodgerblue: '#1e90ff',
|
379
|
+
feldspar: '#d19275',
|
380
|
+
firebrick: '#b22222',
|
381
|
+
floralwhite: '#fffaf0',
|
382
|
+
forestgreen: '#228b22',
|
383
|
+
fuchsia: '#ff00ff',
|
384
|
+
gainsboro: '#dcdcdc',
|
385
|
+
ghostwhite: '#f8f8ff',
|
386
|
+
gold: '#ffd700',
|
387
|
+
goldenrod: '#daa520',
|
388
|
+
gray: '#808080',
|
389
|
+
green: '#008000',
|
390
|
+
greenyellow: '#adff2f',
|
391
|
+
honeydew: '#f0fff0',
|
392
|
+
hotpink: '#ff69b4',
|
393
|
+
indianred: '#cd5c5c',
|
394
|
+
indigo: '#4b0082',
|
395
|
+
ivory: '#fffff0',
|
396
|
+
khaki: '#f0e68c',
|
397
|
+
lavender: '#e6e6fa',
|
398
|
+
lavenderblush: '#fff0f5',
|
399
|
+
lawngreen: '#7cfc00',
|
400
|
+
lemonchiffon: '#fffacd',
|
401
|
+
lightblue: '#add8e6',
|
402
|
+
lightcoral: '#f08080',
|
403
|
+
lightcyan: '#e0ffff',
|
404
|
+
lightgoldenrodyellow: '#fafad2',
|
405
|
+
lightgrey: '#d3d3d3',
|
406
|
+
lightgreen: '#90ee90',
|
407
|
+
lightpink: '#ffb6c1',
|
408
|
+
lightsalmon: '#ffa07a',
|
409
|
+
lightseagreen: '#20b2aa',
|
410
|
+
lightskyblue: '#87cefa',
|
411
|
+
lightslateblue: '#8470ff',
|
412
|
+
lightslategray: '#778899',
|
413
|
+
lightsteelblue: '#b0c4de',
|
414
|
+
lightyellow: '#ffffe0',
|
415
|
+
lime: '#00ff00',
|
416
|
+
limegreen: '#32cd32',
|
417
|
+
linen: '#faf0e6',
|
418
|
+
magenta: '#ff00ff',
|
419
|
+
maroon: '#800000',
|
420
|
+
mediumaquamarine: '#66cdaa',
|
421
|
+
mediumblue: '#0000cd',
|
422
|
+
mediumorchid: '#ba55d3',
|
423
|
+
mediumpurple: '#9370d8',
|
424
|
+
mediumseagreen: '#3cb371',
|
425
|
+
mediumslateblue: '#7b68ee',
|
426
|
+
mediumspringgreen: '#00fa9a',
|
427
|
+
mediumturquoise: '#48d1cc',
|
428
|
+
mediumvioletred: '#c71585',
|
429
|
+
midnightblue: '#191970',
|
430
|
+
mintcream: '#f5fffa',
|
431
|
+
mistyrose: '#ffe4e1',
|
432
|
+
moccasin: '#ffe4b5',
|
433
|
+
navajowhite: '#ffdead',
|
434
|
+
navy: '#000080',
|
435
|
+
oldlace: '#fdf5e6',
|
436
|
+
olive: '#808000',
|
437
|
+
olivedrab: '#6b8e23',
|
438
|
+
orange: '#ffa500',
|
439
|
+
orangered: '#ff4500',
|
440
|
+
orchid: '#da70d6',
|
441
|
+
palegoldenrod: '#eee8aa',
|
442
|
+
palegreen: '#98fb98',
|
443
|
+
paleturquoise: '#afeeee',
|
444
|
+
palevioletred: '#d87093',
|
445
|
+
papayawhip: '#ffefd5',
|
446
|
+
peachpuff: '#ffdab9',
|
447
|
+
peru: '#cd853f',
|
448
|
+
pink: '#ffc0cb',
|
449
|
+
plum: '#dda0dd',
|
450
|
+
powderblue: '#b0e0e6',
|
451
|
+
purple: '#800080',
|
452
|
+
red: '#ff0000',
|
453
|
+
rosybrown: '#bc8f8f',
|
454
|
+
royalblue: '#4169e1',
|
455
|
+
saddlebrown: '#8b4513',
|
456
|
+
salmon: '#fa8072',
|
457
|
+
sandybrown: '#f4a460',
|
458
|
+
seagreen: '#2e8b57',
|
459
|
+
seashell: '#fff5ee',
|
460
|
+
sienna: '#a0522d',
|
461
|
+
silver: '#c0c0c0',
|
462
|
+
skyblue: '#87ceeb',
|
463
|
+
slateblue: '#6a5acd',
|
464
|
+
slategray: '#708090',
|
465
|
+
snow: '#fffafa',
|
466
|
+
springgreen: '#00ff7f',
|
467
|
+
steelblue: '#4682b4',
|
468
|
+
tan: '#d2b48c',
|
469
|
+
teal: '#008080',
|
470
|
+
thistle: '#d8bfd8',
|
471
|
+
tomato: '#ff6347',
|
472
|
+
turquoise: '#40e0d0',
|
473
|
+
violet: '#ee82ee',
|
474
|
+
violetred: '#d02090',
|
475
|
+
wheat: '#f5deb3',
|
476
|
+
white: '#ffffff',
|
477
|
+
whitesmoke: '#f5f5f5',
|
478
|
+
yellow: '#ffff00',
|
479
|
+
yellowgreen: '#9acd32'
|
480
|
+
};
|
481
|
+
|
482
|
+
/**
|
483
|
+
* Tolerant max() function.
|
484
|
+
*
|
485
|
+
* @private
|
486
|
+
* @function patientMax
|
487
|
+
*
|
488
|
+
* @return {number}
|
489
|
+
* max value
|
490
|
+
*/
|
491
|
+
function patientMax() {
|
492
|
+
var args = Array.prototype.slice.call(arguments),
|
493
|
+
r = -Number.MAX_VALUE;
|
494
|
+
|
495
|
+
args.forEach(function (t) {
|
496
|
+
if (
|
497
|
+
typeof t !== 'undefined' &&
|
498
|
+
t !== null &&
|
499
|
+
typeof t.length !== 'undefined'
|
500
|
+
) {
|
501
|
+
// r = r < t.length ? t.length : r;
|
502
|
+
if (t.length > 0) {
|
503
|
+
r = t.length;
|
504
|
+
return true;
|
505
|
+
}
|
506
|
+
}
|
507
|
+
});
|
508
|
+
|
509
|
+
return r;
|
510
|
+
}
|
511
|
+
|
512
|
+
/**
|
513
|
+
* Returns true if we should force chart series boosting
|
514
|
+
* The result of this is cached in chart.boostForceChartBoost.
|
515
|
+
* It's re-fetched on redraw.
|
516
|
+
*
|
517
|
+
* We do this because there's a lot of overhead involved when dealing
|
518
|
+
* with a lot of series.
|
519
|
+
*
|
520
|
+
* @private
|
521
|
+
* @function shouldForceChartSeriesBoosting
|
522
|
+
*
|
523
|
+
* @param {Highcharts.Chart} chart
|
524
|
+
*
|
525
|
+
* @return {boolean}
|
526
|
+
*/
|
527
|
+
function shouldForceChartSeriesBoosting(chart) {
|
528
|
+
// If there are more than five series currently boosting,
|
529
|
+
// we should boost the whole chart to avoid running out of webgl contexts.
|
530
|
+
var sboostCount = 0,
|
531
|
+
canBoostCount = 0,
|
532
|
+
allowBoostForce = pick(
|
533
|
+
chart.options.boost && chart.options.boost.allowForce,
|
534
|
+
true
|
535
|
+
),
|
536
|
+
series;
|
537
|
+
|
538
|
+
if (typeof chart.boostForceChartBoost !== 'undefined') {
|
539
|
+
return chart.boostForceChartBoost;
|
540
|
+
}
|
541
|
+
|
542
|
+
if (chart.series.length > 1) {
|
543
|
+
for (var i = 0; i < chart.series.length; i++) {
|
544
|
+
|
545
|
+
series = chart.series[i];
|
546
|
+
|
547
|
+
// Don't count series with boostThreshold set to 0
|
548
|
+
// See #8950
|
549
|
+
// Also don't count if the series is hidden.
|
550
|
+
// See #9046
|
551
|
+
if (series.options.boostThreshold === 0 ||
|
552
|
+
series.visible === false) {
|
553
|
+
continue;
|
554
|
+
}
|
555
|
+
|
556
|
+
// Don't count heatmap series as they are handled differently.
|
557
|
+
// In the future we should make the heatmap/treemap path compatible
|
558
|
+
// with forcing. See #9636.
|
559
|
+
if (series.type === 'heatmap') {
|
560
|
+
continue;
|
561
|
+
}
|
562
|
+
|
563
|
+
if (boostableMap[series.type]) {
|
564
|
+
++canBoostCount;
|
565
|
+
}
|
566
|
+
|
567
|
+
if (patientMax(
|
568
|
+
series.processedXData,
|
569
|
+
series.options.data,
|
570
|
+
// series.xData,
|
571
|
+
series.points
|
572
|
+
) >= (series.options.boostThreshold || Number.MAX_VALUE)) {
|
573
|
+
++sboostCount;
|
574
|
+
}
|
575
|
+
}
|
576
|
+
}
|
577
|
+
|
578
|
+
chart.boostForceChartBoost = allowBoostForce && (
|
579
|
+
(
|
580
|
+
canBoostCount === chart.series.length &&
|
581
|
+
sboostCount > 0
|
582
|
+
) ||
|
583
|
+
sboostCount > 5
|
584
|
+
);
|
585
|
+
|
586
|
+
return chart.boostForceChartBoost;
|
587
|
+
}
|
588
|
+
|
589
|
+
/**
|
590
|
+
* Return true if ths boost.enabled option is true
|
591
|
+
*
|
592
|
+
* @private
|
593
|
+
* @function boostEnabled
|
594
|
+
*
|
595
|
+
* @param {Highcharts.Chart} chart
|
596
|
+
* The chart
|
597
|
+
*
|
598
|
+
* @return {boolean}
|
599
|
+
*/
|
600
|
+
function boostEnabled(chart) {
|
601
|
+
return pick(
|
602
|
+
(
|
603
|
+
chart &&
|
604
|
+
chart.options &&
|
605
|
+
chart.options.boost &&
|
606
|
+
chart.options.boost.enabled
|
607
|
+
),
|
608
|
+
true
|
609
|
+
);
|
610
|
+
}
|
611
|
+
|
612
|
+
/**
|
613
|
+
* Returns true if the chart is in series boost mode.
|
614
|
+
*
|
615
|
+
* @function Highcharts.Chart#isChartSeriesBoosting
|
616
|
+
*
|
617
|
+
* @param {Highcharts.Chart} chart
|
618
|
+
* the chart to check
|
619
|
+
*
|
620
|
+
* @return {boolean}
|
621
|
+
* true if the chart is in series boost mode
|
622
|
+
*/
|
623
|
+
Chart.prototype.isChartSeriesBoosting = function () {
|
624
|
+
var isSeriesBoosting,
|
625
|
+
threshold = pick(
|
626
|
+
this.options.boost && this.options.boost.seriesThreshold,
|
627
|
+
50
|
628
|
+
);
|
629
|
+
|
630
|
+
isSeriesBoosting = threshold <= this.series.length ||
|
631
|
+
shouldForceChartSeriesBoosting(this);
|
632
|
+
|
633
|
+
return isSeriesBoosting;
|
634
|
+
};
|
635
|
+
|
636
|
+
/**
|
637
|
+
* Get the clip rectangle for a target, either a series or the chart. For the
|
638
|
+
* chart, we need to consider the maximum extent of its Y axes, in case of
|
639
|
+
* Highstock panes and navigator.
|
640
|
+
*
|
641
|
+
* @private
|
642
|
+
* @function Highcharts.Chart#getBoostClipRect
|
643
|
+
*
|
644
|
+
* @param {Highcharts.Chart} target
|
645
|
+
*
|
646
|
+
* @return {Highcharts.BBoxObject}
|
647
|
+
*/
|
648
|
+
Chart.prototype.getBoostClipRect = function (target) {
|
649
|
+
var clipBox = {
|
650
|
+
x: this.plotLeft,
|
651
|
+
y: this.plotTop,
|
652
|
+
width: this.plotWidth,
|
653
|
+
height: this.plotHeight
|
654
|
+
};
|
655
|
+
|
656
|
+
if (target === this) {
|
657
|
+
this.yAxis.forEach(function (yAxis) {
|
658
|
+
clipBox.y = Math.min(yAxis.pos, clipBox.y);
|
659
|
+
clipBox.height = Math.max(
|
660
|
+
yAxis.pos - this.plotTop + yAxis.len,
|
661
|
+
clipBox.height
|
662
|
+
);
|
663
|
+
}, this);
|
664
|
+
}
|
665
|
+
|
666
|
+
return clipBox;
|
667
|
+
};
|
668
|
+
|
669
|
+
/*
|
670
|
+
* Returns true if the series is in boost mode
|
671
|
+
* @param series {Highchart.Series} - the series to check
|
672
|
+
* @returns {boolean} - true if the series is in boost mode
|
673
|
+
*/
|
674
|
+
/*
|
675
|
+
function isSeriesBoosting(series, overrideThreshold) {
|
676
|
+
return isChartSeriesBoosting(series.chart) ||
|
677
|
+
patientMax(
|
678
|
+
series.processedXData,
|
679
|
+
series.options.data,
|
680
|
+
series.points
|
681
|
+
) >= (
|
682
|
+
overrideThreshold ||
|
683
|
+
series.options.boostThreshold ||
|
684
|
+
Number.MAX_VALUE
|
685
|
+
);
|
686
|
+
}
|
687
|
+
*/
|
688
|
+
|
689
|
+
// START OF WEBGL ABSTRACTIONS
|
690
|
+
|
691
|
+
/**
|
692
|
+
* A static shader mimicing axis translation functions found in parts/Axis
|
693
|
+
*
|
694
|
+
* @private
|
695
|
+
* @function GLShader
|
696
|
+
*
|
697
|
+
* @param {WebGLContext} gl
|
698
|
+
* the context in which the shader is active
|
699
|
+
*
|
700
|
+
* @return {*}
|
701
|
+
*/
|
702
|
+
function GLShader(gl) {
|
703
|
+
var vertShade = [
|
704
|
+
/* eslint-disable */
|
705
|
+
'#version 100',
|
706
|
+
'precision highp float;',
|
707
|
+
|
708
|
+
'attribute vec4 aVertexPosition;',
|
709
|
+
'attribute vec4 aColor;',
|
710
|
+
|
711
|
+
'varying highp vec2 position;',
|
712
|
+
'varying highp vec4 vColor;',
|
713
|
+
|
714
|
+
'uniform mat4 uPMatrix;',
|
715
|
+
'uniform float pSize;',
|
716
|
+
|
717
|
+
'uniform float translatedThreshold;',
|
718
|
+
'uniform bool hasThreshold;',
|
719
|
+
|
720
|
+
'uniform bool skipTranslation;',
|
721
|
+
|
722
|
+
'uniform float plotHeight;',
|
723
|
+
|
724
|
+
'uniform float xAxisTrans;',
|
725
|
+
'uniform float xAxisMin;',
|
726
|
+
'uniform float xAxisMinPad;',
|
727
|
+
'uniform float xAxisPointRange;',
|
728
|
+
'uniform float xAxisLen;',
|
729
|
+
'uniform bool xAxisPostTranslate;',
|
730
|
+
'uniform float xAxisOrdinalSlope;',
|
731
|
+
'uniform float xAxisOrdinalOffset;',
|
732
|
+
'uniform float xAxisPos;',
|
733
|
+
'uniform bool xAxisCVSCoord;',
|
734
|
+
|
735
|
+
'uniform float yAxisTrans;',
|
736
|
+
'uniform float yAxisMin;',
|
737
|
+
'uniform float yAxisMinPad;',
|
738
|
+
'uniform float yAxisPointRange;',
|
739
|
+
'uniform float yAxisLen;',
|
740
|
+
'uniform bool yAxisPostTranslate;',
|
741
|
+
'uniform float yAxisOrdinalSlope;',
|
742
|
+
'uniform float yAxisOrdinalOffset;',
|
743
|
+
'uniform float yAxisPos;',
|
744
|
+
'uniform bool yAxisCVSCoord;',
|
745
|
+
|
746
|
+
'uniform bool isBubble;',
|
747
|
+
'uniform bool bubbleSizeByArea;',
|
748
|
+
'uniform float bubbleZMin;',
|
749
|
+
'uniform float bubbleZMax;',
|
750
|
+
'uniform float bubbleZThreshold;',
|
751
|
+
'uniform float bubbleMinSize;',
|
752
|
+
'uniform float bubbleMaxSize;',
|
753
|
+
'uniform bool bubbleSizeAbs;',
|
754
|
+
'uniform bool isInverted;',
|
755
|
+
|
756
|
+
'float bubbleRadius(){',
|
757
|
+
'float value = aVertexPosition.w;',
|
758
|
+
'float zMax = bubbleZMax;',
|
759
|
+
'float zMin = bubbleZMin;',
|
760
|
+
'float radius = 0.0;',
|
761
|
+
'float pos = 0.0;',
|
762
|
+
'float zRange = zMax - zMin;',
|
763
|
+
|
764
|
+
'if (bubbleSizeAbs){',
|
765
|
+
'value = value - bubbleZThreshold;',
|
766
|
+
'zMax = max(zMax - bubbleZThreshold, zMin - bubbleZThreshold);',
|
767
|
+
'zMin = 0.0;',
|
768
|
+
'}',
|
769
|
+
|
770
|
+
'if (value < zMin){',
|
771
|
+
'radius = bubbleZMin / 2.0 - 1.0;',
|
772
|
+
'} else {',
|
773
|
+
'pos = zRange > 0.0 ? (value - zMin) / zRange : 0.5;',
|
774
|
+
'if (bubbleSizeByArea && pos > 0.0){',
|
775
|
+
'pos = sqrt(pos);',
|
776
|
+
'}',
|
777
|
+
'radius = ceil(bubbleMinSize + pos * (bubbleMaxSize - bubbleMinSize)) / 2.0;',
|
778
|
+
'}',
|
779
|
+
|
780
|
+
'return radius * 2.0;',
|
781
|
+
'}',
|
782
|
+
|
783
|
+
'float translate(float val,',
|
784
|
+
'float pointPlacement,',
|
785
|
+
'float localA,',
|
786
|
+
'float localMin,',
|
787
|
+
'float minPixelPadding,',
|
788
|
+
'float pointRange,',
|
789
|
+
'float len,',
|
790
|
+
'bool cvsCoord',
|
791
|
+
'){',
|
792
|
+
|
793
|
+
'float sign = 1.0;',
|
794
|
+
'float cvsOffset = 0.0;',
|
795
|
+
|
796
|
+
'if (cvsCoord) {',
|
797
|
+
'sign *= -1.0;',
|
798
|
+
'cvsOffset = len;',
|
799
|
+
'}',
|
800
|
+
|
801
|
+
'return sign * (val - localMin) * localA + cvsOffset + ',
|
802
|
+
'(sign * minPixelPadding);',//' + localA * pointPlacement * pointRange;',
|
803
|
+
'}',
|
804
|
+
|
805
|
+
'float xToPixels(float value){',
|
806
|
+
'if (skipTranslation){',
|
807
|
+
'return value;// + xAxisPos;',
|
808
|
+
'}',
|
809
|
+
|
810
|
+
'return translate(value, 0.0, xAxisTrans, xAxisMin, xAxisMinPad, xAxisPointRange, xAxisLen, xAxisCVSCoord);// + xAxisPos;',
|
811
|
+
'}',
|
812
|
+
|
813
|
+
'float yToPixels(float value, float checkTreshold){',
|
814
|
+
'float v;',
|
815
|
+
'if (skipTranslation){',
|
816
|
+
'v = value;// + yAxisPos;',
|
817
|
+
'} else {',
|
818
|
+
'v = translate(value, 0.0, yAxisTrans, yAxisMin, yAxisMinPad, yAxisPointRange, yAxisLen, yAxisCVSCoord);// + yAxisPos;',
|
819
|
+
'if (v > plotHeight) {',
|
820
|
+
'v = plotHeight;',
|
821
|
+
'}',
|
822
|
+
'}',
|
823
|
+
'if (checkTreshold > 0.0 && hasThreshold) {',
|
824
|
+
'v = min(v, translatedThreshold);',
|
825
|
+
'}',
|
826
|
+
'return v;',
|
827
|
+
'}',
|
828
|
+
|
829
|
+
'void main(void) {',
|
830
|
+
'if (isBubble){',
|
831
|
+
'gl_PointSize = bubbleRadius();',
|
832
|
+
'} else {',
|
833
|
+
'gl_PointSize = pSize;',
|
834
|
+
'}',
|
835
|
+
//'gl_PointSize = 10.0;',
|
836
|
+
'vColor = aColor;',
|
837
|
+
|
838
|
+
'if (isInverted) {',
|
839
|
+
'gl_Position = uPMatrix * vec4(xToPixels(aVertexPosition.y) + yAxisPos, yToPixels(aVertexPosition.x, aVertexPosition.z) + xAxisPos, 0.0, 1.0);',
|
840
|
+
'} else {',
|
841
|
+
'gl_Position = uPMatrix * vec4(xToPixels(aVertexPosition.x) + xAxisPos, yToPixels(aVertexPosition.y, aVertexPosition.z) + yAxisPos, 0.0, 1.0);',
|
842
|
+
'}',
|
843
|
+
//'gl_Position = uPMatrix * vec4(aVertexPosition.x, aVertexPosition.y, 0.0, 1.0);',
|
844
|
+
'}'
|
845
|
+
/* eslint-enable */
|
846
|
+
].join('\n'),
|
847
|
+
// Fragment shader source
|
848
|
+
fragShade = [
|
849
|
+
/* eslint-disable */
|
850
|
+
'precision highp float;',
|
851
|
+
'uniform vec4 fillColor;',
|
852
|
+
'varying highp vec2 position;',
|
853
|
+
'varying highp vec4 vColor;',
|
854
|
+
'uniform sampler2D uSampler;',
|
855
|
+
'uniform bool isCircle;',
|
856
|
+
'uniform bool hasColor;',
|
857
|
+
|
858
|
+
// 'vec4 toColor(float value, vec2 point) {',
|
859
|
+
// 'return vec4(0.0, 0.0, 0.0, 0.0);',
|
860
|
+
// '}',
|
861
|
+
|
862
|
+
'void main(void) {',
|
863
|
+
'vec4 col = fillColor;',
|
864
|
+
'vec4 tcol;',
|
865
|
+
|
866
|
+
'if (hasColor) {',
|
867
|
+
'col = vColor;',
|
868
|
+
'}',
|
869
|
+
|
870
|
+
'if (isCircle) {',
|
871
|
+
'tcol = texture2D(uSampler, gl_PointCoord.st);',
|
872
|
+
'col *= tcol;',
|
873
|
+
'if (tcol.r < 0.0) {',
|
874
|
+
'discard;',
|
875
|
+
'} else {',
|
876
|
+
'gl_FragColor = col;',
|
877
|
+
'}',
|
878
|
+
'} else {',
|
879
|
+
'gl_FragColor = col;',
|
880
|
+
'}',
|
881
|
+
'}'
|
882
|
+
/* eslint-enable */
|
883
|
+
].join('\n'),
|
884
|
+
uLocations = {},
|
885
|
+
// The shader program
|
886
|
+
shaderProgram,
|
887
|
+
// Uniform handle to the perspective matrix
|
888
|
+
pUniform,
|
889
|
+
// Uniform for point size
|
890
|
+
psUniform,
|
891
|
+
// Uniform for fill color
|
892
|
+
fillColorUniform,
|
893
|
+
// Uniform for isBubble
|
894
|
+
isBubbleUniform,
|
895
|
+
// Uniform for bubble abs sizing
|
896
|
+
bubbleSizeAbsUniform,
|
897
|
+
bubbleSizeAreaUniform,
|
898
|
+
// Skip translation uniform
|
899
|
+
skipTranslationUniform,
|
900
|
+
// Set to 1 if circle
|
901
|
+
isCircleUniform,
|
902
|
+
// Uniform for invertion
|
903
|
+
isInverted,
|
904
|
+
plotHeightUniform,
|
905
|
+
// Error stack
|
906
|
+
errors = [],
|
907
|
+
// Texture uniform
|
908
|
+
uSamplerUniform;
|
909
|
+
|
910
|
+
/*
|
911
|
+
* Handle errors accumulated in errors stack
|
912
|
+
*/
|
913
|
+
function handleErrors() {
|
914
|
+
if (errors.length) {
|
915
|
+
H.error('[highcharts boost] shader error - ' + errors.join('\n'));
|
916
|
+
}
|
917
|
+
}
|
918
|
+
|
919
|
+
/* String to shader program
|
920
|
+
* @param {string} str - the program source
|
921
|
+
* @param {string} type - the program type: either `vertex` or `fragment`
|
922
|
+
* @returns {bool|shader}
|
923
|
+
*/
|
924
|
+
function stringToProgram(str, type) {
|
925
|
+
var t = type === 'vertex' ? gl.VERTEX_SHADER : gl.FRAGMENT_SHADER,
|
926
|
+
shader = gl.createShader(t);
|
927
|
+
|
928
|
+
gl.shaderSource(shader, str);
|
929
|
+
gl.compileShader(shader);
|
930
|
+
|
931
|
+
if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
|
932
|
+
errors.push(
|
933
|
+
'when compiling ' +
|
934
|
+
type +
|
935
|
+
' shader:\n' +
|
936
|
+
gl.getShaderInfoLog(shader)
|
937
|
+
);
|
938
|
+
|
939
|
+
return false;
|
940
|
+
}
|
941
|
+
return shader;
|
942
|
+
}
|
943
|
+
|
944
|
+
/*
|
945
|
+
* Create the shader.
|
946
|
+
* Loads the shader program statically defined above
|
947
|
+
*/
|
948
|
+
function createShader() {
|
949
|
+
var v = stringToProgram(vertShade, 'vertex'),
|
950
|
+
f = stringToProgram(fragShade, 'fragment');
|
951
|
+
|
952
|
+
if (!v || !f) {
|
953
|
+
shaderProgram = false;
|
954
|
+
handleErrors();
|
955
|
+
return false;
|
956
|
+
}
|
957
|
+
|
958
|
+
function uloc(n) {
|
959
|
+
return gl.getUniformLocation(shaderProgram, n);
|
960
|
+
}
|
961
|
+
|
962
|
+
shaderProgram = gl.createProgram();
|
963
|
+
|
964
|
+
gl.attachShader(shaderProgram, v);
|
965
|
+
gl.attachShader(shaderProgram, f);
|
966
|
+
|
967
|
+
gl.linkProgram(shaderProgram);
|
968
|
+
|
969
|
+
if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
|
970
|
+
errors.push(gl.getProgramInfoLog(shaderProgram));
|
971
|
+
handleErrors();
|
972
|
+
shaderProgram = false;
|
973
|
+
return false;
|
974
|
+
}
|
975
|
+
|
976
|
+
gl.useProgram(shaderProgram);
|
977
|
+
|
978
|
+
gl.bindAttribLocation(shaderProgram, 0, 'aVertexPosition');
|
979
|
+
|
980
|
+
pUniform = uloc('uPMatrix');
|
981
|
+
psUniform = uloc('pSize');
|
982
|
+
fillColorUniform = uloc('fillColor');
|
983
|
+
isBubbleUniform = uloc('isBubble');
|
984
|
+
bubbleSizeAbsUniform = uloc('bubbleSizeAbs');
|
985
|
+
bubbleSizeAreaUniform = uloc('bubbleSizeByArea');
|
986
|
+
uSamplerUniform = uloc('uSampler');
|
987
|
+
skipTranslationUniform = uloc('skipTranslation');
|
988
|
+
isCircleUniform = uloc('isCircle');
|
989
|
+
isInverted = uloc('isInverted');
|
990
|
+
plotHeightUniform = uloc('plotHeight');
|
991
|
+
|
992
|
+
return true;
|
993
|
+
}
|
994
|
+
|
995
|
+
/*
|
996
|
+
* Destroy the shader
|
997
|
+
*/
|
998
|
+
function destroy() {
|
999
|
+
if (gl && shaderProgram) {
|
1000
|
+
gl.deleteProgram(shaderProgram);
|
1001
|
+
shaderProgram = false;
|
1002
|
+
}
|
1003
|
+
}
|
1004
|
+
|
1005
|
+
/*
|
1006
|
+
* Bind the shader.
|
1007
|
+
* This makes the shader the active one until another one is bound,
|
1008
|
+
* or until 0 is bound.
|
1009
|
+
*/
|
1010
|
+
function bind() {
|
1011
|
+
if (gl && shaderProgram) {
|
1012
|
+
gl.useProgram(shaderProgram);
|
1013
|
+
}
|
1014
|
+
}
|
1015
|
+
|
1016
|
+
/*
|
1017
|
+
* Set a uniform value.
|
1018
|
+
* This uses a hash map to cache uniform locations.
|
1019
|
+
* @param name {string} - the name of the uniform to set
|
1020
|
+
* @param val {float} - the value to set
|
1021
|
+
*/
|
1022
|
+
function setUniform(name, val) {
|
1023
|
+
if (gl && shaderProgram) {
|
1024
|
+
var u = uLocations[name] = uLocations[name] ||
|
1025
|
+
gl.getUniformLocation(
|
1026
|
+
shaderProgram,
|
1027
|
+
name
|
1028
|
+
);
|
1029
|
+
|
1030
|
+
gl.uniform1f(u, val);
|
1031
|
+
}
|
1032
|
+
}
|
1033
|
+
|
1034
|
+
/*
|
1035
|
+
* Set the active texture
|
1036
|
+
* @param texture - the texture
|
1037
|
+
*/
|
1038
|
+
function setTexture(texture) {
|
1039
|
+
if (gl && shaderProgram) {
|
1040
|
+
gl.uniform1i(uSamplerUniform, texture);
|
1041
|
+
}
|
1042
|
+
}
|
1043
|
+
|
1044
|
+
/*
|
1045
|
+
* Set if inversion state
|
1046
|
+
* @flag is the state
|
1047
|
+
*/
|
1048
|
+
function setInverted(flag) {
|
1049
|
+
if (gl && shaderProgram) {
|
1050
|
+
gl.uniform1i(isInverted, flag);
|
1051
|
+
}
|
1052
|
+
}
|
1053
|
+
|
1054
|
+
/*
|
1055
|
+
* Enable/disable circle drawing
|
1056
|
+
*/
|
1057
|
+
function setDrawAsCircle(flag) {
|
1058
|
+
if (gl && shaderProgram) {
|
1059
|
+
gl.uniform1i(isCircleUniform, flag ? 1 : 0);
|
1060
|
+
}
|
1061
|
+
}
|
1062
|
+
|
1063
|
+
function setPlotHeight(n) {
|
1064
|
+
if (gl && shaderProgram) {
|
1065
|
+
gl.uniform1f(plotHeightUniform, n);
|
1066
|
+
}
|
1067
|
+
}
|
1068
|
+
|
1069
|
+
/*
|
1070
|
+
* Flush
|
1071
|
+
*/
|
1072
|
+
function reset() {
|
1073
|
+
if (gl && shaderProgram) {
|
1074
|
+
gl.uniform1i(isBubbleUniform, 0);
|
1075
|
+
gl.uniform1i(isCircleUniform, 0);
|
1076
|
+
}
|
1077
|
+
}
|
1078
|
+
|
1079
|
+
/*
|
1080
|
+
* Set bubble uniforms
|
1081
|
+
* @param series {Highcharts.Series} - the series to use
|
1082
|
+
*/
|
1083
|
+
function setBubbleUniforms(series, zCalcMin, zCalcMax) {
|
1084
|
+
var seriesOptions = series.options,
|
1085
|
+
zMin = Number.MAX_VALUE,
|
1086
|
+
zMax = -Number.MAX_VALUE;
|
1087
|
+
|
1088
|
+
if (gl && shaderProgram && series.type === 'bubble') {
|
1089
|
+
zMin = pick(seriesOptions.zMin, Math.min(
|
1090
|
+
zMin,
|
1091
|
+
Math.max(
|
1092
|
+
zCalcMin,
|
1093
|
+
seriesOptions.displayNegative === false ?
|
1094
|
+
seriesOptions.zThreshold : -Number.MAX_VALUE
|
1095
|
+
)
|
1096
|
+
));
|
1097
|
+
|
1098
|
+
zMax = pick(seriesOptions.zMax, Math.max(zMax, zCalcMax));
|
1099
|
+
|
1100
|
+
gl.uniform1i(isBubbleUniform, 1);
|
1101
|
+
gl.uniform1i(isCircleUniform, 1);
|
1102
|
+
gl.uniform1i(
|
1103
|
+
bubbleSizeAreaUniform,
|
1104
|
+
series.options.sizeBy !== 'width'
|
1105
|
+
);
|
1106
|
+
gl.uniform1i(
|
1107
|
+
bubbleSizeAbsUniform,
|
1108
|
+
series.options.sizeByAbsoluteValue
|
1109
|
+
);
|
1110
|
+
|
1111
|
+
setUniform('bubbleZMin', zMin);
|
1112
|
+
setUniform('bubbleZMax', zMax);
|
1113
|
+
setUniform('bubbleZThreshold', series.options.zThreshold);
|
1114
|
+
setUniform('bubbleMinSize', series.minPxSize);
|
1115
|
+
setUniform('bubbleMaxSize', series.maxPxSize);
|
1116
|
+
}
|
1117
|
+
}
|
1118
|
+
|
1119
|
+
/*
|
1120
|
+
* Set the Color uniform.
|
1121
|
+
* @param color {Array<float>} - an array with RGBA values
|
1122
|
+
*/
|
1123
|
+
function setColor(color) {
|
1124
|
+
if (gl && shaderProgram) {
|
1125
|
+
gl.uniform4f(
|
1126
|
+
fillColorUniform,
|
1127
|
+
color[0] / 255.0,
|
1128
|
+
color[1] / 255.0,
|
1129
|
+
color[2] / 255.0,
|
1130
|
+
color[3]
|
1131
|
+
);
|
1132
|
+
}
|
1133
|
+
}
|
1134
|
+
|
1135
|
+
/*
|
1136
|
+
* Set skip translation
|
1137
|
+
*/
|
1138
|
+
function setSkipTranslation(flag) {
|
1139
|
+
if (gl && shaderProgram) {
|
1140
|
+
gl.uniform1i(skipTranslationUniform, flag === true ? 1 : 0);
|
1141
|
+
}
|
1142
|
+
}
|
1143
|
+
|
1144
|
+
/*
|
1145
|
+
* Set the perspective matrix
|
1146
|
+
* @param m {Matrix4x4} - the matrix
|
1147
|
+
*/
|
1148
|
+
function setPMatrix(m) {
|
1149
|
+
if (gl && shaderProgram) {
|
1150
|
+
gl.uniformMatrix4fv(pUniform, false, m);
|
1151
|
+
}
|
1152
|
+
}
|
1153
|
+
|
1154
|
+
/*
|
1155
|
+
* Set the point size.
|
1156
|
+
* @param p {float} - point size
|
1157
|
+
*/
|
1158
|
+
function setPointSize(p) {
|
1159
|
+
if (gl && shaderProgram) {
|
1160
|
+
gl.uniform1f(psUniform, p);
|
1161
|
+
}
|
1162
|
+
}
|
1163
|
+
|
1164
|
+
/*
|
1165
|
+
* Get the shader program handle
|
1166
|
+
* @returns {GLInt} - the handle for the program
|
1167
|
+
*/
|
1168
|
+
function getProgram() {
|
1169
|
+
return shaderProgram;
|
1170
|
+
}
|
1171
|
+
|
1172
|
+
if (gl) {
|
1173
|
+
if (!createShader()) {
|
1174
|
+
return false;
|
1175
|
+
}
|
1176
|
+
}
|
1177
|
+
|
1178
|
+
return {
|
1179
|
+
psUniform: function () {
|
1180
|
+
return psUniform;
|
1181
|
+
},
|
1182
|
+
pUniform: function () {
|
1183
|
+
return pUniform;
|
1184
|
+
},
|
1185
|
+
fillColorUniform: function () {
|
1186
|
+
return fillColorUniform;
|
1187
|
+
},
|
1188
|
+
setPlotHeight: setPlotHeight,
|
1189
|
+
setBubbleUniforms: setBubbleUniforms,
|
1190
|
+
bind: bind,
|
1191
|
+
program: getProgram,
|
1192
|
+
create: createShader,
|
1193
|
+
setUniform: setUniform,
|
1194
|
+
setPMatrix: setPMatrix,
|
1195
|
+
setColor: setColor,
|
1196
|
+
setPointSize: setPointSize,
|
1197
|
+
setSkipTranslation: setSkipTranslation,
|
1198
|
+
setTexture: setTexture,
|
1199
|
+
setDrawAsCircle: setDrawAsCircle,
|
1200
|
+
reset: reset,
|
1201
|
+
setInverted: setInverted,
|
1202
|
+
destroy: destroy
|
1203
|
+
};
|
1204
|
+
}
|
1205
|
+
|
1206
|
+
/**
|
1207
|
+
* Vertex Buffer abstraction.
|
1208
|
+
* A vertex buffer is a set of vertices which are passed to the GPU
|
1209
|
+
* in a single call.
|
1210
|
+
*
|
1211
|
+
* @private
|
1212
|
+
* @function GLVertexBuffer
|
1213
|
+
*
|
1214
|
+
* @param {WebGLContext} gl
|
1215
|
+
* the context in which to create the buffer
|
1216
|
+
*
|
1217
|
+
* @param {GLShader} shader
|
1218
|
+
* the shader to use
|
1219
|
+
*
|
1220
|
+
* @return {*}
|
1221
|
+
*/
|
1222
|
+
function GLVertexBuffer(gl, shader, dataComponents /* , type */) {
|
1223
|
+
var buffer = false,
|
1224
|
+
vertAttribute = false,
|
1225
|
+
components = dataComponents || 2,
|
1226
|
+
preAllocated = false,
|
1227
|
+
iterator = 0,
|
1228
|
+
// farray = false,
|
1229
|
+
data;
|
1230
|
+
|
1231
|
+
// type = type || 'float';
|
1232
|
+
|
1233
|
+
function destroy() {
|
1234
|
+
if (buffer) {
|
1235
|
+
gl.deleteBuffer(buffer);
|
1236
|
+
buffer = false;
|
1237
|
+
vertAttribute = false;
|
1238
|
+
}
|
1239
|
+
|
1240
|
+
iterator = 0;
|
1241
|
+
components = dataComponents || 2;
|
1242
|
+
data = [];
|
1243
|
+
}
|
1244
|
+
|
1245
|
+
/*
|
1246
|
+
* Build the buffer
|
1247
|
+
* @param dataIn {Array<float>} - a 0 padded array of indices
|
1248
|
+
* @param attrib {String} - the name of the Attribute to bind the buffer to
|
1249
|
+
* @param dataComponents {Integer} - the number of components per. indice
|
1250
|
+
*/
|
1251
|
+
function build(dataIn, attrib, dataComponents) {
|
1252
|
+
var farray;
|
1253
|
+
|
1254
|
+
data = dataIn || [];
|
1255
|
+
|
1256
|
+
if ((!data || data.length === 0) && !preAllocated) {
|
1257
|
+
// console.error('trying to render empty vbuffer');
|
1258
|
+
destroy();
|
1259
|
+
return false;
|
1260
|
+
}
|
1261
|
+
|
1262
|
+
components = dataComponents || components;
|
1263
|
+
|
1264
|
+
if (buffer) {
|
1265
|
+
gl.deleteBuffer(buffer);
|
1266
|
+
}
|
1267
|
+
|
1268
|
+
if (!preAllocated) {
|
1269
|
+
farray = new Float32Array(data);
|
1270
|
+
}
|
1271
|
+
|
1272
|
+
buffer = gl.createBuffer();
|
1273
|
+
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
1274
|
+
gl.bufferData(
|
1275
|
+
gl.ARRAY_BUFFER,
|
1276
|
+
preAllocated || farray,
|
1277
|
+
gl.STATIC_DRAW
|
1278
|
+
);
|
1279
|
+
|
1280
|
+
// gl.bindAttribLocation(shader.program(), 0, 'aVertexPosition');
|
1281
|
+
vertAttribute = gl.getAttribLocation(shader.program(), attrib);
|
1282
|
+
gl.enableVertexAttribArray(vertAttribute);
|
1283
|
+
|
1284
|
+
// Trigger cleanup
|
1285
|
+
farray = false;
|
1286
|
+
|
1287
|
+
return true;
|
1288
|
+
}
|
1289
|
+
|
1290
|
+
/*
|
1291
|
+
* Bind the buffer
|
1292
|
+
*/
|
1293
|
+
function bind() {
|
1294
|
+
if (!buffer) {
|
1295
|
+
return false;
|
1296
|
+
}
|
1297
|
+
|
1298
|
+
// gl.bindAttribLocation(shader.program(), 0, 'aVertexPosition');
|
1299
|
+
// gl.enableVertexAttribArray(vertAttribute);
|
1300
|
+
// gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
1301
|
+
gl.vertexAttribPointer(
|
1302
|
+
vertAttribute, components, gl.FLOAT, false, 0, 0
|
1303
|
+
);
|
1304
|
+
// gl.enableVertexAttribArray(vertAttribute);
|
1305
|
+
}
|
1306
|
+
|
1307
|
+
/*
|
1308
|
+
* Render the buffer
|
1309
|
+
* @param from {Integer} - the start indice
|
1310
|
+
* @param to {Integer} - the end indice
|
1311
|
+
* @param drawMode {String} - the draw mode
|
1312
|
+
*/
|
1313
|
+
function render(from, to, drawMode) {
|
1314
|
+
var length = preAllocated ? preAllocated.length : data.length;
|
1315
|
+
|
1316
|
+
if (!buffer) {
|
1317
|
+
return false;
|
1318
|
+
}
|
1319
|
+
|
1320
|
+
if (!length) {
|
1321
|
+
return false;
|
1322
|
+
}
|
1323
|
+
|
1324
|
+
if (!from || from > length || from < 0) {
|
1325
|
+
from = 0;
|
1326
|
+
}
|
1327
|
+
|
1328
|
+
if (!to || to > length) {
|
1329
|
+
to = length;
|
1330
|
+
}
|
1331
|
+
|
1332
|
+
drawMode = drawMode || 'points';
|
1333
|
+
|
1334
|
+
gl.drawArrays(
|
1335
|
+
gl[drawMode.toUpperCase()],
|
1336
|
+
from / components,
|
1337
|
+
(to - from) / components
|
1338
|
+
);
|
1339
|
+
|
1340
|
+
return true;
|
1341
|
+
}
|
1342
|
+
|
1343
|
+
function push(x, y, a, b) {
|
1344
|
+
if (preAllocated) { // && iterator <= preAllocated.length - 4) {
|
1345
|
+
preAllocated[++iterator] = x;
|
1346
|
+
preAllocated[++iterator] = y;
|
1347
|
+
preAllocated[++iterator] = a;
|
1348
|
+
preAllocated[++iterator] = b;
|
1349
|
+
}
|
1350
|
+
}
|
1351
|
+
|
1352
|
+
/*
|
1353
|
+
* Note about pre-allocated buffers:
|
1354
|
+
* - This is slower for charts with many series
|
1355
|
+
*/
|
1356
|
+
function allocate(size) {
|
1357
|
+
size *= 4;
|
1358
|
+
iterator = -1;
|
1359
|
+
|
1360
|
+
preAllocated = new Float32Array(size);
|
1361
|
+
}
|
1362
|
+
|
1363
|
+
// /////////////////////////////////////////////////////////////////////////
|
1364
|
+
return {
|
1365
|
+
destroy: destroy,
|
1366
|
+
bind: bind,
|
1367
|
+
data: data,
|
1368
|
+
build: build,
|
1369
|
+
render: render,
|
1370
|
+
allocate: allocate,
|
1371
|
+
push: push
|
1372
|
+
};
|
1373
|
+
}
|
1374
|
+
|
1375
|
+
/**
|
1376
|
+
* Main renderer. Used to render series.
|
1377
|
+
*
|
1378
|
+
* Notes to self:
|
1379
|
+
* - May be able to build a point map by rendering to a separate canvas and
|
1380
|
+
* encoding values in the color data.
|
1381
|
+
* - Need to figure out a way to transform the data quicker
|
1382
|
+
*
|
1383
|
+
* @private
|
1384
|
+
* @function GLRenderer
|
1385
|
+
*
|
1386
|
+
* @param {Function} postRenderCallback
|
1387
|
+
*
|
1388
|
+
* @return {*}
|
1389
|
+
*/
|
1390
|
+
function GLRenderer(postRenderCallback) {
|
1391
|
+
var // Shader
|
1392
|
+
shader = false,
|
1393
|
+
// Vertex buffers - keyed on shader attribute name
|
1394
|
+
vbuffer = false,
|
1395
|
+
// Opengl context
|
1396
|
+
gl = false,
|
1397
|
+
// Width of our viewport in pixels
|
1398
|
+
width = 0,
|
1399
|
+
// Height of our viewport in pixels
|
1400
|
+
height = 0,
|
1401
|
+
// The data to render - array of coordinates
|
1402
|
+
data = false,
|
1403
|
+
// The marker data
|
1404
|
+
markerData = false,
|
1405
|
+
// Exports
|
1406
|
+
exports = {},
|
1407
|
+
// Is it inited?
|
1408
|
+
isInited = false,
|
1409
|
+
// The series stack
|
1410
|
+
series = [],
|
1411
|
+
|
1412
|
+
// Texture handles
|
1413
|
+
textureHandles = {},
|
1414
|
+
|
1415
|
+
// Things to draw as "rectangles" (i.e lines)
|
1416
|
+
asBar = {
|
1417
|
+
'column': true,
|
1418
|
+
'columnrange': true,
|
1419
|
+
'bar': true,
|
1420
|
+
'area': true,
|
1421
|
+
'arearange': true
|
1422
|
+
},
|
1423
|
+
asCircle = {
|
1424
|
+
'scatter': true,
|
1425
|
+
'bubble': true
|
1426
|
+
},
|
1427
|
+
// Render settings
|
1428
|
+
settings = {
|
1429
|
+
pointSize: 1,
|
1430
|
+
lineWidth: 1,
|
1431
|
+
fillColor: '#AA00AA',
|
1432
|
+
useAlpha: true,
|
1433
|
+
usePreallocated: false,
|
1434
|
+
useGPUTranslations: false,
|
1435
|
+
debug: {
|
1436
|
+
timeRendering: false,
|
1437
|
+
timeSeriesProcessing: false,
|
1438
|
+
timeSetup: false,
|
1439
|
+
timeBufferCopy: false,
|
1440
|
+
timeKDTree: false,
|
1441
|
+
showSkipSummary: false
|
1442
|
+
}
|
1443
|
+
};
|
1444
|
+
|
1445
|
+
// /////////////////////////////////////////////////////////////////////////
|
1446
|
+
|
1447
|
+
function setOptions(options) {
|
1448
|
+
merge(true, settings, options);
|
1449
|
+
}
|
1450
|
+
|
1451
|
+
function seriesPointCount(series) {
|
1452
|
+
var isStacked,
|
1453
|
+
xData,
|
1454
|
+
s;
|
1455
|
+
|
1456
|
+
if (series.isSeriesBoosting) {
|
1457
|
+
isStacked = !!series.options.stacking;
|
1458
|
+
xData = (
|
1459
|
+
series.xData ||
|
1460
|
+
series.options.xData ||
|
1461
|
+
series.processedXData
|
1462
|
+
);
|
1463
|
+
s = (isStacked ? series.data : (xData || series.options.data))
|
1464
|
+
.length;
|
1465
|
+
|
1466
|
+
if (series.type === 'treemap') {
|
1467
|
+
s *= 12;
|
1468
|
+
} else if (series.type === 'heatmap') {
|
1469
|
+
s *= 6;
|
1470
|
+
} else if (asBar[series.type]) {
|
1471
|
+
s *= 2;
|
1472
|
+
}
|
1473
|
+
|
1474
|
+
return s;
|
1475
|
+
}
|
1476
|
+
|
1477
|
+
return 0;
|
1478
|
+
}
|
1479
|
+
|
1480
|
+
/* Allocate a float buffer to fit all series */
|
1481
|
+
function allocateBuffer(chart) {
|
1482
|
+
var s = 0;
|
1483
|
+
|
1484
|
+
if (!settings.usePreallocated) {
|
1485
|
+
return;
|
1486
|
+
}
|
1487
|
+
|
1488
|
+
chart.series.forEach(function (series) {
|
1489
|
+
if (series.isSeriesBoosting) {
|
1490
|
+
s += seriesPointCount(series);
|
1491
|
+
}
|
1492
|
+
});
|
1493
|
+
|
1494
|
+
vbuffer.allocate(s);
|
1495
|
+
}
|
1496
|
+
|
1497
|
+
function allocateBufferForSingleSeries(series) {
|
1498
|
+
var s = 0;
|
1499
|
+
|
1500
|
+
if (!settings.usePreallocated) {
|
1501
|
+
return;
|
1502
|
+
}
|
1503
|
+
|
1504
|
+
if (series.isSeriesBoosting) {
|
1505
|
+
s = seriesPointCount(series);
|
1506
|
+
}
|
1507
|
+
|
1508
|
+
vbuffer.allocate(s);
|
1509
|
+
}
|
1510
|
+
|
1511
|
+
/*
|
1512
|
+
* Returns an orthographic perspective matrix
|
1513
|
+
* @param {number} width - the width of the viewport in pixels
|
1514
|
+
* @param {number} height - the height of the viewport in pixels
|
1515
|
+
*/
|
1516
|
+
function orthoMatrix(width, height) {
|
1517
|
+
var near = 0,
|
1518
|
+
far = 1;
|
1519
|
+
|
1520
|
+
return [
|
1521
|
+
2 / width, 0, 0, 0,
|
1522
|
+
0, -(2 / height), 0, 0,
|
1523
|
+
0, 0, -2 / (far - near), 0,
|
1524
|
+
-1, 1, -(far + near) / (far - near), 1
|
1525
|
+
];
|
1526
|
+
}
|
1527
|
+
|
1528
|
+
/*
|
1529
|
+
* Clear the depth and color buffer
|
1530
|
+
*/
|
1531
|
+
function clear() {
|
1532
|
+
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
|
1533
|
+
}
|
1534
|
+
|
1535
|
+
/*
|
1536
|
+
* Get the WebGL context
|
1537
|
+
* @returns {WebGLContext} - the context
|
1538
|
+
*/
|
1539
|
+
function getGL() {
|
1540
|
+
return gl;
|
1541
|
+
}
|
1542
|
+
|
1543
|
+
/*
|
1544
|
+
* Push data for a single series
|
1545
|
+
* This calculates additional vertices and transforms the data to be
|
1546
|
+
* aligned correctly in memory
|
1547
|
+
*/
|
1548
|
+
function pushSeriesData(series, inst) {
|
1549
|
+
var isRange = series.pointArrayMap &&
|
1550
|
+
series.pointArrayMap.join(',') === 'low,high',
|
1551
|
+
chart = series.chart,
|
1552
|
+
options = series.options,
|
1553
|
+
isStacked = !!options.stacking,
|
1554
|
+
rawData = options.data,
|
1555
|
+
xExtremes = series.xAxis.getExtremes(),
|
1556
|
+
xMin = xExtremes.min,
|
1557
|
+
xMax = xExtremes.max,
|
1558
|
+
yExtremes = series.yAxis.getExtremes(),
|
1559
|
+
yMin = yExtremes.min,
|
1560
|
+
yMax = yExtremes.max,
|
1561
|
+
xData = series.xData || options.xData || series.processedXData,
|
1562
|
+
yData = series.yData || options.yData || series.processedYData,
|
1563
|
+
zData = series.zData || options.zData || series.processedZData,
|
1564
|
+
yAxis = series.yAxis,
|
1565
|
+
xAxis = series.xAxis,
|
1566
|
+
plotHeight = series.chart.plotHeight,
|
1567
|
+
plotWidth = series.chart.plotWidth,
|
1568
|
+
useRaw = !xData || xData.length === 0,
|
1569
|
+
// threshold = options.threshold,
|
1570
|
+
// yBottom = chart.yAxis[0].getThreshold(threshold),
|
1571
|
+
// hasThreshold = isNumber(threshold),
|
1572
|
+
// colorByPoint = series.options.colorByPoint,
|
1573
|
+
// This is required for color by point, so make sure this is
|
1574
|
+
// uncommented if enabling that
|
1575
|
+
// colorIndex = 0,
|
1576
|
+
// Required for color axis support
|
1577
|
+
// caxis,
|
1578
|
+
connectNulls = options.connectNulls,
|
1579
|
+
// For some reason eslint doesn't pick up that this is actually used
|
1580
|
+
maxVal, // eslint-disable-line no-unused-vars
|
1581
|
+
points = series.points || false,
|
1582
|
+
lastX = false,
|
1583
|
+
lastY = false,
|
1584
|
+
minVal,
|
1585
|
+
color,
|
1586
|
+
scolor,
|
1587
|
+
sdata = isStacked ? series.data : (xData || rawData),
|
1588
|
+
closestLeft = { x: Number.MAX_VALUE, y: 0 },
|
1589
|
+
closestRight = { x: -Number.MAX_VALUE, y: 0 },
|
1590
|
+
|
1591
|
+
skipped = 0,
|
1592
|
+
hadPoints = false,
|
1593
|
+
|
1594
|
+
cullXThreshold = 1,
|
1595
|
+
cullYThreshold = 1,
|
1596
|
+
|
1597
|
+
// The following are used in the builder while loop
|
1598
|
+
x,
|
1599
|
+
y,
|
1600
|
+
d,
|
1601
|
+
z,
|
1602
|
+
i = -1,
|
1603
|
+
px = false,
|
1604
|
+
nx = false,
|
1605
|
+
// This is in fact used.
|
1606
|
+
low, // eslint-disable-line no-unused-vars
|
1607
|
+
chartDestroyed = typeof chart.index === 'undefined',
|
1608
|
+
nextInside = false,
|
1609
|
+
prevInside = false,
|
1610
|
+
pcolor = false,
|
1611
|
+
drawAsBar = asBar[series.type],
|
1612
|
+
isXInside = false,
|
1613
|
+
isYInside = true,
|
1614
|
+
firstPoint = true,
|
1615
|
+
threshold = options.threshold;
|
1616
|
+
|
1617
|
+
if (options.boostData && options.boostData.length > 0) {
|
1618
|
+
return;
|
1619
|
+
}
|
1620
|
+
|
1621
|
+
if (chart.inverted) {
|
1622
|
+
plotHeight = series.chart.plotWidth;
|
1623
|
+
plotWidth = series.chart.plotHeight;
|
1624
|
+
}
|
1625
|
+
|
1626
|
+
series.closestPointRangePx = Number.MAX_VALUE;
|
1627
|
+
|
1628
|
+
// Push color to color buffer - need to do this per. vertex
|
1629
|
+
function pushColor(color) {
|
1630
|
+
if (color) {
|
1631
|
+
inst.colorData.push(color[0]);
|
1632
|
+
inst.colorData.push(color[1]);
|
1633
|
+
inst.colorData.push(color[2]);
|
1634
|
+
inst.colorData.push(color[3]);
|
1635
|
+
}
|
1636
|
+
}
|
1637
|
+
|
1638
|
+
// Push a vertice to the data buffer
|
1639
|
+
function vertice(x, y, checkTreshold, pointSize, color) {
|
1640
|
+
pushColor(color);
|
1641
|
+
if (settings.usePreallocated) {
|
1642
|
+
vbuffer.push(x, y, checkTreshold ? 1 : 0, pointSize || 1);
|
1643
|
+
} else {
|
1644
|
+
data.push(x);
|
1645
|
+
data.push(y);
|
1646
|
+
data.push(checkTreshold ? 1 : 0);
|
1647
|
+
data.push(pointSize || 1);
|
1648
|
+
}
|
1649
|
+
}
|
1650
|
+
|
1651
|
+
function closeSegment() {
|
1652
|
+
if (inst.segments.length) {
|
1653
|
+
inst.segments[inst.segments.length - 1].to = data.length;
|
1654
|
+
}
|
1655
|
+
}
|
1656
|
+
|
1657
|
+
// Create a new segment for the current set
|
1658
|
+
function beginSegment() {
|
1659
|
+
// Insert a segment on the series.
|
1660
|
+
// A segment is just a start indice.
|
1661
|
+
// When adding a segment, if one exists from before, it should
|
1662
|
+
// set the previous segment's end
|
1663
|
+
|
1664
|
+
if (inst.segments.length &&
|
1665
|
+
inst.segments[inst.segments.length - 1].from === data.length
|
1666
|
+
) {
|
1667
|
+
return;
|
1668
|
+
}
|
1669
|
+
|
1670
|
+
closeSegment();
|
1671
|
+
|
1672
|
+
inst.segments.push({
|
1673
|
+
from: data.length
|
1674
|
+
});
|
1675
|
+
|
1676
|
+
}
|
1677
|
+
|
1678
|
+
// Push a rectangle to the data buffer
|
1679
|
+
function pushRect(x, y, w, h, color) {
|
1680
|
+
pushColor(color);
|
1681
|
+
vertice(x + w, y);
|
1682
|
+
pushColor(color);
|
1683
|
+
vertice(x, y);
|
1684
|
+
pushColor(color);
|
1685
|
+
vertice(x, y + h);
|
1686
|
+
|
1687
|
+
pushColor(color);
|
1688
|
+
vertice(x, y + h);
|
1689
|
+
pushColor(color);
|
1690
|
+
vertice(x + w, y + h);
|
1691
|
+
pushColor(color);
|
1692
|
+
vertice(x + w, y);
|
1693
|
+
}
|
1694
|
+
|
1695
|
+
// Create the first segment
|
1696
|
+
beginSegment();
|
1697
|
+
|
1698
|
+
// Special case for point shapes
|
1699
|
+
if (points && points.length > 0) {
|
1700
|
+
|
1701
|
+
// If we're doing points, we assume that the points are already
|
1702
|
+
// translated, so we skip the shader translation.
|
1703
|
+
inst.skipTranslation = true;
|
1704
|
+
// Force triangle draw mode
|
1705
|
+
inst.drawMode = 'triangles';
|
1706
|
+
|
1707
|
+
// We don't have a z component in the shader, so we need to sort.
|
1708
|
+
if (points[0].node && points[0].node.levelDynamic) {
|
1709
|
+
points.sort(function (a, b) {
|
1710
|
+
if (a.node) {
|
1711
|
+
if (a.node.levelDynamic > b.node.levelDynamic) {
|
1712
|
+
return 1;
|
1713
|
+
}
|
1714
|
+
if (a.node.levelDynamic < b.node.levelDynamic) {
|
1715
|
+
return -1;
|
1716
|
+
}
|
1717
|
+
}
|
1718
|
+
return 0;
|
1719
|
+
});
|
1720
|
+
}
|
1721
|
+
|
1722
|
+
points.forEach(function (point) {
|
1723
|
+
var plotY = point.plotY,
|
1724
|
+
shapeArgs,
|
1725
|
+
swidth,
|
1726
|
+
pointAttr;
|
1727
|
+
|
1728
|
+
if (
|
1729
|
+
typeof plotY !== 'undefined' &&
|
1730
|
+
!isNaN(plotY) &&
|
1731
|
+
point.y !== null
|
1732
|
+
) {
|
1733
|
+
shapeArgs = point.shapeArgs;
|
1734
|
+
|
1735
|
+
pointAttr = chart.styledMode ?
|
1736
|
+
point.series.colorAttribs(point) :
|
1737
|
+
pointAttr = point.series.pointAttribs(point);
|
1738
|
+
|
1739
|
+
swidth = pointAttr['stroke-width'] || 0;
|
1740
|
+
|
1741
|
+
// Handle point colors
|
1742
|
+
color = H.color(pointAttr.fill).rgba;
|
1743
|
+
color[0] /= 255.0;
|
1744
|
+
color[1] /= 255.0;
|
1745
|
+
color[2] /= 255.0;
|
1746
|
+
|
1747
|
+
// So there are two ways of doing this. Either we can
|
1748
|
+
// create a rectangle of two triangles, or we can do a
|
1749
|
+
// point and use point size. Latter is faster, but
|
1750
|
+
// only supports squares. So we're doing triangles.
|
1751
|
+
// We could also use one color per. vertice to get
|
1752
|
+
// better color interpolation.
|
1753
|
+
|
1754
|
+
// If there's stroking, we do an additional rect
|
1755
|
+
if (series.type === 'treemap') {
|
1756
|
+
swidth = swidth || 1;
|
1757
|
+
scolor = H.color(pointAttr.stroke).rgba;
|
1758
|
+
|
1759
|
+
scolor[0] /= 255.0;
|
1760
|
+
scolor[1] /= 255.0;
|
1761
|
+
scolor[2] /= 255.0;
|
1762
|
+
|
1763
|
+
pushRect(
|
1764
|
+
shapeArgs.x,
|
1765
|
+
shapeArgs.y,
|
1766
|
+
shapeArgs.width,
|
1767
|
+
shapeArgs.height,
|
1768
|
+
scolor
|
1769
|
+
);
|
1770
|
+
|
1771
|
+
swidth /= 2;
|
1772
|
+
}
|
1773
|
+
// } else {
|
1774
|
+
// swidth = 0;
|
1775
|
+
// }
|
1776
|
+
|
1777
|
+
// Fixes issues with inverted heatmaps (see #6981)
|
1778
|
+
// The root cause is that the coordinate system is flipped.
|
1779
|
+
// In other words, instead of [0,0] being top-left, it's
|
1780
|
+
// bottom-right. This causes a vertical and horizontal flip
|
1781
|
+
// in the resulting image, making it rotated 180 degrees.
|
1782
|
+
if (series.type === 'heatmap' && chart.inverted) {
|
1783
|
+
shapeArgs.x = xAxis.len - shapeArgs.x;
|
1784
|
+
shapeArgs.y = yAxis.len - shapeArgs.y;
|
1785
|
+
shapeArgs.width = -shapeArgs.width;
|
1786
|
+
shapeArgs.height = -shapeArgs.height;
|
1787
|
+
}
|
1788
|
+
|
1789
|
+
pushRect(
|
1790
|
+
shapeArgs.x + swidth,
|
1791
|
+
shapeArgs.y + swidth,
|
1792
|
+
shapeArgs.width - (swidth * 2),
|
1793
|
+
shapeArgs.height - (swidth * 2),
|
1794
|
+
color
|
1795
|
+
);
|
1796
|
+
}
|
1797
|
+
});
|
1798
|
+
|
1799
|
+
closeSegment();
|
1800
|
+
|
1801
|
+
return;
|
1802
|
+
}
|
1803
|
+
|
1804
|
+
// Extract color axis
|
1805
|
+
// (chart.axes || []).forEach(function (a) {
|
1806
|
+
// if (H.ColorAxis && a instanceof H.ColorAxis) {
|
1807
|
+
// caxis = a;
|
1808
|
+
// }
|
1809
|
+
// });
|
1810
|
+
|
1811
|
+
while (i < sdata.length - 1) {
|
1812
|
+
d = sdata[++i];
|
1813
|
+
|
1814
|
+
// px = x = y = z = nx = low = false;
|
1815
|
+
// chartDestroyed = typeof chart.index === 'undefined';
|
1816
|
+
// nextInside = prevInside = pcolor = isXInside = isYInside = false;
|
1817
|
+
// drawAsBar = asBar[series.type];
|
1818
|
+
|
1819
|
+
if (chartDestroyed) {
|
1820
|
+
break;
|
1821
|
+
}
|
1822
|
+
|
1823
|
+
// Uncomment this to enable color by point.
|
1824
|
+
// This currently left disabled as the charts look really ugly
|
1825
|
+
// when enabled and there's a lot of points.
|
1826
|
+
// Leaving in for the future (tm).
|
1827
|
+
// if (colorByPoint) {
|
1828
|
+
// colorIndex = ++colorIndex %
|
1829
|
+
// series.chart.options.colors.length;
|
1830
|
+
// pcolor = toRGBAFast(series.chart.options.colors[colorIndex]);
|
1831
|
+
// pcolor[0] /= 255.0;
|
1832
|
+
// pcolor[1] /= 255.0;
|
1833
|
+
// pcolor[2] /= 255.0;
|
1834
|
+
// }
|
1835
|
+
|
1836
|
+
if (useRaw) {
|
1837
|
+
x = d[0];
|
1838
|
+
y = d[1];
|
1839
|
+
|
1840
|
+
if (sdata[i + 1]) {
|
1841
|
+
nx = sdata[i + 1][0];
|
1842
|
+
}
|
1843
|
+
|
1844
|
+
if (sdata[i - 1]) {
|
1845
|
+
px = sdata[i - 1][0];
|
1846
|
+
}
|
1847
|
+
|
1848
|
+
if (d.length >= 3) {
|
1849
|
+
z = d[2];
|
1850
|
+
|
1851
|
+
if (d[2] > inst.zMax) {
|
1852
|
+
inst.zMax = d[2];
|
1853
|
+
}
|
1854
|
+
|
1855
|
+
if (d[2] < inst.zMin) {
|
1856
|
+
inst.zMin = d[2];
|
1857
|
+
}
|
1858
|
+
}
|
1859
|
+
|
1860
|
+
} else {
|
1861
|
+
x = d;
|
1862
|
+
y = yData[i];
|
1863
|
+
|
1864
|
+
if (sdata[i + 1]) {
|
1865
|
+
nx = sdata[i + 1];
|
1866
|
+
}
|
1867
|
+
|
1868
|
+
if (sdata[i - 1]) {
|
1869
|
+
px = sdata[i - 1];
|
1870
|
+
}
|
1871
|
+
|
1872
|
+
if (zData && zData.length) {
|
1873
|
+
z = zData[i];
|
1874
|
+
|
1875
|
+
if (zData[i] > inst.zMax) {
|
1876
|
+
inst.zMax = zData[i];
|
1877
|
+
}
|
1878
|
+
|
1879
|
+
if (zData[i] < inst.zMin) {
|
1880
|
+
inst.zMin = zData[i];
|
1881
|
+
}
|
1882
|
+
}
|
1883
|
+
}
|
1884
|
+
|
1885
|
+
if (!connectNulls && (x === null || y === null)) {
|
1886
|
+
beginSegment();
|
1887
|
+
continue;
|
1888
|
+
}
|
1889
|
+
|
1890
|
+
if (nx && nx >= xMin && nx <= xMax) {
|
1891
|
+
nextInside = true;
|
1892
|
+
}
|
1893
|
+
|
1894
|
+
if (px && px >= xMin && px <= xMax) {
|
1895
|
+
prevInside = true;
|
1896
|
+
}
|
1897
|
+
|
1898
|
+
if (isRange) {
|
1899
|
+
if (useRaw) {
|
1900
|
+
y = d.slice(1, 3);
|
1901
|
+
}
|
1902
|
+
|
1903
|
+
low = y[0];
|
1904
|
+
y = y[1];
|
1905
|
+
|
1906
|
+
} else if (isStacked) {
|
1907
|
+
x = d.x;
|
1908
|
+
y = d.stackY;
|
1909
|
+
low = y - d.y;
|
1910
|
+
}
|
1911
|
+
|
1912
|
+
if (yMin !== null &&
|
1913
|
+
typeof yMin !== 'undefined' &&
|
1914
|
+
yMax !== null &&
|
1915
|
+
typeof yMax !== 'undefined'
|
1916
|
+
) {
|
1917
|
+
isYInside = y >= yMin && y <= yMax;
|
1918
|
+
}
|
1919
|
+
|
1920
|
+
if (x > xMax && closestRight.x < xMax) {
|
1921
|
+
closestRight.x = x;
|
1922
|
+
closestRight.y = y;
|
1923
|
+
}
|
1924
|
+
|
1925
|
+
if (x < xMin && closestLeft.x > xMin) {
|
1926
|
+
closestLeft.x = x;
|
1927
|
+
closestLeft.y = y;
|
1928
|
+
}
|
1929
|
+
|
1930
|
+
if (y === null && connectNulls) {
|
1931
|
+
continue;
|
1932
|
+
}
|
1933
|
+
|
1934
|
+
// Cull points outside the extremes
|
1935
|
+
if (y === null || (!isYInside && !nextInside && !prevInside)) {
|
1936
|
+
beginSegment();
|
1937
|
+
continue;
|
1938
|
+
}
|
1939
|
+
|
1940
|
+
if (x >= xMin && x <= xMax) {
|
1941
|
+
isXInside = true;
|
1942
|
+
}
|
1943
|
+
|
1944
|
+
if (!isXInside && !nextInside && !prevInside) {
|
1945
|
+
continue;
|
1946
|
+
}
|
1947
|
+
|
1948
|
+
// Skip translations - temporary floating point fix
|
1949
|
+
if (!settings.useGPUTranslations) {
|
1950
|
+
inst.skipTranslation = true;
|
1951
|
+
x = xAxis.toPixels(x, true);
|
1952
|
+
y = yAxis.toPixels(y, true);
|
1953
|
+
|
1954
|
+
// Make sure we're not drawing outside of the chart area.
|
1955
|
+
// See #6594.
|
1956
|
+
if (y > plotHeight) {
|
1957
|
+
y = plotHeight;
|
1958
|
+
}
|
1959
|
+
|
1960
|
+
if (x > plotWidth) {
|
1961
|
+
// If this is rendered as a point, just skip drawing it
|
1962
|
+
// entirely, as we're not dependandt on lineTo'ing to it.
|
1963
|
+
// See #8197
|
1964
|
+
if (inst.drawMode === 'points') {
|
1965
|
+
continue;
|
1966
|
+
}
|
1967
|
+
|
1968
|
+
// Having this here will clamp markers and make the angle
|
1969
|
+
// of the last line wrong. See 9166.
|
1970
|
+
// x = plotWidth;
|
1971
|
+
|
1972
|
+
}
|
1973
|
+
|
1974
|
+
}
|
1975
|
+
|
1976
|
+
if (drawAsBar) {
|
1977
|
+
|
1978
|
+
maxVal = y;
|
1979
|
+
minVal = low;
|
1980
|
+
|
1981
|
+
if (low === false || typeof low === 'undefined') {
|
1982
|
+
if (y < 0) {
|
1983
|
+
minVal = y;
|
1984
|
+
} else {
|
1985
|
+
minVal = 0;
|
1986
|
+
}
|
1987
|
+
}
|
1988
|
+
|
1989
|
+
if (!isRange && !isStacked) {
|
1990
|
+
minVal = Math.max(threshold, yMin); // #8731
|
1991
|
+
}
|
1992
|
+
if (!settings.useGPUTranslations) {
|
1993
|
+
minVal = yAxis.toPixels(minVal, true);
|
1994
|
+
}
|
1995
|
+
|
1996
|
+
// Need to add an extra point here
|
1997
|
+
vertice(x, minVal, 0, 0, pcolor);
|
1998
|
+
}
|
1999
|
+
|
2000
|
+
// No markers on out of bounds things.
|
2001
|
+
// Out of bound things are shown if and only if the next
|
2002
|
+
// or previous point is inside the rect.
|
2003
|
+
if (inst.hasMarkers && isXInside) {
|
2004
|
+
// x = H.correctFloat(
|
2005
|
+
// Math.min(Math.max(-1e5, xAxis.translate(
|
2006
|
+
// x,
|
2007
|
+
// 0,
|
2008
|
+
// 0,
|
2009
|
+
// 0,
|
2010
|
+
// 1,
|
2011
|
+
// 0.5,
|
2012
|
+
// false
|
2013
|
+
// )), 1e5)
|
2014
|
+
// );
|
2015
|
+
|
2016
|
+
if (lastX !== false) {
|
2017
|
+
series.closestPointRangePx = Math.min(
|
2018
|
+
series.closestPointRangePx,
|
2019
|
+
Math.abs(x - lastX)
|
2020
|
+
);
|
2021
|
+
}
|
2022
|
+
}
|
2023
|
+
|
2024
|
+
// If the last _drawn_ point is closer to this point than the
|
2025
|
+
// threshold, skip it. Shaves off 20-100ms in processing.
|
2026
|
+
|
2027
|
+
if (!settings.useGPUTranslations &&
|
2028
|
+
!settings.usePreallocated &&
|
2029
|
+
(lastX && Math.abs(x - lastX) < cullXThreshold) &&
|
2030
|
+
(lastY && Math.abs(y - lastY) < cullYThreshold)
|
2031
|
+
) {
|
2032
|
+
if (settings.debug.showSkipSummary) {
|
2033
|
+
++skipped;
|
2034
|
+
}
|
2035
|
+
|
2036
|
+
continue;
|
2037
|
+
}
|
2038
|
+
|
2039
|
+
// Do step line if enabled.
|
2040
|
+
// Draws an additional point at the old Y at the new X.
|
2041
|
+
// See #6976.
|
2042
|
+
|
2043
|
+
if (options.step && !firstPoint) {
|
2044
|
+
vertice(
|
2045
|
+
x,
|
2046
|
+
lastY,
|
2047
|
+
0,
|
2048
|
+
2,
|
2049
|
+
pcolor
|
2050
|
+
);
|
2051
|
+
}
|
2052
|
+
|
2053
|
+
vertice(
|
2054
|
+
x,
|
2055
|
+
y,
|
2056
|
+
0,
|
2057
|
+
series.type === 'bubble' ? (z || 1) : 2,
|
2058
|
+
pcolor
|
2059
|
+
);
|
2060
|
+
|
2061
|
+
// Uncomment this to support color axis.
|
2062
|
+
// if (caxis) {
|
2063
|
+
// color = H.color(caxis.toColor(y)).rgba;
|
2064
|
+
|
2065
|
+
// inst.colorData.push(color[0] / 255.0);
|
2066
|
+
// inst.colorData.push(color[1] / 255.0);
|
2067
|
+
// inst.colorData.push(color[2] / 255.0);
|
2068
|
+
// inst.colorData.push(color[3]);
|
2069
|
+
// }
|
2070
|
+
|
2071
|
+
lastX = x;
|
2072
|
+
lastY = y;
|
2073
|
+
|
2074
|
+
hadPoints = true;
|
2075
|
+
firstPoint = false;
|
2076
|
+
}
|
2077
|
+
|
2078
|
+
if (settings.debug.showSkipSummary) {
|
2079
|
+
console.log('skipped points:', skipped); // eslint-disable-line no-console
|
2080
|
+
}
|
2081
|
+
|
2082
|
+
function pushSupplementPoint(point, atStart) {
|
2083
|
+
if (!settings.useGPUTranslations) {
|
2084
|
+
inst.skipTranslation = true;
|
2085
|
+
point.x = xAxis.toPixels(point.x, true);
|
2086
|
+
point.y = yAxis.toPixels(point.y, true);
|
2087
|
+
}
|
2088
|
+
|
2089
|
+
// We should only do this for lines, and we should ignore markers
|
2090
|
+
// since there's no point here that would have a marker.
|
2091
|
+
|
2092
|
+
if (atStart) {
|
2093
|
+
data = [point.x, point.y, 0, 2].concat(data);
|
2094
|
+
return;
|
2095
|
+
}
|
2096
|
+
|
2097
|
+
vertice(
|
2098
|
+
point.x,
|
2099
|
+
point.y,
|
2100
|
+
0,
|
2101
|
+
2
|
2102
|
+
);
|
2103
|
+
}
|
2104
|
+
|
2105
|
+
if (
|
2106
|
+
!hadPoints &&
|
2107
|
+
connectNulls !== false &&
|
2108
|
+
series.drawMode === 'line_strip'
|
2109
|
+
) {
|
2110
|
+
if (closestLeft.x < Number.MAX_VALUE) {
|
2111
|
+
// We actually need to push this *before* the complete buffer.
|
2112
|
+
pushSupplementPoint(closestLeft, true);
|
2113
|
+
}
|
2114
|
+
|
2115
|
+
if (closestRight.x > -Number.MAX_VALUE) {
|
2116
|
+
pushSupplementPoint(closestRight);
|
2117
|
+
}
|
2118
|
+
}
|
2119
|
+
|
2120
|
+
closeSegment();
|
2121
|
+
}
|
2122
|
+
|
2123
|
+
/*
|
2124
|
+
* Push a series to the renderer
|
2125
|
+
* If we render the series immediatly, we don't have to loop later
|
2126
|
+
* @param s {Highchart.Series} - the series to push
|
2127
|
+
*/
|
2128
|
+
function pushSeries(s) {
|
2129
|
+
if (series.length > 0) {
|
2130
|
+
// series[series.length - 1].to = data.length;
|
2131
|
+
if (series[series.length - 1].hasMarkers) {
|
2132
|
+
series[series.length - 1].markerTo = markerData.length;
|
2133
|
+
}
|
2134
|
+
}
|
2135
|
+
|
2136
|
+
if (settings.debug.timeSeriesProcessing) {
|
2137
|
+
console.time('building ' + s.type + ' series'); // eslint-disable-line no-console
|
2138
|
+
}
|
2139
|
+
|
2140
|
+
series.push({
|
2141
|
+
segments: [],
|
2142
|
+
// from: data.length,
|
2143
|
+
markerFrom: markerData.length,
|
2144
|
+
// Push RGBA values to this array to use per. point coloring.
|
2145
|
+
// It should be 0-padded, so each component should be pushed in
|
2146
|
+
// succession.
|
2147
|
+
colorData: [],
|
2148
|
+
series: s,
|
2149
|
+
zMin: Number.MAX_VALUE,
|
2150
|
+
zMax: -Number.MAX_VALUE,
|
2151
|
+
hasMarkers: s.options.marker ?
|
2152
|
+
s.options.marker.enabled !== false :
|
2153
|
+
false,
|
2154
|
+
showMarkers: true,
|
2155
|
+
drawMode: ({
|
2156
|
+
'area': 'lines',
|
2157
|
+
'arearange': 'lines',
|
2158
|
+
'areaspline': 'line_strip',
|
2159
|
+
'column': 'lines',
|
2160
|
+
'columnrange': 'lines',
|
2161
|
+
'bar': 'lines',
|
2162
|
+
'line': 'line_strip',
|
2163
|
+
'scatter': 'points',
|
2164
|
+
'heatmap': 'triangles',
|
2165
|
+
'treemap': 'triangles',
|
2166
|
+
'bubble': 'points'
|
2167
|
+
})[s.type] || 'line_strip'
|
2168
|
+
});
|
2169
|
+
|
2170
|
+
// Add the series data to our buffer(s)
|
2171
|
+
pushSeriesData(s, series[series.length - 1]);
|
2172
|
+
|
2173
|
+
if (settings.debug.timeSeriesProcessing) {
|
2174
|
+
console.timeEnd('building ' + s.type + ' series'); // eslint-disable-line no-console
|
2175
|
+
}
|
2176
|
+
}
|
2177
|
+
|
2178
|
+
/*
|
2179
|
+
* Flush the renderer.
|
2180
|
+
* This removes pushed series and vertices.
|
2181
|
+
* Should be called after clearing and before rendering
|
2182
|
+
*/
|
2183
|
+
function flush() {
|
2184
|
+
series = [];
|
2185
|
+
exports.data = data = [];
|
2186
|
+
markerData = [];
|
2187
|
+
|
2188
|
+
if (vbuffer) {
|
2189
|
+
vbuffer.destroy();
|
2190
|
+
}
|
2191
|
+
}
|
2192
|
+
|
2193
|
+
/*
|
2194
|
+
* Pass x-axis to shader
|
2195
|
+
* @param axis {Highcharts.Axis} - the x-axis
|
2196
|
+
*/
|
2197
|
+
function setXAxis(axis) {
|
2198
|
+
if (!shader) {
|
2199
|
+
return;
|
2200
|
+
}
|
2201
|
+
|
2202
|
+
shader.setUniform('xAxisTrans', axis.transA);
|
2203
|
+
shader.setUniform('xAxisMin', axis.min);
|
2204
|
+
shader.setUniform('xAxisMinPad', axis.minPixelPadding);
|
2205
|
+
shader.setUniform('xAxisPointRange', axis.pointRange);
|
2206
|
+
shader.setUniform('xAxisLen', axis.len);
|
2207
|
+
shader.setUniform('xAxisPos', axis.pos);
|
2208
|
+
shader.setUniform('xAxisCVSCoord', !axis.horiz);
|
2209
|
+
}
|
2210
|
+
|
2211
|
+
/*
|
2212
|
+
* Pass y-axis to shader
|
2213
|
+
* @param axis {Highcharts.Axis} - the y-axis
|
2214
|
+
*/
|
2215
|
+
function setYAxis(axis) {
|
2216
|
+
if (!shader) {
|
2217
|
+
return;
|
2218
|
+
}
|
2219
|
+
|
2220
|
+
shader.setUniform('yAxisTrans', axis.transA);
|
2221
|
+
shader.setUniform('yAxisMin', axis.min);
|
2222
|
+
shader.setUniform('yAxisMinPad', axis.minPixelPadding);
|
2223
|
+
shader.setUniform('yAxisPointRange', axis.pointRange);
|
2224
|
+
shader.setUniform('yAxisLen', axis.len);
|
2225
|
+
shader.setUniform('yAxisPos', axis.pos);
|
2226
|
+
shader.setUniform('yAxisCVSCoord', !axis.horiz);
|
2227
|
+
}
|
2228
|
+
|
2229
|
+
/*
|
2230
|
+
* Set the translation threshold
|
2231
|
+
* @param has {boolean} - has threshold flag
|
2232
|
+
* @param translation {Float} - the threshold
|
2233
|
+
*/
|
2234
|
+
function setThreshold(has, translation) {
|
2235
|
+
shader.setUniform('hasThreshold', has);
|
2236
|
+
shader.setUniform('translatedThreshold', translation);
|
2237
|
+
}
|
2238
|
+
|
2239
|
+
/*
|
2240
|
+
* Render the data
|
2241
|
+
* This renders all pushed series.
|
2242
|
+
*/
|
2243
|
+
function render(chart) {
|
2244
|
+
|
2245
|
+
if (chart) {
|
2246
|
+
if (!chart.chartHeight || !chart.chartWidth) {
|
2247
|
+
// chart.setChartSize();
|
2248
|
+
}
|
2249
|
+
|
2250
|
+
width = chart.chartWidth || 800;
|
2251
|
+
height = chart.chartHeight || 400;
|
2252
|
+
} else {
|
2253
|
+
return false;
|
2254
|
+
}
|
2255
|
+
|
2256
|
+
if (!gl || !width || !height || !shader) {
|
2257
|
+
return false;
|
2258
|
+
}
|
2259
|
+
|
2260
|
+
if (settings.debug.timeRendering) {
|
2261
|
+
console.time('gl rendering'); // eslint-disable-line no-console
|
2262
|
+
}
|
2263
|
+
|
2264
|
+
gl.canvas.width = width;
|
2265
|
+
gl.canvas.height = height;
|
2266
|
+
|
2267
|
+
shader.bind();
|
2268
|
+
|
2269
|
+
gl.viewport(0, 0, width, height);
|
2270
|
+
shader.setPMatrix(orthoMatrix(width, height));
|
2271
|
+
shader.setPlotHeight(chart.plotHeight);
|
2272
|
+
|
2273
|
+
if (settings.lineWidth > 1 && !H.isMS) {
|
2274
|
+
gl.lineWidth(settings.lineWidth);
|
2275
|
+
}
|
2276
|
+
|
2277
|
+
vbuffer.build(exports.data, 'aVertexPosition', 4);
|
2278
|
+
vbuffer.bind();
|
2279
|
+
|
2280
|
+
shader.setInverted(chart.inverted);
|
2281
|
+
|
2282
|
+
// Render the series
|
2283
|
+
series.forEach(function (s, si) {
|
2284
|
+
var options = s.series.options,
|
2285
|
+
shapeOptions = options.marker,
|
2286
|
+
sindex,
|
2287
|
+
lineWidth = typeof options.lineWidth !== 'undefined' ?
|
2288
|
+
options.lineWidth :
|
2289
|
+
1,
|
2290
|
+
threshold = options.threshold,
|
2291
|
+
hasThreshold = isNumber(threshold),
|
2292
|
+
yBottom = s.series.yAxis.getThreshold(threshold),
|
2293
|
+
translatedThreshold = yBottom,
|
2294
|
+
cbuffer,
|
2295
|
+
showMarkers = pick(
|
2296
|
+
options.marker ? options.marker.enabled : null,
|
2297
|
+
s.series.xAxis.isRadial ? true : null,
|
2298
|
+
s.series.closestPointRangePx >
|
2299
|
+
2 * ((
|
2300
|
+
options.marker ?
|
2301
|
+
options.marker.radius :
|
2302
|
+
10
|
2303
|
+
) || 10)
|
2304
|
+
),
|
2305
|
+
fillColor,
|
2306
|
+
shapeTexture = textureHandles[
|
2307
|
+
(shapeOptions && shapeOptions.symbol) || s.series.symbol
|
2308
|
+
] || textureHandles.circle,
|
2309
|
+
color;
|
2310
|
+
|
2311
|
+
if (
|
2312
|
+
s.segments.length === 0 ||
|
2313
|
+
(s.segmentslength && s.segments[0].from === s.segments[0].to)
|
2314
|
+
) {
|
2315
|
+
return;
|
2316
|
+
}
|
2317
|
+
|
2318
|
+
if (shapeTexture.isReady) {
|
2319
|
+
gl.bindTexture(gl.TEXTURE_2D, shapeTexture.handle);
|
2320
|
+
shader.setTexture(shapeTexture.handle);
|
2321
|
+
}
|
2322
|
+
|
2323
|
+
if (chart.styledMode) {
|
2324
|
+
fillColor = (
|
2325
|
+
s.series.markerGroup &&
|
2326
|
+
s.series.markerGroup.getStyle('fill')
|
2327
|
+
);
|
2328
|
+
|
2329
|
+
} else {
|
2330
|
+
fillColor =
|
2331
|
+
(s.series.pointAttribs && s.series.pointAttribs().fill) ||
|
2332
|
+
s.series.color;
|
2333
|
+
|
2334
|
+
if (options.colorByPoint) {
|
2335
|
+
fillColor = s.series.chart.options.colors[si];
|
2336
|
+
}
|
2337
|
+
}
|
2338
|
+
|
2339
|
+
if (s.series.fillOpacity && options.fillOpacity) {
|
2340
|
+
fillColor = new Color(fillColor).setOpacity(
|
2341
|
+
pick(options.fillOpacity, 1.0)
|
2342
|
+
).get();
|
2343
|
+
}
|
2344
|
+
|
2345
|
+
color = H.color(fillColor).rgba;
|
2346
|
+
|
2347
|
+
if (!settings.useAlpha) {
|
2348
|
+
color[3] = 1.0;
|
2349
|
+
}
|
2350
|
+
|
2351
|
+
// This is very much temporary
|
2352
|
+
if (s.drawMode === 'lines' && settings.useAlpha && color[3] < 1) {
|
2353
|
+
color[3] /= 10;
|
2354
|
+
}
|
2355
|
+
|
2356
|
+
// Blending
|
2357
|
+
if (options.boostBlending === 'add') {
|
2358
|
+
gl.blendFunc(gl.SRC_ALPHA, gl.ONE);
|
2359
|
+
gl.blendEquation(gl.FUNC_ADD);
|
2360
|
+
|
2361
|
+
} else if (options.boostBlending === 'mult' ||
|
2362
|
+
options.boostBlending === 'multiply'
|
2363
|
+
) {
|
2364
|
+
gl.blendFunc(gl.DST_COLOR, gl.ZERO);
|
2365
|
+
|
2366
|
+
} else if (options.boostBlending === 'darken') {
|
2367
|
+
gl.blendFunc(gl.ONE, gl.ONE);
|
2368
|
+
gl.blendEquation(gl.FUNC_MIN);
|
2369
|
+
|
2370
|
+
} else {
|
2371
|
+
// gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
|
2372
|
+
// gl.blendEquation(gl.FUNC_ADD);
|
2373
|
+
gl.blendFuncSeparate(
|
2374
|
+
gl.SRC_ALPHA,
|
2375
|
+
gl.ONE_MINUS_SRC_ALPHA,
|
2376
|
+
gl.ONE,
|
2377
|
+
gl.ONE_MINUS_SRC_ALPHA
|
2378
|
+
);
|
2379
|
+
}
|
2380
|
+
|
2381
|
+
shader.reset();
|
2382
|
+
|
2383
|
+
// If there are entries in the colorData buffer, build and bind it.
|
2384
|
+
if (s.colorData.length > 0) {
|
2385
|
+
shader.setUniform('hasColor', 1.0);
|
2386
|
+
cbuffer = GLVertexBuffer(gl, shader); // eslint-disable-line new-cap
|
2387
|
+
cbuffer.build(s.colorData, 'aColor', 4);
|
2388
|
+
cbuffer.bind();
|
2389
|
+
}
|
2390
|
+
|
2391
|
+
// Set series specific uniforms
|
2392
|
+
shader.setColor(color);
|
2393
|
+
setXAxis(s.series.xAxis);
|
2394
|
+
setYAxis(s.series.yAxis);
|
2395
|
+
setThreshold(hasThreshold, translatedThreshold);
|
2396
|
+
|
2397
|
+
if (s.drawMode === 'points') {
|
2398
|
+
if (options.marker && options.marker.radius) {
|
2399
|
+
shader.setPointSize(options.marker.radius * 2.0);
|
2400
|
+
} else {
|
2401
|
+
shader.setPointSize(1);
|
2402
|
+
}
|
2403
|
+
}
|
2404
|
+
|
2405
|
+
// If set to true, the toPixels translations in the shader
|
2406
|
+
// is skipped, i.e it's assumed that the value is a pixel coord.
|
2407
|
+
shader.setSkipTranslation(s.skipTranslation);
|
2408
|
+
|
2409
|
+
if (s.series.type === 'bubble') {
|
2410
|
+
shader.setBubbleUniforms(s.series, s.zMin, s.zMax);
|
2411
|
+
}
|
2412
|
+
|
2413
|
+
shader.setDrawAsCircle(
|
2414
|
+
asCircle[s.series.type] || false
|
2415
|
+
);
|
2416
|
+
|
2417
|
+
// Do the actual rendering
|
2418
|
+
// If the line width is < 0, skip rendering of the lines. See #7833.
|
2419
|
+
if (lineWidth > 0 || s.drawMode !== 'line_strip') {
|
2420
|
+
for (sindex = 0; sindex < s.segments.length; sindex++) {
|
2421
|
+
// if (s.segments[sindex].from < s.segments[sindex].to) {
|
2422
|
+
vbuffer.render(
|
2423
|
+
s.segments[sindex].from,
|
2424
|
+
s.segments[sindex].to,
|
2425
|
+
s.drawMode
|
2426
|
+
);
|
2427
|
+
// }
|
2428
|
+
}
|
2429
|
+
}
|
2430
|
+
|
2431
|
+
if (s.hasMarkers && showMarkers) {
|
2432
|
+
if (options.marker && options.marker.radius) {
|
2433
|
+
shader.setPointSize(options.marker.radius * 2.0);
|
2434
|
+
} else {
|
2435
|
+
shader.setPointSize(10);
|
2436
|
+
}
|
2437
|
+
shader.setDrawAsCircle(true);
|
2438
|
+
for (sindex = 0; sindex < s.segments.length; sindex++) {
|
2439
|
+
// if (s.segments[sindex].from < s.segments[sindex].to) {
|
2440
|
+
vbuffer.render(
|
2441
|
+
s.segments[sindex].from,
|
2442
|
+
s.segments[sindex].to,
|
2443
|
+
'POINTS'
|
2444
|
+
);
|
2445
|
+
// }
|
2446
|
+
}
|
2447
|
+
}
|
2448
|
+
});
|
2449
|
+
|
2450
|
+
if (settings.debug.timeRendering) {
|
2451
|
+
console.timeEnd('gl rendering'); // eslint-disable-line no-console
|
2452
|
+
}
|
2453
|
+
|
2454
|
+
if (postRenderCallback) {
|
2455
|
+
postRenderCallback();
|
2456
|
+
}
|
2457
|
+
|
2458
|
+
flush();
|
2459
|
+
}
|
2460
|
+
|
2461
|
+
/*
|
2462
|
+
* Render the data when ready
|
2463
|
+
*/
|
2464
|
+
function renderWhenReady(chart) {
|
2465
|
+
clear();
|
2466
|
+
|
2467
|
+
if (chart.renderer.forExport) {
|
2468
|
+
return render(chart);
|
2469
|
+
}
|
2470
|
+
|
2471
|
+
if (isInited) {
|
2472
|
+
render(chart);
|
2473
|
+
} else {
|
2474
|
+
setTimeout(function () {
|
2475
|
+
renderWhenReady(chart);
|
2476
|
+
}, 1);
|
2477
|
+
}
|
2478
|
+
}
|
2479
|
+
|
2480
|
+
/*
|
2481
|
+
* Set the viewport size in pixels
|
2482
|
+
* Creates an orthographic perspective matrix and applies it.
|
2483
|
+
* @param w {Integer} - the width of the viewport
|
2484
|
+
* @param h {Integer} - the height of the viewport
|
2485
|
+
*/
|
2486
|
+
function setSize(w, h) {
|
2487
|
+
// Skip if there's no change, or if we have no valid shader
|
2488
|
+
if ((width === w && height === h) || !shader) {
|
2489
|
+
return;
|
2490
|
+
}
|
2491
|
+
|
2492
|
+
width = w;
|
2493
|
+
height = h;
|
2494
|
+
|
2495
|
+
shader.bind();
|
2496
|
+
shader.setPMatrix(orthoMatrix(width, height));
|
2497
|
+
}
|
2498
|
+
|
2499
|
+
/*
|
2500
|
+
* Init OpenGL
|
2501
|
+
* @param canvas {HTMLCanvas} - the canvas to render to
|
2502
|
+
*/
|
2503
|
+
function init(canvas, noFlush) {
|
2504
|
+
var i = 0,
|
2505
|
+
contexts = [
|
2506
|
+
'webgl',
|
2507
|
+
'experimental-webgl',
|
2508
|
+
'moz-webgl',
|
2509
|
+
'webkit-3d'
|
2510
|
+
];
|
2511
|
+
|
2512
|
+
isInited = false;
|
2513
|
+
|
2514
|
+
if (!canvas) {
|
2515
|
+
return false;
|
2516
|
+
}
|
2517
|
+
|
2518
|
+
if (settings.debug.timeSetup) {
|
2519
|
+
console.time('gl setup'); // eslint-disable-line no-console
|
2520
|
+
}
|
2521
|
+
|
2522
|
+
for (; i < contexts.length; i++) {
|
2523
|
+
gl = canvas.getContext(contexts[i], {
|
2524
|
+
// premultipliedAlpha: false
|
2525
|
+
});
|
2526
|
+
if (gl) {
|
2527
|
+
break;
|
2528
|
+
}
|
2529
|
+
}
|
2530
|
+
|
2531
|
+
if (gl) {
|
2532
|
+
if (!noFlush) {
|
2533
|
+
flush();
|
2534
|
+
}
|
2535
|
+
} else {
|
2536
|
+
return false;
|
2537
|
+
}
|
2538
|
+
|
2539
|
+
gl.enable(gl.BLEND);
|
2540
|
+
// gl.blendFunc(gl.SRC_ALPHA, gl.ONE);
|
2541
|
+
gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
|
2542
|
+
gl.disable(gl.DEPTH_TEST);
|
2543
|
+
// gl.depthMask(gl.FALSE);
|
2544
|
+
gl.depthFunc(gl.LESS);
|
2545
|
+
|
2546
|
+
shader = GLShader(gl); // eslint-disable-line new-cap
|
2547
|
+
|
2548
|
+
if (!shader) {
|
2549
|
+
// We need to abort, there's no shader context
|
2550
|
+
return false;
|
2551
|
+
}
|
2552
|
+
|
2553
|
+
vbuffer = GLVertexBuffer(gl, shader); // eslint-disable-line new-cap
|
2554
|
+
|
2555
|
+
function createTexture(name, fn) {
|
2556
|
+
var props = {
|
2557
|
+
isReady: false,
|
2558
|
+
texture: doc.createElement('canvas'),
|
2559
|
+
handle: gl.createTexture()
|
2560
|
+
},
|
2561
|
+
ctx = props.texture.getContext('2d');
|
2562
|
+
|
2563
|
+
textureHandles[name] = props;
|
2564
|
+
|
2565
|
+
props.texture.width = 512;
|
2566
|
+
props.texture.height = 512;
|
2567
|
+
|
2568
|
+
ctx.mozImageSmoothingEnabled = false;
|
2569
|
+
ctx.webkitImageSmoothingEnabled = false;
|
2570
|
+
ctx.msImageSmoothingEnabled = false;
|
2571
|
+
ctx.imageSmoothingEnabled = false;
|
2572
|
+
|
2573
|
+
ctx.strokeStyle = 'rgba(255, 255, 255, 0)';
|
2574
|
+
ctx.fillStyle = '#FFF';
|
2575
|
+
|
2576
|
+
fn(ctx);
|
2577
|
+
|
2578
|
+
try {
|
2579
|
+
|
2580
|
+
gl.activeTexture(gl.TEXTURE0);
|
2581
|
+
gl.bindTexture(gl.TEXTURE_2D, props.handle);
|
2582
|
+
// gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
|
2583
|
+
|
2584
|
+
gl.texImage2D(
|
2585
|
+
gl.TEXTURE_2D,
|
2586
|
+
0,
|
2587
|
+
gl.RGBA,
|
2588
|
+
gl.RGBA,
|
2589
|
+
gl.UNSIGNED_BYTE,
|
2590
|
+
props.texture
|
2591
|
+
);
|
2592
|
+
|
2593
|
+
gl.texParameteri(
|
2594
|
+
gl.TEXTURE_2D,
|
2595
|
+
gl.TEXTURE_WRAP_S,
|
2596
|
+
gl.CLAMP_TO_EDGE
|
2597
|
+
);
|
2598
|
+
|
2599
|
+
gl.texParameteri(
|
2600
|
+
gl.TEXTURE_2D,
|
2601
|
+
gl.TEXTURE_WRAP_T,
|
2602
|
+
gl.CLAMP_TO_EDGE
|
2603
|
+
);
|
2604
|
+
|
2605
|
+
gl.texParameteri(
|
2606
|
+
gl.TEXTURE_2D,
|
2607
|
+
gl.TEXTURE_MAG_FILTER,
|
2608
|
+
gl.LINEAR
|
2609
|
+
);
|
2610
|
+
|
2611
|
+
gl.texParameteri(
|
2612
|
+
gl.TEXTURE_2D,
|
2613
|
+
gl.TEXTURE_MIN_FILTER,
|
2614
|
+
gl.LINEAR
|
2615
|
+
);
|
2616
|
+
|
2617
|
+
// gl.generateMipmap(gl.TEXTURE_2D);
|
2618
|
+
|
2619
|
+
gl.bindTexture(gl.TEXTURE_2D, null);
|
2620
|
+
|
2621
|
+
props.isReady = true;
|
2622
|
+
} catch (e) {}
|
2623
|
+
}
|
2624
|
+
|
2625
|
+
// Circle shape
|
2626
|
+
createTexture('circle', function (ctx) {
|
2627
|
+
ctx.beginPath();
|
2628
|
+
ctx.arc(256, 256, 256, 0, 2 * Math.PI);
|
2629
|
+
ctx.stroke();
|
2630
|
+
ctx.fill();
|
2631
|
+
});
|
2632
|
+
|
2633
|
+
// Square shape
|
2634
|
+
createTexture('square', function (ctx) {
|
2635
|
+
ctx.fillRect(0, 0, 512, 512);
|
2636
|
+
});
|
2637
|
+
|
2638
|
+
// Diamond shape
|
2639
|
+
createTexture('diamond', function (ctx) {
|
2640
|
+
ctx.beginPath();
|
2641
|
+
ctx.moveTo(256, 0);
|
2642
|
+
ctx.lineTo(512, 256);
|
2643
|
+
ctx.lineTo(256, 512);
|
2644
|
+
ctx.lineTo(0, 256);
|
2645
|
+
ctx.lineTo(256, 0);
|
2646
|
+
ctx.fill();
|
2647
|
+
});
|
2648
|
+
|
2649
|
+
// Triangle shape
|
2650
|
+
createTexture('triangle', function (ctx) {
|
2651
|
+
ctx.beginPath();
|
2652
|
+
ctx.moveTo(0, 512);
|
2653
|
+
ctx.lineTo(256, 0);
|
2654
|
+
ctx.lineTo(512, 512);
|
2655
|
+
ctx.lineTo(0, 512);
|
2656
|
+
ctx.fill();
|
2657
|
+
});
|
2658
|
+
|
2659
|
+
// Triangle shape (rotated)
|
2660
|
+
createTexture('triangle-down', function (ctx) {
|
2661
|
+
ctx.beginPath();
|
2662
|
+
ctx.moveTo(0, 0);
|
2663
|
+
ctx.lineTo(256, 512);
|
2664
|
+
ctx.lineTo(512, 0);
|
2665
|
+
ctx.lineTo(0, 0);
|
2666
|
+
ctx.fill();
|
2667
|
+
});
|
2668
|
+
|
2669
|
+
isInited = true;
|
2670
|
+
|
2671
|
+
if (settings.debug.timeSetup) {
|
2672
|
+
console.timeEnd('gl setup'); // eslint-disable-line no-console
|
2673
|
+
}
|
2674
|
+
|
2675
|
+
return true;
|
2676
|
+
}
|
2677
|
+
|
2678
|
+
/*
|
2679
|
+
* Check if we have a valid OGL context
|
2680
|
+
* @returns {Boolean} - true if the context is valid
|
2681
|
+
*/
|
2682
|
+
function valid() {
|
2683
|
+
return gl !== false;
|
2684
|
+
}
|
2685
|
+
|
2686
|
+
/*
|
2687
|
+
* Check if the renderer has been initialized
|
2688
|
+
* @returns {Boolean} - true if it has, false if not
|
2689
|
+
*/
|
2690
|
+
function inited() {
|
2691
|
+
return isInited;
|
2692
|
+
}
|
2693
|
+
|
2694
|
+
function destroy() {
|
2695
|
+
flush();
|
2696
|
+
vbuffer.destroy();
|
2697
|
+
shader.destroy();
|
2698
|
+
if (gl) {
|
2699
|
+
|
2700
|
+
objEach(textureHandles, function (key) {
|
2701
|
+
if (textureHandles[key].handle) {
|
2702
|
+
gl.deleteTexture(textureHandles[key].handle);
|
2703
|
+
}
|
2704
|
+
});
|
2705
|
+
|
2706
|
+
gl.canvas.width = 1;
|
2707
|
+
gl.canvas.height = 1;
|
2708
|
+
}
|
2709
|
+
}
|
2710
|
+
|
2711
|
+
// /////////////////////////////////////////////////////////////////////////
|
2712
|
+
exports = {
|
2713
|
+
allocateBufferForSingleSeries: allocateBufferForSingleSeries,
|
2714
|
+
pushSeries: pushSeries,
|
2715
|
+
setSize: setSize,
|
2716
|
+
inited: inited,
|
2717
|
+
setThreshold: setThreshold,
|
2718
|
+
init: init,
|
2719
|
+
render: renderWhenReady,
|
2720
|
+
settings: settings,
|
2721
|
+
valid: valid,
|
2722
|
+
clear: clear,
|
2723
|
+
flush: flush,
|
2724
|
+
setXAxis: setXAxis,
|
2725
|
+
setYAxis: setYAxis,
|
2726
|
+
data: data,
|
2727
|
+
gl: getGL,
|
2728
|
+
allocateBuffer: allocateBuffer,
|
2729
|
+
destroy: destroy,
|
2730
|
+
setOptions: setOptions
|
2731
|
+
};
|
2732
|
+
|
2733
|
+
return exports;
|
2734
|
+
}
|
2735
|
+
|
2736
|
+
// END OF WEBGL ABSTRACTIONS
|
2737
|
+
// /////////////////////////////////////////////////////////////////////////////
|
2738
|
+
|
2739
|
+
/**
|
2740
|
+
* Create a canvas + context and attach it to the target
|
2741
|
+
*
|
2742
|
+
* @private
|
2743
|
+
* @function createAndAttachRenderer
|
2744
|
+
*
|
2745
|
+
* @param {Highcharts.Chart|Highcharts.Series} target
|
2746
|
+
* the canvas target
|
2747
|
+
*
|
2748
|
+
* @param {Highcharts.Chart} chart
|
2749
|
+
* the chart
|
2750
|
+
*
|
2751
|
+
* @return {*}
|
2752
|
+
*/
|
2753
|
+
function createAndAttachRenderer(chart, series) {
|
2754
|
+
var width = chart.chartWidth,
|
2755
|
+
height = chart.chartHeight,
|
2756
|
+
target = chart,
|
2757
|
+
targetGroup = chart.seriesGroup || series.group,
|
2758
|
+
alpha = 1,
|
2759
|
+
foSupported = doc.implementation.hasFeature(
|
2760
|
+
'www.http://w3.org/TR/SVG11/feature#Extensibility',
|
2761
|
+
'1.1'
|
2762
|
+
);
|
2763
|
+
|
2764
|
+
if (chart.isChartSeriesBoosting()) {
|
2765
|
+
target = chart;
|
2766
|
+
} else {
|
2767
|
+
target = series;
|
2768
|
+
}
|
2769
|
+
|
2770
|
+
// Support for foreignObject is flimsy as best.
|
2771
|
+
// IE does not support it, and Chrome has a bug which messes up
|
2772
|
+
// the canvas draw order.
|
2773
|
+
// As such, we force the Image fallback for now, but leaving the
|
2774
|
+
// actual Canvas path in-place in case this changes in the future.
|
2775
|
+
foSupported = false;
|
2776
|
+
|
2777
|
+
if (!target.renderTarget) {
|
2778
|
+
target.canvas = mainCanvas;
|
2779
|
+
|
2780
|
+
// Fall back to image tag if foreignObject isn't supported,
|
2781
|
+
// or if we're exporting.
|
2782
|
+
if (chart.renderer.forExport || !foSupported) {
|
2783
|
+
target.renderTarget = chart.renderer.image(
|
2784
|
+
'',
|
2785
|
+
0,
|
2786
|
+
0,
|
2787
|
+
width,
|
2788
|
+
height
|
2789
|
+
)
|
2790
|
+
.addClass('highcharts-boost-canvas')
|
2791
|
+
.add(targetGroup);
|
2792
|
+
|
2793
|
+
target.boostClear = function () {
|
2794
|
+
target.renderTarget.attr({ href: '' });
|
2795
|
+
};
|
2796
|
+
|
2797
|
+
target.boostCopy = function () {
|
2798
|
+
target.boostResizeTarget();
|
2799
|
+
target.renderTarget.attr({
|
2800
|
+
href: target.canvas.toDataURL('image/png')
|
2801
|
+
});
|
2802
|
+
};
|
2803
|
+
|
2804
|
+
} else {
|
2805
|
+
target.renderTargetFo = chart.renderer
|
2806
|
+
.createElement('foreignObject')
|
2807
|
+
.add(targetGroup);
|
2808
|
+
|
2809
|
+
target.renderTarget = doc.createElement('canvas');
|
2810
|
+
target.renderTargetCtx = target.renderTarget.getContext('2d');
|
2811
|
+
|
2812
|
+
target.renderTargetFo.element.appendChild(target.renderTarget);
|
2813
|
+
|
2814
|
+
target.boostClear = function () {
|
2815
|
+
target.renderTarget.width = target.canvas.width;
|
2816
|
+
target.renderTarget.height = target.canvas.height;
|
2817
|
+
};
|
2818
|
+
|
2819
|
+
target.boostCopy = function () {
|
2820
|
+
target.renderTarget.width = target.canvas.width;
|
2821
|
+
target.renderTarget.height = target.canvas.height;
|
2822
|
+
|
2823
|
+
target.renderTargetCtx.drawImage(target.canvas, 0, 0);
|
2824
|
+
};
|
2825
|
+
}
|
2826
|
+
|
2827
|
+
target.boostResizeTarget = function () {
|
2828
|
+
width = chart.chartWidth;
|
2829
|
+
height = chart.chartHeight;
|
2830
|
+
|
2831
|
+
(target.renderTargetFo || target.renderTarget)
|
2832
|
+
.attr({
|
2833
|
+
x: 0,
|
2834
|
+
y: 0,
|
2835
|
+
width: width,
|
2836
|
+
height: height
|
2837
|
+
})
|
2838
|
+
.css({
|
2839
|
+
pointerEvents: 'none',
|
2840
|
+
mixedBlendMode: 'normal',
|
2841
|
+
opacity: alpha
|
2842
|
+
});
|
2843
|
+
|
2844
|
+
if (target instanceof H.Chart) {
|
2845
|
+
target.markerGroup.translate(
|
2846
|
+
chart.plotLeft,
|
2847
|
+
chart.plotTop
|
2848
|
+
);
|
2849
|
+
}
|
2850
|
+
};
|
2851
|
+
|
2852
|
+
target.boostClipRect = chart.renderer.clipRect();
|
2853
|
+
|
2854
|
+
(target.renderTargetFo || target.renderTarget)
|
2855
|
+
.clip(target.boostClipRect);
|
2856
|
+
|
2857
|
+
if (target instanceof H.Chart) {
|
2858
|
+
target.markerGroup = target.renderer.g().add(targetGroup);
|
2859
|
+
|
2860
|
+
target.markerGroup.translate(series.xAxis.pos, series.yAxis.pos);
|
2861
|
+
}
|
2862
|
+
}
|
2863
|
+
|
2864
|
+
target.canvas.width = width;
|
2865
|
+
target.canvas.height = height;
|
2866
|
+
|
2867
|
+
target.boostClipRect.attr(chart.getBoostClipRect(target));
|
2868
|
+
|
2869
|
+
target.boostResizeTarget();
|
2870
|
+
target.boostClear();
|
2871
|
+
|
2872
|
+
if (!target.ogl) {
|
2873
|
+
target.ogl = GLRenderer(function () { // eslint-disable-line new-cap
|
2874
|
+
if (target.ogl.settings.debug.timeBufferCopy) {
|
2875
|
+
console.time('buffer copy'); // eslint-disable-line no-console
|
2876
|
+
}
|
2877
|
+
|
2878
|
+
target.boostCopy();
|
2879
|
+
|
2880
|
+
if (target.ogl.settings.debug.timeBufferCopy) {
|
2881
|
+
console.timeEnd('buffer copy'); // eslint-disable-line no-console
|
2882
|
+
}
|
2883
|
+
|
2884
|
+
}); // eslint-disable-line new-cap
|
2885
|
+
|
2886
|
+
if (!target.ogl.init(target.canvas)) {
|
2887
|
+
// The OGL renderer couldn't be inited.
|
2888
|
+
// This likely means a shader error as we wouldn't get to this point
|
2889
|
+
// if there was no WebGL support.
|
2890
|
+
H.error('[highcharts boost] - unable to init WebGL renderer');
|
2891
|
+
}
|
2892
|
+
|
2893
|
+
// target.ogl.clear();
|
2894
|
+
target.ogl.setOptions(chart.options.boost || {});
|
2895
|
+
|
2896
|
+
if (target instanceof H.Chart) {
|
2897
|
+
target.ogl.allocateBuffer(chart);
|
2898
|
+
}
|
2899
|
+
}
|
2900
|
+
|
2901
|
+
target.ogl.setSize(width, height);
|
2902
|
+
|
2903
|
+
return target.ogl;
|
2904
|
+
}
|
2905
|
+
|
2906
|
+
/*
|
2907
|
+
* Performs the actual render if the renderer is
|
2908
|
+
* attached to the series.
|
2909
|
+
* @param renderer {OGLRenderer} - the renderer
|
2910
|
+
* @param series {Highcharts.Series} - the series
|
2911
|
+
*/
|
2912
|
+
function renderIfNotSeriesBoosting(renderer, series, chart) {
|
2913
|
+
if (renderer &&
|
2914
|
+
series.renderTarget &&
|
2915
|
+
series.canvas &&
|
2916
|
+
!(chart || series.chart).isChartSeriesBoosting()
|
2917
|
+
) {
|
2918
|
+
renderer.render(chart || series.chart);
|
2919
|
+
}
|
2920
|
+
}
|
2921
|
+
|
2922
|
+
function allocateIfNotSeriesBoosting(renderer, series) {
|
2923
|
+
if (renderer &&
|
2924
|
+
series.renderTarget &&
|
2925
|
+
series.canvas &&
|
2926
|
+
!series.chart.isChartSeriesBoosting()
|
2927
|
+
) {
|
2928
|
+
renderer.allocateBufferForSingleSeries(series);
|
2929
|
+
}
|
2930
|
+
}
|
2931
|
+
|
2932
|
+
/*
|
2933
|
+
* An "async" foreach loop. Uses a setTimeout to keep the loop from blocking the
|
2934
|
+
* UI thread.
|
2935
|
+
*
|
2936
|
+
* @param arr {Array} - the array to loop through
|
2937
|
+
* @param fn {Function} - the callback to call for each item
|
2938
|
+
* @param finalFunc {Function} - the callback to call when done
|
2939
|
+
* @param chunkSize {Number} - the number of iterations per timeout
|
2940
|
+
* @param i {Number} - the current index
|
2941
|
+
* @param noTimeout {Boolean} - set to true to skip timeouts
|
2942
|
+
*/
|
2943
|
+
H.eachAsync = function (arr, fn, finalFunc, chunkSize, i, noTimeout) {
|
2944
|
+
i = i || 0;
|
2945
|
+
chunkSize = chunkSize || CHUNK_SIZE;
|
2946
|
+
|
2947
|
+
var threshold = i + chunkSize,
|
2948
|
+
proceed = true;
|
2949
|
+
|
2950
|
+
while (proceed && i < threshold && i < arr.length) {
|
2951
|
+
proceed = fn(arr[i], i);
|
2952
|
+
++i;
|
2953
|
+
}
|
2954
|
+
|
2955
|
+
if (proceed) {
|
2956
|
+
if (i < arr.length) {
|
2957
|
+
|
2958
|
+
if (noTimeout) {
|
2959
|
+
H.eachAsync(arr, fn, finalFunc, chunkSize, i, noTimeout);
|
2960
|
+
} else if (win.requestAnimationFrame) {
|
2961
|
+
// If available, do requestAnimationFrame - shaves off a few ms
|
2962
|
+
win.requestAnimationFrame(function () {
|
2963
|
+
H.eachAsync(arr, fn, finalFunc, chunkSize, i);
|
2964
|
+
});
|
2965
|
+
} else {
|
2966
|
+
setTimeout(function () {
|
2967
|
+
H.eachAsync(arr, fn, finalFunc, chunkSize, i);
|
2968
|
+
});
|
2969
|
+
}
|
2970
|
+
|
2971
|
+
} else if (finalFunc) {
|
2972
|
+
finalFunc();
|
2973
|
+
}
|
2974
|
+
}
|
2975
|
+
};
|
2976
|
+
|
2977
|
+
// /////////////////////////////////////////////////////////////////////////////
|
2978
|
+
// Following is the parts of the boost that's common between OGL/Legacy
|
2979
|
+
|
2980
|
+
/**
|
2981
|
+
* Return a full Point object based on the index.
|
2982
|
+
* The boost module uses stripped point objects for performance reasons.
|
2983
|
+
*
|
2984
|
+
* @function Highcharts.Series#getPoint
|
2985
|
+
*
|
2986
|
+
* @param {object|Highcharts.Point} boostPoint
|
2987
|
+
* A stripped-down point object
|
2988
|
+
*
|
2989
|
+
* @return {object}
|
2990
|
+
* A Point object as per http://api.highcharts.com/highcharts#Point
|
2991
|
+
*/
|
2992
|
+
Series.prototype.getPoint = function (boostPoint) {
|
2993
|
+
var point = boostPoint,
|
2994
|
+
xData = (
|
2995
|
+
this.xData || this.options.xData || this.processedXData || false
|
2996
|
+
);
|
2997
|
+
|
2998
|
+
if (boostPoint && !(boostPoint instanceof this.pointClass)) {
|
2999
|
+
point = (new this.pointClass()).init( // eslint-disable-line new-cap
|
3000
|
+
this,
|
3001
|
+
this.options.data[boostPoint.i],
|
3002
|
+
xData ? xData[boostPoint.i] : undefined
|
3003
|
+
);
|
3004
|
+
|
3005
|
+
point.category = point.x;
|
3006
|
+
|
3007
|
+
point.dist = boostPoint.dist;
|
3008
|
+
point.distX = boostPoint.distX;
|
3009
|
+
point.plotX = boostPoint.plotX;
|
3010
|
+
point.plotY = boostPoint.plotY;
|
3011
|
+
point.index = boostPoint.i;
|
3012
|
+
}
|
3013
|
+
|
3014
|
+
return point;
|
3015
|
+
};
|
3016
|
+
|
3017
|
+
/**
|
3018
|
+
* Return a point instance from the k-d-tree
|
3019
|
+
*/
|
3020
|
+
wrap(Series.prototype, 'searchPoint', function (proceed) {
|
3021
|
+
return this.getPoint(
|
3022
|
+
proceed.apply(this, [].slice.call(arguments, 1))
|
3023
|
+
);
|
3024
|
+
});
|
3025
|
+
|
3026
|
+
/**
|
3027
|
+
* Extend series.destroy to also remove the fake k-d-tree points (#5137).
|
3028
|
+
* Normally this is handled by Series.destroy that calls Point.destroy,
|
3029
|
+
* but the fake search points are not registered like that.
|
3030
|
+
*/
|
3031
|
+
addEvent(Series, 'destroy', function () {
|
3032
|
+
var series = this,
|
3033
|
+
chart = series.chart;
|
3034
|
+
|
3035
|
+
if (chart.markerGroup === series.markerGroup) {
|
3036
|
+
series.markerGroup = null;
|
3037
|
+
}
|
3038
|
+
|
3039
|
+
if (chart.hoverPoints) {
|
3040
|
+
chart.hoverPoints = chart.hoverPoints.filter(function (point) {
|
3041
|
+
return point.series === series;
|
3042
|
+
});
|
3043
|
+
}
|
3044
|
+
|
3045
|
+
if (chart.hoverPoint && chart.hoverPoint.series === series) {
|
3046
|
+
chart.hoverPoint = null;
|
3047
|
+
}
|
3048
|
+
});
|
3049
|
+
|
3050
|
+
/**
|
3051
|
+
* Do not compute extremes when min and max are set.
|
3052
|
+
* If we use this in the core, we can add the hook
|
3053
|
+
* to hasExtremes to the methods directly.
|
3054
|
+
*/
|
3055
|
+
wrap(Series.prototype, 'getExtremes', function (proceed) {
|
3056
|
+
if (!this.isSeriesBoosting || (!this.hasExtremes || !this.hasExtremes())) {
|
3057
|
+
return proceed.apply(this, Array.prototype.slice.call(arguments, 1));
|
3058
|
+
}
|
3059
|
+
});
|
3060
|
+
|
3061
|
+
// Set default options
|
3062
|
+
boostable.forEach(
|
3063
|
+
function (type) {
|
3064
|
+
if (plotOptions[type]) {
|
3065
|
+
plotOptions[type].boostThreshold = 5000;
|
3066
|
+
plotOptions[type].boostData = [];
|
3067
|
+
|
3068
|
+
seriesTypes[type].prototype.fillOpacity = true;
|
3069
|
+
}
|
3070
|
+
}
|
3071
|
+
);
|
3072
|
+
|
3073
|
+
/**
|
3074
|
+
* Override a bunch of methods the same way. If the number of points is
|
3075
|
+
* below the threshold, run the original method. If not, check for a
|
3076
|
+
* canvas version or do nothing.
|
3077
|
+
*
|
3078
|
+
* Note that we're not overriding any of these for heatmaps.
|
3079
|
+
*/
|
3080
|
+
[
|
3081
|
+
'translate',
|
3082
|
+
'generatePoints',
|
3083
|
+
'drawTracker',
|
3084
|
+
'drawPoints',
|
3085
|
+
'render'
|
3086
|
+
].forEach(function (method) {
|
3087
|
+
function branch(proceed) {
|
3088
|
+
var letItPass = this.options.stacking &&
|
3089
|
+
(method === 'translate' || method === 'generatePoints');
|
3090
|
+
|
3091
|
+
if (
|
3092
|
+
!this.isSeriesBoosting ||
|
3093
|
+
letItPass ||
|
3094
|
+
!boostEnabled(this.chart) ||
|
3095
|
+
this.type === 'heatmap' ||
|
3096
|
+
this.type === 'treemap' ||
|
3097
|
+
!boostableMap[this.type] ||
|
3098
|
+
this.options.boostThreshold === 0
|
3099
|
+
) {
|
3100
|
+
|
3101
|
+
proceed.call(this);
|
3102
|
+
|
3103
|
+
// If a canvas version of the method exists, like renderCanvas(), run
|
3104
|
+
} else if (this[method + 'Canvas']) {
|
3105
|
+
this[method + 'Canvas']();
|
3106
|
+
}
|
3107
|
+
}
|
3108
|
+
|
3109
|
+
wrap(Series.prototype, method, branch);
|
3110
|
+
|
3111
|
+
// A special case for some types - their translate method is already wrapped
|
3112
|
+
if (method === 'translate') {
|
3113
|
+
[
|
3114
|
+
'column',
|
3115
|
+
'bar',
|
3116
|
+
'arearange',
|
3117
|
+
'columnrange',
|
3118
|
+
'heatmap',
|
3119
|
+
'treemap'
|
3120
|
+
].forEach(
|
3121
|
+
function (type) {
|
3122
|
+
if (seriesTypes[type]) {
|
3123
|
+
wrap(seriesTypes[type].prototype, method, branch);
|
3124
|
+
}
|
3125
|
+
}
|
3126
|
+
);
|
3127
|
+
}
|
3128
|
+
});
|
3129
|
+
|
3130
|
+
/** If the series is a heatmap or treemap, or if the series is not boosting
|
3131
|
+
* do the default behaviour. Otherwise, process if the series has no
|
3132
|
+
* extremes.
|
3133
|
+
*/
|
3134
|
+
wrap(Series.prototype, 'processData', function (proceed) {
|
3135
|
+
|
3136
|
+
var series = this,
|
3137
|
+
dataToMeasure = this.options.data;
|
3138
|
+
|
3139
|
+
// Used twice in this function, first on this.options.data, the second
|
3140
|
+
// time it runs the check again after processedXData is built.
|
3141
|
+
// @todo Check what happens with data grouping
|
3142
|
+
function getSeriesBoosting(data) {
|
3143
|
+
return series.chart.isChartSeriesBoosting() || (
|
3144
|
+
(data ? data.length : 0) >=
|
3145
|
+
(series.options.boostThreshold || Number.MAX_VALUE)
|
3146
|
+
);
|
3147
|
+
}
|
3148
|
+
|
3149
|
+
if (boostEnabled(this.chart) && boostableMap[this.type]) {
|
3150
|
+
|
3151
|
+
// If there are no extremes given in the options, we also need to
|
3152
|
+
// process the data to read the data extremes. If this is a heatmap, do
|
3153
|
+
// default behaviour.
|
3154
|
+
if (
|
3155
|
+
!getSeriesBoosting(dataToMeasure) || // First pass with options.data
|
3156
|
+
this.type === 'heatmap' ||
|
3157
|
+
this.type === 'treemap' ||
|
3158
|
+
this.options.stacking || // processedYData for the stack (#7481)
|
3159
|
+
!this.hasExtremes ||
|
3160
|
+
!this.hasExtremes(true)
|
3161
|
+
) {
|
3162
|
+
proceed.apply(this, Array.prototype.slice.call(arguments, 1));
|
3163
|
+
dataToMeasure = this.processedXData;
|
3164
|
+
}
|
3165
|
+
|
3166
|
+
// Set the isBoosting flag, second pass with processedXData to see if we
|
3167
|
+
// have zoomed.
|
3168
|
+
this.isSeriesBoosting = getSeriesBoosting(dataToMeasure);
|
3169
|
+
|
3170
|
+
// Enter or exit boost mode
|
3171
|
+
if (this.isSeriesBoosting) {
|
3172
|
+
this.enterBoost();
|
3173
|
+
} else if (this.exitBoost) {
|
3174
|
+
this.exitBoost();
|
3175
|
+
}
|
3176
|
+
|
3177
|
+
// The series type is not boostable
|
3178
|
+
} else {
|
3179
|
+
proceed.apply(this, Array.prototype.slice.call(arguments, 1));
|
3180
|
+
}
|
3181
|
+
});
|
3182
|
+
|
3183
|
+
addEvent(Series, 'hide', function () {
|
3184
|
+
if (this.canvas && this.renderTarget) {
|
3185
|
+
if (this.ogl) {
|
3186
|
+
this.ogl.clear();
|
3187
|
+
}
|
3188
|
+
this.boostClear();
|
3189
|
+
}
|
3190
|
+
|
3191
|
+
});
|
3192
|
+
|
3193
|
+
/**
|
3194
|
+
* Enter boost mode and apply boost-specific properties.
|
3195
|
+
*
|
3196
|
+
* @function Highcharts.Series#enterBoost
|
3197
|
+
*/
|
3198
|
+
Series.prototype.enterBoost = function () {
|
3199
|
+
|
3200
|
+
this.alteredByBoost = [];
|
3201
|
+
|
3202
|
+
// Save the original values, including whether it was an own property or
|
3203
|
+
// inherited from the prototype.
|
3204
|
+
['allowDG', 'directTouch', 'stickyTracking'].forEach(function (prop) {
|
3205
|
+
this.alteredByBoost.push({
|
3206
|
+
prop: prop,
|
3207
|
+
val: this[prop],
|
3208
|
+
own: this.hasOwnProperty(prop)
|
3209
|
+
});
|
3210
|
+
}, this);
|
3211
|
+
|
3212
|
+
this.allowDG = false;
|
3213
|
+
this.directTouch = false;
|
3214
|
+
this.stickyTracking = true;
|
3215
|
+
|
3216
|
+
// Once we've been in boost mode, we don't want animation when returning to
|
3217
|
+
// vanilla mode.
|
3218
|
+
this.animate = null;
|
3219
|
+
|
3220
|
+
// Hide series label if any
|
3221
|
+
if (this.labelBySeries) {
|
3222
|
+
this.labelBySeries = this.labelBySeries.destroy();
|
3223
|
+
}
|
3224
|
+
};
|
3225
|
+
|
3226
|
+
/**
|
3227
|
+
* Exit from boost mode and restore non-boost properties.
|
3228
|
+
*
|
3229
|
+
* @function Highcharts.Series#exitBoost
|
3230
|
+
*/
|
3231
|
+
Series.prototype.exitBoost = function () {
|
3232
|
+
// Reset instance properties and/or delete instance properties and go back
|
3233
|
+
// to prototype
|
3234
|
+
(this.alteredByBoost || []).forEach(function (setting) {
|
3235
|
+
if (setting.own) {
|
3236
|
+
this[setting.prop] = setting.val;
|
3237
|
+
} else {
|
3238
|
+
// Revert to prototype
|
3239
|
+
delete this[setting.prop];
|
3240
|
+
}
|
3241
|
+
}, this);
|
3242
|
+
|
3243
|
+
// Clear previous run
|
3244
|
+
if (this.boostClear) {
|
3245
|
+
this.boostClear();
|
3246
|
+
}
|
3247
|
+
|
3248
|
+
};
|
3249
|
+
|
3250
|
+
/**
|
3251
|
+
* @private
|
3252
|
+
* @function Highcharts.Series#hasExtremes
|
3253
|
+
*
|
3254
|
+
* @param {boolean} checkX
|
3255
|
+
*
|
3256
|
+
* @return {boolean}
|
3257
|
+
*/
|
3258
|
+
Series.prototype.hasExtremes = function (checkX) {
|
3259
|
+
var options = this.options,
|
3260
|
+
data = options.data,
|
3261
|
+
xAxis = this.xAxis && this.xAxis.options,
|
3262
|
+
yAxis = this.yAxis && this.yAxis.options;
|
3263
|
+
|
3264
|
+
return data.length > (options.boostThreshold || Number.MAX_VALUE) &&
|
3265
|
+
isNumber(yAxis.min) && isNumber(yAxis.max) &&
|
3266
|
+
(!checkX || (isNumber(xAxis.min) && isNumber(xAxis.max)));
|
3267
|
+
};
|
3268
|
+
|
3269
|
+
/**
|
3270
|
+
* If implemented in the core, parts of this can probably be
|
3271
|
+
* shared with other similar methods in Highcharts.
|
3272
|
+
*
|
3273
|
+
* @function Highcharts.Series#destroyGraphics
|
3274
|
+
*/
|
3275
|
+
Series.prototype.destroyGraphics = function () {
|
3276
|
+
var series = this,
|
3277
|
+
points = this.points,
|
3278
|
+
point,
|
3279
|
+
i;
|
3280
|
+
|
3281
|
+
if (points) {
|
3282
|
+
for (i = 0; i < points.length; i = i + 1) {
|
3283
|
+
point = points[i];
|
3284
|
+
if (point && point.destroyElements) {
|
3285
|
+
point.destroyElements(); // #7557
|
3286
|
+
}
|
3287
|
+
}
|
3288
|
+
}
|
3289
|
+
|
3290
|
+
['graph', 'area', 'tracker'].forEach(function (prop) {
|
3291
|
+
if (series[prop]) {
|
3292
|
+
series[prop] = series[prop].destroy();
|
3293
|
+
}
|
3294
|
+
});
|
3295
|
+
};
|
3296
|
+
|
3297
|
+
|
3298
|
+
/**
|
3299
|
+
* Returns true if the current browser supports webgl
|
3300
|
+
*
|
3301
|
+
* @private
|
3302
|
+
* @function Highcharts.hasWebGLSupport
|
3303
|
+
*
|
3304
|
+
* @return {boolean}
|
3305
|
+
*/
|
3306
|
+
H.hasWebGLSupport = function () {
|
3307
|
+
var i = 0,
|
3308
|
+
canvas,
|
3309
|
+
contexts = ['webgl', 'experimental-webgl', 'moz-webgl', 'webkit-3d'],
|
3310
|
+
context = false;
|
3311
|
+
|
3312
|
+
if (typeof win.WebGLRenderingContext !== 'undefined') {
|
3313
|
+
canvas = doc.createElement('canvas');
|
3314
|
+
|
3315
|
+
for (; i < contexts.length; i++) {
|
3316
|
+
try {
|
3317
|
+
context = canvas.getContext(contexts[i]);
|
3318
|
+
if (typeof context !== 'undefined' && context !== null) {
|
3319
|
+
return true;
|
3320
|
+
}
|
3321
|
+
} catch (e) {
|
3322
|
+
|
3323
|
+
}
|
3324
|
+
}
|
3325
|
+
}
|
3326
|
+
|
3327
|
+
return false;
|
3328
|
+
};
|
3329
|
+
|
3330
|
+
/**
|
3331
|
+
* Used for treemap|heatmap.drawPoints
|
3332
|
+
*
|
3333
|
+
* @private
|
3334
|
+
* @function pointDrawHandler
|
3335
|
+
*
|
3336
|
+
* @param {Function} proceed
|
3337
|
+
*
|
3338
|
+
* @return {*}
|
3339
|
+
*/
|
3340
|
+
function pointDrawHandler(proceed) {
|
3341
|
+
var enabled = true,
|
3342
|
+
renderer;
|
3343
|
+
|
3344
|
+
if (this.chart.options && this.chart.options.boost) {
|
3345
|
+
enabled = typeof this.chart.options.boost.enabled === 'undefined' ?
|
3346
|
+
true :
|
3347
|
+
this.chart.options.boost.enabled;
|
3348
|
+
}
|
3349
|
+
|
3350
|
+
if (!enabled || !this.isSeriesBoosting) {
|
3351
|
+
return proceed.call(this);
|
3352
|
+
}
|
3353
|
+
|
3354
|
+
this.chart.isBoosting = true;
|
3355
|
+
|
3356
|
+
// Make sure we have a valid OGL context
|
3357
|
+
renderer = createAndAttachRenderer(this.chart, this);
|
3358
|
+
|
3359
|
+
if (renderer) {
|
3360
|
+
allocateIfNotSeriesBoosting(renderer, this);
|
3361
|
+
renderer.pushSeries(this);
|
3362
|
+
}
|
3363
|
+
|
3364
|
+
renderIfNotSeriesBoosting(renderer, this);
|
3365
|
+
}
|
3366
|
+
|
3367
|
+
// /////////////////////////////////////////////////////////////////////////////
|
3368
|
+
// We're wrapped in a closure, so just return if there's no webgl support
|
3369
|
+
|
3370
|
+
if (!H.hasWebGLSupport()) {
|
3371
|
+
if (typeof H.initCanvasBoost !== 'undefined') {
|
3372
|
+
// Fallback to canvas boost
|
3373
|
+
H.initCanvasBoost();
|
3374
|
+
} else {
|
3375
|
+
H.error(26);
|
3376
|
+
}
|
3377
|
+
} else {
|
3378
|
+
|
3379
|
+
// /////////////////////////////////////////////////////////////////////////
|
3380
|
+
// GL-SPECIFIC WRAPPINGS FOLLOWS
|
3381
|
+
|
3382
|
+
|
3383
|
+
H.extend(Series.prototype, {
|
3384
|
+
|
3385
|
+
/**
|
3386
|
+
* @private
|
3387
|
+
* @function Highcharts.Series#renderCanvas
|
3388
|
+
*/
|
3389
|
+
renderCanvas: function () {
|
3390
|
+
var series = this,
|
3391
|
+
options = series.options || {},
|
3392
|
+
renderer = false,
|
3393
|
+
chart = series.chart,
|
3394
|
+
xAxis = this.xAxis,
|
3395
|
+
yAxis = this.yAxis,
|
3396
|
+
xData = options.xData || series.processedXData,
|
3397
|
+
yData = options.yData || series.processedYData,
|
3398
|
+
rawData = options.data,
|
3399
|
+
xExtremes = xAxis.getExtremes(),
|
3400
|
+
xMin = xExtremes.min,
|
3401
|
+
xMax = xExtremes.max,
|
3402
|
+
yExtremes = yAxis.getExtremes(),
|
3403
|
+
yMin = yExtremes.min,
|
3404
|
+
yMax = yExtremes.max,
|
3405
|
+
pointTaken = {},
|
3406
|
+
lastClientX,
|
3407
|
+
sampling = !!series.sampling,
|
3408
|
+
points,
|
3409
|
+
enableMouseTracking = options.enableMouseTracking !== false,
|
3410
|
+
threshold = options.threshold,
|
3411
|
+
yBottom = yAxis.getThreshold(threshold),
|
3412
|
+
isRange = series.pointArrayMap &&
|
3413
|
+
series.pointArrayMap.join(',') === 'low,high',
|
3414
|
+
isStacked = !!options.stacking,
|
3415
|
+
cropStart = series.cropStart || 0,
|
3416
|
+
requireSorting = series.requireSorting,
|
3417
|
+
useRaw = !xData,
|
3418
|
+
minVal,
|
3419
|
+
maxVal,
|
3420
|
+
minI,
|
3421
|
+
maxI,
|
3422
|
+
boostOptions,
|
3423
|
+
compareX = options.findNearestPointBy === 'x',
|
3424
|
+
|
3425
|
+
xDataFull = (
|
3426
|
+
this.xData ||
|
3427
|
+
this.options.xData ||
|
3428
|
+
this.processedXData ||
|
3429
|
+
false
|
3430
|
+
),
|
3431
|
+
|
3432
|
+
addKDPoint = function (clientX, plotY, i) {
|
3433
|
+
|
3434
|
+
// We need to do ceil on the clientX to make things
|
3435
|
+
// snap to pixel values. The renderer will frequently
|
3436
|
+
// draw stuff on "sub-pixels".
|
3437
|
+
clientX = Math.ceil(clientX);
|
3438
|
+
|
3439
|
+
// Shaves off about 60ms compared to repeated concatenation
|
3440
|
+
index = compareX ? clientX : clientX + ',' + plotY;
|
3441
|
+
|
3442
|
+
// The k-d tree requires series points.
|
3443
|
+
// Reduce the amount of points, since the time to build the
|
3444
|
+
// tree increases exponentially.
|
3445
|
+
if (enableMouseTracking && !pointTaken[index]) {
|
3446
|
+
pointTaken[index] = true;
|
3447
|
+
|
3448
|
+
if (chart.inverted) {
|
3449
|
+
clientX = xAxis.len - clientX;
|
3450
|
+
plotY = yAxis.len - plotY;
|
3451
|
+
}
|
3452
|
+
|
3453
|
+
points.push({
|
3454
|
+
x: xDataFull ? xDataFull[cropStart + i] : false,
|
3455
|
+
clientX: clientX,
|
3456
|
+
plotX: clientX,
|
3457
|
+
plotY: plotY,
|
3458
|
+
i: cropStart + i
|
3459
|
+
});
|
3460
|
+
}
|
3461
|
+
};
|
3462
|
+
|
3463
|
+
// Get or create the renderer
|
3464
|
+
renderer = createAndAttachRenderer(chart, series);
|
3465
|
+
|
3466
|
+
chart.isBoosting = true;
|
3467
|
+
|
3468
|
+
boostOptions = renderer.settings;
|
3469
|
+
|
3470
|
+
if (!this.visible) {
|
3471
|
+
return;
|
3472
|
+
}
|
3473
|
+
|
3474
|
+
// If we are zooming out from SVG mode, destroy the graphics
|
3475
|
+
if (this.points || this.graph) {
|
3476
|
+
|
3477
|
+
this.animate = null;
|
3478
|
+
this.destroyGraphics();
|
3479
|
+
}
|
3480
|
+
|
3481
|
+
// If we're rendering per. series we should create the marker groups
|
3482
|
+
// as usual.
|
3483
|
+
if (!chart.isChartSeriesBoosting()) {
|
3484
|
+
this.markerGroup = series.plotGroup(
|
3485
|
+
'markerGroup',
|
3486
|
+
'markers',
|
3487
|
+
true,
|
3488
|
+
1,
|
3489
|
+
chart.seriesGroup
|
3490
|
+
);
|
3491
|
+
} else {
|
3492
|
+
// Use a single group for the markers
|
3493
|
+
this.markerGroup = chart.markerGroup;
|
3494
|
+
|
3495
|
+
// When switching from chart boosting mode, destroy redundant
|
3496
|
+
// series boosting targets
|
3497
|
+
if (this.renderTarget) {
|
3498
|
+
this.renderTarget = this.renderTarget.destroy();
|
3499
|
+
}
|
3500
|
+
}
|
3501
|
+
|
3502
|
+
points = this.points = [];
|
3503
|
+
|
3504
|
+
// Do not start building while drawing
|
3505
|
+
series.buildKDTree = noop;
|
3506
|
+
|
3507
|
+
if (renderer) {
|
3508
|
+
allocateIfNotSeriesBoosting(renderer, this);
|
3509
|
+
renderer.pushSeries(series);
|
3510
|
+
// Perform the actual renderer if we're on series level
|
3511
|
+
renderIfNotSeriesBoosting(renderer, this, chart);
|
3512
|
+
}
|
3513
|
+
|
3514
|
+
/* This builds the KD-tree */
|
3515
|
+
function processPoint(d, i) {
|
3516
|
+
var x,
|
3517
|
+
y,
|
3518
|
+
clientX,
|
3519
|
+
plotY,
|
3520
|
+
isNull,
|
3521
|
+
low = false,
|
3522
|
+
chartDestroyed = typeof chart.index === 'undefined',
|
3523
|
+
isYInside = true;
|
3524
|
+
|
3525
|
+
if (!chartDestroyed) {
|
3526
|
+
if (useRaw) {
|
3527
|
+
x = d[0];
|
3528
|
+
y = d[1];
|
3529
|
+
} else {
|
3530
|
+
x = d;
|
3531
|
+
y = yData[i];
|
3532
|
+
}
|
3533
|
+
|
3534
|
+
// Resolve low and high for range series
|
3535
|
+
if (isRange) {
|
3536
|
+
if (useRaw) {
|
3537
|
+
y = d.slice(1, 3);
|
3538
|
+
}
|
3539
|
+
low = y[0];
|
3540
|
+
y = y[1];
|
3541
|
+
} else if (isStacked) {
|
3542
|
+
x = d.x;
|
3543
|
+
y = d.stackY;
|
3544
|
+
low = y - d.y;
|
3545
|
+
}
|
3546
|
+
|
3547
|
+
isNull = y === null;
|
3548
|
+
|
3549
|
+
// Optimize for scatter zooming
|
3550
|
+
if (!requireSorting) {
|
3551
|
+
isYInside = y >= yMin && y <= yMax;
|
3552
|
+
}
|
3553
|
+
|
3554
|
+
if (!isNull && x >= xMin && x <= xMax && isYInside) {
|
3555
|
+
|
3556
|
+
clientX = xAxis.toPixels(x, true);
|
3557
|
+
|
3558
|
+
if (sampling) {
|
3559
|
+
if (minI === undefined || clientX === lastClientX) {
|
3560
|
+
if (!isRange) {
|
3561
|
+
low = y;
|
3562
|
+
}
|
3563
|
+
if (maxI === undefined || y > maxVal) {
|
3564
|
+
maxVal = y;
|
3565
|
+
maxI = i;
|
3566
|
+
}
|
3567
|
+
if (minI === undefined || low < minVal) {
|
3568
|
+
minVal = low;
|
3569
|
+
minI = i;
|
3570
|
+
}
|
3571
|
+
|
3572
|
+
}
|
3573
|
+
// Add points and reset
|
3574
|
+
if (clientX !== lastClientX) {
|
3575
|
+
if (minI !== undefined) { // maxI is number too
|
3576
|
+
plotY = yAxis.toPixels(maxVal, true);
|
3577
|
+
yBottom = yAxis.toPixels(minVal, true);
|
3578
|
+
|
3579
|
+
addKDPoint(clientX, plotY, maxI);
|
3580
|
+
if (yBottom !== plotY) {
|
3581
|
+
addKDPoint(clientX, yBottom, minI);
|
3582
|
+
}
|
3583
|
+
}
|
3584
|
+
|
3585
|
+
minI = maxI = undefined;
|
3586
|
+
lastClientX = clientX;
|
3587
|
+
}
|
3588
|
+
} else {
|
3589
|
+
plotY = Math.ceil(yAxis.toPixels(y, true));
|
3590
|
+
addKDPoint(clientX, plotY, i);
|
3591
|
+
}
|
3592
|
+
}
|
3593
|
+
}
|
3594
|
+
|
3595
|
+
return !chartDestroyed;
|
3596
|
+
}
|
3597
|
+
|
3598
|
+
function doneProcessing() {
|
3599
|
+
fireEvent(series, 'renderedCanvas');
|
3600
|
+
|
3601
|
+
// Go back to prototype, ready to build
|
3602
|
+
delete series.buildKDTree;
|
3603
|
+
series.buildKDTree();
|
3604
|
+
|
3605
|
+
if (boostOptions.debug.timeKDTree) {
|
3606
|
+
console.timeEnd('kd tree building'); // eslint-disable-line no-console
|
3607
|
+
}
|
3608
|
+
}
|
3609
|
+
|
3610
|
+
// Loop over the points to build the k-d tree - skip this if
|
3611
|
+
// exporting
|
3612
|
+
if (!chart.renderer.forExport) {
|
3613
|
+
if (boostOptions.debug.timeKDTree) {
|
3614
|
+
console.time('kd tree building'); // eslint-disable-line no-console
|
3615
|
+
}
|
3616
|
+
|
3617
|
+
H.eachAsync(
|
3618
|
+
isStacked ? series.data : (xData || rawData),
|
3619
|
+
processPoint,
|
3620
|
+
doneProcessing
|
3621
|
+
);
|
3622
|
+
}
|
3623
|
+
}
|
3624
|
+
});
|
3625
|
+
|
3626
|
+
/* *
|
3627
|
+
* We need to handle heatmaps separatly, since we can't perform the
|
3628
|
+
* size/color calculations in the shader easily.
|
3629
|
+
*
|
3630
|
+
* This likely needs future optimization.
|
3631
|
+
*/
|
3632
|
+
['heatmap', 'treemap'].forEach(
|
3633
|
+
function (t) {
|
3634
|
+
if (seriesTypes[t]) {
|
3635
|
+
wrap(seriesTypes[t].prototype, 'drawPoints', pointDrawHandler);
|
3636
|
+
}
|
3637
|
+
}
|
3638
|
+
);
|
3639
|
+
|
3640
|
+
if (seriesTypes.bubble) {
|
3641
|
+
// By default, the bubble series does not use the KD-tree, so force it
|
3642
|
+
// to.
|
3643
|
+
delete seriesTypes.bubble.prototype.buildKDTree;
|
3644
|
+
// seriesTypes.bubble.prototype.directTouch = false;
|
3645
|
+
|
3646
|
+
// Needed for markers to work correctly
|
3647
|
+
wrap(
|
3648
|
+
seriesTypes.bubble.prototype,
|
3649
|
+
'markerAttribs',
|
3650
|
+
function (proceed) {
|
3651
|
+
if (this.isSeriesBoosting) {
|
3652
|
+
return false;
|
3653
|
+
}
|
3654
|
+
return proceed.apply(this, [].slice.call(arguments, 1));
|
3655
|
+
}
|
3656
|
+
);
|
3657
|
+
}
|
3658
|
+
|
3659
|
+
seriesTypes.scatter.prototype.fill = true;
|
3660
|
+
|
3661
|
+
extend(seriesTypes.area.prototype, {
|
3662
|
+
fill: true,
|
3663
|
+
fillOpacity: true,
|
3664
|
+
sampling: true
|
3665
|
+
});
|
3666
|
+
|
3667
|
+
|
3668
|
+
extend(seriesTypes.column.prototype, {
|
3669
|
+
fill: true,
|
3670
|
+
sampling: true
|
3671
|
+
});
|
3672
|
+
|
3673
|
+
// Take care of the canvas blitting
|
3674
|
+
H.Chart.prototype.callbacks.push(function (chart) {
|
3675
|
+
|
3676
|
+
/* Convert chart-level canvas to image */
|
3677
|
+
function canvasToSVG() {
|
3678
|
+
if (chart.ogl && chart.isChartSeriesBoosting()) {
|
3679
|
+
chart.ogl.render(chart);
|
3680
|
+
}
|
3681
|
+
}
|
3682
|
+
|
3683
|
+
/* Clear chart-level canvas */
|
3684
|
+
function preRender() {
|
3685
|
+
// Reset force state
|
3686
|
+
chart.boostForceChartBoost = undefined;
|
3687
|
+
chart.boostForceChartBoost = shouldForceChartSeriesBoosting(chart);
|
3688
|
+
chart.isBoosting = false;
|
3689
|
+
|
3690
|
+
if (!chart.isChartSeriesBoosting() && chart.didBoost) {
|
3691
|
+
chart.didBoost = false;
|
3692
|
+
}
|
3693
|
+
|
3694
|
+
// Clear the canvas
|
3695
|
+
if (chart.boostClear) {
|
3696
|
+
chart.boostClear();
|
3697
|
+
}
|
3698
|
+
|
3699
|
+
if (chart.canvas && chart.ogl && chart.isChartSeriesBoosting()) {
|
3700
|
+
chart.didBoost = true;
|
3701
|
+
|
3702
|
+
// Allocate
|
3703
|
+
chart.ogl.allocateBuffer(chart);
|
3704
|
+
}
|
3705
|
+
|
3706
|
+
// see #6518 + #6739
|
3707
|
+
if (
|
3708
|
+
chart.markerGroup &&
|
3709
|
+
chart.xAxis &&
|
3710
|
+
chart.xAxis.length > 0 &&
|
3711
|
+
chart.yAxis &&
|
3712
|
+
chart.yAxis.length > 0
|
3713
|
+
) {
|
3714
|
+
chart.markerGroup.translate(
|
3715
|
+
chart.xAxis[0].pos,
|
3716
|
+
chart.yAxis[0].pos
|
3717
|
+
);
|
3718
|
+
}
|
3719
|
+
}
|
3720
|
+
|
3721
|
+
addEvent(chart, 'predraw', preRender);
|
3722
|
+
addEvent(chart, 'render', canvasToSVG);
|
3723
|
+
|
3724
|
+
// addEvent(chart, 'zoom', function () {
|
3725
|
+
// chart.boostForceChartBoost =
|
3726
|
+
// shouldForceChartSeriesBoosting(chart);
|
3727
|
+
// });
|
3728
|
+
|
3729
|
+
});
|
3730
|
+
} // if hasCanvasSupport
|