@visactor/vchart 2.0.13-alpha.9 → 2.0.13

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 (134) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.es.js +79 -103
  3. package/build/index.js +79 -103
  4. package/build/index.min.js +2 -2
  5. package/build/tsconfig.tsbuildinfo +1 -1
  6. package/cjs/compile/compiler.d.ts +0 -1
  7. package/cjs/compile/compiler.js +0 -3
  8. package/cjs/compile/compiler.js.map +1 -1
  9. package/cjs/compile/interface/compilable-item.d.ts +1 -2
  10. package/cjs/compile/interface/compilable-item.js.map +1 -1
  11. package/cjs/component/brush/brush.d.ts +1 -4
  12. package/cjs/component/brush/brush.js +14 -31
  13. package/cjs/component/brush/brush.js.map +1 -1
  14. package/cjs/component/brush/interface.d.ts +1 -3
  15. package/cjs/component/brush/interface.js.map +1 -1
  16. package/cjs/component/crosshair/interface/spec.d.ts +0 -1
  17. package/cjs/component/crosshair/interface/spec.js.map +1 -1
  18. package/cjs/component/tooltip/interface/common.d.ts +0 -1
  19. package/cjs/component/tooltip/interface/common.js.map +1 -1
  20. package/cjs/component/tooltip/processor/base.js +1 -1
  21. package/cjs/component/tooltip/processor/base.js.map +1 -1
  22. package/cjs/component/tooltip/tooltip.d.ts +0 -1
  23. package/cjs/component/tooltip/tooltip.js +2 -3
  24. package/cjs/component/tooltip/tooltip.js.map +1 -1
  25. package/cjs/component/tooltip/utils/show-tooltip.d.ts +1 -0
  26. package/cjs/component/tooltip/utils/show-tooltip.js +30 -6
  27. package/cjs/component/tooltip/utils/show-tooltip.js.map +1 -1
  28. package/cjs/constant/correlation.js +1 -1
  29. package/cjs/constant/data.js +1 -1
  30. package/cjs/constant/event.js +1 -1
  31. package/cjs/constant/funnel.js +1 -1
  32. package/cjs/constant/gradient.js +1 -1
  33. package/cjs/constant/hierarchy.js +1 -1
  34. package/cjs/constant/label.js +1 -1
  35. package/cjs/constant/layout.js +1 -1
  36. package/cjs/constant/marker.js +1 -1
  37. package/cjs/constant/polar.js +1 -1
  38. package/cjs/constant/scatter.js +1 -1
  39. package/cjs/constant/scroll-bar.js +2 -1
  40. package/cjs/constant/sunburst.js +1 -1
  41. package/cjs/constant/waterfall.js +1 -1
  42. package/cjs/constant/word-cloud.js +1 -1
  43. package/cjs/core/index.d.ts +1 -1
  44. package/cjs/core/index.js +1 -1
  45. package/cjs/core/index.js.map +1 -1
  46. package/cjs/core/interface.d.ts +1 -9
  47. package/cjs/core/interface.js +1 -1
  48. package/cjs/core/interface.js.map +1 -1
  49. package/cjs/core/util.js +1 -1
  50. package/cjs/core/vchart.d.ts +0 -4
  51. package/cjs/core/vchart.js +2 -11
  52. package/cjs/core/vchart.js.map +1 -1
  53. package/cjs/data/initialize.js +1 -1
  54. package/cjs/data/register.js +1 -1
  55. package/cjs/env/env.js +1 -1
  56. package/cjs/env/index.js +1 -1
  57. package/cjs/event/bubble.js +1 -1
  58. package/cjs/event/event-dispatcher.js +1 -1
  59. package/cjs/event/event.js +2 -2
  60. package/cjs/event/event.js.map +1 -1
  61. package/cjs/event/events/dimension/dimension-hover.js +2 -4
  62. package/cjs/event/events/dimension/dimension-hover.js.map +1 -1
  63. package/cjs/event/index.js +1 -1
  64. package/cjs/event/interface.js +1 -2
  65. package/cjs/interaction/config.js +1 -1
  66. package/cjs/interaction/index.js +1 -1
  67. package/cjs/interaction/interaction.js +1 -1
  68. package/cjs/mark/base/base-mark.js +9 -5
  69. package/cjs/mark/base/base-mark.js.map +1 -1
  70. package/esm/compile/compiler.d.ts +0 -1
  71. package/esm/compile/compiler.js +0 -3
  72. package/esm/compile/compiler.js.map +1 -1
  73. package/esm/compile/interface/compilable-item.d.ts +1 -2
  74. package/esm/compile/interface/compilable-item.js.map +1 -1
  75. package/esm/component/brush/brush.d.ts +1 -4
  76. package/esm/component/brush/brush.js +14 -31
  77. package/esm/component/brush/brush.js.map +1 -1
  78. package/esm/component/brush/interface.d.ts +1 -3
  79. package/esm/component/brush/interface.js.map +1 -1
  80. package/esm/component/crosshair/interface/spec.d.ts +0 -1
  81. package/esm/component/crosshair/interface/spec.js.map +1 -1
  82. package/esm/component/tooltip/interface/common.d.ts +0 -1
  83. package/esm/component/tooltip/interface/common.js.map +1 -1
  84. package/esm/component/tooltip/processor/base.js +1 -1
  85. package/esm/component/tooltip/processor/base.js.map +1 -1
  86. package/esm/component/tooltip/tooltip.d.ts +0 -1
  87. package/esm/component/tooltip/tooltip.js +2 -3
  88. package/esm/component/tooltip/tooltip.js.map +1 -1
  89. package/esm/component/tooltip/utils/show-tooltip.d.ts +1 -0
  90. package/esm/component/tooltip/utils/show-tooltip.js +30 -6
  91. package/esm/component/tooltip/utils/show-tooltip.js.map +1 -1
  92. package/esm/constant/correlation.js +1 -1
  93. package/esm/constant/data.js +1 -1
  94. package/esm/constant/event.js +1 -1
  95. package/esm/constant/funnel.js +1 -1
  96. package/esm/constant/gradient.js +1 -1
  97. package/esm/constant/hierarchy.js +1 -1
  98. package/esm/constant/label.js +1 -1
  99. package/esm/constant/layout.js +1 -1
  100. package/esm/constant/marker.js +1 -1
  101. package/esm/constant/polar.js +1 -1
  102. package/esm/constant/scatter.js +1 -1
  103. package/esm/constant/scroll-bar.js +2 -1
  104. package/esm/constant/sunburst.js +1 -1
  105. package/esm/constant/waterfall.js +1 -1
  106. package/esm/constant/word-cloud.js +1 -1
  107. package/esm/core/index.d.ts +1 -1
  108. package/esm/core/index.js +1 -1
  109. package/esm/core/index.js.map +1 -1
  110. package/esm/core/interface.d.ts +1 -9
  111. package/esm/core/interface.js +1 -1
  112. package/esm/core/interface.js.map +1 -1
  113. package/esm/core/util.js +1 -1
  114. package/esm/core/vchart.d.ts +0 -4
  115. package/esm/core/vchart.js +2 -11
  116. package/esm/core/vchart.js.map +1 -1
  117. package/esm/data/initialize.js +1 -1
  118. package/esm/data/register.js +1 -1
  119. package/esm/env/env.js +1 -1
  120. package/esm/env/index.js +1 -1
  121. package/esm/event/bubble.js +1 -1
  122. package/esm/event/event-dispatcher.js +1 -1
  123. package/esm/event/event.js +2 -2
  124. package/esm/event/event.js.map +1 -1
  125. package/esm/event/events/dimension/dimension-hover.js +2 -4
  126. package/esm/event/events/dimension/dimension-hover.js.map +1 -1
  127. package/esm/event/index.js +1 -1
  128. package/esm/event/interface.js +1 -2
  129. package/esm/interaction/config.js +1 -1
  130. package/esm/interaction/index.js +1 -1
  131. package/esm/interaction/interaction.js +1 -1
  132. package/esm/mark/base/base-mark.js +9 -5
  133. package/esm/mark/base/base-mark.js.map +1 -1
  134. package/package.json +9 -9
