@visactor/vchart 2.0.13-alpha.0 → 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 +39 -23
- package/build/index.js +39 -23
- package/build/index.min.js +2 -2
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/animation/callback-disappear.js +2 -1
- package/cjs/animation/index.js +1 -2
- package/cjs/compile/compiler.d.ts +1 -0
- package/cjs/compile/compiler.js +4 -1
- package/cjs/compile/compiler.js.map +1 -1
- package/cjs/compile/grammar-item.js +1 -1
- package/cjs/compile/interface/compilable-item.d.ts +2 -1
- package/cjs/compile/interface/compilable-item.js.map +1 -1
- package/cjs/compile/morph.js +1 -1
- package/cjs/compile/state-manager.js +1 -1
- package/cjs/compile/util.js +1 -1
- package/cjs/component/brush/brush.d.ts +3 -1
- package/cjs/component/brush/brush.js +21 -14
- package/cjs/component/brush/brush.js.map +1 -1
- package/cjs/component/brush/interface.d.ts +2 -1
- package/cjs/component/brush/interface.js.map +1 -1
- package/cjs/component/tooltip/utils/show-tooltip.js +2 -10
- package/cjs/component/tooltip/utils/show-tooltip.js.map +1 -1
- package/cjs/component/util.js +1 -2
- package/cjs/constant/data.js +2 -1
- package/cjs/constant/scroll-bar.js +1 -2
- package/cjs/core/index.js +2 -1
- package/cjs/core/interface.js +1 -1
- package/cjs/core/util.js +1 -1
- package/cjs/core/vchart.js +1 -1
- package/cjs/env/env.js +1 -1
- package/cjs/env/index.js +1 -1
- package/esm/animation/callback-disappear.js +2 -1
- package/esm/animation/index.js +1 -2
- package/esm/compile/compiler.d.ts +1 -0
- package/esm/compile/compiler.js +4 -1
- package/esm/compile/compiler.js.map +1 -1
- package/esm/compile/grammar-item.js +1 -1
- package/esm/compile/interface/compilable-item.d.ts +2 -1
- package/esm/compile/interface/compilable-item.js.map +1 -1
- package/esm/compile/morph.js +1 -1
- package/esm/compile/state-manager.js +1 -1
- package/esm/compile/util.js +1 -1
- package/esm/component/brush/brush.d.ts +3 -1
- package/esm/component/brush/brush.js +21 -14
- package/esm/component/brush/brush.js.map +1 -1
- package/esm/component/brush/interface.d.ts +2 -1
- package/esm/component/brush/interface.js.map +1 -1
- package/esm/component/tooltip/utils/show-tooltip.js +2 -10
- package/esm/component/tooltip/utils/show-tooltip.js.map +1 -1
- package/esm/component/util.js +1 -2
- package/esm/constant/data.js +2 -1
- package/esm/constant/scroll-bar.js +1 -2
- package/esm/core/index.js +2 -1
- package/esm/core/interface.js +1 -1
- package/esm/core/util.js +1 -1
- package/esm/core/vchart.js +1 -1
- package/esm/env/env.js +1 -1
- package/esm/env/index.js +1 -1
- package/package.json +8 -8
package/build/index.es.js
CHANGED
|
@@ -51096,6 +51096,8 @@ 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;
|
|
51100
|
+
if (!1 === this._beforeBrushEvent(e)) return;
|
|
51099
51101
|
const {
|
|
51100
51102
|
updateTrigger = DEFAULT_BRUSH_ATTRIBUTES.updateTrigger,
|
|
51101
51103
|
endTrigger = DEFAULT_BRUSH_ATTRIBUTES.endTrigger,
|
|
@@ -51103,11 +51105,11 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
51103
51105
|
} = this.attribute;
|
|
51104
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];
|
|
51105
51107
|
}, this._onBrushing = e => {
|
|
51106
|
-
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))));
|
|
51107
51109
|
}, this._onBrushingWithDelay = 0 === this.attribute.delayTime ? this._onBrushing : delayMap$1[this.attribute.delayType](this._onBrushing, this.attribute.delayTime), this._onBrushEnd = e => {
|
|
51108
|
-
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);
|
|
51109
51111
|
}, this._onBrushClear = e => {
|
|
51110
|
-
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);
|
|
51111
51113
|
};
|
|
51112
51114
|
}
|
|
51113
51115
|
_bindBrushEvents() {
|
|
@@ -51119,6 +51121,7 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
51119
51121
|
array(trigger).forEach(t => this.stage.addEventListener(t, this._onBrushStart)), array(resetTrigger).forEach(t => this.stage.addEventListener(t, this._onBrushClear));
|
|
51120
51122
|
}
|
|
51121
51123
|
_initDraw(e) {
|
|
51124
|
+
if (!1 === this.attribute.interactive) return;
|
|
51122
51125
|
const {
|
|
51123
51126
|
brushMode: brushMode
|
|
51124
51127
|
} = this.attribute,
|
|
@@ -51127,6 +51130,7 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
51127
51130
|
}
|
|
51128
51131
|
_initMove(e) {
|
|
51129
51132
|
var _a, _b;
|
|
51133
|
+
if (!1 === this.attribute.interactive) return;
|
|
51130
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;
|
|
51131
51135
|
const {
|
|
51132
51136
|
interactiveRange: interactiveRange
|
|
@@ -51151,6 +51155,7 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
51151
51155
|
}
|
|
51152
51156
|
_drawing(e) {
|
|
51153
51157
|
var _a;
|
|
51158
|
+
if (!1 === this.attribute.interactive) return;
|
|
51154
51159
|
const pos = this.eventPosToStagePos(e),
|
|
51155
51160
|
{
|
|
51156
51161
|
brushType: brushType,
|
|
@@ -51175,6 +51180,7 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
51175
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)));
|
|
51176
51181
|
}
|
|
51177
51182
|
_moving(e) {
|
|
51183
|
+
if (!1 === this.attribute.interactive) return;
|
|
51178
51184
|
const startPos = this._cacheMovePoint,
|
|
51179
51185
|
pos = this.eventPosToStagePos(e);
|
|
51180
51186
|
if (pos.x === (null == startPos ? void 0 : startPos.x) && pos.y === (null == startPos ? void 0 : startPos.y)) return;
|
|
@@ -51188,6 +51194,7 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
51188
51194
|
}), this._brushMaskAABBBoundsDict[this._operatingMask.name] = this._operatingMask.AABBBounds, this._dispatchBrushEvent(IOperateType.moving, e);
|
|
51189
51195
|
}
|
|
51190
51196
|
_drawEnd(e) {
|
|
51197
|
+
if (!1 === this.attribute.interactive) return;
|
|
51191
51198
|
const {
|
|
51192
51199
|
removeOnClick = !0,
|
|
51193
51200
|
sizeThreshold = DEFAULT_SIZE_THRESHOLD
|
|
@@ -51205,7 +51212,7 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
51205
51212
|
}
|
|
51206
51213
|
}
|
|
51207
51214
|
_moveEnd(e) {
|
|
51208
|
-
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));
|
|
51209
51216
|
}
|
|
51210
51217
|
render() {
|
|
51211
51218
|
this._bindBrushEvents();
|
|
@@ -51312,6 +51319,10 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
51312
51319
|
pos = this.eventPosToStagePos(e);
|
|
51313
51320
|
return pos.x > maxX || pos.x < minX || pos.y > maxY || pos.y < minY;
|
|
51314
51321
|
}
|
|
51322
|
+
_beforeBrushEvent(e) {
|
|
51323
|
+
var _a, _b;
|
|
51324
|
+
return null === (_b = (_a = this.attribute).beforeBrushChange) || void 0 === _b ? void 0 : _b.call(_a, e);
|
|
51325
|
+
}
|
|
51315
51326
|
_dispatchBrushEvent(operateType, e) {
|
|
51316
51327
|
this._dispatchEvent(operateType, {
|
|
51317
51328
|
operateMask: this._operatingMask,
|
|
@@ -54894,6 +54905,9 @@ class Compiler {
|
|
|
54894
54905
|
getRootGroup() {
|
|
54895
54906
|
return this._rootGroup;
|
|
54896
54907
|
}
|
|
54908
|
+
getOption() {
|
|
54909
|
+
return this._option;
|
|
54910
|
+
}
|
|
54897
54911
|
constructor(container, option) {
|
|
54898
54912
|
this._count = 0;
|
|
54899
54913
|
this._rootMarks = [];
|
|
@@ -95659,15 +95673,11 @@ function showTooltip(datum, options, component) {
|
|
|
95659
95673
|
});
|
|
95660
95674
|
return originDatum;
|
|
95661
95675
|
};
|
|
95662
|
-
const transform = region.getOption().globalInstance.getStage().window.getViewBoxTransform().getInverse();
|
|
95663
95676
|
const getMockEvent = (originPos) => {
|
|
95664
95677
|
var _a, _b;
|
|
95665
95678
|
const pos = bound(originPos);
|
|
95666
|
-
const
|
|
95667
|
-
const
|
|
95668
|
-
const canvasPoint = { x: 0, y: 0 };
|
|
95669
|
-
transform.transformPoint({ x: tempX, y: tempY }, canvasPoint);
|
|
95670
|
-
const { x: canvasX, y: canvasY } = canvasPoint;
|
|
95679
|
+
const canvasX = (_a = opt.x) !== null && _a !== void 0 ? _a : regionPos.x + pos.x;
|
|
95680
|
+
const canvasY = (_b = opt.y) !== null && _b !== void 0 ? _b : regionPos.y + pos.y;
|
|
95671
95681
|
return {
|
|
95672
95682
|
canvasX,
|
|
95673
95683
|
canvasY,
|
|
@@ -103200,6 +103210,9 @@ class Brush extends BaseComponent {
|
|
|
103200
103210
|
this._initMarkBrushState(componentIndex, '');
|
|
103201
103211
|
brushComponent.children[0].removeAllChild();
|
|
103202
103212
|
}
|
|
103213
|
+
_shouldEnableInteractive() {
|
|
103214
|
+
return this.getOption().getCompiler().getOption().interactive !== false;
|
|
103215
|
+
}
|
|
103203
103216
|
_createBrushComponent(region, componentIndex) {
|
|
103204
103217
|
var _a, _b;
|
|
103205
103218
|
const interactiveAttr = this._getBrushInteractiveAttr(region);
|
|
@@ -103210,30 +103223,30 @@ class Brush extends BaseComponent {
|
|
|
103210
103223
|
this._cacheInteractiveRangeAttrs.push(interactiveAttr);
|
|
103211
103224
|
brush.addEventListener(IOperateType.brushActive, (e) => {
|
|
103212
103225
|
this._initMarkBrushState(componentIndex, OUT_BRUSH_STATE);
|
|
103213
|
-
this._emitEvent(ChartEvent.brushActive, region);
|
|
103226
|
+
this._emitEvent(ChartEvent.brushActive, region, e);
|
|
103214
103227
|
});
|
|
103215
103228
|
brush.addEventListener(IOperateType.drawStart, (e) => {
|
|
103216
103229
|
this._setRegionMarkPickable(region, true);
|
|
103217
|
-
this._emitEvent(ChartEvent.brushStart, region);
|
|
103230
|
+
this._emitEvent(ChartEvent.brushStart, region, e);
|
|
103218
103231
|
});
|
|
103219
103232
|
brush.addEventListener(IOperateType.moveStart, (e) => {
|
|
103220
103233
|
this._setRegionMarkPickable(region, true);
|
|
103221
|
-
this._emitEvent(ChartEvent.brushStart, region);
|
|
103234
|
+
this._emitEvent(ChartEvent.brushStart, region, e);
|
|
103222
103235
|
});
|
|
103223
103236
|
brush.addEventListener(IOperateType.drawing, (e) => {
|
|
103224
103237
|
this._setRegionMarkPickable(region, false);
|
|
103225
103238
|
this._handleBrushChange(region, e);
|
|
103226
|
-
this._emitEvent(ChartEvent.brushChange, region);
|
|
103239
|
+
this._emitEvent(ChartEvent.brushChange, region, e);
|
|
103227
103240
|
});
|
|
103228
103241
|
brush.addEventListener(IOperateType.moving, (e) => {
|
|
103229
103242
|
this._setRegionMarkPickable(region, false);
|
|
103230
103243
|
this._handleBrushChange(region, e);
|
|
103231
|
-
this._emitEvent(ChartEvent.brushChange, region);
|
|
103244
|
+
this._emitEvent(ChartEvent.brushChange, region, e);
|
|
103232
103245
|
});
|
|
103233
103246
|
brush.addEventListener(IOperateType.brushClear, (e) => {
|
|
103234
103247
|
this._setRegionMarkPickable(region, true);
|
|
103235
103248
|
this._initMarkBrushState(componentIndex, '');
|
|
103236
|
-
this._emitEvent(ChartEvent.brushClear, region);
|
|
103249
|
+
this._emitEvent(ChartEvent.brushClear, region, e);
|
|
103237
103250
|
});
|
|
103238
103251
|
brush.addEventListener(IOperateType.drawEnd, (e) => {
|
|
103239
103252
|
var _a;
|
|
@@ -103244,11 +103257,11 @@ class Brush extends BaseComponent {
|
|
|
103244
103257
|
if (this._spec.onBrushEnd(e) === true) {
|
|
103245
103258
|
this.clearGraphic();
|
|
103246
103259
|
this._initMarkBrushState(componentIndex, '');
|
|
103247
|
-
this._emitEvent(ChartEvent.brushClear, region);
|
|
103260
|
+
this._emitEvent(ChartEvent.brushClear, region, e);
|
|
103248
103261
|
}
|
|
103249
103262
|
else {
|
|
103250
103263
|
this._spec.onBrushEnd(e);
|
|
103251
|
-
this._emitEvent(ChartEvent.brushEnd, region);
|
|
103264
|
+
this._emitEvent(ChartEvent.brushEnd, region, e);
|
|
103252
103265
|
}
|
|
103253
103266
|
}
|
|
103254
103267
|
else {
|
|
@@ -103256,7 +103269,7 @@ class Brush extends BaseComponent {
|
|
|
103256
103269
|
if ((!this._spec.zoomWhenEmpty && inBrushData.length > 0) || !updateElementsState) {
|
|
103257
103270
|
this._setAxisAndDataZoom(operateMask, region);
|
|
103258
103271
|
}
|
|
103259
|
-
this._emitEvent(ChartEvent.brushEnd, region);
|
|
103272
|
+
this._emitEvent(ChartEvent.brushEnd, region, e);
|
|
103260
103273
|
}
|
|
103261
103274
|
});
|
|
103262
103275
|
brush.addEventListener(IOperateType.moveEnd, (e) => {
|
|
@@ -103267,7 +103280,7 @@ class Brush extends BaseComponent {
|
|
|
103267
103280
|
if ((!this._spec.zoomWhenEmpty && inBrushData.length > 0) || updateElementsState) {
|
|
103268
103281
|
this._setAxisAndDataZoom(operateMask, region);
|
|
103269
103282
|
}
|
|
103270
|
-
this._emitEvent(ChartEvent.brushEnd, region);
|
|
103283
|
+
this._emitEvent(ChartEvent.brushEnd, region, e);
|
|
103271
103284
|
});
|
|
103272
103285
|
}
|
|
103273
103286
|
_getBrushInteractiveAttr(region) {
|
|
@@ -103285,7 +103298,8 @@ class Brush extends BaseComponent {
|
|
|
103285
103298
|
maxX: seriesRegionEndX
|
|
103286
103299
|
},
|
|
103287
103300
|
xRange: [seriesRegionStartX, seriesRegionEndX],
|
|
103288
|
-
yRange: [seriesRegionStartY, seriesRegionEndY]
|
|
103301
|
+
yRange: [seriesRegionStartY, seriesRegionEndY],
|
|
103302
|
+
interactive: this._shouldEnableInteractive()
|
|
103289
103303
|
};
|
|
103290
103304
|
}
|
|
103291
103305
|
_transformBrushedMarkAttr(brushedStyle) {
|
|
@@ -103306,6 +103320,7 @@ class Brush extends BaseComponent {
|
|
|
103306
103320
|
}
|
|
103307
103321
|
_handleBrushChange(region, e) {
|
|
103308
103322
|
const { operateMask } = e.detail;
|
|
103323
|
+
this._operateMask = operateMask;
|
|
103309
103324
|
const { updateElementsState = true } = this._spec;
|
|
103310
103325
|
if (updateElementsState) {
|
|
103311
103326
|
this._reconfigItem(operateMask, region);
|
|
@@ -103330,7 +103345,7 @@ class Brush extends BaseComponent {
|
|
|
103330
103345
|
}
|
|
103331
103346
|
return data;
|
|
103332
103347
|
}
|
|
103333
|
-
_emitEvent(eventType, region) {
|
|
103348
|
+
_emitEvent(eventType, region, e) {
|
|
103334
103349
|
var _a;
|
|
103335
103350
|
this.event.emit(eventType, {
|
|
103336
103351
|
model: this,
|
|
@@ -103347,7 +103362,8 @@ class Brush extends BaseComponent {
|
|
|
103347
103362
|
linkedOutOfBrushElementsMap: this._linkedOutOfBrushElementsMap,
|
|
103348
103363
|
zoomRecord: this._zoomRecord
|
|
103349
103364
|
},
|
|
103350
|
-
vchart: (_a = this._option) === null || _a === void 0 ? void 0 : _a.globalInstance
|
|
103365
|
+
vchart: (_a = this._option) === null || _a === void 0 ? void 0 : _a.globalInstance,
|
|
103366
|
+
event: e
|
|
103351
103367
|
});
|
|
103352
103368
|
}
|
|
103353
103369
|
_reconfigItem(operateMask, region) {
|
package/build/index.js
CHANGED
|
@@ -51102,6 +51102,8 @@
|
|
|
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;
|
|
51106
|
+
if (!1 === this._beforeBrushEvent(e)) return;
|
|
51105
51107
|
const {
|
|
51106
51108
|
updateTrigger = DEFAULT_BRUSH_ATTRIBUTES.updateTrigger,
|
|
51107
51109
|
endTrigger = DEFAULT_BRUSH_ATTRIBUTES.endTrigger,
|
|
@@ -51109,11 +51111,11 @@
|
|
|
51109
51111
|
} = this.attribute;
|
|
51110
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];
|
|
51111
51113
|
}, this._onBrushing = e => {
|
|
51112
|
-
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))));
|
|
51113
51115
|
}, this._onBrushingWithDelay = 0 === this.attribute.delayTime ? this._onBrushing : delayMap$1[this.attribute.delayType](this._onBrushing, this.attribute.delayTime), this._onBrushEnd = e => {
|
|
51114
|
-
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);
|
|
51115
51117
|
}, this._onBrushClear = e => {
|
|
51116
|
-
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);
|
|
51117
51119
|
};
|
|
51118
51120
|
}
|
|
51119
51121
|
_bindBrushEvents() {
|
|
@@ -51125,6 +51127,7 @@
|
|
|
51125
51127
|
array(trigger).forEach(t => this.stage.addEventListener(t, this._onBrushStart)), array(resetTrigger).forEach(t => this.stage.addEventListener(t, this._onBrushClear));
|
|
51126
51128
|
}
|
|
51127
51129
|
_initDraw(e) {
|
|
51130
|
+
if (!1 === this.attribute.interactive) return;
|
|
51128
51131
|
const {
|
|
51129
51132
|
brushMode: brushMode
|
|
51130
51133
|
} = this.attribute,
|
|
@@ -51133,6 +51136,7 @@
|
|
|
51133
51136
|
}
|
|
51134
51137
|
_initMove(e) {
|
|
51135
51138
|
var _a, _b;
|
|
51139
|
+
if (!1 === this.attribute.interactive) return;
|
|
51136
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;
|
|
51137
51141
|
const {
|
|
51138
51142
|
interactiveRange: interactiveRange
|
|
@@ -51157,6 +51161,7 @@
|
|
|
51157
51161
|
}
|
|
51158
51162
|
_drawing(e) {
|
|
51159
51163
|
var _a;
|
|
51164
|
+
if (!1 === this.attribute.interactive) return;
|
|
51160
51165
|
const pos = this.eventPosToStagePos(e),
|
|
51161
51166
|
{
|
|
51162
51167
|
brushType: brushType,
|
|
@@ -51181,6 +51186,7 @@
|
|
|
51181
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)));
|
|
51182
51187
|
}
|
|
51183
51188
|
_moving(e) {
|
|
51189
|
+
if (!1 === this.attribute.interactive) return;
|
|
51184
51190
|
const startPos = this._cacheMovePoint,
|
|
51185
51191
|
pos = this.eventPosToStagePos(e);
|
|
51186
51192
|
if (pos.x === (null == startPos ? void 0 : startPos.x) && pos.y === (null == startPos ? void 0 : startPos.y)) return;
|
|
@@ -51194,6 +51200,7 @@
|
|
|
51194
51200
|
}), this._brushMaskAABBBoundsDict[this._operatingMask.name] = this._operatingMask.AABBBounds, this._dispatchBrushEvent(IOperateType.moving, e);
|
|
51195
51201
|
}
|
|
51196
51202
|
_drawEnd(e) {
|
|
51203
|
+
if (!1 === this.attribute.interactive) return;
|
|
51197
51204
|
const {
|
|
51198
51205
|
removeOnClick = !0,
|
|
51199
51206
|
sizeThreshold = DEFAULT_SIZE_THRESHOLD
|
|
@@ -51211,7 +51218,7 @@
|
|
|
51211
51218
|
}
|
|
51212
51219
|
}
|
|
51213
51220
|
_moveEnd(e) {
|
|
51214
|
-
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));
|
|
51215
51222
|
}
|
|
51216
51223
|
render() {
|
|
51217
51224
|
this._bindBrushEvents();
|
|
@@ -51318,6 +51325,10 @@
|
|
|
51318
51325
|
pos = this.eventPosToStagePos(e);
|
|
51319
51326
|
return pos.x > maxX || pos.x < minX || pos.y > maxY || pos.y < minY;
|
|
51320
51327
|
}
|
|
51328
|
+
_beforeBrushEvent(e) {
|
|
51329
|
+
var _a, _b;
|
|
51330
|
+
return null === (_b = (_a = this.attribute).beforeBrushChange) || void 0 === _b ? void 0 : _b.call(_a, e);
|
|
51331
|
+
}
|
|
51321
51332
|
_dispatchBrushEvent(operateType, e) {
|
|
51322
51333
|
this._dispatchEvent(operateType, {
|
|
51323
51334
|
operateMask: this._operatingMask,
|
|
@@ -54900,6 +54911,9 @@
|
|
|
54900
54911
|
getRootGroup() {
|
|
54901
54912
|
return this._rootGroup;
|
|
54902
54913
|
}
|
|
54914
|
+
getOption() {
|
|
54915
|
+
return this._option;
|
|
54916
|
+
}
|
|
54903
54917
|
constructor(container, option) {
|
|
54904
54918
|
this._count = 0;
|
|
54905
54919
|
this._rootMarks = [];
|
|
@@ -95665,15 +95679,11 @@
|
|
|
95665
95679
|
});
|
|
95666
95680
|
return originDatum;
|
|
95667
95681
|
};
|
|
95668
|
-
const transform = region.getOption().globalInstance.getStage().window.getViewBoxTransform().getInverse();
|
|
95669
95682
|
const getMockEvent = (originPos) => {
|
|
95670
95683
|
var _a, _b;
|
|
95671
95684
|
const pos = bound(originPos);
|
|
95672
|
-
const
|
|
95673
|
-
const
|
|
95674
|
-
const canvasPoint = { x: 0, y: 0 };
|
|
95675
|
-
transform.transformPoint({ x: tempX, y: tempY }, canvasPoint);
|
|
95676
|
-
const { x: canvasX, y: canvasY } = canvasPoint;
|
|
95685
|
+
const canvasX = (_a = opt.x) !== null && _a !== void 0 ? _a : regionPos.x + pos.x;
|
|
95686
|
+
const canvasY = (_b = opt.y) !== null && _b !== void 0 ? _b : regionPos.y + pos.y;
|
|
95677
95687
|
return {
|
|
95678
95688
|
canvasX,
|
|
95679
95689
|
canvasY,
|
|
@@ -103206,6 +103216,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
103206
103216
|
this._initMarkBrushState(componentIndex, '');
|
|
103207
103217
|
brushComponent.children[0].removeAllChild();
|
|
103208
103218
|
}
|
|
103219
|
+
_shouldEnableInteractive() {
|
|
103220
|
+
return this.getOption().getCompiler().getOption().interactive !== false;
|
|
103221
|
+
}
|
|
103209
103222
|
_createBrushComponent(region, componentIndex) {
|
|
103210
103223
|
var _a, _b;
|
|
103211
103224
|
const interactiveAttr = this._getBrushInteractiveAttr(region);
|
|
@@ -103216,30 +103229,30 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
103216
103229
|
this._cacheInteractiveRangeAttrs.push(interactiveAttr);
|
|
103217
103230
|
brush.addEventListener(IOperateType.brushActive, (e) => {
|
|
103218
103231
|
this._initMarkBrushState(componentIndex, OUT_BRUSH_STATE);
|
|
103219
|
-
this._emitEvent(exports.ChartEvent.brushActive, region);
|
|
103232
|
+
this._emitEvent(exports.ChartEvent.brushActive, region, e);
|
|
103220
103233
|
});
|
|
103221
103234
|
brush.addEventListener(IOperateType.drawStart, (e) => {
|
|
103222
103235
|
this._setRegionMarkPickable(region, true);
|
|
103223
|
-
this._emitEvent(exports.ChartEvent.brushStart, region);
|
|
103236
|
+
this._emitEvent(exports.ChartEvent.brushStart, region, e);
|
|
103224
103237
|
});
|
|
103225
103238
|
brush.addEventListener(IOperateType.moveStart, (e) => {
|
|
103226
103239
|
this._setRegionMarkPickable(region, true);
|
|
103227
|
-
this._emitEvent(exports.ChartEvent.brushStart, region);
|
|
103240
|
+
this._emitEvent(exports.ChartEvent.brushStart, region, e);
|
|
103228
103241
|
});
|
|
103229
103242
|
brush.addEventListener(IOperateType.drawing, (e) => {
|
|
103230
103243
|
this._setRegionMarkPickable(region, false);
|
|
103231
103244
|
this._handleBrushChange(region, e);
|
|
103232
|
-
this._emitEvent(exports.ChartEvent.brushChange, region);
|
|
103245
|
+
this._emitEvent(exports.ChartEvent.brushChange, region, e);
|
|
103233
103246
|
});
|
|
103234
103247
|
brush.addEventListener(IOperateType.moving, (e) => {
|
|
103235
103248
|
this._setRegionMarkPickable(region, false);
|
|
103236
103249
|
this._handleBrushChange(region, e);
|
|
103237
|
-
this._emitEvent(exports.ChartEvent.brushChange, region);
|
|
103250
|
+
this._emitEvent(exports.ChartEvent.brushChange, region, e);
|
|
103238
103251
|
});
|
|
103239
103252
|
brush.addEventListener(IOperateType.brushClear, (e) => {
|
|
103240
103253
|
this._setRegionMarkPickable(region, true);
|
|
103241
103254
|
this._initMarkBrushState(componentIndex, '');
|
|
103242
|
-
this._emitEvent(exports.ChartEvent.brushClear, region);
|
|
103255
|
+
this._emitEvent(exports.ChartEvent.brushClear, region, e);
|
|
103243
103256
|
});
|
|
103244
103257
|
brush.addEventListener(IOperateType.drawEnd, (e) => {
|
|
103245
103258
|
var _a;
|
|
@@ -103250,11 +103263,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
103250
103263
|
if (this._spec.onBrushEnd(e) === true) {
|
|
103251
103264
|
this.clearGraphic();
|
|
103252
103265
|
this._initMarkBrushState(componentIndex, '');
|
|
103253
|
-
this._emitEvent(exports.ChartEvent.brushClear, region);
|
|
103266
|
+
this._emitEvent(exports.ChartEvent.brushClear, region, e);
|
|
103254
103267
|
}
|
|
103255
103268
|
else {
|
|
103256
103269
|
this._spec.onBrushEnd(e);
|
|
103257
|
-
this._emitEvent(exports.ChartEvent.brushEnd, region);
|
|
103270
|
+
this._emitEvent(exports.ChartEvent.brushEnd, region, e);
|
|
103258
103271
|
}
|
|
103259
103272
|
}
|
|
103260
103273
|
else {
|
|
@@ -103262,7 +103275,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
103262
103275
|
if ((!this._spec.zoomWhenEmpty && inBrushData.length > 0) || !updateElementsState) {
|
|
103263
103276
|
this._setAxisAndDataZoom(operateMask, region);
|
|
103264
103277
|
}
|
|
103265
|
-
this._emitEvent(exports.ChartEvent.brushEnd, region);
|
|
103278
|
+
this._emitEvent(exports.ChartEvent.brushEnd, region, e);
|
|
103266
103279
|
}
|
|
103267
103280
|
});
|
|
103268
103281
|
brush.addEventListener(IOperateType.moveEnd, (e) => {
|
|
@@ -103273,7 +103286,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
103273
103286
|
if ((!this._spec.zoomWhenEmpty && inBrushData.length > 0) || updateElementsState) {
|
|
103274
103287
|
this._setAxisAndDataZoom(operateMask, region);
|
|
103275
103288
|
}
|
|
103276
|
-
this._emitEvent(exports.ChartEvent.brushEnd, region);
|
|
103289
|
+
this._emitEvent(exports.ChartEvent.brushEnd, region, e);
|
|
103277
103290
|
});
|
|
103278
103291
|
}
|
|
103279
103292
|
_getBrushInteractiveAttr(region) {
|
|
@@ -103291,7 +103304,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
103291
103304
|
maxX: seriesRegionEndX
|
|
103292
103305
|
},
|
|
103293
103306
|
xRange: [seriesRegionStartX, seriesRegionEndX],
|
|
103294
|
-
yRange: [seriesRegionStartY, seriesRegionEndY]
|
|
103307
|
+
yRange: [seriesRegionStartY, seriesRegionEndY],
|
|
103308
|
+
interactive: this._shouldEnableInteractive()
|
|
103295
103309
|
};
|
|
103296
103310
|
}
|
|
103297
103311
|
_transformBrushedMarkAttr(brushedStyle) {
|
|
@@ -103312,6 +103326,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
103312
103326
|
}
|
|
103313
103327
|
_handleBrushChange(region, e) {
|
|
103314
103328
|
const { operateMask } = e.detail;
|
|
103329
|
+
this._operateMask = operateMask;
|
|
103315
103330
|
const { updateElementsState = true } = this._spec;
|
|
103316
103331
|
if (updateElementsState) {
|
|
103317
103332
|
this._reconfigItem(operateMask, region);
|
|
@@ -103336,7 +103351,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
103336
103351
|
}
|
|
103337
103352
|
return data;
|
|
103338
103353
|
}
|
|
103339
|
-
_emitEvent(eventType, region) {
|
|
103354
|
+
_emitEvent(eventType, region, e) {
|
|
103340
103355
|
var _a;
|
|
103341
103356
|
this.event.emit(eventType, {
|
|
103342
103357
|
model: this,
|
|
@@ -103353,7 +103368,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
103353
103368
|
linkedOutOfBrushElementsMap: this._linkedOutOfBrushElementsMap,
|
|
103354
103369
|
zoomRecord: this._zoomRecord
|
|
103355
103370
|
},
|
|
103356
|
-
vchart: (_a = this._option) === null || _a === void 0 ? void 0 : _a.globalInstance
|
|
103371
|
+
vchart: (_a = this._option) === null || _a === void 0 ? void 0 : _a.globalInstance,
|
|
103372
|
+
event: e
|
|
103357
103373
|
});
|
|
103358
103374
|
}
|
|
103359
103375
|
_reconfigItem(operateMask, region) {
|