@visactor/vchart 2.0.12 → 2.0.13-alpha.1

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.
Files changed (42) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.es.js +45 -39
  3. package/build/index.js +45 -39
  4. package/build/index.min.js +2 -2
  5. package/build/tsconfig.tsbuildinfo +1 -1
  6. package/cjs/animation/callback-disappear.js +1 -1
  7. package/cjs/animation/callback-disappear.js.map +1 -1
  8. package/cjs/animation/interface.d.ts +1 -1
  9. package/cjs/animation/interface.js.map +1 -1
  10. package/cjs/component/brush/brush.js +13 -12
  11. package/cjs/component/brush/brush.js.map +1 -1
  12. package/cjs/component/brush/interface.d.ts +2 -1
  13. package/cjs/component/brush/interface.js.map +1 -1
  14. package/cjs/component/marker/mark-point/base-mark-point.js +22 -20
  15. package/cjs/component/marker/mark-point/base-mark-point.js.map +1 -1
  16. package/cjs/constant/gradient.js +2 -1
  17. package/cjs/constant/scroll-bar.js +1 -2
  18. package/cjs/constant/sunburst.js +1 -1
  19. package/cjs/constant/waterfall.js +1 -1
  20. package/cjs/constant/word-cloud.js +1 -1
  21. package/cjs/core/interface.js +1 -1
  22. package/cjs/core/util.js +1 -1
  23. package/cjs/core/vchart.js +1 -1
  24. package/esm/animation/callback-disappear.js +1 -1
  25. package/esm/animation/callback-disappear.js.map +1 -1
  26. package/esm/animation/interface.d.ts +1 -1
  27. package/esm/animation/interface.js.map +1 -1
  28. package/esm/component/brush/brush.js +13 -12
  29. package/esm/component/brush/brush.js.map +1 -1
  30. package/esm/component/brush/interface.d.ts +2 -1
  31. package/esm/component/brush/interface.js.map +1 -1
  32. package/esm/component/marker/mark-point/base-mark-point.js +22 -20
  33. package/esm/component/marker/mark-point/base-mark-point.js.map +1 -1
  34. package/esm/constant/gradient.js +2 -1
  35. package/esm/constant/scroll-bar.js +1 -2
  36. package/esm/constant/sunburst.js +1 -1
  37. package/esm/constant/waterfall.js +1 -1
  38. package/esm/constant/word-cloud.js +1 -1
  39. package/esm/core/interface.js +1 -1
  40. package/esm/core/util.js +1 -1
  41. package/esm/core/vchart.js +1 -1
  42. package/package.json +7 -7
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._beforeBrushEvent(e)) return;
51099
51100
  const {
51100
51101
  updateTrigger = DEFAULT_BRUSH_ATTRIBUTES.updateTrigger,
51101
51102
  endTrigger = DEFAULT_BRUSH_ATTRIBUTES.endTrigger,
@@ -51103,11 +51104,11 @@ let Brush$1 = class Brush extends AbstractComponent {
51103
51104
  } = this.attribute;
51104
51105
  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
51106
  }, 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)));
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))));
51107
51108
  }, this._onBrushingWithDelay = 0 === this.attribute.delayTime ? this._onBrushing : delayMap$1[this.attribute.delayType](this._onBrushing, this.attribute.delayTime), this._onBrushEnd = e => {
51108
51109
  this._releaseBrushUpdateEvents(), e.preventDefault(), this._activeDrawState && this._drawEnd(e), this._activeMoveState && this._moveEnd(e), this._activeDrawState = !1, this._activeMoveState = !1;
51109
51110
  }, this._onBrushClear = e => {
51110
- e.preventDefault(), this._isEmptyMask() || (this._clearMask(), this._dispatchBrushEvent(IOperateType.brushClear, e)), this._activeDrawState = !1, this._activeMoveState = !1;
51111
+ !1 !== this._beforeBrushEvent(e) && (e.preventDefault(), this._isEmptyMask() || (this._clearMask(), this._dispatchBrushEvent(IOperateType.brushClear, e)), this._activeDrawState = !1, this._activeMoveState = !1);
51111
51112
  };
51112
51113
  }
