@visactor/vchart 1.9.2 → 1.9.3

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 (41) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.js +119 -76
  3. package/build/index.min.js +1 -1
  4. package/build/tsconfig.tsbuildinfo +1 -1
  5. package/cjs/component/axis/cartesian/axis.js +4 -4
  6. package/cjs/component/axis/cartesian/axis.js.map +1 -1
  7. package/cjs/component/label/util.js +3 -3
  8. package/cjs/component/label/util.js.map +1 -1
  9. package/cjs/component/marker/mark-area/mark-area.js +15 -10
  10. package/cjs/component/marker/mark-area/mark-area.js.map +1 -1
  11. package/cjs/component/player/utils/transform.js +2 -2
  12. package/cjs/component/player/utils/transform.js.map +1 -1
  13. package/cjs/core/index.d.ts +1 -1
  14. package/cjs/core/index.js +1 -1
  15. package/cjs/core/index.js.map +1 -1
  16. package/cjs/data/transforms/pie.js +4 -4
  17. package/cjs/data/transforms/pie.js.map +1 -1
  18. package/cjs/series/word-cloud/config.js +1 -1
  19. package/cjs/series/word-cloud/config.js.map +1 -1
  20. package/cjs/util/math.d.ts +1 -0
  21. package/cjs/util/math.js +18 -2
  22. package/cjs/util/math.js.map +1 -1
  23. package/esm/component/axis/cartesian/axis.js +1 -1
  24. package/esm/component/axis/cartesian/axis.js.map +1 -1
  25. package/esm/component/label/util.js +1 -6
  26. package/esm/component/label/util.js.map +1 -1
  27. package/esm/component/marker/mark-area/mark-area.js +15 -9
  28. package/esm/component/marker/mark-area/mark-area.js.map +1 -1
  29. package/esm/component/player/utils/transform.js +2 -2
  30. package/esm/component/player/utils/transform.js.map +1 -1
  31. package/esm/core/index.d.ts +1 -1
  32. package/esm/core/index.js +1 -1
  33. package/esm/core/index.js.map +1 -1
  34. package/esm/data/transforms/pie.js +5 -5
  35. package/esm/data/transforms/pie.js.map +1 -1
  36. package/esm/series/word-cloud/config.js +1 -1
  37. package/esm/series/word-cloud/config.js.map +1 -1
  38. package/esm/util/math.d.ts +1 -0
  39. package/esm/util/math.js +16 -0
  40. package/esm/util/math.js.map +1 -1
  41. package/package.json +12 -12
package/build/index.js CHANGED
@@ -26305,6 +26305,45 @@
26305
26305
  function distance(p1, p2 = { x: 0, y: 0 }) {
26306
26306
  return PointService.distancePP(p1, p2);
26307
26307
  }
26308
+ function getPercentValue(valueList, idx, precision = 2) {
26309
+ if (!valueList[idx]) {
26310
+ return 0;
26311
+ }
26312
+ const sum = valueList.reduce((a, c) => {
26313
+ return (a += isNaN(c) ? 0 : c);
26314
+ }, 0);
26315
+ if (sum === 0) {
26316
+ return 0;
26317
+ }
26318
+ const digits = Math.pow(10, precision);
26319
+ const votesPerQuota = valueList.map(val => {
26320
+ return ((isNaN(val) ? 0 : val) / sum) * digits * 100;
26321
+ });
26322
+ const targetSeats = digits * 100;
26323
+ const seats = votesPerQuota.map(votes => {
26324
+ return Math.floor(votes);
26325
+ });
26326
+ let currentSum = seats.reduce((a, c) => {
26327
+ return a + c;
26328
+ }, 0);
26329
+ const remainder = votesPerQuota.map((votes, idx) => {
26330
+ return votes - seats[idx];
26331
+ });
26332
+ while (currentSum < targetSeats) {
26333
+ let max = Number.NEGATIVE_INFINITY;
26334
+ let maxId = null;
26335
+ for (let i = 0; i < remainder.length; i++) {
26336
+ if (remainder[i] > max) {
26337
+ max = remainder[i];
26338
+ maxId = i;
26339
+ }
26340
+ }
26341
+ ++seats[maxId];
26342
+ remainder[maxId] = 0;
26343
+ ++currentSum;
26344
+ }
26345
+ return seats[idx] / digits;
26346
+ }
26308
26347
 
