highcharts 12.2.0 → 12.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bower.json +1 -1
- package/css/annotations/popup.css +86 -45
- package/css/highcharts.css +40 -35
- package/css/stocktools/gui.css +28 -11
- package/es-modules/Accessibility/Components/InfoRegionsComponent.js +3 -3
- package/es-modules/Accessibility/Components/LegendComponent.js +10 -1
- package/es-modules/Accessibility/Components/MenuComponent.js +26 -23
- package/es-modules/Accessibility/Components/NavigatorComponent.js +5 -1
- package/es-modules/Accessibility/Components/SeriesComponent/ForcedMarkers.js +3 -1
- package/es-modules/Accessibility/FocusBorder.js +4 -0
- package/es-modules/Accessibility/HighContrastMode.js +0 -5
- package/es-modules/Accessibility/Options/A11yDefaults.js +12 -0
- package/es-modules/Core/Axis/Axis.js +4 -3
- package/es-modules/Core/Axis/Axis3DComposition.js +0 -3
- package/es-modules/Core/Axis/AxisDefaults.js +5 -8
- package/es-modules/Core/Axis/BrokenAxis.js +114 -90
- package/es-modules/Core/Axis/Color/ColorAxis.js +3 -3
- package/es-modules/Core/Axis/Color/ColorAxisDefaults.js +2 -3
- package/es-modules/Core/Axis/OrdinalAxis.js +19 -12
- package/es-modules/Core/Axis/PlotLineOrBand/PlotLineOrBand.js +15 -2
- package/es-modules/Core/Axis/RadialAxis.js +18 -7
- package/es-modules/Core/Axis/ScrollbarAxis.js +19 -17
- package/es-modules/Core/Axis/Stacking/StackingAxis.js +0 -1
- package/es-modules/Core/Axis/Tick.js +1 -1
- package/es-modules/Core/Axis/TreeGrid/TreeGridAxis.js +36 -51
- package/es-modules/Core/Axis/TreeGrid/TreeGridTick.js +39 -17
- package/es-modules/Core/Axis/WaterfallAxis.js +4 -4
- package/es-modules/Core/Chart/Chart.js +41 -34
- package/es-modules/Core/Chart/ChartDefaults.js +16 -2
- package/es-modules/Core/Chart/GanttChart.js +4 -2
- package/es-modules/Core/Chart/StockChart.js +42 -49
- package/es-modules/Core/Color/Color.js +4 -8
- package/es-modules/Core/Defaults.js +16 -7
- package/es-modules/Core/Geometry/CircleUtilities.js +3 -1
- package/es-modules/Core/Globals.js +1 -1
- package/es-modules/Core/HttpUtilities.js +45 -38
- package/es-modules/Core/Legend/Legend.js +8 -7
- package/es-modules/Core/Pointer.js +17 -9
- package/es-modules/Core/Renderer/HTML/AST.js +15 -15
- package/es-modules/Core/Renderer/HTML/HTMLElement.js +8 -3
- package/es-modules/Core/Renderer/SVG/SVGElement.js +2 -2
- package/es-modules/Core/Renderer/SVG/SVGLabel.js +10 -1
- package/es-modules/Core/Renderer/SVG/SVGRenderer.js +10 -7
- package/es-modules/Core/Renderer/SVG/TextBuilder.js +2 -2
- package/es-modules/Core/Series/DataLabel.js +4 -2
- package/es-modules/Core/Series/Point.js +9 -0
- package/es-modules/Core/Series/Series.js +17 -7
- package/es-modules/Core/Series/SeriesDefaults.js +1 -3
- package/es-modules/Core/Series/SeriesRegistry.js +8 -1
- package/es-modules/Core/Templating.js +6 -5
- package/es-modules/Core/Tooltip.js +3 -1
- package/es-modules/Data/Connectors/CSVConnector.js +32 -15
- package/es-modules/Data/Connectors/DataConnector.js +107 -12
- package/es-modules/Data/Connectors/GoogleSheetsConnector.js +29 -17
- package/es-modules/Data/Connectors/HTMLTableConnector.js +3 -3
- package/es-modules/Data/Connectors/JSONConnector.js +37 -17
- package/es-modules/Data/Converters/HTMLTableConverter.js +2 -2
- package/es-modules/Data/Converters/JSONConverter.js +0 -1
- package/es-modules/Data/DataPool.js +15 -4
- package/es-modules/Data/DataTable.js +1 -2
- package/es-modules/Data/Formula/FormulaParser.js +33 -1
- package/es-modules/Data/Formula/FormulaProcessor.js +97 -45
- package/es-modules/Data/Modifiers/DataModifier.js +1 -1
- package/es-modules/Data/Modifiers/FilterModifier.js +168 -0
- package/es-modules/Data/Modifiers/FilterModifierOptions.js +14 -0
- package/es-modules/Data/Modifiers/SortModifier.js +12 -3
- package/es-modules/Extensions/Annotations/Annotation.js +10 -7
- package/es-modules/Extensions/Annotations/AnnotationChart.js +7 -3
- package/es-modules/Extensions/Annotations/AnnotationDefaults.js +38 -12
- package/es-modules/Extensions/Annotations/Controllables/ControllableLabel.js +10 -3
- package/es-modules/Extensions/Annotations/MockPoint.js +6 -3
- package/es-modules/Extensions/Annotations/NavigationBindingsDefaults.js +1 -1
- package/es-modules/Extensions/Annotations/Popup/PopupAnnotations.js +10 -4
- package/es-modules/Extensions/Annotations/Popup/PopupComposition.js +1 -1
- package/es-modules/Extensions/Annotations/Types/BasicAnnotation.js +0 -3
- package/es-modules/Extensions/Annotations/Types/CrookedLine.js +97 -94
- package/es-modules/Extensions/Annotations/Types/ElliottWave.js +43 -36
- package/es-modules/Extensions/Annotations/Types/Fibonacci.js +86 -82
- package/es-modules/Extensions/Annotations/Types/FibonacciTimeZones.js +74 -71
- package/es-modules/Extensions/Annotations/Types/InfinityLine.js +17 -3
- package/es-modules/Extensions/Annotations/Types/Measure.js +229 -226
- package/es-modules/Extensions/Annotations/Types/Pitchfork.js +39 -40
- package/es-modules/Extensions/Annotations/Types/TimeCycles.js +56 -52
- package/es-modules/Extensions/Annotations/Types/Tunnel.js +80 -76
- package/es-modules/Extensions/Annotations/Types/VerticalLine.js +57 -53
- package/es-modules/Extensions/Boost/Boost.js +5 -1
- package/es-modules/Extensions/Boost/BoostSeries.js +53 -21
- package/es-modules/Extensions/Boost/WGLRenderer.js +30 -21
- package/es-modules/Extensions/Boost/WGLShader.js +18 -5
- package/es-modules/Extensions/BoostCanvas.js +0 -5
- package/es-modules/Extensions/BorderRadius.js +6 -2
- package/es-modules/Extensions/Breadcrumbs/Breadcrumbs.js +1 -1
- package/es-modules/Extensions/DownloadURL.js +43 -8
- package/es-modules/Extensions/ExportData/ExportData.js +875 -781
- package/es-modules/Extensions/ExportData/ExportDataDefaults.js +67 -13
- package/es-modules/Extensions/Exporting/Exporting.js +1177 -546
- package/es-modules/Extensions/Exporting/ExportingDefaults.js +52 -36
- package/es-modules/Extensions/Exporting/Fullscreen.js +2 -2
- package/es-modules/Extensions/NonCartesianSeriesZoom/NonCartesianSeriesZoom.js +311 -0
- package/es-modules/Extensions/OfflineExporting/OfflineExporting.js +254 -575
- package/es-modules/Extensions/OfflineExporting/OfflineExportingDefaults.js +9 -38
- package/es-modules/Extensions/Pane/Pane.js +1 -1
- package/es-modules/Extensions/Pane/PaneComposition.js +19 -12
- package/es-modules/Extensions/Pane/PaneDefaults.js +9 -1
- package/es-modules/Extensions/ScrollablePlotArea.js +29 -21
- package/es-modules/Extensions/Sonification/Sonification.js +1 -1
- package/es-modules/Extensions/StaticScale.js +13 -11
- package/es-modules/Extensions/TextPath.js +2 -2
- package/es-modules/Extensions/Themes/Adaptive.js +1009 -0
- package/es-modules/Maps/MapNavigation.js +1 -1
- package/es-modules/Series/Bellcurve/BellcurveSeries.js +16 -9
- package/es-modules/Series/Bubble/BubblePoint.js +2 -2
- package/es-modules/Series/Column/ColumnSeriesDefaults.js +1 -2
- package/es-modules/Series/DataModifyComposition.js +0 -2
- package/es-modules/Series/DragNodesComposition.js +4 -0
- package/es-modules/Series/DrawPointUtilities.js +1 -1
- package/es-modules/Series/Flags/FlagsSeriesDefaults.js +2 -0
- package/es-modules/Series/GraphLayoutComposition.js +2 -1
- package/es-modules/Series/Heatmap/HeatmapSeriesDefaults.js +1 -2
- package/es-modules/Series/Histogram/HistogramSeries.js +19 -17
- package/es-modules/Series/Item/ItemSeries.js +1 -1
- package/es-modules/Series/PackedBubble/PackedBubblePoint.js +5 -0
- package/es-modules/Series/Pie/PieDataLabel.js +2 -2
- package/es-modules/Series/Pie/PieSeries.js +2 -2
- package/es-modules/Series/Pie/PieSeriesDefaults.js +1 -2
- package/es-modules/Series/PolarComposition.js +37 -2
- package/es-modules/Series/SeriesOnPointComposition.js +0 -1
- package/es-modules/Series/SimulationSeriesUtilities.js +7 -0
- package/es-modules/Series/SolidGauge/SolidGaugeSeries.js +7 -2
- package/es-modules/Series/SolidGauge/SolidGaugeSeriesDefaults.js +13 -0
- package/es-modules/Series/Treegraph/TreegraphLayout.js +10 -4
- package/es-modules/Series/Treegraph/TreegraphSeries.js +3 -1
- package/es-modules/Series/Treemap/TreemapSeries.js +4 -4
- package/es-modules/Series/Variwide/VariwideComposition.js +9 -11
- package/es-modules/Series/Variwide/VariwideSeries.js +8 -1
- package/es-modules/Series/Waterfall/WaterfallSeries.js +12 -17
- package/es-modules/Series/Wordcloud/WordcloudSeries.js +87 -10
- package/es-modules/Series/XRange/XRangePoint.js +2 -1
- package/es-modules/Shared/BaseForm.js +6 -3
- package/es-modules/Shared/TimeBase.js +5 -1
- package/es-modules/Stock/Indicators/MACD/MACDIndicator.js +1 -1
- package/es-modules/Stock/Navigator/NavigatorComposition.js +2 -2
- package/es-modules/Stock/Scrollbar/Scrollbar.js +5 -7
- package/es-modules/Stock/StockTools/StockToolbar.js +1 -1
- package/es-modules/Stock/StockTools/StockToolsBindings.js +34 -113
- package/es-modules/masters/highcharts-3d.src.js +3 -1
- package/es-modules/masters/highcharts-gantt.src.js +8 -2
- package/es-modules/masters/highcharts-more.src.js +2 -2
- package/es-modules/masters/highcharts.src.js +2 -2
- package/es-modules/masters/highmaps.src.js +2 -2
- package/es-modules/masters/highstock.src.js +2 -2
- package/es-modules/masters/i18n/fr-FR.src.d.ts +1 -1
- package/es-modules/masters/i18n/fr-FR.src.js +1 -1
- package/es-modules/masters/i18n/nb-NO.src.d.ts +1 -1
- package/es-modules/masters/i18n/nb-NO.src.js +1 -1
- package/es-modules/masters/i18n/zh-CN.src.d.ts +1 -1
- package/es-modules/masters/i18n/zh-CN.src.js +1 -1
- package/es-modules/masters/indicators/acceleration-bands.src.js +1 -1
- package/es-modules/masters/indicators/accumulation-distribution.src.js +1 -1
- package/es-modules/masters/indicators/ao.src.js +1 -1
- package/es-modules/masters/indicators/apo.src.js +1 -1
- package/es-modules/masters/indicators/aroon-oscillator.src.js +1 -1
- package/es-modules/masters/indicators/aroon.src.js +1 -1
- package/es-modules/masters/indicators/atr.src.js +1 -1
- package/es-modules/masters/indicators/bollinger-bands.src.js +1 -1
- package/es-modules/masters/indicators/cci.src.js +1 -1
- package/es-modules/masters/indicators/chaikin.src.js +1 -1
- package/es-modules/masters/indicators/cmf.src.js +1 -1
- package/es-modules/masters/indicators/cmo.src.js +1 -1
- package/es-modules/masters/indicators/dema.src.js +1 -1
- package/es-modules/masters/indicators/disparity-index.src.js +1 -1
- package/es-modules/masters/indicators/dmi.src.js +1 -1
- package/es-modules/masters/indicators/dpo.src.js +1 -1
- package/es-modules/masters/indicators/ema.src.js +0 -3
- package/es-modules/masters/indicators/ichimoku-kinko-hyo.src.js +1 -1
- package/es-modules/masters/indicators/indicators-all.src.js +1 -1
- package/es-modules/masters/indicators/indicators.src.js +1 -1
- package/es-modules/masters/indicators/keltner-channels.src.js +1 -1
- package/es-modules/masters/indicators/klinger.src.js +1 -1
- package/es-modules/masters/indicators/macd.src.js +1 -1
- package/es-modules/masters/indicators/mfi.src.js +1 -1
- package/es-modules/masters/indicators/momentum.src.js +1 -1
- package/es-modules/masters/indicators/natr.src.js +1 -1
- package/es-modules/masters/indicators/obv.src.js +1 -1
- package/es-modules/masters/indicators/pivot-points.src.js +1 -1
- package/es-modules/masters/indicators/ppo.src.js +1 -1
- package/es-modules/masters/indicators/price-channel.src.js +1 -1
- package/es-modules/masters/indicators/price-envelopes.src.js +1 -1
- package/es-modules/masters/indicators/psar.src.js +1 -1
- package/es-modules/masters/indicators/regressions.src.js +1 -1
- package/es-modules/masters/indicators/roc.src.js +1 -1
- package/es-modules/masters/indicators/rsi.src.js +1 -1
- package/es-modules/masters/indicators/slow-stochastic.src.js +1 -1
- package/es-modules/masters/indicators/stochastic.src.js +1 -1
- package/es-modules/masters/indicators/supertrend.src.js +1 -1
- package/es-modules/masters/indicators/tema.src.js +1 -1
- package/es-modules/masters/indicators/trendline.src.js +1 -1
- package/es-modules/masters/indicators/trix.src.js +1 -1
- package/es-modules/masters/indicators/volume-by-price.src.js +1 -1
- package/es-modules/masters/indicators/vwap.src.js +1 -1
- package/es-modules/masters/indicators/williams-r.src.js +1 -1
- package/es-modules/masters/indicators/wma.src.js +1 -1
- package/es-modules/masters/indicators/zigzag.src.js +1 -1
- package/es-modules/masters/modules/accessibility.src.js +1 -1
- package/es-modules/masters/modules/annotations-advanced.src.js +1 -1
- package/es-modules/masters/modules/annotations.src.js +1 -1
- package/es-modules/masters/modules/arc-diagram.src.js +1 -1
- package/es-modules/masters/modules/arrow-symbols.src.js +1 -1
- package/es-modules/masters/modules/boost-canvas.src.js +1 -1
- package/es-modules/masters/modules/boost.src.js +1 -1
- package/es-modules/masters/modules/broken-axis.src.js +1 -1
- package/es-modules/masters/modules/bullet.src.js +1 -1
- package/es-modules/masters/modules/coloraxis.src.js +1 -1
- package/es-modules/masters/modules/current-date-indicator.src.js +1 -1
- package/es-modules/masters/modules/cylinder.src.js +1 -1
- package/es-modules/masters/modules/data-tools.src.d.ts +1 -0
- package/es-modules/masters/modules/data-tools.src.js +2 -1
- package/es-modules/masters/modules/data.src.js +1 -1
- package/es-modules/masters/modules/datagrouping.src.js +1 -1
- package/es-modules/masters/modules/debugger.src.js +1 -1
- package/es-modules/masters/modules/dependency-wheel.src.js +1 -1
- package/es-modules/masters/modules/dotplot.src.js +1 -1
- package/es-modules/masters/modules/drag-panes.src.js +1 -1
- package/es-modules/masters/modules/draggable-points.src.js +1 -1
- package/es-modules/masters/modules/drilldown.src.js +3 -1
- package/es-modules/masters/modules/dumbbell.src.js +1 -1
- package/es-modules/masters/modules/export-data.src.js +3 -3
- package/es-modules/masters/modules/exporting.src.js +5 -1
- package/es-modules/masters/modules/flowmap.src.js +1 -1
- package/es-modules/masters/modules/full-screen.src.js +1 -1
- package/es-modules/masters/modules/funnel.src.js +1 -1
- package/es-modules/masters/modules/funnel3d.src.js +1 -1
- package/es-modules/masters/modules/gantt.src.js +1 -1
- package/es-modules/masters/modules/geoheatmap.src.js +1 -1
- package/es-modules/masters/modules/grid-axis.src.js +1 -1
- package/es-modules/masters/modules/heatmap.src.js +1 -1
- package/es-modules/masters/modules/heikinashi.src.js +1 -1
- package/es-modules/masters/modules/histogram-bellcurve.src.js +1 -1
- package/es-modules/masters/modules/hollowcandlestick.src.js +1 -1
- package/es-modules/masters/modules/item-series.src.js +1 -1
- package/es-modules/masters/modules/lollipop.src.js +1 -1
- package/es-modules/masters/modules/map.src.js +1 -1
- package/es-modules/masters/modules/marker-clusters.src.js +1 -1
- package/es-modules/masters/modules/mouse-wheel-zoom.src.js +1 -1
- package/es-modules/masters/modules/navigator.src.js +1 -1
- package/es-modules/masters/modules/networkgraph.src.js +1 -1
- package/es-modules/masters/modules/no-data-to-display.src.js +1 -1
- package/es-modules/masters/modules/non-cartesian-zoom.src.d.ts +2 -0
- package/es-modules/masters/modules/non-cartesian-zoom.src.js +18 -0
- package/es-modules/masters/modules/offline-exporting.src.js +2 -2
- package/es-modules/masters/modules/organization.src.js +1 -1
- package/es-modules/masters/modules/parallel-coordinates.src.js +1 -1
- package/es-modules/masters/modules/pareto.src.js +1 -1
- package/es-modules/masters/modules/pathfinder.src.js +1 -1
- package/es-modules/masters/modules/pattern-fill.src.js +1 -1
- package/es-modules/masters/modules/pictorial.src.js +1 -1
- package/es-modules/masters/modules/pointandfigure.src.js +1 -1
- package/es-modules/masters/modules/price-indicator.src.js +1 -1
- package/es-modules/masters/modules/pyramid3d.src.js +1 -1
- package/es-modules/masters/modules/renko.src.js +1 -1
- package/es-modules/masters/modules/sankey.src.js +1 -1
- package/es-modules/masters/modules/series-label.src.js +1 -1
- package/es-modules/masters/modules/series-on-point.src.js +1 -1
- package/es-modules/masters/modules/solid-gauge.src.js +1 -1
- package/es-modules/masters/modules/sonification.src.js +1 -1
- package/es-modules/masters/modules/static-scale.src.js +1 -1
- package/es-modules/masters/modules/stock-tools.src.js +1 -1
- package/es-modules/masters/modules/stock.src.js +1 -1
- package/es-modules/masters/modules/streamgraph.src.js +1 -1
- package/es-modules/masters/modules/sunburst.src.js +1 -1
- package/es-modules/masters/modules/textpath.src.js +1 -1
- package/es-modules/masters/modules/tiledwebmap.src.js +1 -1
- package/es-modules/masters/modules/tilemap.src.js +1 -1
- package/es-modules/masters/modules/timeline.src.js +1 -1
- package/es-modules/masters/modules/treegraph.src.js +1 -1
- package/es-modules/masters/modules/treegrid.src.js +1 -1
- package/es-modules/masters/modules/treemap.src.js +1 -1
- package/es-modules/masters/modules/variable-pie.src.js +1 -1
- package/es-modules/masters/modules/variwide.src.js +1 -1
- package/es-modules/masters/modules/vector.src.js +1 -1
- package/es-modules/masters/modules/venn.src.js +1 -1
- package/es-modules/masters/modules/windbarb.src.js +1 -1
- package/es-modules/masters/modules/wordcloud.src.js +1 -1
- package/es-modules/masters/modules/xrange.src.js +1 -1
- package/es-modules/masters/standalone-navigator.src.js +7 -6
- package/es-modules/masters/themes/adaptive.src.d.ts +2 -0
- package/es-modules/masters/themes/adaptive.src.js +15 -0
- package/es-modules/masters/themes/avocado.src.js +1 -1
- package/es-modules/masters/themes/brand-dark.src.js +1 -1
- package/es-modules/masters/themes/brand-light.src.js +1 -1
- package/es-modules/masters/themes/dark-blue.src.js +1 -1
- package/es-modules/masters/themes/dark-green.src.js +1 -1
- package/es-modules/masters/themes/dark-unica.src.js +1 -1
- package/es-modules/masters/themes/gray.src.js +1 -1
- package/es-modules/masters/themes/grid-light.src.js +1 -1
- package/es-modules/masters/themes/grid.src.js +1 -1
- package/es-modules/masters/themes/high-contrast-dark.src.js +1 -1
- package/es-modules/masters/themes/high-contrast-light.src.js +1 -1
- package/es-modules/masters/themes/sand-signika.src.js +1 -1
- package/es-modules/masters/themes/skies.src.js +1 -1
- package/es-modules/masters/themes/sunset.src.js +1 -1
- package/es-modules/tsconfig.tsbuildinfo +1 -1
- package/esm/highcharts-3d.js +11 -1
- package/esm/highcharts-3d.src.js +3 -4
- package/esm/highcharts-gantt.js +14 -1
- package/esm/highcharts-gantt.src.js +8 -2
- package/esm/highcharts-more.js +9 -1
- package/esm/highcharts-more.src.js +516 -57
- package/esm/highcharts.js +9 -2
- package/esm/highcharts.src.js +273 -168
- package/esm/highmaps.js +8 -1
- package/esm/highmaps.src.js +2 -2
- package/esm/highstock.js +8 -1
- package/esm/highstock.src.js +2 -2
- package/esm/i18n/fr-FR.js +13 -1
- package/esm/i18n/fr-FR.src.js +1 -1
- package/esm/i18n/nb-NO.js +13 -1
- package/esm/i18n/nb-NO.src.js +1 -1
- package/esm/i18n/zh-CN.js +13 -1
- package/esm/i18n/zh-CN.src.js +1 -1
- package/esm/indicators/acceleration-bands.js +12 -1
- package/esm/indicators/acceleration-bands.src.js +1 -1
- package/esm/indicators/accumulation-distribution.js +12 -1
- package/esm/indicators/accumulation-distribution.src.js +1 -1
- package/esm/indicators/ao.js +12 -1
- package/esm/indicators/ao.src.js +1 -1
- package/esm/indicators/apo.js +12 -1
- package/esm/indicators/apo.src.js +1 -1
- package/esm/indicators/aroon-oscillator.js +12 -1
- package/esm/indicators/aroon-oscillator.src.js +1 -1
- package/esm/indicators/aroon.js +12 -1
- package/esm/indicators/aroon.src.js +1 -1
- package/esm/indicators/atr.js +12 -1
- package/esm/indicators/atr.src.js +1 -1
- package/esm/indicators/bollinger-bands.js +12 -1
- package/esm/indicators/bollinger-bands.src.js +1 -1
- package/esm/indicators/cci.js +12 -1
- package/esm/indicators/cci.src.js +1 -1
- package/esm/indicators/chaikin.js +12 -1
- package/esm/indicators/chaikin.src.js +1 -1
- package/esm/indicators/cmf.js +11 -1
- package/esm/indicators/cmf.src.js +1 -1
- package/esm/indicators/cmo.js +12 -1
- package/esm/indicators/cmo.src.js +1 -1
- package/esm/indicators/dema.js +12 -1
- package/esm/indicators/dema.src.js +1 -1
- package/esm/indicators/disparity-index.js +12 -1
- package/esm/indicators/disparity-index.src.js +1 -1
- package/esm/indicators/dmi.js +12 -1
- package/esm/indicators/dmi.src.js +1 -1
- package/esm/indicators/dpo.js +12 -1
- package/esm/indicators/dpo.src.js +1 -1
- package/esm/indicators/ema.src.js +0 -3
- package/esm/indicators/ichimoku-kinko-hyo.js +12 -1
- package/esm/indicators/ichimoku-kinko-hyo.src.js +1 -1
- package/esm/indicators/indicators-all.js +12 -1
- package/esm/indicators/indicators-all.src.js +2 -2
- package/esm/indicators/indicators.js +12 -1
- package/esm/indicators/indicators.src.js +1 -1
- package/esm/indicators/keltner-channels.js +12 -1
- package/esm/indicators/keltner-channels.src.js +1 -1
- package/esm/indicators/klinger.js +12 -1
- package/esm/indicators/klinger.src.js +1 -1
- package/esm/indicators/macd.js +12 -1
- package/esm/indicators/macd.src.js +2 -2
- package/esm/indicators/mfi.js +12 -1
- package/esm/indicators/mfi.src.js +1 -1
- package/esm/indicators/momentum.js +12 -1
- package/esm/indicators/momentum.src.js +1 -1
- package/esm/indicators/natr.js +12 -1
- package/esm/indicators/natr.src.js +1 -1
- package/esm/indicators/obv.js +12 -1
- package/esm/indicators/obv.src.js +1 -1
- package/esm/indicators/pivot-points.js +12 -1
- package/esm/indicators/pivot-points.src.js +1 -1
- package/esm/indicators/ppo.js +12 -1
- package/esm/indicators/ppo.src.js +1 -1
- package/esm/indicators/price-channel.js +12 -1
- package/esm/indicators/price-channel.src.js +1 -1
- package/esm/indicators/price-envelopes.js +12 -1
- package/esm/indicators/price-envelopes.src.js +1 -1
- package/esm/indicators/psar.js +12 -1
- package/esm/indicators/psar.src.js +1 -1
- package/esm/indicators/regressions.js +12 -1
- package/esm/indicators/regressions.src.js +1 -1
- package/esm/indicators/roc.js +12 -1
- package/esm/indicators/roc.src.js +1 -1
- package/esm/indicators/rsi.js +12 -1
- package/esm/indicators/rsi.src.js +1 -1
- package/esm/indicators/slow-stochastic.js +12 -1
- package/esm/indicators/slow-stochastic.src.js +1 -1
- package/esm/indicators/stochastic.js +12 -1
- package/esm/indicators/stochastic.src.js +1 -1
- package/esm/indicators/supertrend.js +12 -1
- package/esm/indicators/supertrend.src.js +1 -1
- package/esm/indicators/tema.js +12 -1
- package/esm/indicators/tema.src.js +1 -1
- package/esm/indicators/trendline.js +12 -1
- package/esm/indicators/trendline.src.js +1 -1
- package/esm/indicators/trix.js +12 -1
- package/esm/indicators/trix.src.js +1 -1
- package/esm/indicators/volume-by-price.js +12 -1
- package/esm/indicators/volume-by-price.src.js +1 -1
- package/esm/indicators/vwap.js +12 -1
- package/esm/indicators/vwap.src.js +1 -1
- package/esm/indicators/williams-r.js +12 -1
- package/esm/indicators/williams-r.src.js +1 -1
- package/esm/indicators/wma.js +12 -1
- package/esm/indicators/wma.src.js +1 -1
- package/esm/indicators/zigzag.js +12 -1
- package/esm/indicators/zigzag.src.js +1 -1
- package/esm/modules/accessibility.js +12 -1
- package/esm/modules/accessibility.src.js +92 -63
- package/esm/modules/annotations-advanced.js +11 -1
- package/esm/modules/annotations-advanced.src.js +872 -778
- package/esm/modules/annotations.js +11 -1
- package/esm/modules/annotations.src.js +95 -43
- package/esm/modules/arc-diagram.js +11 -1
- package/esm/modules/arc-diagram.src.js +3 -3
- package/esm/modules/arrow-symbols.js +11 -1
- package/esm/modules/arrow-symbols.src.js +1 -1
- package/esm/modules/boost-canvas.js +12 -1
- package/esm/modules/boost-canvas.src.js +102 -53
- package/esm/modules/boost.js +13 -1
- package/esm/modules/boost.src.js +107 -49
- package/esm/modules/broken-axis.js +9 -1
- package/esm/modules/broken-axis.src.js +115 -91
- package/esm/modules/bullet.js +11 -1
- package/esm/modules/bullet.src.js +1 -1
- package/esm/modules/coloraxis.js +11 -1
- package/esm/modules/coloraxis.src.js +6 -7
- package/esm/modules/current-date-indicator.js +11 -1
- package/esm/modules/current-date-indicator.src.js +1 -1
- package/esm/modules/cylinder.js +12 -1
- package/esm/modules/cylinder.src.js +1 -1
- package/esm/modules/data-tools.js +11 -1
- package/esm/modules/data-tools.src.js +542 -125
- package/esm/modules/data.js +11 -1
- package/esm/modules/data.src.js +46 -39
- package/esm/modules/datagrouping.js +11 -1
- package/esm/modules/datagrouping.src.js +1 -1
- package/esm/modules/debugger.js +11 -1
- package/esm/modules/debugger.src.js +1 -1
- package/esm/modules/dependency-wheel.js +12 -1
- package/esm/modules/dependency-wheel.src.js +3 -3
- package/esm/modules/dotplot.js +11 -1
- package/esm/modules/dotplot.src.js +1 -1
- package/esm/modules/drag-panes.js +13 -1
- package/esm/modules/drag-panes.src.js +1 -1
- package/esm/modules/draggable-points.js +9 -1
- package/esm/modules/draggable-points.src.js +1 -1
- package/esm/modules/drilldown.js +13 -1
- package/esm/modules/drilldown.src.js +4 -2
- package/esm/modules/dumbbell.js +9 -1
- package/esm/modules/dumbbell.src.js +1 -1
- package/esm/modules/export-data.js +12 -1
- package/esm/modules/export-data.src.js +985 -799
- package/esm/modules/exporting.js +11 -1
- package/esm/modules/exporting.src.js +1453 -634
- package/esm/modules/flowmap.js +9 -1
- package/esm/modules/flowmap.src.js +1 -1
- package/esm/modules/full-screen.js +12 -1
- package/esm/modules/full-screen.src.js +3 -3
- package/esm/modules/funnel.js +11 -1
- package/esm/modules/funnel.src.js +7 -3
- package/esm/modules/funnel3d.js +13 -1
- package/esm/modules/funnel3d.src.js +1 -1
- package/esm/modules/gantt.js +11 -1
- package/esm/modules/gantt.src.js +254 -212
- package/esm/modules/geoheatmap.js +9 -1
- package/esm/modules/geoheatmap.src.js +1 -1
- package/esm/modules/grid-axis.js +11 -1
- package/esm/modules/grid-axis.src.js +1 -1
- package/esm/modules/heatmap.js +9 -1
- package/esm/modules/heatmap.src.js +2 -3
- package/esm/modules/heikinashi.js +12 -1
- package/esm/modules/heikinashi.src.js +1 -1
- package/esm/modules/histogram-bellcurve.js +10 -1
- package/esm/modules/histogram-bellcurve.src.js +36 -27
- package/esm/modules/hollowcandlestick.js +12 -1
- package/esm/modules/hollowcandlestick.src.js +1 -1
- package/esm/modules/item-series.js +11 -1
- package/esm/modules/item-series.src.js +3 -5
- package/esm/modules/lollipop.js +9 -1
- package/esm/modules/lollipop.src.js +1 -1
- package/esm/modules/map.js +11 -1
- package/esm/modules/map.src.js +5 -6
- package/esm/modules/marker-clusters.js +11 -1
- package/esm/modules/marker-clusters.src.js +1 -1
- package/esm/modules/mouse-wheel-zoom.js +11 -1
- package/esm/modules/mouse-wheel-zoom.src.js +1 -1
- package/esm/modules/navigator.js +11 -1
- package/esm/modules/navigator.src.js +29 -29
- package/esm/modules/networkgraph.js +11 -1
- package/esm/modules/networkgraph.src.js +16 -4
- package/esm/modules/no-data-to-display.js +12 -1
- package/esm/modules/no-data-to-display.src.js +1 -1
- package/esm/modules/non-cartesian-zoom.d.ts +2 -0
- package/esm/modules/non-cartesian-zoom.js +11 -0
- package/esm/modules/non-cartesian-zoom.src.d.ts +2 -0
- package/esm/modules/non-cartesian-zoom.src.js +374 -0
- package/esm/modules/offline-exporting.js +12 -1
- package/esm/modules/offline-exporting.src.js +339 -3363
- package/esm/modules/organization.js +11 -1
- package/esm/modules/organization.src.js +3 -3
- package/esm/modules/parallel-coordinates.js +11 -1
- package/esm/modules/parallel-coordinates.src.js +1 -1
- package/esm/modules/pareto.js +11 -1
- package/esm/modules/pareto.src.js +1 -1
- package/esm/modules/pathfinder.js +11 -1
- package/esm/modules/pathfinder.src.js +1 -1
- package/esm/modules/pattern-fill.js +12 -1
- package/esm/modules/pattern-fill.src.js +1 -1
- package/esm/modules/pictorial.js +11 -1
- package/esm/modules/pictorial.src.js +1 -1
- package/esm/modules/pointandfigure.js +12 -1
- package/esm/modules/pointandfigure.src.js +1 -1
- package/esm/modules/price-indicator.js +13 -1
- package/esm/modules/price-indicator.src.js +1 -1
- package/esm/modules/pyramid3d.js +14 -1
- package/esm/modules/pyramid3d.src.js +1 -1
- package/esm/modules/renko.js +12 -1
- package/esm/modules/renko.src.js +1 -1
- package/esm/modules/sankey.js +11 -1
- package/esm/modules/sankey.src.js +3 -3
- package/esm/modules/series-label.js +9 -1
- package/esm/modules/series-label.src.js +1 -1
- package/esm/modules/series-on-point.js +12 -1
- package/esm/modules/series-on-point.src.js +1 -9
- package/esm/modules/solid-gauge.js +12 -1
- package/esm/modules/solid-gauge.src.js +27 -5
- package/esm/modules/sonification.js +12 -1
- package/esm/modules/sonification.src.js +45 -10
- package/esm/modules/static-scale.js +11 -1
- package/esm/modules/static-scale.src.js +14 -12
- package/esm/modules/stock-tools.js +13 -1
- package/esm/modules/stock-tools.src.js +37 -116
- package/esm/modules/stock.js +11 -1
- package/esm/modules/stock.src.js +98 -98
- package/esm/modules/streamgraph.js +11 -1
- package/esm/modules/streamgraph.src.js +1 -1
- package/esm/modules/sunburst.js +10 -1
- package/esm/modules/sunburst.src.js +9 -9
- package/esm/modules/textpath.js +9 -1
- package/esm/modules/textpath.src.js +3 -3
- package/esm/modules/tiledwebmap.js +10 -2
- package/esm/modules/tiledwebmap.src.js +1 -1
- package/esm/modules/tilemap.js +12 -1
- package/esm/modules/tilemap.src.js +1 -1
- package/esm/modules/timeline.js +12 -1
- package/esm/modules/timeline.src.js +1 -1
- package/esm/modules/treegraph.js +11 -1
- package/esm/modules/treegraph.src.js +16 -8
- package/esm/modules/treegrid.js +11 -1
- package/esm/modules/treegrid.src.js +190 -159
- package/esm/modules/treemap.js +10 -1
- package/esm/modules/treemap.src.js +7 -7
- package/esm/modules/variable-pie.js +11 -1
- package/esm/modules/variable-pie.src.js +1 -1
- package/esm/modules/variwide.js +11 -1
- package/esm/modules/variwide.src.js +18 -13
- package/esm/modules/vector.js +11 -1
- package/esm/modules/vector.src.js +1 -1
- package/esm/modules/venn.js +10 -1
- package/esm/modules/venn.src.js +5 -3
- package/esm/modules/windbarb.js +11 -1
- package/esm/modules/windbarb.src.js +1 -1
- package/esm/modules/wordcloud.js +10 -1
- package/esm/modules/wordcloud.src.js +89 -12
- package/esm/modules/xrange.js +11 -1
- package/esm/modules/xrange.src.js +3 -2
- package/esm/standalone-navigator.js +11 -2
- package/esm/standalone-navigator.src.js +312 -206
- package/esm/themes/adaptive.d.ts +2 -0
- package/esm/themes/adaptive.js +130 -0
- package/esm/themes/adaptive.src.d.ts +2 -0
- package/esm/themes/adaptive.src.js +1069 -0
- package/esm/themes/avocado.js +9 -1
- package/esm/themes/avocado.src.js +1 -1
- package/esm/themes/brand-dark.js +9 -1
- package/esm/themes/brand-dark.src.js +1 -1
- package/esm/themes/brand-light.js +9 -1
- package/esm/themes/brand-light.src.js +1 -1
- package/esm/themes/dark-blue.js +9 -1
- package/esm/themes/dark-blue.src.js +1 -1
- package/esm/themes/dark-green.js +9 -1
- package/esm/themes/dark-green.src.js +1 -1
- package/esm/themes/dark-unica.js +9 -1
- package/esm/themes/dark-unica.src.js +1 -1
- package/esm/themes/gray.js +9 -1
- package/esm/themes/gray.src.js +1 -1
- package/esm/themes/grid-light.js +9 -1
- package/esm/themes/grid-light.src.js +1 -1
- package/esm/themes/grid.js +9 -1
- package/esm/themes/grid.src.js +1 -1
- package/esm/themes/high-contrast-dark.js +9 -1
- package/esm/themes/high-contrast-dark.src.js +1 -1
- package/esm/themes/high-contrast-light.js +9 -1
- package/esm/themes/high-contrast-light.src.js +1 -1
- package/esm/themes/sand-signika.js +9 -1
- package/esm/themes/sand-signika.src.js +1 -1
- package/esm/themes/skies.js +9 -1
- package/esm/themes/skies.src.js +1 -1
- package/esm/themes/sunset.js +9 -1
- package/esm/themes/sunset.src.js +1 -1
- package/highcharts-3d.d.ts +1 -9
- package/highcharts-3d.js +11 -1
- package/highcharts-3d.src.d.ts +1 -9
- package/highcharts-3d.src.js +3 -4
- package/highcharts-gantt.js +15 -2
- package/highcharts-gantt.src.js +546 -392
- package/highcharts-more.d.ts +10 -9
- package/highcharts-more.js +9 -1
- package/highcharts-more.src.d.ts +10 -9
- package/highcharts-more.src.js +516 -57
- package/highcharts.d.ts +4526 -1522
- package/highcharts.js +9 -2
- package/highcharts.src.d.ts +4526 -1522
- package/highcharts.src.js +273 -168
- package/highmaps.js +9 -2
- package/highmaps.src.js +294 -191
- package/highstock.js +9 -2
- package/highstock.src.js +490 -361
- package/i18n/fr-FR.js +13 -1
- package/i18n/fr-FR.src.js +8 -8
- package/i18n/nb-NO.js +13 -1
- package/i18n/nb-NO.src.js +8 -8
- package/i18n/zh-CN.js +13 -1
- package/i18n/zh-CN.src.js +8 -8
- package/indicators/acceleration-bands.d.ts +1 -9
- package/indicators/acceleration-bands.js +12 -1
- package/indicators/acceleration-bands.src.d.ts +1 -9
- package/indicators/acceleration-bands.src.js +1 -1
- package/indicators/accumulation-distribution.d.ts +1 -9
- package/indicators/accumulation-distribution.js +12 -1
- package/indicators/accumulation-distribution.src.d.ts +1 -9
- package/indicators/accumulation-distribution.src.js +1 -1
- package/indicators/ao.d.ts +1 -9
- package/indicators/ao.js +12 -1
- package/indicators/ao.src.d.ts +1 -9
- package/indicators/ao.src.js +1 -1
- package/indicators/apo.d.ts +1 -9
- package/indicators/apo.js +12 -1
- package/indicators/apo.src.d.ts +1 -9
- package/indicators/apo.src.js +1 -1
- package/indicators/aroon-oscillator.d.ts +1 -9
- package/indicators/aroon-oscillator.js +12 -1
- package/indicators/aroon-oscillator.src.d.ts +1 -9
- package/indicators/aroon-oscillator.src.js +1 -1
- package/indicators/aroon.d.ts +1 -9
- package/indicators/aroon.js +12 -1
- package/indicators/aroon.src.d.ts +1 -9
- package/indicators/aroon.src.js +1 -1
- package/indicators/atr.d.ts +1 -9
- package/indicators/atr.js +12 -1
- package/indicators/atr.src.d.ts +1 -9
- package/indicators/atr.src.js +1 -1
- package/indicators/bollinger-bands.d.ts +1 -9
- package/indicators/bollinger-bands.js +12 -1
- package/indicators/bollinger-bands.src.d.ts +1 -9
- package/indicators/bollinger-bands.src.js +1 -1
- package/indicators/cci.d.ts +1 -9
- package/indicators/cci.js +12 -1
- package/indicators/cci.src.d.ts +1 -9
- package/indicators/cci.src.js +1 -1
- package/indicators/chaikin.d.ts +1 -9
- package/indicators/chaikin.js +12 -1
- package/indicators/chaikin.src.d.ts +1 -9
- package/indicators/chaikin.src.js +1 -1
- package/indicators/cmf.d.ts +1 -9
- package/indicators/cmf.js +11 -1
- package/indicators/cmf.src.d.ts +1 -9
- package/indicators/cmf.src.js +1 -1
- package/indicators/cmo.d.ts +1 -9
- package/indicators/cmo.js +12 -1
- package/indicators/cmo.src.d.ts +1 -9
- package/indicators/cmo.src.js +1 -1
- package/indicators/dema.d.ts +1 -9
- package/indicators/dema.js +12 -1
- package/indicators/dema.src.d.ts +1 -9
- package/indicators/dema.src.js +1 -1
- package/indicators/disparity-index.d.ts +1 -9
- package/indicators/disparity-index.js +12 -1
- package/indicators/disparity-index.src.d.ts +1 -9
- package/indicators/disparity-index.src.js +1 -1
- package/indicators/dmi.d.ts +1 -9
- package/indicators/dmi.js +12 -1
- package/indicators/dmi.src.d.ts +1 -9
- package/indicators/dmi.src.js +1 -1
- package/indicators/dpo.d.ts +1 -9
- package/indicators/dpo.js +12 -1
- package/indicators/dpo.src.d.ts +1 -9
- package/indicators/dpo.src.js +1 -1
- package/indicators/ema.d.ts +1 -9
- package/indicators/ema.src.d.ts +1 -9
- package/indicators/ema.src.js +3 -6
- package/indicators/ichimoku-kinko-hyo.d.ts +1 -9
- package/indicators/ichimoku-kinko-hyo.js +12 -1
- package/indicators/ichimoku-kinko-hyo.src.d.ts +1 -9
- package/indicators/ichimoku-kinko-hyo.src.js +1 -1
- package/indicators/indicators-all.d.ts +1 -9
- package/indicators/indicators-all.js +12 -1
- package/indicators/indicators-all.src.d.ts +1 -9
- package/indicators/indicators-all.src.js +2 -2
- package/indicators/indicators.d.ts +1 -9
- package/indicators/indicators.js +12 -1
- package/indicators/indicators.src.d.ts +1 -9
- package/indicators/indicators.src.js +1 -1
- package/indicators/keltner-channels.d.ts +1 -9
- package/indicators/keltner-channels.js +12 -1
- package/indicators/keltner-channels.src.d.ts +1 -9
- package/indicators/keltner-channels.src.js +1 -1
- package/indicators/klinger.d.ts +1 -9
- package/indicators/klinger.js +12 -1
- package/indicators/klinger.src.d.ts +1 -9
- package/indicators/klinger.src.js +1 -1
- package/indicators/macd.d.ts +1 -9
- package/indicators/macd.js +12 -1
- package/indicators/macd.src.d.ts +1 -9
- package/indicators/macd.src.js +2 -2
- package/indicators/mfi.d.ts +1 -9
- package/indicators/mfi.js +12 -1
- package/indicators/mfi.src.d.ts +1 -9
- package/indicators/mfi.src.js +1 -1
- package/indicators/momentum.d.ts +1 -9
- package/indicators/momentum.js +12 -1
- package/indicators/momentum.src.d.ts +1 -9
- package/indicators/momentum.src.js +1 -1
- package/indicators/natr.d.ts +1 -9
- package/indicators/natr.js +12 -1
- package/indicators/natr.src.d.ts +1 -9
- package/indicators/natr.src.js +1 -1
- package/indicators/obv.d.ts +1 -9
- package/indicators/obv.js +12 -1
- package/indicators/obv.src.d.ts +1 -9
- package/indicators/obv.src.js +1 -1
- package/indicators/pivot-points.d.ts +1 -9
- package/indicators/pivot-points.js +12 -1
- package/indicators/pivot-points.src.d.ts +1 -9
- package/indicators/pivot-points.src.js +1 -1
- package/indicators/ppo.d.ts +1 -9
- package/indicators/ppo.js +12 -1
- package/indicators/ppo.src.d.ts +1 -9
- package/indicators/ppo.src.js +1 -1
- package/indicators/price-channel.d.ts +1 -9
- package/indicators/price-channel.js +12 -1
- package/indicators/price-channel.src.d.ts +1 -9
- package/indicators/price-channel.src.js +1 -1
- package/indicators/price-envelopes.d.ts +1 -9
- package/indicators/price-envelopes.js +12 -1
- package/indicators/price-envelopes.src.d.ts +1 -9
- package/indicators/price-envelopes.src.js +1 -1
- package/indicators/psar.d.ts +1 -9
- package/indicators/psar.js +12 -1
- package/indicators/psar.src.d.ts +1 -9
- package/indicators/psar.src.js +1 -1
- package/indicators/regressions.d.ts +1 -9
- package/indicators/regressions.js +12 -1
- package/indicators/regressions.src.d.ts +1 -9
- package/indicators/regressions.src.js +1 -1
- package/indicators/roc.d.ts +1 -9
- package/indicators/roc.js +12 -1
- package/indicators/roc.src.d.ts +1 -9
- package/indicators/roc.src.js +1 -1
- package/indicators/rsi.d.ts +1 -9
- package/indicators/rsi.js +12 -1
- package/indicators/rsi.src.d.ts +1 -9
- package/indicators/rsi.src.js +1 -1
- package/indicators/slow-stochastic.d.ts +1 -9
- package/indicators/slow-stochastic.js +12 -1
- package/indicators/slow-stochastic.src.d.ts +1 -9
- package/indicators/slow-stochastic.src.js +1 -1
- package/indicators/stochastic.d.ts +1 -9
- package/indicators/stochastic.js +12 -1
- package/indicators/stochastic.src.d.ts +1 -9
- package/indicators/stochastic.src.js +1 -1
- package/indicators/supertrend.d.ts +1 -9
- package/indicators/supertrend.js +12 -1
- package/indicators/supertrend.src.d.ts +1 -9
- package/indicators/supertrend.src.js +1 -1
- package/indicators/tema.d.ts +1 -9
- package/indicators/tema.js +12 -1
- package/indicators/tema.src.d.ts +1 -9
- package/indicators/tema.src.js +1 -1
- package/indicators/trendline.d.ts +1 -9
- package/indicators/trendline.js +12 -1
- package/indicators/trendline.src.d.ts +1 -9
- package/indicators/trendline.src.js +1 -1
- package/indicators/trix.d.ts +1 -9
- package/indicators/trix.js +12 -1
- package/indicators/trix.src.d.ts +1 -9
- package/indicators/trix.src.js +1 -1
- package/indicators/volume-by-price.d.ts +1 -9
- package/indicators/volume-by-price.js +12 -1
- package/indicators/volume-by-price.src.d.ts +1 -9
- package/indicators/volume-by-price.src.js +1 -1
- package/indicators/vwap.d.ts +1 -9
- package/indicators/vwap.js +12 -1
- package/indicators/vwap.src.d.ts +1 -9
- package/indicators/vwap.src.js +1 -1
- package/indicators/williams-r.d.ts +1 -9
- package/indicators/williams-r.js +12 -1
- package/indicators/williams-r.src.d.ts +1 -9
- package/indicators/williams-r.src.js +1 -1
- package/indicators/wma.d.ts +1 -9
- package/indicators/wma.js +12 -1
- package/indicators/wma.src.d.ts +1 -9
- package/indicators/wma.src.js +1 -1
- package/indicators/zigzag.d.ts +1 -9
- package/indicators/zigzag.js +12 -1
- package/indicators/zigzag.src.d.ts +1 -9
- package/indicators/zigzag.src.js +1 -1
- package/modules/accessibility.d.ts +1 -11
- package/modules/accessibility.js +12 -1
- package/modules/accessibility.src.d.ts +1 -11
- package/modules/accessibility.src.js +92 -63
- package/modules/annotations-advanced.d.ts +1 -9
- package/modules/annotations-advanced.js +21 -1
- package/modules/annotations-advanced.src.d.ts +1 -9
- package/modules/annotations-advanced.src.js +888 -794
- package/modules/annotations.d.ts +1 -9
- package/modules/annotations.js +11 -1
- package/modules/annotations.src.d.ts +1 -9
- package/modules/annotations.src.js +95 -43
- package/modules/arc-diagram.d.ts +1 -9
- package/modules/arc-diagram.js +11 -1
- package/modules/arc-diagram.src.d.ts +1 -9
- package/modules/arc-diagram.src.js +3 -3
- package/modules/arrow-symbols.d.ts +1 -9
- package/modules/arrow-symbols.js +11 -1
- package/modules/arrow-symbols.src.d.ts +1 -9
- package/modules/arrow-symbols.src.js +1 -1
- package/modules/boost-canvas.d.ts +1 -9
- package/modules/boost-canvas.js +12 -1
- package/modules/boost-canvas.src.d.ts +1 -9
- package/modules/boost-canvas.src.js +102 -53
- package/modules/boost.d.ts +1 -9
- package/modules/boost.js +13 -1
- package/modules/boost.src.d.ts +1 -9
- package/modules/boost.src.js +107 -49
- package/modules/broken-axis.d.ts +1 -9
- package/modules/broken-axis.js +9 -1
- package/modules/broken-axis.src.d.ts +1 -9
- package/modules/broken-axis.src.js +115 -91
- package/modules/bullet.d.ts +1 -9
- package/modules/bullet.js +11 -1
- package/modules/bullet.src.d.ts +1 -9
- package/modules/bullet.src.js +1 -1
- package/modules/coloraxis.d.ts +1 -9
- package/modules/coloraxis.js +11 -1
- package/modules/coloraxis.src.d.ts +1 -9
- package/modules/coloraxis.src.js +6 -7
- package/modules/current-date-indicator.d.ts +1 -9
- package/modules/current-date-indicator.js +11 -1
- package/modules/current-date-indicator.src.d.ts +1 -9
- package/modules/current-date-indicator.src.js +1 -1
- package/modules/cylinder.d.ts +1 -9
- package/modules/cylinder.js +12 -1
- package/modules/cylinder.src.d.ts +1 -9
- package/modules/cylinder.src.js +1 -1
- package/modules/data-tools.js +11 -1
- package/modules/data-tools.src.js +542 -125
- package/modules/data.d.ts +1 -9
- package/modules/data.js +11 -1
- package/modules/data.src.d.ts +1 -9
- package/modules/data.src.js +46 -39
- package/modules/datagrouping.d.ts +1 -9
- package/modules/datagrouping.js +11 -1
- package/modules/datagrouping.src.d.ts +1 -9
- package/modules/datagrouping.src.js +1 -1
- package/modules/debugger.d.ts +1 -9
- package/modules/debugger.js +11 -1
- package/modules/debugger.src.d.ts +1 -9
- package/modules/debugger.src.js +1 -1
- package/modules/dependency-wheel.d.ts +1 -9
- package/modules/dependency-wheel.js +12 -1
- package/modules/dependency-wheel.src.d.ts +1 -9
- package/modules/dependency-wheel.src.js +3 -3
- package/modules/dotplot.d.ts +1 -9
- package/modules/dotplot.js +11 -1
- package/modules/dotplot.src.d.ts +1 -9
- package/modules/dotplot.src.js +1 -1
- package/modules/drag-panes.d.ts +1 -9
- package/modules/drag-panes.js +13 -1
- package/modules/drag-panes.src.d.ts +1 -9
- package/modules/drag-panes.src.js +1 -1
- package/modules/draggable-points.d.ts +1 -9
- package/modules/draggable-points.js +9 -1
- package/modules/draggable-points.src.d.ts +1 -9
- package/modules/draggable-points.src.js +1 -1
- package/modules/drilldown.d.ts +1 -9
- package/modules/drilldown.js +13 -1
- package/modules/drilldown.src.d.ts +1 -9
- package/modules/drilldown.src.js +4 -2
- package/modules/dumbbell.d.ts +1 -9
- package/modules/dumbbell.js +9 -1
- package/modules/dumbbell.src.d.ts +1 -9
- package/modules/dumbbell.src.js +1 -1
- package/modules/export-data.d.ts +2 -79
- package/modules/export-data.js +12 -1
- package/modules/export-data.src.d.ts +2 -79
- package/modules/export-data.src.js +997 -804
- package/modules/exporting.d.ts +35 -21
- package/modules/exporting.js +11 -1
- package/modules/exporting.src.d.ts +35 -21
- package/modules/exporting.src.js +1452 -628
- package/modules/flowmap.d.ts +1 -9
- package/modules/flowmap.js +9 -1
- package/modules/flowmap.src.d.ts +1 -9
- package/modules/flowmap.src.js +1 -1
- package/modules/full-screen.d.ts +1 -9
- package/modules/full-screen.js +12 -1
- package/modules/full-screen.src.d.ts +1 -9
- package/modules/full-screen.src.js +3 -3
- package/modules/funnel.d.ts +1 -9
- package/modules/funnel.js +11 -1
- package/modules/funnel.src.d.ts +1 -9
- package/modules/funnel.src.js +7 -3
- package/modules/funnel3d.d.ts +1 -9
- package/modules/funnel3d.js +13 -1
- package/modules/funnel3d.src.d.ts +1 -9
- package/modules/funnel3d.src.js +1 -1
- package/modules/gantt.d.ts +1 -9
- package/modules/gantt.js +31 -1
- package/modules/gantt.src.d.ts +1 -9
- package/modules/gantt.src.js +273 -230
- package/modules/geoheatmap.d.ts +1 -9
- package/modules/geoheatmap.js +9 -1
- package/modules/geoheatmap.src.d.ts +1 -9
- package/modules/geoheatmap.src.js +1 -1
- package/modules/grid-axis.d.ts +1 -9
- package/modules/grid-axis.js +11 -1
- package/modules/grid-axis.src.d.ts +1 -9
- package/modules/grid-axis.src.js +1 -1
- package/modules/heatmap.d.ts +1 -9
- package/modules/heatmap.js +19 -1
- package/modules/heatmap.src.d.ts +1 -9
- package/modules/heatmap.src.js +21 -23
- package/modules/heikinashi.d.ts +1 -9
- package/modules/heikinashi.js +12 -1
- package/modules/heikinashi.src.d.ts +1 -9
- package/modules/heikinashi.src.js +1 -1
- package/modules/histogram-bellcurve.d.ts +2 -11
- package/modules/histogram-bellcurve.js +10 -1
- package/modules/histogram-bellcurve.src.d.ts +2 -11
- package/modules/histogram-bellcurve.src.js +36 -27
- package/modules/hollowcandlestick.d.ts +1 -9
- package/modules/hollowcandlestick.js +12 -1
- package/modules/hollowcandlestick.src.d.ts +1 -9
- package/modules/hollowcandlestick.src.js +1 -1
- package/modules/item-series.d.ts +1 -9
- package/modules/item-series.js +11 -1
- package/modules/item-series.src.d.ts +1 -9
- package/modules/item-series.src.js +3 -5
- package/modules/lollipop.d.ts +1 -9
- package/modules/lollipop.js +9 -1
- package/modules/lollipop.src.d.ts +1 -9
- package/modules/lollipop.src.js +1 -1
- package/modules/map.d.ts +1 -9
- package/modules/map.js +21 -1
- package/modules/map.src.d.ts +1 -9
- package/modules/map.src.js +25 -27
- package/modules/marker-clusters.d.ts +1 -9
- package/modules/marker-clusters.js +11 -1
- package/modules/marker-clusters.src.d.ts +1 -9
- package/modules/marker-clusters.src.js +1 -1
- package/modules/mouse-wheel-zoom.d.ts +1 -9
- package/modules/mouse-wheel-zoom.js +11 -1
- package/modules/mouse-wheel-zoom.src.d.ts +1 -9
- package/modules/mouse-wheel-zoom.src.js +1 -1
- package/modules/navigator.d.ts +1 -9
- package/modules/navigator.js +11 -1
- package/modules/navigator.src.d.ts +1 -9
- package/modules/navigator.src.js +29 -29
- package/modules/networkgraph.d.ts +1 -9
- package/modules/networkgraph.js +11 -1
- package/modules/networkgraph.src.d.ts +1 -9
- package/modules/networkgraph.src.js +16 -4
- package/modules/no-data-to-display.d.ts +1 -9
- package/modules/no-data-to-display.js +12 -1
- package/modules/no-data-to-display.src.d.ts +1 -9
- package/modules/no-data-to-display.src.js +1 -1
- package/modules/non-cartesian-zoom.d.ts +9 -0
- package/modules/non-cartesian-zoom.js +11 -0
- package/modules/non-cartesian-zoom.src.d.ts +9 -0
- package/modules/non-cartesian-zoom.src.js +427 -0
- package/modules/offline-exporting.d.ts +2 -90
- package/modules/offline-exporting.js +12 -1
- package/modules/offline-exporting.src.d.ts +2 -90
- package/modules/offline-exporting.src.js +355 -3380
- package/modules/organization.d.ts +1 -9
- package/modules/organization.js +11 -1
- package/modules/organization.src.d.ts +1 -9
- package/modules/organization.src.js +3 -3
- package/modules/parallel-coordinates.d.ts +1 -9
- package/modules/parallel-coordinates.js +11 -1
- package/modules/parallel-coordinates.src.d.ts +1 -9
- package/modules/parallel-coordinates.src.js +1 -1
- package/modules/pareto.d.ts +1 -9
- package/modules/pareto.js +11 -1
- package/modules/pareto.src.d.ts +1 -9
- package/modules/pareto.src.js +1 -1
- package/modules/pathfinder.d.ts +1 -9
- package/modules/pathfinder.js +11 -1
- package/modules/pathfinder.src.d.ts +1 -9
- package/modules/pathfinder.src.js +1 -1
- package/modules/pattern-fill.d.ts +1 -9
- package/modules/pattern-fill.js +12 -1
- package/modules/pattern-fill.src.d.ts +1 -9
- package/modules/pattern-fill.src.js +1 -1
- package/modules/pictorial.d.ts +1 -9
- package/modules/pictorial.js +11 -1
- package/modules/pictorial.src.d.ts +1 -9
- package/modules/pictorial.src.js +1 -1
- package/modules/pointandfigure.d.ts +1 -9
- package/modules/pointandfigure.js +12 -1
- package/modules/pointandfigure.src.d.ts +1 -9
- package/modules/pointandfigure.src.js +1 -1
- package/modules/price-indicator.d.ts +1 -9
- package/modules/price-indicator.js +13 -1
- package/modules/price-indicator.src.d.ts +1 -9
- package/modules/price-indicator.src.js +1 -1
- package/modules/pyramid3d.d.ts +1 -9
- package/modules/pyramid3d.js +14 -1
- package/modules/pyramid3d.src.d.ts +1 -9
- package/modules/pyramid3d.src.js +1 -1
- package/modules/renko.d.ts +1 -9
- package/modules/renko.js +12 -1
- package/modules/renko.src.d.ts +1 -9
- package/modules/renko.src.js +1 -1
- package/modules/sankey.d.ts +1 -9
- package/modules/sankey.js +11 -1
- package/modules/sankey.src.d.ts +1 -9
- package/modules/sankey.src.js +3 -3
- package/modules/series-label.d.ts +1 -9
- package/modules/series-label.js +9 -1
- package/modules/series-label.src.d.ts +1 -9
- package/modules/series-label.src.js +1 -1
- package/modules/series-on-point.d.ts +1 -9
- package/modules/series-on-point.js +12 -1
- package/modules/series-on-point.src.d.ts +1 -9
- package/modules/series-on-point.src.js +6 -16
- package/modules/solid-gauge.d.ts +1 -9
- package/modules/solid-gauge.js +12 -1
- package/modules/solid-gauge.src.d.ts +1 -9
- package/modules/solid-gauge.src.js +27 -5
- package/modules/sonification.d.ts +1 -9
- package/modules/sonification.js +12 -1
- package/modules/sonification.src.d.ts +1 -9
- package/modules/sonification.src.js +45 -10
- package/modules/static-scale.d.ts +1 -9
- package/modules/static-scale.js +11 -1
- package/modules/static-scale.src.d.ts +1 -9
- package/modules/static-scale.src.js +14 -12
- package/modules/stock-tools.d.ts +1 -9
- package/modules/stock-tools.js +13 -1
- package/modules/stock-tools.src.d.ts +1 -9
- package/modules/stock-tools.src.js +37 -116
- package/modules/stock.d.ts +1 -9
- package/modules/stock.js +21 -1
- package/modules/stock.src.d.ts +1 -9
- package/modules/stock.src.js +233 -209
- package/modules/streamgraph.d.ts +1 -9
- package/modules/streamgraph.js +11 -1
- package/modules/streamgraph.src.d.ts +1 -9
- package/modules/streamgraph.src.js +1 -1
- package/modules/sunburst.d.ts +1 -9
- package/modules/sunburst.js +10 -1
- package/modules/sunburst.src.d.ts +1 -9
- package/modules/sunburst.src.js +9 -9
- package/modules/textpath.d.ts +1 -9
- package/modules/textpath.js +9 -1
- package/modules/textpath.src.d.ts +1 -9
- package/modules/textpath.src.js +3 -3
- package/modules/tiledwebmap.d.ts +1 -9
- package/modules/tiledwebmap.js +10 -2
- package/modules/tiledwebmap.src.d.ts +1 -9
- package/modules/tiledwebmap.src.js +1 -1
- package/modules/tilemap.d.ts +1 -9
- package/modules/tilemap.js +12 -1
- package/modules/tilemap.src.d.ts +1 -9
- package/modules/tilemap.src.js +1 -1
- package/modules/timeline.d.ts +1 -9
- package/modules/timeline.js +12 -1
- package/modules/timeline.src.d.ts +1 -9
- package/modules/timeline.src.js +1 -1
- package/modules/treegraph.d.ts +1 -9
- package/modules/treegraph.js +11 -1
- package/modules/treegraph.src.d.ts +1 -9
- package/modules/treegraph.src.js +16 -8
- package/modules/treegrid.d.ts +1 -9
- package/modules/treegrid.js +11 -1
- package/modules/treegrid.src.d.ts +1 -9
- package/modules/treegrid.src.js +190 -159
- package/modules/treemap.d.ts +1 -9
- package/modules/treemap.js +10 -1
- package/modules/treemap.src.d.ts +1 -9
- package/modules/treemap.src.js +7 -7
- package/modules/variable-pie.d.ts +1 -9
- package/modules/variable-pie.js +11 -1
- package/modules/variable-pie.src.d.ts +1 -9
- package/modules/variable-pie.src.js +1 -1
- package/modules/variwide.d.ts +1 -9
- package/modules/variwide.js +11 -1
- package/modules/variwide.src.d.ts +1 -9
- package/modules/variwide.src.js +18 -13
- package/modules/vector.d.ts +1 -9
- package/modules/vector.js +11 -1
- package/modules/vector.src.d.ts +1 -9
- package/modules/vector.src.js +1 -1
- package/modules/venn.d.ts +1 -9
- package/modules/venn.js +10 -1
- package/modules/venn.src.d.ts +1 -9
- package/modules/venn.src.js +5 -3
- package/modules/windbarb.d.ts +1 -9
- package/modules/windbarb.js +11 -1
- package/modules/windbarb.src.d.ts +1 -9
- package/modules/windbarb.src.js +1 -1
- package/modules/wordcloud.d.ts +1 -9
- package/modules/wordcloud.js +10 -1
- package/modules/wordcloud.src.d.ts +1 -9
- package/modules/wordcloud.src.js +89 -12
- package/modules/xrange.d.ts +1 -9
- package/modules/xrange.js +11 -1
- package/modules/xrange.src.d.ts +1 -9
- package/modules/xrange.src.js +3 -2
- package/options/abands.d.ts +8 -0
- package/options/abands.src.d.ts +8 -0
- package/options/ao.d.ts +8 -0
- package/options/ao.src.d.ts +8 -0
- package/options/arcdiagram.d.ts +8 -0
- package/options/arcdiagram.src.d.ts +8 -0
- package/options/area.d.ts +9 -0
- package/options/area.src.d.ts +9 -0
- package/options/arearange.d.ts +9 -0
- package/options/arearange.src.d.ts +9 -0
- package/options/areaspline.d.ts +9 -0
- package/options/areaspline.src.d.ts +9 -0
- package/options/areasplinerange.d.ts +9 -0
- package/options/areasplinerange.src.d.ts +9 -0
- package/options/aroon.d.ts +8 -0
- package/options/aroon.src.d.ts +8 -0
- package/options/atr.d.ts +8 -0
- package/options/atr.src.d.ts +8 -0
- package/options/bellcurve.d.ts +8 -0
- package/options/bellcurve.src.d.ts +8 -0
- package/options/boxplot.d.ts +8 -0
- package/options/boxplot.src.d.ts +8 -0
- package/options/bullet.d.ts +8 -0
- package/options/bullet.src.d.ts +8 -0
- package/options/chaikin.d.ts +8 -0
- package/options/chaikin.src.d.ts +8 -0
- package/options/cmo.d.ts +8 -0
- package/options/cmo.src.d.ts +8 -0
- package/options/columnpyramid.d.ts +9 -0
- package/options/columnpyramid.src.d.ts +9 -0
- package/options/columnrange.d.ts +9 -0
- package/options/columnrange.src.d.ts +9 -0
- package/options/dmi.d.ts +8 -0
- package/options/dmi.src.d.ts +8 -0
- package/options/errorbar.d.ts +8 -0
- package/options/errorbar.src.d.ts +8 -0
- package/options/flags.d.ts +8 -0
- package/options/flags.src.d.ts +8 -0
- package/options/funnel.d.ts +8 -0
- package/options/funnel.src.d.ts +8 -0
- package/options/gauge.d.ts +8 -0
- package/options/gauge.src.d.ts +8 -0
- package/options/item.d.ts +8 -0
- package/options/item.src.d.ts +8 -0
- package/options/keltnerchannels.d.ts +8 -0
- package/options/keltnerchannels.src.d.ts +8 -0
- package/options/line.d.ts +9 -0
- package/options/line.src.d.ts +9 -0
- package/options/linearregressionangle.d.ts +8 -0
- package/options/linearregressionangle.src.d.ts +8 -0
- package/options/linearregressionintercept.d.ts +8 -0
- package/options/linearregressionintercept.src.d.ts +8 -0
- package/options/map.d.ts +8 -0
- package/options/map.src.d.ts +8 -0
- package/options/mfi.d.ts +8 -0
- package/options/mfi.src.d.ts +8 -0
- package/options/natr.d.ts +8 -0
- package/options/natr.src.d.ts +8 -0
- package/options/ohlc.d.ts +8 -0
- package/options/ohlc.src.d.ts +8 -0
- package/options/packedbubble.d.ts +8 -0
- package/options/packedbubble.src.d.ts +8 -0
- package/options/pictorial.d.ts +8 -0
- package/options/pictorial.src.d.ts +8 -0
- package/options/pointandfigure.d.ts +8 -0
- package/options/pointandfigure.src.d.ts +8 -0
- package/options/polygon.d.ts +9 -0
- package/options/polygon.src.d.ts +9 -0
- package/options/ppo.d.ts +8 -0
- package/options/ppo.src.d.ts +8 -0
- package/options/psar.d.ts +8 -0
- package/options/psar.src.d.ts +8 -0
- package/options/pyramid.d.ts +8 -0
- package/options/pyramid.src.d.ts +8 -0
- package/options/renko.d.ts +8 -0
- package/options/renko.src.d.ts +8 -0
- package/options/roc.d.ts +8 -0
- package/options/roc.src.d.ts +8 -0
- package/options/sankey.d.ts +8 -0
- package/options/sankey.src.d.ts +8 -0
- package/options/scatter.d.ts +9 -0
- package/options/scatter.src.d.ts +9 -0
- package/options/series.d.ts +9 -0
- package/options/series.src.d.ts +9 -0
- package/options/sma.d.ts +8 -0
- package/options/sma.src.d.ts +8 -0
- package/options/solidgauge.d.ts +14 -0
- package/options/solidgauge.src.d.ts +14 -0
- package/options/spline.d.ts +9 -0
- package/options/spline.src.d.ts +9 -0
- package/options/stochastic.d.ts +8 -0
- package/options/stochastic.src.d.ts +8 -0
- package/options/tema.d.ts +8 -0
- package/options/tema.src.d.ts +8 -0
- package/options/tiledwebmap.d.ts +8 -0
- package/options/tiledwebmap.src.d.ts +8 -0
- package/options/timeline.d.ts +8 -0
- package/options/timeline.src.d.ts +8 -0
- package/options/treegraph.d.ts +8 -0
- package/options/treegraph.src.d.ts +8 -0
- package/options/trix.d.ts +8 -0
- package/options/trix.src.d.ts +8 -0
- package/options/variablepie.d.ts +8 -0
- package/options/variablepie.src.d.ts +8 -0
- package/options/variwide.d.ts +8 -0
- package/options/variwide.src.d.ts +8 -0
- package/options/vbp.d.ts +8 -0
- package/options/vbp.src.d.ts +8 -0
- package/options/vector.d.ts +9 -0
- package/options/vector.src.d.ts +9 -0
- package/options/venn.d.ts +8 -0
- package/options/venn.src.d.ts +8 -0
- package/options/vwap.d.ts +8 -0
- package/options/vwap.src.d.ts +8 -0
- package/options/windbarb.d.ts +9 -0
- package/options/windbarb.src.d.ts +9 -0
- package/options/wma.d.ts +8 -0
- package/options/wma.src.d.ts +8 -0
- package/options/wordcloud.d.ts +8 -0
- package/options/wordcloud.src.d.ts +8 -0
- package/options/zigzag.d.ts +8 -0
- package/options/zigzag.src.d.ts +8 -0
- package/package.json +1 -1
- package/standalone-navigator.js +11 -2
- package/standalone-navigator.src.js +312 -206
- package/themes/adaptive.d.ts +18 -0
- package/themes/adaptive.js +130 -0
- package/themes/adaptive.src.d.ts +18 -0
- package/themes/adaptive.src.js +1122 -0
- package/themes/avocado.d.ts +1 -9
- package/themes/avocado.js +9 -1
- package/themes/avocado.src.d.ts +1 -9
- package/themes/avocado.src.js +1 -1
- package/themes/brand-dark.d.ts +1 -9
- package/themes/brand-dark.js +9 -1
- package/themes/brand-dark.src.d.ts +1 -9
- package/themes/brand-dark.src.js +1 -1
- package/themes/brand-light.d.ts +1 -9
- package/themes/brand-light.js +9 -1
- package/themes/brand-light.src.d.ts +1 -9
- package/themes/brand-light.src.js +1 -1
- package/themes/dark-blue.d.ts +1 -9
- package/themes/dark-blue.js +9 -1
- package/themes/dark-blue.src.d.ts +1 -9
- package/themes/dark-blue.src.js +1 -1
- package/themes/dark-green.d.ts +1 -9
- package/themes/dark-green.js +9 -1
- package/themes/dark-green.src.d.ts +1 -9
- package/themes/dark-green.src.js +1 -1
- package/themes/dark-unica.d.ts +1 -9
- package/themes/dark-unica.js +9 -1
- package/themes/dark-unica.src.d.ts +1 -9
- package/themes/dark-unica.src.js +1 -1
- package/themes/gray.d.ts +1 -9
- package/themes/gray.js +9 -1
- package/themes/gray.src.d.ts +1 -9
- package/themes/gray.src.js +1 -1
- package/themes/grid-light.d.ts +1 -9
- package/themes/grid-light.js +9 -1
- package/themes/grid-light.src.d.ts +1 -9
- package/themes/grid-light.src.js +1 -1
- package/themes/grid.d.ts +1 -9
- package/themes/grid.js +9 -1
- package/themes/grid.src.d.ts +1 -9
- package/themes/grid.src.js +1 -1
- package/themes/high-contrast-dark.d.ts +1 -9
- package/themes/high-contrast-dark.js +9 -1
- package/themes/high-contrast-dark.src.d.ts +1 -9
- package/themes/high-contrast-dark.src.js +1 -1
- package/themes/high-contrast-light.d.ts +1 -9
- package/themes/high-contrast-light.js +9 -1
- package/themes/high-contrast-light.src.d.ts +1 -9
- package/themes/high-contrast-light.src.js +1 -1
- package/themes/sand-signika.d.ts +1 -9
- package/themes/sand-signika.js +9 -1
- package/themes/sand-signika.src.d.ts +1 -9
- package/themes/sand-signika.src.js +1 -1
- package/themes/skies.d.ts +1 -9
- package/themes/skies.js +9 -1
- package/themes/skies.src.d.ts +1 -9
- package/themes/skies.src.js +1 -1
- package/themes/sunset.d.ts +1 -9
- package/themes/sunset.js +9 -1
- package/themes/sunset.src.d.ts +1 -9
- package/themes/sunset.src.js +1 -1
|
@@ -14,69 +14,347 @@ import AST from '../../Core/Renderer/HTML/AST.js';
|
|
|
14
14
|
import Chart from '../../Core/Chart/Chart.js';
|
|
15
15
|
import ChartNavigationComposition from '../../Core/Chart/ChartNavigationComposition.js';
|
|
16
16
|
import D from '../../Core/Defaults.js';
|
|
17
|
-
const { defaultOptions } = D;
|
|
17
|
+
const { defaultOptions, setOptions } = D;
|
|
18
|
+
import DownloadURL from '../DownloadURL.js';
|
|
19
|
+
const { downloadURL, getScript } = DownloadURL;
|
|
18
20
|
import ExportingDefaults from './ExportingDefaults.js';
|
|
19
21
|
import ExportingSymbols from './ExportingSymbols.js';
|
|
20
22
|
import Fullscreen from './Fullscreen.js';
|
|
21
23
|
import G from '../../Core/Globals.js';
|
|
22
|
-
const { doc, SVG_NS, win } = G;
|
|
24
|
+
const { composed, doc, isFirefox, isMS, isSafari, SVG_NS, win } = G;
|
|
23
25
|
import HU from '../../Core/HttpUtilities.js';
|
|
24
26
|
import U from '../../Core/Utilities.js';
|
|
25
|
-
const { addEvent,
|
|
27
|
+
const { addEvent, clearTimeout, createElement, css, discardElement, error, extend, find, fireEvent, isObject, merge, objectEach, pick, pushUnique, removeEvent, splat, uniqueKey } = U;
|
|
28
|
+
AST.allowedAttributes.push('data-z-index', 'fill-opacity', 'filter', 'preserveAspectRatio', 'rx', 'ry', 'stroke-dasharray', 'stroke-linejoin', 'stroke-opacity', 'text-anchor', 'transform', 'transform-origin', 'version', 'viewBox', 'visibility', 'xmlns', 'xmlns:xlink');
|
|
29
|
+
AST.allowedTags.push('desc', 'clippath', 'fedropshadow', 'femorphology', 'g', 'image');
|
|
26
30
|
/* *
|
|
27
31
|
*
|
|
28
|
-
*
|
|
32
|
+
* Constants
|
|
29
33
|
*
|
|
30
34
|
* */
|
|
31
|
-
|
|
32
|
-
|
|
35
|
+
export const domurl = win.URL || win.webkitURL || win;
|
|
36
|
+
/* *
|
|
37
|
+
*
|
|
38
|
+
* Class
|
|
39
|
+
*
|
|
40
|
+
* */
|
|
41
|
+
/**
|
|
42
|
+
* The Exporting class provides methods for exporting charts to images. If the
|
|
43
|
+
* exporting module is loaded, this class is instantiated on the chart and
|
|
44
|
+
* available through the `chart.exporting` property. Read more about the
|
|
45
|
+
* [exporting module](https://www.highcharts.com/docs/export-module-overview).
|
|
46
|
+
*
|
|
47
|
+
* @class
|
|
48
|
+
* @name Highcharts.Exporting
|
|
49
|
+
*
|
|
50
|
+
* @param {Highcharts.Chart} chart
|
|
51
|
+
* The chart instance.
|
|
52
|
+
*
|
|
53
|
+
*/
|
|
54
|
+
class Exporting {
|
|
33
55
|
/* *
|
|
34
56
|
*
|
|
35
|
-
*
|
|
57
|
+
* Constructor
|
|
36
58
|
*
|
|
37
59
|
* */
|
|
60
|
+
constructor(chart, options) {
|
|
61
|
+
this.options = {};
|
|
62
|
+
this.chart = chart;
|
|
63
|
+
this.options = options;
|
|
64
|
+
this.btnCount = 0;
|
|
65
|
+
this.buttonOffset = 0;
|
|
66
|
+
this.divElements = [];
|
|
67
|
+
this.svgElements = [];
|
|
68
|
+
}
|
|
38
69
|
/* *
|
|
39
70
|
*
|
|
40
|
-
*
|
|
71
|
+
* Static Functions
|
|
41
72
|
*
|
|
42
73
|
* */
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
/-/, // In Firefox, both hyphened and camelCased names are listed
|
|
46
|
-
/^(clipPath|cssText|d|height|width)$/, // Full words
|
|
47
|
-
/^font$/, // More specific props are set
|
|
48
|
-
/[lL]ogical(Width|Height)$/,
|
|
49
|
-
/^parentRule$/,
|
|
50
|
-
/^(cssRules|ownerRules)$/, // #19516 read-only properties
|
|
51
|
-
/perspective/,
|
|
52
|
-
/TapHighlightColor/,
|
|
53
|
-
/^transition/,
|
|
54
|
-
/^length$/, // #7700
|
|
55
|
-
/^\d+$/ // #17538
|
|
56
|
-
];
|
|
57
|
-
// These ones are translated to attributes rather than styles
|
|
58
|
-
const inlineToAttributes = [
|
|
59
|
-
'fill',
|
|
60
|
-
'stroke',
|
|
61
|
-
'strokeLinecap',
|
|
62
|
-
'strokeLinejoin',
|
|
63
|
-
'strokeWidth',
|
|
64
|
-
'textAnchor',
|
|
65
|
-
'x',
|
|
66
|
-
'y'
|
|
67
|
-
];
|
|
68
|
-
Exporting.inlineAllowlist = [];
|
|
69
|
-
const unstyledElements = [
|
|
70
|
-
'clipPath',
|
|
71
|
-
'defs',
|
|
72
|
-
'desc'
|
|
73
|
-
];
|
|
74
|
-
/* *
|
|
74
|
+
/**
|
|
75
|
+
* Make hyphenated property names out of camelCase.
|
|
75
76
|
*
|
|
76
|
-
*
|
|
77
|
+
* @private
|
|
78
|
+
* @static
|
|
79
|
+
* @function Highcharts.Exporting#hyphenate
|
|
77
80
|
*
|
|
78
|
-
*
|
|
79
|
-
|
|
81
|
+
* @param {string} property
|
|
82
|
+
* Property name in camelCase.
|
|
83
|
+
*
|
|
84
|
+
* @return {string}
|
|
85
|
+
* Hyphenated property name.
|
|
86
|
+
*
|
|
87
|
+
* @requires modules/exporting
|
|
88
|
+
*/
|
|
89
|
+
static hyphenate(property) {
|
|
90
|
+
return property.replace(/[A-Z]/g, function (match) {
|
|
91
|
+
return '-' + match.toLowerCase();
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Get data:URL from image URL.
|
|
96
|
+
*
|
|
97
|
+
* @private
|
|
98
|
+
* @static
|
|
99
|
+
* @async
|
|
100
|
+
* @function Highcharts.Exporting#imageToDataURL
|
|
101
|
+
*
|
|
102
|
+
* @param {string} imageURL
|
|
103
|
+
* The address or URL of the image.
|
|
104
|
+
* @param {number} scale
|
|
105
|
+
* The scale of the image.
|
|
106
|
+
* @param {string} imageType
|
|
107
|
+
* The export type of the image.
|
|
108
|
+
*
|
|
109
|
+
* @requires modules/exporting
|
|
110
|
+
*/
|
|
111
|
+
static async imageToDataURL(imageURL, scale, imageType) {
|
|
112
|
+
// First, wait for the image to be loaded
|
|
113
|
+
const img = await Exporting.loadImage(imageURL), canvas = doc.createElement('canvas'), ctx = canvas?.getContext('2d');
|
|
114
|
+
if (!ctx) {
|
|
115
|
+
throw new Error('No canvas found!');
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
canvas.height = img.height * scale;
|
|
119
|
+
canvas.width = img.width * scale;
|
|
120
|
+
ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
|
|
121
|
+
// Now we try to get the contents of the canvas
|
|
122
|
+
return canvas.toDataURL(imageType);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
static async fetchCSS(href) {
|
|
126
|
+
const content = await fetch(href)
|
|
127
|
+
.then((res) => res.text());
|
|
128
|
+
const newSheet = new CSSStyleSheet();
|
|
129
|
+
newSheet.replaceSync(content);
|
|
130
|
+
return newSheet;
|
|
131
|
+
}
|
|
132
|
+
static async handleStyleSheet(sheet, resultArray) {
|
|
133
|
+
try {
|
|
134
|
+
for (const rule of Array.from(sheet.cssRules)) {
|
|
135
|
+
if (rule instanceof CSSImportRule) {
|
|
136
|
+
const sheet = await Exporting.fetchCSS(rule.href);
|
|
137
|
+
await Exporting.handleStyleSheet(sheet, resultArray);
|
|
138
|
+
}
|
|
139
|
+
if (rule instanceof CSSFontFaceRule) {
|
|
140
|
+
let cssText = rule.cssText;
|
|
141
|
+
if (sheet.href) {
|
|
142
|
+
const baseUrl = sheet.href, regexp = /url\(\s*(['"]?)(?![a-z]+:|\/\/)([^'")]+?)\1\s*\)/gi;
|
|
143
|
+
// Replace relative URLs
|
|
144
|
+
cssText = cssText.replace(regexp, (_, quote, relPath) => {
|
|
145
|
+
const absolutePath = new URL(relPath, baseUrl).href;
|
|
146
|
+
return `url(${quote}${absolutePath}${quote})`;
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
resultArray.push(cssText);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
catch {
|
|
154
|
+
if (sheet.href) {
|
|
155
|
+
const newSheet = await Exporting.fetchCSS(sheet.href);
|
|
156
|
+
await Exporting.handleStyleSheet(newSheet, resultArray);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
static async fetchStyleSheets() {
|
|
161
|
+
const cssTexts = [];
|
|
162
|
+
for (const sheet of Array.from(doc.styleSheets)) {
|
|
163
|
+
await Exporting.handleStyleSheet(sheet, cssTexts);
|
|
164
|
+
}
|
|
165
|
+
return cssTexts;
|
|
166
|
+
}
|
|
167
|
+
static async inlineFonts(svg) {
|
|
168
|
+
const cssTexts = await Exporting.fetchStyleSheets(), urlRegex = /url\(([^)]+)\)/g, urls = [];
|
|
169
|
+
let cssText = cssTexts.join('\n'), match;
|
|
170
|
+
while ((match = urlRegex.exec(cssText))) {
|
|
171
|
+
const m = match[1].replace(/['"]/g, '');
|
|
172
|
+
if (!urls.includes(m)) {
|
|
173
|
+
urls.push(m);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
const arrayBufferToBase64 = (buffer) => {
|
|
177
|
+
let binary = '';
|
|
178
|
+
const bytes = new Uint8Array(buffer);
|
|
179
|
+
for (let i = 0; i < bytes.byteLength; i++) {
|
|
180
|
+
binary += String.fromCharCode(bytes[i]);
|
|
181
|
+
}
|
|
182
|
+
return btoa(binary);
|
|
183
|
+
};
|
|
184
|
+
const replacements = {};
|
|
185
|
+
for (const url of urls) {
|
|
186
|
+
try {
|
|
187
|
+
const res = await fetch(url), contentType = res.headers.get('Content-Type') || '', b64 = arrayBufferToBase64(await res.arrayBuffer());
|
|
188
|
+
replacements[url] = `data:${contentType};base64,${b64}`;
|
|
189
|
+
}
|
|
190
|
+
catch {
|
|
191
|
+
// eslint-disable-next-line
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
cssText = cssText.replace(urlRegex, (_, url) => {
|
|
195
|
+
const strippedUrl = url.replace(/['"]/g, '');
|
|
196
|
+
return `url(${replacements[strippedUrl] || strippedUrl})`;
|
|
197
|
+
});
|
|
198
|
+
const styleEl = document.createElementNS('http://www.w3.org/2000/svg', 'style');
|
|
199
|
+
styleEl.textContent = cssText;
|
|
200
|
+
// Needs to be appended to pass sanitization
|
|
201
|
+
svg.append(styleEl);
|
|
202
|
+
return svg;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Loads an image from the provided URL.
|
|
206
|
+
*
|
|
207
|
+
* @private
|
|
208
|
+
* @static
|
|
209
|
+
* @function Highcharts.Exporting#loadImage
|
|
210
|
+
*
|
|
211
|
+
* @param {string} imageURL
|
|
212
|
+
* The address or URL of the image.
|
|
213
|
+
*
|
|
214
|
+
* @return {Promise<HTMLImageElement>}
|
|
215
|
+
* Returns a Promise that resolves with the loaded HTMLImageElement.
|
|
216
|
+
*
|
|
217
|
+
* @requires modules/exporting
|
|
218
|
+
*/
|
|
219
|
+
static loadImage(imageURL) {
|
|
220
|
+
return new Promise((resolve, reject) => {
|
|
221
|
+
// Create an image
|
|
222
|
+
const image = new win.Image();
|
|
223
|
+
// Must be set prior to loading image source
|
|
224
|
+
image.crossOrigin = 'Anonymous';
|
|
225
|
+
// Return the image in case of success
|
|
226
|
+
image.onload = () => {
|
|
227
|
+
// IE bug where image is not always ready despite load event
|
|
228
|
+
setTimeout(() => {
|
|
229
|
+
resolve(image);
|
|
230
|
+
}, Exporting.loadEventDeferDelay);
|
|
231
|
+
};
|
|
232
|
+
// Reject in case of fail
|
|
233
|
+
image.onerror = (error) => {
|
|
234
|
+
// eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
|
|
235
|
+
reject(error);
|
|
236
|
+
};
|
|
237
|
+
// Provide the image URL
|
|
238
|
+
image.src = imageURL;
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Prepares and returns the image export options with default values where
|
|
243
|
+
* necessary.
|
|
244
|
+
*
|
|
245
|
+
* @private
|
|
246
|
+
* @static
|
|
247
|
+
* @function Highcharts.Exporting#prepareImageOptions
|
|
248
|
+
*
|
|
249
|
+
* @param {Highcharts.ExportingOptions} exportingOptions
|
|
250
|
+
* The exporting options.
|
|
251
|
+
*
|
|
252
|
+
* @return {Exporting.ImageOptions}
|
|
253
|
+
* The finalized image export options with ensured values.
|
|
254
|
+
*
|
|
255
|
+
* @requires modules/exporting
|
|
256
|
+
*/
|
|
257
|
+
static prepareImageOptions(exportingOptions) {
|
|
258
|
+
const type = exportingOptions?.type || 'image/png', libURL = (exportingOptions?.libURL ||
|
|
259
|
+
defaultOptions.exporting?.libURL);
|
|
260
|
+
return {
|
|
261
|
+
type,
|
|
262
|
+
filename: ((exportingOptions?.filename || 'chart') +
|
|
263
|
+
'.' +
|
|
264
|
+
(type === 'image/svg+xml' ? 'svg' : type.split('/')[1])),
|
|
265
|
+
scale: exportingOptions?.scale || 1,
|
|
266
|
+
// Allow libURL to end with or without fordward slash
|
|
267
|
+
libURL: libURL?.slice(-1) !== '/' ? libURL + '/' : libURL
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* A collection of fixes on the produced SVG to account for expand
|
|
272
|
+
* properties and browser bugs. Returns a cleaned SVG.
|
|
273
|
+
*
|
|
274
|
+
* @private
|
|
275
|
+
* @static
|
|
276
|
+
* @function Highcharts.Exporting#sanitizeSVG
|
|
277
|
+
*
|
|
278
|
+
* @param {string} svg
|
|
279
|
+
* SVG code to sanitize.
|
|
280
|
+
* @param {Highcharts.Options} options
|
|
281
|
+
* Chart options to apply.
|
|
282
|
+
*
|
|
283
|
+
* @return {string}
|
|
284
|
+
* Sanitized SVG code.
|
|
285
|
+
*
|
|
286
|
+
* @requires modules/exporting
|
|
287
|
+
*/
|
|
288
|
+
static sanitizeSVG(svg, options) {
|
|
289
|
+
const split = svg.indexOf('</svg>') + 6, useForeignObject = svg.indexOf('<foreignObject') > -1;
|
|
290
|
+
let html = svg.substr(split);
|
|
291
|
+
// Remove any HTML added to the container after the SVG (#894, #9087)
|
|
292
|
+
svg = svg.substr(0, split);
|
|
293
|
+
if (useForeignObject) {
|
|
294
|
+
// Some tags needs to be closed in xhtml (#13726)
|
|
295
|
+
svg = svg.replace(/(<(?:img|br).*?(?=\>))>/g, '$1 />');
|
|
296
|
+
// Move HTML into a foreignObject
|
|
297
|
+
}
|
|
298
|
+
else if (html && options?.exporting?.allowHTML) {
|
|
299
|
+
html = '<foreignObject x="0" y="0" ' +
|
|
300
|
+
'width="' + options.chart.width + '" ' +
|
|
301
|
+
'height="' + options.chart.height + '">' +
|
|
302
|
+
'<body xmlns="http://www.w3.org/1999/xhtml">' +
|
|
303
|
+
// Some tags needs to be closed in xhtml (#13726)
|
|
304
|
+
html.replace(/(<(?:img|br).*?(?=\>))>/g, '$1 />') +
|
|
305
|
+
'</body>' +
|
|
306
|
+
'</foreignObject>';
|
|
307
|
+
svg = svg.replace('</svg>', html + '</svg>');
|
|
308
|
+
}
|
|
309
|
+
svg = svg
|
|
310
|
+
.replace(/zIndex="[^"]+"/g, '')
|
|
311
|
+
.replace(/symbolName="[^"]+"/g, '')
|
|
312
|
+
.replace(/jQuery\d+="[^"]+"/g, '')
|
|
313
|
+
.replace(/url\(("|")(.*?)("|")\;?\)/g, 'url($2)')
|
|
314
|
+
.replace(/url\([^#]+#/g, 'url(#')
|
|
315
|
+
.replace(/<svg /, '<svg xmlns:xlink="http://www.w3.org/1999/xlink" ')
|
|
316
|
+
.replace(/ (NS\d+\:)?href=/g, ' xlink:href=') // #3567
|
|
317
|
+
.replace(/\n+/g, ' ')
|
|
318
|
+
// Replace HTML entities, issue #347
|
|
319
|
+
.replace(/ /g, '\u00A0') // No-break space
|
|
320
|
+
.replace(/­/g, '\u00AD'); // Soft hyphen
|
|
321
|
+
return svg;
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Get blob URL from SVG code. Falls back to normal data URI.
|
|
325
|
+
*
|
|
326
|
+
* @private
|
|
327
|
+
* @static
|
|
328
|
+
* @function Highcharts.Exporting#svgToDataURL
|
|
329
|
+
*
|
|
330
|
+
* @param {string} svg
|
|
331
|
+
* SVG to get the URL from.
|
|
332
|
+
*
|
|
333
|
+
* @return {string}
|
|
334
|
+
* The data URL.
|
|
335
|
+
*
|
|
336
|
+
* @requires modules/exporting
|
|
337
|
+
*/
|
|
338
|
+
static svgToDataURL(svg) {
|
|
339
|
+
// Webkit and not chrome
|
|
340
|
+
const userAgent = win.navigator.userAgent;
|
|
341
|
+
const webKit = (userAgent.indexOf('WebKit') > -1 &&
|
|
342
|
+
userAgent.indexOf('Chrome') < 0);
|
|
343
|
+
try {
|
|
344
|
+
// Safari requires data URI since it doesn't allow navigation to
|
|
345
|
+
// blob URLs. ForeignObjects also don't work well in Blobs in Chrome
|
|
346
|
+
// (#14780).
|
|
347
|
+
if (!webKit && svg.indexOf('<foreignObject') === -1) {
|
|
348
|
+
return domurl.createObjectURL(new win.Blob([svg], {
|
|
349
|
+
type: 'image/svg+xml;charset-utf-16'
|
|
350
|
+
}));
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
catch {
|
|
354
|
+
// Ignore
|
|
355
|
+
}
|
|
356
|
+
return 'data:image/svg+xml;charset=UTF-8,' + encodeURIComponent(svg);
|
|
357
|
+
}
|
|
80
358
|
/* *
|
|
81
359
|
*
|
|
82
360
|
* Functions
|
|
@@ -86,26 +364,21 @@ var Exporting;
|
|
|
86
364
|
* Add the export button to the chart, with options.
|
|
87
365
|
*
|
|
88
366
|
* @private
|
|
89
|
-
* @function Highcharts.
|
|
90
|
-
*
|
|
367
|
+
* @function Highcharts.Exporting#addButton
|
|
368
|
+
*
|
|
369
|
+
* @param {Highcharts.ExportingButtonOptions} options
|
|
370
|
+
* The exporting button options object.
|
|
371
|
+
*
|
|
91
372
|
* @requires modules/exporting
|
|
92
373
|
*/
|
|
93
|
-
|
|
94
|
-
const
|
|
374
|
+
addButton(options) {
|
|
375
|
+
const exporting = this, chart = exporting.chart, renderer = chart.renderer, btnOptions = merge(chart.options.navigation?.buttonOptions, options), onclick = btnOptions.onclick, menuItems = btnOptions.menuItems, symbolSize = btnOptions.symbolSize || 12;
|
|
95
376
|
let symbol;
|
|
96
|
-
if (!chart.btnCount) {
|
|
97
|
-
chart.btnCount = 0;
|
|
98
|
-
}
|
|
99
|
-
// Keeps references to the button elements
|
|
100
|
-
if (!chart.exportDivElements) {
|
|
101
|
-
chart.exportDivElements = [];
|
|
102
|
-
chart.exportSVGElements = [];
|
|
103
|
-
}
|
|
104
377
|
if (btnOptions.enabled === false || !btnOptions.theme) {
|
|
105
378
|
return;
|
|
106
379
|
}
|
|
107
380
|
const theme = chart.styledMode ? {} : btnOptions.theme;
|
|
108
|
-
let callback;
|
|
381
|
+
let callback = (() => { });
|
|
109
382
|
if (onclick) {
|
|
110
383
|
callback = function (e) {
|
|
111
384
|
if (e) {
|
|
@@ -120,7 +393,7 @@ var Exporting;
|
|
|
120
393
|
if (e) {
|
|
121
394
|
e.stopPropagation();
|
|
122
395
|
}
|
|
123
|
-
|
|
396
|
+
exporting.contextMenu(button.menuClassName, menuItems, button.translateX || 0, button.translateY || 0, button.width || 0, button.height || 0, button);
|
|
124
397
|
button.setState(2);
|
|
125
398
|
};
|
|
126
399
|
}
|
|
@@ -135,18 +408,19 @@ var Exporting;
|
|
|
135
408
|
});
|
|
136
409
|
}
|
|
137
410
|
const button = renderer
|
|
138
|
-
.button(btnOptions.text, 0, 0, callback, theme, void 0, void 0, void 0, void 0, btnOptions.useHTML)
|
|
139
|
-
.addClass(options.className)
|
|
411
|
+
.button(btnOptions.text || '', 0, 0, callback, theme, void 0, void 0, void 0, void 0, btnOptions.useHTML)
|
|
412
|
+
.addClass(options.className || '')
|
|
140
413
|
.attr({
|
|
141
|
-
title: pick(chart.options.lang[btnOptions._titleKey ||
|
|
414
|
+
title: pick(chart.options.lang[(btnOptions._titleKey ||
|
|
415
|
+
btnOptions.titleKey)], '')
|
|
142
416
|
});
|
|
143
417
|
button.menuClassName = (options.menuClassName ||
|
|
144
|
-
'highcharts-menu-' +
|
|
418
|
+
'highcharts-menu-' + exporting.btnCount++);
|
|
145
419
|
if (btnOptions.symbol) {
|
|
146
420
|
symbol = renderer
|
|
147
|
-
.symbol(btnOptions.symbol, Math.round((btnOptions.symbolX || 0) - (symbolSize / 2)), Math.round((btnOptions.symbolY || 0) - (symbolSize / 2)), symbolSize, symbolSize
|
|
421
|
+
.symbol(btnOptions.symbol, Math.round((btnOptions.symbolX || 0) - (symbolSize / 2)), Math.round((btnOptions.symbolY || 0) - (symbolSize / 2)), symbolSize, symbolSize,
|
|
148
422
|
// If symbol is an image, scale it (#7957)
|
|
149
|
-
|
|
423
|
+
{
|
|
150
424
|
width: symbolSize,
|
|
151
425
|
height: symbolSize
|
|
152
426
|
})
|
|
@@ -164,73 +438,69 @@ var Exporting;
|
|
|
164
438
|
}
|
|
165
439
|
}
|
|
166
440
|
button
|
|
167
|
-
.add(
|
|
441
|
+
.add(exporting.group)
|
|
168
442
|
.align(extend(btnOptions, {
|
|
169
443
|
width: button.width,
|
|
170
|
-
x: pick(btnOptions.x,
|
|
444
|
+
x: pick(btnOptions.x, exporting.buttonOffset) // #1654
|
|
171
445
|
}), true, 'spacingBox');
|
|
172
|
-
|
|
446
|
+
exporting.buttonOffset += (((button.width || 0) + (btnOptions.buttonSpacing || 0)) *
|
|
173
447
|
(btnOptions.align === 'right' ? -1 : 1));
|
|
174
|
-
|
|
448
|
+
exporting.svgElements.push(button, symbol);
|
|
175
449
|
}
|
|
176
450
|
/**
|
|
177
451
|
* Clean up after printing a chart.
|
|
178
452
|
*
|
|
179
|
-
* @function Highcharts#afterPrint
|
|
180
|
-
*
|
|
181
453
|
* @private
|
|
182
|
-
*
|
|
183
|
-
* @param {Highcharts.Chart} chart
|
|
184
|
-
* Chart that was (or suppose to be) printed
|
|
454
|
+
* @function Highcharts.Exporting#afterPrint
|
|
185
455
|
*
|
|
186
456
|
* @emits Highcharts.Chart#event:afterPrint
|
|
457
|
+
*
|
|
458
|
+
* @requires modules/exporting
|
|
187
459
|
*/
|
|
188
|
-
|
|
189
|
-
const chart = this;
|
|
190
|
-
if (!
|
|
460
|
+
afterPrint() {
|
|
461
|
+
const chart = this.chart;
|
|
462
|
+
if (!this.printReverseInfo) {
|
|
191
463
|
return void 0;
|
|
192
464
|
}
|
|
193
|
-
const { childNodes, origDisplay, resetParams } =
|
|
465
|
+
const { childNodes, origDisplay, resetParams } = this.printReverseInfo;
|
|
194
466
|
// Put the chart back in
|
|
195
|
-
|
|
467
|
+
this.moveContainers(chart.renderTo);
|
|
196
468
|
// Restore all body content
|
|
197
469
|
[].forEach.call(childNodes, function (node, i) {
|
|
198
470
|
if (node.nodeType === 1) {
|
|
199
471
|
node.style.display = (origDisplay[i] || '');
|
|
200
472
|
}
|
|
201
473
|
});
|
|
202
|
-
|
|
474
|
+
this.isPrinting = false;
|
|
203
475
|
// Reset printMaxWidth
|
|
204
476
|
if (resetParams) {
|
|
205
477
|
chart.setSize.apply(chart, resetParams);
|
|
206
478
|
}
|
|
207
|
-
delete
|
|
208
|
-
printingChart = void 0;
|
|
479
|
+
delete this.printReverseInfo;
|
|
480
|
+
Exporting.printingChart = void 0;
|
|
209
481
|
fireEvent(chart, 'afterPrint');
|
|
210
482
|
}
|
|
211
483
|
/**
|
|
212
484
|
* Prepare chart and document before printing a chart.
|
|
213
485
|
*
|
|
214
|
-
* @function Highcharts#beforePrint
|
|
215
|
-
*
|
|
216
486
|
* @private
|
|
217
|
-
*
|
|
487
|
+
* @function Highcharts.Exporting#beforePrint
|
|
218
488
|
*
|
|
219
489
|
* @emits Highcharts.Chart#event:beforePrint
|
|
490
|
+
*
|
|
491
|
+
* @requires modules/exporting
|
|
220
492
|
*/
|
|
221
|
-
|
|
222
|
-
const chart = this, body = doc.body, printMaxWidth =
|
|
493
|
+
beforePrint() {
|
|
494
|
+
const chart = this.chart, body = doc.body, printMaxWidth = this.options.printMaxWidth, printReverseInfo = {
|
|
223
495
|
childNodes: body.childNodes,
|
|
224
496
|
origDisplay: [],
|
|
225
497
|
resetParams: void 0
|
|
226
498
|
};
|
|
227
|
-
|
|
499
|
+
this.isPrinting = true;
|
|
228
500
|
chart.pointer?.reset(void 0, 0);
|
|
229
501
|
fireEvent(chart, 'beforePrint');
|
|
230
502
|
// Handle printMaxWidth
|
|
231
|
-
|
|
232
|
-
chart.chartWidth > printMaxWidth;
|
|
233
|
-
if (handleMaxWidth) {
|
|
503
|
+
if (printMaxWidth && chart.chartWidth > printMaxWidth) {
|
|
234
504
|
printReverseInfo.resetParams = [
|
|
235
505
|
chart.options.chart.width,
|
|
236
506
|
void 0,
|
|
@@ -246,131 +516,45 @@ var Exporting;
|
|
|
246
516
|
}
|
|
247
517
|
});
|
|
248
518
|
// Pull out the chart
|
|
249
|
-
|
|
519
|
+
this.moveContainers(body);
|
|
250
520
|
// Storage details for undo action after printing
|
|
251
|
-
|
|
252
|
-
}
|
|
253
|
-
/**
|
|
254
|
-
* @private
|
|
255
|
-
*/
|
|
256
|
-
function chartCallback(chart) {
|
|
257
|
-
const composition = chart;
|
|
258
|
-
composition.renderExporting();
|
|
259
|
-
addEvent(chart, 'redraw', composition.renderExporting);
|
|
260
|
-
// Destroy the export elements at chart destroy
|
|
261
|
-
addEvent(chart, 'destroy', composition.destroyExport);
|
|
262
|
-
// Uncomment this to see a button directly below the chart, for quick
|
|
263
|
-
// testing of export
|
|
264
|
-
/*
|
|
265
|
-
let button, viewImage, viewSource;
|
|
266
|
-
if (!chart.renderer.forExport) {
|
|
267
|
-
viewImage = function () {
|
|
268
|
-
let div = doc.createElement('div');
|
|
269
|
-
div.innerHTML = chart.getSVGForExport();
|
|
270
|
-
chart.renderTo.parentNode.appendChild(div);
|
|
271
|
-
};
|
|
272
|
-
|
|
273
|
-
viewSource = function () {
|
|
274
|
-
let pre = doc.createElement('pre');
|
|
275
|
-
pre.innerHTML = chart.getSVGForExport()
|
|
276
|
-
.replace(/</g, '\n<')
|
|
277
|
-
.replace(/>/g, '>');
|
|
278
|
-
chart.renderTo.parentNode.appendChild(pre);
|
|
279
|
-
};
|
|
280
|
-
|
|
281
|
-
viewImage();
|
|
282
|
-
|
|
283
|
-
// View SVG Image
|
|
284
|
-
button = doc.createElement('button');
|
|
285
|
-
button.innerHTML = 'View SVG Image';
|
|
286
|
-
chart.renderTo.parentNode.appendChild(button);
|
|
287
|
-
button.onclick = viewImage;
|
|
288
|
-
|
|
289
|
-
// View SVG Source
|
|
290
|
-
button = doc.createElement('button');
|
|
291
|
-
button.innerHTML = 'View SVG Source';
|
|
292
|
-
chart.renderTo.parentNode.appendChild(button);
|
|
293
|
-
button.onclick = viewSource;
|
|
294
|
-
}
|
|
295
|
-
//*/
|
|
296
|
-
}
|
|
297
|
-
/**
|
|
298
|
-
* @private
|
|
299
|
-
*/
|
|
300
|
-
function compose(ChartClass, SVGRendererClass) {
|
|
301
|
-
ExportingSymbols.compose(SVGRendererClass);
|
|
302
|
-
Fullscreen.compose(ChartClass);
|
|
303
|
-
const chartProto = ChartClass.prototype;
|
|
304
|
-
if (!chartProto.exportChart) {
|
|
305
|
-
chartProto.afterPrint = afterPrint;
|
|
306
|
-
chartProto.exportChart = exportChart;
|
|
307
|
-
chartProto.inlineStyles = inlineStyles;
|
|
308
|
-
chartProto.print = print;
|
|
309
|
-
chartProto.sanitizeSVG = sanitizeSVG;
|
|
310
|
-
chartProto.getChartHTML = getChartHTML;
|
|
311
|
-
chartProto.getSVG = getSVG;
|
|
312
|
-
chartProto.getSVGForExport = getSVGForExport;
|
|
313
|
-
chartProto.getFilename = getFilename;
|
|
314
|
-
chartProto.moveContainers = moveContainers;
|
|
315
|
-
chartProto.beforePrint = beforePrint;
|
|
316
|
-
chartProto.contextMenu = contextMenu;
|
|
317
|
-
chartProto.addButton = addButton;
|
|
318
|
-
chartProto.destroyExport = destroyExport;
|
|
319
|
-
chartProto.renderExporting = renderExporting;
|
|
320
|
-
chartProto.resolveCSSVariables = resolveCSSVariables;
|
|
321
|
-
chartProto.callbacks.push(chartCallback);
|
|
322
|
-
addEvent(ChartClass, 'init', onChartInit);
|
|
323
|
-
addEvent(ChartClass, 'layOutTitle', onChartLayOutTitle);
|
|
324
|
-
if (G.isSafari) {
|
|
325
|
-
win.matchMedia('print').addListener(function (mqlEvent) {
|
|
326
|
-
if (!printingChart) {
|
|
327
|
-
return void 0;
|
|
328
|
-
}
|
|
329
|
-
if (mqlEvent.matches) {
|
|
330
|
-
printingChart.beforePrint();
|
|
331
|
-
}
|
|
332
|
-
else {
|
|
333
|
-
printingChart.afterPrint();
|
|
334
|
-
}
|
|
335
|
-
});
|
|
336
|
-
}
|
|
337
|
-
defaultOptions.exporting = merge(ExportingDefaults.exporting, defaultOptions.exporting);
|
|
338
|
-
defaultOptions.lang = merge(ExportingDefaults.lang, defaultOptions.lang);
|
|
339
|
-
// Buttons and menus are collected in a separate config option set
|
|
340
|
-
// called 'navigation'. This can be extended later to add control
|
|
341
|
-
// buttons like zoom and pan right click menus.
|
|
342
|
-
defaultOptions.navigation = merge(ExportingDefaults.navigation, defaultOptions.navigation);
|
|
343
|
-
}
|
|
521
|
+
this.printReverseInfo = printReverseInfo;
|
|
344
522
|
}
|
|
345
|
-
Exporting.compose = compose;
|
|
346
523
|
/**
|
|
347
524
|
* Display a popup menu for choosing the export type.
|
|
348
525
|
*
|
|
349
526
|
* @private
|
|
350
|
-
* @function Highcharts.
|
|
527
|
+
* @function Highcharts.Exporting#contextMenu
|
|
528
|
+
*
|
|
351
529
|
* @param {string} className
|
|
352
|
-
*
|
|
353
|
-
* @param {Array<string|Highcharts.ExportingMenuObject>} items
|
|
354
|
-
*
|
|
530
|
+
* An identifier for the menu.
|
|
531
|
+
* @param {Array<(string | Highcharts.ExportingMenuObject)>} items
|
|
532
|
+
* A collection with text and onclicks for the items.
|
|
355
533
|
* @param {number} x
|
|
356
|
-
*
|
|
534
|
+
* The x position of the opener button.
|
|
357
535
|
* @param {number} y
|
|
358
|
-
*
|
|
536
|
+
* The y position of the opener button.
|
|
359
537
|
* @param {number} width
|
|
360
|
-
*
|
|
538
|
+
* The width of the opener button.
|
|
361
539
|
* @param {number} height
|
|
362
|
-
*
|
|
540
|
+
* The height of the opener button.
|
|
541
|
+
* @param {SVGElement} button
|
|
542
|
+
* The SVG button element.
|
|
543
|
+
*
|
|
544
|
+
* @emits Highcharts.Chart#event:exportMenuHidden
|
|
545
|
+
* @emits Highcharts.Chart#event:exportMenuShown
|
|
546
|
+
*
|
|
363
547
|
* @requires modules/exporting
|
|
364
548
|
*/
|
|
365
|
-
|
|
366
|
-
const
|
|
549
|
+
contextMenu(className, items, x, y, width, height, button) {
|
|
550
|
+
const exporting = this, chart = exporting.chart, navOptions = chart.options.navigation, chartWidth = chart.chartWidth, chartHeight = chart.chartHeight, cacheName = 'cache-' + className,
|
|
367
551
|
// For mouse leave detection
|
|
368
552
|
menuPadding = Math.max(width, height);
|
|
369
553
|
let innerMenu, menu = chart[cacheName];
|
|
370
554
|
// Create the menu only the first time
|
|
371
555
|
if (!menu) {
|
|
372
556
|
// Create a HTML element above the SVG
|
|
373
|
-
|
|
557
|
+
exporting.contextMenuEl = chart[cacheName] = menu =
|
|
374
558
|
createElement('div', {
|
|
375
559
|
className: className
|
|
376
560
|
}, {
|
|
@@ -388,10 +572,10 @@ var Exporting;
|
|
|
388
572
|
// Presentational CSS
|
|
389
573
|
if (!chart.styledMode) {
|
|
390
574
|
css(innerMenu, extend({
|
|
391
|
-
MozBoxShadow: '3px 3px 10px #
|
|
392
|
-
WebkitBoxShadow: '3px 3px 10px #
|
|
393
|
-
boxShadow: '3px 3px 10px #
|
|
394
|
-
}, navOptions
|
|
575
|
+
MozBoxShadow: '3px 3px 10px #0008',
|
|
576
|
+
WebkitBoxShadow: '3px 3px 10px #0008',
|
|
577
|
+
boxShadow: '3px 3px 10px #0008'
|
|
578
|
+
}, navOptions?.menuStyle || {}));
|
|
395
579
|
}
|
|
396
580
|
// Hide on mouse out
|
|
397
581
|
menu.hideMenu = function () {
|
|
@@ -399,18 +583,20 @@ var Exporting;
|
|
|
399
583
|
if (button) {
|
|
400
584
|
button.setState(0);
|
|
401
585
|
}
|
|
402
|
-
chart.
|
|
586
|
+
if (chart.exporting) {
|
|
587
|
+
chart.exporting.openMenu = false;
|
|
588
|
+
}
|
|
403
589
|
// #10361, #9998
|
|
404
590
|
css(chart.renderTo, { overflow: 'hidden' });
|
|
405
591
|
css(chart.container, { overflow: 'hidden' });
|
|
406
|
-
|
|
592
|
+
clearTimeout(menu.hideTimer);
|
|
407
593
|
fireEvent(chart, 'exportMenuHidden');
|
|
408
594
|
};
|
|
409
595
|
// Hide the menu some time after mouse leave (#1357)
|
|
410
|
-
|
|
596
|
+
exporting.events?.push(addEvent(menu, 'mouseleave', function () {
|
|
411
597
|
menu.hideTimer = win.setTimeout(menu.hideMenu, 500);
|
|
412
598
|
}), addEvent(menu, 'mouseenter', function () {
|
|
413
|
-
|
|
599
|
+
clearTimeout(menu.hideTimer);
|
|
414
600
|
}),
|
|
415
601
|
// Hide it on clicking or touching outside the menu (#2258,
|
|
416
602
|
// #2335, #2407)
|
|
@@ -419,15 +605,16 @@ var Exporting;
|
|
|
419
605
|
menu.hideMenu();
|
|
420
606
|
}
|
|
421
607
|
}), addEvent(menu, 'click', function () {
|
|
422
|
-
if (chart.openMenu) {
|
|
608
|
+
if (chart.exporting?.openMenu) {
|
|
423
609
|
menu.hideMenu();
|
|
424
610
|
}
|
|
425
611
|
}));
|
|
426
612
|
// Create the items
|
|
427
613
|
items.forEach(function (item) {
|
|
428
614
|
if (typeof item === 'string') {
|
|
429
|
-
|
|
430
|
-
.menuItemDefinitions[item];
|
|
615
|
+
if (exporting.options.menuItemDefinitions?.[item]) {
|
|
616
|
+
item = exporting.options.menuItemDefinitions[item];
|
|
617
|
+
}
|
|
431
618
|
}
|
|
432
619
|
if (isObject(item, true)) {
|
|
433
620
|
let element;
|
|
@@ -438,7 +625,7 @@ var Exporting;
|
|
|
438
625
|
// When chart initialized with the table, wrong button
|
|
439
626
|
// text displayed, #14352.
|
|
440
627
|
if (item.textKey === 'viewData' &&
|
|
441
|
-
|
|
628
|
+
exporting.isDataTableVisible) {
|
|
442
629
|
item.textKey = 'hideData';
|
|
443
630
|
}
|
|
444
631
|
element = createElement('li', {
|
|
@@ -449,44 +636,45 @@ var Exporting;
|
|
|
449
636
|
}
|
|
450
637
|
menu.hideMenu();
|
|
451
638
|
if (typeof item !== 'string' && item.onclick) {
|
|
639
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
452
640
|
item.onclick.apply(chart, arguments);
|
|
453
641
|
}
|
|
454
642
|
}
|
|
455
643
|
}, void 0, innerMenu);
|
|
456
|
-
AST.setElementHTML(element, item.text ||
|
|
457
|
-
chart.options.lang[item.textKey]);
|
|
644
|
+
AST.setElementHTML(element, item.text || chart.options.lang[item.textKey]);
|
|
458
645
|
if (!chart.styledMode) {
|
|
459
646
|
element.onmouseover = function () {
|
|
460
|
-
css(this, navOptions
|
|
647
|
+
css(this, navOptions?.menuItemHoverStyle || {});
|
|
461
648
|
};
|
|
462
649
|
element.onmouseout = function () {
|
|
463
|
-
css(this, navOptions
|
|
650
|
+
css(this, navOptions?.menuItemStyle || {});
|
|
464
651
|
};
|
|
465
652
|
css(element, extend({
|
|
466
653
|
cursor: 'pointer'
|
|
467
|
-
}, navOptions
|
|
654
|
+
}, navOptions?.menuItemStyle || {}));
|
|
468
655
|
}
|
|
469
656
|
}
|
|
470
657
|
// Keep references to menu divs to be able to destroy them
|
|
471
|
-
|
|
658
|
+
exporting.divElements.push(element);
|
|
472
659
|
}
|
|
473
660
|
});
|
|
474
661
|
// Keep references to menu and innerMenu div to be able to destroy
|
|
475
662
|
// them
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
663
|
+
exporting.divElements.push(innerMenu, menu);
|
|
664
|
+
exporting.menuHeight = menu.offsetHeight;
|
|
665
|
+
exporting.menuWidth = menu.offsetWidth;
|
|
479
666
|
}
|
|
480
667
|
const menuStyle = { display: 'block' };
|
|
481
668
|
// If outside right, right align it
|
|
482
|
-
if (x + (
|
|
669
|
+
if (x + (exporting.menuWidth || 0) > chartWidth) {
|
|
483
670
|
menuStyle.right = (chartWidth - x - width - menuPadding) + 'px';
|
|
484
671
|
}
|
|
485
672
|
else {
|
|
486
673
|
menuStyle.left = (x - menuPadding) + 'px';
|
|
487
674
|
}
|
|
488
675
|
// If outside bottom, bottom align it
|
|
489
|
-
if (y + height + (
|
|
676
|
+
if (y + height + (exporting.menuHeight || 0) >
|
|
677
|
+
chartHeight &&
|
|
490
678
|
button.alignOptions?.verticalAlign !== 'top') {
|
|
491
679
|
menuStyle.bottom = (chartHeight - y - menuPadding) + 'px';
|
|
492
680
|
}
|
|
@@ -497,106 +685,272 @@ var Exporting;
|
|
|
497
685
|
// #10361, #9998
|
|
498
686
|
css(chart.renderTo, { overflow: '' });
|
|
499
687
|
css(chart.container, { overflow: '' });
|
|
500
|
-
chart.
|
|
688
|
+
if (chart.exporting) {
|
|
689
|
+
chart.exporting.openMenu = true;
|
|
690
|
+
}
|
|
501
691
|
fireEvent(chart, 'exportMenuShown');
|
|
502
692
|
}
|
|
503
693
|
/**
|
|
504
694
|
* Destroy the export buttons.
|
|
695
|
+
*
|
|
505
696
|
* @private
|
|
506
|
-
* @function Highcharts.
|
|
697
|
+
* @function Highcharts.Exporting#destroy
|
|
698
|
+
*
|
|
507
699
|
* @param {global.Event} [e]
|
|
700
|
+
* Event object.
|
|
701
|
+
*
|
|
508
702
|
* @requires modules/exporting
|
|
509
703
|
*/
|
|
510
|
-
|
|
511
|
-
const chart = e ? e.target :
|
|
704
|
+
destroy(e) {
|
|
705
|
+
const exporting = this, chart = e ? e.target : exporting.chart, { divElements, events, svgElements } = exporting;
|
|
512
706
|
let cacheName;
|
|
513
707
|
// Destroy the extra buttons added
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
delete chart[cacheName];
|
|
522
|
-
}
|
|
523
|
-
exportSVGElements[i] = elem.destroy();
|
|
708
|
+
svgElements.forEach((elem, i) => {
|
|
709
|
+
// Destroy and null the svg elements
|
|
710
|
+
if (elem) { // #1822
|
|
711
|
+
elem.onclick = elem.ontouchstart = null;
|
|
712
|
+
cacheName = 'cache-' + elem.menuClassName;
|
|
713
|
+
if (chart[cacheName]) {
|
|
714
|
+
delete chart[cacheName];
|
|
524
715
|
}
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
}
|
|
716
|
+
svgElements[i] = elem.destroy();
|
|
717
|
+
}
|
|
718
|
+
});
|
|
719
|
+
svgElements.length = 0;
|
|
528
720
|
// Destroy the exporting group
|
|
529
|
-
if (
|
|
530
|
-
|
|
531
|
-
delete
|
|
721
|
+
if (exporting.group) {
|
|
722
|
+
exporting.group.destroy();
|
|
723
|
+
delete exporting.group;
|
|
532
724
|
}
|
|
533
725
|
// Destroy the divs for the menu
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
}
|
|
553
|
-
if (exportEvents) {
|
|
554
|
-
exportEvents.forEach(function (unbind) {
|
|
726
|
+
divElements.forEach(function (elem, i) {
|
|
727
|
+
if (elem) {
|
|
728
|
+
// Remove the event handler
|
|
729
|
+
clearTimeout(elem.hideTimer); // #5427
|
|
730
|
+
removeEvent(elem, 'mouseleave');
|
|
731
|
+
// Remove inline events
|
|
732
|
+
divElements[i] =
|
|
733
|
+
elem.onmouseout =
|
|
734
|
+
elem.onmouseover =
|
|
735
|
+
elem.ontouchstart =
|
|
736
|
+
elem.onclick = null;
|
|
737
|
+
// Destroy the div by moving to garbage bin
|
|
738
|
+
discardElement(elem);
|
|
739
|
+
}
|
|
740
|
+
});
|
|
741
|
+
divElements.length = 0;
|
|
742
|
+
if (events) {
|
|
743
|
+
events.forEach(function (unbind) {
|
|
555
744
|
unbind();
|
|
556
745
|
});
|
|
557
|
-
|
|
746
|
+
events.length = 0;
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
/**
|
|
750
|
+
* Get data URL to an image of an SVG and call download on its options
|
|
751
|
+
* object:
|
|
752
|
+
*
|
|
753
|
+
* - **filename:** Name of resulting downloaded file without extension.
|
|
754
|
+
* Default is based on the chart title.
|
|
755
|
+
* - **type:** File type of resulting download. Default is `image/png`.
|
|
756
|
+
* - **scale:** Scaling factor of downloaded image compared to source.
|
|
757
|
+
* Default is `2`.
|
|
758
|
+
* - **libURL:** URL pointing to location of dependency scripts to download
|
|
759
|
+
* on demand. Default is the exporting.libURL option of the global
|
|
760
|
+
* Highcharts options pointing to our server.
|
|
761
|
+
*
|
|
762
|
+
* @async
|
|
763
|
+
* @private
|
|
764
|
+
* @function Highcharts.Exporting#downloadSVG
|
|
765
|
+
*
|
|
766
|
+
* @param {string} svg
|
|
767
|
+
* The generated SVG.
|
|
768
|
+
* @param {Highcharts.ExportingOptions} exportingOptions
|
|
769
|
+
* The exporting options.
|
|
770
|
+
*
|
|
771
|
+
* @requires modules/exporting
|
|
772
|
+
*/
|
|
773
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
774
|
+
async downloadSVG(svg, exportingOptions) {
|
|
775
|
+
const eventArgs = {
|
|
776
|
+
svg,
|
|
777
|
+
exportingOptions,
|
|
778
|
+
exporting: this
|
|
779
|
+
};
|
|
780
|
+
// Fire a custom event before the export starts
|
|
781
|
+
fireEvent(Exporting.prototype, 'downloadSVG', eventArgs);
|
|
782
|
+
// If the event was prevented, do not proceed with the export
|
|
783
|
+
if (eventArgs.defaultPrevented) {
|
|
784
|
+
return;
|
|
785
|
+
}
|
|
786
|
+
// Get the final image options
|
|
787
|
+
const { type, filename, scale, libURL } = Exporting.prepareImageOptions(exportingOptions);
|
|
788
|
+
let svgURL;
|
|
789
|
+
// Initiate download depending on file type
|
|
790
|
+
if (type === 'application/pdf') {
|
|
791
|
+
// Error in case of offline-exporting module is not loaded
|
|
792
|
+
throw new Error('Offline exporting logic for PDF type is not found.');
|
|
793
|
+
}
|
|
794
|
+
else if (type === 'image/svg+xml') {
|
|
795
|
+
// SVG download. In this case, we want to use Microsoft specific
|
|
796
|
+
// Blob if available
|
|
797
|
+
if (typeof win.MSBlobBuilder !== 'undefined') {
|
|
798
|
+
const blob = new win.MSBlobBuilder();
|
|
799
|
+
blob.append(svg);
|
|
800
|
+
svgURL = blob.getBlob('image/svg+xml');
|
|
801
|
+
}
|
|
802
|
+
else {
|
|
803
|
+
svgURL = Exporting.svgToDataURL(svg);
|
|
804
|
+
}
|
|
805
|
+
// Download the chart
|
|
806
|
+
downloadURL(svgURL, filename);
|
|
807
|
+
}
|
|
808
|
+
else {
|
|
809
|
+
// PNG/JPEG download - create bitmap from SVG
|
|
810
|
+
svgURL = Exporting.svgToDataURL(svg);
|
|
811
|
+
try {
|
|
812
|
+
Exporting.objectURLRevoke = true;
|
|
813
|
+
// First, try to get PNG by rendering on canvas
|
|
814
|
+
const dataURL = await Exporting.imageToDataURL(svgURL, scale, type);
|
|
815
|
+
downloadURL(dataURL, filename);
|
|
816
|
+
}
|
|
817
|
+
catch (error) {
|
|
818
|
+
// No need for the below logic to run in case no canvas is
|
|
819
|
+
// found
|
|
820
|
+
if (error.message === 'No canvas found!') {
|
|
821
|
+
throw error;
|
|
822
|
+
}
|
|
823
|
+
// Or in case of exceeding the input length
|
|
824
|
+
if (svg.length > 100000000 /* RegexLimits.svgLimit */) {
|
|
825
|
+
throw new Error('Input too long');
|
|
826
|
+
}
|
|
827
|
+
// Failed due to tainted canvas
|
|
828
|
+
// Create new and untainted canvas
|
|
829
|
+
const canvas = doc.createElement('canvas'), ctx = canvas.getContext('2d'), matchedImageWidth = svg.match(
|
|
830
|
+
// eslint-disable-next-line max-len
|
|
831
|
+
/^<svg[^>]*\s{,1000}width\s{,1000}=\s{,1000}\"?(\d+)\"?[^>]*>/), matchedImageHeight = svg.match(
|
|
832
|
+
// eslint-disable-next-line max-len
|
|
833
|
+
/^<svg[^>]*\s{0,1000}height\s{,1000}=\s{,1000}\"?(\d+)\"?[^>]*>/);
|
|
834
|
+
if (ctx &&
|
|
835
|
+
matchedImageWidth &&
|
|
836
|
+
matchedImageHeight) {
|
|
837
|
+
const imageWidth = +matchedImageWidth[1] * scale, imageHeight = +matchedImageHeight[1] * scale, downloadWithCanVG = () => {
|
|
838
|
+
const v = win.canvg.Canvg.fromString(ctx, svg);
|
|
839
|
+
v.start();
|
|
840
|
+
downloadURL(win.navigator.msSaveOrOpenBlob ?
|
|
841
|
+
canvas.msToBlob() :
|
|
842
|
+
canvas.toDataURL(type), filename);
|
|
843
|
+
};
|
|
844
|
+
canvas.width = imageWidth;
|
|
845
|
+
canvas.height = imageHeight;
|
|
846
|
+
// Must load canVG first if not found. Don't destroy the
|
|
847
|
+
// object URL yet since we are doing things
|
|
848
|
+
// asynchronously
|
|
849
|
+
if (!win.canvg) {
|
|
850
|
+
Exporting.objectURLRevoke = true;
|
|
851
|
+
await getScript(libURL + 'canvg.js');
|
|
852
|
+
}
|
|
853
|
+
// Use loaded canvg
|
|
854
|
+
downloadWithCanVG();
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
finally {
|
|
858
|
+
if (Exporting.objectURLRevoke) {
|
|
859
|
+
try {
|
|
860
|
+
domurl.revokeObjectURL(svgURL);
|
|
861
|
+
}
|
|
862
|
+
catch {
|
|
863
|
+
// Ignore
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
}
|
|
558
867
|
}
|
|
559
868
|
}
|
|
560
869
|
/**
|
|
561
|
-
*
|
|
562
|
-
*
|
|
870
|
+
* Submit an SVG version of the chart along with some parameters for local
|
|
871
|
+
* conversion (PNG, JPEG, and SVG) or conversion on a server (PDF).
|
|
563
872
|
*
|
|
564
873
|
* @sample highcharts/members/chart-exportchart/
|
|
565
|
-
*
|
|
874
|
+
* Export with no options
|
|
566
875
|
* @sample highcharts/members/chart-exportchart-filename/
|
|
567
|
-
*
|
|
876
|
+
* PDF type and custom filename
|
|
877
|
+
* @sample highcharts/exporting/menuitemdefinitions-webp/
|
|
878
|
+
* Export to WebP
|
|
568
879
|
* @sample highcharts/members/chart-exportchart-custom-background/
|
|
569
|
-
*
|
|
880
|
+
* Different chart background in export
|
|
570
881
|
* @sample stock/members/chart-exportchart/
|
|
571
|
-
*
|
|
882
|
+
* Export with Highcharts Stock
|
|
883
|
+
*
|
|
884
|
+
* @async
|
|
885
|
+
* @function Highcharts.Exporting#exportChart
|
|
886
|
+
*
|
|
887
|
+
* @param {Highcharts.ExportingOptions} [exportingOptions]
|
|
888
|
+
* Exporting options in addition to those defined in
|
|
889
|
+
* [exporting](https://api.highcharts.com/highcharts/exporting).
|
|
890
|
+
* @param {Highcharts.Options} [chartOptions]
|
|
891
|
+
* Additional chart options for the exported chart. For example a different
|
|
892
|
+
* background color can be added here, or `dataLabels` for export only.
|
|
572
893
|
*
|
|
573
|
-
* @
|
|
894
|
+
* @requires modules/exporting
|
|
895
|
+
*/
|
|
896
|
+
async exportChart(exportingOptions, chartOptions) {
|
|
897
|
+
// Merge the options
|
|
898
|
+
exportingOptions = merge(this.options, exportingOptions);
|
|
899
|
+
// If local if expected
|
|
900
|
+
if (exportingOptions.local) {
|
|
901
|
+
// Trigger the local export logic
|
|
902
|
+
await this.localExport(exportingOptions, chartOptions || {});
|
|
903
|
+
}
|
|
904
|
+
else {
|
|
905
|
+
// Get the SVG representation
|
|
906
|
+
const svg = this.getSVGForExport(exportingOptions, chartOptions);
|
|
907
|
+
// Do the post
|
|
908
|
+
if (exportingOptions.url) {
|
|
909
|
+
await HU.post(exportingOptions.url, {
|
|
910
|
+
filename: exportingOptions.filename ?
|
|
911
|
+
exportingOptions.filename.replace(/\//g, '-') :
|
|
912
|
+
this.getFilename(),
|
|
913
|
+
type: exportingOptions.type,
|
|
914
|
+
width: exportingOptions.width,
|
|
915
|
+
scale: exportingOptions.scale,
|
|
916
|
+
svg
|
|
917
|
+
}, exportingOptions.fetchOptions);
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
/**
|
|
922
|
+
* Handles the fallback to the export server when a local export fails.
|
|
923
|
+
*
|
|
924
|
+
* @private
|
|
925
|
+
* @async
|
|
926
|
+
* @function Highcharts.Exporting#fallbackToServer
|
|
574
927
|
*
|
|
575
928
|
* @param {Highcharts.ExportingOptions} exportingOptions
|
|
576
|
-
*
|
|
577
|
-
*
|
|
929
|
+
* The exporting options.
|
|
930
|
+
* @param {Error} err
|
|
931
|
+
* The error that caused the local export to fail.
|
|
578
932
|
*
|
|
579
|
-
* @
|
|
580
|
-
*
|
|
581
|
-
* different background color can be added here, or `dataLabels` for
|
|
582
|
-
* export only.
|
|
933
|
+
* @return {Promise<void>}
|
|
934
|
+
* A promise that resolves when the fallback process is complete.
|
|
583
935
|
*
|
|
584
936
|
* @requires modules/exporting
|
|
585
937
|
*/
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
938
|
+
async fallbackToServer(exportingOptions, err) {
|
|
939
|
+
if (exportingOptions.fallbackToExportServer === false) {
|
|
940
|
+
if (exportingOptions.error) {
|
|
941
|
+
exportingOptions.error(exportingOptions, err);
|
|
942
|
+
}
|
|
943
|
+
else {
|
|
944
|
+
// Fallback disabled
|
|
945
|
+
error(28, true);
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
else if (exportingOptions.type === 'application/pdf') {
|
|
949
|
+
// The local must be false to fallback to server for PDF export
|
|
950
|
+
exportingOptions.local = false;
|
|
951
|
+
// Allow fallbacking to server only for PDFs that failed locally
|
|
952
|
+
await this.exportChart(exportingOptions);
|
|
953
|
+
}
|
|
600
954
|
}
|
|
601
955
|
/**
|
|
602
956
|
* Return the unfiltered innerHTML of the chart container. Used as hook for
|
|
@@ -604,38 +958,43 @@ var Exporting;
|
|
|
604
958
|
*
|
|
605
959
|
* @see Chart#getSVG
|
|
606
960
|
*
|
|
607
|
-
* @function Highcharts.
|
|
961
|
+
* @function Highcharts.Exporting#getChartHTML
|
|
962
|
+
*
|
|
963
|
+
* @param {boolean} [applyStyleSheets]
|
|
964
|
+
* whether or not to apply the style sheets.
|
|
608
965
|
*
|
|
609
966
|
* @return {string}
|
|
610
967
|
* The unfiltered SVG of the chart.
|
|
611
968
|
*
|
|
612
969
|
* @requires modules/exporting
|
|
613
970
|
*/
|
|
614
|
-
|
|
971
|
+
getChartHTML(applyStyleSheets) {
|
|
972
|
+
const chart = this.chart;
|
|
615
973
|
if (applyStyleSheets) {
|
|
616
974
|
this.inlineStyles();
|
|
617
975
|
}
|
|
618
976
|
this.resolveCSSVariables();
|
|
619
|
-
return
|
|
977
|
+
return chart.container.innerHTML;
|
|
620
978
|
}
|
|
621
979
|
/**
|
|
622
980
|
* Get the default file name used for exported charts. By default it creates
|
|
623
981
|
* a file name based on the chart title.
|
|
624
982
|
*
|
|
625
|
-
* @function Highcharts.
|
|
983
|
+
* @function Highcharts.Exporting#getFilename
|
|
626
984
|
*
|
|
627
|
-
* @return {string}
|
|
985
|
+
* @return {string}
|
|
986
|
+
* A file name without extension.
|
|
628
987
|
*
|
|
629
988
|
* @requires modules/exporting
|
|
630
989
|
*/
|
|
631
|
-
|
|
632
|
-
const
|
|
633
|
-
let filename = this.options.
|
|
990
|
+
getFilename() {
|
|
991
|
+
const titleText = this.chart.userOptions.title?.text;
|
|
992
|
+
let filename = this.options.filename;
|
|
634
993
|
if (filename) {
|
|
635
994
|
return filename.replace(/\//g, '-');
|
|
636
995
|
}
|
|
637
|
-
if (typeof
|
|
638
|
-
filename =
|
|
996
|
+
if (typeof titleText === 'string') {
|
|
997
|
+
filename = titleText
|
|
639
998
|
.toLowerCase()
|
|
640
999
|
.replace(/<\/?[^>]+(>|$)/g, '') // Strip HTML tags
|
|
641
1000
|
.replace(/[\s_]+/g, '-')
|
|
@@ -654,45 +1013,45 @@ var Exporting;
|
|
|
654
1013
|
* Return an SVG representation of the chart.
|
|
655
1014
|
*
|
|
656
1015
|
* @sample highcharts/members/chart-getsvg/
|
|
657
|
-
*
|
|
1016
|
+
* View the SVG from a button
|
|
658
1017
|
*
|
|
659
|
-
* @function Highcharts.
|
|
1018
|
+
* @function Highcharts.Exporting#getSVG
|
|
660
1019
|
*
|
|
661
1020
|
* @param {Highcharts.Options} [chartOptions]
|
|
662
|
-
*
|
|
663
|
-
*
|
|
664
|
-
*
|
|
665
|
-
*
|
|
1021
|
+
* Additional chart options for the generated SVG representation. For
|
|
1022
|
+
* collections like `xAxis`, `yAxis` or `series`, the additional options is
|
|
1023
|
+
* either merged in to the original item of the same `id`, or to the first
|
|
1024
|
+
* item if a common id is not found.
|
|
666
1025
|
*
|
|
667
1026
|
* @return {string}
|
|
668
|
-
*
|
|
1027
|
+
* The SVG representation of the rendered chart.
|
|
669
1028
|
*
|
|
670
1029
|
* @emits Highcharts.Chart#event:getSVG
|
|
671
1030
|
*
|
|
672
1031
|
* @requires modules/exporting
|
|
673
1032
|
*/
|
|
674
|
-
|
|
675
|
-
const chart = this;
|
|
1033
|
+
getSVG(chartOptions) {
|
|
1034
|
+
const chart = this.chart;
|
|
676
1035
|
let svg, seriesOptions,
|
|
677
1036
|
// Copy the options and add extra options
|
|
678
1037
|
options = merge(chart.options, chartOptions);
|
|
679
1038
|
// Use userOptions to make the options chain in series right (#3881)
|
|
680
|
-
options.plotOptions = merge(chart.userOptions.plotOptions, chartOptions
|
|
1039
|
+
options.plotOptions = merge(chart.userOptions.plotOptions, chartOptions?.plotOptions);
|
|
681
1040
|
// ... and likewise with time, avoid that undefined time properties are
|
|
682
1041
|
// merged over legacy global time options
|
|
683
|
-
options.time = merge(chart.userOptions.time, chartOptions
|
|
1042
|
+
options.time = merge(chart.userOptions.time, chartOptions?.time);
|
|
684
1043
|
// Create a sandbox where a new chart will be generated
|
|
685
|
-
const sandbox = createElement('div',
|
|
1044
|
+
const sandbox = createElement('div', void 0, {
|
|
686
1045
|
position: 'absolute',
|
|
687
1046
|
top: '-9999em',
|
|
688
1047
|
width: chart.chartWidth + 'px',
|
|
689
1048
|
height: chart.chartHeight + 'px'
|
|
690
1049
|
}, doc.body);
|
|
691
1050
|
// Get the source size
|
|
692
|
-
const cssWidth = chart.renderTo.style.width, cssHeight = chart.renderTo.style.height, sourceWidth = options.exporting
|
|
1051
|
+
const cssWidth = chart.renderTo.style.width, cssHeight = chart.renderTo.style.height, sourceWidth = options.exporting?.sourceWidth ||
|
|
693
1052
|
options.chart.width ||
|
|
694
1053
|
(/px$/.test(cssWidth) && parseInt(cssWidth, 10)) ||
|
|
695
|
-
(options.isGantt ? 800 : 600), sourceHeight = options.exporting
|
|
1054
|
+
(options.isGantt ? 800 : 600), sourceHeight = options.exporting?.sourceHeight ||
|
|
696
1055
|
options.chart.height ||
|
|
697
1056
|
(/px$/.test(cssHeight) && parseInt(cssHeight, 10)) ||
|
|
698
1057
|
400;
|
|
@@ -705,9 +1064,11 @@ var Exporting;
|
|
|
705
1064
|
width: sourceWidth,
|
|
706
1065
|
height: sourceHeight
|
|
707
1066
|
});
|
|
708
|
-
options.exporting
|
|
1067
|
+
if (options.exporting) {
|
|
1068
|
+
options.exporting.enabled = false; // Hide buttons in print
|
|
1069
|
+
}
|
|
709
1070
|
delete options.data; // #3004
|
|
710
|
-
//
|
|
1071
|
+
// Prepare for replicating the chart
|
|
711
1072
|
options.series = [];
|
|
712
1073
|
chart.series.forEach(function (serie) {
|
|
713
1074
|
seriesOptions = merge(serie.userOptions, {
|
|
@@ -718,7 +1079,7 @@ var Exporting;
|
|
|
718
1079
|
});
|
|
719
1080
|
// Used for the navigator series that has its own option set
|
|
720
1081
|
if (!seriesOptions.isInternal) {
|
|
721
|
-
options
|
|
1082
|
+
options?.series?.push(seriesOptions);
|
|
722
1083
|
}
|
|
723
1084
|
});
|
|
724
1085
|
const colls = {};
|
|
@@ -727,7 +1088,7 @@ var Exporting;
|
|
|
727
1088
|
if (!axis.userOptions.internalKey) { // #6444
|
|
728
1089
|
axis.userOptions.internalKey = uniqueKey();
|
|
729
1090
|
}
|
|
730
|
-
if (!axis.options.isInternal) {
|
|
1091
|
+
if (options && !axis.options.isInternal) {
|
|
731
1092
|
if (!colls[axis.coll]) {
|
|
732
1093
|
colls[axis.coll] = true;
|
|
733
1094
|
options[axis.coll] = [];
|
|
@@ -750,10 +1111,10 @@ var Exporting;
|
|
|
750
1111
|
// Axis options and series options (#2022, #3900, #5982)
|
|
751
1112
|
if (chartOptions) {
|
|
752
1113
|
['xAxis', 'yAxis', 'series'].forEach(function (coll) {
|
|
753
|
-
const collOptions = {};
|
|
754
1114
|
if (chartOptions[coll]) {
|
|
755
|
-
|
|
756
|
-
|
|
1115
|
+
chartCopy.update({
|
|
1116
|
+
[coll]: chartOptions[coll]
|
|
1117
|
+
});
|
|
757
1118
|
}
|
|
758
1119
|
});
|
|
759
1120
|
}
|
|
@@ -779,92 +1140,96 @@ var Exporting;
|
|
|
779
1140
|
}
|
|
780
1141
|
});
|
|
781
1142
|
// Get the SVG from the container's innerHTML
|
|
782
|
-
svg = chartCopy.getChartHTML(chart.styledMode ||
|
|
783
|
-
options.exporting?.applyStyleSheets);
|
|
784
|
-
fireEvent(
|
|
785
|
-
svg =
|
|
1143
|
+
svg = chartCopy.exporting?.getChartHTML(chart.styledMode ||
|
|
1144
|
+
options.exporting?.applyStyleSheets) || '';
|
|
1145
|
+
fireEvent(chart, 'getSVG', { chartCopy: chartCopy });
|
|
1146
|
+
svg = Exporting.sanitizeSVG(svg, options);
|
|
786
1147
|
// Free up memory
|
|
787
|
-
options =
|
|
1148
|
+
options = void 0;
|
|
788
1149
|
chartCopy.destroy();
|
|
789
1150
|
discardElement(sandbox);
|
|
790
1151
|
return svg;
|
|
791
1152
|
}
|
|
792
1153
|
/**
|
|
1154
|
+
* Gets the SVG for export using the getSVG function with additional
|
|
1155
|
+
* options.
|
|
1156
|
+
*
|
|
793
1157
|
* @private
|
|
794
|
-
* @function Highcharts.
|
|
1158
|
+
* @function Highcharts.Exporting#getSVGForExport
|
|
1159
|
+
*
|
|
1160
|
+
* @param {Highcharts.ExportingOptions} [exportingOptions]
|
|
1161
|
+
* The exporting options.
|
|
1162
|
+
* @param {Highcharts.Options} [chartOptions]
|
|
1163
|
+
* Additional chart options for the exported chart.
|
|
1164
|
+
*
|
|
1165
|
+
* @return {string}
|
|
1166
|
+
* The SVG representation of the rendered chart.
|
|
1167
|
+
*
|
|
1168
|
+
* @requires modules/exporting
|
|
795
1169
|
*/
|
|
796
|
-
|
|
797
|
-
const
|
|
798
|
-
return this.getSVG(merge({ chart: { borderRadius: 0 } },
|
|
1170
|
+
getSVGForExport(exportingOptions, chartOptions) {
|
|
1171
|
+
const currentExportingOptions = this.options;
|
|
1172
|
+
return this.getSVG(merge({ chart: { borderRadius: 0 } }, currentExportingOptions.chartOptions, chartOptions, {
|
|
799
1173
|
exporting: {
|
|
800
|
-
sourceWidth: (
|
|
801
|
-
|
|
802
|
-
sourceHeight: (
|
|
803
|
-
|
|
1174
|
+
sourceWidth: (exportingOptions?.sourceWidth ||
|
|
1175
|
+
currentExportingOptions.sourceWidth),
|
|
1176
|
+
sourceHeight: (exportingOptions?.sourceHeight ||
|
|
1177
|
+
currentExportingOptions.sourceHeight)
|
|
804
1178
|
}
|
|
805
1179
|
}));
|
|
806
1180
|
}
|
|
807
1181
|
/**
|
|
808
|
-
*
|
|
809
|
-
* @private
|
|
810
|
-
* @param {string} prop
|
|
811
|
-
* Property name in camelCase
|
|
812
|
-
* @return {string}
|
|
813
|
-
* Hyphenated property name
|
|
814
|
-
*/
|
|
815
|
-
function hyphenate(prop) {
|
|
816
|
-
return prop.replace(/[A-Z]/g, function (match) {
|
|
817
|
-
return '-' + match.toLowerCase();
|
|
818
|
-
});
|
|
819
|
-
}
|
|
820
|
-
/**
|
|
821
|
-
* Analyze inherited styles from stylesheets and add them inline
|
|
1182
|
+
* Analyze inherited styles from stylesheets and add them inline.
|
|
822
1183
|
*
|
|
823
1184
|
* @private
|
|
824
|
-
* @function Highcharts.
|
|
1185
|
+
* @function Highcharts.Exporting#inlineStyles
|
|
825
1186
|
*
|
|
826
1187
|
* @todo What are the border styles for text about? In general, text has a
|
|
827
|
-
*
|
|
1188
|
+
* lot of properties.
|
|
828
1189
|
*
|
|
829
1190
|
* @todo Make it work with IE9 and IE10.
|
|
830
1191
|
*
|
|
831
1192
|
* @requires modules/exporting
|
|
832
1193
|
*/
|
|
833
|
-
|
|
834
|
-
const denylist = inlineDenylist, allowlist = Exporting.inlineAllowlist, // For IE
|
|
1194
|
+
inlineStyles() {
|
|
1195
|
+
const denylist = Exporting.inlineDenylist, allowlist = Exporting.inlineAllowlist, // For IE
|
|
835
1196
|
defaultStyles = {};
|
|
836
1197
|
let dummySVG;
|
|
837
1198
|
// Create an iframe where we read default styles without pollution from
|
|
838
1199
|
// this body
|
|
839
|
-
const iframe =
|
|
840
|
-
css(iframe, {
|
|
1200
|
+
const iframe = createElement('iframe', void 0, {
|
|
841
1201
|
width: '1px',
|
|
842
1202
|
height: '1px',
|
|
843
1203
|
visibility: 'hidden'
|
|
844
|
-
});
|
|
845
|
-
|
|
846
|
-
const iframeDoc = (iframe.contentWindow && iframe.contentWindow.document);
|
|
1204
|
+
}, doc.body);
|
|
1205
|
+
const iframeDoc = iframe.contentWindow?.document;
|
|
847
1206
|
if (iframeDoc) {
|
|
848
1207
|
iframeDoc.body.appendChild(iframeDoc.createElementNS(SVG_NS, 'svg'));
|
|
849
1208
|
}
|
|
850
1209
|
/**
|
|
851
|
-
* Call this on all elements and recurse to children
|
|
1210
|
+
* Call this on all elements and recurse to children.
|
|
1211
|
+
*
|
|
852
1212
|
* @private
|
|
853
|
-
* @
|
|
854
|
-
*
|
|
855
|
-
|
|
1213
|
+
* @function recurse
|
|
1214
|
+
*
|
|
1215
|
+
* @param {Highcharts.HTMLDOMElement | Highcharts.SVGSVGElement} node
|
|
1216
|
+
* Element child.
|
|
1217
|
+
*/
|
|
856
1218
|
function recurse(node) {
|
|
857
1219
|
const filteredStyles = {};
|
|
858
1220
|
let styles, parentStyles, dummy, denylisted, allowlisted, i;
|
|
859
1221
|
/**
|
|
860
1222
|
* Check computed styles and whether they are in the allow/denylist
|
|
861
1223
|
* for styles or attributes.
|
|
1224
|
+
*
|
|
862
1225
|
* @private
|
|
863
|
-
* @
|
|
864
|
-
*
|
|
1226
|
+
* @function filterStyles
|
|
1227
|
+
*
|
|
1228
|
+
* @param {string | number | Highcharts.GradientColor | Highcharts.PatternObject | undefined} val
|
|
1229
|
+
* Style value.
|
|
865
1230
|
* @param {string} prop
|
|
866
|
-
*
|
|
867
|
-
|
|
1231
|
+
* Style property name.
|
|
1232
|
+
*/
|
|
868
1233
|
function filterStyles(val, prop) {
|
|
869
1234
|
// Check against allowlist & denylist
|
|
870
1235
|
denylisted = allowlisted = false;
|
|
@@ -895,12 +1260,12 @@ var Exporting;
|
|
|
895
1260
|
// against parent (#7687).
|
|
896
1261
|
if ((parentStyles[prop] !== val ||
|
|
897
1262
|
node.nodeName === 'svg') &&
|
|
898
|
-
defaultStyles[node.nodeName][prop] !== val) {
|
|
1263
|
+
(defaultStyles[node.nodeName])[prop] !== val) {
|
|
899
1264
|
// Attributes
|
|
900
|
-
if (!inlineToAttributes ||
|
|
901
|
-
inlineToAttributes.indexOf(prop) !== -1) {
|
|
1265
|
+
if (!Exporting.inlineToAttributes ||
|
|
1266
|
+
Exporting.inlineToAttributes.indexOf(prop) !== -1) {
|
|
902
1267
|
if (val) {
|
|
903
|
-
node.setAttribute(hyphenate(prop), val);
|
|
1268
|
+
node.setAttribute(Exporting.hyphenate(prop), val);
|
|
904
1269
|
}
|
|
905
1270
|
// Styles
|
|
906
1271
|
}
|
|
@@ -912,8 +1277,9 @@ var Exporting;
|
|
|
912
1277
|
}
|
|
913
1278
|
if (iframeDoc &&
|
|
914
1279
|
node.nodeType === 1 &&
|
|
915
|
-
unstyledElements.indexOf(node.nodeName) === -1) {
|
|
916
|
-
styles =
|
|
1280
|
+
Exporting.unstyledElements.indexOf(node.nodeName) === -1) {
|
|
1281
|
+
styles =
|
|
1282
|
+
win.getComputedStyle(node, null);
|
|
917
1283
|
parentStyles = node.nodeName === 'svg' ?
|
|
918
1284
|
{} :
|
|
919
1285
|
win.getComputedStyle(node.parentNode, null);
|
|
@@ -927,12 +1293,14 @@ var Exporting;
|
|
|
927
1293
|
doc.body.appendChild(dummySVG);
|
|
928
1294
|
}
|
|
929
1295
|
*/
|
|
930
|
-
dummySVG =
|
|
1296
|
+
dummySVG =
|
|
1297
|
+
iframeDoc.getElementsByTagName('svg')[0];
|
|
931
1298
|
dummy = iframeDoc.createElementNS(node.namespaceURI, node.nodeName);
|
|
932
1299
|
dummySVG.appendChild(dummy);
|
|
933
1300
|
// Get the defaults into a standard object (simple merge
|
|
934
1301
|
// won't do)
|
|
935
1302
|
const s = win.getComputedStyle(dummy, null), defaults = {};
|
|
1303
|
+
// eslint-disable-next-line @typescript-eslint/no-for-in-array
|
|
936
1304
|
for (const key in s) {
|
|
937
1305
|
if (key.length < 1000 /* RegexLimits.shortLimit */ &&
|
|
938
1306
|
typeof s[key] === 'string' &&
|
|
@@ -952,9 +1320,9 @@ var Exporting;
|
|
|
952
1320
|
for (const p in styles) {
|
|
953
1321
|
if (
|
|
954
1322
|
// Some browsers put lots of styles on the prototype...
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
1323
|
+
isFirefox ||
|
|
1324
|
+
isMS ||
|
|
1325
|
+
isSafari || // #16902
|
|
958
1326
|
// ... Chrome puts them on the instance
|
|
959
1327
|
Object.hasOwnProperty.call(styles, p)) {
|
|
960
1328
|
filterStyles(styles[p], p);
|
|
@@ -974,43 +1342,145 @@ var Exporting;
|
|
|
974
1342
|
}
|
|
975
1343
|
}
|
|
976
1344
|
/**
|
|
977
|
-
* Remove the dummy objects used to get defaults
|
|
1345
|
+
* Remove the dummy objects used to get defaults.
|
|
1346
|
+
*
|
|
978
1347
|
* @private
|
|
1348
|
+
* @function tearDown
|
|
979
1349
|
*/
|
|
980
1350
|
function tearDown() {
|
|
981
1351
|
dummySVG.parentNode.removeChild(dummySVG);
|
|
982
1352
|
// Remove trash from DOM that stayed after each exporting
|
|
983
1353
|
iframe.parentNode.removeChild(iframe);
|
|
984
1354
|
}
|
|
985
|
-
recurse(this.container.querySelector('svg'));
|
|
1355
|
+
recurse(this.chart.container.querySelector('svg'));
|
|
986
1356
|
tearDown();
|
|
987
1357
|
}
|
|
988
1358
|
/**
|
|
989
|
-
*
|
|
1359
|
+
* Get SVG of chart prepared for client side export. This converts embedded
|
|
1360
|
+
* images in the SVG to data URIs. It requires the regular exporting module.
|
|
1361
|
+
* The options and chartOptions arguments are passed to the getSVGForExport
|
|
1362
|
+
* function.
|
|
1363
|
+
*
|
|
1364
|
+
* @private
|
|
1365
|
+
* @async
|
|
1366
|
+
* @function Highcharts.Exporting#localExport
|
|
1367
|
+
*
|
|
1368
|
+
* @param {Highcharts.ExportingOptions} exportingOptions
|
|
1369
|
+
* The exporting options.
|
|
1370
|
+
* @param {Highcharts.Options} chartOptions
|
|
1371
|
+
* Additional chart options for the exported chart.
|
|
1372
|
+
*
|
|
1373
|
+
* @return {Promise<string>}
|
|
1374
|
+
* The sanitized SVG.
|
|
1375
|
+
*
|
|
1376
|
+
* @requires modules/exporting
|
|
990
1377
|
*/
|
|
991
|
-
|
|
992
|
-
const
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
1378
|
+
async localExport(exportingOptions, chartOptions) {
|
|
1379
|
+
const chart = this.chart, exporting = this,
|
|
1380
|
+
// After grabbing the SVG of the chart's copy container we need
|
|
1381
|
+
// to do sanitation on the SVG
|
|
1382
|
+
sanitize = (svg) => Exporting.sanitizeSVG(svg || '', chartCopyOptions),
|
|
1383
|
+
// Return true if the SVG contains images with external data.
|
|
1384
|
+
// With the boost module there are `image` elements with encoded
|
|
1385
|
+
// PNGs, these are supported by svg2pdf and should pass (#10243)
|
|
1386
|
+
hasExternalImages = function () {
|
|
1387
|
+
return [].some.call(chart.container.getElementsByTagName('image'), function (image) {
|
|
1388
|
+
const href = image.getAttribute('href');
|
|
1389
|
+
return (href !== '' &&
|
|
1390
|
+
typeof href === 'string' &&
|
|
1391
|
+
href.indexOf('data:') !== 0);
|
|
999
1392
|
});
|
|
1393
|
+
};
|
|
1394
|
+
let chartCopyContainer, chartCopyOptions, href = null, images;
|
|
1395
|
+
// If we are on IE and in styled mode, add an allowlist to the
|
|
1396
|
+
// renderer for inline styles that we want to pass through. There
|
|
1397
|
+
// are so many styles by default in IE that we don't want to
|
|
1398
|
+
// denylist them all
|
|
1399
|
+
if (isMS && chart.styledMode && !Exporting.inlineAllowlist.length) {
|
|
1400
|
+
Exporting.inlineAllowlist.push(/^blockSize/, /^border/, /^caretColor/, /^color/, /^columnRule/, /^columnRuleColor/, /^cssFloat/, /^cursor/, /^fill$/, /^fillOpacity/, /^font/, /^inlineSize/, /^length/, /^lineHeight/, /^opacity/, /^outline/, /^parentRule/, /^rx$/, /^ry$/, /^stroke/, /^textAlign/, /^textAnchor/, /^textDecoration/, /^transform/, /^vectorEffect/, /^visibility/, /^x$/, /^y$/);
|
|
1401
|
+
}
|
|
1402
|
+
// Always fall back on:
|
|
1403
|
+
// - MS browsers: Embedded images JPEG/PNG, or any PDF
|
|
1404
|
+
// - Embedded images and PDF
|
|
1405
|
+
if ((isMS &&
|
|
1406
|
+
(exportingOptions.type === 'application/pdf' ||
|
|
1407
|
+
chart.container.getElementsByTagName('image').length &&
|
|
1408
|
+
exportingOptions.type !== 'image/svg+xml')) || (exportingOptions.type === 'application/pdf' &&
|
|
1409
|
+
hasExternalImages())) {
|
|
1410
|
+
await this.fallbackToServer(exportingOptions, new Error('Image type not supported for this chart/browser.'));
|
|
1411
|
+
return;
|
|
1412
|
+
}
|
|
1413
|
+
// Hook into getSVG to get a copy of the chart copy's container (#8273)
|
|
1414
|
+
const unbindGetSVG = addEvent(chart, 'getSVG', (e) => {
|
|
1415
|
+
chartCopyOptions = e.chartCopy.options;
|
|
1416
|
+
chartCopyContainer =
|
|
1417
|
+
e.chartCopy.container.cloneNode(true);
|
|
1418
|
+
images = chartCopyContainer && chartCopyContainer
|
|
1419
|
+
.getElementsByTagName('image') || [];
|
|
1000
1420
|
});
|
|
1421
|
+
try {
|
|
1422
|
+
// Trigger hook to get chart copy
|
|
1423
|
+
this.getSVGForExport(exportingOptions, chartOptions);
|
|
1424
|
+
// Get the static array
|
|
1425
|
+
const imagesArray = images ? Array.from(images) : [];
|
|
1426
|
+
// Go through the images we want to embed
|
|
1427
|
+
for (const image of imagesArray) {
|
|
1428
|
+
href = image.getAttributeNS('http://www.w3.org/1999/xlink', 'href');
|
|
1429
|
+
if (href) {
|
|
1430
|
+
Exporting.objectURLRevoke = false;
|
|
1431
|
+
const dataURL = await Exporting.imageToDataURL(href, exportingOptions?.scale || 1, exportingOptions?.type || 'image/png');
|
|
1432
|
+
// Change image href in chart copy
|
|
1433
|
+
image.setAttributeNS('http://www.w3.org/1999/xlink', 'href', dataURL);
|
|
1434
|
+
// Hidden, boosted series have blank href (#10243)
|
|
1435
|
+
}
|
|
1436
|
+
else {
|
|
1437
|
+
image.parentNode.removeChild(image);
|
|
1438
|
+
}
|
|
1439
|
+
}
|
|
1440
|
+
const svgElement = chartCopyContainer?.querySelector('svg');
|
|
1441
|
+
if (svgElement &&
|
|
1442
|
+
!exportingOptions.chartOptions?.chart?.style?.fontFamily) {
|
|
1443
|
+
await Exporting.inlineFonts(svgElement);
|
|
1444
|
+
}
|
|
1445
|
+
// Sanitize the SVG
|
|
1446
|
+
const sanitizedSVG = sanitize(chartCopyContainer?.innerHTML);
|
|
1447
|
+
// Use SVG of chart copy. If SVG contains foreignObjects PDF fails
|
|
1448
|
+
// in all browsers and all exports except SVG will fail in IE, as
|
|
1449
|
+
// both CanVG and svg2pdf choke on this. Gracefully fall back.
|
|
1450
|
+
if (sanitizedSVG.indexOf('<foreignObject') > -1 &&
|
|
1451
|
+
exportingOptions.type !== 'image/svg+xml' &&
|
|
1452
|
+
(isMS ||
|
|
1453
|
+
exportingOptions.type === 'application/pdf')) {
|
|
1454
|
+
throw new Error('Image type not supported for charts with embedded HTML');
|
|
1455
|
+
}
|
|
1456
|
+
else {
|
|
1457
|
+
// Trigger SVG download
|
|
1458
|
+
await exporting.downloadSVG(sanitizedSVG, extend({ filename: exporting.getFilename() }, exportingOptions));
|
|
1459
|
+
}
|
|
1460
|
+
// Return the sanitized SVG
|
|
1461
|
+
return sanitizedSVG;
|
|
1462
|
+
}
|
|
1463
|
+
catch (error) {
|
|
1464
|
+
await this.fallbackToServer(exportingOptions, error);
|
|
1465
|
+
}
|
|
1466
|
+
finally {
|
|
1467
|
+
// Clean up
|
|
1468
|
+
unbindGetSVG();
|
|
1469
|
+
}
|
|
1001
1470
|
}
|
|
1002
1471
|
/**
|
|
1003
1472
|
* Move the chart container(s) to another div.
|
|
1004
1473
|
*
|
|
1005
|
-
* @function Highcharts#moveContainers
|
|
1006
|
-
*
|
|
1007
1474
|
* @private
|
|
1475
|
+
* @function Highcharts.Exporting#moveContainers
|
|
1008
1476
|
*
|
|
1009
1477
|
* @param {Highcharts.HTMLDOMElement} moveTo
|
|
1010
|
-
*
|
|
1478
|
+
* Move target.
|
|
1479
|
+
*
|
|
1480
|
+
* @requires modules/exporting
|
|
1011
1481
|
*/
|
|
1012
|
-
|
|
1013
|
-
const { scrollablePlotArea } =
|
|
1482
|
+
moveContainers(moveTo) {
|
|
1483
|
+
const chart = this.chart, { scrollablePlotArea } = chart;
|
|
1014
1484
|
(
|
|
1015
1485
|
// When scrollablePlotArea is active (#9533)
|
|
1016
1486
|
scrollablePlotArea ?
|
|
@@ -1018,95 +1488,35 @@ var Exporting;
|
|
|
1018
1488
|
scrollablePlotArea.fixedDiv,
|
|
1019
1489
|
scrollablePlotArea.scrollingContainer
|
|
1020
1490
|
] :
|
|
1021
|
-
[
|
|
1491
|
+
[chart.container]).forEach(function (div) {
|
|
1022
1492
|
moveTo.appendChild(div);
|
|
1023
1493
|
});
|
|
1024
1494
|
}
|
|
1025
1495
|
/**
|
|
1026
|
-
*
|
|
1027
|
-
*
|
|
1028
|
-
*
|
|
1029
|
-
*
|
|
1030
|
-
* @private
|
|
1031
|
-
*/
|
|
1032
|
-
function onChartInit() {
|
|
1033
|
-
const chart = this,
|
|
1034
|
-
/**
|
|
1035
|
-
* @private
|
|
1036
|
-
* @param {"exporting"|"navigation"} prop
|
|
1037
|
-
* Property name in option root
|
|
1038
|
-
* @param {Highcharts.ExportingOptions|Highcharts.NavigationOptions} options
|
|
1039
|
-
* Options to update
|
|
1040
|
-
* @param {boolean} [redraw=true]
|
|
1041
|
-
* Whether to redraw
|
|
1042
|
-
*/
|
|
1043
|
-
update = (prop, options, redraw) => {
|
|
1044
|
-
chart.isDirtyExporting = true;
|
|
1045
|
-
merge(true, chart.options[prop], options);
|
|
1046
|
-
if (pick(redraw, true)) {
|
|
1047
|
-
chart.redraw();
|
|
1048
|
-
}
|
|
1049
|
-
};
|
|
1050
|
-
chart.exporting = {
|
|
1051
|
-
update: function (options, redraw) {
|
|
1052
|
-
update('exporting', options, redraw);
|
|
1053
|
-
}
|
|
1054
|
-
};
|
|
1055
|
-
// Register update() method for navigation. Cannot be set the same way
|
|
1056
|
-
// as for exporting, because navigation options are shared with bindings
|
|
1057
|
-
// which has separate update() logic.
|
|
1058
|
-
ChartNavigationComposition
|
|
1059
|
-
.compose(chart).navigation
|
|
1060
|
-
.addUpdate((options, redraw) => {
|
|
1061
|
-
update('navigation', options, redraw);
|
|
1062
|
-
});
|
|
1063
|
-
}
|
|
1064
|
-
/**
|
|
1065
|
-
* On layout of titles (title, subtitle and caption), adjust the `alignTo``
|
|
1066
|
-
* box to avoid the context menu button.
|
|
1067
|
-
* @private
|
|
1068
|
-
*/
|
|
1069
|
-
function onChartLayOutTitle({ alignTo, key, textPxLength }) {
|
|
1070
|
-
const exportingOptions = this.options.exporting, { align, buttonSpacing = 0, verticalAlign, width = 0 } = merge(this.options.navigation?.buttonOptions, exportingOptions?.buttons?.contextButton), space = alignTo.width - textPxLength, widthAdjust = width + buttonSpacing;
|
|
1071
|
-
if ((exportingOptions?.enabled ?? true) &&
|
|
1072
|
-
key === 'title' &&
|
|
1073
|
-
align === 'right' &&
|
|
1074
|
-
verticalAlign === 'top') {
|
|
1075
|
-
if (space < 2 * widthAdjust) {
|
|
1076
|
-
if (space < widthAdjust) {
|
|
1077
|
-
alignTo.width -= widthAdjust;
|
|
1078
|
-
}
|
|
1079
|
-
else if (this.title?.alignValue !== 'left') {
|
|
1080
|
-
alignTo.x -= widthAdjust - space / 2;
|
|
1081
|
-
}
|
|
1082
|
-
}
|
|
1083
|
-
}
|
|
1084
|
-
}
|
|
1085
|
-
/**
|
|
1086
|
-
* Exporting module required. Clears away other elements in the page and
|
|
1087
|
-
* prints the chart as it is displayed. By default, when the exporting
|
|
1088
|
-
* module is enabled, a context button with a drop down menu in the upper
|
|
1089
|
-
* right corner accesses this function.
|
|
1496
|
+
* Clears away other elements in the page and prints the chart as it is
|
|
1497
|
+
* displayed. By default, when the exporting module is enabled, a context
|
|
1498
|
+
* button with a drop down menu in the upper right corner accesses this
|
|
1499
|
+
* function.
|
|
1090
1500
|
*
|
|
1091
1501
|
* @sample highcharts/members/chart-print/
|
|
1092
|
-
*
|
|
1093
|
-
*
|
|
1094
|
-
* @function Highcharts.Chart#print
|
|
1502
|
+
* Print from a HTML button
|
|
1095
1503
|
*
|
|
1504
|
+
* @function Highcharts.Exporting#print
|
|
1096
1505
|
*
|
|
1097
1506
|
* @emits Highcharts.Chart#event:beforePrint
|
|
1098
1507
|
* @emits Highcharts.Chart#event:afterPrint
|
|
1099
1508
|
*
|
|
1100
1509
|
* @requires modules/exporting
|
|
1101
1510
|
*/
|
|
1102
|
-
|
|
1103
|
-
const chart = this;
|
|
1104
|
-
|
|
1511
|
+
print() {
|
|
1512
|
+
const chart = this.chart;
|
|
1513
|
+
// Block the button while in printing mode
|
|
1514
|
+
if (this.isPrinting) {
|
|
1105
1515
|
return;
|
|
1106
1516
|
}
|
|
1107
|
-
printingChart = chart;
|
|
1108
|
-
if (!
|
|
1109
|
-
|
|
1517
|
+
Exporting.printingChart = chart;
|
|
1518
|
+
if (!isSafari) {
|
|
1519
|
+
this.beforePrint();
|
|
1110
1520
|
}
|
|
1111
1521
|
// Give the browser time to draw WebGL content, an issue that randomly
|
|
1112
1522
|
// appears (at least) in Chrome ~67 on the Mac (#8708).
|
|
@@ -1114,86 +1524,310 @@ var Exporting;
|
|
|
1114
1524
|
win.focus(); // #1510
|
|
1115
1525
|
win.print();
|
|
1116
1526
|
// Allow the browser to prepare before reverting
|
|
1117
|
-
if (!
|
|
1527
|
+
if (!isSafari) {
|
|
1118
1528
|
setTimeout(() => {
|
|
1119
|
-
chart.afterPrint();
|
|
1529
|
+
chart.exporting?.afterPrint();
|
|
1120
1530
|
}, 1000);
|
|
1121
1531
|
}
|
|
1122
1532
|
}, 1);
|
|
1123
1533
|
}
|
|
1124
1534
|
/**
|
|
1125
|
-
* Add the buttons on chart load
|
|
1535
|
+
* Add the buttons on chart load.
|
|
1536
|
+
*
|
|
1126
1537
|
* @private
|
|
1127
|
-
* @function Highcharts.
|
|
1538
|
+
* @function Highcharts.Exporting#render
|
|
1539
|
+
*
|
|
1128
1540
|
* @requires modules/exporting
|
|
1129
1541
|
*/
|
|
1130
|
-
|
|
1131
|
-
const
|
|
1132
|
-
|
|
1133
|
-
if (
|
|
1134
|
-
|
|
1542
|
+
render() {
|
|
1543
|
+
const exporting = this, { chart, options } = exporting, isDirty = exporting?.isDirty || !exporting?.svgElements.length;
|
|
1544
|
+
exporting.buttonOffset = 0;
|
|
1545
|
+
if (exporting.isDirty) {
|
|
1546
|
+
exporting.destroy();
|
|
1135
1547
|
}
|
|
1136
|
-
if (isDirty &&
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
chart.addButton(button);
|
|
1548
|
+
if (isDirty && options.enabled !== false) {
|
|
1549
|
+
exporting.events = [];
|
|
1550
|
+
exporting.group || (exporting.group = chart.renderer.g('exporting-group').attr({
|
|
1551
|
+
zIndex: 3 // #4955, // #8392
|
|
1552
|
+
}).add());
|
|
1553
|
+
objectEach(options?.buttons, function (button) {
|
|
1554
|
+
exporting.addButton(button);
|
|
1144
1555
|
});
|
|
1145
|
-
|
|
1556
|
+
exporting.isDirty = false;
|
|
1146
1557
|
}
|
|
1147
1558
|
}
|
|
1148
1559
|
/**
|
|
1149
|
-
*
|
|
1150
|
-
* account for expand properties, browser bugs.
|
|
1151
|
-
* Returns a cleaned SVG.
|
|
1560
|
+
* Resolve CSS variables into hex colors.
|
|
1152
1561
|
*
|
|
1153
1562
|
* @private
|
|
1154
|
-
* @function Highcharts.
|
|
1155
|
-
*
|
|
1156
|
-
* SVG code to sanitize
|
|
1157
|
-
* @param {Highcharts.Options} options
|
|
1158
|
-
* Chart options to apply
|
|
1159
|
-
* @return {string}
|
|
1160
|
-
* Sanitized SVG code
|
|
1563
|
+
* @function Highcharts.Exporting#resolveCSSVariables
|
|
1564
|
+
*
|
|
1161
1565
|
* @requires modules/exporting
|
|
1162
1566
|
*/
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1567
|
+
resolveCSSVariables() {
|
|
1568
|
+
Array.from(this.chart.container.querySelectorAll('*')).forEach((element) => {
|
|
1569
|
+
['color', 'fill', 'stop-color', 'stroke'].forEach((prop) => {
|
|
1570
|
+
const attrValue = element.getAttribute(prop);
|
|
1571
|
+
if (attrValue?.includes('var(')) {
|
|
1572
|
+
element.setAttribute(prop, getComputedStyle(element).getPropertyValue(prop));
|
|
1573
|
+
}
|
|
1574
|
+
const styleValue = element.style?.[prop];
|
|
1575
|
+
if (styleValue?.includes('var(')) {
|
|
1576
|
+
element.style[prop] =
|
|
1577
|
+
getComputedStyle(element).getPropertyValue(prop);
|
|
1578
|
+
}
|
|
1579
|
+
});
|
|
1580
|
+
});
|
|
1581
|
+
}
|
|
1582
|
+
/**
|
|
1583
|
+
* Updates the exporting object with the provided exporting options.
|
|
1584
|
+
*
|
|
1585
|
+
* @private
|
|
1586
|
+
* @function Highcharts.Exporting#update
|
|
1587
|
+
*
|
|
1588
|
+
* @param {Highcharts.ExportingOptions} exportingOptions
|
|
1589
|
+
* The exporting options to update with.
|
|
1590
|
+
* @param {boolean} [redraw=true]
|
|
1591
|
+
* Whether to redraw or not.
|
|
1592
|
+
*
|
|
1593
|
+
* @requires modules/exporting
|
|
1594
|
+
*/
|
|
1595
|
+
update(exportingOptions, redraw) {
|
|
1596
|
+
this.isDirty = true;
|
|
1597
|
+
merge(true, this.options, exportingOptions);
|
|
1598
|
+
if (pick(redraw, true)) {
|
|
1599
|
+
this.chart.redraw();
|
|
1172
1600
|
}
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1601
|
+
}
|
|
1602
|
+
}
|
|
1603
|
+
/* *
|
|
1604
|
+
*
|
|
1605
|
+
* Static Properties
|
|
1606
|
+
*
|
|
1607
|
+
* */
|
|
1608
|
+
Exporting.inlineAllowlist = [];
|
|
1609
|
+
// These CSS properties are not inlined. Remember camelCase.
|
|
1610
|
+
Exporting.inlineDenylist = [
|
|
1611
|
+
/-/, // In Firefox, both hyphened and camelCased names are listed
|
|
1612
|
+
/^(clipPath|cssText|d|height|width)$/, // Full words
|
|
1613
|
+
/^font$/, // More specific props are set
|
|
1614
|
+
/[lL]ogical(Width|Height)$/,
|
|
1615
|
+
/^parentRule$/,
|
|
1616
|
+
/^(cssRules|ownerRules)$/, // #19516 read-only properties
|
|
1617
|
+
/perspective/,
|
|
1618
|
+
/TapHighlightColor/,
|
|
1619
|
+
/^transition/,
|
|
1620
|
+
/^length$/, // #7700
|
|
1621
|
+
/^\d+$/ // #17538
|
|
1622
|
+
];
|
|
1623
|
+
// These ones are translated to attributes rather than styles
|
|
1624
|
+
Exporting.inlineToAttributes = [
|
|
1625
|
+
'fill',
|
|
1626
|
+
'stroke',
|
|
1627
|
+
'strokeLinecap',
|
|
1628
|
+
'strokeLinejoin',
|
|
1629
|
+
'strokeWidth',
|
|
1630
|
+
'textAnchor',
|
|
1631
|
+
'x',
|
|
1632
|
+
'y'
|
|
1633
|
+
];
|
|
1634
|
+
// Milliseconds to defer image load event handlers to offset IE bug
|
|
1635
|
+
Exporting.loadEventDeferDelay = isMS ? 150 : 0;
|
|
1636
|
+
Exporting.unstyledElements = [
|
|
1637
|
+
'clipPath',
|
|
1638
|
+
'defs',
|
|
1639
|
+
'desc'
|
|
1640
|
+
];
|
|
1641
|
+
/* *
|
|
1642
|
+
*
|
|
1643
|
+
* Class Namespace
|
|
1644
|
+
*
|
|
1645
|
+
* */
|
|
1646
|
+
(function (Exporting) {
|
|
1647
|
+
/* *
|
|
1648
|
+
*
|
|
1649
|
+
* Declarations
|
|
1650
|
+
*
|
|
1651
|
+
* */
|
|
1652
|
+
/* *
|
|
1653
|
+
*
|
|
1654
|
+
* Functions
|
|
1655
|
+
*
|
|
1656
|
+
* */
|
|
1657
|
+
/**
|
|
1658
|
+
* Composition function.
|
|
1659
|
+
*
|
|
1660
|
+
* @private
|
|
1661
|
+
* @function Highcharts.Exporting#compose
|
|
1662
|
+
*
|
|
1663
|
+
* @param {ChartClass} ChartClass
|
|
1664
|
+
* Chart class.
|
|
1665
|
+
* @param {SVGRendererClass} SVGRendererClass
|
|
1666
|
+
* SVGRenderer class.
|
|
1667
|
+
*
|
|
1668
|
+
* @requires modules/exporting
|
|
1669
|
+
*/
|
|
1670
|
+
function compose(ChartClass, SVGRendererClass) {
|
|
1671
|
+
ExportingSymbols.compose(SVGRendererClass);
|
|
1672
|
+
Fullscreen.compose(ChartClass);
|
|
1673
|
+
// Check the composition registry for the Exporting
|
|
1674
|
+
if (!pushUnique(composed, 'Exporting')) {
|
|
1675
|
+
return;
|
|
1676
|
+
}
|
|
1677
|
+
// Adding wrappers for the deprecated functions
|
|
1678
|
+
extend(Chart.prototype, {
|
|
1679
|
+
exportChart: async function (exportingOptions, chartOptions) {
|
|
1680
|
+
await this.exporting?.exportChart(exportingOptions, chartOptions);
|
|
1681
|
+
return;
|
|
1682
|
+
},
|
|
1683
|
+
getChartHTML: function (applyStyleSheets) {
|
|
1684
|
+
return this.exporting?.getChartHTML(applyStyleSheets);
|
|
1685
|
+
},
|
|
1686
|
+
getFilename: function () {
|
|
1687
|
+
return this.exporting?.getFilename();
|
|
1688
|
+
},
|
|
1689
|
+
getSVG: function (chartOptions) {
|
|
1690
|
+
return this.exporting?.getSVG(chartOptions);
|
|
1691
|
+
},
|
|
1692
|
+
print: function () {
|
|
1693
|
+
return this.exporting?.print();
|
|
1694
|
+
}
|
|
1695
|
+
});
|
|
1696
|
+
ChartClass.prototype.callbacks.push(chartCallback);
|
|
1697
|
+
addEvent(ChartClass, 'afterInit', onChartAfterInit);
|
|
1698
|
+
addEvent(ChartClass, 'layOutTitle', onChartLayOutTitle);
|
|
1699
|
+
if (isSafari) {
|
|
1700
|
+
win.matchMedia('print').addListener(function (mqlEvent) {
|
|
1701
|
+
if (!Exporting.printingChart) {
|
|
1702
|
+
return void 0;
|
|
1703
|
+
}
|
|
1704
|
+
if (mqlEvent.matches) {
|
|
1705
|
+
Exporting.printingChart.exporting?.beforePrint();
|
|
1706
|
+
}
|
|
1707
|
+
else {
|
|
1708
|
+
Exporting.printingChart.exporting?.afterPrint();
|
|
1709
|
+
}
|
|
1710
|
+
});
|
|
1711
|
+
}
|
|
1712
|
+
// Update with defaults of the exporting module
|
|
1713
|
+
setOptions(ExportingDefaults);
|
|
1714
|
+
}
|
|
1715
|
+
Exporting.compose = compose;
|
|
1716
|
+
/**
|
|
1717
|
+
* Function that is added to the callbacks array that runs on chart load.
|
|
1718
|
+
*
|
|
1719
|
+
* @private
|
|
1720
|
+
* @function Highcharts#chartCallback
|
|
1721
|
+
*
|
|
1722
|
+
* @param {Highcharts.Chart} chart
|
|
1723
|
+
* The chart instance.
|
|
1724
|
+
*
|
|
1725
|
+
* @requires modules/exporting
|
|
1726
|
+
*/
|
|
1727
|
+
function chartCallback(chart) {
|
|
1728
|
+
const exporting = chart.exporting;
|
|
1729
|
+
if (exporting) {
|
|
1730
|
+
exporting.render();
|
|
1731
|
+
// Add the exporting buttons on each chart redraw
|
|
1732
|
+
addEvent(chart, 'redraw', function () {
|
|
1733
|
+
this.exporting?.render();
|
|
1734
|
+
});
|
|
1735
|
+
// Destroy the export elements at chart destroy
|
|
1736
|
+
addEvent(chart, 'destroy', function () {
|
|
1737
|
+
this.exporting?.destroy();
|
|
1738
|
+
});
|
|
1739
|
+
}
|
|
1740
|
+
// Uncomment this to see a button directly below the chart, for quick
|
|
1741
|
+
// testing of export
|
|
1742
|
+
// let button, viewImage, viewSource;
|
|
1743
|
+
// if (!chart.renderer.forExport) {
|
|
1744
|
+
// viewImage = function (): void {
|
|
1745
|
+
// const div = doc.createElement('div');
|
|
1746
|
+
// div.innerHTML = chart.exporting?.getSVGForExport() || '';
|
|
1747
|
+
// chart.renderTo.parentNode.appendChild(div);
|
|
1748
|
+
// };
|
|
1749
|
+
// viewSource = function (): void {
|
|
1750
|
+
// const pre = doc.createElement('pre');
|
|
1751
|
+
// pre.innerHTML = chart.exporting?.getSVGForExport()
|
|
1752
|
+
// .replace(/</g, '\n<')
|
|
1753
|
+
// .replace(/>/g, '>') || '';
|
|
1754
|
+
// chart.renderTo.parentNode.appendChild(pre);
|
|
1755
|
+
// };
|
|
1756
|
+
// viewImage();
|
|
1757
|
+
// // View SVG Image
|
|
1758
|
+
// button = doc.createElement('button');
|
|
1759
|
+
// button.innerHTML = 'View SVG Image';
|
|
1760
|
+
// chart.renderTo.parentNode.appendChild(button);
|
|
1761
|
+
// button.onclick = viewImage;
|
|
1762
|
+
// // View SVG Source
|
|
1763
|
+
// button = doc.createElement('button');
|
|
1764
|
+
// button.innerHTML = 'View SVG Source';
|
|
1765
|
+
// chart.renderTo.parentNode.appendChild(button);
|
|
1766
|
+
// button.onclick = viewSource;
|
|
1767
|
+
// }
|
|
1768
|
+
}
|
|
1769
|
+
/**
|
|
1770
|
+
* Add update methods to handle chart.update and chart.exporting.update and
|
|
1771
|
+
* chart.navigation.update. These must be added to the chart instance rather
|
|
1772
|
+
* than the Chart prototype in order to use the chart instance inside the
|
|
1773
|
+
* update function.
|
|
1774
|
+
*
|
|
1775
|
+
* @private
|
|
1776
|
+
* @function Highcharts#onChartAfterInit
|
|
1777
|
+
*
|
|
1778
|
+
* @requires modules/exporting
|
|
1779
|
+
*/
|
|
1780
|
+
function onChartAfterInit() {
|
|
1781
|
+
const chart = this;
|
|
1782
|
+
// Create the exporting instance
|
|
1783
|
+
if (chart.options.exporting) {
|
|
1784
|
+
/**
|
|
1785
|
+
* Exporting object.
|
|
1786
|
+
*
|
|
1787
|
+
* @name Highcharts.Chart#exporting
|
|
1788
|
+
* @type {Highcharts.Exporting}
|
|
1789
|
+
*/
|
|
1790
|
+
chart.exporting = new Exporting(chart, chart.options.exporting);
|
|
1791
|
+
// Register update() method for navigation. Cannot be set the same
|
|
1792
|
+
// way as for exporting, because navigation options are shared with
|
|
1793
|
+
// bindings which has separate update() logic.
|
|
1794
|
+
ChartNavigationComposition
|
|
1795
|
+
.compose(chart).navigation
|
|
1796
|
+
.addUpdate((options, redraw) => {
|
|
1797
|
+
if (chart.exporting) {
|
|
1798
|
+
chart.exporting.isDirty = true;
|
|
1799
|
+
merge(true, chart.options.navigation, options);
|
|
1800
|
+
if (pick(redraw, true)) {
|
|
1801
|
+
chart.redraw();
|
|
1802
|
+
}
|
|
1803
|
+
}
|
|
1804
|
+
});
|
|
1805
|
+
}
|
|
1806
|
+
}
|
|
1807
|
+
/**
|
|
1808
|
+
* On layout of titles (title, subtitle and caption), adjust the `alignTo`
|
|
1809
|
+
* box to avoid the context menu button.
|
|
1810
|
+
*
|
|
1811
|
+
* @private
|
|
1812
|
+
* @function Highcharts#onChartLayOutTitle
|
|
1813
|
+
*
|
|
1814
|
+
* @requires modules/exporting
|
|
1815
|
+
*/
|
|
1816
|
+
function onChartLayOutTitle({ alignTo, key, textPxLength }) {
|
|
1817
|
+
const exportingOptions = this.options.exporting, { align, buttonSpacing = 0, verticalAlign, width = 0 } = merge(this.options.navigation?.buttonOptions, exportingOptions?.buttons?.contextButton), space = alignTo.width - textPxLength, widthAdjust = width + buttonSpacing;
|
|
1818
|
+
if ((exportingOptions?.enabled ?? true) &&
|
|
1819
|
+
key === 'title' &&
|
|
1820
|
+
align === 'right' &&
|
|
1821
|
+
verticalAlign === 'top') {
|
|
1822
|
+
if (space < 2 * widthAdjust) {
|
|
1823
|
+
if (space < widthAdjust) {
|
|
1824
|
+
alignTo.width -= widthAdjust;
|
|
1825
|
+
}
|
|
1826
|
+
else if (this.title?.alignValue !== 'left') {
|
|
1827
|
+
alignTo.x -= widthAdjust - space / 2;
|
|
1828
|
+
}
|
|
1829
|
+
}
|
|
1183
1830
|
}
|
|
1184
|
-
svg = svg
|
|
1185
|
-
.replace(/zIndex="[^"]+"/g, '')
|
|
1186
|
-
.replace(/symbolName="[^"]+"/g, '')
|
|
1187
|
-
.replace(/jQuery\d+="[^"]+"/g, '')
|
|
1188
|
-
.replace(/url\(("|")(.*?)("|")\;?\)/g, 'url($2)')
|
|
1189
|
-
.replace(/url\([^#]+#/g, 'url(#')
|
|
1190
|
-
.replace(/<svg /, '<svg xmlns:xlink="http://www.w3.org/1999/xlink" ')
|
|
1191
|
-
.replace(/ (NS\d+\:)?href=/g, ' xlink:href=') // #3567
|
|
1192
|
-
.replace(/\n+/g, ' ')
|
|
1193
|
-
// Replace HTML entities, issue #347
|
|
1194
|
-
.replace(/ /g, '\u00A0') // No-break space
|
|
1195
|
-
.replace(/­/g, '\u00AD'); // Soft hyphen
|
|
1196
|
-
return svg;
|
|
1197
1831
|
}
|
|
1198
1832
|
})(Exporting || (Exporting = {}));
|
|
1199
1833
|
/* *
|
|
@@ -1214,10 +1848,9 @@ export default Exporting;
|
|
|
1214
1848
|
* @callback Highcharts.ExportingAfterPrintCallbackFunction
|
|
1215
1849
|
*
|
|
1216
1850
|
* @param {Highcharts.Chart} this
|
|
1217
|
-
*
|
|
1218
|
-
*
|
|
1851
|
+
* The chart on which the event occurred.
|
|
1219
1852
|
* @param {global.Event} event
|
|
1220
|
-
*
|
|
1853
|
+
* The event that occurred.
|
|
1221
1854
|
*/
|
|
1222
1855
|
/**
|
|
1223
1856
|
* Gets fired before a chart is printed through the context menu item or the
|
|
@@ -1226,10 +1859,9 @@ export default Exporting;
|
|
|
1226
1859
|
* @callback Highcharts.ExportingBeforePrintCallbackFunction
|
|
1227
1860
|
*
|
|
1228
1861
|
* @param {Highcharts.Chart} this
|
|
1229
|
-
*
|
|
1230
|
-
*
|
|
1862
|
+
* The chart on which the event occurred.
|
|
1231
1863
|
* @param {global.Event} event
|
|
1232
|
-
*
|
|
1864
|
+
* The event that occurred.
|
|
1233
1865
|
*/
|
|
1234
1866
|
/**
|
|
1235
1867
|
* Function to call if the offline-exporting module fails to export a chart on
|
|
@@ -1238,10 +1870,9 @@ export default Exporting;
|
|
|
1238
1870
|
* @callback Highcharts.ExportingErrorCallbackFunction
|
|
1239
1871
|
*
|
|
1240
1872
|
* @param {Highcharts.ExportingOptions} options
|
|
1241
|
-
*
|
|
1242
|
-
*
|
|
1873
|
+
* The exporting options.
|
|
1243
1874
|
* @param {global.Error} err
|
|
1244
|
-
*
|
|
1875
|
+
* The error from the module.
|
|
1245
1876
|
*/
|
|
1246
1877
|
/**
|
|
1247
1878
|
* Definition for a menu item in the context menu.
|
|
@@ -1251,27 +1882,27 @@ export default Exporting;
|
|
|
1251
1882
|
* The text for the menu item.
|
|
1252
1883
|
*
|
|
1253
1884
|
* @name Highcharts.ExportingMenuObject#text
|
|
1254
|
-
* @type {string|undefined}
|
|
1885
|
+
* @type {string | undefined}
|
|
1255
1886
|
*/ /**
|
|
1256
1887
|
* If internationalization is required, the key to a language string.
|
|
1257
1888
|
*
|
|
1258
1889
|
* @name Highcharts.ExportingMenuObject#textKey
|
|
1259
|
-
* @type {string|undefined}
|
|
1890
|
+
* @type {string | undefined}
|
|
1260
1891
|
*/ /**
|
|
1261
1892
|
* The click handler for the menu item.
|
|
1262
1893
|
*
|
|
1263
1894
|
* @name Highcharts.ExportingMenuObject#onclick
|
|
1264
|
-
* @type {Highcharts.EventCallbackFunction<Highcharts.Chart
|
|
1895
|
+
* @type {Highcharts.EventCallbackFunction<Highcharts.Chart> | undefined}
|
|
1265
1896
|
*/ /**
|
|
1266
1897
|
* Indicates a separator line instead of an item.
|
|
1267
1898
|
*
|
|
1268
1899
|
* @name Highcharts.ExportingMenuObject#separator
|
|
1269
|
-
* @type {boolean|undefined}
|
|
1900
|
+
* @type {boolean | undefined}
|
|
1270
1901
|
*/
|
|
1271
1902
|
/**
|
|
1272
1903
|
* Possible MIME types for exporting.
|
|
1273
1904
|
*
|
|
1274
|
-
* @typedef {"image/png"|"image/jpeg"|"application/pdf"|"image/svg+xml"} Highcharts.ExportingMimeTypeValue
|
|
1905
|
+
* @typedef {"image/png" | "image/jpeg" | "application/pdf" | "image/svg+xml"} Highcharts.ExportingMimeTypeValue
|
|
1275
1906
|
*/
|
|
1276
1907
|
(''); // Keeps doclets above in transpiled file
|
|
1277
1908
|
/* *
|
|
@@ -1284,12 +1915,12 @@ export default Exporting;
|
|
|
1284
1915
|
* `Chart.print` method.
|
|
1285
1916
|
*
|
|
1286
1917
|
* @sample highcharts/chart/events-beforeprint-afterprint/
|
|
1287
|
-
*
|
|
1918
|
+
* Rescale the chart to print
|
|
1288
1919
|
*
|
|
1289
|
-
* @type
|
|
1290
|
-
* @since
|
|
1291
|
-
* @context
|
|
1292
|
-
* @requires
|
|
1920
|
+
* @type {Highcharts.ExportingAfterPrintCallbackFunction}
|
|
1921
|
+
* @since 4.1.0
|
|
1922
|
+
* @context Highcharts.Chart
|
|
1923
|
+
* @requires modules/exporting
|
|
1293
1924
|
* @apioption chart.events.afterPrint
|
|
1294
1925
|
*/
|
|
1295
1926
|
/**
|
|
@@ -1297,12 +1928,12 @@ export default Exporting;
|
|
|
1297
1928
|
* the `Chart.print` method.
|
|
1298
1929
|
*
|
|
1299
1930
|
* @sample highcharts/chart/events-beforeprint-afterprint/
|
|
1300
|
-
*
|
|
1931
|
+
* Rescale the chart to print
|
|
1301
1932
|
*
|
|
1302
|
-
* @type
|
|
1303
|
-
* @since
|
|
1304
|
-
* @context
|
|
1305
|
-
* @requires
|
|
1933
|
+
* @type {Highcharts.ExportingBeforePrintCallbackFunction}
|
|
1934
|
+
* @since 4.1.0
|
|
1935
|
+
* @context Highcharts.Chart
|
|
1936
|
+
* @requires modules/exporting
|
|
1306
1937
|
* @apioption chart.events.beforePrint
|
|
1307
1938
|
*/
|
|
1308
1939
|
(''); // Keeps doclets above in transpiled file
|