51113
51114
  _bindBrushEvents() {
@@ -51312,6 +51313,10 @@ let Brush$1 = class Brush extends AbstractComponent {
51312
51313
  pos = this.eventPosToStagePos(e);
51313
51314
  return pos.x > maxX || pos.x < minX || pos.y > maxY || pos.y < minY;
51314
51315
  }
51316
+ _beforeBrushEvent(e) {
51317
+ var _a, _b;
51318
+ return null === (_b = (_a = this.attribute).beforeBrushChange) || void 0 === _b ? void 0 : _b.call(_a, e);
51319
+ }
51315
51320
  _dispatchBrushEvent(operateType, e) {
51316
51321
  this._dispatchEvent(operateType, {
51317
51322
  operateMask: this._operatingMask,
@@ -59687,7 +59692,7 @@ class CallbackDisappearAnimate extends AStageAnimate {
59687
59692
  }
59688
59693
  afterStageRender(stage, canvas) {
59689
59694
  var _a, _b;
59690
- (_b = (_a = this.params) === null || _a === void 0 ? void 0 : _a.callBack) === null || _b === void 0 ? void 0 : _b.call(_a, stage, canvas, this.currentAnimationRatio, this.animationTime);
59695
+ return (_b = (_a = this.params) === null || _a === void 0 ? void 0 : _a.callBack) === null || _b === void 0 ? void 0 : _b.call(_a, stage, canvas, this.currentAnimationRatio, this.animationTime);
59691
59696
  }
59692
59697
  }
59693
59698
 
@@ -102732,9 +102737,9 @@ class BaseMarkPoint extends BaseMarker {
102732
102737
  return 'cartesian';
102733
102738
  }
102734
102739
  _createMarkerComponent() {
102735
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7;
102740
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8;
102736
102741
  const { itemContent = {}, itemLine = {}, targetSymbol = {} } = this._spec;
102737
- const _8 = itemContent, { type = 'text', text: label, symbol, image, richText, customMark, textStyle, symbolStyle, imageStyle, richTextStyle, customMarkStyle, style = {}, state = {} } = _8, restItemContent = __rest$e(_8, ["type", "text", "symbol", "image", "richText", "customMark", "textStyle", "symbolStyle", "imageStyle", "richTextStyle", "customMarkStyle", "style", "state"]);
102742
+ const _9 = itemContent, { type = 'text', text: label, symbol, image, richText, customMark, textStyle, symbolStyle, imageStyle, richTextStyle, customMarkStyle, style = {}, state = {} } = _9, restItemContent = __rest$e(_9, ["type", "text", "symbol", "image", "richText", "customMark", "textStyle", "symbolStyle", "imageStyle", "richTextStyle", "customMarkStyle", "style", "state"]);
102738
102743
  let itemContentState = null;
102739
102744
  let itemContentStyle = null;
102740
102745
  let defaultStyle = {};
@@ -102744,61 +102749,61 @@ class BaseMarkPoint extends BaseMarker {
102744
102749
  dx: 0,
102745
102750
  dy: 0
102746
102751
  };
102747
- itemContentStyle = transformLabelAttributes(merge$1(defaultStyle, (_b = label !== null && label !== void 0 ? label : textStyle) !== null && _b !== void 0 ? _b : style), this._markerData, this._markAttributeContext);
102752
+ itemContentStyle = transformLabelAttributes(Object.assign(Object.assign({}, label), { style: merge$1(defaultStyle, (_c = (_b = label === null || label === void 0 ? void 0 : label.textStyle) !== null && _b !== void 0 ? _b : textStyle) !== null && _c !== void 0 ? _c : style) }), this._markerData, this._markAttributeContext);
102748
102753
  }
102749
102754
  else if (type === 'richText') {
102750
- itemContentState = (_c = richText === null || richText === void 0 ? void 0 : richText.state) !== null && _c !== void 0 ? _c : state;
102755
+ itemContentState = (_d = richText === null || richText === void 0 ? void 0 : richText.state) !== null && _d !== void 0 ? _d : state;
102751
102756
  defaultStyle = {
102752
102757
  width: 100,
102753
102758
  height: 100
102754
102759
  };
102755
- itemContentStyle = transformStyle(merge$1(defaultStyle, (_e = (_d = richText === null || richText === void 0 ? void 0 : richText.style) !== null && _d !== void 0 ? _d : richTextStyle) !== null && _e !== void 0 ? _e : style), this._markerData, this._markAttributeContext);
102760
+ itemContentStyle = transformStyle(merge$1(defaultStyle, (_f = (_e = richText === null || richText === void 0 ? void 0 : richText.style) !== null && _e !== void 0 ? _e : richTextStyle) !== null && _f !== void 0 ? _f : style), this._markerData, this._markAttributeContext);
102756
102761
  }
102757
102762
  else if (type === 'symbol') {
102758
- itemContentState = (_f = symbol === null || symbol === void 0 ? void 0 : symbol.state) !== null && _f !== void 0 ? _f : state;
102763
+ itemContentState = (_g = symbol === null || symbol === void 0 ? void 0 : symbol.state) !== null && _g !== void 0 ? _g : state;
102759
102764
  defaultStyle = {
102760
102765
  symbolType: 'star',
102761
102766
  fill: 'rgb(48, 115, 242)',
102762
102767
  fillOpacity: 0.8,
102763
102768
  size: 20
102764
102769
  };
102765
- itemContentStyle = transformToGraphic(transformStyle(merge$1(defaultStyle, (_h = (_g = symbol === null || symbol === void 0 ? void 0 : symbol.style) !== null && _g !== void 0 ? _g : symbolStyle) !== null && _h !== void 0 ? _h : style), this._markerData, this._markAttributeContext));
102770
+ itemContentStyle = transformToGraphic(transformStyle(merge$1(defaultStyle, (_j = (_h = symbol === null || symbol === void 0 ? void 0 : symbol.style) !== null && _h !== void 0 ? _h : symbolStyle) !== null && _j !== void 0 ? _j : style), this._markerData, this._markAttributeContext));
102766
102771
  }
102767
102772
  else if (type === 'image') {
102768
- itemContentState = (_j = image === null || image === void 0 ? void 0 : image.state) !== null && _j !== void 0 ? _j : state;
102773
+ itemContentState = (_k = image === null || image === void 0 ? void 0 : image.state) !== null && _k !== void 0 ? _k : state;
102769
102774
  defaultStyle = {
102770
102775
  width: 80,
102771
102776
  height: 80
102772
102777
  };
102773
- itemContentStyle = transformStyle(merge$1(defaultStyle, (_l = (_k = image === null || image === void 0 ? void 0 : image.style) !== null && _k !== void 0 ? _k : imageStyle) !== null && _l !== void 0 ? _l : style), this._markerData, this._markAttributeContext);
102778
+ itemContentStyle = transformStyle(merge$1(defaultStyle, (_m = (_l = image === null || image === void 0 ? void 0 : image.style) !== null && _l !== void 0 ? _l : imageStyle) !== null && _m !== void 0 ? _m : style), this._markerData, this._markAttributeContext);
102774
102779
  }
102775
102780
  else if (type === 'custom') {
102776
- itemContentState = (_m = customMark === null || customMark === void 0 ? void 0 : customMark.state) !== null && _m !== void 0 ? _m : state;
102777
- itemContentStyle = transformStyle((_p = (_o = customMark === null || customMark === void 0 ? void 0 : customMark.style) !== null && _o !== void 0 ? _o : customMarkStyle) !== null && _p !== void 0 ? _p : style, this._markerData, this._markAttributeContext);
102781
+ itemContentState = (_o = customMark === null || customMark === void 0 ? void 0 : customMark.state) !== null && _o !== void 0 ? _o : state;
102782
+ itemContentStyle = transformStyle((_q = (_p = customMark === null || customMark === void 0 ? void 0 : customMark.style) !== null && _p !== void 0 ? _p : customMarkStyle) !== null && _q !== void 0 ? _q : style, this._markerData, this._markAttributeContext);
102778
102783
  }
102779
102784
  const markPointAttrs = {
102780
102785
  zIndex: this.layoutZIndex,
102781
- interactive: (_q = this._spec.interactive) !== null && _q !== void 0 ? _q : true,
102782
- hover: (_r = this._spec.interactive) !== null && _r !== void 0 ? _r : true,
102783
- select: (_s = this._spec.interactive) !== null && _s !== void 0 ? _s : true,
102786
+ interactive: (_r = this._spec.interactive) !== null && _r !== void 0 ? _r : true,
102787
+ hover: (_s = this._spec.interactive) !== null && _s !== void 0 ? _s : true,
102788
+ select: (_t = this._spec.interactive) !== null && _t !== void 0 ? _t : true,
102784
102789
  position: { x: 0, y: 0 },
102785
- clipInRange: (_t = this._spec.clip) !== null && _t !== void 0 ? _t : false,
102790
+ clipInRange: (_u = this._spec.clip) !== null && _u !== void 0 ? _u : false,
102786
102791
  itemContent: Object.assign(Object.assign({ type, offsetX: transformOffset(itemContent.offsetX, this._relativeSeries.getRegion()), offsetY: transformOffset(itemContent.offsetX, this._relativeSeries.getRegion()) }, restItemContent), { style: transformStyle(itemContentStyle, this._markerData, this._markAttributeContext) }),
102787
102792
  targetSymbol: {
102788
- offset: (_u = targetSymbol.offset) !== null && _u !== void 0 ? _u : 0,
102789
- visible: (_v = targetSymbol.visible) !== null && _v !== void 0 ? _v : false,
102790
- size: (_w = targetSymbol.size) !== null && _w !== void 0 ? _w : 20,
102793
+ offset: (_v = targetSymbol.offset) !== null && _v !== void 0 ? _v : 0,
102794
+ visible: (_w = targetSymbol.visible) !== null && _w !== void 0 ? _w : false,
102795
+ size: (_x = targetSymbol.size) !== null && _x !== void 0 ? _x : 20,
102791
102796
  style: transformStyle(targetSymbol.style, this._markerData, this._markAttributeContext)
102792
102797
  },
102793
102798
  state: {
102794
- line: transformState((_y = (_x = this._spec.itemLine.line) === null || _x === void 0 ? void 0 : _x.state) !== null && _y !== void 0 ? _y : {}, this._markerData, this._markAttributeContext),
102795
- lineStartSymbol: transformState((_0 = (_z = this._spec.itemLine.startSymbol) === null || _z === void 0 ? void 0 : _z.state) !== null && _0 !== void 0 ? _0 : {}, this._markerData, this._markAttributeContext),
102796
- lineEndSymbol: transformState((_2 = (_1 = this._spec.itemLine.endSymbol) === null || _1 === void 0 ? void 0 : _1.state) !== null && _2 !== void 0 ? _2 : {}, this._markerData, this._markAttributeContext),
102799
+ line: transformState((_z = (_y = this._spec.itemLine.line) === null || _y === void 0 ? void 0 : _y.state) !== null && _z !== void 0 ? _z : {}, this._markerData, this._markAttributeContext),
102800
+ lineStartSymbol: transformState((_1 = (_0 = this._spec.itemLine.startSymbol) === null || _0 === void 0 ? void 0 : _0.state) !== null && _1 !== void 0 ? _1 : {}, this._markerData, this._markAttributeContext),
102801
+ lineEndSymbol: transformState((_3 = (_2 = this._spec.itemLine.endSymbol) === null || _2 === void 0 ? void 0 : _2.state) !== null && _3 !== void 0 ? _3 : {}, this._markerData, this._markAttributeContext),
102797
102802
  itemContent: transformState(itemContentState, this._markerData, this._markAttributeContext),
102798
- textBackground: transformState((_4 = (_3 = this._spec.itemContent.text) === null || _3 === void 0 ? void 0 : _3.labelBackground) === null || _4 === void 0 ? void 0 : _4.state, this._markerData, this._markAttributeContext),
102799
- targetItem: transformState((_6 = (_5 = this._spec.targetSymbol) === null || _5 === void 0 ? void 0 : _5.state) !== null && _6 !== void 0 ? _6 : {}, this._markerData, this._markAttributeContext)
102803
+ textBackground: transformState((_5 = (_4 = this._spec.itemContent.text) === null || _4 === void 0 ? void 0 : _4.labelBackground) === null || _5 === void 0 ? void 0 : _5.state, this._markerData, this._markAttributeContext),
102804
+ targetItem: transformState((_7 = (_6 = this._spec.targetSymbol) === null || _6 === void 0 ? void 0 : _6.state) !== null && _7 !== void 0 ? _7 : {}, this._markerData, this._markAttributeContext)
102800
102805
  },
102801
- animation: (_7 = this._spec.animation) !== null && _7 !== void 0 ? _7 : false,
102806
+ animation: (_8 = this._spec.animation) !== null && _8 !== void 0 ? _8 : false,
102802
102807
  animationEnter: this._spec.animationEnter,
102803
102808
  animationExit: this._spec.animationExit,
102804
102809
  animationUpdate: this._spec.animationUpdate
@@ -103206,30 +103211,30 @@ class Brush extends BaseComponent {
103206
103211
  this._cacheInteractiveRangeAttrs.push(interactiveAttr);
103207
103212
  brush.addEventListener(IOperateType.brushActive, (e) => {
103208
103213
  this._initMarkBrushState(componentIndex, OUT_BRUSH_STATE);
103209
- this._emitEvent(ChartEvent.brushActive, region);
103214
+ this._emitEvent(ChartEvent.brushActive, region, e);
103210
103215
  });
103211
103216
  brush.addEventListener(IOperateType.drawStart, (e) => {
103212
103217
  this._setRegionMarkPickable(region, true);
103213
- this._emitEvent(ChartEvent.brushStart, region);
103218
+ this._emitEvent(ChartEvent.brushStart, region, e);
103214
103219
  });
103215
103220
  brush.addEventListener(IOperateType.moveStart, (e) => {
103216
103221
  this._setRegionMarkPickable(region, true);
103217
- this._emitEvent(ChartEvent.brushStart, region);
103222
+ this._emitEvent(ChartEvent.brushStart, region, e);
103218
103223
  });
103219
103224
  brush.addEventListener(IOperateType.drawing, (e) => {
103220
103225
  this._setRegionMarkPickable(region, false);
103221
103226
  this._handleBrushChange(region, e);
103222
- this._emitEvent(ChartEvent.brushChange, region);
103227
+ this._emitEvent(ChartEvent.brushChange, region, e);
103223
103228
  });
103224
103229
  brush.addEventListener(IOperateType.moving, (e) => {
103225
103230
  this._setRegionMarkPickable(region, false);
103226
103231
  this._handleBrushChange(region, e);
103227
- this._emitEvent(ChartEvent.brushChange, region);
103232
+ this._emitEvent(ChartEvent.brushChange, region, e);
103228
103233
  });
103229
103234
  brush.addEventListener(IOperateType.brushClear, (e) => {
103230
103235
  this._setRegionMarkPickable(region, true);
103231
103236
  this._initMarkBrushState(componentIndex, '');
103232
- this._emitEvent(ChartEvent.brushClear, region);
103237
+ this._emitEvent(ChartEvent.brushClear, region, e);
103233
103238
  });
103234
103239
  brush.addEventListener(IOperateType.drawEnd, (e) => {
103235
103240
  var _a;
@@ -103240,11 +103245,11 @@ class Brush extends BaseComponent {
103240
103245
  if (this._spec.onBrushEnd(e) === true) {
103241
103246
  this.clearGraphic();
103242
103247
  this._initMarkBrushState(componentIndex, '');
103243
- this._emitEvent(ChartEvent.brushClear, region);
103248
+ this._emitEvent(ChartEvent.brushClear, region, e);
103244
103249
  }
103245
103250
  else {
103246
103251
  this._spec.onBrushEnd(e);
103247
- this._emitEvent(ChartEvent.brushEnd, region);
103252
+ this._emitEvent(ChartEvent.brushEnd, region, e);
103248
103253
  }
103249
103254
  }
103250
103255
  else {
@@ -103252,7 +103257,7 @@ class Brush extends BaseComponent {
103252
103257
  if ((!this._spec.zoomWhenEmpty && inBrushData.length > 0) || !updateElementsState) {
103253
103258
  this._setAxisAndDataZoom(operateMask, region);
103254
103259
  }
103255
- this._emitEvent(ChartEvent.brushEnd, region);
103260
+ this._emitEvent(ChartEvent.brushEnd, region, e);
103256
103261
  }
103257
103262
  });
103258
103263
  brush.addEventListener(IOperateType.moveEnd, (e) => {
@@ -103263,7 +103268,7 @@ class Brush extends BaseComponent {
103263
103268
  if ((!this._spec.zoomWhenEmpty && inBrushData.length > 0) || updateElementsState) {
103264
103269
  this._setAxisAndDataZoom(operateMask, region);
103265
103270
  }
103266
- this._emitEvent(ChartEvent.brushEnd, region);
103271
+ this._emitEvent(ChartEvent.brushEnd, region, e);
103267
103272
  });
103268
103273
  }
103269
103274
  _getBrushInteractiveAttr(region) {
@@ -103326,7 +103331,7 @@ class Brush extends BaseComponent {
103326
103331
  }
103327
103332
  return data;
103328
103333
  }
103329
- _emitEvent(eventType, region) {
103334
+ _emitEvent(eventType, region, e) {
103330
103335
  var _a;
103331
103336
  this.event.emit(eventType, {
103332
103337
  model: this,
@@ -103343,7 +103348,8 @@ class Brush extends BaseComponent {
103343
103348
  linkedOutOfBrushElementsMap: this._linkedOutOfBrushElementsMap,
103344
103349
  zoomRecord: this._zoomRecord
103345
103350
  },
103346
- vchart: (_a = this._option) === null || _a === void 0 ? void 0 : _a.globalInstance
103351
+ vchart: (_a = this._option) === null || _a === void 0 ? void 0 : _a.globalInstance,
103352
+ event: e
103347
103353
  });
103348
103354
  }
103349
103355
  _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._beforeBrushEvent(e)) return;
51105
51106
  const {
51106
51107
  updateTrigger = DEFAULT_BRUSH_ATTRIBUTES.updateTrigger,
51107
51108
  endTrigger = DEFAULT_BRUSH_ATTRIBUTES.endTrigger,
@@ -51109,11 +51110,11 @@
51109
51110
  } = this.attribute;
51110
51111
  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
51112
  }, 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)));
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))));
51113
51114
  }, this._onBrushingWithDelay = 0 === this.attribute.delayTime ? this._onBrushing : delayMap$1[this.attribute.delayType](this._onBrushing, this.attribute.delayTime), this._onBrushEnd = e => {
51114
51115
  this._releaseBrushUpdateEvents(), e.preventDefault(), this._activeDrawState && this._drawEnd(e), this._activeMoveState && this._moveEnd(e), this._activeDrawState = !1, this._activeMoveState = !1;
51115
51116
  }, this._onBrushClear = e => {
51116
- e.preventDefault(), this._isEmptyMask() || (this._clearMask(), this._dispatchBrushEvent(IOperateType.brushClear, e)), this._activeDrawState = !1, this._activeMoveState = !1;
51117
+ !1 !== this._beforeBrushEvent(e) && (e.preventDefault(), this._isEmptyMask() || (this._clearMask(), this._dispatchBrushEvent(IOperateType.brushClear, e)), this._activeDrawState = !1, this._activeMoveState = !1);
51117
51118
  };
