@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.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,
|
|
@@ -53857,7 +53868,7 @@ let Event$1 = class Event {
|
|
|
53857
53868
|
if (ComposedEventCtor) {
|
|
53858
53869
|
const composedEvent = new ComposedEventCtor(this._eventDispatcher, this._mode);
|
|
53859
53870
|
composedEvent.register(eType, handler);
|
|
53860
|
-
this._composedEventMap.set(callback, {
|
|
53871
|
+
this._composedEventMap.set(handler.callback, {
|
|
53861
53872
|
eventType: eType,
|
|
53862
53873
|
event: composedEvent
|
|
53863
53874
|
});
|
|
@@ -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 = [];
|
|
@@ -60370,6 +60384,7 @@ class VChart {
|
|
|
60370
60384
|
this._observer = null;
|
|
60371
60385
|
this._context = {};
|
|
60372
60386
|
this._renderState = RenderStateEnum.render;
|
|
60387
|
+
this._disableDimensionHoverEvent = false;
|
|
60373
60388
|
this._doResize = () => {
|
|
60374
60389
|
const { width, height } = this.getCurrentSize();
|
|
60375
60390
|
if (this._currentSize.width !== width || this._currentSize.height !== height) {
|
|
@@ -60514,7 +60529,7 @@ class VChart {
|
|
|
60514
60529
|
this._compiler.updateLayoutTag();
|
|
60515
60530
|
this._setFontFamilyTheme(this.getTheme('fontFamily'));
|
|
60516
60531
|
this._initDataSet(this._option.dataSet);
|
|
60517
|
-
this._autoSize = isTrueBrowseEnv ? (_g = (_f = spec.autoFit) !== null && _f !== void 0 ? _f : this._option.autoFit) !== null && _g !== void 0 ? _g : true : false;
|
|
60532
|
+
this._autoSize = isTrueBrowseEnv ? ((_g = (_f = spec.autoFit) !== null && _f !== void 0 ? _f : this._option.autoFit) !== null && _g !== void 0 ? _g : true) : false;
|
|
60518
60533
|
this._bindResizeEvent();
|
|
60519
60534
|
this._bindViewEvent();
|
|
60520
60535
|
this._initChartPlugin();
|
|
@@ -61167,7 +61182,7 @@ class VChart {
|
|
|
61167
61182
|
resize = true;
|
|
61168
61183
|
}
|
|
61169
61184
|
const lasAutoSize = this._autoSize;
|
|
61170
|
-
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;
|
|
61185
|
+
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;
|
|
61171
61186
|
if (this._autoSize !== lasAutoSize) {
|
|
61172
61187
|
resize = true;
|
|
61173
61188
|
}
|
|
@@ -61408,6 +61423,22 @@ class VChart {
|
|
|
61408
61423
|
var _a;
|
|
61409
61424
|
return (_a = this._chart) === null || _a === void 0 ? void 0 : _a.setDimensionIndex(value, opt);
|
|
61410
61425
|
}
|
|
61426
|
+
disableDimensionHoverEvent(value) {
|
|
61427
|
+
if (value !== undefined) {
|
|
61428
|
+
this._disableDimensionHoverEvent = value;
|
|
61429
|
+
}
|
|
61430
|
+
return this._disableDimensionHoverEvent;
|
|
61431
|
+
}
|
|
61432
|
+
disableCrossHair(value = true) {
|
|
61433
|
+
this.getChart()
|
|
61434
|
+
.getComponentsByKey('crosshair')
|
|
61435
|
+
.forEach(crosshair => (crosshair.enable = !value));
|
|
61436
|
+
}
|
|
61437
|
+
disableTooltip(value = true) {
|
|
61438
|
+
this.getChart()
|
|
61439
|
+
.getComponentsByKey('tooltip')
|
|
61440
|
+
.forEach(tooltip => (tooltip.enable = !value));
|
|
61441
|
+
}
|
|
61411
61442
|
showCrosshair(cb) {
|
|
61412
61443
|
var _a;
|
|
61413
61444
|
(_a = this._chart) === null || _a === void 0 ? void 0 : _a.showCrosshair(cb);
|
|
@@ -64428,7 +64459,8 @@ class DimensionHoverEvent extends DimensionEvent {
|
|
|
64428
64459
|
super(...arguments);
|
|
64429
64460
|
this._cacheDimensionInfo = null;
|
|
64430
64461
|
this.onMouseMove = (params) => {
|
|
64431
|
-
|
|
64462
|
+
var _a, _b, _c, _d;
|
|
64463
|
+
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))) {
|
|
64432
64464
|
return;
|
|
64433
64465
|
}
|
|
64434
64466
|
const x = params.event.viewX;
|
|
@@ -64450,7 +64482,8 @@ class DimensionHoverEvent extends DimensionEvent {
|
|
|
64450
64482
|
}
|
|
64451
64483
|
};
|
|
64452
64484
|
this.onMouseOut = (params) => {
|
|
64453
|
-
|
|
64485
|
+
var _a, _b, _c, _d;
|
|
64486
|
+
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))) {
|
|
64454
64487
|
return;
|
|
64455
64488
|
}
|
|
64456
64489
|
this._callback.call(null, Object.assign(Object.assign({}, params), { action: 'leave', dimensionInfo: this._cacheDimensionInfo ? this._cacheDimensionInfo.slice() : [] }));
|
|
@@ -71748,6 +71781,9 @@ class BaseTooltipProcessor {
|
|
|
71748
71781
|
}
|
|
71749
71782
|
shouldHandleTooltip(params, info) {
|
|
71750
71783
|
var _a, _b;
|
|
71784
|
+
if (!this.component.enable) {
|
|
71785
|
+
return false;
|
|
71786
|
+
}
|
|
71751
71787
|
if (isNil$1(info)) {
|
|
71752
71788
|
return false;
|
|
71753
71789
|
}
|
|
@@ -95659,11 +95695,15 @@ function showTooltip(datum, options, component) {
|
|
|
95659
95695
|
});
|
|
95660
95696
|
return originDatum;
|
|
95661
95697
|
};
|
|
95698
|
+
const transform = region.getOption().globalInstance.getStage().window.getViewBoxTransform().getInverse();
|
|
95662
95699
|
const getMockEvent = (originPos) => {
|
|
95663
95700
|
var _a, _b;
|
|
95664
95701
|
const pos = bound(originPos);
|
|
95665
|
-
const
|
|
95666
|
-
const
|
|
95702
|
+
const tempX = (_a = opt.x) !== null && _a !== void 0 ? _a : regionPos.x + pos.x;
|
|
95703
|
+
const tempY = (_b = opt.y) !== null && _b !== void 0 ? _b : regionPos.y + pos.y;
|
|
95704
|
+
const canvasPoint = { x: 0, y: 0 };
|
|
95705
|
+
transform.transformPoint({ x: tempX, y: tempY }, canvasPoint);
|
|
95706
|
+
const { x: canvasX, y: canvasY } = canvasPoint;
|
|
95667
95707
|
return {
|
|
95668
95708
|
canvasX,
|
|
95669
95709
|
canvasY,
|
|
@@ -96041,6 +96081,7 @@ class Tooltip extends BaseComponent {
|
|
|
96041
96081
|
this.specKey = 'tooltip';
|
|
96042
96082
|
this.layoutType = 'none';
|
|
96043
96083
|
this._isReleased = false;
|
|
96084
|
+
this.enable = true;
|
|
96044
96085
|
this._alwaysShow = false;
|
|
96045
96086
|
this._eventList = [];
|
|
96046
96087
|
this._isTooltipShown = false;
|
|
@@ -103196,6 +103237,9 @@ class Brush extends BaseComponent {
|
|
|
103196
103237
|
this._initMarkBrushState(componentIndex, '');
|
|
103197
103238
|
brushComponent.children[0].removeAllChild();
|
|
103198
103239
|
}
|
|
103240
|
+
_shouldEnableInteractive() {
|
|
103241
|
+
return this.getOption().getCompiler().getOption().interactive !== false;
|
|
103242
|
+
}
|
|
103199
103243
|
_createBrushComponent(region, componentIndex) {
|
|
103200
103244
|
var _a, _b;
|
|
103201
103245
|
const interactiveAttr = this._getBrushInteractiveAttr(region);
|
|
@@ -103206,33 +103250,45 @@ class Brush extends BaseComponent {
|
|
|
103206
103250
|
this._cacheInteractiveRangeAttrs.push(interactiveAttr);
|
|
103207
103251
|
brush.addEventListener(IOperateType.brushActive, (e) => {
|
|
103208
103252
|
this._initMarkBrushState(componentIndex, OUT_BRUSH_STATE);
|
|
103209
|
-
this._emitEvent(ChartEvent.brushActive, region);
|
|
103253
|
+
this._emitEvent(ChartEvent.brushActive, region, e);
|
|
103210
103254
|
});
|
|
103211
103255
|
brush.addEventListener(IOperateType.drawStart, (e) => {
|
|
103256
|
+
if (this._spec.disableDimensionHoverWhenBrushing) {
|
|
103257
|
+
this._option.globalInstance.disableDimensionHoverEvent(true);
|
|
103258
|
+
}
|
|
103212
103259
|
this._setRegionMarkPickable(region, true);
|
|
103213
|
-
this._emitEvent(ChartEvent.brushStart, region);
|
|
103260
|
+
this._emitEvent(ChartEvent.brushStart, region, e);
|
|
103214
103261
|
});
|
|
103215
103262
|
brush.addEventListener(IOperateType.moveStart, (e) => {
|
|
103263
|
+
if (this._spec.disableDimensionHoverWhenBrushing) {
|
|
103264
|
+
this._option.globalInstance.disableDimensionHoverEvent(true);
|
|
103265
|
+
}
|
|
103216
103266
|
this._setRegionMarkPickable(region, true);
|
|
103217
|
-
this._emitEvent(ChartEvent.brushStart, region);
|
|
103267
|
+
this._emitEvent(ChartEvent.brushStart, region, e);
|
|
103218
103268
|
});
|
|
103219
103269
|
brush.addEventListener(IOperateType.drawing, (e) => {
|
|
103220
103270
|
this._setRegionMarkPickable(region, false);
|
|
103221
103271
|
this._handleBrushChange(region, e);
|
|
103222
|
-
this._emitEvent(ChartEvent.brushChange, region);
|
|
103272
|
+
this._emitEvent(ChartEvent.brushChange, region, e);
|
|
103223
103273
|
});
|
|
103224
103274
|
brush.addEventListener(IOperateType.moving, (e) => {
|
|
103225
103275
|
this._setRegionMarkPickable(region, false);
|
|
103226
103276
|
this._handleBrushChange(region, e);
|
|
103227
|
-
this._emitEvent(ChartEvent.brushChange, region);
|
|
103277
|
+
this._emitEvent(ChartEvent.brushChange, region, e);
|
|
103228
103278
|
});
|
|
103229
103279
|
brush.addEventListener(IOperateType.brushClear, (e) => {
|
|
103280
|
+
if (this._spec.disableDimensionHoverWhenBrushing) {
|
|
103281
|
+
this._option.globalInstance.disableDimensionHoverEvent(false);
|
|
103282
|
+
}
|
|
103230
103283
|
this._setRegionMarkPickable(region, true);
|
|
103231
103284
|
this._initMarkBrushState(componentIndex, '');
|
|
103232
|
-
this._emitEvent(ChartEvent.brushClear, region);
|
|
103285
|
+
this._emitEvent(ChartEvent.brushClear, region, e);
|
|
103233
103286
|
});
|
|
103234
103287
|
brush.addEventListener(IOperateType.drawEnd, (e) => {
|
|
103235
103288
|
var _a;
|
|
103289
|
+
if (this._spec.disableDimensionHoverWhenBrushing) {
|
|
103290
|
+
this._option.globalInstance.disableDimensionHoverEvent(false);
|
|
103291
|
+
}
|
|
103236
103292
|
this._setRegionMarkPickable(region, true);
|
|
103237
103293
|
const { operateMask } = e.detail;
|
|
103238
103294
|
const { updateElementsState = true } = this._spec;
|
|
@@ -103240,11 +103296,11 @@ class Brush extends BaseComponent {
|
|
|
103240
103296
|
if (this._spec.onBrushEnd(e) === true) {
|
|
103241
103297
|
this.clearGraphic();
|
|
103242
103298
|
this._initMarkBrushState(componentIndex, '');
|
|
103243
|
-
this._emitEvent(ChartEvent.brushClear, region);
|
|
103299
|
+
this._emitEvent(ChartEvent.brushClear, region, e);
|
|
103244
103300
|
}
|
|
103245
103301
|
else {
|
|
103246
103302
|
this._spec.onBrushEnd(e);
|
|
103247
|
-
this._emitEvent(ChartEvent.brushEnd, region);
|
|
103303
|
+
this._emitEvent(ChartEvent.brushEnd, region, e);
|
|
103248
103304
|
}
|
|
103249
103305
|
}
|
|
103250
103306
|
else {
|
|
@@ -103252,10 +103308,13 @@ class Brush extends BaseComponent {
|
|
|
103252
103308
|
if ((!this._spec.zoomWhenEmpty && inBrushData.length > 0) || !updateElementsState) {
|
|
103253
103309
|
this._setAxisAndDataZoom(operateMask, region);
|
|
103254
103310
|
}
|
|
103255
|
-
this._emitEvent(ChartEvent.brushEnd, region);
|
|
103311
|
+
this._emitEvent(ChartEvent.brushEnd, region, e);
|
|
103256
103312
|
}
|
|
103257
103313
|
});
|
|
103258
103314
|
brush.addEventListener(IOperateType.moveEnd, (e) => {
|
|
103315
|
+
if (this._spec.disableDimensionHoverWhenBrushing) {
|
|
103316
|
+
this._option.globalInstance.disableDimensionHoverEvent(false);
|
|
103317
|
+
}
|
|
103259
103318
|
this._setRegionMarkPickable(region, true);
|
|
103260
103319
|
const { operateMask } = e.detail;
|
|
103261
103320
|
const { updateElementsState = true } = this._spec;
|
|
@@ -103263,7 +103322,7 @@ class Brush extends BaseComponent {
|
|
|
103263
103322
|
if ((!this._spec.zoomWhenEmpty && inBrushData.length > 0) || updateElementsState) {
|
|
103264
103323
|
this._setAxisAndDataZoom(operateMask, region);
|
|
103265
103324
|
}
|
|
103266
|
-
this._emitEvent(ChartEvent.brushEnd, region);
|
|
103325
|
+
this._emitEvent(ChartEvent.brushEnd, region, e);
|
|
103267
103326
|
});
|
|
103268
103327
|
}
|
|
103269
103328
|
_getBrushInteractiveAttr(region) {
|
|
@@ -103281,7 +103340,8 @@ class Brush extends BaseComponent {
|
|
|
103281
103340
|
maxX: seriesRegionEndX
|
|
103282
103341
|
},
|
|
103283
103342
|
xRange: [seriesRegionStartX, seriesRegionEndX],
|
|
103284
|
-
yRange: [seriesRegionStartY, seriesRegionEndY]
|
|
103343
|
+
yRange: [seriesRegionStartY, seriesRegionEndY],
|
|
103344
|
+
interactive: this._shouldEnableInteractive()
|
|
103285
103345
|
};
|
|
103286
103346
|
}
|
|
103287
103347
|
_transformBrushedMarkAttr(brushedStyle) {
|
|
@@ -103302,6 +103362,7 @@ class Brush extends BaseComponent {
|
|
|
103302
103362
|
}
|
|
103303
103363
|
_handleBrushChange(region, e) {
|
|
103304
103364
|
const { operateMask } = e.detail;
|
|
103365
|
+
this._operateMask = operateMask;
|
|
103305
103366
|
const { updateElementsState = true } = this._spec;
|
|
103306
103367
|
if (updateElementsState) {
|
|
103307
103368
|
this._reconfigItem(operateMask, region);
|
|
@@ -103326,7 +103387,7 @@ class Brush extends BaseComponent {
|
|
|
103326
103387
|
}
|
|
103327
103388
|
return data;
|
|
103328
103389
|
}
|
|
103329
|
-
_emitEvent(eventType, region) {
|
|
103390
|
+
_emitEvent(eventType, region, e) {
|
|
103330
103391
|
var _a;
|
|
103331
103392
|
this.event.emit(eventType, {
|
|
103332
103393
|
model: this,
|
|
@@ -103343,7 +103404,8 @@ class Brush extends BaseComponent {
|
|
|
103343
103404
|
linkedOutOfBrushElementsMap: this._linkedOutOfBrushElementsMap,
|
|
103344
103405
|
zoomRecord: this._zoomRecord
|
|
103345
103406
|
},
|
|
103346
|
-
vchart: (_a = this._option) === null || _a === void 0 ? void 0 : _a.globalInstance
|
|
103407
|
+
vchart: (_a = this._option) === null || _a === void 0 ? void 0 : _a.globalInstance,
|
|
103408
|
+
event: e
|
|
103347
103409
|
});
|
|
103348
103410
|
}
|
|
103349
103411
|
_reconfigItem(operateMask, region) {
|
|
@@ -103598,6 +103660,12 @@ class Brush extends BaseComponent {
|
|
|
103598
103660
|
this._brushComponents = null;
|
|
103599
103661
|
}
|
|
103600
103662
|
}
|
|
103663
|
+
clearBrushStateAndMask() {
|
|
103664
|
+
this._relativeRegions.forEach((region, componentIndex) => {
|
|
103665
|
+
this._initMarkBrushState(componentIndex, '');
|
|
103666
|
+
this._brushComponents[componentIndex].children[0].removeAllChild();
|
|
103667
|
+
});
|
|
103668
|
+
}
|
|
103601
103669
|
}
|
|
103602
103670
|
Brush.type = ComponentTypeEnum.brush;
|
|
103603
103671
|
Brush.builtInTheme = {
|