@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
|
@@ -5,13 +5,13 @@ import { BLACK, COORD_PRECISION, DEFAULT_PRECISION, X, Y } from '../common/const
|
|
|
5
5
|
import { defined, isNumber, last, limitValue, round, setDefaultOptions, valueOrDefault, HashMap } from '../common';
|
|
6
6
|
import { dateEquals } from '../date-utils';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
const MIN_CATEGORY_POINTS_RANGE = 0.01;
|
|
9
|
+
const MIN_CATEGORY_RANGE = 0.1;
|
|
10
10
|
|
|
11
11
|
function indexOf(value, arr) {
|
|
12
12
|
if (value instanceof Date) {
|
|
13
|
-
|
|
14
|
-
for (
|
|
13
|
+
const length = arr.length;
|
|
14
|
+
for (let idx = 0; idx < length; idx++) {
|
|
15
15
|
if (dateEquals(arr[idx], value)) {
|
|
16
16
|
return idx;
|
|
17
17
|
}
|
|
@@ -23,41 +23,33 @@ function indexOf(value, arr) {
|
|
|
23
23
|
return arr.indexOf(value);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
Axis.apply(this, arguments);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
if ( Axis ) CategoryAxis.__proto__ = Axis;
|
|
32
|
-
CategoryAxis.prototype = Object.create( Axis && Axis.prototype );
|
|
33
|
-
CategoryAxis.prototype.constructor = CategoryAxis;
|
|
34
|
-
|
|
35
|
-
CategoryAxis.prototype.initFields = function initFields () {
|
|
26
|
+
class CategoryAxis extends Axis {
|
|
27
|
+
initFields() {
|
|
36
28
|
this._ticks = {};
|
|
37
|
-
}
|
|
29
|
+
}
|
|
38
30
|
|
|
39
|
-
|
|
31
|
+
categoriesHash() {
|
|
40
32
|
return "";
|
|
41
|
-
}
|
|
33
|
+
}
|
|
42
34
|
|
|
43
|
-
|
|
44
|
-
|
|
35
|
+
clone() {
|
|
36
|
+
const copy = new CategoryAxis(Object.assign({}, this.options, {
|
|
45
37
|
categories: this.options.srcCategories
|
|
46
38
|
}), this.chartService);
|
|
47
39
|
copy.createLabels();
|
|
48
40
|
|
|
49
41
|
return copy;
|
|
50
|
-
}
|
|
42
|
+
}
|
|
51
43
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
44
|
+
initUserOptions(options) {
|
|
45
|
+
const categories = options.categories || [];
|
|
46
|
+
const definedMin = defined(options.min);
|
|
47
|
+
const definedMax = defined(options.max);
|
|
56
48
|
options.srcCategories = options.categories = categories;
|
|
57
49
|
|
|
58
50
|
if ((definedMin || definedMax) && categories.length) {
|
|
59
|
-
|
|
60
|
-
|
|
51
|
+
const min = definedMin ? Math.floor(options.min) : 0;
|
|
52
|
+
let max;
|
|
61
53
|
|
|
62
54
|
if (definedMax) {
|
|
63
55
|
max = options.justified ? Math.floor(options.max) + 1 : Math.ceil(options.max);
|
|
@@ -69,13 +61,13 @@ var CategoryAxis = (function (Axis) {
|
|
|
69
61
|
}
|
|
70
62
|
|
|
71
63
|
return options;
|
|
72
|
-
}
|
|
64
|
+
}
|
|
73
65
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
66
|
+
rangeIndices() {
|
|
67
|
+
const options = this.options;
|
|
68
|
+
const length = options.categories.length || 1;
|
|
69
|
+
const min = isNumber(options.min) ? options.min % 1 : 0;
|
|
70
|
+
let max;
|
|
79
71
|
|
|
80
72
|
if (isNumber(options.max) && options.max % 1 !== 0 && options.max < this.totalRange().max) {
|
|
81
73
|
max = length - (1 - options.max % 1);
|
|
@@ -87,35 +79,33 @@ var CategoryAxis = (function (Axis) {
|
|
|
87
79
|
min: min,
|
|
88
80
|
max: max
|
|
89
81
|
};
|
|
90
|
-
}
|
|
82
|
+
}
|
|
91
83
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
84
|
+
range() {
|
|
85
|
+
const options = this.options;
|
|
86
|
+
const min = isNumber(options.min) ? options.min : 0;
|
|
87
|
+
const max = isNumber(options.max) ? options.max : this.totalRange().max;
|
|
96
88
|
|
|
97
89
|
return {
|
|
98
90
|
min: min,
|
|
99
91
|
max: max
|
|
100
92
|
};
|
|
101
|
-
}
|
|
93
|
+
}
|
|
102
94
|
|
|
103
|
-
|
|
95
|
+
roundedRange() {
|
|
104
96
|
return this.range();
|
|
105
|
-
}
|
|
97
|
+
}
|
|
106
98
|
|
|
107
|
-
|
|
108
|
-
|
|
99
|
+
totalRange() {
|
|
100
|
+
const options = this.options;
|
|
109
101
|
return { min: 0, max: Math.max(this._seriesMax || 0, options.srcCategories.length) - (options.justified ? 1 : 0) };
|
|
110
|
-
}
|
|
102
|
+
}
|
|
111
103
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
var size = this.options.vertical ? lineBox.height() : lineBox.width();
|
|
118
|
-
var scale = size / ((max - min) || 1);
|
|
104
|
+
scaleOptions() {
|
|
105
|
+
const { min, max } = this.rangeIndices();
|
|
106
|
+
const lineBox = this.lineBox();
|
|
107
|
+
const size = this.options.vertical ? lineBox.height() : lineBox.width();
|
|
108
|
+
const scale = size / ((max - min) || 1);
|
|
119
109
|
|
|
120
110
|
return {
|
|
121
111
|
scale: scale * (this.options.reverse ? -1 : 1),
|
|
@@ -123,24 +113,22 @@ var CategoryAxis = (function (Axis) {
|
|
|
123
113
|
min: min,
|
|
124
114
|
max: max
|
|
125
115
|
};
|
|
126
|
-
}
|
|
116
|
+
}
|
|
127
117
|
|
|
128
|
-
|
|
129
|
-
|
|
118
|
+
arrangeLabels() {
|
|
119
|
+
super.arrangeLabels();
|
|
130
120
|
this.hideOutOfRangeLabels();
|
|
131
|
-
}
|
|
121
|
+
}
|
|
132
122
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
var box = ref.box;
|
|
136
|
-
var labels = ref.labels;
|
|
123
|
+
hideOutOfRangeLabels() {
|
|
124
|
+
const { box, labels } = this;
|
|
137
125
|
|
|
138
126
|
if (labels.length > 0) {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
127
|
+
const valueAxis = this.options.vertical ? Y : X;
|
|
128
|
+
const start = box[valueAxis + 1];
|
|
129
|
+
const end = box[valueAxis + 2];
|
|
130
|
+
const firstLabel = labels[0];
|
|
131
|
+
const lastLabel = last(labels);
|
|
144
132
|
|
|
145
133
|
if (firstLabel.box[valueAxis + 1] > end || firstLabel.box[valueAxis + 2] < start) {
|
|
146
134
|
firstLabel.options.visible = false;
|
|
@@ -149,27 +137,25 @@ var CategoryAxis = (function (Axis) {
|
|
|
149
137
|
lastLabel.options.visible = false;
|
|
150
138
|
}
|
|
151
139
|
}
|
|
152
|
-
}
|
|
140
|
+
}
|
|
153
141
|
|
|
154
|
-
|
|
142
|
+
getMajorTickPositions() {
|
|
155
143
|
return this.getTicks().majorTicks;
|
|
156
|
-
}
|
|
144
|
+
}
|
|
157
145
|
|
|
158
|
-
|
|
146
|
+
getMinorTickPositions() {
|
|
159
147
|
return this.getTicks().minorTicks;
|
|
160
|
-
}
|
|
148
|
+
}
|
|
161
149
|
|
|
162
|
-
|
|
150
|
+
getLabelsTickPositions() {
|
|
163
151
|
return this.getTicks().labelTicks;
|
|
164
|
-
}
|
|
152
|
+
}
|
|
165
153
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
var current = Math.floor(min);
|
|
172
|
-
var indices = [];
|
|
154
|
+
tickIndices(stepSize) {
|
|
155
|
+
const { min, max } = this.rangeIndices();
|
|
156
|
+
const limit = Math.ceil(max);
|
|
157
|
+
let current = Math.floor(min);
|
|
158
|
+
const indices = [];
|
|
173
159
|
|
|
174
160
|
while (current <= limit) {
|
|
175
161
|
indices.push(current);
|
|
@@ -177,36 +163,31 @@ var CategoryAxis = (function (Axis) {
|
|
|
177
163
|
}
|
|
178
164
|
|
|
179
165
|
return indices;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
var pos = box[(vertical ? Y : X) + (reverse ? 2 : 1)];
|
|
191
|
-
var indices = this.tickIndices(stepSize);
|
|
192
|
-
var positions = [];
|
|
193
|
-
|
|
194
|
-
for (var idx = 0; idx < indices.length; idx++) {
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
getTickPositions(stepSize) {
|
|
169
|
+
const { vertical, reverse } = this.options;
|
|
170
|
+
const { scale, box, min } = this.scaleOptions();
|
|
171
|
+
const pos = box[(vertical ? Y : X) + (reverse ? 2 : 1)];
|
|
172
|
+
const indices = this.tickIndices(stepSize);
|
|
173
|
+
const positions = [];
|
|
174
|
+
|
|
175
|
+
for (let idx = 0; idx < indices.length; idx++) {
|
|
195
176
|
positions.push(pos + round(scale * (indices[idx] - min), COORD_PRECISION));
|
|
196
177
|
}
|
|
197
178
|
|
|
198
179
|
return positions;
|
|
199
|
-
}
|
|
180
|
+
}
|
|
200
181
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
182
|
+
getTicks() {
|
|
183
|
+
const options = this.options;
|
|
184
|
+
const cache = this._ticks;
|
|
185
|
+
const range = this.rangeIndices();
|
|
186
|
+
const lineBox = this.lineBox();
|
|
187
|
+
const hash = lineBox.getHash() + range.min + "," + range.max + options.reverse + options.justified;
|
|
207
188
|
|
|
208
189
|
if (cache._hash !== hash) {
|
|
209
|
-
|
|
190
|
+
const hasMinor = options.minorTicks.visible || options.minorGridLines.visible;
|
|
210
191
|
cache._hash = hash;
|
|
211
192
|
cache.labelTicks = this.getTickPositions(1);
|
|
212
193
|
cache.majorTicks = this.filterOutOfRangePositions(cache.labelTicks, lineBox);
|
|
@@ -214,91 +195,82 @@ var CategoryAxis = (function (Axis) {
|
|
|
214
195
|
}
|
|
215
196
|
|
|
216
197
|
return cache;
|
|
217
|
-
}
|
|
198
|
+
}
|
|
218
199
|
|
|
219
|
-
|
|
200
|
+
filterOutOfRangePositions(positions, lineBox) {
|
|
220
201
|
if (!positions.length) {
|
|
221
202
|
return positions;
|
|
222
203
|
}
|
|
223
204
|
|
|
224
|
-
|
|
225
|
-
|
|
205
|
+
const axis = this.options.vertical ? Y : X;
|
|
206
|
+
const inRange = (position) => lineBox[axis + 1] <= position && position <= lineBox[axis + 2];
|
|
226
207
|
|
|
227
|
-
|
|
228
|
-
|
|
208
|
+
const end = positions.length - 1;
|
|
209
|
+
let startIndex = 0;
|
|
229
210
|
while (!inRange(positions[startIndex]) && startIndex <= end) {
|
|
230
211
|
startIndex++;
|
|
231
212
|
}
|
|
232
213
|
|
|
233
|
-
|
|
214
|
+
let endIndex = end;
|
|
234
215
|
|
|
235
216
|
while (!inRange(positions[endIndex]) && endIndex >= 0) {
|
|
236
217
|
endIndex--;
|
|
237
218
|
}
|
|
238
219
|
|
|
239
220
|
return positions.slice(startIndex, endIndex + 1);
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
var axisOrigin = axis + startEdge.toString();
|
|
252
|
-
var lineStart = lineBox[axisOrigin];
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
lineInfo() {
|
|
224
|
+
const { vertical, reverse } = this.options;
|
|
225
|
+
const lineBox = this.lineBox();
|
|
226
|
+
const lineSize = vertical ? lineBox.height() : lineBox.width();
|
|
227
|
+
const axis = vertical ? Y : X;
|
|
228
|
+
const axisDir = reverse ? -1 : 1;
|
|
229
|
+
const startEdge = axisDir === 1 ? 1 : 2;
|
|
230
|
+
const axisOrigin = axis + startEdge.toString();
|
|
231
|
+
const lineStart = lineBox[axisOrigin];
|
|
253
232
|
|
|
254
233
|
return {
|
|
255
|
-
axis
|
|
256
|
-
axisOrigin
|
|
257
|
-
axisDir
|
|
258
|
-
lineBox
|
|
259
|
-
lineSize
|
|
260
|
-
lineStart
|
|
234
|
+
axis,
|
|
235
|
+
axisOrigin,
|
|
236
|
+
axisDir,
|
|
237
|
+
lineBox,
|
|
238
|
+
lineSize,
|
|
239
|
+
lineStart
|
|
261
240
|
};
|
|
262
|
-
}
|
|
241
|
+
}
|
|
263
242
|
|
|
264
|
-
|
|
243
|
+
lineDir() {
|
|
265
244
|
/*
|
|
266
245
|
* Category axis line direction:
|
|
267
246
|
* * Vertical: down.
|
|
268
247
|
* * Horizontal: right.
|
|
269
248
|
*/
|
|
270
249
|
|
|
271
|
-
|
|
272
|
-
var reverse = ref.reverse;
|
|
250
|
+
const { reverse } = this.options;
|
|
273
251
|
return reverse ? -1 : 1;
|
|
274
|
-
}
|
|
252
|
+
}
|
|
275
253
|
|
|
276
254
|
// TODO: Rename to slotBox, valueSlot, slotByIndex?
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
var slotBox = box.clone();
|
|
290
|
-
var singleSlot = !defined(to);
|
|
291
|
-
|
|
292
|
-
var start = valueOrDefault(from, 0);
|
|
293
|
-
var end = valueOrDefault(to, start);
|
|
255
|
+
getSlot(from, to, limit) {
|
|
256
|
+
const options = this.options;
|
|
257
|
+
const { reverse, justified } = options;
|
|
258
|
+
const { scale, box, min } = this.scaleOptions();
|
|
259
|
+
const { axis: valueAxis, lineStart } = this.lineInfo();
|
|
260
|
+
|
|
261
|
+
const slotBox = box.clone();
|
|
262
|
+
const singleSlot = !defined(to);
|
|
263
|
+
|
|
264
|
+
const start = valueOrDefault(from, 0);
|
|
265
|
+
let end = valueOrDefault(to, start);
|
|
294
266
|
end = Math.max(end - 1, start);
|
|
295
267
|
|
|
296
268
|
// Fixes transient bug caused by iOS 6.0 JIT
|
|
297
269
|
// (one can never be too sure)
|
|
298
270
|
end = Math.max(start, end);
|
|
299
271
|
|
|
300
|
-
|
|
301
|
-
|
|
272
|
+
let p1 = lineStart + (start - min) * scale;
|
|
273
|
+
let p2 = lineStart + (end + 1 - min) * scale;
|
|
302
274
|
|
|
303
275
|
if (singleSlot && justified) {
|
|
304
276
|
p2 = p1;
|
|
@@ -313,24 +285,24 @@ var CategoryAxis = (function (Axis) {
|
|
|
313
285
|
slotBox[valueAxis + 2] = reverse ? p1 : p2;
|
|
314
286
|
|
|
315
287
|
return slotBox;
|
|
316
|
-
}
|
|
288
|
+
}
|
|
317
289
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
290
|
+
limitSlot(slot) {
|
|
291
|
+
const vertical = this.options.vertical;
|
|
292
|
+
const valueAxis = vertical ? Y : X;
|
|
293
|
+
const lineBox = this.lineBox();
|
|
294
|
+
const limittedSlot = slot.clone();
|
|
323
295
|
|
|
324
296
|
limittedSlot[valueAxis + 1] = limitValue(slot[valueAxis + 1], lineBox[valueAxis + 1], lineBox[valueAxis + 2]);
|
|
325
297
|
limittedSlot[valueAxis + 2] = limitValue(slot[valueAxis + 2], lineBox[valueAxis + 1], lineBox[valueAxis + 2]);
|
|
326
298
|
|
|
327
299
|
return limittedSlot;
|
|
328
|
-
}
|
|
300
|
+
}
|
|
329
301
|
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
302
|
+
slot(from, to, limit) {
|
|
303
|
+
const min = Math.floor(this.options.min || 0);
|
|
304
|
+
let start = from;
|
|
305
|
+
let end = to;
|
|
334
306
|
|
|
335
307
|
if (typeof start === "string") {
|
|
336
308
|
start = this.categoryIndex(start);
|
|
@@ -344,31 +316,24 @@ var CategoryAxis = (function (Axis) {
|
|
|
344
316
|
end -= min;
|
|
345
317
|
}
|
|
346
318
|
|
|
347
|
-
return
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
var box = ref$1.box;
|
|
359
|
-
var min = ref$1.min;
|
|
360
|
-
var max = ref$1.max;
|
|
361
|
-
var startValue = reverse ? max : min;
|
|
362
|
-
var lineStart = box[valueAxis + 1];
|
|
363
|
-
var lineEnd = box[valueAxis + 2];
|
|
364
|
-
var pos = point[valueAxis];
|
|
319
|
+
return super.slot(start, end, limit);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
pointCategoryIndex(point) {
|
|
323
|
+
const { reverse, justified, vertical } = this.options;
|
|
324
|
+
const valueAxis = vertical ? Y : X;
|
|
325
|
+
const { scale, box, min, max } = this.scaleOptions();
|
|
326
|
+
const startValue = reverse ? max : min;
|
|
327
|
+
const lineStart = box[valueAxis + 1];
|
|
328
|
+
const lineEnd = box[valueAxis + 2];
|
|
329
|
+
const pos = point[valueAxis];
|
|
365
330
|
|
|
366
331
|
if (pos < lineStart || pos > lineEnd) {
|
|
367
332
|
return null;
|
|
368
333
|
}
|
|
369
334
|
|
|
370
|
-
|
|
371
|
-
|
|
335
|
+
let value = startValue + (pos - lineStart) / scale;
|
|
336
|
+
const diff = value % 1;
|
|
372
337
|
|
|
373
338
|
if (justified) {
|
|
374
339
|
value = Math.round(value);
|
|
@@ -377,55 +342,55 @@ var CategoryAxis = (function (Axis) {
|
|
|
377
342
|
}
|
|
378
343
|
|
|
379
344
|
return Math.floor(value);
|
|
380
|
-
}
|
|
345
|
+
}
|
|
381
346
|
|
|
382
|
-
|
|
383
|
-
|
|
347
|
+
getCategory(point) {
|
|
348
|
+
const index = this.pointCategoryIndex(point);
|
|
384
349
|
|
|
385
350
|
if (index === null) {
|
|
386
351
|
return null;
|
|
387
352
|
}
|
|
388
353
|
|
|
389
354
|
return this.options.categories[index];
|
|
390
|
-
}
|
|
355
|
+
}
|
|
391
356
|
|
|
392
|
-
|
|
357
|
+
categoryIndex(value) {
|
|
393
358
|
return this.totalIndex(value) - Math.floor(this.options.min || 0);
|
|
394
|
-
}
|
|
359
|
+
}
|
|
395
360
|
|
|
396
|
-
|
|
397
|
-
|
|
361
|
+
categoryAt(index, total) {
|
|
362
|
+
const options = this.options;
|
|
398
363
|
|
|
399
364
|
return (total ? options.srcCategories : options.categories)[index];
|
|
400
|
-
}
|
|
365
|
+
}
|
|
401
366
|
|
|
402
|
-
|
|
367
|
+
categoriesCount() {
|
|
403
368
|
return (this.options.categories || []).length;
|
|
404
|
-
}
|
|
369
|
+
}
|
|
405
370
|
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
371
|
+
translateRange(delta) {
|
|
372
|
+
const options = this.options;
|
|
373
|
+
const lineBox = this.lineBox();
|
|
374
|
+
const size = options.vertical ? lineBox.height() : lineBox.width();
|
|
375
|
+
const range = options.categories.length;
|
|
376
|
+
const scale = size / range;
|
|
377
|
+
const offset = round(delta / scale, DEFAULT_PRECISION);
|
|
413
378
|
|
|
414
379
|
return {
|
|
415
380
|
min: offset,
|
|
416
381
|
max: range + offset
|
|
417
382
|
};
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
scaleRange(scale, cursor) {
|
|
386
|
+
const position = Math.abs(this.pointOffset(cursor));
|
|
387
|
+
const rangeIndices = this.limitedRangeIndices();
|
|
388
|
+
const range = rangeIndices.max - rangeIndices.min;
|
|
389
|
+
const delta = this.scaleToDelta(scale, range);
|
|
390
|
+
const minDelta = position * delta;
|
|
391
|
+
const maxDelta = (1 - position) * delta;
|
|
392
|
+
const min = rangeIndices.min + minDelta;
|
|
393
|
+
let max = rangeIndices.max - maxDelta;
|
|
429
394
|
|
|
430
395
|
if (max - min < MIN_CATEGORY_RANGE) {
|
|
431
396
|
max = min + MIN_CATEGORY_RANGE;
|
|
@@ -435,34 +400,29 @@ var CategoryAxis = (function (Axis) {
|
|
|
435
400
|
min: min,
|
|
436
401
|
max: max
|
|
437
402
|
};
|
|
438
|
-
}
|
|
403
|
+
}
|
|
439
404
|
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
var totalMax = ref.max;
|
|
444
|
-
var range = this.scaleRange(scale, cursor);
|
|
405
|
+
zoomRange(scale, cursor) {
|
|
406
|
+
const { min: totalMin, max: totalMax } = this.totalRange();
|
|
407
|
+
const range = this.scaleRange(scale, cursor);
|
|
445
408
|
|
|
446
409
|
return {
|
|
447
410
|
min: limitValue(range.min, totalMin, totalMax),
|
|
448
411
|
max: limitValue(range.max, totalMin, totalMax)
|
|
449
412
|
};
|
|
450
|
-
}
|
|
413
|
+
}
|
|
451
414
|
|
|
452
|
-
|
|
453
|
-
|
|
415
|
+
labelsCount() {
|
|
416
|
+
const labelsRange = this.labelsRange();
|
|
454
417
|
|
|
455
418
|
return labelsRange.max - labelsRange.min;
|
|
456
|
-
}
|
|
419
|
+
}
|
|
457
420
|
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
var min = ref.min;
|
|
464
|
-
var max = ref.max;
|
|
465
|
-
var start = Math.floor(min);
|
|
421
|
+
labelsRange() {
|
|
422
|
+
const options = this.options;
|
|
423
|
+
const { justified, labels: labelOptions } = options;
|
|
424
|
+
let { min, max } = this.limitedRangeIndices(true);
|
|
425
|
+
const start = Math.floor(min);
|
|
466
426
|
|
|
467
427
|
if (!justified) {
|
|
468
428
|
min = Math.floor(min);
|
|
@@ -472,7 +432,7 @@ var CategoryAxis = (function (Axis) {
|
|
|
472
432
|
max = Math.floor(max);
|
|
473
433
|
}
|
|
474
434
|
|
|
475
|
-
|
|
435
|
+
let skip;
|
|
476
436
|
|
|
477
437
|
if (min > labelOptions.skip) {
|
|
478
438
|
skip = labelOptions.skip + labelOptions.step * Math.ceil((min - labelOptions.skip) / labelOptions.step);
|
|
@@ -484,84 +444,77 @@ var CategoryAxis = (function (Axis) {
|
|
|
484
444
|
min: skip - start,
|
|
485
445
|
max: (options.categories.length ? max + (justified ? 1 : 0) : 0) - start
|
|
486
446
|
};
|
|
487
|
-
}
|
|
447
|
+
}
|
|
488
448
|
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
449
|
+
createAxisLabel(index, labelOptions, labelContext) {
|
|
450
|
+
const options = this.options;
|
|
451
|
+
const dataItem = options.dataItems ? options.dataItems[index] : null;
|
|
452
|
+
const category = valueOrDefault(options.categories[index], "");
|
|
493
453
|
|
|
494
454
|
labelContext.dataItem = dataItem;
|
|
495
|
-
|
|
455
|
+
const text = this.axisLabelText(category, labelOptions, labelContext);
|
|
496
456
|
|
|
497
457
|
return new AxisLabel(category, text, index, dataItem, labelOptions);
|
|
498
|
-
}
|
|
458
|
+
}
|
|
499
459
|
|
|
500
|
-
|
|
501
|
-
|
|
460
|
+
shouldRenderNote(value) {
|
|
461
|
+
const range = this.limitedRangeIndices();
|
|
502
462
|
|
|
503
463
|
return Math.floor(range.min) <= value && value <= Math.ceil(range.max);
|
|
504
|
-
}
|
|
464
|
+
}
|
|
505
465
|
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
466
|
+
noteSlot(value) {
|
|
467
|
+
const options = this.options;
|
|
468
|
+
const index = value - Math.floor(options.min || 0);
|
|
509
469
|
return this.getSlot(index);
|
|
510
|
-
}
|
|
470
|
+
}
|
|
511
471
|
|
|
512
|
-
|
|
513
|
-
|
|
472
|
+
arrangeNotes() {
|
|
473
|
+
super.arrangeNotes();
|
|
514
474
|
this.hideOutOfRangeNotes();
|
|
515
|
-
}
|
|
475
|
+
}
|
|
516
476
|
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
var notes = ref.notes;
|
|
520
|
-
var box = ref.box;
|
|
477
|
+
hideOutOfRangeNotes() {
|
|
478
|
+
const { notes, box } = this;
|
|
521
479
|
if (notes && notes.length) {
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
480
|
+
const valueAxis = this.options.vertical ? Y : X;
|
|
481
|
+
const start = box[valueAxis + 1];
|
|
482
|
+
const end = box[valueAxis + 2];
|
|
525
483
|
|
|
526
|
-
for (
|
|
527
|
-
|
|
484
|
+
for (let idx = 0; idx < notes.length; idx++) {
|
|
485
|
+
const note = notes[idx];
|
|
528
486
|
if (note.box && (end < note.box[valueAxis + 1] || note.box[valueAxis + 2] < start)) {
|
|
529
487
|
note.hide();
|
|
530
488
|
}
|
|
531
489
|
}
|
|
532
490
|
}
|
|
533
|
-
}
|
|
491
|
+
}
|
|
534
492
|
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
var max = range.max + offset;
|
|
493
|
+
pan(delta) {
|
|
494
|
+
const range = this.limitedRangeIndices(true);
|
|
495
|
+
const { scale } = this.scaleOptions();
|
|
496
|
+
const offset = round(delta / scale, DEFAULT_PRECISION);
|
|
497
|
+
const totalRange = this.totalRange();
|
|
498
|
+
const min = range.min + offset;
|
|
499
|
+
const max = range.max + offset;
|
|
543
500
|
|
|
544
501
|
return this.limitRange(min, max, 0, totalRange.max, offset);
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
var min = range.min + diffStart / scale;
|
|
562
|
-
var max = range.min + diffEnd / scale;
|
|
563
|
-
var rangeMin = Math.min(min, max);
|
|
564
|
-
var rangeMax = Math.max(min, max);
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
pointsRange(start, end) {
|
|
505
|
+
const { reverse, vertical } = this.options;
|
|
506
|
+
const valueAxis = vertical ? Y : X;
|
|
507
|
+
const range = this.limitedRangeIndices(true);
|
|
508
|
+
const { scale, box } = this.scaleOptions();
|
|
509
|
+
const lineStart = box[valueAxis + (reverse ? 2 : 1)];
|
|
510
|
+
|
|
511
|
+
const diffStart = start[valueAxis] - lineStart;
|
|
512
|
+
const diffEnd = end[valueAxis] - lineStart;
|
|
513
|
+
|
|
514
|
+
const min = range.min + diffStart / scale;
|
|
515
|
+
const max = range.min + diffEnd / scale;
|
|
516
|
+
const rangeMin = Math.min(min, max);
|
|
517
|
+
const rangeMax = Math.max(min, max);
|
|
565
518
|
|
|
566
519
|
if (rangeMax - rangeMin >= MIN_CATEGORY_POINTS_RANGE) {
|
|
567
520
|
return {
|
|
@@ -569,29 +522,29 @@ var CategoryAxis = (function (Axis) {
|
|
|
569
522
|
max: rangeMax
|
|
570
523
|
};
|
|
571
524
|
}
|
|
572
|
-
}
|
|
525
|
+
}
|
|
573
526
|
|
|
574
|
-
|
|
527
|
+
valueRange() {
|
|
575
528
|
return this.range();
|
|
576
|
-
}
|
|
529
|
+
}
|
|
577
530
|
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
531
|
+
totalIndex(value) {
|
|
532
|
+
const options = this.options;
|
|
533
|
+
const index = this._categoriesMap ?
|
|
581
534
|
this._categoriesMap.get(value) : indexOf(value, options.srcCategories);
|
|
582
535
|
|
|
583
536
|
return index;
|
|
584
|
-
}
|
|
537
|
+
}
|
|
585
538
|
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
539
|
+
currentRangeIndices() {
|
|
540
|
+
const options = this.options;
|
|
541
|
+
let min = 0;
|
|
589
542
|
|
|
590
543
|
if (isNumber(options.min)) {
|
|
591
544
|
min = Math.floor(options.min);
|
|
592
545
|
}
|
|
593
546
|
|
|
594
|
-
|
|
547
|
+
let max;
|
|
595
548
|
if (isNumber(options.max)) {
|
|
596
549
|
max = options.justified ? Math.floor(options.max) : Math.ceil(options.max) - 1;
|
|
597
550
|
} else {
|
|
@@ -602,12 +555,12 @@ var CategoryAxis = (function (Axis) {
|
|
|
602
555
|
min: min,
|
|
603
556
|
max: max
|
|
604
557
|
};
|
|
605
|
-
}
|
|
558
|
+
}
|
|
606
559
|
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
560
|
+
limitedRangeIndices(totalLimit) {
|
|
561
|
+
const options = this.options;
|
|
562
|
+
let min = isNumber(options.min) ? options.min : 0;
|
|
563
|
+
let max;
|
|
611
564
|
|
|
612
565
|
if (isNumber(options.max)) {
|
|
613
566
|
max = options.max;
|
|
@@ -618,7 +571,7 @@ var CategoryAxis = (function (Axis) {
|
|
|
618
571
|
}
|
|
619
572
|
|
|
620
573
|
if (totalLimit) {
|
|
621
|
-
|
|
574
|
+
const totalRange = this.totalRange();
|
|
622
575
|
min = limitValue(min, 0, totalRange.max);
|
|
623
576
|
max = limitValue(max, 0, totalRange.max);
|
|
624
577
|
}
|
|
@@ -627,31 +580,29 @@ var CategoryAxis = (function (Axis) {
|
|
|
627
580
|
min: min,
|
|
628
581
|
max: max
|
|
629
582
|
};
|
|
630
|
-
}
|
|
583
|
+
}
|
|
631
584
|
|
|
632
|
-
|
|
585
|
+
totalRangeIndices() {
|
|
633
586
|
return {
|
|
634
587
|
min: 0,
|
|
635
588
|
max: this.totalRange().max || 1
|
|
636
589
|
};
|
|
637
|
-
}
|
|
590
|
+
}
|
|
638
591
|
|
|
639
|
-
|
|
592
|
+
indexCategories() {
|
|
640
593
|
if (!this._categoriesMap) {
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
for (
|
|
594
|
+
const map = this._categoriesMap = new HashMap();
|
|
595
|
+
const srcCategories = this.options.srcCategories;
|
|
596
|
+
for (let idx = 0; idx < srcCategories.length; idx++) {
|
|
644
597
|
map.set(srcCategories[idx], idx);
|
|
645
598
|
}
|
|
646
599
|
}
|
|
647
|
-
}
|
|
600
|
+
}
|
|
648
601
|
|
|
649
|
-
|
|
602
|
+
totalCount() {
|
|
650
603
|
return Math.max(this.options.srcCategories.length, this._seriesMax || 0);
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
return CategoryAxis;
|
|
654
|
-
}(Axis));
|
|
604
|
+
}
|
|
605
|
+
}
|
|
655
606
|
|
|
656
607
|
setDefaultOptions(CategoryAxis, {
|
|
657
608
|
type: "category",
|