package/build/index.js CHANGED
@@ -16495,6 +16495,7 @@
16495
16495
  var _a;
16496
16496
  if (!states.length) return void this.clearStates(hasAnimation);
16497
16497
  if (!((null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) !== states.length || states.some((stateName, index) => this.currentStates[index] !== stateName))) return;
16498
+ this.stateSort && (states = states.sort(this.stateSort));
16498
16499
  const stateAttrs = {};
16499
16500
  states.forEach(stateName => {
16500
16501
  var _a;
@@ -18523,7 +18524,7 @@
18523
18524
  var _a;
18524
18525
  if (!states.length) return void this.clearStates(hasAnimation);
18525
18526
  if (!((null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) !== states.length || states.some((stateName, index) => this.currentStates[index] !== stateName))) return;
18526
- this.stopStateAnimates();
18527
+ this.stopStateAnimates(), this.stateSort && (states = states.sort(this.stateSort));
18527
18528
  const stateAttrs = {},
18528
18529
  subAttrs = this.subGraphic.map(() => ({}));
18529
18530
  states.forEach(stateName => {
@@ -35177,8 +35178,8 @@
35177
35178
  }
35178
35179
  parseParams(params, isTimeline, child) {
35179
35180
  var _a, _b;
35180
- const totalTime = this.resolveValue(params.totalTime, void 0, void 0),
35181
- startTime = this.resolveValue(params.startTime, void 0, 0),
35181
+ const totalTime = this.resolveValue(params.totalTime, child, void 0),
35182
+ startTime = this.resolveValue(params.startTime, child, 0),
35182
35183
  parsedParams = Object.assign({}, params);
35183
35184
  parsedParams.oneByOneDelay = 0, parsedParams.startTime = startTime, parsedParams.totalTime = totalTime;
35184
35185
  const oneByOne = this.resolveValue(params.oneByOne, child, !1);
@@ -35227,11 +35228,10 @@
35227
35228
  let oneByOneDelay = 0;
35228
35229
  oneByOne && (oneByOneDelay = "number" == typeof oneByOne ? oneByOne : oneByOne ? delay + delayAfter + duration : 0), parsedParams.oneByOneDelay = oneByOneDelay, parsedParams.custom = null !== (_a = params.custom) && void 0 !== _a ? _a : AnimateExecutor.builtInAnimateMap[null !== (_b = params.type) && void 0 !== _b ? _b : "fromTo"];
35229
35230
  const customType = getCustomType(parsedParams.custom);
35230
- if (parsedParams.customType = customType, totalTime) {
35231
- const _totalTime = delay + delayAfter + duration + oneByOneDelay * (this._target.count - 2),
35232
- scale = totalTime ? totalTime / _totalTime : 1;
35233
- parsedParams.delay = delay * scale, parsedParams.delayAfter = delayAfter * scale, parsedParams.duration = duration * scale, parsedParams.oneByOneDelay = oneByOneDelay * scale, parsedParams.startTime = startTime;
35234
- }
35231
+ parsedParams.customType = customType;
35232
+ const _totalTime = delay + delayAfter + duration + oneByOneDelay * (this._target.count - 2),
35233
+ scale = isValidNumber$1(totalTime) ? totalTime / _totalTime : 1;
35234
+ parsedParams.delay = delay * scale, parsedParams.delayAfter = delayAfter * scale, parsedParams.duration = duration * scale, parsedParams.oneByOneDelay = oneByOneDelay * scale, parsedParams.startTime = startTime;
35235
35235
  }
35236
35236
  return parsedParams;
35237
35237
  }
@@ -51102,8 +51102,6 @@
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;
51107
51105
  const {
51108
51106
  updateTrigger = DEFAULT_BRUSH_ATTRIBUTES.updateTrigger,
51109
51107
  endTrigger = DEFAULT_BRUSH_ATTRIBUTES.endTrigger,
@@ -51111,11 +51109,11 @@
51111
51109
  } = this.attribute;
51112
51110
  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];
51113
51111
  }, this._onBrushing = 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))));
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)));
51115
51113
  }, this._onBrushingWithDelay = 0 === this.attribute.delayTime ? this._onBrushing : delayMap$1[this.attribute.delayType](this._onBrushing, this.attribute.delayTime), this._onBrushEnd = e => {
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);
51114
+ this._releaseBrushUpdateEvents(), e.preventDefault(), this._activeDrawState && this._drawEnd(e), this._activeMoveState && this._moveEnd(e), this._activeDrawState = !1, this._activeMoveState = !1;
51117
51115
  }, this._onBrushClear = e => {
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);
51116
+ e.preventDefault(), this._isEmptyMask() || (this._clearMask(), this._dispatchBrushEvent(IOperateType.brushClear, e)), this._activeDrawState = !1, this._activeMoveState = !1;
51119
51117
  };