51118
51119
  }
51119
51120
  _bindBrushEvents() {
@@ -51318,6 +51319,10 @@
51318
51319
  pos = this.eventPosToStagePos(e);
51319
51320
  return pos.x > maxX || pos.x < minX || pos.y > maxY || pos.y < minY;
51320
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
+ }
51321
51326
  _dispatchBrushEvent(operateType, e) {
51322
51327
  this._dispatchEvent(operateType, {
51323
51328
  operateMask: this._operatingMask,
@@ -59693,7 +59698,7 @@
59693
59698
  }
59694
59699
  afterStageRender(stage, canvas) {
59695
59700
  var _a, _b;
59696
- (_b = (_a = this.params) === null || _a === void 0 ? void 0 : _a.callBack) === null || _b === void 0 ? void 0 : _b.call(_a, stage, canvas, this.currentAnimationRatio, this.animationTime);
59701
+ return (_b = (_a = this.params) === null || _a === void 0 ? void 0 : _a.callBack) === null || _b === void 0 ? void 0 : _b.call(_a, stage, canvas, this.currentAnimationRatio, this.animationTime);
59697
59702
  }
59698
59703
  }
59699
59704
 
@@ -102738,9 +102743,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
102738
102743
  return 'cartesian';
102739
102744
  }
102740
102745
  _createMarkerComponent() {
102741
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7;
102746
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8;
102742
102747
  const { itemContent = {}, itemLine = {}, targetSymbol = {} } = this._spec;
102743
- const _8 = itemContent, { type = 'text', text: label, symbol, image, richText, customMark, textStyle, symbolStyle, imageStyle, richTextStyle, customMarkStyle, style = {}, state = {} } = _8, restItemContent = __rest$e(_8, ["type", "text", "symbol", "image", "richText", "customMark", "textStyle", "symbolStyle", "imageStyle", "richTextStyle", "customMarkStyle", "style", "state"]);
102748
+ const _9 = itemContent, { type = 'text', text: label, symbol, image, richText, customMark, textStyle, symbolStyle, imageStyle, richTextStyle, customMarkStyle, style = {}, state = {} } = _9, restItemContent = __rest$e(_9, ["type", "text", "symbol", "image", "richText", "customMark", "textStyle", "symbolStyle", "imageStyle", "richTextStyle", "customMarkStyle", "style", "state"]);
102744
102749
  let itemContentState = null;
102745
102750
  let itemContentStyle = null;
102746
102751
  let defaultStyle = {};
@@ -102750,61 +102755,61 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
102750
102755
  dx: 0,
102751
102756
  dy: 0
102752
102757
  };
