@visactor/vchart 1.9.6-alpha.4 → 1.9.6-alpha.6

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 (95) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.js +87 -256
  3. package/build/index.min.js +1 -1
  4. package/build/tsconfig.tsbuildinfo +1 -1
  5. package/cjs/compile/mark/util.js +1 -0
  6. package/cjs/compile/mark/util.js.map +1 -1
  7. package/cjs/component/axis/base-axis.js +1 -1
  8. package/cjs/component/axis/base-axis.js.map +1 -1
  9. package/cjs/component/brush/brush.d.ts +0 -5
  10. package/cjs/component/brush/brush.js +14 -60
  11. package/cjs/component/brush/brush.js.map +1 -1
  12. package/cjs/component/brush/interface.d.ts +0 -3
  13. package/cjs/component/brush/interface.js.map +1 -1
  14. package/cjs/component/data-zoom/data-filter-base-component.d.ts +2 -11
  15. package/cjs/component/data-zoom/data-filter-base-component.js +12 -31
  16. package/cjs/component/data-zoom/data-filter-base-component.js.map +1 -1
  17. package/cjs/component/data-zoom/data-zoom/data-zoom.d.ts +0 -1
  18. package/cjs/component/data-zoom/data-zoom/data-zoom.js +8 -11
  19. package/cjs/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
  20. package/cjs/component/data-zoom/data-zoom/interface.d.ts +0 -1
  21. package/cjs/component/data-zoom/data-zoom/interface.js.map +1 -1
  22. package/cjs/component/data-zoom/interface.d.ts +0 -2
  23. package/cjs/component/data-zoom/interface.js.map +1 -1
  24. package/cjs/component/data-zoom/scroll-bar/scroll-bar.js +1 -2
  25. package/cjs/component/data-zoom/scroll-bar/scroll-bar.js.map +1 -1
  26. package/cjs/component/data-zoom/util.js +1 -5
  27. package/cjs/component/data-zoom/util.js.map +1 -1
  28. package/cjs/component/label/base-label.d.ts +2 -1
  29. package/cjs/component/label/base-label.js +3 -0
  30. package/cjs/component/label/base-label.js.map +1 -1
  31. package/cjs/component/label/label.d.ts +1 -2
  32. package/cjs/component/label/label.js +7 -10
  33. package/cjs/component/label/label.js.map +1 -1
  34. package/cjs/component/label/total-label.d.ts +1 -0
  35. package/cjs/component/label/total-label.js +9 -1
  36. package/cjs/component/label/total-label.js.map +1 -1
  37. package/cjs/core/index.d.ts +1 -1
  38. package/cjs/core/index.js +1 -1
  39. package/cjs/core/index.js.map +1 -1
  40. package/cjs/event/interface.d.ts +1 -1
  41. package/cjs/event/interface.js.map +1 -1
  42. package/cjs/interaction/zoom/zoomable.js +4 -6
  43. package/cjs/interaction/zoom/zoomable.js.map +1 -1
  44. package/cjs/mark/base/base-mark.js +2 -2
  45. package/cjs/mark/base/base-mark.js.map +1 -1
  46. package/cjs/series/funnel/funnel.js +2 -1
  47. package/cjs/series/funnel/funnel.js.map +1 -1
  48. package/cjs/series/map/geo-source.d.ts +1 -1
  49. package/cjs/series/map/geo-source.js.map +1 -1
  50. package/esm/compile/mark/util.js +1 -0
  51. package/esm/compile/mark/util.js.map +1 -1
  52. package/esm/component/axis/base-axis.js +1 -1
  53. package/esm/component/axis/base-axis.js.map +1 -1
  54. package/esm/component/brush/brush.d.ts +0 -5
  55. package/esm/component/brush/brush.js +13 -60
  56. package/esm/component/brush/brush.js.map +1 -1
  57. package/esm/component/brush/interface.d.ts +0 -3
  58. package/esm/component/brush/interface.js.map +1 -1
  59. package/esm/component/data-zoom/data-filter-base-component.d.ts +2 -11
  60. package/esm/component/data-zoom/data-filter-base-component.js +12 -31
  61. package/esm/component/data-zoom/data-filter-base-component.js.map +1 -1
  62. package/esm/component/data-zoom/data-zoom/data-zoom.d.ts +0 -1
  63. package/esm/component/data-zoom/data-zoom/data-zoom.js +9 -12
  64. package/esm/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
  65. package/esm/component/data-zoom/data-zoom/interface.d.ts +0 -1
  66. package/esm/component/data-zoom/data-zoom/interface.js.map +1 -1
  67. package/esm/component/data-zoom/interface.d.ts +0 -2
  68. package/esm/component/data-zoom/interface.js.map +1 -1
  69. package/esm/component/data-zoom/scroll-bar/scroll-bar.js +2 -3
  70. package/esm/component/data-zoom/scroll-bar/scroll-bar.js.map +1 -1
  71. package/esm/component/data-zoom/util.js +1 -5
  72. package/esm/component/data-zoom/util.js.map +1 -1
  73. package/esm/component/label/base-label.d.ts +2 -1
  74. package/esm/component/label/base-label.js +3 -0
  75. package/esm/component/label/base-label.js.map +1 -1
  76. package/esm/component/label/label.d.ts +1 -2
  77. package/esm/component/label/label.js +8 -9
  78. package/esm/component/label/label.js.map +1 -1
  79. package/esm/component/label/total-label.d.ts +1 -0
  80. package/esm/component/label/total-label.js +10 -0
  81. package/esm/component/label/total-label.js.map +1 -1
  82. package/esm/core/index.d.ts +1 -1
  83. package/esm/core/index.js +1 -1
  84. package/esm/core/index.js.map +1 -1
  85. package/esm/event/interface.d.ts +1 -1
  86. package/esm/event/interface.js.map +1 -1
  87. package/esm/interaction/zoom/zoomable.js +4 -6
  88. package/esm/interaction/zoom/zoomable.js.map +1 -1
  89. package/esm/mark/base/base-mark.js +1 -1
  90. package/esm/mark/base/base-mark.js.map +1 -1
  91. package/esm/series/funnel/funnel.js +2 -1
  92. package/esm/series/funnel/funnel.js.map +1 -1
  93. package/esm/series/map/geo-source.d.ts +1 -1
  94. package/esm/series/map/geo-source.js.map +1 -1
  95. package/package.json +12 -12
package/build/index.js CHANGED
@@ -23968,38 +23968,6 @@
23968
23968
  };
