@visactor/vchart 1.13.8-alpha.5 → 1.13.8-alpha.8
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 +2 -2
- package/build/index.es.js +53 -77
- package/build/index.js +53 -77
- package/build/index.min.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/constant/funnel.js +1 -2
- package/cjs/constant/sunburst.js +2 -1
- package/cjs/core/index.d.ts +1 -1
- package/cjs/core/index.js +2 -3
- package/cjs/core/index.js.map +1 -1
- package/cjs/core/vchart.js +2 -1
- package/esm/constant/funnel.js +1 -2
- package/esm/constant/sunburst.js +2 -1
- package/esm/core/index.d.ts +1 -1
- package/esm/core/index.js +2 -3
- package/esm/core/index.js.map +1 -1
- package/esm/core/vchart.js +2 -1
- package/package.json +16 -16
package/build/index.es.js
CHANGED
|
@@ -44398,7 +44398,7 @@ var IOperateType;
|
|
|
44398
44398
|
const DEFAULT_BRUSH_ATTRIBUTES = {
|
|
44399
44399
|
trigger: "pointerdown",
|
|
44400
44400
|
updateTrigger: "pointermove",
|
|
44401
|
-
endTrigger: "pointerup",
|
|
44401
|
+
endTrigger: ["pointerup", "pointerleave"],
|
|
44402
44402
|
resetTrigger: "pointerupoutside",
|
|
44403
44403
|
hasMask: !0,
|
|
44404
44404
|
brushMode: "single",
|
|
@@ -44436,41 +44436,22 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
44436
44436
|
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, Brush.defaultAttributes, attributes)), this.name = "brush", this._activeDrawState = !1, this._cacheDrawPoints = [], this._isDrawedBeforeEnd = !1, this._isDownBeforeUpOutside = !1, this._activeMoveState = !1, this._operatingMaskMoveDx = 0, this._operatingMaskMoveDy = 0, this._operatingMaskMoveRangeX = [-1 / 0, 1 / 0], this._operatingMaskMoveRangeY = [-1 / 0, 1 / 0], this._brushMaskAABBBoundsDict = {}, this._onBrushStart = e => {
|
|
44437
44437
|
var _a;
|
|
44438
44438
|
if (this._outOfInteractiveRange(e)) return void (this._isDownBeforeUpOutside = !0);
|
|
44439
|
-
e.stopPropagation();
|
|
44439
|
+
this._isDownBeforeUpOutside = !1, e.stopPropagation();
|
|
44440
44440
|
const brushMoved = null === (_a = this.attribute.brushMoved) || void 0 === _a || _a;
|
|
44441
44441
|
this._activeMoveState = brushMoved && this._isPosInBrushMask(e), this._activeDrawState = !this._activeMoveState, this._activeDrawState && this._initDraw(e), this._activeMoveState && this._initMove(e);
|
|
44442
44442
|
}, this._onBrushing = e => {
|
|
44443
44443
|
this._outOfInteractiveRange(e) || ((this._activeDrawState || this._activeMoveState) && e.stopPropagation(), this._activeDrawState && this._drawing(e), this._activeMoveState && this._moving(e));
|
|
44444
44444
|
}, this._onBrushingWithDelay = 0 === this.attribute.delayTime ? this._onBrushing : delayMap$1[this.attribute.delayType](this._onBrushing, this.attribute.delayTime), this._onBrushEnd = e => {
|
|
44445
44445
|
var _a;
|
|
44446
|
+
if (this._isDownBeforeUpOutside) return this._isEmptyMask() || (this._clearMask(), this._dispatchBrushEvent(IOperateType.brushClear, e)), void (this._isDownBeforeUpOutside = !1);
|
|
44446
44447
|
if (!this._activeDrawState && !this._activeMoveState) return;
|
|
44447
44448
|
e.preventDefault();
|
|
44448
44449
|
const {
|
|
44449
44450
|
removeOnClick = !0
|
|
44450
44451
|
} = this.attribute;
|
|
44451
|
-
this._activeDrawState && !this._isDrawedBeforeEnd && removeOnClick ? (
|
|
44452
|
-
operateMask: this._operatingMask,
|
|
44453
|
-
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
44454
|
-
event: e
|
|
44455
|
-
}), this._container.incrementalClearChild(), this._brushMaskAABBBoundsDict = {}) : (this._activeDrawState && this._dispatchEvent(IOperateType.drawEnd, {
|
|
44456
|
-
operateMask: this._operatingMask,
|
|
44457
|
-
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
44458
|
-
event: e
|
|
44459
|
-
}), this._activeMoveState && this._dispatchEvent(IOperateType.moveEnd, {
|
|
44460
|
-
operateMask: this._operatingMask,
|
|
44461
|
-
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
44462
|
-
event: e
|
|
44463
|
-
})), this._activeDrawState = !1, this._activeMoveState = !1, this._isDrawedBeforeEnd = !1, this._operatingMask && this._operatingMask.setAttribute("pickable", !1);
|
|
44452
|
+
this._activeDrawState && !this._isDrawedBeforeEnd && removeOnClick ? (null === (_a = this._operatingMask) || void 0 === _a ? void 0 : _a._AABBBounds.empty()) ? this._isEmptyMask() || (this._clearMask(), this._dispatchBrushEvent(IOperateType.brushClear, e)) : (delete this._brushMaskAABBBoundsDict[this._operatingMask.name], this._container.setAttributes({}), this._container.removeChild(this._operatingMask), this._isEmptyMask() ? this._dispatchBrushEvent(IOperateType.drawEnd, e) : this._dispatchBrushEvent(IOperateType.brushClear, e)) : (this._activeDrawState && this._dispatchBrushEvent(IOperateType.drawEnd, e), this._activeMoveState && this._dispatchBrushEvent(IOperateType.moveEnd, e)), this._activeDrawState = !1, this._activeMoveState = !1, this._isDrawedBeforeEnd = !1, this._operatingMask && this._operatingMask.setAttribute("pickable", !1);
|
|
44464
44453
|
}, this._onBrushClear = e => {
|
|
44465
|
-
e.preventDefault();
|
|
44466
|
-
const {
|
|
44467
|
-
removeOnClick = !0
|
|
44468
|
-
} = this.attribute;
|
|
44469
|
-
this._isDownBeforeUpOutside && removeOnClick && (this._dispatchEvent(IOperateType.brushClear, {
|
|
44470
|
-
operateMask: this._operatingMask,
|
|
44471
|
-
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
44472
|
-
event: e
|
|
44473
|
-
}), this._container.incrementalClearChild(), this._brushMaskAABBBoundsDict = {}), this._activeDrawState = !1, this._activeMoveState = !1, this._isDrawedBeforeEnd = !1, this._isDownBeforeUpOutside = !1, this._operatingMask && this._operatingMask.setAttribute("pickable", !1);
|
|
44454
|
+
e.preventDefault(), this._isEmptyMask() || (this._clearMask(), this._dispatchBrushEvent(IOperateType.brushClear, e)), this._activeDrawState = !1, this._activeMoveState = !1, this._isDrawedBeforeEnd = !1, this._isDownBeforeUpOutside = !1;
|
|
44474
44455
|
};
|
|
44475
44456
|
}
|
|
44476
44457
|
_bindBrushEvents() {
|
|
@@ -44481,35 +44462,14 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
44481
44462
|
endTrigger = DEFAULT_BRUSH_ATTRIBUTES.endTrigger,
|
|
44482
44463
|
resetTrigger = DEFAULT_BRUSH_ATTRIBUTES.resetTrigger
|
|
44483
44464
|
} = this.attribute;
|
|
44484
|
-
array(trigger).forEach(t =>
|
|
44485
|
-
}
|
|
44486
|
-
_isPosInBrushMask(e) {
|
|
44487
|
-
const pos = this.eventPosToStagePos(e),
|
|
44488
|
-
brushMasks = this._container.getChildren();
|
|
44489
|
-
for (let i = 0; i < brushMasks.length; i++) {
|
|
44490
|
-
const {
|
|
44491
|
-
points = [],
|
|
44492
|
-
dx = 0,
|
|
44493
|
-
dy = 0
|
|
44494
|
-
} = brushMasks[i].attribute,
|
|
44495
|
-
pointsConsiderOffset = points.map(point => ({
|
|
44496
|
-
x: point.x + dx,
|
|
44497
|
-
y: point.y + dy
|
|
44498
|
-
}));
|
|
44499
|
-
if (polygonContainPoint(pointsConsiderOffset, pos.x, pos.y)) return this._operatingMask = brushMasks[i], !0;
|
|
44500
|
-
}
|
|
44501
|
-
return !1;
|
|
44465
|
+
array(trigger).forEach(t => this.stage.addEventListener(t, this._onBrushStart)), array(updateTrigger).forEach(t => this.stage.addEventListener(t, this._onBrushingWithDelay)), array(endTrigger).forEach(t => this.stage.addEventListener(t, this._onBrushEnd)), array(resetTrigger).forEach(t => this.stage.addEventListener(t, this._onBrushClear));
|
|
44502
44466
|
}
|
|
44503
44467
|
_initDraw(e) {
|
|
44504
44468
|
const {
|
|
44505
44469
|
brushMode: brushMode
|
|
44506
44470
|
} = this.attribute,
|
|
44507
44471
|
pos = this.eventPosToStagePos(e);
|
|
44508
|
-
this._cacheDrawPoints = [pos], this._isDrawedBeforeEnd = !1, "single" === brushMode &&
|
|
44509
|
-
operateMask: this._operatingMask,
|
|
44510
|
-
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
44511
|
-
event: e
|
|
44512
|
-
});
|
|
44472
|
+
this._cacheDrawPoints = [pos], this._isDrawedBeforeEnd = !1, "single" === brushMode && this._clearMask(), this._addBrushMask(), this._dispatchBrushEvent(IOperateType.drawStart, e);
|
|
44513
44473
|
}
|
|
44514
44474
|
_initMove(e) {
|
|
44515
44475
|
var _a, _b;
|
|
@@ -44533,11 +44493,7 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
44533
44493
|
maxMoveStepX = maxX - x2,
|
|
44534
44494
|
minMoveStepY = minY - y1,
|
|
44535
44495
|
maxMoveStepY = maxY - y2;
|
|
44536
|
-
this._operatingMaskMoveRangeX = [minMoveStepX, maxMoveStepX], this._operatingMaskMoveRangeY = [minMoveStepY, maxMoveStepY], this._operatingMask.setAttribute("pickable", !0), this.
|
|
44537
|
-
operateMask: this._operatingMask,
|
|
44538
|
-
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
44539
|
-
event: e
|
|
44540
|
-
});
|
|
44496
|
+
this._operatingMaskMoveRangeX = [minMoveStepX, maxMoveStepX], this._operatingMaskMoveRangeY = [minMoveStepY, maxMoveStepY], this._operatingMask.setAttribute("pickable", !0), this._dispatchBrushEvent(IOperateType.moveStart, e);
|
|
44541
44497
|
}
|
|
44542
44498
|
_drawing(e) {
|
|
44543
44499
|
var _a, _b;
|
|
@@ -44560,11 +44516,7 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
44560
44516
|
y1 = 0,
|
|
44561
44517
|
y2 = 0
|
|
44562
44518
|
} = null === (_b = this._operatingMask) || void 0 === _b ? void 0 : _b._AABBBounds;
|
|
44563
|
-
this._isDrawedBeforeEnd = !this._operatingMask._AABBBounds.empty() && !!(Math.abs(x2 - x1) > sizeThreshold || Math.abs(y1 - y2) > sizeThreshold), this._isDrawedBeforeEnd && (this._brushMaskAABBBoundsDict[this._operatingMask.name] = this._operatingMask.AABBBounds, this.
|
|
44564
|
-
operateMask: this._operatingMask,
|
|
44565
|
-
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
44566
|
-
event: e
|
|
44567
|
-
}));
|
|
44519
|
+
this._isDrawedBeforeEnd = !this._operatingMask._AABBBounds.empty() && !!(Math.abs(x2 - x1) > sizeThreshold || Math.abs(y1 - y2) > sizeThreshold), this._isDrawedBeforeEnd && (this._brushMaskAABBBoundsDict[this._operatingMask.name] = this._operatingMask.AABBBounds), this._dispatchBrushEvent(IOperateType.drawing, e);
|
|
44568
44520
|
}
|
|
44569
44521
|
_moving(e) {
|
|
44570
44522
|
const startPos = this._cacheMovePoint,
|
|
@@ -44577,11 +44529,21 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
44577
44529
|
this._operatingMask.setAttributes({
|
|
44578
44530
|
dx: moveX,
|
|
44579
44531
|
dy: moveY
|
|
44580
|
-
}), this._brushMaskAABBBoundsDict[this._operatingMask.name] = this._operatingMask.AABBBounds, this.
|
|
44581
|
-
|
|
44582
|
-
|
|
44583
|
-
|
|
44584
|
-
});
|
|
44532
|
+
}), this._brushMaskAABBBoundsDict[this._operatingMask.name] = this._operatingMask.AABBBounds, this._dispatchBrushEvent(IOperateType.moving, e);
|
|
44533
|
+
}
|
|
44534
|
+
render() {
|
|
44535
|
+
this.releaseBrushEvents(), this._bindBrushEvents();
|
|
44536
|
+
const group = this.createOrUpdateChild("brush-container", {}, "group");
|
|
44537
|
+
this._container = group;
|
|
44538
|
+
}
|
|
44539
|
+
releaseBrushEvents() {
|
|
44540
|
+
const {
|
|
44541
|
+
trigger = DEFAULT_BRUSH_ATTRIBUTES.trigger,
|
|
44542
|
+
updateTrigger = DEFAULT_BRUSH_ATTRIBUTES.updateTrigger,
|
|
44543
|
+
endTrigger = DEFAULT_BRUSH_ATTRIBUTES.endTrigger,
|
|
44544
|
+
resetTrigger = DEFAULT_BRUSH_ATTRIBUTES.resetTrigger
|
|
44545
|
+
} = this.attribute;
|
|
44546
|
+
array(trigger).forEach(t => this.stage.removeEventListener(t, this._onBrushStart)), array(updateTrigger).forEach(t => this.stage.removeEventListener(t, this._onBrushingWithDelay)), array(endTrigger).forEach(t => this.stage.removeEventListener(t, this._onBrushEnd)), array(resetTrigger).forEach(t => this.stage.removeEventListener(t, this._onBrushClear));
|
|
44585
44547
|
}
|
|
44586
44548
|
_computeMaskPoints() {
|
|
44587
44549
|
const {
|
|
@@ -44639,6 +44601,23 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
44639
44601
|
}));
|
|
44640
44602
|
brushMask.name = `brush-${Date.now()}`, this._operatingMask = brushMask, this._container.add(brushMask), this._brushMaskAABBBoundsDict[brushMask.name] = brushMask.AABBBounds;
|
|
44641
44603
|
}
|
|
44604
|
+
_isPosInBrushMask(e) {
|
|
44605
|
+
const pos = this.eventPosToStagePos(e),
|
|
44606
|
+
brushMasks = this._container.getChildren();
|
|
44607
|
+
for (let i = 0; i < brushMasks.length; i++) {
|
|
44608
|
+
const {
|
|
44609
|
+
points = [],
|
|
44610
|
+
dx = 0,
|
|
44611
|
+
dy = 0
|
|
44612
|
+
} = brushMasks[i].attribute,
|
|
44613
|
+
pointsConsiderOffset = points.map(point => ({
|
|
44614
|
+
x: point.x + dx,
|
|
44615
|
+
y: point.y + dy
|
|
44616
|
+
}));
|
|
44617
|
+
if (polygonContainPoint(pointsConsiderOffset, pos.x, pos.y)) return this._operatingMask = brushMasks[i], !0;
|
|
44618
|
+
}
|
|
44619
|
+
return !1;
|
|
44620
|
+
}
|
|
44642
44621
|
_outOfInteractiveRange(e) {
|
|
44643
44622
|
const {
|
|
44644
44623
|
interactiveRange: interactiveRange
|
|
@@ -44655,21 +44634,18 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
44655
44634
|
eventPosToStagePos(e) {
|
|
44656
44635
|
return this.stage.eventPointTransform(e);
|
|
44657
44636
|
}
|
|
44658
|
-
|
|
44659
|
-
this.
|
|
44660
|
-
|
|
44661
|
-
|
|
44637
|
+
_dispatchBrushEvent(operateType, e) {
|
|
44638
|
+
this._dispatchEvent(operateType, {
|
|
44639
|
+
operateMask: this._operatingMask,
|
|
44640
|
+
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
44641
|
+
event: e
|
|
44642
|
+
});
|
|
44662
44643
|
}
|
|
44663
|
-
|
|
44664
|
-
|
|
44665
|
-
|
|
44666
|
-
|
|
44667
|
-
|
|
44668
|
-
updateTrigger = DEFAULT_BRUSH_ATTRIBUTES.updateTrigger,
|
|
44669
|
-
endTrigger = DEFAULT_BRUSH_ATTRIBUTES.endTrigger,
|
|
44670
|
-
resetTrigger = DEFAULT_BRUSH_ATTRIBUTES.resetTrigger
|
|
44671
|
-
} = this.attribute;
|
|
44672
|
-
array(trigger).forEach(t => vglobal.removeEventListener(t, this._onBrushStart)), array(updateTrigger).forEach(t => this.stage.removeEventListener(t, this._onBrushingWithDelay)), array(endTrigger).forEach(t => this.stage.removeEventListener(t, this._onBrushEnd)), array(resetTrigger).forEach(t => this.stage.removeEventListener(t, this._onBrushClear));
|
|
44644
|
+
_clearMask() {
|
|
44645
|
+
this._brushMaskAABBBoundsDict = {}, this._container.incrementalClearChild(), this._operatingMask = null;
|
|
44646
|
+
}
|
|
44647
|
+
_isEmptyMask() {
|
|
44648
|
+
return isEmpty(this._brushMaskAABBBoundsDict) || Object.keys(this._brushMaskAABBBoundsDict).every(key => this._brushMaskAABBBoundsDict[key].empty());
|
|
44673
44649
|
}
|
|
44674
44650
|
};
|
|
44675
44651
|
Brush$1.defaultAttributes = DEFAULT_BRUSH_ATTRIBUTES;
|
|
@@ -63650,7 +63626,7 @@ const registerVChartCore = () => {
|
|
|
63650
63626
|
};
|
|
63651
63627
|
registerVChartCore();
|
|
63652
63628
|
|
|
63653
|
-
const version = "1.13.8-alpha.
|
|
63629
|
+
const version = "1.13.8-alpha.8";
|
|
63654
63630
|
|
|
63655
63631
|
const addVChartProperty = (data, op) => {
|
|
63656
63632
|
const context = op.beforeCall();
|
package/build/index.js
CHANGED
|
@@ -44404,7 +44404,7 @@
|
|
|
44404
44404
|
const DEFAULT_BRUSH_ATTRIBUTES = {
|
|
44405
44405
|
trigger: "pointerdown",
|
|
44406
44406
|
updateTrigger: "pointermove",
|
|
44407
|
-
endTrigger: "pointerup",
|
|
44407
|
+
endTrigger: ["pointerup", "pointerleave"],
|
|
44408
44408
|
resetTrigger: "pointerupoutside",
|
|
44409
44409
|
hasMask: !0,
|
|
44410
44410
|
brushMode: "single",
|
|
@@ -44442,41 +44442,22 @@
|
|
|
44442
44442
|
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, Brush.defaultAttributes, attributes)), this.name = "brush", this._activeDrawState = !1, this._cacheDrawPoints = [], this._isDrawedBeforeEnd = !1, this._isDownBeforeUpOutside = !1, this._activeMoveState = !1, this._operatingMaskMoveDx = 0, this._operatingMaskMoveDy = 0, this._operatingMaskMoveRangeX = [-1 / 0, 1 / 0], this._operatingMaskMoveRangeY = [-1 / 0, 1 / 0], this._brushMaskAABBBoundsDict = {}, this._onBrushStart = e => {
|
|
44443
44443
|
var _a;
|
|
44444
44444
|
if (this._outOfInteractiveRange(e)) return void (this._isDownBeforeUpOutside = !0);
|
|
44445
|
-
e.stopPropagation();
|
|
44445
|
+
this._isDownBeforeUpOutside = !1, e.stopPropagation();
|
|
44446
44446
|
const brushMoved = null === (_a = this.attribute.brushMoved) || void 0 === _a || _a;
|
|
44447
44447
|
this._activeMoveState = brushMoved && this._isPosInBrushMask(e), this._activeDrawState = !this._activeMoveState, this._activeDrawState && this._initDraw(e), this._activeMoveState && this._initMove(e);
|
|
44448
44448
|
}, this._onBrushing = e => {
|
|
44449
44449
|
this._outOfInteractiveRange(e) || ((this._activeDrawState || this._activeMoveState) && e.stopPropagation(), this._activeDrawState && this._drawing(e), this._activeMoveState && this._moving(e));
|
|
44450
44450
|
}, this._onBrushingWithDelay = 0 === this.attribute.delayTime ? this._onBrushing : delayMap$1[this.attribute.delayType](this._onBrushing, this.attribute.delayTime), this._onBrushEnd = e => {
|
|
44451
44451
|
var _a;
|
|
44452
|
+
if (this._isDownBeforeUpOutside) return this._isEmptyMask() || (this._clearMask(), this._dispatchBrushEvent(IOperateType.brushClear, e)), void (this._isDownBeforeUpOutside = !1);
|
|
44452
44453
|
if (!this._activeDrawState && !this._activeMoveState) return;
|
|
44453
44454
|
e.preventDefault();
|
|
44454
44455
|
const {
|
|
44455
44456
|
removeOnClick = !0
|
|
44456
44457
|
} = this.attribute;
|
|
44457
|
-
this._activeDrawState && !this._isDrawedBeforeEnd && removeOnClick ? (
|
|
44458
|
-
operateMask: this._operatingMask,
|
|
44459
|
-
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
44460
|
-
event: e
|
|
44461
|
-
}), this._container.incrementalClearChild(), this._brushMaskAABBBoundsDict = {}) : (this._activeDrawState && this._dispatchEvent(IOperateType.drawEnd, {
|
|
44462
|
-
operateMask: this._operatingMask,
|
|
44463
|
-
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
44464
|
-
event: e
|
|
44465
|
-
}), this._activeMoveState && this._dispatchEvent(IOperateType.moveEnd, {
|
|
44466
|
-
operateMask: this._operatingMask,
|
|
44467
|
-
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
44468
|
-
event: e
|
|
44469
|
-
})), this._activeDrawState = !1, this._activeMoveState = !1, this._isDrawedBeforeEnd = !1, this._operatingMask && this._operatingMask.setAttribute("pickable", !1);
|
|
44458
|
+
this._activeDrawState && !this._isDrawedBeforeEnd && removeOnClick ? (null === (_a = this._operatingMask) || void 0 === _a ? void 0 : _a._AABBBounds.empty()) ? this._isEmptyMask() || (this._clearMask(), this._dispatchBrushEvent(IOperateType.brushClear, e)) : (delete this._brushMaskAABBBoundsDict[this._operatingMask.name], this._container.setAttributes({}), this._container.removeChild(this._operatingMask), this._isEmptyMask() ? this._dispatchBrushEvent(IOperateType.drawEnd, e) : this._dispatchBrushEvent(IOperateType.brushClear, e)) : (this._activeDrawState && this._dispatchBrushEvent(IOperateType.drawEnd, e), this._activeMoveState && this._dispatchBrushEvent(IOperateType.moveEnd, e)), this._activeDrawState = !1, this._activeMoveState = !1, this._isDrawedBeforeEnd = !1, this._operatingMask && this._operatingMask.setAttribute("pickable", !1);
|
|
44470
44459
|
}, this._onBrushClear = e => {
|
|
44471
|
-
e.preventDefault();
|
|
44472
|
-
const {
|
|
44473
|
-
removeOnClick = !0
|
|
44474
|
-
} = this.attribute;
|
|
44475
|
-
this._isDownBeforeUpOutside && removeOnClick && (this._dispatchEvent(IOperateType.brushClear, {
|
|
44476
|
-
operateMask: this._operatingMask,
|
|
44477
|
-
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
44478
|
-
event: e
|
|
44479
|
-
}), this._container.incrementalClearChild(), this._brushMaskAABBBoundsDict = {}), this._activeDrawState = !1, this._activeMoveState = !1, this._isDrawedBeforeEnd = !1, this._isDownBeforeUpOutside = !1, this._operatingMask && this._operatingMask.setAttribute("pickable", !1);
|
|
44460
|
+
e.preventDefault(), this._isEmptyMask() || (this._clearMask(), this._dispatchBrushEvent(IOperateType.brushClear, e)), this._activeDrawState = !1, this._activeMoveState = !1, this._isDrawedBeforeEnd = !1, this._isDownBeforeUpOutside = !1;
|
|
44480
44461
|
};
|
|
44481
44462
|
}
|
|
44482
44463
|
_bindBrushEvents() {
|
|
@@ -44487,35 +44468,14 @@
|
|
|
44487
44468
|
endTrigger = DEFAULT_BRUSH_ATTRIBUTES.endTrigger,
|
|
44488
44469
|
resetTrigger = DEFAULT_BRUSH_ATTRIBUTES.resetTrigger
|
|
44489
44470
|
} = this.attribute;
|
|
44490
|
-
array(trigger).forEach(t =>
|
|
44491
|
-
}
|
|
44492
|
-
_isPosInBrushMask(e) {
|
|
44493
|
-
const pos = this.eventPosToStagePos(e),
|
|
44494
|
-
brushMasks = this._container.getChildren();
|
|
44495
|
-
for (let i = 0; i < brushMasks.length; i++) {
|
|
44496
|
-
const {
|
|
44497
|
-
points = [],
|
|
44498
|
-
dx = 0,
|
|
44499
|
-
dy = 0
|
|
44500
|
-
} = brushMasks[i].attribute,
|
|
44501
|
-
pointsConsiderOffset = points.map(point => ({
|
|
44502
|
-
x: point.x + dx,
|
|
44503
|
-
y: point.y + dy
|
|
44504
|
-
}));
|
|
44505
|
-
if (polygonContainPoint(pointsConsiderOffset, pos.x, pos.y)) return this._operatingMask = brushMasks[i], !0;
|
|
44506
|
-
}
|
|
44507
|
-
return !1;
|
|
44471
|
+
array(trigger).forEach(t => this.stage.addEventListener(t, this._onBrushStart)), array(updateTrigger).forEach(t => this.stage.addEventListener(t, this._onBrushingWithDelay)), array(endTrigger).forEach(t => this.stage.addEventListener(t, this._onBrushEnd)), array(resetTrigger).forEach(t => this.stage.addEventListener(t, this._onBrushClear));
|
|
44508
44472
|
}
|
|
44509
44473
|
_initDraw(e) {
|
|
44510
44474
|
const {
|
|
44511
44475
|
brushMode: brushMode
|
|
44512
44476
|
} = this.attribute,
|
|
44513
44477
|
pos = this.eventPosToStagePos(e);
|
|
44514
|
-
this._cacheDrawPoints = [pos], this._isDrawedBeforeEnd = !1, "single" === brushMode &&
|
|
44515
|
-
operateMask: this._operatingMask,
|
|
44516
|
-
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
44517
|
-
event: e
|
|
44518
|
-
});
|
|
44478
|
+
this._cacheDrawPoints = [pos], this._isDrawedBeforeEnd = !1, "single" === brushMode && this._clearMask(), this._addBrushMask(), this._dispatchBrushEvent(IOperateType.drawStart, e);
|
|
44519
44479
|
}
|
|
44520
44480
|
_initMove(e) {
|
|
44521
44481
|
var _a, _b;
|
|
@@ -44539,11 +44499,7 @@
|
|
|
44539
44499
|
maxMoveStepX = maxX - x2,
|
|
44540
44500
|
minMoveStepY = minY - y1,
|
|
44541
44501
|
maxMoveStepY = maxY - y2;
|
|
44542
|
-
this._operatingMaskMoveRangeX = [minMoveStepX, maxMoveStepX], this._operatingMaskMoveRangeY = [minMoveStepY, maxMoveStepY], this._operatingMask.setAttribute("pickable", !0), this.
|
|
44543
|
-
operateMask: this._operatingMask,
|
|
44544
|
-
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
44545
|
-
event: e
|
|
44546
|
-
});
|
|
44502
|
+
this._operatingMaskMoveRangeX = [minMoveStepX, maxMoveStepX], this._operatingMaskMoveRangeY = [minMoveStepY, maxMoveStepY], this._operatingMask.setAttribute("pickable", !0), this._dispatchBrushEvent(IOperateType.moveStart, e);
|
|
44547
44503
|
}
|
|
44548
44504
|
_drawing(e) {
|
|
44549
44505
|
var _a, _b;
|
|
@@ -44566,11 +44522,7 @@
|
|
|
44566
44522
|
y1 = 0,
|
|
44567
44523
|
y2 = 0
|
|
44568
44524
|
} = null === (_b = this._operatingMask) || void 0 === _b ? void 0 : _b._AABBBounds;
|
|
44569
|
-
this._isDrawedBeforeEnd = !this._operatingMask._AABBBounds.empty() && !!(Math.abs(x2 - x1) > sizeThreshold || Math.abs(y1 - y2) > sizeThreshold), this._isDrawedBeforeEnd && (this._brushMaskAABBBoundsDict[this._operatingMask.name] = this._operatingMask.AABBBounds, this.
|
|
44570
|
-
operateMask: this._operatingMask,
|
|
44571
|
-
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
44572
|
-
event: e
|
|
44573
|
-
}));
|
|
44525
|
+
this._isDrawedBeforeEnd = !this._operatingMask._AABBBounds.empty() && !!(Math.abs(x2 - x1) > sizeThreshold || Math.abs(y1 - y2) > sizeThreshold), this._isDrawedBeforeEnd && (this._brushMaskAABBBoundsDict[this._operatingMask.name] = this._operatingMask.AABBBounds), this._dispatchBrushEvent(IOperateType.drawing, e);
|
|
44574
44526
|
}
|
|
44575
44527
|
_moving(e) {
|
|
44576
44528
|
const startPos = this._cacheMovePoint,
|
|
@@ -44583,11 +44535,21 @@
|
|
|
44583
44535
|
this._operatingMask.setAttributes({
|
|
44584
44536
|
dx: moveX,
|
|
44585
44537
|
dy: moveY
|
|
44586
|
-
}), this._brushMaskAABBBoundsDict[this._operatingMask.name] = this._operatingMask.AABBBounds, this.
|
|
44587
|
-
|
|
44588
|
-
|
|
44589
|
-
|
|
44590
|
-
});
|
|
44538
|
+
}), this._brushMaskAABBBoundsDict[this._operatingMask.name] = this._operatingMask.AABBBounds, this._dispatchBrushEvent(IOperateType.moving, e);
|
|
44539
|
+
}
|
|
44540
|
+
render() {
|
|
44541
|
+
this.releaseBrushEvents(), this._bindBrushEvents();
|
|
44542
|
+
const group = this.createOrUpdateChild("brush-container", {}, "group");
|
|
44543
|
+
this._container = group;
|
|
44544
|
+
}
|
|
44545
|
+
releaseBrushEvents() {
|
|
44546
|
+
const {
|
|
44547
|
+
trigger = DEFAULT_BRUSH_ATTRIBUTES.trigger,
|
|
44548
|
+
updateTrigger = DEFAULT_BRUSH_ATTRIBUTES.updateTrigger,
|
|
44549
|
+
endTrigger = DEFAULT_BRUSH_ATTRIBUTES.endTrigger,
|
|
44550
|
+
resetTrigger = DEFAULT_BRUSH_ATTRIBUTES.resetTrigger
|
|
44551
|
+
} = this.attribute;
|
|
44552
|
+
array(trigger).forEach(t => this.stage.removeEventListener(t, this._onBrushStart)), array(updateTrigger).forEach(t => this.stage.removeEventListener(t, this._onBrushingWithDelay)), array(endTrigger).forEach(t => this.stage.removeEventListener(t, this._onBrushEnd)), array(resetTrigger).forEach(t => this.stage.removeEventListener(t, this._onBrushClear));
|
|
44591
44553
|
}
|
|
44592
44554
|
_computeMaskPoints() {
|
|
44593
44555
|
const {
|
|
@@ -44645,6 +44607,23 @@
|
|
|
44645
44607
|
}));
|
|
44646
44608
|
brushMask.name = `brush-${Date.now()}`, this._operatingMask = brushMask, this._container.add(brushMask), this._brushMaskAABBBoundsDict[brushMask.name] = brushMask.AABBBounds;
|
|
44647
44609
|
}
|
|
44610
|
+
_isPosInBrushMask(e) {
|
|
44611
|
+
const pos = this.eventPosToStagePos(e),
|
|
44612
|
+
brushMasks = this._container.getChildren();
|
|
44613
|
+
for (let i = 0; i < brushMasks.length; i++) {
|
|
44614
|
+
const {
|
|
44615
|
+
points = [],
|
|
44616
|
+
dx = 0,
|
|
44617
|
+
dy = 0
|
|
44618
|
+
} = brushMasks[i].attribute,
|
|
44619
|
+
pointsConsiderOffset = points.map(point => ({
|
|
44620
|
+
x: point.x + dx,
|
|
44621
|
+
y: point.y + dy
|
|
44622
|
+
}));
|
|
44623
|
+
if (polygonContainPoint(pointsConsiderOffset, pos.x, pos.y)) return this._operatingMask = brushMasks[i], !0;
|
|
44624
|
+
}
|
|
44625
|
+
return !1;
|
|
44626
|
+
}
|
|
44648
44627
|
_outOfInteractiveRange(e) {
|
|
44649
44628
|
const {
|
|
44650
44629
|
interactiveRange: interactiveRange
|
|
@@ -44661,21 +44640,18 @@
|
|
|
44661
44640
|
eventPosToStagePos(e) {
|
|
44662
44641
|
return this.stage.eventPointTransform(e);
|
|
44663
44642
|
}
|
|
44664
|
-
|
|
44665
|
-
this.
|
|
44666
|
-
|
|
44667
|
-
|
|
44643
|
+
_dispatchBrushEvent(operateType, e) {
|
|
44644
|
+
this._dispatchEvent(operateType, {
|
|
44645
|
+
operateMask: this._operatingMask,
|
|
44646
|
+
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
44647
|
+
event: e
|
|
44648
|
+
});
|
|
44668
44649
|
}
|
|
44669
|
-
|
|
44670
|
-
|
|
44671
|
-
|
|
44672
|
-
|
|
44673
|
-
|
|
44674
|
-
updateTrigger = DEFAULT_BRUSH_ATTRIBUTES.updateTrigger,
|
|
44675
|
-
endTrigger = DEFAULT_BRUSH_ATTRIBUTES.endTrigger,
|
|
44676
|
-
resetTrigger = DEFAULT_BRUSH_ATTRIBUTES.resetTrigger
|
|
44677
|
-
} = this.attribute;
|
|
44678
|
-
array(trigger).forEach(t => vglobal.removeEventListener(t, this._onBrushStart)), array(updateTrigger).forEach(t => this.stage.removeEventListener(t, this._onBrushingWithDelay)), array(endTrigger).forEach(t => this.stage.removeEventListener(t, this._onBrushEnd)), array(resetTrigger).forEach(t => this.stage.removeEventListener(t, this._onBrushClear));
|
|
44650
|
+
_clearMask() {
|
|
44651
|
+
this._brushMaskAABBBoundsDict = {}, this._container.incrementalClearChild(), this._operatingMask = null;
|
|
44652
|
+
}
|
|
44653
|
+
_isEmptyMask() {
|
|
44654
|
+
return isEmpty(this._brushMaskAABBBoundsDict) || Object.keys(this._brushMaskAABBBoundsDict).every(key => this._brushMaskAABBBoundsDict[key].empty());
|
|
44679
44655
|
}
|
|
44680
44656
|
};
|
|
44681
44657
|
Brush$1.defaultAttributes = DEFAULT_BRUSH_ATTRIBUTES;
|
|
@@ -63656,7 +63632,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
63656
63632
|
};
|
|
63657
63633
|
registerVChartCore();
|
|
63658
63634
|
|
|
63659
|
-
const version = "1.13.8-alpha.
|
|
63635
|
+
const version = "1.13.8-alpha.8";
|
|
63660
63636
|
|
|
63661
63637
|
const addVChartProperty = (data, op) => {
|
|
63662
63638
|
const context = op.beforeCall();
|