@visactor/vchart 1.9.6-alpha.2 → 1.9.6-alpha.5

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 (57) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.js +41 -230
  3. package/build/index.min.js +1 -1
  4. package/build/tsconfig.tsbuildinfo +1 -1
  5. package/cjs/component/brush/brush.d.ts +0 -5
  6. package/cjs/component/brush/brush.js +14 -60
  7. package/cjs/component/brush/brush.js.map +1 -1
  8. package/cjs/component/brush/interface.d.ts +0 -3
  9. package/cjs/component/brush/interface.js.map +1 -1
  10. package/cjs/component/data-zoom/data-filter-base-component.d.ts +2 -11
  11. package/cjs/component/data-zoom/data-filter-base-component.js +12 -31
  12. package/cjs/component/data-zoom/data-filter-base-component.js.map +1 -1
  13. package/cjs/component/data-zoom/data-zoom/data-zoom.d.ts +0 -1
  14. package/cjs/component/data-zoom/data-zoom/data-zoom.js +8 -11
  15. package/cjs/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
  16. package/cjs/component/data-zoom/data-zoom/interface.d.ts +0 -1
  17. package/cjs/component/data-zoom/data-zoom/interface.js.map +1 -1
  18. package/cjs/component/data-zoom/interface.d.ts +0 -2
  19. package/cjs/component/data-zoom/interface.js.map +1 -1
  20. package/cjs/component/data-zoom/scroll-bar/scroll-bar.js +1 -2
  21. package/cjs/component/data-zoom/scroll-bar/scroll-bar.js.map +1 -1
  22. package/cjs/component/data-zoom/util.js +1 -5
  23. package/cjs/component/data-zoom/util.js.map +1 -1
  24. package/cjs/component/tooltip/tooltip.js +5 -8
  25. package/cjs/component/tooltip/tooltip.js.map +1 -1
  26. package/cjs/core/index.d.ts +1 -1
  27. package/cjs/core/index.js +1 -1
  28. package/cjs/core/index.js.map +1 -1
  29. package/cjs/interaction/zoom/zoomable.js +4 -6
  30. package/cjs/interaction/zoom/zoomable.js.map +1 -1
  31. package/esm/component/brush/brush.d.ts +0 -5
  32. package/esm/component/brush/brush.js +13 -60
  33. package/esm/component/brush/brush.js.map +1 -1
  34. package/esm/component/brush/interface.d.ts +0 -3
  35. package/esm/component/brush/interface.js.map +1 -1
  36. package/esm/component/data-zoom/data-filter-base-component.d.ts +2 -11
  37. package/esm/component/data-zoom/data-filter-base-component.js +12 -31
  38. package/esm/component/data-zoom/data-filter-base-component.js.map +1 -1
  39. package/esm/component/data-zoom/data-zoom/data-zoom.d.ts +0 -1
  40. package/esm/component/data-zoom/data-zoom/data-zoom.js +9 -12
  41. package/esm/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
  42. package/esm/component/data-zoom/data-zoom/interface.d.ts +0 -1
  43. package/esm/component/data-zoom/data-zoom/interface.js.map +1 -1
  44. package/esm/component/data-zoom/interface.d.ts +0 -2
  45. package/esm/component/data-zoom/interface.js.map +1 -1
  46. package/esm/component/data-zoom/scroll-bar/scroll-bar.js +2 -3
  47. package/esm/component/data-zoom/scroll-bar/scroll-bar.js.map +1 -1
  48. package/esm/component/data-zoom/util.js +1 -5
  49. package/esm/component/data-zoom/util.js.map +1 -1
  50. package/esm/component/tooltip/tooltip.js +5 -8
  51. package/esm/component/tooltip/tooltip.js.map +1 -1
  52. package/esm/core/index.d.ts +1 -1
  53. package/esm/core/index.js +1 -1
  54. package/esm/core/index.js.map +1 -1
  55. package/esm/interaction/zoom/zoomable.js +4 -6
  56. package/esm/interaction/zoom/zoomable.js.map +1 -1
  57. package/package.json +14 -14
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));
@@ -37445,11 +37413,11 @@
37445
37413
  start: start,
37446
37414
  end: end
37447
37415
  } = 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", {
37416
+ 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
37417
  start: start,
37450
37418
  end: end,
37451
37419
  tag: this._activeTag
