@visactor/vchart 2.0.13-alpha.7 → 2.0.13-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/es5/index.js +1 -1
- package/build/index.es.js +92 -24
- package/build/index.js +92 -24
- package/build/index.min.js +2 -2
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/chart/index.js +1 -1
- package/cjs/chart/stack.js +1 -1
- package/cjs/chart/util.js +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 +4 -1
- package/cjs/component/brush/brush.js +31 -14
- package/cjs/component/brush/brush.js.map +1 -1
- package/cjs/component/brush/interface.d.ts +3 -1
- package/cjs/component/brush/interface.js.map +1 -1
- package/cjs/component/crosshair/interface/spec.d.ts +1 -0
- package/cjs/component/crosshair/interface/spec.js.map +1 -1
- package/cjs/component/tooltip/interface/common.d.ts +1 -0
- package/cjs/component/tooltip/interface/common.js.map +1 -1
- package/cjs/component/tooltip/processor/base.js +1 -1
- package/cjs/component/tooltip/processor/base.js.map +1 -1
- package/cjs/component/tooltip/tooltip.d.ts +1 -0
- package/cjs/component/tooltip/tooltip.js +3 -2
- package/cjs/component/tooltip/tooltip.js.map +1 -1
- package/cjs/component/tooltip/utils/show-tooltip.js +10 -2
- package/cjs/component/tooltip/utils/show-tooltip.js.map +1 -1
- package/cjs/component/util.js +1 -2
- package/cjs/constant/base.js +2 -1
- package/cjs/constant/scroll-bar.js +1 -2
- package/cjs/constant/word-cloud.js +2 -1
- package/cjs/core/interface.d.ts +9 -1
- package/cjs/core/interface.js +1 -1
- package/cjs/core/interface.js.map +1 -1
- package/cjs/core/util.js +1 -1
- package/cjs/core/vchart.d.ts +4 -0
- package/cjs/core/vchart.js +11 -2
- package/cjs/core/vchart.js.map +1 -1
- package/cjs/event/event.js +1 -1
- package/cjs/event/event.js.map +1 -1
- package/cjs/event/events/dimension/dimension-hover.js +4 -2
- package/cjs/event/events/dimension/dimension-hover.js.map +1 -1
- package/esm/chart/index.js +1 -1
- package/esm/chart/stack.js +1 -1
- package/esm/chart/util.js +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 +4 -1
- package/esm/component/brush/brush.js +31 -14
- package/esm/component/brush/brush.js.map +1 -1
- package/esm/component/brush/interface.d.ts +3 -1
- package/esm/component/brush/interface.js.map +1 -1
- package/esm/component/crosshair/interface/spec.d.ts +1 -0
- package/esm/component/crosshair/interface/spec.js.map +1 -1
- package/esm/component/tooltip/interface/common.d.ts +1 -0
- package/esm/component/tooltip/interface/common.js.map +1 -1
- package/esm/component/tooltip/processor/base.js +1 -1
- package/esm/component/tooltip/processor/base.js.map +1 -1
- package/esm/component/tooltip/tooltip.d.ts +1 -0
- package/esm/component/tooltip/tooltip.js +3 -2
- package/esm/component/tooltip/tooltip.js.map +1 -1
- package/esm/component/tooltip/utils/show-tooltip.js +10 -2
- package/esm/component/tooltip/utils/show-tooltip.js.map +1 -1
- package/esm/component/util.js +1 -2
- package/esm/constant/base.js +2 -1
- package/esm/constant/scroll-bar.js +1 -2
- package/esm/constant/word-cloud.js +2 -1
- package/esm/core/interface.d.ts +9 -1
- package/esm/core/interface.js +1 -1
- package/esm/core/interface.js.map +1 -1
- package/esm/core/util.js +1 -1
- package/esm/core/vchart.d.ts +4 -0
- package/esm/core/vchart.js +11 -2
- package/esm/core/vchart.js.map +1 -1
- package/esm/event/event.js +1 -1
- package/esm/event/event.js.map +1 -1
- package/esm/event/events/dimension/dimension-hover.js +4 -2
- package/esm/event/events/dimension/dimension-hover.js.map +1 -1
- package/package.json +8 -8
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,
|
|
@@ -53863,7 +53874,7 @@
|
|
|
53863
53874
|
if (ComposedEventCtor) {
|
|
53864
53875
|
const composedEvent = new ComposedEventCtor(this._eventDispatcher, this._mode);
|
|
53865
53876
|
composedEvent.register(eType, handler);
|
|
53866
|
-
this._composedEventMap.set(callback, {
|
|
53877
|
+
this._composedEventMap.set(handler.callback, {
|
|
53867
53878
|
eventType: eType,
|
|
53868
53879
|
event: composedEvent
|
|
53869
53880
|
});
|
|
@@ -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 = [];
|
|
@@ -60376,6 +60390,7 @@
|
|
|
60376
60390
|
this._observer = null;
|
|
60377
60391
|
this._context = {};
|
|
60378
60392
|
this._renderState = RenderStateEnum.render;
|
|
60393
|
+
this._disableDimensionHoverEvent = false;
|
|
60379
60394
|
this._doResize = () => {
|
|
60380
60395
|
const { width, height } = this.getCurrentSize();
|
|
60381
60396
|
if (this._currentSize.width !== width || this._currentSize.height !== height) {
|
|
@@ -60520,7 +60535,7 @@
|
|
|
60520
60535
|
this._compiler.updateLayoutTag();
|
|
60521
60536
|
this._setFontFamilyTheme(this.getTheme('fontFamily'));
|
|
60522
60537
|
this._initDataSet(this._option.dataSet);
|
|
60523
|
-
this._autoSize = isTrueBrowseEnv ? (_g = (_f = spec.autoFit) !== null && _f !== void 0 ? _f : this._option.autoFit) !== null && _g !== void 0 ? _g : true : false;
|
|
60538
|
+
this._autoSize = isTrueBrowseEnv ? ((_g = (_f = spec.autoFit) !== null && _f !== void 0 ? _f : this._option.autoFit) !== null && _g !== void 0 ? _g : true) : false;
|
|
60524
60539
|
this._bindResizeEvent();
|
|
60525
60540
|
this._bindViewEvent();
|
|
60526
60541
|
this._initChartPlugin();
|
|
@@ -61173,7 +61188,7 @@
|
|
|
61173
61188
|
resize = true;
|
|
61174
61189
|
}
|
|
61175
61190
|
const lasAutoSize = this._autoSize;
|
|
61176
|
-
this._autoSize = isTrueBrowser(this._option.mode) ? (_b = (_a = this._spec.autoFit) !== null && _a !== void 0 ? _a : this._option.autoFit) !== null && _b !== void 0 ? _b : true : false;
|
|
61191
|
+
this._autoSize = isTrueBrowser(this._option.mode) ? ((_b = (_a = this._spec.autoFit) !== null && _a !== void 0 ? _a : this._option.autoFit) !== null && _b !== void 0 ? _b : true) : false;
|
|
61177
61192
|
if (this._autoSize !== lasAutoSize) {
|
|
61178
61193
|
resize = true;
|
|
61179
61194
|
}
|
|
@@ -61414,6 +61429,22 @@
|
|
|
61414
61429
|
var _a;
|
|
61415
61430
|
return (_a = this._chart) === null || _a === void 0 ? void 0 : _a.setDimensionIndex(value, opt);
|
|
61416
61431
|
}
|
|
61432
|
+
disableDimensionHoverEvent(value) {
|
|
61433
|
+
if (value !== undefined) {
|
|
61434
|
+
this._disableDimensionHoverEvent = value;
|
|
61435
|
+
}
|
|
61436
|
+
return this._disableDimensionHoverEvent;
|
|
61437
|
+
}
|
|
61438
|
+
disableCrossHair(value = true) {
|
|
61439
|
+
this.getChart()
|
|
61440
|
+
.getComponentsByKey('crosshair')
|
|
61441
|
+
.forEach(crosshair => (crosshair.enable = !value));
|
|
61442
|
+
}
|
|
61443
|
+
disableTooltip(value = true) {
|
|
61444
|
+
this.getChart()
|
|
61445
|
+
.getComponentsByKey('tooltip')
|
|
61446
|
+
.forEach(tooltip => (tooltip.enable = !value));
|
|
61447
|
+
}
|
|
61417
61448
|
showCrosshair(cb) {
|
|
61418
61449
|
var _a;
|
|
61419
61450
|
(_a = this._chart) === null || _a === void 0 ? void 0 : _a.showCrosshair(cb);
|
|
@@ -64434,7 +64465,8 @@
|
|
|
64434
64465
|
super(...arguments);
|
|
64435
64466
|
this._cacheDimensionInfo = null;
|
|
64436
64467
|
this.onMouseMove = (params) => {
|
|
64437
|
-
|
|
64468
|
+
var _a, _b, _c, _d;
|
|
64469
|
+
if (!params || ((_d = (_c = (_b = (_a = params.chart) === null || _a === void 0 ? void 0 : _a.getOption()) === null || _b === void 0 ? void 0 : _b.globalInstance) === null || _c === void 0 ? void 0 : _c.disableDimensionHoverEvent) === null || _d === void 0 ? void 0 : _d.call(_c))) {
|
|
64438
64470
|
return;
|
|
64439
64471
|
}
|
|
64440
64472
|
const x = params.event.viewX;
|
|
@@ -64456,7 +64488,8 @@
|
|
|
64456
64488
|
}
|
|
64457
64489
|
};
|
|
64458
64490
|
this.onMouseOut = (params) => {
|
|
64459
|
-
|
|
64491
|
+
var _a, _b, _c, _d;
|
|
64492
|
+
if (!params || ((_d = (_c = (_b = (_a = params.chart) === null || _a === void 0 ? void 0 : _a.getOption()) === null || _b === void 0 ? void 0 : _b.globalInstance) === null || _c === void 0 ? void 0 : _c.disableDimensionHoverEvent) === null || _d === void 0 ? void 0 : _d.call(_c))) {
|
|
64460
64493
|
return;
|
|
64461
64494
|
}
|
|
64462
64495
|
this._callback.call(null, Object.assign(Object.assign({}, params), { action: 'leave', dimensionInfo: this._cacheDimensionInfo ? this._cacheDimensionInfo.slice() : [] }));
|
|
@@ -71754,6 +71787,9 @@
|
|
|
71754
71787
|
}
|
|
71755
71788
|
shouldHandleTooltip(params, info) {
|
|
71756
71789
|
var _a, _b;
|
|
71790
|
+
if (!this.component.enable) {
|
|
71791
|
+
return false;
|
|
71792
|
+
}
|
|
71757
71793
|
if (isNil$1(info)) {
|
|
71758
71794
|
return false;
|
|
71759
71795
|
}
|
|
@@ -95665,11 +95701,15 @@
|
|
|
95665
95701
|
});
|
|
95666
95702
|
return originDatum;
|
|
95667
95703
|
};
|
|
95704
|
+
const transform = region.getOption().globalInstance.getStage().window.getViewBoxTransform().getInverse();
|
|
95668
95705
|
const getMockEvent = (originPos) => {
|
|
95669
95706
|
var _a, _b;
|
|
95670
95707
|
const pos = bound(originPos);
|
|
95671
|
-
const
|
|
95672
|
-
const
|
|
95708
|
+
const tempX = (_a = opt.x) !== null && _a !== void 0 ? _a : regionPos.x + pos.x;
|
|
95709
|
+
const tempY = (_b = opt.y) !== null && _b !== void 0 ? _b : regionPos.y + pos.y;
|
|
95710
|
+
const canvasPoint = { x: 0, y: 0 };
|
|
95711
|
+
transform.transformPoint({ x: tempX, y: tempY }, canvasPoint);
|
|
95712
|
+
const { x: canvasX, y: canvasY } = canvasPoint;
|
|
95673
95713
|
return {
|
|
95674
95714
|
canvasX,
|
|
95675
95715
|
canvasY,
|
|
@@ -96047,6 +96087,7 @@
|
|
|
96047
96087
|
this.specKey = 'tooltip';
|
|
96048
96088
|
this.layoutType = 'none';
|
|
96049
96089
|
this._isReleased = false;
|
|
96090
|
+
this.enable = true;
|
|
96050
96091
|
this._alwaysShow = false;
|
|
96051
96092
|
this._eventList = [];
|
|
96052
96093
|
this._isTooltipShown = false;
|
|
@@ -103202,6 +103243,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
103202
103243
|
this._initMarkBrushState(componentIndex, '');
|
|
103203
103244
|
brushComponent.children[0].removeAllChild();
|
|
103204
103245
|
}
|
|
103246
|
+
_shouldEnableInteractive() {
|
|
103247
|
+
return this.getOption().getCompiler().getOption().interactive !== false;
|
|
103248
|
+
}
|
|
103205
103249
|
_createBrushComponent(region, componentIndex) {
|
|
103206
103250
|
var _a, _b;
|
|
103207
103251
|
const interactiveAttr = this._getBrushInteractiveAttr(region);
|
|
@@ -103212,33 +103256,45 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
103212
103256
|
this._cacheInteractiveRangeAttrs.push(interactiveAttr);
|
|
103213
103257
|
brush.addEventListener(IOperateType.brushActive, (e) => {
|
|
103214
103258
|
this._initMarkBrushState(componentIndex, OUT_BRUSH_STATE);
|
|
103215
|
-
this._emitEvent(exports.ChartEvent.brushActive, region);
|
|
103259
|
+
this._emitEvent(exports.ChartEvent.brushActive, region, e);
|
|
103216
103260
|
});
|
|
103217
103261
|
brush.addEventListener(IOperateType.drawStart, (e) => {
|
|
103262
|
+
if (this._spec.disableDimensionHoverWhenBrushing) {
|
|
103263
|
+
this._option.globalInstance.disableDimensionHoverEvent(true);
|
|
103264
|
+
}
|
|
103218
103265
|
this._setRegionMarkPickable(region, true);
|
|
103219
|
-
this._emitEvent(exports.ChartEvent.brushStart, region);
|
|
103266
|
+
this._emitEvent(exports.ChartEvent.brushStart, region, e);
|
|
103220
103267
|
});
|
|
103221
103268
|
brush.addEventListener(IOperateType.moveStart, (e) => {
|
|
103269
|
+
if (this._spec.disableDimensionHoverWhenBrushing) {
|
|
103270
|
+
this._option.globalInstance.disableDimensionHoverEvent(true);
|
|
103271
|
+
}
|
|
103222
103272
|
this._setRegionMarkPickable(region, true);
|
|
103223
|
-
this._emitEvent(exports.ChartEvent.brushStart, region);
|
|
103273
|
+
this._emitEvent(exports.ChartEvent.brushStart, region, e);
|
|
103224
103274
|
});
|
|
103225
103275
|
brush.addEventListener(IOperateType.drawing, (e) => {
|
|
103226
103276
|
this._setRegionMarkPickable(region, false);
|
|
103227
103277
|
this._handleBrushChange(region, e);
|
|
103228
|
-
this._emitEvent(exports.ChartEvent.brushChange, region);
|
|
103278
|
+
this._emitEvent(exports.ChartEvent.brushChange, region, e);
|
|
103229
103279
|
});
|
|
103230
103280
|
brush.addEventListener(IOperateType.moving, (e) => {
|
|
103231
103281
|
this._setRegionMarkPickable(region, false);
|
|
103232
103282
|
this._handleBrushChange(region, e);
|
|
103233
|
-
this._emitEvent(exports.ChartEvent.brushChange, region);
|
|
103283
|
+
this._emitEvent(exports.ChartEvent.brushChange, region, e);
|
|
103234
103284
|
});
|
|
103235
103285
|
brush.addEventListener(IOperateType.brushClear, (e) => {
|
|
103286
|
+
if (this._spec.disableDimensionHoverWhenBrushing) {
|
|
103287
|
+
this._option.globalInstance.disableDimensionHoverEvent(false);
|
|
103288
|
+
}
|
|
103236
103289
|
this._setRegionMarkPickable(region, true);
|
|
103237
103290
|
this._initMarkBrushState(componentIndex, '');
|
|
103238
|
-
this._emitEvent(exports.ChartEvent.brushClear, region);
|
|
103291
|
+
this._emitEvent(exports.ChartEvent.brushClear, region, e);
|
|
103239
103292
|
});
|
|
103240
103293
|
brush.addEventListener(IOperateType.drawEnd, (e) => {
|
|
103241
103294
|
var _a;
|
|
103295
|
+
if (this._spec.disableDimensionHoverWhenBrushing) {
|
|
103296
|
+
this._option.globalInstance.disableDimensionHoverEvent(false);
|
|
103297
|
+
}
|
|
103242
103298
|
this._setRegionMarkPickable(region, true);
|
|
103243
103299
|
const { operateMask } = e.detail;
|
|
103244
103300
|
const { updateElementsState = true } = this._spec;
|
|
@@ -103246,11 +103302,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
103246
103302
|
if (this._spec.onBrushEnd(e) === true) {
|
|
103247
103303
|
this.clearGraphic();
|
|
103248
103304
|
this._initMarkBrushState(componentIndex, '');
|
|
103249
|
-
this._emitEvent(exports.ChartEvent.brushClear, region);
|
|
103305
|
+
this._emitEvent(exports.ChartEvent.brushClear, region, e);
|
|
103250
103306
|
}
|
|
103251
103307
|
else {
|
|
103252
103308
|
this._spec.onBrushEnd(e);
|
|
103253
|
-
this._emitEvent(exports.ChartEvent.brushEnd, region);
|
|
103309
|
+
this._emitEvent(exports.ChartEvent.brushEnd, region, e);
|
|
103254
103310
|
}
|
|
103255
103311
|
}
|
|
103256
103312
|
else {
|
|
@@ -103258,10 +103314,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
103258
103314
|
if ((!this._spec.zoomWhenEmpty && inBrushData.length > 0) || !updateElementsState) {
|
|
103259
103315
|
this._setAxisAndDataZoom(operateMask, region);
|
|
103260
103316
|
}
|
|
103261
|
-
this._emitEvent(exports.ChartEvent.brushEnd, region);
|
|
103317
|
+
this._emitEvent(exports.ChartEvent.brushEnd, region, e);
|
|
103262
103318
|
}
|
|
103263
103319
|
});
|
|
103264
103320
|
brush.addEventListener(IOperateType.moveEnd, (e) => {
|
|
103321
|
+
if (this._spec.disableDimensionHoverWhenBrushing) {
|
|
103322
|
+
this._option.globalInstance.disableDimensionHoverEvent(false);
|
|
103323
|
+
}
|
|
103265
103324
|
this._setRegionMarkPickable(region, true);
|
|
103266
103325
|
const { operateMask } = e.detail;
|
|
103267
103326
|
const { updateElementsState = true } = this._spec;
|
|
@@ -103269,7 +103328,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
103269
103328
|
if ((!this._spec.zoomWhenEmpty && inBrushData.length > 0) || updateElementsState) {
|
|
103270
103329
|
this._setAxisAndDataZoom(operateMask, region);
|
|
103271
103330
|
}
|
|
103272
|
-
this._emitEvent(exports.ChartEvent.brushEnd, region);
|
|
103331
|
+
this._emitEvent(exports.ChartEvent.brushEnd, region, e);
|
|
103273
103332
|
});
|
|
103274
103333
|
}
|
|
103275
103334
|
_getBrushInteractiveAttr(region) {
|
|
@@ -103287,7 +103346,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
103287
103346
|
maxX: seriesRegionEndX
|
|
103288
103347
|
},
|
|
103289
103348
|
xRange: [seriesRegionStartX, seriesRegionEndX],
|
|
103290
|
-
yRange: [seriesRegionStartY, seriesRegionEndY]
|
|
103349
|
+
yRange: [seriesRegionStartY, seriesRegionEndY],
|
|
103350
|
+
interactive: this._shouldEnableInteractive()
|
|
103291
103351
|
};
|
|
103292
103352
|
}
|
|
103293
103353
|
_transformBrushedMarkAttr(brushedStyle) {
|
|
@@ -103308,6 +103368,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
103308
103368
|
}
|
|
103309
103369
|
_handleBrushChange(region, e) {
|
|
103310
103370
|
const { operateMask } = e.detail;
|
|
103371
|
+
this._operateMask = operateMask;
|
|
103311
103372
|
const { updateElementsState = true } = this._spec;
|
|
103312
103373
|
if (updateElementsState) {
|
|
103313
103374
|
this._reconfigItem(operateMask, region);
|
|
@@ -103332,7 +103393,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
103332
103393
|
}
|
|
103333
103394
|
return data;
|
|
103334
103395
|
}
|
|
103335
|
-
_emitEvent(eventType, region) {
|
|
103396
|
+
_emitEvent(eventType, region, e) {
|
|
103336
103397
|
var _a;
|
|
103337
103398
|
this.event.emit(eventType, {
|
|
103338
103399
|
model: this,
|
|
@@ -103349,7 +103410,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
103349
103410
|
linkedOutOfBrushElementsMap: this._linkedOutOfBrushElementsMap,
|
|
103350
103411
|
zoomRecord: this._zoomRecord
|
|
103351
103412
|
},
|
|
103352
|
-
vchart: (_a = this._option) === null || _a === void 0 ? void 0 : _a.globalInstance
|
|
103413
|
+
vchart: (_a = this._option) === null || _a === void 0 ? void 0 : _a.globalInstance,
|
|
103414
|
+
event: e
|
|
103353
103415
|
});
|
|
103354
103416
|
}
|
|
103355
103417
|
_reconfigItem(operateMask, region) {
|
|
@@ -103604,6 +103666,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
103604
103666
|
this._brushComponents = null;
|
|
103605
103667
|
}
|
|
103606
103668
|
}
|
|
103669
|
+
clearBrushStateAndMask() {
|
|
103670
|
+
this._relativeRegions.forEach((region, componentIndex) => {
|
|
103671
|
+
this._initMarkBrushState(componentIndex, '');
|
|
103672
|
+
this._brushComponents[componentIndex].children[0].removeAllChild();
|
|
103673
|
+
});
|
|
103674
|
+
}
|
|
103607
103675
|
}
|
|
103608
103676
|
Brush.type = ComponentTypeEnum.brush;
|
|
103609
103677
|
Brush.builtInTheme = {
|