23969
23969
  DefaultPickService = __decorate$Z([injectable(), __param$u(0, inject(ContributionProvider)), __param$u(0, named(PickItemInterceptor)), __metadata$J("design:paramtypes", [Object])], DefaultPickService);
23970
23970
 
23971
- function simplifyRadialDist(points, sqTolerance) {
23972
- let deltaX,
23973
- deltaY,
23974
- lastX = points[0].x,
23975
- lastY = points[0].y;
23976
- const newPoints = [points[0]];
23977
- for (let i = 1, len = points.length; i < len; i++) deltaX = points[i].x - lastX, deltaY = points[i].y - lastY, deltaX * deltaX + deltaY * deltaY > sqTolerance && (lastX = points[i].x, lastY = points[i].y, newPoints.push(points[i]));
23978
- return points[points.length - 1].x === lastX && points[points.length - 1].y === lastY || newPoints.push(points[points.length - 1]), newPoints;
23979
- }
23980
- function simplifyDPStep(points, startIdx, endIdx, sqTolerance, simplified) {
23981
- let maxSqDist = sqTolerance,
23982
- nextIdx = startIdx;
23983
- const startX = points[startIdx].x,
23984
- startY = points[startIdx].y,
23985
- vecX2 = points[endIdx].x - startX,
23986
- vecY2 = points[endIdx].y - startY,
23987
- sqLength = vecX2 * vecX2 + vecY2 * vecY2;
23988
- let area, sqArea, sqDistance, vecX1, vecY1;
23989
- for (let i = startIdx + 1, len = endIdx - 1; i < len; i++) vecX1 = points[i].x - startX, vecY1 = points[i].y - startY, area = vecX1 * vecY2 - vecX2 * vecY1, sqArea = area * area, sqDistance = sqArea / sqLength, sqDistance > maxSqDist && (maxSqDist = sqDistance, nextIdx = i);
23990
- maxSqDist > sqTolerance && (nextIdx - startIdx > 2 && simplifyDPStep(points, startIdx, nextIdx, sqTolerance, simplified), simplified.push(points[nextIdx], points[nextIdx + 1]), endIdx - nextIdx > 2 && simplifyDPStep(points, nextIdx, endIdx, sqTolerance, simplified));
23991
- }
23992
- function simplifyDouglasPeucker(points, sqTolerance) {
23993
- const lastIdx = points.length - 1,
23994
- simplified = [points[0]];
23995
- return simplifyDPStep(points, 0, lastIdx, sqTolerance, simplified), simplified.push(points[lastIdx]), simplified;
23996
- }
23997
- function flatten_simplify(points, tolerance, highestQuality) {
23998
- if (points.length <= 10) return points;
23999
- const sqTolerance = void 0 !== tolerance ? tolerance * tolerance : 1;
24000
- return points = simplifyDouglasPeucker(points = highestQuality ? points : simplifyRadialDist(points, sqTolerance), sqTolerance);
24001
- }
24002
-
24003
23971
  let loadArcModule = !1;