26309
26348
  function eachSeries(regions, callback, filter) {
26310
26349
  let flag = false;
@@ -37281,10 +37320,10 @@
37281
37320
  }, this._statePointToData = state => state, this._onHandlerPointerDown = (e, tag) => {
37282
37321
  e.stopPropagation(), "start" === tag ? (this._activeTag = DataZoomActiveTag.startHandler, this._activeItem = this._startHandlerMask) : "end" === tag ? (this._activeTag = DataZoomActiveTag.endHandler, this._activeItem = this._endHandlerMask) : "middleRect" === tag ? (this._activeTag = DataZoomActiveTag.middleHandler, this._activeItem = this._middleHandlerRect) : "middleSymbol" === tag ? (this._activeTag = DataZoomActiveTag.middleHandler, this._activeItem = this._middleHandlerSymbol) : "background" === tag && (this._activeTag = DataZoomActiveTag.background, this._activeItem = this._background), this._activeState = !0, this._activeCache.startPos = this.eventPosToStagePos(e), this._activeCache.lastPos = this.eventPosToStagePos(e), "browser" === vglobal.env && (vglobal.addEventListener("pointermove", this._onHandlerPointerMove, {
37283
37322
  capture: !0
37284
- }), vglobal.addEventListener("pointerup", this._onHandlerPointerUp.bind(this))), this.addEventListener("pointermove", this._onHandlerPointerMove, {
37323
+ }), vglobal.addEventListener("pointerup", this._onHandlerPointerUp)), this.addEventListener("pointermove", this._onHandlerPointerMove, {
37285
37324
  capture: !0
37286
37325
  });
37287
- }, this._onHandlerPointerMove = delayMap$2[this.attribute.delayType](e => {
37326
+ }, this._pointerMove = e => {
37288
37327
  e.stopPropagation();
37289
37328
  const {
37290
37329
  start: startAttr,
@@ -37302,12 +37341,33 @@
37302
37341
  start: start,
37303
37342
  end: end
37304
37343
  } = this.state;
37305
- 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), this._dispatchEvent("change", {
37344
+ 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", {
37306
37345
  start: start,
37307
37346
  end: end,
37308
37347
  tag: this._activeTag
37309
37348
  }));
37310
- }, this.attribute.delayTime);
37349
+ }, this._onHandlerPointerMove = 0 === this.attribute.delayTime ? this._pointerMove : delayMap$2[this.attribute.delayType](this._pointerMove, this.attribute.delayTime), this._onHandlerPointerUp = e => {
37350
+ e.preventDefault();
37351
+ const {
37352
+ start: start,
37353
+ end: end,
37354
+ brushSelect: brushSelect,
37355
+ realTime = !0
37356
+ } = this.attribute;
37357
+ if (this._activeState && this._activeTag === DataZoomActiveTag.background) {
37358
+ const pos = this.eventPosToStagePos(e);
37359
+ this.backgroundDragZoom(this._activeCache.startPos, pos);
37360
+ }
37361
+ 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", {
37362
+ start: this.state.start,
37363
+ end: this.state.end,
37364
+ tag: this._activeTag
37365
+ })), "browser" === vglobal.env && (vglobal.removeEventListener("pointermove", this._onHandlerPointerMove, {
37366
+ capture: !0
37367
+ }), vglobal.removeEventListener("pointerup", this._onHandlerPointerUp)), this.removeEventListener("pointermove", this._onHandlerPointerMove, {
37368
+ capture: !0
37369
+ }), this.removeEventListener("pointerup", this._onHandlerPointerUp);
37370
+ };
37311
37371
  const {
37312
37372
  position: position,
37313
37373
  showDetail: showDetail
@@ -37360,28 +37420,6 @@
37360
37420
  y: y - ((null === (_b = this.stage) || void 0 === _b ? void 0 : _b.y) || 0)
37361
37421
  };
37362
37422
  }
