@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
|
@@ -8,29 +8,16 @@ import areNumbers from '../utils/are-numbers';
|
|
|
8
8
|
import { MIN_VALUE, MAX_VALUE } from '../../common/constants';
|
|
9
9
|
import { defined } from '../../common';
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
var categoryIx = fields.categoryIx;
|
|
22
|
-
var category = fields.category;
|
|
23
|
-
var series = fields.series;
|
|
24
|
-
var seriesIx = fields.seriesIx;
|
|
25
|
-
var ref = this;
|
|
26
|
-
var children = ref.children;
|
|
27
|
-
var options = ref.options;
|
|
28
|
-
var value = data.valueFields;
|
|
29
|
-
var valueParts = this.splitValue(value);
|
|
30
|
-
var hasValue = areNumbers(valueParts);
|
|
31
|
-
var dataItem = series.data[categoryIx];
|
|
32
|
-
var categoryPoints = this.categoryPoints[categoryIx];
|
|
33
|
-
var point;
|
|
11
|
+
class BoxPlotChart extends CandlestickChart {
|
|
12
|
+
addValue(data, fields) {
|
|
13
|
+
const { categoryIx, category, series, seriesIx } = fields;
|
|
14
|
+
const { children, options } = this;
|
|
15
|
+
const value = data.valueFields;
|
|
16
|
+
const valueParts = this.splitValue(value);
|
|
17
|
+
const hasValue = areNumbers(valueParts);
|
|
18
|
+
const dataItem = series.data[categoryIx];
|
|
19
|
+
let categoryPoints = this.categoryPoints[categoryIx];
|
|
20
|
+
let point;
|
|
34
21
|
|
|
35
22
|
if (!categoryPoints) {
|
|
36
23
|
this.categoryPoints[categoryIx] = categoryPoints = [];
|
|
@@ -40,7 +27,7 @@ var BoxPlotChart = (function (CandlestickChart) {
|
|
|
40
27
|
point = this.createPoint(data, fields);
|
|
41
28
|
}
|
|
42
29
|
|
|
43
|
-
|
|
30
|
+
let cluster = children[categoryIx];
|
|
44
31
|
if (!cluster) {
|
|
45
32
|
cluster = new ClusterLayout({
|
|
46
33
|
vertical: options.invertAxes,
|
|
@@ -66,67 +53,65 @@ var BoxPlotChart = (function (CandlestickChart) {
|
|
|
66
53
|
|
|
67
54
|
this.points.push(point);
|
|
68
55
|
categoryPoints.push(point);
|
|
69
|
-
}
|
|
56
|
+
}
|
|
70
57
|
|
|
71
|
-
|
|
58
|
+
pointType() {
|
|
72
59
|
if (this.options.invertAxes) {
|
|
73
60
|
return VerticalBoxPlot;
|
|
74
61
|
}
|
|
75
62
|
|
|
76
63
|
return BoxPlot;
|
|
77
|
-
}
|
|
64
|
+
}
|
|
78
65
|
|
|
79
|
-
|
|
66
|
+
splitValue(value) {
|
|
80
67
|
return [
|
|
81
68
|
value.lower, value.q1, value.median,
|
|
82
69
|
value.q3, value.upper
|
|
83
70
|
];
|
|
84
|
-
}
|
|
71
|
+
}
|
|
85
72
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
73
|
+
updateRange(value, fields) {
|
|
74
|
+
const axisName = fields.series.axis;
|
|
75
|
+
let parts = this.splitValue(value).concat(this.filterOutliers(value.outliers));
|
|
89
76
|
|
|
90
77
|
if (defined(value.mean)) {
|
|
91
78
|
parts = parts.concat(value.mean);
|
|
92
79
|
}
|
|
93
80
|
|
|
94
|
-
|
|
81
|
+
let axisRange = this.valueAxisRanges[axisName] || { min: MAX_VALUE, max: MIN_VALUE };
|
|
95
82
|
|
|
96
83
|
this.valueAxisRanges[axisName] = {
|
|
97
84
|
min: Math.min.apply(Math, parts.concat([ axisRange.min ])),
|
|
98
85
|
max: Math.max.apply(Math, parts.concat([ axisRange.max ]))
|
|
99
86
|
};
|
|
100
|
-
}
|
|
87
|
+
}
|
|
101
88
|
|
|
102
|
-
|
|
103
|
-
|
|
89
|
+
formatPointValue(point, format) {
|
|
90
|
+
const value = point.value;
|
|
104
91
|
|
|
105
92
|
return this.chartService.format.auto(format,
|
|
106
93
|
value.lower, value.q1, value.median,
|
|
107
94
|
value.q3, value.upper, value.mean, point.category
|
|
108
95
|
);
|
|
109
|
-
}
|
|
96
|
+
}
|
|
110
97
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
98
|
+
filterOutliers(items) {
|
|
99
|
+
const length = (items || []).length;
|
|
100
|
+
const result = [];
|
|
114
101
|
|
|
115
|
-
for (
|
|
116
|
-
|
|
102
|
+
for (let i = 0; i < length; i++) {
|
|
103
|
+
const item = items[i];
|
|
117
104
|
if (defined(item) && item !== null) {
|
|
118
105
|
result.push(item);
|
|
119
106
|
}
|
|
120
107
|
}
|
|
121
108
|
|
|
122
109
|
return result;
|
|
123
|
-
}
|
|
110
|
+
}
|
|
124
111
|
|
|
125
|
-
|
|
112
|
+
supportsPointInactiveOpacity() {
|
|
126
113
|
return false;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
return BoxPlotChart;
|
|
130
|
-
}(CandlestickChart));
|
|
114
|
+
}
|
|
115
|
+
}
|
|
131
116
|
|
|
132
117
|
export default BoxPlotChart;
|
|
@@ -9,24 +9,17 @@ import { LINE_MARKER_SIZE, BORDER_BRIGHTNESS } from '../constants';
|
|
|
9
9
|
import { CROSS, CIRCLE, WHITE } from '../../common/constants';
|
|
10
10
|
import { deepExtend, defined, setDefaultOptions } from '../../common';
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
class BoxPlot extends Candlestick {
|
|
13
|
+
constructor(value, options) {
|
|
14
|
+
super(value, options);
|
|
15
15
|
|
|
16
16
|
this.createNote();
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
BoxPlot.prototype.reflow = function reflow (box) {
|
|
24
|
-
var ref = this;
|
|
25
|
-
var options = ref.options;
|
|
26
|
-
var value = ref.value;
|
|
27
|
-
var chart = ref.owner;
|
|
28
|
-
var valueAxis = chart.seriesValueAxis(options);
|
|
29
|
-
var whiskerSlot, boxSlot;
|
|
19
|
+
reflow(box) {
|
|
20
|
+
const { options, value, owner: chart } = this;
|
|
21
|
+
const valueAxis = chart.seriesValueAxis(options);
|
|
22
|
+
let whiskerSlot, boxSlot;
|
|
30
23
|
|
|
31
24
|
this.boxSlot = boxSlot = valueAxis.getSlot(value.q1, value.q3);
|
|
32
25
|
this.realBody = boxSlot;
|
|
@@ -35,10 +28,10 @@ var BoxPlot = (function (Candlestick) {
|
|
|
35
28
|
this.whiskerSlot = whiskerSlot = valueAxis.getSlot(value.lower, value.upper);
|
|
36
29
|
this.reflowWhiskerSlot(box);
|
|
37
30
|
|
|
38
|
-
|
|
31
|
+
const medianSlot = valueAxis.getSlot(value.median);
|
|
39
32
|
|
|
40
33
|
if (value.mean) {
|
|
41
|
-
|
|
34
|
+
const meanSlot = valueAxis.getSlot(value.mean);
|
|
42
35
|
this.meanPoints = this.calcMeanPoints(box, meanSlot);
|
|
43
36
|
}
|
|
44
37
|
|
|
@@ -47,26 +40,26 @@ var BoxPlot = (function (Candlestick) {
|
|
|
47
40
|
|
|
48
41
|
this.box = whiskerSlot.clone().wrap(boxSlot);
|
|
49
42
|
this.reflowNote();
|
|
50
|
-
}
|
|
43
|
+
}
|
|
51
44
|
|
|
52
|
-
|
|
45
|
+
reflowBoxSlot(box) {
|
|
53
46
|
this.boxSlot.x1 = box.x1;
|
|
54
47
|
this.boxSlot.x2 = box.x2;
|
|
55
|
-
}
|
|
48
|
+
}
|
|
56
49
|
|
|
57
|
-
|
|
50
|
+
reflowWhiskerSlot(box) {
|
|
58
51
|
this.whiskerSlot.x1 = box.x1;
|
|
59
52
|
this.whiskerSlot.x2 = box.x2;
|
|
60
|
-
}
|
|
53
|
+
}
|
|
61
54
|
|
|
62
|
-
|
|
55
|
+
calcMeanPoints(box, meanSlot) {
|
|
63
56
|
return [
|
|
64
57
|
[ [ box.x1, meanSlot.y1 ], [ box.x2, meanSlot.y1 ] ]
|
|
65
58
|
];
|
|
66
|
-
}
|
|
59
|
+
}
|
|
67
60
|
|
|
68
|
-
|
|
69
|
-
|
|
61
|
+
calcWhiskerPoints(boxSlot, whiskerSlot) {
|
|
62
|
+
const mid = whiskerSlot.center().x;
|
|
70
63
|
return [ [
|
|
71
64
|
[ mid - 5, whiskerSlot.y1 ], [ mid + 5, whiskerSlot.y1 ],
|
|
72
65
|
[ mid, whiskerSlot.y1 ], [ mid, boxSlot.y1 ]
|
|
@@ -74,42 +67,40 @@ var BoxPlot = (function (Candlestick) {
|
|
|
74
67
|
[ mid - 5, whiskerSlot.y2 ], [ mid + 5, whiskerSlot.y2 ],
|
|
75
68
|
[ mid, whiskerSlot.y2 ], [ mid, boxSlot.y2 ]
|
|
76
69
|
] ];
|
|
77
|
-
}
|
|
70
|
+
}
|
|
78
71
|
|
|
79
|
-
|
|
72
|
+
calcMedianPoints(box, medianSlot) {
|
|
80
73
|
return [
|
|
81
74
|
[ [ box.x1, medianSlot.y1 ], [ box.x2, medianSlot.y1 ] ]
|
|
82
75
|
];
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
BoxPlot.prototype.renderOutliers = function renderOutliers (options) {
|
|
86
|
-
var this$1 = this;
|
|
76
|
+
}
|
|
87
77
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
78
|
+
renderOutliers(options) {
|
|
79
|
+
const value = this.value;
|
|
80
|
+
const outliers = value.outliers || [];
|
|
81
|
+
const outerFence = Math.abs(value.q3 - value.q1) * 3;
|
|
82
|
+
const elements = [];
|
|
83
|
+
let markers = options.markers || {};
|
|
93
84
|
|
|
94
|
-
for (
|
|
95
|
-
|
|
85
|
+
for (let i = 0; i < outliers.length; i++) {
|
|
86
|
+
const outlierValue = outliers[i];
|
|
96
87
|
if (outlierValue < value.q3 + outerFence && outlierValue > value.q1 - outerFence) {
|
|
97
88
|
markers = options.outliers;
|
|
98
89
|
} else {
|
|
99
90
|
markers = options.extremes;
|
|
100
91
|
}
|
|
101
|
-
|
|
92
|
+
let markersBorder = deepExtend({}, markers.border);
|
|
102
93
|
|
|
103
94
|
if (!defined(markersBorder.color)) {
|
|
104
|
-
if (defined(this
|
|
105
|
-
markersBorder.color = this
|
|
95
|
+
if (defined(this.color)) {
|
|
96
|
+
markersBorder.color = this.color;
|
|
106
97
|
} else {
|
|
107
98
|
markersBorder.color =
|
|
108
99
|
new Color(markers.background).brightness(BORDER_BRIGHTNESS).toHex();
|
|
109
100
|
}
|
|
110
101
|
}
|
|
111
102
|
|
|
112
|
-
|
|
103
|
+
const shape = new ShapeElement({
|
|
113
104
|
type: markers.type,
|
|
114
105
|
width: markers.size,
|
|
115
106
|
height: markers.size,
|
|
@@ -126,50 +117,48 @@ var BoxPlot = (function (Candlestick) {
|
|
|
126
117
|
|
|
127
118
|
this.reflowOutliers(elements);
|
|
128
119
|
return elements;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
BoxPlot.prototype.reflowOutliers = function reflowOutliers (outliers) {
|
|
132
|
-
var this$1 = this;
|
|
120
|
+
}
|
|
133
121
|
|
|
134
|
-
|
|
135
|
-
|
|
122
|
+
reflowOutliers(outliers) {
|
|
123
|
+
const valueAxis = this.owner.seriesValueAxis(this.options);
|
|
124
|
+
const center = this.box.center();
|
|
136
125
|
|
|
137
|
-
for (
|
|
138
|
-
|
|
139
|
-
|
|
126
|
+
for (let i = 0; i < outliers.length; i++) {
|
|
127
|
+
const outlierValue = outliers[i].value;
|
|
128
|
+
const markerBox = valueAxis.getSlot(outlierValue);
|
|
140
129
|
|
|
141
|
-
if (this
|
|
130
|
+
if (this.options.vertical) {
|
|
142
131
|
markerBox.move(center.x);
|
|
143
132
|
} else {
|
|
144
133
|
markerBox.move(undefined, center.y);
|
|
145
134
|
}
|
|
146
135
|
|
|
147
|
-
this
|
|
136
|
+
this.box = this.box.wrap(markerBox);
|
|
148
137
|
outliers[i].reflow(markerBox);
|
|
149
138
|
}
|
|
150
|
-
}
|
|
139
|
+
}
|
|
151
140
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
141
|
+
mainVisual(options) {
|
|
142
|
+
const group = super.mainVisual(options);
|
|
143
|
+
const outliers = this.renderOutliers(options);
|
|
155
144
|
|
|
156
|
-
for (
|
|
157
|
-
|
|
145
|
+
for (let i = 0; i < outliers.length; i++) {
|
|
146
|
+
const element = outliers[i].getElement();
|
|
158
147
|
if (element) {
|
|
159
148
|
group.append(element);
|
|
160
149
|
}
|
|
161
150
|
}
|
|
162
151
|
|
|
163
152
|
return group;
|
|
164
|
-
}
|
|
153
|
+
}
|
|
165
154
|
|
|
166
|
-
|
|
155
|
+
createLines(container, options) {
|
|
167
156
|
this.drawLines(container, options, this.whiskerPoints, options.whiskers);
|
|
168
157
|
this.drawLines(container, options, this.medianPoints, options.median);
|
|
169
158
|
this.drawLines(container, options, this.meanPoints, options.mean);
|
|
170
|
-
}
|
|
159
|
+
}
|
|
171
160
|
|
|
172
|
-
|
|
161
|
+
getBorderColor() {
|
|
173
162
|
if ((this.options.border || {}).color) {
|
|
174
163
|
return this.options.border.color;
|
|
175
164
|
}
|
|
@@ -178,11 +167,9 @@ var BoxPlot = (function (Candlestick) {
|
|
|
178
167
|
return this.color;
|
|
179
168
|
}
|
|
180
169
|
|
|
181
|
-
return
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
return BoxPlot;
|
|
185
|
-
}(Candlestick));
|
|
170
|
+
return super.getBorderColor();
|
|
171
|
+
}
|
|
172
|
+
}
|
|
186
173
|
|
|
187
174
|
setDefaultOptions(BoxPlot, {
|
|
188
175
|
border: {
|
|
@@ -1,32 +1,24 @@
|
|
|
1
1
|
import BoxPlot from './box-plot';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
BoxPlot.apply(this, arguments);
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
if ( BoxPlot ) VerticalBoxPlot.__proto__ = BoxPlot;
|
|
9
|
-
VerticalBoxPlot.prototype = Object.create( BoxPlot && BoxPlot.prototype );
|
|
10
|
-
VerticalBoxPlot.prototype.constructor = VerticalBoxPlot;
|
|
11
|
-
|
|
12
|
-
VerticalBoxPlot.prototype.reflowBoxSlot = function reflowBoxSlot (box) {
|
|
3
|
+
class VerticalBoxPlot extends BoxPlot {
|
|
4
|
+
reflowBoxSlot(box) {
|
|
13
5
|
this.boxSlot.y1 = box.y1;
|
|
14
6
|
this.boxSlot.y2 = box.y2;
|
|
15
|
-
}
|
|
7
|
+
}
|
|
16
8
|
|
|
17
|
-
|
|
9
|
+
reflowWhiskerSlot(box) {
|
|
18
10
|
this.whiskerSlot.y1 = box.y1;
|
|
19
11
|
this.whiskerSlot.y2 = box.y2;
|
|
20
|
-
}
|
|
12
|
+
}
|
|
21
13
|
|
|
22
|
-
|
|
14
|
+
calcMeanPoints(box, meanSlot) {
|
|
23
15
|
return [
|
|
24
16
|
[ [ meanSlot.x1, box.y1 ], [ meanSlot.x1, box.y2 ] ]
|
|
25
17
|
];
|
|
26
|
-
}
|
|
18
|
+
}
|
|
27
19
|
|
|
28
|
-
|
|
29
|
-
|
|
20
|
+
calcWhiskerPoints(boxSlot, whiskerSlot) {
|
|
21
|
+
const mid = whiskerSlot.center().y;
|
|
30
22
|
return [ [
|
|
31
23
|
[ whiskerSlot.x1, mid - 5 ], [ whiskerSlot.x1, mid + 5 ],
|
|
32
24
|
[ whiskerSlot.x1, mid ], [ boxSlot.x1, mid ]
|
|
@@ -34,15 +26,13 @@ var VerticalBoxPlot = (function (BoxPlot) {
|
|
|
34
26
|
[ whiskerSlot.x2, mid - 5 ], [ whiskerSlot.x2, mid + 5 ],
|
|
35
27
|
[ whiskerSlot.x2, mid ], [ boxSlot.x2, mid ]
|
|
36
28
|
] ];
|
|
37
|
-
}
|
|
29
|
+
}
|
|
38
30
|
|
|
39
|
-
|
|
31
|
+
calcMedianPoints(box, medianSlot) {
|
|
40
32
|
return [
|
|
41
33
|
[ [ medianSlot.x1, box.y1 ], [ medianSlot.x1, box.y2 ] ]
|
|
42
34
|
];
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return VerticalBoxPlot;
|
|
46
|
-
}(BoxPlot));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
47
37
|
|
|
48
38
|
export default VerticalBoxPlot;
|
|
@@ -6,57 +6,49 @@ import { INITIAL_ANIMATION_DURATION, BUBBLE } from '../constants';
|
|
|
6
6
|
import { MIN_VALUE, CIRCLE } from '../../common/constants';
|
|
7
7
|
import { deepExtend, isFunction, setDefaultOptions, valueOrDefault } from '../../common';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
ScatterChart.apply(this, arguments);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
if ( ScatterChart ) BubbleChart.__proto__ = ScatterChart;
|
|
15
|
-
BubbleChart.prototype = Object.create( ScatterChart && ScatterChart.prototype );
|
|
16
|
-
BubbleChart.prototype.constructor = BubbleChart;
|
|
17
|
-
|
|
18
|
-
BubbleChart.prototype._initFields = function _initFields () {
|
|
9
|
+
class BubbleChart extends ScatterChart {
|
|
10
|
+
_initFields() {
|
|
19
11
|
this._maxSize = MIN_VALUE;
|
|
20
|
-
|
|
21
|
-
}
|
|
12
|
+
super._initFields();
|
|
13
|
+
}
|
|
22
14
|
|
|
23
|
-
|
|
15
|
+
addValue(value, fields) {
|
|
24
16
|
if (value.size !== null && (value.size > 0 || (value.size < 0 && fields.series.negativeValues.visible))) {
|
|
25
17
|
this._maxSize = Math.max(this._maxSize, Math.abs(value.size));
|
|
26
|
-
|
|
18
|
+
super.addValue(value, fields);
|
|
27
19
|
} else {
|
|
28
20
|
this.points.push(null);
|
|
29
21
|
this.seriesPoints[fields.seriesIx].push(null);
|
|
30
22
|
}
|
|
31
|
-
}
|
|
23
|
+
}
|
|
32
24
|
|
|
33
|
-
|
|
25
|
+
reflow(box) {
|
|
34
26
|
this.updateBubblesSize(box);
|
|
35
|
-
|
|
36
|
-
}
|
|
27
|
+
super.reflow(box);
|
|
28
|
+
}
|
|
37
29
|
|
|
38
|
-
|
|
30
|
+
pointType() {
|
|
39
31
|
return Bubble;
|
|
40
|
-
}
|
|
32
|
+
}
|
|
41
33
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
34
|
+
createPoint(value, fields) {
|
|
35
|
+
const series = fields.series;
|
|
36
|
+
const pointsCount = series.data.length;
|
|
37
|
+
const delay = fields.pointIx * (INITIAL_ANIMATION_DURATION / pointsCount);
|
|
38
|
+
const animationOptions = {
|
|
47
39
|
delay: delay,
|
|
48
40
|
duration: INITIAL_ANIMATION_DURATION - delay,
|
|
49
41
|
type: BUBBLE
|
|
50
42
|
};
|
|
51
43
|
|
|
52
|
-
|
|
44
|
+
let color = fields.color || series.color;
|
|
53
45
|
if (value.size < 0 && series.negativeValues.visible) {
|
|
54
46
|
color = valueOrDefault(
|
|
55
47
|
series.negativeValues.color, color
|
|
56
48
|
);
|
|
57
49
|
}
|
|
58
50
|
|
|
59
|
-
|
|
51
|
+
let pointOptions = deepExtend({
|
|
60
52
|
labels: {
|
|
61
53
|
animation: {
|
|
62
54
|
delay: delay,
|
|
@@ -79,40 +71,37 @@ var BubbleChart = (function (ScatterChart) {
|
|
|
79
71
|
|
|
80
72
|
pointOptions.markers.background = color;
|
|
81
73
|
|
|
82
|
-
|
|
74
|
+
const point = new Bubble(value, pointOptions);
|
|
83
75
|
point.color = color;
|
|
84
76
|
|
|
85
77
|
this.append(point);
|
|
86
78
|
|
|
87
79
|
return point;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
for (var pointIx = 0; pointIx < seriesPoints.length; pointIx++) {
|
|
110
|
-
var point = seriesPoints[pointIx];
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
updateBubblesSize(box) {
|
|
83
|
+
const { options: { series } } = this;
|
|
84
|
+
const boxSize = Math.min(box.width(), box.height());
|
|
85
|
+
|
|
86
|
+
for (let seriesIx = 0; seriesIx < series.length; seriesIx++) {
|
|
87
|
+
const currentSeries = series[seriesIx];
|
|
88
|
+
const seriesPoints = this.seriesPoints[seriesIx];
|
|
89
|
+
const minSize = currentSeries.minSize || Math.max(boxSize * 0.02, 10);
|
|
90
|
+
const maxSize = currentSeries.maxSize || boxSize * 0.2;
|
|
91
|
+
const minR = minSize / 2;
|
|
92
|
+
const maxR = maxSize / 2;
|
|
93
|
+
const minArea = Math.PI * minR * minR;
|
|
94
|
+
const maxArea = Math.PI * maxR * maxR;
|
|
95
|
+
const areaRange = maxArea - minArea;
|
|
96
|
+
const areaRatio = areaRange / this._maxSize;
|
|
97
|
+
|
|
98
|
+
for (let pointIx = 0; pointIx < seriesPoints.length; pointIx++) {
|
|
99
|
+
const point = seriesPoints[pointIx];
|
|
111
100
|
if (point) {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
101
|
+
const area = Math.abs(point.value.size) * areaRatio;
|
|
102
|
+
const radius = Math.sqrt((minArea + area) / Math.PI);
|
|
103
|
+
const baseZIndex = valueOrDefault(point.options.zIndex, 0);
|
|
104
|
+
const zIndex = baseZIndex + (1 - radius / maxR);
|
|
116
105
|
|
|
117
106
|
deepExtend(point.options, {
|
|
118
107
|
zIndex: zIndex,
|
|
@@ -127,18 +116,16 @@ var BubbleChart = (function (ScatterChart) {
|
|
|
127
116
|
}
|
|
128
117
|
}
|
|
129
118
|
}
|
|
130
|
-
}
|
|
119
|
+
}
|
|
131
120
|
|
|
132
|
-
|
|
133
|
-
|
|
121
|
+
formatPointValue(point, format) {
|
|
122
|
+
const value = point.value;
|
|
134
123
|
return this.chartService.format.auto(format, value.x, value.y, value.size, point.category);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
BubbleChart.prototype.createAnimation = function createAnimation () {};
|
|
138
|
-
BubbleChart.prototype.createVisual = function createVisual () {};
|
|
124
|
+
}
|
|
139
125
|
|
|
140
|
-
|
|
141
|
-
|
|
126
|
+
createAnimation() {}
|
|
127
|
+
createVisual() {}
|
|
128
|
+
}
|
|
142
129
|
|
|
143
130
|
setDefaultOptions(BubbleChart, {
|
|
144
131
|
tooltip: {
|
|
@@ -7,25 +7,21 @@ import { CENTER } from '../../common/constants';
|
|
|
7
7
|
import { deepExtend } from '../../common';
|
|
8
8
|
import { createPatternFill } from '../../core/pattern';
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
class Bubble extends LinePoint {
|
|
11
|
+
constructor(value, options) {
|
|
12
|
+
super(value, options);
|
|
13
13
|
|
|
14
14
|
this.category = value.category;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var center = this.box.center();
|
|
26
|
-
var radius = (markers.size + markers.border.width + border.width) / 2;
|
|
27
|
-
var highlightGroup = new draw.Group();
|
|
28
|
-
var shadow = new draw.Circle(new geom.Circle([ center.x, center.y + radius / 5 + border.width / 2 ], radius + border.width / 2), {
|
|
17
|
+
createHighlight() {
|
|
18
|
+
const highlight = this.options.highlight;
|
|
19
|
+
const border = highlight.border;
|
|
20
|
+
const markers = this.options.markers;
|
|
21
|
+
const center = this.box.center();
|
|
22
|
+
const radius = (markers.size + markers.border.width + border.width) / 2;
|
|
23
|
+
const highlightGroup = new draw.Group();
|
|
24
|
+
const shadow = new draw.Circle(new geom.Circle([ center.x, center.y + radius / 5 + border.width / 2 ], radius + border.width / 2), {
|
|
29
25
|
stroke: {
|
|
30
26
|
color: 'none'
|
|
31
27
|
},
|
|
@@ -43,7 +39,7 @@ var Bubble = (function (LinePoint) {
|
|
|
43
39
|
} ]
|
|
44
40
|
})
|
|
45
41
|
});
|
|
46
|
-
|
|
42
|
+
const overlay = new draw.Circle(new geom.Circle([ center.x, center.y ], radius), {
|
|
47
43
|
stroke: {
|
|
48
44
|
color: border.color ||
|
|
49
45
|
new Color(markers.background).brightness(BORDER_BRIGHTNESS).toHex(),
|
|
@@ -59,20 +55,18 @@ var Bubble = (function (LinePoint) {
|
|
|
59
55
|
highlightGroup.append(shadow, overlay);
|
|
60
56
|
|
|
61
57
|
return highlightGroup;
|
|
62
|
-
}
|
|
58
|
+
}
|
|
63
59
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
60
|
+
createFocusHighlight(style) {
|
|
61
|
+
const highlightOptions = this.options.focusHighlight;
|
|
62
|
+
const markers = this.options.markers;
|
|
63
|
+
const center = this.box.center();
|
|
64
|
+
const radius = (markers.size + markers.border.width) / 2 + highlightOptions.border.width / 2;
|
|
65
|
+
const highlight = new draw.Circle(new geom.Circle([ center.x, center.y ], radius), style);
|
|
70
66
|
|
|
71
67
|
return highlight;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
return Bubble;
|
|
75
|
-
}(LinePoint));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
76
70
|
|
|
77
71
|
Bubble.prototype.defaults = deepExtend({}, Bubble.prototype.defaults, {
|
|
78
72
|
labels: {
|