37452
- });
37420
+ }));
37453
37421
  }, this._onHandlerPointerMove = 0 === this.attribute.delayTime ? this._pointerMove : delayMap$2[this.attribute.delayType](this._pointerMove, this.attribute.delayTime), this._onHandlerPointerUp = e => {
37454
37422
  e.preventDefault();
37455
37423
  const {
@@ -37462,11 +37430,11 @@
37462
37430
  const pos = this.eventPosToStagePos(e);
37463
37431
  this.backgroundDragZoom(this._activeCache.startPos, pos);
37464
37432
  }
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", {
37433
+ 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
37434
  start: this.state.start,
37467
37435
  end: this.state.end,
37468
37436
  tag: this._activeTag
37469
- }), "browser" === vglobal.env && (vglobal.removeEventListener("pointermove", this._onHandlerPointerMove, {
37437
+ })), "browser" === vglobal.env && (vglobal.removeEventListener("pointermove", this._onHandlerPointerMove, {
37470
37438
  capture: !0
37471
37439
  }), vglobal.removeEventListener("pointerup", this._onHandlerPointerUp)), this.removeEventListener("pointermove", this._onHandlerPointerMove, {
37472
37440
  capture: !0
@@ -37674,7 +37642,7 @@
37674
37642
  } else this._isHorizontal ? this._startText.setAttribute("dy", startTextDy) : this._startText.setAttribute("dx", startTextDx);
37675
37643
  }
37676
37644
  getLayoutAttrFromConfig() {
37677
- var _a, _b, _c, _d, _e, _f;
37645
+ var _a, _b, _c, _d;
37678
37646
  if (this._layoutAttrFromConfig) return this._layoutAttrFromConfig;
37679
37647
  const {
37680
37648
  position: positionConfig,
@@ -37682,8 +37650,7 @@
37682
37650
  orient: orient,
37683
37651
  middleHandlerStyle = {},
37684
37652
  startHandlerStyle = {},
37685
- endHandlerStyle = {},
37686
- backgroundStyle = {}
37653
+ endHandlerStyle = {}
37687
37654
  } = this.attribute,
37688
37655
  {
37689
37656
  width: widthConfig,
@@ -37705,8 +37672,8 @@
37705
37672
  y: position.y
37706
37673
  }) : (height -= (startHandlerSize + endHandlerSize) / 2, position = {
37707
37674
  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 = {
37675
+ y: position.y + startHandlerSize
37676
+ })), this._layoutAttrFromConfig = {
37710
37677
  position: position,
37711
37678
  width: width,
37712
37679
  height: height
@@ -37920,14 +37887,11 @@
37920
37887
  };
37921
37888
  }