37363
- _onHandlerPointerUp(e) {
37364
- e.preventDefault();
37365
- const {
37366
- start: start,
37367
- end: end,
37368
- brushSelect: brushSelect,
37369
- realTime = !0
37370
- } = this.attribute;
37371
- if (this._activeState && this._activeTag === DataZoomActiveTag.background) {
37372
- const pos = this.eventPosToStagePos(e);
37373
- this.backgroundDragZoom(this._activeCache.startPos, pos);
37374
- }
37375
- 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", {
37376
- start: this.state.start,
37377
- end: this.state.end,
37378
- tag: this._activeTag
37379
- })), "browser" === vglobal.env && (vglobal.removeEventListener("pointermove", this._onHandlerPointerMove, {
37380
- capture: !0
37381
- }), vglobal.removeEventListener("pointerup", this._onHandlerPointerUp.bind(this))), this.removeEventListener("pointermove", this._onHandlerPointerMove, {
37382
- capture: !0
37383
- });
37384
- }
37385
37423
  _onHandlerPointerEnter(e) {
37386
37424
  e.stopPropagation(), this._showText = !0, this.renderText();
37387
37425
  }
@@ -37570,7 +37608,7 @@
37570
37608
  }, this._layoutAttrFromConfig;
37571
37609
  }
37572
37610
  render() {
37573
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
37611
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9;
37574
37612
  this._layoutAttrFromConfig = null;
37575
37613
  const {
37576
37614
  orient: orient,
@@ -37603,15 +37641,15 @@
37603
37641
  height: height,
37604
37642
  cursor: brushSelect ? "crosshair" : "auto"
37605
37643
  }, backgroundStyle), {
37606
- pickable: !zoomLock
37607
- }), "rect"), (null === (_c = backgroundChartStyle.line) || void 0 === _c ? void 0 : _c.visible) && this.setPreviewAttributes("line", group), (null === (_d = backgroundChartStyle.area) || void 0 === _d ? void 0 : _d.visible) && this.setPreviewAttributes("area", group), brushSelect && this.renderDragMask(), this._isHorizontal ? this._selectedBackground = group.createOrUpdateChild("selectedBackground", Object.assign(Object.assign({
37644
+ pickable: !zoomLock && (null === (_c = backgroundStyle.pickable) || void 0 === _c || _c)
37645
+ }), "rect"), (null === (_d = backgroundChartStyle.line) || void 0 === _d ? void 0 : _d.visible) && this.setPreviewAttributes("line", group), (null === (_e = backgroundChartStyle.area) || void 0 === _e ? void 0 : _e.visible) && this.setPreviewAttributes("area", group), brushSelect && this.renderDragMask(), this._isHorizontal ? this._selectedBackground = group.createOrUpdateChild("selectedBackground", Object.assign(Object.assign({
37608
37646
  x: position.x + start * width,
37609
37647
  y: position.y,
37610
37648
  width: (end - start) * width,
37611
37649
  height: height,
37612
37650
  cursor: brushSelect ? "crosshair" : "move"
37613
37651
  }, selectedBackgroundStyle), {
37614
- pickable: !zoomLock
37652
+ pickable: !zoomLock && (null === (_f = selectedBackgroundChartStyle.pickable) || void 0 === _f || _f)
37615
37653
  }), "rect") : this._selectedBackground = group.createOrUpdateChild("selectedBackground", Object.assign(Object.assign({
37616
37654
  x: position.x,
37617
37655
  y: position.y + start * height,
@@ -37619,41 +37657,41 @@
37619
37657
  height: (end - start) * height,
37620
37658
  cursor: brushSelect ? "crosshair" : "move"
37621
37659
  }, selectedBackgroundStyle), {
37622
- pickable: !zoomLock
37623
- }), "rect"), (null === (_e = selectedBackgroundChartStyle.line) || void 0 === _e ? void 0 : _e.visible) && this.setSelectedPreviewAttributes("line", group), (null === (_f = selectedBackgroundChartStyle.area) || void 0 === _f ? void 0 : _f.visible) && this.setSelectedPreviewAttributes("area", group), this._isHorizontal) {
37660
+ pickable: !zoomLock && (null === (_g = selectedBackgroundStyle.pickable) || void 0 === _g || _g)
37661
+ }), "rect"), (null === (_h = selectedBackgroundChartStyle.line) || void 0 === _h ? void 0 : _h.visible) && this.setSelectedPreviewAttributes("line", group), (null === (_j = selectedBackgroundChartStyle.area) || void 0 === _j ? void 0 : _j.visible) && this.setSelectedPreviewAttributes("area", group), this._isHorizontal) {
37624
37662
  if (middleHandlerStyle.visible) {
37625
- const middleHandlerBackgroundSize = (null === (_g = middleHandlerStyle.background) || void 0 === _g ? void 0 : _g.size) || 10;
37663
+ const middleHandlerBackgroundSize = (null === (_k = middleHandlerStyle.background) || void 0 === _k ? void 0 : _k.size) || 10;
37626
37664
  this._middleHandlerRect = group.createOrUpdateChild("middleHandlerRect", Object.assign(Object.assign({
37627
37665
  x: position.x + start * width,
37628
37666
  y: position.y - middleHandlerBackgroundSize,
37629
37667
  width: (end - start) * width,
37630
37668
  height: middleHandlerBackgroundSize
37631
- }, null === (_h = middleHandlerStyle.background) || void 0 === _h ? void 0 : _h.style), {
37632
- pickable: !zoomLock
37669
+ }, null === (_l = middleHandlerStyle.background) || void 0 === _l ? void 0 : _l.style), {
37670
+ pickable: !zoomLock && (null === (_p = null === (_o = null === (_m = middleHandlerStyle.background) || void 0 === _m ? void 0 : _m.style) || void 0 === _o ? void 0 : _o.pickable) || void 0 === _p || _p)
37633
37671
  }), "rect"), this._middleHandlerSymbol = group.createOrUpdateChild("middleHandlerSymbol", Object.assign(Object.assign({
37634
37672
  x: position.x + (start + end) / 2 * width,
37635
37673
  y: position.y - middleHandlerBackgroundSize / 2,
37636
37674
  strokeBoundsBuffer: 0,
37637
37675
  angle: 0,
37638
- symbolType: null !== (_k = null === (_j = middleHandlerStyle.icon) || void 0 === _j ? void 0 : _j.symbolType) && void 0 !== _k ? _k : "square"
37676
+ symbolType: null !== (_r = null === (_q = middleHandlerStyle.icon) || void 0 === _q ? void 0 : _q.symbolType) && void 0 !== _r ? _r : "square"
37639
37677
  }, middleHandlerStyle.icon), {
37640
- pickable: !zoomLock
37678
+ pickable: !zoomLock && (null === (_s = middleHandlerStyle.icon.pickable) || void 0 === _s || _s)
37641
37679
  }), "symbol");
37642
37680
  }