102753
- itemContentStyle = transformLabelAttributes(merge$1(defaultStyle, (_b = label !== null && label !== void 0 ? label : textStyle) !== null && _b !== void 0 ? _b : style), this._markerData, this._markAttributeContext);
102758
+ itemContentStyle = transformLabelAttributes(Object.assign(Object.assign({}, label), { style: merge$1(defaultStyle, (_c = (_b = label === null || label === void 0 ? void 0 : label.textStyle) !== null && _b !== void 0 ? _b : textStyle) !== null && _c !== void 0 ? _c : style) }), this._markerData, this._markAttributeContext);
102754
102759
  }
102755
102760
  else if (type === 'richText') {
102756
- itemContentState = (_c = richText === null || richText === void 0 ? void 0 : richText.state) !== null && _c !== void 0 ? _c : state;
102761
+ itemContentState = (_d = richText === null || richText === void 0 ? void 0 : richText.state) !== null && _d !== void 0 ? _d : state;
102757
102762
  defaultStyle = {
102758
102763
  width: 100,
102759
102764
  height: 100
102760
102765
  };
102761
- itemContentStyle = transformStyle(merge$1(defaultStyle, (_e = (_d = richText === null || richText === void 0 ? void 0 : richText.style) !== null && _d !== void 0 ? _d : richTextStyle) !== null && _e !== void 0 ? _e : style), this._markerData, this._markAttributeContext);
102766
+ itemContentStyle = transformStyle(merge$1(defaultStyle, (_f = (_e = richText === null || richText === void 0 ? void 0 : richText.style) !== null && _e !== void 0 ? _e : richTextStyle) !== null && _f !== void 0 ? _f : style), this._markerData, this._markAttributeContext);
102762
102767
  }