37922
37889
  getPreviewLinePoints() {
37923
- var _a;
37924
- let previewPoints = this._previewData.map(d => ({
37890
+ const previewPoints = this._previewData.map(d => ({
37925
37891
  x: this._previewPointsX && this._previewPointsX(d),
37926
37892
  y: this._previewPointsY && this._previewPointsY(d)
37927
37893
  }));
37928
37894
  if (0 === previewPoints.length) return previewPoints;
37929
- const tolerance = null !== (_a = this.attribute.tolerance) && void 0 !== _a ? _a : this._previewData.length > 1e4 ? this._previewData.length / 1e4 : this._previewData.length;
37930
- previewPoints = flatten_simplify(previewPoints, tolerance, !1);
37931
37895
  const {
37932
37896
  basePointStart: basePointStart,
37933
37897
  basePointEnd: basePointEnd
@@ -37935,16 +37899,13 @@
37935
37899
  return basePointStart.concat(previewPoints).concat(basePointEnd);
37936
37900
  }
37937
37901
  getPreviewAreaPoints() {
37938
- var _a;
37939
- let previewPoints = this._previewData.map(d => ({
37902
+ const previewPoints = this._previewData.map(d => ({
37940
37903
  x: this._previewPointsX && this._previewPointsX(d),
37941
37904
  y: this._previewPointsY && this._previewPointsY(d),
37942
37905
  x1: this._previewPointsX1 && this._previewPointsX1(d),
37943
37906
  y1: this._previewPointsY1 && this._previewPointsY1(d)
37944
37907
  }));
37945
37908
  if (0 === previewPoints.length) return previewPoints;
37946
- const tolerance = null !== (_a = this.attribute.tolerance) && void 0 !== _a ? _a : this._previewData.length > 1e4 ? this._previewData.length / 1e4 : this._previewData.length;
37947
- previewPoints = flatten_simplify(previewPoints, tolerance, !1);
37948
37909
  const {
37949
37910
  basePointStart: basePointStart,
37950
37911
  basePointEnd: basePointEnd
@@ -59952,7 +59913,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
59952
59913
  registerChartPlugin(MediaQuery);
59953
59914
  };
59954
59915
 
59955
- const version = "1.9.6-alpha.2";
59916
+ const version = "1.9.6-alpha.5";
59956
59917
 
59957
59918
  const addVChartProperty = (data, op) => {
59958
59919
  const context = op.beforeCall();
@@ -66357,19 +66318,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
66357
66318
  if (newDomain.length === 0) {
66358
66319
  return [];
66359
66320
  }
66360
- const domainMap = {};
66361
- newDomain.forEach(d => {
66362
- if (!domainMap[d]) {
66363
- domainMap[d] = 1;
66364
- }
66365
- });
66366
66321
  let filter = null;
66367
66322
  if (isContinuous()) {
66368
66323
  filter = (d) => d[datumField] >= newDomain[0] && d[datumField] <= newDomain[1];
66369
66324
  }
66370
66325
  else {
66371
66326
  filter = (d) => {
66372
- return domainMap[d[datumField] + ''] || domainMap[d[datumField]];
66327
+ return newDomain.indexOf(d[datumField] + '') >= 0 || newDomain.indexOf(d[datumField]) >= 0;
66373
66328
  };
66374
66329
  }
66375
66330
  return data.filter(filter);
@@ -66747,7 +66702,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
66747
66702
  }, this._getRegionOrSeriesLayout(regionOrSeries), false)) {
66748
66703
  return;
66749
66704
  }
66750
- this._clickEnable = false;
66751
66705
  if (callback) {
66752
66706
  callback({ zoomDelta, zoomX, zoomY }, event);
66753
66707
  }
@@ -66831,7 +66785,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
66831
66785
  }, this._getRegionOrSeriesLayout(regionOrSeries), false)) {
66832
66786
  return stopBubble;
66833
66787
  }
66834
- this._clickEnable = false;
66835
66788
  if (callback) {
66836
66789
  stopBubble = callback({ scrollX, scrollY }, event);
66837
66790
  }
@@ -66941,7 +66894,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
66941
66894
  if (this._option.disableTriggerEvent) {
66942
66895
  return;
66943
66896
  }
66944
- this._clickEnable = true;
66897
+ this._clickEnable = false;
66945
66898
  if (!this._zoomableTrigger.parserDragEvent(params.event)) {
66946
66899
  return;
66947
66900
  }
@@ -66956,7 +66909,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
66956
66909
  let upX = event.canvasX;
66957
66910
  let upY = event.canvasY;
66958
66911
  const mouseup = delayMap[delayType]((params) => {
66959
- this._clickEnable = false;
66912
+ this._clickEnable = true;
66960
66913
  const event = params.event;
66961
66914
  const dx = event.canvasX - upX;
66962
66915
  const dy = event.canvasY - upY;
@@ -85945,14 +85898,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
85945
85898
  });
85946
85899
  };
85947
85900
  this._getMouseOutHandler = (needPointerDetection) => (params) => {
85948
- var _a, _b, _c;
85901
+ var _a, _b;
85949
85902
  if (this._alwaysShow) {
85950
85903
  return;
85951
85904
  }
85952
85905
  if (!this._isTooltipShown && !((_b = (_a = this.tooltipHandler) === null || _a === void 0 ? void 0 : _a.isTooltipShown) === null || _b === void 0 ? void 0 : _b.call(_a))) {
85953
85906
  return;
85954
85907
  }
85955
- const browserEnv = isTrueBrowser((_c = this._option) === null || _c === void 0 ? void 0 : _c.mode);
85908
+ const browserEnv = isTrueBrowser(this._option.mode);
85956
85909
  const { clientX, clientY } = params.event;
85957
85910
  if (browserEnv && this._isPointerOnTooltip(params)) {
85958
85911
  return;
@@ -86009,7 +85962,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
86009
85962
  }
86010
85963
  };
86011
85964
  this._showTooltipByMouseEvent = (activeType, mouseEventData, params, useCache) => {
86012
- var _a;
86013
85965
  const processor = this._processor[activeType];
86014
85966
  if (!processor.shouldHandleTooltip(params, {
86015
85967
  tooltipInfo: mouseEventData.tooltipInfo[activeType],
@@ -86033,8 +85985,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
86033
85985
  if (success) {
86034
85986
  this._isTooltipShown = true;
86035
85987
  }
86036
- const vchart = (_a = this._option) === null || _a === void 0 ? void 0 : _a.globalInstance;
86037
- if (success && VChart.globalConfig.uniqueTooltip && vchart) {
85988
+ const vchart = this._option.globalInstance;
85989
+ if (success && VChart.globalConfig.uniqueTooltip) {
86038
85990
  VChart.hideTooltip(vchart.id);
86039
85991
  }
86040
85992
  return success;
@@ -86288,11 +86240,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
86288
86240
  prevParams.datum === nextParams.datum);
86289
86241
  }
86290
86242
  _isPointerInChart(point) {
86291
- var _a;
86292
- const globalInstance = (_a = this._option) === null || _a === void 0 ? void 0 : _a.globalInstance;
86293
- if (!globalInstance) {
86294
- return false;
86295
- }
86243
+ const globalInstance = this._option.globalInstance;
86296
86244
  const chart = globalInstance.getChart();
86297
86245
  if (!chart) {
86298
86246
  return false;
@@ -87655,27 +87603,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
87655
87603
  get orient() {
87656
87604
  return this._orient;
87657
87605
  }
87658
- get isHorizontal() {
87659
- return this._isHorizontal;
87660
- }
87661
- get stateScale() {
87662
- return this._stateScale;
87663
- }
87664
- get relatedAxisComponent() {
87665
- return this._relatedAxisComponent;
87666
- }
87667
- get state() {
87668
- return {
87669
- start: this._start,
87670
- end: this._end,
87671
- startValue: this._startValue,
87672
- endValue: this._endValue
87673
- };
87674
- }
87675
87606
  setStartAndEnd(start, end, rangeMode = ['percent', 'percent']) {
87676
87607
  const [startMode = 'percent', endMode = 'percent'] = rangeMode;
87677
- const startPercent = (startMode === 'percent' ? start : this.dataToStatePoint(start));
87678
- const endPercent = (endMode === 'percent' ? end : this.dataToStatePoint(end));
87608
+ const startPercent = (startMode === 'percent' ? start : this._dataToStatePoint(start));
87609
+ const endPercent = (endMode === 'percent' ? end : this._dataToStatePoint(end));
87679
87610
  this._handleChange(startPercent, endPercent, true);
87680
87611
  }
87681
87612
  enableInteraction() {
@@ -87701,7 +87632,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
87701
87632
  _handleChange(start, end, updateComponent) {
87702
87633
  var _a, _b;
87703
87634
  const zoomLock = (_b = (_a = this._spec) === null || _a === void 0 ? void 0 : _a.zoomLock) !== null && _b !== void 0 ? _b : false;
87704
- if (zoomLock) {
87635
+ if (zoomLock || end - start < this._minSpan || end - start > this._maxSpan) {
87705
87636
  this._shouldChange = false;
87706
87637
  }
87707
87638
  }
@@ -87975,9 +87906,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
87975
87906
  this._handleChange(this._start, this._end, true);
87976
87907
  }
87977
87908
  _computeDomainOfStateScale(isContinuous) {
87978
- if (this._spec.customDomain) {
87979
- return this._spec.customDomain;
87980
- }
87981
87909
  const domain = this._data.getLatestData().map((d) => d[this._stateField]);
87982
87910
  if (isContinuous) {
87983
87911
  const domainNum = domain.map((n) => n * 1);
@@ -88100,23 +88028,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
88100
88028
  }
88101
88029
  _statePointToData(state) {
88102
88030
  const scale = this._stateScale;
88103
- const domain = scale.domain();
88104
- if (isContinuous(scale.type)) {
88105
- if (this._isReverse()) {
88106
- return domain[0] + (domain[1] - domain[0]) * (1 - state);
88107
- }
88108
- return domain[0] + (domain[1] - domain[0]) * state;
88109
- }
88110
88031
  let range = scale.range();
88111
88032
  if (this._isReverse()) {
88112
88033
  range = range.slice().reverse();
88113
88034
  }
88114
88035
  const posInRange = range[0] + (range[1] - range[0]) * state;
88115
- const bandSize = scale.bandwidth();
88116
- const domainIndex = Math.min(Math.max(0, Math.floor(posInRange / bandSize)), domain.length - 1);
88117
- return domain[domainIndex];
88036
+ return scale.invert(posInRange);
88118
88037
  }
88119
- dataToStatePoint(data) {
88038
+ _dataToStatePoint(data) {
88120
88039
  const scale = this._stateScale;
88121
88040
  const pos = scale.scale(data);
88122
88041
  let range = scale.range();
@@ -88139,17 +88058,17 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
88139
88058
  if (this._spec.rangeMode) {
88140
88059
  const [startMode, endMode] = this._spec.rangeMode;
88141
88060
  if (this._modeCheck('start', startMode) && this._modeCheck('end', endMode)) {
88142
- start = startMode === 'percent' ? this._spec.start : this.dataToStatePoint(this._spec.startValue);
88143
- end = endMode === 'percent' ? this._spec.end : this.dataToStatePoint(this._spec.endValue);
88061
+ start = startMode === 'percent' ? this._spec.start : this._dataToStatePoint(this._spec.startValue);
88062
+ end = endMode === 'percent' ? this._spec.end : this._dataToStatePoint(this._spec.endValue);
88144
88063
  }
88145
88064
  }
88146
88065
  else {
88147
88066
  start = this._spec.start
88148
88067
  ? this._spec.start
88149
88068
  : this._spec.startValue
88150
- ? this.dataToStatePoint(this._spec.startValue)
88069
+ ? this._dataToStatePoint(this._spec.startValue)
88151
88070
  : 0;
88152
- end = this._spec.end ? this._spec.end : this._spec.endValue ? this.dataToStatePoint(this._spec.endValue) : 1;
88071
+ end = this._spec.end ? this._spec.end : this._spec.endValue ? this._dataToStatePoint(this._spec.endValue) : 1;
88153
88072
  }
88154
88073
  this._startValue = this._statePointToData(start);
88155
88074
  this._endValue = this._statePointToData(end);
@@ -88190,11 +88109,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
88190
88109
  .range(defaultRange);
88191
88110
  }
88192
88111
  else {
88193
- this._stateScale.domain(domain, true).range(defaultRange).padding(0);
88112
+ this._stateScale.domain(domain, true).range(defaultRange);
88194
88113
  }
88195
88114
  }
88196
88115
  else {
88197
- this._stateScale = new BandScale().padding(0);
88116
+ this._stateScale = new BandScale();
88198
88117
  this._stateScale.domain(this._computeDomainOfStateScale(), true).range(defaultRange);
88199
88118
  }
88200
88119
  }
@@ -88453,7 +88372,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
88453
88372
  this.layoutZIndex = exports.LayoutZIndex.DataZoom;
88454
88373
  this.layoutLevel = exports.LayoutLevel.DataZoom;
88455
88374
  this.layoutType = 'region-relative';
88456
- this._isReverseCache = false;
88457
88375
  this._dataToPositionX = (datum) => {
88458
88376
  const offsetLeft = this._orient === 'left' ? this._middleHandlerSize : 0;
88459
88377
  const offsetHandler = this._isHorizontal ? this._startHandlerSize / 2 : 0;
@@ -88521,10 +88439,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
88521
88439
  }
88522
88440
  onLayoutEnd(ctx) {
88523
88441
  this._updateScaleRange();
88524
- if (this._isReverse() && !this._isReverseCache) {
88525
- this._isReverseCache = this._isReverse();
88526
- this.effect.onZoomChange();
88527
- }
88528
88442
  if (this._cacheVisibility !== false) {
88529
88443
  super.onLayoutEnd(ctx);
88530
88444
  }
@@ -88547,28 +88461,19 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
88547
88461
  const defaultSize = this._isHorizontal
88548
88462
  ? this.getLayoutRect().width - handlerSize
88549
88463
  : this.getLayoutRect().height - handlerSize;
88550
- const defaultRange = (_b = (_a = this._relatedAxisComponent) === null || _a === void 0 ? void 0 : _a.getScale().range()) !== null && _b !== void 0 ? _b : [
88551
- this._startHandlerSize / 2,
88552
- defaultSize - this._endHandlerSize / 2
88553
- ];
88464
+ const defaultRange = (_b = (_a = this._relatedAxisComponent) === null || _a === void 0 ? void 0 : _a.getScale().range()) !== null && _b !== void 0 ? _b : [0, defaultSize];
88554
88465
  if (this._isHorizontal) {
88555
- stateScaleRange = this._visible
88556
- ? [this._startHandlerSize / 2, this._computeWidth() - this._endHandlerSize / 2]
88557
- : defaultRange;
88466
+ stateScaleRange = this._visible ? [0, this._computeWidth() - handlerSize] : defaultRange;
88558
88467
  this._stateScale.range(stateScaleRange);
88559
88468
  this._valueScale.range([this._computeHeight() - this._middleHandlerSize, 0]);
88560
88469
  }
88561
88470
  else if (this.layoutOrient === 'left') {
88562
- stateScaleRange = this._visible
88563
- ? [this._startHandlerSize / 2, this._computeHeight() - this._endHandlerSize / 2]
88564
- : defaultRange;
88471
+ stateScaleRange = this._visible ? [0, this._computeHeight() - handlerSize] : defaultRange;
88565
88472
  this._stateScale.range(stateScaleRange);
88566
88473
  this._valueScale.range([this._computeWidth() - this._middleHandlerSize, 0]);
88567
88474
  }
88568
88475
  else {
88569
- stateScaleRange = this._visible
88570
- ? [this._startHandlerSize / 2, this._computeHeight() - this._endHandlerSize / 2]
88571
- : defaultRange;
88476
+ stateScaleRange = this._visible ? [0, this._computeHeight() - handlerSize] : defaultRange;
88572
88477
  this._stateScale.range(stateScaleRange);
88573
88478
  this._valueScale.range([0, this._computeWidth() - this._middleHandlerSize]);
88574
88479
  }
@@ -88646,7 +88551,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
88646
88551
  }, orient: this._orient, size: {
88647
88552
  width: this.getLayoutRect().width,
88648
88553
  height: this.getLayoutRect().height
88649
- }, 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());
88554
+ }, 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());
88650
88555
  }
88651
88556
  _createOrUpdateComponent() {
88652
88557
  if (this._visible) {
@@ -88684,11 +88589,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
88684
88589
  }
88685
88590
  this._start = start;
88686
88591
  this._end = end;
88687
- const startValue = this._statePointToData(start);
88688
- const endValue = this._statePointToData(end);
88689
- const hasChange = isFunction$1(this._spec.updateDataAfterChange)
88690
- ? this._spec.updateDataAfterChange(start, end, startValue, endValue)
88691
- : this._handleStateChange(startValue, endValue, tag);
88592
+ const hasChange = this._handleStateChange(this._statePointToData(start), this._statePointToData(end), tag);
88692
88593
  if (hasChange) {
88693
88594
  this.event.emit(exports.ChartEvent.dataZoomChange, {
88694
88595
  model: this,
@@ -88877,11 +88778,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
88877
88778
  }
88878
88779
  this._start = start;
88879
88780
  this._end = end;
88880
- const startValue = this._statePointToData(start);
88881
- const endValue = this._statePointToData(end);
88882
- const hasChange = isFunction$1(this._spec.updateDataAfterChange)
88883
- ? this._spec.updateDataAfterChange(start, end, startValue, endValue)
88884
- : this._handleStateChange(this._statePointToData(start), this._statePointToData(end));
88781
+ const hasChange = this._handleStateChange(this._statePointToData(start), this._statePointToData(end));
88885
88782
  if (hasChange) {
88886
88783
  this.event.emit(exports.ChartEvent.scrollBarChange, {
88887
88784
  model: this,
@@ -91598,7 +91495,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91598
91495
  this._needInitOutState = true;
91599
91496
  this._cacheInteractiveRangeAttrs = [];
91600
91497
  this._needDisablePickable = false;
91601
- this._relatedDataZooms = [];
91602
91498
  }
91603
91499
  init() {
91604
91500
  const inBrushMarkAttr = this._transformBrushedMarkAttr(this._spec.inBrush);
@@ -91631,14 +91527,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91631
91527
  this.initEvent();
91632
91528
  this._bindRegions();
91633
91529
  this._bindLinkedSeries();
91634
- this._bindDataZoom();
91635
91530
  this._initNeedOperatedItem();
91636
91531
  }
91637
91532
  _extendDataInBrush(elementsMap) {
91638
91533
  const data = [];
91639
91534
  for (const brushName in elementsMap) {
91640
91535
  for (const elementKey in elementsMap[brushName]) {
91641
- data.push(Object.assign(Object.assign({}, elementsMap[brushName][elementKey].data[0]), { getSeries: elementsMap[brushName][elementKey].getSeries }));
91536
+ data.push(elementsMap[brushName][elementKey].data[0]);
91642
91537
  }
91643
91538
  }
91644
91539
  return data;
@@ -91698,11 +91593,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91698
91593
  this._needInitOutState = false;
91699
91594
  this._needDisablePickable = true;
91700
91595
  this._handleBrushChange(exports.ChartEvent.brushChange, region, e);
91701
- this._emitEvent(exports.ChartEvent.brushChange, region);
91702
91596
  });
91703
91597
  brush.addEventListener(IOperateType.moving, (e) => {
91704
91598
  this._handleBrushChange(exports.ChartEvent.brushChange, region, e);
91705
- this._emitEvent(exports.ChartEvent.brushChange, region);
91706
91599
  });
91707
91600
  brush.addEventListener(IOperateType.brushClear, (e) => {
91708
91601
  this._initMarkBrushState(componentIndex, '');
@@ -91710,31 +91603,23 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91710
91603
  this._needDisablePickable = false;
91711
91604
  this._handleBrushChange(exports.ChartEvent.brushChange, region, e);
91712
91605
  this._handleBrushChange(exports.ChartEvent.brushClear, region, e);
91713
- this._emitEvent(exports.ChartEvent.brushChange, region);
91714
- this._emitEvent(exports.ChartEvent.brushClear, region);
91715
91606
  });
91716
91607
  brush.addEventListener(IOperateType.drawEnd, (e) => {
91717
91608
  this._needInitOutState = true;
91718
91609
  this._needDisablePickable = false;
91719
- const { operateMask } = e.detail;
91720
91610
  this._handleBrushChange(exports.ChartEvent.brushEnd, region, e);
91721
- this._setDataZoomState(operateMask, region);
91722
- this._emitEvent(exports.ChartEvent.brushEnd, region);
91723
91611
  });
91724
91612
  brush.addEventListener(IOperateType.moveEnd, (e) => {
91725
- const { operateMask } = e.detail;
91726
91613
  this._handleBrushChange(exports.ChartEvent.brushEnd, region, e);
91727
- this._setDataZoomState(operateMask, region);
91728
- this._emitEvent(exports.ChartEvent.brushEnd, region);
91729
91614
  });
91730
91615
  }
91731
91616
  _handleBrushChange(eventType, region, e) {
91732
91617
  const { operateMask } = e.detail;
91733
91618
  this._reconfigItem(operateMask, region);
91734
91619
  this._reconfigLinkedItem(operateMask, region);
91620
+ this._emitEvent(eventType, region);
91735
91621
  }
91736
91622
  _emitEvent(eventType, region) {
91737
- var _a;
91738
91623
  this.event.emit(eventType, {
91739
91624
  model: this,
91740
91625
  value: {
@@ -91747,8 +91632,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91747
91632
  inBrushElementsMap: this._inBrushElementsMap,
91748
91633
  outOfBrushElementsMap: this._outOfBrushElementsMap,
91749
91634
  linkedInBrushElementsMap: this._linkedInBrushElementsMap,
91750
- linkedOutOfBrushElementsMap: this._linkedOutOfBrushElementsMap,
91751
- releatedDataZoom: (_a = this._relatedDataZooms) !== null && _a !== void 0 ? _a : []
91635
+ linkedOutOfBrushElementsMap: this._linkedOutOfBrushElementsMap
91752
91636
  }
91753
91637
  });
91754
91638
  }
@@ -91777,7 +91661,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91777
91661
  const elements = grammarMark.elements;
91778
91662
  elements.forEach((el) => {
91779
91663
  var _a, _b, _c;
91780
- el.getSeries = mark.getSeries;
91781
91664
  const graphicItem = el.getGraphicItem();
91782
91665
  const elementKey = mark.id + '_' + el.key;
91783
91666
  if (((_a = this._outOfBrushElementsMap) === null || _a === void 0 ? void 0 : _a[elementKey]) && this._isBrushContainItem(operateMask, graphicItem)) {
@@ -91908,63 +91791,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91908
91791
  }
91909
91792
  return brushMask.globalAABBBounds.intersects(item.globalAABBBounds);
91910
91793
  }
91911
- _findValueInDataZoom(dataZoom, dataValue, type) {
91912
- const stateScale = dataZoom.stateScale;
91913
- if (isContinuous(stateScale.type)) {
91914
- return Math[type](...dataValue);
91915
- }
91916
- const domain = stateScale.domain();
91917
- const dataIndex = dataValue.map(d => d.indexOf(domain));
91918
- return domain[Math[type](...dataIndex)];
91919
- }
91920
- _setDataZoomComponent(dataZooms, region, operateMaskBounds, inBrushDataValue, isHorizontal) {
91921
- var _a;
91922
- const range = (_a = this._spec.dataZoomRangeExpand) !== null && _a !== void 0 ? _a : 0;
91923
- const { x1, x2, y1, y2 } = operateMaskBounds;
91924
- const regionStartAttr = isHorizontal ? 'x' : 'y';
91925
- const boundsStart = isHorizontal ? x1 : y1;
91926
- const boundsEnd = isHorizontal ? x2 : y2;
91927
- dataZooms.forEach((dz) => {
91928
- const startValue = dz.relatedAxisComponent && inBrushDataValue.length > 0
91929
- ? dz.relatedAxisComponent
91930
- .getScale()
91931
- .invert(boundsStart - region.getLayoutStartPoint()[regionStartAttr])
91932
- : this._findValueInDataZoom(dz, inBrushDataValue, 'min');
91933
- const endValue = dz.relatedAxisComponent && inBrushDataValue.length > 0
91934
- ? dz.relatedAxisComponent
91935
- .getScale()
91936
- .invert(boundsEnd - region.getLayoutStartPoint()[regionStartAttr])
91937
- : this._findValueInDataZoom(dz, inBrushDataValue, 'max');
91938
- const startPercent = dz.dataToStatePoint(startValue);
91939
- const endPercent = dz.dataToStatePoint(endValue);
91940
- dz.setStartAndEnd(Math.min(Math.max(0, startPercent - range), 1), Math.min(Math.max(0, endPercent + range), 1), [
91941
- 'percent',
91942
- 'percent'
91943
- ]);
91944
- });
91945
- }
91946
- _setDataZoomState(operateMask, region) {
91947
- const hDataZooms = [];
91948
- const vDataZooms = [];
91949
- this._relatedDataZooms.forEach(dz => {
91950
- if (dz.isHorizontal) {
91951
- hDataZooms.push(dz);
91952
- }
91953
- else {
91954
- vDataZooms.push(dz);
91955
- }
91956
- });
91957
- const operateMaskBounds = operateMask.AABBBounds;
91958
- const inBrushDataXValue = [];
91959
- const inBrushDataYValue = [];
91960
- this._extendDataInBrush(this._inBrushElementsMap).forEach(item => {
91961
- const spec = item.getSeries().getSpec();
91962
- inBrushDataXValue.push(item[array(spec.xField)[0]]);
91963
- inBrushDataYValue.push(item[array(spec.yField)[0]]);
91964
- });
91965
- this._setDataZoomComponent(hDataZooms, region, operateMaskBounds, inBrushDataXValue, true);
91966
- this._setDataZoomComponent(vDataZooms, region, operateMaskBounds, inBrushDataYValue, false);
91967
- }
91968
91794
  _bindRegions() {
91969
91795
  if (isValid$3(this._spec.regionId) && isValid$3(this._spec.regionIndex)) {
91970
91796
  this._relativeRegions = this._option.getAllRegions();
@@ -91977,18 +91803,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91977
91803
  }
91978
91804
  this._linkedSeries = this._option.getSeriesInUserIdOrIndex(array(this._spec.brushLinkSeriesId), array(this._spec.brushLinkSeriesIndex));
91979
91805
  }
91980
- _bindDataZoom() {
91981
- if (this._spec.dataZoomId) {
91982
- array(this._spec.dataZoomId).forEach((dataZoomId) => {
91983
- this._relatedDataZooms.push(this._option.getComponentByUserId(dataZoomId));
91984
- });
91985
- }
91986
- if (this._spec.dataZoomIndex) {
91987
- array(this._spec.dataZoomIndex).forEach((dataZoomIndex) => {
91988
- this._relatedDataZooms.push(this._option.getComponentByIndex('dataZoom', dataZoomIndex));
91989
- });
91990
- }
91991
- }
91992
91806
  _initNeedOperatedItem() {
91993
91807
  const seriesUserId = this._spec.seriesId;
91994
91808
  const seriesIndex = this._spec.seriesIndex;
@@ -91998,10 +91812,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91998
91812
  if ((seriesUserId && array(seriesUserId).includes(s.userId.toString())) ||
91999
91813
  (seriesIndex && array(seriesIndex).includes(s.getSpecIndex())) ||
92000
91814
  (!seriesIndex && !seriesUserId)) {
92001
- allMarks.push(...s.getMarksWithoutRoot().map(mark => {
92002
- mark.getSeries = () => s;
92003
- return mark;
92004
- }));
91815
+ allMarks.push(...s.getMarksWithoutRoot());
92005
91816
  }
92006
91817
  this._itemMap[r.id] = allMarks;
92007
91818
  });