@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,11 +8,11 @@ import { LEFT, RIGHT, MIN_VALUE, MAX_VALUE, X } from '../common/constants';
|
|
|
8
8
|
import { addClass, Class, removeClass, eventCoordinates, deepExtend, elementStyles, eventElement, setDefaultOptions, limitValue, round, bindEvents, unbindEvents, mousewheelDelta, hasClasses } from '../common';
|
|
9
9
|
import { parseDate } from '../date-utils';
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
const ZOOM_ACCELERATION = 3;
|
|
12
|
+
const SELECTOR_HEIGHT_ADJUST = 0.1;
|
|
13
13
|
|
|
14
14
|
function createDiv(classNames) {
|
|
15
|
-
|
|
15
|
+
const element = document.createElement("div");
|
|
16
16
|
if (classNames) {
|
|
17
17
|
element.className = classNames;
|
|
18
18
|
}
|
|
@@ -21,7 +21,7 @@ function createDiv(classNames) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
function closestHandle(element) {
|
|
24
|
-
|
|
24
|
+
let current = element;
|
|
25
25
|
while (current && !hasClasses(current, "k-handle")) {
|
|
26
26
|
current = current.parentNode;
|
|
27
27
|
}
|
|
@@ -29,11 +29,11 @@ function closestHandle(element) {
|
|
|
29
29
|
return current;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
class Selection extends Class {
|
|
33
|
+
constructor(chart, categoryAxis, options, observer) {
|
|
34
|
+
super();
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
const chartElement = chart.element;
|
|
37
37
|
|
|
38
38
|
this.options = deepExtend({}, this.options, options);
|
|
39
39
|
this.chart = chart;
|
|
@@ -55,17 +55,13 @@ var Selection = (function (Class) {
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
Selection.prototype = Object.create( Class && Class.prototype );
|
|
60
|
-
Selection.prototype.constructor = Selection;
|
|
61
|
-
|
|
62
|
-
Selection.prototype.onPane = function onPane (pane) {
|
|
58
|
+
onPane(pane) {
|
|
63
59
|
return this.categoryAxis.pane === pane;
|
|
64
|
-
}
|
|
60
|
+
}
|
|
65
61
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
62
|
+
createElements() {
|
|
63
|
+
const options = this.options;
|
|
64
|
+
const wrapper = this.wrapper = createDiv("k-selector k-pointer-events-none");
|
|
69
65
|
elementStyles(wrapper, {
|
|
70
66
|
top: options.offset.top,
|
|
71
67
|
left: options.offset.left,
|
|
@@ -74,7 +70,7 @@ var Selection = (function (Class) {
|
|
|
74
70
|
direction: 'ltr'
|
|
75
71
|
});
|
|
76
72
|
|
|
77
|
-
|
|
73
|
+
const selection = this.selection = createDiv("k-selection k-pointer-events-none");
|
|
78
74
|
|
|
79
75
|
this.leftMask = createDiv("k-mask k-pointer-events-none");
|
|
80
76
|
this.rightMask = createDiv("k-mask k-pointer-events-none");
|
|
@@ -83,11 +79,11 @@ var Selection = (function (Class) {
|
|
|
83
79
|
wrapper.appendChild(this.rightMask);
|
|
84
80
|
wrapper.appendChild(selection);
|
|
85
81
|
|
|
86
|
-
|
|
82
|
+
const body = this.body = createDiv("k-selection-bg k-pointer-events-none");
|
|
87
83
|
selection.appendChild(body);
|
|
88
84
|
|
|
89
|
-
|
|
90
|
-
|
|
85
|
+
const leftHandle = this.leftHandle = createDiv("k-handle k-left-handle k-pointer-events-auto");
|
|
86
|
+
const rightHandle = this.rightHandle = createDiv("k-handle k-right-handle k-pointer-events-auto");
|
|
91
87
|
leftHandle.appendChild(createDiv());
|
|
92
88
|
rightHandle.appendChild(createDiv());
|
|
93
89
|
|
|
@@ -95,9 +91,9 @@ var Selection = (function (Class) {
|
|
|
95
91
|
selection.appendChild(rightHandle);
|
|
96
92
|
|
|
97
93
|
this.chartElement.appendChild(wrapper);
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
94
|
+
const selectionStyles = elementStyles(selection, [ "borderLeftWidth", "borderRightWidth", "height" ]);
|
|
95
|
+
const leftHandleHeight = elementStyles(leftHandle, "height").height;
|
|
96
|
+
const rightHandleHeight = elementStyles(rightHandle, "height").height;
|
|
101
97
|
|
|
102
98
|
options.selection = {
|
|
103
99
|
border: {
|
|
@@ -116,14 +112,14 @@ var Selection = (function (Class) {
|
|
|
116
112
|
|
|
117
113
|
/* eslint no-self-assign: "off" */
|
|
118
114
|
wrapper.style.cssText = wrapper.style.cssText;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
Selection.prototype.bindEvents = function bindEvents$1 () {
|
|
122
|
-
var obj;
|
|
115
|
+
}
|
|
123
116
|
|
|
117
|
+
bindEvents() {
|
|
124
118
|
if (this.options.mousewheel !== false) {
|
|
125
119
|
this._mousewheelHandler = this._mousewheel.bind(this);
|
|
126
|
-
bindEvents(this.chartElement,
|
|
120
|
+
bindEvents(this.chartElement, {
|
|
121
|
+
[ MOUSEWHEEL ]: this._mousewheelHandler
|
|
122
|
+
});
|
|
127
123
|
}
|
|
128
124
|
|
|
129
125
|
this._domEvents = DomEventsBuilder.create(this.chartElement, {
|
|
@@ -137,14 +133,12 @@ var Selection = (function (Class) {
|
|
|
137
133
|
gesturechange: this._gesturechange.bind(this),
|
|
138
134
|
gestureend: this._gestureend.bind(this)
|
|
139
135
|
});
|
|
140
|
-
}
|
|
136
|
+
}
|
|
141
137
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
var box = categoryAxis.pane.chartsBox();
|
|
147
|
-
var intlService = this.chart.chartService.intl;
|
|
138
|
+
initOptions() {
|
|
139
|
+
const { options, categoryAxis } = this;
|
|
140
|
+
const box = categoryAxis.pane.chartsBox();
|
|
141
|
+
const intlService = this.chart.chartService.intl;
|
|
148
142
|
|
|
149
143
|
if (this._dateAxis) {
|
|
150
144
|
deepExtend(options, {
|
|
@@ -155,9 +149,7 @@ var Selection = (function (Class) {
|
|
|
155
149
|
});
|
|
156
150
|
}
|
|
157
151
|
|
|
158
|
-
|
|
159
|
-
var paddingLeft = ref$1.paddingLeft;
|
|
160
|
-
var paddingTop = ref$1.paddingTop;
|
|
152
|
+
const { paddingLeft, paddingTop } = elementStyles(this.chartElement, [ "paddingLeft", "paddingTop" ]);
|
|
161
153
|
|
|
162
154
|
this.options = deepExtend({}, {
|
|
163
155
|
width: box.width(),
|
|
@@ -173,11 +165,9 @@ var Selection = (function (Class) {
|
|
|
173
165
|
from: options.min,
|
|
174
166
|
to: options.max
|
|
175
167
|
}, options);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
Selection.prototype.destroy = function destroy () {
|
|
179
|
-
var obj;
|
|
168
|
+
}
|
|
180
169
|
|
|
170
|
+
destroy() {
|
|
181
171
|
if (this._domEvents) {
|
|
182
172
|
this._domEvents.destroy();
|
|
183
173
|
delete this._domEvents;
|
|
@@ -188,60 +178,62 @@ var Selection = (function (Class) {
|
|
|
188
178
|
|
|
189
179
|
if (this.wrapper) {
|
|
190
180
|
if (this._mousewheelHandler) {
|
|
191
|
-
unbindEvents(this.chartElement,
|
|
181
|
+
unbindEvents(this.chartElement, {
|
|
182
|
+
[ MOUSEWHEEL ]: this._mousewheelHandler
|
|
183
|
+
});
|
|
192
184
|
this._mousewheelHandler = null;
|
|
193
185
|
}
|
|
194
186
|
|
|
195
187
|
this.chartElement.removeChild(this.wrapper);
|
|
196
188
|
this.wrapper = null;
|
|
197
189
|
}
|
|
198
|
-
}
|
|
190
|
+
}
|
|
199
191
|
|
|
200
|
-
|
|
192
|
+
_rangeEventArgs(range) {
|
|
201
193
|
|
|
202
194
|
return {
|
|
203
195
|
axis: this.categoryAxis.options,
|
|
204
196
|
from: this._value(range.from),
|
|
205
197
|
to: this._value(range.to)
|
|
206
198
|
};
|
|
207
|
-
}
|
|
199
|
+
}
|
|
208
200
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
201
|
+
_pointInPane(x, y) {
|
|
202
|
+
const paneBox = this.categoryAxis.pane.box;
|
|
203
|
+
const modelCoords = this.chart._toModelCoordinates(x, y);
|
|
212
204
|
return paneBox.containsPoint(modelCoords);
|
|
213
|
-
}
|
|
205
|
+
}
|
|
214
206
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
207
|
+
_start(e) {
|
|
208
|
+
const options = this.options;
|
|
209
|
+
const target = eventElement(e);
|
|
218
210
|
if (this._state || !target) {
|
|
219
211
|
return;
|
|
220
212
|
}
|
|
221
213
|
|
|
222
|
-
|
|
223
|
-
|
|
214
|
+
const coords = eventCoordinates(e);
|
|
215
|
+
const inPane = this._pointInPane(coords.x, coords.y);
|
|
224
216
|
if (!inPane) {
|
|
225
217
|
return;
|
|
226
218
|
}
|
|
227
219
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
220
|
+
const handle = closestHandle(target);
|
|
221
|
+
const bodyRect = this.body.getBoundingClientRect();
|
|
222
|
+
const inBody = !handle && coords.x >= bodyRect.x && coords.x <= bodyRect.x + bodyRect.width &&
|
|
231
223
|
coords.y >= bodyRect.y && coords.y <= bodyRect.y + bodyRect.height;
|
|
232
224
|
|
|
233
225
|
this.chart._unsetActivePoint();
|
|
234
226
|
this._state = {
|
|
235
227
|
moveTarget: handle,
|
|
236
228
|
startLocation: e.x ? e.x.location : 0,
|
|
237
|
-
inBody
|
|
229
|
+
inBody,
|
|
238
230
|
range: {
|
|
239
231
|
from: this._index(options.from),
|
|
240
232
|
to: this._index(options.to)
|
|
241
233
|
}
|
|
242
234
|
};
|
|
243
235
|
|
|
244
|
-
|
|
236
|
+
const args = this._rangeEventArgs({
|
|
245
237
|
from: this._index(options.from),
|
|
246
238
|
to: this._index(options.to)
|
|
247
239
|
});
|
|
@@ -249,10 +241,10 @@ var Selection = (function (Class) {
|
|
|
249
241
|
if (this.trigger(SELECT_START, args)) {
|
|
250
242
|
this._state = null;
|
|
251
243
|
}
|
|
252
|
-
}
|
|
244
|
+
}
|
|
253
245
|
|
|
254
|
-
|
|
255
|
-
|
|
246
|
+
_press(e) {
|
|
247
|
+
let handle;
|
|
256
248
|
if (this._state) {
|
|
257
249
|
handle = this._state.moveTarget;
|
|
258
250
|
} else {
|
|
@@ -261,36 +253,32 @@ var Selection = (function (Class) {
|
|
|
261
253
|
if (handle) {
|
|
262
254
|
addClass(handle, "k-handle-active");
|
|
263
255
|
}
|
|
264
|
-
}
|
|
256
|
+
}
|
|
265
257
|
|
|
266
|
-
|
|
258
|
+
_move(e) {
|
|
267
259
|
if (!this._state) {
|
|
268
260
|
return;
|
|
269
261
|
}
|
|
270
262
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
var oldRange = { from: range.from, to: range.to };
|
|
284
|
-
var span = range.to - range.from;
|
|
285
|
-
var scale = elementStyles(this.wrapper, "width").width / (categoryAxis.categoriesCount() - 1);
|
|
286
|
-
var offset = Math.round(delta / scale) * (reverse ? -1 : 1);
|
|
263
|
+
const { _state: state, options, categoryAxis } = this;
|
|
264
|
+
const { range, moveTarget: target } = state;
|
|
265
|
+
const reverse = categoryAxis.options.reverse;
|
|
266
|
+
const from = this._index(options.from);
|
|
267
|
+
const to = this._index(options.to);
|
|
268
|
+
const min = this._index(options.min);
|
|
269
|
+
const max = this._index(options.max);
|
|
270
|
+
const delta = state.startLocation - e.x.location;
|
|
271
|
+
const oldRange = { from: range.from, to: range.to };
|
|
272
|
+
const span = range.to - range.from;
|
|
273
|
+
const scale = elementStyles(this.wrapper, "width").width / (categoryAxis.categoriesCount() - 1);
|
|
274
|
+
const offset = Math.round(delta / scale) * (reverse ? -1 : 1);
|
|
287
275
|
|
|
288
276
|
if (!target && !state.inBody) {
|
|
289
277
|
return;
|
|
290
278
|
}
|
|
291
279
|
|
|
292
|
-
|
|
293
|
-
|
|
280
|
+
const leftHandle = target && hasClasses(target, "k-left-handle");
|
|
281
|
+
const rightHandle = target && hasClasses(target, "k-right-handle");
|
|
294
282
|
|
|
295
283
|
if (state.inBody) {
|
|
296
284
|
range.from = Math.min(
|
|
@@ -319,38 +307,36 @@ var Selection = (function (Class) {
|
|
|
319
307
|
this.move(range.from, range.to);
|
|
320
308
|
this.trigger(SELECT, this._rangeEventArgs(range));
|
|
321
309
|
}
|
|
322
|
-
}
|
|
310
|
+
}
|
|
323
311
|
|
|
324
|
-
|
|
312
|
+
_end() {
|
|
325
313
|
if (this._state) {
|
|
326
|
-
|
|
314
|
+
const moveTarget = this._state.moveTarget;
|
|
327
315
|
if (moveTarget) {
|
|
328
316
|
removeClass(moveTarget, "k-handle-active");
|
|
329
317
|
}
|
|
330
318
|
|
|
331
|
-
|
|
319
|
+
const range = this._state.range;
|
|
332
320
|
this.set(range.from, range.to);
|
|
333
321
|
this.trigger(SELECT_END, this._rangeEventArgs(range));
|
|
334
322
|
|
|
335
323
|
delete this._state;
|
|
336
324
|
}
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
var rightClick = e.event.which === 3;
|
|
353
|
-
var offset = Math.round(mid - categoryIx);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
_tap(e) {
|
|
328
|
+
const { options, categoryAxis } = this;
|
|
329
|
+
const coords = this.chart._eventCoordinates(e);
|
|
330
|
+
const categoryIx = categoryAxis.pointCategoryIndex(new Point(coords.x, categoryAxis.box.y1));
|
|
331
|
+
const from = this._index(options.from);
|
|
332
|
+
const to = this._index(options.to);
|
|
333
|
+
const min = this._index(options.min);
|
|
334
|
+
const max = this._index(options.max);
|
|
335
|
+
const span = to - from;
|
|
336
|
+
const mid = from + span / 2;
|
|
337
|
+
const range = {};
|
|
338
|
+
const rightClick = e.event.which === 3;
|
|
339
|
+
let offset = Math.round(mid - categoryIx);
|
|
354
340
|
|
|
355
341
|
if (this._state || rightClick) {
|
|
356
342
|
return;
|
|
@@ -377,17 +363,15 @@ var Selection = (function (Class) {
|
|
|
377
363
|
this.trigger(SELECT, this._rangeEventArgs(range));
|
|
378
364
|
this._end();
|
|
379
365
|
}
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
Selection.prototype._mousewheel = function _mousewheel (e) {
|
|
383
|
-
var this$1 = this;
|
|
366
|
+
}
|
|
384
367
|
|
|
385
|
-
|
|
368
|
+
_mousewheel(e) {
|
|
369
|
+
let delta = mousewheelDelta(e);
|
|
386
370
|
|
|
387
371
|
this._start(e);
|
|
388
372
|
|
|
389
373
|
if (this._state) {
|
|
390
|
-
|
|
374
|
+
const range = this._state.range;
|
|
391
375
|
|
|
392
376
|
e.preventDefault();
|
|
393
377
|
e.stopPropagation();
|
|
@@ -414,16 +398,16 @@ var Selection = (function (Class) {
|
|
|
414
398
|
clearTimeout(this._mwTimeout);
|
|
415
399
|
}
|
|
416
400
|
|
|
417
|
-
this._mwTimeout = setTimeout(
|
|
418
|
-
this
|
|
401
|
+
this._mwTimeout = setTimeout(() => {
|
|
402
|
+
this._end();
|
|
419
403
|
}, MOUSEWHEEL_DELAY);
|
|
420
404
|
}
|
|
421
|
-
}
|
|
405
|
+
}
|
|
422
406
|
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
407
|
+
_gesturestart(e) {
|
|
408
|
+
const options = this.options;
|
|
409
|
+
const touch = e.touches[0];
|
|
410
|
+
const inPane = this._pointInPane(touch.pageX, touch.pageY);
|
|
427
411
|
|
|
428
412
|
if (!inPane) {
|
|
429
413
|
return;
|
|
@@ -435,37 +419,33 @@ var Selection = (function (Class) {
|
|
|
435
419
|
to: this._index(options.to)
|
|
436
420
|
}
|
|
437
421
|
};
|
|
438
|
-
|
|
422
|
+
const args = this._rangeEventArgs(this._state.range);
|
|
439
423
|
|
|
440
424
|
if (this.trigger(SELECT_START, args)) {
|
|
441
425
|
this._state = null;
|
|
442
426
|
} else {
|
|
443
427
|
e.preventDefault();
|
|
444
428
|
}
|
|
445
|
-
}
|
|
429
|
+
}
|
|
446
430
|
|
|
447
|
-
|
|
431
|
+
_gestureend() {
|
|
448
432
|
if (this._state) {
|
|
449
433
|
this.trigger(SELECT_END, this._rangeEventArgs(this._state.range));
|
|
450
434
|
delete this._state;
|
|
451
435
|
}
|
|
452
|
-
}
|
|
436
|
+
}
|
|
453
437
|
|
|
454
|
-
|
|
438
|
+
_gesturechange(e) {
|
|
455
439
|
if (!this._state) {
|
|
456
440
|
return;
|
|
457
441
|
}
|
|
458
442
|
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
var p0 = chart._toModelCoordinates(e.touches[0].x.location).x;
|
|
466
|
-
var p1 = chart._toModelCoordinates(e.touches[1].x.location).x;
|
|
467
|
-
var left = Math.min(p0, p1);
|
|
468
|
-
var right = Math.max(p0, p1);
|
|
443
|
+
const { chart, _state: state, options, categoryAxis } = this;
|
|
444
|
+
const range = state.range;
|
|
445
|
+
const p0 = chart._toModelCoordinates(e.touches[0].x.location).x;
|
|
446
|
+
const p1 = chart._toModelCoordinates(e.touches[1].x.location).x;
|
|
447
|
+
const left = Math.min(p0, p1);
|
|
448
|
+
const right = Math.max(p0, p1);
|
|
469
449
|
|
|
470
450
|
e.preventDefault();
|
|
471
451
|
|
|
@@ -476,20 +456,20 @@ var Selection = (function (Class) {
|
|
|
476
456
|
this.move(range.from, range.to);
|
|
477
457
|
|
|
478
458
|
this.trigger(SELECT, this._rangeEventArgs(range));
|
|
479
|
-
}
|
|
459
|
+
}
|
|
480
460
|
|
|
481
|
-
|
|
482
|
-
|
|
461
|
+
_index(value) {
|
|
462
|
+
let index = value;
|
|
483
463
|
|
|
484
464
|
if (value instanceof Date) {
|
|
485
465
|
index = this.categoryAxis.categoryIndex(value);
|
|
486
466
|
}
|
|
487
467
|
|
|
488
468
|
return index;
|
|
489
|
-
}
|
|
469
|
+
}
|
|
490
470
|
|
|
491
|
-
|
|
492
|
-
|
|
471
|
+
_value(index) {
|
|
472
|
+
let value = index;
|
|
493
473
|
if (this._dateAxis) {
|
|
494
474
|
value = this.categoryAxis.categoryAt(index);
|
|
495
475
|
if (value > this.options.max) {
|
|
@@ -498,27 +478,25 @@ var Selection = (function (Class) {
|
|
|
498
478
|
}
|
|
499
479
|
|
|
500
480
|
return value;
|
|
501
|
-
}
|
|
481
|
+
}
|
|
502
482
|
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
483
|
+
_slot(value) {
|
|
484
|
+
const categoryAxis = this.categoryAxis;
|
|
485
|
+
const index = this._index(value);
|
|
506
486
|
|
|
507
487
|
return categoryAxis.getSlot(index, index, true);
|
|
508
|
-
}
|
|
488
|
+
}
|
|
509
489
|
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
var right = reverse ? from : to;
|
|
518
|
-
var edge = 'x' + (reverse ? 2 : 1);
|
|
490
|
+
move(from, to) {
|
|
491
|
+
const options = this.options;
|
|
492
|
+
const reverse = this.categoryAxis.options.reverse;
|
|
493
|
+
const { offset, padding, selection: { border } } = options;
|
|
494
|
+
const left = reverse ? to : from;
|
|
495
|
+
const right = reverse ? from : to;
|
|
496
|
+
const edge = 'x' + (reverse ? 2 : 1);
|
|
519
497
|
|
|
520
|
-
|
|
521
|
-
|
|
498
|
+
let box = this._slot(left);
|
|
499
|
+
const leftMaskWidth = round(box[edge] - offset.left + padding.left);
|
|
522
500
|
|
|
523
501
|
elementStyles(this.leftMask, {
|
|
524
502
|
width: leftMaskWidth
|
|
@@ -529,12 +507,12 @@ var Selection = (function (Class) {
|
|
|
529
507
|
|
|
530
508
|
box = this._slot(right);
|
|
531
509
|
|
|
532
|
-
|
|
510
|
+
const rightMaskWidth = round(options.width - (box[edge] - offset.left + padding.left));
|
|
533
511
|
elementStyles(this.rightMask, {
|
|
534
512
|
width: rightMaskWidth
|
|
535
513
|
});
|
|
536
514
|
|
|
537
|
-
|
|
515
|
+
let distance = options.width - rightMaskWidth;
|
|
538
516
|
if (distance !== options.width) {
|
|
539
517
|
distance += border.right;
|
|
540
518
|
}
|
|
@@ -545,14 +523,14 @@ var Selection = (function (Class) {
|
|
|
545
523
|
elementStyles(this.selection, {
|
|
546
524
|
width: Math.max(options.width - (leftMaskWidth + rightMaskWidth) - border.right, 0)
|
|
547
525
|
});
|
|
548
|
-
}
|
|
526
|
+
}
|
|
549
527
|
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
528
|
+
set(from, to) {
|
|
529
|
+
const options = this.options;
|
|
530
|
+
const min = this._index(options.min);
|
|
531
|
+
const max = this._index(options.max);
|
|
532
|
+
const fromValue = limitValue(this._index(from), min, max);
|
|
533
|
+
const toValue = limitValue(this._index(to), fromValue + 1, max);
|
|
556
534
|
|
|
557
535
|
if (options.visible) {
|
|
558
536
|
this.move(fromValue, toValue);
|
|
@@ -560,17 +538,17 @@ var Selection = (function (Class) {
|
|
|
560
538
|
|
|
561
539
|
options.from = this._value(fromValue);
|
|
562
540
|
options.to = this._value(toValue);
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
expand(delta) {
|
|
544
|
+
const options = this.options;
|
|
545
|
+
const min = this._index(options.min);
|
|
546
|
+
const max = this._index(options.max);
|
|
547
|
+
const zDir = options.mousewheel.zoom;
|
|
548
|
+
const from = this._index(options.from);
|
|
549
|
+
const to = this._index(options.to);
|
|
550
|
+
let range = { from: from, to: to };
|
|
551
|
+
const oldRange = deepExtend({}, range);
|
|
574
552
|
|
|
575
553
|
if (this._state) {
|
|
576
554
|
range = this._state.range;
|
|
@@ -595,26 +573,25 @@ var Selection = (function (Class) {
|
|
|
595
573
|
this.set(range.from, range.to);
|
|
596
574
|
return true;
|
|
597
575
|
}
|
|
598
|
-
}
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
var maxDelta = round((1 - position) * delta);
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
zoom(delta, coords) {
|
|
579
|
+
const options = this.options;
|
|
580
|
+
const min = this._index(options.min);
|
|
581
|
+
const max = this._index(options.max);
|
|
582
|
+
const from = this._index(options.from);
|
|
583
|
+
const to = this._index(options.to);
|
|
584
|
+
let range = { from: from, to: to };
|
|
585
|
+
const oldRange = deepExtend({}, range);
|
|
586
|
+
|
|
587
|
+
const { reverse } = this.categoryAxis.options;
|
|
588
|
+
const origin = X + (reverse ? '2' : '1');
|
|
589
|
+
const lineBox = this.categoryAxis.lineBox();
|
|
590
|
+
const relative = Math.abs(lineBox[origin] - coords[X]);
|
|
591
|
+
const size = lineBox.width();
|
|
592
|
+
const position = round(relative / size, 2);
|
|
593
|
+
const minDelta = round(position * delta);
|
|
594
|
+
const maxDelta = round((1 - position) * delta);
|
|
618
595
|
|
|
619
596
|
if (this._state) {
|
|
620
597
|
range = this._state.range;
|
|
@@ -635,14 +612,12 @@ var Selection = (function (Class) {
|
|
|
635
612
|
this.set(range.from, range.to);
|
|
636
613
|
return true;
|
|
637
614
|
}
|
|
638
|
-
}
|
|
615
|
+
}
|
|
639
616
|
|
|
640
|
-
|
|
617
|
+
trigger(name, args) {
|
|
641
618
|
return (this.observer || this.chart).trigger(name, args);
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
return Selection;
|
|
645
|
-
}(Class));
|
|
619
|
+
}
|
|
620
|
+
}
|
|
646
621
|
|
|
647
622
|
setDefaultOptions(Selection, {
|
|
648
623
|
visible: true,
|