37643
37681
  this._startHandler = group.createOrUpdateChild("startHandler", Object.assign(Object.assign(Object.assign({
37644
37682
  x: position.x + start * width,
37645
37683
  y: position.y + height / 2,
37646
37684
  size: height,
37647
- symbolType: null !== (_l = startHandlerStyle.symbolType) && void 0 !== _l ? _l : "square"
37685
+ symbolType: null !== (_t = startHandlerStyle.symbolType) && void 0 !== _t ? _t : "square"
37648
37686
  }, DEFAULT_HANDLER_ATTR_MAP.horizontal), startHandlerStyle), {
37649
- pickable: !zoomLock
37687
+ pickable: !zoomLock && (null === (_u = startHandlerStyle.pickable) || void 0 === _u || _u)
37650
37688
  }), "symbol"), this._endHandler = group.createOrUpdateChild("endHandler", Object.assign(Object.assign(Object.assign({
37651
37689
  x: position.x + end * width,
37652
37690
  y: position.y + height / 2,
37653
37691
  size: height,
37654
- symbolType: null !== (_m = endHandlerStyle.symbolType) && void 0 !== _m ? _m : "square"
37692
+ symbolType: null !== (_v = endHandlerStyle.symbolType) && void 0 !== _v ? _v : "square"
37655
37693
  }, DEFAULT_HANDLER_ATTR_MAP.horizontal), endHandlerStyle), {
37656
- pickable: !zoomLock
37694
+ pickable: !zoomLock && (null === (_w = endHandlerStyle.pickable) || void 0 === _w || _w)
37657
37695
  }), "symbol");
37658
37696
  const startHandlerWidth = Math.max(this._startHandler.AABBBounds.width(), startHandlerMinSize),
