@visactor/vchart 2.0.13-alpha.1 → 2.0.13-alpha.2
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 +19 -5
- package/build/index.js +19 -5
- package/build/index.min.js +2 -2
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/compile/compiler.d.ts +1 -0
- package/cjs/compile/compiler.js +3 -0
- package/cjs/compile/compiler.js.map +1 -1
- package/cjs/compile/interface/compilable-item.d.ts +2 -1
- package/cjs/compile/interface/compilable-item.js.map +1 -1
- package/cjs/component/brush/brush.d.ts +3 -1
- package/cjs/component/brush/brush.js +8 -2
- package/cjs/component/brush/brush.js.map +1 -1
- package/esm/compile/compiler.d.ts +1 -0
- package/esm/compile/compiler.js +3 -0
- package/esm/compile/compiler.js.map +1 -1
- package/esm/compile/interface/compilable-item.d.ts +2 -1
- package/esm/compile/interface/compilable-item.js.map +1 -1
- package/esm/component/brush/brush.d.ts +3 -1
- package/esm/component/brush/brush.js +8 -2
- package/esm/component/brush/brush.js.map +1 -1
- package/package.json +9 -9
package/build/index.es.js
CHANGED
|
@@ -51096,6 +51096,7 @@ loadBrushComponent();
|
|
|
51096
51096
|
let Brush$1 = class Brush extends AbstractComponent {
|
|
51097
51097
|
constructor(attributes, options) {
|
|
51098
51098
|
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, Brush.defaultAttributes, attributes)), this.name = "brush", this._activeBrushState = !1, this._activeDrawState = !1, this._cacheDrawPoints = [], this._activeMoveState = !1, this._operatingMaskMoveDx = 0, this._operatingMaskMoveDy = 0, this._operatingMaskMoveRangeX = [-1 / 0, 1 / 0], this._operatingMaskMoveRangeY = [-1 / 0, 1 / 0], this._brushMaskAABBBoundsDict = {}, this._firstUpdate = !0, this._onBrushStart = e => {
|
|
51099
|
+
if (!1 === this.attribute.interactive) return;
|
|
51099
51100
|
if (!1 === this._beforeBrushEvent(e)) return;
|
|
51100
51101
|
const {
|
|
51101
51102
|
updateTrigger = DEFAULT_BRUSH_ATTRIBUTES.updateTrigger,
|
|
@@ -51104,11 +51105,11 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
51104
51105
|
} = this.attribute;
|
|
51105
51106
|
array(updateTrigger).forEach(t => this.stage.addEventListener(t, this._onBrushingWithDelay)), array(endTrigger).forEach(t => this.stage.addEventListener(t, this._onBrushEnd)), e.stopPropagation(), this._firstUpdate = !0, this._activeMoveState = brushMoved && this._isPosInBrushMask(e), this._activeDrawState = !this._activeMoveState, this._startPos = this.eventPosToStagePos(e), this._cacheDrawPoints = [this._startPos];
|
|
51106
51107
|
}, this._onBrushing = e => {
|
|
51107
|
-
!1 !== this._beforeBrushEvent(e) && (this._outOfInteractiveRange(e) || (e.stopPropagation(), this._firstUpdate ? (this._activeDrawState && this._initDraw(e), this._activeMoveState && this._initMove(e), this._firstUpdate = !1) : (this._activeDrawState && this._drawing(e), this._activeMoveState && this._moving(e))));
|
|
51108
|
+
!1 !== this.attribute.interactive && !1 !== this._beforeBrushEvent(e) && (this._outOfInteractiveRange(e) || (e.stopPropagation(), this._firstUpdate ? (this._activeDrawState && this._initDraw(e), this._activeMoveState && this._initMove(e), this._firstUpdate = !1) : (this._activeDrawState && this._drawing(e), this._activeMoveState && this._moving(e))));
|
|
51108
51109
|
}, this._onBrushingWithDelay = 0 === this.attribute.delayTime ? this._onBrushing : delayMap$1[this.attribute.delayType](this._onBrushing, this.attribute.delayTime), this._onBrushEnd = e => {
|
|
51109
|
-
this._releaseBrushUpdateEvents(), e.preventDefault(), this._activeDrawState && this._drawEnd(e), this._activeMoveState && this._moveEnd(e), this._activeDrawState = !1, this._activeMoveState = !1;
|
|
51110
|
+
!1 !== this.attribute.interactive && (this._releaseBrushUpdateEvents(), e.preventDefault(), this._activeDrawState && this._drawEnd(e), this._activeMoveState && this._moveEnd(e), this._activeDrawState = !1, this._activeMoveState = !1);
|
|
51110
51111
|
}, this._onBrushClear = e => {
|
|
51111
|
-
!1 !== this._beforeBrushEvent(e) && (e.preventDefault(), this._isEmptyMask() || (this._clearMask(), this._dispatchBrushEvent(IOperateType.brushClear, e)), this._activeDrawState = !1, this._activeMoveState = !1);
|
|
51112
|
+
!1 !== this.attribute.interactive && !1 !== this._beforeBrushEvent(e) && (e.preventDefault(), this._isEmptyMask() || (this._clearMask(), this._dispatchBrushEvent(IOperateType.brushClear, e)), this._activeDrawState = !1, this._activeMoveState = !1);
|
|
51112
51113
|
};
|
|
51113
51114
|
}
|
|
51114
51115
|
_bindBrushEvents() {
|
|
@@ -51120,6 +51121,7 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
51120
51121
|
array(trigger).forEach(t => this.stage.addEventListener(t, this._onBrushStart)), array(resetTrigger).forEach(t => this.stage.addEventListener(t, this._onBrushClear));
|
|
51121
51122
|
}
|
|
51122
51123
|
_initDraw(e) {
|
|
51124
|
+
if (!1 === this.attribute.interactive) return;
|
|
51123
51125
|
const {
|
|
51124
51126
|
brushMode: brushMode
|
|
51125
51127
|
} = this.attribute,
|
|
@@ -51128,6 +51130,7 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
51128
51130
|
}
|
|
51129
51131
|
_initMove(e) {
|
|
51130
51132
|
var _a, _b;
|
|
51133
|
+
if (!1 === this.attribute.interactive) return;
|
|
51131
51134
|
this._cacheMovePoint = this.eventPosToStagePos(e), this._operatingMaskMoveDx = null !== (_a = this._operatingMask.attribute.dx) && void 0 !== _a ? _a : 0, this._operatingMaskMoveDy = null !== (_b = this._operatingMask.attribute.dy) && void 0 !== _b ? _b : 0;
|
|
51132
51135
|
const {
|
|
51133
51136
|
interactiveRange: interactiveRange
|
|
@@ -51152,6 +51155,7 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
51152
51155
|
}
|
|
51153
51156
|
_drawing(e) {
|
|
51154
51157
|
var _a;
|
|
51158
|
+
if (!1 === this.attribute.interactive) return;
|
|
51155
51159
|
const pos = this.eventPosToStagePos(e),
|
|
51156
51160
|
{
|
|
51157
51161
|
brushType: brushType,
|
|
@@ -51176,6 +51180,7 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
51176
51180
|
(Math.abs(x2 - x1) > sizeThreshold || Math.abs(y1 - y2) > sizeThreshold) && (1 !== Object.keys(this._brushMaskAABBBoundsDict).length || this._activeBrushState ? this._dispatchBrushEvent(IOperateType.drawing, e) : (this._activeBrushState = !0, this._dispatchBrushEvent(IOperateType.brushActive, e)));
|
|
51177
51181
|
}
|
|
51178
51182
|
_moving(e) {
|
|
51183
|
+
if (!1 === this.attribute.interactive) return;
|
|
51179
51184
|
const startPos = this._cacheMovePoint,
|
|
51180
51185
|
pos = this.eventPosToStagePos(e);
|
|
51181
51186
|
if (pos.x === (null == startPos ? void 0 : startPos.x) && pos.y === (null == startPos ? void 0 : startPos.y)) return;
|
|
@@ -51189,6 +51194,7 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
51189
51194
|
}), this._brushMaskAABBBoundsDict[this._operatingMask.name] = this._operatingMask.AABBBounds, this._dispatchBrushEvent(IOperateType.moving, e);
|
|
51190
51195
|
}
|
|
51191
51196
|
_drawEnd(e) {
|
|
51197
|
+
if (!1 === this.attribute.interactive) return;
|
|
51192
51198
|
const {
|
|
51193
51199
|
removeOnClick = !0,
|
|
51194
51200
|
sizeThreshold = DEFAULT_SIZE_THRESHOLD
|
|
@@ -51206,7 +51212,7 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
51206
51212
|
}
|
|
51207
51213
|
}
|
|
51208
51214
|
_moveEnd(e) {
|
|
51209
|
-
this._operatingMask && this._operatingMask.setAttribute("pickable", !1), this._dispatchBrushEvent(IOperateType.moveEnd, e);
|
|
51215
|
+
!1 !== this.attribute.interactive && (this._operatingMask && this._operatingMask.setAttribute("pickable", !1), this._dispatchBrushEvent(IOperateType.moveEnd, e));
|
|
51210
51216
|
}
|
|
51211
51217
|
render() {
|
|
51212
51218
|
this._bindBrushEvents();
|
|
@@ -54899,6 +54905,9 @@ class Compiler {
|
|
|
54899
54905
|
getRootGroup() {
|
|
54900
54906
|
return this._rootGroup;
|
|
54901
54907
|
}
|
|
54908
|
+
getOption() {
|
|
54909
|
+
return this._option;
|
|
54910
|
+
}
|
|
54902
54911
|
constructor(container, option) {
|
|
54903
54912
|
this._count = 0;
|
|
54904
54913
|
this._rootMarks = [];
|
|
@@ -103201,6 +103210,9 @@ class Brush extends BaseComponent {
|
|
|
103201
103210
|
this._initMarkBrushState(componentIndex, '');
|
|
103202
103211
|
brushComponent.children[0].removeAllChild();
|
|
103203
103212
|
}
|
|
103213
|
+
_shouldEnableInteractive() {
|
|
103214
|
+
return this.getOption().getCompiler().getOption().interactive !== false;
|
|
103215
|
+
}
|
|
103204
103216
|
_createBrushComponent(region, componentIndex) {
|
|
103205
103217
|
var _a, _b;
|
|
103206
103218
|
const interactiveAttr = this._getBrushInteractiveAttr(region);
|
|
@@ -103286,7 +103298,8 @@ class Brush extends BaseComponent {
|
|
|
103286
103298
|
maxX: seriesRegionEndX
|
|
103287
103299
|
},
|
|
103288
103300
|
xRange: [seriesRegionStartX, seriesRegionEndX],
|
|
103289
|
-
yRange: [seriesRegionStartY, seriesRegionEndY]
|
|
103301
|
+
yRange: [seriesRegionStartY, seriesRegionEndY],
|
|
103302
|
+
interactive: this._shouldEnableInteractive()
|
|
103290
103303
|
};
|
|
103291
103304
|
}
|
|
103292
103305
|
_transformBrushedMarkAttr(brushedStyle) {
|
|
@@ -103307,6 +103320,7 @@ class Brush extends BaseComponent {
|
|
|
103307
103320
|
}
|
|
103308
103321
|
_handleBrushChange(region, e) {
|
|
103309
103322
|
const { operateMask } = e.detail;
|
|
103323
|
+
this._operateMask = operateMask;
|
|
103310
103324
|
const { updateElementsState = true } = this._spec;
|
|
103311
103325
|
if (updateElementsState) {
|
|
103312
103326
|
this._reconfigItem(operateMask, region);
|
package/build/index.js
CHANGED
|
@@ -51102,6 +51102,7 @@
|
|
|
51102
51102
|
let Brush$1 = class Brush extends AbstractComponent {
|
|
51103
51103
|
constructor(attributes, options) {
|
|
51104
51104
|
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, Brush.defaultAttributes, attributes)), this.name = "brush", this._activeBrushState = !1, this._activeDrawState = !1, this._cacheDrawPoints = [], this._activeMoveState = !1, this._operatingMaskMoveDx = 0, this._operatingMaskMoveDy = 0, this._operatingMaskMoveRangeX = [-1 / 0, 1 / 0], this._operatingMaskMoveRangeY = [-1 / 0, 1 / 0], this._brushMaskAABBBoundsDict = {}, this._firstUpdate = !0, this._onBrushStart = e => {
|
|
51105
|
+
if (!1 === this.attribute.interactive) return;
|
|
51105
51106
|
if (!1 === this._beforeBrushEvent(e)) return;
|
|
51106
51107
|
const {
|
|
51107
51108
|
updateTrigger = DEFAULT_BRUSH_ATTRIBUTES.updateTrigger,
|
|
@@ -51110,11 +51111,11 @@
|
|
|
51110
51111
|
} = this.attribute;
|
|
51111
51112
|
array(updateTrigger).forEach(t => this.stage.addEventListener(t, this._onBrushingWithDelay)), array(endTrigger).forEach(t => this.stage.addEventListener(t, this._onBrushEnd)), e.stopPropagation(), this._firstUpdate = !0, this._activeMoveState = brushMoved && this._isPosInBrushMask(e), this._activeDrawState = !this._activeMoveState, this._startPos = this.eventPosToStagePos(e), this._cacheDrawPoints = [this._startPos];
|
|
51112
51113
|
}, this._onBrushing = e => {
|
|
51113
|
-
!1 !== this._beforeBrushEvent(e) && (this._outOfInteractiveRange(e) || (e.stopPropagation(), this._firstUpdate ? (this._activeDrawState && this._initDraw(e), this._activeMoveState && this._initMove(e), this._firstUpdate = !1) : (this._activeDrawState && this._drawing(e), this._activeMoveState && this._moving(e))));
|
|
51114
|
+
!1 !== this.attribute.interactive && !1 !== this._beforeBrushEvent(e) && (this._outOfInteractiveRange(e) || (e.stopPropagation(), this._firstUpdate ? (this._activeDrawState && this._initDraw(e), this._activeMoveState && this._initMove(e), this._firstUpdate = !1) : (this._activeDrawState && this._drawing(e), this._activeMoveState && this._moving(e))));
|
|
51114
51115
|
}, this._onBrushingWithDelay = 0 === this.attribute.delayTime ? this._onBrushing : delayMap$1[this.attribute.delayType](this._onBrushing, this.attribute.delayTime), this._onBrushEnd = e => {
|
|
51115
|
-
this._releaseBrushUpdateEvents(), e.preventDefault(), this._activeDrawState && this._drawEnd(e), this._activeMoveState && this._moveEnd(e), this._activeDrawState = !1, this._activeMoveState = !1;
|
|
51116
|
+
!1 !== this.attribute.interactive && (this._releaseBrushUpdateEvents(), e.preventDefault(), this._activeDrawState && this._drawEnd(e), this._activeMoveState && this._moveEnd(e), this._activeDrawState = !1, this._activeMoveState = !1);
|
|
51116
51117
|
}, this._onBrushClear = e => {
|
|
51117
|
-
!1 !== this._beforeBrushEvent(e) && (e.preventDefault(), this._isEmptyMask() || (this._clearMask(), this._dispatchBrushEvent(IOperateType.brushClear, e)), this._activeDrawState = !1, this._activeMoveState = !1);
|
|
51118
|
+
!1 !== this.attribute.interactive && !1 !== this._beforeBrushEvent(e) && (e.preventDefault(), this._isEmptyMask() || (this._clearMask(), this._dispatchBrushEvent(IOperateType.brushClear, e)), this._activeDrawState = !1, this._activeMoveState = !1);
|
|
51118
51119
|
};
|
|
51119
51120
|
}
|
|
51120
51121
|
_bindBrushEvents() {
|
|
@@ -51126,6 +51127,7 @@
|
|
|
51126
51127
|
array(trigger).forEach(t => this.stage.addEventListener(t, this._onBrushStart)), array(resetTrigger).forEach(t => this.stage.addEventListener(t, this._onBrushClear));
|
|
51127
51128
|
}
|
|
51128
51129
|
_initDraw(e) {
|
|
51130
|
+
if (!1 === this.attribute.interactive) return;
|
|
51129
51131
|
const {
|
|
51130
51132
|
brushMode: brushMode
|
|
51131
51133
|
} = this.attribute,
|
|
@@ -51134,6 +51136,7 @@
|
|
|
51134
51136
|
}
|
|
51135
51137
|
_initMove(e) {
|
|
51136
51138
|
var _a, _b;
|
|
51139
|
+
if (!1 === this.attribute.interactive) return;
|
|
51137
51140
|
this._cacheMovePoint = this.eventPosToStagePos(e), this._operatingMaskMoveDx = null !== (_a = this._operatingMask.attribute.dx) && void 0 !== _a ? _a : 0, this._operatingMaskMoveDy = null !== (_b = this._operatingMask.attribute.dy) && void 0 !== _b ? _b : 0;
|
|
51138
51141
|
const {
|
|
51139
51142
|
interactiveRange: interactiveRange
|
|
@@ -51158,6 +51161,7 @@
|
|
|
51158
51161
|
}
|
|
51159
51162
|
_drawing(e) {
|
|
51160
51163
|
var _a;
|
|
51164
|
+
if (!1 === this.attribute.interactive) return;
|
|
51161
51165
|
const pos = this.eventPosToStagePos(e),
|
|
51162
51166
|
{
|
|
51163
51167
|
brushType: brushType,
|
|
@@ -51182,6 +51186,7 @@
|
|
|
51182
51186
|
(Math.abs(x2 - x1) > sizeThreshold || Math.abs(y1 - y2) > sizeThreshold) && (1 !== Object.keys(this._brushMaskAABBBoundsDict).length || this._activeBrushState ? this._dispatchBrushEvent(IOperateType.drawing, e) : (this._activeBrushState = !0, this._dispatchBrushEvent(IOperateType.brushActive, e)));
|
|
51183
51187
|
}
|
|
51184
51188
|
_moving(e) {
|
|
51189
|
+
if (!1 === this.attribute.interactive) return;
|
|
51185
51190
|
const startPos = this._cacheMovePoint,
|
|
51186
51191
|
pos = this.eventPosToStagePos(e);
|
|
51187
51192
|
if (pos.x === (null == startPos ? void 0 : startPos.x) && pos.y === (null == startPos ? void 0 : startPos.y)) return;
|
|
@@ -51195,6 +51200,7 @@
|
|
|
51195
51200
|
}), this._brushMaskAABBBoundsDict[this._operatingMask.name] = this._operatingMask.AABBBounds, this._dispatchBrushEvent(IOperateType.moving, e);
|
|
51196
51201
|
}
|
|
51197
51202
|
_drawEnd(e) {
|
|
51203
|
+
if (!1 === this.attribute.interactive) return;
|
|
51198
51204
|
const {
|
|
51199
51205
|
removeOnClick = !0,
|
|
51200
51206
|
sizeThreshold = DEFAULT_SIZE_THRESHOLD
|
|
@@ -51212,7 +51218,7 @@
|
|
|
51212
51218
|
}
|
|
51213
51219
|
}
|
|
51214
51220
|
_moveEnd(e) {
|
|
51215
|
-
this._operatingMask && this._operatingMask.setAttribute("pickable", !1), this._dispatchBrushEvent(IOperateType.moveEnd, e);
|
|
51221
|
+
!1 !== this.attribute.interactive && (this._operatingMask && this._operatingMask.setAttribute("pickable", !1), this._dispatchBrushEvent(IOperateType.moveEnd, e));
|
|
51216
51222
|
}
|
|
51217
51223
|
render() {
|
|
51218
51224
|
this._bindBrushEvents();
|
|
@@ -54905,6 +54911,9 @@
|
|
|
54905
54911
|
getRootGroup() {
|
|
54906
54912
|
return this._rootGroup;
|
|
54907
54913
|
}
|
|
54914
|
+
getOption() {
|
|
54915
|
+
return this._option;
|
|
54916
|
+
}
|
|
54908
54917
|
constructor(container, option) {
|
|
54909
54918
|
this._count = 0;
|
|
54910
54919
|
this._rootMarks = [];
|
|
@@ -103207,6 +103216,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
103207
103216
|
this._initMarkBrushState(componentIndex, '');
|
|
103208
103217
|
brushComponent.children[0].removeAllChild();
|
|
103209
103218
|
}
|
|
103219
|
+
_shouldEnableInteractive() {
|
|
103220
|
+
return this.getOption().getCompiler().getOption().interactive !== false;
|
|
103221
|
+
}
|
|
103210
103222
|
_createBrushComponent(region, componentIndex) {
|
|
103211
103223
|
var _a, _b;
|
|
103212
103224
|
const interactiveAttr = this._getBrushInteractiveAttr(region);
|
|
@@ -103292,7 +103304,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
103292
103304
|
maxX: seriesRegionEndX
|
|
103293
103305
|
},
|
|
103294
103306
|
xRange: [seriesRegionStartX, seriesRegionEndX],
|
|
103295
|
-
yRange: [seriesRegionStartY, seriesRegionEndY]
|
|
103307
|
+
yRange: [seriesRegionStartY, seriesRegionEndY],
|
|
103308
|
+
interactive: this._shouldEnableInteractive()
|
|
103296
103309
|
};
|
|
103297
103310
|
}
|
|
103298
103311
|
_transformBrushedMarkAttr(brushedStyle) {
|
|
@@ -103313,6 +103326,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
103313
103326
|
}
|
|
103314
103327
|
_handleBrushChange(region, e) {
|
|
103315
103328
|
const { operateMask } = e.detail;
|
|
103329
|
+
this._operateMask = operateMask;
|
|
103316
103330
|
const { updateElementsState = true } = this._spec;
|
|
103317
103331
|
if (updateElementsState) {
|
|
103318
103332
|
this._reconfigItem(operateMask, region);
|