102763
102768
  else if (type === 'symbol') {
102764
- itemContentState = (_f = symbol === null || symbol === void 0 ? void 0 : symbol.state) !== null && _f !== void 0 ? _f : state;
102769
+ itemContentState = (_g = symbol === null || symbol === void 0 ? void 0 : symbol.state) !== null && _g !== void 0 ? _g : state;
102765
102770
  defaultStyle = {
102766
102771
  symbolType: 'star',
102767
102772
  fill: 'rgb(48, 115, 242)',
102768
102773
  fillOpacity: 0.8,
102769
102774
  size: 20
102770
102775
  };
102771
- itemContentStyle = transformToGraphic(transformStyle(merge$1(defaultStyle, (_h = (_g = symbol === null || symbol === void 0 ? void 0 : symbol.style) !== null && _g !== void 0 ? _g : symbolStyle) !== null && _h !== void 0 ? _h : style), this._markerData, this._markAttributeContext));
102776
+ itemContentStyle = transformToGraphic(transformStyle(merge$1(defaultStyle, (_j = (_h = symbol === null || symbol === void 0 ? void 0 : symbol.style) !== null && _h !== void 0 ? _h : symbolStyle) !== null && _j !== void 0 ? _j : style), this._markerData, this._markAttributeContext));
102772
102777
  }
