@visactor/vchart 1.3.0-beta.6 → 1.3.0-beta.7
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/build/es5/index.js +3 -3
- package/build/index.js +1437 -909
- package/build/index.min.js +2 -2
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/animation/spec.d.ts +1 -1
- package/cjs/animation/spec.js.map +1 -1
- package/cjs/chart/area/area.js +0 -1
- package/cjs/chart/area/area.js.map +1 -1
- package/cjs/chart/base-chart.d.ts +2 -1
- package/cjs/chart/base-chart.js +21 -30
- package/cjs/chart/base-chart.js.map +1 -1
- package/cjs/chart/cartesian/cartesian.js +2 -1
- package/cjs/chart/cartesian/cartesian.js.map +1 -1
- package/cjs/chart/interface/chart.d.ts +2 -1
- package/cjs/chart/interface/chart.js.map +1 -1
- package/cjs/chart/line/line.js +0 -1
- package/cjs/chart/line/line.js.map +1 -1
- package/cjs/chart/radar/radar.js +0 -1
- package/cjs/chart/radar/radar.js.map +1 -1
- package/cjs/chart/stack.d.ts +1 -0
- package/cjs/chart/stack.js +14 -0
- package/cjs/chart/stack.js.map +1 -1
- package/cjs/chart/util.d.ts +8 -0
- package/cjs/chart/util.js +33 -3
- package/cjs/chart/util.js.map +1 -1
- package/cjs/compile/compiler.js +2 -1
- package/cjs/compile/compiler.js.map +1 -1
- package/cjs/component/axis/base-axis.d.ts +1 -0
- package/cjs/component/axis/base-axis.js.map +1 -1
- package/cjs/component/axis/cartesian/axis.js +1 -0
- package/cjs/component/axis/cartesian/axis.js.map +1 -1
- package/cjs/component/axis/cartesian/interface/common.d.ts +3 -1
- package/cjs/component/axis/cartesian/interface/common.js.map +1 -1
- package/cjs/component/axis/mixin/linear-axis-mixin.js +1 -1
- package/cjs/component/axis/mixin/linear-axis-mixin.js.map +1 -1
- package/cjs/component/axis/polar/axis.js +3 -2
- package/cjs/component/axis/polar/axis.js.map +1 -1
- package/cjs/component/base/base-component.d.ts +3 -2
- package/cjs/component/base/base-component.js +3 -3
- package/cjs/component/base/base-component.js.map +1 -1
- package/cjs/component/crosshair/base.d.ts +1 -0
- package/cjs/component/crosshair/base.js +3 -2
- package/cjs/component/crosshair/base.js.map +1 -1
- package/cjs/component/crosshair/cartesian.js +1 -1
- package/cjs/component/crosshair/cartesian.js.map +1 -1
- package/cjs/component/custom-mark/custom-mark.d.ts +1 -0
- package/cjs/component/data-zoom/data-filter-base-component.d.ts +1 -0
- package/cjs/component/geo/geo-coordinate.d.ts +7 -2
- package/cjs/component/geo/geo-coordinate.js +38 -14
- package/cjs/component/geo/geo-coordinate.js.map +1 -1
- package/cjs/component/index.d.ts +2 -1
- package/cjs/component/index.js +10 -2
- package/cjs/component/index.js.map +1 -1
- package/cjs/component/indicator/indicator.js.map +1 -1
- package/cjs/component/interface/theme.d.ts +2 -0
- package/cjs/component/interface/theme.js.map +1 -1
- package/cjs/component/interface/type.d.ts +1 -0
- package/cjs/component/interface/type.js +2 -2
- package/cjs/component/interface/type.js.map +1 -1
- package/cjs/component/label/base-label.d.ts +40 -0
- package/cjs/component/label/base-label.js +44 -0
- package/cjs/component/label/base-label.js.map +1 -0
- package/cjs/component/label/interface.d.ts +4 -0
- package/cjs/component/label/interface.js.map +1 -1
- package/cjs/component/label/label.d.ts +5 -27
- package/cjs/component/label/label.js +30 -33
- package/cjs/component/label/label.js.map +1 -1
- package/cjs/component/label/pie.d.ts +5 -0
- package/cjs/component/label/pie.js +21 -0
- package/cjs/component/label/pie.js.map +1 -0
- package/cjs/component/label/totalLabel.d.ts +27 -0
- package/cjs/component/label/totalLabel.js +107 -0
- package/cjs/component/label/totalLabel.js.map +1 -0
- package/cjs/component/label/util.d.ts +3 -1
- package/cjs/component/label/util.js +5 -5
- package/cjs/component/label/util.js.map +1 -1
- package/cjs/component/legend/base-legend.d.ts +1 -0
- package/cjs/component/legend/continuous/legend.js +5 -2
- package/cjs/component/legend/continuous/legend.js.map +1 -1
- package/cjs/component/marker/base-marker.d.ts +6 -0
- package/cjs/component/marker/base-marker.js +14 -0
- package/cjs/component/marker/base-marker.js.map +1 -1
- package/cjs/component/marker/interface.d.ts +1 -0
- package/cjs/component/marker/interface.js.map +1 -1
- package/cjs/component/marker/mark-area/mark-area.js +17 -6
- package/cjs/component/marker/mark-area/mark-area.js.map +1 -1
- package/cjs/component/marker/mark-line/mark-line.js +17 -6
- package/cjs/component/marker/mark-line/mark-line.js.map +1 -1
- package/cjs/component/marker/mark-point/mark-point.js +18 -7
- package/cjs/component/marker/mark-point/mark-point.js.map +1 -1
- package/cjs/component/title/title.d.ts +1 -0
- package/cjs/component/title/title.js +2 -1
- package/cjs/component/title/title.js.map +1 -1
- package/cjs/component/tooltip/handler/base.js +6 -3
- package/cjs/component/tooltip/handler/base.js.map +1 -1
- package/cjs/component/tooltip/handler/utils/attribute.js +2 -1
- package/cjs/component/tooltip/handler/utils/attribute.js.map +1 -1
- package/cjs/component/tooltip/handler/utils/common.js +2 -2
- package/cjs/component/tooltip/handler/utils/common.js.map +1 -1
- package/cjs/component/tooltip/tooltip.js +6 -6
- package/cjs/component/tooltip/tooltip.js.map +1 -1
- package/cjs/constant/index.d.ts +3 -0
- package/cjs/constant/index.js +4 -3
- package/cjs/constant/index.js.map +1 -1
- package/cjs/constant/marker.js +2 -1
- package/cjs/core/factory.js +1 -2
- package/cjs/core/index.d.ts +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/index.js.map +1 -1
- package/cjs/core/vchart.js +11 -11
- package/cjs/core/vchart.js.map +1 -1
- package/cjs/data/initialize.js.map +1 -1
- package/cjs/data/transforms/invalid-travel.js +1 -2
- package/cjs/data/transforms/invalid-travel.js.map +1 -1
- package/cjs/data/transforms/legend-data/continuous/continuous.js +1 -2
- package/cjs/data/transforms/legend-data/continuous/continuous.js.map +1 -1
- package/cjs/event/event-dispatcher.js +4 -2
- package/cjs/event/event-dispatcher.js.map +1 -1
- package/cjs/event/interface.d.ts +3 -3
- package/cjs/event/interface.js.map +1 -1
- package/cjs/interaction/trigger.js +4 -0
- package/cjs/interaction/trigger.js.map +1 -1
- package/cjs/layout/label/arc-label.js.map +1 -1
- package/cjs/model/base-model.d.ts +2 -0
- package/cjs/model/base-model.js +2 -0
- package/cjs/model/base-model.js.map +1 -1
- package/cjs/model/interface.d.ts +6 -1
- package/cjs/model/interface.js.map +1 -1
- package/cjs/region/region.d.ts +1 -0
- package/cjs/series/area/area.d.ts +3 -2
- package/cjs/series/area/area.js +31 -10
- package/cjs/series/area/area.js.map +1 -1
- package/cjs/series/area/tooltip-helpter.d.ts +5 -0
- package/cjs/series/area/tooltip-helpter.js +24 -0
- package/cjs/series/area/tooltip-helpter.js.map +1 -0
- package/cjs/series/bar/bar.d.ts +1 -0
- package/cjs/series/base/base-series.d.ts +3 -0
- package/cjs/series/base/base-series.js +14 -8
- package/cjs/series/base/base-series.js.map +1 -1
- package/cjs/series/cartesian/cartesian.d.ts +1 -0
- package/cjs/series/cartesian/cartesian.js +12 -2
- package/cjs/series/cartesian/cartesian.js.map +1 -1
- package/cjs/series/dot/dot.d.ts +1 -0
- package/cjs/series/dot/dot.js +3 -0
- package/cjs/series/dot/dot.js.map +1 -1
- package/cjs/series/funnel/funnel.d.ts +1 -0
- package/cjs/series/geo/geo.d.ts +2 -0
- package/cjs/series/geo/geo.js +5 -1
- package/cjs/series/geo/geo.js.map +1 -1
- package/cjs/series/heatmap/heatmap.d.ts +1 -0
- package/cjs/series/interface/common.d.ts +1 -0
- package/cjs/series/interface/common.js.map +1 -1
- package/cjs/series/interface/series.d.ts +3 -2
- package/cjs/series/interface/series.js.map +1 -1
- package/cjs/series/line/interface.d.ts +0 -2
- package/cjs/series/line/interface.js.map +1 -1
- package/cjs/series/line/line.d.ts +1 -2
- package/cjs/series/line/line.js +3 -2
- package/cjs/series/line/line.js.map +1 -1
- package/cjs/series/map/map.d.ts +1 -2
- package/cjs/series/map/map.js +1 -5
- package/cjs/series/map/map.js.map +1 -1
- package/cjs/series/mixin/line-mixin.d.ts +2 -0
- package/cjs/series/mixin/line-mixin.js +8 -9
- package/cjs/series/mixin/line-mixin.js.map +1 -1
- package/cjs/series/pie/interface.d.ts +4 -7
- package/cjs/series/pie/interface.js.map +1 -1
- package/cjs/series/pie/pie.d.ts +2 -0
- package/cjs/series/pie/pie.js +19 -56
- package/cjs/series/pie/pie.js.map +1 -1
- package/cjs/series/polar/polar.d.ts +1 -0
- package/cjs/series/range-area/range-area.js +5 -2
- package/cjs/series/range-area/range-area.js.map +1 -1
- package/cjs/series/rose/interface.d.ts +3 -0
- package/cjs/series/rose/interface.js.map +1 -1
- package/cjs/series/rose/rose.d.ts +1 -2
- package/cjs/series/rose/rose.js +17 -36
- package/cjs/series/rose/rose.js.map +1 -1
- package/cjs/series/scatter/interface.d.ts +1 -2
- package/cjs/series/scatter/interface.js.map +1 -1
- package/cjs/series/scatter/scatter.d.ts +1 -2
- package/cjs/series/scatter/scatter.js +7 -6
- package/cjs/series/scatter/scatter.js.map +1 -1
- package/cjs/series/word-cloud/base.d.ts +1 -0
- package/cjs/series/word-cloud/base.js +1 -1
- package/cjs/series/word-cloud/base.js.map +1 -1
- package/cjs/series/word-cloud/interface.d.ts +3 -3
- package/cjs/series/word-cloud/interface.js.map +1 -1
- package/cjs/series/word-cloud/word-cloud-3d.js +1 -1
- package/cjs/series/word-cloud/word-cloud-3d.js.map +1 -1
- package/cjs/theme/buildin-theme/light/component/index.js +3 -2
- package/cjs/theme/buildin-theme/light/component/index.js.map +1 -1
- package/cjs/theme/buildin-theme/light/component/total-label.d.ts +2 -0
- package/cjs/theme/buildin-theme/light/component/total-label.js +24 -0
- package/cjs/theme/buildin-theme/light/component/total-label.js.map +1 -0
- package/cjs/theme/buildin-theme/light/series/rose.js +0 -1
- package/cjs/theme/buildin-theme/light/series/rose.js.map +1 -1
- package/cjs/typings/spec/common.d.ts +2 -0
- package/cjs/typings/spec/common.js.map +1 -1
- package/cjs/typings/visual.d.ts +1 -1
- package/cjs/typings/visual.js.map +1 -1
- package/cjs/util/space.d.ts +2 -0
- package/cjs/util/space.js +12 -6
- package/cjs/util/space.js.map +1 -1
- package/cjs/vchart-all.js +1 -1
- package/cjs/vchart-all.js.map +1 -1
- package/esm/animation/spec.d.ts +1 -1
- package/esm/animation/spec.js.map +1 -1
- package/esm/chart/area/area.js +0 -1
- package/esm/chart/area/area.js.map +1 -1
- package/esm/chart/base-chart.d.ts +2 -1
- package/esm/chart/base-chart.js +24 -31
- package/esm/chart/base-chart.js.map +1 -1
- package/esm/chart/cartesian/cartesian.js +2 -1
- package/esm/chart/cartesian/cartesian.js.map +1 -1
- package/esm/chart/interface/chart.d.ts +2 -1
- package/esm/chart/interface/chart.js.map +1 -1
- package/esm/chart/line/line.js +0 -1
- package/esm/chart/line/line.js.map +1 -1
- package/esm/chart/radar/radar.js +0 -1
- package/esm/chart/radar/radar.js.map +1 -1
- package/esm/chart/stack.d.ts +1 -0
- package/esm/chart/stack.js +16 -2
- package/esm/chart/stack.js.map +1 -1
- package/esm/chart/util.d.ts +8 -0
- package/esm/chart/util.js +35 -2
- package/esm/chart/util.js.map +1 -1
- package/esm/compile/compiler.js +2 -1
- package/esm/compile/compiler.js.map +1 -1
- package/esm/component/axis/base-axis.d.ts +1 -0
- package/esm/component/axis/base-axis.js.map +1 -1
- package/esm/component/axis/cartesian/axis.js +1 -0
- package/esm/component/axis/cartesian/axis.js.map +1 -1
- package/esm/component/axis/cartesian/interface/common.d.ts +3 -1
- package/esm/component/axis/cartesian/interface/common.js.map +1 -1
- package/esm/component/axis/mixin/linear-axis-mixin.js +1 -1
- package/esm/component/axis/mixin/linear-axis-mixin.js.map +1 -1
- package/esm/component/axis/polar/axis.js +3 -2
- package/esm/component/axis/polar/axis.js.map +1 -1
- package/esm/component/base/base-component.d.ts +3 -2
- package/esm/component/base/base-component.js +3 -3
- package/esm/component/base/base-component.js.map +1 -1
- package/esm/component/crosshair/base.d.ts +1 -0
- package/esm/component/crosshair/base.js +3 -2
- package/esm/component/crosshair/base.js.map +1 -1
- package/esm/component/crosshair/cartesian.js +1 -1
- package/esm/component/crosshair/cartesian.js.map +1 -1
- package/esm/component/custom-mark/custom-mark.d.ts +1 -0
- package/esm/component/data-zoom/data-filter-base-component.d.ts +1 -0
- package/esm/component/geo/geo-coordinate.d.ts +7 -2
- package/esm/component/geo/geo-coordinate.js +40 -14
- package/esm/component/geo/geo-coordinate.js.map +1 -1
- package/esm/component/index.d.ts +2 -1
- package/esm/component/index.js +3 -2
- package/esm/component/index.js.map +1 -1
- package/esm/component/indicator/indicator.js.map +1 -1
- package/esm/component/interface/theme.d.ts +2 -0
- package/esm/component/interface/theme.js.map +1 -1
- package/esm/component/interface/type.d.ts +1 -0
- package/esm/component/interface/type.js +2 -2
- package/esm/component/interface/type.js.map +1 -1
- package/esm/component/label/base-label.d.ts +40 -0
- package/esm/component/label/base-label.js +42 -0
- package/esm/component/label/base-label.js.map +1 -0
- package/esm/component/label/interface.d.ts +4 -0
- package/esm/component/label/interface.js.map +1 -1
- package/esm/component/label/label.d.ts +5 -27
- package/esm/component/label/label.js +32 -35
- package/esm/component/label/label.js.map +1 -1
- package/esm/component/label/pie.d.ts +5 -0
- package/esm/component/label/pie.js +13 -0
- package/esm/component/label/pie.js.map +1 -0
- package/esm/component/label/totalLabel.d.ts +27 -0
- package/esm/component/label/totalLabel.js +110 -0
- package/esm/component/label/totalLabel.js.map +1 -0
- package/esm/component/label/util.d.ts +3 -1
- package/esm/component/label/util.js +6 -4
- package/esm/component/label/util.js.map +1 -1
- package/esm/component/legend/base-legend.d.ts +1 -0
- package/esm/component/legend/continuous/legend.js +5 -2
- package/esm/component/legend/continuous/legend.js.map +1 -1
- package/esm/component/marker/base-marker.d.ts +6 -0
- package/esm/component/marker/base-marker.js +14 -0
- package/esm/component/marker/base-marker.js.map +1 -1
- package/esm/component/marker/interface.d.ts +1 -0
- package/esm/component/marker/interface.js.map +1 -1
- package/esm/component/marker/mark-area/mark-area.js +17 -6
- package/esm/component/marker/mark-area/mark-area.js.map +1 -1
- package/esm/component/marker/mark-line/mark-line.js +17 -6
- package/esm/component/marker/mark-line/mark-line.js.map +1 -1
- package/esm/component/marker/mark-point/mark-point.js +18 -7
- package/esm/component/marker/mark-point/mark-point.js.map +1 -1
- package/esm/component/title/title.d.ts +1 -0
- package/esm/component/title/title.js +2 -1
- package/esm/component/title/title.js.map +1 -1
- package/esm/component/tooltip/handler/base.js +6 -3
- package/esm/component/tooltip/handler/base.js.map +1 -1
- package/esm/component/tooltip/handler/utils/attribute.js +2 -1
- package/esm/component/tooltip/handler/utils/attribute.js.map +1 -1
- package/esm/component/tooltip/handler/utils/common.js +2 -2
- package/esm/component/tooltip/handler/utils/common.js.map +1 -1
- package/esm/component/tooltip/tooltip.js +6 -6
- package/esm/component/tooltip/tooltip.js.map +1 -1
- package/esm/constant/index.d.ts +3 -0
- package/esm/constant/index.js +6 -0
- package/esm/constant/index.js.map +1 -1
- package/esm/constant/marker.js +2 -1
- package/esm/core/factory.js +1 -2
- package/esm/core/index.d.ts +1 -1
- package/esm/core/index.js +1 -1
- package/esm/core/index.js.map +1 -1
- package/esm/core/vchart.js +14 -11
- package/esm/core/vchart.js.map +1 -1
- package/esm/data/initialize.js.map +1 -1
- package/esm/data/transforms/invalid-travel.js +1 -2
- package/esm/data/transforms/invalid-travel.js.map +1 -1
- package/esm/data/transforms/legend-data/continuous/continuous.js +1 -1
- package/esm/data/transforms/legend-data/continuous/continuous.js.map +1 -1
- package/esm/event/event-dispatcher.js +3 -2
- package/esm/event/event-dispatcher.js.map +1 -1
- package/esm/event/interface.d.ts +3 -3
- package/esm/event/interface.js.map +1 -1
- package/esm/interaction/trigger.js +4 -0
- package/esm/interaction/trigger.js.map +1 -1
- package/esm/layout/label/arc-label.js.map +1 -1
- package/esm/model/base-model.d.ts +2 -0
- package/esm/model/base-model.js +2 -0
- package/esm/model/base-model.js.map +1 -1
- package/esm/model/interface.d.ts +6 -1
- package/esm/model/interface.js.map +1 -1
- package/esm/region/region.d.ts +1 -0
- package/esm/series/area/area.d.ts +3 -2
- package/esm/series/area/area.js +34 -8
- package/esm/series/area/area.js.map +1 -1
- package/esm/series/area/tooltip-helpter.d.ts +5 -0
- package/esm/series/area/tooltip-helpter.js +18 -0
- package/esm/series/area/tooltip-helpter.js.map +1 -0
- package/esm/series/bar/bar.d.ts +1 -0
- package/esm/series/base/base-series.d.ts +3 -0
- package/esm/series/base/base-series.js +14 -9
- package/esm/series/base/base-series.js.map +1 -1
- package/esm/series/cartesian/cartesian.d.ts +1 -0
- package/esm/series/cartesian/cartesian.js +12 -2
- package/esm/series/cartesian/cartesian.js.map +1 -1
- package/esm/series/dot/dot.d.ts +1 -0
- package/esm/series/dot/dot.js +3 -0
- package/esm/series/dot/dot.js.map +1 -1
- package/esm/series/funnel/funnel.d.ts +1 -0
- package/esm/series/geo/geo.d.ts +2 -0
- package/esm/series/geo/geo.js +4 -1
- package/esm/series/geo/geo.js.map +1 -1
- package/esm/series/heatmap/heatmap.d.ts +1 -0
- package/esm/series/interface/common.d.ts +1 -0
- package/esm/series/interface/common.js.map +1 -1
- package/esm/series/interface/series.d.ts +3 -2
- package/esm/series/interface/series.js.map +1 -1
- package/esm/series/line/interface.d.ts +0 -2
- package/esm/series/line/interface.js.map +1 -1
- package/esm/series/line/line.d.ts +1 -2
- package/esm/series/line/line.js +3 -2
- package/esm/series/line/line.js.map +1 -1
- package/esm/series/map/map.d.ts +1 -2
- package/esm/series/map/map.js +1 -5
- package/esm/series/map/map.js.map +1 -1
- package/esm/series/mixin/line-mixin.d.ts +2 -0
- package/esm/series/mixin/line-mixin.js +9 -8
- package/esm/series/mixin/line-mixin.js.map +1 -1
- package/esm/series/pie/interface.d.ts +4 -7
- package/esm/series/pie/interface.js.map +1 -1
- package/esm/series/pie/pie.d.ts +2 -0
- package/esm/series/pie/pie.js +22 -54
- package/esm/series/pie/pie.js.map +1 -1
- package/esm/series/polar/polar.d.ts +1 -0
- package/esm/series/range-area/range-area.js +4 -3
- package/esm/series/range-area/range-area.js.map +1 -1
- package/esm/series/rose/interface.d.ts +3 -0
- package/esm/series/rose/interface.js.map +1 -1
- package/esm/series/rose/rose.d.ts +1 -2
- package/esm/series/rose/rose.js +17 -37
- package/esm/series/rose/rose.js.map +1 -1
- package/esm/series/scatter/interface.d.ts +1 -2
- package/esm/series/scatter/interface.js.map +1 -1
- package/esm/series/scatter/scatter.d.ts +1 -2
- package/esm/series/scatter/scatter.js +8 -7
- package/esm/series/scatter/scatter.js.map +1 -1
- package/esm/series/word-cloud/base.d.ts +1 -0
- package/esm/series/word-cloud/base.js +1 -1
- package/esm/series/word-cloud/base.js.map +1 -1
- package/esm/series/word-cloud/interface.d.ts +3 -3
- package/esm/series/word-cloud/interface.js.map +1 -1
- package/esm/series/word-cloud/word-cloud-3d.js +1 -1
- package/esm/series/word-cloud/word-cloud-3d.js.map +1 -1
- package/esm/theme/buildin-theme/light/component/index.js +4 -1
- package/esm/theme/buildin-theme/light/component/index.js.map +1 -1
- package/esm/theme/buildin-theme/light/component/total-label.d.ts +2 -0
- package/esm/theme/buildin-theme/light/component/total-label.js +20 -0
- package/esm/theme/buildin-theme/light/component/total-label.js.map +1 -0
- package/esm/theme/buildin-theme/light/series/rose.js +0 -1
- package/esm/theme/buildin-theme/light/series/rose.js.map +1 -1
- package/esm/typings/spec/common.d.ts +2 -0
- package/esm/typings/spec/common.js.map +1 -1
- package/esm/typings/visual.d.ts +1 -1
- package/esm/typings/visual.js.map +1 -1
- package/esm/util/space.d.ts +2 -0
- package/esm/util/space.js +8 -3
- package/esm/util/space.js.map +1 -1
- package/esm/vchart-all.js +2 -2
- package/esm/vchart-all.js.map +1 -1
- package/package.json +13 -12
package/build/index.js
CHANGED
|
@@ -2612,7 +2612,7 @@
|
|
|
2612
2612
|
}
|
|
2613
2613
|
return t;
|
|
2614
2614
|
}
|
|
2615
|
-
function __awaiter$
|
|
2615
|
+
function __awaiter$h(thisArg, _arguments, P, generator) {
|
|
2616
2616
|
function adopt(value) {
|
|
2617
2617
|
return value instanceof P ? value : new P(function (resolve) {
|
|
2618
2618
|
resolve(value);
|
|
@@ -2684,6 +2684,7 @@
|
|
|
2684
2684
|
ComponentTypeEnum["player"] = "player";
|
|
2685
2685
|
ComponentTypeEnum["scrollBar"] = "scrollBar";
|
|
2686
2686
|
ComponentTypeEnum["label"] = "label";
|
|
2687
|
+
ComponentTypeEnum["totalLabel"] = "totalLabel";
|
|
2687
2688
|
ComponentTypeEnum["brush"] = "brush";
|
|
2688
2689
|
ComponentTypeEnum["poptip"] = "poptip";
|
|
2689
2690
|
ComponentTypeEnum["customMark"] = "customMark";
|
|
@@ -8181,8 +8182,8 @@
|
|
|
8181
8182
|
if (array && array.length) {
|
|
8182
8183
|
const n = array.length;
|
|
8183
8184
|
for (let i = 0; i < n; i += 1) {
|
|
8184
|
-
|
|
8185
|
-
isNumber(value)
|
|
8185
|
+
let value = valueGetter(array[i]);
|
|
8186
|
+
isNil(value) || !isNumber(value = +value) || Number.isNaN(value) || (isNil(min) ? (min = value, max = value) : (min = Math.min(min, value), max = Math.max(max, value)));
|
|
8186
8187
|
}
|
|
8187
8188
|
return [min, max];
|
|
8188
8189
|
}
|
|
@@ -9812,7 +9813,17 @@
|
|
|
9812
9813
|
}
|
|
9813
9814
|
return couldBeValidNumber(v.substring(0, v.length - 1));
|
|
9814
9815
|
}
|
|
9816
|
+
function isPercentOffset(v) {
|
|
9817
|
+
if (!isObject$f(v)) {
|
|
9818
|
+
return false;
|
|
9819
|
+
}
|
|
9820
|
+
if ('percent' in v || 'offset' in v) {
|
|
9821
|
+
return true;
|
|
9822
|
+
}
|
|
9823
|
+
return false;
|
|
9824
|
+
}
|
|
9815
9825
|
function calcLayoutNumber(v, size, callOp) {
|
|
9826
|
+
var _a, _b;
|
|
9816
9827
|
if (isNumber(v)) {
|
|
9817
9828
|
return v;
|
|
9818
9829
|
}
|
|
@@ -9822,6 +9833,9 @@
|
|
|
9822
9833
|
if (isFunction(v)) {
|
|
9823
9834
|
return v(callOp);
|
|
9824
9835
|
}
|
|
9836
|
+
if (isObject$f(v)) {
|
|
9837
|
+
return size * ((_a = v.percent) !== null && _a !== void 0 ? _a : 0) + ((_b = v.offset) !== null && _b !== void 0 ? _b : 0);
|
|
9838
|
+
}
|
|
9825
9839
|
return 0;
|
|
9826
9840
|
}
|
|
9827
9841
|
function calcPadding(paddingSpec, rect, callOp) {
|
|
@@ -9882,12 +9896,13 @@
|
|
|
9882
9896
|
}
|
|
9883
9897
|
return result;
|
|
9884
9898
|
}
|
|
9885
|
-
if (isNumber(spec) || isPercent(spec) || isFunction(spec)) {
|
|
9899
|
+
if (isNumber(spec) || isPercent(spec) || isFunction(spec) || isPercentOffset(spec)) {
|
|
9886
9900
|
result.top = result.left = result.bottom = result.right = spec;
|
|
9887
9901
|
return result;
|
|
9888
9902
|
}
|
|
9889
9903
|
if (isObject$f(spec)) {
|
|
9890
9904
|
result = Object.assign({}, spec);
|
|
9905
|
+
return result;
|
|
9891
9906
|
}
|
|
9892
9907
|
return result;
|
|
9893
9908
|
}
|
|
@@ -13512,7 +13527,7 @@
|
|
|
13512
13527
|
return Array.isArray(object) && object.some(isPromise);
|
|
13513
13528
|
}
|
|
13514
13529
|
|
|
13515
|
-
var __awaiter$
|
|
13530
|
+
var __awaiter$g = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
13516
13531
|
function adopt(value) {
|
|
13517
13532
|
return value instanceof P ? value : new P(function (resolve) {
|
|
13518
13533
|
resolve(value);
|
|
@@ -13657,7 +13672,7 @@
|
|
|
13657
13672
|
}
|
|
13658
13673
|
};
|
|
13659
13674
|
var _saveAsyncResultToSingletonScope = function (binding, asyncResult) {
|
|
13660
|
-
return __awaiter$
|
|
13675
|
+
return __awaiter$g(void 0, void 0, void 0, function () {
|
|
13661
13676
|
var result, ex_1;
|
|
13662
13677
|
return __generator$3(this, function (_a) {
|
|
13663
13678
|
switch (_a.label) {
|
|
@@ -13745,7 +13760,7 @@
|
|
|
13745
13760
|
};
|
|
13746
13761
|
return __assign$1.apply(this, arguments);
|
|
13747
13762
|
};
|
|
13748
|
-
var __awaiter$
|
|
13763
|
+
var __awaiter$f = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
13749
13764
|
function adopt(value) {
|
|
13750
13765
|
return value instanceof P ? value : new P(function (resolve) {
|
|
13751
13766
|
resolve(value);
|
|
@@ -13918,7 +13933,7 @@
|
|
|
13918
13933
|
return instance;
|
|
13919
13934
|
}
|
|
13920
13935
|
function createInstanceWithInjectionsAsync(args) {
|
|
13921
|
-
return __awaiter$
|
|
13936
|
+
return __awaiter$f(this, void 0, void 0, function () {
|
|
13922
13937
|
var constructorInjections, propertyInjections;
|
|
13923
13938
|
return __generator$2(this, function (_a) {
|
|
13924
13939
|
switch (_a.label) {
|
|
@@ -13938,7 +13953,7 @@
|
|
|
13938
13953
|
});
|
|
13939
13954
|
}
|
|
13940
13955
|
function possiblyWaitInjections(possiblePromiseinjections) {
|
|
13941
|
-
return __awaiter$
|
|
13956
|
+
return __awaiter$f(this, void 0, void 0, function () {
|
|
13942
13957
|
var injections, _i, possiblePromiseinjections_1, injection;
|
|
13943
13958
|
return __generator$2(this, function (_a) {
|
|
13944
13959
|
injections = [];
|
|
@@ -14001,7 +14016,7 @@
|
|
|
14001
14016
|
}
|
|
14002
14017
|
}
|
|
14003
14018
|
|
|
14004
|
-
var __awaiter$
|
|
14019
|
+
var __awaiter$e = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
14005
14020
|
function adopt(value) {
|
|
14006
14021
|
return value instanceof P ? value : new P(function (resolve) {
|
|
14007
14022
|
resolve(value);
|
|
@@ -14227,7 +14242,7 @@
|
|
|
14227
14242
|
return result;
|
|
14228
14243
|
};
|
|
14229
14244
|
var _activateContainerAsync = function (activationsIterator, context, resultPromise) {
|
|
14230
|
-
return __awaiter$
|
|
14245
|
+
return __awaiter$e(void 0, void 0, void 0, function () {
|
|
14231
14246
|
var result, activation;
|
|
14232
14247
|
return __generator$1(this, function (_a) {
|
|
14233
14248
|
switch (_a.label) {
|
|
@@ -14841,7 +14856,7 @@
|
|
|
14841
14856
|
};
|
|
14842
14857
|
return __assign.apply(this, arguments);
|
|
14843
14858
|
};
|
|
14844
|
-
var __awaiter$
|
|
14859
|
+
var __awaiter$d = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
14845
14860
|
function adopt(value) {
|
|
14846
14861
|
return value instanceof P ? value : new P(function (resolve) {
|
|
14847
14862
|
resolve(value);
|
|
@@ -15040,7 +15055,7 @@
|
|
|
15040
15055
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
15041
15056
|
modules[_i] = arguments[_i];
|
|
15042
15057
|
}
|
|
15043
|
-
return __awaiter$
|
|
15058
|
+
return __awaiter$d(this, void 0, void 0, function () {
|
|
15044
15059
|
var getHelpers, _a, modules_2, currentModule, containerModuleHelpers;
|
|
15045
15060
|
return __generator(this, function (_b) {
|
|
15046
15061
|
switch (_b.label) {
|
|
@@ -15082,7 +15097,7 @@
|
|
|
15082
15097
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
15083
15098
|
modules[_i] = arguments[_i];
|
|
15084
15099
|
}
|
|
15085
|
-
return __awaiter$
|
|
15100
|
+
return __awaiter$d(this, void 0, void 0, function () {
|
|
15086
15101
|
var _a, modules_3, module_1, deactivations;
|
|
15087
15102
|
return __generator(this, function (_b) {
|
|
15088
15103
|
switch (_b.label) {
|
|
@@ -15118,7 +15133,7 @@
|
|
|
15118
15133
|
return this.bind(serviceIdentifier);
|
|
15119
15134
|
};
|
|
15120
15135
|
Container.prototype.rebindAsync = function (serviceIdentifier) {
|
|
15121
|
-
return __awaiter$
|
|
15136
|
+
return __awaiter$d(this, void 0, void 0, function () {
|
|
15122
15137
|
return __generator(this, function (_a) {
|
|
15123
15138
|
switch (_a.label) {
|
|
15124
15139
|
case 0:
|
|
@@ -15138,7 +15153,7 @@
|
|
|
15138
15153
|
this._removeServiceFromDictionary(serviceIdentifier);
|
|
15139
15154
|
};
|
|
15140
15155
|
Container.prototype.unbindAsync = function (serviceIdentifier) {
|
|
15141
|
-
return __awaiter$
|
|
15156
|
+
return __awaiter$d(this, void 0, void 0, function () {
|
|
15142
15157
|
var bindings;
|
|
15143
15158
|
return __generator(this, function (_a) {
|
|
15144
15159
|
switch (_a.label) {
|
|
@@ -15164,7 +15179,7 @@
|
|
|
15164
15179
|
this._bindingDictionary = new Lookup();
|
|
15165
15180
|
};
|
|
15166
15181
|
Container.prototype.unbindAllAsync = function () {
|
|
15167
|
-
return __awaiter$
|
|
15182
|
+
return __awaiter$d(this, void 0, void 0, function () {
|
|
15168
15183
|
var promises;
|
|
15169
15184
|
var _this = this;
|
|
15170
15185
|
return __generator(this, function (_a) {
|
|
@@ -15253,7 +15268,7 @@
|
|
|
15253
15268
|
return this._getButThrowIfAsync(getArgs);
|
|
15254
15269
|
};
|
|
15255
15270
|
Container.prototype.getAsync = function (serviceIdentifier) {
|
|
15256
|
-
return __awaiter$
|
|
15271
|
+
return __awaiter$d(this, void 0, void 0, function () {
|
|
15257
15272
|
var getArgs;
|
|
15258
15273
|
return __generator(this, function (_a) {
|
|
15259
15274
|
getArgs = this._getNotAllArgs(serviceIdentifier, false);
|
|
@@ -15266,7 +15281,7 @@
|
|
|
15266
15281
|
return this._getButThrowIfAsync(getArgs);
|
|
15267
15282
|
};
|
|
15268
15283
|
Container.prototype.getTaggedAsync = function (serviceIdentifier, key, value) {
|
|
15269
|
-
return __awaiter$
|
|
15284
|
+
return __awaiter$d(this, void 0, void 0, function () {
|
|
15270
15285
|
var getArgs;
|
|
15271
15286
|
return __generator(this, function (_a) {
|
|
15272
15287
|
getArgs = this._getNotAllArgs(serviceIdentifier, false, key, value);
|
|
@@ -15350,7 +15365,7 @@
|
|
|
15350
15365
|
}
|
|
15351
15366
|
};
|
|
15352
15367
|
Container.prototype._handleDeactivationError = function (asyncResult, constructor) {
|
|
15353
|
-
return __awaiter$
|
|
15368
|
+
return __awaiter$d(this, void 0, void 0, function () {
|
|
15354
15369
|
var ex_1;
|
|
15355
15370
|
return __generator(this, function (_a) {
|
|
15356
15371
|
switch (_a.label) {
|
|
@@ -15383,7 +15398,7 @@
|
|
|
15383
15398
|
}
|
|
15384
15399
|
};
|
|
15385
15400
|
Container.prototype._deactivateContainerAsync = function (instance, deactivationsIterator) {
|
|
15386
|
-
return __awaiter$
|
|
15401
|
+
return __awaiter$d(this, void 0, void 0, function () {
|
|
15387
15402
|
var deactivation;
|
|
15388
15403
|
return __generator(this, function (_a) {
|
|
15389
15404
|
switch (_a.label) {
|
|
@@ -15536,7 +15551,7 @@
|
|
|
15536
15551
|
}
|
|
15537
15552
|
};
|
|
15538
15553
|
Container.prototype._deactivateSingletonsAsync = function (bindings) {
|
|
15539
|
-
return __awaiter$
|
|
15554
|
+
return __awaiter$d(this, void 0, void 0, function () {
|
|
15540
15555
|
var _this = this;
|
|
15541
15556
|
return __generator(this, function (_a) {
|
|
15542
15557
|
switch (_a.label) {
|
|
@@ -15559,7 +15574,7 @@
|
|
|
15559
15574
|
}
|
|
15560
15575
|
};
|
|
15561
15576
|
Container.prototype._propagateContainerDeactivationThenBindingAndPreDestroyAsync = function (binding, instance, constructor) {
|
|
15562
|
-
return __awaiter$
|
|
15577
|
+
return __awaiter$d(this, void 0, void 0, function () {
|
|
15563
15578
|
return __generator(this, function (_a) {
|
|
15564
15579
|
switch (_a.label) {
|
|
15565
15580
|
case 0:
|
|
@@ -15599,7 +15614,7 @@
|
|
|
15599
15614
|
return this._preDestroy(constructor, instance);
|
|
15600
15615
|
};
|
|
15601
15616
|
Container.prototype._bindingDeactivationAndPreDestroyAsync = function (binding, instance, constructor) {
|
|
15602
|
-
return __awaiter$
|
|
15617
|
+
return __awaiter$d(this, void 0, void 0, function () {
|
|
15603
15618
|
return __generator(this, function (_a) {
|
|
15604
15619
|
switch (_a.label) {
|
|
15605
15620
|
case 0:
|
|
@@ -18164,7 +18179,7 @@
|
|
|
18164
18179
|
}
|
|
18165
18180
|
Generator.auto_increment_id = 0;
|
|
18166
18181
|
|
|
18167
|
-
var __awaiter$
|
|
18182
|
+
var __awaiter$c = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
18168
18183
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
18169
18184
|
function fulfilled(value) {
|
|
18170
18185
|
try {
|
|
@@ -18234,7 +18249,7 @@
|
|
|
18234
18249
|
}
|
|
18235
18250
|
forEachChildrenAsync(cb) {
|
|
18236
18251
|
let reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
18237
|
-
return __awaiter$
|
|
18252
|
+
return __awaiter$c(this, void 0, void 0, function* () {
|
|
18238
18253
|
if (reverse) {
|
|
18239
18254
|
let child = this._lastChild,
|
|
18240
18255
|
i = 0;
|
|
@@ -18764,13 +18779,14 @@
|
|
|
18764
18779
|
e.propagationStopped = !1, e.propagationImmediatelyStopped = !1, this.propagate(e, type), this.dispatch.emit(type || e.type, e);
|
|
18765
18780
|
}
|
|
18766
18781
|
mapEvent(e) {
|
|
18767
|
-
var _a;
|
|
18782
|
+
var _a, _b, _c, _d, _e;
|
|
18768
18783
|
if (!this.rootTarget) return;
|
|
18769
18784
|
const mappers = this.mappingTable[e.type];
|
|
18770
18785
|
let target;
|
|
18771
18786
|
const cacheKey = `${e.canvasX}-${e.canvasY}`;
|
|
18772
|
-
if ((null === (_a = this._prePointTargetCache) || void 0 === _a ? void 0 : _a[cacheKey]) ? target = this._prePointTargetCache[cacheKey] : (target = this.pickTarget(e.canvasX, e.canvasY), this._prePointTargetCache = {
|
|
18773
|
-
[cacheKey]: target
|
|
18787
|
+
if ((null === (_a = this._prePointTargetCache) || void 0 === _a ? void 0 : _a[cacheKey]) && (null === (_c = null === (_b = this._prePointTargetCache) || void 0 === _b ? void 0 : _b[cacheKey]) || void 0 === _c ? void 0 : _c.stage.renderCount) === (null === (_d = this._prePointTargetCache) || void 0 === _d ? void 0 : _d.stageRenderCount) ? target = this._prePointTargetCache[cacheKey] : (target = this.pickTarget(e.canvasX, e.canvasY), this._prePointTargetCache = {
|
|
18788
|
+
[cacheKey]: target,
|
|
18789
|
+
stageRenderCount: null !== (_e = null == target ? void 0 : target.stage.renderCount) && void 0 !== _e ? _e : -1
|
|
18774
18790
|
}), mappers) for (let i = 0, j = mappers.length; i < j; i++) mappers[i].fn(e, target);else console.warn(`[EventManager]: Event mapping not defined for ${e.type}`);
|
|
18775
18791
|
}
|
|
18776
18792
|
propagate(e, type) {
|
|
@@ -18847,13 +18863,12 @@
|
|
|
18847
18863
|
}
|
|
18848
18864
|
notifyListeners(e, type) {
|
|
18849
18865
|
const listeners = e.currentTarget._events[type];
|
|
18850
|
-
if (listeners) {
|
|
18851
|
-
|
|
18852
|
-
|
|
18853
|
-
|
|
18854
|
-
|
|
18855
|
-
|
|
18856
|
-
} else this.emitDelegation(e, type);
|
|
18866
|
+
if (listeners) if ("fn" in listeners) listeners.once && e.currentTarget.removeEventListener(type, listeners.fn, {
|
|
18867
|
+
once: !0
|
|
18868
|
+
}), listeners.fn.call(listeners.context, e);else for (let i = 0, j = listeners.length; i < j && !e.propagationImmediatelyStopped; i++) listeners[i].once && e.currentTarget.removeEventListener(type, listeners[i].fn, {
|
|
18869
|
+
once: !0
|
|
18870
|
+
}), listeners[i].fn.call(listeners[i].context, e);
|
|
18871
|
+
this.emitDelegation(e, type);
|
|
18857
18872
|
}
|
|
18858
18873
|
emitDelegation(e, type) {
|
|
18859
18874
|
const listeners = e.currentTarget._events[WILDCARD];
|
|
@@ -22270,7 +22285,7 @@
|
|
|
22270
22285
|
}
|
|
22271
22286
|
Graphic.mixin(EventTarget);
|
|
22272
22287
|
|
|
22273
|
-
var __awaiter$
|
|
22288
|
+
var __awaiter$b = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
22274
22289
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
22275
22290
|
function fulfilled(value) {
|
|
22276
22291
|
try {
|
|
@@ -22296,7 +22311,7 @@
|
|
|
22296
22311
|
});
|
|
22297
22312
|
};
|
|
22298
22313
|
function waitForAllSubLayers(stage) {
|
|
22299
|
-
return __awaiter$
|
|
22314
|
+
return __awaiter$b(this, void 0, void 0, function* () {
|
|
22300
22315
|
const promiseList = [],
|
|
22301
22316
|
layers = stage.getChildren();
|
|
22302
22317
|
yield new Promise(resolve => {
|
|
@@ -23217,6 +23232,16 @@
|
|
|
23217
23232
|
cap = arcAttribute.cap,
|
|
23218
23233
|
forceShowCap = arcAttribute.forceShowCap
|
|
23219
23234
|
} = arc.attribute;
|
|
23235
|
+
let conicalOffset = 0;
|
|
23236
|
+
const tempChangeConicalColor = (isBoolean(cap) && cap || cap[0]) && "conical" === fill.gradient;
|
|
23237
|
+
if (tempChangeConicalColor) {
|
|
23238
|
+
const {
|
|
23239
|
+
sc: sc,
|
|
23240
|
+
startAngle: startAngle,
|
|
23241
|
+
endAngle: endAngle
|
|
23242
|
+
} = arc.getParsedAngle();
|
|
23243
|
+
abs$1(endAngle - startAngle) < pi2 - epsilon$1 && (conicalOffset = sc || 0, fill.startAngle -= conicalOffset, fill.endAngle -= conicalOffset);
|
|
23244
|
+
}
|
|
23220
23245
|
let beforeRenderContribitionsRuned = !1;
|
|
23221
23246
|
const {
|
|
23222
23247
|
isFullStroke: isFullStroke,
|
|
@@ -23251,7 +23276,7 @@
|
|
|
23251
23276
|
}
|
|
23252
23277
|
strokeCb ? strokeCb(context, arc.attribute, arcAttribute) : sVisible && (context.setStrokeStyle(arc, arc.attribute, x, y, arcAttribute), context.stroke());
|
|
23253
23278
|
}
|
|
23254
|
-
if (cap && forceShowCap) {
|
|
23279
|
+
if ((isBoolean(cap) && cap || cap[1]) && forceShowCap) {
|
|
23255
23280
|
const {
|
|
23256
23281
|
startAngle: sa,
|
|
23257
23282
|
endAngle: ea
|
|
@@ -23288,7 +23313,7 @@
|
|
|
23288
23313
|
}
|
|
23289
23314
|
this._arcAfterRenderContribitions.forEach(c => {
|
|
23290
23315
|
c.drawShape(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, drawContext, fillCb, strokeCb);
|
|
23291
|
-
});
|
|
23316
|
+
}), tempChangeConicalColor && (fill.startAngle += conicalOffset, fill.endAngle += conicalOffset);
|
|
23292
23317
|
}
|
|
23293
23318
|
draw(arc, renderService, drawContext, params) {
|
|
23294
23319
|
const {
|
|
@@ -25458,7 +25483,9 @@
|
|
|
25458
25483
|
capAngle = capWidth / outerRadius;
|
|
25459
25484
|
if (capWidth > epsilon$1 && outerRadius > epsilon$1) return {
|
|
25460
25485
|
startAngle: startAngle - sign * capAngle * startCap,
|
|
25461
|
-
endAngle: endAngle + sign * capAngle * endCap
|
|
25486
|
+
endAngle: endAngle + sign * capAngle * endCap,
|
|
25487
|
+
sc: sign * capAngle * startCap,
|
|
25488
|
+
ec: sign * capAngle * endCap
|
|
25462
25489
|
};
|
|
25463
25490
|
}
|
|
25464
25491
|
return {
|
|
@@ -28396,15 +28423,26 @@
|
|
|
28396
28423
|
}
|
|
28397
28424
|
drawShape(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, drawContext, fillCb, strokeCb) {
|
|
28398
28425
|
const {
|
|
28399
|
-
|
|
28400
|
-
|
|
28401
|
-
|
|
28402
|
-
|
|
28403
|
-
|
|
28404
|
-
|
|
28405
|
-
|
|
28406
|
-
|
|
28407
|
-
|
|
28426
|
+
outerBorder: outerBorder,
|
|
28427
|
+
innerBorder: innerBorder
|
|
28428
|
+
} = arc.attribute,
|
|
28429
|
+
doOuterBorder = outerBorder && !1 !== outerBorder.visible,
|
|
28430
|
+
doInnerBorder = innerBorder && !1 !== innerBorder.visible;
|
|
28431
|
+
if (!doOuterBorder && !doInnerBorder) return;
|
|
28432
|
+
const {
|
|
28433
|
+
innerRadius = arcAttribute.innerRadius,
|
|
28434
|
+
outerRadius = arcAttribute.outerRadius,
|
|
28435
|
+
startAngle = arcAttribute.startAngle,
|
|
28436
|
+
endAngle = arcAttribute.endAngle,
|
|
28437
|
+
opacity = arcAttribute.opacity,
|
|
28438
|
+
x: originX = arcAttribute.x,
|
|
28439
|
+
y: originY = arcAttribute.y,
|
|
28440
|
+
scaleX = arcAttribute.scaleX,
|
|
28441
|
+
scaleY = arcAttribute.scaleY
|
|
28442
|
+
} = arc.attribute,
|
|
28443
|
+
doStrokeOuter = !(!outerBorder || !outerBorder.stroke),
|
|
28444
|
+
doStrokeInner = !(!innerBorder || !innerBorder.stroke);
|
|
28445
|
+
if (doOuterBorder) {
|
|
28408
28446
|
const {
|
|
28409
28447
|
distance = arcAttribute.outerBorder.distance
|
|
28410
28448
|
} = outerBorder,
|
|
@@ -28415,12 +28453,12 @@
|
|
|
28415
28453
|
innerRadius: innerRadius - d,
|
|
28416
28454
|
startAngle: startAngle - deltaAngle,
|
|
28417
28455
|
endAngle: endAngle + deltaAngle
|
|
28418
|
-
}), context.beginPath(), drawArcPath$1(arc, context, x, y, outerRadius + d, innerRadius - d), context.setShadowStyle && context.setShadowStyle(arc, arc.attribute, arcAttribute), strokeCb) strokeCb(context, outerBorder, arcAttribute.outerBorder);else if (
|
|
28456
|
+
}), context.beginPath(), drawArcPath$1(arc, context, x, y, outerRadius + d, innerRadius - d), context.setShadowStyle && context.setShadowStyle(arc, arc.attribute, arcAttribute), strokeCb) strokeCb(context, outerBorder, arcAttribute.outerBorder);else if (doStrokeOuter) {
|
|
28419
28457
|
const lastOpacity = arcAttribute.outerBorder.opacity;
|
|
28420
|
-
arcAttribute.outerBorder.opacity = opacity, context.setStrokeStyle(arc, outerBorder, x, y, arcAttribute.outerBorder), arcAttribute.outerBorder.opacity = lastOpacity, context.stroke();
|
|
28458
|
+
arcAttribute.outerBorder.opacity = opacity, context.setStrokeStyle(arc, outerBorder, (originX - x) / scaleX, (originY - y) / scaleY, arcAttribute.outerBorder), arcAttribute.outerBorder.opacity = lastOpacity, context.stroke();
|
|
28421
28459
|
}
|
|
28422
28460
|
}
|
|
28423
|
-
if (
|
|
28461
|
+
if (doInnerBorder) {
|
|
28424
28462
|
const {
|
|
28425
28463
|
distance = arcAttribute.innerBorder.distance
|
|
28426
28464
|
} = innerBorder,
|
|
@@ -28431,9 +28469,9 @@
|
|
|
28431
28469
|
innerRadius: innerRadius + d,
|
|
28432
28470
|
startAngle: startAngle + deltaAngle,
|
|
28433
28471
|
endAngle: endAngle - deltaAngle
|
|
28434
|
-
}), context.beginPath(), drawArcPath$1(arc, context, x, y, outerRadius - d, innerRadius + d), context.setShadowStyle && context.setShadowStyle(arc, arc.attribute, arcAttribute), strokeCb) strokeCb(context, innerBorder, arcAttribute.innerBorder);else if (
|
|
28472
|
+
}), context.beginPath(), drawArcPath$1(arc, context, x, y, outerRadius - d, innerRadius + d), context.setShadowStyle && context.setShadowStyle(arc, arc.attribute, arcAttribute), strokeCb) strokeCb(context, innerBorder, arcAttribute.innerBorder);else if (doStrokeInner) {
|
|
28435
28473
|
const lastOpacity = arcAttribute.innerBorder.opacity;
|
|
28436
|
-
arcAttribute.innerBorder.opacity = opacity, context.setStrokeStyle(arc, innerBorder, x, y, arcAttribute.innerBorder), arcAttribute.innerBorder.opacity = lastOpacity, context.stroke();
|
|
28474
|
+
arcAttribute.innerBorder.opacity = opacity, context.setStrokeStyle(arc, innerBorder, (originX - x) / scaleX, (originY - y) / scaleY, arcAttribute.innerBorder), arcAttribute.innerBorder.opacity = lastOpacity, context.stroke();
|
|
28437
28475
|
}
|
|
28438
28476
|
}
|
|
28439
28477
|
arc.setAttributes({
|
|
@@ -28471,31 +28509,42 @@
|
|
|
28471
28509
|
}
|
|
28472
28510
|
drawShape(circle, context, x, y, doFill, doStroke, fVisible, sVisible, circleAttribute, drawContext, fillCb, strokeCb) {
|
|
28473
28511
|
const {
|
|
28474
|
-
|
|
28475
|
-
|
|
28476
|
-
|
|
28477
|
-
|
|
28478
|
-
|
|
28479
|
-
|
|
28480
|
-
|
|
28481
|
-
|
|
28512
|
+
outerBorder: outerBorder,
|
|
28513
|
+
innerBorder: innerBorder
|
|
28514
|
+
} = circle.attribute,
|
|
28515
|
+
doOuterBorder = outerBorder && !1 !== outerBorder.visible,
|
|
28516
|
+
doInnerBorder = innerBorder && !1 !== innerBorder.visible;
|
|
28517
|
+
if (!doOuterBorder && !doInnerBorder) return;
|
|
28518
|
+
const {
|
|
28519
|
+
radius = circleAttribute.radius,
|
|
28520
|
+
startAngle = circleAttribute.startAngle,
|
|
28521
|
+
endAngle = circleAttribute.endAngle,
|
|
28522
|
+
opacity = circleAttribute.opacity,
|
|
28523
|
+
x: originX = circleAttribute.x,
|
|
28524
|
+
y: originY = circleAttribute.y,
|
|
28525
|
+
scaleX = circleAttribute.scaleX,
|
|
28526
|
+
scaleY = circleAttribute.scaleY
|
|
28527
|
+
} = circle.attribute,
|
|
28528
|
+
doStrokeOuter = !(!outerBorder || !outerBorder.stroke),
|
|
28529
|
+
doStrokeInner = !(!innerBorder || !innerBorder.stroke);
|
|
28530
|
+
if (doOuterBorder) {
|
|
28482
28531
|
const {
|
|
28483
28532
|
distance = circleAttribute.outerBorder.distance
|
|
28484
28533
|
} = outerBorder,
|
|
28485
28534
|
dw = getScaledStroke(context, distance, context.dpr);
|
|
28486
|
-
if (context.beginPath(), context.arc(x, y, radius + dw, startAngle, endAngle), context.closePath(), context.setShadowStyle && context.setShadowStyle(circle, circle.attribute, circleAttribute), strokeCb) strokeCb(context, outerBorder, circleAttribute.outerBorder);else if (
|
|
28535
|
+
if (context.beginPath(), context.arc(x, y, radius + dw, startAngle, endAngle), context.closePath(), context.setShadowStyle && context.setShadowStyle(circle, circle.attribute, circleAttribute), strokeCb) strokeCb(context, outerBorder, circleAttribute.outerBorder);else if (doStrokeOuter) {
|
|
28487
28536
|
const lastOpacity = circleAttribute.outerBorder.opacity;
|
|
28488
|
-
circleAttribute.outerBorder.opacity = opacity, context.setStrokeStyle(circle, outerBorder, x, y, circleAttribute.outerBorder), circleAttribute.outerBorder.opacity = lastOpacity, context.stroke();
|
|
28537
|
+
circleAttribute.outerBorder.opacity = opacity, context.setStrokeStyle(circle, outerBorder, (originX - x) / scaleX, (originY - y) / scaleY, circleAttribute.outerBorder), circleAttribute.outerBorder.opacity = lastOpacity, context.stroke();
|
|
28489
28538
|
}
|
|
28490
28539
|
}
|
|
28491
|
-
if (
|
|
28540
|
+
if (doInnerBorder) {
|
|
28492
28541
|
const {
|
|
28493
28542
|
distance = circleAttribute.innerBorder.distance
|
|
28494
28543
|
} = innerBorder,
|
|
28495
28544
|
dw = getScaledStroke(context, distance, context.dpr);
|
|
28496
|
-
if (context.beginPath(), context.arc(x, y, radius - dw, startAngle, endAngle), context.closePath(), context.setShadowStyle && context.setShadowStyle(circle, circle.attribute, circleAttribute), strokeCb) strokeCb(context, innerBorder, circleAttribute.innerBorder);else if (
|
|
28545
|
+
if (context.beginPath(), context.arc(x, y, radius - dw, startAngle, endAngle), context.closePath(), context.setShadowStyle && context.setShadowStyle(circle, circle.attribute, circleAttribute), strokeCb) strokeCb(context, innerBorder, circleAttribute.innerBorder);else if (doStrokeInner) {
|
|
28497
28546
|
const lastOpacity = circleAttribute.innerBorder.opacity;
|
|
28498
|
-
circleAttribute.innerBorder.opacity = opacity, context.setStrokeStyle(circle, innerBorder, x, y, circleAttribute.innerBorder), circleAttribute.innerBorder.opacity = lastOpacity, context.stroke();
|
|
28547
|
+
circleAttribute.innerBorder.opacity = opacity, context.setStrokeStyle(circle, innerBorder, (originX - x) / scaleX, (originY - y) / scaleY, circleAttribute.innerBorder), circleAttribute.innerBorder.opacity = lastOpacity, context.stroke();
|
|
28499
28548
|
}
|
|
28500
28549
|
}
|
|
28501
28550
|
}
|
|
@@ -28592,14 +28641,25 @@
|
|
|
28592
28641
|
}
|
|
28593
28642
|
drawShape(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb) {
|
|
28594
28643
|
const {
|
|
28595
|
-
|
|
28596
|
-
|
|
28597
|
-
|
|
28598
|
-
|
|
28599
|
-
|
|
28600
|
-
|
|
28601
|
-
|
|
28602
|
-
|
|
28644
|
+
outerBorder: outerBorder,
|
|
28645
|
+
innerBorder: innerBorder
|
|
28646
|
+
} = rect.attribute,
|
|
28647
|
+
doOuterBorder = outerBorder && !1 !== outerBorder.visible,
|
|
28648
|
+
doInnerBorder = innerBorder && !1 !== innerBorder.visible;
|
|
28649
|
+
if (!doOuterBorder && !doInnerBorder) return;
|
|
28650
|
+
const {
|
|
28651
|
+
width = rectAttribute.width,
|
|
28652
|
+
height = rectAttribute.height,
|
|
28653
|
+
cornerRadius = rectAttribute.cornerRadius,
|
|
28654
|
+
opacity = rectAttribute.opacity,
|
|
28655
|
+
x: originX = rectAttribute.x,
|
|
28656
|
+
y: originY = rectAttribute.y,
|
|
28657
|
+
scaleX = rectAttribute.scaleX,
|
|
28658
|
+
scaleY = rectAttribute.scaleY
|
|
28659
|
+
} = rect.attribute,
|
|
28660
|
+
doStrokeOuter = !(!outerBorder || !outerBorder.stroke),
|
|
28661
|
+
doStrokeInner = !(!innerBorder || !innerBorder.stroke);
|
|
28662
|
+
if (doOuterBorder) {
|
|
28603
28663
|
const {
|
|
28604
28664
|
distance = rectAttribute.outerBorder.distance
|
|
28605
28665
|
} = outerBorder,
|
|
@@ -28607,12 +28667,12 @@
|
|
|
28607
28667
|
nextX = x - d,
|
|
28608
28668
|
nextY = y - d,
|
|
28609
28669
|
dw = 2 * d;
|
|
28610
|
-
if (0 === cornerRadius || isArray$3(cornerRadius) && cornerRadius.every(num => 0 === num) ? (context.beginPath(), context.rect(nextX, nextY, width + dw, height + dw)) : (context.beginPath(), createRectPath(context, nextX, nextY, width + dw, height + dw, cornerRadius)), context.setShadowStyle && context.setShadowStyle(rect, rect.attribute, rectAttribute), strokeCb) strokeCb(context, outerBorder, rectAttribute.outerBorder);else if (
|
|
28670
|
+
if (0 === cornerRadius || isArray$3(cornerRadius) && cornerRadius.every(num => 0 === num) ? (context.beginPath(), context.rect(nextX, nextY, width + dw, height + dw)) : (context.beginPath(), createRectPath(context, nextX, nextY, width + dw, height + dw, cornerRadius)), context.setShadowStyle && context.setShadowStyle(rect, rect.attribute, rectAttribute), strokeCb) strokeCb(context, outerBorder, rectAttribute.outerBorder);else if (doStrokeOuter) {
|
|
28611
28671
|
const lastOpacity = rectAttribute.outerBorder.opacity;
|
|
28612
|
-
rectAttribute.outerBorder.opacity = opacity, context.setStrokeStyle(rect, outerBorder, x, y, rectAttribute.outerBorder), rectAttribute.outerBorder.opacity = lastOpacity, context.stroke();
|
|
28672
|
+
rectAttribute.outerBorder.opacity = opacity, context.setStrokeStyle(rect, outerBorder, (originX - x) / scaleX, (originY - y) / scaleY, rectAttribute.outerBorder), rectAttribute.outerBorder.opacity = lastOpacity, context.stroke();
|
|
28613
28673
|
}
|
|
28614
28674
|
}
|
|
28615
|
-
if (
|
|
28675
|
+
if (doInnerBorder) {
|
|
28616
28676
|
const {
|
|
28617
28677
|
distance = rectAttribute.innerBorder.distance
|
|
28618
28678
|
} = innerBorder,
|
|
@@ -28620,9 +28680,9 @@
|
|
|
28620
28680
|
nextX = x + d,
|
|
28621
28681
|
nextY = y + d,
|
|
28622
28682
|
dw = 2 * d;
|
|
28623
|
-
if (0 === cornerRadius || isArray$3(cornerRadius) && cornerRadius.every(num => 0 === num) ? (context.beginPath(), context.rect(nextX, nextY, width - dw, height - dw)) : (context.beginPath(), createRectPath(context, nextX, nextY, width - dw, height - dw, cornerRadius)), context.setShadowStyle && context.setShadowStyle(rect, rect.attribute, rectAttribute), strokeCb) strokeCb(context, innerBorder, rectAttribute.innerBorder);else if (
|
|
28683
|
+
if (0 === cornerRadius || isArray$3(cornerRadius) && cornerRadius.every(num => 0 === num) ? (context.beginPath(), context.rect(nextX, nextY, width - dw, height - dw)) : (context.beginPath(), createRectPath(context, nextX, nextY, width - dw, height - dw, cornerRadius)), context.setShadowStyle && context.setShadowStyle(rect, rect.attribute, rectAttribute), strokeCb) strokeCb(context, innerBorder, rectAttribute.innerBorder);else if (doStrokeInner) {
|
|
28624
28684
|
const lastOpacity = rectAttribute.innerBorder.opacity;
|
|
28625
|
-
rectAttribute.innerBorder.opacity = opacity, context.setStrokeStyle(rect, innerBorder, x, y, rectAttribute.innerBorder), rectAttribute.innerBorder.opacity = lastOpacity, context.stroke();
|
|
28685
|
+
rectAttribute.innerBorder.opacity = opacity, context.setStrokeStyle(rect, innerBorder, (originX - x) / scaleX, (originY - y) / scaleY, rectAttribute.innerBorder), rectAttribute.innerBorder.opacity = lastOpacity, context.stroke();
|
|
28626
28686
|
}
|
|
28627
28687
|
}
|
|
28628
28688
|
}
|
|
@@ -28685,33 +28745,43 @@
|
|
|
28685
28745
|
this.time = BaseRenderContributionTime.afterFillStroke, this.useStyle = !0, this.order = 0;
|
|
28686
28746
|
}
|
|
28687
28747
|
drawShape(symbol, context, x, y, doFill, doStroke, fVisible, sVisible, symbolAttribute, drawContext, fillCb, strokeCb) {
|
|
28748
|
+
const parsedPath = symbol.getParsedPath();
|
|
28749
|
+
if (!parsedPath) return;
|
|
28688
28750
|
const {
|
|
28689
|
-
size = symbolAttribute.size,
|
|
28690
|
-
opacity = symbolAttribute.opacity,
|
|
28691
28751
|
outerBorder: outerBorder,
|
|
28692
28752
|
innerBorder: innerBorder
|
|
28693
28753
|
} = symbol.attribute,
|
|
28694
|
-
|
|
28695
|
-
|
|
28696
|
-
|
|
28697
|
-
|
|
28698
|
-
|
|
28699
|
-
|
|
28700
|
-
|
|
28701
|
-
|
|
28702
|
-
|
|
28703
|
-
|
|
28704
|
-
|
|
28754
|
+
doOuterBorder = outerBorder && !1 !== outerBorder.visible,
|
|
28755
|
+
doInnerBorder = innerBorder && !1 !== innerBorder.visible;
|
|
28756
|
+
if (!doOuterBorder && !doInnerBorder) return;
|
|
28757
|
+
const {
|
|
28758
|
+
size = symbolAttribute.size,
|
|
28759
|
+
opacity = symbolAttribute.opacity,
|
|
28760
|
+
x: originX = symbolAttribute.x,
|
|
28761
|
+
y: originY = symbolAttribute.y,
|
|
28762
|
+
scaleX = symbolAttribute.scaleX,
|
|
28763
|
+
scaleY = symbolAttribute.scaleY
|
|
28764
|
+
} = symbol.attribute,
|
|
28765
|
+
doStrokeOuter = !(!outerBorder || !outerBorder.stroke),
|
|
28766
|
+
doStrokeInner = !(!innerBorder || !innerBorder.stroke);
|
|
28767
|
+
if (doOuterBorder) {
|
|
28768
|
+
const {
|
|
28769
|
+
distance = symbolAttribute.outerBorder.distance
|
|
28770
|
+
} = outerBorder,
|
|
28771
|
+
d = getScaledStroke(context, distance, context.dpr);
|
|
28772
|
+
if (context.beginPath(), !1 === parsedPath.drawOffset(context, size, x, y, d) && context.closePath(), context.setShadowStyle && context.setShadowStyle(symbol, symbol.attribute, symbolAttribute), strokeCb) strokeCb(context, outerBorder, symbolAttribute.outerBorder);else if (doStrokeOuter) {
|
|
28773
|
+
const lastOpacity = symbolAttribute.outerBorder.opacity;
|
|
28774
|
+
symbolAttribute.outerBorder.opacity = opacity, context.setStrokeStyle(symbol, outerBorder, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute.outerBorder), symbolAttribute.outerBorder.opacity = lastOpacity, context.stroke();
|
|
28705
28775
|
}
|
|
28706
|
-
|
|
28707
|
-
|
|
28708
|
-
|
|
28709
|
-
|
|
28710
|
-
|
|
28711
|
-
|
|
28712
|
-
|
|
28713
|
-
|
|
28714
|
-
|
|
28776
|
+
}
|
|
28777
|
+
if (doInnerBorder) {
|
|
28778
|
+
const {
|
|
28779
|
+
distance = symbolAttribute.innerBorder.distance
|
|
28780
|
+
} = innerBorder,
|
|
28781
|
+
d = getScaledStroke(context, distance, context.dpr);
|
|
28782
|
+
if (context.beginPath(), !1 === parsedPath.drawOffset(context, size, x, y, -d) && context.closePath(), context.setShadowStyle && context.setShadowStyle(symbol, symbol.attribute, symbolAttribute), strokeCb) strokeCb(context, innerBorder, symbolAttribute.innerBorder);else if (doStrokeInner) {
|
|
28783
|
+
const lastOpacity = symbolAttribute.innerBorder.opacity;
|
|
28784
|
+
symbolAttribute.innerBorder.opacity = opacity, context.setStrokeStyle(symbol, innerBorder, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute.innerBorder), symbolAttribute.innerBorder.opacity = lastOpacity, context.stroke();
|
|
28715
28785
|
}
|
|
28716
28786
|
}
|
|
28717
28787
|
}
|
|
@@ -28779,7 +28849,7 @@
|
|
|
28779
28849
|
bind(DefaultRenderService).toSelf(), bind(RenderService).toService(DefaultRenderService);
|
|
28780
28850
|
});
|
|
28781
28851
|
|
|
28782
|
-
var __awaiter$
|
|
28852
|
+
var __awaiter$a = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
28783
28853
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28784
28854
|
function fulfilled(value) {
|
|
28785
28855
|
try {
|
|
@@ -28844,7 +28914,7 @@
|
|
|
28844
28914
|
}
|
|
28845
28915
|
function foreachAsync(graphic, defaultZIndex, cb) {
|
|
28846
28916
|
let reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
28847
|
-
return __awaiter$
|
|
28917
|
+
return __awaiter$a(this, void 0, void 0, function* () {
|
|
28848
28918
|
yield graphic.forEachChildrenAsync(cb, reverse);
|
|
28849
28919
|
});
|
|
28850
28920
|
}
|
|
@@ -30936,7 +31006,7 @@
|
|
|
30936
31006
|
__metadata$F = undefined && undefined.__metadata || function (k, v) {
|
|
30937
31007
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
30938
31008
|
},
|
|
30939
|
-
__awaiter$
|
|
31009
|
+
__awaiter$9 = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
30940
31010
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
30941
31011
|
function fulfilled(value) {
|
|
30942
31012
|
try {
|
|
@@ -30962,7 +31032,7 @@
|
|
|
30962
31032
|
});
|
|
30963
31033
|
};
|
|
30964
31034
|
function makeUpCanvas(domref, canvasIdLists, canvasMap, freeCanvasIdx, freeCanvasList) {
|
|
30965
|
-
return __awaiter$
|
|
31035
|
+
return __awaiter$9(this, void 0, void 0, function* () {
|
|
30966
31036
|
const dpr = wx.getSystemInfoSync().pixelRatio;
|
|
30967
31037
|
for (let i = 0; i < canvasIdLists.length; i++) {
|
|
30968
31038
|
const id = canvasIdLists[i];
|
|
@@ -33315,7 +33385,7 @@
|
|
|
33315
33385
|
decorator(target, key, paramIndex);
|
|
33316
33386
|
};
|
|
33317
33387
|
},
|
|
33318
|
-
__awaiter$
|
|
33388
|
+
__awaiter$8 = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
33319
33389
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
33320
33390
|
function fulfilled(value) {
|
|
33321
33391
|
try {
|
|
@@ -33353,7 +33423,7 @@
|
|
|
33353
33423
|
super.init(), this.defaultRenderMap.set(this.lineRender.numberType, this.lineRender), this.defaultRenderMap.set(this.areaRender.numberType, this.areaRender);
|
|
33354
33424
|
}
|
|
33355
33425
|
draw(renderService, drawContext) {
|
|
33356
|
-
return __awaiter$
|
|
33426
|
+
return __awaiter$8(this, void 0, void 0, function* () {
|
|
33357
33427
|
if (this.checkingForDrawPromise) return;
|
|
33358
33428
|
this.lastRenderService = renderService, this.lastDrawContext = drawContext, this.checkingForDrawPromise = this.checkForDraw(drawContext);
|
|
33359
33429
|
const skipDraw = yield this.checkingForDrawPromise;
|
|
@@ -33375,15 +33445,15 @@
|
|
|
33375
33445
|
});
|
|
33376
33446
|
}
|
|
33377
33447
|
_increaseRender(group, drawContext) {
|
|
33378
|
-
return __awaiter$
|
|
33448
|
+
return __awaiter$8(this, void 0, void 0, function* () {
|
|
33379
33449
|
this.rendering = !0, yield this._renderIncrementalGroup(group, drawContext);
|
|
33380
33450
|
});
|
|
33381
33451
|
}
|
|
33382
33452
|
_renderIncrementalGroup(group, drawContext) {
|
|
33383
|
-
return __awaiter$
|
|
33453
|
+
return __awaiter$8(this, void 0, void 0, function* () {
|
|
33384
33454
|
this.count = group.count, yield new Promise(resolve => {
|
|
33385
33455
|
this.renderItem(group, drawContext, {
|
|
33386
|
-
drawingCb: () => __awaiter$
|
|
33456
|
+
drawingCb: () => __awaiter$8(this, void 0, void 0, function* () {
|
|
33387
33457
|
if (2 !== group.count) yield foreachAsync(group, DefaultAttribute.zIndex, (item, i) => {
|
|
33388
33458
|
if (this.status === STATUS.STOP) return !0;
|
|
33389
33459
|
if (item.isContainer) return !1;
|
|
@@ -33404,7 +33474,7 @@
|
|
|
33404
33474
|
});
|
|
33405
33475
|
}
|
|
33406
33476
|
waitToNextFrame() {
|
|
33407
|
-
return __awaiter$
|
|
33477
|
+
return __awaiter$8(this, void 0, void 0, function* () {
|
|
33408
33478
|
return new Promise(resolve => {
|
|
33409
33479
|
this.global.getRequestAnimationFrame()(() => {
|
|
33410
33480
|
resolve(!1);
|
|
@@ -33413,13 +33483,13 @@
|
|
|
33413
33483
|
});
|
|
33414
33484
|
}
|
|
33415
33485
|
checkForDraw(drawContext) {
|
|
33416
|
-
return __awaiter$
|
|
33486
|
+
return __awaiter$8(this, void 0, void 0, function* () {
|
|
33417
33487
|
let skip = this.rendering;
|
|
33418
33488
|
return drawContext.restartIncremental && (skip = !1, yield this.forceStop(), this.resetToInit()), skip;
|
|
33419
33489
|
});
|
|
33420
33490
|
}
|
|
33421
33491
|
forceStop() {
|
|
33422
|
-
return __awaiter$
|
|
33492
|
+
return __awaiter$8(this, void 0, void 0, function* () {
|
|
33423
33493
|
this.rendering && (this.status = STATUS.STOP, yield new Promise(resolve => {
|
|
33424
33494
|
this.hooks.completeDraw.tap("stopCb", () => {
|
|
33425
33495
|
this.status = STATUS.NORMAL, this.hooks.completeDraw.taps = this.hooks.completeDraw.taps.filter(item => "stopCb" !== item.name), resolve(!1);
|
|
@@ -33431,11 +33501,11 @@
|
|
|
33431
33501
|
this.currFrameStartAt = 0, this.currentIdx = 0;
|
|
33432
33502
|
}
|
|
33433
33503
|
renderGroup(group, drawContext) {
|
|
33434
|
-
return __awaiter$
|
|
33504
|
+
return __awaiter$8(this, void 0, void 0, function* () {
|
|
33435
33505
|
if (!drawContext.break && !1 !== group.attribute.visibleAll) return group.incremental && drawContext.startAtId === group._uid ? (yield this._increaseRender(group, drawContext), void (drawContext.break = !0)) : void (yield new Promise(resolve => {
|
|
33436
33506
|
this.renderItem(group, drawContext, {
|
|
33437
|
-
drawingCb: () => __awaiter$
|
|
33438
|
-
yield foreachAsync(group, DefaultAttribute.zIndex, item => __awaiter$
|
|
33507
|
+
drawingCb: () => __awaiter$8(this, void 0, void 0, function* () {
|
|
33508
|
+
yield foreachAsync(group, DefaultAttribute.zIndex, item => __awaiter$8(this, void 0, void 0, function* () {
|
|
33439
33509
|
drawContext.break || item.isContainer && (yield this.renderGroup(item, drawContext));
|
|
33440
33510
|
})), resolve(!1);
|
|
33441
33511
|
})
|
|
@@ -36105,7 +36175,7 @@
|
|
|
36105
36175
|
}
|
|
36106
36176
|
};
|
|
36107
36177
|
|
|
36108
|
-
const fontSize$
|
|
36178
|
+
const fontSize$7 = THEME_CONSTANTS.LABEL_FONT_SIZE;
|
|
36109
36179
|
const funnel$1 = {
|
|
36110
36180
|
transform: {
|
|
36111
36181
|
style: {
|
|
@@ -36114,7 +36184,7 @@
|
|
|
36114
36184
|
},
|
|
36115
36185
|
label: {
|
|
36116
36186
|
style: {
|
|
36117
|
-
fontSize: fontSize$
|
|
36187
|
+
fontSize: fontSize$7,
|
|
36118
36188
|
fill: 'white',
|
|
36119
36189
|
textBaseline: 'middle',
|
|
36120
36190
|
lineWidth: 2
|
|
@@ -36122,7 +36192,7 @@
|
|
|
36122
36192
|
},
|
|
36123
36193
|
outerLabel: {
|
|
36124
36194
|
style: {
|
|
36125
|
-
fontSize: fontSize$
|
|
36195
|
+
fontSize: fontSize$7,
|
|
36126
36196
|
fill: '#707070'
|
|
36127
36197
|
},
|
|
36128
36198
|
line: {
|
|
@@ -36133,14 +36203,14 @@
|
|
|
36133
36203
|
},
|
|
36134
36204
|
transformLabel: {
|
|
36135
36205
|
style: {
|
|
36136
|
-
fontSize: fontSize$
|
|
36206
|
+
fontSize: fontSize$7,
|
|
36137
36207
|
fill: '#707070',
|
|
36138
36208
|
textBaseline: 'middle'
|
|
36139
36209
|
}
|
|
36140
36210
|
}
|
|
36141
36211
|
};
|
|
36142
36212
|
|
|
36143
|
-
const fontSize$
|
|
36213
|
+
const fontSize$6 = THEME_CONSTANTS.LABEL_FONT_SIZE;
|
|
36144
36214
|
const funnel3d = {
|
|
36145
36215
|
transform3d: {
|
|
36146
36216
|
style: {
|
|
@@ -36149,7 +36219,7 @@
|
|
|
36149
36219
|
},
|
|
36150
36220
|
label: {
|
|
36151
36221
|
style: {
|
|
36152
|
-
fontSize: fontSize$
|
|
36222
|
+
fontSize: fontSize$6,
|
|
36153
36223
|
fill: 'white',
|
|
36154
36224
|
textBaseline: 'middle',
|
|
36155
36225
|
lineWidth: 2
|
|
@@ -36157,7 +36227,7 @@
|
|
|
36157
36227
|
},
|
|
36158
36228
|
outerLabel: {
|
|
36159
36229
|
style: {
|
|
36160
|
-
fontSize: fontSize$
|
|
36230
|
+
fontSize: fontSize$6,
|
|
36161
36231
|
fill: '#707070'
|
|
36162
36232
|
},
|
|
36163
36233
|
line: {
|
|
@@ -36168,7 +36238,7 @@
|
|
|
36168
36238
|
},
|
|
36169
36239
|
transformLabel: {
|
|
36170
36240
|
style: {
|
|
36171
|
-
fontSize: fontSize$
|
|
36241
|
+
fontSize: fontSize$6,
|
|
36172
36242
|
fill: '#707070',
|
|
36173
36243
|
textBaseline: 'middle'
|
|
36174
36244
|
}
|
|
@@ -36350,7 +36420,7 @@
|
|
|
36350
36420
|
}
|
|
36351
36421
|
};
|
|
36352
36422
|
|
|
36353
|
-
const fontSize$
|
|
36423
|
+
const fontSize$5 = THEME_CONSTANTS.LABEL_FONT_SIZE;
|
|
36354
36424
|
const waterfall$1 = {
|
|
36355
36425
|
seriesFieldName: {
|
|
36356
36426
|
total: 'total',
|
|
@@ -36369,7 +36439,7 @@
|
|
|
36369
36439
|
position: 'withChange',
|
|
36370
36440
|
style: {
|
|
36371
36441
|
fill: 'black',
|
|
36372
|
-
fontSize: fontSize$
|
|
36442
|
+
fontSize: fontSize$5
|
|
36373
36443
|
}
|
|
36374
36444
|
},
|
|
36375
36445
|
label: {
|
|
@@ -36377,7 +36447,7 @@
|
|
|
36377
36447
|
offset: 12,
|
|
36378
36448
|
position: 'inside',
|
|
36379
36449
|
style: {
|
|
36380
|
-
fontSize: fontSize$
|
|
36450
|
+
fontSize: fontSize$5
|
|
36381
36451
|
}
|
|
36382
36452
|
}
|
|
36383
36453
|
};
|
|
@@ -36402,7 +36472,7 @@
|
|
|
36402
36472
|
}
|
|
36403
36473
|
};
|
|
36404
36474
|
|
|
36405
|
-
const fontSize$
|
|
36475
|
+
const fontSize$4 = THEME_CONSTANTS.LABEL_FONT_SIZE;
|
|
36406
36476
|
const treemap$1 = {
|
|
36407
36477
|
gapWidth: 1,
|
|
36408
36478
|
nodePadding: [5],
|
|
@@ -36414,19 +36484,19 @@
|
|
|
36414
36484
|
},
|
|
36415
36485
|
label: {
|
|
36416
36486
|
style: {
|
|
36417
|
-
fontSize: fontSize$
|
|
36487
|
+
fontSize: fontSize$4,
|
|
36418
36488
|
fill: 'white',
|
|
36419
36489
|
textBaseline: 'middle',
|
|
36420
36490
|
textAlign: 'center'
|
|
36421
36491
|
}
|
|
36422
36492
|
},
|
|
36423
36493
|
nonLeafLabel: {
|
|
36424
|
-
padding: fontSize$
|
|
36494
|
+
padding: fontSize$4 * 2,
|
|
36425
36495
|
style: {
|
|
36426
36496
|
fill: 'black',
|
|
36427
36497
|
stroke: 'white',
|
|
36428
36498
|
lineWidth: 2,
|
|
36429
|
-
fontSize: fontSize$
|
|
36499
|
+
fontSize: fontSize$4,
|
|
36430
36500
|
textBaseline: 'middle',
|
|
36431
36501
|
textAlign: 'center'
|
|
36432
36502
|
}
|
|
@@ -36947,6 +37017,7 @@
|
|
|
36947
37017
|
const DefaultMorph = !0;
|
|
36948
37018
|
const DefaultMorphAll = !1;
|
|
36949
37019
|
const DefaultSplitPath = null;
|
|
37020
|
+
const DefaultEnableExitAnimation = !0;
|
|
36950
37021
|
const ImmediateAnimationState = "VGRAMMAR_IMMEDIATE_ANIMATION";
|
|
36951
37022
|
const DefaultAnimationStartTime = 0;
|
|
36952
37023
|
const DefaultAnimationDuration = 1e3;
|
|
@@ -38005,11 +38076,12 @@
|
|
|
38005
38076
|
class Element {
|
|
38006
38077
|
constructor(mark) {
|
|
38007
38078
|
this.data = null, this.states = [], this.diffState = DiffState.enter, this.isReserved = !1, this.runtimeStatesEncoder = null, this.items = [], this.getStateAttrs = (stateName, nextStates) => {
|
|
38008
|
-
var _a, _b, _c
|
|
38009
|
-
const
|
|
38079
|
+
var _a, _b, _c;
|
|
38080
|
+
const isRuntimeState = !isNil(null === (_a = this.runtimeStatesEncoder) || void 0 === _a ? void 0 : _a[stateName]),
|
|
38081
|
+
encoder = isRuntimeState ? this.runtimeStatesEncoder[stateName] : null === (_b = this.mark.getSpec().encode) || void 0 === _b ? void 0 : _b[stateName];
|
|
38010
38082
|
if (!encoder) return {};
|
|
38011
38083
|
if (isFunction(encoder)) return encoder(this.getDatum(), this, stateName, nextStates);
|
|
38012
|
-
if (null === (
|
|
38084
|
+
if (!isRuntimeState && (null === (_c = this.graphicItem.states) || void 0 === _c ? void 0 : _c[stateName])) return this.graphicItem.states[stateName];
|
|
38013
38085
|
const stateItems = this.items.map(item => Object.assign({}, item, {
|
|
38014
38086
|
nextAttrs: {}
|
|
38015
38087
|
}));
|
|
@@ -38110,7 +38182,7 @@
|
|
|
38110
38182
|
clearStates(hasAnimation) {
|
|
38111
38183
|
var _a;
|
|
38112
38184
|
const stateAnimation = isBoolean(hasAnimation) ? hasAnimation : !!(null === (_a = this.mark.getSpec().animation) || void 0 === _a ? void 0 : _a.state);
|
|
38113
|
-
this.states = [], this.graphicItem && this.graphicItem.clearStates(stateAnimation);
|
|
38185
|
+
this.states = [], this.graphicItem && this.graphicItem.clearStates(stateAnimation), this.runtimeStatesEncoder && (this.runtimeStatesEncoder = {});
|
|
38114
38186
|
}
|
|
38115
38187
|
_updateRuntimeStates(state, attrs) {
|
|
38116
38188
|
this.runtimeStatesEncoder || (this.runtimeStatesEncoder = {}), this.runtimeStatesEncoder[state] = attrs;
|
|
@@ -38119,13 +38191,17 @@
|
|
|
38119
38191
|
return this.states && this.states.includes(state);
|
|
38120
38192
|
}
|
|
38121
38193
|
addState(state, attrs) {
|
|
38122
|
-
|
|
38123
|
-
nextStates
|
|
38194
|
+
var _a;
|
|
38195
|
+
const nextStates = array(state).reduce((nextStates, state) => (nextStates.includes(state) || nextStates.push(state), nextStates), this.states.slice()),
|
|
38196
|
+
isRuntimeStateUpdate = attrs && isString(state) && !isEqual$1(attrs, null === (_a = this.runtimeStatesEncoder) || void 0 === _a ? void 0 : _a[state]);
|
|
38197
|
+
isRuntimeStateUpdate && this._updateRuntimeStates(state, attrs), nextStates.length !== this.states.length ? this.useStates(nextStates) : isRuntimeStateUpdate && this.graphicItem && (this.graphicItem.clearStates(), this.useStates(nextStates));
|
|
38124
38198
|
}
|
|
38125
38199
|
removeState(state) {
|
|
38126
38200
|
const states = array(state),
|
|
38127
38201
|
nextStates = this.states.filter(state => !states.includes(state));
|
|
38128
|
-
nextStates.length !== this.states.length && this.
|
|
38202
|
+
nextStates.length !== this.states.length && (this.runtimeStatesEncoder && states.forEach(state => {
|
|
38203
|
+
this.runtimeStatesEncoder[state] = null;
|
|
38204
|
+
}), this.useStates(nextStates));
|
|
38129
38205
|
}
|
|
38130
38206
|
useStates(states, hasAnimation) {
|
|
38131
38207
|
var _a, _b;
|
|
@@ -40421,7 +40497,7 @@
|
|
|
40421
40497
|
return res[key] = parseOptionValue(option, params), res;
|
|
40422
40498
|
}, {}) : options.map(option => parseOptionValue(option, params)) : options;
|
|
40423
40499
|
|
|
40424
|
-
var __awaiter$
|
|
40500
|
+
var __awaiter$7 = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
40425
40501
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
40426
40502
|
function fulfilled(value) {
|
|
40427
40503
|
try {
|
|
@@ -40485,7 +40561,7 @@
|
|
|
40485
40561
|
return super.emit(event, ...args);
|
|
40486
40562
|
}
|
|
40487
40563
|
evaluateTransform(transforms, upstream, parameters) {
|
|
40488
|
-
return __awaiter$
|
|
40564
|
+
return __awaiter$7(this, void 0, void 0, function* () {
|
|
40489
40565
|
if (!transforms || !transforms.length) return upstream;
|
|
40490
40566
|
let currentUpstreamData = upstream,
|
|
40491
40567
|
i = 0;
|
|
@@ -40674,12 +40750,13 @@
|
|
|
40674
40750
|
class GlyphElement extends Element {
|
|
40675
40751
|
constructor(mark) {
|
|
40676
40752
|
super(mark), this.getStateAttrs = (stateName, nextStates) => {
|
|
40677
|
-
var _a, _b, _c
|
|
40678
|
-
const
|
|
40753
|
+
var _a, _b, _c;
|
|
40754
|
+
const isRuntimeState = !isNil(null === (_a = this.runtimeStatesEncoder) || void 0 === _a ? void 0 : _a[stateName]),
|
|
40755
|
+
encoder = isRuntimeState ? this.runtimeStatesEncoder[stateName] : null === (_b = this.mark.getSpec().encode) || void 0 === _b ? void 0 : _b[stateName],
|
|
40679
40756
|
glyphStateAttributes = {};
|
|
40680
40757
|
if (!encoder) return glyphStateAttributes;
|
|
40681
40758
|
if (isFunction(encoder)) return glyphStateAttributes.attributes = encoder(this.getDatum(), this, stateName, nextStates), glyphStateAttributes;
|
|
40682
|
-
if (null === (
|
|
40759
|
+
if (!isRuntimeState && (null === (_c = this.graphicItem.glyphStates) || void 0 === _c ? void 0 : _c[stateName])) return this.graphicItem.glyphStates[stateName];
|
|
40683
40760
|
if (encoder) {
|
|
40684
40761
|
const item = this.items[0],
|
|
40685
40762
|
targetItems = [Object.assign({}, item, {
|
|
@@ -40954,7 +41031,7 @@
|
|
|
40954
41031
|
return event.element = item, event.vGrammarType = type, event;
|
|
40955
41032
|
}
|
|
40956
41033
|
|
|
40957
|
-
var __awaiter$
|
|
41034
|
+
var __awaiter$6 = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
40958
41035
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
40959
41036
|
function fulfilled(value) {
|
|
40960
41037
|
try {
|
|
@@ -41054,7 +41131,7 @@
|
|
|
41054
41131
|
}
|
|
41055
41132
|
evaluate(data, parameters) {
|
|
41056
41133
|
var _a;
|
|
41057
|
-
return __awaiter$
|
|
41134
|
+
return __awaiter$6(this, void 0, void 0, function* () {
|
|
41058
41135
|
return this.evaluateMainTasks(data, parameters), (null === (_a = this.renderContext) || void 0 === _a ? void 0 : _a.progressive) || (yield this.evaluateTransform(this._getTransformsAfterEncode(), this.elements, parameters)), this;
|
|
41059
41136
|
});
|
|
41060
41137
|
}
|
|
@@ -42101,10 +42178,10 @@
|
|
|
42101
42178
|
lineWidth = null !== (_e = backgroundStyle.lineWidth) && void 0 !== _e ? _e : 1,
|
|
42102
42179
|
range = this.stage ? [this.stage.width, this.stage.height] : void 0,
|
|
42103
42180
|
layout = "auto" === position;
|
|
42104
|
-
let
|
|
42105
|
-
|
|
42181
|
+
let maxBBoxI,
|
|
42182
|
+
maxBBoxSize = -1 / 0;
|
|
42106
42183
|
for (let i = 0; i < this.positionList.length + 1; i++) {
|
|
42107
|
-
const p = layout ? this.positionList[i === this.positionList.length ?
|
|
42184
|
+
const p = layout ? this.positionList[i === this.positionList.length ? maxBBoxI : i] : position,
|
|
42108
42185
|
{
|
|
42109
42186
|
angle: angle,
|
|
42110
42187
|
offset: offset,
|
|
@@ -42148,7 +42225,7 @@
|
|
|
42148
42225
|
{
|
|
42149
42226
|
const bbox = getRectIntersect(b, stageBounds, !1),
|
|
42150
42227
|
size = (bbox.x2 - bbox.x1) * (bbox.y2 - bbox.y1);
|
|
42151
|
-
size
|
|
42228
|
+
size > maxBBoxSize && (maxBBoxSize = size, maxBBoxI = i);
|
|
42152
42229
|
}
|
|
42153
42230
|
}
|
|
42154
42231
|
}
|
|
@@ -42864,7 +42941,7 @@
|
|
|
42864
42941
|
setBitmapTool(bmpTool) {
|
|
42865
42942
|
this._bmpTool = bmpTool;
|
|
42866
42943
|
}
|
|
42867
|
-
layoutArcLabels(position, attribute, currentMarks, data, textBoundsArray) {
|
|
42944
|
+
layoutArcLabels(position, attribute, currentMarks, data, textBoundsArray, ellipsisWidth) {
|
|
42868
42945
|
return [];
|
|
42869
42946
|
}
|
|
42870
42947
|
render() {
|
|
@@ -42918,7 +42995,6 @@
|
|
|
42918
42995
|
}
|
|
42919
42996
|
layout() {
|
|
42920
42997
|
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
42921
|
-
var _a;
|
|
42922
42998
|
const {
|
|
42923
42999
|
textStyle = {},
|
|
42924
43000
|
position: position,
|
|
@@ -42943,15 +43019,23 @@
|
|
|
42943
43019
|
textLocation && (labelAttribute.x = textLocation.x, labelAttribute.y = textLocation.y, text.setAttributes(textLocation), labels.push(text));
|
|
42944
43020
|
}
|
|
42945
43021
|
if ("arc" === this.attribute.type) {
|
|
42946
|
-
const
|
|
43022
|
+
const ellipsisLabelAttribute = Object.assign(Object.assign({}, this.attribute.textStyle), {
|
|
43023
|
+
text: "..."
|
|
43024
|
+
}),
|
|
43025
|
+
ellipsisText = this._createLabelText(ellipsisLabelAttribute),
|
|
43026
|
+
ellipsisTextBounds = this.getGraphicBounds(ellipsisText),
|
|
43027
|
+
ellipsisWidth = ellipsisTextBounds.x2 - ellipsisTextBounds.x1,
|
|
43028
|
+
arcs = this.layoutArcLabels(position, this.attribute, Array.from(this._idToGraphic.values()), data, textBoundsArray, ellipsisWidth);
|
|
42947
43029
|
for (let i = 0; i < data.length; i++) {
|
|
42948
43030
|
const textData = data[i],
|
|
42949
|
-
basedArc = arcs.find(arc => arc.
|
|
43031
|
+
basedArc = arcs.find(arc => arc.refDatum.id === textData.id),
|
|
42950
43032
|
labelAttribute = {
|
|
43033
|
+
visible: basedArc.labelVisible,
|
|
42951
43034
|
x: basedArc.labelPosition.x,
|
|
42952
43035
|
y: basedArc.labelPosition.y,
|
|
42953
|
-
angle:
|
|
42954
|
-
|
|
43036
|
+
angle: basedArc.angle,
|
|
43037
|
+
maxLineWidth: basedArc.labelLimit,
|
|
43038
|
+
points: (null == basedArc ? void 0 : basedArc.pointA) && (null == basedArc ? void 0 : basedArc.pointB) && (null == basedArc ? void 0 : basedArc.pointC) ? [basedArc.pointA, basedArc.pointB, basedArc.pointC] : void 0
|
|
42955
43039
|
};
|
|
42956
43040
|
labels[i].setAttributes(labelAttribute);
|
|
42957
43041
|
}
|
|
@@ -43000,24 +43084,6 @@
|
|
|
43000
43084
|
continue;
|
|
43001
43085
|
}
|
|
43002
43086
|
}
|
|
43003
|
-
if (clampForce) {
|
|
43004
|
-
const {
|
|
43005
|
-
dx = 0,
|
|
43006
|
-
dy = 0
|
|
43007
|
-
} = clampText(text, bmpTool.width, bmpTool.height);
|
|
43008
|
-
if ((0 !== dx || 0 !== dy) && canPlace(bmpTool, bitmap, {
|
|
43009
|
-
x1: text.AABBBounds.x1 + dx,
|
|
43010
|
-
x2: text.AABBBounds.x2 + dx,
|
|
43011
|
-
y1: text.AABBBounds.y1 + dy,
|
|
43012
|
-
y2: text.AABBBounds.y2 + dy
|
|
43013
|
-
})) {
|
|
43014
|
-
text.setAttributes({
|
|
43015
|
-
x: text.attribute.x + dx,
|
|
43016
|
-
y: text.attribute.y + dy
|
|
43017
|
-
}), result.push(text);
|
|
43018
|
-
continue;
|
|
43019
|
-
}
|
|
43020
|
-
}
|
|
43021
43087
|
let hasPlace = !1;
|
|
43022
43088
|
for (let j = 0; j < strategy.length; j++) if (hasPlace = place$2(bmpTool, bitmap, strategy[j], this.attribute, text, this.getGraphicBounds(baseMark, labels[i]), this.labeling), !1 !== hasPlace) {
|
|
43023
43089
|
text.setAttributes({
|
|
@@ -43075,12 +43141,12 @@
|
|
|
43075
43141
|
prevTextMap = this._graphicToText || new Map(),
|
|
43076
43142
|
texts = [];
|
|
43077
43143
|
labels.forEach((text, index) => {
|
|
43078
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
43079
|
-
const labelLine = (null === (_a = text.attribute) || void 0 === _a ? void 0 : _a.
|
|
43144
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
43145
|
+
const labelLine = (null === (_a = text.attribute) || void 0 === _a ? void 0 : _a.points) ? createLine({
|
|
43080
43146
|
visible: null === (_c = null === (_b = text.attribute) || void 0 === _b ? void 0 : _b.visible) || void 0 === _c || _c,
|
|
43081
43147
|
stroke: null !== (_f = null === (_e = null === (_d = text.attribute) || void 0 === _d ? void 0 : _d.line) || void 0 === _e ? void 0 : _e.stroke) && void 0 !== _f ? _f : null === (_g = text.attribute) || void 0 === _g ? void 0 : _g.fill,
|
|
43082
|
-
lineWidth: 1,
|
|
43083
|
-
|
|
43148
|
+
lineWidth: null !== (_k = null === (_j = null === (_h = text.attribute) || void 0 === _h ? void 0 : _h.line) || void 0 === _j ? void 0 : _j.lineWidth) && void 0 !== _k ? _k : 1,
|
|
43149
|
+
points: null === (_l = text.attribute) || void 0 === _l ? void 0 : _l.points
|
|
43084
43150
|
}) : void 0,
|
|
43085
43151
|
relatedGraphic = this._idToGraphic.get(text.attribute.id),
|
|
43086
43152
|
state = (null == prevTextMap ? void 0 : prevTextMap.get(relatedGraphic)) ? "update" : "enter";
|
|
@@ -43109,11 +43175,11 @@
|
|
|
43109
43175
|
if ("update" === state) {
|
|
43110
43176
|
const prevLabel = prevTextMap.get(relatedGraphic);
|
|
43111
43177
|
if (prevTextMap.delete(relatedGraphic), currentTextMap.set(relatedGraphic, prevLabel), disableAnimation) prevLabel.text.setAttributes(text.attribute), (null == prevLabel ? void 0 : prevLabel.labelLine) && prevLabel.labelLine.setAttributes({
|
|
43112
|
-
|
|
43178
|
+
points: null === (_o = text.attribute) || void 0 === _o ? void 0 : _o.points
|
|
43113
43179
|
});else {
|
|
43114
43180
|
const prevText = prevLabel.text;
|
|
43115
43181
|
prevText.animate().to(text.attribute, duration, easing), prevLabel.labelLine && prevLabel.labelLine.animate().to(merge$2({}, prevLabel.labelLine.attribute, {
|
|
43116
|
-
|
|
43182
|
+
points: null === (_m = text.attribute) || void 0 === _m ? void 0 : _m.points
|
|
43117
43183
|
}), duration, easing), !1 !== animationConfig.increaseEffect && prevText.attribute.text !== text.attribute.text && isValidNumber(Number(prevText.attribute.text) * Number(text.attribute.text)) && prevText.animate().play(new IncreaseCount({
|
|
43118
43184
|
text: prevText.attribute.text
|
|
43119
43185
|
}, {
|
|
@@ -43169,33 +43235,77 @@
|
|
|
43169
43235
|
return listener;
|
|
43170
43236
|
}
|
|
43171
43237
|
_smartInvert(labels) {
|
|
43238
|
+
var _a, _b, _c, _d;
|
|
43172
43239
|
const option = this.attribute.smartInvert || {},
|
|
43173
43240
|
{
|
|
43174
43241
|
textType: textType,
|
|
43175
43242
|
contrastRatiosThreshold: contrastRatiosThreshold,
|
|
43176
43243
|
alternativeColors: alternativeColors
|
|
43177
|
-
} = option
|
|
43178
|
-
|
|
43244
|
+
} = option,
|
|
43245
|
+
fillStrategy = null !== (_a = option.fillStrategy) && void 0 !== _a ? _a : "invertBase",
|
|
43246
|
+
strokeStrategy = null !== (_b = option.strokeStrategy) && void 0 !== _b ? _b : "base",
|
|
43247
|
+
brightColor = null !== (_c = option.brightColor) && void 0 !== _c ? _c : "#ffffff",
|
|
43248
|
+
darkColor = null !== (_d = option.darkColor) && void 0 !== _d ? _d : "#000000";
|
|
43249
|
+
if ("null" !== fillStrategy || "null" !== strokeStrategy) for (let i = 0; i < labels.length; i++) {
|
|
43179
43250
|
const label = labels[i];
|
|
43180
43251
|
if (!label) continue;
|
|
43181
43252
|
const baseMark = this._idToGraphic.get(label.attribute.id);
|
|
43182
43253
|
let isInside = canPlaceInside(label.AABBBounds, null == baseMark ? void 0 : baseMark.AABBBounds);
|
|
43183
|
-
|
|
43184
|
-
|
|
43185
|
-
|
|
43186
|
-
|
|
43187
|
-
|
|
43254
|
+
"arc" === this.attribute.type && (isInside = "inside" === this.attribute.position);
|
|
43255
|
+
const backgroundColor = baseMark.attribute.fill,
|
|
43256
|
+
foregroundColor = label.attribute.fill,
|
|
43257
|
+
baseColor = backgroundColor,
|
|
43258
|
+
invertColor = labelSmartInvert(foregroundColor, backgroundColor, textType, contrastRatiosThreshold, alternativeColors),
|
|
43259
|
+
simialrColor = contrastAccessibilityChecker(invertColor, brightColor) ? brightColor : darkColor;
|
|
43260
|
+
if (isInside) {
|
|
43261
|
+
if (this.setFillStrategy(fillStrategy, label, baseColor, invertColor, simialrColor), 0 === label.attribute.lineWidth) continue;
|
|
43262
|
+
this.setStrokeStrategy(strokeStrategy, label, baseColor, invertColor, simialrColor);
|
|
43263
|
+
} else {
|
|
43264
|
+
if (0 === label.attribute.lineWidth) continue;
|
|
43265
|
+
if (label.attribute.stroke) {
|
|
43266
|
+
label.setAttributes({
|
|
43267
|
+
fill: labelSmartInvert(label.attribute.fill, label.attribute.stroke, textType, contrastRatiosThreshold, alternativeColors)
|
|
43268
|
+
});
|
|
43269
|
+
continue;
|
|
43270
|
+
}
|
|
43271
|
+
this.setFillStrategy(fillStrategy, label, baseColor, invertColor, simialrColor), this.setStrokeStrategy(strokeStrategy, label, baseColor, invertColor, simialrColor);
|
|
43272
|
+
}
|
|
43273
|
+
}
|
|
43274
|
+
}
|
|
43275
|
+
setFillStrategy(fillStrategy, label, baseColor, invertColor, simialrColor) {
|
|
43276
|
+
switch (fillStrategy) {
|
|
43277
|
+
case "base":
|
|
43188
43278
|
label.setAttributes({
|
|
43189
|
-
fill:
|
|
43279
|
+
fill: baseColor
|
|
43190
43280
|
});
|
|
43191
|
-
|
|
43192
|
-
|
|
43193
|
-
foregroundColor = label.attribute.fill;
|
|
43281
|
+
break;
|
|
43282
|
+
case "invertBase":
|
|
43194
43283
|
label.setAttributes({
|
|
43195
|
-
|
|
43196
|
-
|
|
43284
|
+
fill: invertColor
|
|
43285
|
+
});
|
|
43286
|
+
break;
|
|
43287
|
+
case "similarBase":
|
|
43288
|
+
label.setAttributes({
|
|
43289
|
+
fill: simialrColor
|
|
43290
|
+
});
|
|
43291
|
+
}
|
|
43292
|
+
}
|
|
43293
|
+
setStrokeStrategy(strokeStrategy, label, baseColor, invertColor, simialrColor) {
|
|
43294
|
+
switch (strokeStrategy) {
|
|
43295
|
+
case "base":
|
|
43296
|
+
label.setAttributes({
|
|
43297
|
+
stroke: baseColor
|
|
43298
|
+
});
|
|
43299
|
+
break;
|
|
43300
|
+
case "invertBase":
|
|
43301
|
+
label.setAttributes({
|
|
43302
|
+
stroke: invertColor
|
|
43303
|
+
});
|
|
43304
|
+
break;
|
|
43305
|
+
case "similarBase":
|
|
43306
|
+
label.setAttributes({
|
|
43307
|
+
stroke: simialrColor
|
|
43197
43308
|
});
|
|
43198
|
-
}
|
|
43199
43309
|
}
|
|
43200
43310
|
}
|
|
43201
43311
|
setLocation(point) {
|
|
@@ -43477,17 +43587,19 @@
|
|
|
43477
43587
|
y: 0
|
|
43478
43588
|
};
|
|
43479
43589
|
}
|
|
43480
|
-
layoutArcLabels(position, attribute, currentMarks, data, textBoundsArray) {
|
|
43481
|
-
|
|
43590
|
+
layoutArcLabels(position, attribute, currentMarks, data, textBoundsArray, ellipsisWidth) {
|
|
43591
|
+
var _a;
|
|
43592
|
+
this._arcLeft.clear(), this._arcRight.clear(), this._ellipsisWidth = ellipsisWidth;
|
|
43482
43593
|
const {
|
|
43483
|
-
|
|
43484
|
-
|
|
43485
|
-
|
|
43594
|
+
width: width,
|
|
43595
|
+
height: height
|
|
43596
|
+
} = attribute,
|
|
43597
|
+
centerOffset = null !== (_a = null == attribute ? void 0 : attribute.centerOffset) && void 0 !== _a ? _a : 0;
|
|
43486
43598
|
currentMarks.forEach((currentMark, index) => {
|
|
43487
43599
|
var _a, _b;
|
|
43488
43600
|
const graphicAttribute = currentMark.attribute,
|
|
43489
43601
|
radiusRatio = this.computeLayoutOuterRadius(graphicAttribute.outerRadius, width, height),
|
|
43490
|
-
radius = this.computeRadius(radiusRatio, width, height),
|
|
43602
|
+
radius = this.computeRadius(radiusRatio, width, height, centerOffset),
|
|
43491
43603
|
center = {
|
|
43492
43604
|
x: null !== (_a = null == graphicAttribute ? void 0 : graphicAttribute.x) && void 0 !== _a ? _a : 0,
|
|
43493
43605
|
y: null !== (_b = null == graphicAttribute ? void 0 : graphicAttribute.y) && void 0 !== _b ? _b : 0
|
|
@@ -43500,7 +43612,7 @@
|
|
|
43500
43612
|
arcMiddle = circlePoint(center.x, center.y, graphicAttribute.outerRadius, arcMiddleAngle),
|
|
43501
43613
|
outerArcMiddle = circlePoint(center.x, center.y, radius + attribute.line.line1MinLength, arcMiddleAngle),
|
|
43502
43614
|
arc = new ArcInfo$1(item, arcMiddle, outerArcMiddle, arcQuadrant, intervalAngle, arcMiddleAngle);
|
|
43503
|
-
arc.pointA = circlePoint(center.x, center.y, this.computeDatumRadius(2 * center.x, 2 * center.y, graphicAttribute.outerRadius), arc.middleAngle), arc.labelSize = {
|
|
43615
|
+
arc.pointA = circlePoint(center.x, center.y, this.computeDatumRadius(2 * center.x, 2 * center.y, graphicAttribute.outerRadius, centerOffset), arc.middleAngle), arc.labelSize = {
|
|
43504
43616
|
width: textBounds.x2 - textBounds.x1,
|
|
43505
43617
|
height: textBounds.y2 - textBounds.y1
|
|
43506
43618
|
}, isQuadrantRight(arc.quadrant) ? this._arcRight.set(arc.refDatum, arc) : isQuadrantLeft(arc.quadrant) && this._arcLeft.set(arc.refDatum, arc);
|
|
@@ -43511,22 +43623,24 @@
|
|
|
43511
43623
|
return "inside" === position ? (arcs.push(...this._layoutInsideLabels(rightArcs, attribute, currentMarks)), arcs.push(...this._layoutInsideLabels(leftArcs, attribute, currentMarks))) : (arcs.push(...this._layoutOutsideLabels(rightArcs, attribute, currentMarks)), arcs.push(...this._layoutOutsideLabels(leftArcs, attribute, currentMarks))), arcs;
|
|
43512
43624
|
}
|
|
43513
43625
|
_layoutInsideLabels(arcs, attribute, currentMarks) {
|
|
43514
|
-
var _a, _b, _c, _d;
|
|
43626
|
+
var _a, _b, _c, _d, _e;
|
|
43515
43627
|
const center = {
|
|
43516
43628
|
x: null !== (_b = null === (_a = currentMarks[0].attribute) || void 0 === _a ? void 0 : _a.x) && void 0 !== _b ? _b : 0,
|
|
43517
43629
|
y: null !== (_d = null === (_c = currentMarks[0].attribute) || void 0 === _c ? void 0 : _c.y) && void 0 !== _d ? _d : 0
|
|
43518
43630
|
},
|
|
43631
|
+
centerOffset = null !== (_e = null == attribute ? void 0 : attribute.centerOffset) && void 0 !== _e ? _e : 0,
|
|
43519
43632
|
innerRadiusRatio = this.computeLayoutOuterRadius(currentMarks[0].attribute.innerRadius, attribute.width, attribute.height),
|
|
43520
43633
|
outerRadiusRatio = this.computeLayoutOuterRadius(currentMarks[0].attribute.outerRadius, attribute.width, attribute.height),
|
|
43521
43634
|
labelConfig = attribute,
|
|
43522
43635
|
spaceWidth = labelConfig.spaceWidth;
|
|
43523
43636
|
return arcs.forEach(arc => {
|
|
43637
|
+
var _a, _b;
|
|
43524
43638
|
const {
|
|
43525
43639
|
labelSize: labelSize,
|
|
43526
43640
|
radian: radian
|
|
43527
43641
|
} = arc,
|
|
43528
|
-
innerRadius = this.computeRadius(innerRadiusRatio, attribute.width, attribute.height, 1),
|
|
43529
|
-
outerRadius = this.computeRadius(outerRadiusRatio, attribute.width, attribute.height, 1);
|
|
43642
|
+
innerRadius = this.computeRadius(innerRadiusRatio, attribute.width, attribute.height, centerOffset, 1),
|
|
43643
|
+
outerRadius = this.computeRadius(outerRadiusRatio, attribute.width, attribute.height, centerOffset, 1);
|
|
43530
43644
|
let limit;
|
|
43531
43645
|
if (radian < connectLineRadian(outerRadius, labelSize.height)) limit = 0;else {
|
|
43532
43646
|
let minRadius;
|
|
@@ -43538,7 +43652,7 @@
|
|
|
43538
43652
|
const labelWidth = Math.min(limit, arc.labelSize.width),
|
|
43539
43653
|
align = this._computeAlign(arc, attribute),
|
|
43540
43654
|
labelRadius = outerRadius - spaceWidth - ("left" === align ? labelWidth : "right" === align ? 0 : labelWidth / 2);
|
|
43541
|
-
arc.labelPosition = circlePoint(center.x, center.y, labelRadius, arc.middleAngle), arc.labelLimit = labelWidth, isGreater(labelWidth, 0) || (arc.labelVisible = !1), arc.angle = arc.middleAngle;
|
|
43655
|
+
arc.labelPosition = circlePoint(center.x, center.y, labelRadius, arc.middleAngle), arc.labelLimit = labelWidth, isGreater(labelWidth, 0) || (arc.labelVisible = !1), arc.angle = null !== (_b = null === (_a = null == attribute ? void 0 : attribute.textStyle) || void 0 === _a ? void 0 : _a.angle) && void 0 !== _b ? _b : arc.middleAngle;
|
|
43542
43656
|
}), arcs;
|
|
43543
43657
|
}
|
|
43544
43658
|
_layoutOutsideLabels(arcs, attribute, currentMarks) {
|
|
@@ -43591,28 +43705,30 @@
|
|
|
43591
43705
|
}
|
|
43592
43706
|
const width = 2 * center_x;
|
|
43593
43707
|
return arcs.forEach(arc => {
|
|
43594
|
-
|
|
43708
|
+
var _a, _b;
|
|
43709
|
+
arc.labelVisible && (isLess(arc.pointB.x, line2MinLength + spaceWidth) || isGreater(arc.pointB.x, width - line2MinLength - spaceWidth)) && (arc.labelVisible = !1), arc.angle = null !== (_b = null === (_a = null == attribute ? void 0 : attribute.textStyle) || void 0 === _a ? void 0 : _a.angle) && void 0 !== _b ? _b : 0;
|
|
43595
43710
|
}), arcs;
|
|
43596
43711
|
}
|
|
43597
43712
|
_computeX(arc, attribute, currentMarks) {
|
|
43598
|
-
var _a, _b, _c, _e;
|
|
43713
|
+
var _a, _b, _c, _e, _f;
|
|
43599
43714
|
const center_x = null !== (_b = null === (_a = currentMarks[0].attribute) || void 0 === _a ? void 0 : _a.x) && void 0 !== _b ? _b : 0,
|
|
43715
|
+
centerOffset = (null === (_c = currentMarks[0].attribute) || void 0 === _c ? void 0 : _c.y, null !== (_e = null == attribute ? void 0 : attribute.centerOffset) && void 0 !== _e ? _e : 0),
|
|
43600
43716
|
plotLayout_width = 2 * center_x,
|
|
43601
|
-
radiusRatio =
|
|
43717
|
+
radiusRatio = this.computeLayoutOuterRadius(currentMarks[0].attribute.outerRadius, attribute.width, attribute.height),
|
|
43602
43718
|
line1MinLength = attribute.line.line1MinLength,
|
|
43603
43719
|
line2MinLength = attribute.line.line2MinLength,
|
|
43604
|
-
labelLayoutAlign = null === (
|
|
43720
|
+
labelLayoutAlign = null === (_f = attribute.layout) || void 0 === _f ? void 0 : _f.align,
|
|
43605
43721
|
spaceWidth = attribute.spaceWidth,
|
|
43606
43722
|
{
|
|
43607
43723
|
labelPosition: labelPosition,
|
|
43608
43724
|
quadrant: quadrant,
|
|
43609
43725
|
pointB: pointB
|
|
43610
|
-
} =
|
|
43726
|
+
} = arc;
|
|
43611
43727
|
isValidNumber(pointB.x * pointB.y) || (arc.pointC = {
|
|
43612
43728
|
x: NaN,
|
|
43613
43729
|
y: NaN
|
|
43614
43730
|
}, labelPosition.x = NaN, arc.labelLimit = 0);
|
|
43615
|
-
const radius = this.computeRadius(radiusRatio, attribute.width, attribute.height),
|
|
43731
|
+
const radius = this.computeRadius(radiusRatio, attribute.width, attribute.height, centerOffset),
|
|
43616
43732
|
flag = isQuadrantLeft(quadrant) ? -1 : 1;
|
|
43617
43733
|
let cx = 0;
|
|
43618
43734
|
let limit = (flag > 0 ? plotLayout_width - pointB.x : pointB.x) - line2MinLength - spaceWidth;
|
|
@@ -43629,17 +43745,18 @@
|
|
|
43629
43745
|
default:
|
|
43630
43746
|
cx = pointB.x + flag * line2MinLength;
|
|
43631
43747
|
}
|
|
43632
|
-
|
|
43748
|
+
labelWidth = Math.max(this._ellipsisWidth, labelWidth), arc.labelLimit = labelWidth, arc.pointC = {
|
|
43633
43749
|
x: cx,
|
|
43634
43750
|
y: labelPosition.y
|
|
43635
|
-
}
|
|
43751
|
+
};
|
|
43752
|
+
const targetCenterOffset = .5 * (arc.labelLimit < arc.labelSize.width ? arc.labelLimit : arc.labelSize.width);
|
|
43753
|
+
if ("edge" === labelLayoutAlign) {
|
|
43636
43754
|
const alignOffset = 0;
|
|
43637
|
-
labelPosition.x = flag > 0 ? plotLayout_width + alignOffset : alignOffset;
|
|
43755
|
+
labelPosition.x = (flag > 0 ? plotLayout_width + alignOffset : alignOffset) - flag * targetCenterOffset;
|
|
43638
43756
|
} else {
|
|
43639
43757
|
const alignOffset = 0;
|
|
43640
|
-
labelPosition.x = cx + alignOffset + flag * (spaceWidth +
|
|
43758
|
+
labelPosition.x = cx + alignOffset + flag * (spaceWidth + targetCenterOffset);
|
|
43641
43759
|
}
|
|
43642
|
-
arc.labelLimit = labelWidth;
|
|
43643
43760
|
}
|
|
43644
43761
|
_computeAlignOffset(align, labelWidth, alignFlag) {
|
|
43645
43762
|
switch (align) {
|
|
@@ -43763,7 +43880,7 @@
|
|
|
43763
43880
|
return -1;
|
|
43764
43881
|
}
|
|
43765
43882
|
_computePointB(arc, r, attribute, currentMarks) {
|
|
43766
|
-
var _a, _b, _c, _d;
|
|
43883
|
+
var _a, _b, _c, _d, _e;
|
|
43767
43884
|
const labelConfig = attribute,
|
|
43768
43885
|
radiusRatio = this.computeLayoutOuterRadius(currentMarks[0].attribute.outerRadius, attribute.width, attribute.height),
|
|
43769
43886
|
line1MinLength = labelConfig.line.line1MinLength;
|
|
@@ -43775,7 +43892,8 @@
|
|
|
43775
43892
|
x: null !== (_b = null === (_a = currentMarks[0].attribute) || void 0 === _a ? void 0 : _a.x) && void 0 !== _b ? _b : 0,
|
|
43776
43893
|
y: null !== (_d = null === (_c = currentMarks[0].attribute) || void 0 === _c ? void 0 : _c.y) && void 0 !== _d ? _d : 0
|
|
43777
43894
|
},
|
|
43778
|
-
|
|
43895
|
+
centerOffset = null !== (_e = null == attribute ? void 0 : attribute.centerOffset) && void 0 !== _e ? _e : 0,
|
|
43896
|
+
radius = this.computeRadius(radiusRatio, attribute.width, attribute.height, centerOffset),
|
|
43779
43897
|
{
|
|
43780
43898
|
labelPosition: labelPosition,
|
|
43781
43899
|
quadrant: quadrant
|
|
@@ -43795,7 +43913,7 @@
|
|
|
43795
43913
|
for (const arc of arcs) arc.labelVisible && (arc.lastLabelY = arc.labelPosition.y);
|
|
43796
43914
|
}
|
|
43797
43915
|
_computeYRange(arc, attribute, currentMarks) {
|
|
43798
|
-
var _a, _b, _c, _d;
|
|
43916
|
+
var _a, _b, _c, _d, _e;
|
|
43799
43917
|
const plotRect = {
|
|
43800
43918
|
width: 2 * (null !== (_b = null === (_a = currentMarks[0].attribute) || void 0 === _a ? void 0 : _a.x) && void 0 !== _b ? _b : 0),
|
|
43801
43919
|
height: 2 * (null !== (_d = null === (_c = currentMarks[0].attribute) || void 0 === _c ? void 0 : _c.y) && void 0 !== _d ? _d : 0)
|
|
@@ -43806,7 +43924,8 @@
|
|
|
43806
43924
|
width: width,
|
|
43807
43925
|
height: height
|
|
43808
43926
|
} = plotRect,
|
|
43809
|
-
|
|
43927
|
+
centerOffset = null !== (_e = null == attribute ? void 0 : attribute.centerOffset) && void 0 !== _e ? _e : 0,
|
|
43928
|
+
radius = this.computeRadius(radiusRatio, attribute.width, attribute.height, centerOffset),
|
|
43810
43929
|
r = this._computeLayoutRadius(height / 2, attribute, currentMarks),
|
|
43811
43930
|
cx = Math.abs(arc.center.x - width / 2),
|
|
43812
43931
|
cy = arc.center.y - height / 2;
|
|
@@ -43821,11 +43940,13 @@
|
|
|
43821
43940
|
points[0].x > points[1].x && points.reverse(), points[0].x < 0 ? isNumberClose(points[0].y, points[1].y) ? Math.abs(arc.middleAngle) < Math.PI / 2 ? (min = 0, max = points[1].y + height / 2) : (min = points[1].y + height / 2, max = height) : points[0].y < points[1].y ? (min = 0, max = points[1].y + height / 2) : (min = points[1].y + height / 2, max = plotRect.height) : (min = Math.min(points[0].y, points[1].y) + height / 2, max = Math.max(points[0].y, points[1].y) + height / 2), arc.labelYRange = [min, max];
|
|
43822
43941
|
}
|
|
43823
43942
|
_computeLayoutRadius(halfYLength, attribute, currentMarks) {
|
|
43943
|
+
var _a;
|
|
43824
43944
|
const labelConfig = attribute,
|
|
43825
43945
|
layoutArcGap = labelConfig.layoutArcGap,
|
|
43826
43946
|
line1MinLength = labelConfig.line.line1MinLength,
|
|
43827
43947
|
radiusRatio = this.computeLayoutOuterRadius(currentMarks[0].attribute.outerRadius, attribute.width, attribute.height),
|
|
43828
|
-
|
|
43948
|
+
centerOffset = null !== (_a = null == attribute ? void 0 : attribute.centerOffset) && void 0 !== _a ? _a : 0,
|
|
43949
|
+
outerR = this.computeRadius(radiusRatio, attribute.width, attribute.height, centerOffset) + line1MinLength,
|
|
43829
43950
|
a = outerR - layoutArcGap;
|
|
43830
43951
|
return Math.max((a ** 2 + halfYLength ** 2) / (2 * a), outerR);
|
|
43831
43952
|
}
|
|
@@ -43874,8 +43995,9 @@
|
|
|
43874
43995
|
checkBoundsOverlap(lastBounds, bounds) ? arcs[i].labelVisible = !1 : lastBounds = bounds;
|
|
43875
43996
|
}
|
|
43876
43997
|
}
|
|
43877
|
-
computeRadius(r, width, height, k) {
|
|
43878
|
-
|
|
43998
|
+
computeRadius(r, width, height, centerOffset, k) {
|
|
43999
|
+
var _a;
|
|
44000
|
+
return null !== (_a = this.computeLayoutRadius(width || 0, height || 0) * r * (isNil(k) ? 1 : k) + centerOffset) && void 0 !== _a ? _a : 0;
|
|
43879
44001
|
}
|
|
43880
44002
|
computeLayoutRadius(width, height) {
|
|
43881
44003
|
return Math.min(width / 2, height / 2);
|
|
@@ -43883,9 +44005,10 @@
|
|
|
43883
44005
|
computeLayoutOuterRadius(r, width, height) {
|
|
43884
44006
|
return r / (Math.min(width, height) / 2);
|
|
43885
44007
|
}
|
|
43886
|
-
computeDatumRadius(width, height, outerRadius) {
|
|
44008
|
+
computeDatumRadius(width, height, outerRadius, centerOffset) {
|
|
44009
|
+
var _a;
|
|
43887
44010
|
const outerRadiusRatio = this.computeLayoutOuterRadius(outerRadius, width, height);
|
|
43888
|
-
return this.computeLayoutRadius(width || 0, height || 0) * outerRadiusRatio;
|
|
44011
|
+
return null !== (_a = this.computeLayoutRadius(width || 0, height || 0) * outerRadiusRatio + centerOffset) && void 0 !== _a ? _a : 0;
|
|
43889
44012
|
}
|
|
43890
44013
|
}
|
|
43891
44014
|
ArcLabel.defaultAttributes = {
|
|
@@ -43911,7 +44034,8 @@
|
|
|
43911
44034
|
align: "arc",
|
|
43912
44035
|
strategy: "priority",
|
|
43913
44036
|
tangentConstraint: !0
|
|
43914
|
-
}
|
|
44037
|
+
},
|
|
44038
|
+
pickable: !1
|
|
43915
44039
|
};
|
|
43916
44040
|
|
|
43917
44041
|
const labelComponentMap = {
|
|
@@ -44610,10 +44734,9 @@
|
|
|
44610
44734
|
let {
|
|
44611
44735
|
style: textStyle
|
|
44612
44736
|
} = tagAttributes;
|
|
44613
|
-
|
|
44614
|
-
|
|
44615
|
-
|
|
44616
|
-
}, textStyle), isFunction(textStyle.text) && (textStyle.text = textStyle.text({
|
|
44737
|
+
textStyle = isFunction(textStyle) ? merge$2({}, DEFAULT_AXIS_THEME.label.style, textStyle(tickDatum, index, tickData, layer)) : textStyle;
|
|
44738
|
+
const labelAlign = this.getLabelAlign(vector, inside, textStyle.angle);
|
|
44739
|
+
return textStyle = merge$2(labelAlign, textStyle), isFunction(textStyle.text) && (textStyle.text = textStyle.text({
|
|
44617
44740
|
label: tickDatum.label,
|
|
44618
44741
|
value: tickDatum.rawValue,
|
|
44619
44742
|
index: tickDatum.index,
|
|
@@ -44741,37 +44864,49 @@
|
|
|
44741
44864
|
bounds.x1 += deltaX, bounds.x2 += deltaX, bounds.y1 += deltaY, bounds.y2 += deltaY, bounds.centerX += deltaX, bounds.centerY += deltaY, item.rotatedBounds = bounds;
|
|
44742
44865
|
});
|
|
44743
44866
|
}
|
|
44867
|
+
function clampAngle() {
|
|
44868
|
+
let angle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
44869
|
+
if (angle < 0) for (; angle < 0;) angle += 2 * Math.PI;
|
|
44870
|
+
if (angle > 0) for (; angle >= 2 * Math.PI;) angle -= 2 * Math.PI;
|
|
44871
|
+
return angle;
|
|
44872
|
+
}
|
|
44744
44873
|
function rotateYAxis(orient, items) {
|
|
44745
|
-
|
|
44746
|
-
|
|
44747
|
-
|
|
44748
|
-
|
|
44749
|
-
if (angle < 0) for (; angle < 0;) angle += 2 * Math.PI;
|
|
44750
|
-
if (angle > 0) for (; angle >= 2 * Math.PI;) angle -= 2 * Math.PI;
|
|
44751
|
-
const step = angle / (.5 * Math.PI);
|
|
44752
|
-
let index;
|
|
44753
|
-
index = step === Math.floor(step) ? 2 * Math.floor(step) : 2 * Math.floor(step) + 1, item.setAttributes({
|
|
44754
|
-
textAlign: align[index],
|
|
44755
|
-
textBaseline: baseline[index],
|
|
44756
|
-
angle: angle
|
|
44757
|
-
});
|
|
44874
|
+
items.forEach((item, i) => {
|
|
44875
|
+
item.setAttributes(Object.assign(Object.assign({}, getYAxisLabelAlign(orient, item.attribute.angle)), {
|
|
44876
|
+
angle: clampAngle(item.attribute.angle)
|
|
44877
|
+
}));
|
|
44758
44878
|
});
|
|
44759
44879
|
}
|
|
44760
44880
|
function rotateXAxis(orient, items) {
|
|
44881
|
+
items.forEach(item => {
|
|
44882
|
+
item.setAttributes(Object.assign(Object.assign({}, getXAxisLabelAlign(orient, item.attribute.angle)), {
|
|
44883
|
+
angle: clampAngle(item.attribute.angle)
|
|
44884
|
+
}));
|
|
44885
|
+
});
|
|
44886
|
+
}
|
|
44887
|
+
function getXAxisLabelAlign(orient) {
|
|
44888
|
+
let angle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
44761
44889
|
let align = ["center", "left", "left", "left", "center", "right", "right", "right", "left"],
|
|
44762
44890
|
baseline = ["top", "top", "middle", "bottom", "bottom", "bottom", "middle", "top", "top"];
|
|
44763
|
-
"top" === orient && (align = ["center", "right", "right", "right", "center", "left", "left", "left", "right"], baseline = ["bottom", "bottom", "middle", "top", "top", "top", "middle", "bottom", "bottom"])
|
|
44764
|
-
|
|
44765
|
-
|
|
44766
|
-
|
|
44767
|
-
|
|
44768
|
-
|
|
44769
|
-
|
|
44770
|
-
|
|
44771
|
-
|
|
44772
|
-
|
|
44773
|
-
|
|
44774
|
-
|
|
44891
|
+
"top" === orient && (align = ["center", "right", "right", "right", "center", "left", "left", "left", "right"], baseline = ["bottom", "bottom", "middle", "top", "top", "top", "middle", "bottom", "bottom"]);
|
|
44892
|
+
const step = (angle = clampAngle(angle)) / (.5 * Math.PI);
|
|
44893
|
+
let index;
|
|
44894
|
+
return index = step === Math.floor(step) ? 2 * Math.floor(step) : 2 * Math.floor(step) + 1, {
|
|
44895
|
+
textAlign: align[index],
|
|
44896
|
+
textBaseline: baseline[index]
|
|
44897
|
+
};
|
|
44898
|
+
}
|
|
44899
|
+
function getYAxisLabelAlign(orient) {
|
|
44900
|
+
let angle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
44901
|
+
let align = ["right", "right", "center", "left", "center", "left", "center", "right", "right"],
|
|
44902
|
+
baseline = ["middle", "middle", "top", "top", "middle", "middle", "bottom", "bottom", "middle"];
|
|
44903
|
+
"right" === orient && (align = ["left", "right", "right", "right", "left", "left", "left", "left", "right"], baseline = ["middle", "bottom", "middle", "top", "top", "top", "middle", "bottom", "bottom"]);
|
|
44904
|
+
const step = (angle = clampAngle(angle)) / (.5 * Math.PI);
|
|
44905
|
+
let index;
|
|
44906
|
+
return index = step === Math.floor(step) ? 2 * Math.floor(step) : 2 * Math.floor(step) + 1, {
|
|
44907
|
+
textAlign: align[index],
|
|
44908
|
+
textBaseline: baseline[index]
|
|
44909
|
+
};
|
|
44775
44910
|
}
|
|
44776
44911
|
|
|
44777
44912
|
function autoLimit(labels, config) {
|
|
@@ -45125,10 +45260,18 @@
|
|
|
45125
45260
|
factor = (inside ? 1 : -1) * verticalFactor;
|
|
45126
45261
|
return isNumberClose(vector[1], 0) ? base = !isNumberClose(vector[0], 0) || Object.is(vector[0], -0) || Object.is(vector[1], -0) ? "middle" : 1 === factor ? "bottom" : "top" : vector[1] > 0 ? base = "top" : vector[1] < 0 && (base = "bottom"), base;
|
|
45127
45262
|
}
|
|
45128
|
-
|
|
45263
|
+
getLabelAlign(vector, inside, angle) {
|
|
45129
45264
|
const orient = this.attribute.orient;
|
|
45130
|
-
|
|
45265
|
+
if (isValidNumber(angle)) {
|
|
45266
|
+
if ("top" === orient || "bottom" === orient) return getXAxisLabelAlign(orient, angle);
|
|
45267
|
+
if ("left" === orient || "right" === orient) return getYAxisLabelAlign(orient, angle);
|
|
45268
|
+
}
|
|
45269
|
+
return {
|
|
45270
|
+
textAlign: this.getTextAlign(vector),
|
|
45271
|
+
textBaseline: this.getTextBaseline(vector, inside)
|
|
45272
|
+
};
|
|
45131
45273
|
}
|
|
45274
|
+
beforeLabelsOverlap(labelShapes, labelData, labelContainer, layer, layerCount) {}
|
|
45132
45275
|
handleLabelsOverlap(labelShapes, labelData, labelContainer, layer, layerCount) {
|
|
45133
45276
|
if (isEmpty(labelShapes)) return;
|
|
45134
45277
|
const {
|
|
@@ -45462,6 +45605,12 @@
|
|
|
45462
45605
|
beforeLabelsOverlap(labelShapes, labelData, labelContainer, layer, layerCount) {}
|
|
45463
45606
|
handleLabelsOverlap(labelShapes, labelData, labelContainer, layer, layerCount) {}
|
|
45464
45607
|
afterLabelsOverlap(labelShapes, labelData, labelContainer, layer, layerCount) {}
|
|
45608
|
+
getLabelAlign(vector, inside, angle) {
|
|
45609
|
+
return {
|
|
45610
|
+
textAlign: this.getTextAlign(vector),
|
|
45611
|
+
textBaseline: this.getTextBaseline(vector)
|
|
45612
|
+
};
|
|
45613
|
+
}
|
|
45465
45614
|
}
|
|
45466
45615
|
CircleAxis.defaultAttributes = DEFAULT_AXIS_THEME;
|
|
45467
45616
|
|
|
@@ -47206,10 +47355,18 @@
|
|
|
47206
47355
|
}, null == valueAttr ? void 0 : valueAttr.style), {
|
|
47207
47356
|
text: valueAttr.formatMethod ? valueAttr.formatMethod(value, item, index) : value
|
|
47208
47357
|
}));
|
|
47209
|
-
this._appendDataToShape(valueShape, LEGEND_ELEMENT_NAME.itemValue, item, itemGroup, null == valueAttr ? void 0 : valueAttr.state), valueShape.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected), this._itemWidthByUser
|
|
47210
|
-
|
|
47211
|
-
|
|
47212
|
-
|
|
47358
|
+
if (this._appendDataToShape(valueShape, LEGEND_ELEMENT_NAME.itemValue, item, itemGroup, null == valueAttr ? void 0 : valueAttr.state), valueShape.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected), this._itemWidthByUser) {
|
|
47359
|
+
const layoutWidth = this._itemWidthByUser - parsedPadding[1] - parsedPadding[3] - shapeSize - shapeSpace - labelSpace - focusSpace - valueSpace,
|
|
47360
|
+
valueBounds = valueShape.AABBBounds,
|
|
47361
|
+
labelBounds = labelShape.AABBBounds,
|
|
47362
|
+
valueWidth = valueBounds.width(),
|
|
47363
|
+
labelWidth = labelBounds.width();
|
|
47364
|
+
labelWidth > layoutWidth ? (layoutWidth - valueWidth) / labelWidth > .4 ? labelShape.setAttribute("maxLineWidth", layoutWidth - valueWidth) : (valueShape.setAttribute("maxLineWidth", .5 * layoutWidth), labelShape.setAttribute("maxLineWidth", .5 * layoutWidth)) : valueShape.setAttribute("maxLineWidth", layoutWidth - labelWidth), valueAttr.alignRight && valueShape.setAttributes({
|
|
47365
|
+
textAlign: "right",
|
|
47366
|
+
x: this._itemWidthByUser - shapeSize / 2 - parsedPadding[1] - parsedPadding[3] - focusSpace - valueSpace
|
|
47367
|
+
});
|
|
47368
|
+
}
|
|
47369
|
+
focusStartX = valueShape.AABBBounds.x2 + valueSpace, innerGroup.add(valueShape);
|
|
47213
47370
|
} else this._itemWidthByUser && labelShape.setAttribute("maxLineWidth", this._itemWidthByUser - parsedPadding[1] - parsedPadding[3] - shapeSize - shapeSpace - focusSpace);
|
|
47214
47371
|
focusShape && (focusShape.setAttribute("x", focusStartX), innerGroup.add(focusShape));
|
|
47215
47372
|
const innerGroupBounds = innerGroup.AABBBounds,
|
|
@@ -47487,6 +47644,7 @@
|
|
|
47487
47644
|
min: min,
|
|
47488
47645
|
max: max
|
|
47489
47646
|
} = this.attribute;
|
|
47647
|
+
if (max === min) return;
|
|
47490
47648
|
let currentPos,
|
|
47491
47649
|
originPos,
|
|
47492
47650
|
railLen,
|
|
@@ -47505,15 +47663,16 @@
|
|
|
47505
47663
|
}, this._onTrackPointerMove = e => {
|
|
47506
47664
|
e.stopPropagation();
|
|
47507
47665
|
const {
|
|
47508
|
-
|
|
47509
|
-
|
|
47510
|
-
|
|
47511
|
-
|
|
47512
|
-
|
|
47513
|
-
|
|
47514
|
-
|
|
47515
|
-
|
|
47516
|
-
|
|
47666
|
+
railWidth: railWidth,
|
|
47667
|
+
railHeight: railHeight,
|
|
47668
|
+
min: min,
|
|
47669
|
+
max: max
|
|
47670
|
+
} = this.attribute;
|
|
47671
|
+
if (max === min) return;
|
|
47672
|
+
const {
|
|
47673
|
+
startHandler: startHandler,
|
|
47674
|
+
endHandler: endHandler
|
|
47675
|
+
} = this._getHandlers();
|
|
47517
47676
|
let currentPos, trackLen, railLen;
|
|
47518
47677
|
this._isHorizontal ? (currentPos = e.clientX, trackLen = this._track.attribute.width, railLen = railWidth) : (currentPos = e.clientY, trackLen = this._track.attribute.height, railLen = railHeight);
|
|
47519
47678
|
const delta = currentPos - this._prePos;
|
|
@@ -47541,12 +47700,13 @@
|
|
|
47541
47700
|
}, this._onRailPointerDown = e => {
|
|
47542
47701
|
e.stopPropagation();
|
|
47543
47702
|
const {
|
|
47544
|
-
|
|
47545
|
-
|
|
47546
|
-
|
|
47547
|
-
|
|
47548
|
-
|
|
47549
|
-
|
|
47703
|
+
railWidth: railWidth,
|
|
47704
|
+
railHeight: railHeight,
|
|
47705
|
+
min: min,
|
|
47706
|
+
max: max
|
|
47707
|
+
} = this.attribute;
|
|
47708
|
+
if (max === min) return;
|
|
47709
|
+
const startHandler = this._startHandler,
|
|
47550
47710
|
endHandler = this._endHandler;
|
|
47551
47711
|
let currentPos, startHandlerPos, endHandlerPos, railLen;
|
|
47552
47712
|
this._isHorizontal ? (currentPos = e.viewX - this._rail.globalAABBBounds.x1, startHandlerPos = null == startHandler ? void 0 : startHandler.attribute.x, endHandlerPos = null == endHandler ? void 0 : endHandler.attribute.x, railLen = railWidth) : (currentPos = e.viewY - this._rail.globalAABBBounds.y1, startHandlerPos = null == startHandler ? void 0 : startHandler.attribute.y, endHandlerPos = null == endHandler ? void 0 : endHandler.attribute.y, railLen = railHeight);
|
|
@@ -47559,14 +47719,15 @@
|
|
|
47559
47719
|
};
|
|
47560
47720
|
}
|
|
47561
47721
|
setValue(value) {
|
|
47722
|
+
const {
|
|
47723
|
+
layout: layout,
|
|
47724
|
+
railWidth: railWidth,
|
|
47725
|
+
railHeight: railHeight,
|
|
47726
|
+
min: min,
|
|
47727
|
+
max: max
|
|
47728
|
+
} = this.attribute;
|
|
47729
|
+
if (max === min) return;
|
|
47562
47730
|
const [startValue, endValue] = array(value),
|
|
47563
|
-
{
|
|
47564
|
-
layout: layout,
|
|
47565
|
-
railWidth: railWidth,
|
|
47566
|
-
railHeight: railHeight,
|
|
47567
|
-
min: min,
|
|
47568
|
-
max: max
|
|
47569
|
-
} = this.attribute,
|
|
47570
47731
|
{
|
|
47571
47732
|
startHandler: startHandler,
|
|
47572
47733
|
endHandler: endHandler
|
|
@@ -47681,7 +47842,7 @@
|
|
|
47681
47842
|
isHorizontal = this._isHorizontal,
|
|
47682
47843
|
railLen = isHorizontal ? railWidth : railHeight,
|
|
47683
47844
|
[startValue, endValue] = convertValueToRange(value),
|
|
47684
|
-
handlerStart = (startValue - min) / (max - min) * railLen,
|
|
47845
|
+
handlerStart = max === min ? range ? 0 : railLen : (startValue - min) / (max - min) * railLen,
|
|
47685
47846
|
startHandler = this._renderHandler(Object.assign({
|
|
47686
47847
|
x: isHorizontal ? handlerStart : railWidth / 2,
|
|
47687
47848
|
y: isHorizontal ? railHeight / 2 : handlerStart,
|
|
@@ -47690,11 +47851,11 @@
|
|
|
47690
47851
|
cursor: !1 === slidable ? "default" : getDefaultCursor(isHorizontal)
|
|
47691
47852
|
}, handlerStyle));
|
|
47692
47853
|
if (startHandler.name = SLIDER_ELEMENT_NAME.startHandler, this._startHandler = startHandler, container.add(startHandler), this._currentValue.startPos = handlerStart, handlerTextVisible) {
|
|
47693
|
-
const startHandlerText = this._renderHandlerText(startValue);
|
|
47854
|
+
const startHandlerText = this._renderHandlerText(startValue, range ? "start" : "end");
|
|
47694
47855
|
startHandlerText.name = SLIDER_ELEMENT_NAME.startHandlerText, container.add(startHandlerText), this._startHandlerText = startHandlerText;
|
|
47695
47856
|
}
|
|
47696
47857
|
if (range) {
|
|
47697
|
-
const handlerEnd = (endValue - min) / (max - min) * railLen,
|
|
47858
|
+
const handlerEnd = max === min ? railLen : (endValue - min) / (max - min) * railLen,
|
|
47698
47859
|
endHandler = this._renderHandler(Object.assign({
|
|
47699
47860
|
x: isHorizontal ? handlerEnd : railWidth / 2,
|
|
47700
47861
|
y: isHorizontal ? railHeight / 2 : handlerEnd,
|
|
@@ -47703,7 +47864,7 @@
|
|
|
47703
47864
|
cursor: !1 === slidable ? "default" : getDefaultCursor(isHorizontal)
|
|
47704
47865
|
}, handlerStyle));
|
|
47705
47866
|
if (endHandler.name = SLIDER_ELEMENT_NAME.endHandler, this._endHandler = endHandler, container.add(endHandler), this._currentValue.endPos = handlerEnd, handlerTextVisible) {
|
|
47706
|
-
const endHandlerText = this._renderHandlerText(endValue);
|
|
47867
|
+
const endHandlerText = this._renderHandlerText(endValue, "end");
|
|
47707
47868
|
endHandlerText.name = SLIDER_ELEMENT_NAME.endHandlerText, container.add(endHandlerText), this._endHandlerText = endHandlerText;
|
|
47708
47869
|
}
|
|
47709
47870
|
}
|
|
@@ -47717,15 +47878,16 @@
|
|
|
47717
47878
|
railWidth: railWidth,
|
|
47718
47879
|
trackStyle: trackStyle,
|
|
47719
47880
|
railStyle: railStyle,
|
|
47720
|
-
slidable: slidable
|
|
47721
|
-
} = this.attribute;
|
|
47722
|
-
let {
|
|
47881
|
+
slidable: slidable,
|
|
47723
47882
|
value: value
|
|
47724
47883
|
} = this.attribute;
|
|
47725
|
-
|
|
47884
|
+
let startValue, endValue;
|
|
47885
|
+
if (isNil(value)) range ? (startValue = min, endValue = max) : startValue = endValue = min;else if (range) {
|
|
47886
|
+
const clampValue = clampRange(value, min, max);
|
|
47887
|
+
startValue = clampValue[0], endValue = clampValue[1];
|
|
47888
|
+
} else startValue = min, endValue = clamp$1(value, min, max);
|
|
47726
47889
|
const isHorizontal = this._isHorizontal,
|
|
47727
47890
|
railLen = isHorizontal ? railWidth : railHeight;
|
|
47728
|
-
let [startValue, endValue] = convertValueToRange(value);
|
|
47729
47891
|
range || (startValue = min);
|
|
47730
47892
|
const trackContainer = createGroup({
|
|
47731
47893
|
x: 0,
|
|
@@ -47740,10 +47902,11 @@
|
|
|
47740
47902
|
const draggableTrack = isObject$f(range) && !0 === range.draggableTrack;
|
|
47741
47903
|
let cursor;
|
|
47742
47904
|
cursor = !1 === slidable ? "default" : !1 === range || !1 === draggableTrack ? "pointer" : getDefaultCursor(isHorizontal);
|
|
47743
|
-
const trackWidth = (endValue - startValue) / (max - min) * railLen,
|
|
47905
|
+
const trackWidth = max === min ? railLen : (endValue - startValue) / (max - min) * railLen,
|
|
47906
|
+
startPos = max === min ? 0 : (startValue - min) / (max - min) * railLen,
|
|
47744
47907
|
track = createRect(Object.assign({
|
|
47745
|
-
x: isHorizontal ?
|
|
47746
|
-
y: isHorizontal ? 0 :
|
|
47908
|
+
x: isHorizontal ? startPos : 0,
|
|
47909
|
+
y: isHorizontal ? 0 : startPos,
|
|
47747
47910
|
width: isHorizontal ? trackWidth : railWidth,
|
|
47748
47911
|
height: isHorizontal ? railHeight : trackWidth,
|
|
47749
47912
|
cursor: cursor
|
|
@@ -47753,7 +47916,7 @@
|
|
|
47753
47916
|
_renderHandler(style) {
|
|
47754
47917
|
return createSymbol(style);
|
|
47755
47918
|
}
|
|
47756
|
-
_renderHandlerText(value) {
|
|
47919
|
+
_renderHandlerText(value, position) {
|
|
47757
47920
|
var _a, _b, _c;
|
|
47758
47921
|
const {
|
|
47759
47922
|
align: align,
|
|
@@ -47766,7 +47929,8 @@
|
|
|
47766
47929
|
slidable: slidable
|
|
47767
47930
|
} = this.attribute,
|
|
47768
47931
|
isHorizontal = this._isHorizontal,
|
|
47769
|
-
|
|
47932
|
+
railLen = isHorizontal ? railWidth : railHeight,
|
|
47933
|
+
handlerStart = max === min ? "start" === position ? 0 : railLen : (value - min) / (max - min) * railLen,
|
|
47770
47934
|
textSpace = null !== (_a = handlerText.space) && void 0 !== _a ? _a : 4,
|
|
47771
47935
|
textStyle = Object.assign({
|
|
47772
47936
|
text: (null == handlerText ? void 0 : handlerText.formatter) ? handlerText.formatter(value) : value.toFixed(null !== (_b = null == handlerText ? void 0 : handlerText.precision) && void 0 !== _b ? _b : 0),
|
|
@@ -48870,7 +49034,7 @@
|
|
|
48870
49034
|
}
|
|
48871
49035
|
}
|
|
48872
49036
|
|
|
48873
|
-
var __awaiter$
|
|
49037
|
+
var __awaiter$5 = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
48874
49038
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
48875
49039
|
function fulfilled(value) {
|
|
48876
49040
|
try {
|
|
@@ -48927,7 +49091,7 @@
|
|
|
48927
49091
|
}, this._dispatchChange = value => {
|
|
48928
49092
|
const index = Math.floor(value);
|
|
48929
49093
|
index !== this._activeIndex && (this._dataIndex = index, this._activeIndex = index, index !== this._maxIndex && this.dispatchCustomEvent(PlayerEventEnum.OnChange));
|
|
48930
|
-
}, this.play = () => __awaiter$
|
|
49094
|
+
}, this.play = () => __awaiter$5(this, void 0, void 0, function* () {
|
|
48931
49095
|
this._isPlaying || (this._controller.togglePause(), this._isPlaying = !0, this._elapsed >= this._totalDuration && (this._elapsed = 0), this._startTime = Date.now() - this._elapsed, this.dispatchCustomEvent(PlayerEventEnum.OnPlay), this._rafId = vglobal.getRequestAnimationFrame()(this._play.bind(this)));
|
|
48932
49096
|
}), this._play = () => {
|
|
48933
49097
|
this._elapsed = Date.now() - this._startTime;
|
|
@@ -51250,7 +51414,7 @@
|
|
|
51250
51414
|
return new Component(view, componentType, groupMark);
|
|
51251
51415
|
};
|
|
51252
51416
|
|
|
51253
|
-
var __awaiter$
|
|
51417
|
+
var __awaiter$4 = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
51254
51418
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
51255
51419
|
function fulfilled(value) {
|
|
51256
51420
|
try {
|
|
@@ -51319,7 +51483,7 @@
|
|
|
51319
51483
|
};
|
|
51320
51484
|
}
|
|
51321
51485
|
evaluate(upstream, parameters) {
|
|
51322
|
-
return __awaiter$
|
|
51486
|
+
return __awaiter$4(this, void 0, void 0, function* () {
|
|
51323
51487
|
const tasks = this._isLoaded ? this.transforms : this._loadTasks.concat(this.transforms);
|
|
51324
51488
|
this.grammarSource && (this._input = upstream);
|
|
51325
51489
|
const values = yield this.evaluateTransform(tasks, this._input, parameters),
|
|
@@ -51499,7 +51663,7 @@
|
|
|
51499
51663
|
}
|
|
51500
51664
|
}
|
|
51501
51665
|
|
|
51502
|
-
var __awaiter$
|
|
51666
|
+
var __awaiter$3 = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
51503
51667
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
51504
51668
|
function fulfilled(value) {
|
|
51505
51669
|
try {
|
|
@@ -51529,7 +51693,7 @@
|
|
|
51529
51693
|
this.grammars = [], this.logger = Logger.getInstance(), this._curRank = 0, this._committed = new UniqueList(grammar => grammar.uid), this._heap = new Heap((a, b) => a.qrank - b.qrank), this._beforeRunner = null, this._afterRunner = null, this._isRunning = !1, this._updateCounter = 0, this._finishFirstRender = !1;
|
|
51530
51694
|
}
|
|
51531
51695
|
asyncCallback(callback) {
|
|
51532
|
-
return __awaiter$
|
|
51696
|
+
return __awaiter$3(this, void 0, void 0, function* () {
|
|
51533
51697
|
try {
|
|
51534
51698
|
yield callback(this);
|
|
51535
51699
|
} catch (err) {
|
|
@@ -51587,7 +51751,7 @@
|
|
|
51587
51751
|
grammar.targets && grammar.targets.length && this._finishFirstRender && grammar.targets.forEach(target => this._enqueue(target));
|
|
51588
51752
|
}
|
|
51589
51753
|
evaluate() {
|
|
51590
|
-
return __awaiter$
|
|
51754
|
+
return __awaiter$3(this, void 0, void 0, function* () {
|
|
51591
51755
|
if (this._beforeRunner && (yield this.asyncCallback(this._beforeRunner)), !this._committed.length) return this.logger.info("Dataflow invoked, but nothing to do."), !1;
|
|
51592
51756
|
this._isRunning = !0, this._updateCounter += 1;
|
|
51593
51757
|
let grammar,
|
|
@@ -52148,19 +52312,20 @@
|
|
|
52148
52312
|
};
|
|
52149
52313
|
return (null !== (_a = spec.marks) && void 0 !== _a ? _a : []).forEach(mark => traverse(mark, "root")), spec;
|
|
52150
52314
|
};
|
|
52151
|
-
const
|
|
52152
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
52315
|
+
const normalizeRunningConfig = runningConfig => {
|
|
52316
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
52153
52317
|
return {
|
|
52154
|
-
reuse: null !== (_a = null ==
|
|
52155
|
-
morph: null !== (_b = null ==
|
|
52156
|
-
morphAll: null !== (_c = null ==
|
|
52318
|
+
reuse: null !== (_a = null == runningConfig ? void 0 : runningConfig.reuse) && void 0 !== _a ? _a : DefaultReuse,
|
|
52319
|
+
morph: null !== (_b = null == runningConfig ? void 0 : runningConfig.morph) && void 0 !== _b ? _b : DefaultMorph,
|
|
52320
|
+
morphAll: null !== (_c = null == runningConfig ? void 0 : runningConfig.morphAll) && void 0 !== _c ? _c : DefaultMorphAll,
|
|
52157
52321
|
animation: {
|
|
52158
|
-
easing: null !== (_e = null === (_d = null ==
|
|
52159
|
-
delay: null !== (_g = null === (_f = null ==
|
|
52160
|
-
duration: null !== (_j = null === (_h = null ==
|
|
52161
|
-
oneByOne: null !== (_l = null === (_k = null ==
|
|
52162
|
-
splitPath: null !== (_o = null === (_m = null ==
|
|
52163
|
-
}
|
|
52322
|
+
easing: null !== (_e = null === (_d = null == runningConfig ? void 0 : runningConfig.animation) || void 0 === _d ? void 0 : _d.easing) && void 0 !== _e ? _e : DefaultAnimationEasing,
|
|
52323
|
+
delay: null !== (_g = null === (_f = null == runningConfig ? void 0 : runningConfig.animation) || void 0 === _f ? void 0 : _f.delay) && void 0 !== _g ? _g : DefaultAnimationDelay,
|
|
52324
|
+
duration: null !== (_j = null === (_h = null == runningConfig ? void 0 : runningConfig.animation) || void 0 === _h ? void 0 : _h.duration) && void 0 !== _j ? _j : DefaultAnimationDuration,
|
|
52325
|
+
oneByOne: null !== (_l = null === (_k = null == runningConfig ? void 0 : runningConfig.animation) || void 0 === _k ? void 0 : _k.oneByOne) && void 0 !== _l ? _l : DefaultAnimationOneByOne,
|
|
52326
|
+
splitPath: null !== (_o = null === (_m = null == runningConfig ? void 0 : runningConfig.animation) || void 0 === _m ? void 0 : _m.splitPath) && void 0 !== _o ? _o : DefaultSplitPath
|
|
52327
|
+
},
|
|
52328
|
+
enableExitAnimation: null !== (_p = null == runningConfig ? void 0 : runningConfig.enableExitAnimation) && void 0 !== _p ? _p : DefaultEnableExitAnimation
|
|
52164
52329
|
};
|
|
52165
52330
|
};
|
|
52166
52331
|
|
|
@@ -52799,32 +52964,32 @@
|
|
|
52799
52964
|
return null !== (_a = grammar.id()) && void 0 !== _a ? _a : Symbol();
|
|
52800
52965
|
});
|
|
52801
52966
|
}
|
|
52802
|
-
diffMark(prevMarks, nextMarks,
|
|
52967
|
+
diffMark(prevMarks, nextMarks, runningConfig) {
|
|
52803
52968
|
const diffResult = {
|
|
52804
52969
|
enter: [],
|
|
52805
52970
|
exit: [],
|
|
52806
52971
|
update: []
|
|
52807
52972
|
};
|
|
52808
|
-
let
|
|
52809
|
-
|
|
52973
|
+
let prevDiffMarks = [],
|
|
52974
|
+
nextDiffMarks = [];
|
|
52810
52975
|
prevMarks.forEach(mark => {
|
|
52811
|
-
|
|
52976
|
+
mark.markType !== GrammarMarkType.group && (runningConfig.morph && mark.getMorphConfig().morph || runningConfig.morphAll || runningConfig.reuse) ? prevDiffMarks.push(mark) : diffResult.exit.push({
|
|
52812
52977
|
prev: [mark]
|
|
52813
52978
|
});
|
|
52814
52979
|
}), nextMarks.forEach(mark => {
|
|
52815
|
-
|
|
52980
|
+
mark.markType !== GrammarMarkType.group && (runningConfig.morph && mark.getMorphConfig().morph || runningConfig.morphAll || runningConfig.reuse) ? nextDiffMarks.push(mark) : diffResult.enter.push({
|
|
52816
52981
|
next: [mark]
|
|
52817
52982
|
});
|
|
52818
52983
|
});
|
|
52819
|
-
const keyDiffResult = this.diffUpdateByGroup(
|
|
52820
|
-
|
|
52821
|
-
const nameDiffResult = this.diffUpdateByGroup(
|
|
52822
|
-
|
|
52823
|
-
const prevParentGroup = groupData(
|
|
52984
|
+
const keyDiffResult = this.diffUpdateByGroup(prevDiffMarks, nextDiffMarks, mark => mark.getMorphConfig().morphKey, mark => mark.getMorphConfig().morphKey);
|
|
52985
|
+
prevDiffMarks = keyDiffResult.prev, nextDiffMarks = keyDiffResult.next, diffResult.update = diffResult.update.concat(keyDiffResult.update);
|
|
52986
|
+
const nameDiffResult = this.diffUpdateByGroup(prevDiffMarks, nextDiffMarks, mark => mark.id(), mark => mark.id());
|
|
52987
|
+
prevDiffMarks = nameDiffResult.prev, nextDiffMarks = nameDiffResult.next, diffResult.update = diffResult.update.concat(nameDiffResult.update);
|
|
52988
|
+
const prevParentGroup = groupData(prevDiffMarks, mark => {
|
|
52824
52989
|
var _a, _b;
|
|
52825
52990
|
return null === (_b = null === (_a = mark.group) || void 0 === _a ? void 0 : _a.id) || void 0 === _b ? void 0 : _b.call(_a);
|
|
52826
52991
|
}),
|
|
52827
|
-
nextParentGroup = groupData(
|
|
52992
|
+
nextParentGroup = groupData(nextDiffMarks, mark => {
|
|
52828
52993
|
var _a, _b;
|
|
52829
52994
|
return null === (_b = null === (_a = mark.group) || void 0 === _a ? void 0 : _a.id) || void 0 === _b ? void 0 : _b.call(_a);
|
|
52830
52995
|
});
|
|
@@ -52844,11 +53009,11 @@
|
|
|
52844
53009
|
next: [nextChild]
|
|
52845
53010
|
});
|
|
52846
53011
|
}
|
|
52847
|
-
|
|
53012
|
+
prevDiffMarks = prevDiffMarks.filter(mark => !prevChildren.includes(mark)), nextDiffMarks = nextDiffMarks.filter(mark => !nextChildren.includes(mark));
|
|
52848
53013
|
}
|
|
52849
|
-
}),
|
|
53014
|
+
}), prevDiffMarks.forEach(mark => diffResult.exit.push({
|
|
52850
53015
|
prev: [mark]
|
|
52851
|
-
})),
|
|
53016
|
+
})), nextDiffMarks.forEach(mark => diffResult.enter.push({
|
|
52852
53017
|
next: [mark]
|
|
52853
53018
|
})), diffResult;
|
|
52854
53019
|
}
|
|
@@ -52861,7 +53026,7 @@
|
|
|
52861
53026
|
});
|
|
52862
53027
|
}
|
|
52863
53028
|
}
|
|
52864
|
-
morph(prevMarks, nextMarks,
|
|
53029
|
+
morph(prevMarks, nextMarks, runningConfig) {
|
|
52865
53030
|
const prevElements = prevMarks.reduce((elements, mark) => (this._appendMorphKeyToElements(mark), elements.concat(mark.elements)), []),
|
|
52866
53031
|
nextElements = nextMarks.reduce((elements, mark) => (this._appendMorphKeyToElements(mark), elements.concat(mark.elements)), []),
|
|
52867
53032
|
diffResult = diffMultiple(prevElements, nextElements, element => {
|
|
@@ -52885,13 +53050,13 @@
|
|
|
52885
53050
|
};
|
|
52886
53051
|
diffResult.enter.forEach(diff => {
|
|
52887
53052
|
diff.next.forEach(element => {
|
|
52888
|
-
this.doMorph([], [element],
|
|
53053
|
+
this.doMorph([], [element], runningConfig, onMorphEnd, parameters);
|
|
52889
53054
|
}), morphCount += 1;
|
|
52890
53055
|
}), diffResult.update.forEach(diff => {
|
|
52891
53056
|
const divideCount = Math.min(diff.prev.length, diff.next.length),
|
|
52892
53057
|
prevDivide = this.divideElements(diff.prev, divideCount),
|
|
52893
53058
|
nextDivide = this.divideElements(diff.next, divideCount);
|
|
52894
|
-
for (let i = 0; i < divideCount; i++) this.doMorph(prevDivide[i], nextDivide[i],
|
|
53059
|
+
for (let i = 0; i < divideCount; i++) this.doMorph(prevDivide[i], nextDivide[i], runningConfig, onMorphEnd, parameters), morphCount += 1;
|
|
52895
53060
|
});
|
|
52896
53061
|
}
|
|
52897
53062
|
diffUpdateByGroup(prev, next, prevKey, nextKey) {
|
|
@@ -52921,7 +53086,7 @@
|
|
|
52921
53086
|
update: update
|
|
52922
53087
|
};
|
|
52923
53088
|
}
|
|
52924
|
-
doMorph(prev, next,
|
|
53089
|
+
doMorph(prev, next, runningConfig, onEnd, parameters) {
|
|
52925
53090
|
var _a, _b;
|
|
52926
53091
|
const morphData = {
|
|
52927
53092
|
prev: prev.map(element => element.getDatum()),
|
|
@@ -52931,11 +53096,11 @@
|
|
|
52931
53096
|
prev: prev.slice(),
|
|
52932
53097
|
next: next.slice()
|
|
52933
53098
|
},
|
|
52934
|
-
easing =
|
|
52935
|
-
delay = invokeFunctionType(
|
|
52936
|
-
duration = invokeFunctionType(
|
|
52937
|
-
oneByOne = invokeFunctionType(
|
|
52938
|
-
splitPath = invokeFunctionType(
|
|
53099
|
+
easing = runningConfig.animation.easing,
|
|
53100
|
+
delay = invokeFunctionType(runningConfig.animation.delay, parameters, morphData, morphElements),
|
|
53101
|
+
duration = invokeFunctionType(runningConfig.animation.duration, parameters, morphData, morphElements),
|
|
53102
|
+
oneByOne = invokeFunctionType(runningConfig.animation.oneByOne, parameters, morphData, morphElements),
|
|
53103
|
+
splitPath = invokeFunctionType(runningConfig.animation.splitPath, parameters, morphData, morphElements),
|
|
52939
53104
|
individualDelay = isValidNumber(oneByOne) && oneByOne > 0 ? index => isNumber(oneByOne) ? index * oneByOne : !0 === oneByOne ? index * duration : 0 : void 0;
|
|
52940
53105
|
1 !== prev.length && 0 !== prev.length || 1 !== next.length ? 1 === prev.length && next.length > 1 ? oneToMultiMorph(prev[0].getGraphicItem(), next.map(element => element.getGraphicItem()), {
|
|
52941
53106
|
delay: delay,
|
|
@@ -53299,7 +53464,7 @@
|
|
|
53299
53464
|
}
|
|
53300
53465
|
}
|
|
53301
53466
|
|
|
53302
|
-
var __awaiter$
|
|
53467
|
+
var __awaiter$2 = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
53303
53468
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
53304
53469
|
function fulfilled(value) {
|
|
53305
53470
|
try {
|
|
@@ -53649,27 +53814,27 @@
|
|
|
53649
53814
|
commit(grammar) {
|
|
53650
53815
|
return this._dataflow.commit(grammar), this;
|
|
53651
53816
|
}
|
|
53652
|
-
run(
|
|
53653
|
-
return this.evaluate(
|
|
53817
|
+
run(runningConfig) {
|
|
53818
|
+
return this.evaluate(runningConfig), this;
|
|
53654
53819
|
}
|
|
53655
|
-
runSync(
|
|
53656
|
-
return this.evaluateSync(
|
|
53820
|
+
runSync(runningConfig) {
|
|
53821
|
+
return this.evaluateSync(runningConfig), this;
|
|
53657
53822
|
}
|
|
53658
53823
|
isRunning() {
|
|
53659
53824
|
return this._running;
|
|
53660
53825
|
}
|
|
53661
|
-
runAsync(
|
|
53662
|
-
return __awaiter$
|
|
53826
|
+
runAsync(runningConfig) {
|
|
53827
|
+
return __awaiter$2(this, void 0, void 0, function* () {
|
|
53663
53828
|
for (; this._running;) yield this._running;
|
|
53664
53829
|
const clear = () => {
|
|
53665
53830
|
this._running = null;
|
|
53666
53831
|
};
|
|
53667
|
-
return (this._running = this.evaluate(
|
|
53832
|
+
return (this._running = this.evaluate(runningConfig)).then(clear, clear), this._running;
|
|
53668
53833
|
});
|
|
53669
53834
|
}
|
|
53670
|
-
runNextTick(
|
|
53671
|
-
return __awaiter$
|
|
53672
|
-
return this._currentDataflow || (this._currentDataflow = Promise.resolve().then(() => this.runAsync(
|
|
53835
|
+
runNextTick(runningConfig) {
|
|
53836
|
+
return __awaiter$2(this, void 0, void 0, function* () {
|
|
53837
|
+
return this._currentDataflow || (this._currentDataflow = Promise.resolve().then(() => this.runAsync(runningConfig).then(() => {
|
|
53673
53838
|
this._currentDataflow = null;
|
|
53674
53839
|
}).catch(e => {
|
|
53675
53840
|
this._currentDataflow = null, this.logger.error(e);
|
|
@@ -53679,34 +53844,34 @@
|
|
|
53679
53844
|
doRender(immediately) {
|
|
53680
53845
|
this.emit(HOOK_EVENT.BEFORE_DO_RENDER), this.renderer && (this._progressiveMarks || this.animate.animate(), this.renderer.render(immediately), this.handleRenderEnd()), this.emit(HOOK_EVENT.AFTER_DO_RENDER);
|
|
53681
53846
|
}
|
|
53682
|
-
evaluate(
|
|
53847
|
+
evaluate(runningConfig) {
|
|
53683
53848
|
var _a, _b;
|
|
53684
|
-
return __awaiter$
|
|
53685
|
-
const
|
|
53686
|
-
this.reuseCachedGrammars(
|
|
53849
|
+
return __awaiter$2(this, void 0, void 0, function* () {
|
|
53850
|
+
const normalizedRunningConfig = normalizeRunningConfig(runningConfig);
|
|
53851
|
+
this.reuseCachedGrammars(normalizedRunningConfig);
|
|
53687
53852
|
const grammarWillDetach = this._cachedGrammars.size() > 0;
|
|
53688
53853
|
this.detachCachedGrammar();
|
|
53689
53854
|
const hasResize = this._resizeRenderer(),
|
|
53690
53855
|
hasUpdate = this._dataflow.hasCommitted();
|
|
53691
53856
|
return grammarWillDetach || hasUpdate || this._layoutState || hasResize ? (this.clearProgressive(), yield this._dataflow.evaluate(), this._needBuildLayoutTree && (this.buildLayoutTree(), this._needBuildLayoutTree = !1), this._layoutState && (this._layoutState = LayoutState.layouting, this.doLayout(), this._dataflow.hasCommitted() && (this._layoutState = LayoutState.reevaluate, yield this._dataflow.evaluate()), this._layoutState = LayoutState.after, (null === (_a = this._layoutMarks) || void 0 === _a ? void 0 : _a.length) && this.handleLayoutEnd()), this._layoutState = null, this.findProgressiveMarks(), this._resizeRenderer(), this.doRender(!1), null === (_b = this._willMorphMarks) || void 0 === _b || _b.forEach(morphMarks => {
|
|
53692
|
-
this._morph.morph(morphMarks.prev, morphMarks.next,
|
|
53693
|
-
}), this._willMorphMarks = null, this.releaseCachedGrammars(), this.doPreProgressive(), this) : this;
|
|
53857
|
+
this._morph.morph(morphMarks.prev, morphMarks.next, normalizedRunningConfig);
|
|
53858
|
+
}), this._willMorphMarks = null, this.releaseCachedGrammars(normalizedRunningConfig), this.doPreProgressive(), this) : this;
|
|
53694
53859
|
});
|
|
53695
53860
|
}
|
|
53696
|
-
evaluateSync(
|
|
53861
|
+
evaluateSync(runningConfig) {
|
|
53697
53862
|
var _a, _b;
|
|
53698
|
-
const
|
|
53699
|
-
this.reuseCachedGrammars(
|
|
53863
|
+
const normalizedRunningConfig = normalizeRunningConfig(runningConfig);
|
|
53864
|
+
this.reuseCachedGrammars(normalizedRunningConfig);
|
|
53700
53865
|
const grammarWillDetach = this._cachedGrammars.size() > 0;
|
|
53701
|
-
this.
|
|
53866
|
+
this.detachCachedGrammar();
|
|
53702
53867
|
const hasResize = this._resizeRenderer(),
|
|
53703
53868
|
hasUpdate = this._dataflow.hasCommitted();
|
|
53704
53869
|
return grammarWillDetach || hasUpdate || this._layoutState || hasResize ? (this.clearProgressive(), this._dataflow.evaluateSync(), this._needBuildLayoutTree && (this.buildLayoutTree(), this._needBuildLayoutTree = !1), this._layoutState && (this._layoutState = LayoutState.layouting, this.doLayout(), this._dataflow.hasCommitted() && (this._layoutState = LayoutState.reevaluate, this._dataflow.evaluateSync()), this._layoutState = LayoutState.after, (null === (_a = this._layoutMarks) || void 0 === _a ? void 0 : _a.length) && this.handleLayoutEnd()), this._layoutState = null, this.findProgressiveMarks(), this._resizeRenderer(), this.doRender(!0), null === (_b = this._willMorphMarks) || void 0 === _b || _b.forEach(morphMarks => {
|
|
53705
|
-
this._morph.morph(morphMarks.prev, morphMarks.next,
|
|
53706
|
-
}), this._willMorphMarks = null, this.releaseCachedGrammars(), this.doPreProgressive(), this) : this;
|
|
53870
|
+
this._morph.morph(morphMarks.prev, morphMarks.next, normalizedRunningConfig);
|
|
53871
|
+
}), this._willMorphMarks = null, this.releaseCachedGrammars(normalizedRunningConfig), this.doPreProgressive(), this) : this;
|
|
53707
53872
|
}
|
|
53708
|
-
reuseCachedGrammars(
|
|
53709
|
-
if (this._willMorphMarks || (this._willMorphMarks = []),
|
|
53873
|
+
reuseCachedGrammars(runningConfig) {
|
|
53874
|
+
if (this._willMorphMarks || (this._willMorphMarks = []), runningConfig.reuse) {
|
|
53710
53875
|
const reuseDiffUpdate = diff => {
|
|
53711
53876
|
diff.next.reuse(diff.prev), diff.prev.detachAll(), diff.prev.clear(), this._cachedGrammars.unrecord(diff.prev);
|
|
53712
53877
|
};
|
|
@@ -53715,8 +53880,10 @@
|
|
|
53715
53880
|
this._morph.diffGrammar(this._cachedGrammars.getAllScales(), this.grammars.getAllScales()).update.forEach(reuseDiffUpdate);
|
|
53716
53881
|
this._morph.diffGrammar(this._cachedGrammars.getAllCoordinates(), this.grammars.getAllCoordinates()).update.forEach(reuseDiffUpdate);
|
|
53717
53882
|
}
|
|
53718
|
-
this._morph.diffMark(this._cachedGrammars.getAllMarks(), this.grammars.getAllMarks().filter(mark => "root" !== mark.id()),
|
|
53719
|
-
1 === diff.prev.length && 1 === diff.next.length && diff.prev[0].markType === diff.next[0].markType
|
|
53883
|
+
this._morph.diffMark(this._cachedGrammars.getAllMarks(), this.grammars.getAllMarks().filter(mark => "root" !== mark.id()), runningConfig).update.forEach(diff => {
|
|
53884
|
+
const matched = 1 === diff.prev.length && 1 === diff.next.length && diff.prev[0].markType === diff.next[0].markType,
|
|
53885
|
+
enableMarkMorphConfig = diff.prev.every(mark => mark.getMorphConfig().morph) && diff.next.every(mark => mark.getMorphConfig().morph);
|
|
53886
|
+
matched && runningConfig.reuse ? (diff.next[0].reuse(diff.prev[0]), diff.prev[0].detachAll(), diff.prev[0].clear(), this._cachedGrammars.unrecord(diff.prev[0])) : (runningConfig.morph && enableMarkMorphConfig || runningConfig.morphAll) && this._willMorphMarks.push({
|
|
53720
53887
|
prev: diff.prev,
|
|
53721
53888
|
next: diff.next
|
|
53722
53889
|
});
|
|
@@ -53731,21 +53898,22 @@
|
|
|
53731
53898
|
}
|
|
53732
53899
|
});
|
|
53733
53900
|
}
|
|
53734
|
-
releaseCachedGrammars() {
|
|
53901
|
+
releaseCachedGrammars(runningConfig) {
|
|
53735
53902
|
this._cachedGrammars.traverse(grammar => {
|
|
53736
53903
|
"mark" !== grammar.grammarType && grammar.release();
|
|
53737
53904
|
});
|
|
53738
|
-
const markNodes = this._cachedGrammars.getAllMarkNodes()
|
|
53739
|
-
|
|
53740
|
-
|
|
53741
|
-
|
|
53742
|
-
|
|
53743
|
-
|
|
53744
|
-
|
|
53745
|
-
|
|
53905
|
+
const markNodes = this._cachedGrammars.getAllMarkNodes();
|
|
53906
|
+
markNodes.forEach(node => {
|
|
53907
|
+
node.mark.animate.stop(), runningConfig.enableExitAnimation && node.mark.animate.animate();
|
|
53908
|
+
});
|
|
53909
|
+
const releaseUp = node => {
|
|
53910
|
+
if (node.mark.view && 0 === node.mark.animate.getAnimatorCount() && (!node.children || 0 === node.children.length)) {
|
|
53911
|
+
node.mark.release();
|
|
53912
|
+
const parent = node.parent;
|
|
53913
|
+
parent && (node.parent.children = node.parent.children.filter(n => n !== node), node.parent = null, releaseUp(parent));
|
|
53914
|
+
}
|
|
53915
|
+
};
|
|
53746
53916
|
markNodes.forEach(node => {
|
|
53747
|
-
node.mark.animate.animate();
|
|
53748
|
-
}), markNodes.forEach(node => {
|
|
53749
53917
|
const mark = node.mark;
|
|
53750
53918
|
0 === mark.animate.getAnimatorCount() ? releaseUp(node) : mark.addEventListener("animationEnd", () => {
|
|
53751
53919
|
0 === mark.animate.getAnimatorCount() && releaseUp(node);
|
|
@@ -53806,7 +53974,7 @@
|
|
|
53806
53974
|
}
|
|
53807
53975
|
resize(width, height) {
|
|
53808
53976
|
let render = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
53809
|
-
return __awaiter$
|
|
53977
|
+
return __awaiter$2(this, void 0, void 0, function* () {
|
|
53810
53978
|
let needDataflow = !1;
|
|
53811
53979
|
return width !== this.width() && (needDataflow = !0, this.updateSignal(SIGNAL_WIDTH, width)), height !== this.height() && (needDataflow = !0, this.updateSignal(SIGNAL_HEIGHT, height)), needDataflow && (render ? yield this.evaluate() : yield this._dataflow.evaluate()), this;
|
|
53812
53980
|
});
|
|
@@ -54150,6 +54318,9 @@
|
|
|
54150
54318
|
const STACK_FIELD_END_PERCENT = `${PREFIX}_STACK_END_PERCENT`;
|
|
54151
54319
|
const STACK_FIELD_START_OffsetSilhouette = `${PREFIX}_STACK_START_OffsetSilhouette`;
|
|
54152
54320
|
const STACK_FIELD_END_OffsetSilhouette = `${PREFIX}_STACK_END_OffsetSilhouette`;
|
|
54321
|
+
const STACK_FIELD_TOTAL = `${PREFIX}_STACK_TOTAL`;
|
|
54322
|
+
const STACK_FIELD_TOTAL_PERCENT = `${PREFIX}_STACK_TOTAL_PERCENT`;
|
|
54323
|
+
const STACK_FIELD_TOTAL_TOP = `${PREFIX}_STACK_TOTAL_TOP`;
|
|
54153
54324
|
const SEGMENT_FIELD_START = `${PREFIX}_SEGMENT_START`;
|
|
54154
54325
|
const SEGMENT_FIELD_END = `${PREFIX}_SEGMENT_END`;
|
|
54155
54326
|
var LayoutZIndex;
|
|
@@ -54320,7 +54491,6 @@
|
|
|
54320
54491
|
},
|
|
54321
54492
|
label: {
|
|
54322
54493
|
style: {
|
|
54323
|
-
fill: 'white',
|
|
54324
54494
|
textAlign: 'center',
|
|
54325
54495
|
textBaseline: 'middle',
|
|
54326
54496
|
fontSize: 12
|
|
@@ -54592,7 +54762,7 @@
|
|
|
54592
54762
|
delayTime: 0
|
|
54593
54763
|
};
|
|
54594
54764
|
|
|
54595
|
-
const fontSize$
|
|
54765
|
+
const fontSize$3 = THEME_CONSTANTS.LABEL_FONT_SIZE;
|
|
54596
54766
|
const crosshair = {
|
|
54597
54767
|
trigger: 'hover',
|
|
54598
54768
|
xField: {
|
|
@@ -54611,7 +54781,7 @@
|
|
|
54611
54781
|
style: {
|
|
54612
54782
|
fontWeight: 'normal',
|
|
54613
54783
|
fill: '#fff',
|
|
54614
|
-
fontSize: fontSize$
|
|
54784
|
+
fontSize: fontSize$3
|
|
54615
54785
|
},
|
|
54616
54786
|
labelBackground: {
|
|
54617
54787
|
padding: {
|
|
@@ -54643,7 +54813,7 @@
|
|
|
54643
54813
|
style: {
|
|
54644
54814
|
fontWeight: 'normal',
|
|
54645
54815
|
fill: '#fff',
|
|
54646
|
-
fontSize: fontSize$
|
|
54816
|
+
fontSize: fontSize$3
|
|
54647
54817
|
},
|
|
54648
54818
|
labelBackground: {
|
|
54649
54819
|
padding: {
|
|
@@ -54675,7 +54845,7 @@
|
|
|
54675
54845
|
style: {
|
|
54676
54846
|
fontWeight: 'normal',
|
|
54677
54847
|
fill: '#fff',
|
|
54678
|
-
fontSize: fontSize$
|
|
54848
|
+
fontSize: fontSize$3
|
|
54679
54849
|
},
|
|
54680
54850
|
labelBackground: {
|
|
54681
54851
|
padding: {
|
|
@@ -54707,7 +54877,7 @@
|
|
|
54707
54877
|
style: {
|
|
54708
54878
|
fontWeight: 'normal',
|
|
54709
54879
|
fill: '#fff',
|
|
54710
|
-
fontSize: fontSize$
|
|
54880
|
+
fontSize: fontSize$3
|
|
54711
54881
|
},
|
|
54712
54882
|
labelBackground: {
|
|
54713
54883
|
padding: {
|
|
@@ -54994,8 +55164,8 @@
|
|
|
54994
55164
|
} }, DEFAULT_CONTINUOUS_LEGEND_THEME)
|
|
54995
55165
|
};
|
|
54996
55166
|
|
|
54997
|
-
const fontSize$
|
|
54998
|
-
const fontFamily = THEME_CONSTANTS.FONT_FAMILY;
|
|
55167
|
+
const fontSize$2 = THEME_CONSTANTS.LABEL_FONT_SIZE;
|
|
55168
|
+
const fontFamily$1 = THEME_CONSTANTS.FONT_FAMILY;
|
|
54999
55169
|
const mapLabel = {
|
|
55000
55170
|
visible: true,
|
|
55001
55171
|
offset: 12,
|
|
@@ -55007,8 +55177,8 @@
|
|
|
55007
55177
|
textBaseline: 'middle',
|
|
55008
55178
|
textAlign: 'left',
|
|
55009
55179
|
fill: 'black',
|
|
55010
|
-
fontSize: fontSize$
|
|
55011
|
-
fontFamily
|
|
55180
|
+
fontSize: fontSize$2,
|
|
55181
|
+
fontFamily: fontFamily$1
|
|
55012
55182
|
}
|
|
55013
55183
|
},
|
|
55014
55184
|
valueLabel: {
|
|
@@ -55017,8 +55187,8 @@
|
|
|
55017
55187
|
textBaseline: 'middle',
|
|
55018
55188
|
textAlign: 'left',
|
|
55019
55189
|
fill: 'black',
|
|
55020
|
-
fontSize: fontSize$
|
|
55021
|
-
fontFamily
|
|
55190
|
+
fontSize: fontSize$2,
|
|
55191
|
+
fontFamily: fontFamily$1
|
|
55022
55192
|
}
|
|
55023
55193
|
},
|
|
55024
55194
|
background: {
|
|
@@ -55220,7 +55390,7 @@
|
|
|
55220
55390
|
}
|
|
55221
55391
|
};
|
|
55222
55392
|
|
|
55223
|
-
const fontSize = THEME_CONSTANTS.LABEL_FONT_SIZE;
|
|
55393
|
+
const fontSize$1 = THEME_CONSTANTS.LABEL_FONT_SIZE;
|
|
55224
55394
|
const tooltip = {
|
|
55225
55395
|
offset: {
|
|
55226
55396
|
x: 10,
|
|
@@ -55262,7 +55432,7 @@
|
|
|
55262
55432
|
spacing: 6
|
|
55263
55433
|
},
|
|
55264
55434
|
keyLabel: {
|
|
55265
|
-
fontSize,
|
|
55435
|
+
fontSize: fontSize$1,
|
|
55266
55436
|
fontColor: '#4E5969',
|
|
55267
55437
|
textAlign: 'left',
|
|
55268
55438
|
lineHeight: 18,
|
|
@@ -55270,7 +55440,7 @@
|
|
|
55270
55440
|
spacing: 26
|
|
55271
55441
|
},
|
|
55272
55442
|
valueLabel: {
|
|
55273
|
-
fontSize,
|
|
55443
|
+
fontSize: fontSize$1,
|
|
55274
55444
|
fontColor: '#4E5969',
|
|
55275
55445
|
lineHeight: 18,
|
|
55276
55446
|
textBaseline: 'middle',
|
|
@@ -55306,6 +55476,24 @@
|
|
|
55306
55476
|
}
|
|
55307
55477
|
};
|
|
55308
55478
|
|
|
55479
|
+
const fontSize = THEME_CONSTANTS.LABEL_FONT_SIZE;
|
|
55480
|
+
const fontFamily = THEME_CONSTANTS.FONT_FAMILY;
|
|
55481
|
+
const totalLabel = {
|
|
55482
|
+
visible: false,
|
|
55483
|
+
offset: 5,
|
|
55484
|
+
overlap: {
|
|
55485
|
+
clampForce: true,
|
|
55486
|
+
strategy: []
|
|
55487
|
+
},
|
|
55488
|
+
smartInvert: false,
|
|
55489
|
+
animation: false,
|
|
55490
|
+
style: {
|
|
55491
|
+
fontSize,
|
|
55492
|
+
fontFamily,
|
|
55493
|
+
fill: 'black'
|
|
55494
|
+
}
|
|
55495
|
+
};
|
|
55496
|
+
|
|
55309
55497
|
const component = {
|
|
55310
55498
|
discreteLegend,
|
|
55311
55499
|
colorLegend,
|
|
@@ -55328,7 +55516,8 @@
|
|
|
55328
55516
|
indicator,
|
|
55329
55517
|
title,
|
|
55330
55518
|
mapLabel,
|
|
55331
|
-
poptip
|
|
55519
|
+
poptip,
|
|
55520
|
+
totalLabel
|
|
55332
55521
|
};
|
|
55333
55522
|
|
|
55334
55523
|
const lightTheme = {
|
|
@@ -56360,7 +56549,8 @@
|
|
|
56360
56549
|
discreteLegend: 'legend',
|
|
56361
56550
|
continuousLegend: 'legend',
|
|
56362
56551
|
colorLegend: 'legend',
|
|
56363
|
-
sizeLegend: 'legend'
|
|
56552
|
+
sizeLegend: 'legend',
|
|
56553
|
+
label: 'label'
|
|
56364
56554
|
};
|
|
56365
56555
|
class EventDispatcher {
|
|
56366
56556
|
constructor(vchart, compiler) {
|
|
@@ -56482,6 +56672,12 @@
|
|
|
56482
56672
|
if (filter.type && modelType !== filter.type) {
|
|
56483
56673
|
return false;
|
|
56484
56674
|
}
|
|
56675
|
+
if (filter.level === 'mark' && !filter.type && !(params === null || params === void 0 ? void 0 : params.mark)) {
|
|
56676
|
+
return false;
|
|
56677
|
+
}
|
|
56678
|
+
if (filter.level === 'model' && !filter.type && !(params === null || params === void 0 ? void 0 : params.model)) {
|
|
56679
|
+
return false;
|
|
56680
|
+
}
|
|
56485
56681
|
if (isValid(filter.userId) && ((_c = params.model) === null || _c === void 0 ? void 0 : _c.userId) !== filter.userId) {
|
|
56486
56682
|
return false;
|
|
56487
56683
|
}
|
|
@@ -56950,7 +57146,7 @@
|
|
|
56950
57146
|
}
|
|
56951
57147
|
renderAsync(morphConfig) {
|
|
56952
57148
|
var _a;
|
|
56953
|
-
return __awaiter$
|
|
57149
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
|
56954
57150
|
this.initView();
|
|
56955
57151
|
if (!this._view) {
|
|
56956
57152
|
return Promise.reject('srView init fail');
|
|
@@ -56977,6 +57173,8 @@
|
|
|
56977
57173
|
if (!this._view) {
|
|
56978
57174
|
return Promise.reject();
|
|
56979
57175
|
}
|
|
57176
|
+
this._width = width;
|
|
57177
|
+
this._height = height;
|
|
56980
57178
|
this._view.resize(width, height);
|
|
56981
57179
|
return this.reRenderAsync({ morph: false });
|
|
56982
57180
|
}
|
|
@@ -57185,7 +57383,7 @@
|
|
|
57185
57383
|
}
|
|
57186
57384
|
function getCanvasDataURL(c, ctx) {
|
|
57187
57385
|
var _a;
|
|
57188
|
-
return __awaiter$
|
|
57386
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
|
57189
57387
|
if (!c) {
|
|
57190
57388
|
return '';
|
|
57191
57389
|
}
|
|
@@ -57201,6 +57399,62 @@
|
|
|
57201
57399
|
});
|
|
57202
57400
|
}
|
|
57203
57401
|
|
|
57402
|
+
function setDefaultCrosshairForCartesianChart(spec) {
|
|
57403
|
+
spec.crosshair = array(spec.crosshair || {}).map(crosshairCfg => {
|
|
57404
|
+
return merge$2({
|
|
57405
|
+
[spec.direction === Direction$2.horizontal ? 'yField' : 'xField']: {
|
|
57406
|
+
visible: true,
|
|
57407
|
+
line: {
|
|
57408
|
+
visible: true,
|
|
57409
|
+
type: 'rect'
|
|
57410
|
+
}
|
|
57411
|
+
}
|
|
57412
|
+
}, crosshairCfg);
|
|
57413
|
+
});
|
|
57414
|
+
}
|
|
57415
|
+
function calculateChartSize(spec, option) {
|
|
57416
|
+
var _a;
|
|
57417
|
+
const { width: userWidth, height: userHeight } = spec;
|
|
57418
|
+
if (isValid(userWidth) && isValid(userHeight)) {
|
|
57419
|
+
return {
|
|
57420
|
+
width: userWidth,
|
|
57421
|
+
height: userHeight
|
|
57422
|
+
};
|
|
57423
|
+
}
|
|
57424
|
+
let width = DEFAULT_CHART_WIDTH;
|
|
57425
|
+
let height = DEFAULT_CHART_HEIGHT;
|
|
57426
|
+
const container = option.container;
|
|
57427
|
+
const canvas = option.canvas;
|
|
57428
|
+
if (container) {
|
|
57429
|
+
const { width: containerWidth, height: containerHeight } = getContainerSize(container, DEFAULT_CHART_WIDTH, DEFAULT_CHART_HEIGHT);
|
|
57430
|
+
width = containerWidth;
|
|
57431
|
+
height = containerHeight;
|
|
57432
|
+
}
|
|
57433
|
+
else if (canvas && isTrueBrowser(option.mode)) {
|
|
57434
|
+
let canvasNode;
|
|
57435
|
+
if (isString(canvas)) {
|
|
57436
|
+
canvasNode = document === null || document === void 0 ? void 0 : document.getElementById(canvas);
|
|
57437
|
+
}
|
|
57438
|
+
else {
|
|
57439
|
+
canvasNode = canvas;
|
|
57440
|
+
}
|
|
57441
|
+
const { width: containerWidth, height: containerHeight } = getContainerSize(canvasNode, DEFAULT_CHART_WIDTH, DEFAULT_CHART_HEIGHT);
|
|
57442
|
+
width = containerWidth;
|
|
57443
|
+
height = containerHeight;
|
|
57444
|
+
}
|
|
57445
|
+
else if (isMiniAppLikeMode(option.mode) && ((_a = option.modeParams) === null || _a === void 0 ? void 0 : _a.domref)) {
|
|
57446
|
+
const domRef = option.modeParams.domref;
|
|
57447
|
+
width = domRef.width;
|
|
57448
|
+
height = domRef.height;
|
|
57449
|
+
}
|
|
57450
|
+
width = userWidth !== null && userWidth !== void 0 ? userWidth : width;
|
|
57451
|
+
height = userHeight !== null && userHeight !== void 0 ? userHeight : height;
|
|
57452
|
+
return {
|
|
57453
|
+
width,
|
|
57454
|
+
height
|
|
57455
|
+
};
|
|
57456
|
+
}
|
|
57457
|
+
|
|
57204
57458
|
class VChart {
|
|
57205
57459
|
static useChart(charts) {
|
|
57206
57460
|
charts.forEach(c => Factory.registerChart(c.type, c));
|
|
@@ -57249,7 +57503,6 @@
|
|
|
57249
57503
|
throw new Error(msg);
|
|
57250
57504
|
}
|
|
57251
57505
|
};
|
|
57252
|
-
this._curSize = { width: 0, height: 0 };
|
|
57253
57506
|
this._observer = null;
|
|
57254
57507
|
this._context = {};
|
|
57255
57508
|
this._onResize = debounce((...args) => {
|
|
@@ -57282,10 +57535,17 @@
|
|
|
57282
57535
|
this._currentThemeName = ThemeManager.getCurrentThemeName();
|
|
57283
57536
|
this._setSpec(spec);
|
|
57284
57537
|
this._updateCurrentTheme();
|
|
57538
|
+
this._curSize = calculateChartSize(this._spec, {
|
|
57539
|
+
container: this._container,
|
|
57540
|
+
canvas: this._canvas,
|
|
57541
|
+
mode: this._option.mode || exports.RenderModeEnum['desktop-browser'],
|
|
57542
|
+
modeParams: this._option.modeParams
|
|
57543
|
+
});
|
|
57285
57544
|
this._compiler = new Compiler({
|
|
57286
57545
|
dom: (_a = this._container) !== null && _a !== void 0 ? _a : 'none',
|
|
57287
57546
|
canvas: renderCanvas
|
|
57288
57547
|
}, Object.assign(Object.assign({ mode: this._option.mode, stage, pluginList: poptip !== false ? ['poptipForText'] : [] }, restOptions), { background: this._getBackground(), onError: this._onError }));
|
|
57548
|
+
this._compiler.setSize(this._curSize.width, this._curSize.height);
|
|
57289
57549
|
this._eventDispatcher = new EventDispatcher(this, this._compiler);
|
|
57290
57550
|
this._event = new Event$1(this._eventDispatcher, mode);
|
|
57291
57551
|
this._compiler.initView();
|
|
@@ -57294,10 +57554,6 @@
|
|
|
57294
57554
|
});
|
|
57295
57555
|
this._initDataSet(this._option.dataSet);
|
|
57296
57556
|
this._autoSize = isTrueBrowser(mode) ? (_d = (_c = spec.autoFit) !== null && _c !== void 0 ? _c : this._option.autoFit) !== null && _d !== void 0 ? _d : true : false;
|
|
57297
|
-
this._curSize = {
|
|
57298
|
-
width: spec.width || 0,
|
|
57299
|
-
height: spec.height || 0
|
|
57300
|
-
};
|
|
57301
57557
|
this._bindResizeEvent();
|
|
57302
57558
|
this._bindVGrammarViewEvent();
|
|
57303
57559
|
this._event.emit(ChartEvent.initialized, {});
|
|
@@ -57352,6 +57608,7 @@
|
|
|
57352
57608
|
return;
|
|
57353
57609
|
}
|
|
57354
57610
|
this._chart = chart;
|
|
57611
|
+
this._chart.setCanvasRect(this._curSize.width, this._curSize.height);
|
|
57355
57612
|
this._chart.created();
|
|
57356
57613
|
this._chart.init({});
|
|
57357
57614
|
}
|
|
@@ -57411,7 +57668,7 @@
|
|
|
57411
57668
|
}
|
|
57412
57669
|
}
|
|
57413
57670
|
updateCustomConfigAndRerender(modifyConfig, morphConfig) {
|
|
57414
|
-
return __awaiter$
|
|
57671
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
|
57415
57672
|
const result = modifyConfig();
|
|
57416
57673
|
if (!isValid(result)) {
|
|
57417
57674
|
return this;
|
|
@@ -57473,7 +57730,7 @@
|
|
|
57473
57730
|
}
|
|
57474
57731
|
renderAsync(morphConfig) {
|
|
57475
57732
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
57476
|
-
return __awaiter$
|
|
57733
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
|
57477
57734
|
if (!this._chart) {
|
|
57478
57735
|
(_b = (_a = this._option.performanceHook) === null || _a === void 0 ? void 0 : _a.beforeInitializeChart) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
57479
57736
|
this._initChart(this._spec);
|
|
@@ -57518,7 +57775,7 @@
|
|
|
57518
57775
|
InstanceManager.unregisterInstance(this);
|
|
57519
57776
|
}
|
|
57520
57777
|
updateData(id, data, options) {
|
|
57521
|
-
return __awaiter$
|
|
57778
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
|
57522
57779
|
if (isNil(this._dataSet)) {
|
|
57523
57780
|
return this;
|
|
57524
57781
|
}
|
|
@@ -57552,7 +57809,7 @@
|
|
|
57552
57809
|
});
|
|
57553
57810
|
}
|
|
57554
57811
|
updateDataInBatches(list) {
|
|
57555
|
-
return __awaiter$
|
|
57812
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
|
57556
57813
|
if (this._chart) {
|
|
57557
57814
|
list.forEach(({ id, data, options }) => {
|
|
57558
57815
|
this._chart.updateData(id, data, false, options);
|
|
@@ -57621,7 +57878,7 @@
|
|
|
57621
57878
|
return this;
|
|
57622
57879
|
}
|
|
57623
57880
|
updateFullData(data, reRender = true) {
|
|
57624
|
-
return __awaiter$
|
|
57881
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
|
57625
57882
|
if (this._chart) {
|
|
57626
57883
|
this._chart.updateFullData(data);
|
|
57627
57884
|
if (reRender) {
|
|
@@ -57648,7 +57905,7 @@
|
|
|
57648
57905
|
});
|
|
57649
57906
|
}
|
|
57650
57907
|
updateSpec(spec, forceMerge = false, morphConfig) {
|
|
57651
|
-
return __awaiter$
|
|
57908
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
|
57652
57909
|
if (!spec) {
|
|
57653
57910
|
return this;
|
|
57654
57911
|
}
|
|
@@ -57691,7 +57948,7 @@
|
|
|
57691
57948
|
}
|
|
57692
57949
|
resize(width, height) {
|
|
57693
57950
|
var _a, _b, _c, _d, _e, _f;
|
|
57694
|
-
return __awaiter$
|
|
57951
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
|
57695
57952
|
if (!this._chart || !this._compiler) {
|
|
57696
57953
|
return this;
|
|
57697
57954
|
}
|
|
@@ -57769,7 +58026,7 @@
|
|
|
57769
58026
|
return this._currentThemeName;
|
|
57770
58027
|
}
|
|
57771
58028
|
setCurrentTheme(name) {
|
|
57772
|
-
return __awaiter$
|
|
58029
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
|
57773
58030
|
if (!ThemeManager.themeExist(name)) {
|
|
57774
58031
|
return this;
|
|
57775
58032
|
}
|
|
@@ -57878,7 +58135,7 @@
|
|
|
57878
58135
|
}
|
|
57879
58136
|
}
|
|
57880
58137
|
getDataURL() {
|
|
57881
|
-
return __awaiter$
|
|
58138
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
|
57882
58139
|
const stage = this.getStage();
|
|
57883
58140
|
if (this._chart && stage) {
|
|
57884
58141
|
stage.render();
|
|
@@ -57893,7 +58150,7 @@
|
|
|
57893
58150
|
});
|
|
57894
58151
|
}
|
|
57895
58152
|
exportImg(name) {
|
|
57896
|
-
return __awaiter$
|
|
58153
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
|
57897
58154
|
if (!isTrueBrowser(this._option.mode)) {
|
|
57898
58155
|
this._option.onError(new TypeError(`non-browser environment can not export img`));
|
|
57899
58156
|
return;
|
|
@@ -58830,6 +59087,8 @@
|
|
|
58830
59087
|
}
|
|
58831
59088
|
init(option) {
|
|
58832
59089
|
}
|
|
59090
|
+
afterInit() {
|
|
59091
|
+
}
|
|
58833
59092
|
onLayoutStart(layoutRect, viewRect, ctx) {
|
|
58834
59093
|
super.onLayoutStart(layoutRect, viewRect, ctx);
|
|
58835
59094
|
this._isLayout = true;
|
|
@@ -58873,6 +59132,7 @@
|
|
|
58873
59132
|
const result = {
|
|
58874
59133
|
change: false,
|
|
58875
59134
|
reMake: false,
|
|
59135
|
+
reMakeData: false,
|
|
58876
59136
|
reRender: false,
|
|
58877
59137
|
reSize: false,
|
|
58878
59138
|
reCompile: false
|
|
@@ -60806,7 +61066,7 @@
|
|
|
60806
61066
|
VChart.useMark([ComponentMark, GroupMark, ImageMark]);
|
|
60807
61067
|
Factory.registerRegion('region', Region);
|
|
60808
61068
|
Factory.registerLayout('base', Layout);
|
|
60809
|
-
const version = "1.3.0-beta.
|
|
61069
|
+
const version = "1.3.0-beta.7";
|
|
60810
61070
|
Logger.getInstance(LoggerLevel.Error);
|
|
60811
61071
|
|
|
60812
61072
|
var SeriesMarkNameEnum;
|
|
@@ -61211,6 +61471,13 @@
|
|
|
61211
61471
|
for (const key in stackCache.nodes) {
|
|
61212
61472
|
this.stackOffsetSilhouette(stackCache.nodes[key]);
|
|
61213
61473
|
}
|
|
61474
|
+
model.getSeries().forEach(s => {
|
|
61475
|
+
const stackData = s.getStackData();
|
|
61476
|
+
const stackValueField = s.getStackValueField();
|
|
61477
|
+
if (stackData && stackValueField) {
|
|
61478
|
+
this.stackTotal(stackCache, stackValueField);
|
|
61479
|
+
}
|
|
61480
|
+
});
|
|
61214
61481
|
};
|
|
61215
61482
|
this._chart = chart;
|
|
61216
61483
|
}
|
|
@@ -61224,6 +61491,25 @@
|
|
|
61224
61491
|
this.stackRegion({ model: r });
|
|
61225
61492
|
});
|
|
61226
61493
|
}
|
|
61494
|
+
stackTotal(stackData, valueField) {
|
|
61495
|
+
if ('values' in stackData && stackData.values.length) {
|
|
61496
|
+
const total = sum(stackData.values, valueField);
|
|
61497
|
+
const percent = max$2(stackData.values, STACK_FIELD_END_PERCENT);
|
|
61498
|
+
stackData.values.forEach(v => {
|
|
61499
|
+
v[STACK_FIELD_TOTAL] = total;
|
|
61500
|
+
v[STACK_FIELD_TOTAL_PERCENT] = percent;
|
|
61501
|
+
delete v[STACK_FIELD_TOTAL_TOP];
|
|
61502
|
+
});
|
|
61503
|
+
const maxNode = stackData.values.reduce((max, current) => {
|
|
61504
|
+
return current[STACK_FIELD_END] > max[STACK_FIELD_END] ? current : max;
|
|
61505
|
+
});
|
|
61506
|
+
maxNode[STACK_FIELD_TOTAL_TOP] = true;
|
|
61507
|
+
return;
|
|
61508
|
+
}
|
|
61509
|
+
for (const key in stackData.nodes) {
|
|
61510
|
+
this.stackTotal(stackData.nodes[key], valueField);
|
|
61511
|
+
}
|
|
61512
|
+
}
|
|
61227
61513
|
stackOffsetSilhouette(stackCache) {
|
|
61228
61514
|
if (!stackCache.values.length) {
|
|
61229
61515
|
return;
|
|
@@ -61730,46 +62016,14 @@
|
|
|
61730
62016
|
}
|
|
61731
62017
|
onRender(option) {
|
|
61732
62018
|
}
|
|
62019
|
+
setCanvasRect(width, height) {
|
|
62020
|
+
this._canvasRect = { width, height };
|
|
62021
|
+
}
|
|
61733
62022
|
getCanvasRect() {
|
|
61734
62023
|
if (this._canvasRect) {
|
|
61735
62024
|
return this._canvasRect;
|
|
61736
62025
|
}
|
|
61737
|
-
|
|
61738
|
-
if (isValid(userWidth) && isValid(userHeight)) {
|
|
61739
|
-
this._canvasRect = {
|
|
61740
|
-
width: userWidth,
|
|
61741
|
-
height: userHeight
|
|
61742
|
-
};
|
|
61743
|
-
}
|
|
61744
|
-
else {
|
|
61745
|
-
let width = DEFAULT_CHART_WIDTH;
|
|
61746
|
-
let height = DEFAULT_CHART_HEIGHT;
|
|
61747
|
-
const container = this._option.container;
|
|
61748
|
-
const canvas = this._option.canvas;
|
|
61749
|
-
if (container) {
|
|
61750
|
-
const { width: containerWidth, height: containerHeight } = getContainerSize(this._option.container, DEFAULT_CHART_WIDTH, DEFAULT_CHART_HEIGHT);
|
|
61751
|
-
width = containerWidth;
|
|
61752
|
-
height = containerHeight;
|
|
61753
|
-
}
|
|
61754
|
-
else if (canvas && isTrueBrowser(this._option.mode)) {
|
|
61755
|
-
let canvasNode;
|
|
61756
|
-
if (isString(canvas)) {
|
|
61757
|
-
canvasNode = document === null || document === void 0 ? void 0 : document.getElementById(canvas);
|
|
61758
|
-
}
|
|
61759
|
-
else {
|
|
61760
|
-
canvasNode = canvas;
|
|
61761
|
-
}
|
|
61762
|
-
const { width: containerWidth, height: containerHeight } = getContainerSize(canvasNode, DEFAULT_CHART_WIDTH, DEFAULT_CHART_HEIGHT);
|
|
61763
|
-
width = containerWidth;
|
|
61764
|
-
height = containerHeight;
|
|
61765
|
-
}
|
|
61766
|
-
width = userWidth !== null && userWidth !== void 0 ? userWidth : width;
|
|
61767
|
-
height = userHeight !== null && userHeight !== void 0 ? userHeight : height;
|
|
61768
|
-
this._canvasRect = {
|
|
61769
|
-
width,
|
|
61770
|
-
height
|
|
61771
|
-
};
|
|
61772
|
-
}
|
|
62026
|
+
this._canvasRect = calculateChartSize(this._spec, this._option);
|
|
61773
62027
|
return this._canvasRect;
|
|
61774
62028
|
}
|
|
61775
62029
|
getSeriesData(id, index) {
|
|
@@ -61898,7 +62152,7 @@
|
|
|
61898
62152
|
if (!this._spec.data) {
|
|
61899
62153
|
return;
|
|
61900
62154
|
}
|
|
61901
|
-
array(this._spec.data).forEach(d => {
|
|
62155
|
+
array(this._spec.data).forEach((d, i) => {
|
|
61902
62156
|
const dataView = this._dataSet.getDataView(d.id);
|
|
61903
62157
|
if (dataView) {
|
|
61904
62158
|
if (d.values) {
|
|
@@ -61908,6 +62162,9 @@
|
|
|
61908
62162
|
dataView.updateRawData([]);
|
|
61909
62163
|
}
|
|
61910
62164
|
}
|
|
62165
|
+
else {
|
|
62166
|
+
result.reMakeData = true;
|
|
62167
|
+
}
|
|
61911
62168
|
});
|
|
61912
62169
|
}
|
|
61913
62170
|
updateRegionSpec(result) {
|
|
@@ -61957,7 +62214,19 @@
|
|
|
61957
62214
|
return;
|
|
61958
62215
|
}
|
|
61959
62216
|
this._series.forEach(s => {
|
|
61960
|
-
|
|
62217
|
+
var _a;
|
|
62218
|
+
const spec = this._spec.series[s.getSpecIndex()];
|
|
62219
|
+
if (result.reMakeData) {
|
|
62220
|
+
let values;
|
|
62221
|
+
if (!spec.data) {
|
|
62222
|
+
values = (_a = this.getSeriesData(spec.dataId, spec.dataIndex)) === null || _a === void 0 ? void 0 : _a.latestData;
|
|
62223
|
+
}
|
|
62224
|
+
else {
|
|
62225
|
+
values = spec.data.values;
|
|
62226
|
+
}
|
|
62227
|
+
s.updateRawData(values);
|
|
62228
|
+
}
|
|
62229
|
+
this._mergeUpdateResult(result, s.updateSpec(spec));
|
|
61961
62230
|
s.reInit();
|
|
61962
62231
|
});
|
|
61963
62232
|
}
|
|
@@ -61990,7 +62259,8 @@
|
|
|
61990
62259
|
largeThreshold: spec.largeThreshold,
|
|
61991
62260
|
progressiveStep: spec.progressiveStep,
|
|
61992
62261
|
progressiveThreshold: spec.progressiveThreshold,
|
|
61993
|
-
background: spec.seriesBackground
|
|
62262
|
+
background: spec.seriesBackground,
|
|
62263
|
+
invalidType: spec.invalidType
|
|
61994
62264
|
};
|
|
61995
62265
|
return series;
|
|
61996
62266
|
}
|
|
@@ -62046,7 +62316,7 @@
|
|
|
62046
62316
|
});
|
|
62047
62317
|
}
|
|
62048
62318
|
setSeriesTheme(theme) {
|
|
62049
|
-
this._series.forEach((s) => __awaiter$
|
|
62319
|
+
this._series.forEach((s) => __awaiter$h(this, void 0, void 0, function* () {
|
|
62050
62320
|
yield s.setCurrentTheme(theme.series[s.type], true);
|
|
62051
62321
|
}));
|
|
62052
62322
|
}
|
|
@@ -62324,7 +62594,7 @@
|
|
|
62324
62594
|
return true;
|
|
62325
62595
|
}
|
|
62326
62596
|
_getDefaultSeriesSpec(spec) {
|
|
62327
|
-
const series = Object.assign(Object.assign({}, super._getDefaultSeriesSpec(spec)), { xField: spec.xField, yField: spec.yField, zField: spec.zField, seriesField: spec.seriesField, seriesStyle: spec.seriesStyle, direction: spec.direction, stack: spec.stack, percent: spec.percent, stackOffsetSilhouette: spec.stackOffsetSilhouette });
|
|
62597
|
+
const series = Object.assign(Object.assign({}, super._getDefaultSeriesSpec(spec)), { xField: spec.xField, yField: spec.yField, zField: spec.zField, seriesField: spec.seriesField, seriesStyle: spec.seriesStyle, direction: spec.direction, stack: spec.stack, percent: spec.percent, stackOffsetSilhouette: spec.stackOffsetSilhouette, totalLabel: spec.totalLabel });
|
|
62328
62598
|
const seriesType = this.seriesType;
|
|
62329
62599
|
if (seriesType) {
|
|
62330
62600
|
series.type = seriesType;
|
|
@@ -62423,20 +62693,6 @@
|
|
|
62423
62693
|
ChartTypeEnum["heatmap"] = "heatmap";
|
|
62424
62694
|
})(ChartTypeEnum || (ChartTypeEnum = {}));
|
|
62425
62695
|
|
|
62426
|
-
function setDefaultCrosshairForCartesianChart(spec) {
|
|
62427
|
-
spec.crosshair = array(spec.crosshair || {}).map(crosshairCfg => {
|
|
62428
|
-
return merge$2({
|
|
62429
|
-
[spec.direction === Direction$2.horizontal ? 'yField' : 'xField']: {
|
|
62430
|
-
visible: true,
|
|
62431
|
-
line: {
|
|
62432
|
-
visible: true,
|
|
62433
|
-
type: 'rect'
|
|
62434
|
-
}
|
|
62435
|
-
}
|
|
62436
|
-
}, crosshairCfg);
|
|
62437
|
-
});
|
|
62438
|
-
}
|
|
62439
|
-
|
|
62440
62696
|
const waterfall = (lastData, op) => {
|
|
62441
62697
|
if (!lastData || lastData.length === 0) {
|
|
62442
62698
|
return lastData;
|
|
@@ -62778,6 +63034,11 @@
|
|
|
62778
63034
|
event.on(trigger, { level: Event_Bubble_Level.mark }, this.onUnSelect);
|
|
62779
63035
|
});
|
|
62780
63036
|
}
|
|
63037
|
+
if (!selectTriggerOff) {
|
|
63038
|
+
array(selectTriggerOff !== null && selectTriggerOff !== void 0 ? selectTriggerOff : selectTrigger).forEach(trigger => {
|
|
63039
|
+
event.on(trigger, { level: Event_Bubble_Level.vchart }, this.onUnSelect);
|
|
63040
|
+
});
|
|
63041
|
+
}
|
|
62781
63042
|
}
|
|
62782
63043
|
}
|
|
62783
63044
|
releaseEvent() {
|
|
@@ -63517,17 +63778,14 @@
|
|
|
63517
63778
|
return data;
|
|
63518
63779
|
}
|
|
63519
63780
|
const { invalidType, checkField } = config();
|
|
63520
|
-
if (invalidType
|
|
63521
|
-
data = data.filter((datum) => couldBeValidNumber(datum[checkField]));
|
|
63522
|
-
}
|
|
63523
|
-
else if (invalidType === 'zero') {
|
|
63524
|
-
data.forEach((datum) => {
|
|
63525
|
-
if (!couldBeValidNumber(datum[checkField])) {
|
|
63526
|
-
datum[checkField] = 0;
|
|
63527
|
-
}
|
|
63528
|
-
});
|
|
63781
|
+
if (invalidType !== 'zero') {
|
|
63529
63782
|
return data;
|
|
63530
63783
|
}
|
|
63784
|
+
data.forEach((datum) => {
|
|
63785
|
+
if (!couldBeValidNumber(datum[checkField])) {
|
|
63786
|
+
datum[checkField] = 0;
|
|
63787
|
+
}
|
|
63788
|
+
});
|
|
63531
63789
|
return data;
|
|
63532
63790
|
};
|
|
63533
63791
|
|
|
@@ -63660,6 +63918,8 @@
|
|
|
63660
63918
|
this._stack = false;
|
|
63661
63919
|
this._percent = false;
|
|
63662
63920
|
this._stackOffsetSilhouette = false;
|
|
63921
|
+
this._invalidType = 'break';
|
|
63922
|
+
this._getInvalidDefined = (datum) => couldBeValidNumber(datum[this.getStackValueField()]);
|
|
63663
63923
|
this._region = options.region;
|
|
63664
63924
|
this._dataSet = options.dataSet;
|
|
63665
63925
|
((_a = this._spec) === null || _a === void 0 ? void 0 : _a.name) && (this.name = this._spec.name);
|
|
@@ -63710,11 +63970,11 @@
|
|
|
63710
63970
|
}
|
|
63711
63971
|
if (isBoolean(this._spec.percent)) {
|
|
63712
63972
|
this._percent = this._spec.percent;
|
|
63713
|
-
this._stack = this._spec.
|
|
63973
|
+
this._stack = this._spec.percent || this._stack;
|
|
63714
63974
|
}
|
|
63715
63975
|
if (isBoolean(this._spec.stackOffsetSilhouette)) {
|
|
63716
63976
|
this._stackOffsetSilhouette = this._spec.stackOffsetSilhouette;
|
|
63717
|
-
this._stack = this._spec.
|
|
63977
|
+
this._stack = this._spec.stackOffsetSilhouette || this._stack;
|
|
63718
63978
|
}
|
|
63719
63979
|
if (isValid(this._spec.invalidType)) {
|
|
63720
63980
|
this._invalidType = this._spec.invalidType;
|
|
@@ -63722,7 +63982,7 @@
|
|
|
63722
63982
|
(_a = this._tooltipHelper) === null || _a === void 0 ? void 0 : _a.updateTooltipSpec();
|
|
63723
63983
|
}
|
|
63724
63984
|
initData() {
|
|
63725
|
-
var _a, _b;
|
|
63985
|
+
var _a, _b, _c;
|
|
63726
63986
|
this._rawData = this._spec.data;
|
|
63727
63987
|
(_a = this._rawData) === null || _a === void 0 ? void 0 : _a.target.addListener('change', this.rawDataUpdate.bind(this));
|
|
63728
63988
|
this._addDataIndexAndKey();
|
|
@@ -63736,9 +63996,9 @@
|
|
|
63736
63996
|
this._data = new SeriesData(this._option, viewData);
|
|
63737
63997
|
this._viewDataFilter.target.removeListener('change', viewData.reRunAllTransform);
|
|
63738
63998
|
}
|
|
63739
|
-
if (this._invalidType === '
|
|
63740
|
-
registerDataSetInstanceTransform(this.
|
|
63741
|
-
(
|
|
63999
|
+
if (this._invalidType === 'zero' && ((_b = this._rawData) === null || _b === void 0 ? void 0 : _b.dataSet)) {
|
|
64000
|
+
registerDataSetInstanceTransform(this._rawData.dataSet, 'invalidTravel', invalidTravel);
|
|
64001
|
+
(_c = this._rawData) === null || _c === void 0 ? void 0 : _c.transform({
|
|
63742
64002
|
type: 'invalidTravel',
|
|
63743
64003
|
options: {
|
|
63744
64004
|
config: () => {
|
|
@@ -64077,6 +64337,7 @@
|
|
|
64077
64337
|
if (spec.invalidType !== invalidType) {
|
|
64078
64338
|
result.change = true;
|
|
64079
64339
|
result.reRender = true;
|
|
64340
|
+
result.reMake = true;
|
|
64080
64341
|
}
|
|
64081
64342
|
return result;
|
|
64082
64343
|
}
|
|
@@ -64179,7 +64440,7 @@
|
|
|
64179
64440
|
onMarkTreePositionUpdate(marks) {
|
|
64180
64441
|
}
|
|
64181
64442
|
setCurrentTheme(theme, noRender) {
|
|
64182
|
-
return __awaiter$
|
|
64443
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
|
64183
64444
|
const modifyConfig = () => {
|
|
64184
64445
|
this.reInit(theme);
|
|
64185
64446
|
return { change: true, reMake: false };
|
|
@@ -64278,7 +64539,8 @@
|
|
|
64278
64539
|
return key;
|
|
64279
64540
|
}
|
|
64280
64541
|
addViewDataFilter(option) {
|
|
64281
|
-
|
|
64542
|
+
var _a;
|
|
64543
|
+
(_a = this._viewDataFilter) === null || _a === void 0 ? void 0 : _a.transform(option, false);
|
|
64282
64544
|
}
|
|
64283
64545
|
reFilterViewData() {
|
|
64284
64546
|
var _a;
|
|
@@ -64318,6 +64580,9 @@
|
|
|
64318
64580
|
}
|
|
64319
64581
|
return list;
|
|
64320
64582
|
}
|
|
64583
|
+
_getInvalidConnectType() {
|
|
64584
|
+
return this._invalidType === 'zero' ? 'zero' : this._invalidType === 'link' ? 'connect' : 'none';
|
|
64585
|
+
}
|
|
64321
64586
|
}
|
|
64322
64587
|
BaseSeries.mark = {
|
|
64323
64588
|
[SeriesMarkNameEnum.label]: { name: SeriesMarkNameEnum.label, type: MarkTypeEnum.text }
|
|
@@ -64567,13 +64832,19 @@
|
|
|
64567
64832
|
if (!this._xAxisHelper) {
|
|
64568
64833
|
return Number.NaN;
|
|
64569
64834
|
}
|
|
64570
|
-
|
|
64835
|
+
const { dataToPosition, getFields } = this._xAxisHelper;
|
|
64836
|
+
const fields = getFields ? getFields() : this._fieldX;
|
|
64837
|
+
const value = this.getDatumPositionValues(datum, fields);
|
|
64838
|
+
return dataToPosition(array(value), { bandPosition: this._bandPosition, datum });
|
|
64571
64839
|
}
|
|
64572
64840
|
dataToPositionY(datum) {
|
|
64573
64841
|
if (!this._yAxisHelper) {
|
|
64574
64842
|
return Number.NaN;
|
|
64575
64843
|
}
|
|
64576
|
-
|
|
64844
|
+
const { dataToPosition, getFields } = this._yAxisHelper;
|
|
64845
|
+
const fields = getFields ? getFields() : this._fieldY;
|
|
64846
|
+
const value = this.getDatumPositionValues(datum, fields);
|
|
64847
|
+
return dataToPosition(array(value), { bandPosition: this._bandPosition, datum });
|
|
64577
64848
|
}
|
|
64578
64849
|
dataToPositionZ(datum) {
|
|
64579
64850
|
if (!this._zAxisHelper) {
|
|
@@ -66718,6 +66989,12 @@
|
|
|
66718
66989
|
this.setMarkStyle(lineMark, {
|
|
66719
66990
|
stroke: this.getColorAttribute()
|
|
66720
66991
|
}, 'normal', AttributeLevel.Series);
|
|
66992
|
+
if (this._invalidType !== 'zero') {
|
|
66993
|
+
this.setMarkStyle(lineMark, {
|
|
66994
|
+
defined: this._getInvalidDefined,
|
|
66995
|
+
connectedType: this._getInvalidConnectType()
|
|
66996
|
+
}, 'normal', AttributeLevel.Series);
|
|
66997
|
+
}
|
|
66721
66998
|
if (this.coordinate === 'polar') {
|
|
66722
66999
|
this.setMarkStyle(lineMark, {
|
|
66723
67000
|
lineJoin: DEFAULT_CLOSE_STROKE_JOIN,
|
|
@@ -66735,16 +67012,6 @@
|
|
|
66735
67012
|
curveType
|
|
66736
67013
|
}, 'normal', AttributeLevel.Built_In);
|
|
66737
67014
|
}
|
|
66738
|
-
if (this._invalidType) {
|
|
66739
|
-
this.setMarkStyle(lineMark, {
|
|
66740
|
-
defined: (datum) => {
|
|
66741
|
-
if (this._invalidType === 'break') {
|
|
66742
|
-
return couldBeValidNumber(datum[this.getStackValueField()]);
|
|
66743
|
-
}
|
|
66744
|
-
return true;
|
|
66745
|
-
}
|
|
66746
|
-
}, 'normal', AttributeLevel.Series);
|
|
66747
|
-
}
|
|
66748
67015
|
this.setMarkStyle(lineMark, {
|
|
66749
67016
|
x: this.dataToPositionX.bind(this),
|
|
66750
67017
|
y: this.dataToPositionY.bind(this),
|
|
@@ -66813,17 +67080,9 @@
|
|
|
66813
67080
|
this.setMarkStyle(symbolMark, {
|
|
66814
67081
|
fill: this.getColorAttribute()
|
|
66815
67082
|
}, 'normal', AttributeLevel.Series);
|
|
66816
|
-
if (this._invalidType) {
|
|
67083
|
+
if (this._invalidType !== 'zero') {
|
|
66817
67084
|
this.setMarkStyle(symbolMark, {
|
|
66818
|
-
visible:
|
|
66819
|
-
if (this._invalidType === 'break') {
|
|
66820
|
-
return couldBeValidNumber(datum[this.getStackValueField()]);
|
|
66821
|
-
}
|
|
66822
|
-
else if (this._invalidType === 'link') {
|
|
66823
|
-
return couldBeValidNumber(datum[this.getStackValueField()]);
|
|
66824
|
-
}
|
|
66825
|
-
return true;
|
|
66826
|
-
}
|
|
67085
|
+
visible: this._getInvalidDefined
|
|
66827
67086
|
}, 'normal', AttributeLevel.Series);
|
|
66828
67087
|
}
|
|
66829
67088
|
this.setMarkStyle(symbolMark, {
|
|
@@ -66864,17 +67123,9 @@
|
|
|
66864
67123
|
},
|
|
66865
67124
|
z: this.dataToPositionZ.bind(this)
|
|
66866
67125
|
});
|
|
66867
|
-
if (this._invalidType) {
|
|
67126
|
+
if (this._invalidType !== 'zero') {
|
|
66868
67127
|
this.setMarkStyle(labelMark, {
|
|
66869
|
-
visible:
|
|
66870
|
-
if (this._invalidType === 'break') {
|
|
66871
|
-
return couldBeValidNumber(datum[this.getStackValueField()]);
|
|
66872
|
-
}
|
|
66873
|
-
else if (this._invalidType === 'link') {
|
|
66874
|
-
return couldBeValidNumber(datum[this.getStackValueField()]);
|
|
66875
|
-
}
|
|
66876
|
-
return true;
|
|
66877
|
-
}
|
|
67128
|
+
visible: this._getInvalidDefined
|
|
66878
67129
|
}, 'normal', AttributeLevel.Series);
|
|
66879
67130
|
}
|
|
66880
67131
|
}
|
|
@@ -66957,7 +67208,6 @@
|
|
|
66957
67208
|
constructor() {
|
|
66958
67209
|
super(...arguments);
|
|
66959
67210
|
this.type = SeriesTypeEnum.line;
|
|
66960
|
-
this._invalidType = 'break';
|
|
66961
67211
|
}
|
|
66962
67212
|
initMark() {
|
|
66963
67213
|
var _a;
|
|
@@ -66985,7 +67235,8 @@
|
|
|
66985
67235
|
}
|
|
66986
67236
|
}
|
|
66987
67237
|
getSeriesStyle(datum) {
|
|
66988
|
-
|
|
67238
|
+
var _a;
|
|
67239
|
+
const isLineAsSeriesMark = ((_a = this._spec) === null || _a === void 0 ? void 0 : _a.seriesMark) !== 'point';
|
|
66989
67240
|
return (attribute) => {
|
|
66990
67241
|
var _a, _b;
|
|
66991
67242
|
if (isLineAsSeriesMark) {
|
|
@@ -67392,13 +67643,79 @@
|
|
|
67392
67643
|
}
|
|
67393
67644
|
AreaMark.type = MarkTypeEnum.area;
|
|
67394
67645
|
|
|
67646
|
+
class AreaSeriesTooltipHelper extends BaseSeriesTooltipHelper {
|
|
67647
|
+
constructor() {
|
|
67648
|
+
super(...arguments);
|
|
67649
|
+
this._getSeriesStyle = (datum, styleKey, defaultValue) => {
|
|
67650
|
+
var _a, _b, _c, _d;
|
|
67651
|
+
for (const key of array(styleKey)) {
|
|
67652
|
+
let value = (_a = this.series.getSeriesStyle(datum)) === null || _a === void 0 ? void 0 : _a(key);
|
|
67653
|
+
if (value === false && (key === 'fill' || key === 'stroke')) {
|
|
67654
|
+
if (key === 'fill') {
|
|
67655
|
+
value = (_c = (_b = this.series.getSeriesStyle(datum)) === null || _b === void 0 ? void 0 : _b('stroke')) === null || _c === void 0 ? void 0 : _c[0];
|
|
67656
|
+
}
|
|
67657
|
+
else {
|
|
67658
|
+
value = (_d = this.series.getSeriesStyle(datum)) === null || _d === void 0 ? void 0 : _d('fill');
|
|
67659
|
+
}
|
|
67660
|
+
}
|
|
67661
|
+
if (isValid(value)) {
|
|
67662
|
+
return value;
|
|
67663
|
+
}
|
|
67664
|
+
}
|
|
67665
|
+
return defaultValue;
|
|
67666
|
+
};
|
|
67667
|
+
}
|
|
67668
|
+
}
|
|
67669
|
+
|
|
67395
67670
|
VChart.useMark([LineMark, AreaMark, TextMark, SymbolMark]);
|
|
67396
67671
|
class AreaSeries extends CartesianSeries {
|
|
67397
67672
|
constructor() {
|
|
67398
67673
|
super(...arguments);
|
|
67399
67674
|
this.type = SeriesTypeEnum.area;
|
|
67400
67675
|
this._stack = true;
|
|
67401
|
-
|
|
67676
|
+
}
|
|
67677
|
+
setAttrFromSpec() {
|
|
67678
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
67679
|
+
super.setAttrFromSpec();
|
|
67680
|
+
const isAreaVisible = ((_a = this._spec.area) === null || _a === void 0 ? void 0 : _a.visible) !== false && ((_c = (_b = this._spec.area) === null || _b === void 0 ? void 0 : _b.style) === null || _c === void 0 ? void 0 : _c.visible) !== false;
|
|
67681
|
+
const isLineVisible = ((_d = this._spec.line) === null || _d === void 0 ? void 0 : _d.visible) !== false && ((_f = (_e = this._spec.line) === null || _e === void 0 ? void 0 : _e.style) === null || _f === void 0 ? void 0 : _f.visible) !== false;
|
|
67682
|
+
const areaSpec = (_g = this._spec.area) !== null && _g !== void 0 ? _g : {};
|
|
67683
|
+
const lineSpec = (_h = this._spec.line) !== null && _h !== void 0 ? _h : {};
|
|
67684
|
+
areaSpec.interactive = areaSpec.interactive || lineSpec.interactive;
|
|
67685
|
+
areaSpec.support3d = areaSpec.support3d || lineSpec.support3d;
|
|
67686
|
+
areaSpec.zIndex =
|
|
67687
|
+
isValid(areaSpec.zIndex) || isValid(lineSpec.zIndex)
|
|
67688
|
+
? Math.max((_j = areaSpec.zIndex) !== null && _j !== void 0 ? _j : 0, (_k = lineSpec.zIndex) !== null && _k !== void 0 ? _k : 0)
|
|
67689
|
+
: undefined;
|
|
67690
|
+
if (areaSpec.style) {
|
|
67691
|
+
delete areaSpec.style.stroke;
|
|
67692
|
+
}
|
|
67693
|
+
if (areaSpec.state) {
|
|
67694
|
+
Object.keys(areaSpec.state).forEach(state => {
|
|
67695
|
+
if ('style' in areaSpec.state[state]) {
|
|
67696
|
+
delete areaSpec.state[state].style.stroke;
|
|
67697
|
+
}
|
|
67698
|
+
else {
|
|
67699
|
+
delete areaSpec.state[state].stroke;
|
|
67700
|
+
}
|
|
67701
|
+
});
|
|
67702
|
+
}
|
|
67703
|
+
let mainSpec = areaSpec;
|
|
67704
|
+
let subSpec = lineSpec;
|
|
67705
|
+
const seriesMark = (_l = this._spec.seriesMark) !== null && _l !== void 0 ? _l : 'area';
|
|
67706
|
+
if (seriesMark === 'line' || (isLineVisible && !isAreaVisible)) {
|
|
67707
|
+
mainSpec = lineSpec;
|
|
67708
|
+
subSpec = areaSpec;
|
|
67709
|
+
}
|
|
67710
|
+
areaSpec.style = merge$2({}, subSpec.style, mainSpec.style);
|
|
67711
|
+
areaSpec.state = merge$2({}, subSpec.state, mainSpec.state);
|
|
67712
|
+
if (!isAreaVisible) {
|
|
67713
|
+
areaSpec.style.fill = false;
|
|
67714
|
+
}
|
|
67715
|
+
if (!isLineVisible) {
|
|
67716
|
+
areaSpec.style.stroke = false;
|
|
67717
|
+
}
|
|
67718
|
+
areaSpec.visible = !(!isAreaVisible && !isLineVisible);
|
|
67402
67719
|
}
|
|
67403
67720
|
initMark() {
|
|
67404
67721
|
var _a, _b, _c, _d;
|
|
@@ -67414,9 +67731,8 @@
|
|
|
67414
67731
|
groupKey: this._seriesField,
|
|
67415
67732
|
defaultMorphElementKey: this.getDimensionField()[0],
|
|
67416
67733
|
progressive,
|
|
67417
|
-
isSeriesMark: isAreaVisible && seriesMark
|
|
67734
|
+
isSeriesMark: isAreaVisible && seriesMark !== 'point'
|
|
67418
67735
|
});
|
|
67419
|
-
this.initLineMark(progressive, seriesMark === 'line' || (seriesMark === 'area' && !isAreaVisible));
|
|
67420
67736
|
this.initSymbolMark(progressive, seriesMark === 'point');
|
|
67421
67737
|
}
|
|
67422
67738
|
initMarkStyle() {
|
|
@@ -67454,18 +67770,26 @@
|
|
|
67454
67770
|
}
|
|
67455
67771
|
this.setMarkStyle(areaMark, {
|
|
67456
67772
|
fill: this.getColorAttribute(),
|
|
67457
|
-
|
|
67458
|
-
if (this._invalidType === 'break') {
|
|
67459
|
-
return couldBeValidNumber(datum[this.getStackValueField()]);
|
|
67460
|
-
}
|
|
67461
|
-
return true;
|
|
67462
|
-
}
|
|
67773
|
+
stroke: this.getColorAttribute()
|
|
67463
67774
|
}, 'normal', AttributeLevel.Series);
|
|
67775
|
+
if (this._invalidType !== 'zero') {
|
|
67776
|
+
this.setMarkStyle(areaMark, {
|
|
67777
|
+
defined: this._getInvalidDefined,
|
|
67778
|
+
connectedType: this._getInvalidConnectType()
|
|
67779
|
+
}, 'normal', AttributeLevel.Series);
|
|
67780
|
+
}
|
|
67464
67781
|
this.setMarkStyle(areaMark, {
|
|
67465
67782
|
curveType
|
|
67466
67783
|
}, 'normal', AttributeLevel.Built_In);
|
|
67467
67784
|
this._trigger.registerMark(areaMark);
|
|
67468
67785
|
this._tooltipHelper.activeTriggerSet.dimension.add(areaMark);
|
|
67786
|
+
Object.keys(areaMark.stateStyle).forEach(state => {
|
|
67787
|
+
if (areaMark.stateStyle[state].stroke) {
|
|
67788
|
+
areaMark.setPostProcess('stroke', result => {
|
|
67789
|
+
return [result, false, false, false];
|
|
67790
|
+
}, state);
|
|
67791
|
+
}
|
|
67792
|
+
});
|
|
67469
67793
|
}
|
|
67470
67794
|
this.initLineMarkStyle(this._direction, userCurveType);
|
|
67471
67795
|
this.initSymbolMarkStyle();
|
|
@@ -67485,6 +67809,9 @@
|
|
|
67485
67809
|
this._symbolMark.setAnimationConfig(animationConfig(DEFAULT_MARK_ANIMATION.symbol(), userAnimationConfig(SeriesMarkNameEnum.point, this._spec)));
|
|
67486
67810
|
}
|
|
67487
67811
|
}
|
|
67812
|
+
initTooltip() {
|
|
67813
|
+
this._tooltipHelper = new AreaSeriesTooltipHelper(this);
|
|
67814
|
+
}
|
|
67488
67815
|
}
|
|
67489
67816
|
AreaSeries.type = SeriesTypeEnum.area;
|
|
67490
67817
|
AreaSeries.mark = Object.assign(Object.assign(Object.assign({}, BaseSeries.mark), lineLikeSeriesMarkMap), { [SeriesMarkNameEnum.area]: { name: SeriesMarkNameEnum.area, type: MarkTypeEnum.area } });
|
|
@@ -67603,13 +67930,14 @@
|
|
|
67603
67930
|
}
|
|
67604
67931
|
this.setMarkStyle(areaMark, {
|
|
67605
67932
|
fill: this.getColorAttribute(),
|
|
67606
|
-
|
|
67607
|
-
if (this._invalidType === 'break') {
|
|
67608
|
-
return couldBeValidNumber(datum[this.getStackValueField()]);
|
|
67609
|
-
}
|
|
67610
|
-
return true;
|
|
67611
|
-
}
|
|
67933
|
+
stroke: false
|
|
67612
67934
|
}, 'normal', AttributeLevel.Series);
|
|
67935
|
+
if (this._invalidType !== 'zero') {
|
|
67936
|
+
this.setMarkStyle(areaMark, {
|
|
67937
|
+
defined: this._getInvalidDefined,
|
|
67938
|
+
connectedType: this._getInvalidConnectType()
|
|
67939
|
+
}, 'normal', AttributeLevel.Series);
|
|
67940
|
+
}
|
|
67613
67941
|
this.setMarkStyle(areaMark, {
|
|
67614
67942
|
curveType
|
|
67615
67943
|
}, 'normal', AttributeLevel.Built_In);
|
|
@@ -67794,6 +68122,7 @@
|
|
|
67794
68122
|
super(...arguments);
|
|
67795
68123
|
this.type = SeriesTypeEnum.geo;
|
|
67796
68124
|
this.coordinate = 'geo';
|
|
68125
|
+
this._nameProperty = 'name';
|
|
67797
68126
|
}
|
|
67798
68127
|
getMapViewData() {
|
|
67799
68128
|
var _a;
|
|
@@ -67811,6 +68140,9 @@
|
|
|
67811
68140
|
set valueField(f) {
|
|
67812
68141
|
this._valueField = f;
|
|
67813
68142
|
}
|
|
68143
|
+
getNameProperty() {
|
|
68144
|
+
return this._nameProperty;
|
|
68145
|
+
}
|
|
67814
68146
|
getCoordinateHelper() {
|
|
67815
68147
|
return this._coordinateHelper;
|
|
67816
68148
|
}
|
|
@@ -67993,15 +68325,11 @@
|
|
|
67993
68325
|
constructor() {
|
|
67994
68326
|
super(...arguments);
|
|
67995
68327
|
this.type = SeriesTypeEnum.map;
|
|
67996
|
-
this._nameProperty = 'name';
|
|
67997
68328
|
this._areaCache = new Map();
|
|
67998
68329
|
}
|
|
67999
68330
|
getNameMap() {
|
|
68000
68331
|
return this._nameMap;
|
|
68001
68332
|
}
|
|
68002
|
-
getNameProperty() {
|
|
68003
|
-
return this._nameProperty;
|
|
68004
|
-
}
|
|
68005
68333
|
setAttrFromSpec() {
|
|
68006
68334
|
super.setAttrFromSpec();
|
|
68007
68335
|
this.map = this._spec.map;
|
|
@@ -69350,37 +69678,18 @@
|
|
|
69350
69678
|
this._viewDataLabel = new SeriesData(this._option, viewDataLabel);
|
|
69351
69679
|
}
|
|
69352
69680
|
initMark() {
|
|
69353
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
69354
69681
|
this._pieMark = this._createMark(Object.assign(Object.assign({}, BasePieSeries.mark.pie), { name: this._pieMarkName, type: this._pieMarkType }), {
|
|
69355
69682
|
morph: shouldDoMorph(this._spec.animation, this._spec.morph, userAnimationConfig(this.type, this._spec)),
|
|
69356
69683
|
defaultMorphElementKey: this._seriesField,
|
|
69357
69684
|
key: DEFAULT_DATA_KEY,
|
|
69358
69685
|
groupKey: this._seriesField,
|
|
69359
69686
|
skipBeforeLayouted: true,
|
|
69360
|
-
isSeriesMark: true
|
|
69687
|
+
isSeriesMark: true,
|
|
69688
|
+
label: merge$2({ animation: this._spec.animation }, this._spec.label)
|
|
69361
69689
|
});
|
|
69362
|
-
if ((_b = (_a = this._spec) === null || _a === void 0 ? void 0 : _a.label) === null || _b === void 0 ? void 0 : _b.visible) {
|
|
69363
|
-
const spec = this.getSpec();
|
|
69364
|
-
this._labelMark = this._createMark(BasePieSeries.mark.label, {
|
|
69365
|
-
dataView: this._viewDataLabel.getDataView(),
|
|
69366
|
-
dataProductId: this._viewDataLabel.getProductId(),
|
|
69367
|
-
skipBeforeLayouted: true,
|
|
69368
|
-
themeSpec: (_c = this._theme) === null || _c === void 0 ? void 0 : _c.label,
|
|
69369
|
-
support3d: (_d = spec === null || spec === void 0 ? void 0 : spec.label) === null || _d === void 0 ? void 0 : _d.support3d,
|
|
69370
|
-
markSpec: Object.assign({ visible: true }, (_e = this.getSpec()) === null || _e === void 0 ? void 0 : _e.label)
|
|
69371
|
-
});
|
|
69372
|
-
this._labelLineMark = this._createMark(BasePieSeries.mark.labelLine, {
|
|
69373
|
-
dataView: this._viewDataLabel.getDataView(),
|
|
69374
|
-
dataProductId: this._viewDataLabel.getProductId(),
|
|
69375
|
-
skipBeforeLayouted: true,
|
|
69376
|
-
themeSpec: (_g = (_f = this._theme) === null || _f === void 0 ? void 0 : _f.label) === null || _g === void 0 ? void 0 : _g.line,
|
|
69377
|
-
support3d: (_h = spec === null || spec === void 0 ? void 0 : spec.label) === null || _h === void 0 ? void 0 : _h.support3d,
|
|
69378
|
-
markSpec: Object.assign({ visible: true }, (_k = (_j = this.getSpec()) === null || _j === void 0 ? void 0 : _j.label) === null || _k === void 0 ? void 0 : _k.line)
|
|
69379
|
-
});
|
|
69380
|
-
}
|
|
69381
69690
|
}
|
|
69382
69691
|
initMarkStyle() {
|
|
69383
|
-
var _a
|
|
69692
|
+
var _a;
|
|
69384
69693
|
const pieMark = this._pieMark;
|
|
69385
69694
|
if (pieMark) {
|
|
69386
69695
|
this.setMarkStyle(pieMark, {
|
|
@@ -69402,32 +69711,6 @@
|
|
|
69402
69711
|
this._trigger.registerMark(pieMark);
|
|
69403
69712
|
(_a = this._tooltipHelper) === null || _a === void 0 ? void 0 : _a.activeTriggerSet.mark.add(pieMark);
|
|
69404
69713
|
}
|
|
69405
|
-
const labelMark = this._labelMark;
|
|
69406
|
-
if (labelMark) {
|
|
69407
|
-
this.setMarkStyle(labelMark, {
|
|
69408
|
-
visible: field$2(DEFAULT_LABEL_VISIBLE).bind(this),
|
|
69409
|
-
x: field$2(DEFAULT_LABEL_X).bind(this),
|
|
69410
|
-
y: field$2(DEFAULT_LABEL_Y).bind(this),
|
|
69411
|
-
text: field$2(DEFAULT_LABEL_TEXT).bind(this),
|
|
69412
|
-
fill: ((_c = (_b = this._spec.label) === null || _b === void 0 ? void 0 : _b.style) === null || _c === void 0 ? void 0 : _c.fill) || this.getColorAttribute(),
|
|
69413
|
-
textAlign: field$2(DEFAULT_LABEL_ALIGN).bind(this),
|
|
69414
|
-
textBaseline: ((_d = this._spec.label) === null || _d === void 0 ? void 0 : _d.position) === 'inside' ? 'middle' : 'top',
|
|
69415
|
-
angle: (datum) => {
|
|
69416
|
-
var _a;
|
|
69417
|
-
const angle = datum[ARC_MIDDLE_ANGLE];
|
|
69418
|
-
return ((_a = this._spec.label) === null || _a === void 0 ? void 0 : _a.position) === 'inside' ? degrees(angle) : 0;
|
|
69419
|
-
},
|
|
69420
|
-
limit: field$2(DEFAULT_LABEL_LIMIT).bind(this)
|
|
69421
|
-
}, undefined, AttributeLevel.User_Mark);
|
|
69422
|
-
this._trigger.registerMark(labelMark);
|
|
69423
|
-
}
|
|
69424
|
-
const labelLineMark = this._labelLineMark;
|
|
69425
|
-
if (labelLineMark) {
|
|
69426
|
-
this.setMarkStyle(labelLineMark, Object.assign({ visible: field$2(DEFAULT_LABEL_VISIBLE).bind(this), stroke: ((_g = (_f = (_e = this._spec.label) === null || _e === void 0 ? void 0 : _e.line) === null || _f === void 0 ? void 0 : _f.style) === null || _g === void 0 ? void 0 : _g.stroke) || this.getColorAttribute(), lineWidth: 1 }, this.generateLinePath('normal')));
|
|
69427
|
-
this.setMarkStyle(labelLineMark, this.generateLinePath('hover'), 'hover');
|
|
69428
|
-
this.setMarkStyle(labelLineMark, this.generateLinePath('selected'), 'selected');
|
|
69429
|
-
this._trigger.registerMark(labelLineMark);
|
|
69430
|
-
}
|
|
69431
69714
|
}
|
|
69432
69715
|
initMarkStyleWithSpec(mark, spec, key) {
|
|
69433
69716
|
super.initMarkStyleWithSpec(mark, spec, key);
|
|
@@ -69440,6 +69723,22 @@
|
|
|
69440
69723
|
}
|
|
69441
69724
|
}
|
|
69442
69725
|
}
|
|
69726
|
+
initLabelMarkStyle(textMark) {
|
|
69727
|
+
var _a, _b, _c, _d, _e, _f;
|
|
69728
|
+
if (!textMark) {
|
|
69729
|
+
return;
|
|
69730
|
+
}
|
|
69731
|
+
this.setMarkStyle(textMark, {
|
|
69732
|
+
visible: field$2(DEFAULT_LABEL_VISIBLE).bind(this),
|
|
69733
|
+
text: (datum) => {
|
|
69734
|
+
return datum[this.getDimensionField()[0]];
|
|
69735
|
+
},
|
|
69736
|
+
fill: ((_b = (_a = this._spec.label) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.fill) || this.getColorAttribute(),
|
|
69737
|
+
angle: (_d = (_c = this._spec.label) === null || _c === void 0 ? void 0 : _c.style) === null || _d === void 0 ? void 0 : _d.angle,
|
|
69738
|
+
limit: (_f = (_e = this._spec.label) === null || _e === void 0 ? void 0 : _e.style) === null || _f === void 0 ? void 0 : _f.limit,
|
|
69739
|
+
z: this.dataToPositionZ.bind(this)
|
|
69740
|
+
});
|
|
69741
|
+
}
|
|
69443
69742
|
afterInitMark() {
|
|
69444
69743
|
super.afterInitMark();
|
|
69445
69744
|
this._trigger.setStateKeys([this._seriesField, ...this._radiusField]);
|
|
@@ -69585,12 +69884,6 @@
|
|
|
69585
69884
|
}
|
|
69586
69885
|
this._pieMark.setAnimationConfig(pieAnimationConfig);
|
|
69587
69886
|
}
|
|
69588
|
-
if (this._labelMark) {
|
|
69589
|
-
this._labelMark.setAnimationConfig(animationConfig(DEFAULT_MARK_ANIMATION.label(), userAnimationConfig(SeriesMarkNameEnum.label, this._spec)));
|
|
69590
|
-
if (this._labelLineMark) {
|
|
69591
|
-
this._labelLineMark.setAnimationConfig(animationConfig(DEFAULT_MARK_ANIMATION.label(), userAnimationConfig(SeriesMarkNameEnum.labelLine, this._spec)));
|
|
69592
|
-
}
|
|
69593
|
-
}
|
|
69594
69887
|
}
|
|
69595
69888
|
getDefaultShapeType() {
|
|
69596
69889
|
return 'square';
|
|
@@ -69720,7 +70013,6 @@
|
|
|
69720
70013
|
constructor() {
|
|
69721
70014
|
super(...arguments);
|
|
69722
70015
|
this.type = SeriesTypeEnum.scatter;
|
|
69723
|
-
this._invalidType = 'break';
|
|
69724
70016
|
}
|
|
69725
70017
|
setAttrFromSpec() {
|
|
69726
70018
|
super.setAttrFromSpec();
|
|
@@ -69840,14 +70132,11 @@
|
|
|
69840
70132
|
if (!symbolMark) {
|
|
69841
70133
|
return;
|
|
69842
70134
|
}
|
|
69843
|
-
this.
|
|
69844
|
-
|
|
69845
|
-
|
|
69846
|
-
|
|
69847
|
-
|
|
69848
|
-
return true;
|
|
69849
|
-
}
|
|
69850
|
-
});
|
|
70135
|
+
if (this._invalidType !== 'zero') {
|
|
70136
|
+
this.setMarkStyle(symbolMark, {
|
|
70137
|
+
visible: this._getInvalidDefined
|
|
70138
|
+
});
|
|
70139
|
+
}
|
|
69851
70140
|
this.setMarkStyle(symbolMark, {
|
|
69852
70141
|
x: this.dataToPositionX.bind(this),
|
|
69853
70142
|
y: this.dataToPositionY.bind(this),
|
|
@@ -69878,14 +70167,13 @@
|
|
|
69878
70167
|
text: (datum) => {
|
|
69879
70168
|
return datum[this.getStackValueField()];
|
|
69880
70169
|
},
|
|
69881
|
-
visible: (datum) => {
|
|
69882
|
-
if (this._invalidType === 'break') {
|
|
69883
|
-
return couldBeValidNumber(datum[this.getStackValueField()]);
|
|
69884
|
-
}
|
|
69885
|
-
return true;
|
|
69886
|
-
},
|
|
69887
70170
|
z: this.dataToPositionZ.bind(this)
|
|
69888
70171
|
}, STATE_VALUE_ENUM.STATE_NORMAL, AttributeLevel.Series);
|
|
70172
|
+
if (this._invalidType !== 'zero') {
|
|
70173
|
+
this.setMarkStyle(labelMark, {
|
|
70174
|
+
visible: this._getInvalidDefined
|
|
70175
|
+
}, STATE_VALUE_ENUM.STATE_NORMAL, AttributeLevel.Series);
|
|
70176
|
+
}
|
|
69889
70177
|
}
|
|
69890
70178
|
handleZoom(e) {
|
|
69891
70179
|
this.getMarksWithoutRoot().forEach(mark => {
|
|
@@ -69980,29 +70268,19 @@
|
|
|
69980
70268
|
}
|
|
69981
70269
|
initMark() {
|
|
69982
70270
|
this.initRoseMark();
|
|
69983
|
-
this.initLabelMark();
|
|
69984
70271
|
}
|
|
69985
70272
|
initMarkStyle() {
|
|
69986
70273
|
this.initRoseMarkStyle();
|
|
69987
|
-
this.initLabelMarkStyle();
|
|
69988
70274
|
}
|
|
69989
70275
|
initRoseMark() {
|
|
69990
70276
|
this._roseMark = this._createMark(RoseSeries.mark.rose, {
|
|
69991
70277
|
morph: shouldDoMorph(this._spec.animation, this._spec.morph, userAnimationConfig('rose', this._spec)),
|
|
69992
70278
|
defaultMorphElementKey: this.getDimensionField()[0],
|
|
69993
70279
|
groupKey: this._seriesField,
|
|
69994
|
-
isSeriesMark: true
|
|
70280
|
+
isSeriesMark: true,
|
|
70281
|
+
label: merge$2({ animation: this._spec.animation }, this._spec.label)
|
|
69995
70282
|
});
|
|
69996
70283
|
}
|
|
69997
|
-
initLabelMark() {
|
|
69998
|
-
var _a, _b, _c, _d;
|
|
69999
|
-
if ((_b = (_a = this._spec) === null || _a === void 0 ? void 0 : _a.label) === null || _b === void 0 ? void 0 : _b.visible) {
|
|
70000
|
-
this._labelMark = this._createMark(RoseSeries.mark.label, {
|
|
70001
|
-
themeSpec: (_c = this._theme) === null || _c === void 0 ? void 0 : _c.label,
|
|
70002
|
-
markSpec: Object.assign({ visible: true }, (_d = this.getSpec()) === null || _d === void 0 ? void 0 : _d.label)
|
|
70003
|
-
});
|
|
70004
|
-
}
|
|
70005
|
-
}
|
|
70006
70284
|
getRoseAngle() {
|
|
70007
70285
|
var _a, _b, _c;
|
|
70008
70286
|
const angleBandWidth = (_c = (_b = (_a = this.angleAxisHelper).getBandwidth) === null || _b === void 0 ? void 0 : _b.call(_a, this._groups ? this._groups.fields.length - 1 : 0)) !== null && _c !== void 0 ? _c : DefaultBandWidth$1;
|
|
@@ -70037,35 +70315,21 @@
|
|
|
70037
70315
|
(_a = this._tooltipHelper) === null || _a === void 0 ? void 0 : _a.activeTriggerSet.mark.add(roseMark);
|
|
70038
70316
|
}
|
|
70039
70317
|
}
|
|
70040
|
-
initLabelMarkStyle() {
|
|
70041
|
-
var _a, _b;
|
|
70042
|
-
|
|
70043
|
-
|
|
70044
|
-
let angle = 0;
|
|
70045
|
-
let radius = 0;
|
|
70046
|
-
this.setMarkStyle(labelMark, {
|
|
70047
|
-
visible: true,
|
|
70048
|
-
x: (datum) => {
|
|
70049
|
-
var _a, _b;
|
|
70050
|
-
const baseAngle = this.angleAxisHelper.dataToPosition(this.getDatumPositionValues(datum, this.getGroupFields()));
|
|
70051
|
-
const bandAngle = this.angleAxisHelper.getBandwidth(0) * 0.5;
|
|
70052
|
-
const startAngle = baseAngle - bandAngle;
|
|
70053
|
-
const endAngle = baseAngle + this.getRoseAngle() - bandAngle;
|
|
70054
|
-
angle = (startAngle + endAngle) / 2;
|
|
70055
|
-
radius =
|
|
70056
|
-
valueInScaleRange(this.radiusAxisHelper.dataToPosition([datum[this._radiusField[0]]]), this.radiusAxisHelper.getScale(0)) -
|
|
70057
|
-
(((_b = (_a = this._spec.label) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.size) || 10) / 2;
|
|
70058
|
-
return this.angleAxisHelper.center().x + radius * Math.cos(angle);
|
|
70059
|
-
},
|
|
70060
|
-
y: () => this.angleAxisHelper.center().y + radius * Math.sin(angle),
|
|
70061
|
-
text: (datum) => {
|
|
70062
|
-
return datum[this._radiusField[0]];
|
|
70063
|
-
},
|
|
70064
|
-
stroke: ((_b = (_a = this._spec.label) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.stroke) || this.getColorAttribute(),
|
|
70065
|
-
angle: () => { var _a, _b, _c; return (((_b = (_a = this._spec.label) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.angle) || ((_c = degrees(angle)) !== null && _c !== void 0 ? _c : 0) + 90); }
|
|
70066
|
-
}, undefined, AttributeLevel.User_Mark);
|
|
70067
|
-
this._trigger.registerMark(labelMark);
|
|
70318
|
+
initLabelMarkStyle(textMark) {
|
|
70319
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
70320
|
+
if (!textMark) {
|
|
70321
|
+
return;
|
|
70068
70322
|
}
|
|
70323
|
+
this.setMarkStyle(textMark, {
|
|
70324
|
+
visible: (_b = (_a = this._spec) === null || _a === void 0 ? void 0 : _a.label) === null || _b === void 0 ? void 0 : _b.visible,
|
|
70325
|
+
text: (datum) => {
|
|
70326
|
+
return datum[this.getDimensionField()[0]];
|
|
70327
|
+
},
|
|
70328
|
+
fill: ((_d = (_c = this._spec.label) === null || _c === void 0 ? void 0 : _c.style) === null || _d === void 0 ? void 0 : _d.fill) || this.getColorAttribute(),
|
|
70329
|
+
angle: (_f = (_e = this._spec.label) === null || _e === void 0 ? void 0 : _e.style) === null || _f === void 0 ? void 0 : _f.angle,
|
|
70330
|
+
limit: (_h = (_g = this._spec.label) === null || _g === void 0 ? void 0 : _g.style) === null || _h === void 0 ? void 0 : _h.limit,
|
|
70331
|
+
z: 0
|
|
70332
|
+
});
|
|
70069
70333
|
}
|
|
70070
70334
|
initAnimation() {
|
|
70071
70335
|
var _a, _b;
|
|
@@ -70595,6 +70859,9 @@
|
|
|
70595
70859
|
_getDataIdKey() {
|
|
70596
70860
|
return undefined;
|
|
70597
70861
|
}
|
|
70862
|
+
getStackValueField() {
|
|
70863
|
+
return null;
|
|
70864
|
+
}
|
|
70598
70865
|
}
|
|
70599
70866
|
DotSeries.type = SeriesTypeEnum.dot;
|
|
70600
70867
|
DotSeries.mark = Object.assign(Object.assign({}, BaseSeries.mark), { [SeriesMarkNameEnum.group]: { name: SeriesMarkNameEnum.group, type: MarkTypeEnum.group }, [SeriesMarkNameEnum.grid]: { name: SeriesMarkNameEnum.grid, type: MarkTypeEnum.rule }, [SeriesMarkNameEnum.gridBackground]: { name: SeriesMarkNameEnum.gridBackground, type: MarkTypeEnum.rect }, [SeriesMarkNameEnum.dot]: { name: SeriesMarkNameEnum.dot, type: MarkTypeEnum.symbol }, [SeriesMarkNameEnum.title]: { name: SeriesMarkNameEnum.title, type: MarkTypeEnum.text }, [SeriesMarkNameEnum.subTitle]: { name: SeriesMarkNameEnum.subTitle, type: MarkTypeEnum.text }, [SeriesMarkNameEnum.symbol]: { name: SeriesMarkNameEnum.symbol, type: MarkTypeEnum.symbol } });
|
|
@@ -71457,7 +71724,7 @@
|
|
|
71457
71724
|
class BaseLayout {
|
|
71458
71725
|
constructor(options) {
|
|
71459
71726
|
var _a, _b;
|
|
71460
|
-
switch (this.options =
|
|
71727
|
+
switch (this.options = merge$2({}, BaseLayout.defaultOptions, options), isFunction(this.options.shape) ? this.shape = this.options.shape : this.shape = getShapeFunction(this.options.shape), this.getText = null !== (_a = functor$1(this.options.text)) && void 0 !== _a ? _a : d => d, this.getTextFontWeight = functor$1(this.options.fontWeight), this.getTextFontSize = functor$1(this.options.fontSize), this.getTextFontStyle = functor$1(this.options.fontStyle), this.getTextFontFamily = functor$1(this.options.fontFamily), this.outputCallback = null !== (_b = this.options.outputCallback) && void 0 !== _b ? _b : res => res, this.options.color) {
|
|
71461
71728
|
case "random-dark":
|
|
71462
71729
|
this.getTextColor = () => randomHslColor(10, 50);
|
|
71463
71730
|
break;
|
|
@@ -71569,7 +71836,7 @@
|
|
|
71569
71836
|
class CloudLayout extends BaseLayout {
|
|
71570
71837
|
constructor(options) {
|
|
71571
71838
|
var _a;
|
|
71572
|
-
super(
|
|
71839
|
+
super(merge$2({}, CloudLayout.defaultOptions, options)), this.cw = 64, this.ch = 2048, this._size = [256, 256], this._isBoardExpandCompleted = !1, this._placeStatus = 0, this._tTemp = null, this._dtTemp = null, this._dy = 0, this.cacheMap = new Map(), this.options.minFontSize <= CloudLayout.defaultOptions.minFontSize && (this.options.minFontSize = CloudLayout.defaultOptions.minFontSize), this.spiral = isString(this.options.spiral) ? null !== (_a = spirals[this.options.spiral]) && void 0 !== _a ? _a : spirals.archimedean : this.options.spiral, this.random = this.options.random ? Math.random : () => 1, this.getTextPadding = functor$1(this.options.padding);
|
|
71573
71840
|
}
|
|
71574
71841
|
zoomRatio() {
|
|
71575
71842
|
return this._originSize[0] / this._size[0];
|
|
@@ -71912,7 +72179,7 @@
|
|
|
71912
72179
|
|
|
71913
72180
|
let GridLayout$1 = class GridLayout extends BaseLayout {
|
|
71914
72181
|
constructor(options) {
|
|
71915
|
-
super(
|
|
72182
|
+
super(merge$2({}, GridLayout.defaultOptions, options)), this.fillGridAt = (x, y) => {
|
|
71916
72183
|
x >= this.ngx || y >= this.ngy || x < 0 || y < 0 || (this.grid[x][y] = !1);
|
|
71917
72184
|
}, this.updateGrid = (gx, gy, gw, gh, info) => {
|
|
71918
72185
|
const occupied = info.occupied;
|
|
@@ -72103,7 +72370,7 @@
|
|
|
72103
72370
|
|
|
72104
72371
|
class FastLayout extends BaseLayout {
|
|
72105
72372
|
constructor(options) {
|
|
72106
|
-
super(
|
|
72373
|
+
super(merge$2({}, FastLayout.defaultOptions, options)), this.random = this.options.random ? Math.random : () => 0, this.aspectRatio = 1;
|
|
72107
72374
|
}
|
|
72108
72375
|
fit(word) {
|
|
72109
72376
|
for (let i = 0, len = this.result.length; i < len; i++) if (isOverlap(word, this.result[i])) return !1;
|
|
@@ -72301,7 +72568,7 @@
|
|
|
72301
72568
|
return length;
|
|
72302
72569
|
};
|
|
72303
72570
|
function loadImage(url) {
|
|
72304
|
-
return isValidUrl(url) ? new Promise((resolve, reject) => {
|
|
72571
|
+
return url && (isValidUrl(url) || isBase64(url) || url.startsWith("<svg")) ? new Promise((resolve, reject) => {
|
|
72305
72572
|
const imageMark = createImage({
|
|
72306
72573
|
image: url
|
|
72307
72574
|
});
|
|
@@ -72322,7 +72589,7 @@
|
|
|
72322
72589
|
};
|
|
72323
72590
|
}
|
|
72324
72591
|
|
|
72325
|
-
var __awaiter$
|
|
72592
|
+
var __awaiter$1 = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
72326
72593
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
72327
72594
|
function fulfilled(value) {
|
|
72328
72595
|
try {
|
|
@@ -72347,121 +72614,119 @@
|
|
|
72347
72614
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
72348
72615
|
});
|
|
72349
72616
|
};
|
|
72350
|
-
function
|
|
72351
|
-
return __awaiter$
|
|
72352
|
-
const
|
|
72353
|
-
|
|
72617
|
+
function loadAndHandleImage(segmentationInput) {
|
|
72618
|
+
return __awaiter$1(this, void 0, void 0, function* () {
|
|
72619
|
+
const shapeImage = yield loadImage(segmentationInput.shapeUrl);
|
|
72620
|
+
return segmentationInput.removeWhiteBorder && shapeImage ? removeBorder(shapeImage, segmentationInput.tempCanvas, segmentationInput.tempCtx) : shapeImage;
|
|
72621
|
+
});
|
|
72622
|
+
}
|
|
72623
|
+
function segmentation(shapeImage, segmentationInput) {
|
|
72624
|
+
const {
|
|
72354
72625
|
size: size,
|
|
72355
72626
|
tempCanvas: tempCanvas,
|
|
72356
|
-
tempCtx: ctx
|
|
72357
|
-
|
|
72358
|
-
|
|
72359
|
-
|
|
72360
|
-
|
|
72361
|
-
|
|
72362
|
-
|
|
72363
|
-
|
|
72364
|
-
|
|
72365
|
-
|
|
72627
|
+
tempCtx: ctx
|
|
72628
|
+
} = segmentationInput,
|
|
72629
|
+
shapeConfig = scaleAndMiddleShape(shapeImage, size);
|
|
72630
|
+
tempCanvas.width = size[0], tempCanvas.height = size[1], ctx.clearRect(0, 0, tempCanvas.width, tempCanvas.height), ctx.drawImage(shapeImage, shapeConfig.x, shapeConfig.y, shapeConfig.width, shapeConfig.height);
|
|
72631
|
+
const imageData = ctx.getImageData(0, 0, size[0], size[1]),
|
|
72632
|
+
labels = new Array(size[0] * size[1]).fill(0);
|
|
72633
|
+
let curLabel = 1;
|
|
72634
|
+
const offset = [[0, 1], [1, 0], [-1, 0], [0, -1]];
|
|
72635
|
+
let queue = [];
|
|
72636
|
+
for (let i = 0; i < size[1]; i++) for (let j = 0; j < size[0]; j++) if (0 === labels[i * size[0] + j] && !isEmptyPixel(imageData, i, j)) {
|
|
72637
|
+
labels[i * size[0] + j] = curLabel, queue.push([i, j]);
|
|
72638
|
+
for (let k = 0; k < queue.length; k++) for (let m = 0; m < 4; m++) {
|
|
72639
|
+
let row = queue[k][0] + offset[m][0],
|
|
72640
|
+
col = queue[k][1] + offset[m][1];
|
|
72641
|
+
row = row < 0 ? 0 : row >= size[1] ? size[1] - 1 : row, col = col < 0 ? 0 : col >= size[0] ? size[0] - 1 : col, 0 !== labels[row * size[0] + col] || isEmptyPixel(imageData, row, col) || (labels[row * size[0] + col] = curLabel, queue.push([row, col]));
|
|
72642
|
+
}
|
|
72643
|
+
curLabel++, queue = [];
|
|
72644
|
+
}
|
|
72645
|
+
const boundaries = {},
|
|
72646
|
+
areas = {},
|
|
72647
|
+
centers = {},
|
|
72648
|
+
maxPoints = {},
|
|
72649
|
+
maxR = {},
|
|
72650
|
+
ratios = {},
|
|
72651
|
+
shapeBounds = {
|
|
72652
|
+
x1: 1 / 0,
|
|
72653
|
+
x2: -1 / 0,
|
|
72654
|
+
y1: 1 / 0,
|
|
72655
|
+
y2: -1 / 0,
|
|
72656
|
+
width: 0,
|
|
72657
|
+
height: 0
|
|
72658
|
+
};
|
|
72659
|
+
for (let i = 0; i < size[1]; i++) for (let j = 0; j < size[0]; j++) {
|
|
72660
|
+
const label = labels[i * size[0] + j];
|
|
72661
|
+
0 !== label && (isBoundaryPixel(i, j) && (boundaries[label] = boundaries[label] || [], boundaries[label].push([j, i]), maxPoints[label] || (maxPoints[label] = [1 / 0, -1 / 0, 1 / 0, -1 / 0]), i < maxPoints[label][0] && (maxPoints[label][0] = i), i > maxPoints[label][1] && (maxPoints[label][1] = i), j < maxPoints[label][2] && (maxPoints[label][2] = j), j > maxPoints[label][3] && (maxPoints[label][3] = j), j < shapeBounds.x1 && (shapeBounds.x1 = j), j > shapeBounds.x2 && (shapeBounds.x2 = j), i < shapeBounds.y1 && (shapeBounds.y1 = i), i > shapeBounds.y2 && (shapeBounds.y2 = i)), areas[label] = areas[label] || 0, areas[label]++);
|
|
72662
|
+
}
|
|
72663
|
+
const allBoundaries = [];
|
|
72664
|
+
for (const label in boundaries) {
|
|
72665
|
+
const boundary = boundaries[label],
|
|
72666
|
+
x = ~~(boundary.reduce((acc, cur) => acc + cur[0], 0) / boundary.length),
|
|
72667
|
+
y = ~~(boundary.reduce((acc, cur) => acc + cur[1], 0) / boundary.length);
|
|
72668
|
+
centers[label] = [x, y], allBoundaries.push(...boundary);
|
|
72669
|
+
const [yMin, yMax, xMin, xMax] = maxPoints[label];
|
|
72670
|
+
maxR[label] = ~~Math.max(Math.sqrt((x - xMin) ** 2 + (y - yMin) ** 2), Math.sqrt((x - xMax) ** 2 + (y - yMax) ** 2), Math.sqrt((x - xMin) ** 2 + (y - yMax) ** 2), Math.sqrt((x - xMax) ** 2 + (y - yMin) ** 2)), ratios[label] = (xMax - xMin) / (yMax - yMin);
|
|
72671
|
+
}
|
|
72672
|
+
const regions = Object.keys(centers).map(key => ({
|
|
72673
|
+
label: key - 1,
|
|
72674
|
+
boundary: boundaries[key],
|
|
72675
|
+
area: areas[key],
|
|
72676
|
+
center: centers[key],
|
|
72677
|
+
maxPoint: maxPoints[key],
|
|
72678
|
+
maxR: maxR[key],
|
|
72679
|
+
ratio: ratios[key]
|
|
72680
|
+
}));
|
|
72681
|
+
shapeBounds.width = shapeBounds.x2 - shapeBounds.x1 + 1, shapeBounds.height = shapeBounds.y2 - shapeBounds.y1 + 1;
|
|
72682
|
+
const x = ~~(allBoundaries.reduce((acc, cur) => acc + cur[0], 0) / allBoundaries.length),
|
|
72683
|
+
y = ~~(allBoundaries.reduce((acc, cur) => acc + cur[1], 0) / allBoundaries.length),
|
|
72684
|
+
shapeMaxR = ~~Math.max(Math.sqrt((x - shapeBounds.x1) ** 2 + (y - shapeBounds.y1) ** 2), Math.sqrt((x - shapeBounds.x2) ** 2 + (y - shapeBounds.y2) ** 2), Math.sqrt((x - shapeBounds.x1) ** 2 + (y - shapeBounds.y2) ** 2), Math.sqrt((x - shapeBounds.x2) ** 2 + (y - shapeBounds.y1) ** 2)),
|
|
72685
|
+
shapeRatio = shapeBounds.width / shapeBounds.height,
|
|
72686
|
+
shapeArea = Object.keys(areas).reduce((acc, key) => acc + areas[key], 0),
|
|
72687
|
+
segmentation = {
|
|
72688
|
+
regions: regions,
|
|
72689
|
+
labels: labels,
|
|
72690
|
+
labelNumber: curLabel - 1
|
|
72691
|
+
};
|
|
72692
|
+
return Object.assign(segmentationInput, {
|
|
72693
|
+
segmentation: segmentation,
|
|
72694
|
+
shapeConfig: shapeConfig,
|
|
72695
|
+
shapeBounds: shapeBounds,
|
|
72696
|
+
shapeMaxR: shapeMaxR,
|
|
72697
|
+
shapeRatio: shapeRatio,
|
|
72698
|
+
shapeCenter: [x, y],
|
|
72699
|
+
shapeArea: shapeArea
|
|
72700
|
+
});
|
|
72701
|
+
function isBoundaryPixel(i, j) {
|
|
72366
72702
|
const offset = [[0, 1], [1, 0], [-1, 0], [0, -1]];
|
|
72367
|
-
|
|
72368
|
-
for (let
|
|
72369
|
-
|
|
72370
|
-
|
|
72371
|
-
|
|
72372
|
-
col = queue[k][1] + offset[m][1];
|
|
72373
|
-
row = row < 0 ? 0 : row >= size[1] ? size[1] - 1 : row, col = col < 0 ? 0 : col >= size[0] ? size[0] - 1 : col, 0 !== labels[row * size[0] + col] || isEmptyPixel(imageData, row, col) || (labels[row * size[0] + col] = curLabel, queue.push([row, col]));
|
|
72374
|
-
}
|
|
72375
|
-
curLabel++, queue = [];
|
|
72376
|
-
}
|
|
72377
|
-
const boundaries = {},
|
|
72378
|
-
areas = {},
|
|
72379
|
-
centers = {},
|
|
72380
|
-
maxPoints = {},
|
|
72381
|
-
maxR = {},
|
|
72382
|
-
ratios = {},
|
|
72383
|
-
shapeBounds = {
|
|
72384
|
-
x1: 1 / 0,
|
|
72385
|
-
x2: -1 / 0,
|
|
72386
|
-
y1: 1 / 0,
|
|
72387
|
-
y2: -1 / 0,
|
|
72388
|
-
width: 0,
|
|
72389
|
-
height: 0
|
|
72390
|
-
};
|
|
72391
|
-
for (let i = 0; i < size[1]; i++) for (let j = 0; j < size[0]; j++) {
|
|
72392
|
-
const label = labels[i * size[0] + j];
|
|
72393
|
-
0 !== label && (isBoundaryPixel(i, j) && (boundaries[label] = boundaries[label] || [], boundaries[label].push([j, i]), maxPoints[label] || (maxPoints[label] = [1 / 0, -1 / 0, 1 / 0, -1 / 0]), i < maxPoints[label][0] && (maxPoints[label][0] = i), i > maxPoints[label][1] && (maxPoints[label][1] = i), j < maxPoints[label][2] && (maxPoints[label][2] = j), j > maxPoints[label][3] && (maxPoints[label][3] = j), j < shapeBounds.x1 && (shapeBounds.x1 = j), j > shapeBounds.x2 && (shapeBounds.x2 = j), i < shapeBounds.y1 && (shapeBounds.y1 = i), i > shapeBounds.y2 && (shapeBounds.y2 = i)), areas[label] = areas[label] || 0, areas[label]++);
|
|
72394
|
-
}
|
|
72395
|
-
const allBoundaries = [];
|
|
72396
|
-
for (const label in boundaries) {
|
|
72397
|
-
const boundary = boundaries[label],
|
|
72398
|
-
x = ~~(boundary.reduce((acc, cur) => acc + cur[0], 0) / boundary.length),
|
|
72399
|
-
y = ~~(boundary.reduce((acc, cur) => acc + cur[1], 0) / boundary.length);
|
|
72400
|
-
centers[label] = [x, y], allBoundaries.push(...boundary);
|
|
72401
|
-
const [yMin, yMax, xMin, xMax] = maxPoints[label];
|
|
72402
|
-
maxR[label] = ~~Math.max(Math.sqrt((x - xMin) ** 2 + (y - yMin) ** 2), Math.sqrt((x - xMax) ** 2 + (y - yMax) ** 2), Math.sqrt((x - xMin) ** 2 + (y - yMax) ** 2), Math.sqrt((x - xMax) ** 2 + (y - yMin) ** 2)), ratios[label] = (xMax - xMin) / (yMax - yMin);
|
|
72403
|
-
}
|
|
72404
|
-
const regions = Object.keys(centers).map(key => ({
|
|
72405
|
-
label: key - 1,
|
|
72406
|
-
boundary: boundaries[key],
|
|
72407
|
-
area: areas[key],
|
|
72408
|
-
center: centers[key],
|
|
72409
|
-
maxPoint: maxPoints[key],
|
|
72410
|
-
maxR: maxR[key],
|
|
72411
|
-
ratio: ratios[key]
|
|
72412
|
-
}));
|
|
72413
|
-
shapeBounds.width = shapeBounds.x2 - shapeBounds.x1 + 1, shapeBounds.height = shapeBounds.y2 - shapeBounds.y1 + 1;
|
|
72414
|
-
const x = ~~(allBoundaries.reduce((acc, cur) => acc + cur[0], 0) / allBoundaries.length),
|
|
72415
|
-
y = ~~(allBoundaries.reduce((acc, cur) => acc + cur[1], 0) / allBoundaries.length),
|
|
72416
|
-
shapeMaxR = ~~Math.max(Math.sqrt((x - shapeBounds.x1) ** 2 + (y - shapeBounds.y1) ** 2), Math.sqrt((x - shapeBounds.x2) ** 2 + (y - shapeBounds.y2) ** 2), Math.sqrt((x - shapeBounds.x1) ** 2 + (y - shapeBounds.y2) ** 2), Math.sqrt((x - shapeBounds.x2) ** 2 + (y - shapeBounds.y1) ** 2)),
|
|
72417
|
-
shapeRatio = shapeBounds.width / shapeBounds.height,
|
|
72418
|
-
shapeArea = Object.keys(areas).reduce((acc, key) => acc + areas[key], 0),
|
|
72419
|
-
segmentation = {
|
|
72420
|
-
regions: regions,
|
|
72421
|
-
labels: labels,
|
|
72422
|
-
labelNumber: curLabel - 1
|
|
72423
|
-
};
|
|
72424
|
-
return Object.assign(segmentationInput, {
|
|
72425
|
-
segmentation: segmentation,
|
|
72426
|
-
shapeConfig: shapeConfig,
|
|
72427
|
-
shapeBounds: shapeBounds,
|
|
72428
|
-
shapeMaxR: shapeMaxR,
|
|
72429
|
-
shapeRatio: shapeRatio,
|
|
72430
|
-
shapeCenter: [x, y],
|
|
72431
|
-
shapeArea: shapeArea
|
|
72432
|
-
});
|
|
72433
|
-
function isBoundaryPixel(i, j) {
|
|
72434
|
-
const offset = [[0, 1], [1, 0], [-1, 0], [0, -1]];
|
|
72435
|
-
if (0 === i || 0 === j || i === size[1] - 1 || j === size[0] - 1) return !0;
|
|
72436
|
-
for (let k = 0; k < 4; k++) {
|
|
72437
|
-
let row = i + offset[k][0],
|
|
72438
|
-
col = j + offset[k][1];
|
|
72439
|
-
if (row = row < 0 ? 0 : row >= size[1] ? size[1] - 1 : row, col = col < 0 ? 0 : col >= size[0] ? size[0] - 1 : col, 0 === labels[row * size[0] + col]) return !0;
|
|
72440
|
-
}
|
|
72441
|
-
return !1;
|
|
72703
|
+
if (0 === i || 0 === j || i === size[1] - 1 || j === size[0] - 1) return !0;
|
|
72704
|
+
for (let k = 0; k < 4; k++) {
|
|
72705
|
+
let row = i + offset[k][0],
|
|
72706
|
+
col = j + offset[k][1];
|
|
72707
|
+
if (row = row < 0 ? 0 : row >= size[1] ? size[1] - 1 : row, col = col < 0 ? 0 : col >= size[0] ? size[0] - 1 : col, 0 === labels[row * size[0] + col]) return !0;
|
|
72442
72708
|
}
|
|
72443
|
-
|
|
72709
|
+
return !1;
|
|
72710
|
+
}
|
|
72444
72711
|
}
|
|
72445
72712
|
function isEmptyPixel(imageData, i, j) {
|
|
72446
72713
|
const width = imageData.width;
|
|
72447
72714
|
return 0 === imageData.data[i * width * 4 + 4 * j + 3] || 255 === imageData.data[i * width * 4 + 4 * j + 0] && 255 === imageData.data[i * width * 4 + 4 * j + 1] && 255 === imageData.data[i * width * 4 + 4 * j + 2];
|
|
72448
72715
|
}
|
|
72449
72716
|
function removeBorder(image, canvas, ctx) {
|
|
72450
|
-
|
|
72451
|
-
|
|
72452
|
-
|
|
72453
|
-
|
|
72454
|
-
|
|
72455
|
-
|
|
72456
|
-
|
|
72457
|
-
|
|
72458
|
-
|
|
72459
|
-
|
|
72460
|
-
|
|
72461
|
-
|
|
72462
|
-
|
|
72463
|
-
return canvas.width = trimmed.width, canvas.height = trimmed.height, ctx.clearRect(0, 0, canvas.width, canvas.height), ctx.putImageData(trimmed, 0, 0), yield loadImage(canvas.toDataURL("imgage/png"));
|
|
72464
|
-
});
|
|
72717
|
+
canvas.width = image.width, canvas.height = image.height, ctx.clearRect(0, 0, canvas.width, canvas.height), ctx.drawImage(image, 0, 0);
|
|
72718
|
+
const width = canvas.width,
|
|
72719
|
+
imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
|
|
72720
|
+
let top = 0,
|
|
72721
|
+
bottom = imageData.height,
|
|
72722
|
+
left = 0,
|
|
72723
|
+
right = imageData.width;
|
|
72724
|
+
for (; top < bottom && rowBlank(imageData, width, top);) ++top;
|
|
72725
|
+
for (; bottom - 1 > top && rowBlank(imageData, width, bottom - 1);) --bottom;
|
|
72726
|
+
for (; left < right && columnBlank(imageData, width, left, top, bottom);) ++left;
|
|
72727
|
+
for (; right - 1 > left && columnBlank(imageData, width, right - 1, top, bottom);) --right;
|
|
72728
|
+
const trimmed = ctx.getImageData(left, top, right - left, bottom - top);
|
|
72729
|
+
return canvas.width = trimmed.width, canvas.height = trimmed.height, ctx.clearRect(0, 0, canvas.width, canvas.height), ctx.putImageData(trimmed, 0, 0), canvas;
|
|
72465
72730
|
}
|
|
72466
72731
|
function rowBlank(imageData, width, y) {
|
|
72467
72732
|
for (let x = 0; x < width; ++x) if (!isEmptyPixel(imageData, y, x)) return !1;
|
|
@@ -72969,44 +73234,17 @@
|
|
|
72969
73234
|
}
|
|
72970
73235
|
}
|
|
72971
73236
|
|
|
72972
|
-
var __awaiter$1 = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
72973
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
72974
|
-
function fulfilled(value) {
|
|
72975
|
-
try {
|
|
72976
|
-
step(generator.next(value));
|
|
72977
|
-
} catch (e) {
|
|
72978
|
-
reject(e);
|
|
72979
|
-
}
|
|
72980
|
-
}
|
|
72981
|
-
function rejected(value) {
|
|
72982
|
-
try {
|
|
72983
|
-
step(generator.throw(value));
|
|
72984
|
-
} catch (e) {
|
|
72985
|
-
reject(e);
|
|
72986
|
-
}
|
|
72987
|
-
}
|
|
72988
|
-
function step(result) {
|
|
72989
|
-
var value;
|
|
72990
|
-
result.done ? resolve(result.value) : (value = result.value, value instanceof P ? value : new P(function (resolve) {
|
|
72991
|
-
resolve(value);
|
|
72992
|
-
})).then(fulfilled, rejected);
|
|
72993
|
-
}
|
|
72994
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
72995
|
-
});
|
|
72996
|
-
};
|
|
72997
73237
|
function cloud (words, layoutConfig, segmentationOutput) {
|
|
72998
|
-
|
|
72999
|
-
|
|
73000
|
-
|
|
73001
|
-
|
|
73002
|
-
|
|
73003
|
-
|
|
73004
|
-
|
|
73005
|
-
|
|
73006
|
-
|
|
73007
|
-
|
|
73008
|
-
};
|
|
73009
|
-
});
|
|
73238
|
+
allocateWords(words, segmentationOutput), "ensureMapping" === layoutConfig.layoutMode ? layoutGlobalShrink(words, layoutConfig, segmentationOutput) : "ensureMappingEnlarge" === layoutConfig.layoutMode ? layoutSelfEnlarge(words, layoutConfig, segmentationOutput) : layout(words, layoutConfig, segmentationOutput);
|
|
73239
|
+
const fillingWords = filling(words, layoutConfig, segmentationOutput),
|
|
73240
|
+
failedWords = [],
|
|
73241
|
+
successedWords = [];
|
|
73242
|
+
for (let i = 0; i < words.length; i++) words[i].hasPlaced ? successedWords.push(words[i]) : failedWords.push(words[i]);
|
|
73243
|
+
return failedWords.forEach(word => word.visible = !1), {
|
|
73244
|
+
fillingWords: fillingWords,
|
|
73245
|
+
successedWords: successedWords,
|
|
73246
|
+
failedWords: failedWords
|
|
73247
|
+
};
|
|
73010
73248
|
}
|
|
73011
73249
|
|
|
73012
73250
|
var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
@@ -73049,7 +73287,9 @@
|
|
|
73049
73287
|
};
|
|
73050
73288
|
const transform$1 = (options, upstreamData, parameters, view) => __awaiter(void 0, void 0, void 0, function* () {
|
|
73051
73289
|
var _a, _b, _c;
|
|
73052
|
-
if (options.size
|
|
73290
|
+
if (!options.size || options.size[0] <= 0 || options.size[1] <= 0) {
|
|
73291
|
+
return Logger.getInstance().info("Wordcloud size dimensions must be greater than 0"), [];
|
|
73292
|
+
}
|
|
73053
73293
|
options.shape || error("WordcloudShape shape must be specified."), options.text || error("WordcloudShape text must be specified."), (null == view ? void 0 : view.emit) && view.emit(WORDCLOUD_SHAPE_HOOK_EVENT.BEFORE_WORDCLOUD_SHAPE_LAYOUT);
|
|
73054
73294
|
const data = upstreamData,
|
|
73055
73295
|
as = options.as || OUTPUT;
|
|
@@ -73073,7 +73313,9 @@
|
|
|
73073
73313
|
tempCtx.textAlign = "center", tempCtx.textBaseline = "middle", segmentationInput.tempCanvas = tempCanvas, segmentationInput.tempCtx = tempCtx;
|
|
73074
73314
|
const boardW = options.size[0] + 31 >> 5 << 5;
|
|
73075
73315
|
segmentationInput.boardSize = [boardW, options.size[1]], segmentationInput.random ? segmentationInput.randomGenerator = Math.random : segmentationInput.randomGenerator = fakeRandom();
|
|
73076
|
-
const
|
|
73316
|
+
const shapeImage = yield loadAndHandleImage(segmentationInput);
|
|
73317
|
+
if (!shapeImage) return [];
|
|
73318
|
+
const segmentationOutput = segmentation(shapeImage, segmentationInput),
|
|
73077
73319
|
colorMode = options.colorMode || "ordinal",
|
|
73078
73320
|
wordsConfig = {
|
|
73079
73321
|
getText: field(options.text),
|
|
@@ -73166,17 +73408,17 @@
|
|
|
73166
73408
|
fillingWords: fillingWords,
|
|
73167
73409
|
successedWords: successedWords,
|
|
73168
73410
|
failedWords: failedWords
|
|
73169
|
-
} =
|
|
73411
|
+
} = cloud(words, layoutConfig, segmentationOutput);
|
|
73170
73412
|
let w, t;
|
|
73171
73413
|
const modKeywords = [];
|
|
73172
|
-
for (let i = 0; i < words.length; ++i) w = words[i], t = w.datum, t[as.x] = w.x, t[as.y] = w.y, t[as.fontFamily] = w.fontFamily, t[as.fontSize] = w.fontSize, t[as.fontStyle] = w.fontStyle, t[as.fontWeight] = w.fontWeight, t[as.angle] = w.rotate, t[as.opacity] = w.opacity, t[as.visible] = w.visible, t[as.isFillingWord] = !1, t[as.color] = w.color, modKeywords.push(t);
|
|
73414
|
+
for (let i = 0; i < words.length; ++i) w = words[i], t = w.datum, t[as.x] = w.x, t[as.y] = w.y, t[as.fontFamily] = w.fontFamily, t[as.fontSize] = w.fontSize, t[as.fontStyle] = w.fontStyle, t[as.fontWeight] = w.fontWeight, t[as.angle] = degreeToRadian(w.rotate), t[as.opacity] = w.opacity, t[as.visible] = w.visible, t[as.isFillingWord] = !1, t[as.color] = w.color, modKeywords.push(t);
|
|
73173
73415
|
const textKey = null !== (_b = null === (_a = options.text) || void 0 === _a ? void 0 : _a.field) && void 0 !== _b ? _b : "textKey",
|
|
73174
73416
|
dataIndexKey = null !== (_c = options.dataIndexKey) && void 0 !== _c ? _c : "defaultDataIndexKey",
|
|
73175
73417
|
fillingWordsData = [];
|
|
73176
73418
|
return fillingWords.forEach((word, index) => {
|
|
73177
73419
|
var _a, _b;
|
|
73178
73420
|
const t = {};
|
|
73179
|
-
t[as.x] = word.x, t[as.y] = word.y, t[as.fontFamily] = word.fontFamily, t[as.fontSize] = word.fontSize, t[as.fontStyle] = word.fontStyle, t[as.fontWeight] = word.fontWeight, t[as.angle] = word.rotate, t[as.opacity] = word.opacity, t[as.visible] = word.visible, t[as.isFillingWord] = !0, t[as.color] = getFillingColor ? (null === (_a = options.colorField) || void 0 === _a ? void 0 : _a.field) === (null === (_b = options.fillingColorField) || void 0 === _b ? void 0 : _b.field) && sameColorList ? word.color : word.fillingColor : layoutConfig.fillingColorList[~~(segmentationInput.randomGenerator() * layoutConfig.fillingColorList.length)], t[textKey] = word.text, t[dataIndexKey] = `${word.text}_${index}_fillingWords`, fillingWordsData.push(t);
|
|
73421
|
+
t[as.x] = word.x, t[as.y] = word.y, t[as.fontFamily] = word.fontFamily, t[as.fontSize] = word.fontSize, t[as.fontStyle] = word.fontStyle, t[as.fontWeight] = word.fontWeight, t[as.angle] = degreeToRadian(word.rotate), t[as.opacity] = word.opacity, t[as.visible] = word.visible, t[as.isFillingWord] = !0, t[as.color] = getFillingColor ? (null === (_a = options.colorField) || void 0 === _a ? void 0 : _a.field) === (null === (_b = options.fillingColorField) || void 0 === _b ? void 0 : _b.field) && sameColorList ? word.color : word.fillingColor : layoutConfig.fillingColorList[~~(segmentationInput.randomGenerator() * layoutConfig.fillingColorList.length)], t[textKey] = word.text, t[dataIndexKey] = `${word.text}_${index}_fillingWords`, fillingWordsData.push(t);
|
|
73180
73422
|
}), (null == view ? void 0 : view.emit) && view.emit(WORDCLOUD_SHAPE_HOOK_EVENT.AFTER_WORDCLOUD_SHAPE_LAYOUT, {
|
|
73181
73423
|
successedWords: successedWords,
|
|
73182
73424
|
failedWords: failedWords
|
|
@@ -73203,10 +73445,12 @@
|
|
|
73203
73445
|
fillingColorScale = datum => new OrdinalScale().domain(uniquefillingColorField).range(fillingColorList).scale(datum);
|
|
73204
73446
|
}
|
|
73205
73447
|
} else {
|
|
73206
|
-
|
|
73207
|
-
|
|
73208
|
-
|
|
73209
|
-
1 === fillingColorList.length && (fillingColorList = [fillingColorList[0], fillingColorList[0]])
|
|
73448
|
+
1 === colorList.length && (colorList = [colorList[0], colorList[0]]);
|
|
73449
|
+
const valueScale = new LinearScale().domain(extent(getColor, data)).range(colorList);
|
|
73450
|
+
if (colorScale = i => valueScale.scale(i), getFillingColor && ((null === (_c = options.colorField) || void 0 === _c ? void 0 : _c.field) !== (null === (_d = options.fillingColorField) || void 0 === _d ? void 0 : _d.field) || !sameColorList)) {
|
|
73451
|
+
1 === fillingColorList.length && (fillingColorList = [fillingColorList[0], fillingColorList[0]]);
|
|
73452
|
+
const fillingValueScale = new LinearScale().domain(extent(getFillingColor, data)).range(fillingColorList);
|
|
73453
|
+
fillingColorScale = i => fillingValueScale.scale(i);
|
|
73210
73454
|
}
|
|
73211
73455
|
}
|
|
73212
73456
|
Object.assign(wordsConfig, {
|
|
@@ -73229,7 +73473,7 @@
|
|
|
73229
73473
|
fontSizeScale = datum => sizeScale.scale(getFontSize(datum));
|
|
73230
73474
|
} else if (getFontSize && isFunction(getFontSize) && !range) {
|
|
73231
73475
|
const a = .5,
|
|
73232
|
-
[min, max] =
|
|
73476
|
+
[min, max] = extent(getFontSize, data),
|
|
73233
73477
|
words = data.map(datum => ({
|
|
73234
73478
|
text: getText(datum),
|
|
73235
73479
|
value: getFontSize(datum),
|
|
@@ -73468,7 +73712,7 @@
|
|
|
73468
73712
|
const fontWeightField = this._fontWeightField;
|
|
73469
73713
|
const fillingRotateAngles = this._wordCloudShapeConfig.fillingRotateAngles;
|
|
73470
73714
|
if (valueField) {
|
|
73471
|
-
const [minValue, maxValue] = extent$2((_a = this.getViewData()) === null || _a === void 0 ? void 0 : _a.latestData.map((datum) => datum[valueField]));
|
|
73715
|
+
const [minValue, maxValue] = extent$2((_a = this.getViewData()) === null || _a === void 0 ? void 0 : _a.latestData.map((datum) => +datum[valueField]));
|
|
73472
73716
|
valueScale.domain([minValue, maxValue], true).range(fontWeightRange);
|
|
73473
73717
|
wordCloudTransforms.push({
|
|
73474
73718
|
type: 'map',
|
|
@@ -73648,7 +73892,7 @@
|
|
|
73648
73892
|
const fontWeightField = this._fontWeightField;
|
|
73649
73893
|
const fillingRotateAngles = this._wordCloudShapeConfig.fillingRotateAngles;
|
|
73650
73894
|
if (valueField) {
|
|
73651
|
-
const [minValue, maxValue] = extent$2((_a = this.getViewData()) === null || _a === void 0 ? void 0 : _a.latestData.map((datum) => datum[valueField]));
|
|
73895
|
+
const [minValue, maxValue] = extent$2((_a = this.getViewData()) === null || _a === void 0 ? void 0 : _a.latestData.map((datum) => +datum[valueField]));
|
|
73652
73896
|
valueScale.domain([minValue, maxValue], true).range(fontWeightRange);
|
|
73653
73897
|
wordCloudTransforms.push({
|
|
73654
73898
|
type: 'map',
|
|
@@ -78634,7 +78878,7 @@
|
|
|
78634
78878
|
}
|
|
78635
78879
|
_getDefaultSeriesSpec(spec) {
|
|
78636
78880
|
var _a;
|
|
78637
|
-
return Object.assign(Object.assign({}, super._getDefaultSeriesSpec(spec)), {
|
|
78881
|
+
return Object.assign(Object.assign({}, super._getDefaultSeriesSpec(spec)), { point: spec.point, line: spec.line, area: spec.area, seriesMark: (_a = spec.seriesMark) !== null && _a !== void 0 ? _a : 'area', activePoint: spec.activePoint });
|
|
78638
78882
|
}
|
|
78639
78883
|
transformSpec(spec) {
|
|
78640
78884
|
super.transformSpec(spec);
|
|
@@ -79133,7 +79377,7 @@
|
|
|
79133
79377
|
}
|
|
79134
79378
|
_getDefaultSeriesSpec(spec) {
|
|
79135
79379
|
var _a;
|
|
79136
|
-
return Object.assign(Object.assign({}, super._getDefaultSeriesSpec(spec)), {
|
|
79380
|
+
return Object.assign(Object.assign({}, super._getDefaultSeriesSpec(spec)), { point: spec.point, line: spec.line, seriesMark: (_a = spec.seriesMark) !== null && _a !== void 0 ? _a : 'line', activePoint: spec.activePoint });
|
|
79137
79381
|
}
|
|
79138
79382
|
transformSpec(spec) {
|
|
79139
79383
|
super.transformSpec(spec);
|
|
@@ -79403,7 +79647,7 @@
|
|
|
79403
79647
|
}
|
|
79404
79648
|
_getDefaultSeriesSpec(spec) {
|
|
79405
79649
|
var _a;
|
|
79406
|
-
return Object.assign(Object.assign({}, super._getDefaultSeriesSpec(spec)), { seriesField: spec.seriesField,
|
|
79650
|
+
return Object.assign(Object.assign({}, super._getDefaultSeriesSpec(spec)), { seriesField: spec.seriesField, line: spec.line, point: spec.point, stack: spec.stack, percent: spec.percent, area: merge$2({
|
|
79407
79651
|
visible: false
|
|
79408
79652
|
}, spec.area), seriesMark: (_a = spec.seriesMark) !== null && _a !== void 0 ? _a : 'area', activePoint: spec.activePoint });
|
|
79409
79653
|
}
|
|
@@ -80112,14 +80356,14 @@
|
|
|
80112
80356
|
this.name = 'component';
|
|
80113
80357
|
this.modelType = 'component';
|
|
80114
80358
|
this._regions = [];
|
|
80115
|
-
this._delegateEvent = (component, event, type) => {
|
|
80359
|
+
this._delegateEvent = (component, event, type, item = null, datum = null) => {
|
|
80116
80360
|
var _a, _b;
|
|
80117
80361
|
this.event.emit(type, {
|
|
80118
80362
|
model: this,
|
|
80119
80363
|
node: component,
|
|
80120
80364
|
event,
|
|
80121
|
-
item:
|
|
80122
|
-
datum:
|
|
80365
|
+
item: item,
|
|
80366
|
+
datum: datum,
|
|
80123
80367
|
source: Event_Source_Type.chart,
|
|
80124
80368
|
chart: (_b = (_a = this._option) === null || _a === void 0 ? void 0 : _a.globalInstance) === null || _b === void 0 ? void 0 : _b.getChart()
|
|
80125
80369
|
}, 'model');
|
|
@@ -80144,7 +80388,7 @@
|
|
|
80144
80388
|
};
|
|
80145
80389
|
}
|
|
80146
80390
|
setCurrentTheme(theme, noRender) {
|
|
80147
|
-
return __awaiter$
|
|
80391
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
|
80148
80392
|
const modifyConfig = () => {
|
|
80149
80393
|
this.reInit(theme);
|
|
80150
80394
|
return { change: true, reMake: false };
|
|
@@ -83324,7 +83568,7 @@
|
|
|
83324
83568
|
if (isHorizontal && !isXAxis(spec.orient)) {
|
|
83325
83569
|
inverse = isValid(spec.inverse) ? !spec.inverse : true;
|
|
83326
83570
|
}
|
|
83327
|
-
return new C(Object.assign(Object.assign({}, spec), { inverse }), options);
|
|
83571
|
+
return new C(Object.assign(Object.assign({}, spec), { type: axisType, inverse }), options);
|
|
83328
83572
|
}
|
|
83329
83573
|
options.onError(`Component ${componentName} not found`);
|
|
83330
83574
|
return null;
|
|
@@ -83928,7 +84172,7 @@
|
|
|
83928
84172
|
}
|
|
83929
84173
|
niceDomain(domain) {
|
|
83930
84174
|
const { min: userMin, max: userMax } = getLinearAxisSpecDomain(this._spec);
|
|
83931
|
-
if (isValid(userMin) || isValid(userMax)) {
|
|
84175
|
+
if (isValid(userMin) || isValid(userMax) || this._spec.type !== 'linear') {
|
|
83932
84176
|
return domain;
|
|
83933
84177
|
}
|
|
83934
84178
|
if (Math.abs(minInArray(domain) - maxInArray(domain)) <= 1e-12) {
|
|
@@ -84397,7 +84641,7 @@
|
|
|
84397
84641
|
const componentName = `${PolarAxis.type}-${axisType}`;
|
|
84398
84642
|
const C = Factory.getComponentInKey(componentName);
|
|
84399
84643
|
if (C) {
|
|
84400
|
-
return new C(spec, options);
|
|
84644
|
+
return new C(Object.assign(Object.assign({}, spec), { type: axisType }), options);
|
|
84401
84645
|
}
|
|
84402
84646
|
options.onError(`Component ${componentName} not found`);
|
|
84403
84647
|
return null;
|
|
@@ -85278,10 +85522,10 @@
|
|
|
85278
85522
|
const statisticData = s.getRawDataStatistics().latestData;
|
|
85279
85523
|
const seriesMin = (_a = statisticData === null || statisticData === void 0 ? void 0 : statisticData[datumField]) === null || _a === void 0 ? void 0 : _a.min;
|
|
85280
85524
|
const seriesMax = (_b = statisticData === null || statisticData === void 0 ? void 0 : statisticData[datumField]) === null || _b === void 0 ? void 0 : _b.max;
|
|
85281
|
-
if (isValidNumber(seriesMin)
|
|
85525
|
+
if (isValidNumber(seriesMin)) {
|
|
85282
85526
|
min = seriesMin;
|
|
85283
85527
|
}
|
|
85284
|
-
if (isValidNumber(seriesMax)
|
|
85528
|
+
if (isValidNumber(seriesMax)) {
|
|
85285
85529
|
max = seriesMax;
|
|
85286
85530
|
}
|
|
85287
85531
|
});
|
|
@@ -85483,8 +85727,16 @@
|
|
|
85483
85727
|
if (isEmpty(visualMappingRange)) {
|
|
85484
85728
|
visualMappingRange = this._legendType === 'color' ? SINGLE_SEQUENCE : SIZE;
|
|
85485
85729
|
}
|
|
85730
|
+
let min = (_a = this._legendData.getLatestData()[0]) !== null && _a !== void 0 ? _a : 0;
|
|
85731
|
+
let max = (_b = this._legendData.getLatestData()[1]) !== null && _b !== void 0 ? _b : 1;
|
|
85732
|
+
const isSame = this._legendData.getLatestData()[0] === this._legendData.getLatestData()[1];
|
|
85733
|
+
if (isSame) {
|
|
85734
|
+
min = Math.min(0, this._legendData.getLatestData()[0]);
|
|
85735
|
+
max = this._legendData.getLatestData()[0] === 0 ? 1 : Math.max(0, this._legendData.getLatestData()[0]);
|
|
85736
|
+
}
|
|
85486
85737
|
const attrs = Object.assign(Object.assign({}, getContinuousLegendAttributes(this._spec)), { layout,
|
|
85487
|
-
align, zIndex: this.layoutZIndex, min
|
|
85738
|
+
align, zIndex: this.layoutZIndex, min,
|
|
85739
|
+
max, value: this._spec.defaultSelected, [this._legendType === 'color' ? 'colors' : 'sizeRange']: visualMappingRange });
|
|
85488
85740
|
this._addDefaultTitleText(attrs);
|
|
85489
85741
|
return attrs;
|
|
85490
85742
|
}
|
|
@@ -85836,9 +86088,12 @@
|
|
|
85836
86088
|
return this._titleComponent;
|
|
85837
86089
|
}
|
|
85838
86090
|
clear() {
|
|
85839
|
-
|
|
85840
|
-
|
|
86091
|
+
if (this._titleComponent) {
|
|
86092
|
+
this._container.removeChild(this._titleComponent);
|
|
86093
|
+
this._titleComponent = null;
|
|
86094
|
+
}
|
|
85841
86095
|
this._cacheAttrs = null;
|
|
86096
|
+
super.clear();
|
|
85842
86097
|
}
|
|
85843
86098
|
}
|
|
85844
86099
|
Title.type = ComponentTypeEnum.title;
|
|
@@ -85989,6 +86244,7 @@
|
|
|
85989
86244
|
this.initProjection();
|
|
85990
86245
|
this.coordinateHelper();
|
|
85991
86246
|
this.initEvent();
|
|
86247
|
+
this._initCenterCache();
|
|
85992
86248
|
}
|
|
85993
86249
|
dispatchZoom(zoomDelta, center) {
|
|
85994
86250
|
const scaleCenter = center || {
|
|
@@ -86046,14 +86302,22 @@
|
|
|
86046
86302
|
s.setCoordinateHelper(helper);
|
|
86047
86303
|
}
|
|
86048
86304
|
else {
|
|
86049
|
-
s.setXAxisHelper(Object.assign(Object.assign({}, helper), { dataToPosition: (values) => {
|
|
86050
|
-
|
|
86051
|
-
|
|
86052
|
-
|
|
86053
|
-
|
|
86054
|
-
|
|
86055
|
-
|
|
86056
|
-
|
|
86305
|
+
s.setXAxisHelper(Object.assign(Object.assign({}, helper), { dataToPosition: (values, option) => {
|
|
86306
|
+
let value = values[0];
|
|
86307
|
+
if (isNil(value) && (option === null || option === void 0 ? void 0 : option.datum)) {
|
|
86308
|
+
const nameFieldValue = option.datum[s.getDimensionField()[0]];
|
|
86309
|
+
value = this._centerCache.get(nameFieldValue).x;
|
|
86310
|
+
}
|
|
86311
|
+
return this.dataToLongitude(value);
|
|
86312
|
+
}, getFields: () => [this._longitudeField], getAxisType: () => this.type, getAxisId: () => this.id, isInverse: () => false }));
|
|
86313
|
+
s.setYAxisHelper(Object.assign(Object.assign({}, helper), { dataToPosition: (values, option) => {
|
|
86314
|
+
let value = values[0];
|
|
86315
|
+
if (isNil(value) && (option === null || option === void 0 ? void 0 : option.datum)) {
|
|
86316
|
+
const nameFieldValue = option.datum[s.getDimensionField()[0]];
|
|
86317
|
+
value = this._centerCache.get(nameFieldValue).y;
|
|
86318
|
+
}
|
|
86319
|
+
return this.dataToLatitude(value);
|
|
86320
|
+
}, getFields: () => [this._latitudeField], getAxisType: () => this.type, getAxisId: () => this.id, isInverse: () => false }));
|
|
86057
86321
|
}
|
|
86058
86322
|
});
|
|
86059
86323
|
});
|
|
@@ -86137,26 +86401,31 @@
|
|
|
86137
86401
|
center && (translate = [size[0] / 2, size[1] / 2]);
|
|
86138
86402
|
return { translate, scale, center };
|
|
86139
86403
|
}
|
|
86140
|
-
|
|
86404
|
+
_initCenterCache() {
|
|
86405
|
+
if (!this._centerCache) {
|
|
86406
|
+
this._centerCache = new Map();
|
|
86407
|
+
}
|
|
86141
86408
|
this._regions.forEach(r => {
|
|
86142
|
-
|
|
86143
|
-
|
|
86144
|
-
|
|
86145
|
-
|
|
86146
|
-
|
|
86147
|
-
s.
|
|
86148
|
-
|
|
86149
|
-
|
|
86150
|
-
});
|
|
86151
|
-
|
|
86152
|
-
|
|
86153
|
-
|
|
86154
|
-
|
|
86155
|
-
}
|
|
86156
|
-
});
|
|
86157
|
-
}
|
|
86409
|
+
r.getSeries().forEach(s => {
|
|
86410
|
+
var _a, _b;
|
|
86411
|
+
if (s.type === 'map') {
|
|
86412
|
+
const mapData = (_b = (_a = s.getMapViewData()) === null || _a === void 0 ? void 0 : _a.latestData) !== null && _b !== void 0 ? _b : [];
|
|
86413
|
+
mapData.forEach((feature = {}) => {
|
|
86414
|
+
const key = feature[s.getDimensionField()[0]] || feature[DEFAULT_MAP_LOOK_UP_KEY];
|
|
86415
|
+
const { centroidX, centroidY } = feature;
|
|
86416
|
+
if (key && isValid(centroidX * centroidY)) {
|
|
86417
|
+
this._centerCache.set(key, { x: centroidX, y: centroidY });
|
|
86418
|
+
}
|
|
86419
|
+
});
|
|
86420
|
+
}
|
|
86421
|
+
});
|
|
86158
86422
|
});
|
|
86159
86423
|
}
|
|
86424
|
+
release() {
|
|
86425
|
+
super.release();
|
|
86426
|
+
this._centerCache && this._centerCache.clear();
|
|
86427
|
+
this._centerCache = null;
|
|
86428
|
+
}
|
|
86160
86429
|
}
|
|
86161
86430
|
GeoCoordinate.type = ComponentTypeEnum.geoCoordinate;
|
|
86162
86431
|
mixin(GeoCoordinate, Zoomable);
|
|
@@ -86305,8 +86574,9 @@
|
|
|
86305
86574
|
return null;
|
|
86306
86575
|
}
|
|
86307
86576
|
_getAxisInfoByField(field) {
|
|
86308
|
-
|
|
86309
|
-
|
|
86577
|
+
var _a, _b;
|
|
86578
|
+
const axesComponents = (_b = (_a = this._option) === null || _a === void 0 ? void 0 : _a.getComponentsByKey) === null || _b === void 0 ? void 0 : _b.call(_a, 'axes');
|
|
86579
|
+
if (!(axesComponents === null || axesComponents === void 0 ? void 0 : axesComponents.length)) {
|
|
86310
86580
|
return null;
|
|
86311
86581
|
}
|
|
86312
86582
|
let bindingAxesIndex = get$1(this._spec, `${field}Field.bindingAxesIndex`);
|
|
@@ -86970,7 +87240,7 @@
|
|
|
86970
87240
|
else if (type === 'rect') {
|
|
86971
87241
|
crosshair = new RectCrosshair(Object.assign(Object.assign({}, attributes), { rectStyle: style, zIndex: this.gridZIndex }));
|
|
86972
87242
|
}
|
|
86973
|
-
container.add(crosshair);
|
|
87243
|
+
container === null || container === void 0 ? void 0 : container.add(crosshair);
|
|
86974
87244
|
if (dim === 'x') {
|
|
86975
87245
|
this._xCrosshair = crosshair;
|
|
86976
87246
|
}
|
|
@@ -87922,6 +88192,27 @@
|
|
|
87922
88192
|
this._startRelativeSeries = this._getSeriesByIdOrIndex(spec.startRelativeSeriesId, spec.startRelativeSeriesIndex);
|
|
87923
88193
|
this._endRelativeSeries = this._getSeriesByIdOrIndex(spec.endRelativeSeriesId, spec.endRelativeSeriesIndex);
|
|
87924
88194
|
}
|
|
88195
|
+
_computeClipRange(regions) {
|
|
88196
|
+
let minX = Infinity;
|
|
88197
|
+
let maxX = -Infinity;
|
|
88198
|
+
let minY = Infinity;
|
|
88199
|
+
let maxY = -Infinity;
|
|
88200
|
+
regions.forEach((region) => {
|
|
88201
|
+
if (region.getLayoutStartPoint().x < minX) {
|
|
88202
|
+
minX = region.getLayoutStartPoint().x;
|
|
88203
|
+
}
|
|
88204
|
+
if (region.getLayoutStartPoint().x + region.getLayoutRect().width > maxX) {
|
|
88205
|
+
maxX = region.getLayoutStartPoint().x + region.getLayoutRect().width;
|
|
88206
|
+
}
|
|
88207
|
+
if (region.getLayoutStartPoint().y < minY) {
|
|
88208
|
+
minY = region.getLayoutStartPoint().y;
|
|
88209
|
+
}
|
|
88210
|
+
if (region.getLayoutStartPoint().y + region.getLayoutRect().height > maxY) {
|
|
88211
|
+
maxY = region.getLayoutStartPoint().y + region.getLayoutRect().height;
|
|
88212
|
+
}
|
|
88213
|
+
});
|
|
88214
|
+
return { minX, maxX, minY, maxY };
|
|
88215
|
+
}
|
|
87925
88216
|
initEvent() {
|
|
87926
88217
|
}
|
|
87927
88218
|
onRender(ctx) {
|
|
@@ -88005,7 +88296,7 @@
|
|
|
88005
88296
|
this.getContainer().add(this._markerComponent);
|
|
88006
88297
|
}
|
|
88007
88298
|
_markerLayout() {
|
|
88008
|
-
var _a, _b, _c, _d, _e;
|
|
88299
|
+
var _a, _b, _c, _d, _e, _f;
|
|
88009
88300
|
const spec = this._spec;
|
|
88010
88301
|
const data = this._markerData;
|
|
88011
88302
|
const startRelativeSeries = this._startRelativeSeries;
|
|
@@ -88016,6 +88307,7 @@
|
|
|
88016
88307
|
const isCoordinateLayout = isValid(spec.coordinates) && (!isValid(spec.process) || ('process' in spec && 'xy' in spec.process));
|
|
88017
88308
|
const isPositionLayout = isValid(spec.positions);
|
|
88018
88309
|
const autoRange = (_a = spec === null || spec === void 0 ? void 0 : spec.autoRange) !== null && _a !== void 0 ? _a : false;
|
|
88310
|
+
const isNeedClip = (_b = spec === null || spec === void 0 ? void 0 : spec.clip) !== null && _b !== void 0 ? _b : false;
|
|
88019
88311
|
let points = [];
|
|
88020
88312
|
if (isXLayout) {
|
|
88021
88313
|
points = xLayout(data, startRelativeSeries, endRelativeSeries, relativeSeries, autoRange)[0];
|
|
@@ -88030,11 +88322,26 @@
|
|
|
88030
88322
|
points = spec.positions;
|
|
88031
88323
|
}
|
|
88032
88324
|
const dataPoints = data.latestData[0].latestData ? data.latestData[0].latestData : data.latestData;
|
|
88033
|
-
|
|
88325
|
+
let clipRange;
|
|
88326
|
+
if (isNeedClip) {
|
|
88327
|
+
const { minX, maxX, minY, maxY } = this._computeClipRange([
|
|
88328
|
+
startRelativeSeries.getRegion(),
|
|
88329
|
+
endRelativeSeries.getRegion(),
|
|
88330
|
+
relativeSeries.getRegion()
|
|
88331
|
+
]);
|
|
88332
|
+
clipRange = {
|
|
88333
|
+
x: minX,
|
|
88334
|
+
y: minY,
|
|
88335
|
+
width: maxX - minX,
|
|
88336
|
+
height: maxY - minY
|
|
88337
|
+
};
|
|
88338
|
+
}
|
|
88339
|
+
(_c = this._markerComponent) === null || _c === void 0 ? void 0 : _c.setAttributes({
|
|
88034
88340
|
points: points,
|
|
88035
|
-
label: Object.assign(Object.assign({}, (
|
|
88341
|
+
label: Object.assign(Object.assign({}, (_d = this._markerComponent.attribute) === null || _d === void 0 ? void 0 : _d.label), { text: this._spec.label.formatMethod
|
|
88036
88342
|
? this._spec.label.formatMethod(dataPoints)
|
|
88037
|
-
: (
|
|
88343
|
+
: (_f = (_e = this._markerComponent.attribute) === null || _e === void 0 ? void 0 : _e.label) === null || _f === void 0 ? void 0 : _f.text }),
|
|
88344
|
+
clipRange
|
|
88038
88345
|
});
|
|
88039
88346
|
}
|
|
88040
88347
|
_initDataView() {
|
|
@@ -88156,7 +88463,7 @@
|
|
|
88156
88463
|
this.getContainer().add(this._markerComponent);
|
|
88157
88464
|
}
|
|
88158
88465
|
_markerLayout() {
|
|
88159
|
-
var _a, _b, _c, _d, _e;
|
|
88466
|
+
var _a, _b, _c, _d, _e, _f;
|
|
88160
88467
|
const spec = this._spec;
|
|
88161
88468
|
const data = this._markerData;
|
|
88162
88469
|
const startRelativeSeries = this._startRelativeSeries;
|
|
@@ -88167,6 +88474,7 @@
|
|
|
88167
88474
|
const isCoordinateLayout = isValid(spec.coordinates);
|
|
88168
88475
|
const isPositionLayout = isValid(spec.positions);
|
|
88169
88476
|
const autoRange = (_a = spec === null || spec === void 0 ? void 0 : spec.autoRange) !== null && _a !== void 0 ? _a : false;
|
|
88477
|
+
const isNeedClip = (_b = spec === null || spec === void 0 ? void 0 : spec.clip) !== null && _b !== void 0 ? _b : false;
|
|
88170
88478
|
let points = [];
|
|
88171
88479
|
let lines = [];
|
|
88172
88480
|
if (isXLayout) {
|
|
@@ -88184,11 +88492,26 @@
|
|
|
88184
88492
|
points = spec.positions;
|
|
88185
88493
|
}
|
|
88186
88494
|
const dataPoints = data.latestData[0].latestData ? data.latestData[0].latestData : data.latestData;
|
|
88187
|
-
|
|
88495
|
+
let clipRange;
|
|
88496
|
+
if (isNeedClip) {
|
|
88497
|
+
const { minX, maxX, minY, maxY } = this._computeClipRange([
|
|
88498
|
+
startRelativeSeries.getRegion(),
|
|
88499
|
+
endRelativeSeries.getRegion(),
|
|
88500
|
+
relativeSeries.getRegion()
|
|
88501
|
+
]);
|
|
88502
|
+
clipRange = {
|
|
88503
|
+
x: minX,
|
|
88504
|
+
y: minY,
|
|
88505
|
+
width: maxX - minX,
|
|
88506
|
+
height: maxY - minY
|
|
88507
|
+
};
|
|
88508
|
+
}
|
|
88509
|
+
(_c = this._markerComponent) === null || _c === void 0 ? void 0 : _c.setAttributes({
|
|
88188
88510
|
points: points,
|
|
88189
|
-
label: Object.assign(Object.assign({}, (
|
|
88511
|
+
label: Object.assign(Object.assign({}, (_d = this._markerComponent.attribute) === null || _d === void 0 ? void 0 : _d.label), { text: this._spec.label.formatMethod
|
|
88190
88512
|
? this._spec.label.formatMethod(dataPoints)
|
|
88191
|
-
: (
|
|
88513
|
+
: (_f = (_e = this._markerComponent.attribute) === null || _e === void 0 ? void 0 : _e.label) === null || _f === void 0 ? void 0 : _f.text }),
|
|
88514
|
+
clipRange
|
|
88192
88515
|
});
|
|
88193
88516
|
}
|
|
88194
88517
|
_initDataView() {
|
|
@@ -88267,13 +88590,14 @@
|
|
|
88267
88590
|
this.getContainer().add(this._markerComponent);
|
|
88268
88591
|
}
|
|
88269
88592
|
_markerLayout() {
|
|
88270
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
88593
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
88271
88594
|
const spec = this._spec;
|
|
88272
88595
|
const data = this._markerData;
|
|
88273
88596
|
const relativeSeries = this._relativeSeries;
|
|
88274
88597
|
const isCoordinateLayout = 'coordinate' in spec;
|
|
88275
88598
|
const isPositionLayout = 'position' in spec;
|
|
88276
88599
|
const autoRange = (_a = spec === null || spec === void 0 ? void 0 : spec.autoRange) !== null && _a !== void 0 ? _a : false;
|
|
88600
|
+
const isNeedClip = (_b = spec === null || spec === void 0 ? void 0 : spec.clip) !== null && _b !== void 0 ? _b : false;
|
|
88277
88601
|
let point;
|
|
88278
88602
|
if (isCoordinateLayout) {
|
|
88279
88603
|
point = coordinateLayout(data, relativeSeries, autoRange)[0];
|
|
@@ -88282,11 +88606,22 @@
|
|
|
88282
88606
|
point = spec.position;
|
|
88283
88607
|
}
|
|
88284
88608
|
const dataPoints = data.latestData[0].latestData ? data.latestData[0].latestData : data.latestData;
|
|
88285
|
-
|
|
88609
|
+
let clipRange;
|
|
88610
|
+
if (isNeedClip) {
|
|
88611
|
+
const { minX, maxX, minY, maxY } = this._computeClipRange([relativeSeries.getRegion()]);
|
|
88612
|
+
clipRange = {
|
|
88613
|
+
x: minX,
|
|
88614
|
+
y: minY,
|
|
88615
|
+
width: maxX - minX,
|
|
88616
|
+
height: maxY - minY
|
|
88617
|
+
};
|
|
88618
|
+
}
|
|
88619
|
+
(_c = this._markerComponent) === null || _c === void 0 ? void 0 : _c.setAttributes({
|
|
88286
88620
|
position: point,
|
|
88287
|
-
itemContent: Object.assign(Object.assign({}, (
|
|
88621
|
+
itemContent: Object.assign(Object.assign({}, (_d = this._markerComponent.attribute) === null || _d === void 0 ? void 0 : _d.itemContent), { textStyle: Object.assign(Object.assign({}, (_f = (_e = this._markerComponent.attribute) === null || _e === void 0 ? void 0 : _e.itemContent) === null || _f === void 0 ? void 0 : _f.textStyle), { text: ((_g = this._spec.itemContent.text) === null || _g === void 0 ? void 0 : _g.formatMethod)
|
|
88288
88622
|
? this._spec.itemContent.text.formatMethod(dataPoints)
|
|
88289
|
-
: (
|
|
88623
|
+
: (_k = (_j = (_h = this._markerComponent.attribute) === null || _h === void 0 ? void 0 : _h.itemContent) === null || _j === void 0 ? void 0 : _j.textStyle) === null || _k === void 0 ? void 0 : _k.text }) }),
|
|
88624
|
+
clipRange
|
|
88290
88625
|
});
|
|
88291
88626
|
}
|
|
88292
88627
|
_initDataView() {
|
|
@@ -88367,6 +88702,9 @@
|
|
|
88367
88702
|
}
|
|
88368
88703
|
}
|
|
88369
88704
|
const getScale = (element, boundingClientRect) => {
|
|
88705
|
+
if (!element) {
|
|
88706
|
+
return 1;
|
|
88707
|
+
}
|
|
88370
88708
|
if (!boundingClientRect) {
|
|
88371
88709
|
boundingClientRect = element.getBoundingClientRect();
|
|
88372
88710
|
}
|
|
@@ -88862,6 +89200,7 @@
|
|
|
88862
89200
|
return attribute;
|
|
88863
89201
|
};
|
|
88864
89202
|
const measureTooltipText = (text, style) => {
|
|
89203
|
+
var _a;
|
|
88865
89204
|
const measure = initTextMeasure(style);
|
|
88866
89205
|
if (!style.multiLine) {
|
|
88867
89206
|
const { width, height } = measure.fullMeasure(text);
|
|
@@ -88876,7 +89215,7 @@
|
|
|
88876
89215
|
const { width, height } = measure.fullMeasure(textLines);
|
|
88877
89216
|
if (style.maxWidth && style.maxWidth <= width) {
|
|
88878
89217
|
const bound = getRichTextBounds({
|
|
88879
|
-
wordBreak: style.wordBreak,
|
|
89218
|
+
wordBreak: (_a = style.wordBreak) !== null && _a !== void 0 ? _a : 'break-word',
|
|
88880
89219
|
maxWidth: style.maxWidth,
|
|
88881
89220
|
width: 0,
|
|
88882
89221
|
height: 0,
|
|
@@ -89010,7 +89349,7 @@
|
|
|
89010
89349
|
return actualTooltip;
|
|
89011
89350
|
};
|
|
89012
89351
|
this._getActualTooltipPosition = (actualTooltip, position, params, tooltipParentElement, changePositionOnly) => {
|
|
89013
|
-
var _a, _b, _c, _d, _e;
|
|
89352
|
+
var _a, _b, _c, _d, _e, _f;
|
|
89014
89353
|
const event = params.event;
|
|
89015
89354
|
const { width: tooltipBoxWidth = 0, height: tooltipBoxHeight = 0 } = (_a = this._getTooltipBoxSize(actualTooltip, changePositionOnly)) !== null && _a !== void 0 ? _a : {};
|
|
89016
89355
|
const { offsetX, offsetY } = this._option;
|
|
@@ -89082,9 +89421,12 @@
|
|
|
89082
89421
|
containerSize.width = window.innerWidth;
|
|
89083
89422
|
containerSize.height = window.innerHeight;
|
|
89084
89423
|
if (!isCanvas) {
|
|
89085
|
-
tooltipParentElementRect = tooltipParentElement.getBoundingClientRect()
|
|
89086
|
-
|
|
89087
|
-
|
|
89424
|
+
tooltipParentElementRect = (_e = tooltipParentElement === null || tooltipParentElement === void 0 ? void 0 : tooltipParentElement.getBoundingClientRect()) !== null && _e !== void 0 ? _e : {
|
|
89425
|
+
x: Infinity,
|
|
89426
|
+
y: Infinity
|
|
89427
|
+
};
|
|
89428
|
+
const chartElement = ((_f = this._compiler.getCanvas()) !== null && _f !== void 0 ? _f : this._chartContainer);
|
|
89429
|
+
const chartElementRect = chartElement === null || chartElement === void 0 ? void 0 : chartElement.getBoundingClientRect();
|
|
89088
89430
|
relativePosOffset = {
|
|
89089
89431
|
x: chartElementRect.x - tooltipParentElementRect.x,
|
|
89090
89432
|
y: chartElementRect.y - tooltipParentElementRect.y
|
|
@@ -90354,6 +90696,12 @@
|
|
|
90354
90696
|
}
|
|
90355
90697
|
};
|
|
90356
90698
|
this._handleMouseMove = (params) => {
|
|
90699
|
+
if (!this.tooltipHandler) {
|
|
90700
|
+
this._initHandler();
|
|
90701
|
+
}
|
|
90702
|
+
if (!this._processor) {
|
|
90703
|
+
this._initProcessor();
|
|
90704
|
+
}
|
|
90357
90705
|
if (this._alwaysShow) {
|
|
90358
90706
|
return;
|
|
90359
90707
|
}
|
|
@@ -90472,8 +90820,6 @@
|
|
|
90472
90820
|
created() {
|
|
90473
90821
|
super.created();
|
|
90474
90822
|
this._regions = this._option.getAllRegions();
|
|
90475
|
-
this._initHandler();
|
|
90476
|
-
this._initProcessor();
|
|
90477
90823
|
this._initEvent();
|
|
90478
90824
|
}
|
|
90479
90825
|
release() {
|
|
@@ -90531,9 +90877,13 @@
|
|
|
90531
90877
|
this._spec.style = merge$2({}, this._theme, this._originalSpec.style);
|
|
90532
90878
|
}
|
|
90533
90879
|
reInit(theme) {
|
|
90534
|
-
var _a, _b;
|
|
90535
90880
|
super.reInit(theme);
|
|
90536
|
-
|
|
90881
|
+
if (this.tooltipHandler) {
|
|
90882
|
+
this.tooltipHandler.reInit();
|
|
90883
|
+
}
|
|
90884
|
+
else {
|
|
90885
|
+
this._initHandler();
|
|
90886
|
+
}
|
|
90537
90887
|
}
|
|
90538
90888
|
setAttrFromSpec() {
|
|
90539
90889
|
var _a;
|
|
@@ -90573,6 +90923,12 @@
|
|
|
90573
90923
|
}
|
|
90574
90924
|
showTooltip(datum, options) {
|
|
90575
90925
|
var _a;
|
|
90926
|
+
if (!this.tooltipHandler) {
|
|
90927
|
+
this._initHandler();
|
|
90928
|
+
}
|
|
90929
|
+
if (!this._processor) {
|
|
90930
|
+
this._initProcessor();
|
|
90931
|
+
}
|
|
90576
90932
|
if (!((_a = this.tooltipHandler) === null || _a === void 0 ? void 0 : _a.showTooltip)) {
|
|
90577
90933
|
return false;
|
|
90578
90934
|
}
|
|
@@ -90752,14 +91108,29 @@
|
|
|
90752
91108
|
return strategy;
|
|
90753
91109
|
}
|
|
90754
91110
|
|
|
91111
|
+
function pieLabel(labelInfo) {
|
|
91112
|
+
var _a, _b;
|
|
91113
|
+
const { series, baseMark } = labelInfo;
|
|
91114
|
+
const labelSpec = (_a = baseMark.getLabelSpec()) !== null && _a !== void 0 ? _a : {};
|
|
91115
|
+
const labelPosition = (_b = labelSpec.position) !== null && _b !== void 0 ? _b : 'outside';
|
|
91116
|
+
const position = labelPosition;
|
|
91117
|
+
let smartInvert;
|
|
91118
|
+
if (labelSpec.smartInvert) {
|
|
91119
|
+
smartInvert = labelSpec.smartInvert;
|
|
91120
|
+
}
|
|
91121
|
+
else {
|
|
91122
|
+
smartInvert = isString(labelPosition) && labelPosition.includes('inside');
|
|
91123
|
+
}
|
|
91124
|
+
return { position, smartInvert };
|
|
91125
|
+
}
|
|
91126
|
+
|
|
90755
91127
|
const markLabelConfigFunc = {
|
|
90756
91128
|
rect: barLabel,
|
|
90757
|
-
symbol: symbolLabel
|
|
91129
|
+
symbol: symbolLabel,
|
|
91130
|
+
arc: pieLabel
|
|
90758
91131
|
};
|
|
90759
|
-
function textAttribute(labelInfo, datum) {
|
|
90760
|
-
|
|
90761
|
-
const { labelMark, series, baseMark } = labelInfo;
|
|
90762
|
-
const formatMethod = (_a = baseMark.getLabelSpec()) === null || _a === void 0 ? void 0 : _a.formatMethod;
|
|
91132
|
+
function textAttribute(labelInfo, datum, formatMethod) {
|
|
91133
|
+
const { labelMark, series } = labelInfo;
|
|
90763
91134
|
const field = series.getMeasureField()[0];
|
|
90764
91135
|
const textAttribute = { text: datum[field], data: datum };
|
|
90765
91136
|
const attributes = Object.keys(labelMark.stateStyle.normal);
|
|
@@ -90773,7 +91144,7 @@
|
|
|
90773
91144
|
return textAttribute;
|
|
90774
91145
|
}
|
|
90775
91146
|
|
|
90776
|
-
class
|
|
91147
|
+
class BaseLabelComponent extends BaseComponent {
|
|
90777
91148
|
constructor(spec, options) {
|
|
90778
91149
|
super(spec, options);
|
|
90779
91150
|
this.type = ComponentTypeEnum.label;
|
|
@@ -90782,6 +91153,52 @@
|
|
|
90782
91153
|
this.layoutZIndex = LayoutZIndex.Label;
|
|
90783
91154
|
this._regions = options.getRegionsInIndex([options.specIndex]);
|
|
90784
91155
|
this.layoutBindRegionID = this._regions.map(x => x.id);
|
|
91156
|
+
}
|
|
91157
|
+
_interactiveConfig(labelSpec) {
|
|
91158
|
+
const { interactive } = labelSpec;
|
|
91159
|
+
if (interactive !== true) {
|
|
91160
|
+
return { hover: false, select: false };
|
|
91161
|
+
}
|
|
91162
|
+
const result = { hover: false, select: false, state: labelSpec.state };
|
|
91163
|
+
const { hover, select } = this._option.getChart().getSpec();
|
|
91164
|
+
if (hover !== false || hover.enable !== false) {
|
|
91165
|
+
result.hover = true;
|
|
91166
|
+
}
|
|
91167
|
+
if (select !== false || select.enable !== false) {
|
|
91168
|
+
result.select = true;
|
|
91169
|
+
}
|
|
91170
|
+
return result;
|
|
91171
|
+
}
|
|
91172
|
+
setLayoutStartPosition() {
|
|
91173
|
+
}
|
|
91174
|
+
updateSpec(spec) {
|
|
91175
|
+
const result = super.updateSpec(spec);
|
|
91176
|
+
result.reRender = true;
|
|
91177
|
+
result.reMake = true;
|
|
91178
|
+
return result;
|
|
91179
|
+
}
|
|
91180
|
+
onRender(ctx) {
|
|
91181
|
+
}
|
|
91182
|
+
changeRegions(regions) {
|
|
91183
|
+
}
|
|
91184
|
+
clear() {
|
|
91185
|
+
super.clear();
|
|
91186
|
+
this._marks.forEach(mark => {
|
|
91187
|
+
if (mark.getProduct()) {
|
|
91188
|
+
mark.getProduct().release();
|
|
91189
|
+
}
|
|
91190
|
+
});
|
|
91191
|
+
}
|
|
91192
|
+
}
|
|
91193
|
+
BaseLabelComponent.type = ComponentTypeEnum.label;
|
|
91194
|
+
|
|
91195
|
+
class Label extends BaseLabelComponent {
|
|
91196
|
+
constructor(spec, options) {
|
|
91197
|
+
super(spec, options);
|
|
91198
|
+
this.type = ComponentTypeEnum.label;
|
|
91199
|
+
this.name = ComponentTypeEnum.label;
|
|
91200
|
+
this.layoutType = 'absolute';
|
|
91201
|
+
this.layoutZIndex = LayoutZIndex.Label;
|
|
90785
91202
|
this._layoutRule = spec.labelLayout || 'series';
|
|
90786
91203
|
}
|
|
90787
91204
|
static createComponent(spec, options) {
|
|
@@ -90794,7 +91211,7 @@
|
|
|
90794
91211
|
.flat();
|
|
90795
91212
|
const labelVisible = marks.some(mark => { var _a; return ((_a = mark.getLabelSpec()) === null || _a === void 0 ? void 0 : _a.visible) === true; });
|
|
90796
91213
|
if (labelVisible) {
|
|
90797
|
-
labelComponents.push(new Label(spec, Object.assign(Object.assign({}, options), { specIndex: i })));
|
|
91214
|
+
labelComponents.push(new Label(spec, Object.assign(Object.assign({}, options), { specIndex: i, specKey: 'label' })));
|
|
90798
91215
|
continue;
|
|
90799
91216
|
}
|
|
90800
91217
|
}
|
|
@@ -90825,6 +91242,22 @@
|
|
|
90825
91242
|
});
|
|
90826
91243
|
this.event.off(HOOK_EVENT.AFTER_MARK_RENDER_END, enableAnimation);
|
|
90827
91244
|
};
|
|
91245
|
+
this.event.on('afterElementEncode', eventParams => {
|
|
91246
|
+
var _a;
|
|
91247
|
+
const mark = eventParams.item;
|
|
91248
|
+
if (this._option.getChart().getLayoutTag() === false && ((_a = mark.context) === null || _a === void 0 ? void 0 : _a.model) === this) {
|
|
91249
|
+
this._delegateLabelEvent(mark.getGroupGraphicItem());
|
|
91250
|
+
}
|
|
91251
|
+
});
|
|
91252
|
+
}
|
|
91253
|
+
_delegateLabelEvent(component) {
|
|
91254
|
+
const textNodes = component === null || component === void 0 ? void 0 : component.findAll(node => node.type === 'text', true).filter(text => !text.__vchart_event);
|
|
91255
|
+
if (textNodes && textNodes.length > 0) {
|
|
91256
|
+
textNodes.forEach(text => {
|
|
91257
|
+
text.__vchart_event = true;
|
|
91258
|
+
text.addEventListener('*', ((event, type) => this._delegateEvent(component, event, type, text, text.attribute.data)));
|
|
91259
|
+
});
|
|
91260
|
+
}
|
|
90828
91261
|
}
|
|
90829
91262
|
_initTextMark() {
|
|
90830
91263
|
if (!this._labelInfo) {
|
|
@@ -90879,33 +91312,18 @@
|
|
|
90879
91312
|
}
|
|
90880
91313
|
});
|
|
90881
91314
|
}
|
|
90882
|
-
_interactiveConfig(labelSpec) {
|
|
90883
|
-
const { interactive } = labelSpec;
|
|
90884
|
-
if (interactive !== true) {
|
|
90885
|
-
return { hover: false, select: false };
|
|
90886
|
-
}
|
|
90887
|
-
const result = { hover: false, select: false, state: labelSpec.state };
|
|
90888
|
-
const { hover, select } = this._option.getChart().getSpec();
|
|
90889
|
-
if (hover !== false || hover.enable !== false) {
|
|
90890
|
-
result.hover = true;
|
|
90891
|
-
}
|
|
90892
|
-
if (select !== false || select.enable !== false) {
|
|
90893
|
-
result.select = true;
|
|
90894
|
-
}
|
|
90895
|
-
return result;
|
|
90896
|
-
}
|
|
90897
|
-
setLayoutStartPosition() {
|
|
90898
|
-
}
|
|
90899
91315
|
updateLayoutAttribute() {
|
|
90900
91316
|
super.updateLayoutAttribute();
|
|
90901
91317
|
this._labelComponentMap.forEach(({ region, labelInfo }, labelComponent) => {
|
|
90902
91318
|
const baseMarks = labelInfo.map(info => info.baseMark);
|
|
90903
91319
|
const component = labelComponent.getProduct();
|
|
91320
|
+
const dependCmp = this._option.getAllComponents().filter(cmp => cmp.type === 'totalLabel');
|
|
90904
91321
|
component
|
|
90905
91322
|
.target(baseMarks.map(mark => mark.getProduct()))
|
|
90906
91323
|
.configure({ interactive: false })
|
|
91324
|
+
.depend(dependCmp.map(cmp => cmp.getMarks()[0].getProduct()))
|
|
90907
91325
|
.labelStyle(mark => {
|
|
90908
|
-
var _a, _b;
|
|
91326
|
+
var _a, _b, _c, _d;
|
|
90909
91327
|
const markId = mark.context.markId;
|
|
90910
91328
|
const baseMark = this._option.getChart().getMarkById(markId);
|
|
90911
91329
|
if (baseMark) {
|
|
@@ -90913,15 +91331,23 @@
|
|
|
90913
91331
|
const labelSpec = (_b = baseMark.getLabelSpec()) !== null && _b !== void 0 ? _b : {};
|
|
90914
91332
|
const interactive = this._interactiveConfig(labelSpec);
|
|
90915
91333
|
const passiveLabelSpec = pickWithout(labelSpec, ['position', 'style', 'state']);
|
|
91334
|
+
const centerOffset = (_d = (_c = this._spec) === null || _c === void 0 ? void 0 : _c.centerOffset) !== null && _d !== void 0 ? _d : 0;
|
|
90916
91335
|
return merge$2({
|
|
90917
|
-
textStyle: { pickable: labelSpec.interactive === true }
|
|
90918
|
-
|
|
91336
|
+
textStyle: Object.assign({ pickable: labelSpec.interactive === true }, labelSpec.style),
|
|
91337
|
+
overlap: {
|
|
91338
|
+
avoidMarks: this._option
|
|
91339
|
+
.getAllComponents()
|
|
91340
|
+
.filter(cmp => cmp.type === 'totalLabel')
|
|
91341
|
+
.map(cmp => cmp.getMarks()[0].getProductId())
|
|
91342
|
+
}
|
|
91343
|
+
}, configFunc(labelInfo[baseMarks.findIndex(mark => mark === baseMark)]), Object.assign(Object.assign(Object.assign({}, passiveLabelSpec), interactive), { centerOffset, pickable: false }));
|
|
90919
91344
|
}
|
|
90920
91345
|
})
|
|
90921
91346
|
.encode((datum, element) => {
|
|
91347
|
+
var _a;
|
|
90922
91348
|
const markId = element.mark.context.markId;
|
|
90923
91349
|
const baseMark = this._option.getChart().getMarkById(markId);
|
|
90924
|
-
return textAttribute(labelInfo[baseMarks.findIndex(mark => mark === baseMark)], datum);
|
|
91350
|
+
return textAttribute(labelInfo[baseMarks.findIndex(mark => mark === baseMark)], datum, (_a = baseMark.getLabelSpec()) === null || _a === void 0 ? void 0 : _a.formatMethod);
|
|
90925
91351
|
})
|
|
90926
91352
|
.size(() => region.getLayoutRect());
|
|
90927
91353
|
});
|
|
@@ -90938,16 +91364,6 @@
|
|
|
90938
91364
|
});
|
|
90939
91365
|
});
|
|
90940
91366
|
}
|
|
90941
|
-
updateSpec(spec) {
|
|
90942
|
-
const result = super.updateSpec(spec);
|
|
90943
|
-
result.reRender = true;
|
|
90944
|
-
result.reMake = true;
|
|
90945
|
-
return result;
|
|
90946
|
-
}
|
|
90947
|
-
onRender(ctx) {
|
|
90948
|
-
}
|
|
90949
|
-
changeRegions(regions) {
|
|
90950
|
-
}
|
|
90951
91367
|
clear() {
|
|
90952
91368
|
super.clear();
|
|
90953
91369
|
this._labelComponentMap.forEach((context, mark) => {
|
|
@@ -90959,6 +91375,116 @@
|
|
|
90959
91375
|
}
|
|
90960
91376
|
Label.type = ComponentTypeEnum.label;
|
|
90961
91377
|
|
|
91378
|
+
class TotalLabel extends BaseLabelComponent {
|
|
91379
|
+
constructor() {
|
|
91380
|
+
super(...arguments);
|
|
91381
|
+
this.type = ComponentTypeEnum.totalLabel;
|
|
91382
|
+
this.name = ComponentTypeEnum.totalLabel;
|
|
91383
|
+
this.layoutType = 'absolute';
|
|
91384
|
+
this.layoutZIndex = LayoutZIndex.Label;
|
|
91385
|
+
}
|
|
91386
|
+
static createComponent(spec, options) {
|
|
91387
|
+
const regions = options.getAllRegions();
|
|
91388
|
+
const labelComponents = [];
|
|
91389
|
+
for (let i = 0; i < regions.length; i++) {
|
|
91390
|
+
const series = getSeries(regions);
|
|
91391
|
+
series.forEach(s => {
|
|
91392
|
+
var _a, _b;
|
|
91393
|
+
if ((_b = (_a = s.getSpec()) === null || _a === void 0 ? void 0 : _a.totalLabel) === null || _b === void 0 ? void 0 : _b.visible) {
|
|
91394
|
+
const cmp = new TotalLabel(s.getSpec().totalLabel, Object.assign(Object.assign({}, options), { specIndex: i, specKey: 'totalLabel' }));
|
|
91395
|
+
cmp.series = s;
|
|
91396
|
+
labelComponents.push(cmp);
|
|
91397
|
+
}
|
|
91398
|
+
});
|
|
91399
|
+
}
|
|
91400
|
+
return labelComponents;
|
|
91401
|
+
}
|
|
91402
|
+
init(option) {
|
|
91403
|
+
super.init(option);
|
|
91404
|
+
this._initTextMark();
|
|
91405
|
+
this._initLabelComponent();
|
|
91406
|
+
}
|
|
91407
|
+
_initTextMark() {
|
|
91408
|
+
var _a;
|
|
91409
|
+
if ((_a = this.series.getSpec().totalLabel) === null || _a === void 0 ? void 0 : _a.visible) {
|
|
91410
|
+
const mark = this.series.getMarksInType([MarkTypeEnum.rect, MarkTypeEnum.symbol])[0];
|
|
91411
|
+
const textMark = this._createMark({ type: MarkTypeEnum.text, name: `${mark.name}-total-label` });
|
|
91412
|
+
this._baseMark = mark;
|
|
91413
|
+
this._textMark = textMark;
|
|
91414
|
+
this._initTextMarkStyle();
|
|
91415
|
+
}
|
|
91416
|
+
}
|
|
91417
|
+
_initTextMarkStyle() {
|
|
91418
|
+
super.initMarkStyleWithSpec(this._textMark, this._spec);
|
|
91419
|
+
this.setMarkStyle(this._textMark, {
|
|
91420
|
+
text: datum => {
|
|
91421
|
+
return datum[STACK_FIELD_TOTAL];
|
|
91422
|
+
}
|
|
91423
|
+
}, 'normal', AttributeLevel.Default);
|
|
91424
|
+
}
|
|
91425
|
+
_initLabelComponent() {
|
|
91426
|
+
const component = this._createMark({ type: MarkTypeEnum.component, name: `${this.series.name}-total-label-component` }, {
|
|
91427
|
+
componentType: 'label',
|
|
91428
|
+
support3d: this._spec.support3d
|
|
91429
|
+
});
|
|
91430
|
+
if (component) {
|
|
91431
|
+
this._marks.addMark(component);
|
|
91432
|
+
}
|
|
91433
|
+
}
|
|
91434
|
+
updateLayoutAttribute() {
|
|
91435
|
+
super.updateLayoutAttribute();
|
|
91436
|
+
this._marks.forEach((componentMark, index) => {
|
|
91437
|
+
const component = componentMark.getProduct();
|
|
91438
|
+
component
|
|
91439
|
+
.target(this._baseMark.getProduct())
|
|
91440
|
+
.configure({ interactive: false })
|
|
91441
|
+
.labelStyle(() => {
|
|
91442
|
+
if (this._baseMark) {
|
|
91443
|
+
const { offset, animation, overlap } = this._spec;
|
|
91444
|
+
const interactive = this._interactiveConfig(this._spec);
|
|
91445
|
+
return merge$2({
|
|
91446
|
+
textStyle: { pickable: this._spec.interactive === true },
|
|
91447
|
+
position: totalLabelPosition(this.series, this._baseMark.type)
|
|
91448
|
+
}, Object.assign({ offset,
|
|
91449
|
+
animation,
|
|
91450
|
+
overlap, dataFilter: (data) => {
|
|
91451
|
+
return data.filter((d) => d.data[STACK_FIELD_TOTAL_TOP]);
|
|
91452
|
+
} }, interactive));
|
|
91453
|
+
}
|
|
91454
|
+
})
|
|
91455
|
+
.encode((datum, element) => {
|
|
91456
|
+
return textAttribute({ baseMark: this._baseMark, labelMark: this._textMark, series: this.series }, datum, this._spec.formatMethod);
|
|
91457
|
+
})
|
|
91458
|
+
.size(() => this._regions[0].getLayoutRect());
|
|
91459
|
+
});
|
|
91460
|
+
}
|
|
91461
|
+
compileMarks() {
|
|
91462
|
+
this.getMarks().forEach(m => {
|
|
91463
|
+
var _a;
|
|
91464
|
+
const group = this._regions[0].getGroupMark().getProduct();
|
|
91465
|
+
m.compile({ group });
|
|
91466
|
+
(_a = m.getProduct()) === null || _a === void 0 ? void 0 : _a.configure({
|
|
91467
|
+
context: {
|
|
91468
|
+
model: this
|
|
91469
|
+
}
|
|
91470
|
+
});
|
|
91471
|
+
});
|
|
91472
|
+
}
|
|
91473
|
+
}
|
|
91474
|
+
TotalLabel.type = ComponentTypeEnum.totalLabel;
|
|
91475
|
+
function totalLabelPosition(series, type) {
|
|
91476
|
+
let position;
|
|
91477
|
+
switch (type) {
|
|
91478
|
+
case 'rect':
|
|
91479
|
+
position = series.direction === 'horizontal' ? 'right' : 'top';
|
|
91480
|
+
break;
|
|
91481
|
+
case 'symbol':
|
|
91482
|
+
default:
|
|
91483
|
+
position = 'top';
|
|
91484
|
+
}
|
|
91485
|
+
return position;
|
|
91486
|
+
}
|
|
91487
|
+
|
|
90962
91488
|
class GridLayout {
|
|
90963
91489
|
constructor(gridInfo, ctx) {
|
|
90964
91490
|
this._chartLayoutRect = { x: 0, y: 0, width: 1, height: 1 };
|
|
@@ -91468,6 +91994,7 @@
|
|
|
91468
91994
|
Title,
|
|
91469
91995
|
MarkArea,
|
|
91470
91996
|
Player,
|
|
91997
|
+
TotalLabel,
|
|
91471
91998
|
Label,
|
|
91472
91999
|
MarkPoint,
|
|
91473
92000
|
Brush,
|
|
@@ -91590,6 +92117,7 @@
|
|
|
91590
92117
|
exports.ThemeManager = ThemeManager;
|
|
91591
92118
|
exports.Title = Title;
|
|
91592
92119
|
exports.Tooltip = Tooltip;
|
|
92120
|
+
exports.TotalLabel = TotalLabel;
|
|
91593
92121
|
exports.TreeMapChart = TreeMapChart;
|
|
91594
92122
|
exports.TreeMapSeries = TreeMapSeries;
|
|
91595
92123
|
exports.VChart = VChart;
|