37659
37697
  startHandlerHeight = Math.max(this._startHandler.AABBBounds.height(), startHandlerMinSize),
@@ -37682,38 +37720,38 @@
37682
37720
  }), "rect");
37683
37721
  } else {
37684
37722
  if (middleHandlerStyle.visible) {
37685
- const middleHandlerBackgroundSize = (null === (_o = middleHandlerStyle.background) || void 0 === _o ? void 0 : _o.size) || 10;
37723
+ const middleHandlerBackgroundSize = (null === (_x = middleHandlerStyle.background) || void 0 === _x ? void 0 : _x.size) || 10;
37686
37724
  this._middleHandlerRect = group.createOrUpdateChild("middleHandlerRect", Object.assign(Object.assign({
37687
37725
  x: "left" === orient ? position.x - middleHandlerBackgroundSize : position.x + width,
37688
37726
  y: position.y + start * height,
37689
37727
  width: middleHandlerBackgroundSize,
37690
37728
  height: (end - start) * height
37691
- }, null === (_p = middleHandlerStyle.background) || void 0 === _p ? void 0 : _p.style), {
37692
- pickable: !zoomLock
37729
+ }, null === (_y = middleHandlerStyle.background) || void 0 === _y ? void 0 : _y.style), {
37730
+ pickable: !zoomLock && (null === (_1 = null === (_0 = null === (_z = middleHandlerStyle.background) || void 0 === _z ? void 0 : _z.style) || void 0 === _0 ? void 0 : _0.pickable) || void 0 === _1 || _1)
37693
37731
  }), "rect"), this._middleHandlerSymbol = group.createOrUpdateChild("middleHandlerSymbol", Object.assign(Object.assign({
37694
37732
  x: "left" === orient ? position.x - middleHandlerBackgroundSize / 2 : position.x + width + middleHandlerBackgroundSize / 2,
37695
37733
  y: position.y + (start + end) / 2 * height,
37696
37734
  angle: Math.PI / 180 * 90,
37697
- symbolType: null !== (_r = null === (_q = middleHandlerStyle.icon) || void 0 === _q ? void 0 : _q.symbolType) && void 0 !== _r ? _r : "square",
37735
+ symbolType: null !== (_3 = null === (_2 = middleHandlerStyle.icon) || void 0 === _2 ? void 0 : _2.symbolType) && void 0 !== _3 ? _3 : "square",
37698
37736
  strokeBoundsBuffer: 0
37699
37737
  }, middleHandlerStyle.icon), {
37700
- pickable: !zoomLock
37738
+ pickable: !zoomLock && (null === (_5 = null === (_4 = middleHandlerStyle.icon) || void 0 === _4 ? void 0 : _4.pickable) || void 0 === _5 || _5)
37701
37739
  }), "symbol");
37702
37740
  }
37703
37741
  this._startHandler = group.createOrUpdateChild("startHandler", Object.assign(Object.assign(Object.assign({
37704
37742
  x: position.x + width / 2,
37705
37743
  y: position.y + start * height,
37706
37744
  size: width,
37707
- symbolType: null !== (_s = startHandlerStyle.symbolType) && void 0 !== _s ? _s : "square"
37745
+ symbolType: null !== (_6 = startHandlerStyle.symbolType) && void 0 !== _6 ? _6 : "square"
37708
37746
  }, DEFAULT_HANDLER_ATTR_MAP.vertical), startHandlerStyle), {
37709
- pickable: !zoomLock
37747
+ pickable: !zoomLock && (null === (_7 = startHandlerStyle.pickable) || void 0 === _7 || _7)
37710
37748
  }), "symbol"), this._endHandler = group.createOrUpdateChild("endHandler", Object.assign(Object.assign(Object.assign({
37711
37749
  x: position.x + width / 2,
37712
37750
  y: position.y + end * height,
37713
37751
  size: width,
37714
- symbolType: null !== (_t = endHandlerStyle.symbolType) && void 0 !== _t ? _t : "square"
37752
+ symbolType: null !== (_8 = endHandlerStyle.symbolType) && void 0 !== _8 ? _8 : "square"
37715
37753
  }, DEFAULT_HANDLER_ATTR_MAP.vertical), endHandlerStyle), {
37716
- pickable: !zoomLock
37754
+ pickable: !zoomLock && (null === (_9 = endHandlerStyle.pickable) || void 0 === _9 || _9)
37717
37755
  }), "symbol");