24004
23972
  const arcModule = new ContainerModule(bind => {
24005
23973
  loadArcModule || (loadArcModule = !0, bind(DefaultCanvasArcRender).toSelf().inSingletonScope(), bind(ArcRender).to(DefaultCanvasArcRender).inSingletonScope(), bind(GraphicRender).toService(ArcRender), bind(ArcRenderContribution).toService(DefaultBaseInteractiveRenderContribution), bindContributionProvider(bind, ArcRenderContribution));
@@ -36988,17 +36956,9 @@
36988
36956
  }), items.length > 1 && alternateColor) {
36989
36957
  const colors = isArray$3(alternateColor) ? alternateColor : [alternateColor, "transparent"],
36990
36958
  getColor = index => colors[index % colors.length];
36991
- for (let index = 0; index < items.length; index++) {
36992
- const prev = items[index].points;
36993
- let curr;
36994
- curr = index !== items.length - 1 ? items[index + 1].points : [{
36995
- x: items[index].points[0].x + (items[index].points[0].x - items[index - 1].points[0].x),
36996
- y: items[index].points[0].y + (items[index].points[0].y - items[index - 1].points[0].y)
36997
- }, {
36998
- x: items[index].points[1].x + (items[index].points[1].x - items[index - 1].points[1].x),
36999
- y: items[index].points[1].y + (items[index].points[1].y - items[index - 1].points[1].y)
37000
- }];
37001
- const path = getRegionPath(prev, curr, gridAttrs),
36959
+ for (let index = 0; index < items.length - 1; index++) {
36960
+ const [prev, curr] = [items[index].points, items[index + 1].points],
36961
+ path = getRegionPath(prev, curr, gridAttrs),
37002
36962
  shape = graphicCreator.path({
37003
36963
  path: path,
37004
36964
  fill: getColor(index)
@@ -37445,11 +37405,11 @@
37445
37405
  start: start,
37446
37406
  end: end
37447
37407
  } = this.state;
37448
- this._activeState && (this._activeTag === DataZoomActiveTag.middleHandler ? this.moveZoomWithMiddle((this.state.start + this.state.end) / 2 + dis) : this._activeTag === DataZoomActiveTag.startHandler ? start + dis > end ? (start = end, end = start + dis, this._activeTag = DataZoomActiveTag.endHandler) : start += dis : this._activeTag === DataZoomActiveTag.endHandler && (end + dis < start ? (end = start, start = end + dis, this._activeTag = DataZoomActiveTag.startHandler) : end += dis), this._activeCache.lastPos = pos, brushSelect && this.renderDragMask()), start = Math.min(Math.max(start, 0), 1), end = Math.min(Math.max(end, 0), 1), startAttr === start && endAttr === end || this.setStateAttr(start, end, !0), realTime && this._dispatchEvent("change", {
37408
+ this._activeState && (this._activeTag === DataZoomActiveTag.middleHandler ? this.moveZoomWithMiddle((this.state.start + this.state.end) / 2 + dis) : this._activeTag === DataZoomActiveTag.startHandler ? start + dis > end ? (start = end, end = start + dis, this._activeTag = DataZoomActiveTag.endHandler) : start += dis : this._activeTag === DataZoomActiveTag.endHandler && (end + dis < start ? (end = start, start = end + dis, this._activeTag = DataZoomActiveTag.startHandler) : end += dis), this._activeCache.lastPos = pos, brushSelect && this.renderDragMask()), start = Math.min(Math.max(start, 0), 1), end = Math.min(Math.max(end, 0), 1), !realTime || startAttr === start && endAttr === end || (this.setStateAttr(start, end, !0), this._dispatchEvent("change", {
37449
37409
  start: start,
37450
37410
  end: end,
37451
37411
  tag: this._activeTag
37452
- });
37412
+ }));
37453
37413
  }, this._onHandlerPointerMove = 0 === this.attribute.delayTime ? this._pointerMove : delayMap$2[this.attribute.delayType](this._pointerMove, this.attribute.delayTime), this._onHandlerPointerUp = e => {
37454
37414
  e.preventDefault();
37455
37415
  const {
@@ -37462,11 +37422,11 @@
37462
37422
  const pos = this.eventPosToStagePos(e);
37463
37423
  this.backgroundDragZoom(this._activeCache.startPos, pos);
37464
37424
  }
37465
- this._activeState = !1, brushSelect && this.renderDragMask(), start === this.state.start && end === this.state.end || this.setStateAttr(this.state.start, this.state.end, !0), this._dispatchEvent("change", {
37425
+ this._activeState = !1, brushSelect && this.renderDragMask(), realTime && start === this.state.start && end === this.state.end || (this.setStateAttr(this.state.start, this.state.end, !0), this._dispatchEvent("change", {
37466
37426
  start: this.state.start,
37467
37427
  end: this.state.end,
37468
37428
  tag: this._activeTag
37469
- }), "browser" === vglobal.env && (vglobal.removeEventListener("pointermove", this._onHandlerPointerMove, {
37429
+ })), "browser" === vglobal.env && (vglobal.removeEventListener("pointermove", this._onHandlerPointerMove, {
37470
37430
  capture: !0
37471
37431
  }), vglobal.removeEventListener("pointerup", this._onHandlerPointerUp)), this.removeEventListener("pointermove", this._onHandlerPointerMove, {
37472
37432
  capture: !0
@@ -37514,14 +37474,14 @@
37514
37474
  }));
37515
37475
  }
37516
37476
  eventPosToStagePos(e) {
37517
- var _a, _b, _c, _d, _e, _f;
37477
+ var _a, _b;
37518
37478
  const {
37519
37479
  x: x,
37520
37480
  y: y
37521
- } = vglobal.mapToCanvasPoint(e, null === (_d = null === (_c = null === (_b = null === (_a = this.stage) || void 0 === _a ? void 0 : _a.window) || void 0 === _b ? void 0 : _b.getContext()) || void 0 === _c ? void 0 : _c.canvas) || void 0 === _d ? void 0 : _d.nativeCanvas);
37481
+ } = vglobal.mapToCanvasPoint(e, this.stage.window.getContext().canvas.nativeCanvas);
37522
37482
  return {
37523
- x: x - ((null === (_e = this.stage) || void 0 === _e ? void 0 : _e.x) || 0),
37524
- y: y - ((null === (_f = this.stage) || void 0 === _f ? void 0 : _f.y) || 0)
37483
+ x: x - ((null === (_a = this.stage) || void 0 === _a ? void 0 : _a.x) || 0),
37484
+ y: y - ((null === (_b = this.stage) || void 0 === _b ? void 0 : _b.y) || 0)
37525
37485
  };
37526
37486
  }
37527
37487
  _onHandlerPointerEnter(e) {
@@ -37674,7 +37634,7 @@
37674
37634
  } else this._isHorizontal ? this._startText.setAttribute("dy", startTextDy) : this._startText.setAttribute("dx", startTextDx);
37675
37635
  }
37676
37636
  getLayoutAttrFromConfig() {
37677
- var _a, _b, _c, _d, _e, _f;
37637
+ var _a, _b, _c, _d;
37678
37638
  if (this._layoutAttrFromConfig) return this._layoutAttrFromConfig;
37679
37639
  const {
37680
37640
  position: positionConfig,
@@ -37682,8 +37642,7 @@
37682
37642
  orient: orient,
37683
37643
  middleHandlerStyle = {},
37684
37644
  startHandlerStyle = {},
37685
- endHandlerStyle = {},
37686
- backgroundStyle = {}
37645
+ endHandlerStyle = {}
37687
37646
  } = this.attribute,
37688
37647
  {
37689
37648
  width: widthConfig,
@@ -37705,8 +37664,8 @@
37705
37664
  y: position.y
37706
37665
  }) : (height -= (startHandlerSize + endHandlerSize) / 2, position = {
37707
37666
  x: position.x,
37708
- y: position.y + startHandlerSize / 2
37709
- })), height += null !== (_e = backgroundStyle.lineWidth / 2) && void 0 !== _e ? _e : 1, width += null !== (_f = backgroundStyle.lineWidth / 2) && void 0 !== _f ? _f : 1, this._layoutAttrFromConfig = {
37667
+ y: position.y + startHandlerSize
37668
+ })), this._layoutAttrFromConfig = {
37710
37669
  position: position,
37711
37670
  width: width,
37712
37671
  height: height
@@ -37919,21 +37878,12 @@
37919
37878
  basePointEnd: basePointEnd
37920
37879
  };
37921
37880
  }
