@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
|
@@ -7,13 +7,13 @@ import now from './now';
|
|
|
7
7
|
import grep from './grep';
|
|
8
8
|
import Observable from './observable';
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
const extend = Object.assign;
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
const preventDefault = (e) => {
|
|
13
13
|
e.preventDefault();
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
let
|
|
17
17
|
DEFAULT_MIN_HOLD = 800,
|
|
18
18
|
CLICK_DELAY = 300,
|
|
19
19
|
DEFAULT_THRESHOLD = 0,
|
|
@@ -32,7 +32,7 @@ var
|
|
|
32
32
|
GESTUREEND = 'gestureend',
|
|
33
33
|
GESTURETAP = 'gesturetap';
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
let THRESHOLD = {
|
|
36
36
|
'api': 0,
|
|
37
37
|
'touch': 0,
|
|
38
38
|
'mouse': 9,
|
|
@@ -40,7 +40,7 @@ var THRESHOLD = {
|
|
|
40
40
|
};
|
|
41
41
|
|
|
42
42
|
function touchDelta(touch1, touch2) {
|
|
43
|
-
|
|
43
|
+
let x1 = touch1.x.location,
|
|
44
44
|
y1 = touch1.y.location,
|
|
45
45
|
x2 = touch2.x.location,
|
|
46
46
|
y2 = touch2.y.location,
|
|
@@ -57,7 +57,7 @@ function touchDelta(touch1, touch2) {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
function getTouches(e) {
|
|
60
|
-
|
|
60
|
+
let touches = [],
|
|
61
61
|
originalEvent = e.originalEvent || e,
|
|
62
62
|
currentTarget = e.currentTarget;
|
|
63
63
|
|
|
@@ -83,10 +83,10 @@ function getTouches(e) {
|
|
|
83
83
|
|
|
84
84
|
return touches;
|
|
85
85
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
86
|
+
class TouchAxis extends Class {
|
|
87
|
+
constructor(axis, location) {
|
|
88
|
+
super();
|
|
89
|
+
let that = this;
|
|
90
90
|
|
|
91
91
|
that.support = getSupportedFeatures();
|
|
92
92
|
that.invalidZeroEvents = this.support.mobileOS && this.support.mobileOS.android;
|
|
@@ -97,12 +97,8 @@ var TouchAxis = (function (Class) {
|
|
|
97
97
|
that.timeStamp = now();
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
TouchAxis.prototype.constructor = TouchAxis;
|
|
103
|
-
|
|
104
|
-
TouchAxis.prototype.move = function move (location) {
|
|
105
|
-
var that = this,
|
|
100
|
+
move(location) {
|
|
101
|
+
let that = this,
|
|
106
102
|
offset = location['page' + that.axis],
|
|
107
103
|
timeStamp = now(),
|
|
108
104
|
timeDelta = timeStamp - that.timeStamp || 1;
|
|
@@ -116,23 +112,21 @@ var TouchAxis = (function (Class) {
|
|
|
116
112
|
that.initialDelta = offset - that.startLocation;
|
|
117
113
|
that.velocity = that.delta / timeDelta;
|
|
118
114
|
that.timeStamp = timeStamp;
|
|
119
|
-
}
|
|
115
|
+
}
|
|
120
116
|
|
|
121
|
-
|
|
122
|
-
|
|
117
|
+
_updateLocationData(location) {
|
|
118
|
+
let that = this,
|
|
123
119
|
axis = that.axis;
|
|
124
120
|
|
|
125
121
|
that.location = location['page' + axis];
|
|
126
122
|
that.client = location['client' + axis];
|
|
127
123
|
that.screen = location['screen' + axis];
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
return TouchAxis;
|
|
131
|
-
}(Class));
|
|
124
|
+
}
|
|
125
|
+
}
|
|
132
126
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
127
|
+
class Touch extends Class {
|
|
128
|
+
constructor(userEvents, target, touchInfo) {
|
|
129
|
+
super();
|
|
136
130
|
|
|
137
131
|
extend(this, {
|
|
138
132
|
x: new TouchAxis('X', touchInfo.location),
|
|
@@ -152,19 +146,13 @@ var Touch = (function (Class) {
|
|
|
152
146
|
});
|
|
153
147
|
}
|
|
154
148
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
Touch.prototype.constructor = Touch;
|
|
158
|
-
|
|
159
|
-
Touch.prototype.press = function press () {
|
|
160
|
-
var this$1 = this;
|
|
161
|
-
|
|
162
|
-
this._holdTimeout = setTimeout(function () { return this$1._hold(); }, this.userEvents.minHold);
|
|
149
|
+
press() {
|
|
150
|
+
this._holdTimeout = setTimeout(() => this._hold(), this.userEvents.minHold);
|
|
163
151
|
this._trigger(PRESS, this.pressEvent);
|
|
164
|
-
}
|
|
152
|
+
}
|
|
165
153
|
|
|
166
|
-
|
|
167
|
-
|
|
154
|
+
_tap(touchInfo) {
|
|
155
|
+
let that = this;
|
|
168
156
|
|
|
169
157
|
that.userEvents._clicks++;
|
|
170
158
|
|
|
@@ -179,16 +167,16 @@ var Touch = (function (Class) {
|
|
|
179
167
|
that.userEvents._clicks = 0;
|
|
180
168
|
}, CLICK_DELAY);
|
|
181
169
|
}
|
|
182
|
-
}
|
|
170
|
+
}
|
|
183
171
|
|
|
184
|
-
|
|
172
|
+
_hold() {
|
|
185
173
|
this._trigger(HOLD, this.pressEvent);
|
|
186
|
-
}
|
|
174
|
+
}
|
|
187
175
|
|
|
188
176
|
/* eslint-disable consistent-return */
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
177
|
+
move(touchInfo) {
|
|
178
|
+
let that = this;
|
|
179
|
+
let preventMove = touchInfo.type !== 'api' && that.userEvents._shouldNotMove;
|
|
192
180
|
|
|
193
181
|
if (that._finished || preventMove) {
|
|
194
182
|
return;
|
|
@@ -212,10 +200,10 @@ var Touch = (function (Class) {
|
|
|
212
200
|
if (!that._finished) {
|
|
213
201
|
that._trigger(MOVE, touchInfo);
|
|
214
202
|
}
|
|
215
|
-
}
|
|
203
|
+
}
|
|
216
204
|
/* eslint-enable consistent-return */
|
|
217
205
|
|
|
218
|
-
|
|
206
|
+
end(touchInfo) {
|
|
219
207
|
this.endTime = now();
|
|
220
208
|
|
|
221
209
|
if (this._finished) {
|
|
@@ -237,10 +225,10 @@ var Touch = (function (Class) {
|
|
|
237
225
|
|
|
238
226
|
clearTimeout(this._holdTimeout);
|
|
239
227
|
this.dispose();
|
|
240
|
-
}
|
|
228
|
+
}
|
|
241
229
|
|
|
242
|
-
|
|
243
|
-
|
|
230
|
+
dispose() {
|
|
231
|
+
let userEvents = this.userEvents,
|
|
244
232
|
activeTouches = userEvents.touches || [];
|
|
245
233
|
|
|
246
234
|
this._finished = true;
|
|
@@ -248,32 +236,32 @@ var Touch = (function (Class) {
|
|
|
248
236
|
|
|
249
237
|
clearTimeout(this._holdTimeout);
|
|
250
238
|
// activeTouches.splice($.inArray(this, activeTouches), 1);
|
|
251
|
-
|
|
239
|
+
const activeTouchIndex = activeTouches.indexOf(this);
|
|
252
240
|
activeTouches.splice(activeTouchIndex, 1);
|
|
253
|
-
}
|
|
241
|
+
}
|
|
254
242
|
|
|
255
|
-
|
|
243
|
+
skip() {
|
|
256
244
|
this.dispose();
|
|
257
|
-
}
|
|
245
|
+
}
|
|
258
246
|
|
|
259
|
-
|
|
247
|
+
cancel() {
|
|
260
248
|
this.dispose();
|
|
261
|
-
}
|
|
249
|
+
}
|
|
262
250
|
|
|
263
|
-
|
|
251
|
+
isMoved() {
|
|
264
252
|
return this._moved;
|
|
265
|
-
}
|
|
253
|
+
}
|
|
266
254
|
|
|
267
|
-
|
|
255
|
+
_start(touchInfo) {
|
|
268
256
|
clearTimeout(this._holdTimeout);
|
|
269
257
|
this.startTime = now();
|
|
270
258
|
this._moved = true;
|
|
271
259
|
this._trigger(START, touchInfo);
|
|
272
|
-
}
|
|
260
|
+
}
|
|
273
261
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
262
|
+
_trigger(name, touchInfo) {
|
|
263
|
+
const e = touchInfo.event;
|
|
264
|
+
const data = {
|
|
277
265
|
touch: this,
|
|
278
266
|
x: this.x,
|
|
279
267
|
y: this.y,
|
|
@@ -284,19 +272,17 @@ var Touch = (function (Class) {
|
|
|
284
272
|
if (this.userEvents.notify(name, data)) {
|
|
285
273
|
e.preventDefault();
|
|
286
274
|
}
|
|
287
|
-
}
|
|
275
|
+
}
|
|
288
276
|
|
|
289
|
-
|
|
290
|
-
|
|
277
|
+
_withinIgnoreThreshold() {
|
|
278
|
+
let xDelta = this.x.initialDelta,
|
|
291
279
|
yDelta = this.y.initialDelta;
|
|
292
280
|
return Math.sqrt(xDelta * xDelta + yDelta * yDelta) <= this.threshold;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
return Touch;
|
|
296
|
-
}(Class));
|
|
281
|
+
}
|
|
282
|
+
}
|
|
297
283
|
|
|
298
284
|
function withEachUpEvent(callback) {
|
|
299
|
-
|
|
285
|
+
let downEvents = eventMap.up.split(' '),
|
|
300
286
|
idx = 0,
|
|
301
287
|
length = downEvents.length;
|
|
302
288
|
|
|
@@ -305,13 +291,13 @@ function withEachUpEvent(callback) {
|
|
|
305
291
|
}
|
|
306
292
|
}
|
|
307
293
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
294
|
+
export default class UserEvents extends Observable {
|
|
295
|
+
constructor(element, options) {
|
|
296
|
+
super();
|
|
297
|
+
let that = this;
|
|
298
|
+
let filter;
|
|
313
299
|
|
|
314
|
-
|
|
300
|
+
const support = getSupportedFeatures();
|
|
315
301
|
this.support = support;
|
|
316
302
|
|
|
317
303
|
/* eslint-disable no-param-reassign */
|
|
@@ -361,7 +347,7 @@ var UserEvents = (function (Observable) {
|
|
|
361
347
|
on(element, applyEventMap('mousedown'), filter, this._elementSelectHandler);
|
|
362
348
|
|
|
363
349
|
if (that.captureUpIfMoved) {
|
|
364
|
-
|
|
350
|
+
let surfaceElement = that.surface;
|
|
365
351
|
that._preventIfMovingProxy = that.preventIfMoving.bind(that);
|
|
366
352
|
|
|
367
353
|
withEachUpEvent(function(eventName) {
|
|
@@ -387,20 +373,16 @@ var UserEvents = (function (Observable) {
|
|
|
387
373
|
], options);
|
|
388
374
|
}
|
|
389
375
|
|
|
390
|
-
|
|
391
|
-
UserEvents.prototype = Object.create( Observable && Observable.prototype );
|
|
392
|
-
UserEvents.prototype.constructor = UserEvents;
|
|
393
|
-
|
|
394
|
-
UserEvents.prototype.preventIfMoving = function preventIfMoving (e) {
|
|
376
|
+
preventIfMoving(e) {
|
|
395
377
|
if (this._isMoved()) {
|
|
396
378
|
e.preventDefault();
|
|
397
379
|
}
|
|
398
|
-
}
|
|
380
|
+
}
|
|
399
381
|
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
382
|
+
destroy() {
|
|
383
|
+
let that = this;
|
|
384
|
+
const options = this.options;
|
|
385
|
+
const element = this.element;
|
|
404
386
|
|
|
405
387
|
if (that._destroyed) {
|
|
406
388
|
return;
|
|
@@ -409,7 +391,7 @@ var UserEvents = (function (Observable) {
|
|
|
409
391
|
that._destroyed = true;
|
|
410
392
|
|
|
411
393
|
if (that.captureUpIfMoved) {
|
|
412
|
-
|
|
394
|
+
let surfaceElement = that.surface;
|
|
413
395
|
withEachUpEvent(function(eventName) {
|
|
414
396
|
surfaceElement.removeEventListener(eventName, that._preventIfMovingProxy, true);
|
|
415
397
|
});
|
|
@@ -432,21 +414,21 @@ var UserEvents = (function (Observable) {
|
|
|
432
414
|
delete that.surface;
|
|
433
415
|
delete that.element;
|
|
434
416
|
delete that.currentTarget;
|
|
435
|
-
}
|
|
417
|
+
}
|
|
436
418
|
|
|
437
|
-
|
|
419
|
+
capture() {
|
|
438
420
|
UserEvents.current = this;
|
|
439
|
-
}
|
|
421
|
+
}
|
|
440
422
|
|
|
441
|
-
|
|
423
|
+
cancel() {
|
|
442
424
|
this._disposeAll();
|
|
443
425
|
this.trigger(CANCEL);
|
|
444
|
-
}
|
|
426
|
+
}
|
|
445
427
|
|
|
446
|
-
|
|
447
|
-
|
|
428
|
+
notify(event, data) {
|
|
429
|
+
let that = this,
|
|
448
430
|
touches = that.touches;
|
|
449
|
-
|
|
431
|
+
let eventName = event;
|
|
450
432
|
|
|
451
433
|
if (this._isMultiTouch()) {
|
|
452
434
|
switch (eventName) {
|
|
@@ -471,50 +453,48 @@ var UserEvents = (function (Observable) {
|
|
|
471
453
|
return this.trigger(eventName, extend(data, {
|
|
472
454
|
type: eventName
|
|
473
455
|
}));
|
|
474
|
-
}
|
|
456
|
+
}
|
|
475
457
|
|
|
476
|
-
|
|
458
|
+
press(x, y, target) {
|
|
477
459
|
this._apiCall('_start', x, y, target);
|
|
478
|
-
}
|
|
460
|
+
}
|
|
479
461
|
|
|
480
|
-
|
|
462
|
+
move(x, y) {
|
|
481
463
|
this._apiCall('_move', x, y);
|
|
482
|
-
}
|
|
464
|
+
}
|
|
483
465
|
|
|
484
|
-
|
|
466
|
+
end(x, y) {
|
|
485
467
|
this._apiCall('_end', x, y);
|
|
486
|
-
}
|
|
468
|
+
}
|
|
487
469
|
|
|
488
|
-
|
|
470
|
+
_isMultiTouch() {
|
|
489
471
|
return this.touches.length > 1;
|
|
490
|
-
}
|
|
472
|
+
}
|
|
491
473
|
|
|
492
|
-
|
|
474
|
+
_maxTouchesReached() {
|
|
493
475
|
return this.touches.length >= this._maxTouches;
|
|
494
|
-
}
|
|
476
|
+
}
|
|
495
477
|
|
|
496
|
-
|
|
497
|
-
|
|
478
|
+
_disposeAll() {
|
|
479
|
+
let touches = this.touches;
|
|
498
480
|
while (touches.length > 0) {
|
|
499
481
|
touches.pop().dispose();
|
|
500
482
|
}
|
|
501
|
-
}
|
|
483
|
+
}
|
|
502
484
|
|
|
503
|
-
|
|
485
|
+
_isMoved() {
|
|
504
486
|
return grep(this.touches, function(touch) {
|
|
505
487
|
return touch.isMoved();
|
|
506
488
|
}).length;
|
|
507
|
-
}
|
|
489
|
+
}
|
|
508
490
|
|
|
509
|
-
|
|
491
|
+
_select(e) {
|
|
510
492
|
if (!this.allowSelection || this.trigger(SELECT, { event: e })) {
|
|
511
493
|
e.preventDefault();
|
|
512
494
|
}
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
UserEvents.prototype._start = function _start (e) {
|
|
516
|
-
var this$1 = this;
|
|
495
|
+
}
|
|
517
496
|
|
|
497
|
+
_start(e) {
|
|
518
498
|
if (e.which && e.which > 1 || this._maxTouchesReached()) {
|
|
519
499
|
return;
|
|
520
500
|
}
|
|
@@ -526,46 +506,44 @@ var UserEvents = (function (Observable) {
|
|
|
526
506
|
e.stopPropagation();
|
|
527
507
|
}
|
|
528
508
|
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
for (
|
|
532
|
-
if (this
|
|
509
|
+
let target;
|
|
510
|
+
const eventTouches = getTouches(e);
|
|
511
|
+
for (let idx = 0; idx < eventTouches.length; idx++) {
|
|
512
|
+
if (this._maxTouchesReached()) {
|
|
533
513
|
break;
|
|
534
514
|
}
|
|
535
515
|
|
|
536
|
-
|
|
537
|
-
if (this
|
|
516
|
+
const eventTouch = eventTouches[idx];
|
|
517
|
+
if (this.filter) {
|
|
538
518
|
target = eventTouch.currentTarget;
|
|
539
519
|
} else {
|
|
540
|
-
target = this
|
|
520
|
+
target = this.element;
|
|
541
521
|
}
|
|
542
522
|
|
|
543
523
|
if (target && target.length === 0) {
|
|
544
524
|
continue;
|
|
545
525
|
}
|
|
546
526
|
|
|
547
|
-
|
|
548
|
-
this
|
|
527
|
+
const touch = new Touch(this, target, eventTouch);
|
|
528
|
+
this.touches.push(touch);
|
|
549
529
|
touch.press();
|
|
550
530
|
|
|
551
|
-
if (this
|
|
552
|
-
this
|
|
531
|
+
if (this._isMultiTouch()) {
|
|
532
|
+
this.notify('gesturestart', {});
|
|
553
533
|
}
|
|
554
534
|
}
|
|
555
|
-
}
|
|
535
|
+
}
|
|
556
536
|
|
|
557
|
-
|
|
537
|
+
_move(e) {
|
|
558
538
|
this._eachTouch('move', e);
|
|
559
|
-
}
|
|
539
|
+
}
|
|
560
540
|
|
|
561
|
-
|
|
541
|
+
_end(e) {
|
|
562
542
|
this._eachTouch('end', e);
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
UserEvents.prototype._eachTouch = function _eachTouch (methodName, e) {
|
|
566
|
-
var this$1 = this;
|
|
543
|
+
}
|
|
567
544
|
|
|
568
|
-
|
|
545
|
+
_eachTouch(methodName, e) {
|
|
546
|
+
let that = this,
|
|
569
547
|
dict = {},
|
|
570
548
|
touches = getTouches(e),
|
|
571
549
|
activeTouches = that.touches,
|
|
@@ -584,17 +562,17 @@ var UserEvents = (function (Observable) {
|
|
|
584
562
|
matchingTouch = dict[touchInfo.id];
|
|
585
563
|
|
|
586
564
|
if (matchingTouch) {
|
|
587
|
-
|
|
565
|
+
const shouldCapture = methodName === 'move' && touchInfo.type === 'pointer' && !this.surface.hasPointerCapture(touchInfo.id);
|
|
588
566
|
if (shouldCapture) {
|
|
589
|
-
this
|
|
567
|
+
this.surface.setPointerCapture(touchInfo.id);
|
|
590
568
|
}
|
|
591
569
|
|
|
592
570
|
matchingTouch[methodName](touchInfo);
|
|
593
571
|
}
|
|
594
572
|
}
|
|
595
|
-
}
|
|
573
|
+
}
|
|
596
574
|
|
|
597
|
-
|
|
575
|
+
_apiCall(type, x, y, target) {
|
|
598
576
|
this[type]({
|
|
599
577
|
api: true,
|
|
600
578
|
pageX: x,
|
|
@@ -605,17 +583,13 @@ var UserEvents = (function (Observable) {
|
|
|
605
583
|
stopPropagation: noop,
|
|
606
584
|
preventDefault: noop
|
|
607
585
|
});
|
|
608
|
-
}
|
|
586
|
+
}
|
|
609
587
|
|
|
610
|
-
|
|
588
|
+
static defaultThreshold(value) {
|
|
611
589
|
DEFAULT_THRESHOLD = value;
|
|
612
|
-
}
|
|
590
|
+
}
|
|
613
591
|
|
|
614
|
-
|
|
592
|
+
static minHold(value) {
|
|
615
593
|
DEFAULT_MIN_HOLD = value;
|
|
616
|
-
}
|
|
617
|
-
|
|
618
|
-
return UserEvents;
|
|
619
|
-
}(Observable));
|
|
620
|
-
|
|
621
|
-
export default UserEvents;
|
|
594
|
+
}
|
|
595
|
+
}
|
|
@@ -9,9 +9,9 @@ import { AXIS_LABEL_CLICK, CENTER, TOP, BOTTOM, LEFT, DEFAULT_PRECISION, X, Y }
|
|
|
9
9
|
|
|
10
10
|
import { eventElement, round, setDefaultOptions } from '../common';
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
class AxisLabel extends TextBox {
|
|
13
|
+
constructor(value, text, index, dataItem, options) {
|
|
14
|
+
super(text, options);
|
|
15
15
|
|
|
16
16
|
this.text = text;
|
|
17
17
|
this.value = value;
|
|
@@ -20,12 +20,8 @@ var AxisLabel = (function (TextBox) {
|
|
|
20
20
|
this.reflow(new Box());
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
AxisLabel.prototype.constructor = AxisLabel;
|
|
26
|
-
|
|
27
|
-
AxisLabel.prototype.visualContext = function visualContext (targetBox) {
|
|
28
|
-
var context = TextBox.prototype.visualContext.call(this, targetBox);
|
|
23
|
+
visualContext(targetBox) {
|
|
24
|
+
const context = super.visualContext(targetBox);
|
|
29
25
|
|
|
30
26
|
context.value = this.value;
|
|
31
27
|
context.dataItem = this.dataItem;
|
|
@@ -33,9 +29,9 @@ var AxisLabel = (function (TextBox) {
|
|
|
33
29
|
context.culture = this.options.culture;
|
|
34
30
|
|
|
35
31
|
return context;
|
|
36
|
-
}
|
|
32
|
+
}
|
|
37
33
|
|
|
38
|
-
|
|
34
|
+
click(widget, e) {
|
|
39
35
|
|
|
40
36
|
widget.trigger(AXIS_LABEL_CLICK, {
|
|
41
37
|
element: eventElement(e),
|
|
@@ -45,54 +41,55 @@ var AxisLabel = (function (TextBox) {
|
|
|
45
41
|
dataItem: this.dataItem,
|
|
46
42
|
axis: this.parent.options
|
|
47
43
|
});
|
|
48
|
-
}
|
|
44
|
+
}
|
|
49
45
|
|
|
50
|
-
|
|
46
|
+
rotate() {
|
|
51
47
|
if (this.options.alignRotation !== CENTER) {
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
const box = this.normalBox.toRect();
|
|
49
|
+
const transform = this.rotationTransform();
|
|
54
50
|
|
|
55
51
|
this.box = rectToBox(box.bbox(transform.matrix()));
|
|
56
52
|
} else {
|
|
57
|
-
|
|
53
|
+
super.rotate();
|
|
58
54
|
}
|
|
59
55
|
|
|
60
56
|
return this.box;
|
|
61
|
-
}
|
|
57
|
+
}
|
|
62
58
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
59
|
+
rotationTransform() {
|
|
60
|
+
const options = this.options;
|
|
61
|
+
const rotation = options.rotation;
|
|
66
62
|
if (!rotation) {
|
|
67
63
|
return null;
|
|
68
64
|
}
|
|
69
65
|
|
|
70
66
|
if (options.alignRotation === CENTER) {
|
|
71
|
-
return
|
|
67
|
+
return super.rotationTransform();
|
|
72
68
|
}
|
|
73
69
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
70
|
+
const rotationMatrix = geom.transform().rotate(rotation).matrix();
|
|
71
|
+
const box = this.normalBox.toRect();
|
|
72
|
+
const rect = this.targetBox.toRect();
|
|
77
73
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
74
|
+
const rotationOrigin = options.rotationOrigin || TOP;
|
|
75
|
+
const alignAxis = rotationOrigin === TOP || rotationOrigin === BOTTOM ? X : Y;
|
|
76
|
+
const distanceAxis = rotationOrigin === TOP || rotationOrigin === BOTTOM ? Y : X;
|
|
77
|
+
const axisAnchor = rotationOrigin === TOP || rotationOrigin === LEFT ? rect.origin : rect.bottomRight();
|
|
82
78
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
79
|
+
const topLeft = box.topLeft().transformCopy(rotationMatrix);
|
|
80
|
+
const topRight = box.topRight().transformCopy(rotationMatrix);
|
|
81
|
+
const bottomRight = box.bottomRight().transformCopy(rotationMatrix);
|
|
82
|
+
const bottomLeft = box.bottomLeft().transformCopy(rotationMatrix);
|
|
83
|
+
const rotatedBox = geom.Rect.fromPoints(topLeft, topRight, bottomRight, bottomLeft);
|
|
88
84
|
|
|
89
|
-
|
|
90
|
-
|
|
85
|
+
const translate = {
|
|
86
|
+
[distanceAxis]: rect.origin[distanceAxis] - rotatedBox.origin[distanceAxis]
|
|
87
|
+
};
|
|
91
88
|
|
|
92
|
-
|
|
93
|
-
|
|
89
|
+
const distanceLeft = Math.abs(topLeft[distanceAxis] + translate[distanceAxis] - axisAnchor[distanceAxis]);
|
|
90
|
+
const distanceRight = Math.abs(topRight[distanceAxis] + translate[distanceAxis] - axisAnchor[distanceAxis]);
|
|
94
91
|
|
|
95
|
-
|
|
92
|
+
let alignStart, alignEnd;
|
|
96
93
|
|
|
97
94
|
if (round(distanceLeft, DEFAULT_PRECISION) === round(distanceRight, DEFAULT_PRECISION)) {
|
|
98
95
|
alignStart = topLeft;
|
|
@@ -105,16 +102,14 @@ var AxisLabel = (function (TextBox) {
|
|
|
105
102
|
alignEnd = bottomLeft;
|
|
106
103
|
}
|
|
107
104
|
|
|
108
|
-
|
|
105
|
+
const alignCenter = alignStart[alignAxis] + (alignEnd[alignAxis] - alignStart[alignAxis]) / 2;
|
|
109
106
|
translate[alignAxis] = rect.center()[alignAxis] - alignCenter;
|
|
110
107
|
|
|
111
108
|
return geom.transform()
|
|
112
109
|
.translate(translate.x, translate.y)
|
|
113
110
|
.rotate(rotation);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
return AxisLabel;
|
|
117
|
-
}(TextBox));
|
|
111
|
+
}
|
|
112
|
+
}
|
|
118
113
|
|
|
119
114
|
setDefaultOptions(AxisLabel, {
|
|
120
115
|
_autoReflow: false
|