102773
102778
  else if (type === 'image') {
102774
- itemContentState = (_j = image === null || image === void 0 ? void 0 : image.state) !== null && _j !== void 0 ? _j : state;
102779
+ itemContentState = (_k = image === null || image === void 0 ? void 0 : image.state) !== null && _k !== void 0 ? _k : state;
102775
102780
  defaultStyle = {
102776
102781
  width: 80,
102777
102782
  height: 80
102778
102783
  };
102779
- itemContentStyle = transformStyle(merge$1(defaultStyle, (_l = (_k = image === null || image === void 0 ? void 0 : image.style) !== null && _k !== void 0 ? _k : imageStyle) !== null && _l !== void 0 ? _l : style), this._markerData, this._markAttributeContext);
102784
+ itemContentStyle = transformStyle(merge$1(defaultStyle, (_m = (_l = image === null || image === void 0 ? void 0 : image.style) !== null && _l !== void 0 ? _l : imageStyle) !== null && _m !== void 0 ? _m : style), this._markerData, this._markAttributeContext);
102780
102785
  }
102781
102786
  else if (type === 'custom') {
102782
- itemContentState = (_m = customMark === null || customMark === void 0 ? void 0 : customMark.state) !== null && _m !== void 0 ? _m : state;
102783
- itemContentStyle = transformStyle((_p = (_o = customMark === null || customMark === void 0 ? void 0 : customMark.style) !== null && _o !== void 0 ? _o : customMarkStyle) !== null && _p !== void 0 ? _p : style, this._markerData, this._markAttributeContext);
102787
+ itemContentState = (_o = customMark === null || customMark === void 0 ? void 0 : customMark.state) !== null && _o !== void 0 ? _o : state;
102788
+ itemContentStyle = transformStyle((_q = (_p = customMark === null || customMark === void 0 ? void 0 : customMark.style) !== null && _p !== void 0 ? _p : customMarkStyle) !== null && _q !== void 0 ? _q : style, this._markerData, this._markAttributeContext);
102784
102789
  }