51120
51118
  }
51121
51119
  _bindBrushEvents() {
@@ -51127,7 +51125,6 @@
51127
51125
  array(trigger).forEach(t => this.stage.addEventListener(t, this._onBrushStart)), array(resetTrigger).forEach(t => this.stage.addEventListener(t, this._onBrushClear));
51128
51126
  }
51129
51127
  _initDraw(e) {
51130
- if (!1 === this.attribute.interactive) return;
51131
51128
  const {
51132
51129
  brushMode: brushMode
51133
51130
  } = this.attribute,
@@ -51136,7 +51133,6 @@
51136
51133
  }
51137
51134
  _initMove(e) {
51138
51135
  var _a, _b;
51139
- if (!1 === this.attribute.interactive) return;
51140
51136
  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;
51141
51137
  const {
51142
51138
  interactiveRange: interactiveRange
@@ -51161,7 +51157,6 @@
51161
51157
  }
51162
51158
  _drawing(e) {
51163
51159
  var _a;
51164
- if (!1 === this.attribute.interactive) return;
51165
51160
  const pos = this.eventPosToStagePos(e),
51166
51161
  {
51167
51162
  brushType: brushType,
@@ -51186,7 +51181,6 @@
51186
51181
  (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)));
51187
51182
  }
51188
51183
  _moving(e) {
51189
- if (!1 === this.attribute.interactive) return;
51190
51184
  const startPos = this._cacheMovePoint,
51191
51185
  pos = this.eventPosToStagePos(e);
51192
51186
  if (pos.x === (null == startPos ? void 0 : startPos.x) && pos.y === (null == startPos ? void 0 : startPos.y)) return;
@@ -51200,7 +51194,6 @@
51200
51194
  }), this._brushMaskAABBBoundsDict[this._operatingMask.name] = this._operatingMask.AABBBounds, this._dispatchBrushEvent(IOperateType.moving, e);