37718
37756
  const startHandlerWidth = Math.max(this._startHandler.AABBBounds.width(), startHandlerMinSize),
37719
37757
  startHandlerHeight = Math.max(this._startHandler.AABBBounds.height(), startHandlerMinSize),
@@ -58794,7 +58832,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
58794
58832
  registerChartPlugin(MediaQuery);
58795
58833
  };
58796
58834
 
58797
- const version = "1.9.2";
58835
+ const version = "1.9.3";
58798
58836
 
58799
58837
  const addVChartProperty = (data, op) => {
58800
58838
  const context = op.beforeCall();
@@ -68138,11 +68176,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
68138
68176
  max = Math.max(angleFieldValue, max);
68139
68177
  data[index][ARC_TRANSFORM_VALUE] = angleFieldValue;
68140
68178
  }
68179
+ const valueList = data.map(d => Number(d[angleField]));
68141
68180
  const angleRange = endAngle - startAngle;
68142
68181
  let lastAngle = startAngle;
68143
68182
  let restAngle = angleRange;
68144
68183
  let largeThanMinAngleTotal = 0;
68145
- data.forEach(d => {
68184
+ data.forEach((d, i) => {
68146
68185
  const angleFieldValue = d[ARC_TRANSFORM_VALUE];
68147
68186
  const ratio = total ? angleFieldValue / total : 0;
68148
68187
  let radian = ratio * angleRange;
@@ -68157,6 +68196,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
68157
68196
  const dEndAngle = lastAngle + radian;
68158
68197
  d[asRatio] = ratio;
68159
68198
  d[asK] = max ? angleFieldValue / max : 0;
68199
+ d._percent_ = getPercentValue(valueList, i);
68160
68200
  appendArcInfo(d, dStartAngle, radian);
68161
68201
  lastAngle = dEndAngle;
68162
68202
  });
@@ -70930,7 +70970,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
70930
70970
  'star',
70931
70971
  'cardioid',
70932
70972
  'circle',
70933
- 'pentagon'
70973
+ 'pentagon',
70974
+ 'rect'
70934
70975
  ];
70935
70976
 
70936
70977
  const WORD_CLOUD_ANGLE = `${PREFIX}_WORD_CLOUD_ANGLE`;
@@ -81668,7 +81709,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
81668
81709
  }
81669
81710
  else {
81670
81711
  if (isXAxis(this.getOrient())) {
81671
- field = s.fieldX2
81712
+ field = s.getSpec().x2Field
81672
81713
  ? [...s.fieldX, s.fieldX2]
81673
81714
  : s.fieldX;
81674
81715
  }
@@ -81676,7 +81717,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
81676
81717
  field = s.fieldZ;
81677
81718
  }
81678
81719
  else {
81679
- field = s.fieldY;
81720
+ field = s.getSpec().y2Field
81721
+ ? [...s.fieldY, s.fieldY2]
81722
+ : s.fieldY;
81680
81723
  }
81681
81724
  }
81682
81725
  field = (isArray$1(field) ? (isContinuous(this._scale.type) ? field : [field[0]]) : [field]);
@@ -88872,22 +88915,28 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
88872
88915
  let lines = [];
88873
88916
  if (isXYLayout) {
88874
88917
  lines = xyLayout(data, startRelativeSeries, endRelativeSeries, relativeSeries, autoRange);
88875
- points = [
88876
- {
88877
- x: lines[0][0].x,
88878
- y: lines[1][0].y
88879
- },
88880
- lines[0][0],
88881
- {
88882
- x: lines[1][0].x,
88883
- y: lines[0][0].y
88884
- },
88885
- lines[1][0]
88886
- ];
88918
+ const [start, end] = lines;
88919
+ if (start && start.length && end && end.length) {
88920
+ points = [
88921
+ {
88922
+ x: start[0].x,
88923
+ y: end[0].y
88924
+ },
88925
+ start[0],
88926
+ {
88927
+ x: end[0].x,
88928
+ y: start[0].y
88929
+ },
88930
+ end[0]
88931
+ ];
88932
+ }
88887
88933
  }
