@visactor/vrender-components 0.22.7-alpha.9 → 0.22.8-alpha.0
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/cjs/axis/util.js +1 -2
- package/cjs/brush/brush.d.ts +16 -10
- package/cjs/brush/brush.js +80 -93
- package/cjs/brush/brush.js.map +1 -1
- package/cjs/brush/config.d.ts +5 -5
- package/cjs/brush/config.js +5 -5
- package/cjs/brush/config.js.map +1 -1
- package/cjs/brush/type.d.ts +1 -0
- package/cjs/brush/type.js +3 -2
- package/cjs/brush/type.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/dist/index.es.js +133 -134
- package/es/axis/util.js +1 -2
- package/es/brush/brush.d.ts +16 -10
- package/es/brush/brush.js +82 -95
- package/es/brush/brush.js.map +1 -1
- package/es/brush/config.d.ts +5 -5
- package/es/brush/config.js +5 -5
- package/es/brush/config.js.map +1 -1
- package/es/brush/type.d.ts +1 -0
- package/es/brush/type.js +3 -2
- package/es/brush/type.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.es.js
CHANGED
|
@@ -29720,13 +29720,14 @@ var IOperateType;
|
|
|
29720
29720
|
IOperateType["moving"] = "moving";
|
|
29721
29721
|
IOperateType["moveStart"] = "moveStart";
|
|
29722
29722
|
IOperateType["moveEnd"] = "moveEnd";
|
|
29723
|
+
IOperateType["brushActive"] = "brushActive";
|
|
29723
29724
|
IOperateType["brushClear"] = "brushClear";
|
|
29724
29725
|
})(IOperateType || (IOperateType = {}));
|
|
29725
29726
|
|
|
29726
29727
|
const DEFAULT_BRUSH_ATTRIBUTES = {
|
|
29727
29728
|
trigger: 'pointerdown',
|
|
29728
29729
|
updateTrigger: 'pointermove',
|
|
29729
|
-
endTrigger: 'pointerup',
|
|
29730
|
+
endTrigger: ['pointerup', 'pointerleave'],
|
|
29730
29731
|
resetTrigger: 'pointerupoutside',
|
|
29731
29732
|
hasMask: true,
|
|
29732
29733
|
brushMode: 'single',
|
|
@@ -29742,10 +29743,10 @@ const DEFAULT_BRUSH_ATTRIBUTES = {
|
|
|
29742
29743
|
delayType: 'throttle',
|
|
29743
29744
|
delayTime: 10,
|
|
29744
29745
|
interactiveRange: {
|
|
29745
|
-
|
|
29746
|
-
|
|
29747
|
-
|
|
29748
|
-
|
|
29746
|
+
minY: -Infinity,
|
|
29747
|
+
maxY: Infinity,
|
|
29748
|
+
minX: -Infinity,
|
|
29749
|
+
maxX: Infinity
|
|
29749
29750
|
}
|
|
29750
29751
|
};
|
|
29751
29752
|
const DEFAULT_SIZE_THRESHOLD = 5;
|
|
@@ -29766,145 +29767,86 @@ class Brush extends AbstractComponent {
|
|
|
29766
29767
|
this.name = 'brush';
|
|
29767
29768
|
this._activeDrawState = false;
|
|
29768
29769
|
this._cacheDrawPoints = [];
|
|
29769
|
-
this._isDrawedBeforeEnd = false;
|
|
29770
|
-
this._isDownBeforeUpOutside = false;
|
|
29771
29770
|
this._activeMoveState = false;
|
|
29772
29771
|
this._operatingMaskMoveDx = 0;
|
|
29773
29772
|
this._operatingMaskMoveDy = 0;
|
|
29774
29773
|
this._operatingMaskMoveRangeX = [-Infinity, Infinity];
|
|
29775
29774
|
this._operatingMaskMoveRangeY = [-Infinity, Infinity];
|
|
29776
29775
|
this._brushMaskAABBBoundsDict = {};
|
|
29776
|
+
this._firstUpdate = true;
|
|
29777
29777
|
this._onBrushStart = (e) => {
|
|
29778
|
-
var _a;
|
|
29779
29778
|
if (this._outOfInteractiveRange(e)) {
|
|
29780
|
-
this.
|
|
29779
|
+
if (!this._isEmptyMask()) {
|
|
29780
|
+
this._clearMask();
|
|
29781
|
+
this._dispatchBrushEvent(IOperateType.brushClear, e);
|
|
29782
|
+
}
|
|
29781
29783
|
return;
|
|
29782
29784
|
}
|
|
29785
|
+
const { updateTrigger = DEFAULT_BRUSH_ATTRIBUTES.updateTrigger, endTrigger = DEFAULT_BRUSH_ATTRIBUTES.endTrigger, brushMoved = true } = this.attribute;
|
|
29786
|
+
array(updateTrigger).forEach(t => this.stage.addEventListener(t, this._onBrushingWithDelay));
|
|
29787
|
+
array(endTrigger).forEach(t => this.stage.addEventListener(t, this._onBrushEnd));
|
|
29783
29788
|
e.stopPropagation();
|
|
29784
|
-
|
|
29789
|
+
this._firstUpdate = true;
|
|
29785
29790
|
this._activeMoveState = brushMoved && this._isPosInBrushMask(e);
|
|
29786
29791
|
this._activeDrawState = !this._activeMoveState;
|
|
29787
|
-
this.
|
|
29788
|
-
this._activeMoveState && this._initMove(e);
|
|
29792
|
+
this._startPos = this.eventPosToStagePos(e);
|
|
29789
29793
|
};
|
|
29790
29794
|
this._onBrushing = (e) => {
|
|
29791
29795
|
if (this._outOfInteractiveRange(e)) {
|
|
29792
29796
|
return;
|
|
29793
29797
|
}
|
|
29794
|
-
|
|
29795
|
-
|
|
29798
|
+
e.stopPropagation();
|
|
29799
|
+
if (this._firstUpdate) {
|
|
29800
|
+
this._activeDrawState && this._initDraw(e);
|
|
29801
|
+
this._activeMoveState && this._initMove(e);
|
|
29802
|
+
this._firstUpdate = false;
|
|
29803
|
+
}
|
|
29804
|
+
else {
|
|
29805
|
+
this._activeDrawState && this._drawing(e);
|
|
29806
|
+
this._activeMoveState && this._moving(e);
|
|
29796
29807
|
}
|
|
29797
|
-
this._activeDrawState && this._drawing(e);
|
|
29798
|
-
this._activeMoveState && this._moving(e);
|
|
29799
29808
|
};
|
|
29800
29809
|
this._onBrushingWithDelay = this.attribute.delayTime === 0
|
|
29801
29810
|
? this._onBrushing
|
|
29802
29811
|
: delayMap[this.attribute.delayType](this._onBrushing, this.attribute.delayTime);
|
|
29803
29812
|
this._onBrushEnd = (e) => {
|
|
29804
|
-
|
|
29805
|
-
if (!this._activeDrawState && !this._activeMoveState) {
|
|
29806
|
-
return;
|
|
29807
|
-
}
|
|
29813
|
+
this._releaseBrushUpdateEvents();
|
|
29808
29814
|
e.preventDefault();
|
|
29809
|
-
|
|
29810
|
-
|
|
29811
|
-
if ((_a = this._operatingMask) === null || _a === void 0 ? void 0 : _a._AABBBounds.empty()) {
|
|
29812
|
-
this._dispatchEvent(IOperateType.brushClear, {
|
|
29813
|
-
operateMask: this._operatingMask,
|
|
29814
|
-
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
29815
|
-
event: e
|
|
29816
|
-
});
|
|
29817
|
-
}
|
|
29818
|
-
this._container.incrementalClearChild();
|
|
29819
|
-
this._brushMaskAABBBoundsDict = {};
|
|
29820
|
-
}
|
|
29821
|
-
else {
|
|
29822
|
-
if (this._activeDrawState) {
|
|
29823
|
-
this._dispatchEvent(IOperateType.drawEnd, {
|
|
29824
|
-
operateMask: this._operatingMask,
|
|
29825
|
-
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
29826
|
-
event: e
|
|
29827
|
-
});
|
|
29828
|
-
}
|
|
29829
|
-
if (this._activeMoveState) {
|
|
29830
|
-
this._dispatchEvent(IOperateType.moveEnd, {
|
|
29831
|
-
operateMask: this._operatingMask,
|
|
29832
|
-
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
29833
|
-
event: e
|
|
29834
|
-
});
|
|
29835
|
-
}
|
|
29836
|
-
}
|
|
29815
|
+
this._activeDrawState && this._drawEnd(e);
|
|
29816
|
+
this._activeMoveState && this._moveEnd(e);
|
|
29837
29817
|
this._activeDrawState = false;
|
|
29838
29818
|
this._activeMoveState = false;
|
|
29839
|
-
this._isDrawedBeforeEnd = false;
|
|
29840
|
-
if (this._operatingMask) {
|
|
29841
|
-
this._operatingMask.setAttribute('pickable', false);
|
|
29842
|
-
}
|
|
29843
29819
|
};
|
|
29844
29820
|
this._onBrushClear = (e) => {
|
|
29845
29821
|
e.preventDefault();
|
|
29846
|
-
|
|
29847
|
-
|
|
29848
|
-
this.
|
|
29849
|
-
operateMask: this._operatingMask,
|
|
29850
|
-
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
29851
|
-
event: e
|
|
29852
|
-
});
|
|
29853
|
-
this._container.incrementalClearChild();
|
|
29854
|
-
this._brushMaskAABBBoundsDict = {};
|
|
29822
|
+
if (!this._isEmptyMask()) {
|
|
29823
|
+
this._clearMask();
|
|
29824
|
+
this._dispatchBrushEvent(IOperateType.brushClear, e);
|
|
29855
29825
|
}
|
|
29856
29826
|
this._activeDrawState = false;
|
|
29857
29827
|
this._activeMoveState = false;
|
|
29858
|
-
this._isDrawedBeforeEnd = false;
|
|
29859
|
-
this._isDownBeforeUpOutside = false;
|
|
29860
|
-
if (this._operatingMask) {
|
|
29861
|
-
this._operatingMask.setAttribute('pickable', false);
|
|
29862
|
-
}
|
|
29863
29828
|
};
|
|
29864
29829
|
}
|
|
29865
29830
|
_bindBrushEvents() {
|
|
29831
|
+
this.releaseBrushEvents();
|
|
29866
29832
|
if (this.attribute.disableTriggerEvent) {
|
|
29867
29833
|
return;
|
|
29868
29834
|
}
|
|
29869
|
-
const { trigger = DEFAULT_BRUSH_ATTRIBUTES.trigger,
|
|
29870
|
-
|
|
29871
|
-
array(
|
|
29872
|
-
array(endTrigger).forEach(t => this.stage.addEventListener(t, this._onBrushEnd));
|
|
29835
|
+
const { trigger = DEFAULT_BRUSH_ATTRIBUTES.trigger, resetTrigger = DEFAULT_BRUSH_ATTRIBUTES.resetTrigger } = this
|
|
29836
|
+
.attribute;
|
|
29837
|
+
array(trigger).forEach(t => this.stage.addEventListener(t, this._onBrushStart));
|
|
29873
29838
|
array(resetTrigger).forEach(t => this.stage.addEventListener(t, this._onBrushClear));
|
|
29874
29839
|
}
|
|
29875
|
-
_isPosInBrushMask(e) {
|
|
29876
|
-
const pos = this.eventPosToStagePos(e);
|
|
29877
|
-
const brushMasks = this._container.getChildren();
|
|
29878
|
-
for (let i = 0; i < brushMasks.length; i++) {
|
|
29879
|
-
const { points = [], dx = 0, dy = 0 } = brushMasks[i].attribute;
|
|
29880
|
-
const pointsConsiderOffset = points.map((point) => {
|
|
29881
|
-
return {
|
|
29882
|
-
x: point.x + dx,
|
|
29883
|
-
y: point.y + dy
|
|
29884
|
-
};
|
|
29885
|
-
});
|
|
29886
|
-
if (polygonContainPoint(pointsConsiderOffset, pos.x, pos.y)) {
|
|
29887
|
-
this._operatingMask = brushMasks[i];
|
|
29888
|
-
return true;
|
|
29889
|
-
}
|
|
29890
|
-
}
|
|
29891
|
-
return false;
|
|
29892
|
-
}
|
|
29893
29840
|
_initDraw(e) {
|
|
29894
29841
|
const { brushMode } = this.attribute;
|
|
29895
29842
|
const pos = this.eventPosToStagePos(e);
|
|
29896
29843
|
this._cacheDrawPoints = [pos];
|
|
29897
|
-
this.
|
|
29898
|
-
if (brushMode === 'single') {
|
|
29899
|
-
this._brushMaskAABBBoundsDict = {};
|
|
29900
|
-
this._container.incrementalClearChild();
|
|
29901
|
-
}
|
|
29844
|
+
brushMode === 'single' && this._clearMask();
|
|
29902
29845
|
this._addBrushMask();
|
|
29903
|
-
this.
|
|
29904
|
-
|
|
29905
|
-
|
|
29906
|
-
|
|
29907
|
-
});
|
|
29846
|
+
this._dispatchBrushEvent(IOperateType.drawStart, e);
|
|
29847
|
+
if (Object.keys(this._brushMaskAABBBoundsDict).length === 1) {
|
|
29848
|
+
this._dispatchBrushEvent(IOperateType.brushActive, e);
|
|
29849
|
+
}
|
|
29908
29850
|
}
|
|
29909
29851
|
_initMove(e) {
|
|
29910
29852
|
var _a, _b;
|
|
@@ -29921,16 +29863,12 @@ class Brush extends AbstractComponent {
|
|
|
29921
29863
|
this._operatingMaskMoveRangeX = [minMoveStepX, maxMoveStepX];
|
|
29922
29864
|
this._operatingMaskMoveRangeY = [minMoveStepY, maxMoveStepY];
|
|
29923
29865
|
this._operatingMask.setAttribute('pickable', true);
|
|
29924
|
-
this.
|
|
29925
|
-
operateMask: this._operatingMask,
|
|
29926
|
-
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
29927
|
-
event: e
|
|
29928
|
-
});
|
|
29866
|
+
this._dispatchBrushEvent(IOperateType.moveStart, e);
|
|
29929
29867
|
}
|
|
29930
29868
|
_drawing(e) {
|
|
29931
|
-
var _a
|
|
29869
|
+
var _a;
|
|
29932
29870
|
const pos = this.eventPosToStagePos(e);
|
|
29933
|
-
const {
|
|
29871
|
+
const { brushType } = this.attribute;
|
|
29934
29872
|
const cacheLength = this._cacheDrawPoints.length;
|
|
29935
29873
|
if (cacheLength > 0) {
|
|
29936
29874
|
const lastPos = (_a = this._cacheDrawPoints[this._cacheDrawPoints.length - 1]) !== null && _a !== void 0 ? _a : {};
|
|
@@ -29946,18 +29884,7 @@ class Brush extends AbstractComponent {
|
|
|
29946
29884
|
}
|
|
29947
29885
|
const maskPoints = this._computeMaskPoints();
|
|
29948
29886
|
this._operatingMask.setAttribute('points', maskPoints);
|
|
29949
|
-
|
|
29950
|
-
this._isDrawedBeforeEnd =
|
|
29951
|
-
!this._operatingMask._AABBBounds.empty() &&
|
|
29952
|
-
!!(Math.abs(x2 - x1) > sizeThreshold || Math.abs(y1 - y2) > sizeThreshold);
|
|
29953
|
-
if (this._isDrawedBeforeEnd) {
|
|
29954
|
-
this._brushMaskAABBBoundsDict[this._operatingMask.name] = this._operatingMask.AABBBounds;
|
|
29955
|
-
this._dispatchEvent(IOperateType.drawing, {
|
|
29956
|
-
operateMask: this._operatingMask,
|
|
29957
|
-
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
29958
|
-
event: e
|
|
29959
|
-
});
|
|
29960
|
-
}
|
|
29887
|
+
this._dispatchBrushEvent(IOperateType.drawing, e);
|
|
29961
29888
|
}
|
|
29962
29889
|
_moving(e) {
|
|
29963
29890
|
const startPos = this._cacheMovePoint;
|
|
@@ -29976,11 +29903,61 @@ class Brush extends AbstractComponent {
|
|
|
29976
29903
|
dy: moveY
|
|
29977
29904
|
});
|
|
29978
29905
|
this._brushMaskAABBBoundsDict[this._operatingMask.name] = this._operatingMask.AABBBounds;
|
|
29979
|
-
this.
|
|
29980
|
-
|
|
29981
|
-
|
|
29982
|
-
|
|
29983
|
-
|
|
29906
|
+
this._dispatchBrushEvent(IOperateType.moving, e);
|
|
29907
|
+
}
|
|
29908
|
+
_drawEnd(e) {
|
|
29909
|
+
const { removeOnClick = true, sizeThreshold = DEFAULT_SIZE_THRESHOLD } = this.attribute;
|
|
29910
|
+
if (this._outOfInteractiveRange(e)) {
|
|
29911
|
+
if (!this._isEmptyMask()) {
|
|
29912
|
+
this._clearMask();
|
|
29913
|
+
this._dispatchBrushEvent(IOperateType.brushClear, e);
|
|
29914
|
+
}
|
|
29915
|
+
}
|
|
29916
|
+
else {
|
|
29917
|
+
const { x: x1, y: y1 } = this._startPos;
|
|
29918
|
+
const { x: x2, y: y2 } = this.eventPosToStagePos(e);
|
|
29919
|
+
if (Math.abs(x2 - x1) <= 1 && Math.abs(y2 - y1) <= 1 && removeOnClick) {
|
|
29920
|
+
if (!this._isEmptyMask()) {
|
|
29921
|
+
this._clearMask();
|
|
29922
|
+
this._dispatchBrushEvent(IOperateType.brushClear, e);
|
|
29923
|
+
}
|
|
29924
|
+
}
|
|
29925
|
+
else if (Math.abs(x2 - x1) < sizeThreshold && Math.abs(y1 - y2) < sizeThreshold) {
|
|
29926
|
+
delete this._brushMaskAABBBoundsDict[this._operatingMask.name];
|
|
29927
|
+
this._container.setAttributes({});
|
|
29928
|
+
this._container.removeChild(this._operatingMask);
|
|
29929
|
+
if (this._isEmptyMask()) {
|
|
29930
|
+
this._dispatchBrushEvent(IOperateType.brushClear, e);
|
|
29931
|
+
}
|
|
29932
|
+
}
|
|
29933
|
+
else {
|
|
29934
|
+
this._brushMaskAABBBoundsDict[this._operatingMask.name] = this._operatingMask.AABBBounds;
|
|
29935
|
+
this._dispatchBrushEvent(IOperateType.drawEnd, e);
|
|
29936
|
+
}
|
|
29937
|
+
}
|
|
29938
|
+
}
|
|
29939
|
+
_moveEnd(e) {
|
|
29940
|
+
if (this._operatingMask) {
|
|
29941
|
+
this._operatingMask.setAttribute('pickable', false);
|
|
29942
|
+
}
|
|
29943
|
+
this._dispatchBrushEvent(IOperateType.moveEnd, e);
|
|
29944
|
+
}
|
|
29945
|
+
render() {
|
|
29946
|
+
this._bindBrushEvents();
|
|
29947
|
+
const group = this.createOrUpdateChild('brush-container', {}, 'group');
|
|
29948
|
+
this._container = group;
|
|
29949
|
+
}
|
|
29950
|
+
releaseBrushEvents() {
|
|
29951
|
+
const { trigger = DEFAULT_BRUSH_ATTRIBUTES.trigger, resetTrigger = DEFAULT_BRUSH_ATTRIBUTES.resetTrigger } = this
|
|
29952
|
+
.attribute;
|
|
29953
|
+
array(trigger).forEach(t => this.stage.removeEventListener(t, this._onBrushStart));
|
|
29954
|
+
array(resetTrigger).forEach(t => this.stage.removeEventListener(t, this._onBrushClear));
|
|
29955
|
+
this._releaseBrushUpdateEvents();
|
|
29956
|
+
}
|
|
29957
|
+
_releaseBrushUpdateEvents() {
|
|
29958
|
+
const { updateTrigger = DEFAULT_BRUSH_ATTRIBUTES.updateTrigger, endTrigger = DEFAULT_BRUSH_ATTRIBUTES.endTrigger } = this.attribute;
|
|
29959
|
+
array(updateTrigger).forEach(t => this.stage.removeEventListener(t, this._onBrushingWithDelay));
|
|
29960
|
+
array(endTrigger).forEach(t => this.stage.removeEventListener(t, this._onBrushEnd));
|
|
29984
29961
|
}
|
|
29985
29962
|
_computeMaskPoints() {
|
|
29986
29963
|
const { brushType, xRange = [0, 0], yRange = [0, 0] } = this.attribute;
|
|
@@ -30049,12 +30026,30 @@ class Brush extends AbstractComponent {
|
|
|
30049
30026
|
_addBrushMask() {
|
|
30050
30027
|
var _a;
|
|
30051
30028
|
const { brushStyle, hasMask } = this.attribute;
|
|
30052
|
-
const brushMask = graphicCreator.polygon(Object.assign(Object.assign({ points: cloneDeep(this._cacheDrawPoints), cursor: 'move', pickable: false }, brushStyle), { opacity: hasMask ? (_a = brushStyle.opacity) !== null && _a !== void 0 ? _a : 1 : 0 }));
|
|
30029
|
+
const brushMask = graphicCreator.polygon(Object.assign(Object.assign({ points: cloneDeep(this._cacheDrawPoints), cursor: 'move', pickable: false }, brushStyle), { opacity: hasMask ? ((_a = brushStyle.opacity) !== null && _a !== void 0 ? _a : 1) : 0 }));
|
|
30053
30030
|
brushMask.name = `brush-${Date.now()}`;
|
|
30054
30031
|
this._operatingMask = brushMask;
|
|
30055
30032
|
this._container.add(brushMask);
|
|
30056
30033
|
this._brushMaskAABBBoundsDict[brushMask.name] = brushMask.AABBBounds;
|
|
30057
30034
|
}
|
|
30035
|
+
_isPosInBrushMask(e) {
|
|
30036
|
+
const pos = this.eventPosToStagePos(e);
|
|
30037
|
+
const brushMasks = this._container.getChildren();
|
|
30038
|
+
for (let i = 0; i < brushMasks.length; i++) {
|
|
30039
|
+
const { points = [], dx = 0, dy = 0 } = brushMasks[i].attribute;
|
|
30040
|
+
const pointsConsiderOffset = points.map((point) => {
|
|
30041
|
+
return {
|
|
30042
|
+
x: point.x + dx,
|
|
30043
|
+
y: point.y + dy
|
|
30044
|
+
};
|
|
30045
|
+
});
|
|
30046
|
+
if (polygonContainPoint(pointsConsiderOffset, pos.x, pos.y)) {
|
|
30047
|
+
this._operatingMask = brushMasks[i];
|
|
30048
|
+
return true;
|
|
30049
|
+
}
|
|
30050
|
+
}
|
|
30051
|
+
return false;
|
|
30052
|
+
}
|
|
30058
30053
|
_outOfInteractiveRange(e) {
|
|
30059
30054
|
const { interactiveRange } = this.attribute;
|
|
30060
30055
|
const { minY = -Infinity, maxY = Infinity, minX = -Infinity, maxX = Infinity } = interactiveRange;
|
|
@@ -30067,17 +30062,21 @@ class Brush extends AbstractComponent {
|
|
|
30067
30062
|
eventPosToStagePos(e) {
|
|
30068
30063
|
return this.stage.eventPointTransform(e);
|
|
30069
30064
|
}
|
|
30070
|
-
|
|
30071
|
-
this.
|
|
30072
|
-
|
|
30073
|
-
|
|
30065
|
+
_dispatchBrushEvent(operateType, e) {
|
|
30066
|
+
this._dispatchEvent(operateType, {
|
|
30067
|
+
operateMask: this._operatingMask,
|
|
30068
|
+
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
30069
|
+
event: e
|
|
30070
|
+
});
|
|
30074
30071
|
}
|
|
30075
|
-
|
|
30076
|
-
|
|
30077
|
-
|
|
30078
|
-
|
|
30079
|
-
|
|
30080
|
-
|
|
30072
|
+
_clearMask() {
|
|
30073
|
+
this._brushMaskAABBBoundsDict = {};
|
|
30074
|
+
this._container.incrementalClearChild();
|
|
30075
|
+
this._operatingMask = null;
|
|
30076
|
+
}
|
|
30077
|
+
_isEmptyMask() {
|
|
30078
|
+
return (isEmpty(this._brushMaskAABBBoundsDict) ||
|
|
30079
|
+
Object.keys(this._brushMaskAABBBoundsDict).every(key => this._brushMaskAABBBoundsDict[key].empty()));
|
|
30081
30080
|
}
|
|
30082
30081
|
}
|
|
30083
30082
|
Brush.defaultAttributes = DEFAULT_BRUSH_ATTRIBUTES;
|
|
@@ -31620,6 +31619,6 @@ StoryLabelItem.defaultAttributes = {
|
|
|
31620
31619
|
theme: 'default'
|
|
31621
31620
|
};
|
|
31622
31621
|
|
|
31623
|
-
const version = "0.22.
|
|
31622
|
+
const version = "0.22.8-alpha.0";
|
|
31624
31623
|
|
|
31625
31624
|
export { AXIS_ELEMENT_NAME, AbstractComponent, ArcInfo, ArcLabel, ArcSegment, AxisStateValue, BasePlayer, Brush, CheckBox, CircleAxis, CircleAxisGrid, CircleCrosshair, ColorContinuousLegend, ContinuousPlayer, DEFAULT_ITEM_SPACE_COL, DEFAULT_ITEM_SPACE_ROW, DEFAULT_LABEL_SPACE, DEFAULT_PAGER_SPACE, DEFAULT_SHAPE_SIZE, DEFAULT_SHAPE_SPACE, DEFAULT_STATES$1 as DEFAULT_STATES, DEFAULT_TITLE_SPACE, DEFAULT_VALUE_SPACE, DataLabel, DataZoom, DataZoomActiveTag, DirectionEnum, DiscreteLegend, DiscretePlayer, EmptyTip, GroupTransition, IMarkAreaLabelPosition, IMarkCommonArcLabelPosition, IMarkLineLabelPosition, IMarkPointItemPosition, IOperateType, Indicator, LEGEND_ELEMENT_NAME, LabelBase, LegendEvent, LegendStateValue, LineAxis, LineAxisGrid, LineCrosshair, LineLabel, LinkPath, MarkArcArea, MarkArcLine, MarkArea, MarkLine, MarkPoint, Pager, PlayerEventEnum, PolygonCrosshair, PolygonSectorCrosshair, PopTip, Radio, RectCrosshair, RectLabel, SLIDER_ELEMENT_NAME, ScrollBar, SectorCrosshair, Segment, SizeContinuousLegend, Slider, StoryLabelItem, Switch, SymbolLabel, Tag, Timeline, Title, Tooltip, TopZIndex, VTag, WeatherBox, alignTextInLine, angle, angleLabelOrientAttribute, angleTo, cartesianTicks, clampRadian, computeOffsetForlimit, continuousTicks, contrastAccessibilityChecker, convertDomainToTickData, createTextGraphicByType, deltaXYToAngle, fuzzyEqualNumber, getAxisBreakSymbolAttrs, getCircleLabelPosition, getCirclePoints, getCircleVerticalVector, getElMap, getHorizontalPath, getMarksByName, getNoneGroupMarksByName, getPolarAngleLabelPosition, getPolygonPath, getSizeHandlerPath, getTextAlignAttrOfVerticalDir, getTextType, getVerticalCoord, getVerticalPath, hasOverlap, htmlAttributeTransform, initTextMeasure, isInRange, isPostiveXAxis, isRichText, isVisible, labelSmartInvert, length, limitShapeInBounds, linearDiscreteTicks, loadPoptip, loadScrollbar, measureTextSize, normalize, polarAngleAxisDiscreteTicks, polarTicks, reactAttributeTransform, registerArcDataLabel, registerLineDataLabel, registerMarkArcAreaAnimate, registerMarkArcLineAnimate, registerMarkAreaAnimate, registerMarkLineAnimate, registerMarkPointAnimate, registerRectDataLabel, registerSymbolDataLabel, removeRepeatPoint, richTextAttributeTransform, scale, scrollbarModule, setPoptipTheme, smartInvertStrategy, tan2AngleToAngle, textIntersect, ticks, traverseGroup, version };
|
package/es/axis/util.js
CHANGED
package/es/brush/brush.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare class Brush extends AbstractComponent<Required<BrushAttributes>>
|
|
|
7
7
|
static defaultAttributes: {
|
|
8
8
|
trigger: string;
|
|
9
9
|
updateTrigger: string;
|
|
10
|
-
endTrigger: string;
|
|
10
|
+
endTrigger: string[];
|
|
11
11
|
resetTrigger: string;
|
|
12
12
|
hasMask: boolean;
|
|
13
13
|
brushMode: string;
|
|
@@ -23,17 +23,15 @@ export declare class Brush extends AbstractComponent<Required<BrushAttributes>>
|
|
|
23
23
|
delayType: string;
|
|
24
24
|
delayTime: number;
|
|
25
25
|
interactiveRange: {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
minY: number;
|
|
27
|
+
maxY: number;
|
|
28
|
+
minX: number;
|
|
29
|
+
maxX: number;
|
|
30
30
|
};
|
|
31
31
|
};
|
|
32
32
|
private _container;
|
|
33
33
|
private _activeDrawState;
|
|
34
34
|
private _cacheDrawPoints;
|
|
35
|
-
private _isDrawedBeforeEnd;
|
|
36
|
-
private _isDownBeforeUpOutside;
|
|
37
35
|
private _activeMoveState;
|
|
38
36
|
private _operatingMaskMoveDx;
|
|
39
37
|
private _operatingMaskMoveDy;
|
|
@@ -42,9 +40,10 @@ export declare class Brush extends AbstractComponent<Required<BrushAttributes>>
|
|
|
42
40
|
private _cacheMovePoint;
|
|
43
41
|
private _operatingMask;
|
|
44
42
|
private _brushMaskAABBBoundsDict;
|
|
43
|
+
private _firstUpdate;
|
|
44
|
+
private _startPos;
|
|
45
45
|
constructor(attributes: BrushAttributes, options?: ComponentOptions);
|
|
46
46
|
private _bindBrushEvents;
|
|
47
|
-
private _isPosInBrushMask;
|
|
48
47
|
private _onBrushStart;
|
|
49
48
|
private _onBrushing;
|
|
50
49
|
private _onBrushingWithDelay;
|
|
@@ -54,13 +53,20 @@ export declare class Brush extends AbstractComponent<Required<BrushAttributes>>
|
|
|
54
53
|
private _initMove;
|
|
55
54
|
private _drawing;
|
|
56
55
|
private _moving;
|
|
56
|
+
private _drawEnd;
|
|
57
|
+
private _moveEnd;
|
|
58
|
+
protected render(): void;
|
|
59
|
+
releaseBrushEvents(): void;
|
|
60
|
+
private _releaseBrushUpdateEvents;
|
|
57
61
|
private _computeMaskPoints;
|
|
58
62
|
private _addBrushMask;
|
|
63
|
+
private _isPosInBrushMask;
|
|
59
64
|
private _outOfInteractiveRange;
|
|
60
65
|
protected eventPosToStagePos(e: FederatedPointerEvent): {
|
|
61
66
|
x: number;
|
|
62
67
|
y: number;
|
|
63
68
|
};
|
|
64
|
-
|
|
65
|
-
|
|
69
|
+
private _dispatchBrushEvent;
|
|
70
|
+
private _clearMask;
|
|
71
|
+
private _isEmptyMask;
|
|
66
72
|
}
|