@visactor/vchart 1.13.9-alpha.5 → 1.13.9
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 +1 -1
- package/build/index.es.js +1063 -804
- package/build/index.js +1063 -803
- package/build/index.min.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/chart/base/base-chart.d.ts +8 -1
- package/cjs/chart/base/base-chart.js +33 -20
- package/cjs/chart/base/base-chart.js.map +1 -1
- package/cjs/chart/index.d.ts +1 -1
- package/cjs/chart/index.js.map +1 -1
- package/cjs/chart/interface/chart.d.ts +8 -1
- package/cjs/chart/interface/chart.js.map +1 -1
- package/cjs/chart/pictogram/interface.d.ts +1 -1
- package/cjs/chart/pictogram/interface.js.map +1 -1
- package/cjs/chart/progress/linear/linear-progress-transformer.js +1 -1
- package/cjs/chart/progress/linear/linear-progress-transformer.js.map +1 -1
- package/cjs/chart/sankey/sankey.js +21 -21
- package/cjs/chart/sankey/sankey.js.map +1 -1
- package/cjs/compile/mark/compilable-mark.d.ts +1 -0
- package/cjs/compile/mark/compilable-mark.js +3 -0
- package/cjs/compile/mark/compilable-mark.js.map +1 -1
- package/cjs/component/axis/base-axis.js +7 -2
- package/cjs/component/axis/base-axis.js.map +1 -1
- package/cjs/component/axis/interface/spec.d.ts +7 -2
- package/cjs/component/axis/interface/spec.js.map +1 -1
- package/cjs/component/brush/brush.d.ts +23 -24
- package/cjs/component/brush/brush.js +183 -182
- package/cjs/component/brush/brush.js.map +1 -1
- package/cjs/component/brush/interface.d.ts +2 -0
- package/cjs/component/brush/interface.js.map +1 -1
- package/cjs/component/crosshair/base.js +1 -1
- package/cjs/component/crosshair/base.js.map +1 -1
- package/cjs/component/crosshair/utils/cartesian.js +9 -8
- package/cjs/component/crosshair/utils/cartesian.js.map +1 -1
- package/cjs/component/data-zoom/data-zoom/interface.d.ts +2 -3
- package/cjs/component/data-zoom/data-zoom/interface.js.map +1 -1
- package/cjs/component/marker/mark-area/base-mark-area.js +27 -17
- package/cjs/component/marker/mark-area/base-mark-area.js.map +1 -1
- package/cjs/component/marker/mark-area/interface/theme.d.ts +4 -3
- package/cjs/component/marker/mark-area/interface/theme.js.map +1 -1
- package/cjs/component/marker/mark-line/base-mark-line.js +31 -20
- package/cjs/component/marker/mark-line/base-mark-line.js.map +1 -1
- package/cjs/component/marker/mark-line/cartesian-mark-line.js +32 -26
- package/cjs/component/marker/mark-line/cartesian-mark-line.js.map +1 -1
- package/cjs/component/marker/mark-line/interface/theme.d.ts +4 -3
- package/cjs/component/marker/mark-line/interface/theme.js.map +1 -1
- package/cjs/component/marker/mark-point/cartesian-mark-point.js +3 -1
- package/cjs/component/marker/mark-point/cartesian-mark-point.js.map +1 -1
- package/cjs/component/marker/utils.d.ts +12 -0
- package/cjs/component/marker/utils.js +22 -7
- package/cjs/component/marker/utils.js.map +1 -1
- package/cjs/constant/event.d.ts +1 -0
- package/cjs/constant/event.js +6 -6
- package/cjs/constant/event.js.map +1 -1
- package/cjs/constant/funnel.js +2 -1
- package/cjs/constant/sunburst.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/interface.js +2 -1
- package/cjs/core/vchart.js +1 -2
- package/cjs/data/transforms/pictogram.d.ts +1 -9
- package/cjs/data/transforms/pictogram.js +3 -3
- package/cjs/data/transforms/pictogram.js.map +1 -1
- package/cjs/data/transforms/pie.js +1 -1
- package/cjs/data/transforms/pie.js.map +1 -1
- package/cjs/index-harmony-simple.js.map +1 -1
- package/cjs/index.d.ts +1 -0
- package/cjs/index.js +8 -7
- package/cjs/index.js.map +1 -1
- package/cjs/model/base-model.d.ts +1 -0
- package/cjs/model/base-model.js +6 -0
- package/cjs/model/base-model.js.map +1 -1
- package/cjs/plugin/components/tooltip-handler/dom-tooltip-handler.js +11 -7
- package/cjs/plugin/components/tooltip-handler/dom-tooltip-handler.js.map +1 -1
- package/cjs/series/bar/bar.js.map +1 -1
- package/cjs/series/gauge/gauge.js +7 -5
- package/cjs/series/gauge/gauge.js.map +1 -1
- package/cjs/series/pictogram/tooltip-helper.d.ts +2 -2
- package/cjs/series/pictogram/tooltip-helper.js.map +1 -1
- package/cjs/series/pie/pie.js +3 -3
- package/cjs/series/pie/pie.js.map +1 -1
- package/cjs/series/polar/progress-like/interface.d.ts +1 -0
- package/cjs/series/polar/progress-like/interface.js.map +1 -1
- package/cjs/series/polar/progress-like/progress-like.js +4 -3
- package/cjs/series/polar/progress-like/progress-like.js.map +1 -1
- package/cjs/series/progress/linear/interface.d.ts +1 -0
- package/cjs/series/progress/linear/interface.js.map +1 -1
- package/cjs/series/progress/linear/linear.js +6 -4
- package/cjs/series/progress/linear/linear.js.map +1 -1
- package/cjs/typings/visual.d.ts +1 -1
- package/cjs/typings/visual.js.map +1 -1
- package/esm/chart/base/base-chart.d.ts +8 -1
- package/esm/chart/base/base-chart.js +33 -20
- package/esm/chart/base/base-chart.js.map +1 -1
- package/esm/chart/index.d.ts +1 -1
- package/esm/chart/index.js.map +1 -1
- package/esm/chart/interface/chart.d.ts +8 -1
- package/esm/chart/interface/chart.js.map +1 -1
- package/esm/chart/pictogram/interface.d.ts +1 -1
- package/esm/chart/pictogram/interface.js.map +1 -1
- package/esm/chart/progress/linear/linear-progress-transformer.js +1 -1
- package/esm/chart/progress/linear/linear-progress-transformer.js.map +1 -1
- package/esm/chart/sankey/sankey.js +22 -22
- package/esm/chart/sankey/sankey.js.map +1 -1
- package/esm/compile/mark/compilable-mark.d.ts +1 -0
- package/esm/compile/mark/compilable-mark.js +3 -0
- package/esm/compile/mark/compilable-mark.js.map +1 -1
- package/esm/component/axis/base-axis.js +7 -2
- package/esm/component/axis/base-axis.js.map +1 -1
- package/esm/component/axis/interface/spec.d.ts +7 -2
- package/esm/component/axis/interface/spec.js.map +1 -1
- package/esm/component/brush/brush.d.ts +23 -24
- package/esm/component/brush/brush.js +179 -177
- package/esm/component/brush/brush.js.map +1 -1
- package/esm/component/brush/interface.d.ts +2 -0
- package/esm/component/brush/interface.js.map +1 -1
- package/esm/component/crosshair/base.js +1 -1
- package/esm/component/crosshair/base.js.map +1 -1
- package/esm/component/crosshair/utils/cartesian.js +9 -8
- package/esm/component/crosshair/utils/cartesian.js.map +1 -1
- package/esm/component/data-zoom/data-zoom/interface.d.ts +2 -3
- package/esm/component/data-zoom/data-zoom/interface.js.map +1 -1
- package/esm/component/marker/mark-area/base-mark-area.js +27 -16
- package/esm/component/marker/mark-area/base-mark-area.js.map +1 -1
- package/esm/component/marker/mark-area/interface/theme.d.ts +4 -3
- package/esm/component/marker/mark-area/interface/theme.js.map +1 -1
- package/esm/component/marker/mark-line/base-mark-line.js +30 -19
- package/esm/component/marker/mark-line/base-mark-line.js.map +1 -1
- package/esm/component/marker/mark-line/cartesian-mark-line.js +31 -26
- package/esm/component/marker/mark-line/cartesian-mark-line.js.map +1 -1
- package/esm/component/marker/mark-line/interface/theme.d.ts +4 -3
- package/esm/component/marker/mark-line/interface/theme.js.map +1 -1
- package/esm/component/marker/mark-point/cartesian-mark-point.js +1 -1
- package/esm/component/marker/mark-point/cartesian-mark-point.js.map +1 -1
- package/esm/component/marker/utils.d.ts +12 -0
- package/esm/component/marker/utils.js +19 -4
- package/esm/component/marker/utils.js.map +1 -1
- package/esm/constant/event.d.ts +1 -0
- package/esm/constant/event.js +6 -6
- package/esm/constant/event.js.map +1 -1
- package/esm/constant/funnel.js +2 -1
- package/esm/constant/sunburst.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/interface.js +2 -1
- package/esm/core/vchart.js +1 -2
- package/esm/data/transforms/pictogram.d.ts +1 -9
- package/esm/data/transforms/pictogram.js +3 -3
- package/esm/data/transforms/pictogram.js.map +1 -1
- package/esm/data/transforms/pie.js +1 -1
- package/esm/data/transforms/pie.js.map +1 -1
- package/esm/index-harmony-simple.js.map +1 -1
- package/esm/index.d.ts +1 -0
- package/esm/index.js +2 -0
- package/esm/index.js.map +1 -1
- package/esm/model/base-model.d.ts +1 -0
- package/esm/model/base-model.js +6 -0
- package/esm/model/base-model.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/dom-tooltip-handler.js +11 -7
- package/esm/plugin/components/tooltip-handler/dom-tooltip-handler.js.map +1 -1
- package/esm/series/bar/bar.js.map +1 -1
- package/esm/series/gauge/gauge.js +6 -4
- package/esm/series/gauge/gauge.js.map +1 -1
- package/esm/series/pictogram/tooltip-helper.d.ts +2 -2
- package/esm/series/pictogram/tooltip-helper.js.map +1 -1
- package/esm/series/pie/pie.js +4 -4
- package/esm/series/pie/pie.js.map +1 -1
- package/esm/series/polar/progress-like/interface.d.ts +1 -0
- package/esm/series/polar/progress-like/interface.js.map +1 -1
- package/esm/series/polar/progress-like/progress-like.js +4 -3
- package/esm/series/polar/progress-like/progress-like.js.map +1 -1
- package/esm/series/progress/linear/interface.d.ts +1 -0
- package/esm/series/progress/linear/interface.js.map +1 -1
- package/esm/series/progress/linear/linear.js +6 -4
- package/esm/series/progress/linear/linear.js.map +1 -1
- package/esm/typings/visual.d.ts +1 -1
- package/esm/typings/visual.js.map +1 -1
- package/package.json +18 -18
|
@@ -12,8 +12,11 @@ class Brush extends base_component_1.BaseComponent {
|
|
|
12
12
|
this.name = type_1.ComponentTypeEnum.brush, this.specKey = "brush", this.layoutZIndex = layout_1.LayoutZIndex.Brush,
|
|
13
13
|
this._linkedSeries = [], this._itemMap = {}, this._linkedItemMap = {}, this._inBrushElementsMap = {},
|
|
14
14
|
this._outOfBrushElementsMap = {}, this._linkedInBrushElementsMap = {}, this._linkedOutOfBrushElementsMap = {},
|
|
15
|
-
this.
|
|
16
|
-
this.
|
|
15
|
+
this._cacheInteractiveRangeAttrs = [], this._needDisablePickable = !1, this._releatedAxes = [],
|
|
16
|
+
this._regionAxisMap = {}, this._axisDataZoomMap = {}, this._zoomRecord = [];
|
|
17
|
+
}
|
|
18
|
+
static getSpecInfo(chartSpec) {
|
|
19
|
+
return (0, util_1.getSpecInfo)(chartSpec, this.specKey, this.type, (s => !1 !== s.visible));
|
|
17
20
|
}
|
|
18
21
|
init() {
|
|
19
22
|
const inBrushMarkAttr = this._transformBrushedMarkAttr(this._spec.inBrush), outOfBrushMarkAttr = this._transformBrushedMarkAttr(this._spec.outOfBrush);
|
|
@@ -24,42 +27,71 @@ class Brush extends base_component_1.BaseComponent {
|
|
|
24
27
|
}));
|
|
25
28
|
}));
|
|
26
29
|
}
|
|
27
|
-
|
|
28
|
-
|
|
30
|
+
_initNeedOperatedItem() {
|
|
31
|
+
const seriesUserId = this._spec.seriesId, seriesIndex = this._spec.seriesIndex;
|
|
32
|
+
this._relativeRegions.forEach((r => {
|
|
33
|
+
const allMarks = [];
|
|
34
|
+
r.getSeries().forEach((s => {
|
|
35
|
+
(seriesUserId && (0, vutils_1.array)(seriesUserId).includes(s.userId.toString()) || seriesIndex && (0,
|
|
36
|
+
vutils_1.array)(seriesIndex).includes(s.getSpecIndex()) || !seriesIndex && !seriesUserId) && allMarks.push(...s.getMarksWithoutRoot()),
|
|
37
|
+
this._itemMap[r.id] = allMarks;
|
|
38
|
+
}));
|
|
39
|
+
})), this._linkedSeries.forEach((s => {
|
|
40
|
+
this._linkedItemMap[s.id] = s.getMarksWithoutRoot();
|
|
41
|
+
}));
|
|
29
42
|
}
|
|
30
43
|
created() {
|
|
31
44
|
super.created(), this.initEvent(), this._bindRegions(), this._bindLinkedSeries(),
|
|
32
45
|
this._initRegionAxisMap(), this._initAxisDataZoomMap(), this._initNeedOperatedItem();
|
|
33
46
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
for (const brushName in elementsMap) for (const elementKey in elementsMap[brushName]) data.push(Object.assign({}, null === (_b = null === (_a = elementsMap[brushName][elementKey]) || void 0 === _a ? void 0 : _a.data) || void 0 === _b ? void 0 : _b[0]));
|
|
38
|
-
return data;
|
|
47
|
+
_bindRegions() {
|
|
48
|
+
(0, vutils_1.isValid)(this._spec.regionId) || (0, vutils_1.isValid)(this._spec.regionIndex) ? this._relativeRegions = this._option.getRegionsInUserIdOrIndex((0,
|
|
49
|
+
vutils_1.array)(this._spec.regionId), (0, vutils_1.array)(this._spec.regionIndex)) : this._relativeRegions = this._option.getAllRegions();
|
|
39
50
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
for (const elementKey in elementsMap) data.push(null === (_a = elementsMap[elementKey].data) || void 0 === _a ? void 0 : _a[0]);
|
|
44
|
-
return data;
|
|
51
|
+
_bindLinkedSeries() {
|
|
52
|
+
((0, vutils_1.isValid)(this._spec.brushLinkSeriesId) || (0, vutils_1.isValid)(this._spec.brushLinkSeriesIndex)) && (this._linkedSeries = this._option.getSeriesInUserIdOrIndex((0,
|
|
53
|
+
vutils_1.array)(this._spec.brushLinkSeriesId), (0, vutils_1.array)(this._spec.brushLinkSeriesIndex)));
|
|
45
54
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
_initRegionAxisMap() {
|
|
56
|
+
(0, vutils_1.isValid)(this._spec.axisId) ? (0, vutils_1.array)(this._spec.axisId).forEach((axisId => {
|
|
57
|
+
this._releatedAxes.push(this._option.getComponentByUserId(axisId));
|
|
58
|
+
})) : (0, vutils_1.isValid)(this._spec.axisIndex) ? (0, vutils_1.array)(this._spec.axisIndex).forEach((axisIndex => {
|
|
59
|
+
this._releatedAxes.push(this._option.getComponentByIndex("axes", axisIndex));
|
|
60
|
+
})) : this._releatedAxes = this._option.getComponentsByKey("axes"), this._releatedAxes.forEach((axis => {
|
|
61
|
+
null == axis || axis.getRegions().forEach((region => {
|
|
62
|
+
this._regionAxisMap["region_" + region.id] ? this._regionAxisMap["region_" + region.id].push(axis) : this._regionAxisMap["region_" + region.id] = [ axis ];
|
|
63
|
+
}));
|
|
64
|
+
}));
|
|
65
|
+
}
|
|
66
|
+
_initAxisDataZoomMap() {
|
|
67
|
+
this._option.getComponentsByKey("dataZoom").forEach((dz => {
|
|
68
|
+
dz.relatedAxisComponent && (this._axisDataZoomMap[dz.relatedAxisComponent.id] = dz);
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
initEvent() {}
|
|
72
|
+
onRender(ctx) {}
|
|
73
|
+
changeRegions(regions) {}
|
|
74
|
+
_compareSpec(spec, prevSpec) {
|
|
75
|
+
this._brushComponents && this._relativeRegions.forEach(((region, index) => {
|
|
76
|
+
this._updateBrushComponent(region, index);
|
|
77
|
+
}));
|
|
78
|
+
const result = super._compareSpec(spec, prevSpec);
|
|
79
|
+
return (0, vutils_2.isEqual)(prevSpec, spec) || (result.reRender = !0, result.reMake = !0),
|
|
80
|
+
result;
|
|
81
|
+
}
|
|
82
|
+
onLayoutEnd(ctx) {
|
|
83
|
+
var _a;
|
|
84
|
+
if (super.onLayoutEnd(ctx), this._option.disableTriggerEvent) return;
|
|
85
|
+
(null === (_a = this._spec.visible) || void 0 === _a || _a) && (this._brushComponents ? this._relativeRegions.forEach(((region, index) => {
|
|
86
|
+
this._updateBrushComponent(region, index);
|
|
87
|
+
})) : (this._brushComponents = [], this._relativeRegions.forEach(((region, index) => {
|
|
88
|
+
this._createBrushComponent(region, index);
|
|
89
|
+
}))));
|
|
58
90
|
}
|
|
59
91
|
_updateBrushComponent(region, componentIndex) {
|
|
60
92
|
const interactiveAttr = this._getBrushInteractiveAttr(region), brushComponent = this._brushComponents[componentIndex];
|
|
61
93
|
brushComponent.setAttributes(interactiveAttr), this._initMarkBrushState(componentIndex, ""),
|
|
62
|
-
brushComponent.children[0].removeAllChild()
|
|
94
|
+
brushComponent.children[0].removeAllChild();
|
|
63
95
|
}
|
|
64
96
|
_createBrushComponent(region, componentIndex) {
|
|
65
97
|
var _a, _b;
|
|
@@ -70,43 +102,75 @@ class Brush extends base_component_1.BaseComponent {
|
|
|
70
102
|
disableTriggerEvent: this._option.disableTriggerEvent
|
|
71
103
|
}));
|
|
72
104
|
brush.id = null !== (_b = this._spec.id) && void 0 !== _b ? _b : `brush-${this.id}`,
|
|
73
|
-
this.getContainer().add(brush)
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
brush.addEventListener(vrender_components_1.IOperateType.drawStart, (e => {
|
|
105
|
+
this.getContainer().add(brush), this._brushComponents.push(brush), this._cacheInteractiveRangeAttrs.push(interactiveAttr),
|
|
106
|
+
brush.addEventListener(vrender_components_1.IOperateType.brushActive, (e => {
|
|
107
|
+
this._initMarkBrushState(componentIndex, "outOfBrush"), this._emitEvent(event_1.ChartEvent.brushActive, region);
|
|
108
|
+
})), brush.addEventListener(vrender_components_1.IOperateType.drawStart, (e => {
|
|
77
109
|
this._emitEvent(event_1.ChartEvent.brushStart, region);
|
|
78
110
|
})), brush.addEventListener(vrender_components_1.IOperateType.moveStart, (e => {
|
|
79
111
|
this._emitEvent(event_1.ChartEvent.brushStart, region);
|
|
80
112
|
})), brush.addEventListener(vrender_components_1.IOperateType.drawing, (e => {
|
|
81
|
-
this.
|
|
82
|
-
this._needInitOutState = !1, this._needDisablePickable = !0, this._handleBrushChange(event_1.ChartEvent.brushChange, region, e),
|
|
83
|
-
this._emitEvent(event_1.ChartEvent.brushChange, region);
|
|
113
|
+
this._needDisablePickable = !0, this._handleBrushChange(region, e), this._emitEvent(event_1.ChartEvent.brushChange, region);
|
|
84
114
|
})), brush.addEventListener(vrender_components_1.IOperateType.moving, (e => {
|
|
85
|
-
this._handleBrushChange(
|
|
115
|
+
this._handleBrushChange(region, e), this._emitEvent(event_1.ChartEvent.brushChange, region);
|
|
86
116
|
})), brush.addEventListener(vrender_components_1.IOperateType.brushClear, (e => {
|
|
87
|
-
this._initMarkBrushState(componentIndex, ""), this.
|
|
88
|
-
this._handleBrushChange(event_1.ChartEvent.brushChange, region, e), this._handleBrushChange(event_1.ChartEvent.brushClear, region, e),
|
|
89
|
-
this._emitEvent(event_1.ChartEvent.brushChange, region), this._emitEvent(event_1.ChartEvent.brushClear, region);
|
|
117
|
+
this._initMarkBrushState(componentIndex, ""), this._needDisablePickable = !1, this._emitEvent(event_1.ChartEvent.brushClear, region);
|
|
90
118
|
})), brush.addEventListener(vrender_components_1.IOperateType.drawEnd, (e => {
|
|
91
|
-
|
|
119
|
+
var _a;
|
|
120
|
+
this._needDisablePickable = !1;
|
|
92
121
|
const {operateMask: operateMask} = e.detail;
|
|
93
|
-
this.
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
122
|
+
if (null === (_a = this._spec) || void 0 === _a ? void 0 : _a.onBrushEnd) !0 === this._spec.onBrushEnd(e) ? (this.clearGraphic(),
|
|
123
|
+
this._initMarkBrushState(componentIndex, ""), this._needDisablePickable = !1, this._emitEvent(event_1.ChartEvent.brushClear, region)) : (this._spec.onBrushEnd(e),
|
|
124
|
+
this._emitEvent(event_1.ChartEvent.brushEnd, region)); else {
|
|
125
|
+
const inBrushData = this._extendDataInBrush(this._inBrushElementsMap);
|
|
126
|
+
!this._spec.zoomWhenEmpty && inBrushData.length > 0 && this._setAxisAndDataZoom(operateMask, region),
|
|
127
|
+
this._emitEvent(event_1.ChartEvent.brushEnd, region);
|
|
128
|
+
}
|
|
97
129
|
})), brush.addEventListener(vrender_components_1.IOperateType.moveEnd, (e => {
|
|
98
|
-
const {operateMask: operateMask} = e.detail;
|
|
99
|
-
this._handleBrushChange(event_1.ChartEvent.brushEnd, region, e);
|
|
100
|
-
const inBrushData = this._extendDataInBrush(this._inBrushElementsMap);
|
|
130
|
+
const {operateMask: operateMask} = e.detail, inBrushData = this._extendDataInBrush(this._inBrushElementsMap);
|
|
101
131
|
!this._spec.zoomWhenEmpty && inBrushData.length > 0 && this._setAxisAndDataZoom(operateMask, region),
|
|
102
132
|
this._emitEvent(event_1.ChartEvent.brushEnd, region);
|
|
103
133
|
}));
|
|
104
134
|
}
|
|
105
|
-
|
|
135
|
+
_getBrushInteractiveAttr(region) {
|
|
136
|
+
const regionLayoutPosition = region.getLayoutStartPoint(), regionLayoutRect = region.getLayoutRect(), seriesRegionStartX = regionLayoutPosition.x, seriesRegionEndX = seriesRegionStartX + regionLayoutRect.width, seriesRegionStartY = regionLayoutPosition.y, seriesRegionEndY = seriesRegionStartY + regionLayoutRect.height;
|
|
137
|
+
return {
|
|
138
|
+
interactiveRange: {
|
|
139
|
+
minY: seriesRegionStartY,
|
|
140
|
+
maxY: seriesRegionEndY,
|
|
141
|
+
minX: seriesRegionStartX,
|
|
142
|
+
maxX: seriesRegionEndX
|
|
143
|
+
},
|
|
144
|
+
xRange: [ seriesRegionStartX, seriesRegionEndX ],
|
|
145
|
+
yRange: [ seriesRegionStartY, seriesRegionEndY ]
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
_transformBrushedMarkAttr(brushedStyle) {
|
|
149
|
+
const styleResult = {};
|
|
150
|
+
return (null == brushedStyle ? void 0 : brushedStyle.symbol) && (styleResult.symbolType = brushedStyle.symbol),
|
|
151
|
+
(null == brushedStyle ? void 0 : brushedStyle.symbolSize) && (styleResult.size = brushedStyle.symbolSize),
|
|
152
|
+
(null == brushedStyle ? void 0 : brushedStyle.color) && (styleResult.fill = brushedStyle.color),
|
|
153
|
+
(null == brushedStyle ? void 0 : brushedStyle.colorAlpha) && (styleResult.fillOpacity = brushedStyle.colorAlpha),
|
|
154
|
+
Object.assign(Object.assign({}, (0, style_1.transformToGraphic)(brushedStyle)), styleResult);
|
|
155
|
+
}
|
|
156
|
+
_handleBrushChange(region, e) {
|
|
106
157
|
const {operateMask: operateMask} = e.detail;
|
|
107
158
|
this._reconfigItem(operateMask, region), this._reconfigLinkedItem(operateMask, region);
|
|
108
159
|
}
|
|
160
|
+
_extendDataInBrush(elementsMap) {
|
|
161
|
+
var _a, _b;
|
|
162
|
+
const data = [];
|
|
163
|
+
for (const brushName in elementsMap) for (const elementKey in elementsMap[brushName]) data.push(Object.assign({}, null === (_b = null === (_a = elementsMap[brushName][elementKey]) || void 0 === _a ? void 0 : _a.data) || void 0 === _b ? void 0 : _b[0]));
|
|
164
|
+
return data;
|
|
165
|
+
}
|
|
166
|
+
_extendDatumOutOfBrush(elementsMap) {
|
|
167
|
+
var _a;
|
|
168
|
+
const data = [];
|
|
169
|
+
for (const elementKey in elementsMap) data.push(null === (_a = elementsMap[elementKey].data) || void 0 === _a ? void 0 : _a[0]);
|
|
170
|
+
return data;
|
|
171
|
+
}
|
|
109
172
|
_emitEvent(eventType, region) {
|
|
173
|
+
var _a;
|
|
110
174
|
this.event.emit(eventType, {
|
|
111
175
|
model: this,
|
|
112
176
|
value: {
|
|
@@ -121,103 +185,113 @@ class Brush extends base_component_1.BaseComponent {
|
|
|
121
185
|
linkedInBrushElementsMap: this._linkedInBrushElementsMap,
|
|
122
186
|
linkedOutOfBrushElementsMap: this._linkedOutOfBrushElementsMap,
|
|
123
187
|
zoomRecord: this._zoomRecord
|
|
124
|
-
}
|
|
188
|
+
},
|
|
189
|
+
vchart: null === (_a = this._option) || void 0 === _a ? void 0 : _a.globalInstance
|
|
125
190
|
});
|
|
126
191
|
}
|
|
127
|
-
_transformBrushedMarkAttr(brushedStyle) {
|
|
128
|
-
const styleResult = {};
|
|
129
|
-
return (null == brushedStyle ? void 0 : brushedStyle.symbol) && (styleResult.symbolType = brushedStyle.symbol),
|
|
130
|
-
(null == brushedStyle ? void 0 : brushedStyle.symbolSize) && (styleResult.size = brushedStyle.symbolSize),
|
|
131
|
-
(null == brushedStyle ? void 0 : brushedStyle.color) && (styleResult.fill = brushedStyle.color),
|
|
132
|
-
(null == brushedStyle ? void 0 : brushedStyle.colorAlpha) && (styleResult.fillOpacity = brushedStyle.colorAlpha),
|
|
133
|
-
Object.assign(Object.assign({}, (0, style_1.transformToGraphic)(brushedStyle)), styleResult);
|
|
134
|
-
}
|
|
135
192
|
_reconfigItem(operateMask, region) {
|
|
193
|
+
var _a, _b, _c;
|
|
194
|
+
if (!(null == operateMask ? void 0 : operateMask.globalTransMatrix) || !(null === (_a = null == operateMask ? void 0 : operateMask.attribute) || void 0 === _a ? void 0 : _a.points)) return;
|
|
195
|
+
const points = null !== (_c = null === (_b = null == operateMask ? void 0 : operateMask.attribute) || void 0 === _b ? void 0 : _b.points) && void 0 !== _c ? _c : [], {a: a, b: b, c: c, d: d, e: e, f: f} = operateMask.globalTransMatrix, pointsCoord = points.map((p => ({
|
|
196
|
+
x: a * p.x + c * p.y + e,
|
|
197
|
+
y: b * p.x + d * p.y + f
|
|
198
|
+
}))), {markTypeFilter: markTypeFilter = []} = this._spec;
|
|
136
199
|
this._itemMap[region.id].forEach((mark => {
|
|
200
|
+
if (markTypeFilter.includes(mark.type)) return;
|
|
137
201
|
const grammarMark = mark.getProduct();
|
|
138
202
|
if (!grammarMark || !grammarMark.elements || !grammarMark.elements.length) return;
|
|
139
203
|
grammarMark.elements.forEach((el => {
|
|
140
204
|
var _a, _b, _c;
|
|
141
|
-
const graphicItem = el.getGraphicItem(), elementKey = mark.id + "_" + el.key;
|
|
142
|
-
(null === (_a = this._outOfBrushElementsMap) || void 0 === _a ? void 0 : _a[elementKey]) &&
|
|
205
|
+
const graphicItem = el.getGraphicItem(), elementKey = mark.id + "_" + el.key, isBrushContainItem = this._isBrushContainItem(operateMask.globalAABBBounds, pointsCoord, graphicItem);
|
|
206
|
+
(null === (_a = this._outOfBrushElementsMap) || void 0 === _a ? void 0 : _a[elementKey]) && isBrushContainItem ? (el.addState("inBrush"),
|
|
143
207
|
this._inBrushElementsMap[null == operateMask ? void 0 : operateMask.name] || (this._inBrushElementsMap[null == operateMask ? void 0 : operateMask.name] = {}),
|
|
144
208
|
this._inBrushElementsMap[null == operateMask ? void 0 : operateMask.name][elementKey] = el,
|
|
145
|
-
delete this._outOfBrushElementsMap[elementKey]) : (null === (_c = null === (_b = this._inBrushElementsMap) || void 0 === _b ? void 0 : _b[null == operateMask ? void 0 : operateMask.name]) || void 0 === _c ? void 0 : _c[elementKey]) && !
|
|
209
|
+
delete this._outOfBrushElementsMap[elementKey]) : (null === (_c = null === (_b = this._inBrushElementsMap) || void 0 === _b ? void 0 : _b[null == operateMask ? void 0 : operateMask.name]) || void 0 === _c ? void 0 : _c[elementKey]) && !isBrushContainItem && (el.removeState("inBrush"),
|
|
146
210
|
el.addState("outOfBrush"), this._outOfBrushElementsMap[elementKey] = el, delete this._inBrushElementsMap[operateMask.name][elementKey]),
|
|
147
211
|
graphicItem.setAttribute("pickable", !this._needDisablePickable);
|
|
148
212
|
}));
|
|
149
213
|
}));
|
|
150
214
|
}
|
|
151
215
|
_reconfigLinkedItem(operateMask, region) {
|
|
216
|
+
var _a;
|
|
217
|
+
if (!(null == operateMask ? void 0 : operateMask.globalTransMatrix) || !(null === (_a = null == operateMask ? void 0 : operateMask.attribute) || void 0 === _a ? void 0 : _a.points)) return;
|
|
152
218
|
const regionLayoutPos = region.getLayoutStartPoint(), seriesId = region.getSeries().map((s => s.id));
|
|
153
219
|
this._linkedSeries.forEach((s => {
|
|
220
|
+
var _a, _b;
|
|
154
221
|
if (!seriesId.includes(s.id)) {
|
|
155
|
-
const sRegionLayoutPos = s.getRegion().getLayoutStartPoint(), regionOffsetX = sRegionLayoutPos.x - regionLayoutPos.x, regionOffsetY = sRegionLayoutPos.y - regionLayoutPos.y
|
|
222
|
+
const sRegionLayoutPos = s.getRegion().getLayoutStartPoint(), regionOffsetX = sRegionLayoutPos.x - regionLayoutPos.x, regionOffsetY = sRegionLayoutPos.y - regionLayoutPos.y, points = null !== (_b = null === (_a = null == operateMask ? void 0 : operateMask.attribute) || void 0 === _a ? void 0 : _a.points) && void 0 !== _b ? _b : [], {a: a, b: b, c: c, d: d, e: e, f: f} = operateMask.globalTransMatrix, dx = regionOffsetX || 0, dy = regionOffsetY || 0, pointsCoord = points.map((p => ({
|
|
223
|
+
x: a * p.x + c * p.y + e + dx,
|
|
224
|
+
y: b * p.x + d * p.y + f + dy
|
|
225
|
+
})));
|
|
226
|
+
operateMask.globalAABBBounds.clone().set(operateMask.globalAABBBounds.x1 + dx, operateMask.globalAABBBounds.y1 + dy, operateMask.globalAABBBounds.x2 + dx, operateMask.globalAABBBounds.y2 + dy);
|
|
227
|
+
const {markTypeFilter: markTypeFilter = []} = this._spec;
|
|
156
228
|
this._linkedItemMap[s.id].forEach((mark => {
|
|
229
|
+
if (markTypeFilter.includes(mark.type)) return;
|
|
157
230
|
const grammarMark = mark.getProduct();
|
|
158
231
|
if (!grammarMark || !grammarMark.elements || !grammarMark.elements.length) return;
|
|
159
232
|
grammarMark.elements.forEach((el => {
|
|
160
233
|
var _a, _b, _c;
|
|
161
234
|
const graphicItem = el.getGraphicItem(), elementKey = mark.id + "_" + el.key;
|
|
162
|
-
(null === (_a = this._linkedOutOfBrushElementsMap) || void 0 === _a ? void 0 : _a[elementKey]) && this._isBrushContainItem(operateMask, graphicItem,
|
|
163
|
-
|
|
164
|
-
dy: regionOffsetY
|
|
165
|
-
}) ? (el.addState("inBrush"), this._linkedInBrushElementsMap[null == operateMask ? void 0 : operateMask.name] || (this._linkedInBrushElementsMap[null == operateMask ? void 0 : operateMask.name] = {}),
|
|
235
|
+
(null === (_a = this._linkedOutOfBrushElementsMap) || void 0 === _a ? void 0 : _a[elementKey]) && this._isBrushContainItem(operateMask.globalAABBBounds, pointsCoord, graphicItem) ? (el.addState("inBrush"),
|
|
236
|
+
this._linkedInBrushElementsMap[null == operateMask ? void 0 : operateMask.name] || (this._linkedInBrushElementsMap[null == operateMask ? void 0 : operateMask.name] = {}),
|
|
166
237
|
this._linkedInBrushElementsMap[null == operateMask ? void 0 : operateMask.name][elementKey] = el,
|
|
167
|
-
delete this._linkedOutOfBrushElementsMap[elementKey]) : (null === (_c = null === (_b = this._linkedInBrushElementsMap) || void 0 === _b ? void 0 : _b[null == operateMask ? void 0 : operateMask.name]) || void 0 === _c ? void 0 : _c[elementKey]) && !this._isBrushContainItem(operateMask, graphicItem,
|
|
168
|
-
|
|
169
|
-
dy: regionOffsetY
|
|
170
|
-
}) && (el.removeState("inBrush"), el.addState("outOfBrush"), this._linkedOutOfBrushElementsMap[elementKey] = el),
|
|
238
|
+
delete this._linkedOutOfBrushElementsMap[elementKey]) : (null === (_c = null === (_b = this._linkedInBrushElementsMap) || void 0 === _b ? void 0 : _b[null == operateMask ? void 0 : operateMask.name]) || void 0 === _c ? void 0 : _c[elementKey]) && !this._isBrushContainItem(operateMask.globalAABBBounds, pointsCoord, graphicItem) && (el.removeState("inBrush"),
|
|
239
|
+
el.addState("outOfBrush"), this._linkedOutOfBrushElementsMap[elementKey] = el),
|
|
171
240
|
graphicItem.setAttribute("pickable", !this._needDisablePickable);
|
|
172
241
|
}));
|
|
173
242
|
}));
|
|
174
243
|
}
|
|
175
244
|
}));
|
|
176
245
|
}
|
|
177
|
-
_isBrushContainItem(
|
|
178
|
-
var _a, _b, _c;
|
|
179
|
-
if (!(null == brushMask ? void 0 : brushMask.globalTransMatrix) || !(null === (_a = null == brushMask ? void 0 : brushMask.attribute) || void 0 === _a ? void 0 : _a.points)) return !1;
|
|
180
|
-
const points = null !== (_c = null === (_b = null == brushMask ? void 0 : brushMask.attribute) || void 0 === _b ? void 0 : _b.points) && void 0 !== _c ? _c : [], {a: a, b: b, c: c, d: d, e: e, f: f} = brushMask.globalTransMatrix, dx = (null == linkedOffset ? void 0 : linkedOffset.dx) || 0, dy = (null == linkedOffset ? void 0 : linkedOffset.dy) || 0, pointsCoord = points.map((p => ({
|
|
181
|
-
x: a * p.x + c * p.y + e + dx,
|
|
182
|
-
y: b * p.x + d * p.y + f + dy
|
|
183
|
-
})));
|
|
184
|
-
brushMask.globalAABBBounds.clone().set(brushMask.globalAABBBounds.x1 + dx, brushMask.globalAABBBounds.y1 + dy, brushMask.globalAABBBounds.x2 + dx, brushMask.globalAABBBounds.y2 + dy);
|
|
185
|
-
const x = item.globalTransMatrix.e, y = item.globalTransMatrix.f;
|
|
246
|
+
_isBrushContainItem(brushMaskAABBBounds, brushMaskPointsCoord, item) {
|
|
186
247
|
let itemBounds = [];
|
|
187
|
-
if ("symbol"
|
|
188
|
-
const {
|
|
189
|
-
vutils_1.array)(itemSize)[0] / 2;
|
|
190
|
-
return itemBounds = [ {
|
|
191
|
-
x: x - size,
|
|
192
|
-
y: y - size
|
|
193
|
-
}, {
|
|
194
|
-
x: x + size,
|
|
195
|
-
y: y - size
|
|
196
|
-
}, {
|
|
197
|
-
x: x + size,
|
|
198
|
-
y: y + size
|
|
199
|
-
}, {
|
|
200
|
-
x: x - size,
|
|
201
|
-
y: y + size
|
|
202
|
-
} ], (0, vutils_1.polygonIntersectPolygon)(pointsCoord, itemBounds);
|
|
203
|
-
}
|
|
204
|
-
if ("rect" === item.type) {
|
|
205
|
-
const {x1: x1, x2: x2, y1: y1, y2: y2} = null == item ? void 0 : item.AABBBounds, width = Math.abs(x1 - x2), height = Math.abs(y1 - y2);
|
|
248
|
+
if ([ "symbol", "rect" ].includes(item.type)) {
|
|
249
|
+
const {x1: x1, x2: x2, y1: y1, y2: y2} = null == item ? void 0 : item.globalAABBBounds;
|
|
206
250
|
return itemBounds = [ {
|
|
207
|
-
x:
|
|
208
|
-
y:
|
|
251
|
+
x: x1,
|
|
252
|
+
y: y1
|
|
209
253
|
}, {
|
|
210
|
-
x:
|
|
211
|
-
y:
|
|
254
|
+
x: x2,
|
|
255
|
+
y: y1
|
|
212
256
|
}, {
|
|
213
|
-
x:
|
|
214
|
-
y:
|
|
257
|
+
x: x2,
|
|
258
|
+
y: y2
|
|
215
259
|
}, {
|
|
216
|
-
x:
|
|
217
|
-
y:
|
|
218
|
-
} ], (0, vutils_1.polygonIntersectPolygon)(
|
|
260
|
+
x: x1,
|
|
261
|
+
y: y2
|
|
262
|
+
} ], (0, vutils_1.polygonIntersectPolygon)(brushMaskPointsCoord, itemBounds);
|
|
219
263
|
}
|
|
220
|
-
return
|
|
264
|
+
return brushMaskAABBBounds.intersects(item.globalAABBBounds);
|
|
265
|
+
}
|
|
266
|
+
_initMarkBrushState(componentIndex, stateName) {
|
|
267
|
+
this._brushComponents.forEach(((brush, index) => {
|
|
268
|
+
index !== componentIndex && brush.children[0].removeAllChild();
|
|
269
|
+
})), this._inBrushElementsMap = {}, this._outOfBrushElementsMap = {}, this._linkedInBrushElementsMap = {},
|
|
270
|
+
this._linkedOutOfBrushElementsMap = {};
|
|
271
|
+
const {markTypeFilter: markTypeFilter = []} = this._spec;
|
|
272
|
+
Object.entries(this._itemMap).forEach((([regionId, marks]) => {
|
|
273
|
+
marks.forEach((mark => {
|
|
274
|
+
if (markTypeFilter.includes(mark.type)) return;
|
|
275
|
+
const grammarMark = mark.getProduct();
|
|
276
|
+
if (!grammarMark || !grammarMark.elements || !grammarMark.elements.length) return;
|
|
277
|
+
grammarMark.elements.forEach((el => {
|
|
278
|
+
const elementKey = mark.id + "_" + el.key;
|
|
279
|
+
el.removeState("inBrush"), el.removeState("outOfBrush"), el.addState(stateName),
|
|
280
|
+
this._outOfBrushElementsMap[elementKey] = el;
|
|
281
|
+
}));
|
|
282
|
+
}));
|
|
283
|
+
})), Object.entries(this._linkedItemMap).forEach((([seriesId, marks]) => {
|
|
284
|
+
marks.forEach((mark => {
|
|
285
|
+
if (markTypeFilter.includes(mark.type)) return;
|
|
286
|
+
const grammarMark = mark.getProduct();
|
|
287
|
+
if (!grammarMark || !grammarMark.elements || !grammarMark.elements.length) return;
|
|
288
|
+
grammarMark.elements.forEach((el => {
|
|
289
|
+
const elementKey = mark.id + "_" + el.key;
|
|
290
|
+
el.removeState("inBrush"), el.removeState("outOfBrush"), el.addState(stateName),
|
|
291
|
+
this._linkedOutOfBrushElementsMap[elementKey] = el;
|
|
292
|
+
}));
|
|
293
|
+
}));
|
|
294
|
+
}));
|
|
221
295
|
}
|
|
222
296
|
_stateClamp(state) {
|
|
223
297
|
return Math.min(Math.max(0, state), 1);
|
|
@@ -255,83 +329,9 @@ class Brush extends base_component_1.BaseComponent {
|
|
|
255
329
|
}));
|
|
256
330
|
}
|
|
257
331
|
}
|
|
258
|
-
_bindRegions() {
|
|
259
|
-
(0, vutils_1.isValid)(this._spec.regionId) && (0, vutils_1.isValid)(this._spec.regionIndex) && (this._relativeRegions = this._option.getAllRegions()),
|
|
260
|
-
this._relativeRegions = this._option.getRegionsInUserIdOrIndex((0, vutils_1.array)(this._spec.regionId), (0,
|
|
261
|
-
vutils_1.array)(this._spec.regionIndex));
|
|
262
|
-
}
|
|
263
|
-
_bindLinkedSeries() {
|
|
264
|
-
(0, vutils_1.isValid)(this._spec.brushLinkSeriesId) && (0, vutils_1.isValid)(this._spec.brushLinkSeriesIndex) || (this._linkedSeries = this._option.getSeriesInUserIdOrIndex((0,
|
|
265
|
-
vutils_1.array)(this._spec.brushLinkSeriesId), (0, vutils_1.array)(this._spec.brushLinkSeriesIndex)));
|
|
266
|
-
}
|
|
267
|
-
_initRegionAxisMap() {
|
|
268
|
-
(0, vutils_1.isValid)(this._spec.axisId) ? (0, vutils_1.array)(this._spec.axisId).forEach((axisId => {
|
|
269
|
-
this._releatedAxes.push(this._option.getComponentByUserId(axisId));
|
|
270
|
-
})) : (0, vutils_1.isValid)(this._spec.axisIndex) ? (0, vutils_1.array)(this._spec.axisIndex).forEach((axisIndex => {
|
|
271
|
-
this._releatedAxes.push(this._option.getComponentByIndex("axes", axisIndex));
|
|
272
|
-
})) : this._releatedAxes = this._option.getComponentsByKey("axes"), this._releatedAxes.forEach((axis => {
|
|
273
|
-
null == axis || axis.getRegions().forEach((region => {
|
|
274
|
-
this._regionAxisMap["region_" + region.id] ? this._regionAxisMap["region_" + region.id].push(axis) : this._regionAxisMap["region_" + region.id] = [ axis ];
|
|
275
|
-
}));
|
|
276
|
-
}));
|
|
277
|
-
}
|
|
278
|
-
_initAxisDataZoomMap() {
|
|
279
|
-
this._option.getComponentsByKey("dataZoom").forEach((dz => {
|
|
280
|
-
dz.relatedAxisComponent && (this._axisDataZoomMap[dz.relatedAxisComponent.id] = dz);
|
|
281
|
-
}));
|
|
282
|
-
}
|
|
283
|
-
_initNeedOperatedItem() {
|
|
284
|
-
const seriesUserId = this._spec.seriesId, seriesIndex = this._spec.seriesIndex;
|
|
285
|
-
this._relativeRegions.forEach((r => {
|
|
286
|
-
const allMarks = [];
|
|
287
|
-
r.getSeries().forEach((s => {
|
|
288
|
-
(seriesUserId && (0, vutils_1.array)(seriesUserId).includes(s.userId.toString()) || seriesIndex && (0,
|
|
289
|
-
vutils_1.array)(seriesIndex).includes(s.getSpecIndex()) || !seriesIndex && !seriesUserId) && allMarks.push(...s.getMarksWithoutRoot()),
|
|
290
|
-
this._itemMap[r.id] = allMarks;
|
|
291
|
-
}));
|
|
292
|
-
})), this._linkedSeries.forEach((s => {
|
|
293
|
-
this._linkedItemMap[s.id] = s.getMarksWithoutRoot();
|
|
294
|
-
}));
|
|
295
|
-
}
|
|
296
|
-
_initMarkBrushState(componentIndex, stateName) {
|
|
297
|
-
this._brushComponents.forEach(((brush, index) => {
|
|
298
|
-
index !== componentIndex && brush.children[0].removeAllChild();
|
|
299
|
-
})), this._inBrushElementsMap = {}, this._outOfBrushElementsMap = {}, this._linkedInBrushElementsMap = {},
|
|
300
|
-
this._linkedOutOfBrushElementsMap = {}, this._option.getAllSeries().forEach((s => {
|
|
301
|
-
s.getMarksWithoutRoot().forEach((mark => {
|
|
302
|
-
const grammarMark = mark.getProduct();
|
|
303
|
-
if (!grammarMark || !grammarMark.elements || !grammarMark.elements.length) return;
|
|
304
|
-
grammarMark.elements.forEach((el => {
|
|
305
|
-
const elementKey = mark.id + "_" + el.key;
|
|
306
|
-
el.removeState("inBrush"), el.removeState("outOfBrush"), el.addState(stateName),
|
|
307
|
-
this._outOfBrushElementsMap[elementKey] = el, this._linkedOutOfBrushElementsMap[elementKey] = el;
|
|
308
|
-
}));
|
|
309
|
-
}));
|
|
310
|
-
}));
|
|
311
|
-
}
|
|
312
|
-
initEvent() {}
|
|
313
|
-
onRender(ctx) {}
|
|
314
|
-
changeRegions(regions) {}
|
|
315
332
|
_getNeedClearVRenderComponents() {
|
|
316
333
|
return this._brushComponents;
|
|
317
334
|
}
|
|
318
|
-
_compareSpec(spec, prevSpec) {
|
|
319
|
-
this._brushComponents && this._relativeRegions.forEach(((region, index) => {
|
|
320
|
-
this._updateBrushComponent(region, index);
|
|
321
|
-
}));
|
|
322
|
-
const result = super._compareSpec(spec, prevSpec);
|
|
323
|
-
return (0, vutils_2.isEqual)(prevSpec, spec) || (result.reRender = !0, result.reMake = !0),
|
|
324
|
-
result;
|
|
325
|
-
}
|
|
326
|
-
onLayoutEnd(ctx) {
|
|
327
|
-
var _a;
|
|
328
|
-
if (super.onLayoutEnd(ctx), this._option.disableTriggerEvent) return;
|
|
329
|
-
(null === (_a = this._spec.visible) || void 0 === _a || _a) && (this._brushComponents ? this._relativeRegions.forEach(((region, index) => {
|
|
330
|
-
this._updateBrushComponent(region, index);
|
|
331
|
-
})) : (this._brushComponents = [], this._relativeRegions.forEach(((region, index) => {
|
|
332
|
-
this._createBrushComponent(region, index);
|
|
333
|
-
}))));
|
|
334
|
-
}
|
|
335
335
|
clearGraphic() {
|
|
336
336
|
this._brushComponents && this._brushComponents.forEach((brush => {
|
|
337
337
|
brush._container.incrementalClearChild();
|
|
@@ -340,8 +340,9 @@ class Brush extends base_component_1.BaseComponent {
|
|
|
340
340
|
clear() {
|
|
341
341
|
if (this._brushComponents) {
|
|
342
342
|
const container = this.getContainer();
|
|
343
|
-
this._brushComponents.forEach((brush => {
|
|
344
|
-
|
|
343
|
+
this._brushComponents.forEach(((brush, index) => {
|
|
344
|
+
this._initMarkBrushState(index, ""), this._needDisablePickable = !1, brush.removeAllChild(),
|
|
345
|
+
brush.releaseBrushEvents(), container && container.removeChild(brush);
|
|
345
346
|
})), this._brushComponents = null;
|
|
346
347
|
}
|
|
347
348
|
}
|