@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
|
@@ -10,11 +10,11 @@ import { bindSegments, evalOptions } from '../utils';
|
|
|
10
10
|
import { CIRCLE, RIGHT, CENTER } from '../../common/constants';
|
|
11
11
|
import { deepExtend, defined, find, isFunction, last, round, setDefaultOptions, valueOrDefault } from '../../common';
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
const PIE_SECTOR_ANIM_DELAY = 70;
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
class PieChart extends ChartElement {
|
|
16
|
+
constructor(plotArea, options) {
|
|
17
|
+
super(options);
|
|
18
18
|
|
|
19
19
|
this.plotArea = plotArea;
|
|
20
20
|
this.chartService = plotArea.chartService;
|
|
@@ -23,37 +23,26 @@ var PieChart = (function (ChartElement) {
|
|
|
23
23
|
this.render();
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
PieChart.prototype = Object.create( ChartElement && ChartElement.prototype );
|
|
28
|
-
PieChart.prototype.constructor = PieChart;
|
|
29
|
-
|
|
30
|
-
PieChart.prototype.render = function render () {
|
|
26
|
+
render() {
|
|
31
27
|
this.traverseDataPoints(this.addValue.bind(this));
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
var data = currentSeries.data;
|
|
47
|
-
var ref$1 = bindSegments(currentSeries);
|
|
48
|
-
var total = ref$1.total;
|
|
49
|
-
var points = ref$1.points;
|
|
50
|
-
var count = ref$1.count;
|
|
51
|
-
var anglePerValue = 360 / total;
|
|
52
|
-
var constantAngle = (void 0);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
traverseDataPoints(callback) {
|
|
31
|
+
const { options, plotArea: { options: { seriesColors = [] } } } = this;
|
|
32
|
+
const colorsCount = seriesColors.length;
|
|
33
|
+
const series = options.series;
|
|
34
|
+
const seriesCount = series.length;
|
|
35
|
+
|
|
36
|
+
for (let seriesIx = 0; seriesIx < seriesCount; seriesIx++) {
|
|
37
|
+
const currentSeries = series[seriesIx];
|
|
38
|
+
const data = currentSeries.data;
|
|
39
|
+
const { total, points, count } = bindSegments(currentSeries);
|
|
40
|
+
const anglePerValue = 360 / total;
|
|
41
|
+
let constantAngle;
|
|
53
42
|
if (!isFinite(anglePerValue)) {
|
|
54
43
|
constantAngle = 360 / count;
|
|
55
44
|
}
|
|
56
|
-
|
|
45
|
+
let currentAngle;
|
|
57
46
|
|
|
58
47
|
if (defined(currentSeries.startAngle)) {
|
|
59
48
|
currentAngle = currentSeries.startAngle;
|
|
@@ -67,24 +56,22 @@ var PieChart = (function (ChartElement) {
|
|
|
67
56
|
}
|
|
68
57
|
}
|
|
69
58
|
|
|
70
|
-
for (
|
|
71
|
-
|
|
59
|
+
for (let i = 0; i < points.length; i++) {
|
|
60
|
+
const pointData = points[i];
|
|
72
61
|
if (!pointData) {
|
|
73
62
|
continue;
|
|
74
63
|
}
|
|
75
64
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
var angle = value !== 0 ? (constantAngle || (value * anglePerValue)) : 0;
|
|
80
|
-
var explode = data.length !== 1 && Boolean(fields.explode);
|
|
65
|
+
const { fields, value, visible } = pointData;
|
|
66
|
+
const angle = value !== 0 ? (constantAngle || (value * anglePerValue)) : 0;
|
|
67
|
+
const explode = data.length !== 1 && Boolean(fields.explode);
|
|
81
68
|
|
|
82
69
|
if (!isFunction(currentSeries.color)) {
|
|
83
70
|
currentSeries.color = fields.color || seriesColors[i % colorsCount];
|
|
84
71
|
}
|
|
85
72
|
|
|
86
73
|
callback(value, new Ring(null, 0, 0, currentAngle, angle), {
|
|
87
|
-
owner: this
|
|
74
|
+
owner: this,
|
|
88
75
|
category: defined(fields.category) ? fields.category : "",
|
|
89
76
|
pattern: defined(fields.pattern) ? fields.pattern : currentSeries.pattern,
|
|
90
77
|
index: i,
|
|
@@ -96,7 +83,7 @@ var PieChart = (function (ChartElement) {
|
|
|
96
83
|
visibleInLegend: fields.visibleInLegend,
|
|
97
84
|
visible: visible,
|
|
98
85
|
zIndex: seriesCount - seriesIx,
|
|
99
|
-
animationDelay: this
|
|
86
|
+
animationDelay: this.animationDelay(i, seriesIx, seriesCount)
|
|
100
87
|
});
|
|
101
88
|
|
|
102
89
|
if (visible !== false) {
|
|
@@ -104,10 +91,10 @@ var PieChart = (function (ChartElement) {
|
|
|
104
91
|
}
|
|
105
92
|
}
|
|
106
93
|
}
|
|
107
|
-
}
|
|
94
|
+
}
|
|
108
95
|
|
|
109
|
-
|
|
110
|
-
|
|
96
|
+
evalSegmentOptions(options, value, fields) {
|
|
97
|
+
const series = fields.series;
|
|
111
98
|
|
|
112
99
|
evalOptions(options, {
|
|
113
100
|
value: value,
|
|
@@ -119,10 +106,10 @@ var PieChart = (function (ChartElement) {
|
|
|
119
106
|
"data", "content", "template", "visual", "toggle",
|
|
120
107
|
"ariaTemplate", "ariaContent"
|
|
121
108
|
] });
|
|
122
|
-
}
|
|
109
|
+
}
|
|
123
110
|
|
|
124
|
-
|
|
125
|
-
|
|
111
|
+
addValue(value, sector, fields) {
|
|
112
|
+
const segmentOptions = deepExtend({}, fields.series, { index: fields.index });
|
|
126
113
|
segmentOptions.pattern = fields.pattern || segmentOptions.pattern;
|
|
127
114
|
this.evalSegmentOptions(segmentOptions, value, fields);
|
|
128
115
|
|
|
@@ -132,51 +119,48 @@ var PieChart = (function (ChartElement) {
|
|
|
132
119
|
return;
|
|
133
120
|
}
|
|
134
121
|
|
|
135
|
-
|
|
122
|
+
const segment = new PieSegment(value, sector, segmentOptions);
|
|
136
123
|
Object.assign(segment, fields);
|
|
137
124
|
this.append(segment);
|
|
138
125
|
this.points.push(segment);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
var leftSideLabels = [];
|
|
157
|
-
var rightSideLabels = [];
|
|
158
|
-
var padding = valueOrDefault(options.padding, defaultPadding);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
reflow(targetBox) {
|
|
129
|
+
const { options, points, seriesConfigs = [] } = this;
|
|
130
|
+
const count = points.length;
|
|
131
|
+
const box = targetBox.clone();
|
|
132
|
+
const space = 5;
|
|
133
|
+
const minWidth = Math.min(box.width(), box.height());
|
|
134
|
+
const halfMinWidth = minWidth / 2;
|
|
135
|
+
const defaultPadding = minWidth - minWidth * 0.85;
|
|
136
|
+
const newBox = new Box(box.x1, box.y1, box.x1 + minWidth, box.y1 + minWidth);
|
|
137
|
+
const newBoxCenter = newBox.center();
|
|
138
|
+
const boxCenter = box.center();
|
|
139
|
+
const seriesCount = options.series.length;
|
|
140
|
+
const leftSideLabels = [];
|
|
141
|
+
const rightSideLabels = [];
|
|
142
|
+
let padding = valueOrDefault(options.padding, defaultPadding);
|
|
159
143
|
|
|
160
144
|
this.targetBox = targetBox;
|
|
161
145
|
|
|
162
146
|
padding = padding > halfMinWidth - space ? halfMinWidth - space : padding;
|
|
163
147
|
newBox.translate(boxCenter.x - newBoxCenter.x, boxCenter.y - newBoxCenter.y);
|
|
164
148
|
|
|
165
|
-
|
|
166
|
-
|
|
149
|
+
const radius = halfMinWidth - padding;
|
|
150
|
+
const center = new Point(
|
|
167
151
|
radius + newBox.x1 + padding,
|
|
168
152
|
radius + newBox.y1 + padding
|
|
169
153
|
);
|
|
170
154
|
|
|
171
|
-
for (
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
155
|
+
for (let i = 0; i < count; i++) {
|
|
156
|
+
const segment = points[i];
|
|
157
|
+
const sector = segment.sector;
|
|
158
|
+
const seriesIndex = segment.seriesIx;
|
|
175
159
|
sector.radius = radius;
|
|
176
160
|
sector.center = center;
|
|
177
161
|
|
|
178
162
|
if (seriesConfigs.length) {
|
|
179
|
-
|
|
163
|
+
const seriesConfig = seriesConfigs[seriesIndex];
|
|
180
164
|
sector.innerRadius = seriesConfig.innerRadius;
|
|
181
165
|
sector.radius = seriesConfig.radius;
|
|
182
166
|
}
|
|
@@ -187,7 +171,7 @@ var PieChart = (function (ChartElement) {
|
|
|
187
171
|
|
|
188
172
|
segment.reflow(newBox);
|
|
189
173
|
|
|
190
|
-
|
|
174
|
+
const label = segment.label;
|
|
191
175
|
if (label) {
|
|
192
176
|
if (label.options.position === OUTSIDE_END) {
|
|
193
177
|
if (seriesIndex === seriesCount - 1) {
|
|
@@ -212,33 +196,33 @@ var PieChart = (function (ChartElement) {
|
|
|
212
196
|
}
|
|
213
197
|
|
|
214
198
|
this.box = newBox;
|
|
215
|
-
}
|
|
199
|
+
}
|
|
216
200
|
|
|
217
|
-
|
|
218
|
-
|
|
201
|
+
leftLabelsReflow(labels) {
|
|
202
|
+
const distances = this.distanceBetweenLabels(labels);
|
|
219
203
|
|
|
220
204
|
this.distributeLabels(distances, labels);
|
|
221
|
-
}
|
|
205
|
+
}
|
|
222
206
|
|
|
223
|
-
|
|
224
|
-
|
|
207
|
+
rightLabelsReflow(labels) {
|
|
208
|
+
const distances = this.distanceBetweenLabels(labels);
|
|
225
209
|
|
|
226
210
|
this.distributeLabels(distances, labels);
|
|
227
|
-
}
|
|
211
|
+
}
|
|
228
212
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
213
|
+
distanceBetweenLabels(labels) {
|
|
214
|
+
const segment = last(this.points);
|
|
215
|
+
const sector = segment.sector;
|
|
216
|
+
const count = labels.length - 1;
|
|
217
|
+
const lr = sector.radius + segment.options.labels.distance;
|
|
218
|
+
const distances = [];
|
|
219
|
+
let firstBox = labels[0].box;
|
|
220
|
+
let distance = round(firstBox.y1 - (sector.center.y - lr - firstBox.height() - firstBox.height() / 2));
|
|
237
221
|
|
|
238
222
|
distances.push(distance);
|
|
239
223
|
|
|
240
|
-
for (
|
|
241
|
-
|
|
224
|
+
for (let i = 0; i < count; i++) {
|
|
225
|
+
const secondBox = labels[i + 1].box;
|
|
242
226
|
|
|
243
227
|
firstBox = labels[i].box;
|
|
244
228
|
distance = round(secondBox.y1 - firstBox.y2);
|
|
@@ -248,57 +232,53 @@ var PieChart = (function (ChartElement) {
|
|
|
248
232
|
distances.push(distance);
|
|
249
233
|
|
|
250
234
|
return distances;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
PieChart.prototype.distributeLabels = function distributeLabels (distances, labels) {
|
|
254
|
-
var this$1 = this;
|
|
235
|
+
}
|
|
255
236
|
|
|
256
|
-
|
|
257
|
-
|
|
237
|
+
distributeLabels(distances, labels) {
|
|
238
|
+
const count = distances.length;
|
|
239
|
+
let left, right, remaining;
|
|
258
240
|
|
|
259
|
-
for (
|
|
241
|
+
for (let i = 0; i < count; i++) {
|
|
260
242
|
remaining = -distances[i];
|
|
261
243
|
left = right = i;
|
|
262
244
|
|
|
263
245
|
while (remaining > 0 && (left >= 0 || right < count)) {
|
|
264
|
-
remaining = this
|
|
265
|
-
remaining = this
|
|
246
|
+
remaining = this._takeDistance(distances, i, --left, remaining);
|
|
247
|
+
remaining = this._takeDistance(distances, i, ++right, remaining);
|
|
266
248
|
}
|
|
267
249
|
}
|
|
268
250
|
|
|
269
251
|
this.reflowLabels(distances, labels);
|
|
270
|
-
}
|
|
252
|
+
}
|
|
271
253
|
|
|
272
|
-
|
|
273
|
-
|
|
254
|
+
_takeDistance(distances, anchor, position, amount) {
|
|
255
|
+
let result = amount;
|
|
274
256
|
if (distances[position] > 0) {
|
|
275
|
-
|
|
257
|
+
const available = Math.min(distances[position], result);
|
|
276
258
|
result -= available;
|
|
277
259
|
distances[position] -= available;
|
|
278
260
|
distances[anchor] += available;
|
|
279
261
|
}
|
|
280
262
|
|
|
281
263
|
return result;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
PieChart.prototype.reflowLabels = function reflowLabels (distances, labels) {
|
|
285
|
-
var this$1 = this;
|
|
264
|
+
}
|
|
286
265
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
266
|
+
reflowLabels(distances, labels) {
|
|
267
|
+
const segment = last(this.points);
|
|
268
|
+
const sector = segment.sector;
|
|
269
|
+
const labelOptions = segment.options.labels;
|
|
270
|
+
const labelsCount = labels.length;
|
|
271
|
+
const labelDistance = labelOptions.distance;
|
|
272
|
+
let boxY = sector.center.y - (sector.radius + labelDistance) - labels[0].box.height();
|
|
273
|
+
let boxX;
|
|
294
274
|
|
|
295
275
|
distances[0] += 2;
|
|
296
|
-
for (
|
|
297
|
-
|
|
298
|
-
|
|
276
|
+
for (let i = 0; i < labelsCount; i++) {
|
|
277
|
+
const label = labels[i];
|
|
278
|
+
const box = label.box;
|
|
299
279
|
|
|
300
280
|
boxY += distances[i];
|
|
301
|
-
boxX = this
|
|
281
|
+
boxX = this.hAlignLabel(
|
|
302
282
|
box.x2,
|
|
303
283
|
sector.clone().expand(labelDistance),
|
|
304
284
|
boxY,
|
|
@@ -319,30 +299,25 @@ var PieChart = (function (ChartElement) {
|
|
|
319
299
|
|
|
320
300
|
boxY += box.height();
|
|
321
301
|
}
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
PieChart.prototype.createVisual = function createVisual () {
|
|
325
|
-
var this$1 = this;
|
|
302
|
+
}
|
|
326
303
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
var space = 4;
|
|
304
|
+
createVisual() {
|
|
305
|
+
const { options: { connectors }, points } = this;
|
|
306
|
+
const count = points.length;
|
|
307
|
+
const space = 4;
|
|
332
308
|
|
|
333
|
-
|
|
309
|
+
super.createVisual();
|
|
334
310
|
|
|
335
311
|
this._connectorLines = [];
|
|
336
312
|
|
|
337
|
-
for (
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
var connectorsColor = (segment.options.connectors || {}).color || connectors.color;
|
|
313
|
+
for (let i = 0; i < count; i++) {
|
|
314
|
+
const segment = points[i];
|
|
315
|
+
const { sector, label } = segment;
|
|
316
|
+
const angle = sector.middle();
|
|
317
|
+
const connectorsColor = (segment.options.connectors || {}).color || connectors.color;
|
|
343
318
|
|
|
344
319
|
if (label) {
|
|
345
|
-
|
|
320
|
+
const connectorLine = new draw.Path({
|
|
346
321
|
stroke: {
|
|
347
322
|
color: connectorsColor,
|
|
348
323
|
width: connectors.width
|
|
@@ -354,11 +329,11 @@ var PieChart = (function (ChartElement) {
|
|
|
354
329
|
});
|
|
355
330
|
|
|
356
331
|
if (label.options.position === OUTSIDE_END) {
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
332
|
+
const box = label.box;
|
|
333
|
+
const centerPoint = sector.center;
|
|
334
|
+
let start = sector.point(angle);
|
|
335
|
+
let middle = new Point(box.x1, box.center().y);
|
|
336
|
+
let sr, end, crossing;
|
|
362
337
|
|
|
363
338
|
start = sector.clone().expand(connectors.padding).point(angle);
|
|
364
339
|
connectorLine.moveTo(start.x, start.y);
|
|
@@ -370,7 +345,7 @@ var PieChart = (function (ChartElement) {
|
|
|
370
345
|
crossing = crossing || middle;
|
|
371
346
|
crossing.x = Math.min(crossing.x, middle.x);
|
|
372
347
|
|
|
373
|
-
if (this
|
|
348
|
+
if (this.pointInCircle(crossing, sector.center, sector.radius + space) ||
|
|
374
349
|
crossing.x < sector.center.x) {
|
|
375
350
|
sr = sector.center.x + sector.radius + space;
|
|
376
351
|
if (segment.options.labels.align !== COLUMN) {
|
|
@@ -394,7 +369,7 @@ var PieChart = (function (ChartElement) {
|
|
|
394
369
|
crossing = crossing || middle;
|
|
395
370
|
crossing.x = Math.max(crossing.x, middle.x);
|
|
396
371
|
|
|
397
|
-
if (this
|
|
372
|
+
if (this.pointInCircle(crossing, sector.center, sector.radius + space) ||
|
|
398
373
|
crossing.x > sector.center.x) {
|
|
399
374
|
sr = sector.center.x - sector.radius - space;
|
|
400
375
|
if (segment.options.labels.align !== COLUMN) {
|
|
@@ -415,27 +390,27 @@ var PieChart = (function (ChartElement) {
|
|
|
415
390
|
|
|
416
391
|
connectorLine.lineTo(end.x, end.y);
|
|
417
392
|
|
|
418
|
-
this
|
|
419
|
-
this
|
|
393
|
+
this._connectorLines.push(connectorLine);
|
|
394
|
+
this.visual.append(connectorLine);
|
|
420
395
|
}
|
|
421
396
|
}
|
|
422
397
|
}
|
|
423
|
-
}
|
|
398
|
+
}
|
|
424
399
|
|
|
425
|
-
|
|
426
|
-
|
|
400
|
+
renderVisual() {
|
|
401
|
+
super.renderVisual();
|
|
427
402
|
|
|
428
|
-
if (find(this.options.series,
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
403
|
+
if (find(this.options.series, options => options.autoFit)) {
|
|
404
|
+
const targetBox = this.targetBox;
|
|
405
|
+
const pieCenter = this.box.center();
|
|
406
|
+
const bbox = this.visual.bbox();
|
|
432
407
|
if (!bbox) {
|
|
433
408
|
return;
|
|
434
409
|
}
|
|
435
410
|
|
|
436
|
-
|
|
411
|
+
const bboxBottom = bbox.bottomRight();
|
|
437
412
|
|
|
438
|
-
|
|
413
|
+
const scale = Math.min(
|
|
439
414
|
(pieCenter.y - targetBox.y1) / (pieCenter.y - bbox.origin.y),
|
|
440
415
|
(targetBox.y2 - pieCenter.y) / (bboxBottom.y - pieCenter.y),
|
|
441
416
|
(pieCenter.x - targetBox.x1) / (pieCenter.x - bbox.origin.x),
|
|
@@ -446,58 +421,53 @@ var PieChart = (function (ChartElement) {
|
|
|
446
421
|
this.visual.transform(geometry.transform().scale(scale, scale, [ pieCenter.x, pieCenter.y ]));
|
|
447
422
|
}
|
|
448
423
|
}
|
|
449
|
-
}
|
|
424
|
+
}
|
|
450
425
|
|
|
451
|
-
|
|
452
|
-
|
|
426
|
+
labelComparator(reverse) {
|
|
427
|
+
const reverseValue = reverse ? -1 : 1;
|
|
453
428
|
|
|
454
429
|
return function(a, b) {
|
|
455
|
-
|
|
456
|
-
|
|
430
|
+
const first = (a.parent.sector.middle() + 270) % 360;
|
|
431
|
+
const second = (b.parent.sector.middle() + 270) % 360;
|
|
457
432
|
return (first - second) * reverseValue;
|
|
458
433
|
};
|
|
459
|
-
}
|
|
434
|
+
}
|
|
460
435
|
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
var cx = sector_center.x;
|
|
465
|
-
var cy = sector_center.y;
|
|
466
|
-
var t = Math.min(Math.abs(cy - y1), Math.abs(cy - y2));
|
|
436
|
+
hAlignLabel(originalX, sector, y1, y2, direction) {
|
|
437
|
+
const { radius, center: { x: cx, y: cy } } = sector;
|
|
438
|
+
const t = Math.min(Math.abs(cy - y1), Math.abs(cy - y2));
|
|
467
439
|
|
|
468
440
|
if (t > radius) {
|
|
469
441
|
return originalX;
|
|
470
442
|
}
|
|
471
443
|
|
|
472
444
|
return cx + Math.sqrt((radius * radius) - (t * t)) * (direction ? 1 : -1);
|
|
473
|
-
}
|
|
445
|
+
}
|
|
474
446
|
|
|
475
|
-
|
|
447
|
+
pointInCircle(point, center, radius) {
|
|
476
448
|
return Math.pow(center.x - point.x, 2) + Math.pow(center.y - point.y, 2) < Math.pow(radius, 2);
|
|
477
|
-
}
|
|
449
|
+
}
|
|
478
450
|
|
|
479
|
-
|
|
451
|
+
formatPointValue(point, format) {
|
|
480
452
|
return this.chartService.format.auto(format, point.value);
|
|
481
|
-
}
|
|
453
|
+
}
|
|
482
454
|
|
|
483
|
-
|
|
455
|
+
animationDelay(categoryIndex) {
|
|
484
456
|
return categoryIndex * PIE_SECTOR_ANIM_DELAY;
|
|
485
|
-
}
|
|
457
|
+
}
|
|
486
458
|
|
|
487
|
-
|
|
459
|
+
stackRoot() {
|
|
488
460
|
return this;
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
return PieChart;
|
|
492
|
-
}(ChartElement));
|
|
461
|
+
}
|
|
462
|
+
}
|
|
493
463
|
|
|
494
464
|
function intersection(a1, a2, b1, b2) {
|
|
495
|
-
|
|
496
|
-
|
|
465
|
+
const uat = (b2.x - b1.x) * (a1.y - b1.y) - (b2.y - b1.y) * (a1.x - b1.x);
|
|
466
|
+
const ub = (b2.y - b1.y) * (a2.x - a1.x) - (b2.x - b1.x) * (a2.y - a1.y);
|
|
497
467
|
|
|
498
|
-
|
|
468
|
+
let result;
|
|
499
469
|
if (ub !== 0) {
|
|
500
|
-
|
|
470
|
+
const ua = (uat / ub);
|
|
501
471
|
|
|
502
472
|
result = new Point(
|
|
503
473
|
a1.x + ua * (a2.x - a1.x),
|