88888
88934
  else if (isXLayout || isYLayout) {
88889
88935
  lines = xyLayout(data, startRelativeSeries, endRelativeSeries, relativeSeries, autoRange);
88890
- points = [...lines[0], lines[1][1], lines[1][0]];
88936
+ const [start, end] = lines;
88937
+ if (start && start.length && end && end.length) {
88938
+ points = [...start, end[1], end[0]];
88939
+ }
88891
88940
  }
88892
88941
  else if (isCoordinateLayout) {
88893
88942
  points = coordinateLayout(data, relativeSeries, autoRange, spec.coordinatesOffset);
@@ -88992,7 +89041,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
88992
89041
  return result;
88993
89042
  };
88994
89043
  const transformToAttrs = (spec) => {
88995
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
89044
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
88996
89045
  const trackStyle = rectToAttribute((_b = (_a = spec === null || spec === void 0 ? void 0 : spec.slider) === null || _a === void 0 ? void 0 : _a.trackStyle) !== null && _b !== void 0 ? _b : {});
88997
89046
  const railStyle = rectToAttribute((_d = (_c = spec === null || spec === void 0 ? void 0 : spec.slider) === null || _c === void 0 ? void 0 : _c.railStyle) !== null && _d !== void 0 ? _d : {});
88998
89047
  const handlerStyle = symbolToAttribute((_f = (_e = spec === null || spec === void 0 ? void 0 : spec.slider) === null || _e === void 0 ? void 0 : _e.handlerStyle) !== null && _f !== void 0 ? _f : {});
@@ -89000,7 +89049,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
89000
89049
  const pause = baseToAttribute((_k = (_j = spec === null || spec === void 0 ? void 0 : spec.controller) === null || _j === void 0 ? void 0 : _j.pause) !== null && _k !== void 0 ? _k : {});
89001
89050
  const backward = baseToAttribute((_m = (_l = spec === null || spec === void 0 ? void 0 : spec.controller) === null || _l === void 0 ? void 0 : _l.backward) !== null && _m !== void 0 ? _m : {});
89002
89051
  const forward = baseToAttribute((_p = (_o = spec === null || spec === void 0 ? void 0 : spec.controller) === null || _o === void 0 ? void 0 : _o.forward) !== null && _p !== void 0 ? _p : {});
89003
- return Object.assign(Object.assign({}, spec), { direction: spec.direction, interval: spec.interval, visible: spec.visible, orient: spec.orient, slider: Object.assign(Object.assign({}, spec.slider), { trackStyle: trackStyle, railStyle: railStyle, handlerStyle: handlerStyle }), controller: Object.assign(Object.assign({}, spec.controller), { start: start, pause: pause, backward: backward, forward: forward }) });
89052
+ return Object.assign(Object.assign({}, spec), { direction: spec.direction, interval: spec.interval, visible: spec.visible, orient: (_q = spec.orient) !== null && _q !== void 0 ? _q : 'bottom', slider: Object.assign(Object.assign({}, spec.slider), { trackStyle: trackStyle, railStyle: railStyle, handlerStyle: handlerStyle }), controller: Object.assign(Object.assign({}, spec.controller), { start: start, pause: pause, backward: backward, forward: forward }) });
89004
89053
  };
89005
89054
  const transformContinuousSpecToAttrs = (spec, data) => (Object.assign(Object.assign({}, transformToAttrs(spec)), { data, type: 'continuous' }));
89006
89055
  const transformDiscreteSpecToAttrs = (spec, data) => (Object.assign(Object.assign({}, transformToAttrs(spec)), { data, type: 'discrete' }));
@@ -89320,12 +89369,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
89320
89369
  textAttribute.text = formatMethod(textAttribute.text, datum, { series });
89321
89370
  }
89322
89371
  if (formatter) {
89323
- if (series.type === 'pie') {
89324
- datum._percent_ = (datum[ARC_RATIO] * 100).toFixed(2) + '%';
89325
- }
89326
- else if (datum[STACK_FIELD_END_PERCENT]) {
89327
- datum._percent_ = (datum[STACK_FIELD_END_PERCENT] * 100).toFixed(2) + '%';
89328
- }
89329
89372
  textAttribute.text = substitute(formatter, datum);
89330
89373
  }
89331
89374
  return textAttribute;