51201
51195
  }
51202
51196
  _drawEnd(e) {
51203
- if (!1 === this.attribute.interactive) return;
51204
51197
  const {
51205
51198
  removeOnClick = !0,
51206
51199
  sizeThreshold = DEFAULT_SIZE_THRESHOLD
@@ -51218,7 +51211,7 @@
51218
51211
  }
51219
51212
  }
51220
51213
  _moveEnd(e) {
51221
- !1 !== this.attribute.interactive && (this._operatingMask && this._operatingMask.setAttribute("pickable", !1), this._dispatchBrushEvent(IOperateType.moveEnd, e));
51214
+ this._operatingMask && this._operatingMask.setAttribute("pickable", !1), this._dispatchBrushEvent(IOperateType.moveEnd, e);
51222
51215
  }
51223
51216
  render() {
51224
51217
  this._bindBrushEvents();
@@ -51325,10 +51318,6 @@
51325
51318
  pos = this.eventPosToStagePos(e);
51326
51319
  return pos.x > maxX || pos.x < minX || pos.y > maxY || pos.y < minY;
51327
51320
  }
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
- }
51332
51321
  _dispatchBrushEvent(operateType, e) {
51333
51322
  this._dispatchEvent(operateType, {
51334
51323
  operateMask: this._operatingMask,
@@ -53874,7 +53863,7 @@
53874
53863
  if (ComposedEventCtor) {
53875
53864
  const composedEvent = new ComposedEventCtor(this._eventDispatcher, this._mode);
53876
53865
  composedEvent.register(eType, handler);
53877
- this._composedEventMap.set(handler.callback, {
53866
+ this._composedEventMap.set(callback, {
53878
53867
  eventType: eType,
53879
53868
  event: composedEvent
53880
53869
  });
@@ -54911,9 +54900,6 @@
54911
54900
  getRootGroup() {
54912
54901
  return this._rootGroup;
54913
54902
  }
54914
- getOption() {
54915
- return this._option;
54916
- }
54917
54903
  constructor(container, option) {
54918
54904
  this._count = 0;
54919
54905
  this._rootMarks = [];
@@ -58908,6 +58894,7 @@
58908
58894
  allGraphics.forEach((g, index) => {
58909
58895
  g.context.graphicCount = graphicCount;
58910
58896
  g.context.graphicIndex = index;
58897
+ g.stateSort = this._stateSort;
58911
58898
  });
58912
58899
  this._dataByKey = newGroupedData;
58913
58900
  this._graphics = allGraphics;
@@ -58953,8 +58940,13 @@
58953
58940
  var _a;
58954
58941
  const attrsByGroup = noGroupEncode ? null : this._runGroupEncoder((_a = this._encoderOfState) === null || _a === void 0 ? void 0 : _a.group);
58955
58942
  graphics.forEach((g, index) => {
58956
- var _a;
58957
- const attrs = this._runEncoderOfGraphic((_a = this._encoderOfState) === null || _a === void 0 ? void 0 : _a.update, g);
58943
+ var _a, _b;
58944
+ let attrs = this._runEncoderOfGraphic((_a = this._encoderOfState) === null || _a === void 0 ? void 0 : _a.update, g);
58945
+ (_b = g.currentStates) === null || _b === void 0 ? void 0 : _b.forEach((_state) => {
58946
+ var _a;
58947
+ const stateAttr = this._runEncoderOfGraphic((_a = this._encoderOfState) === null || _a === void 0 ? void 0 : _a[_state], g);
58948
+ attrs = Object.assign(Object.assign({}, attrs), stateAttr);
58949
+ });
58958
58950
  if (!isNil$1(this._markConfig.interactive)) {
58959
58951
  attrs.pickable = this._markConfig.interactive;
58960
58952
  }
@@ -58976,6 +58968,7 @@
58976
58968
  }
58977
58969
  g.context = mockGraphic.context;
58978
58970
  g.context.diffAttrs = finalAttrs;
58971
+ g.stateSort = this._stateSort;
58979
58972
  const gIndex = this._graphics === graphics ? index : index + this._graphics.length - graphics.length;
58980
58973
  if (gIndex >= 0) {
58981
58974
  this._graphics[gIndex] = g;
@@ -60390,7 +60383,6 @@
60390
60383
  this._observer = null;
60391
60384
  this._context = {};
60392
60385
  this._renderState = RenderStateEnum.render;
60393
- this._disableDimensionHoverEvent = false;
60394
60386
  this._doResize = () => {
60395
60387
  const { width, height } = this.getCurrentSize();
60396
60388
  if (this._currentSize.width !== width || this._currentSize.height !== height) {
@@ -60535,7 +60527,7 @@
60535
60527
  this._compiler.updateLayoutTag();
60536
60528
  this._setFontFamilyTheme(this.getTheme('fontFamily'));
60537
60529
  this._initDataSet(this._option.dataSet);
60538
- this._autoSize = isTrueBrowseEnv ? ((_g = (_f = spec.autoFit) !== null && _f !== void 0 ? _f : this._option.autoFit) !== null && _g !== void 0 ? _g : true) : false;
60530
+ this._autoSize = isTrueBrowseEnv ? (_g = (_f = spec.autoFit) !== null && _f !== void 0 ? _f : this._option.autoFit) !== null && _g !== void 0 ? _g : true : false;
60539
60531
  this._bindResizeEvent();
60540
60532
  this._bindViewEvent();
60541
60533
  this._initChartPlugin();
@@ -61188,7 +61180,7 @@
61188
61180
  resize = true;
61189
61181
  }
61190
61182
  const lasAutoSize = this._autoSize;
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;
61183
+ 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;
61192
61184
  if (this._autoSize !== lasAutoSize) {
61193
61185
  resize = true;
61194
61186
  }
@@ -61429,22 +61421,6 @@
61429
61421
  var _a;
61430
61422
  return (_a = this._chart) === null || _a === void 0 ? void 0 : _a.setDimensionIndex(value, opt);
61431
61423
  }
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
- }
61448
61424
  showCrosshair(cb) {
61449
61425
  var _a;
61450
61426
  (_a = this._chart) === null || _a === void 0 ? void 0 : _a.showCrosshair(cb);
@@ -61773,7 +61749,7 @@
61773
61749
  });
61774
61750
  };
61775
61751
 
61776
- const version = "2.0.12";
61752
+ const version = "2.0.13";
61777
61753
 
61778
61754
  const addVChartProperty = (data, op) => {
61779
61755
  const context = op.beforeCall();
@@ -64465,8 +64441,7 @@
64465
64441
  super(...arguments);
64466
64442
  this._cacheDimensionInfo = null;
64467
64443
  this.onMouseMove = (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))) {
64444
+ if (!params) {
64470
64445
  return;
64471
64446
  }
64472
64447
  const x = params.event.viewX;
@@ -64488,8 +64463,7 @@
64488
64463
  }
64489
64464
  };
64490
64465
  this.onMouseOut = (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))) {
64466
+ if (!params) {
64493
64467
  return;
64494
64468
  }
64495
64469
  this._callback.call(null, Object.assign(Object.assign({}, params), { action: 'leave', dimensionInfo: this._cacheDimensionInfo ? this._cacheDimensionInfo.slice() : [] }));
@@ -71787,9 +71761,6 @@
71787
71761
  }
71788
71762
  shouldHandleTooltip(params, info) {
71789
71763
  var _a, _b;
71790
- if (!this.component.enable) {
71791
- return false;
71792
- }
71793
71764
  if (isNil$1(info)) {
71794
71765
  return false;
71795
71766
  }
@@ -95674,7 +95645,7 @@
95674
95645
  return Object.keys(data).length > 0;
95675
95646
  };
95676
95647
  function showTooltip(datum, options, component) {
95677
- var _a, _b, _c, _d, _e, _f;
95648
+ var _a, _b, _c, _d, _e, _f, _g;
95678
95649
  const opt = Object.assign({ regionIndex: 0 }, options);
95679
95650
  const componentOptions = component.getOption();
95680
95651
  const region = componentOptions.getRegionsInUserIdOrIndex(isValid$1(opt.regionId) ? [opt.regionId] : undefined, isValid$1(opt.regionIndex) ? [opt.regionIndex] : undefined)[0];
@@ -95694,12 +95665,11 @@
95694
95665
  const getOriginDatum = (info) => {
95695
95666
  var _a;
95696
95667
  const { dimensionFields, dimensionData, measureFields, measureData, groupField, groupData } = info.data;
95697
- const originDatum = (_a = info.series.getViewData()) === null || _a === void 0 ? void 0 : _a.latestData.find((datum) => {
95668
+ return (_a = info.series.getViewData()) === null || _a === void 0 ? void 0 : _a.latestData.find((datum) => {
95698
95669
  return (datumContainsArray(dimensionFields, dimensionData)(datum) &&
95699
95670
  datumContainsArray(measureFields, measureData)(datum) &&
95700
95671
  (isNil$1(groupField) || datumContainsArray([groupField], [groupData])(datum)));
95701
95672
  });
95702
- return originDatum;
95703
95673
  };
95704
95674
  const transform = region.getOption().globalInstance.getStage().window.getViewBoxTransform().getInverse();
95705
95675
  const getMockEvent = (originPos) => {
@@ -95773,7 +95743,7 @@
95773
95743
  if (!info) {
95774
95744
  return 'none';
95775
95745
  }
95776
- const mockDatum = Object.assign(Object.assign({}, getOriginDatum(info)), datum);
95746
+ const mockDatum = (_f = info.data.originDatum) !== null && _f !== void 0 ? _f : Object.assign(Object.assign({}, getOriginDatum(info)), datum);
95777
95747
  const mockDimensionData = [
95778
95748
  {
95779
95749
  datum: [mockDatum],
@@ -95790,7 +95760,7 @@
95790
95760
  changePositionOnly: false,
95791
95761
  tooltip: null,
95792
95762
  dimensionInfo: mockDimensionInfo,
95793
- chart: (_f = componentOptions.globalInstance.getChart()) !== null && _f !== void 0 ? _f : undefined,
95763
+ chart: (_g = componentOptions.globalInstance.getChart()) !== null && _g !== void 0 ? _g : undefined,
95794
95764
  datum: mockDatum,
95795
95765
  model: info.series,
95796
95766
  source: Event_Source_Type.chart,
@@ -95855,6 +95825,40 @@
95855
95825
  series
95856
95826
  });
95857
95827
  };
95828
+ const parseMarkInfoOfGeoSeries = () => {
95829
+ var _a, _b;
95830
+ const originDatum = (_b = (_a = series
95831
+ .getMapViewData) === null || _a === void 0 ? void 0 : _a.call(series)) === null || _b === void 0 ? void 0 : _b.latestData.find((datum) => dimensionFields.every((key, i) => datum.properties[key] === (dimensionData === null || dimensionData === void 0 ? void 0 : dimensionData[i])));
95832
+ let markInfoMeasureData = measureData;
95833
+ if (!hasMeasureData) {
95834
+ measureData = getDataArrayFromFieldArray(measureFields, originDatum);
95835
+ markInfoMeasureData = measureData;
95836
+ if (!hasData(measureData) && !originDatum) {
95837
+ return;
95838
+ }
95839
+ measureData = Object.assign({}, originDatum.properties);
95840
+ }
95841
+ const pos = series.type === exports.SeriesTypeEnum.pie
95842
+ ? series.dataToCentralPosition(originDatum.properties)
95843
+ : series.dataToPosition(originDatum.properties);
95844
+ if (isNil$1(pos) || isNaN(pos.x) || isNaN(pos.y)) {
95845
+ return;
95846
+ }
95847
+ markInfoList.push({
95848
+ pos,
95849
+ data: {
95850
+ dimensionFields,
95851
+ dimensionData,
95852
+ measureFields,
95853
+ measureData: markInfoMeasureData,
95854
+ hasMeasureData,
95855
+ groupField,
95856
+ groupData,
95857
+ originDatum
95858
+ },
95859
+ series
95860
+ });
95861
+ };
95858
95862
  if (series.coordinate === 'cartesian') {
95859
95863
  const cartesianSeries = series;
95860
95864
  const dimType = isDiscrete((_f = (_e = series.getYAxisHelper()) === null || _e === void 0 ? void 0 : _e.getScale(0)) === null || _f === void 0 ? void 0 : _f.type) ? 'y' : 'x';
@@ -95979,7 +95983,7 @@
95979
95983
  }
95980
95984
  }
95981
95985
  else if (series.coordinate === 'geo') {
95982
- parseMarkInfoOfSimpleSeries();
95986
+ parseMarkInfoOfGeoSeries();
95983
95987
  }
95984
95988
  });
95985
95989
  return markInfoList;
@@ -96087,7 +96091,6 @@
96087
96091
  this.specKey = 'tooltip';
96088
96092
  this.layoutType = 'none';
96089
96093
  this._isReleased = false;
96090
- this.enable = true;
96091
96094
  this._alwaysShow = false;
96092
96095
  this._eventList = [];
96093
96096
  this._isTooltipShown = false;
@@ -103243,9 +103246,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
103243
103246
  this._initMarkBrushState(componentIndex, '');
103244
103247
  brushComponent.children[0].removeAllChild();
103245
103248
  }
103246
- _shouldEnableInteractive() {
103247
- return this.getOption().getCompiler().getOption().interactive !== false;
103248
- }
103249
103249
  _createBrushComponent(region, componentIndex) {
103250
103250
  var _a, _b;
103251
103251
  const interactiveAttr = this._getBrushInteractiveAttr(region);
@@ -103256,45 +103256,33 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
103256
103256
  this._cacheInteractiveRangeAttrs.push(interactiveAttr);
103257
103257
  brush.addEventListener(IOperateType.brushActive, (e) => {
103258
103258
  this._initMarkBrushState(componentIndex, OUT_BRUSH_STATE);
103259
- this._emitEvent(exports.ChartEvent.brushActive, region, e);
103259
+ this._emitEvent(exports.ChartEvent.brushActive, region);
103260
103260
  });
103261
103261
  brush.addEventListener(IOperateType.drawStart, (e) => {
103262
- if (this._spec.disableDimensionHoverWhenBrushing) {
103263
- this._option.globalInstance.disableDimensionHoverEvent(true);
103264
- }
103265
103262
  this._setRegionMarkPickable(region, true);
103266
- this._emitEvent(exports.ChartEvent.brushStart, region, e);
103263
+ this._emitEvent(exports.ChartEvent.brushStart, region);
103267
103264
  });
103268
103265
  brush.addEventListener(IOperateType.moveStart, (e) => {
103269
- if (this._spec.disableDimensionHoverWhenBrushing) {
103270
- this._option.globalInstance.disableDimensionHoverEvent(true);
103271
- }
103272
103266
  this._setRegionMarkPickable(region, true);
103273
- this._emitEvent(exports.ChartEvent.brushStart, region, e);
103267
+ this._emitEvent(exports.ChartEvent.brushStart, region);
103274
103268
  });
103275
103269
  brush.addEventListener(IOperateType.drawing, (e) => {
103276
103270
  this._setRegionMarkPickable(region, false);
103277
103271
  this._handleBrushChange(region, e);
103278
- this._emitEvent(exports.ChartEvent.brushChange, region, e);
103272
+ this._emitEvent(exports.ChartEvent.brushChange, region);
103279
103273
  });
103280
103274
  brush.addEventListener(IOperateType.moving, (e) => {
103281
103275
  this._setRegionMarkPickable(region, false);
103282
103276
  this._handleBrushChange(region, e);
103283
- this._emitEvent(exports.ChartEvent.brushChange, region, e);
103277
+ this._emitEvent(exports.ChartEvent.brushChange, region);
103284
103278
  });
103285
103279
  brush.addEventListener(IOperateType.brushClear, (e) => {
103286
- if (this._spec.disableDimensionHoverWhenBrushing) {
103287
- this._option.globalInstance.disableDimensionHoverEvent(false);
103288
- }
103289
103280
  this._setRegionMarkPickable(region, true);
103290
103281
  this._initMarkBrushState(componentIndex, '');
103291
- this._emitEvent(exports.ChartEvent.brushClear, region, e);
103282
+ this._emitEvent(exports.ChartEvent.brushClear, region);
103292
103283
  });
103293
103284
  brush.addEventListener(IOperateType.drawEnd, (e) => {
103294
103285
  var _a;
103295
- if (this._spec.disableDimensionHoverWhenBrushing) {
103296
- this._option.globalInstance.disableDimensionHoverEvent(false);
103297
- }
103298
103286
  this._setRegionMarkPickable(region, true);
103299
103287
  const { operateMask } = e.detail;
103300
103288
  const { updateElementsState = true } = this._spec;
@@ -103302,11 +103290,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
103302
103290
  if (this._spec.onBrushEnd(e) === true) {
103303
103291
  this.clearGraphic();
103304
103292
  this._initMarkBrushState(componentIndex, '');
103305
- this._emitEvent(exports.ChartEvent.brushClear, region, e);
103293
+ this._emitEvent(exports.ChartEvent.brushClear, region);
103306
103294
  }
103307
103295
  else {
103308
103296
  this._spec.onBrushEnd(e);
103309
- this._emitEvent(exports.ChartEvent.brushEnd, region, e);
103297
+ this._emitEvent(exports.ChartEvent.brushEnd, region);
103310
103298
  }
103311
103299
  }
103312
103300
  else {
@@ -103314,13 +103302,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
103314
103302
  if ((!this._spec.zoomWhenEmpty && inBrushData.length > 0) || !updateElementsState) {
103315
103303
  this._setAxisAndDataZoom(operateMask, region);
103316
103304
  }
103317
- this._emitEvent(exports.ChartEvent.brushEnd, region, e);
103305
+ this._emitEvent(exports.ChartEvent.brushEnd, region);
103318
103306
  }
103319
103307
  });
103320
103308
  brush.addEventListener(IOperateType.moveEnd, (e) => {
103321
- if (this._spec.disableDimensionHoverWhenBrushing) {
103322
- this._option.globalInstance.disableDimensionHoverEvent(false);
103323
- }
103324
103309
  this._setRegionMarkPickable(region, true);
103325
103310
  const { operateMask } = e.detail;
103326
103311
  const { updateElementsState = true } = this._spec;
@@ -103328,7 +103313,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
103328
103313
  if ((!this._spec.zoomWhenEmpty && inBrushData.length > 0) || updateElementsState) {
103329
103314
  this._setAxisAndDataZoom(operateMask, region);
103330
103315
  }
103331
- this._emitEvent(exports.ChartEvent.brushEnd, region, e);
103316
+ this._emitEvent(exports.ChartEvent.brushEnd, region);
103332
103317
  });
103333
103318
  }
