@visactor/vchart 2.0.13-alpha.0 → 2.0.13-alpha.10

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 (112) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.es.js +110 -46
  3. package/build/index.js +110 -46
  4. package/build/index.min.js +2 -2
  5. package/build/tsconfig.tsbuildinfo +1 -1
  6. package/cjs/animation/callback-disappear.js +2 -1
  7. package/cjs/animation/index.js +1 -2
  8. package/cjs/compile/compiler.d.ts +1 -0
  9. package/cjs/compile/compiler.js +4 -1
  10. package/cjs/compile/compiler.js.map +1 -1
  11. package/cjs/compile/grammar-item.js +1 -1
  12. package/cjs/compile/interface/compilable-item.d.ts +2 -1
  13. package/cjs/compile/interface/compilable-item.js.map +1 -1
  14. package/cjs/compile/morph.js +1 -1
  15. package/cjs/compile/state-manager.js +1 -1
  16. package/cjs/compile/util.js +1 -1
  17. package/cjs/component/brush/brush.d.ts +4 -1
  18. package/cjs/component/brush/brush.js +31 -14
  19. package/cjs/component/brush/brush.js.map +1 -1
  20. package/cjs/component/brush/interface.d.ts +3 -1
  21. package/cjs/component/brush/interface.js.map +1 -1
  22. package/cjs/component/crosshair/interface/spec.d.ts +1 -0
  23. package/cjs/component/crosshair/interface/spec.js.map +1 -1
  24. package/cjs/component/tooltip/interface/common.d.ts +1 -0
  25. package/cjs/component/tooltip/interface/common.js.map +1 -1
  26. package/cjs/component/tooltip/processor/base.js +1 -1
  27. package/cjs/component/tooltip/processor/base.js.map +1 -1
  28. package/cjs/component/tooltip/tooltip.d.ts +1 -0
  29. package/cjs/component/tooltip/tooltip.js +3 -2
  30. package/cjs/component/tooltip/tooltip.js.map +1 -1
  31. package/cjs/component/util.js +1 -2
  32. package/cjs/constant/data.js +2 -1
  33. package/cjs/constant/scroll-bar.js +1 -2
  34. package/cjs/core/index.js +2 -1
  35. package/cjs/core/interface.d.ts +9 -1
  36. package/cjs/core/interface.js +1 -1
  37. package/cjs/core/interface.js.map +1 -1
  38. package/cjs/core/util.js +1 -1
  39. package/cjs/core/vchart.d.ts +4 -0
  40. package/cjs/core/vchart.js +11 -2
  41. package/cjs/core/vchart.js.map +1 -1
  42. package/cjs/env/env.js +1 -1
  43. package/cjs/env/index.js +1 -1
  44. package/cjs/event/event.js +1 -1
  45. package/cjs/event/event.js.map +1 -1
  46. package/cjs/event/events/dimension/dimension-hover.js +4 -2
  47. package/cjs/event/events/dimension/dimension-hover.js.map +1 -1
  48. package/cjs/interaction/interface/trigger.d.ts +1 -1
  49. package/cjs/interaction/interface/trigger.js.map +1 -1
  50. package/cjs/interaction/triggers/base.d.ts +3 -2
  51. package/cjs/interaction/triggers/base.js +2 -2
  52. package/cjs/interaction/triggers/base.js.map +1 -1
  53. package/cjs/interaction/triggers/element-highlight.d.ts +3 -3
  54. package/cjs/interaction/triggers/element-highlight.js +11 -11
  55. package/cjs/interaction/triggers/element-highlight.js.map +1 -1
  56. package/cjs/interaction/triggers/element-select.d.ts +3 -3
  57. package/cjs/interaction/triggers/element-select.js +13 -13
  58. package/cjs/interaction/triggers/element-select.js.map +1 -1
  59. package/esm/animation/callback-disappear.js +2 -1
  60. package/esm/animation/index.js +1 -2
  61. package/esm/compile/compiler.d.ts +1 -0
  62. package/esm/compile/compiler.js +4 -1
  63. package/esm/compile/compiler.js.map +1 -1
  64. package/esm/compile/grammar-item.js +1 -1
  65. package/esm/compile/interface/compilable-item.d.ts +2 -1
  66. package/esm/compile/interface/compilable-item.js.map +1 -1
  67. package/esm/compile/morph.js +1 -1
  68. package/esm/compile/state-manager.js +1 -1
  69. package/esm/compile/util.js +1 -1
  70. package/esm/component/brush/brush.d.ts +4 -1
  71. package/esm/component/brush/brush.js +31 -14
  72. package/esm/component/brush/brush.js.map +1 -1
  73. package/esm/component/brush/interface.d.ts +3 -1
  74. package/esm/component/brush/interface.js.map +1 -1
  75. package/esm/component/crosshair/interface/spec.d.ts +1 -0
  76. package/esm/component/crosshair/interface/spec.js.map +1 -1
  77. package/esm/component/tooltip/interface/common.d.ts +1 -0
  78. package/esm/component/tooltip/interface/common.js.map +1 -1
  79. package/esm/component/tooltip/processor/base.js +1 -1
  80. package/esm/component/tooltip/processor/base.js.map +1 -1
  81. package/esm/component/tooltip/tooltip.d.ts +1 -0
  82. package/esm/component/tooltip/tooltip.js +3 -2
  83. package/esm/component/tooltip/tooltip.js.map +1 -1
  84. package/esm/component/util.js +1 -2
  85. package/esm/constant/data.js +2 -1
  86. package/esm/constant/scroll-bar.js +1 -2
  87. package/esm/core/index.js +2 -1
  88. package/esm/core/interface.d.ts +9 -1
  89. package/esm/core/interface.js +1 -1
  90. package/esm/core/interface.js.map +1 -1
  91. package/esm/core/util.js +1 -1
  92. package/esm/core/vchart.d.ts +4 -0
  93. package/esm/core/vchart.js +11 -2
  94. package/esm/core/vchart.js.map +1 -1
  95. package/esm/env/env.js +1 -1
  96. package/esm/env/index.js +1 -1
  97. package/esm/event/event.js +1 -1
  98. package/esm/event/event.js.map +1 -1
  99. package/esm/event/events/dimension/dimension-hover.js +4 -2
  100. package/esm/event/events/dimension/dimension-hover.js.map +1 -1
  101. package/esm/interaction/interface/trigger.d.ts +1 -1
  102. package/esm/interaction/interface/trigger.js.map +1 -1
  103. package/esm/interaction/triggers/base.d.ts +3 -2
  104. package/esm/interaction/triggers/base.js +2 -2
  105. package/esm/interaction/triggers/base.js.map +1 -1
  106. package/esm/interaction/triggers/element-highlight.d.ts +3 -3
  107. package/esm/interaction/triggers/element-highlight.js +11 -11
  108. package/esm/interaction/triggers/element-highlight.js.map +1 -1
  109. package/esm/interaction/triggers/element-select.d.ts +3 -3
  110. package/esm/interaction/triggers/element-select.js +13 -13
  111. package/esm/interaction/triggers/element-select.js.map +1 -1
  112. package/package.json +7 -7
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 = [];
@@ -60021,9 +60035,9 @@
60021
60035
  });