37922
- simplifyPoints(points) {
37923
- var _a;
37924
- if (points.length > 1e4) {
37925
- const tolerance = null !== (_a = this.attribute.tolerance) && void 0 !== _a ? _a : this._previewData.length / 1e4;
37926
- return flatten_simplify(points, tolerance, !1);
37927
- }
37928
- return points;
37929
- }
37930
37881
  getPreviewLinePoints() {
37931
- let previewPoints = this._previewData.map(d => ({
37882
+ const previewPoints = this._previewData.map(d => ({
37932
37883
  x: this._previewPointsX && this._previewPointsX(d),
37933
37884
  y: this._previewPointsY && this._previewPointsY(d)
37934
37885
  }));
37935
37886
  if (0 === previewPoints.length) return previewPoints;
37936
- previewPoints = this.simplifyPoints(previewPoints);
37937
37887
  const {
37938
37888
  basePointStart: basePointStart,
37939
37889
  basePointEnd: basePointEnd
@@ -37941,14 +37891,13 @@
37941
37891
  return basePointStart.concat(previewPoints).concat(basePointEnd);
37942
37892
  }
37943
37893
  getPreviewAreaPoints() {
37944
- let previewPoints = this._previewData.map(d => ({
37894
+ const previewPoints = this._previewData.map(d => ({
37945
37895
  x: this._previewPointsX && this._previewPointsX(d),
37946
37896
  y: this._previewPointsY && this._previewPointsY(d),
37947
37897
  x1: this._previewPointsX1 && this._previewPointsX1(d),
37948
37898
  y1: this._previewPointsY1 && this._previewPointsY1(d)
37949
37899
  }));
37950
37900
  if (0 === previewPoints.length) return previewPoints;
37951
- previewPoints = this.simplifyPoints(previewPoints);
37952
37901
  const {
37953
37902
  basePointStart: basePointStart,
37954
37903
  basePointEnd: basePointEnd
@@ -44297,9 +44246,12 @@
44297
44246
  excludedChannels = Object.keys(excludedChannelMap).filter(channel => 0 !== excludedChannelMap[channel]);
44298
44247
  this.subAnimate.animate.preventAttrs(excludedChannels);
44299
44248
  const from = Object.assign({}, this.from),
44300
- to = Object.assign({}, this.to);
44249
+ to = Object.assign({}, this.to),
44250
+ animatedChannels = [];
44301
44251
  Object.keys(to).forEach(k => {
44302
- excludedChannels.includes(k) ? (from[k] = to[k], this.from[k] = to[k]) : isNil$3(from[k]) && (from[k] = this.target.getComputedAttribute(k));
44252
+ excludedChannels.includes(k) ? (from[k] = to[k], this.from[k] = to[k]) : isNil$3(from[k]) ? from[k] = this.target.getComputedAttribute(k) : animatedChannels.push(k);
44253
+ }), this.target.animates.forEach(a => {
44254
+ a !== this.subAnimate.animate && a.preventAttrs(animatedChannels);
44303
44255
  }), this.target.setAttributes(from, !1, {
44304
44256
  type: AttributeUpdateType.ANIMATE_UPDATE,
44305
44257
  animationState: {
@@ -54985,6 +54937,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
54985
54937
  if (isFunctionStyle) {
54986
54938
  return true;
54987
54939
  }
54940
+ const hasPostProcess = isFunction$1(style.postProcess);
54941
+ if (hasPostProcess) {
54942
+ return true;
54943
+ }
54988
54944
  const isScale = !!(style === null || style === void 0 ? void 0 : style.scale);
54989
54945
  if (isScale) {
54990
54946
  if (style.field !== facetField) {
@@ -57937,6 +57893,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
57937
57893
  if (stateStyle.referer) {
57938
57894
  return stateStyle.referer._computeAttribute(key, state);
57939
57895
  }
57896
+ if (!stateStyle.style) {
57897
+ return (datum, opt) => stateStyle.style;
57898
+ }
57940
57899
  if (typeof stateStyle.style === 'function') {
57941
57900
  return (datum, opt) => stateStyle.style(datum, this._attributeContext, opt, this.getDataView());
57942
57901
  }
@@ -59956,7 +59915,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
59956
59915
  registerChartPlugin(MediaQuery);
59957
59916
  };
59958
59917
 
59959
- const version = "1.9.6-alpha.4";
59918
+ const version = "1.9.6-alpha.6";
59960
59919
 
59961
59920
  const addVChartProperty = (data, op) => {
59962
59921
  const context = op.beforeCall();
@@ -66361,19 +66320,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
66361
66320
  if (newDomain.length === 0) {
66362
66321
  return [];
66363
66322
  }
66364
- const domainMap = {};
66365
- newDomain.forEach(d => {
66366
- if (!domainMap[d]) {
66367
- domainMap[d] = 1;
66368
- }
66369
- });
66370
66323
  let filter = null;
66371
66324
  if (isContinuous()) {
66372
66325
  filter = (d) => d[datumField] >= newDomain[0] && d[datumField] <= newDomain[1];
66373
66326
  }
66374
66327
  else {
66375
66328
  filter = (d) => {
66376
- return domainMap[d[datumField] + ''] || domainMap[d[datumField]];
66329
+ return newDomain.indexOf(d[datumField] + '') >= 0 || newDomain.indexOf(d[datumField]) >= 0;
66377
66330
  };
66378
66331
  }
66379
66332
  return data.filter(filter);
@@ -66751,7 +66704,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
66751
66704
  }, this._getRegionOrSeriesLayout(regionOrSeries), false)) {
66752
66705
  return;
66753
66706
  }
66754
- this._clickEnable = false;
66755
66707
  if (callback) {
66756
66708
  callback({ zoomDelta, zoomX, zoomY }, event);
66757
66709
  }
@@ -66835,7 +66787,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
66835
66787
  }, this._getRegionOrSeriesLayout(regionOrSeries), false)) {
66836
66788
  return stopBubble;
66837
66789
  }
66838
- this._clickEnable = false;
66839
66790
  if (callback) {
66840
66791
  stopBubble = callback({ scrollX, scrollY }, event);
66841
66792
  }
@@ -66945,7 +66896,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
66945
66896
  if (this._option.disableTriggerEvent) {
66946
66897
  return;
66947
66898
  }
66948
- this._clickEnable = true;
66899
+ this._clickEnable = false;
66949
66900
  if (!this._zoomableTrigger.parserDragEvent(params.event)) {
66950
66901
  return;
66951
66902
  }
@@ -66960,7 +66911,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
66960
66911
  let upX = event.canvasX;
66961
66912
  let upY = event.canvasY;
66962
66913
  const mouseup = delayMap[delayType]((params) => {
66963
- this._clickEnable = false;
66914
+ this._clickEnable = true;
66964
66915
  const event = params.event;
66965
66916
  const dx = event.canvasX - upX;
66966
66917
  const dy = event.canvasY - upY;
@@ -75033,6 +74984,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
75033
74984
  _buildMarkAttributeContext() {
75034
74985
  super._buildMarkAttributeContext();
75035
74986
  this._markAttributeContext.valueToPosition = this.valueToPosition.bind(this);
74987
+ this._markAttributeContext.getPoints = this.getPoints.bind(this);
74988
+ this._markAttributeContext.isTransformLevel = this.isTransformLevel.bind(this);
75036
74989
  }
75037
74990
  valueToPosition(category) {
75038
74991
  var _a, _b, _c;
@@ -82408,7 +82361,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
82408
82361
  : null;
82409
82362
  }
82410
82363
  _delegateAxisContainerEvent(component) {
82411
- component.addEventListener('*', ((event, type) => this._delegateEvent(component, event, type)));
82364
+ if (component.listenerCount('*') === 0) {
82365
+ component.addEventListener('*', ((event, type) => this._delegateEvent(component, event, type)));
82366
+ }
82412
82367
  }
82413
82368
  _getAxisAttributes() {
82414
82369
  const spec = this._spec;
@@ -87659,27 +87614,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
87659
87614
  get orient() {
87660
87615
  return this._orient;
87661
87616
  }
87662
- get isHorizontal() {
87663
- return this._isHorizontal;
87664
- }
87665
- get stateScale() {
87666
- return this._stateScale;
87667
- }
87668
- get relatedAxisComponent() {
87669
- return this._relatedAxisComponent;
87670
- }
87671
- get state() {
87672
- return {
87673
- start: this._start,
87674
- end: this._end,
87675
- startValue: this._startValue,
87676
- endValue: this._endValue
87677
- };
87678
- }
87679
87617
  setStartAndEnd(start, end, rangeMode = ['percent', 'percent']) {
87680
87618
  const [startMode = 'percent', endMode = 'percent'] = rangeMode;
87681
- const startPercent = (startMode === 'percent' ? start : this.dataToStatePoint(start));
87682
- const endPercent = (endMode === 'percent' ? end : this.dataToStatePoint(end));
87619
+ const startPercent = (startMode === 'percent' ? start : this._dataToStatePoint(start));
87620
+ const endPercent = (endMode === 'percent' ? end : this._dataToStatePoint(end));
87683
87621
  this._handleChange(startPercent, endPercent, true);
87684
87622
  }
87685
87623
  enableInteraction() {
@@ -87705,7 +87643,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
87705
87643
  _handleChange(start, end, updateComponent) {
87706
87644
  var _a, _b;
87707
87645
  const zoomLock = (_b = (_a = this._spec) === null || _a === void 0 ? void 0 : _a.zoomLock) !== null && _b !== void 0 ? _b : false;
87708
- if (zoomLock) {
87646
+ if (zoomLock || end - start < this._minSpan || end - start > this._maxSpan) {
87709
87647
  this._shouldChange = false;
87710
87648
  }
87711
87649
  }
@@ -87979,9 +87917,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
87979
87917
  this._handleChange(this._start, this._end, true);
87980
87918
  }
87981
87919
  _computeDomainOfStateScale(isContinuous) {
87982
- if (this._spec.customDomain) {
87983
- return this._spec.customDomain;
87984
- }
87985
87920
  const domain = this._data.getLatestData().map((d) => d[this._stateField]);
87986
87921
  if (isContinuous) {
87987
87922
  const domainNum = domain.map((n) => n * 1);
@@ -88104,23 +88039,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
88104
88039
  }
88105
88040
  _statePointToData(state) {
88106
88041
  const scale = this._stateScale;
88107
- const domain = scale.domain();
88108
- if (isContinuous(scale.type)) {
88109
- if (this._isReverse()) {
88110
- return domain[0] + (domain[1] - domain[0]) * (1 - state);
88111
- }
88112
- return domain[0] + (domain[1] - domain[0]) * state;
88113
- }
88114
88042
  let range = scale.range();
88115
88043
  if (this._isReverse()) {
88116
88044
  range = range.slice().reverse();
88117
88045
  }
88118
88046
  const posInRange = range[0] + (range[1] - range[0]) * state;
88119
- const bandSize = scale.bandwidth();
88120
- const domainIndex = Math.min(Math.max(0, Math.floor(posInRange / bandSize)), domain.length - 1);
88121
- return domain[domainIndex];
88047
+ return scale.invert(posInRange);
88122
88048
  }
88123
- dataToStatePoint(data) {
88049
+ _dataToStatePoint(data) {
88124
88050
  const scale = this._stateScale;
88125
88051
  const pos = scale.scale(data);
88126
88052
  let range = scale.range();
@@ -88143,17 +88069,17 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
88143
88069
  if (this._spec.rangeMode) {
88144
88070
  const [startMode, endMode] = this._spec.rangeMode;
88145
88071
  if (this._modeCheck('start', startMode) && this._modeCheck('end', endMode)) {
88146
- start = startMode === 'percent' ? this._spec.start : this.dataToStatePoint(this._spec.startValue);
88147
- end = endMode === 'percent' ? this._spec.end : this.dataToStatePoint(this._spec.endValue);
88072
+ start = startMode === 'percent' ? this._spec.start : this._dataToStatePoint(this._spec.startValue);
88073
+ end = endMode === 'percent' ? this._spec.end : this._dataToStatePoint(this._spec.endValue);
88148
88074
  }
88149
88075
  }
88150
88076
  else {
88151
88077
  start = this._spec.start
88152
88078
  ? this._spec.start
88153
88079
  : this._spec.startValue
88154
- ? this.dataToStatePoint(this._spec.startValue)
88080
+ ? this._dataToStatePoint(this._spec.startValue)
88155
88081
  : 0;
88156
- end = this._spec.end ? this._spec.end : this._spec.endValue ? this.dataToStatePoint(this._spec.endValue) : 1;
88082
+ end = this._spec.end ? this._spec.end : this._spec.endValue ? this._dataToStatePoint(this._spec.endValue) : 1;
88157
88083
  }
88158
88084
  this._startValue = this._statePointToData(start);
88159
88085
  this._endValue = this._statePointToData(end);
@@ -88194,11 +88120,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
88194
88120
  .range(defaultRange);
88195
88121
  }
88196
88122
  else {
88197
- this._stateScale.domain(domain, true).range(defaultRange).padding(0);
88123
+ this._stateScale.domain(domain, true).range(defaultRange);
88198
88124
  }
88199
88125
  }
88200
88126
  else {
88201
- this._stateScale = new BandScale().padding(0);
88127
+ this._stateScale = new BandScale();
88202
88128
  this._stateScale.domain(this._computeDomainOfStateScale(), true).range(defaultRange);
88203
88129
  }
88204
88130
  }
@@ -88457,7 +88383,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
88457
88383
  this.layoutZIndex = exports.LayoutZIndex.DataZoom;
88458
88384
  this.layoutLevel = exports.LayoutLevel.DataZoom;
88459
88385
  this.layoutType = 'region-relative';
88460
- this._isReverseCache = false;
88461
88386
  this._dataToPositionX = (datum) => {
88462
88387
  const offsetLeft = this._orient === 'left' ? this._middleHandlerSize : 0;
88463
88388
  const offsetHandler = this._isHorizontal ? this._startHandlerSize / 2 : 0;
@@ -88525,10 +88450,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
88525
88450
  }
88526
88451
  onLayoutEnd(ctx) {
88527
88452
  this._updateScaleRange();
88528
- if (this._isReverse() && !this._isReverseCache) {
88529
- this._isReverseCache = this._isReverse();
88530
- this.effect.onZoomChange();
88531
- }
88532
88453
  if (this._cacheVisibility !== false) {
88533
88454
  super.onLayoutEnd(ctx);
88534
88455
  }
@@ -88551,28 +88472,19 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
88551
88472
  const defaultSize = this._isHorizontal
88552
88473
  ? this.getLayoutRect().width - handlerSize
88553
88474
  : this.getLayoutRect().height - handlerSize;
88554
- const defaultRange = (_b = (_a = this._relatedAxisComponent) === null || _a === void 0 ? void 0 : _a.getScale().range()) !== null && _b !== void 0 ? _b : [
88555
- this._startHandlerSize / 2,
88556
- defaultSize - this._endHandlerSize / 2
88557
- ];
88475
+ const defaultRange = (_b = (_a = this._relatedAxisComponent) === null || _a === void 0 ? void 0 : _a.getScale().range()) !== null && _b !== void 0 ? _b : [0, defaultSize];
88558
88476
  if (this._isHorizontal) {
88559
- stateScaleRange = this._visible
88560
- ? [this._startHandlerSize / 2, this._computeWidth() - this._endHandlerSize / 2]
88561
- : defaultRange;
88477
+ stateScaleRange = this._visible ? [0, this._computeWidth() - handlerSize] : defaultRange;
88562
88478
  this._stateScale.range(stateScaleRange);
88563
88479
  this._valueScale.range([this._computeHeight() - this._middleHandlerSize, 0]);
88564
88480
  }
88565
88481
  else if (this.layoutOrient === 'left') {
88566
- stateScaleRange = this._visible
88567
- ? [this._startHandlerSize / 2, this._computeHeight() - this._endHandlerSize / 2]
88568
- : defaultRange;
88482
+ stateScaleRange = this._visible ? [0, this._computeHeight() - handlerSize] : defaultRange;
88569
88483
  this._stateScale.range(stateScaleRange);
88570
88484
  this._valueScale.range([this._computeWidth() - this._middleHandlerSize, 0]);
88571
88485
  }
88572
88486
  else {
88573
- stateScaleRange = this._visible
88574
- ? [this._startHandlerSize / 2, this._computeHeight() - this._endHandlerSize / 2]
88575
- : defaultRange;
88487
+ stateScaleRange = this._visible ? [0, this._computeHeight() - handlerSize] : defaultRange;
88576
88488
  this._stateScale.range(stateScaleRange);
88577
88489
  this._valueScale.range([0, this._computeWidth() - this._middleHandlerSize]);
88578
88490
  }
@@ -88650,7 +88562,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
88650
88562
  }, orient: this._orient, size: {
88651
88563
  width: this.getLayoutRect().width,
88652
88564
  height: this.getLayoutRect().height
88653
- }, showDetail: spec.showDetail, brushSelect: (_b = spec.brushSelect) !== null && _b !== void 0 ? _b : false, zoomLock: (_c = spec.zoomLock) !== null && _c !== void 0 ? _c : false, minSpan: this._minSpan, maxSpan: this._maxSpan, delayType: spec.delayType, delayTime: isValid$3(spec.delayType) ? (_d = spec.delayTime) !== null && _d !== void 0 ? _d : 30 : 0, realTime: (_e = spec.realTime) !== null && _e !== void 0 ? _e : true, previewData: isNeedPreview && this._data.getLatestData(), previewPointsX: isNeedPreview && this._dataToPositionX, previewPointsY: isNeedPreview && this._dataToPositionY, tolerance: this._spec.tolerance }, this._getComponentAttrs());
88565
+ }, showDetail: spec.showDetail, brushSelect: (_b = spec.brushSelect) !== null && _b !== void 0 ? _b : false, zoomLock: (_c = spec.zoomLock) !== null && _c !== void 0 ? _c : false, minSpan: this._minSpan, maxSpan: this._maxSpan, delayType: spec.delayType, delayTime: isValid$3(spec.delayType) ? (_d = spec.delayTime) !== null && _d !== void 0 ? _d : 30 : 0, realTime: (_e = spec.realTime) !== null && _e !== void 0 ? _e : true, previewData: isNeedPreview && this._data.getLatestData(), previewPointsX: isNeedPreview && this._dataToPositionX, previewPointsY: isNeedPreview && this._dataToPositionY }, this._getComponentAttrs());
88654
88566
  }
88655
88567
  _createOrUpdateComponent() {
88656
88568
  if (this._visible) {
@@ -88688,11 +88600,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
88688
88600
  }
88689
88601
  this._start = start;
88690
88602
  this._end = end;
88691
- const startValue = this._statePointToData(start);
88692
- const endValue = this._statePointToData(end);
88693
- const hasChange = isFunction$1(this._spec.updateDataAfterChange)
88694
- ? this._spec.updateDataAfterChange(start, end, startValue, endValue)
88695
- : this._handleStateChange(startValue, endValue, tag);
88603
+ const hasChange = this._handleStateChange(this._statePointToData(start), this._statePointToData(end), tag);
88696
88604
  if (hasChange) {
88697
88605
  this.event.emit(exports.ChartEvent.dataZoomChange, {
88698
88606
  model: this,
@@ -88881,11 +88789,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
88881
88789
  }
88882
88790
  this._start = start;
88883
88791
  this._end = end;
88884
- const startValue = this._statePointToData(start);
88885
- const endValue = this._statePointToData(end);
88886
- const hasChange = isFunction$1(this._spec.updateDataAfterChange)
88887
- ? this._spec.updateDataAfterChange(start, end, startValue, endValue)
88888
- : this._handleStateChange(this._statePointToData(start), this._statePointToData(end));
88792
+ const hasChange = this._handleStateChange(this._statePointToData(start), this._statePointToData(end));
88889
88793
  if (hasChange) {
88890
88794
  this.event.emit(exports.ChartEvent.scrollBarChange, {
88891
88795
  model: this,
@@ -90966,6 +90870,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90966
90870
  _getNeedClearVRenderComponents() {
90967
90871
  return [];
90968
90872
  }
90873
+ _delegateLabelEvent(component) {
90874
+ if (component.listenerCount('*') === 0) {
90875
+ component.addEventListener('*', ((event, type) => this._delegateEvent(component, event, type)));
90876
+ }
90877
+ }
90969
90878
  }
90970
90879
  BaseLabelComponent.type = ComponentTypeEnum.label;
90971
90880
 
@@ -91075,23 +90984,19 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91075
90984
  });
91076
90985
  this.event.off(exports.VGRAMMAR_HOOK_EVENT.AFTER_MARK_RENDER_END, enableAnimation);
91077
90986
  };
91078
- this.event.on('afterElementEncode', eventParams => {
91079
- var _a;
91080
- const mark = eventParams.item;
91081
- if (this._option.getChart().getLayoutTag() === false && ((_a = mark.getContext()) === null || _a === void 0 ? void 0 : _a.model) === this) {
91082
- this._delegateLabelEvent(mark.getGroupGraphicItem());
90987
+ }
90988
+ afterCompile() {
90989
+ this._labelComponentMap.forEach((info, component) => {
90990
+ const product = component.getProduct();
90991
+ if (product) {
90992
+ product.addEventListener(exports.VGRAMMAR_HOOK_EVENT.AFTER_ELEMENT_ENCODE, () => {
90993
+ if (this._isLayout === false) {
90994
+ this._delegateLabelEvent(product.getGroupGraphicItem());
90995
+ }
90996
+ });
91083
90997
  }
91084
90998
  });
91085
90999
  }
91086
- _delegateLabelEvent(component) {
91087
- const textNodes = component === null || component === void 0 ? void 0 : component.findAll(node => node.type === 'text', true).filter(text => !text.__vchart_event);
91088
- if (textNodes && textNodes.length > 0) {
91089
- textNodes.forEach(text => {
91090
- text.__vchart_event = true;
91091
- text.addEventListener('*', ((event, type) => this._delegateEvent(component, event, type, text, text.attribute.data)));
91092
- });
91093
- }
91094
- }
91095
91000
  _initTextMark() {
91096
91001
  if (!this._labelInfoMap) {
91097
91002
  this._labelInfoMap = new Map();
@@ -91344,6 +91249,18 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91344
91249
  this._marks.addMark(component);
91345
91250
  }
91346
91251
  }
91252
+ afterCompile() {
91253
+ this._marks.forEach((componentMark, index) => {
91254
+ const product = componentMark.getProduct();
91255
+ if (product) {
91256
+ product.addEventListener(exports.VGRAMMAR_HOOK_EVENT.AFTER_ELEMENT_ENCODE, () => {
91257
+ if (this._isLayout === false) {
91258
+ this._delegateLabelEvent(product.getGroupGraphicItem());
91259
+ }
91260
+ });
91261
+ }
91262
+ });
91263
+ }
91347
91264
  updateLayoutAttribute() {
91348
91265
  super.updateLayoutAttribute();
91349
91266
  const series = this._getSeries();
@@ -91602,7 +91519,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91602
91519
  this._needInitOutState = true;
91603
91520
  this._cacheInteractiveRangeAttrs = [];
91604
91521
  this._needDisablePickable = false;
91605
- this._relatedDataZooms = [];
91606
91522
  }
91607
91523
  init() {
91608
91524
  const inBrushMarkAttr = this._transformBrushedMarkAttr(this._spec.inBrush);
@@ -91635,14 +91551,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91635
91551
  this.initEvent();
91636
91552
  this._bindRegions();
91637
91553
  this._bindLinkedSeries();
91638
- this._bindDataZoom();
91639
91554
  this._initNeedOperatedItem();
91640
91555
  }
91641
91556
  _extendDataInBrush(elementsMap) {
91642
91557
  const data = [];
91643
91558
  for (const brushName in elementsMap) {
91644
91559
  for (const elementKey in elementsMap[brushName]) {
91645
- data.push(Object.assign(Object.assign({}, elementsMap[brushName][elementKey].data[0]), { getSeries: elementsMap[brushName][elementKey].getSeries }));
91560
+ data.push(elementsMap[brushName][elementKey].data[0]);
91646
91561
  }
91647
91562
  }
91648
91563
  return data;
@@ -91702,11 +91617,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91702
91617
  this._needInitOutState = false;
91703
91618
  this._needDisablePickable = true;
91704
91619
  this._handleBrushChange(exports.ChartEvent.brushChange, region, e);
91705
- this._emitEvent(exports.ChartEvent.brushChange, region);
91706
91620
  });
91707
91621
  brush.addEventListener(IOperateType.moving, (e) => {
91708
91622
  this._handleBrushChange(exports.ChartEvent.brushChange, region, e);
91709
- this._emitEvent(exports.ChartEvent.brushChange, region);
91710
91623
  });
91711
91624
  brush.addEventListener(IOperateType.brushClear, (e) => {
91712
91625
  this._initMarkBrushState(componentIndex, '');
@@ -91714,31 +91627,23 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91714
91627
  this._needDisablePickable = false;
91715
91628
  this._handleBrushChange(exports.ChartEvent.brushChange, region, e);
91716
91629
  this._handleBrushChange(exports.ChartEvent.brushClear, region, e);
91717
- this._emitEvent(exports.ChartEvent.brushChange, region);
91718
- this._emitEvent(exports.ChartEvent.brushClear, region);
91719
91630
  });
91720
91631
  brush.addEventListener(IOperateType.drawEnd, (e) => {
91721
91632
  this._needInitOutState = true;
91722
91633
  this._needDisablePickable = false;
91723
- const { operateMask } = e.detail;
91724
91634
  this._handleBrushChange(exports.ChartEvent.brushEnd, region, e);
91725
- this._setDataZoomState(operateMask, region);
91726
- this._emitEvent(exports.ChartEvent.brushEnd, region);
91727
91635
  });
91728
91636
  brush.addEventListener(IOperateType.moveEnd, (e) => {
91729
- const { operateMask } = e.detail;
91730
91637
  this._handleBrushChange(exports.ChartEvent.brushEnd, region, e);
91731
- this._setDataZoomState(operateMask, region);
91732
- this._emitEvent(exports.ChartEvent.brushEnd, region);
91733
91638
  });
91734
91639
  }
91735
91640
  _handleBrushChange(eventType, region, e) {
91736
91641
  const { operateMask } = e.detail;
91737
91642
  this._reconfigItem(operateMask, region);
91738
91643
  this._reconfigLinkedItem(operateMask, region);
91644
+ this._emitEvent(eventType, region);
91739
91645
  }
91740
91646
  _emitEvent(eventType, region) {
91741
- var _a;
91742
91647
  this.event.emit(eventType, {
91743
91648
  model: this,
91744
91649
  value: {
@@ -91751,8 +91656,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91751
91656
  inBrushElementsMap: this._inBrushElementsMap,
91752
91657
  outOfBrushElementsMap: this._outOfBrushElementsMap,
91753
91658
  linkedInBrushElementsMap: this._linkedInBrushElementsMap,
91754
- linkedOutOfBrushElementsMap: this._linkedOutOfBrushElementsMap,
91755
- releatedDataZoom: (_a = this._relatedDataZooms) !== null && _a !== void 0 ? _a : []
91659
+ linkedOutOfBrushElementsMap: this._linkedOutOfBrushElementsMap
91756
91660
  }
91757
91661
  });
91758
91662
  }
@@ -91781,7 +91685,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91781
91685
  const elements = grammarMark.elements;
91782
91686
  elements.forEach((el) => {
91783
91687
  var _a, _b, _c;
91784
- el.getSeries = mark.getSeries;
91785
91688
  const graphicItem = el.getGraphicItem();
91786
91689
  const elementKey = mark.id + '_' + el.key;
91787
91690
  if (((_a = this._outOfBrushElementsMap) === null || _a === void 0 ? void 0 : _a[elementKey]) && this._isBrushContainItem(operateMask, graphicItem)) {
@@ -91912,63 +91815,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91912
91815
  }
91913
91816
  return brushMask.globalAABBBounds.intersects(item.globalAABBBounds);
91914
91817
  }
91915
- _findValueInDataZoom(dataZoom, dataValue, type) {
91916
- const stateScale = dataZoom.stateScale;
91917
- if (isContinuous(stateScale.type)) {
91918
- return Math[type](...dataValue);
91919
- }
91920
- const domain = stateScale.domain();
91921
- const dataIndex = dataValue.map(d => d.indexOf(domain));
91922
- return domain[Math[type](...dataIndex)];
91923
- }
91924
- _setDataZoomComponent(dataZooms, region, operateMaskBounds, inBrushDataValue, isHorizontal) {
91925
- var _a;
91926
- const range = (_a = this._spec.dataZoomRangeExpand) !== null && _a !== void 0 ? _a : 0;
91927
- const { x1, x2, y1, y2 } = operateMaskBounds;
91928
- const regionStartAttr = isHorizontal ? 'x' : 'y';
91929
- const boundsStart = isHorizontal ? x1 : y1;
91930
- const boundsEnd = isHorizontal ? x2 : y2;
91931
- dataZooms.forEach((dz) => {
91932
- const startValue = dz.relatedAxisComponent && inBrushDataValue.length > 0
91933
- ? dz.relatedAxisComponent
91934
- .getScale()
91935
- .invert(boundsStart - region.getLayoutStartPoint()[regionStartAttr])
91936
- : this._findValueInDataZoom(dz, inBrushDataValue, 'min');
91937
- const endValue = dz.relatedAxisComponent && inBrushDataValue.length > 0
91938
- ? dz.relatedAxisComponent
91939
- .getScale()
91940
- .invert(boundsEnd - region.getLayoutStartPoint()[regionStartAttr])
91941
- : this._findValueInDataZoom(dz, inBrushDataValue, 'max');
91942
- const startPercent = dz.dataToStatePoint(startValue);
91943
- const endPercent = dz.dataToStatePoint(endValue);
91944
- dz.setStartAndEnd(Math.min(Math.max(0, startPercent - range), 1), Math.min(Math.max(0, endPercent + range), 1), [
91945
- 'percent',
91946
- 'percent'
91947
- ]);
91948
- });
91949
- }
91950
- _setDataZoomState(operateMask, region) {
91951
- const hDataZooms = [];
91952
- const vDataZooms = [];
91953
- this._relatedDataZooms.forEach(dz => {
91954
- if (dz.isHorizontal) {
91955
- hDataZooms.push(dz);
91956
- }
91957
- else {
91958
- vDataZooms.push(dz);
91959
- }
91960
- });
91961
- const operateMaskBounds = operateMask.AABBBounds;
91962
- const inBrushDataXValue = [];
91963
- const inBrushDataYValue = [];
91964
- this._extendDataInBrush(this._inBrushElementsMap).forEach(item => {
91965
- const spec = item.getSeries().getSpec();
91966
- inBrushDataXValue.push(item[array(spec.xField)[0]]);
91967
- inBrushDataYValue.push(item[array(spec.yField)[0]]);
91968
- });
91969
- this._setDataZoomComponent(hDataZooms, region, operateMaskBounds, inBrushDataXValue, true);
91970
- this._setDataZoomComponent(vDataZooms, region, operateMaskBounds, inBrushDataYValue, false);
91971
- }
91972
91818
  _bindRegions() {
91973
91819
  if (isValid$3(this._spec.regionId) && isValid$3(this._spec.regionIndex)) {
91974
91820
  this._relativeRegions = this._option.getAllRegions();
@@ -91981,18 +91827,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91981
91827
  }
91982
91828
  this._linkedSeries = this._option.getSeriesInUserIdOrIndex(array(this._spec.brushLinkSeriesId), array(this._spec.brushLinkSeriesIndex));
91983
91829
  }
91984
- _bindDataZoom() {
91985
- if (this._spec.dataZoomId) {
91986
- array(this._spec.dataZoomId).forEach((dataZoomId) => {
91987
- this._relatedDataZooms.push(this._option.getComponentByUserId(dataZoomId));
91988
- });
91989
- }
91990
- if (this._spec.dataZoomIndex) {
91991
- array(this._spec.dataZoomIndex).forEach((dataZoomIndex) => {
91992
- this._relatedDataZooms.push(this._option.getComponentByIndex('dataZoom', dataZoomIndex));
91993
- });
91994
- }
91995
- }
91996
91830
  _initNeedOperatedItem() {
91997
91831
  const seriesUserId = this._spec.seriesId;
91998
91832
  const seriesIndex = this._spec.seriesIndex;
@@ -92002,10 +91836,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
92002
91836
  if ((seriesUserId && array(seriesUserId).includes(s.userId.toString())) ||
92003
91837
  (seriesIndex && array(seriesIndex).includes(s.getSpecIndex())) ||
92004
91838
  (!seriesIndex && !seriesUserId)) {
92005
- allMarks.push(...s.getMarksWithoutRoot().map(mark => {
92006
- mark.getSeries = () => s;
92007
- return mark;
92008
- }));
91839
+ allMarks.push(...s.getMarksWithoutRoot());
92009
91840
  }
92010
91841
  this._itemMap[r.id] = allMarks;
92011
91842
  });