103334
103319
  _getBrushInteractiveAttr(region) {
@@ -103346,8 +103331,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
103346
103331
  maxX: seriesRegionEndX
103347
103332
  },
103348
103333
  xRange: [seriesRegionStartX, seriesRegionEndX],
103349
- yRange: [seriesRegionStartY, seriesRegionEndY],
103350
- interactive: this._shouldEnableInteractive()
103334
+ yRange: [seriesRegionStartY, seriesRegionEndY]
103351
103335
  };
103352
103336
  }
103353
103337
  _transformBrushedMarkAttr(brushedStyle) {
@@ -103368,7 +103352,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
103368
103352
  }
103369
103353
  _handleBrushChange(region, e) {
103370
103354
  const { operateMask } = e.detail;
103371
- this._operateMask = operateMask;
103372
103355
  const { updateElementsState = true } = this._spec;
103373
103356
  if (updateElementsState) {
103374
103357
  this._reconfigItem(operateMask, region);
@@ -103393,7 +103376,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
103393
103376
  }
103394
103377
  return data;
103395
103378
  }
103396
- _emitEvent(eventType, region, e) {
103379
+ _emitEvent(eventType, region) {
103397
103380
  var _a;
103398
103381
  this.event.emit(eventType, {
103399
103382
  model: this,
@@ -103410,8 +103393,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
103410
103393
  linkedOutOfBrushElementsMap: this._linkedOutOfBrushElementsMap,
103411
103394
  zoomRecord: this._zoomRecord
103412
103395
  },
103413
- vchart: (_a = this._option) === null || _a === void 0 ? void 0 : _a.globalInstance,
103414
- event: e
103396
+ vchart: (_a = this._option) === null || _a === void 0 ? void 0 : _a.globalInstance
103415
103397
  });
103416
103398
  }
103417
103399
  _reconfigItem(operateMask, region) {
@@ -103666,12 +103648,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
103666
103648
  this._brushComponents = null;
103667
103649
  }
103668
103650
  }
103669
- clearBrushStateAndMask() {
103670
- this._relativeRegions.forEach((region, componentIndex) => {
103671
- this._initMarkBrushState(componentIndex, '');
103672
- this._brushComponents[componentIndex].children[0].removeAllChild();
103673
- });
103674
- }
103675
103651
  }
103676
103652
  Brush.type = ComponentTypeEnum.brush;
103677
103653
  Brush.builtInTheme = {