60022
60036
  }
60023
60037
  }
60024
- start(g) {
60038
+ start(g, e) {
60025
60039
  }
60026
- reset(g) {
60040
+ reset(g, e) {
60027
60041
  }
60028
60042
  dispatchEvent(type, params) {
60029
60043
  if (this.options.event) {
@@ -60054,17 +60068,17 @@
60054
60068
  constructor(options) {
60055
60069
  super(options);
60056
60070
  this.type = "element-highlight";
60057
- this.resetAll = () => {
60071
+ this.resetAll = (e) => {
60058
60072
  const { highlightState, blurState, interaction } = this.options;
60059
60073
  if (this._lastGraphic) {
60060
60074
  interaction.clearAllStatesOfTrigger(this, highlightState, blurState);
60061
- this.dispatchEvent('reset', { graphics: [this._lastGraphic], options: this.options });
60075
+ this.dispatchEvent('reset', Object.assign({ graphics: [this._lastGraphic], options: this.options }, e));
60062
60076
  this._lastGraphic = null;
60063
60077
  interaction.setStatedGraphics(this, []);
60064
60078
  }
60065
60079
  };
60066
60080
  this.handleStart = (e) => {
60067
- this.start(e.item);
60081
+ this.start(e.item, e);
60068
60082
  };
60069
60083
  this.handleReset = (e) => {
60070
60084
  const { interaction } = this.options;
@@ -60075,10 +60089,10 @@
60075
60089
  const markGraphic = e.item;
60076
60090
  const hasActiveElement = markGraphic && this._markSet.getMarkInId(markGraphic.context.markId);
60077
60091
  if (this._resetType.includes('view') && !hasActiveElement) {
60078
- this.resetAll();
60092
+ this.resetAll(e);
60079
60093
  }
60080
60094
  else if (this._resetType.includes('self') && hasActiveElement) {
60081
- this.resetAll();
60095
+ this.resetAll(e);
60082
60096
  }
60083
60097
  };
60084
60098
  this.options = Object.assign({}, defaultOptions$6, options);
@@ -60110,7 +60124,7 @@
60110
60124
  events.push({ type: eventName, handler: this.handleReset });
60111
60125
  return events;
60112
60126
  }
60113
- start(markGraphic) {
60127
+ start(markGraphic, e) {
60114
60128
  if (markGraphic && this._markSet.getMarkInId(markGraphic.context.markId)) {
60115
60129
  const { highlightState, blurState, interaction } = this.options;
60116
60130
  if (this._lastGraphic === markGraphic) {
@@ -60119,20 +60133,20 @@
60119
60133
  const newStatedGraphics = interaction.updateStates(this, [markGraphic], interaction.getStatedGraphics(this), highlightState, blurState);
60120
60134
  interaction.setStatedGraphics(this, newStatedGraphics);
60121
60135
  this._lastGraphic = markGraphic;
60122
- this.dispatchEvent('start', { graphics: newStatedGraphics, options: this.options });
60136
+ this.dispatchEvent('start', Object.assign({ graphics: newStatedGraphics, options: this.options }, e));
60123
60137
  }
60124
60138
  else if (this._lastGraphic && this._resetType === 'view') {
60125
- this.resetAll();
60139
+ this.resetAll(e);
60126
60140
  }
60127
60141
  }
60128
- reset(markGraphic) {
60142
+ reset(markGraphic, e) {
60129
60143
  if (markGraphic) {
60130
60144
  if (this._markSet.getMarkInId(markGraphic.context.markId)) {
60131
60145
  markGraphic.removeState([this.options.highlightState, this.options.blurState]);
60132
60146
  }
60133
60147
  }
60134
60148
  else {
60135
- this.resetAll();
60149
+ this.resetAll(e);
60136
60150
  }
60137
60151
  }
60138
60152
  }
@@ -60151,17 +60165,17 @@
60151
60165
  super(options);
60152
60166
  this.type = "element-select";
60153
60167
  this._resetType = [];
60154
- this.resetAll = () => {
60168
+ this.resetAll = (e) => {
60155
60169
  const { state, reverseState, interaction } = this.options;
60156
60170
  const statedGraphics = interaction.getStatedGraphics(this);
60157
60171
  if (statedGraphics && statedGraphics.length) {
60158
60172
  interaction.clearAllStatesOfTrigger(this, state, reverseState);
60159
- this.dispatchEvent('reset', { graphics: statedGraphics, options: this.options });
60173
+ this.dispatchEvent('reset', Object.assign({ graphics: statedGraphics, options: this.options }, e));
60160
60174
  interaction.setStatedGraphics(this, []);
60161
60175
  }
60162
60176
  };
60163
60177
  this.handleStart = (e) => {
60164
- this.start(e.item);
60178
+ this.start(e.item, e);
60165
60179
  };
60166
60180
  this.handleReset = (e) => {
60167
60181
  const { interaction } = this.options;
@@ -60172,10 +60186,10 @@
60172
60186
  const markGraphic = e.item;
60173
60187
  const hasActiveElement = markGraphic && this._markSet.getMarkInId(markGraphic.context.markId);
60174
60188
  if (this._resetType.includes('view') && !hasActiveElement) {
60175
- this.resetAll();
60189
+ this.resetAll(e);
60176
60190
  }
60177
60191
  else if (this._resetType.includes('self') && hasActiveElement) {
60178
- this.resetAll();
60192
+ this.resetAll(e);
60179
60193
  }
60180
60194
  };
60181
60195
  this.options = Object.assign({}, defaultOptions$5, options);
@@ -60205,7 +60219,7 @@
60205
60219
  this._resetType = resetType;
60206
60220
  return events;
60207
60221
  }
60208
- start(markGraphic) {
60222
+ start(markGraphic, e) {
60209
60223
  const { state, reverseState, isMultiple, interaction } = this.options;
60210
60224
  const statedGraphics = interaction.getStatedGraphics(this);
60211
60225
  if (markGraphic && this._markSet.getMarkInId(markGraphic.context.markId)) {
@@ -60216,7 +60230,7 @@
60216
60230
  interaction.setStatedGraphics(this, interaction.updateStates(this, newStatedGraphics, statedGraphics, state, reverseState));
60217
60231
  }
60218
60232
  else {
60219
- this.resetAll();
60233
+ this.resetAll(e);
60220
60234
  }
60221
60235
  }
60222
60236
  }
@@ -60227,26 +60241,26 @@
60227
60241
  markGraphic.addState(state, true);
60228
60242
  const newStatedGraphics = this.options.interaction.updateStates(this, isMultiple && statedGraphics ? [...statedGraphics, markGraphic] : [markGraphic], statedGraphics, state, reverseState);
60229
60243
  interaction.setStatedGraphics(this, newStatedGraphics);
60230
- this.dispatchEvent('start', { graphics: newStatedGraphics, options: this.options });
60244
+ this.dispatchEvent('start', Object.assign({ graphics: newStatedGraphics, options: this.options }, e));
60231
60245
  if (this._resetType.includes('timeout')) {
60232
60246
  this._timer = setTimeout(() => {
60233
- this.resetAll();
60247
+ this.resetAll(e);
60234
60248
  }, this.options.triggerOff);
60235
60249
  }
60236
60250
  }
60237
60251
  }
60238
60252
  else if (this._resetType.includes('view') && statedGraphics && statedGraphics.length) {
60239
- this.resetAll();
60253
+ this.resetAll(e);
60240
60254
  }
60241
60255
  }
60242
- reset(markGraphic) {
60256
+ reset(markGraphic, e) {
60243
60257
  if (markGraphic) {
60244
60258
  if (this._markSet.getMarkInId(markGraphic.context.markId)) {
60245
60259
  markGraphic.removeState([this.options.state, this.options.reverseState]);
60246
60260
  }
60247
60261
  }
60248
60262
  else {
60249
- this.resetAll();
60263
+ this.resetAll(e);
60250
60264
  }
60251
60265
  }
60252
60266
  }
@@ -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
- if (!params) {
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
- if (!params) {
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
  }
@@ -96051,6 +96087,7 @@
96051
96087
  this.specKey = 'tooltip';
96052
96088
  this.layoutType = 'none';
96053
96089
  this._isReleased = false;
96090
+ this.enable = true;
96054
96091
  this._alwaysShow = false;
96055
96092
  this._eventList = [];
96056
96093
  this._isTooltipShown = false;
@@ -103206,6 +103243,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
103206
103243
  this._initMarkBrushState(componentIndex, '');
103207
103244
  brushComponent.children[0].removeAllChild();
103208
103245
  }
103246
+ _shouldEnableInteractive() {
103247
+ return this.getOption().getCompiler().getOption().interactive !== false;
103248
+ }
103209
103249
  _createBrushComponent(region, componentIndex) {
103210
103250
  var _a, _b;
103211
103251
  const interactiveAttr = this._getBrushInteractiveAttr(region);
@@ -103216,33 +103256,45 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
103216
103256
  this._cacheInteractiveRangeAttrs.push(interactiveAttr);
103217
103257
  brush.addEventListener(IOperateType.brushActive, (e) => {
103218
103258
  this._initMarkBrushState(componentIndex, OUT_BRUSH_STATE);
103219
- this._emitEvent(exports.ChartEvent.brushActive, region);
103259
+ this._emitEvent(exports.ChartEvent.brushActive, region, e);
103220
103260
  });
103221
103261
  brush.addEventListener(IOperateType.drawStart, (e) => {
103262
+ if (this._spec.disableDimensionHoverWhenBrushing) {
103263
+ this._option.globalInstance.disableDimensionHoverEvent(true);
103264
+ }
103222
103265
  this._setRegionMarkPickable(region, true);
103223
- this._emitEvent(exports.ChartEvent.brushStart, region);
103266
+ this._emitEvent(exports.ChartEvent.brushStart, region, e);
103224
103267
  });
103225
103268
  brush.addEventListener(IOperateType.moveStart, (e) => {
103269
+ if (this._spec.disableDimensionHoverWhenBrushing) {
103270
+ this._option.globalInstance.disableDimensionHoverEvent(true);
103271
+ }
103226
103272
  this._setRegionMarkPickable(region, true);
103227
- this._emitEvent(exports.ChartEvent.brushStart, region);
103273
+ this._emitEvent(exports.ChartEvent.brushStart, region, e);
103228
103274
  });
103229
103275
  brush.addEventListener(IOperateType.drawing, (e) => {
103230
103276
  this._setRegionMarkPickable(region, false);
103231
103277
  this._handleBrushChange(region, e);
103232
- this._emitEvent(exports.ChartEvent.brushChange, region);
103278
+ this._emitEvent(exports.ChartEvent.brushChange, region, e);
103233
103279
  });
103234
103280
  brush.addEventListener(IOperateType.moving, (e) => {
103235
103281
  this._setRegionMarkPickable(region, false);
103236
103282
  this._handleBrushChange(region, e);
103237
- this._emitEvent(exports.ChartEvent.brushChange, region);
103283
+ this._emitEvent(exports.ChartEvent.brushChange, region, e);
103238
103284
  });
103239
103285
  brush.addEventListener(IOperateType.brushClear, (e) => {
103286
+ if (this._spec.disableDimensionHoverWhenBrushing) {
103287
+ this._option.globalInstance.disableDimensionHoverEvent(false);
103288
+ }
103240
103289
  this._setRegionMarkPickable(region, true);
103241
103290
  this._initMarkBrushState(componentIndex, '');
103242
- this._emitEvent(exports.ChartEvent.brushClear, region);
103291
+ this._emitEvent(exports.ChartEvent.brushClear, region, e);
103243
103292
  });
103244
103293
  brush.addEventListener(IOperateType.drawEnd, (e) => {
103245
103294
  var _a;
103295
+ if (this._spec.disableDimensionHoverWhenBrushing) {
103296
+ this._option.globalInstance.disableDimensionHoverEvent(false);
103297
+ }
103246
103298
  this._setRegionMarkPickable(region, true);
103247
103299
  const { operateMask } = e.detail;
103248
103300
  const { updateElementsState = true } = this._spec;
@@ -103250,11 +103302,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
103250
103302
  if (this._spec.onBrushEnd(e) === true) {
103251
103303
  this.clearGraphic();
103252
103304
  this._initMarkBrushState(componentIndex, '');
103253
- this._emitEvent(exports.ChartEvent.brushClear, region);
103305
+ this._emitEvent(exports.ChartEvent.brushClear, region, e);
103254
103306
  }
103255
103307
  else {
103256
103308
  this._spec.onBrushEnd(e);
103257
- this._emitEvent(exports.ChartEvent.brushEnd, region);
103309
+ this._emitEvent(exports.ChartEvent.brushEnd, region, e);
103258
103310
  }
103259
103311
  }
103260
103312
  else {
@@ -103262,10 +103314,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
103262
103314
  if ((!this._spec.zoomWhenEmpty && inBrushData.length > 0) || !updateElementsState) {
103263
103315
  this._setAxisAndDataZoom(operateMask, region);
103264
103316
  }
103265
- this._emitEvent(exports.ChartEvent.brushEnd, region);
103317
+ this._emitEvent(exports.ChartEvent.brushEnd, region, e);
103266
103318
  }
103267
103319
  });
103268
103320
  brush.addEventListener(IOperateType.moveEnd, (e) => {
103321
+ if (this._spec.disableDimensionHoverWhenBrushing) {
103322
+ this._option.globalInstance.disableDimensionHoverEvent(false);
103323
+ }
103269
103324
  this._setRegionMarkPickable(region, true);
103270
103325
  const { operateMask } = e.detail;
103271
103326
  const { updateElementsState = true } = this._spec;
@@ -103273,7 +103328,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
103273
103328
  if ((!this._spec.zoomWhenEmpty && inBrushData.length > 0) || updateElementsState) {
103274
103329
  this._setAxisAndDataZoom(operateMask, region);
103275
103330
  }
103276
- this._emitEvent(exports.ChartEvent.brushEnd, region);
103331
+ this._emitEvent(exports.ChartEvent.brushEnd, region, e);
103277
103332
  });
103278
103333
  }
103279
103334
  _getBrushInteractiveAttr(region) {
@@ -103291,7 +103346,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
103291
103346
  maxX: seriesRegionEndX
103292
103347
  },
103293
103348
  xRange: [seriesRegionStartX, seriesRegionEndX],
103294
- yRange: [seriesRegionStartY, seriesRegionEndY]
103349
+ yRange: [seriesRegionStartY, seriesRegionEndY],
103350
+ interactive: this._shouldEnableInteractive()
103295
103351
  };
103296
103352
  }
103297
103353
  _transformBrushedMarkAttr(brushedStyle) {
@@ -103312,6 +103368,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
103312
103368
  }
103313
103369
  _handleBrushChange(region, e) {
103314
103370
  const { operateMask } = e.detail;
103371
+ this._operateMask = operateMask;
103315
103372
  const { updateElementsState = true } = this._spec;
103316
103373
  if (updateElementsState) {
103317
103374
  this._reconfigItem(operateMask, region);
@@ -103336,7 +103393,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
103336
103393
  }
103337
103394
  return data;
103338
103395
  }
103339
- _emitEvent(eventType, region) {
103396
+ _emitEvent(eventType, region, e) {
103340
103397
  var _a;
103341
103398
  this.event.emit(eventType, {
103342
103399
  model: this,
@@ -103353,7 +103410,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
103353
103410
  linkedOutOfBrushElementsMap: this._linkedOutOfBrushElementsMap,
103354
103411
  zoomRecord: this._zoomRecord
103355
103412
  },
103356
- 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
103357
103415
  });
103358
103416
  }
103359
103417
  _reconfigItem(operateMask, region) {
@@ -103608,6 +103666,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
103608
103666
  this._brushComponents = null;
103609
103667
  }
103610
103668
  }
103669
+ clearBrushStateAndMask() {
103670
+ this._relativeRegions.forEach((region, componentIndex) => {
103671
+ this._initMarkBrushState(componentIndex, '');
103672
+ this._brushComponents[componentIndex].children[0].removeAllChild();
103673
+ });
103674
+ }
103611
103675
  }
103612
103676
  Brush.type = ComponentTypeEnum.brush;
103613
103677
  Brush.builtInTheme = {