@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
|
@@ -6,15 +6,12 @@ import { DEFAULT_LINE_WIDTH, INSIDE } from '../constants';
|
|
|
6
6
|
import { autoMajorUnit } from '../../core';
|
|
7
7
|
import { buildLabelElement, getRange } from '../utils';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var Point = geo.Point;
|
|
9
|
+
const { Path, Group } = drawing;
|
|
10
|
+
const Point = geo.Point;
|
|
12
11
|
|
|
13
12
|
function renderAxisTick(tickRenderOptions, tickOptions) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var tickY = tickRenderOptions.tickY;
|
|
17
|
-
var start, end;
|
|
13
|
+
const { position, tickX, tickY } = tickRenderOptions;
|
|
14
|
+
let start, end;
|
|
18
15
|
|
|
19
16
|
if (tickRenderOptions.vertical) {
|
|
20
17
|
start = new Point(tickX, position);
|
|
@@ -24,7 +21,7 @@ function renderAxisTick(tickRenderOptions, tickOptions) {
|
|
|
24
21
|
end = new Point(position, tickY + tickOptions.size);
|
|
25
22
|
}
|
|
26
23
|
|
|
27
|
-
|
|
24
|
+
const tickPath = new Path({
|
|
28
25
|
stroke: {
|
|
29
26
|
color: tickOptions.color,
|
|
30
27
|
width: tickOptions.width
|
|
@@ -35,12 +32,11 @@ function renderAxisTick(tickRenderOptions, tickOptions) {
|
|
|
35
32
|
}
|
|
36
33
|
|
|
37
34
|
function renderTicks(tickGroup, tickPositions, tickRenderOptions, tickOptions) {
|
|
38
|
-
|
|
35
|
+
const count = tickPositions.length;
|
|
39
36
|
|
|
40
37
|
if (tickOptions.visible) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
for (var i = tickOptions.skip; i < count; i += tickOptions.step) {
|
|
38
|
+
const { mirror, lineBox } = tickRenderOptions;
|
|
39
|
+
for (let i = tickOptions.skip; i < count; i += tickOptions.step) {
|
|
44
40
|
if (i % tickOptions.skipUnit === 0) {
|
|
45
41
|
continue;
|
|
46
42
|
}
|
|
@@ -54,65 +50,56 @@ function renderTicks(tickGroup, tickPositions, tickRenderOptions, tickOptions) {
|
|
|
54
50
|
}
|
|
55
51
|
}
|
|
56
52
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
53
|
+
class LinearScale extends NumericAxis {
|
|
54
|
+
constructor(options, service) {
|
|
55
|
+
let scaleOptions = options || {};
|
|
60
56
|
if (!defined(scaleOptions.reverse) && scaleOptions.vertical === false && (service || {}).rtl) {
|
|
61
57
|
scaleOptions = Object.assign({}, scaleOptions, {
|
|
62
58
|
reverse: true
|
|
63
59
|
});
|
|
64
60
|
}
|
|
65
61
|
|
|
66
|
-
|
|
62
|
+
super(0, 1, scaleOptions, service);
|
|
67
63
|
|
|
68
64
|
this.options.minorUnit = this.options.minorUnit || this.options.majorUnit / 10;
|
|
69
65
|
}
|
|
70
66
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
LinearScale.prototype.constructor = LinearScale;
|
|
74
|
-
|
|
75
|
-
LinearScale.prototype.initUserOptions = function initUserOptions (options) {
|
|
76
|
-
var scaleOptions = deepExtend({}, this.options, options);
|
|
67
|
+
initUserOptions(options) {
|
|
68
|
+
let scaleOptions = deepExtend({}, this.options, options);
|
|
77
69
|
scaleOptions = deepExtend({}, scaleOptions , { labels: { mirror: scaleOptions.mirror } });
|
|
78
70
|
scaleOptions.majorUnit = scaleOptions.majorUnit || autoMajorUnit(scaleOptions.min, scaleOptions.max);
|
|
79
71
|
|
|
80
72
|
return scaleOptions;
|
|
81
|
-
}
|
|
73
|
+
}
|
|
82
74
|
|
|
83
|
-
|
|
84
|
-
}
|
|
75
|
+
initFields() {
|
|
76
|
+
}
|
|
85
77
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
78
|
+
render() {
|
|
79
|
+
const elements = this.elements = new Group();
|
|
80
|
+
const labels = this.renderLabels();
|
|
81
|
+
const scaleLine = this.renderLine();
|
|
82
|
+
const scaleTicks = this.renderTicks();
|
|
83
|
+
const ranges = this.renderRanges();
|
|
92
84
|
|
|
93
85
|
elements.append(scaleLine, labels, scaleTicks, ranges);
|
|
94
86
|
|
|
95
87
|
return elements;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
for (var i = 0; i < count; i++) {
|
|
112
|
-
var range = getRange(ranges[i], min, max);
|
|
113
|
-
var slot = this$1.getSlot(range.from, range.to);
|
|
114
|
-
var slotX = vertical ? this$1.lineBox() : slot;
|
|
115
|
-
var slotY = vertical ? slot : this$1.lineBox();
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
renderRanges() {
|
|
91
|
+
const options = this.options;
|
|
92
|
+
const { min, max, vertical, labels: { mirror } } = options;
|
|
93
|
+
const ranges = options.ranges || [];
|
|
94
|
+
const elements = new Group();
|
|
95
|
+
const count = ranges.length;
|
|
96
|
+
const rangeSize = options.rangeSize || options.minorTicks.size / 2;
|
|
97
|
+
|
|
98
|
+
for (let i = 0; i < count; i++) {
|
|
99
|
+
const range = getRange(ranges[i], min, max);
|
|
100
|
+
const slot = this.getSlot(range.from, range.to);
|
|
101
|
+
const slotX = vertical ? this.lineBox() : slot;
|
|
102
|
+
const slotY = vertical ? slot : this.lineBox();
|
|
116
103
|
if (vertical) {
|
|
117
104
|
slotX.x1 -= rangeSize * (mirror ? -1 : 1);
|
|
118
105
|
} else {
|
|
@@ -126,28 +113,26 @@ var LinearScale = (function (NumericAxis) {
|
|
|
126
113
|
}
|
|
127
114
|
|
|
128
115
|
return elements;
|
|
129
|
-
}
|
|
116
|
+
}
|
|
130
117
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
var options = ref.options;
|
|
135
|
-
var elements = new Group();
|
|
118
|
+
renderLabels() {
|
|
119
|
+
const { labels, options } = this;
|
|
120
|
+
const elements = new Group();
|
|
136
121
|
|
|
137
|
-
for (
|
|
122
|
+
for (let i = 0; i < labels.length; i++) {
|
|
138
123
|
elements.append(buildLabelElement(labels[i], options.labels));
|
|
139
124
|
}
|
|
140
125
|
|
|
141
126
|
return elements;
|
|
142
|
-
}
|
|
127
|
+
}
|
|
143
128
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
129
|
+
renderLine() {
|
|
130
|
+
const line = this.options.line;
|
|
131
|
+
const lineBox = this.lineBox();
|
|
132
|
+
const elements = new Group();
|
|
148
133
|
|
|
149
134
|
if (line.width > 0 && line.visible) {
|
|
150
|
-
|
|
135
|
+
const linePath = new Path({
|
|
151
136
|
stroke: {
|
|
152
137
|
color: line.color,
|
|
153
138
|
dashType: line.dashType,
|
|
@@ -160,13 +145,13 @@ var LinearScale = (function (NumericAxis) {
|
|
|
160
145
|
}
|
|
161
146
|
|
|
162
147
|
return elements;
|
|
163
|
-
}
|
|
148
|
+
}
|
|
164
149
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
150
|
+
renderTicks() {
|
|
151
|
+
const ticks = new Group();
|
|
152
|
+
const options = this.options;
|
|
153
|
+
const majorUnit = options.majorTicks.visible ? options.majorUnit : 0;
|
|
154
|
+
const tickRenderOptions = {
|
|
170
155
|
vertical: options.vertical,
|
|
171
156
|
mirror: options.labels.mirror,
|
|
172
157
|
lineBox: this.lineBox()
|
|
@@ -178,10 +163,8 @@ var LinearScale = (function (NumericAxis) {
|
|
|
178
163
|
}, options.minorTicks));
|
|
179
164
|
|
|
180
165
|
return ticks;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
return LinearScale;
|
|
184
|
-
}(NumericAxis));
|
|
166
|
+
}
|
|
167
|
+
}
|
|
185
168
|
|
|
186
169
|
setDefaultOptions(LinearScale, {
|
|
187
170
|
min: 0,
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { Class, setDefaultOptions, defined, deepExtend, limitValue } from '../common';
|
|
2
2
|
import { BLACK } from '../common/constants';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
class Pointer extends Class {
|
|
5
|
+
constructor(scale, userOptions) {
|
|
6
|
+
super();
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var max = ref.max;
|
|
11
|
-
var options = this.options = deepExtend({}, this.options, userOptions);
|
|
8
|
+
const { min, max } = scale.options;
|
|
9
|
+
const options = this.options = deepExtend({}, this.options, userOptions);
|
|
12
10
|
|
|
13
11
|
options.fill = options.color;
|
|
14
12
|
|
|
@@ -21,21 +19,15 @@ var Pointer = (function (Class) {
|
|
|
21
19
|
}
|
|
22
20
|
}
|
|
23
21
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
Pointer.prototype.value = function value (newValue) {
|
|
29
|
-
var options = this.options;
|
|
30
|
-
var value = options.value;
|
|
22
|
+
value(newValue) {
|
|
23
|
+
const options = this.options;
|
|
24
|
+
const value = options.value;
|
|
31
25
|
|
|
32
26
|
if (arguments.length === 0) {
|
|
33
27
|
return value;
|
|
34
28
|
}
|
|
35
29
|
|
|
36
|
-
|
|
37
|
-
var min = ref.min;
|
|
38
|
-
var max = ref.max;
|
|
30
|
+
const { min, max } = this.scale.options;
|
|
39
31
|
|
|
40
32
|
options._oldValue = defined(options._oldValue) ? options.value : min;
|
|
41
33
|
options.value = limitValue(newValue, min, max);
|
|
@@ -43,10 +35,8 @@ var Pointer = (function (Class) {
|
|
|
43
35
|
if (this.elements) {
|
|
44
36
|
this.repaint();
|
|
45
37
|
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return Pointer;
|
|
49
|
-
}(Class));
|
|
38
|
+
}
|
|
39
|
+
}
|
|
50
40
|
|
|
51
41
|
setDefaultOptions(Pointer, {
|
|
52
42
|
color: BLACK
|
|
@@ -5,68 +5,55 @@ import Gauge from '../gauge';
|
|
|
5
5
|
import RadialScale from './radial-scale';
|
|
6
6
|
import RadialPointer from './radial-pointer';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
const Group = drawing.Group;
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
function RadialGauge () {
|
|
12
|
-
Gauge.apply(this, arguments);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
if ( Gauge ) RadialGauge.__proto__ = Gauge;
|
|
16
|
-
RadialGauge.prototype = Object.create( Gauge && Gauge.prototype );
|
|
17
|
-
RadialGauge.prototype.constructor = RadialGauge;
|
|
18
|
-
|
|
19
|
-
RadialGauge.prototype.reflow = function reflow (bbox) {
|
|
20
|
-
var this$1 = this;
|
|
10
|
+
class RadialGauge extends Gauge {
|
|
21
11
|
|
|
22
|
-
|
|
12
|
+
reflow(bbox) {
|
|
13
|
+
const pointers = this.pointers;
|
|
23
14
|
this.scale.reflow(bbox);
|
|
24
15
|
this._initialPlotArea = this.scale.bbox;
|
|
25
16
|
|
|
26
|
-
for (
|
|
27
|
-
pointers[i].reflow(this
|
|
28
|
-
this
|
|
17
|
+
for (let i = 0; i < pointers.length; i++) {
|
|
18
|
+
pointers[i].reflow(this.scale.arc);
|
|
19
|
+
this._initialPlotArea = geo.Rect.union(this._initialPlotArea, pointers[i].bbox);
|
|
29
20
|
}
|
|
30
21
|
|
|
31
22
|
this.fitScale(bbox);
|
|
32
23
|
this.alignScale(bbox);
|
|
33
24
|
this._buildVisual(this.gaugeArea, pointers, this.scale);
|
|
34
25
|
this._draw();
|
|
35
|
-
}
|
|
26
|
+
}
|
|
36
27
|
|
|
37
|
-
|
|
38
|
-
|
|
28
|
+
_buildVisual(gaugeArea, pointers, scale) {
|
|
29
|
+
const visuals = this._visuals = new Group();
|
|
39
30
|
|
|
40
31
|
visuals.append(gaugeArea);
|
|
41
32
|
visuals.append(scale.ticks);
|
|
42
33
|
visuals.append(scale.ranges);
|
|
43
34
|
this._buildPointers(pointers);
|
|
44
35
|
visuals.append(scale.labelElements);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
RadialGauge.prototype._buildPointers = function _buildPointers (pointers) {
|
|
48
|
-
var this$1 = this;
|
|
36
|
+
}
|
|
49
37
|
|
|
50
|
-
|
|
51
|
-
|
|
38
|
+
_buildPointers(pointers) {
|
|
39
|
+
for (let i = 0; i < pointers.length; i++) {
|
|
40
|
+
const current = pointers[i];
|
|
52
41
|
current.render();
|
|
53
|
-
this
|
|
42
|
+
this._visuals.append(current.elements);
|
|
54
43
|
|
|
55
44
|
current.value(current.options.value);
|
|
56
45
|
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
RadialGauge.prototype.fitScale = function fitScale (bbox) {
|
|
60
|
-
var this$1 = this;
|
|
46
|
+
}
|
|
61
47
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
48
|
+
fitScale(bbox) {
|
|
49
|
+
const arc = this.scale.arc;
|
|
50
|
+
const plotAreaBox = this._initialPlotArea;
|
|
51
|
+
const step = Math.abs(this.getDiff(plotAreaBox, bbox));
|
|
52
|
+
let min = round(step, COORD_PRECISION);
|
|
53
|
+
let max = round(-step, COORD_PRECISION);
|
|
54
|
+
let minDiff, midDiff, maxDiff, mid, oldDiff;
|
|
55
|
+
let staleFlag = 0;
|
|
56
|
+
let i = 0;
|
|
70
57
|
|
|
71
58
|
while (i++ < 100) {
|
|
72
59
|
staleFlag = (oldDiff === maxDiff) ? (staleFlag + 1) : 0;
|
|
@@ -76,14 +63,14 @@ var RadialGauge = (function (Gauge) {
|
|
|
76
63
|
}
|
|
77
64
|
|
|
78
65
|
if (min !== mid) {
|
|
79
|
-
minDiff = this
|
|
66
|
+
minDiff = this.getPlotBox(min, bbox, arc);
|
|
80
67
|
if (0 <= minDiff && minDiff <= 2) {
|
|
81
68
|
break;
|
|
82
69
|
}
|
|
83
70
|
}
|
|
84
71
|
|
|
85
72
|
if (max !== mid) {
|
|
86
|
-
maxDiff = this
|
|
73
|
+
maxDiff = this.getPlotBox(max, bbox, arc);
|
|
87
74
|
if (0 <= maxDiff && maxDiff <= 2) {
|
|
88
75
|
break;
|
|
89
76
|
}
|
|
@@ -97,7 +84,7 @@ var RadialGauge = (function (Gauge) {
|
|
|
97
84
|
mid = round(((min + max) / 2) || 1, COORD_PRECISION);
|
|
98
85
|
}
|
|
99
86
|
|
|
100
|
-
midDiff = this
|
|
87
|
+
midDiff = this.getPlotBox(mid, bbox, arc);
|
|
101
88
|
if (0 <= midDiff && midDiff <= 2) {
|
|
102
89
|
break;
|
|
103
90
|
}
|
|
@@ -112,15 +99,13 @@ var RadialGauge = (function (Gauge) {
|
|
|
112
99
|
minDiff = midDiff;
|
|
113
100
|
}
|
|
114
101
|
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
RadialGauge.prototype.getPlotBox = function getPlotBox (step, bbox, arc) {
|
|
118
|
-
var this$1 = this;
|
|
102
|
+
}
|
|
119
103
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
104
|
+
getPlotBox(step, bbox, arc) {
|
|
105
|
+
const scale = this.scale;
|
|
106
|
+
const pointers = this.pointers;
|
|
107
|
+
const radius = arc.getRadiusX();
|
|
108
|
+
const scaleArc = arc.clone();
|
|
124
109
|
|
|
125
110
|
scaleArc.setRadiusX(radius + step).setRadiusY(radius + step);
|
|
126
111
|
|
|
@@ -128,63 +113,55 @@ var RadialGauge = (function (Gauge) {
|
|
|
128
113
|
scale.reflow(bbox);
|
|
129
114
|
this.plotBbox = scale.bbox;
|
|
130
115
|
|
|
131
|
-
for (
|
|
116
|
+
for (let i = 0; i < pointers.length; i++) {
|
|
132
117
|
pointers[i].reflow(scaleArc);
|
|
133
|
-
this
|
|
118
|
+
this.plotBbox = geo.Rect.union(this.plotBbox, pointers[i].bbox);
|
|
134
119
|
}
|
|
135
120
|
|
|
136
121
|
return this.getDiff(this.plotBbox, bbox);
|
|
137
|
-
}
|
|
122
|
+
}
|
|
138
123
|
|
|
139
|
-
|
|
124
|
+
getDiff(plotBox, box) {
|
|
140
125
|
return Math.min(box.width() - plotBox.width(), box.height() - plotBox.height());
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
RadialGauge.prototype.alignScale = function alignScale (bbox) {
|
|
144
|
-
var this$1 = this;
|
|
126
|
+
}
|
|
145
127
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
var pointers = ref.pointers;
|
|
128
|
+
alignScale(bbox) {
|
|
129
|
+
const plotBoxCenter = this.plotBbox.center();
|
|
130
|
+
const boxCenter = bbox.center();
|
|
131
|
+
const paddingX = plotBoxCenter.x - boxCenter.x;
|
|
132
|
+
const paddingY = plotBoxCenter.y - boxCenter.y;
|
|
133
|
+
const { scale, pointers } = this;
|
|
153
134
|
|
|
154
135
|
scale.arc.center.x -= paddingX;
|
|
155
136
|
scale.arc.center.y -= paddingY;
|
|
156
137
|
|
|
157
138
|
scale.reflow(bbox);
|
|
158
139
|
|
|
159
|
-
for (
|
|
140
|
+
for (let i = 0; i < pointers.length; i++) {
|
|
160
141
|
pointers[i].reflow(scale.arc);
|
|
161
|
-
this
|
|
142
|
+
this.plotBbox = geo.Rect.union(scale.bbox, pointers[i].bbox);
|
|
162
143
|
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
RadialGauge.prototype._createModel = function _createModel () {
|
|
166
|
-
var this$1 = this;
|
|
144
|
+
}
|
|
167
145
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
146
|
+
_createModel() {
|
|
147
|
+
const options = this.options;
|
|
148
|
+
const pointers = options.pointer;
|
|
149
|
+
const scale = this.scale = new RadialScale(options.scale, this.contextService);
|
|
171
150
|
|
|
172
151
|
this.pointers = [];
|
|
173
152
|
|
|
174
|
-
|
|
175
|
-
for (
|
|
176
|
-
|
|
153
|
+
const pointersArr = isArray(pointers) ? pointers : [ pointers ];
|
|
154
|
+
for (let i = 0; i < pointersArr.length; i++) {
|
|
155
|
+
const current = new RadialPointer(scale, deepExtend({}, pointersArr[i], {
|
|
177
156
|
animation: {
|
|
178
157
|
transitions: options.transitions
|
|
179
158
|
}
|
|
180
159
|
}));
|
|
181
160
|
|
|
182
|
-
this
|
|
161
|
+
this.pointers.push(current);
|
|
183
162
|
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
return RadialGauge;
|
|
187
|
-
}(Gauge));
|
|
163
|
+
}
|
|
164
|
+
}
|
|
188
165
|
|
|
189
166
|
setDefaultOptions(RadialGauge, {
|
|
190
167
|
transitions: true,
|
|
@@ -2,28 +2,22 @@ import { geometry, drawing } from '@progress/kendo-drawing';
|
|
|
2
2
|
import { interpolateValue, setDefaultOptions } from '../../common';
|
|
3
3
|
import { ANGULAR_SPEED, LINEAR, RADIAL_POINTER } from '../constants';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
class RadialPointerAnimation extends drawing.Animation {
|
|
6
|
+
constructor(element, options) {
|
|
7
|
+
super(element, options);
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
const animationOptions = this.options;
|
|
10
10
|
|
|
11
11
|
animationOptions.duration = Math.max((Math.abs(animationOptions.newAngle - animationOptions.oldAngle) / animationOptions.duration) * 1000, 1);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
RadialPointerAnimation.prototype.step = function step (pos) {
|
|
19
|
-
var options = this.options;
|
|
20
|
-
var angle = interpolateValue(options.oldAngle, options.newAngle, pos);
|
|
14
|
+
step(pos) {
|
|
15
|
+
const options = this.options;
|
|
16
|
+
const angle = interpolateValue(options.oldAngle, options.newAngle, pos);
|
|
21
17
|
|
|
22
18
|
this.element.transform(geometry.transform().rotate(angle, options.center));
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return RadialPointerAnimation;
|
|
26
|
-
}(drawing.Animation));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
27
21
|
|
|
28
22
|
setDefaultOptions(RadialPointerAnimation, {
|
|
29
23
|
easing: LINEAR,
|
|
@@ -5,30 +5,19 @@ import { ANGULAR_SPEED, DEGREE, DEFAULT_LINE_WIDTH, RADIAL_POINTER } from '../co
|
|
|
5
5
|
import Pointer from '../pointer';
|
|
6
6
|
import RadialPointerAnimation from './radial-pointer-animation';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var Group = drawing.Group;
|
|
11
|
-
var Path = drawing.Path;
|
|
12
|
-
|
|
13
|
-
var RadialPointer = (function (Pointer) {
|
|
14
|
-
function RadialPointer () {
|
|
15
|
-
Pointer.apply(this, arguments);
|
|
16
|
-
}
|
|
8
|
+
const CAP_SIZE = 0.05;
|
|
9
|
+
const { Circle, Group, Path } = drawing;
|
|
17
10
|
|
|
18
|
-
|
|
19
|
-
RadialPointer.prototype = Object.create( Pointer && Pointer.prototype );
|
|
20
|
-
RadialPointer.prototype.constructor = RadialPointer;
|
|
11
|
+
class RadialPointer extends Pointer {
|
|
21
12
|
|
|
22
|
-
|
|
13
|
+
setAngle(angle) {
|
|
23
14
|
this.elements.transform(geo.transform().rotate(angle, this.center));
|
|
24
|
-
}
|
|
15
|
+
}
|
|
25
16
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
var oldAngle = scale.slotAngle(options._oldValue);
|
|
31
|
-
var newAngle = scale.slotAngle(options.value);
|
|
17
|
+
repaint() {
|
|
18
|
+
const { scale, options } = this;
|
|
19
|
+
const oldAngle = scale.slotAngle(options._oldValue);
|
|
20
|
+
const newAngle = scale.slotAngle(options.value);
|
|
32
21
|
|
|
33
22
|
if (options.animation.transitions === false) {
|
|
34
23
|
this.setAngle(newAngle);
|
|
@@ -38,13 +27,11 @@ var RadialPointer = (function (Pointer) {
|
|
|
38
27
|
newAngle: newAngle
|
|
39
28
|
})).play();
|
|
40
29
|
}
|
|
41
|
-
}
|
|
30
|
+
}
|
|
42
31
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
var options = ref.options;
|
|
47
|
-
var elements = new Group();
|
|
32
|
+
render() {
|
|
33
|
+
const { scale, options } = this;
|
|
34
|
+
const elements = new Group();
|
|
48
35
|
|
|
49
36
|
if (options.animation !== false) {
|
|
50
37
|
deepExtend(options.animation, {
|
|
@@ -60,24 +47,24 @@ var RadialPointer = (function (Pointer) {
|
|
|
60
47
|
this.setAngle(DEGREE);
|
|
61
48
|
|
|
62
49
|
return elements;
|
|
63
|
-
}
|
|
50
|
+
}
|
|
64
51
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
52
|
+
reflow(arc) {
|
|
53
|
+
const center = this.center = arc.center;
|
|
54
|
+
const length = limitValue(this.options.length || 1, 0.1, 1.5);
|
|
55
|
+
const radius = this.radius = arc.getRadiusX() * length;
|
|
56
|
+
const capSize = this.capSize = Math.round(radius * this.options.cap.size);
|
|
70
57
|
|
|
71
58
|
this.bbox = geo.Rect.fromPoints(new geo.Point(center.x - capSize, center.y - capSize),
|
|
72
59
|
new geo.Point(center.x + capSize, center.y + capSize));
|
|
73
|
-
}
|
|
60
|
+
}
|
|
74
61
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
62
|
+
_renderNeedle() {
|
|
63
|
+
const minorTickSize = this.scale.options.minorTicks.size;
|
|
64
|
+
const center = this.center;
|
|
65
|
+
const needleColor = this.options.color;
|
|
79
66
|
|
|
80
|
-
|
|
67
|
+
const needlePath = new Path({
|
|
81
68
|
fill: { color: needleColor },
|
|
82
69
|
stroke: { color: needleColor, width: DEFAULT_LINE_WIDTH }
|
|
83
70
|
});
|
|
@@ -88,23 +75,21 @@ var RadialPointer = (function (Pointer) {
|
|
|
88
75
|
.close();
|
|
89
76
|
|
|
90
77
|
return needlePath;
|
|
91
|
-
}
|
|
78
|
+
}
|
|
92
79
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
80
|
+
_renderCap() {
|
|
81
|
+
const options = this.options;
|
|
82
|
+
const capColor = options.cap.color || options.color;
|
|
83
|
+
const circle = new geo.Circle(this.center, this.capSize);
|
|
97
84
|
|
|
98
|
-
|
|
85
|
+
const cap = new Circle(circle, {
|
|
99
86
|
fill: { color: capColor },
|
|
100
87
|
stroke: { color: capColor }
|
|
101
88
|
});
|
|
102
89
|
|
|
103
90
|
return cap;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
return RadialPointer;
|
|
107
|
-
}(Pointer));
|
|
91
|
+
}
|
|
92
|
+
}
|
|
108
93
|
|
|
109
94
|
setDefaultOptions(RadialPointer, {
|
|
110
95
|
cap: {
|