@progress/kendo-charts 2.7.2-dev.202502101310 → 2.7.2-develop.1
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/dist/cdn/js/kendo-charts.js +1 -1
- package/dist/cdn/main.js +1 -1
- package/dist/es/barcode/barcode-validator.js +10 -12
- package/dist/es/barcode/barcode.js +84 -96
- package/dist/es/barcode/encodings/code11.js +41 -57
- package/dist/es/barcode/encodings/code128.js +222 -354
- package/dist/es/barcode/encodings/code39-extended.js +20 -34
- package/dist/es/barcode/encodings/code39.js +49 -75
- package/dist/es/barcode/encodings/code93-extended.js +12 -24
- package/dist/es/barcode/encodings/code93.js +52 -70
- package/dist/es/barcode/encodings/ean13.js +28 -42
- package/dist/es/barcode/encodings/ean8.js +8 -18
- package/dist/es/barcode/encodings/encoding.js +18 -24
- package/dist/es/barcode/encodings/main.js +13 -10
- package/dist/es/barcode/encodings/msi.js +56 -112
- package/dist/es/barcode/encodings/postnet.js +31 -45
- package/dist/es/barcode/surface-size.js +2 -2
- package/dist/es/chart/aggregates/aggregates.js +23 -23
- package/dist/es/chart/aggregates/default-aggregates.js +10 -18
- package/dist/es/chart/aggregates/series-aggregator.js +42 -54
- package/dist/es/chart/animations/bar-chart-animation.js +15 -26
- package/dist/es/chart/animations/bubble-animation.js +7 -17
- package/dist/es/chart/animations/clip-animation.js +13 -23
- package/dist/es/chart/animations/fade-in-animation.js +6 -16
- package/dist/es/chart/animations/pie-animation.js +6 -16
- package/dist/es/chart/api-elements/chart-axis.js +14 -22
- package/dist/es/chart/api-elements/chart-pane.js +10 -8
- package/dist/es/chart/api-elements/chart-plotarea.js +4 -10
- package/dist/es/chart/api-elements/find-axis-by-name.js +1 -1
- package/dist/es/chart/area-chart/area-chart.js +46 -60
- package/dist/es/chart/area-chart/area-segment.js +46 -52
- package/dist/es/chart/area-chart/spline-area-segment.js +12 -21
- package/dist/es/chart/area-chart/step-area-segment.js +6 -15
- package/dist/es/chart/axis-group-range-tracker.js +14 -20
- package/dist/es/chart/bar-chart/bar-chart.js +65 -80
- package/dist/es/chart/bar-chart/bar-label.js +25 -32
- package/dist/es/chart/bar-chart/bar.js +76 -91
- package/dist/es/chart/box-plot-chart/box-plot-chart.js +33 -48
- package/dist/es/chart/box-plot-chart/box-plot.js +55 -68
- package/dist/es/chart/box-plot-chart/vertical-box-plot.js +13 -23
- package/dist/es/chart/bubble-chart/bubble-chart.js +51 -64
- package/dist/es/chart/bubble-chart/bubble.js +21 -27
- package/dist/es/chart/bullet-chart/bullet-chart.js +45 -57
- package/dist/es/chart/bullet-chart/bullet.js +48 -57
- package/dist/es/chart/bullet-chart/target.js +1 -11
- package/dist/es/chart/candlestick-chart/candlestick-chart.js +41 -55
- package/dist/es/chart/candlestick-chart/candlestick.js +60 -69
- package/dist/es/chart/categorical-chart.js +178 -206
- package/dist/es/chart/chart-container.js +30 -39
- package/dist/es/chart/chart.js +641 -701
- package/dist/es/chart/constants.js +103 -103
- package/dist/es/chart/crosshair/crosshair-tooltip.js +22 -34
- package/dist/es/chart/crosshair/crosshair.js +39 -47
- package/dist/es/chart/donut-chart/donut-chart.js +36 -48
- package/dist/es/chart/donut-chart/donut-segment.js +12 -24
- package/dist/es/chart/error-bars/categorical-error-bar.js +5 -15
- package/dist/es/chart/error-bars/error-bar-base.js +37 -49
- package/dist/es/chart/error-bars/error-range-calculator.js +46 -56
- package/dist/es/chart/error-bars/scatter-error-bar.js +6 -16
- package/dist/es/chart/funnel-chart/funnel-chart.js +86 -103
- package/dist/es/chart/funnel-chart/funnel-segment.js +46 -54
- package/dist/es/chart/funnel-chart/pyramid-chart.js +5 -11
- package/dist/es/chart/heatmap-chart/color-scale.js +7 -9
- package/dist/es/chart/heatmap-chart/heatmap-chart.js +87 -110
- package/dist/es/chart/heatmap-chart/heatmap-point.js +72 -78
- package/dist/es/chart/highlight.js +26 -36
- package/dist/es/chart/layout/cluster-layout.js +16 -25
- package/dist/es/chart/layout/radar-cluster-layout.js +15 -24
- package/dist/es/chart/layout/radar-stack-layout.js +10 -22
- package/dist/es/chart/layout/stack-wrap.js +12 -24
- package/dist/es/chart/layout/utils.js +2 -2
- package/dist/es/chart/legend/legend-item-line-area.js +8 -19
- package/dist/es/chart/legend/legend-item-line.js +21 -31
- package/dist/es/chart/legend/legend-item-marker.js +18 -28
- package/dist/es/chart/legend/legend-item-square.js +8 -18
- package/dist/es/chart/legend/legend-item.js +91 -105
- package/dist/es/chart/legend/legend-layout.js +18 -25
- package/dist/es/chart/legend/legend.js +68 -92
- package/dist/es/chart/line-chart/line-chart.js +35 -48
- package/dist/es/chart/line-chart/line-point.js +90 -103
- package/dist/es/chart/line-chart/line-segment.js +23 -34
- package/dist/es/chart/line-chart/spline-segment.js +10 -20
- package/dist/es/chart/line-chart/step-line-mixin.js +14 -17
- package/dist/es/chart/line-chart/step-line-segment.js +4 -14
- package/dist/es/chart/mixins/accessibility-attributes-mixin.js +7 -7
- package/dist/es/chart/mixins/clip-animation-mixin.js +7 -7
- package/dist/es/chart/mixins/line-chart-mixin.js +27 -31
- package/dist/es/chart/mixins/note-mixin.js +3 -3
- package/dist/es/chart/mixins/pie-chart-mixin.js +9 -9
- package/dist/es/chart/mixins/plotarea-events-mixin.js +1 -1
- package/dist/es/chart/mixins/point-events-mixin.js +1 -1
- package/dist/es/chart/ohlc-chart/ohlc-chart.js +4 -14
- package/dist/es/chart/ohlc-chart/ohlc-point.js +15 -28
- package/dist/es/chart/pan-and-zoom/accept-key.js +3 -3
- package/dist/es/chart/pan-and-zoom/mousewheel-zoom.js +25 -33
- package/dist/es/chart/pan-and-zoom/pannable.js +29 -37
- package/dist/es/chart/pan-and-zoom/to-chart-axis-ranges.js +3 -3
- package/dist/es/chart/pan-and-zoom/zoom-selection.js +61 -70
- package/dist/es/chart/pane.js +71 -79
- package/dist/es/chart/pie-chart/pie-chart.js +153 -183
- package/dist/es/chart/pie-chart/pie-segment.js +82 -98
- package/dist/es/chart/plotarea/categorical-plotarea.js +285 -318
- package/dist/es/chart/plotarea/donut-plotarea.js +12 -22
- package/dist/es/chart/plotarea/funnel-plotarea.js +17 -27
- package/dist/es/chart/plotarea/heatmap-plotarea.js +139 -167
- package/dist/es/chart/plotarea/pie-plotarea.js +15 -25
- package/dist/es/chart/plotarea/plotarea-base.js +423 -462
- package/dist/es/chart/plotarea/plotarea-factory.js +15 -20
- package/dist/es/chart/plotarea/polar-plotarea-base.js +37 -51
- package/dist/es/chart/plotarea/polar-plotarea.js +39 -49
- package/dist/es/chart/plotarea/radar-plotarea.js +55 -65
- package/dist/es/chart/plotarea/xy-plotarea.js +111 -128
- package/dist/es/chart/polar-area-chart/polar-area-chart.js +22 -36
- package/dist/es/chart/polar-area-chart/polar-area-segment.js +7 -17
- package/dist/es/chart/polar-area-chart/spline-polar-area-segment.js +15 -25
- package/dist/es/chart/polar-line-chart/polar-line-chart.js +2 -11
- package/dist/es/chart/polar-scatter-chart/polar-scatter-chart.js +6 -16
- package/dist/es/chart/radar-area-chart/radar-area-chart.js +11 -21
- package/dist/es/chart/radar-area-chart/radar-area-segment.js +3 -13
- package/dist/es/chart/radar-area-chart/spline-radar-area-segment.js +3 -13
- package/dist/es/chart/radar-bar-chart/radar-bar-chart.js +19 -29
- package/dist/es/chart/radar-bar-chart/radar-segment.js +6 -12
- package/dist/es/chart/radar-line-chart/radar-line-chart.js +26 -35
- package/dist/es/chart/range-area-chart/range-area-chart.js +46 -58
- package/dist/es/chart/range-area-chart/range-area-point.js +55 -66
- package/dist/es/chart/range-area-chart/range-area-segment.js +19 -28
- package/dist/es/chart/range-area-chart/range-line-point.js +4 -14
- package/dist/es/chart/range-area-chart/spline-range-area-segment.js +11 -18
- package/dist/es/chart/range-area-chart/step-range-area-segment.js +7 -16
- package/dist/es/chart/range-bar-chart/range-bar-chart.js +18 -29
- package/dist/es/chart/range-bar-chart/range-bar.js +10 -23
- package/dist/es/chart/register-charts.js +20 -16
- package/dist/es/chart/scatter-charts/scatter-chart.js +100 -122
- package/dist/es/chart/scatter-charts/scatter-line-chart.js +15 -25
- package/dist/es/chart/selection.js +176 -201
- package/dist/es/chart/series-binder.js +55 -66
- package/dist/es/chart/theme/base-theme.js +75 -79
- package/dist/es/chart/theme/load-theme.js +52 -52
- package/dist/es/chart/tooltip/base-tooltip.js +17 -24
- package/dist/es/chart/tooltip/shared-tooltip.js +25 -31
- package/dist/es/chart/tooltip/tooltip.js +10 -20
- package/dist/es/chart/trendlines/calculate-moving-average.js +11 -13
- package/dist/es/chart/trendlines/calculate-polynomial.js +24 -26
- package/dist/es/chart/trendlines/calculate-slope.js +12 -14
- package/dist/es/chart/trendlines/check-all-positive.js +2 -5
- package/dist/es/chart/trendlines/exponential-trendline.js +15 -24
- package/dist/es/chart/trendlines/get-scatter-trendline-data.js +6 -7
- package/dist/es/chart/trendlines/get-trendline-data.js +6 -6
- package/dist/es/chart/trendlines/linear-trendline.js +12 -21
- package/dist/es/chart/trendlines/logarithmic-trendline.js +14 -23
- package/dist/es/chart/trendlines/moving-average.js +15 -26
- package/dist/es/chart/trendlines/polynomial-trendline.js +13 -21
- package/dist/es/chart/trendlines/power-trendline.js +15 -24
- package/dist/es/chart/trendlines/scatter-exponential-trendline.js +15 -24
- package/dist/es/chart/trendlines/scatter-linear-trendline.js +10 -16
- package/dist/es/chart/trendlines/scatter-logarithmic-trendline.js +17 -27
- package/dist/es/chart/trendlines/scatter-moving-average.js +7 -10
- package/dist/es/chart/trendlines/scatter-polynomial-trendline.js +11 -16
- package/dist/es/chart/trendlines/scatter-power-trendline.js +15 -22
- package/dist/es/chart/trendlines/scatter-trendline-registry.js +1 -1
- package/dist/es/chart/trendlines/scatter-value-getter.js +2 -5
- package/dist/es/chart/trendlines/trendline-factory.js +1 -1
- package/dist/es/chart/trendlines/trendline-registry.js +1 -1
- package/dist/es/chart/trendlines/x-value-limits.js +6 -8
- package/dist/es/chart/utils/any-has-z-index.js +1 -1
- package/dist/es/chart/utils/bind-segments.js +8 -8
- package/dist/es/chart/utils/categories-count.js +3 -3
- package/dist/es/chart/utils/count-numbers.js +4 -4
- package/dist/es/chart/utils/create-out-of-range-points.js +13 -22
- package/dist/es/chart/utils/eval-options.js +7 -10
- package/dist/es/chart/utils/filter-series-by-type.js +4 -4
- package/dist/es/chart/utils/get-field.js +1 -1
- package/dist/es/chart/utils/has-gradient-overlay.js +1 -1
- package/dist/es/chart/utils/is-date-axis.js +2 -2
- package/dist/es/chart/utils/parse-date-category.js +2 -2
- package/dist/es/chart/utils/segment-visible.js +2 -2
- package/dist/es/chart/waterfall-chart/waterfall-chart.js +41 -55
- package/dist/es/chart/waterfall-chart/waterfall-segment.js +16 -24
- package/dist/es/chart-wizard/get-wizard-data-from-data-rows.js +5 -6
- package/dist/es/chart-wizard/messages.js +1 -1
- package/dist/es/chart-wizard/state.js +145 -137
- package/dist/es/chart-wizard.js +12 -12
- package/dist/es/common/add-class.js +3 -3
- package/dist/es/common/align-path-to-pixel.js +2 -2
- package/dist/es/common/auto-text-color.js +1 -1
- package/dist/es/common/constants.js +53 -53
- package/dist/es/common/create-hash-set.js +59 -65
- package/dist/es/common/cycleDown.js +1 -1
- package/dist/es/common/deep-extend.js +10 -12
- package/dist/es/common/element-scale.js +9 -9
- package/dist/es/common/element-styles.js +8 -8
- package/dist/es/common/event-map.js +4 -4
- package/dist/es/common/event-utils.js +13 -13
- package/dist/es/common/find.js +2 -2
- package/dist/es/common/font-loader.js +42 -44
- package/dist/es/common/get-aria-template.js +2 -4
- package/dist/es/common/get-spacing.js +2 -4
- package/dist/es/common/get-supported-features.js +7 -7
- package/dist/es/common/get-template.js +2 -4
- package/dist/es/common/getter.js +5 -5
- package/dist/es/common/grep.js +3 -3
- package/dist/es/common/has-classes.js +2 -2
- package/dist/es/common/hash-map.js +11 -11
- package/dist/es/common/instance-observer.js +28 -33
- package/dist/es/common/keys.js +1 -1
- package/dist/es/common/map.js +4 -4
- package/dist/es/common/matrix.js +142 -150
- package/dist/es/common/mousewheel-delta.js +2 -2
- package/dist/es/common/observable.js +40 -52
- package/dist/es/common/remove-class.js +1 -1
- package/dist/es/common/render-icon.js +50 -60
- package/dist/es/common/set-default-options.js +1 -1
- package/dist/es/common/sparse-array-limits.js +4 -4
- package/dist/es/common/user-events.js +124 -150
- package/dist/es/core/axis-label.js +38 -43
- package/dist/es/core/axis.js +293 -345
- package/dist/es/core/box-element.js +36 -46
- package/dist/es/core/box.js +75 -83
- package/dist/es/core/category-axis.js +265 -314
- package/dist/es/core/chart-element.js +98 -109
- package/dist/es/core/constants.js +3 -3
- package/dist/es/core/curve-processor.js +86 -93
- package/dist/es/core/date-category-axis.js +381 -413
- package/dist/es/core/date-value-axis.js +108 -118
- package/dist/es/core/float-element.js +54 -78
- package/dist/es/core/gradients.js +3 -3
- package/dist/es/core/logarithmic-axis.js +134 -186
- package/dist/es/core/mixins/grid-lines-mixin.js +18 -20
- package/dist/es/core/mixins/radar-numeric-axis-mixin.js +46 -51
- package/dist/es/core/note.js +58 -73
- package/dist/es/core/numeric-axis.js +111 -133
- package/dist/es/core/pattern.js +4 -8
- package/dist/es/core/point.js +25 -34
- package/dist/es/core/polar-axis.js +73 -91
- package/dist/es/core/radar-category-axis.js +90 -114
- package/dist/es/core/radar-logarithmic-axis.js +10 -20
- package/dist/es/core/radar-numeric-axis.js +10 -20
- package/dist/es/core/ring.js +61 -68
- package/dist/es/core/root-element.js +40 -48
- package/dist/es/core/sector.js +11 -17
- package/dist/es/core/shape-builder.js +13 -23
- package/dist/es/core/shape-element.js +27 -37
- package/dist/es/core/text-box.js +50 -59
- package/dist/es/core/text.js +13 -24
- package/dist/es/core/title.js +19 -25
- package/dist/es/core/utils/auto-axis-max.js +3 -3
- package/dist/es/core/utils/auto-axis-min.js +3 -3
- package/dist/es/core/utils/auto-major-unit.js +4 -4
- package/dist/es/core/utils/box-diff.js +9 -9
- package/dist/es/core/utils/create-axis-grid-line.js +2 -4
- package/dist/es/core/utils/create-axis-tick.js +2 -4
- package/dist/es/core/utils/guid.js +3 -3
- package/dist/es/core/utils/rect-to-box.js +2 -2
- package/dist/es/date-utils/absolute-date-diff.js +2 -2
- package/dist/es/date-utils/add-duration.js +5 -5
- package/dist/es/date-utils/ceil-date.js +1 -1
- package/dist/es/date-utils/constants.js +17 -17
- package/dist/es/date-utils/date-index.js +3 -3
- package/dist/es/date-utils/duration.js +1 -1
- package/dist/es/date-utils/lte-date-index.js +4 -4
- package/dist/es/date-utils/parse-date.js +1 -1
- package/dist/es/date-utils/parse-dates.js +2 -2
- package/dist/es/date-utils/start-of-week.js +3 -5
- package/dist/es/date-utils/to-date.js +1 -1
- package/dist/es/date-utils/to-time.js +2 -2
- package/dist/es/drawing-utils.js +18 -17
- package/dist/es/gauges/arc/arc-gauge.js +29 -38
- package/dist/es/gauges/arc/arc-scale.js +16 -29
- package/dist/es/gauges/arc/range-pointer-animation.js +16 -25
- package/dist/es/gauges/arc/range-pointer.js +25 -46
- package/dist/es/gauges/circular/circular-gauge.js +7 -17
- package/dist/es/gauges/constants.js +14 -14
- package/dist/es/gauges/gauge.js +84 -96
- package/dist/es/gauges/linear/arrow-linear-pointer-animation.js +13 -25
- package/dist/es/gauges/linear/arrow-linear-pointer.js +23 -35
- package/dist/es/gauges/linear/bar-linear-pointer-animation.js +15 -24
- package/dist/es/gauges/linear/bar-linear-pointer.js +38 -51
- package/dist/es/gauges/linear/linear-gauge.js +61 -83
- package/dist/es/gauges/linear/linear-pointer.js +25 -39
- package/dist/es/gauges/linear/linear-scale.js +57 -74
- package/dist/es/gauges/pointer.js +11 -21
- package/dist/es/gauges/radial/radial-gauge.js +58 -81
- package/dist/es/gauges/radial/radial-pointer-animation.js +9 -15
- package/dist/es/gauges/radial/radial-pointer.js +33 -48
- package/dist/es/gauges/radial/radial-scale.js +154 -186
- package/dist/es/gauges/utils/build-label-element.js +10 -12
- package/dist/es/gauges/utils/get-range.js +2 -2
- package/dist/es/gauges/utils/pad.js +3 -3
- package/dist/es/gauges/utils/unpad.js +1 -1
- package/dist/es/map/attribution.js +42 -52
- package/dist/es/map/constants.js +5 -5
- package/dist/es/map/crs.js +68 -112
- package/dist/es/map/datums.js +3 -3
- package/dist/es/map/extent.js +40 -54
- package/dist/es/map/layers/bubble.js +52 -70
- package/dist/es/map/layers/layer.js +50 -56
- package/dist/es/map/layers/marker.js +109 -129
- package/dist/es/map/layers/shape.js +111 -133
- package/dist/es/map/layers/tile.js +144 -170
- package/dist/es/map/location.js +70 -78
- package/dist/es/map/map.js +261 -291
- package/dist/es/map/navigator.js +33 -39
- package/dist/es/map/scroller/draggable.js +98 -134
- package/dist/es/map/scroller/fx.js +39 -46
- package/dist/es/map/scroller/scroller.js +144 -174
- package/dist/es/map/tooltip/tooltip.js +15 -25
- package/dist/es/map/utils.js +25 -26
- package/dist/es/map/zoom.js +30 -36
- package/dist/es/qrcode/encodings/data-modes/alpha-numeric-data-mode.js +14 -26
- package/dist/es/qrcode/encodings/data-modes/byte-data-mode.js +15 -25
- package/dist/es/qrcode/encodings/data-modes/data-mode-instances.js +8 -7
- package/dist/es/qrcode/encodings/data-modes/numeric-data-mode.js +14 -24
- package/dist/es/qrcode/encodings/data-modes/qr-data-mode.js +15 -21
- package/dist/es/qrcode/encodings/encoders/iso-encoder.js +6 -16
- package/dist/es/qrcode/encodings/encoders/utf8-encoder.js +28 -36
- package/dist/es/qrcode/encodings/encoding-result.js +4 -10
- package/dist/es/qrcode/encodings/encoding.js +68 -192
- package/dist/es/qrcode/encodings/free-cell-visitor.js +16 -24
- package/dist/es/qrcode/encodings/utils/choose-mode.js +44 -0
- package/dist/es/qrcode/encodings/utils/get-data-codewords-count.js +13 -0
- package/dist/es/qrcode/encodings/utils/get-data-string.js +13 -0
- package/dist/es/qrcode/encodings/utils/get-modes.js +35 -0
- package/dist/es/qrcode/encodings/utils/get-version.js +23 -0
- package/dist/es/qrcode/encodings/utils/index.js +5 -0
- package/dist/es/qrcode/encodings/version-codewords.js +1 -1
- package/dist/es/qrcode/qrcode-validator.js +3 -5
- package/dist/es/qrcode/qrcode.js +104 -114
- package/dist/es/qrcode/utils.js +4 -4
- package/dist/es/sankey/calculation.js +286 -307
- package/dist/es/sankey/element.js +15 -23
- package/dist/es/sankey/label.js +29 -44
- package/dist/es/sankey/legend.js +15 -29
- package/dist/es/sankey/link.js +80 -98
- package/dist/es/sankey/node.js +26 -37
- package/dist/es/sankey/sankey.js +318 -385
- package/dist/es/sankey/title.js +9 -20
- package/dist/es/sankey/utils.js +18 -23
- package/dist/es/services/chart-service.js +24 -28
- package/dist/es/services/dom-events-builder.js +15 -15
- package/dist/es/services/format-service.js +30 -35
- package/dist/es/services/intl-service.js +14 -18
- package/dist/es/services/map-service.js +11 -11
- package/dist/es/services/template-service.js +9 -9
- package/dist/es/sparkline/shared-tooltip.js +11 -21
- package/dist/es/sparkline/sparkline.js +50 -60
- package/dist/es/stock/constants.js +3 -3
- package/dist/es/stock/fade-out-animation.js +12 -21
- package/dist/es/stock/navigator-hint.js +37 -49
- package/dist/es/stock/navigator.js +130 -161
- package/dist/es/stock/stock-chart.js +58 -67
- package/dist/es2015/chart/legend/legend-item.js +1 -1
- package/dist/es2015/qrcode/encodings/encoders/iso-encoder.js +1 -1
- package/dist/es2015/qrcode/encodings/encoders/utf8-encoder.js +1 -1
- package/dist/es2015/qrcode/encodings/encoding.js +3 -127
- package/dist/es2015/qrcode/encodings/utils/choose-mode.js +44 -0
- package/dist/es2015/qrcode/encodings/utils/get-data-codewords-count.js +13 -0
- package/dist/es2015/qrcode/encodings/utils/get-data-string.js +13 -0
- package/dist/es2015/qrcode/encodings/utils/get-modes.js +35 -0
- package/dist/es2015/qrcode/encodings/utils/get-version.js +23 -0
- package/dist/es2015/qrcode/encodings/utils/index.js +5 -0
- package/dist/npm/main.js +3222 -3589
- package/dist/systemjs/kendo-charts.js +1 -1
- package/package.json +19 -57
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
const ActionTypes = Object.freeze({
|
|
2
2
|
seriesType: 0,
|
|
3
3
|
stacked: 1,
|
|
4
4
|
|
|
@@ -53,7 +53,7 @@ var ActionTypes = Object.freeze({
|
|
|
53
53
|
valueAxisLabelsRotation: 42,
|
|
54
54
|
});
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
const fontSizes = [
|
|
57
57
|
{ text: "10", value: "10px" },
|
|
58
58
|
{ text: "12", value: "12px" },
|
|
59
59
|
{ text: "14", value: "14px" },
|
|
@@ -64,12 +64,12 @@ var fontSizes = [
|
|
|
64
64
|
{ text: "56", value: "56px" }
|
|
65
65
|
];
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
const titleSizeDefault = '20px';
|
|
68
|
+
const subtitleSizeDefault = '16px';
|
|
69
|
+
const labelSizeDefault = '12px';
|
|
70
|
+
const axisTitleSizeDefault = '16px';
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
const fontNames = [
|
|
73
73
|
{
|
|
74
74
|
text: "Arial",
|
|
75
75
|
value: "Arial, Helvetica, sans-serif",
|
|
@@ -114,18 +114,19 @@ var fontNames = [
|
|
|
114
114
|
text: "Verdana",
|
|
115
115
|
value: "Verdana, Geneva, sans-serif",
|
|
116
116
|
style: { fontFamily: "Verdana, Geneva, sans-serif" },
|
|
117
|
-
}
|
|
117
|
+
},
|
|
118
|
+
];
|
|
118
119
|
|
|
119
|
-
|
|
120
|
+
const fontNameDefault = fontNames[0].value;
|
|
120
121
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
122
|
+
const columnType = "column";
|
|
123
|
+
const barType = "bar";
|
|
124
|
+
const lineType = "line";
|
|
125
|
+
const pieType = "pie";
|
|
126
|
+
const scatterType = "scatter";
|
|
127
|
+
const categoricalTypes = [columnType, barType, lineType, scatterType];
|
|
127
128
|
|
|
128
|
-
|
|
129
|
+
const scatterSeries = {
|
|
129
130
|
type: lineType,
|
|
130
131
|
width: 0,
|
|
131
132
|
};
|
|
@@ -134,58 +135,61 @@ function isCategorical(type) {
|
|
|
134
135
|
return type && categoricalTypes.includes(type);
|
|
135
136
|
}
|
|
136
137
|
|
|
137
|
-
|
|
138
|
-
|
|
138
|
+
const categoryTypes = ["string", "date", "number"];
|
|
139
|
+
const valueTypes = ["number"];
|
|
139
140
|
|
|
140
|
-
|
|
141
|
+
const axesDefinitions = {
|
|
141
142
|
bar: [
|
|
142
143
|
{ axisType: "category", types: categoryTypes },
|
|
143
|
-
{ axisType: "value", types: valueTypes }
|
|
144
|
+
{ axisType: "value", types: valueTypes },
|
|
145
|
+
],
|
|
144
146
|
column: [
|
|
145
147
|
{ axisType: "category", types: categoryTypes },
|
|
146
|
-
{ axisType: "value", types: valueTypes }
|
|
148
|
+
{ axisType: "value", types: valueTypes },
|
|
149
|
+
],
|
|
147
150
|
line: [
|
|
148
151
|
{ axisType: "category", types: categoryTypes },
|
|
149
|
-
{ axisType: "value", types: valueTypes }
|
|
152
|
+
{ axisType: "value", types: valueTypes },
|
|
153
|
+
],
|
|
150
154
|
pie: [
|
|
151
155
|
{ axisType: "category", types: categoryTypes },
|
|
152
|
-
{ axisType: "value", types: valueTypes, count: 1 }
|
|
156
|
+
{ axisType: "value", types: valueTypes, count: 1 },
|
|
157
|
+
],
|
|
153
158
|
scatter: [
|
|
154
159
|
{ axisType: "category", types: categoryTypes },
|
|
155
|
-
{ axisType: "value", types: valueTypes }
|
|
160
|
+
{ axisType: "value", types: valueTypes },
|
|
161
|
+
],
|
|
156
162
|
};
|
|
157
163
|
|
|
158
164
|
function getFont(font, size) {
|
|
159
|
-
return
|
|
165
|
+
return `${size || ""} ${font || ""}`.trim();
|
|
160
166
|
}
|
|
161
167
|
|
|
162
168
|
function parseFont(font) {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
return { size
|
|
169
|
+
const spaceIndex = (font || "").indexOf(" ");
|
|
170
|
+
const size = font && font.substring(0, spaceIndex);
|
|
171
|
+
const name = font && font.substring(spaceIndex + 1);
|
|
172
|
+
return { size, name };
|
|
167
173
|
}
|
|
168
174
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
var size = ref.size;
|
|
175
|
+
const updateFontName = (fontName, defaultSize, currentFont) => {
|
|
176
|
+
const { size } = parseFont(currentFont);
|
|
172
177
|
return fontName ? getFont(fontName, size || defaultSize) : "";
|
|
173
178
|
};
|
|
174
179
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
var name = ref.name;
|
|
180
|
+
const updateFontSize = (fontSize, defaultFontName, currentFont) => {
|
|
181
|
+
const { name } = parseFont(currentFont);
|
|
178
182
|
return fontSize ? getFont(name || defaultFontName, fontSize) : "";
|
|
179
183
|
};
|
|
180
184
|
|
|
181
|
-
|
|
185
|
+
const hasValue = (value) => value !== undefined && value !== null;
|
|
182
186
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
result.forEach(
|
|
187
|
+
const recordWithValues = (data) => {
|
|
188
|
+
const result = structuredClone(data[0]);
|
|
189
|
+
result.forEach((item, i) => {
|
|
186
190
|
if (!hasValue(item.value)) {
|
|
187
|
-
for (
|
|
188
|
-
|
|
191
|
+
for (let index = 0; index < data.length; index++) {
|
|
192
|
+
const value = data[index][i].value;
|
|
189
193
|
if (hasValue(value)) {
|
|
190
194
|
item.value = value;
|
|
191
195
|
break;
|
|
@@ -197,33 +201,33 @@ var recordWithValues = function (data) {
|
|
|
197
201
|
return result;
|
|
198
202
|
};
|
|
199
203
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
204
|
+
const getCategoryColumnIndex = (data, categoryDef) => {
|
|
205
|
+
const candidates = [];
|
|
206
|
+
const sampleRecord = recordWithValues(data);
|
|
203
207
|
|
|
204
|
-
categoryDef.types.forEach(
|
|
205
|
-
sampleRecord.forEach(
|
|
208
|
+
categoryDef.types.forEach((type) => {
|
|
209
|
+
sampleRecord.forEach((item, i) => {
|
|
206
210
|
if (typeof item.value === type) {
|
|
207
211
|
candidates.push(i);
|
|
208
212
|
}
|
|
209
213
|
});
|
|
210
214
|
});
|
|
211
215
|
|
|
212
|
-
|
|
213
|
-
|
|
216
|
+
const result = candidates.findIndex((index) => {
|
|
217
|
+
const values = data.map((record) => record[index].value);
|
|
214
218
|
return new Set(values).size === values.length;
|
|
215
219
|
});
|
|
216
220
|
|
|
217
221
|
return Math.max(result, 0);
|
|
218
222
|
};
|
|
219
223
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
224
|
+
const getValueColumnIndexes = (data, valuesDef) => {
|
|
225
|
+
const candidates = [];
|
|
226
|
+
const sampleRecord = recordWithValues(data);
|
|
223
227
|
|
|
224
|
-
valuesDef.forEach(
|
|
225
|
-
def.types.forEach(
|
|
226
|
-
sampleRecord.forEach(
|
|
228
|
+
valuesDef.forEach((def) => {
|
|
229
|
+
def.types.forEach((type) => {
|
|
230
|
+
sampleRecord.forEach((item, i) => {
|
|
227
231
|
if (typeof item.value === type) {
|
|
228
232
|
candidates.push(i);
|
|
229
233
|
}
|
|
@@ -234,7 +238,8 @@ var getValueColumnIndexes = function (data, valuesDef) {
|
|
|
234
238
|
return candidates;
|
|
235
239
|
};
|
|
236
240
|
|
|
237
|
-
|
|
241
|
+
const emptyState = () =>
|
|
242
|
+
structuredClone({
|
|
238
243
|
columns: [],
|
|
239
244
|
data: [],
|
|
240
245
|
series: [],
|
|
@@ -252,24 +257,24 @@ var emptyState = function () { return structuredClone({
|
|
|
252
257
|
title: { text: '' },
|
|
253
258
|
subtitle: { text: '' },
|
|
254
259
|
stack: false,
|
|
255
|
-
});
|
|
260
|
+
});
|
|
256
261
|
|
|
257
|
-
|
|
258
|
-
|
|
262
|
+
const categoryValueChartState = (data, seriesType, options) => {
|
|
263
|
+
const state = emptyState();
|
|
259
264
|
state.seriesType = seriesType;
|
|
260
265
|
state.data = data || [];
|
|
261
266
|
state.legend = { visible: true, position: "bottom" };
|
|
262
|
-
|
|
267
|
+
const chartDef = axesDefinitions[seriesType];
|
|
263
268
|
|
|
264
269
|
if (!chartDef || !data.length) {
|
|
265
270
|
return state;
|
|
266
271
|
}
|
|
267
272
|
|
|
268
|
-
|
|
269
|
-
state.columns = data[0].map(
|
|
273
|
+
const firstRecord = data[0].slice();
|
|
274
|
+
state.columns = data[0].map((i) => String(i.field));
|
|
270
275
|
|
|
271
|
-
|
|
272
|
-
|
|
276
|
+
const categoryDef = chartDef.find((def) => def.axisType === "category");
|
|
277
|
+
let catIndex = -1;
|
|
273
278
|
if (categoryDef) {
|
|
274
279
|
catIndex =
|
|
275
280
|
options && options.categoryAxis
|
|
@@ -277,22 +282,22 @@ var categoryValueChartState = function (data, seriesType, options) {
|
|
|
277
282
|
: getCategoryColumnIndex(data, categoryDef);
|
|
278
283
|
}
|
|
279
284
|
|
|
280
|
-
|
|
281
|
-
|
|
285
|
+
const valuesDef = chartDef.filter((def) => def.axisType === "value");
|
|
286
|
+
let valuesIndexes = getValueColumnIndexes(data, valuesDef);
|
|
282
287
|
|
|
283
288
|
if (valuesIndexes.includes(catIndex)) {
|
|
284
289
|
if (valuesIndexes.length > 1) {
|
|
285
|
-
valuesIndexes = valuesIndexes.filter(
|
|
290
|
+
valuesIndexes = valuesIndexes.filter((index) => index !== catIndex);
|
|
286
291
|
} else {
|
|
287
292
|
catIndex = -1;
|
|
288
293
|
}
|
|
289
294
|
}
|
|
290
295
|
|
|
291
|
-
|
|
292
|
-
valuesIndexes.forEach(
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
data.forEach(
|
|
296
|
+
const series = [];
|
|
297
|
+
valuesIndexes.forEach((index) => {
|
|
298
|
+
const valuesColumn = firstRecord[index];
|
|
299
|
+
const valuesResult = [];
|
|
300
|
+
data.forEach((record) => {
|
|
296
301
|
valuesResult.push(record[index].value);
|
|
297
302
|
});
|
|
298
303
|
series.push(Object.assign({}, {name: valuesColumn.field,
|
|
@@ -303,42 +308,44 @@ var categoryValueChartState = function (data, seriesType, options) {
|
|
|
303
308
|
(seriesType === scatterType ? scatterSeries : {})));
|
|
304
309
|
});
|
|
305
310
|
|
|
306
|
-
|
|
311
|
+
const categories =
|
|
307
312
|
catIndex > -1
|
|
308
|
-
? data.map(
|
|
313
|
+
? data.map((item) =>
|
|
314
|
+
String(
|
|
309
315
|
hasValue(item[catIndex].value)
|
|
310
316
|
? item[catIndex].value
|
|
311
317
|
: " "
|
|
312
|
-
)
|
|
318
|
+
)
|
|
313
319
|
)
|
|
314
320
|
: [];
|
|
315
321
|
|
|
316
322
|
if (series.length) {
|
|
317
|
-
state.series = series.map(
|
|
323
|
+
state.series = series.map((s, i) => (Object.assign({}, s, {id: i})));
|
|
318
324
|
state.initialSeries = structuredClone(state.series);
|
|
319
325
|
}
|
|
320
326
|
|
|
321
327
|
state.categoryAxis = [
|
|
322
|
-
{ categories
|
|
328
|
+
{ categories, labels: { visible: true, rotation: "auto" } },
|
|
329
|
+
];
|
|
323
330
|
state.categoryField = state.columns[catIndex];
|
|
324
331
|
|
|
325
332
|
return state;
|
|
326
333
|
};
|
|
327
334
|
|
|
328
|
-
|
|
329
|
-
|
|
335
|
+
const pieChartState = (data, seriesType, options) => {
|
|
336
|
+
const state = emptyState();
|
|
330
337
|
state.seriesType = seriesType;
|
|
331
338
|
state.data = data || [];
|
|
332
339
|
|
|
333
|
-
|
|
340
|
+
const chartDef = axesDefinitions[seriesType];
|
|
334
341
|
|
|
335
342
|
if (!chartDef || !data.length) {
|
|
336
343
|
return state;
|
|
337
344
|
}
|
|
338
345
|
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
346
|
+
const categoriesAxis = data[0].map((i) => i.field);
|
|
347
|
+
const categoryDef = chartDef.find((def) => def.axisType === "category");
|
|
348
|
+
let catIndex = -1;
|
|
342
349
|
if (categoryDef) {
|
|
343
350
|
catIndex =
|
|
344
351
|
options && options.categoryAxis
|
|
@@ -346,9 +353,9 @@ var pieChartState = function (data, seriesType, options) {
|
|
|
346
353
|
: getCategoryColumnIndex(data, categoryDef);
|
|
347
354
|
}
|
|
348
355
|
|
|
349
|
-
|
|
356
|
+
const valuesDef = chartDef.filter((def) => def.axisType === "value");
|
|
350
357
|
|
|
351
|
-
|
|
358
|
+
let valuesIndexes = [];
|
|
352
359
|
if (options && options.valueAxis) {
|
|
353
360
|
valuesIndexes = [categoriesAxis.indexOf(options.valueAxis)];
|
|
354
361
|
} else {
|
|
@@ -356,22 +363,22 @@ var pieChartState = function (data, seriesType, options) {
|
|
|
356
363
|
}
|
|
357
364
|
|
|
358
365
|
if (valuesIndexes.includes(catIndex) && valuesIndexes.length > 1) {
|
|
359
|
-
valuesIndexes = valuesIndexes.filter(
|
|
366
|
+
valuesIndexes = valuesIndexes.filter((index) => index !== catIndex);
|
|
360
367
|
}
|
|
361
368
|
|
|
362
369
|
if (typeof valuesDef[0].count === "number") {
|
|
363
370
|
valuesIndexes = valuesIndexes.slice(0, valuesDef[0].count);
|
|
364
371
|
}
|
|
365
372
|
|
|
366
|
-
|
|
367
|
-
catIndex > -1 ? data.map(
|
|
373
|
+
const categories =
|
|
374
|
+
catIndex > -1 ? data.map((item) => String(item[catIndex].value)) : [];
|
|
368
375
|
|
|
369
|
-
|
|
376
|
+
const flatData = [];
|
|
370
377
|
|
|
371
|
-
data.forEach(
|
|
372
|
-
|
|
373
|
-
valuesIndexes.forEach(
|
|
374
|
-
|
|
378
|
+
data.forEach((item) => {
|
|
379
|
+
const record = {};
|
|
380
|
+
valuesIndexes.forEach((index) => {
|
|
381
|
+
const col = item[index];
|
|
375
382
|
record[col.field] = col.value || 0;
|
|
376
383
|
record[item[catIndex].field] = item[catIndex].value || " ";
|
|
377
384
|
});
|
|
@@ -379,7 +386,7 @@ var pieChartState = function (data, seriesType, options) {
|
|
|
379
386
|
});
|
|
380
387
|
|
|
381
388
|
state.columns = categoriesAxis;
|
|
382
|
-
state.categoryAxis = [{ categories
|
|
389
|
+
state.categoryAxis = [{ categories, title: { text: "" } }];
|
|
383
390
|
|
|
384
391
|
state.series = [
|
|
385
392
|
{
|
|
@@ -390,7 +397,8 @@ var pieChartState = function (data, seriesType, options) {
|
|
|
390
397
|
labels: { visible: true },
|
|
391
398
|
categoryField: categoriesAxis[catIndex],
|
|
392
399
|
field: categoriesAxis[valuesIndexes[0]],
|
|
393
|
-
}
|
|
400
|
+
},
|
|
401
|
+
];
|
|
394
402
|
|
|
395
403
|
state.categoryField = categoriesAxis[catIndex];
|
|
396
404
|
state.valueField = categoriesAxis[valuesIndexes[0]];
|
|
@@ -401,7 +409,7 @@ var pieChartState = function (data, seriesType, options) {
|
|
|
401
409
|
};
|
|
402
410
|
|
|
403
411
|
function createInitialState(data, seriesType, defaultState) {
|
|
404
|
-
|
|
412
|
+
const state = createState(
|
|
405
413
|
data,
|
|
406
414
|
(defaultState && defaultState.seriesType) || seriesType
|
|
407
415
|
);
|
|
@@ -419,24 +427,24 @@ function createState(data, seriesType) {
|
|
|
419
427
|
}
|
|
420
428
|
|
|
421
429
|
function mergeStates(source, target) {
|
|
422
|
-
|
|
430
|
+
const newState = structuredClone(target);
|
|
423
431
|
newState.legend = source.legend;
|
|
424
432
|
newState.area = source.area;
|
|
425
433
|
newState.title = source.title;
|
|
426
434
|
newState.subtitle = source.subtitle;
|
|
427
435
|
if (newState.series.length === source.series.length) {
|
|
428
|
-
for (
|
|
436
|
+
for (let i = 0; i < newState.series.length; i++) {
|
|
429
437
|
newState.series[i].color = source.series[i].color;
|
|
430
438
|
newState.series[i].labels = source.series[i].labels;
|
|
431
439
|
}
|
|
432
440
|
}
|
|
433
441
|
|
|
434
442
|
if (
|
|
435
|
-
source.series.every(
|
|
443
|
+
source.series.every((s) => s.labels && s.labels.visible) &&
|
|
436
444
|
isCategorical(newState.seriesType) &&
|
|
437
445
|
isCategorical(source.seriesType)
|
|
438
446
|
) {
|
|
439
|
-
newState.series.forEach(
|
|
447
|
+
newState.series.forEach((s) => {
|
|
440
448
|
s.labels = s.labels || {};
|
|
441
449
|
s.labels.visible = true;
|
|
442
450
|
});
|
|
@@ -447,30 +455,30 @@ function mergeStates(source, target) {
|
|
|
447
455
|
|
|
448
456
|
/* eslint-disable complexity */
|
|
449
457
|
function updateState(currentState, action, value) {
|
|
450
|
-
|
|
458
|
+
const state = Object.assign({}, currentState);
|
|
451
459
|
|
|
452
460
|
switch (action) {
|
|
453
461
|
case ActionTypes.seriesType:
|
|
454
462
|
return createState(state.data, value);
|
|
455
463
|
|
|
456
464
|
case ActionTypes.stacked:
|
|
457
|
-
state.series = state.series.map(
|
|
465
|
+
state.series = state.series.map((s) => (Object.assign({}, s, {stack: value})));
|
|
458
466
|
state.stack = value;
|
|
459
467
|
return state;
|
|
460
468
|
|
|
461
469
|
case ActionTypes.categoryAxisX: {
|
|
462
470
|
if (state.seriesType && isCategorical(state.seriesType)) {
|
|
463
|
-
|
|
471
|
+
const newState = categoryValueChartState(
|
|
464
472
|
state.data,
|
|
465
473
|
state.seriesType,
|
|
466
474
|
{ categoryAxis: value }
|
|
467
475
|
);
|
|
468
476
|
return mergeStates(state, newState);
|
|
469
477
|
} else if (state.seriesType === pieType) {
|
|
470
|
-
|
|
478
|
+
const newState = pieChartState(state.data, state.seriesType, {
|
|
471
479
|
categoryAxis: value,
|
|
472
480
|
});
|
|
473
|
-
return mergeStates(state, newState
|
|
481
|
+
return mergeStates(state, newState);
|
|
474
482
|
}
|
|
475
483
|
|
|
476
484
|
return state;
|
|
@@ -478,11 +486,11 @@ function updateState(currentState, action, value) {
|
|
|
478
486
|
|
|
479
487
|
case ActionTypes.valueAxisY: {
|
|
480
488
|
if (state.seriesType === pieType) {
|
|
481
|
-
|
|
489
|
+
const newState = pieChartState(state.data, state.seriesType, {
|
|
482
490
|
categoryAxis: state.categoryField,
|
|
483
491
|
valueAxis: value,
|
|
484
492
|
});
|
|
485
|
-
return mergeStates(state, newState
|
|
493
|
+
return mergeStates(state, newState);
|
|
486
494
|
}
|
|
487
495
|
|
|
488
496
|
return state;
|
|
@@ -573,12 +581,12 @@ function updateState(currentState, action, value) {
|
|
|
573
581
|
return state;
|
|
574
582
|
|
|
575
583
|
case ActionTypes.seriesColor:
|
|
576
|
-
state.series = state.series.map(
|
|
577
|
-
{color: value.seriesName === s.name ? value.color : s.color}))
|
|
584
|
+
state.series = state.series.map((s) => (Object.assign({}, s,
|
|
585
|
+
{color: value.seriesName === s.name ? value.color : s.color})));
|
|
578
586
|
return state;
|
|
579
587
|
|
|
580
588
|
case ActionTypes.seriesLabel:
|
|
581
|
-
state.series = state.series.map(
|
|
589
|
+
state.series = state.series.map((s) => {
|
|
582
590
|
if (value.all || value.seriesName === s.name) {
|
|
583
591
|
return Object.assign({}, s, {labels: { visible: value.visible }});
|
|
584
592
|
}
|
|
@@ -591,7 +599,7 @@ function updateState(currentState, action, value) {
|
|
|
591
599
|
return state;
|
|
592
600
|
|
|
593
601
|
case ActionTypes.legendFontName: {
|
|
594
|
-
|
|
602
|
+
const legend = state.legend || {};
|
|
595
603
|
state.legend = Object.assign({}, legend,
|
|
596
604
|
{labels: Object.assign({}, legend.labels,
|
|
597
605
|
{font: updateFontName(
|
|
@@ -602,20 +610,20 @@ function updateState(currentState, action, value) {
|
|
|
602
610
|
return state;
|
|
603
611
|
}
|
|
604
612
|
case ActionTypes.legendFontSize: {
|
|
605
|
-
|
|
606
|
-
state.legend = Object.assign({}, legend
|
|
607
|
-
{labels: Object.assign({}, legend
|
|
613
|
+
const legend = state.legend || {};
|
|
614
|
+
state.legend = Object.assign({}, legend,
|
|
615
|
+
{labels: Object.assign({}, legend.labels,
|
|
608
616
|
{font: updateFontSize(
|
|
609
617
|
value,
|
|
610
618
|
fontNameDefault,
|
|
611
|
-
legend
|
|
619
|
+
legend.labels && legend.labels.font
|
|
612
620
|
)})});
|
|
613
621
|
return state;
|
|
614
622
|
}
|
|
615
623
|
case ActionTypes.legendColor: {
|
|
616
|
-
|
|
617
|
-
state.legend = Object.assign({}, legend
|
|
618
|
-
{labels: Object.assign({}, legend
|
|
624
|
+
const legend = state.legend || {};
|
|
625
|
+
state.legend = Object.assign({}, legend,
|
|
626
|
+
{labels: Object.assign({}, legend.labels, {color: value})});
|
|
619
627
|
return state;
|
|
620
628
|
}
|
|
621
629
|
case ActionTypes.legendPosition:
|
|
@@ -623,80 +631,80 @@ function updateState(currentState, action, value) {
|
|
|
623
631
|
return state;
|
|
624
632
|
|
|
625
633
|
case ActionTypes.categoryAxisTitleText:
|
|
626
|
-
state.categoryAxis = (state.categoryAxis || []).map(
|
|
634
|
+
state.categoryAxis = (state.categoryAxis || []).map(axis => (Object.assign({}, axis, {title: Object.assign({}, axis.title, {text: value})})));
|
|
627
635
|
return state;
|
|
628
636
|
|
|
629
637
|
case ActionTypes.categoryAxisTitleFontName: {
|
|
630
|
-
state.categoryAxis = (state.categoryAxis || []).map(
|
|
638
|
+
state.categoryAxis = (state.categoryAxis || []).map(axis => (Object.assign({}, axis, {title: Object.assign({}, axis.title, {font: updateFontName(value, axisTitleSizeDefault, axis.title && axis.title.font)})})));
|
|
631
639
|
return state;
|
|
632
640
|
}
|
|
633
641
|
case ActionTypes.categoryAxisTitleFontSize:
|
|
634
|
-
state.categoryAxis = (state.categoryAxis || []).map(
|
|
642
|
+
state.categoryAxis = (state.categoryAxis || []).map(axis => (Object.assign({}, axis, {title: Object.assign({}, axis.title, {font: updateFontSize(value, fontNameDefault, axis.title && axis.title.font)})})));
|
|
635
643
|
return state;
|
|
636
644
|
|
|
637
645
|
case ActionTypes.categoryAxisTitleColor:
|
|
638
|
-
state.categoryAxis = (state.categoryAxis || []).map(
|
|
646
|
+
state.categoryAxis = (state.categoryAxis || []).map(axis => (Object.assign({}, axis, {title: Object.assign({}, axis.title, {color: value})})));
|
|
639
647
|
return state;
|
|
640
648
|
|
|
641
649
|
case ActionTypes.categoryAxisLabelsFontName: {
|
|
642
|
-
state.categoryAxis = (state.categoryAxis || []).map(
|
|
650
|
+
state.categoryAxis = (state.categoryAxis || []).map(axis => (Object.assign({}, axis, {labels: Object.assign({}, axis.labels, {font: updateFontName(value, labelSizeDefault, axis.labels && axis.labels.font)})})));
|
|
643
651
|
return state;
|
|
644
652
|
}
|
|
645
653
|
|
|
646
654
|
case ActionTypes.categoryAxisLabelsFontSize:
|
|
647
|
-
state.categoryAxis = (state.categoryAxis || []).map(
|
|
655
|
+
state.categoryAxis = (state.categoryAxis || []).map(axis => (Object.assign({}, axis, {labels: Object.assign({}, axis.labels, {font: updateFontSize(value, fontNameDefault, axis.labels && axis.labels.font)})})));
|
|
648
656
|
return state;
|
|
649
657
|
|
|
650
658
|
case ActionTypes.categoryAxisLabelsColor:
|
|
651
|
-
state.categoryAxis = (state.categoryAxis || []).map(
|
|
659
|
+
state.categoryAxis = (state.categoryAxis || []).map(axis => (Object.assign({}, axis, {labels: Object.assign({}, axis.labels, {color: value})})));
|
|
652
660
|
return state;
|
|
653
661
|
|
|
654
662
|
case ActionTypes.categoryAxisLabelsRotation: {
|
|
655
|
-
|
|
656
|
-
state.categoryAxis = (state.categoryAxis || []).map(
|
|
663
|
+
const rotation = hasValue(value) ? value : 'auto';
|
|
664
|
+
state.categoryAxis = (state.categoryAxis || []).map(axis => (Object.assign({}, axis, {labels: Object.assign({}, axis.labels, {rotation})})));
|
|
657
665
|
return state;
|
|
658
666
|
}
|
|
659
667
|
case ActionTypes.categoryAxisReverseOrder:
|
|
660
|
-
state.categoryAxis = (state.categoryAxis || []).map(
|
|
668
|
+
state.categoryAxis = (state.categoryAxis || []).map(axis => (Object.assign({}, axis, {reverse: value})));
|
|
661
669
|
return state;
|
|
662
670
|
|
|
663
671
|
case ActionTypes.valueAxisTitleText: {
|
|
664
672
|
if (!state.valueAxis || state.valueAxis.length === 0) {
|
|
665
673
|
state.valueAxis = [{ title: { text: value } }];
|
|
666
674
|
} else {
|
|
667
|
-
state.valueAxis = (state.valueAxis || []).map(
|
|
675
|
+
state.valueAxis = (state.valueAxis || []).map(axis => (Object.assign({}, axis, {title: Object.assign({}, axis.title, {text: value})})));
|
|
668
676
|
}
|
|
669
677
|
return state;
|
|
670
678
|
}
|
|
671
679
|
case ActionTypes.valueAxisTitleFontName: {
|
|
672
|
-
state.valueAxis = (state.valueAxis || []).map(
|
|
680
|
+
state.valueAxis = (state.valueAxis || []).map(axis => (Object.assign({}, axis, {title: Object.assign({}, axis.title, {font: updateFontName(value, axisTitleSizeDefault, axis.title && axis.title.font)})})));
|
|
673
681
|
return state;
|
|
674
682
|
}
|
|
675
683
|
case ActionTypes.valueAxisTitleFontSize:
|
|
676
|
-
state.valueAxis = (state.valueAxis || []).map(
|
|
684
|
+
state.valueAxis = (state.valueAxis || []).map(axis => (Object.assign({}, axis, {title: Object.assign({}, axis.title, {font: updateFontSize(value, fontNameDefault, axis.title && axis.title.font)})})));
|
|
677
685
|
return state;
|
|
678
686
|
case ActionTypes.valueAxisTitleColor:
|
|
679
|
-
state.valueAxis = (state.valueAxis || []).map(
|
|
687
|
+
state.valueAxis = (state.valueAxis || []).map(axis => (Object.assign({}, axis, {title: Object.assign({}, axis.title, {color: value})})));
|
|
680
688
|
return state;
|
|
681
689
|
|
|
682
690
|
case ActionTypes.valueAxisLabelsFormat:
|
|
683
|
-
state.valueAxis = (state.valueAxis || []).map(
|
|
691
|
+
state.valueAxis = (state.valueAxis || []).map(axis => (Object.assign({}, axis, {labels: Object.assign({}, axis.labels, {format: value})})));
|
|
684
692
|
return state;
|
|
685
693
|
|
|
686
694
|
case ActionTypes.valueAxisLabelsFontName: {
|
|
687
|
-
state.valueAxis = (state.valueAxis || []).map(
|
|
695
|
+
state.valueAxis = (state.valueAxis || []).map(axis => (Object.assign({}, axis, {labels: Object.assign({}, axis.labels, {font: updateFontName(value, labelSizeDefault, axis.labels && axis.labels.font)})})));
|
|
688
696
|
return state;
|
|
689
697
|
}
|
|
690
698
|
case ActionTypes.valueAxisLabelsFontSize:
|
|
691
|
-
state.valueAxis = (state.valueAxis || []).map(
|
|
699
|
+
state.valueAxis = (state.valueAxis || []).map(axis => (Object.assign({}, axis, {labels: Object.assign({}, axis.labels, {font: updateFontSize(value, fontNameDefault, axis.labels && axis.labels.font)})})));
|
|
692
700
|
return state;
|
|
693
701
|
case ActionTypes.valueAxisLabelsColor:
|
|
694
|
-
state.valueAxis = (state.valueAxis || []).map(
|
|
702
|
+
state.valueAxis = (state.valueAxis || []).map(axis => (Object.assign({}, axis, {labels: Object.assign({}, axis.labels, {color: value})})));
|
|
695
703
|
return state;
|
|
696
704
|
|
|
697
705
|
case ActionTypes.valueAxisLabelsRotation: {
|
|
698
|
-
|
|
699
|
-
state.valueAxis = (state.valueAxis || []).map(
|
|
706
|
+
const rotation = hasValue(value) ? value : 'auto';
|
|
707
|
+
state.valueAxis = (state.valueAxis || []).map(axis => (Object.assign({}, axis, {labels: Object.assign({}, axis.labels, {rotation: rotation})})));
|
|
700
708
|
return state;
|
|
701
709
|
}
|
|
702
710
|
|
package/dist/es/chart-wizard.js
CHANGED
|
@@ -4,16 +4,16 @@ import {
|
|
|
4
4
|
messages
|
|
5
5
|
} from './chart-wizard/messages';
|
|
6
6
|
|
|
7
|
-
export
|
|
8
|
-
getWizardDataFromDataRows
|
|
9
|
-
ActionTypes
|
|
10
|
-
createInitialState
|
|
11
|
-
createState
|
|
12
|
-
fontNames
|
|
13
|
-
fontSizes
|
|
14
|
-
isCategorical
|
|
15
|
-
mergeStates
|
|
16
|
-
parseFont
|
|
17
|
-
updateState
|
|
18
|
-
messages
|
|
7
|
+
export const ChartWizardCommon = Object.freeze({
|
|
8
|
+
getWizardDataFromDataRows,
|
|
9
|
+
ActionTypes,
|
|
10
|
+
createInitialState,
|
|
11
|
+
createState,
|
|
12
|
+
fontNames,
|
|
13
|
+
fontSizes,
|
|
14
|
+
isCategorical,
|
|
15
|
+
mergeStates,
|
|
16
|
+
parseFont,
|
|
17
|
+
updateState,
|
|
18
|
+
messages
|
|
19
19
|
});
|