102785
102790
  const markPointAttrs = {
102786
102791
  zIndex: this.layoutZIndex,
102787
- interactive: (_q = this._spec.interactive) !== null && _q !== void 0 ? _q : true,
102788
- hover: (_r = this._spec.interactive) !== null && _r !== void 0 ? _r : true,
102789
- select: (_s = this._spec.interactive) !== null && _s !== void 0 ? _s : true,
102792
+ interactive: (_r = this._spec.interactive) !== null && _r !== void 0 ? _r : true,
102793
+ hover: (_s = this._spec.interactive) !== null && _s !== void 0 ? _s : true,
102794
+ select: (_t = this._spec.interactive) !== null && _t !== void 0 ? _t : true,
102790
102795
  position: { x: 0, y: 0 },
102791
- clipInRange: (_t = this._spec.clip) !== null && _t !== void 0 ? _t : false,
102796
+ clipInRange: (_u = this._spec.clip) !== null && _u !== void 0 ? _u : false,
102792
102797
  itemContent: Object.assign(Object.assign({ type, offsetX: transformOffset(itemContent.offsetX, this._relativeSeries.getRegion()), offsetY: transformOffset(itemContent.offsetX, this._relativeSeries.getRegion()) }, restItemContent), { style: transformStyle(itemContentStyle, this._markerData, this._markAttributeContext) }),
102793
102798
  targetSymbol: {
102794
- offset: (_u = targetSymbol.offset) !== null && _u !== void 0 ? _u : 0,
102795
- visible: (_v = targetSymbol.visible) !== null && _v !== void 0 ? _v : false,
102796
- size: (_w = targetSymbol.size) !== null && _w !== void 0 ? _w : 20,
102799
+ offset: (_v = targetSymbol.offset) !== null && _v !== void 0 ? _v : 0,
102800
+ visible: (_w = targetSymbol.visible) !== null && _w !== void 0 ? _w : false,
102801
+ size: (_x = targetSymbol.size) !== null && _x !== void 0 ? _x : 20,
102797
102802
  style: transformStyle(targetSymbol.style, this._markerData, this._markAttributeContext)
102798
102803
  },
102799
102804
  state: {
102800
- line: transformState((_y = (_x = this._spec.itemLine.line) === null || _x === void 0 ? void 0 : _x.state) !== null && _y !== void 0 ? _y : {}, this._markerData, this._markAttributeContext),
102801
- lineStartSymbol: transformState((_0 = (_z = this._spec.itemLine.startSymbol) === null || _z === void 0 ? void 0 : _z.state) !== null && _0 !== void 0 ? _0 : {}, this._markerData, this._markAttributeContext),
102802
- lineEndSymbol: transformState((_2 = (_1 = this._spec.itemLine.endSymbol) === null || _1 === void 0 ? void 0 : _1.state) !== null && _2 !== void 0 ? _2 : {}, this._markerData, this._markAttributeContext),
102805
+ line: transformState((_z = (_y = this._spec.itemLine.line) === null || _y === void 0 ? void 0 : _y.state) !== null && _z !== void 0 ? _z : {}, this._markerData, this._markAttributeContext),
102806
+ lineStartSymbol: transformState((_1 = (_0 = this._spec.itemLine.startSymbol) === null || _0 === void 0 ? void 0 : _0.state) !== null && _1 !== void 0 ? _1 : {}, this._markerData, this._markAttributeContext),
102807
+ lineEndSymbol: transformState((_3 = (_2 = this._spec.itemLine.endSymbol) === null || _2 === void 0 ? void 0 : _2.state) !== null && _3 !== void 0 ? _3 : {}, this._markerData, this._markAttributeContext),
102803
102808
  itemContent: transformState(itemContentState, this._markerData, this._markAttributeContext),
102804
- textBackground: transformState((_4 = (_3 = this._spec.itemContent.text) === null || _3 === void 0 ? void 0 : _3.labelBackground) === null || _4 === void 0 ? void 0 : _4.state, this._markerData, this._markAttributeContext),
102805
- targetItem: transformState((_6 = (_5 = this._spec.targetSymbol) === null || _5 === void 0 ? void 0 : _5.state) !== null && _6 !== void 0 ? _6 : {}, this._markerData, this._markAttributeContext)
102809
+ textBackground: transformState((_5 = (_4 = this._spec.itemContent.text) === null || _4 === void 0 ? void 0 : _4.labelBackground) === null || _5 === void 0 ? void 0 : _5.state, this._markerData, this._markAttributeContext),
102810
+ targetItem: transformState((_7 = (_6 = this._spec.targetSymbol) === null || _6 === void 0 ? void 0 : _6.state) !== null && _7 !== void 0 ? _7 : {}, this._markerData, this._markAttributeContext)
102806
102811
  },
102807
- animation: (_7 = this._spec.animation) !== null && _7 !== void 0 ? _7 : false,
102812
+ animation: (_8 = this._spec.animation) !== null && _8 !== void 0 ? _8 : false,
102808
102813
  animationEnter: this._spec.animationEnter,
102809
102814
  animationExit: this._spec.animationExit,
102810
102815
  animationUpdate: this._spec.animationUpdate
@@ -103212,30 +103217,30 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
103212
103217
  this._cacheInteractiveRangeAttrs.push(interactiveAttr);
103213
103218
  brush.addEventListener(IOperateType.brushActive, (e) => {
103214
103219
  this._initMarkBrushState(componentIndex, OUT_BRUSH_STATE);
103215
- this._emitEvent(exports.ChartEvent.brushActive, region);
103220
+ this._emitEvent(exports.ChartEvent.brushActive, region, e);
103216
103221
  });
103217
103222
  brush.addEventListener(IOperateType.drawStart, (e) => {
103218
103223
  this._setRegionMarkPickable(region, true);
103219
- this._emitEvent(exports.ChartEvent.brushStart, region);
103224
+ this._emitEvent(exports.ChartEvent.brushStart, region, e);
103220
103225
  });
103221
103226
  brush.addEventListener(IOperateType.moveStart, (e) => {
103222
103227
  this._setRegionMarkPickable(region, true);
103223
- this._emitEvent(exports.ChartEvent.brushStart, region);
103228
+ this._emitEvent(exports.ChartEvent.brushStart, region, e);
103224
103229
  });
103225
103230
  brush.addEventListener(IOperateType.drawing, (e) => {
103226
103231
  this._setRegionMarkPickable(region, false);
103227
103232
  this._handleBrushChange(region, e);
103228
- this._emitEvent(exports.ChartEvent.brushChange, region);
103233
+ this._emitEvent(exports.ChartEvent.brushChange, region, e);
103229
103234
  });
103230
103235
  brush.addEventListener(IOperateType.moving, (e) => {
103231
103236
  this._setRegionMarkPickable(region, false);
103232
103237
  this._handleBrushChange(region, e);
103233
- this._emitEvent(exports.ChartEvent.brushChange, region);
103238
+ this._emitEvent(exports.ChartEvent.brushChange, region, e);
103234
103239
  });
103235
103240
  brush.addEventListener(IOperateType.brushClear, (e) => {
103236
103241
  this._setRegionMarkPickable(region, true);
103237
103242
  this._initMarkBrushState(componentIndex, '');
103238
- this._emitEvent(exports.ChartEvent.brushClear, region);
103243
+ this._emitEvent(exports.ChartEvent.brushClear, region, e);
103239
103244
  });
103240
103245
  brush.addEventListener(IOperateType.drawEnd, (e) => {
103241
103246
  var _a;
@@ -103246,11 +103251,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
103246
103251
  if (this._spec.onBrushEnd(e) === true) {
103247
103252
  this.clearGraphic();
103248
103253
  this._initMarkBrushState(componentIndex, '');
103249
- this._emitEvent(exports.ChartEvent.brushClear, region);
103254
+ this._emitEvent(exports.ChartEvent.brushClear, region, e);
103250
103255
  }
103251
103256
  else {
103252
103257
  this._spec.onBrushEnd(e);
103253
- this._emitEvent(exports.ChartEvent.brushEnd, region);
103258
+ this._emitEvent(exports.ChartEvent.brushEnd, region, e);
103254
103259
  }
103255
103260
  }
103256
103261
  else {
@@ -103258,7 +103263,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
103258
103263
  if ((!this._spec.zoomWhenEmpty && inBrushData.length > 0) || !updateElementsState) {
103259
103264
  this._setAxisAndDataZoom(operateMask, region);
103260
103265
  }
103261
- this._emitEvent(exports.ChartEvent.brushEnd, region);
103266
+ this._emitEvent(exports.ChartEvent.brushEnd, region, e);
103262
103267
  }
103263
103268
  });
