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,2625 @@
|
|
1
|
+
/**
|
2
|
+
* (c) 2009-2019 Highsoft AS
|
3
|
+
* Authors: Øystein Moseng, Torstein Hønsi, Jon A. Nygård
|
4
|
+
*
|
5
|
+
* License: www.highcharts.com/license
|
6
|
+
*/
|
7
|
+
|
8
|
+
/**
|
9
|
+
* Function callback to execute while series points are dragged. Return false to
|
10
|
+
* stop the default drag action.
|
11
|
+
*
|
12
|
+
* @callback Highcharts.SeriesPointDragCallbackFunction
|
13
|
+
*
|
14
|
+
* @param {Highcharts.Point} this
|
15
|
+
* Point where the event occured.
|
16
|
+
*
|
17
|
+
* @param {Highcharts.SeriesPointDragEventObject} event
|
18
|
+
* Event arguments.
|
19
|
+
*/
|
20
|
+
|
21
|
+
/**
|
22
|
+
* Contains common information for a drag event on series points.
|
23
|
+
*
|
24
|
+
* @interface Highcharts.SeriesPointDragEventObject
|
25
|
+
*//**
|
26
|
+
* New points during drag.
|
27
|
+
* @name Highcharts.SeriesPointDragEventObject#newPoints
|
28
|
+
* @type {Highcharts.Dictionary<Highcharts.SeriesPointDragPointObject>}
|
29
|
+
*//**
|
30
|
+
* Original data.
|
31
|
+
* @name Highcharts.SeriesPointDragEventObject#origin
|
32
|
+
* @type {object}
|
33
|
+
*//**
|
34
|
+
* Prevent default drag action.
|
35
|
+
* @name Highcharts.SeriesPointDragEventObject#preventDefault
|
36
|
+
* @type {Function}
|
37
|
+
*//**
|
38
|
+
* Target point that caused the event.
|
39
|
+
* @name Highcharts.SeriesPointDragEventObject#target
|
40
|
+
* @type {Highcharts.Point}
|
41
|
+
*//**
|
42
|
+
* Event type.
|
43
|
+
* @name Highcharts.SeriesPointDragEventObject#type
|
44
|
+
* @type {"drag"}
|
45
|
+
*/
|
46
|
+
|
47
|
+
/**
|
48
|
+
* Contains information about a dragged points new values.
|
49
|
+
*
|
50
|
+
* @interface Highcharts.SeriesPointDragPointObject
|
51
|
+
*//**
|
52
|
+
* New values.
|
53
|
+
* @name Highcharts.SeriesPointDragPointObject#newValues
|
54
|
+
* @type {Highcharts.Dictionary<number>}
|
55
|
+
*//**
|
56
|
+
* Dragged point.
|
57
|
+
* @name Highcharts.SeriesPointDragPointObject#point
|
58
|
+
* @type {Highcharts.Point}
|
59
|
+
*/
|
60
|
+
|
61
|
+
/**
|
62
|
+
* Function callback to execute when a series point is dragged.
|
63
|
+
*
|
64
|
+
* @callback Highcharts.SeriesPointDragStartCallbackFunction
|
65
|
+
*
|
66
|
+
* @param {Highcharts.Point} this
|
67
|
+
* Point where the event occured.
|
68
|
+
*
|
69
|
+
* @param {Highcharts.SeriesPointDragStartEventObject} event
|
70
|
+
* Event arguments.
|
71
|
+
*/
|
72
|
+
|
73
|
+
/**
|
74
|
+
* Contains common information for a drag event on series point.
|
75
|
+
*
|
76
|
+
* @interface Highcharts.SeriesPointDragStartEventObject
|
77
|
+
*
|
78
|
+
* @implements {global.MouseDownEvent}
|
79
|
+
*//**
|
80
|
+
* Data property being dragged.
|
81
|
+
* @name Highcharts.SeriesPointDragStartEventObject#updateProp
|
82
|
+
* @type {Highcharts.Dictionary<number>}
|
83
|
+
*/
|
84
|
+
|
85
|
+
/**
|
86
|
+
* Function callback to execute when series points are dropped.
|
87
|
+
*
|
88
|
+
* @callback Highcharts.SeriesPointDropCallbackFunction
|
89
|
+
*
|
90
|
+
* @param {Highcharts.Point} this
|
91
|
+
* Point where the event occured.
|
92
|
+
*
|
93
|
+
* @param {Highcharts.SeriesPointDropEventObject} event
|
94
|
+
* Event arguments.
|
95
|
+
*/
|
96
|
+
|
97
|
+
/**
|
98
|
+
* Contains common information for a drop event on series points.
|
99
|
+
*
|
100
|
+
* @interface Highcharts.SeriesPointDropEventObject
|
101
|
+
*//**
|
102
|
+
* New points after drop.
|
103
|
+
* @name Highcharts.SeriesPointDropEventObject#newPoints
|
104
|
+
* @type {Highcharts.Dictionary<Highcharts.SeriesPointDropPointObject>}
|
105
|
+
*//**
|
106
|
+
* Number of new points.
|
107
|
+
* @name Highcharts.SeriesPointDropEventObject#numNewPoints
|
108
|
+
* @type {number}
|
109
|
+
*//**
|
110
|
+
* Original data.
|
111
|
+
* @name Highcharts.SeriesPointDropEventObject#origin
|
112
|
+
* @type {object}
|
113
|
+
*//**
|
114
|
+
* Prevent default drop action.
|
115
|
+
* @name Highcharts.SeriesPointDropEventObject#preventDefault
|
116
|
+
* @type {Function}
|
117
|
+
*//**
|
118
|
+
* Target point that caused the event.
|
119
|
+
* @name Highcharts.SeriesPointDropEventObject#target
|
120
|
+
* @type {Highcharts.Point}
|
121
|
+
*//**
|
122
|
+
* Event type.
|
123
|
+
* @name Highcharts.SeriesPointDropEventObject#type
|
124
|
+
* @type {"drop"}
|
125
|
+
*/
|
126
|
+
|
127
|
+
/**
|
128
|
+
* Contains information about a dropped points new values.
|
129
|
+
*
|
130
|
+
* @interface Highcharts.SeriesPointDropPointObject
|
131
|
+
*//**
|
132
|
+
* New values.
|
133
|
+
* @name Highcharts.SeriesPointDropPointObject#newValues
|
134
|
+
* @type {Highcharts.Dictionary<number>}
|
135
|
+
*//**
|
136
|
+
* Dragged point.
|
137
|
+
* @name Highcharts.SeriesPointDropPointObject#point
|
138
|
+
* @type {Highcharts.Point}
|
139
|
+
*/
|
140
|
+
|
141
|
+
'use strict';
|
142
|
+
|
143
|
+
import H from '../parts/Globals.js';
|
144
|
+
import '../parts/Utilities.js';
|
145
|
+
|
146
|
+
var addEvent = H.addEvent,
|
147
|
+
objectEach = H.objectEach,
|
148
|
+
pick = H.pick,
|
149
|
+
merge = H.merge,
|
150
|
+
seriesTypes = H.seriesTypes;
|
151
|
+
|
152
|
+
/**
|
153
|
+
* Flip a side property, used with resizeRect. If input side is "left", return
|
154
|
+
* "right" etc.
|
155
|
+
*
|
156
|
+
* @private
|
157
|
+
* @function flipResizeSide
|
158
|
+
*
|
159
|
+
* @param {string} side
|
160
|
+
* Side prop to flip. Can be `left`, `right`, `top` or `bottom`.
|
161
|
+
*
|
162
|
+
* @return {"bottom"|"left"|"right"|"top"|undefined}
|
163
|
+
* The flipped side.
|
164
|
+
*/
|
165
|
+
function flipResizeSide(side) {
|
166
|
+
return {
|
167
|
+
left: 'right',
|
168
|
+
right: 'left',
|
169
|
+
top: 'bottom',
|
170
|
+
bottom: 'top'
|
171
|
+
}[side];
|
172
|
+
}
|
173
|
+
|
174
|
+
/* @todo
|
175
|
+
Add drag/drop support to specific data props for different series types.
|
176
|
+
|
177
|
+
The dragDrop.draggableX/Y user options on series enable/disable all of these per
|
178
|
+
irection unless they are specifically set in options using
|
179
|
+
dragDrop.{optionName}. If the prop does not specify an optionName here, it can
|
180
|
+
only be enabled/disabled by the user with draggableX/Y.
|
181
|
+
|
182
|
+
Supported options for each prop:
|
183
|
+
optionName: User option in series.dragDrop that enables/disables
|
184
|
+
dragging this prop.
|
185
|
+
axis: Can be 'x' or 'y'. Whether this prop is linked to x or y axis.
|
186
|
+
move: Whether or not this prop should be updated when moving points.
|
187
|
+
resize: Whether or not to draw a drag handle and allow user to drag and
|
188
|
+
update this prop by itself.
|
189
|
+
beforeResize: Hook to perform tasks before a resize is made. Gets
|
190
|
+
the guide box, the new points values, and the point as args.
|
191
|
+
resizeSide: Which side of the guide box to resize when dragging the
|
192
|
+
handle. Can be "left", "right", "top", "bottom". Chart.inverted is
|
193
|
+
handled automatically. Can also be a function, taking the new point
|
194
|
+
values as parameter, as well as the point, and returning a string
|
195
|
+
with the side.
|
196
|
+
propValidate: Function that takes the prop value and the point as
|
197
|
+
arguments, and returns true if the prop value is valid, false if
|
198
|
+
not. It is used to prevent e.g. resizing "low" above "high".
|
199
|
+
handlePositioner: For resizeable props, return 0,0 in SVG plot coords of
|
200
|
+
where to place the dragHandle. Gets point as argument. Should return
|
201
|
+
object with x and y properties.
|
202
|
+
handleFormatter: For resizeable props, return the path of the drag
|
203
|
+
handle as an SVG path array. Gets the point as argument. The handle
|
204
|
+
is translated according to handlePositioner.
|
205
|
+
handleOptions: Options to merge with the default handle options.
|
206
|
+
|
207
|
+
TODO:
|
208
|
+
- It makes sense to have support for resizing the size of bubbles and
|
209
|
+
e.g variwide columns. This requires us to support dragging along a
|
210
|
+
z-axis, somehow computing a relative value from old to new pixel
|
211
|
+
size.
|
212
|
+
- Moving maps could be useful, although we would have to compute new
|
213
|
+
point.path values in order to do it properly (using SVG translate
|
214
|
+
is easier, but won't update the data).
|
215
|
+
*/
|
216
|
+
|
217
|
+
// 90deg rotated column handle path, used in multiple series types
|
218
|
+
var horizHandleFormatter = function (point) {
|
219
|
+
var shapeArgs = point.shapeArgs || point.graphic.getBBox(),
|
220
|
+
top = shapeArgs.r || 0, // Rounding of bar corners
|
221
|
+
bottom = shapeArgs.height - top,
|
222
|
+
centerY = shapeArgs.height / 2;
|
223
|
+
|
224
|
+
return [
|
225
|
+
// Top wick
|
226
|
+
'M', 0, top,
|
227
|
+
'L', 0, centerY - 5,
|
228
|
+
// Circle
|
229
|
+
'A', 1, 1, 0, 0, 0, 0, centerY + 5,
|
230
|
+
'A', 1, 1, 0, 0, 0, 0, centerY - 5,
|
231
|
+
// Bottom wick
|
232
|
+
'M', 0, centerY + 5,
|
233
|
+
'L', 0, bottom
|
234
|
+
];
|
235
|
+
};
|
236
|
+
|
237
|
+
// Line series - only draggableX/Y, no drag handles
|
238
|
+
var lineDragDropProps = seriesTypes.line.prototype.dragDropProps = {
|
239
|
+
x: {
|
240
|
+
axis: 'x',
|
241
|
+
move: true
|
242
|
+
},
|
243
|
+
y: {
|
244
|
+
axis: 'y',
|
245
|
+
move: true
|
246
|
+
}
|
247
|
+
};
|
248
|
+
|
249
|
+
// Flag series - same as line/scatter
|
250
|
+
if (seriesTypes.flags) {
|
251
|
+
seriesTypes.flags.prototype.dragDropProps = lineDragDropProps;
|
252
|
+
}
|
253
|
+
|
254
|
+
// Column series - x can be moved, y can only be resized. Note extra
|
255
|
+
// functionality for handling upside down columns (below threshold).
|
256
|
+
var columnDragDropProps = seriesTypes.column.prototype.dragDropProps = {
|
257
|
+
x: {
|
258
|
+
axis: 'x',
|
259
|
+
move: true
|
260
|
+
},
|
261
|
+
y: {
|
262
|
+
axis: 'y',
|
263
|
+
move: false,
|
264
|
+
resize: true,
|
265
|
+
// Force guideBox start coordinates
|
266
|
+
beforeResize: function (guideBox, pointVals, point) {
|
267
|
+
// We need to ensure that guideBox always starts at threshold.
|
268
|
+
// We flip whether or not we update the top or bottom of the guide
|
269
|
+
// box at threshold, but if we drag the mouse fast, the top has not
|
270
|
+
// reached threshold before we cross over and update the bottom.
|
271
|
+
var threshold = point.series.translatedThreshold,
|
272
|
+
y = guideBox.attr('y'),
|
273
|
+
height,
|
274
|
+
diff;
|
275
|
+
|
276
|
+
if (pointVals.y >= point.series.options.threshold || 0) {
|
277
|
+
// Above threshold - always set height to hit the threshold
|
278
|
+
height = guideBox.attr('height');
|
279
|
+
diff = threshold ? threshold - (y + height) : 0;
|
280
|
+
guideBox.attr({
|
281
|
+
height: Math.max(0, Math.round(height + diff))
|
282
|
+
});
|
283
|
+
} else {
|
284
|
+
// Below - always set y to start at threshold
|
285
|
+
guideBox.attr({
|
286
|
+
y: Math.round(y + (threshold ? threshold - y : 0))
|
287
|
+
});
|
288
|
+
}
|
289
|
+
},
|
290
|
+
// Flip the side of the resize handle if column is below threshold.
|
291
|
+
// Make sure we remove the handle on the other side.
|
292
|
+
resizeSide: function (pointVals, point) {
|
293
|
+
var chart = point.series.chart,
|
294
|
+
dragHandles = chart.dragHandles,
|
295
|
+
side = pointVals.y >= (point.series.options.threshold || 0) ?
|
296
|
+
'top' : 'bottom',
|
297
|
+
flipSide = flipResizeSide(side);
|
298
|
+
|
299
|
+
// Force remove handle on other side
|
300
|
+
if (dragHandles[flipSide]) {
|
301
|
+
dragHandles[flipSide].destroy();
|
302
|
+
delete dragHandles[flipSide];
|
303
|
+
}
|
304
|
+
return side;
|
305
|
+
},
|
306
|
+
// Position handle at bottom if column is below threshold
|
307
|
+
handlePositioner: function (point) {
|
308
|
+
var bBox = point.shapeArgs || point.graphic.getBBox();
|
309
|
+
|
310
|
+
return {
|
311
|
+
x: bBox.x,
|
312
|
+
y: point.y >= (point.series.options.threshold || 0) ?
|
313
|
+
bBox.y : bBox.y + bBox.height
|
314
|
+
};
|
315
|
+
},
|
316
|
+
// Horizontal handle
|
317
|
+
handleFormatter: function (point) {
|
318
|
+
var shapeArgs = point.shapeArgs,
|
319
|
+
radius = shapeArgs.r || 0, // Rounding of bar corners
|
320
|
+
centerX = shapeArgs.width / 2;
|
321
|
+
|
322
|
+
return [
|
323
|
+
// Left wick
|
324
|
+
'M', radius, 0,
|
325
|
+
'L', centerX - 5, 0,
|
326
|
+
// Circle
|
327
|
+
'A', 1, 1, 0, 0, 0, centerX + 5, 0,
|
328
|
+
'A', 1, 1, 0, 0, 0, centerX - 5, 0,
|
329
|
+
// Right wick
|
330
|
+
'M', centerX + 5, 0,
|
331
|
+
'L', shapeArgs.width - radius, 0
|
332
|
+
];
|
333
|
+
}
|
334
|
+
}
|
335
|
+
};
|
336
|
+
|
337
|
+
// Bullet graph, x/y same as column, but also allow target to be dragged.
|
338
|
+
if (seriesTypes.bullet) {
|
339
|
+
seriesTypes.bullet.prototype.dragDropProps = {
|
340
|
+
x: columnDragDropProps.x,
|
341
|
+
y: columnDragDropProps.y,
|
342
|
+
/**
|
343
|
+
* Allow target value to be dragged individually. Requires
|
344
|
+
* `draggable-points` module.
|
345
|
+
*
|
346
|
+
* @type {boolean}
|
347
|
+
* @default true
|
348
|
+
* @apioption plotOptions.bullet.dragDrop.draggableTarget
|
349
|
+
*/
|
350
|
+
target: {
|
351
|
+
optionName: 'draggableTarget',
|
352
|
+
axis: 'y',
|
353
|
+
move: true,
|
354
|
+
resize: true,
|
355
|
+
resizeSide: 'top',
|
356
|
+
handlePositioner: function (point) {
|
357
|
+
var bBox = point.targetGraphic.getBBox();
|
358
|
+
|
359
|
+
return {
|
360
|
+
x: point.barX,
|
361
|
+
y: bBox.y + bBox.height / 2
|
362
|
+
};
|
363
|
+
},
|
364
|
+
handleFormatter: columnDragDropProps.y.handleFormatter
|
365
|
+
}
|
366
|
+
};
|
367
|
+
}
|
368
|
+
|
369
|
+
// Columnrange series - move x, resize or move low/high
|
370
|
+
if (seriesTypes.columnrange) {
|
371
|
+
seriesTypes.columnrange.prototype.dragDropProps = {
|
372
|
+
x: {
|
373
|
+
axis: 'x',
|
374
|
+
move: true
|
375
|
+
},
|
376
|
+
/**
|
377
|
+
* Allow low value to be dragged individually. Requires
|
378
|
+
* `draggable-points` module.
|
379
|
+
*
|
380
|
+
* @type {boolean}
|
381
|
+
* @default true
|
382
|
+
* @apioption plotOptions.columnrange.dragDrop.draggableLow
|
383
|
+
*/
|
384
|
+
low: {
|
385
|
+
optionName: 'draggableLow',
|
386
|
+
axis: 'y',
|
387
|
+
move: true,
|
388
|
+
resize: true,
|
389
|
+
resizeSide: 'bottom',
|
390
|
+
handlePositioner: function (point) {
|
391
|
+
var bBox = point.shapeArgs || point.graphic.getBBox();
|
392
|
+
|
393
|
+
return {
|
394
|
+
x: bBox.x,
|
395
|
+
y: bBox.y + bBox.height
|
396
|
+
};
|
397
|
+
},
|
398
|
+
handleFormatter: columnDragDropProps.y.handleFormatter,
|
399
|
+
propValidate: function (val, point) {
|
400
|
+
return val <= point.high;
|
401
|
+
}
|
402
|
+
},
|
403
|
+
/**
|
404
|
+
* Allow high value to be dragged individually. Requires
|
405
|
+
* `draggable-points` module.
|
406
|
+
*
|
407
|
+
* @type {boolean}
|
408
|
+
* @default true
|
409
|
+
* @apioption plotOptions.columnrange.dragDrop.draggableHigh
|
410
|
+
*/
|
411
|
+
high: {
|
412
|
+
optionName: 'draggableHigh',
|
413
|
+
axis: 'y',
|
414
|
+
move: true,
|
415
|
+
resize: true,
|
416
|
+
resizeSide: 'top',
|
417
|
+
handlePositioner: function (point) {
|
418
|
+
var bBox = point.shapeArgs || point.graphic.getBBox();
|
419
|
+
|
420
|
+
return {
|
421
|
+
x: bBox.x,
|
422
|
+
y: bBox.y
|
423
|
+
};
|
424
|
+
},
|
425
|
+
handleFormatter: columnDragDropProps.y.handleFormatter,
|
426
|
+
propValidate: function (val, point) {
|
427
|
+
return val >= point.low;
|
428
|
+
}
|
429
|
+
}
|
430
|
+
};
|
431
|
+
}
|
432
|
+
|
433
|
+
// Boxplot series - move x, resize or move low/q1/q3/high
|
434
|
+
if (seriesTypes.boxplot) {
|
435
|
+
seriesTypes.boxplot.prototype.dragDropProps = {
|
436
|
+
x: columnDragDropProps.x,
|
437
|
+
/**
|
438
|
+
* Allow low value to be dragged individually. Requires
|
439
|
+
* `draggable-points` module.
|
440
|
+
*
|
441
|
+
* @type {boolean}
|
442
|
+
* @default true
|
443
|
+
* @apioption plotOptions.boxplot.dragDrop.draggableLow
|
444
|
+
*/
|
445
|
+
low: {
|
446
|
+
optionName: 'draggableLow',
|
447
|
+
axis: 'y',
|
448
|
+
move: true,
|
449
|
+
resize: true,
|
450
|
+
resizeSide: 'bottom',
|
451
|
+
handlePositioner: function (point) {
|
452
|
+
return {
|
453
|
+
x: point.shapeArgs.x,
|
454
|
+
y: point.lowPlot
|
455
|
+
};
|
456
|
+
},
|
457
|
+
handleFormatter: columnDragDropProps.y.handleFormatter,
|
458
|
+
propValidate: function (val, point) {
|
459
|
+
return val <= point.q1;
|
460
|
+
}
|
461
|
+
},
|
462
|
+
/**
|
463
|
+
* Allow Q1 value to be dragged individually. Requires
|
464
|
+
* `draggable-points` module.
|
465
|
+
*
|
466
|
+
* @type {boolean}
|
467
|
+
* @default true
|
468
|
+
* @apioption plotOptions.boxplot.dragDrop.draggableQ1
|
469
|
+
*/
|
470
|
+
q1: {
|
471
|
+
optionName: 'draggableQ1',
|
472
|
+
axis: 'y',
|
473
|
+
move: true,
|
474
|
+
resize: true,
|
475
|
+
resizeSide: 'bottom',
|
476
|
+
handlePositioner: function (point) {
|
477
|
+
return {
|
478
|
+
x: point.shapeArgs.x,
|
479
|
+
y: point.q1Plot
|
480
|
+
};
|
481
|
+
},
|
482
|
+
handleFormatter: columnDragDropProps.y.handleFormatter,
|
483
|
+
propValidate: function (val, point) {
|
484
|
+
return val <= point.median && val >= point.low;
|
485
|
+
}
|
486
|
+
},
|
487
|
+
median: {
|
488
|
+
// Median can not be dragged individually, just move the whole
|
489
|
+
// point for this.
|
490
|
+
axis: 'y',
|
491
|
+
move: true
|
492
|
+
},
|
493
|
+
/**
|
494
|
+
* Allow Q3 value to be dragged individually. Requires
|
495
|
+
* `draggable-points` module.
|
496
|
+
*
|
497
|
+
* @type {boolean}
|
498
|
+
* @default true
|
499
|
+
* @apioption plotOptions.boxplot.dragDrop.draggableQ3
|
500
|
+
*/
|
501
|
+
q3: {
|
502
|
+
optionName: 'draggableQ3',
|
503
|
+
axis: 'y',
|
504
|
+
move: true,
|
505
|
+
resize: true,
|
506
|
+
resizeSide: 'top',
|
507
|
+
handlePositioner: function (point) {
|
508
|
+
return {
|
509
|
+
x: point.shapeArgs.x,
|
510
|
+
y: point.q3Plot
|
511
|
+
};
|
512
|
+
},
|
513
|
+
handleFormatter: columnDragDropProps.y.handleFormatter,
|
514
|
+
propValidate: function (val, point) {
|
515
|
+
return val <= point.high && val >= point.median;
|
516
|
+
}
|
517
|
+
},
|
518
|
+
/**
|
519
|
+
* Allow high value to be dragged individually. Requires
|
520
|
+
* `draggable-points` module.
|
521
|
+
*
|
522
|
+
* @type {boolean}
|
523
|
+
* @default true
|
524
|
+
* @apioption plotOptions.boxplot.dragDrop.draggableHigh
|
525
|
+
*/
|
526
|
+
high: {
|
527
|
+
optionName: 'draggableHigh',
|
528
|
+
axis: 'y',
|
529
|
+
move: true,
|
530
|
+
resize: true,
|
531
|
+
resizeSide: 'top',
|
532
|
+
handlePositioner: function (point) {
|
533
|
+
return {
|
534
|
+
x: point.shapeArgs.x,
|
535
|
+
y: point.highPlot
|
536
|
+
};
|
537
|
+
},
|
538
|
+
handleFormatter: columnDragDropProps.y.handleFormatter,
|
539
|
+
propValidate: function (val, point) {
|
540
|
+
return val >= point.q3;
|
541
|
+
}
|
542
|
+
}
|
543
|
+
};
|
544
|
+
}
|
545
|
+
|
546
|
+
|
547
|
+
// OHLC series - move x, resize or move open/high/low/close
|
548
|
+
if (seriesTypes.ohlc) {
|
549
|
+
seriesTypes.ohlc.prototype.dragDropProps = {
|
550
|
+
x: columnDragDropProps.x,
|
551
|
+
/**
|
552
|
+
* Allow low value to be dragged individually. Requires
|
553
|
+
* `draggable-points` module.
|
554
|
+
*
|
555
|
+
* @type {boolean}
|
556
|
+
* @default true
|
557
|
+
* @apioption plotOptions.ohlc.dragDrop.draggableLow
|
558
|
+
*/
|
559
|
+
low: {
|
560
|
+
optionName: 'draggableLow',
|
561
|
+
axis: 'y',
|
562
|
+
move: true,
|
563
|
+
resize: true,
|
564
|
+
resizeSide: 'bottom',
|
565
|
+
handlePositioner: function (point) {
|
566
|
+
return {
|
567
|
+
x: point.shapeArgs.x,
|
568
|
+
y: point.plotLow
|
569
|
+
};
|
570
|
+
},
|
571
|
+
handleFormatter: columnDragDropProps.y.handleFormatter,
|
572
|
+
propValidate: function (val, point) {
|
573
|
+
return val <= point.open && val <= point.close;
|
574
|
+
}
|
575
|
+
},
|
576
|
+
/**
|
577
|
+
* Allow high value to be dragged individually. Requires
|
578
|
+
* `draggable-points` module.
|
579
|
+
*
|
580
|
+
* @type {boolean}
|
581
|
+
* @default true
|
582
|
+
* @apioption plotOptions.ohlc.dragDrop.draggableHigh
|
583
|
+
*/
|
584
|
+
high: {
|
585
|
+
optionName: 'draggableHigh',
|
586
|
+
axis: 'y',
|
587
|
+
move: true,
|
588
|
+
resize: true,
|
589
|
+
resizeSide: 'top',
|
590
|
+
handlePositioner: function (point) {
|
591
|
+
return {
|
592
|
+
x: point.shapeArgs.x,
|
593
|
+
y: point.plotHigh
|
594
|
+
};
|
595
|
+
},
|
596
|
+
handleFormatter: columnDragDropProps.y.handleFormatter,
|
597
|
+
propValidate: function (val, point) {
|
598
|
+
return val >= point.open && val >= point.close;
|
599
|
+
}
|
600
|
+
},
|
601
|
+
/**
|
602
|
+
* Allow open value to be dragged individually. Requires
|
603
|
+
* `draggable-points` module.
|
604
|
+
*
|
605
|
+
* @type {boolean}
|
606
|
+
* @default true
|
607
|
+
* @apioption plotOptions.ohlc.dragDrop.draggableOpen
|
608
|
+
*/
|
609
|
+
open: {
|
610
|
+
optionName: 'draggableOpen',
|
611
|
+
axis: 'y',
|
612
|
+
move: true,
|
613
|
+
resize: true,
|
614
|
+
resizeSide: function (point) {
|
615
|
+
return point.open >= point.close ? 'top' : 'bottom';
|
616
|
+
},
|
617
|
+
handlePositioner: function (point) {
|
618
|
+
return {
|
619
|
+
x: point.shapeArgs.x,
|
620
|
+
y: point.plotOpen
|
621
|
+
};
|
622
|
+
},
|
623
|
+
handleFormatter: columnDragDropProps.y.handleFormatter,
|
624
|
+
propValidate: function (val, point) {
|
625
|
+
return val <= point.high && val >= point.low;
|
626
|
+
}
|
627
|
+
},
|
628
|
+
/**
|
629
|
+
* Allow close value to be dragged individually. Requires
|
630
|
+
* `draggable-points` module.
|
631
|
+
*
|
632
|
+
* @type {boolean}
|
633
|
+
* @default true
|
634
|
+
* @apioption plotOptions.ohlc.dragDrop.draggableClose
|
635
|
+
*/
|
636
|
+
close: {
|
637
|
+
optionName: 'draggableClose',
|
638
|
+
axis: 'y',
|
639
|
+
move: true,
|
640
|
+
resize: true,
|
641
|
+
resizeSide: function (point) {
|
642
|
+
return point.open >= point.close ? 'bottom' : 'top';
|
643
|
+
},
|
644
|
+
handlePositioner: function (point) {
|
645
|
+
return {
|
646
|
+
x: point.shapeArgs.x,
|
647
|
+
y: point.plotClose
|
648
|
+
};
|
649
|
+
},
|
650
|
+
handleFormatter: columnDragDropProps.y.handleFormatter,
|
651
|
+
propValidate: function (val, point) {
|
652
|
+
return val <= point.high && val >= point.low;
|
653
|
+
}
|
654
|
+
}
|
655
|
+
};
|
656
|
+
}
|
657
|
+
|
658
|
+
// Arearange series - move x, resize or move low/high
|
659
|
+
if (seriesTypes.arearange) {
|
660
|
+
var columnrangeDragDropProps = seriesTypes.columnrange
|
661
|
+
.prototype.dragDropProps,
|
662
|
+
// Use a circle covering the marker as drag handle
|
663
|
+
arearangeHandleFormatter = function (point) {
|
664
|
+
var radius = point.graphic ?
|
665
|
+
point.graphic.getBBox().width / 2 + 1 :
|
666
|
+
4;
|
667
|
+
|
668
|
+
return [
|
669
|
+
'M', 0 - radius, 0,
|
670
|
+
'a', radius, radius, 0, 1, 0, radius * 2, 0,
|
671
|
+
'a', radius, radius, 0, 1, 0, radius * -2, 0
|
672
|
+
];
|
673
|
+
};
|
674
|
+
|
675
|
+
seriesTypes.arearange.prototype.dragDropProps = {
|
676
|
+
x: columnrangeDragDropProps.x,
|
677
|
+
/**
|
678
|
+
* Allow low value to be dragged individually. Requires
|
679
|
+
* `draggable-points` module.
|
680
|
+
*
|
681
|
+
* @type {boolean}
|
682
|
+
* @default true
|
683
|
+
* @apioption plotOptions.arearange.dragDrop.draggableLow
|
684
|
+
*/
|
685
|
+
low: {
|
686
|
+
optionName: 'draggableLow',
|
687
|
+
axis: 'y',
|
688
|
+
move: true,
|
689
|
+
resize: true,
|
690
|
+
resizeSide: 'bottom',
|
691
|
+
handlePositioner: function (point) {
|
692
|
+
var bBox = point.lowerGraphic && point.lowerGraphic.getBBox();
|
693
|
+
|
694
|
+
return bBox ? {
|
695
|
+
x: bBox.x + bBox.width / 2,
|
696
|
+
y: bBox.y + bBox.height / 2
|
697
|
+
} : { x: -999, y: -999 };
|
698
|
+
},
|
699
|
+
handleFormatter: arearangeHandleFormatter,
|
700
|
+
propValidate: columnrangeDragDropProps.low.propValidate
|
701
|
+
},
|
702
|
+
/**
|
703
|
+
* Allow high value to be dragged individually. Requires
|
704
|
+
* `draggable-points` module.
|
705
|
+
*
|
706
|
+
* @type {boolean}
|
707
|
+
* @default true
|
708
|
+
* @apioption plotOptions.arearange.dragDrop.draggableHigh
|
709
|
+
*/
|
710
|
+
high: {
|
711
|
+
optionName: 'draggableHigh',
|
712
|
+
axis: 'y',
|
713
|
+
move: true,
|
714
|
+
resize: true,
|
715
|
+
resizeSide: 'top',
|
716
|
+
handlePositioner: function (point) {
|
717
|
+
var bBox = point.upperGraphic && point.upperGraphic.getBBox();
|
718
|
+
|
719
|
+
return bBox ? {
|
720
|
+
x: bBox.x + bBox.width / 2,
|
721
|
+
y: bBox.y + bBox.height / 2
|
722
|
+
} : { x: -999, y: -999 };
|
723
|
+
},
|
724
|
+
handleFormatter: arearangeHandleFormatter,
|
725
|
+
propValidate: columnrangeDragDropProps.high.propValidate
|
726
|
+
}
|
727
|
+
};
|
728
|
+
}
|
729
|
+
|
730
|
+
// Waterfall - mostly as column, but don't show drag handles for sum points
|
731
|
+
if (seriesTypes.waterfall) {
|
732
|
+
seriesTypes.waterfall.prototype.dragDropProps = {
|
733
|
+
x: columnDragDropProps.x,
|
734
|
+
y: merge(columnDragDropProps.y, {
|
735
|
+
handleFormatter: function (point) {
|
736
|
+
return point.isSum || point.isIntermediateSum ? null :
|
737
|
+
columnDragDropProps.y.handleFormatter(point);
|
738
|
+
}
|
739
|
+
})
|
740
|
+
};
|
741
|
+
}
|
742
|
+
|
743
|
+
// Xrange - resize/move x/x2, and move y
|
744
|
+
if (seriesTypes.xrange) {
|
745
|
+
// Handle positioner logic is the same for x and x2 apart from the
|
746
|
+
// x value. shapeArgs does not take yAxis reversed etc into account, so we
|
747
|
+
// use axis.toPixels to handle positioning.
|
748
|
+
var xrangeHandlePositioner = function (point, xProp) {
|
749
|
+
var series = point.series,
|
750
|
+
xAxis = series.xAxis,
|
751
|
+
yAxis = series.yAxis,
|
752
|
+
inverted = series.chart.inverted,
|
753
|
+
// Using toPixels handles axis.reversed, but doesn't take
|
754
|
+
// chart.inverted into account.
|
755
|
+
newX = xAxis.toPixels(point[xProp], true),
|
756
|
+
newY = yAxis.toPixels(point.y, true);
|
757
|
+
|
758
|
+
// Handle chart inverted
|
759
|
+
if (inverted) {
|
760
|
+
newX = xAxis.len - newX;
|
761
|
+
newY = yAxis.len - newY -
|
762
|
+
point.shapeArgs.height / 2;
|
763
|
+
} else {
|
764
|
+
newY -= point.shapeArgs.height / 2;
|
765
|
+
}
|
766
|
+
|
767
|
+
return {
|
768
|
+
x: Math.round(newX),
|
769
|
+
y: Math.round(newY)
|
770
|
+
};
|
771
|
+
},
|
772
|
+
xrangeDragDropProps = seriesTypes.xrange.prototype.dragDropProps = {
|
773
|
+
y: {
|
774
|
+
axis: 'y',
|
775
|
+
move: true
|
776
|
+
},
|
777
|
+
/**
|
778
|
+
* Allow x value to be dragged individually. Requires
|
779
|
+
* `draggable-points` module.
|
780
|
+
*
|
781
|
+
* @type {boolean}
|
782
|
+
* @default true
|
783
|
+
* @apioption plotOptions.xrange.dragDrop.draggableX1
|
784
|
+
*/
|
785
|
+
x: {
|
786
|
+
optionName: 'draggableX1',
|
787
|
+
axis: 'x',
|
788
|
+
move: true,
|
789
|
+
resize: true,
|
790
|
+
resizeSide: 'left',
|
791
|
+
handlePositioner: function (point) {
|
792
|
+
return xrangeHandlePositioner(point, 'x');
|
793
|
+
},
|
794
|
+
handleFormatter: horizHandleFormatter,
|
795
|
+
propValidate: function (val, point) {
|
796
|
+
return val <= point.x2;
|
797
|
+
}
|
798
|
+
},
|
799
|
+
/**
|
800
|
+
* Allow x2 value to be dragged individually. Requires
|
801
|
+
* `draggable-points` module.
|
802
|
+
*
|
803
|
+
* @type {boolean}
|
804
|
+
* @default true
|
805
|
+
* @apioption plotOptions.xrange.dragDrop.draggableX2
|
806
|
+
*/
|
807
|
+
x2: {
|
808
|
+
optionName: 'draggableX2',
|
809
|
+
axis: 'x',
|
810
|
+
move: true,
|
811
|
+
resize: true,
|
812
|
+
resizeSide: 'right',
|
813
|
+
handlePositioner: function (point) {
|
814
|
+
return xrangeHandlePositioner(point, 'x2');
|
815
|
+
},
|
816
|
+
handleFormatter: horizHandleFormatter,
|
817
|
+
propValidate: function (val, point) {
|
818
|
+
return val >= point.x;
|
819
|
+
}
|
820
|
+
}
|
821
|
+
};
|
822
|
+
}
|
823
|
+
|
824
|
+
// Gantt - same as xrange, but with aliases
|
825
|
+
if (seriesTypes.gantt) {
|
826
|
+
seriesTypes.gantt.prototype.dragDropProps = {
|
827
|
+
y: xrangeDragDropProps.y,
|
828
|
+
/**
|
829
|
+
* Allow start value to be dragged individually. Requires
|
830
|
+
* `draggable-points` module.
|
831
|
+
*
|
832
|
+
* @type {boolean}
|
833
|
+
* @default true
|
834
|
+
* @apioption plotOptions.gantt.dragDrop.draggableStart
|
835
|
+
*/
|
836
|
+
start: merge(xrangeDragDropProps.x, {
|
837
|
+
optionName: 'draggableStart',
|
838
|
+
// Do not allow individual drag handles for milestones
|
839
|
+
validateIndividualDrag: function (point) {
|
840
|
+
return !point.milestone;
|
841
|
+
}
|
842
|
+
}),
|
843
|
+
/**
|
844
|
+
* Allow end value to be dragged individually. Requires
|
845
|
+
* `draggable-points` module.
|
846
|
+
*
|
847
|
+
* @type {boolean}
|
848
|
+
* @default true
|
849
|
+
* @apioption plotOptions.gantt.dragDrop.draggableEnd
|
850
|
+
*/
|
851
|
+
end: merge(xrangeDragDropProps.x2, {
|
852
|
+
optionName: 'draggableEnd',
|
853
|
+
// Do not allow individual drag handles for milestones
|
854
|
+
validateIndividualDrag: function (point) {
|
855
|
+
return !point.milestone;
|
856
|
+
}
|
857
|
+
})
|
858
|
+
};
|
859
|
+
}
|
860
|
+
|
861
|
+
// Don't support certain series types
|
862
|
+
[
|
863
|
+
'gauge',
|
864
|
+
'pie',
|
865
|
+
'sunburst',
|
866
|
+
'wordcloud',
|
867
|
+
'sankey',
|
868
|
+
'histogram',
|
869
|
+
'pareto',
|
870
|
+
'vector',
|
871
|
+
'windbarb',
|
872
|
+
'treemap',
|
873
|
+
'bellcurve',
|
874
|
+
'sma',
|
875
|
+
'map',
|
876
|
+
'mapline'
|
877
|
+
].forEach(
|
878
|
+
function (type) {
|
879
|
+
if (seriesTypes[type]) {
|
880
|
+
seriesTypes[type].prototype.dragDropProps = null;
|
881
|
+
}
|
882
|
+
}
|
883
|
+
);
|
884
|
+
|
885
|
+
/**
|
886
|
+
* The draggable-points module allows points to be moved around or modified in
|
887
|
+
* the chart. In addition to the options mentioned under the `dragDrop` API
|
888
|
+
* structure, the module fires three events,
|
889
|
+
* [point.dragStart](plotOptions.series.point.events.dragStart),
|
890
|
+
* [point.drag](plotOptions.series.point.events.drag) and
|
891
|
+
* [point.drop](plotOptions.series.point.events.drop).
|
892
|
+
*
|
893
|
+
* It requires the `modules/draggable-points.js` file to be loaded.
|
894
|
+
*
|
895
|
+
* @sample highcharts/dragdrop/resize-column
|
896
|
+
* Draggable column and line series
|
897
|
+
* @sample highcharts/dragdrop/bar-series
|
898
|
+
* Draggable bar
|
899
|
+
* @sample highcharts/dragdrop/drag-bubble
|
900
|
+
* Draggable bubbles
|
901
|
+
* @sample highcharts/dragdrop/drag-xrange
|
902
|
+
* Draggable X range series
|
903
|
+
*
|
904
|
+
* @since 6.2.0
|
905
|
+
* @apioption plotOptions.series.dragDrop
|
906
|
+
*/
|
907
|
+
|
908
|
+
/**
|
909
|
+
* The amount of pixels to drag the pointer before it counts as a drag
|
910
|
+
* operation. This prevents drag/drop to fire when just clicking or selecting
|
911
|
+
* points.
|
912
|
+
*
|
913
|
+
* @type {number}
|
914
|
+
* @default 2
|
915
|
+
* @since 6.2.0
|
916
|
+
* @apioption plotOptions.series.dragDrop.dragSensitivity
|
917
|
+
*/
|
918
|
+
var defaultDragSensitivity = 2;
|
919
|
+
|
920
|
+
/**
|
921
|
+
* Style options for the guide box. The guide box has one state by default, the
|
922
|
+
* `default` state.
|
923
|
+
*
|
924
|
+
* @type {Highcharts.Dictionary<Highcharts.PlotSeriesDragDropGuideBoxDefaultOptions>}
|
925
|
+
* @since 6.2.0
|
926
|
+
* @optionparent plotOptions.series.dragDrop.guideBox
|
927
|
+
*/
|
928
|
+
var defaultGuideBoxOptions = {
|
929
|
+
/**
|
930
|
+
* Style options for the guide box default state.
|
931
|
+
*
|
932
|
+
* @since 6.2.0
|
933
|
+
*/
|
934
|
+
'default': {
|
935
|
+
/**
|
936
|
+
* CSS class name of the guide box in this state. Defaults to
|
937
|
+
* `highcharts-drag-box-default`.
|
938
|
+
*
|
939
|
+
* @since 6.2.0
|
940
|
+
*/
|
941
|
+
className: 'highcharts-drag-box-default',
|
942
|
+
|
943
|
+
/**
|
944
|
+
* Width of the line around the guide box.
|
945
|
+
*
|
946
|
+
* @since 6.2.0
|
947
|
+
*/
|
948
|
+
lineWidth: 1,
|
949
|
+
|
950
|
+
/**
|
951
|
+
* Color of the border around the guide box.
|
952
|
+
*
|
953
|
+
* @type {Highcharts.ColorString}
|
954
|
+
* @since 6.2.0
|
955
|
+
*/
|
956
|
+
lineColor: '#888',
|
957
|
+
|
958
|
+
/**
|
959
|
+
* Guide box fill color.
|
960
|
+
*
|
961
|
+
* @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
|
962
|
+
* @since 6.2.0
|
963
|
+
*/
|
964
|
+
color: 'rgba(0, 0, 0, 0.1)',
|
965
|
+
|
966
|
+
/**
|
967
|
+
* Guide box cursor.
|
968
|
+
*
|
969
|
+
* @since 6.2.0
|
970
|
+
*/
|
971
|
+
cursor: 'move',
|
972
|
+
|
973
|
+
/**
|
974
|
+
* Guide box zIndex.
|
975
|
+
*
|
976
|
+
* @since 6.2.0
|
977
|
+
*/
|
978
|
+
zIndex: 900
|
979
|
+
}
|
980
|
+
};
|
981
|
+
|
982
|
+
|
983
|
+
/**
|
984
|
+
* Options for the drag handles.
|
985
|
+
*
|
986
|
+
* @since 6.2.0
|
987
|
+
* @optionparent plotOptions.series.dragDrop.dragHandle
|
988
|
+
*/
|
989
|
+
var defaultDragHandleOptions = {
|
990
|
+
|
991
|
+
/**
|
992
|
+
* Function to define the SVG path to use for the drag handles. Takes the
|
993
|
+
* point as argument. Should return an SVG path in array format. The SVG
|
994
|
+
* path is automatically positioned on the point.
|
995
|
+
*
|
996
|
+
* @type {Function}
|
997
|
+
* @since 6.2.0
|
998
|
+
* @apioption plotOptions.series.dragDrop.dragHandle.pathFormatter
|
999
|
+
*/
|
1000
|
+
// pathFormatter: null,
|
1001
|
+
|
1002
|
+
/**
|
1003
|
+
* The mouse cursor to use for the drag handles. By default this is
|
1004
|
+
* intelligently switching between `ew-resize` and `ns-resize` depending on
|
1005
|
+
* the direction the point is being dragged.
|
1006
|
+
*
|
1007
|
+
* @type {string}
|
1008
|
+
* @since 6.2.0
|
1009
|
+
* @apioption plotOptions.series.dragDrop.dragHandle.cursor
|
1010
|
+
*/
|
1011
|
+
// cursor: null,
|
1012
|
+
|
1013
|
+
/**
|
1014
|
+
* The class name of the drag handles. Defaults to `highcharts-drag-handle`.
|
1015
|
+
*
|
1016
|
+
* @since 6.2.0
|
1017
|
+
*/
|
1018
|
+
className: 'highcharts-drag-handle',
|
1019
|
+
|
1020
|
+
/**
|
1021
|
+
* The fill color of the drag handles.
|
1022
|
+
*
|
1023
|
+
* @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
|
1024
|
+
* @since 6.2.0
|
1025
|
+
*/
|
1026
|
+
color: '#fff',
|
1027
|
+
|
1028
|
+
/**
|
1029
|
+
* The line color of the drag handles.
|
1030
|
+
*
|
1031
|
+
* @type {Highcharts.ColorString}
|
1032
|
+
* @since 6.2.0
|
1033
|
+
*/
|
1034
|
+
lineColor: 'rgba(0, 0, 0, 0.6)',
|
1035
|
+
|
1036
|
+
/**
|
1037
|
+
* The line width for the drag handles.
|
1038
|
+
*
|
1039
|
+
* @since 6.2.0
|
1040
|
+
*/
|
1041
|
+
lineWidth: 1,
|
1042
|
+
|
1043
|
+
/**
|
1044
|
+
* The z index for the drag handles.
|
1045
|
+
*
|
1046
|
+
* @since 6.2.0
|
1047
|
+
*/
|
1048
|
+
zIndex: 901
|
1049
|
+
};
|
1050
|
+
|
1051
|
+
/**
|
1052
|
+
* Set the minimum X value the points can be moved to.
|
1053
|
+
*
|
1054
|
+
* @sample {gantt} gantt/dragdrop/drag-gantt
|
1055
|
+
* Limit dragging
|
1056
|
+
* @sample {highcharts} highcharts/dragdrop/drag-xrange
|
1057
|
+
* Limit dragging
|
1058
|
+
*
|
1059
|
+
* @type {number}
|
1060
|
+
* @since 6.2.0
|
1061
|
+
* @apioption plotOptions.series.dragDrop.dragMinX
|
1062
|
+
*/
|
1063
|
+
|
1064
|
+
/**
|
1065
|
+
* Set the maximum X value the points can be moved to.
|
1066
|
+
*
|
1067
|
+
* @sample {gantt} gantt/dragdrop/drag-gantt
|
1068
|
+
* Limit dragging
|
1069
|
+
* @sample {highcharts} highcharts/dragdrop/drag-xrange
|
1070
|
+
* Limit dragging
|
1071
|
+
*
|
1072
|
+
* @type {number}
|
1073
|
+
* @since 6.2.0
|
1074
|
+
* @apioption plotOptions.series.dragDrop.dragMaxX
|
1075
|
+
*/
|
1076
|
+
|
1077
|
+
/**
|
1078
|
+
* Set the minimum Y value the points can be moved to.
|
1079
|
+
*
|
1080
|
+
* @sample {gantt} gantt/dragdrop/drag-gantt
|
1081
|
+
* Limit dragging
|
1082
|
+
* @sample {highcharts} highcharts/dragdrop/drag-xrange
|
1083
|
+
* Limit dragging
|
1084
|
+
*
|
1085
|
+
* @type {number}
|
1086
|
+
* @since 6.2.0
|
1087
|
+
* @apioption plotOptions.series.dragDrop.dragMinY
|
1088
|
+
*/
|
1089
|
+
|
1090
|
+
/**
|
1091
|
+
* Set the maximum Y value the points can be moved to.
|
1092
|
+
*
|
1093
|
+
* @sample {gantt} gantt/dragdrop/drag-gantt
|
1094
|
+
* Limit dragging
|
1095
|
+
* @sample {highcharts} highcharts/dragdrop/drag-xrange
|
1096
|
+
* Limit dragging
|
1097
|
+
*
|
1098
|
+
* @type {number}
|
1099
|
+
* @since 6.2.0
|
1100
|
+
* @apioption plotOptions.series.dragDrop.dragMaxY
|
1101
|
+
*/
|
1102
|
+
|
1103
|
+
/**
|
1104
|
+
* The X precision value to drag to for this series. Set to 0 to disable. By
|
1105
|
+
* default this is disabled, except for category axes, where the default is 1.
|
1106
|
+
*
|
1107
|
+
* @type {number}
|
1108
|
+
* @default 0
|
1109
|
+
* @since 6.2.0
|
1110
|
+
* @apioption plotOptions.series.dragDrop.dragPrecisionX
|
1111
|
+
*/
|
1112
|
+
|
1113
|
+
/**
|
1114
|
+
* The Y precision value to drag to for this series. Set to 0 to disable. By
|
1115
|
+
* default this is disabled, except for category axes, where the default is 1.
|
1116
|
+
*
|
1117
|
+
* @type {number}
|
1118
|
+
* @default 0
|
1119
|
+
* @since 6.2.0
|
1120
|
+
* @apioption plotOptions.series.dragDrop.dragPrecisionY
|
1121
|
+
*/
|
1122
|
+
|
1123
|
+
/**
|
1124
|
+
* Enable dragging in the X dimension.
|
1125
|
+
*
|
1126
|
+
* @type {boolean}
|
1127
|
+
* @since 6.2.0
|
1128
|
+
* @apioption plotOptions.series.dragDrop.draggableX
|
1129
|
+
*/
|
1130
|
+
|
1131
|
+
/**
|
1132
|
+
* Enable dragging in the Y dimension. Note that this is not supported for
|
1133
|
+
* TreeGrid axes (the default axis type in Gantt charts).
|
1134
|
+
*
|
1135
|
+
* @type {boolean}
|
1136
|
+
* @since 6.2.0
|
1137
|
+
* @apioption plotOptions.series.dragDrop.draggableY
|
1138
|
+
*/
|
1139
|
+
|
1140
|
+
/**
|
1141
|
+
* Group the points by a property. Points with the same property value will be
|
1142
|
+
* grouped together when moving.
|
1143
|
+
*
|
1144
|
+
* @sample {gantt} gantt/dragdrop/drag-gantt
|
1145
|
+
* Drag grouped points
|
1146
|
+
* @sample {highcharts} highcharts/dragdrop/drag-xrange
|
1147
|
+
* Drag grouped points
|
1148
|
+
*
|
1149
|
+
* @type {string}
|
1150
|
+
* @since 6.2.0
|
1151
|
+
* @apioption plotOptions.series.dragDrop.groupBy
|
1152
|
+
*/
|
1153
|
+
|
1154
|
+
/**
|
1155
|
+
* Update points as they are dragged. If false, a guide box is drawn to
|
1156
|
+
* illustrate the new point size.
|
1157
|
+
*
|
1158
|
+
* @sample {gantt} gantt/dragdrop/drag-gantt
|
1159
|
+
* liveRedraw disabled
|
1160
|
+
* @sample {highcharts} highcharts/dragdrop/drag-xrange
|
1161
|
+
* liveRedraw disabled
|
1162
|
+
*
|
1163
|
+
* @type {boolean}
|
1164
|
+
* @default true
|
1165
|
+
* @since 6.2.0
|
1166
|
+
* @apioption plotOptions.series.dragDrop.liveRedraw
|
1167
|
+
*/
|
1168
|
+
|
1169
|
+
/**
|
1170
|
+
* Set a key to hold when dragging to zoom the chart. Requires the
|
1171
|
+
* draggable-points module. This is useful to avoid zooming while moving points.
|
1172
|
+
* Should be set different than [chart.panKey](#chart.panKey).
|
1173
|
+
*
|
1174
|
+
* @type {string}
|
1175
|
+
* @since 6.2.0
|
1176
|
+
* @validvalue ["alt", "ctrl", "meta", "shift"]
|
1177
|
+
* @apioption chart.zoomKey
|
1178
|
+
*/
|
1179
|
+
|
1180
|
+
/**
|
1181
|
+
* Callback that fires when starting to drag a point. The mouse event object is
|
1182
|
+
* passed in as an argument. If a drag handle is used, `e.updateProp` is set to
|
1183
|
+
* the data property being dragged. The `this` context is the point. See
|
1184
|
+
* [drag and drop options](plotOptions.series.dragDrop).
|
1185
|
+
*
|
1186
|
+
* Requires the `draggable-points` module.
|
1187
|
+
*
|
1188
|
+
* @sample {highcharts} highcharts/dragdrop/drag-xrange
|
1189
|
+
* Drag events
|
1190
|
+
*
|
1191
|
+
* @type {Highcharts.SeriesPointDragStartCallbackFunction}
|
1192
|
+
* @since 6.2.0
|
1193
|
+
* @apioption plotOptions.series.point.events.dragStart
|
1194
|
+
*/
|
1195
|
+
|
1196
|
+
/**
|
1197
|
+
* Callback that fires while dragging a point. The mouse event is passed in as
|
1198
|
+
* parameter. The original data can be accessed from `e.origin`, and the new
|
1199
|
+
* point values can be accessed from `e.newPoints`. If there is only a single
|
1200
|
+
* point being updated, it can be accessed from `e.newPoint` for simplicity, and
|
1201
|
+
* its ID can be accessed from `e.newPointId`. The `this` context is the point
|
1202
|
+
* being dragged. To stop the default drag action, return false. See
|
1203
|
+
* [drag and drop options](plotOptions.series.dragDrop).
|
1204
|
+
*
|
1205
|
+
* Requires the `draggable-points` module.
|
1206
|
+
*
|
1207
|
+
* @sample {highcharts} highcharts/dragdrop/drag-xrange
|
1208
|
+
* Drag events
|
1209
|
+
*
|
1210
|
+
* @type {Highcharts.SeriesPointDragCallbackFunction}
|
1211
|
+
* @since 6.2.0
|
1212
|
+
* @apioption plotOptions.series.point.events.drag
|
1213
|
+
*/
|
1214
|
+
|
1215
|
+
/**
|
1216
|
+
* Callback that fires when the point is dropped. The parameters passed are the
|
1217
|
+
* same as for [drag](#plotOptions.series.point.events.drag). To stop the
|
1218
|
+
* default drop action, return false. See
|
1219
|
+
* [drag and drop options](plotOptions.series.dragDrop).
|
1220
|
+
*
|
1221
|
+
* Requires the `draggable-points` module.
|
1222
|
+
*
|
1223
|
+
* @sample {highcharts} highcharts/dragdrop/drag-xrange
|
1224
|
+
* Drag events
|
1225
|
+
*
|
1226
|
+
* @type {Highcharts.SeriesPointDropCallbackFunction}
|
1227
|
+
* @since 6.2.0
|
1228
|
+
* @apioption plotOptions.series.point.events.drop
|
1229
|
+
*/
|
1230
|
+
|
1231
|
+
/**
|
1232
|
+
* Point specific options for the draggable-points module. Overrides options on
|
1233
|
+
* `series.dragDrop`.
|
1234
|
+
*
|
1235
|
+
* Requires the `draggable-points` module.
|
1236
|
+
*
|
1237
|
+
* @extends plotOptions.series.dragDrop
|
1238
|
+
* @since 6.2.0
|
1239
|
+
* @apioption series.line.data.dragDrop
|
1240
|
+
*/
|
1241
|
+
|
1242
|
+
|
1243
|
+
/**
|
1244
|
+
* Utility function to test if a series is using drag/drop, looking at its
|
1245
|
+
* options.
|
1246
|
+
*
|
1247
|
+
* @private
|
1248
|
+
* @function isSeriesDraggable
|
1249
|
+
*
|
1250
|
+
* @param {Highcharts.Series} series
|
1251
|
+
* The series to test.
|
1252
|
+
*
|
1253
|
+
* @return {boolean}
|
1254
|
+
* True if the series is using drag/drop.
|
1255
|
+
*/
|
1256
|
+
function isSeriesDraggable(series) {
|
1257
|
+
var props = ['draggableX', 'draggableY'],
|
1258
|
+
i;
|
1259
|
+
|
1260
|
+
// Add optionNames from dragDropProps to the array of props to check for
|
1261
|
+
objectEach(series.dragDropProps, function (val) {
|
1262
|
+
if (val.optionName) {
|
1263
|
+
props.push(val.optionName);
|
1264
|
+
}
|
1265
|
+
});
|
1266
|
+
|
1267
|
+
// Loop over all options we have that could enable dragDrop for this
|
1268
|
+
// series. If any of them are truthy, this series is draggable.
|
1269
|
+
i = props.length;
|
1270
|
+
while (i--) {
|
1271
|
+
if (series.options.dragDrop[props[i]]) {
|
1272
|
+
return true;
|
1273
|
+
}
|
1274
|
+
}
|
1275
|
+
}
|
1276
|
+
|
1277
|
+
|
1278
|
+
/**
|
1279
|
+
* Utility function to test if a chart should have drag/drop enabled, looking at
|
1280
|
+
* its options.
|
1281
|
+
*
|
1282
|
+
* @private
|
1283
|
+
* @function isChartDraggable
|
1284
|
+
*
|
1285
|
+
* @param {Highcharts.Chart} chart
|
1286
|
+
* The chart to test.
|
1287
|
+
*
|
1288
|
+
* @return {boolean}
|
1289
|
+
* True if the chart is drag/droppable.
|
1290
|
+
*/
|
1291
|
+
function isChartDraggable(chart) {
|
1292
|
+
var i = chart.series ? chart.series.length : 0;
|
1293
|
+
|
1294
|
+
if (chart.hasCartesianSeries && !chart.polar) {
|
1295
|
+
while (i--) {
|
1296
|
+
if (
|
1297
|
+
chart.series[i].options.dragDrop &&
|
1298
|
+
isSeriesDraggable(chart.series[i])
|
1299
|
+
) {
|
1300
|
+
return true;
|
1301
|
+
}
|
1302
|
+
}
|
1303
|
+
}
|
1304
|
+
}
|
1305
|
+
|
1306
|
+
|
1307
|
+
/**
|
1308
|
+
* Utility function to test if a point is movable (any of its props can be
|
1309
|
+
* dragged by a move, not just individually).
|
1310
|
+
*
|
1311
|
+
* @private
|
1312
|
+
* @function isPointMovable
|
1313
|
+
*
|
1314
|
+
* @param {Highcharts.Point} point
|
1315
|
+
* The point to test.
|
1316
|
+
*
|
1317
|
+
* @return {boolean}
|
1318
|
+
* True if the point is movable.
|
1319
|
+
*/
|
1320
|
+
function isPointMovable(point) {
|
1321
|
+
var series = point.series,
|
1322
|
+
seriesDragDropOptions = series.options.dragDrop || {},
|
1323
|
+
pointDragDropOptions = point.options && point.options.dragDrop,
|
1324
|
+
updateProps = series.dragDropProps,
|
1325
|
+
hasMovableX,
|
1326
|
+
hasMovableY;
|
1327
|
+
|
1328
|
+
objectEach(updateProps, function (p) {
|
1329
|
+
if (p.axis === 'x' && p.move) {
|
1330
|
+
hasMovableX = true;
|
1331
|
+
} else if (p.axis === 'y' && p.move) {
|
1332
|
+
hasMovableY = true;
|
1333
|
+
}
|
1334
|
+
});
|
1335
|
+
|
1336
|
+
// We can only move the point if draggableX/Y is set, even if all the
|
1337
|
+
// individual prop options are set.
|
1338
|
+
return (
|
1339
|
+
seriesDragDropOptions.draggableX && hasMovableX ||
|
1340
|
+
seriesDragDropOptions.draggableY && hasMovableY
|
1341
|
+
) &&
|
1342
|
+
!(
|
1343
|
+
pointDragDropOptions &&
|
1344
|
+
pointDragDropOptions.draggableX === false &&
|
1345
|
+
pointDragDropOptions.draggableY === false
|
1346
|
+
) &&
|
1347
|
+
series.yAxis &&
|
1348
|
+
series.xAxis;
|
1349
|
+
}
|
1350
|
+
|
1351
|
+
|
1352
|
+
/**
|
1353
|
+
* Take a mouse/touch event and return the event object with chartX/chartY.
|
1354
|
+
*
|
1355
|
+
* @private
|
1356
|
+
* @function getNormalizedEvent
|
1357
|
+
*
|
1358
|
+
* @param {global.Event} e
|
1359
|
+
* The event to normalize.
|
1360
|
+
*
|
1361
|
+
* @return {global.Event}
|
1362
|
+
* The normalized event.
|
1363
|
+
*/
|
1364
|
+
function getNormalizedEvent(e, chart) {
|
1365
|
+
return e.chartX === undefined || e.chartY === undefined ?
|
1366
|
+
chart.pointer.normalize(e) : e;
|
1367
|
+
}
|
1368
|
+
|
1369
|
+
|
1370
|
+
/**
|
1371
|
+
* Add multiple event listeners with the same handler to the same element.
|
1372
|
+
*
|
1373
|
+
* @private
|
1374
|
+
* @function addEvents
|
1375
|
+
*
|
1376
|
+
* @param {*} el
|
1377
|
+
* The element or object to add listeners to.
|
1378
|
+
*
|
1379
|
+
* @param {Array<string>} types
|
1380
|
+
* Array with the event types this handler should apply to.
|
1381
|
+
*
|
1382
|
+
* @param {Highcharts.EventCallbackFunction} fn
|
1383
|
+
* The function callback to execute when the events are fired.
|
1384
|
+
*
|
1385
|
+
* @param {Highcharts.Dictionary<*>} options
|
1386
|
+
* Event options
|
1387
|
+
*
|
1388
|
+
* @param {number} options.order
|
1389
|
+
* The order the event handler should be called. This opens for having
|
1390
|
+
* one handler be called before another, independent of in which order
|
1391
|
+
* they were added.
|
1392
|
+
*
|
1393
|
+
* @return {Function}
|
1394
|
+
* A callback function to remove the added events.
|
1395
|
+
*/
|
1396
|
+
function addEvents(el, types, fn, options) {
|
1397
|
+
var removeFuncs = types.map(function (type) {
|
1398
|
+
return addEvent(el, type, fn, options);
|
1399
|
+
});
|
1400
|
+
|
1401
|
+
return function () {
|
1402
|
+
removeFuncs.forEach(function (fn) {
|
1403
|
+
fn();
|
1404
|
+
});
|
1405
|
+
};
|
1406
|
+
}
|
1407
|
+
|
1408
|
+
|
1409
|
+
/**
|
1410
|
+
* In mousemove events, check that we have dragged mouse further than the
|
1411
|
+
* dragSensitivity before we call mouseMove handler.
|
1412
|
+
*
|
1413
|
+
* @private
|
1414
|
+
* @function hasDraggedPastSensitivity
|
1415
|
+
*
|
1416
|
+
* @param {global.Event} e
|
1417
|
+
* Mouse move event to test.
|
1418
|
+
*
|
1419
|
+
* @param {Highcharts.Chart} chart
|
1420
|
+
* Chart that has started dragging.
|
1421
|
+
*
|
1422
|
+
* @param {number} sensitivity
|
1423
|
+
* Pixel sensitivity to test against.
|
1424
|
+
*
|
1425
|
+
* @return {boolean}
|
1426
|
+
* True if the event is moved past sensitivity relative to the chart's
|
1427
|
+
* drag origin.
|
1428
|
+
*/
|
1429
|
+
function hasDraggedPastSensitivity(e, chart, sensitivity) {
|
1430
|
+
var orig = chart.dragDropData.origin,
|
1431
|
+
oldX = orig.chartX,
|
1432
|
+
oldY = orig.chartY,
|
1433
|
+
newX = e.chartX,
|
1434
|
+
newY = e.chartY,
|
1435
|
+
distance = Math.sqrt(
|
1436
|
+
(newX - oldX) * (newX - oldX) +
|
1437
|
+
(newY - oldY) * (newY - oldY)
|
1438
|
+
);
|
1439
|
+
|
1440
|
+
return distance > sensitivity;
|
1441
|
+
}
|
1442
|
+
|
1443
|
+
|
1444
|
+
/**
|
1445
|
+
* Get a snapshot of points, mouse position, and guide box dimensions
|
1446
|
+
*
|
1447
|
+
* @private
|
1448
|
+
* @function getPositionSnapshot
|
1449
|
+
*
|
1450
|
+
* @param {global.Event} e
|
1451
|
+
* Mouse event with mouse position to snapshot.
|
1452
|
+
*
|
1453
|
+
* @param {Array<Highcharts.Point>} points
|
1454
|
+
* Points to take snapshot of. We store the value of the data properties
|
1455
|
+
* defined in each series' dragDropProps.
|
1456
|
+
*
|
1457
|
+
* @param {Highcharts.SVGElement} [guideBox]
|
1458
|
+
* The guide box to take snapshot of.
|
1459
|
+
*
|
1460
|
+
* @return {object}
|
1461
|
+
* Snapshot object. Point properties are placed in a hashmap with IDs as
|
1462
|
+
* keys.
|
1463
|
+
*/
|
1464
|
+
function getPositionSnapshot(e, points, guideBox) {
|
1465
|
+
var res = {
|
1466
|
+
chartX: e.chartX,
|
1467
|
+
chartY: e.chartY,
|
1468
|
+
guideBox: guideBox && {
|
1469
|
+
x: guideBox.attr('x'),
|
1470
|
+
y: guideBox.attr('y'),
|
1471
|
+
width: guideBox.attr('width'),
|
1472
|
+
height: guideBox.attr('height')
|
1473
|
+
},
|
1474
|
+
points: {}
|
1475
|
+
};
|
1476
|
+
|
1477
|
+
// Loop over the points and add their props
|
1478
|
+
points.forEach(function (point) {
|
1479
|
+
var pointProps = {};
|
1480
|
+
|
1481
|
+
// Add all of the props defined in the series' dragDropProps to the
|
1482
|
+
// snapshot
|
1483
|
+
objectEach(point.series.dragDropProps, function (val, key) {
|
1484
|
+
pointProps[key] = point[key];
|
1485
|
+
});
|
1486
|
+
pointProps.point = point; // Store reference to point
|
1487
|
+
res.points[point.id] = pointProps;
|
1488
|
+
});
|
1489
|
+
|
1490
|
+
return res;
|
1491
|
+
}
|
1492
|
+
|
1493
|
+
|
1494
|
+
/**
|
1495
|
+
* Get a list of points that are grouped with this point. If only one point is
|
1496
|
+
* in the group, that point is returned by itself in an array.
|
1497
|
+
*
|
1498
|
+
* @private
|
1499
|
+
* @function getGroupedPoints
|
1500
|
+
*
|
1501
|
+
* @param {Highcharts.Point} point
|
1502
|
+
* Point to find group from.
|
1503
|
+
*
|
1504
|
+
* @return {Array<Highcharts.Point>}
|
1505
|
+
* Array of points in this group.
|
1506
|
+
*/
|
1507
|
+
function getGroupedPoints(point) {
|
1508
|
+
var series = point.series,
|
1509
|
+
groupKey = series.options.dragDrop.groupBy;
|
1510
|
+
|
1511
|
+
return point.options[groupKey] ?
|
1512
|
+
// If we have a grouping option, filter the points by that
|
1513
|
+
series.points.filter(function (comparePoint) {
|
1514
|
+
return comparePoint.options[groupKey] === point.options[groupKey];
|
1515
|
+
}) :
|
1516
|
+
// Otherwise return the point by itself only
|
1517
|
+
[point];
|
1518
|
+
}
|
1519
|
+
|
1520
|
+
|
1521
|
+
/**
|
1522
|
+
* Resize a rect element on one side. The element is modified.
|
1523
|
+
*
|
1524
|
+
* @private
|
1525
|
+
* @function resizeRect
|
1526
|
+
*
|
1527
|
+
* @param {Highcharts.SVGElement} rect
|
1528
|
+
* Rect element to resize.
|
1529
|
+
*
|
1530
|
+
* @param {string} updateSide
|
1531
|
+
* Which side of the rect to update. Can be `left`, `right`, `top` or
|
1532
|
+
* `bottom`.
|
1533
|
+
*
|
1534
|
+
* @param {object} update
|
1535
|
+
* Object with x and y properties, detailing how much to resize each
|
1536
|
+
* dimension.
|
1537
|
+
*
|
1538
|
+
* @return {Highcharts.SVGElement}
|
1539
|
+
* The modified rect.
|
1540
|
+
*/
|
1541
|
+
function resizeRect(rect, updateSide, update) {
|
1542
|
+
var resizeAttrs;
|
1543
|
+
|
1544
|
+
switch (updateSide) {
|
1545
|
+
case 'left':
|
1546
|
+
resizeAttrs = {
|
1547
|
+
x: rect.attr('x') + update.x,
|
1548
|
+
width: Math.max(1, rect.attr('width') - update.x)
|
1549
|
+
};
|
1550
|
+
break;
|
1551
|
+
case 'right':
|
1552
|
+
resizeAttrs = {
|
1553
|
+
width: Math.max(1, rect.attr('width') + update.x)
|
1554
|
+
};
|
1555
|
+
break;
|
1556
|
+
case 'top':
|
1557
|
+
resizeAttrs = {
|
1558
|
+
y: rect.attr('y') + update.y,
|
1559
|
+
height: Math.max(1, rect.attr('height') - update.y)
|
1560
|
+
};
|
1561
|
+
break;
|
1562
|
+
case 'bottom':
|
1563
|
+
resizeAttrs = {
|
1564
|
+
height: Math.max(1, rect.attr('height') + update.y)
|
1565
|
+
};
|
1566
|
+
break;
|
1567
|
+
default:
|
1568
|
+
}
|
1569
|
+
rect.attr(resizeAttrs);
|
1570
|
+
}
|
1571
|
+
|
1572
|
+
|
1573
|
+
/**
|
1574
|
+
* Prepare chart.dragDropData with origin info, and show the guide box.
|
1575
|
+
*
|
1576
|
+
* @private
|
1577
|
+
* @function initDragDrop
|
1578
|
+
*
|
1579
|
+
* @param {global.Event} e
|
1580
|
+
* Mouse event with original mouse position.
|
1581
|
+
*
|
1582
|
+
* @param {Highcharts.Point} point
|
1583
|
+
* The point the dragging started on.
|
1584
|
+
*/
|
1585
|
+
function initDragDrop(e, point) {
|
1586
|
+
var groupedPoints = getGroupedPoints(point),
|
1587
|
+
series = point.series,
|
1588
|
+
chart = series.chart,
|
1589
|
+
guideBox;
|
1590
|
+
|
1591
|
+
// If liveRedraw is disabled, show the guide box with the default state
|
1592
|
+
if (!pick(
|
1593
|
+
series.options.dragDrop && series.options.dragDrop.liveRedraw,
|
1594
|
+
true
|
1595
|
+
)) {
|
1596
|
+
chart.dragGuideBox = guideBox = series.getGuideBox(groupedPoints);
|
1597
|
+
chart.setGuideBoxState('default', series.options.dragDrop.guideBox)
|
1598
|
+
.add(series.group);
|
1599
|
+
}
|
1600
|
+
|
1601
|
+
// Store some data on the chart to pick up later
|
1602
|
+
chart.dragDropData = {
|
1603
|
+
origin: getPositionSnapshot(e, groupedPoints, guideBox),
|
1604
|
+
point: point,
|
1605
|
+
groupedPoints: groupedPoints,
|
1606
|
+
isDragging: true
|
1607
|
+
};
|
1608
|
+
}
|
1609
|
+
|
1610
|
+
|
1611
|
+
/**
|
1612
|
+
* Calculate new point options from points being dragged.
|
1613
|
+
*
|
1614
|
+
* @private
|
1615
|
+
* @function getNewPoints
|
1616
|
+
*
|
1617
|
+
* @param {object} dragDropData
|
1618
|
+
* A chart's dragDropData with drag/drop origin information, and info on
|
1619
|
+
* which points are being dragged.
|
1620
|
+
*
|
1621
|
+
* @param {global.Event} newPos
|
1622
|
+
* Event with the new position of the mouse (chartX/Y properties).
|
1623
|
+
*
|
1624
|
+
* @return {Array<object>}
|
1625
|
+
* Hashmap with point.id mapped to an object with the original point
|
1626
|
+
* reference, as well as the new data values.
|
1627
|
+
*/
|
1628
|
+
function getNewPoints(dragDropData, newPos) {
|
1629
|
+
var point = dragDropData.point,
|
1630
|
+
series = point.series,
|
1631
|
+
options = merge(series.options.dragDrop, point.options.dragDrop),
|
1632
|
+
updateProps = {},
|
1633
|
+
resizeProp = dragDropData.updateProp,
|
1634
|
+
hashmap = {};
|
1635
|
+
|
1636
|
+
// Go through the data props that can be updated on this series and find out
|
1637
|
+
// which ones we want to update.
|
1638
|
+
objectEach(point.series.dragDropProps, function (val, key) {
|
1639
|
+
// If we are resizing, skip if this key is not the correct one or it
|
1640
|
+
// is not resizable.
|
1641
|
+
if (
|
1642
|
+
resizeProp && (
|
1643
|
+
resizeProp !== key ||
|
1644
|
+
!val.resize ||
|
1645
|
+
val.optionName && options[val.optionName] === false
|
1646
|
+
)
|
1647
|
+
) {
|
1648
|
+
return;
|
1649
|
+
}
|
1650
|
+
|
1651
|
+
// If we are resizing, we now know it is good. If we are moving, check
|
1652
|
+
// that moving along this axis is enabled, and the prop is movable.
|
1653
|
+
// If this prop is enabled, add it to be updated.
|
1654
|
+
if (
|
1655
|
+
resizeProp || (
|
1656
|
+
val.move &&
|
1657
|
+
(
|
1658
|
+
val.axis === 'x' && options.draggableX ||
|
1659
|
+
val.axis === 'y' && options.draggableY
|
1660
|
+
)
|
1661
|
+
)
|
1662
|
+
) {
|
1663
|
+
updateProps[key] = val;
|
1664
|
+
}
|
1665
|
+
});
|
1666
|
+
|
1667
|
+
// Go through the points to be updated and get new options for each of them
|
1668
|
+
(resizeProp ? // If resizing).forEach(only update the point we are resizing
|
1669
|
+
[point] :
|
1670
|
+
dragDropData.groupedPoints).forEach(
|
1671
|
+
function (p) {
|
1672
|
+
hashmap[p.id] = {
|
1673
|
+
point: p,
|
1674
|
+
newValues: p.getDropValues(
|
1675
|
+
dragDropData.origin, newPos, updateProps
|
1676
|
+
)
|
1677
|
+
};
|
1678
|
+
}
|
1679
|
+
);
|
1680
|
+
return hashmap;
|
1681
|
+
}
|
1682
|
+
|
1683
|
+
|
1684
|
+
/**
|
1685
|
+
* Update the points in a chart from dragDropData.newPoints.
|
1686
|
+
*
|
1687
|
+
* @private
|
1688
|
+
* @function updatePoints
|
1689
|
+
*
|
1690
|
+
* @param {Highcharts.Chart} chart
|
1691
|
+
* A chart with dragDropData.newPoints.
|
1692
|
+
*
|
1693
|
+
* @param {boolean} [animate=true]
|
1694
|
+
* Animate updating points?
|
1695
|
+
*/
|
1696
|
+
function updatePoints(chart, animate) {
|
1697
|
+
var newPoints = chart.dragDropData.newPoints,
|
1698
|
+
animOptions = animate === false ? false : merge({
|
1699
|
+
duration: 400 // 400 is the default in H.animate
|
1700
|
+
}, chart.options.animation);
|
1701
|
+
|
1702
|
+
chart.isDragDropAnimating = true;
|
1703
|
+
|
1704
|
+
// Update the points
|
1705
|
+
objectEach(newPoints, function (newPoint) {
|
1706
|
+
newPoint.point.update(newPoint.newValues, false);
|
1707
|
+
});
|
1708
|
+
|
1709
|
+
chart.redraw(animOptions);
|
1710
|
+
|
1711
|
+
// Clear the isAnimating flag after animation duration is complete.
|
1712
|
+
// The complete handler for animation seems to have bugs at this time, so
|
1713
|
+
// we have to use a timeout instead.
|
1714
|
+
setTimeout(function () {
|
1715
|
+
delete chart.isDragDropAnimating;
|
1716
|
+
if (chart.hoverPoint && !chart.dragHandles) {
|
1717
|
+
chart.hoverPoint.showDragHandles();
|
1718
|
+
}
|
1719
|
+
}, animOptions.duration);
|
1720
|
+
}
|
1721
|
+
|
1722
|
+
|
1723
|
+
/**
|
1724
|
+
* Resize the guide box according to point options and a difference in mouse
|
1725
|
+
* positions. Handles reversed axes.
|
1726
|
+
*
|
1727
|
+
* @private
|
1728
|
+
* @function resizeGuideBox
|
1729
|
+
*
|
1730
|
+
* @param {Highcharts.Point} point
|
1731
|
+
* The point that is being resized.
|
1732
|
+
*
|
1733
|
+
* @param {number} dX
|
1734
|
+
* Difference in X position.
|
1735
|
+
*
|
1736
|
+
* @param {number} dY
|
1737
|
+
* Difference in Y position.
|
1738
|
+
*/
|
1739
|
+
function resizeGuideBox(point, dX, dY) {
|
1740
|
+
var series = point.series,
|
1741
|
+
chart = series.chart,
|
1742
|
+
dragDropData = chart.dragDropData,
|
1743
|
+
resizeSide,
|
1744
|
+
newPoint,
|
1745
|
+
resizeProp = series.dragDropProps[dragDropData.updateProp];
|
1746
|
+
|
1747
|
+
// dragDropProp.resizeSide holds info on which side to resize.
|
1748
|
+
newPoint = dragDropData.newPoints[point.id].newValues;
|
1749
|
+
resizeSide = typeof resizeProp.resizeSide === 'function' ?
|
1750
|
+
resizeProp.resizeSide(newPoint, point) : resizeProp.resizeSide;
|
1751
|
+
|
1752
|
+
// Call resize hook if it is defined
|
1753
|
+
if (resizeProp.beforeResize) {
|
1754
|
+
resizeProp.beforeResize(chart.dragGuideBox, newPoint, point);
|
1755
|
+
}
|
1756
|
+
|
1757
|
+
// Do the resize
|
1758
|
+
resizeRect(
|
1759
|
+
chart.dragGuideBox,
|
1760
|
+
resizeProp.axis === 'x' && series.xAxis.reversed ||
|
1761
|
+
resizeProp.axis === 'y' && series.yAxis.reversed ?
|
1762
|
+
flipResizeSide(resizeSide) : resizeSide,
|
1763
|
+
{
|
1764
|
+
x: resizeProp.axis === 'x' ?
|
1765
|
+
dX - (dragDropData.origin.prevdX || 0) : 0,
|
1766
|
+
y: resizeProp.axis === 'y' ?
|
1767
|
+
dY - (dragDropData.origin.prevdY || 0) : 0
|
1768
|
+
}
|
1769
|
+
);
|
1770
|
+
}
|
1771
|
+
|
1772
|
+
|
1773
|
+
/**
|
1774
|
+
* Default mouse move handler while dragging. Handles updating points or guide
|
1775
|
+
* box.
|
1776
|
+
*
|
1777
|
+
* @private
|
1778
|
+
* @function dragMove
|
1779
|
+
*
|
1780
|
+
* @param {global.Event} e
|
1781
|
+
* The mouse move event.
|
1782
|
+
*
|
1783
|
+
* @param {Highcharts.Point} point
|
1784
|
+
* The point that is dragged.
|
1785
|
+
*/
|
1786
|
+
function dragMove(e, point) {
|
1787
|
+
var series = point.series,
|
1788
|
+
chart = series.chart,
|
1789
|
+
data = chart.dragDropData,
|
1790
|
+
options = merge(series.options.dragDrop, point.options.dragDrop),
|
1791
|
+
draggableX = options.draggableX,
|
1792
|
+
draggableY = options.draggableY,
|
1793
|
+
origin = data.origin,
|
1794
|
+
dX = e.chartX - origin.chartX,
|
1795
|
+
dY = e.chartY - origin.chartY,
|
1796
|
+
oldDx = dX,
|
1797
|
+
updateProp = data.updateProp;
|
1798
|
+
|
1799
|
+
// Handle inverted
|
1800
|
+
if (chart.inverted) {
|
1801
|
+
dX = -dY;
|
1802
|
+
dY = -oldDx;
|
1803
|
+
}
|
1804
|
+
|
1805
|
+
// If we have liveRedraw enabled, update the points immediately. Otherwise
|
1806
|
+
// update the guideBox.
|
1807
|
+
if (pick(options.liveRedraw, true)) {
|
1808
|
+
updatePoints(chart, false);
|
1809
|
+
|
1810
|
+
// Update drag handles
|
1811
|
+
point.showDragHandles();
|
1812
|
+
|
1813
|
+
} else {
|
1814
|
+
// No live redraw, update guide box
|
1815
|
+
if (updateProp) {
|
1816
|
+
// We are resizing, so resize the guide box
|
1817
|
+
resizeGuideBox(point, dX, dY);
|
1818
|
+
} else {
|
1819
|
+
// We are moving, so move the guide box
|
1820
|
+
chart.dragGuideBox.translate(
|
1821
|
+
draggableX ? dX : 0, draggableY ? dY : 0
|
1822
|
+
);
|
1823
|
+
}
|
1824
|
+
}
|
1825
|
+
|
1826
|
+
// Update stored previous dX/Y
|
1827
|
+
origin.prevdX = dX;
|
1828
|
+
origin.prevdY = dY;
|
1829
|
+
}
|
1830
|
+
|
1831
|
+
|
1832
|
+
/**
|
1833
|
+
* Set the state of the guide box.
|
1834
|
+
*
|
1835
|
+
* @private
|
1836
|
+
* @function Highcharts.Chart#setGuideBoxState
|
1837
|
+
*
|
1838
|
+
* @param {string} state
|
1839
|
+
* The state to set the guide box to.
|
1840
|
+
*
|
1841
|
+
* @param {object} options
|
1842
|
+
* Additional overall guideBox options to consider.
|
1843
|
+
*
|
1844
|
+
* @return {Highcharts.SVGElement}
|
1845
|
+
* The modified guide box.
|
1846
|
+
*/
|
1847
|
+
H.Chart.prototype.setGuideBoxState = function (state, options) {
|
1848
|
+
var guideBox = this.dragGuideBox,
|
1849
|
+
guideBoxOptions = merge(defaultGuideBoxOptions, options),
|
1850
|
+
stateOptions = merge(guideBoxOptions.default, guideBoxOptions[state]);
|
1851
|
+
|
1852
|
+
return guideBox
|
1853
|
+
.attr({
|
1854
|
+
className: stateOptions.className,
|
1855
|
+
stroke: stateOptions.lineColor,
|
1856
|
+
strokeWidth: stateOptions.lineWidth,
|
1857
|
+
fill: stateOptions.color,
|
1858
|
+
cursor: stateOptions.cursor,
|
1859
|
+
zIndex: stateOptions.zIndex
|
1860
|
+
})
|
1861
|
+
// Use pointerEvents 'none' to avoid capturing the click event
|
1862
|
+
.css({ pointerEvents: 'none' });
|
1863
|
+
};
|
1864
|
+
|
1865
|
+
|
1866
|
+
/**
|
1867
|
+
* Get updated point values when dragging a point.
|
1868
|
+
*
|
1869
|
+
* @private
|
1870
|
+
* @function Highcharts.Point#getDropValues
|
1871
|
+
*
|
1872
|
+
* @param {object} origin
|
1873
|
+
* Mouse position (chartX/Y) and point props at current data values.
|
1874
|
+
* Point props should be organized per point.id in a hashmap.
|
1875
|
+
*
|
1876
|
+
* @param {global.Event} newPos
|
1877
|
+
* New mouse position (chartX/Y).
|
1878
|
+
*
|
1879
|
+
* @param {object} updateProps
|
1880
|
+
* Point props to modify. Map of prop objects where each key refers to
|
1881
|
+
* the prop, and the value is an object with an axis property. Example:
|
1882
|
+
* {
|
1883
|
+
* x: {
|
1884
|
+
* axis: 'x'
|
1885
|
+
* },
|
1886
|
+
* x2: {
|
1887
|
+
* axis: 'x'
|
1888
|
+
* }
|
1889
|
+
* }
|
1890
|
+
*
|
1891
|
+
* @return {object}
|
1892
|
+
* An object with updated data values.
|
1893
|
+
*/
|
1894
|
+
H.Point.prototype.getDropValues = function (origin, newPos, updateProps) {
|
1895
|
+
var point = this,
|
1896
|
+
series = point.series,
|
1897
|
+
options = merge(series.options.dragDrop, point.options.dragDrop),
|
1898
|
+
yAxis = series.yAxis,
|
1899
|
+
xAxis = series.xAxis,
|
1900
|
+
dX = newPos.chartX - origin.chartX,
|
1901
|
+
dY = newPos.chartY - origin.chartY,
|
1902
|
+
oldX = pick(origin.x, point.x),
|
1903
|
+
oldY = pick(origin.y, point.y),
|
1904
|
+
dXValue = xAxis.toValue(
|
1905
|
+
xAxis.toPixels(oldX, true) +
|
1906
|
+
(xAxis.horiz ? dX : dY),
|
1907
|
+
true
|
1908
|
+
) - oldX,
|
1909
|
+
dYValue = yAxis.toValue(
|
1910
|
+
yAxis.toPixels(oldY, true) +
|
1911
|
+
(yAxis.horiz ? dX : dY),
|
1912
|
+
true
|
1913
|
+
) - oldY,
|
1914
|
+
result = {},
|
1915
|
+
updateSingleProp,
|
1916
|
+
pointOrigin = origin.points[point.id];
|
1917
|
+
|
1918
|
+
// Find out if we only have one prop to update
|
1919
|
+
for (var key in updateProps) {
|
1920
|
+
if (updateProps.hasOwnProperty(key)) {
|
1921
|
+
if (updateSingleProp !== undefined) {
|
1922
|
+
updateSingleProp = false;
|
1923
|
+
break;
|
1924
|
+
}
|
1925
|
+
updateSingleProp = true;
|
1926
|
+
}
|
1927
|
+
}
|
1928
|
+
|
1929
|
+
// Utility function to apply precision and limit a value within the
|
1930
|
+
// draggable range
|
1931
|
+
function limitToRange(val, direction) {
|
1932
|
+
var defaultPrecision = series[direction.toLowerCase() + 'Axis']
|
1933
|
+
.categories ? 1 : 0,
|
1934
|
+
precision = pick(
|
1935
|
+
options['dragPrecision' + direction], defaultPrecision
|
1936
|
+
),
|
1937
|
+
min = pick(options['dragMin' + direction], -Infinity),
|
1938
|
+
max = pick(options['dragMax' + direction], Infinity),
|
1939
|
+
res = val;
|
1940
|
+
|
1941
|
+
if (precision) {
|
1942
|
+
res = Math.round(res / precision) * precision;
|
1943
|
+
}
|
1944
|
+
return Math.max(min, Math.min(max, res));
|
1945
|
+
}
|
1946
|
+
|
1947
|
+
// Assign new value to property. Adds dX/YValue to the old value, limiting
|
1948
|
+
// it within min/max ranges.
|
1949
|
+
objectEach(updateProps, function (val, key) {
|
1950
|
+
var oldVal = pointOrigin[key],
|
1951
|
+
newVal = limitToRange(
|
1952
|
+
oldVal + (val.axis === 'x' ? dXValue : dYValue),
|
1953
|
+
val.axis.toUpperCase()
|
1954
|
+
);
|
1955
|
+
|
1956
|
+
// If we are updating a single prop, and it has a validation function
|
1957
|
+
// for the prop, run it. If it fails, don't update the value.
|
1958
|
+
if (
|
1959
|
+
!(
|
1960
|
+
updateSingleProp &&
|
1961
|
+
val.propValidate &&
|
1962
|
+
!val.propValidate(newVal, point)
|
1963
|
+
) &&
|
1964
|
+
oldVal !== undefined
|
1965
|
+
) {
|
1966
|
+
result[key] = newVal;
|
1967
|
+
}
|
1968
|
+
});
|
1969
|
+
|
1970
|
+
return result;
|
1971
|
+
};
|
1972
|
+
|
1973
|
+
|
1974
|
+
/**
|
1975
|
+
* Returns an SVGElement to use as the guide box for a set of points.
|
1976
|
+
*
|
1977
|
+
* @private
|
1978
|
+
* @function Highcharts.Series#getGuideBox
|
1979
|
+
*
|
1980
|
+
* @param {Array<Highcharts.Point>} points
|
1981
|
+
* The state to set the guide box to.
|
1982
|
+
*
|
1983
|
+
* @return {Highcharts.SVGElement}
|
1984
|
+
* An SVG element for the guide box, not added to DOM.
|
1985
|
+
*/
|
1986
|
+
H.Series.prototype.getGuideBox = function (points) {
|
1987
|
+
var chart = this.chart,
|
1988
|
+
minX = Infinity,
|
1989
|
+
maxX = -Infinity,
|
1990
|
+
minY = Infinity,
|
1991
|
+
maxY = -Infinity,
|
1992
|
+
changed;
|
1993
|
+
|
1994
|
+
// Find bounding box of all points
|
1995
|
+
points.forEach(function (point) {
|
1996
|
+
var bBox = point.graphic && point.graphic.getBBox() || point.shapeArgs;
|
1997
|
+
|
1998
|
+
if (bBox && (bBox.width || bBox.height || bBox.x || bBox.y)) {
|
1999
|
+
changed = true;
|
2000
|
+
minX = Math.min(bBox.x, minX);
|
2001
|
+
maxX = Math.max(bBox.x + bBox.width, maxX);
|
2002
|
+
minY = Math.min(bBox.y, minY);
|
2003
|
+
maxY = Math.max(bBox.y + bBox.height, maxY);
|
2004
|
+
}
|
2005
|
+
});
|
2006
|
+
|
2007
|
+
return changed ? chart.renderer.rect(
|
2008
|
+
minX,
|
2009
|
+
minY,
|
2010
|
+
maxX - minX,
|
2011
|
+
maxY - minY
|
2012
|
+
) : chart.renderer.g();
|
2013
|
+
};
|
2014
|
+
|
2015
|
+
|
2016
|
+
/**
|
2017
|
+
* On point mouse out. Hide drag handles, depending on state.
|
2018
|
+
*
|
2019
|
+
* @private
|
2020
|
+
* @function mouseOut
|
2021
|
+
*
|
2022
|
+
* @param {Highcharts.Point} point
|
2023
|
+
* The point mousing out of.
|
2024
|
+
*/
|
2025
|
+
function mouseOut(point) {
|
2026
|
+
var chart = point.series && point.series.chart,
|
2027
|
+
dragDropData = chart && chart.dragDropData;
|
2028
|
+
|
2029
|
+
if (
|
2030
|
+
chart &&
|
2031
|
+
chart.dragHandles &&
|
2032
|
+
!(
|
2033
|
+
dragDropData &&
|
2034
|
+
(
|
2035
|
+
dragDropData.isDragging &&
|
2036
|
+
dragDropData.draggedPastSensitivity ||
|
2037
|
+
dragDropData.isHoveringHandle === point.id
|
2038
|
+
)
|
2039
|
+
)
|
2040
|
+
) {
|
2041
|
+
chart.hideDragHandles();
|
2042
|
+
}
|
2043
|
+
}
|
2044
|
+
|
2045
|
+
|
2046
|
+
/**
|
2047
|
+
* Mouseout on resize handle. Handle states, and possibly run mouseOut on point.
|
2048
|
+
*
|
2049
|
+
* @private
|
2050
|
+
* @function onResizeHandleMouseOut
|
2051
|
+
*
|
2052
|
+
* @param {Highcharts.Point} point
|
2053
|
+
* The point mousing out of.
|
2054
|
+
*/
|
2055
|
+
function onResizeHandleMouseOut(point) {
|
2056
|
+
var chart = point.series.chart;
|
2057
|
+
|
2058
|
+
if (
|
2059
|
+
chart.dragDropData &&
|
2060
|
+
point.id === chart.dragDropData.isHoveringHandle
|
2061
|
+
) {
|
2062
|
+
delete chart.dragDropData.isHoveringHandle;
|
2063
|
+
}
|
2064
|
+
if (!chart.hoverPoint) {
|
2065
|
+
mouseOut(point);
|
2066
|
+
}
|
2067
|
+
}
|
2068
|
+
|
2069
|
+
|
2070
|
+
/**
|
2071
|
+
* Mousedown on resize handle. Init a drag if the conditions are right.
|
2072
|
+
*
|
2073
|
+
* @private
|
2074
|
+
* @function onResizeHandleMouseDown
|
2075
|
+
*
|
2076
|
+
* @param {global.Event} e
|
2077
|
+
* The mousedown event.
|
2078
|
+
*
|
2079
|
+
* @param {Highcharts.Point} point
|
2080
|
+
* The point mousing down on.
|
2081
|
+
*
|
2082
|
+
* @param {string} updateProp
|
2083
|
+
* The data property this resize handle is attached to for this point.
|
2084
|
+
*/
|
2085
|
+
function onResizeHandleMouseDown(e, point, updateProp) {
|
2086
|
+
var chart = point.series.chart;
|
2087
|
+
|
2088
|
+
// Ignore if zoom/pan key is pressed
|
2089
|
+
if (chart.zoomOrPanKeyPressed(e)) {
|
2090
|
+
return;
|
2091
|
+
}
|
2092
|
+
|
2093
|
+
// Prevent zooming
|
2094
|
+
chart.mouseIsDown = false;
|
2095
|
+
|
2096
|
+
// We started a drag
|
2097
|
+
initDragDrop(e, point);
|
2098
|
+
chart.dragDropData.updateProp = e.updateProp = updateProp;
|
2099
|
+
point.firePointEvent('dragStart', e);
|
2100
|
+
|
2101
|
+
// Prevent default to avoid point click for dragging too
|
2102
|
+
e.stopPropagation();
|
2103
|
+
e.preventDefault();
|
2104
|
+
}
|
2105
|
+
|
2106
|
+
|
2107
|
+
/**
|
2108
|
+
* Render drag handles on a point - depending on which handles are enabled - and
|
2109
|
+
* attach events to them.
|
2110
|
+
*
|
2111
|
+
* @private
|
2112
|
+
* @function Highcharts.Point#showDragHandles
|
2113
|
+
*/
|
2114
|
+
H.Point.prototype.showDragHandles = function () {
|
2115
|
+
var point = this,
|
2116
|
+
series = point.series,
|
2117
|
+
chart = series.chart,
|
2118
|
+
renderer = chart.renderer,
|
2119
|
+
options = merge(series.options.dragDrop, point.options.dragDrop);
|
2120
|
+
|
2121
|
+
// Go through each updateProp and see if we are supposed to create a handle
|
2122
|
+
// for it.
|
2123
|
+
objectEach(series.dragDropProps, function (val, key) {
|
2124
|
+
var handleOptions = merge(
|
2125
|
+
defaultDragHandleOptions,
|
2126
|
+
val.handleOptions,
|
2127
|
+
options.dragHandle
|
2128
|
+
),
|
2129
|
+
handleAttrs = {
|
2130
|
+
className: handleOptions.className,
|
2131
|
+
'stroke-width': handleOptions.lineWidth,
|
2132
|
+
fill: handleOptions.color,
|
2133
|
+
stroke: handleOptions.lineColor
|
2134
|
+
},
|
2135
|
+
pathFormatter = handleOptions.pathFormatter || val.handleFormatter,
|
2136
|
+
positioner = val.handlePositioner,
|
2137
|
+
pos,
|
2138
|
+
handle,
|
2139
|
+
handleSide,
|
2140
|
+
path,
|
2141
|
+
// Run validation function on whether or not we allow individual
|
2142
|
+
// updating of this prop.
|
2143
|
+
validate = val.validateIndividualDrag ?
|
2144
|
+
val.validateIndividualDrag(point) : true;
|
2145
|
+
|
2146
|
+
if (
|
2147
|
+
val.resize &&
|
2148
|
+
validate &&
|
2149
|
+
val.resizeSide &&
|
2150
|
+
pathFormatter &&
|
2151
|
+
(
|
2152
|
+
options['draggable' + val.axis.toUpperCase()] ||
|
2153
|
+
options[val.optionName]
|
2154
|
+
) &&
|
2155
|
+
options[val.optionName] !== false
|
2156
|
+
) {
|
2157
|
+
|
2158
|
+
// Create group if it doesn't exist
|
2159
|
+
if (!chart.dragHandles) {
|
2160
|
+
chart.dragHandles = {
|
2161
|
+
group: renderer.g('drag-drop-handles')
|
2162
|
+
.add(series.markerGroup || series.group)
|
2163
|
+
};
|
2164
|
+
}
|
2165
|
+
|
2166
|
+
// Store which point this is
|
2167
|
+
chart.dragHandles.point = point.id;
|
2168
|
+
|
2169
|
+
// Find position and path of handle
|
2170
|
+
pos = positioner(point);
|
2171
|
+
handleAttrs.d = path = pathFormatter(point);
|
2172
|
+
handleSide = typeof val.resizeSide === 'function' ?
|
2173
|
+
val.resizeSide(point.options, point) : val.resizeSide;
|
2174
|
+
if (!path || pos.x < 0 || pos.y < 0) {
|
2175
|
+
return;
|
2176
|
+
}
|
2177
|
+
|
2178
|
+
// If cursor is not set explicitly, use axis direction
|
2179
|
+
handleAttrs.cursor = handleOptions.cursor ||
|
2180
|
+
(val.axis === 'x') !== !!chart.inverted ?
|
2181
|
+
'ew-resize' : 'ns-resize';
|
2182
|
+
|
2183
|
+
// Create and add the handle element if it doesn't exist
|
2184
|
+
handle = chart.dragHandles[handleSide];
|
2185
|
+
if (!handle) {
|
2186
|
+
handle = chart.dragHandles[handleSide] = renderer
|
2187
|
+
.path()
|
2188
|
+
.add(chart.dragHandles.group);
|
2189
|
+
}
|
2190
|
+
|
2191
|
+
// Move and update handle
|
2192
|
+
handle.translate(pos.x, pos.y).attr(handleAttrs);
|
2193
|
+
|
2194
|
+
// Add events
|
2195
|
+
addEvents(
|
2196
|
+
handle.element,
|
2197
|
+
['touchstart', 'mousedown'],
|
2198
|
+
function (e) {
|
2199
|
+
onResizeHandleMouseDown(
|
2200
|
+
getNormalizedEvent(e, chart), point, key
|
2201
|
+
);
|
2202
|
+
}
|
2203
|
+
);
|
2204
|
+
addEvent(chart.dragHandles.group.element, 'mouseover', function () {
|
2205
|
+
chart.dragDropData = chart.dragDropData || {};
|
2206
|
+
chart.dragDropData.isHoveringHandle = point.id;
|
2207
|
+
});
|
2208
|
+
addEvents(
|
2209
|
+
chart.dragHandles.group.element,
|
2210
|
+
['touchend', 'mouseout'],
|
2211
|
+
function () {
|
2212
|
+
onResizeHandleMouseOut(point);
|
2213
|
+
}
|
2214
|
+
);
|
2215
|
+
}
|
2216
|
+
});
|
2217
|
+
};
|
2218
|
+
|
2219
|
+
|
2220
|
+
/**
|
2221
|
+
* Remove the chart's drag handles if they exist.
|
2222
|
+
*
|
2223
|
+
* @private
|
2224
|
+
* @function Highcharts.Chart#hideDragHandles
|
2225
|
+
*/
|
2226
|
+
H.Chart.prototype.hideDragHandles = function () {
|
2227
|
+
var chart = this;
|
2228
|
+
|
2229
|
+
if (chart.dragHandles) {
|
2230
|
+
objectEach(chart.dragHandles, function (val, key) {
|
2231
|
+
if (key !== 'group' && val.destroy) {
|
2232
|
+
val.destroy();
|
2233
|
+
}
|
2234
|
+
});
|
2235
|
+
if (chart.dragHandles.group && chart.dragHandles.group.destroy) {
|
2236
|
+
chart.dragHandles.group.destroy();
|
2237
|
+
}
|
2238
|
+
delete chart.dragHandles;
|
2239
|
+
}
|
2240
|
+
};
|
2241
|
+
|
2242
|
+
|
2243
|
+
/**
|
2244
|
+
* Utility function to count the number of props in an object.
|
2245
|
+
*
|
2246
|
+
* @private
|
2247
|
+
* @function countProps
|
2248
|
+
*
|
2249
|
+
* @param {object} object
|
2250
|
+
* The object to count.
|
2251
|
+
*
|
2252
|
+
* @return {number}
|
2253
|
+
* Number of own properties on the object.
|
2254
|
+
*/
|
2255
|
+
function countProps(object) {
|
2256
|
+
var count = 0;
|
2257
|
+
|
2258
|
+
for (var p in object) {
|
2259
|
+
if (object.hasOwnProperty(p)) {
|
2260
|
+
count++;
|
2261
|
+
}
|
2262
|
+
}
|
2263
|
+
return count;
|
2264
|
+
}
|
2265
|
+
|
2266
|
+
|
2267
|
+
/**
|
2268
|
+
* Utility function to get the value of the first prop of an object. (Note that
|
2269
|
+
* the order of keys in an object is usually not guaranteed.)
|
2270
|
+
*
|
2271
|
+
* @private
|
2272
|
+
* @function getFirstProp
|
2273
|
+
*
|
2274
|
+
* @param {object} object
|
2275
|
+
* The object to count.
|
2276
|
+
*
|
2277
|
+
* @return {*}
|
2278
|
+
* Value of the first prop in the object.
|
2279
|
+
*/
|
2280
|
+
function getFirstProp(object) {
|
2281
|
+
for (var p in object) {
|
2282
|
+
if (object.hasOwnProperty(p)) {
|
2283
|
+
return object[p];
|
2284
|
+
}
|
2285
|
+
}
|
2286
|
+
}
|
2287
|
+
|
2288
|
+
|
2289
|
+
/**
|
2290
|
+
* Mouseover on a point. Show drag handles if the conditions are right.
|
2291
|
+
*
|
2292
|
+
* @private
|
2293
|
+
* @function mouseOver
|
2294
|
+
*
|
2295
|
+
* @param {Highcharts.Point} point
|
2296
|
+
* The point mousing over.
|
2297
|
+
*/
|
2298
|
+
function mouseOver(point) {
|
2299
|
+
var series = point.series,
|
2300
|
+
chart = series && series.chart,
|
2301
|
+
dragDropData = chart && chart.dragDropData;
|
2302
|
+
|
2303
|
+
if (
|
2304
|
+
chart &&
|
2305
|
+
!(
|
2306
|
+
dragDropData &&
|
2307
|
+
dragDropData.isDragging && // Ignore if dragging a point
|
2308
|
+
dragDropData.draggedPastSensitivity
|
2309
|
+
) &&
|
2310
|
+
!chart.isDragDropAnimating && // Ignore if animating
|
2311
|
+
series.options.dragDrop && // No need to compute handles without this
|
2312
|
+
!(
|
2313
|
+
chart.options &&
|
2314
|
+
chart.options.chart &&
|
2315
|
+
chart.options.chart.options3d // No 3D support
|
2316
|
+
)
|
2317
|
+
) {
|
2318
|
+
// Hide the handles if they exist on another point already
|
2319
|
+
if (chart.dragHandles) {
|
2320
|
+
chart.hideDragHandles();
|
2321
|
+
}
|
2322
|
+
point.showDragHandles();
|
2323
|
+
}
|
2324
|
+
}
|
2325
|
+
|
2326
|
+
|
2327
|
+
/**
|
2328
|
+
* On container mouse move. Handle drag sensitivity and fire drag event.
|
2329
|
+
*
|
2330
|
+
* @private
|
2331
|
+
* @function mouseMove
|
2332
|
+
*
|
2333
|
+
* @param {global.Event} e
|
2334
|
+
* The mouse move event.
|
2335
|
+
*
|
2336
|
+
* @param {Highcharts.Chart} chart
|
2337
|
+
* The chart we are moving across.
|
2338
|
+
*/
|
2339
|
+
function mouseMove(e, chart) {
|
2340
|
+
// Ignore if zoom/pan key is pressed
|
2341
|
+
if (chart.zoomOrPanKeyPressed(e)) {
|
2342
|
+
return;
|
2343
|
+
}
|
2344
|
+
|
2345
|
+
var dragDropData = chart.dragDropData,
|
2346
|
+
point,
|
2347
|
+
seriesDragDropOpts,
|
2348
|
+
newPoints,
|
2349
|
+
numNewPoints = 0,
|
2350
|
+
newPoint;
|
2351
|
+
|
2352
|
+
if (dragDropData && dragDropData.isDragging) {
|
2353
|
+
point = dragDropData.point;
|
2354
|
+
seriesDragDropOpts = point.series.options.dragDrop;
|
2355
|
+
|
2356
|
+
// No tooltip for dragging
|
2357
|
+
e.preventDefault();
|
2358
|
+
|
2359
|
+
// Update sensitivity test if not passed yet
|
2360
|
+
if (!dragDropData.draggedPastSensitivity) {
|
2361
|
+
dragDropData.draggedPastSensitivity = hasDraggedPastSensitivity(
|
2362
|
+
e, chart, pick(
|
2363
|
+
point.options.dragDrop &&
|
2364
|
+
point.options.dragDrop.dragSensitivity,
|
2365
|
+
seriesDragDropOpts &&
|
2366
|
+
seriesDragDropOpts.dragSensitivity,
|
2367
|
+
defaultDragSensitivity
|
2368
|
+
)
|
2369
|
+
);
|
2370
|
+
}
|
2371
|
+
|
2372
|
+
// If we have dragged past dragSensitivity, run the mousemove handler
|
2373
|
+
// for dragging
|
2374
|
+
if (dragDropData.draggedPastSensitivity) {
|
2375
|
+
// Find the new point values from the moving
|
2376
|
+
dragDropData.newPoints = getNewPoints(dragDropData, e);
|
2377
|
+
|
2378
|
+
// If we are only dragging one point, add it to the event
|
2379
|
+
newPoints = dragDropData.newPoints;
|
2380
|
+
numNewPoints = countProps(newPoints);
|
2381
|
+
newPoint = numNewPoints === 1 ?
|
2382
|
+
getFirstProp(newPoints) :
|
2383
|
+
null;
|
2384
|
+
|
2385
|
+
// Run the handler
|
2386
|
+
point.firePointEvent('drag', {
|
2387
|
+
origin: dragDropData.origin,
|
2388
|
+
newPoints: dragDropData.newPoints,
|
2389
|
+
newPoint: newPoint && newPoint.newValues,
|
2390
|
+
newPointId: newPoint && newPoint.point.id,
|
2391
|
+
numNewPoints: numNewPoints,
|
2392
|
+
chartX: e.chartX,
|
2393
|
+
chartY: e.chartY
|
2394
|
+
}, function () {
|
2395
|
+
dragMove(e, point);
|
2396
|
+
});
|
2397
|
+
}
|
2398
|
+
}
|
2399
|
+
}
|
2400
|
+
|
2401
|
+
|
2402
|
+
/**
|
2403
|
+
* On container mouse up. Fire drop event and reset state.
|
2404
|
+
*
|
2405
|
+
* @private
|
2406
|
+
* @function mouseUp
|
2407
|
+
*
|
2408
|
+
* @param {global.Event} e
|
2409
|
+
* The mouse up event.
|
2410
|
+
*
|
2411
|
+
* @param {Highcharts.Chart} chart
|
2412
|
+
* The chart we were dragging in.
|
2413
|
+
*/
|
2414
|
+
function mouseUp(e, chart) {
|
2415
|
+
var dragDropData = chart.dragDropData;
|
2416
|
+
|
2417
|
+
if (
|
2418
|
+
dragDropData &&
|
2419
|
+
dragDropData.isDragging &&
|
2420
|
+
dragDropData.draggedPastSensitivity
|
2421
|
+
) {
|
2422
|
+
var point = dragDropData.point,
|
2423
|
+
newPoints = dragDropData.newPoints,
|
2424
|
+
numNewPoints = countProps(newPoints),
|
2425
|
+
newPoint = numNewPoints === 1 ?
|
2426
|
+
getFirstProp(newPoints) :
|
2427
|
+
null;
|
2428
|
+
|
2429
|
+
// Hide the drag handles
|
2430
|
+
if (chart.dragHandles) {
|
2431
|
+
chart.hideDragHandles();
|
2432
|
+
}
|
2433
|
+
|
2434
|
+
// Prevent default action
|
2435
|
+
e.preventDefault();
|
2436
|
+
chart.cancelClick = true;
|
2437
|
+
|
2438
|
+
// Fire the event, with a default handler that updates the points
|
2439
|
+
|
2440
|
+
point.firePointEvent('drop', {
|
2441
|
+
origin: dragDropData.origin,
|
2442
|
+
chartX: e.chartX,
|
2443
|
+
chartY: e.chartY,
|
2444
|
+
newPoints: newPoints,
|
2445
|
+
numNewPoints: numNewPoints,
|
2446
|
+
newPoint: newPoint && newPoint.newValues,
|
2447
|
+
newPointId: newPoint && newPoint.point.id
|
2448
|
+
}, function () {
|
2449
|
+
updatePoints(chart);
|
2450
|
+
});
|
2451
|
+
}
|
2452
|
+
|
2453
|
+
// Reset
|
2454
|
+
delete chart.dragDropData;
|
2455
|
+
|
2456
|
+
// Clean up the drag guide box if it exists. This is always added on
|
2457
|
+
// drag start, even if user is overriding events.
|
2458
|
+
if (chart.dragGuideBox) {
|
2459
|
+
chart.dragGuideBox.destroy();
|
2460
|
+
delete chart.dragGuideBox;
|
2461
|
+
}
|
2462
|
+
}
|
2463
|
+
|
2464
|
+
|
2465
|
+
/**
|
2466
|
+
* On container mouse down. Init dragdrop if conditions are right.
|
2467
|
+
*
|
2468
|
+
* @private
|
2469
|
+
* @function mouseDown
|
2470
|
+
*
|
2471
|
+
* @param {global.Event} e
|
2472
|
+
* The mouse down event.
|
2473
|
+
*
|
2474
|
+
* @param {Highcharts.Chart} chart
|
2475
|
+
* The chart we are clicking.
|
2476
|
+
*/
|
2477
|
+
function mouseDown(e, chart) {
|
2478
|
+
var dragPoint = chart.hoverPoint,
|
2479
|
+
dragDropOptions = H.merge(
|
2480
|
+
dragPoint.series.options.dragDrop,
|
2481
|
+
dragPoint.options.dragDrop
|
2482
|
+
),
|
2483
|
+
draggableX = dragDropOptions.draggableX || false,
|
2484
|
+
draggableY = dragDropOptions.draggableY || false;
|
2485
|
+
|
2486
|
+
// Reset cancel click
|
2487
|
+
chart.cancelClick = false;
|
2488
|
+
|
2489
|
+
// Ignore if option is disable for the point
|
2490
|
+
if (!(draggableX || draggableY)) {
|
2491
|
+
return;
|
2492
|
+
}
|
2493
|
+
|
2494
|
+
// Ignore if zoom/pan key is pressed
|
2495
|
+
if (chart.zoomOrPanKeyPressed(e)) {
|
2496
|
+
return;
|
2497
|
+
}
|
2498
|
+
|
2499
|
+
// If we somehow get a mousedown event while we are dragging, cancel
|
2500
|
+
if (chart.dragDropData && chart.dragDropData.isDragging) {
|
2501
|
+
mouseUp(e, chart);
|
2502
|
+
return;
|
2503
|
+
}
|
2504
|
+
|
2505
|
+
// If this point is movable, start dragging it
|
2506
|
+
if (dragPoint && isPointMovable(dragPoint)) {
|
2507
|
+
chart.mouseIsDown = false; // Prevent zooming
|
2508
|
+
initDragDrop(e, dragPoint);
|
2509
|
+
dragPoint.firePointEvent('dragStart', e);
|
2510
|
+
}
|
2511
|
+
}
|
2512
|
+
|
2513
|
+
|
2514
|
+
// Point hover event. We use a short timeout due to issues with coordinating
|
2515
|
+
// point mouseover/out events on dragHandles and points. Particularly arearange
|
2516
|
+
// series are finicky since the markers are not individual points. This logic
|
2517
|
+
// should preferably be improved in the future. Notice that the mouseOut event
|
2518
|
+
// below must have a shorter timeout to ensure event order.
|
2519
|
+
addEvent(H.Point, 'mouseOver', function () {
|
2520
|
+
var point = this;
|
2521
|
+
|
2522
|
+
setTimeout(function () {
|
2523
|
+
mouseOver(point);
|
2524
|
+
}, 12);
|
2525
|
+
});
|
2526
|
+
|
2527
|
+
|
2528
|
+
// Point mouseleave event. See above function for explanation of the timeout.
|
2529
|
+
addEvent(H.Point, 'mouseOut', function () {
|
2530
|
+
var point = this;
|
2531
|
+
|
2532
|
+
setTimeout(function () {
|
2533
|
+
if (point.series) {
|
2534
|
+
mouseOut(point);
|
2535
|
+
}
|
2536
|
+
}, 10);
|
2537
|
+
});
|
2538
|
+
|
2539
|
+
|
2540
|
+
// Hide drag handles on a point if it is removed
|
2541
|
+
addEvent(H.Point, 'remove', function () {
|
2542
|
+
var chart = this.series.chart,
|
2543
|
+
dragHandles = chart.dragHandles;
|
2544
|
+
|
2545
|
+
if (dragHandles && dragHandles.point === this.id) {
|
2546
|
+
chart.hideDragHandles();
|
2547
|
+
}
|
2548
|
+
});
|
2549
|
+
|
2550
|
+
|
2551
|
+
/**
|
2552
|
+
* Check whether the zoomKey or panKey is pressed.
|
2553
|
+
*
|
2554
|
+
* @private
|
2555
|
+
* @function Highcharts.Chart#zoomOrPanKeyPressed
|
2556
|
+
*
|
2557
|
+
* @param {global.Event} e
|
2558
|
+
* A mouse event.
|
2559
|
+
*
|
2560
|
+
* @return {boolean}
|
2561
|
+
* True if the zoom or pan keys are pressed. False otherwise.
|
2562
|
+
*/
|
2563
|
+
H.Chart.prototype.zoomOrPanKeyPressed = function (e) {
|
2564
|
+
// Check whether the panKey and zoomKey are set in chart.userOptions
|
2565
|
+
var chartOptions = this.userOptions.chart || {},
|
2566
|
+
panKey = chartOptions.panKey && chartOptions.panKey + 'Key',
|
2567
|
+
zoomKey = chartOptions.zoomKey && chartOptions.zoomKey + 'Key';
|
2568
|
+
|
2569
|
+
return (e[zoomKey] || e[panKey]);
|
2570
|
+
};
|
2571
|
+
|
2572
|
+
|
2573
|
+
/**
|
2574
|
+
* Add events to document and chart if the chart is draggable.
|
2575
|
+
*
|
2576
|
+
* @private
|
2577
|
+
* @function addDragDropEvents
|
2578
|
+
*
|
2579
|
+
* @param {Highcharts.Chart} chart
|
2580
|
+
* The chart to add events to.
|
2581
|
+
*/
|
2582
|
+
function addDragDropEvents(chart) {
|
2583
|
+
var container = chart.container,
|
2584
|
+
doc = H.doc;
|
2585
|
+
|
2586
|
+
// Only enable if we have a draggable chart
|
2587
|
+
if (isChartDraggable(chart)) {
|
2588
|
+
addEvents(container, ['mousedown', 'touchstart'], function (e) {
|
2589
|
+
mouseDown(getNormalizedEvent(e, chart), chart);
|
2590
|
+
});
|
2591
|
+
addEvents(container, ['mousemove', 'touchmove'], function (e) {
|
2592
|
+
mouseMove(getNormalizedEvent(e, chart), chart);
|
2593
|
+
});
|
2594
|
+
addEvent(container, 'mouseleave', function (e) {
|
2595
|
+
mouseUp(getNormalizedEvent(e, chart), chart);
|
2596
|
+
});
|
2597
|
+
chart.unbindDragDropMouseUp = addEvents(
|
2598
|
+
doc,
|
2599
|
+
['mouseup', 'touchend'],
|
2600
|
+
function (e) {
|
2601
|
+
mouseUp(getNormalizedEvent(e, chart), chart);
|
2602
|
+
}
|
2603
|
+
);
|
2604
|
+
|
2605
|
+
// Add flag to avoid doing this again
|
2606
|
+
chart.hasAddedDragDropEvents = true;
|
2607
|
+
|
2608
|
+
// Add cleanup to make sure we don't pollute document
|
2609
|
+
addEvent(chart, 'destroy', function () {
|
2610
|
+
if (chart.unbindDragDropMouseUp) {
|
2611
|
+
chart.unbindDragDropMouseUp();
|
2612
|
+
}
|
2613
|
+
});
|
2614
|
+
}
|
2615
|
+
}
|
2616
|
+
|
2617
|
+
|
2618
|
+
// Add event listener to Chart.render that checks whether or not we should add
|
2619
|
+
// dragdrop.
|
2620
|
+
addEvent(H.Chart, 'render', function () {
|
2621
|
+
// If we don't have dragDrop events, see if we should add them
|
2622
|
+
if (!this.hasAddedDragDropEvents) {
|
2623
|
+
addDragDropEvents(this);
|
2624
|
+
}
|
2625
|
+
});
|