103264
103269
  brush.addEventListener(IOperateType.moveEnd, (e) => {
@@ -103269,7 +103274,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
103269
103274
  if ((!this._spec.zoomWhenEmpty && inBrushData.length > 0) || updateElementsState) {
103270
103275
  this._setAxisAndDataZoom(operateMask, region);
103271
103276
  }
103272
- this._emitEvent(exports.ChartEvent.brushEnd, region);
103277
+ this._emitEvent(exports.ChartEvent.brushEnd, region, e);
103273
103278
  });
103274
103279
  }
103275
103280
  _getBrushInteractiveAttr(region) {
@@ -103332,7 +103337,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
103332
103337
  }
103333
103338
  return data;
103334
103339
  }
103335
- _emitEvent(eventType, region) {
103340
+ _emitEvent(eventType, region, e) {
103336
103341
  var _a;
103337
103342
  this.event.emit(eventType, {
103338
103343
  model: this,
@@ -103349,7 +103354,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
103349
103354
  linkedOutOfBrushElementsMap: this._linkedOutOfBrushElementsMap,
103350
103355
  zoomRecord: this._zoomRecord
103351
103356
  },
103352
- vchart: (_a = this._option) === null || _a === void 0 ? void 0 : _a.globalInstance
103357
+ vchart: (_a = this._option) === null || _a === void 0 ? void 0 : _a.globalInstance,
103358
+ event: e
103353
103359
  });
103354
103360
  }
103355
103361
  _reconfigItem(operateMask, region) {