@visactor/vchart 1.12.2-alpha.2 → 1.12.2-alpha.9

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 (207) hide show
  1. package/build/index.js +647 -625
  2. package/build/index.min.js +1 -1
  3. package/cjs/animation/config.js +2 -2
  4. package/cjs/animation/config.js.map +1 -1
  5. package/cjs/animation/utils.js +5 -4
  6. package/cjs/animation/utils.js.map +1 -1
  7. package/cjs/chart/base/base-chart.js +1 -1
  8. package/cjs/chart/base/base-chart.js.map +1 -1
  9. package/cjs/chart/sankey/sankey-transformer.js +2 -1
  10. package/cjs/chart/sankey/sankey-transformer.js.map +1 -1
  11. package/cjs/compile/compilable-base.js +2 -1
  12. package/cjs/compile/util.js +1 -2
  13. package/cjs/component/axis/cartesian/axis.js.map +1 -1
  14. package/cjs/component/axis/cartesian/linear-axis.js +12 -9
  15. package/cjs/component/axis/cartesian/linear-axis.js.map +1 -1
  16. package/cjs/component/axis/interface/spec.d.ts +1 -1
  17. package/cjs/component/axis/interface/spec.js.map +1 -1
  18. package/cjs/component/axis/mixin/linear-axis-mixin.d.ts +2 -1
  19. package/cjs/component/axis/mixin/linear-axis-mixin.js +15 -25
  20. package/cjs/component/axis/mixin/linear-axis-mixin.js.map +1 -1
  21. package/cjs/component/axis/mixin/util/break-data.js +1 -1
  22. package/cjs/component/axis/mixin/util/break-data.js.map +1 -1
  23. package/cjs/component/brush/brush.js +6 -2
  24. package/cjs/component/brush/brush.js.map +1 -1
  25. package/cjs/component/brush/interface.d.ts +1 -0
  26. package/cjs/component/brush/interface.js.map +1 -1
  27. package/cjs/component/data-zoom/data-filter-base-component.js +3 -1
  28. package/cjs/component/data-zoom/data-filter-base-component.js.map +1 -1
  29. package/cjs/component/indicator/indicator.js +29 -16
  30. package/cjs/component/indicator/indicator.js.map +1 -1
  31. package/cjs/component/tooltip/constant.d.ts +2 -1
  32. package/cjs/component/tooltip/constant.js +2 -2
  33. package/cjs/component/tooltip/constant.js.map +1 -1
  34. package/cjs/component/tooltip/interface/common.d.ts +3 -3
  35. package/cjs/component/tooltip/interface/common.js.map +1 -1
  36. package/cjs/component/tooltip/processor/base.d.ts +3 -4
  37. package/cjs/component/tooltip/processor/base.js +6 -39
  38. package/cjs/component/tooltip/processor/base.js.map +1 -1
  39. package/cjs/component/tooltip/processor/dimension-tooltip.d.ts +2 -1
  40. package/cjs/component/tooltip/processor/dimension-tooltip.js +37 -6
  41. package/cjs/component/tooltip/processor/dimension-tooltip.js.map +1 -1
  42. package/cjs/component/tooltip/processor/group-tooltip.d.ts +2 -3
  43. package/cjs/component/tooltip/processor/group-tooltip.js +3 -12
  44. package/cjs/component/tooltip/processor/group-tooltip.js.map +1 -1
  45. package/cjs/component/tooltip/processor/interface.d.ts +0 -1
  46. package/cjs/component/tooltip/processor/interface.js.map +1 -1
  47. package/cjs/component/tooltip/processor/mark-tooltip.d.ts +2 -3
  48. package/cjs/component/tooltip/processor/mark-tooltip.js +4 -13
  49. package/cjs/component/tooltip/processor/mark-tooltip.js.map +1 -1
  50. package/cjs/component/tooltip/tooltip-transformer.js +2 -2
  51. package/cjs/component/tooltip/tooltip-transformer.js.map +1 -1
  52. package/cjs/component/tooltip/tooltip.js +20 -22
  53. package/cjs/component/tooltip/tooltip.js.map +1 -1
  54. package/cjs/component/tooltip/utils/common.d.ts +3 -1
  55. package/cjs/component/tooltip/utils/common.js +19 -2
  56. package/cjs/component/tooltip/utils/common.js.map +1 -1
  57. package/cjs/component/tooltip/utils/compose.js +1 -1
  58. package/cjs/component/tooltip/utils/compose.js.map +1 -1
  59. package/cjs/component/tooltip/utils/get-spec.js +64 -81
  60. package/cjs/component/tooltip/utils/get-spec.js.map +1 -1
  61. package/cjs/component/tooltip/utils/index.d.ts +0 -1
  62. package/cjs/component/tooltip/utils/index.js +1 -1
  63. package/cjs/component/tooltip/utils/index.js.map +1 -1
  64. package/cjs/constant/correlation.js +1 -2
  65. package/cjs/constant/layout.js +2 -1
  66. package/cjs/core/index.d.ts +1 -1
  67. package/cjs/core/index.js +1 -1
  68. package/cjs/core/index.js.map +1 -1
  69. package/cjs/event/events/dimension/util/cartesian.d.ts +1 -1
  70. package/cjs/event/events/dimension/util/cartesian.js +6 -4
  71. package/cjs/event/events/dimension/util/cartesian.js.map +1 -1
  72. package/cjs/event/events/dimension/util/polar.js +4 -2
  73. package/cjs/event/events/dimension/util/polar.js.map +1 -1
  74. package/cjs/plugin/components/tooltip-handler/base.js +27 -64
  75. package/cjs/plugin/components/tooltip-handler/base.js.map +1 -1
  76. package/cjs/plugin/components/tooltip-handler/utils/position.d.ts +3 -4
  77. package/cjs/plugin/components/tooltip-handler/utils/position.js +8 -11
  78. package/cjs/plugin/components/tooltip-handler/utils/position.js.map +1 -1
  79. package/cjs/scale/global-scale.js +2 -0
  80. package/cjs/scale/global-scale.js.map +1 -1
  81. package/cjs/series/bar/bar.js +3 -1
  82. package/cjs/series/bar/bar.js.map +1 -1
  83. package/cjs/series/base/tooltip-helper.d.ts +1 -3
  84. package/cjs/series/base/tooltip-helper.js +5 -30
  85. package/cjs/series/base/tooltip-helper.js.map +1 -1
  86. package/cjs/series/dot/tooltip-helper.d.ts +0 -1
  87. package/cjs/series/dot/tooltip-helper.js +2 -19
  88. package/cjs/series/dot/tooltip-helper.js.map +1 -1
  89. package/cjs/series/interface/series.d.ts +2 -0
  90. package/cjs/series/interface/series.js.map +1 -1
  91. package/cjs/series/pie/interface.d.ts +1 -1
  92. package/cjs/series/pie/interface.js.map +1 -1
  93. package/cjs/series/pie/pie-transformer.js +2 -2
  94. package/cjs/series/pie/pie-transformer.js.map +1 -1
  95. package/cjs/series/polar/polar.js.map +1 -1
  96. package/cjs/series/sankey/interface.d.ts +1 -0
  97. package/cjs/series/sankey/interface.js.map +1 -1
  98. package/cjs/series/sankey/sankey.d.ts +1 -0
  99. package/cjs/series/sankey/sankey.js +25 -13
  100. package/cjs/series/sankey/sankey.js.map +1 -1
  101. package/esm/animation/config.js +2 -2
  102. package/esm/animation/config.js.map +1 -1
  103. package/esm/animation/utils.js +1 -1
  104. package/esm/animation/utils.js.map +1 -1
  105. package/esm/chart/base/base-chart.js +1 -1
  106. package/esm/chart/base/base-chart.js.map +1 -1
  107. package/esm/chart/sankey/sankey-transformer.js +2 -1
  108. package/esm/chart/sankey/sankey-transformer.js.map +1 -1
  109. package/esm/compile/compilable-base.js +2 -1
  110. package/esm/compile/util.js +1 -2
  111. package/esm/component/axis/cartesian/axis.js.map +1 -1
  112. package/esm/component/axis/cartesian/linear-axis.js +13 -10
  113. package/esm/component/axis/cartesian/linear-axis.js.map +1 -1
  114. package/esm/component/axis/interface/spec.d.ts +1 -1
  115. package/esm/component/axis/interface/spec.js.map +1 -1
  116. package/esm/component/axis/mixin/linear-axis-mixin.d.ts +2 -1
  117. package/esm/component/axis/mixin/linear-axis-mixin.js +15 -25
  118. package/esm/component/axis/mixin/linear-axis-mixin.js.map +1 -1
  119. package/esm/component/axis/mixin/util/break-data.js +1 -1
  120. package/esm/component/axis/mixin/util/break-data.js.map +1 -1
  121. package/esm/component/brush/brush.js +6 -2
  122. package/esm/component/brush/brush.js.map +1 -1
  123. package/esm/component/brush/interface.d.ts +1 -0
  124. package/esm/component/brush/interface.js.map +1 -1
  125. package/esm/component/data-zoom/data-filter-base-component.js +1 -1
  126. package/esm/component/data-zoom/data-filter-base-component.js.map +1 -1
  127. package/esm/component/indicator/indicator.js +29 -16
  128. package/esm/component/indicator/indicator.js.map +1 -1
  129. package/esm/component/tooltip/constant.d.ts +2 -1
  130. package/esm/component/tooltip/constant.js +2 -0
  131. package/esm/component/tooltip/constant.js.map +1 -1
  132. package/esm/component/tooltip/interface/common.d.ts +3 -3
  133. package/esm/component/tooltip/interface/common.js.map +1 -1
  134. package/esm/component/tooltip/processor/base.d.ts +3 -4
  135. package/esm/component/tooltip/processor/base.js +7 -44
  136. package/esm/component/tooltip/processor/base.js.map +1 -1
  137. package/esm/component/tooltip/processor/dimension-tooltip.d.ts +2 -1
  138. package/esm/component/tooltip/processor/dimension-tooltip.js +43 -6
  139. package/esm/component/tooltip/processor/dimension-tooltip.js.map +1 -1
  140. package/esm/component/tooltip/processor/group-tooltip.d.ts +2 -3
  141. package/esm/component/tooltip/processor/group-tooltip.js +4 -13
  142. package/esm/component/tooltip/processor/group-tooltip.js.map +1 -1
  143. package/esm/component/tooltip/processor/interface.d.ts +0 -1
  144. package/esm/component/tooltip/processor/interface.js.map +1 -1
  145. package/esm/component/tooltip/processor/mark-tooltip.d.ts +2 -3
  146. package/esm/component/tooltip/processor/mark-tooltip.js +3 -14
  147. package/esm/component/tooltip/processor/mark-tooltip.js.map +1 -1
  148. package/esm/component/tooltip/tooltip-transformer.js +1 -1
  149. package/esm/component/tooltip/tooltip-transformer.js.map +1 -1
  150. package/esm/component/tooltip/tooltip.js +21 -23
  151. package/esm/component/tooltip/tooltip.js.map +1 -1
  152. package/esm/component/tooltip/utils/common.d.ts +3 -1
  153. package/esm/component/tooltip/utils/common.js +15 -1
  154. package/esm/component/tooltip/utils/common.js.map +1 -1
  155. package/esm/component/tooltip/utils/compose.js +2 -2
  156. package/esm/component/tooltip/utils/compose.js.map +1 -1
  157. package/esm/component/tooltip/utils/get-spec.js +61 -81
  158. package/esm/component/tooltip/utils/get-spec.js.map +1 -1
  159. package/esm/component/tooltip/utils/index.d.ts +0 -1
  160. package/esm/component/tooltip/utils/index.js +0 -2
  161. package/esm/component/tooltip/utils/index.js.map +1 -1
  162. package/esm/constant/correlation.js +1 -2
  163. package/esm/constant/layout.js +2 -1
  164. package/esm/core/index.d.ts +1 -1
  165. package/esm/core/index.js +1 -1
  166. package/esm/core/index.js.map +1 -1
  167. package/esm/event/events/dimension/util/cartesian.d.ts +1 -1
  168. package/esm/event/events/dimension/util/cartesian.js +6 -4
  169. package/esm/event/events/dimension/util/cartesian.js.map +1 -1
  170. package/esm/event/events/dimension/util/polar.js +3 -1
  171. package/esm/event/events/dimension/util/polar.js.map +1 -1
  172. package/esm/plugin/components/tooltip-handler/base.js +20 -57
  173. package/esm/plugin/components/tooltip-handler/base.js.map +1 -1
  174. package/esm/plugin/components/tooltip-handler/utils/position.d.ts +3 -4
  175. package/esm/plugin/components/tooltip-handler/utils/position.js +8 -11
  176. package/esm/plugin/components/tooltip-handler/utils/position.js.map +1 -1
  177. package/esm/scale/global-scale.js +1 -0
  178. package/esm/scale/global-scale.js.map +1 -1
  179. package/esm/series/bar/bar.js +1 -1
  180. package/esm/series/bar/bar.js.map +1 -1
  181. package/esm/series/base/tooltip-helper.d.ts +1 -3
  182. package/esm/series/base/tooltip-helper.js +4 -25
  183. package/esm/series/base/tooltip-helper.js.map +1 -1
  184. package/esm/series/dot/tooltip-helper.d.ts +0 -1
  185. package/esm/series/dot/tooltip-helper.js +3 -20
  186. package/esm/series/dot/tooltip-helper.js.map +1 -1
  187. package/esm/series/interface/series.d.ts +2 -0
  188. package/esm/series/interface/series.js.map +1 -1
  189. package/esm/series/pie/interface.d.ts +1 -1
  190. package/esm/series/pie/interface.js.map +1 -1
  191. package/esm/series/pie/pie-transformer.js +1 -1
  192. package/esm/series/pie/pie-transformer.js.map +1 -1
  193. package/esm/series/polar/polar.js.map +1 -1
  194. package/esm/series/sankey/interface.d.ts +1 -0
  195. package/esm/series/sankey/interface.js.map +1 -1
  196. package/esm/series/sankey/sankey.d.ts +1 -0
  197. package/esm/series/sankey/sankey.js +23 -13
  198. package/esm/series/sankey/sankey.js.map +1 -1
  199. package/package.json +14 -14
  200. package/build/es5/index.js +0 -15
  201. package/build/tsconfig.tsbuildinfo +0 -1
  202. package/cjs/component/tooltip/utils/pattern.d.ts +0 -4
  203. package/cjs/component/tooltip/utils/pattern.js +0 -13
  204. package/cjs/component/tooltip/utils/pattern.js.map +0 -1
  205. package/esm/component/tooltip/utils/pattern.d.ts +0 -4
  206. package/esm/component/tooltip/utils/pattern.js +0 -5
  207. package/esm/component/tooltip/utils/pattern.js.map +0 -1
package/build/index.js CHANGED
@@ -18,7 +18,7 @@
18
18
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
19
  PERFORMANCE OF THIS SOFTWARE.
20
20
  ***************************************************************************** */
21
- function __rest$d(s, e) {
21
+ function __rest$e(s, e) {
22
22
  var t = {};
23
23
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
24
24
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
@@ -11979,7 +11979,7 @@
11979
11979
  delta = this._duringTime + delta * this.timeScale - this._startTime, this._duringTime = this._startTime;
11980
11980
  }
11981
11981
  this.status === AnimateStatus.INITIAL && (this.status = AnimateStatus.RUNNING, this._onStart && this._onStart.forEach(cb => cb()));
11982
- this.setPosition(this.rawPosition + delta * this.timeScale) && this.status === AnimateStatus.RUNNING && (this.status = AnimateStatus.END, this._onEnd && this._onEnd.forEach(cb => cb()));
11982
+ this.setPosition(Math.max(this.rawPosition, 0) + delta * this.timeScale) && this.status === AnimateStatus.RUNNING && (this.status = AnimateStatus.END, this._onEnd && this._onEnd.forEach(cb => cb()));
11983
11983
  }
11984
11984
  setPosition(rawPosition) {
11985
11985
  let sa,
@@ -12102,7 +12102,7 @@
12102
12102
  end = !1;
12103
12103
  const startAt = null !== (_a = this._startAt) && void 0 !== _a ? _a : 0;
12104
12104
  if (rawPosition < 0 && (rawPosition = 0), rawPosition < startAt) return this.rawPosition = rawPosition, !1;
12105
- if (rawPosition -= startAt, d <= 0) return end = !0, end;
12105
+ if (rawPosition -= startAt, d <= 0 && (end = !0, d < 0)) return end;
12106
12106
  if (loop = Math.floor(rawPosition / d), position = rawPosition - loop * d, end = rawPosition >= loopCount * d + d, end && (position = d, loop = loopCount, rawPosition = position * loop + d), rawPosition === prevRawPos) return end;
12107
12107
  const rev = !this.reversed != !(this.bounce && loop % 2);
12108
12108
  return rev && (position = d - position), this._deltaPosition = position - this.position, this.position = position, this.rawPosition = rawPosition + startAt, this.updatePosition(end, rev), end;
@@ -13682,7 +13682,7 @@
13682
13682
  var _a;
13683
13683
  data.loadState = (null == res ? void 0 : res.data) ? "success" : "fail", data.data = null == res ? void 0 : res.data, null === (_a = data.waitingMark) || void 0 === _a || _a.map((mark, index) => {
13684
13684
  (null == res ? void 0 : res.data) ? (data.loadState = "success", data.data = res.data, mark.imageLoadSuccess(svgStr, res.data)) : (data.loadState = "fail", mark.imageLoadFail(svgStr));
13685
- });
13685
+ }), data.waitingMark && (data.waitingMark = []);
13686
13686
  })) : (data.loadState = "fail", mark.imageLoadFail(svgStr)));
13687
13687
  }
13688
13688
  static GetFile(url, type) {
@@ -13713,7 +13713,7 @@
13713
13713
  var _a;
13714
13714
  data.loadState = (null == res ? void 0 : res.data) ? "success" : "fail", data.data = null == res ? void 0 : res.data, null === (_a = data.waitingMark) || void 0 === _a || _a.map((mark, index) => {
13715
13715
  (null == res ? void 0 : res.data) ? (data.loadState = "success", data.data = res.data, mark.imageLoadSuccess(url, res.data)) : (data.loadState = "fail", mark.imageLoadFail(url));
13716
- });
13716
+ }), data.waitingMark && (data.waitingMark = []);
13717
13717
  });
13718
13718
  promises.push(end);
13719
13719
  } else data.loadState = "fail", marks.forEach(mark => mark.imageLoadFail(url));
@@ -23036,7 +23036,7 @@
23036
23036
  release() {
23037
23037
  super.release(), this.hooks.beforeRender.unTap("constructor", this.beforeRender), this.hooks.afterRender.unTap("constructor", this.afterRender), this.eventSystem && this.eventSystem.release(), this.layerService.releaseStage(this), this.pluginService.release(), this.forEach(layer => {
23038
23038
  layer.release();
23039
- }), this.interactiveLayer && this.interactiveLayer.release(), this.window.release(), this.ticker.remTimeline(this.timeline), this.renderService.renderTreeRoots = [];
23039
+ }), this.interactiveLayer && (this.interactiveLayer.release(), this.interactiveLayer.removeAllChild()), this.window.release(), this.ticker.remTimeline(this.timeline), this.renderService.renderTreeRoots = [];
23040
23040
  }
23041
23041
  setStage(stage) {}
23042
23042
  dirty(b, matrix) {
@@ -24894,7 +24894,9 @@
24894
24894
  const bctx = vglobal.createCanvas({
24895
24895
  width: 1,
24896
24896
  height: 1
24897
- }).getContext("2d");
24897
+ }).getContext("2d", {
24898
+ willReadFrequently: !0
24899
+ });
24898
24900
  bctx.fillStyle = backgroundColor, bctx.fillRect(0, 0, 1, 1);
24899
24901
  const bgPixel = bctx.getImageData(0, 0, 1, 1).data;
24900
24902
  return (imageData, y, x) => {
@@ -24911,7 +24913,9 @@
24911
24913
  height: height,
24912
24914
  dpr: 1
24913
24915
  }),
24914
- tempContext = maskCanvas.getContext("2d");
24916
+ tempContext = maskCanvas.getContext("2d", {
24917
+ willReadFrequently: !0
24918
+ });
24915
24919
  if (cacheCanvas) {
24916
24920
  const prevWidth = cacheCanvas.width,
24917
24921
  prevHeight = cacheCanvas.height;
@@ -30435,7 +30439,7 @@
30435
30439
  registerGroup(), registerRect(), registerSymbol(), registerRichtext(), registerText();
30436
30440
  }
30437
30441
 
30438
- var __rest$c = undefined && undefined.__rest || function (s, e) {
30442
+ var __rest$d = undefined && undefined.__rest || function (s, e) {
30439
30443
  var t = {};
30440
30444
  for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
30441
30445
  if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
@@ -30453,10 +30457,11 @@
30453
30457
  return this._textShape;
30454
30458
  }
30455
30459
  constructor(attributes, options) {
30456
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, Tag.defaultAttributes, attributes)), this.name = "tag";
30460
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, Tag.defaultAttributes, attributes)), this.name = "tag", this._tagStates = [], this._rectStates = [], this._symbolStates = [], this._textStates = [];
30457
30461
  }
30458
30462
  render() {
30459
30463
  var _a, _b, _c;
30464
+ this.cacheStates();
30460
30465
  const {
30461
30466
  text = "",
30462
30467
  textStyle = {},
@@ -30486,7 +30491,7 @@
30486
30491
  const {
30487
30492
  visible: shapeVisible
30488
30493
  } = shape,
30489
- shapeStyle = __rest$c(shape, ["visible"]);
30494
+ shapeStyle = __rest$d(shape, ["visible"]);
30490
30495
  if (isBoolean$1(shapeVisible)) {
30491
30496
  const size = (null == shapeStyle ? void 0 : shapeStyle.size) || 10,
30492
30497
  maxSize = isNumber$1(size) ? size : Math.max(size[0], size[1]);
@@ -30517,7 +30522,7 @@
30517
30522
  const {
30518
30523
  visible: bgVisible
30519
30524
  } = panel,
30520
- backgroundStyle = __rest$c(panel, ["visible"]);
30525
+ backgroundStyle = __rest$d(panel, ["visible"]);
30521
30526
  if (visible && isBoolean$1(bgVisible)) {
30522
30527
  const bgRect = this.createOrUpdateChild("tag-panel", Object.assign(Object.assign({}, backgroundStyle), {
30523
30528
  visible: bgVisible && !!text,
@@ -30605,7 +30610,7 @@
30605
30610
  const {
30606
30611
  visible: bgVisible
30607
30612
  } = panel,
30608
- backgroundStyle = __rest$c(panel, ["visible"]);
30613
+ backgroundStyle = __rest$d(panel, ["visible"]);
30609
30614
  if (visible && isBoolean$1(bgVisible)) {
30610
30615
  const bgRect = this.createOrUpdateChild("tag-panel", Object.assign(Object.assign({}, backgroundStyle), {
30611
30616
  visible: bgVisible && !!text,
@@ -30621,7 +30626,24 @@
30621
30626
  this._bgRect = bgRect;
30622
30627
  }
30623
30628
  }
30624
- this._textShape = textShape;
30629
+ this._textShape = textShape, this._symbol = symbol, this.resetStates();
30630
+ }
30631
+ initAttributes(params, options) {
30632
+ params = (null == options ? void 0 : options.skipDefault) ? params : merge$2({}, Tag.defaultAttributes, params), super.initAttributes(params), this.render();
30633
+ }
30634
+ addState(stateName, keepCurrentStates, hasAnimation) {
30635
+ super.addState(stateName, keepCurrentStates, hasAnimation), this._textShape && this._textShape.addState(stateName, keepCurrentStates, hasAnimation), this._bgRect && this._bgRect.addState(stateName, keepCurrentStates, hasAnimation), this._symbol && this._symbol.addState(stateName, keepCurrentStates, hasAnimation);
30636
+ }
30637
+ removeState(stateName, hasAnimation) {
30638
+ super.removeState(stateName, hasAnimation), this._textShape && this._textShape.removeState(stateName, hasAnimation), this._bgRect && this._bgRect.removeState(stateName, hasAnimation), this._symbol && this._symbol.removeState(stateName, hasAnimation);
30639
+ }
30640
+ cacheStates() {
30641
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
30642
+ this._tagStates = null !== (_b = null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.slice()) && void 0 !== _b ? _b : [], this._rectStates = null !== (_e = null === (_d = null === (_c = this._bgRect) || void 0 === _c ? void 0 : _c.currentStates) || void 0 === _d ? void 0 : _d.slice()) && void 0 !== _e ? _e : [], this._symbolStates = null !== (_h = null === (_g = null === (_f = this._symbol) || void 0 === _f ? void 0 : _f.currentStates) || void 0 === _g ? void 0 : _g.slice()) && void 0 !== _h ? _h : [], this._textStates = null !== (_l = null === (_k = null === (_j = this._textShape) || void 0 === _j ? void 0 : _j.currentStates) || void 0 === _k ? void 0 : _k.slice()) && void 0 !== _l ? _l : [], this.clearStates(), null === (_m = this._bgRect) || void 0 === _m || _m.clearStates(), null === (_o = this._symbol) || void 0 === _o || _o.clearStates(), null === (_p = this._textShape) || void 0 === _p || _p.clearStates();
30643
+ }
30644
+ resetStates() {
30645
+ var _a, _b, _c;
30646
+ this._tagStates.length && this.useStates(this._tagStates), this._rectStates.length && (null === (_a = this._bgRect) || void 0 === _a || _a.useStates(this._rectStates)), this._symbolStates.length && (null === (_b = this._symbol) || void 0 === _b || _b.useStates(this._symbolStates)), this._textStates.length && (null === (_c = this._textShape) || void 0 === _c || _c.useStates(this._textStates));
30625
30647
  }
30626
30648
  }
30627
30649
  Tag.defaultAttributes = {
@@ -30671,7 +30693,7 @@
30671
30693
  merge$2(theme.poptip, DEFAULT_THEME, defaultPoptipTheme);
30672
30694
  }
30673
30695
 
30674
- var __rest$b = undefined && undefined.__rest || function (s, e) {
30696
+ var __rest$c = undefined && undefined.__rest || function (s, e) {
30675
30697
  var t = {};
30676
30698
  for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
30677
30699
  if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
@@ -30758,7 +30780,7 @@
30758
30780
  const {
30759
30781
  visible: bgVisible
30760
30782
  } = panel,
30761
- backgroundStyle = __rest$b(panel, ["visible"]),
30783
+ backgroundStyle = __rest$c(panel, ["visible"]),
30762
30784
  symbolSize = null !== (_a = backgroundStyle.size) && void 0 !== _a ? _a : 12,
30763
30785
  spaceSize = isArray$1(symbolSize) ? [symbolSize[0] + (null !== (_b = backgroundStyle.space) && void 0 !== _b ? _b : 0), symbolSize[1] + (null !== (_c = backgroundStyle.space) && void 0 !== _c ? _c : 0)] : symbolSize + (null !== (_d = backgroundStyle.space) && void 0 !== _d ? _d : 0),
30764
30786
  lineWidth = null !== (_e = backgroundStyle.lineWidth) && void 0 !== _e ? _e : 1,
@@ -31769,7 +31791,7 @@
31769
31791
  registerGroup(), registerText(), registerRichtext(), registerLine();
31770
31792
  }
31771
31793
 
31772
- var __rest$a = undefined && undefined.__rest || function (s, e) {
31794
+ var __rest$b = undefined && undefined.__rest || function (s, e) {
31773
31795
  var t = {};
31774
31796
  for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
31775
31797
  if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
@@ -31790,7 +31812,7 @@
31790
31812
  const {
31791
31813
  data: data
31792
31814
  } = attributes,
31793
- restAttributes = __rest$a(attributes, ["data"]);
31815
+ restAttributes = __rest$b(attributes, ["data"]);
31794
31816
  super((null == options ? void 0 : options.skipDefault) ? attributes : Object.assign({
31795
31817
  data: data
31796
31818
  }, merge$2({}, LabelBase.defaultAttributes, restAttributes))), this.name = "label", this._onHover = e => {
@@ -32319,7 +32341,7 @@
32319
32341
  };
32320
32342
  const getLabelComponent = type => labelComponentMap[type];
32321
32343
 
32322
- var __rest$9 = undefined && undefined.__rest || function (s, e) {
32344
+ var __rest$a = undefined && undefined.__rest || function (s, e) {
32323
32345
  var t = {};
32324
32346
  for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
32325
32347
  if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
@@ -32333,7 +32355,7 @@
32333
32355
  const {
32334
32356
  data: data
32335
32357
  } = attributes,
32336
- restAttributes = __rest$9(attributes, ["data"]);
32358
+ restAttributes = __rest$a(attributes, ["data"]);
32337
32359
  super((null == options ? void 0 : options.skipDefault) ? attributes : Object.assign({
32338
32360
  data: data
32339
32361
  }, merge$2({}, SymbolLabel.defaultAttributes, restAttributes))), this.name = "symbol-label";
@@ -32355,7 +32377,7 @@
32355
32377
  registerLabelComponent("symbol", SymbolLabel), registerLabelComponent("line-data", SymbolLabel);
32356
32378
  };
32357
32379
 
32358
- var __rest$8 = undefined && undefined.__rest || function (s, e) {
32380
+ var __rest$9 = undefined && undefined.__rest || function (s, e) {
32359
32381
  var t = {};
32360
32382
  for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
32361
32383
  if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
@@ -32369,7 +32391,7 @@
32369
32391
  const {
32370
32392
  data: data
32371
32393
  } = attributes,
32372
- restAttributes = __rest$8(attributes, ["data"]);
32394
+ restAttributes = __rest$9(attributes, ["data"]);
32373
32395
  super((null == options ? void 0 : options.skipDefault) ? attributes : Object.assign({
32374
32396
  data: data
32375
32397
  }, merge$2({}, RectLabel.defaultAttributes, restAttributes)));
@@ -32419,7 +32441,7 @@
32419
32441
  registerLabelComponent("rect", RectLabel);
32420
32442
  };
32421
32443
 
32422
- var __rest$7 = undefined && undefined.__rest || function (s, e) {
32444
+ var __rest$8 = undefined && undefined.__rest || function (s, e) {
32423
32445
  var t = {};
32424
32446
  for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
32425
32447
  if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
@@ -32433,7 +32455,7 @@
32433
32455
  const {
32434
32456
  data: data
32435
32457
  } = attributes,
32436
- restAttributes = __rest$7(attributes, ["data"]);
32458
+ restAttributes = __rest$8(attributes, ["data"]);
32437
32459
  super((null == options ? void 0 : options.skipDefault) ? attributes : Object.assign({
32438
32460
  data: data
32439
32461
  }, merge$2({}, LineLabel.defaultAttributes, restAttributes))), this.name = "line-label";
@@ -32473,7 +32495,7 @@
32473
32495
  registerLabelComponent("line", LineLabel$1), registerLabelComponent("area", LineLabel$1);
32474
32496
  };
32475
32497
 
32476
- var __rest$6 = undefined && undefined.__rest || function (s, e) {
32498
+ var __rest$7 = undefined && undefined.__rest || function (s, e) {
32477
32499
  var t = {};
32478
32500
  for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
32479
32501
  if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
@@ -32505,7 +32527,7 @@
32505
32527
  const {
32506
32528
  data: data
32507
32529
  } = attributes,
32508
- restAttributes = __rest$6(attributes, ["data"]);
32530
+ restAttributes = __rest$7(attributes, ["data"]);
32509
32531
  super((null == options ? void 0 : options.skipDefault) ? attributes : Object.assign({
32510
32532
  data: data
32511
32533
  }, merge$2({}, ArcLabel.defaultAttributes, restAttributes))), this.name = "arc-label", this._ellipsisWidth = 0, this._arcLeft = new Map(), this._arcRight = new Map();
@@ -32594,6 +32616,7 @@
32594
32616
  case "inside":
32595
32617
  case "inside-inner":
32596
32618
  case "inside-outer":
32619
+ case "inside-center":
32597
32620
  arcs.push(...this._layoutInsideLabels(rightArcs, attribute, currentMarks)), arcs.push(...this._layoutInsideLabels(leftArcs, attribute, currentMarks));
32598
32621
  break;
32599
32622
  default:
@@ -32627,7 +32650,7 @@
32627
32650
  align = this._computeAlign(arc, attribute);
32628
32651
  let labelRadius,
32629
32652
  alignOffset = 0;
32630
- if ("inside" === position && (alignOffset = "left" === align ? labelWidth : "right" === align ? 0 : labelWidth / 2), labelRadius = "inside-inner" === position ? innerRadius - offsetRadius + alignOffset : outerRadius + offsetRadius - alignOffset, arc.labelPosition = polarToCartesian(arc.circleCenter, labelRadius, arc.middleAngle), arc.labelLimit = labelWidth, isGreater(labelWidth, 0) || (arc.labelVisible = !1), !1 !== labelConfig.rotate) {
32653
+ if ("inside" === position && (alignOffset = "left" === align ? labelWidth : "right" === align ? 0 : labelWidth / 2), labelRadius = "inside-inner" === position ? innerRadius - offsetRadius + alignOffset : "inside-center" === position ? innerRadius + (outerRadius - innerRadius) / 2 : outerRadius + offsetRadius - alignOffset, arc.labelPosition = polarToCartesian(arc.circleCenter, labelRadius, arc.middleAngle), arc.labelLimit = labelWidth, isGreater(labelWidth, 0) || (arc.labelVisible = !1), !1 !== labelConfig.rotate) {
32631
32654
  arc.angle = null !== (_b = null === (_a = attribute.textStyle) || void 0 === _a ? void 0 : _a.angle) && void 0 !== _b ? _b : arc.middleAngle;
32632
32655
  let offsetAngle = null !== (_c = labelConfig.offsetAngle) && void 0 !== _c ? _c : 0;
32633
32656
  ["inside-inner", "inside-outer"].includes(position) && (offsetAngle += Math.PI / 2), arc.angle += offsetAngle;
@@ -32997,7 +33020,7 @@
32997
33020
  return Math.min(width / 2, height / 2);
32998
33021
  }
32999
33022
  _canPlaceInside(textBound, shapeBound) {
33000
- return "inside" === this.attribute.position;
33023
+ return "inside" === this.attribute.position || "inside-center" === this.attribute.position;
33001
33024
  }
33002
33025
  computeLayoutOuterRadius(r, width, height) {
33003
33026
  return r / (Math.min(width, height) / 2);
@@ -33035,7 +33058,7 @@
33035
33058
  registerLabelComponent("arc", ArcLabel);
33036
33059
  };
33037
33060
 
33038
- var __rest$5 = undefined && undefined.__rest || function (s, e) {
33061
+ var __rest$6 = undefined && undefined.__rest || function (s, e) {
33039
33062
  var t = {};
33040
33063
  for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
33041
33064
  if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
@@ -33049,7 +33072,7 @@
33049
33072
  const {
33050
33073
  dataLabels: dataLabels
33051
33074
  } = attributes,
33052
- restAttributes = __rest$5(attributes, ["dataLabels"]);
33075
+ restAttributes = __rest$6(attributes, ["dataLabels"]);
33053
33076
  super((null == options ? void 0 : options.skipDefault) ? attributes : Object.assign({
33054
33077
  dataLabels: dataLabels
33055
33078
  }, merge$2({}, DataLabel.defaultAttributes, restAttributes))), this.name = "data-label";
@@ -33470,12 +33493,13 @@
33470
33493
  let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
33471
33494
  var _a, _b;
33472
33495
  const {
33473
- style = {}
33496
+ style = {},
33497
+ angle = .5 * Math.PI
33474
33498
  } = props,
33475
33499
  symbolStyle = merge$2({}, DEFAULT_AXIS_BREAK_SYMBOL_STYLE, style),
33476
33500
  symbolSize = null !== (_a = symbolStyle.size) && void 0 !== _a ? _a : DEFAULT_AXIS_BREAK_SYMBOL_STYLE.size;
33477
33501
  return Object.assign(Object.assign({}, symbolStyle), {
33478
- symbolType: null !== (_b = symbolStyle.symbolType) && void 0 !== _b ? _b : `M ${-symbolSize / 2} ${symbolSize / 6} L ${symbolSize / 2} ${-symbolSize / 6}`,
33502
+ symbolType: null !== (_b = symbolStyle.symbolType) && void 0 !== _b ? _b : `M ${-symbolSize / 2} ${symbolSize * Math.sin(angle)} L ${symbolSize / 2} ${-symbolSize * Math.sin(angle)}`,
33479
33503
  symbolSize: symbolSize
33480
33504
  });
33481
33505
  }
@@ -34135,7 +34159,7 @@
34135
34159
  registerGroup(), registerPath();
34136
34160
  }
34137
34161
 
34138
- var __rest$4 = undefined && undefined.__rest || function (s, e) {
34162
+ var __rest$5 = undefined && undefined.__rest || function (s, e) {
34139
34163
  var t = {};
34140
34164
  for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
34141
34165
  if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
@@ -34223,7 +34247,7 @@
34223
34247
  style: style,
34224
34248
  state: state
34225
34249
  } = _a,
34226
- restLineAttrs = __rest$4(_a, ["startSymbol", "endSymbol", "style", "state"]),
34250
+ restLineAttrs = __rest$5(_a, ["startSymbol", "endSymbol", "style", "state"]),
34227
34251
  lineAttrs = Object.assign({
34228
34252
  startSymbol: startSymbol,
34229
34253
  endSymbol: endSymbol,
@@ -34260,7 +34284,7 @@
34260
34284
  state = {},
34261
34285
  maxWidth: maxWidth
34262
34286
  } = _d,
34263
- restAttrs = __rest$4(_d, ["position", "space", "textStyle", "autoRotate", "shape", "background", "state", "maxWidth"]);
34287
+ restAttrs = __rest$5(_d, ["position", "space", "textStyle", "autoRotate", "shape", "background", "state", "maxWidth"]);
34264
34288
  let percent = .5;
34265
34289
  "start" === position ? percent = 0 : "end" === position && (percent = 1);
34266
34290
  const {
@@ -34556,7 +34580,7 @@
34556
34580
  }
34557
34581
  }
34558
34582
 
34559
- var __rest$3 = undefined && undefined.__rest || function (s, e) {
34583
+ var __rest$4 = undefined && undefined.__rest || function (s, e) {
34560
34584
  var t = {};
34561
34585
  for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
34562
34586
  if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
@@ -34615,7 +34639,7 @@
34615
34639
  background: background,
34616
34640
  state = {}
34617
34641
  } = _d,
34618
- restAttrs = __rest$3(_d, ["space", "textStyle", "shape", "background", "state"]);
34642
+ restAttrs = __rest$4(_d, ["space", "textStyle", "shape", "background", "state"]);
34619
34643
  let titlePoint = center,
34620
34644
  labelHeight = 0;
34621
34645
  (null === (_a = this.attribute.label) || void 0 === _a ? void 0 : _a.visible) && !1 === this.attribute.label.inside && (labelHeight = get$1(this.attribute.label, "style.fontSize", 12) + get$1(this.attribute.label, "space", 4));
@@ -35847,13 +35871,14 @@
35847
35871
  const {
35848
35872
  breakData: breakData
35849
35873
  } = op;
35850
- if (breakData) {
35874
+ if (breakData && breakData()) {
35851
35875
  const {
35852
- range: breakRanges
35876
+ range: breakRanges,
35877
+ scope: scope
35853
35878
  } = breakData(),
35854
35879
  domain = scale.domain();
35855
35880
  scaleTicks = [];
35856
- for (let i = 0; i < domain.length; i++) if (i < domain.length - 1) {
35881
+ for (let i = 0; i < domain.length - 1; i++) {
35857
35882
  getTicks(count, [domain[i], domain[i + 1]]).forEach(tick => {
35858
35883
  breakRanges.some(breakRange => tick >= breakRange[0] && tick <= breakRange[1]) || scaleTicks.push(tick);
35859
35884
  });
@@ -35910,7 +35935,7 @@
35910
35935
  AABBBounds: bounds,
35911
35936
  value: scaleTicks[i]
35912
35937
  }));
35913
- const samplingMethod = breakData ? methods$1.greedy : methods$1.parity;
35938
+ const samplingMethod = breakData && breakData() ? methods$1.greedy : methods$1.parity;
35914
35939
  for (; items.length >= 3 && hasOverlap$1(items, labelGap);) items = samplingMethod(items, labelGap);
35915
35940
  const ticks = items.map(item => item.value);
35916
35941
  ticks.length < 3 && labelFlush && (ticks.length > 1 && ticks.pop(), last(ticks) !== last(scaleTicks) && ticks.push(last(scaleTicks))), scaleTicks = ticks;
@@ -36409,7 +36434,7 @@
36409
36434
  }
36410
36435
  mixin(LineAxisGrid, LineAxisMixin);
36411
36436
 
36412
- var __rest$2 = undefined && undefined.__rest || function (s, e) {
36437
+ var __rest$3 = undefined && undefined.__rest || function (s, e) {
36413
36438
  var t = {};
36414
36439
  for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
36415
36440
  if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
@@ -36435,7 +36460,7 @@
36435
36460
  center: center,
36436
36461
  subGrid: subGrid
36437
36462
  } = _a,
36438
- grid = __rest$2(_a, ["radius", "innerRadius", "startAngle", "endAngle", "center", "subGrid"]),
36463
+ grid = __rest$3(_a, ["radius", "innerRadius", "startAngle", "endAngle", "center", "subGrid"]),
36439
36464
  {
36440
36465
  alignWithLabel = !0
36441
36466
  } = grid || {},
@@ -36628,7 +36653,7 @@
36628
36653
  loadTagComponent(), registerRect(), registerSymbol(), registerArea(), registerLine();
36629
36654
  }
36630
36655
 
36631
- var __rest$1 = undefined && undefined.__rest || function (s, e) {
36656
+ var __rest$2 = undefined && undefined.__rest || function (s, e) {
36632
36657
  var t = {};
36633
36658
  for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
36634
36659
  if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
@@ -36837,11 +36862,11 @@
36837
36862
  {
36838
36863
  formatMethod: startTextFormat
36839
36864
  } = startTextStyle,
36840
- restStartTextStyle = __rest$1(startTextStyle, ["formatMethod"]),
36865
+ restStartTextStyle = __rest$2(startTextStyle, ["formatMethod"]),
36841
36866
  {
36842
36867
  formatMethod: endTextFormat
36843
36868
  } = endTextStyle,
36844
- restEndTextStyle = __rest$1(endTextStyle, ["formatMethod"]),
36869
+ restEndTextStyle = __rest$2(endTextStyle, ["formatMethod"]),
36845
36870
  {
36846
36871
  start: start,
36847
36872
  end: end
@@ -39347,7 +39372,7 @@
39347
39372
  loadBaseLegend(), loadSliderComponent(), registerPath();
39348
39373
  }
39349
39374
 
39350
- var __rest = undefined && undefined.__rest || function (s, e) {
39375
+ var __rest$1 = undefined && undefined.__rest || function (s, e) {
39351
39376
  var t = {};
39352
39377
  for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
39353
39378
  if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
@@ -39797,7 +39822,7 @@
39797
39822
  space: pagerSpace = DEFAULT_PAGER_SPACE,
39798
39823
  defaultCurrent = 1
39799
39824
  } = pager,
39800
- compStyle = __rest(pager, ["space", "defaultCurrent"]),
39825
+ compStyle = __rest$1(pager, ["space", "defaultCurrent"]),
39801
39826
  {
39802
39827
  isHorizontal: isHorizontal
39803
39828
  } = this._itemContext;
@@ -39865,7 +39890,7 @@
39865
39890
  space: pagerSpace = DEFAULT_PAGER_SPACE,
39866
39891
  defaultCurrent = 1
39867
39892
  } = pager,
39868
- compStyle = __rest(pager, ["space", "defaultCurrent"]),
39893
+ compStyle = __rest$1(pager, ["space", "defaultCurrent"]),
39869
39894
  {
39870
39895
  isHorizontal: isHorizontal
39871
39896
  } = this._itemContext;
@@ -48866,6 +48891,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
48866
48891
  isProgressive() {
48867
48892
  return this.renderContext && (!!this.renderContext.progressive || !!this.renderContext.beforeTransformProgressive);
48868
48893
  }
48894
+ canAnimateAfterProgressive() {
48895
+ return this.renderContext && this.renderContext.beforeTransformProgressive && this.renderContext.beforeTransformProgressive.canAnimate();
48896
+ }
48869
48897
  isDoingProgressive() {
48870
48898
  return this.renderContext && (this.renderContext.progressive && this.renderContext.progressive.currentIndex < this.renderContext.progressive.totalStep || this.renderContext.beforeTransformProgressive && this.renderContext.beforeTransformProgressive.unfinished());
48871
48899
  }
@@ -50466,10 +50494,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
50466
50494
  var _b;
50467
50495
  const matched = 1 === diff.prev.length && 1 === diff.next.length && diff.prev[0].markType === diff.next[0].markType,
50468
50496
  enableMarkMorphConfig = diff.prev.every(mark => mark.getMorphConfig().morph) && diff.next.every(mark => mark.getMorphConfig().morph);
50469
- matched && runningConfig.reuse ? (diff.next[0].reuse(diff.prev[0]), diff.prev[0].detachAll(), diff.prev[0].clear(), this._cachedGrammars.unrecord(diff.prev[0])) : (runningConfig.morph && enableMarkMorphConfig || runningConfig.morphAll) && (null === (_b = this.addMorphMarks) || void 0 === _b || _b.call(this, {
50497
+ runningConfig.morph && enableMarkMorphConfig || runningConfig.morphAll ? null === (_b = this.addMorphMarks) || void 0 === _b || _b.call(this, {
50470
50498
  prev: diff.prev,
50471
50499
  next: diff.next
50472
- }));
50500
+ }) : matched && runningConfig.reuse && (diff.next[0].reuse(diff.prev[0]), diff.prev[0].detachAll(), diff.prev[0].clear(), this._cachedGrammars.unrecord(diff.prev[0]));
50473
50501
  });
50474
50502
  }
50475
50503
  detachCachedGrammar() {
@@ -50646,7 +50674,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
50646
50674
  if (this._progressiveMarks && this._progressiveMarks.some(mark => mark.isDoingProgressive())) {
50647
50675
  const raf = vglobal.getRequestAnimationFrame();
50648
50676
  this._progressiveRafId = raf(this.handleProgressiveFrame);
50649
- }
50677
+ } else this._progressiveMarks && this._progressiveMarks.every(mark => mark.canAnimateAfterProgressive()) ? this.animate.animate() : this._progressiveMarks && (this._progressiveMarks = null);
50650
50678
  }
50651
50679
  clearProgressive() {
50652
50680
  if (this._progressiveRafId) {
@@ -51884,6 +51912,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
51884
51912
  Factory.registerGraphicComponent(AxisEnum.circleAxis, attrs => new CircleAxis(attrs)), Factory.registerComponent(ComponentEnum.axis, Axis);
51885
51913
  };
51886
51914
 
51915
+ var __rest = undefined && undefined.__rest || function (s, e) {
51916
+ var t = {};
51917
+ for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
51918
+ if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
51919
+ var i = 0;
51920
+ for (p = Object.getOwnPropertySymbols(s); i < p.length; i++) e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]) && (t[p[i]] = s[p[i]]);
51921
+ }
51922
+ return t;
51923
+ };
51887
51924
  const generateLabelAttributes = function (marks, groupSize, encoder, labelStyle, parameters) {
51888
51925
  let theme = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
51889
51926
  var _a;
@@ -51924,34 +51961,44 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
51924
51961
  }
51925
51962
  const data = null !== (_b = addition.data) && void 0 !== _b ? _b : [],
51926
51963
  themeDatum = null !== (_d = null === (_c = null == currentTheme ? void 0 : currentTheme.data) || void 0 === _c ? void 0 : _c[0]) && void 0 !== _d ? _d : {};
51927
- data && data.length > 0 ? data.forEach((d, index) => {
51964
+ if (data && data.length > 0) data.forEach((d, index) => {
51928
51965
  if (mark.elements[index]) {
51929
51966
  const attributes = invokeEncoder(encoder, d, mark.elements[index], labelParameters);
51930
51967
  merge$2(d, themeDatum, attributes);
51931
51968
  }
51932
- }) : mark.elements.forEach(element => {
51933
- if ("willRelease" !== element.getGraphicItem().releaseStatus) if (mark.isCollectionMark()) {
51934
- element.getDatum().forEach(entry => {
51935
- const attributes = invokeEncoder(encoder, entry, element, labelParameters);
51936
- data.push(merge$2({}, themeDatum, attributes));
51969
+ });else {
51970
+ const mergeAttributes = (attributes, themeDatum) => {
51971
+ const {
51972
+ data: labelData
51973
+ } = attributes,
51974
+ restAttribute = __rest(attributes, ["data"]);
51975
+ return Object.assign(Object.assign({}, merge$2({}, themeDatum, restAttribute)), {
51976
+ data: labelData
51937
51977
  });
51938
- } else {
51939
- const attributes = invokeEncoder(encoder, element.getDatum(), element, labelParameters),
51940
- datum = merge$2({}, themeDatum, attributes);
51941
- data.push(datum);
51942
- }
51943
- });
51944
- const graphicItemName = null === (_e = mark.graphicItem) || void 0 === _e ? void 0 : _e.name;
51945
- return merge$2({}, currentTheme, {
51946
- data: data,
51947
- baseMarkGroupName: graphicItemName,
51948
- getBaseMarks: () => mark.elements.map(element => element.getGraphicItem())
51949
- }, null != addition ? addition : {});
51950
- }).filter(label => !isNil$1(label));
51951
- return merge$2({}, labelTheme, {
51952
- size: groupSize,
51953
- dataLabels: dataLabels
51954
- });
51978
+ };
51979
+ mark.elements.forEach(element => {
51980
+ if ("willRelease" !== element.getGraphicItem().releaseStatus) if (mark.isCollectionMark()) {
51981
+ element.getDatum().forEach(entry => {
51982
+ const attributes = invokeEncoder(encoder, entry, element, labelParameters);
51983
+ data.push(mergeAttributes(attributes, themeDatum));
51984
+ });
51985
+ } else {
51986
+ const attributes = invokeEncoder(encoder, element.getDatum(), element, labelParameters);
51987
+ data.push(mergeAttributes(attributes, themeDatum));
51988
+ }
51989
+ });
51990
+ }
51991
+ const graphicItemName = null === (_e = mark.graphicItem) || void 0 === _e ? void 0 : _e.name,
51992
+ result = merge$2({}, currentTheme, {
51993
+ baseMarkGroupName: graphicItemName,
51994
+ getBaseMarks: () => mark.elements.map(element => element.getGraphicItem())
51995
+ }, null != addition ? addition : {});
51996
+ return result.data = null != data ? data : currentTheme.data, result;
51997
+ }).filter(label => !isNil$1(label)),
51998
+ result = merge$2({}, labelTheme, {
51999
+ size: groupSize
52000
+ });
52001
+ return result.dataLabels = dataLabels, result;
51955
52002
  };
51956
52003
  let Label$1 = class Label extends Component {
51957
52004
  constructor(view, group) {
@@ -54392,11 +54439,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
54392
54439
  if (!chart) {
54393
54440
  return null;
54394
54441
  }
54395
- const { x, y } = pos;
54396
54442
  const angleAxisList = getAxis(chart, (cmp) => cmp.getOrient() === 'angle', pos);
54397
54443
  const radiusAxisList = getAxis(chart, (cmp) => cmp.getOrient() === 'radius', pos);
54444
+ if ((!angleAxisList || !angleAxisList.length) && (!radiusAxisList || !radiusAxisList.length)) {
54445
+ return null;
54446
+ }
54398
54447
  const targetAxisInfo = [];
54399
54448
  const getDimensionField = (series) => series.getDimensionField()[0];
54449
+ const { x, y } = pos;
54400
54450
  if (angleAxisList) {
54401
54451
  angleAxisList.forEach(axis => {
54402
54452
  var _a;
@@ -54539,6 +54589,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
54539
54589
  const { x, y } = pos;
54540
54590
  const xAxisList = (_a = getAxis(chart, (cmp) => isXAxis(cmp.getOrient()), pos)) !== null && _a !== void 0 ? _a : [];
54541
54591
  const yAxisList = (_b = getAxis(chart, (cmp) => isYAxis(cmp.getOrient()), pos)) !== null && _b !== void 0 ? _b : [];
54592
+ if (!xAxisList.length && !yAxisList.length) {
54593
+ return null;
54594
+ }
54542
54595
  const bandAxisSet = new Set();
54543
54596
  const linearAxisSet = new Set();
54544
54597
  const forceAxisSet = new Set();
@@ -54562,14 +54615,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
54562
54615
  axisList.forEach(axis => {
54563
54616
  if (forceAxisSet.size > 0) {
54564
54617
  if (forceAxisSet.has(axis)) {
54565
- const info = getDimensionInfoByPosition(axis, posValue, orient, getDimensionFieldFunc(isXAxis, isDiscrete(axis.getScale().type)));
54618
+ const info = getDimensionInfoByPosition(axis, posValue, getDimensionFieldFunc(isXAxis, isDiscrete(axis.getScale().type)));
54566
54619
  info && targetAxisInfo.push(info);
54567
54620
  }
54568
54621
  }
54569
54622
  else {
54570
54623
  const hasDiscreteAxis = bandAxisSet.size > 0;
54571
54624
  if ((hasDiscreteAxis ? bandAxisSet : linearAxisSet).has(axis)) {
54572
- const info = getDimensionInfoByPosition(axis, posValue, orient, getDimensionFieldFunc(isXAxis, hasDiscreteAxis));
54625
+ const info = getDimensionInfoByPosition(axis, posValue, getDimensionFieldFunc(isXAxis, hasDiscreteAxis));
54573
54626
  info && targetAxisInfo.push(info);
54574
54627
  }
54575
54628
  }
@@ -54592,7 +54645,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
54592
54645
  }
54593
54646
  return targetAxisInfo;
54594
54647
  };
54595
- const getDimensionInfoByPosition = (axis, posValue, posKey, getDimensionField) => {
54648
+ const getDimensionInfoByPosition = (axis, posValue, getDimensionField) => {
54596
54649
  const value = axis.positionToData(posValue, true);
54597
54650
  return isNil$1(value) ? null : getDimensionInfoByValue(axis, value, getDimensionField);
54598
54651
  };
@@ -58873,7 +58926,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
58873
58926
  this._product.encode(updateStyles, true);
58874
58927
  }
58875
58928
  _separateStyle() {
58876
- const _a = this.stateStyle, _b = STATE_VALUE_ENUM.STATE_NORMAL, normalStyle = _a[_b]; __rest$d(_a, [typeof _b === "symbol" ? _b : _b + ""]);
58929
+ const _a = this.stateStyle, _b = STATE_VALUE_ENUM.STATE_NORMAL, normalStyle = _a[_b]; __rest$e(_a, [typeof _b === "symbol" ? _b : _b + ""]);
58877
58930
  const enterStyles = this._option.noSeparateStyle ? null : {};
58878
58931
  const updateStyles = {};
58879
58932
  Object.keys(normalStyle).forEach(key => {
@@ -58893,7 +58946,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
58893
58946
  return { enterStyles, updateStyles };
58894
58947
  }
58895
58948
  compileEncode() {
58896
- const _a = this.stateStyle, _b = STATE_VALUE_ENUM.STATE_NORMAL; _a[_b]; const temp = __rest$d(_a, [typeof _b === "symbol" ? _b : _b + ""]);
58949
+ const _a = this.stateStyle, _b = STATE_VALUE_ENUM.STATE_NORMAL; _a[_b]; const temp = __rest$e(_a, [typeof _b === "symbol" ? _b : _b + ""]);
58897
58950
  const { enterStyles, updateStyles } = this._separateStyle();
58898
58951
  this._product.encode(updateStyles, true);
58899
58952
  this._product.encodeState('group', enterStyles, true);
@@ -59338,7 +59391,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
59338
59391
  }
59339
59392
  _computeGradientAttr(gradientStyle) {
59340
59393
  var _a, _b;
59341
- const { gradient, scale, field } = gradientStyle, rest = __rest$d(gradientStyle, ["gradient", "scale", "field"]);
59394
+ const { gradient, scale, field } = gradientStyle, rest = __rest$e(gradientStyle, ["gradient", "scale", "field"]);
59342
59395
  let colorScale = scale;
59343
59396
  let colorField = field;
59344
59397
  if ((!scale || !field) && this.model.modelType === 'series') {
@@ -59385,7 +59438,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
59385
59438
  };
59386
59439
  }
59387
59440
  _computeBorderAttr(borderStyle) {
59388
- const { scale, field } = borderStyle, mergedStyle = __rest$d(borderStyle, ["scale", "field"]);
59441
+ const { scale, field } = borderStyle, mergedStyle = __rest$e(borderStyle, ["scale", "field"]);
59389
59442
  return (data, opt) => {
59390
59443
  var _a, _b, _c;
59391
59444
  const computeStyle = {};
@@ -59792,7 +59845,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
59792
59845
  };
59793
59846
  this._option = merge$2(this._option, { animation: spec.animation !== false }, options);
59794
59847
  this._onError = (_a = this._option) === null || _a === void 0 ? void 0 : _a.onError;
59795
- const _g = this._option, { dom, renderCanvas, mode, stage, poptip } = _g, restOptions = __rest$d(_g, ["dom", "renderCanvas", "mode", "stage", "poptip"]);
59848
+ const _g = this._option, { dom, renderCanvas, mode, stage, poptip } = _g, restOptions = __rest$e(_g, ["dom", "renderCanvas", "mode", "stage", "poptip"]);
59796
59849
  const isTrueBrowseEnv = isTrueBrowser(mode);
59797
59850
  if (isTrueBrowseEnv) {
59798
59851
  registerBrowserEnv();
@@ -60944,7 +60997,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
60944
60997
  };
60945
60998
  registerVChartCore();
60946
60999
 
60947
- const version = "1.12.2-alpha.2";
61000
+ const version = "1.12.2-alpha.9";
60948
61001
 
60949
61002
  const addVChartProperty = (data, op) => {
60950
61003
  const context = op.beforeCall();
@@ -60971,28 +61024,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
60971
61024
  }
60972
61025
  }
60973
61026
 
60974
- const getTooltipActualActiveType = (spec) => {
60975
- var _a, _b, _c;
60976
- if ((spec === null || spec === void 0 ? void 0 : spec.visible) === false) {
60977
- return [];
60978
- }
60979
- const activeTypeMap = {
60980
- mark: ((_a = spec === null || spec === void 0 ? void 0 : spec.mark) === null || _a === void 0 ? void 0 : _a.visible) !== false,
60981
- dimension: ((_b = spec === null || spec === void 0 ? void 0 : spec.dimension) === null || _b === void 0 ? void 0 : _b.visible) !== false,
60982
- group: ((_c = spec === null || spec === void 0 ? void 0 : spec.group) === null || _c === void 0 ? void 0 : _c.visible) !== false
60983
- };
60984
- if (isValid$1(spec === null || spec === void 0 ? void 0 : spec.activeType)) {
60985
- Object.keys(activeTypeMap).forEach(t => {
60986
- var _a;
60987
- activeTypeMap[t] = (_a = spec === null || spec === void 0 ? void 0 : spec.activeType) === null || _a === void 0 ? void 0 : _a.includes(t);
60988
- });
60989
- }
60990
- return Object.keys(activeTypeMap).filter(t => activeTypeMap[t]);
60991
- };
60992
- function isEmptyPos(params) {
60993
- return isNil$1(params.mark) && isNil$1(params.model) && isNil$1(params.datum);
60994
- }
60995
-
60996
61027
  class BaseSeriesTooltipHelper extends BaseTooltipHelper {
60997
61028
  constructor(series) {
60998
61029
  super();
@@ -61071,22 +61102,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
61071
61102
  this.updateTooltipSpec();
61072
61103
  }
61073
61104
  updateTooltipSpec() {
61074
- var _a, _b, _c, _d;
61075
- const seriesTooltipSpec = (_b = (_a = this.series.getSpec()) === null || _a === void 0 ? void 0 : _a.tooltip) !== null && _b !== void 0 ? _b : {};
61076
- const chartTooltipSpec = (_d = (_c = this.series.getChart().getSpec()) === null || _c === void 0 ? void 0 : _c.tooltip) !== null && _d !== void 0 ? _d : {};
61077
- const spec = Object.assign(Object.assign({}, chartTooltipSpec), seriesTooltipSpec);
61078
- ['mark', 'dimension', 'group'].forEach(activeType => {
61079
- const pattern = spec[activeType];
61080
- if (isValid$1(pattern)) {
61081
- spec[activeType] = Object.assign(Object.assign({}, pattern), { title: addExtraInfoToTooltipTitlePattern(pattern.title, {
61082
- seriesId: this.series.id
61083
- }, true), content: addExtraInfoToTooltipContentPattern(pattern.content, {
61084
- seriesId: this.series.id
61085
- }, true) });
61086
- }
61087
- });
61088
- this.spec = spec;
61089
- this.activeType = getTooltipActualActiveType(spec);
61105
+ var _a;
61106
+ const seriesTooltipSpec = (_a = this.series.getSpec()) === null || _a === void 0 ? void 0 : _a.tooltip;
61107
+ this.spec = seriesTooltipSpec;
61090
61108
  this._seriesCacheInfo = this._getSeriesCacheInfo();
61091
61109
  }
61092
61110
  getDefaultTooltipPattern(activeType, dimensionInfo) {
@@ -61167,26 +61185,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
61167
61185
  return null;
61168
61186
  }
61169
61187
  }
61170
- const merge = (source, extraInfo, overwrite) => {
61171
- const info = isFunction$1(extraInfo) ? extraInfo(source) : extraInfo;
61172
- return overwrite ? Object.assign(Object.assign({}, source), info) : Object.assign(Object.assign({}, info), source);
61173
- };
61174
- const addExtraInfoToTooltipTitlePattern = (pattern, extraInfo, overwrite) => {
61175
- const result = isValid$1(pattern)
61176
- ? isFunction$1(pattern)
61177
- ? (...args) => merge(pattern(...args), extraInfo, overwrite)
61178
- : merge(pattern, extraInfo, overwrite)
61179
- : undefined;
61180
- return result;
61181
- };
61182
- const addExtraInfoToTooltipContentPattern = (pattern, extraInfo, overwrite) => {
61183
- const result = isValid$1(pattern)
61184
- ? array(pattern).map(patternItem => isFunction$1(patternItem)
61185
- ? (...args) => array(patternItem(...args)).map(line => merge(line, extraInfo, overwrite))
61186
- : merge(patternItem, extraInfo, overwrite))
61187
- : undefined;
61188
- return result;
61189
- };
61190
61188
 
61191
61189
  const methods = {
61192
61190
  min: (arr) => {
@@ -61521,10 +61519,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
61521
61519
  update: [
61522
61520
  {
61523
61521
  type: 'update',
61524
- options: { excludeChannels: ['points', 'defined'] }
61522
+ options: { excludeChannels: ['points', 'defined', 'segments'] }
61525
61523
  },
61526
61524
  {
61527
- channel: ['points'],
61525
+ channel: ['points', 'segments'],
61528
61526
  custom: TagPointsUpdate,
61529
61527
  duration: DEFAULT_ANIMATION_CONFIG.update.duration,
61530
61528
  easing: DEFAULT_ANIMATION_CONFIG.update.easing,
@@ -61589,7 +61587,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
61589
61587
  View.useRegisters([registerGrowPointsInAnimation, registerGrowPointsOutAnimation]);
61590
61588
  };
61591
61589
 
61592
- const AnimationStates = Object.keys(DEFAULT_ANIMATION_CONFIG);
61590
+ const AnimationStates = [...Object.keys(DEFAULT_ANIMATION_CONFIG), 'normal'];
61593
61591
  function animationConfig(defaultConfig = {}, userConfig, params) {
61594
61592
  const config = {};
61595
61593
  for (let i = 0; i < AnimationStates.length; i++) {
@@ -64442,7 +64440,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
64442
64440
 
64443
64441
  class BaseComponent extends LayoutModel {
64444
64442
  static createComponent(specInfo, options) {
64445
- const { spec } = specInfo, others = __rest$d(specInfo, ["spec"]);
64443
+ const { spec } = specInfo, others = __rest$e(specInfo, ["spec"]);
64446
64444
  return new this(spec, Object.assign(Object.assign({}, options), others));
64447
64445
  }
64448
64446
  getRegions() {
@@ -64943,7 +64941,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
64943
64941
  };
64944
64942
  }
64945
64943
  if (spec.title && spec.title.visible) {
64946
- const _a = spec.title, { autoRotate, angle, style: titleStyle = {}, background: titleBackgroundSpec, state: titleState, shape: titleShapeSpec } = _a, restTitleAttrs = __rest$d(_a, ["autoRotate", "angle", "style", "background", "state", "shape"]);
64944
+ const _a = spec.title, { autoRotate, angle, style: titleStyle = {}, background: titleBackgroundSpec, state: titleState, shape: titleShapeSpec } = _a, restTitleAttrs = __rest$e(_a, ["autoRotate", "angle", "style", "background", "state", "shape"]);
64947
64945
  let titleAngle = angle;
64948
64946
  let titleTextStyle;
64949
64947
  if (spec.orient === 'left' || spec.orient === 'right') {
@@ -65180,7 +65178,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
65180
65178
  };
65181
65179
  this._updateAxisLayout = () => {
65182
65180
  const startPoint = this.getLayoutStartPoint();
65183
- const _a = this._getUpdateAttribute(false), { grid: updateGridAttrs } = _a, updateAxisAttrs = __rest$d(_a, ["grid"]);
65181
+ const _a = this._getUpdateAttribute(false), { grid: updateGridAttrs } = _a, updateAxisAttrs = __rest$e(_a, ["grid"]);
65184
65182
  const axisProduct = this._axisMark.getProduct();
65185
65183
  const axisAttrs = mergeSpec({ x: startPoint.x, y: startPoint.y }, this._axisStyle, updateAxisAttrs);
65186
65184
  axisProduct.encode(axisAttrs);
@@ -65293,7 +65291,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
65293
65291
  return specInfos;
65294
65292
  }
65295
65293
  static createComponent(specInfo, options) {
65296
- const { spec } = specInfo, others = __rest$d(specInfo, ["spec"]);
65294
+ const { spec } = specInfo, others = __rest$e(specInfo, ["spec"]);
65297
65295
  const C = Factory$1.getComponentInKey(others.type);
65298
65296
  if (C) {
65299
65297
  return new C(spec, Object.assign(Object.assign({}, options), others));
@@ -65841,6 +65839,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
65841
65839
  const min = data[0];
65842
65840
  const max = data[data.length - 1];
65843
65841
  const breaks = points.filter(point => point > min && point < max);
65842
+ if (breaks.length === 0) {
65843
+ return [[min, max]];
65844
+ }
65844
65845
  return setDomain(min, max, breaks);
65845
65846
  }
65846
65847
  const sorter = (a, b) => a - b;
@@ -65990,54 +65991,29 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
65990
65991
  }
65991
65992
  });
65992
65993
  if (userSetBreaks) {
65993
- let breakDomains = [];
65994
- let breakScopes = [];
65995
- let breakRanges;
65996
- let source = [...values];
65997
- if (this._spec.breaks.length === 1) {
65998
- const { domain, scope } = breakData(source, this._spec.breaks[0].range);
65999
- breakDomains = domain;
66000
- breakScopes = scope;
66001
- breakRanges = [this._spec.breaks[0].range];
65994
+ const breakRanges = [];
65995
+ const breaks = [];
65996
+ for (let index = 0; index < this._spec.breaks.length; index++) {
65997
+ const { range } = this._spec.breaks[index];
65998
+ if (range[0] <= range[1] && (range[1] <= maxDomain || range[1] <= minDomain)) {
65999
+ breakRanges.push(range);
66000
+ breaks.push(this._spec.breaks[index]);
66001
+ }
66002
+ }
66003
+ breakRanges.sort((a, b) => a[0] - b[0]);
66004
+ if (breakRanges.length) {
66005
+ const { domain: breakDomains, scope: breakScopes } = breakData(values, combineArray(breakRanges));
66006
+ domain = combineArray(breakDomains);
66007
+ this._break = {
66008
+ domain: breakDomains,
66009
+ scope: breakScopes,
66010
+ range: breakRanges,
66011
+ breaks
66012
+ };
66002
66013
  }
66003
66014
  else {
66004
- breakRanges = this._spec.breaks
66005
- .map((breakSpec) => breakSpec.range)
66006
- .sort((a, b) => a[0] - b[0]);
66007
- for (let index = 0; index < breakRanges.length; index++) {
66008
- const breakRange = breakRanges[index];
66009
- const { domain, scope } = breakData(source, breakRange);
66010
- let finalScope = scope;
66011
- const finalDomain = domain;
66012
- if (index > 0) {
66013
- const lastRatio = last(breakScopes)[1];
66014
- const restRarioRange = 1 - lastRatio;
66015
- finalScope = scope.map(eachScope => {
66016
- return [lastRatio + eachScope[0] * restRarioRange, lastRatio + eachScope[1] * restRarioRange];
66017
- });
66018
- finalDomain[0][0] = last(breakDomains)[1];
66019
- }
66020
- breakDomains.push(finalDomain[0]);
66021
- breakScopes.push(finalScope[0]);
66022
- if (finalDomain.length > 2) {
66023
- breakDomains.push(finalDomain[1]);
66024
- breakScopes.push(finalScope[1]);
66025
- }
66026
- if (index === breakRanges.length - 1) {
66027
- breakDomains.push(last(finalDomain));
66028
- breakScopes.push(last(finalScope));
66029
- }
66030
- else {
66031
- source = source.filter(val => val >= last(finalDomain)[0]);
66032
- }
66033
- }
66015
+ domain = [minDomain, maxDomain];
66034
66016
  }
66035
- domain = combineArray(breakDomains);
66036
- this._break = {
66037
- domain: breakDomains,
66038
- scope: breakScopes,
66039
- range: breakRanges
66040
- };
66041
66017
  }
66042
66018
  else {
66043
66019
  domain = [minDomain, maxDomain];
@@ -66252,16 +66228,16 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
66252
66228
  return Object.assign(Object.assign({}, super._tickTransformOption()), { breakData: ((_a = this._spec.breaks) === null || _a === void 0 ? void 0 : _a.length) ? () => this._break : null });
66253
66229
  }
66254
66230
  _getUpdateAttribute(ignoreGrid) {
66255
- var _a;
66231
+ var _a, _b;
66256
66232
  const attrs = super._getUpdateAttribute(ignoreGrid);
66257
- if (!isZAxis(this._orient) && ((_a = this._spec.breaks) === null || _a === void 0 ? void 0 : _a.length) && this._break) {
66233
+ if (!isZAxis(this._orient) && ((_b = (_a = this._break) === null || _a === void 0 ? void 0 : _a.breaks) === null || _b === void 0 ? void 0 : _b.length)) {
66258
66234
  const { width, height } = this.getLayoutRect();
66259
66235
  const isX = isXAxis(this._orient);
66260
66236
  const axisLength = isX ? width : height;
66261
- attrs.breaks = this._spec.breaks.map(obj => {
66237
+ attrs.breaks = this._break.breaks.map(obj => {
66262
66238
  const { range, breakSymbol, gap = 6 } = obj;
66263
- const index = this._break.domain.findIndex(domainRange => range[0] === domainRange[0] && range[1] === domainRange[1]);
66264
- const ratio = 1 - (this._break.scope[index][0] + this._break.scope[index][1]) / 2;
66239
+ const position = this.valueToPosition((range[0] + range[1]) / 2);
66240
+ const ratio = position / axisLength;
66265
66241
  let gapRatio;
66266
66242
  if (isPercent(gap)) {
66267
66243
  gapRatio = Number(gap.substring(0, gap.length - 1)) / 100;
@@ -66269,9 +66245,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
66269
66245
  else {
66270
66246
  gapRatio = gap / axisLength;
66271
66247
  }
66248
+ const symbolAngle = isValidNumber$1(breakSymbol === null || breakSymbol === void 0 ? void 0 : breakSymbol.angle) ? breakSymbol.angle : isX ? 60 : 15;
66272
66249
  return {
66273
66250
  range: [ratio - gapRatio / 2, ratio + gapRatio / 2],
66274
- breakSymbol: Object.assign({ visible: true }, breakSymbol),
66251
+ breakSymbol: Object.assign(Object.assign({ visible: true }, breakSymbol), { angle: (symbolAngle * Math.PI) / 180 }),
66275
66252
  rawRange: range
66276
66253
  };
66277
66254
  });
@@ -67060,6 +67037,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
67060
67037
  result.reMake = true;
67061
67038
  return result;
67062
67039
  }
67040
+ if (!isEqual(lastSpec.specified, s.specified)) {
67041
+ result.reMake = true;
67042
+ return result;
67043
+ }
67063
67044
  if (s.range && !isEqual(s.range, scale.range())) {
67064
67045
  scale.range(s.range);
67065
67046
  result.reRender = true;
@@ -67473,7 +67454,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
67473
67454
  if (!constructor) {
67474
67455
  return;
67475
67456
  }
67476
- const { spec } = specInfo, others = __rest$d(specInfo, ["spec"]);
67457
+ const { spec } = specInfo, others = __rest$e(specInfo, ["spec"]);
67477
67458
  const region = new constructor(spec, Object.assign(Object.assign({}, this._modelOption), others));
67478
67459
  if (region) {
67479
67460
  region.created();
@@ -67484,7 +67465,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
67484
67465
  if (!constructor) {
67485
67466
  return;
67486
67467
  }
67487
- const { spec } = specInfo, others = __rest$d(specInfo, ["spec"]);
67468
+ const { spec } = specInfo, others = __rest$e(specInfo, ["spec"]);
67488
67469
  let region;
67489
67470
  if (isValid$1(spec.regionId)) {
67490
67471
  region = this.getRegionsInUserId(spec.regionId);
@@ -67758,7 +67739,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
67758
67739
  }
67759
67740
  for (let i = 0; i < currentKeys.length; i++) {
67760
67741
  const key = currentKeys[i];
67761
- if (isArray$1(this._spec[key]) && this._spec[key].length !== spec[key].length) {
67742
+ if (isArray$1(this._spec[key]) && this._spec[key].length !== array(spec[key]).length) {
67762
67743
  result.reMake = true;
67763
67744
  return result;
67764
67745
  }
@@ -69677,9 +69658,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
69677
69658
  const depthFromSpec = this._groups ? this._groups.fields.length : 1;
69678
69659
  const depth = isNil$1(scaleDepth) ? depthFromSpec : Math.min(depthFromSpec, scaleDepth);
69679
69660
  const bandWidth = (_b = (_a = axisHelper.getBandwidth) === null || _a === void 0 ? void 0 : _a.call(axisHelper, depth - 1)) !== null && _b !== void 0 ? _b : DefaultBandWidth$2;
69680
- const hasBarWidth = this._spec.barWidth !== undefined && depth === depthFromSpec;
69681
- const hasBarMinWidth = this._spec.barMinWidth !== undefined;
69682
- const hasBarMaxWidth = this._spec.barMaxWidth !== undefined;
69661
+ const hasBarWidth = isValid$1(this._spec.barWidth) && depth === depthFromSpec;
69662
+ const hasBarMinWidth = isValid$1(this._spec.barMinWidth);
69663
+ const hasBarMaxWidth = isValid$1(this._spec.barMaxWidth);
69683
69664
  let width = bandWidth;
69684
69665
  if (hasBarWidth) {
69685
69666
  width = getActualNumValue(this._spec.barWidth, bandWidth);
@@ -74200,7 +74181,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
74200
74181
  const specFromChart = this._getDefaultSpecFromChart(chartSpec);
74201
74182
  newSpec = mergeSpec({}, this._theme, specFromChart, spec);
74202
74183
  const getMergedLabelSpec = (position, label) => {
74203
- if (position === 'inside') {
74184
+ if (position === 'inside' || position === 'inside-center') {
74204
74185
  return mergeSpec({}, this._theme.innerLabel, label);
74205
74186
  }
74206
74187
  return mergeSpec({}, this._theme.outerLabel, label);
@@ -74891,7 +74872,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
74891
74872
  return specInfos;
74892
74873
  }
74893
74874
  static createComponent(specInfo, options) {
74894
- const { spec } = specInfo, others = __rest$d(specInfo, ["spec"]);
74875
+ const { spec } = specInfo, others = __rest$e(specInfo, ["spec"]);
74895
74876
  const C = Factory$1.getComponentInKey(others.type);
74896
74877
  if (C) {
74897
74878
  return new C(spec, Object.assign(Object.assign({}, options), others));
@@ -75204,7 +75185,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
75204
75185
  return { outerRadius, innerRadius };
75205
75186
  }
75206
75187
  _update(attrs) {
75207
- const { grid: gridAttrs } = attrs, axisAttrs = __rest$d(attrs, ["grid"]);
75188
+ const { grid: gridAttrs } = attrs, axisAttrs = __rest$e(attrs, ["grid"]);
75208
75189
  const axisProduct = this._axisMark.getProduct();
75209
75190
  axisProduct.encode(mergeSpec({}, this._axisStyle, axisAttrs));
75210
75191
  if (this._gridMark) {
@@ -75816,32 +75797,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
75816
75797
  };
75817
75798
 
75818
75799
  class DotSeriesTooltipHelper extends BaseSeriesTooltipHelper {
75819
- updateTooltipSpec() {
75820
- var _a;
75821
- super.updateTooltipSpec();
75822
- if (isValid$1((_a = this.spec) === null || _a === void 0 ? void 0 : _a.mark)) {
75823
- this.spec.mark.updateContent = (prev, datum, params) => {
75824
- const childrenContent = [];
75825
- const childrenPrev = prev.filter((p) => p.key === 'children');
75826
- childrenPrev.length > 0 &&
75827
- childrenPrev[0].value.forEach((element) => {
75828
- let flag = true;
75829
- for (const key in element) {
75830
- childrenContent.push({
75831
- shapeType: 'circle',
75832
- hasShape: flag,
75833
- shapeColor: this.shapeColorCallback(datum[0].datum[0]),
75834
- shapeStroke: this.shapeStrokeCallback(datum[0].datum[0]),
75835
- key: key,
75836
- value: element[key] + ''
75837
- });
75838
- flag = false;
75839
- }
75840
- });
75841
- return prev.concat(childrenContent);
75842
- };
75843
- }
75844
- }
75845
75800
  getDefaultTooltipPattern(activeType) {
75846
75801
  if (activeType === 'mark') {
75847
75802
  return {
@@ -75889,20 +75844,22 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
75889
75844
  ],
75890
75845
  updateContent: (prev, datum, params) => {
75891
75846
  const childrenContent = [];
75892
- prev[3].value.forEach((element) => {
75893
- let flag = true;
75894
- for (const key in element) {
75895
- childrenContent.push({
75896
- shapeType: 'circle',
75897
- hasShape: flag,
75898
- shapeColor: this.shapeColorCallback(datum[0].datum[0]),
75899
- shapeStroke: this.shapeStrokeCallback(datum[0].datum[0]),
75900
- key: key,
75901
- value: element[key] + ''
75902
- });
75903
- flag = false;
75904
- }
75905
- });
75847
+ const childrenPrev = prev.filter((p) => p.key === 'children');
75848
+ childrenPrev.length > 0 &&
75849
+ childrenPrev[0].value.forEach((element) => {
75850
+ let flag = true;
75851
+ for (const key in element) {
75852
+ childrenContent.push({
75853
+ shapeType: 'circle',
75854
+ hasShape: flag,
75855
+ shapeColor: this.shapeColorCallback(datum[0].datum[0]),
75856
+ shapeStroke: this.shapeStrokeCallback(datum[0].datum[0]),
75857
+ key: key,
75858
+ value: element[key] + ''
75859
+ });
75860
+ flag = false;
75861
+ }
75862
+ });
75906
75863
  return prev.concat(childrenContent);
75907
75864
  }
75908
75865
  };
@@ -78551,7 +78508,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
78551
78508
  size: size,
78552
78509
  maskCanvas: maskCanvas
78553
78510
  } = segmentationInput,
78554
- imageData = maskCanvas.getContext("2d").getImageData(0, 0, maskCanvas.width, maskCanvas.height),
78511
+ imageData = maskCanvas.getContext("2d", {
78512
+ willReadFrequently: !0
78513
+ }).getImageData(0, 0, maskCanvas.width, maskCanvas.height),
78555
78514
  labels = new Array(size[0] * size[1]).fill(0);
78556
78515
  let curLabel = 1;
78557
78516
  const offset = [[0, 1], [1, 0], [-1, 0], [0, -1]];
@@ -78633,7 +78592,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
78633
78592
  }
78634
78593
  function removeBorder(image, canvas, isEmptyPixel) {
78635
78594
  canvas.width = image.width, canvas.height = image.height;
78636
- const ctx = canvas.getContext("2d");
78595
+ const ctx = canvas.getContext("2d", {
78596
+ willReadFrequently: !0
78597
+ });
78637
78598
  ctx.clearRect(0, 0, canvas.width, canvas.height), ctx.drawImage(image, 0, 0);
78638
78599
  const width = canvas.width,
78639
78600
  imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
@@ -78728,7 +78689,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
78728
78689
  shapeRatio: shapeRatio
78729
78690
  } = segmentationOutput,
78730
78691
  board = initBoardWithShape(segmentationOutput),
78731
- ctx = canvas.getContext("2d");
78692
+ ctx = canvas.getContext("2d", {
78693
+ willReadFrequently: !0
78694
+ });
78732
78695
  for (const region of regions) {
78733
78696
  const {
78734
78697
  words: regionWords,
@@ -78769,7 +78732,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
78769
78732
  shapeMaxR: shapeMaxR,
78770
78733
  shapeRatio: shapeRatio
78771
78734
  } = segmentationOutput,
78772
- ctx = canvas.getContext("2d"),
78735
+ ctx = canvas.getContext("2d", {
78736
+ willReadFrequently: !0
78737
+ }),
78773
78738
  boardOrigin = initBoardWithShape(segmentationOutput);
78774
78739
  let board = boardOrigin.slice(0);
78775
78740
  const fontFactor = layoutConfig.fontSizeShrinkFactor;
@@ -78837,7 +78802,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
78837
78802
  shapeMaxR: shapeMaxR,
78838
78803
  shapeRatio: shapeRatio
78839
78804
  } = segmentationOutput,
78840
- ctx = canvas.getContext("2d"),
78805
+ ctx = canvas.getContext("2d", {
78806
+ willReadFrequently: !0
78807
+ }),
78841
78808
  boardOrigin = initBoardWithShape(segmentationOutput);
78842
78809
  let board = boardOrigin.slice(0);
78843
78810
  const fontFactor = layoutConfig.fontSizeEnlargeFactor,
@@ -79086,7 +79053,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
79086
79053
  tempCanvas: canvas,
79087
79054
  randomGenerator: randomGenerator
79088
79055
  } = segmentationOutput,
79089
- ctx = canvas.getContext("2d");
79056
+ ctx = canvas.getContext("2d", {
79057
+ willReadFrequently: !0
79058
+ });
79090
79059
  let fontSize = fillingInitialFontSize,
79091
79060
  opacity = fillingInitialOpacity;
79092
79061
  const placedFillingWords = [];
@@ -79202,7 +79171,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
79202
79171
  width: options.size[0],
79203
79172
  height: options.size[1]
79204
79173
  }),
79205
- tempCtx = tempCanvas.getContext("2d");
79174
+ tempCtx = tempCanvas.getContext("2d", {
79175
+ willReadFrequently: !0
79176
+ });
79206
79177
  tempCtx.textAlign = "center", tempCtx.textBaseline = "middle", segmentationInput.tempCanvas = tempCanvas;
79207
79178
  const boardW = options.size[0] + 31 >> 5 << 5;
79208
79179
  if (segmentationInput.boardSize = [boardW, options.size[1]], segmentationInput.random ? segmentationInput.randomGenerator = Math.random : segmentationInput.randomGenerator = fakeRandom(), this.segmentationInput = segmentationInput, isString$1(segmentationInput.shapeUrl)) {
@@ -79229,6 +79200,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
79229
79200
  segmentationInput.maskCanvas = maskCanvas, this.options.onUpdateMaskCanvas && this.options.onUpdateMaskCanvas(maskCanvas), this.doLayout(), this.isImageFinished = !0, this.isLayoutFinished = !0;
79230
79201
  }
79231
79202
  }
79203
+ canAnimate() {
79204
+ return !0;
79205
+ }
79232
79206
  unfinished() {
79233
79207
  return !this.isLayoutFinished;
79234
79208
  }
@@ -80733,6 +80707,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
80733
80707
  let flattenIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : -1;
80734
80708
  let parent = arguments.length > 4 ? arguments[4] : undefined;
80735
80709
  let getNodeKey = arguments.length > 5 ? arguments[5] : undefined;
80710
+ let valueField = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : "value";
80736
80711
  let sum = 0,
80737
80712
  prevFlattenIndex = null != flattenIndex ? flattenIndex : -1,
80738
80713
  maxDepth = depth;
@@ -80744,16 +80719,16 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
80744
80719
  maxDepth: -1,
80745
80720
  depth: depth,
80746
80721
  index: index,
80747
- value: datum.value,
80722
+ value: datum[valueField],
80748
80723
  isLeaf: !0,
80749
80724
  datum: parent ? parent.datum.concat(datum) : [datum],
80750
80725
  parentKey: null == parent ? void 0 : parent.key
80751
80726
  };
80752
80727
  if (null === (_b = datum.children) || void 0 === _b ? void 0 : _b.length) {
80753
80728
  node.children = [], node.isLeaf = !1;
80754
- const res = calculateNodeValue$1(datum.children, node.children, depth + 1, prevFlattenIndex, node, getNodeKey);
80755
- node.value = isNil$1(datum.value) ? res.sum : Math.max(res.sum, toValidNumber$1(datum.value)), prevFlattenIndex = res.flattenIndex, maxDepth = Math.max(res.maxDepth, maxDepth);
80756
- } else node.isLeaf = !0, node.value = toValidNumber$1(datum.value);
80729
+ const res = calculateNodeValue$1(datum.children, node.children, depth + 1, prevFlattenIndex, node, getNodeKey, valueField);
80730
+ node.value = isNil$1(datum[valueField]) ? res.sum : Math.max(res.sum, toValidNumber$1(datum[valueField])), prevFlattenIndex = res.flattenIndex, maxDepth = Math.max(res.maxDepth, maxDepth);
80731
+ } else node.isLeaf = !0, node.value = toValidNumber$1(datum[valueField]);
80757
80732
  sum += Math.abs(node.value), output.push(node);
80758
80733
  }), {
80759
80734
  sum: sum,
@@ -80863,7 +80838,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
80863
80838
  height: Math.abs(config.y1 - config.y0)
80864
80839
  },
80865
80840
  nodes = [],
80866
- res = calculateNodeValue$1(data, nodes, 0, -1, null, this._getNodeKey);
80841
+ res = calculateNodeValue$1(data, nodes, 0, -1, null, this._getNodeKey, this.options.valueField);
80867
80842
  if (this._maxDepth = res.maxDepth, res.sum <= 0) return [];
80868
80843
  const root = {
80869
80844
  flattenIndex: -1,
@@ -82108,18 +82083,51 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
82108
82083
  let links = result.links;
82109
82084
  if (this._nodeMap = result.nodeMap, this.computeNodeValues(nodes), this.computeNodeDepths(nodes), ["right", "end", "justify"].includes(this.options.nodeAlign) && this.computeNodeEndDepths(nodes), this._maxDepth <= 1) return null;
82110
82085
  const columns = this.computeNodeBreadths(nodes);
82111
- return this.computeLinkBreadths(nodes), nodes.forEach(node => {
82086
+ if (this.computeLinkBreadths(nodes), nodes.forEach(node => {
82112
82087
  node.sourceLinks = node.sourceLinks.filter(link => !isNil$1(link.source) && !isNil$1(link.target)), node.targetLinks = node.targetLinks.filter(link => !isNil$1(link.source) && !isNil$1(link.target));
82113
- }), links = links.filter(link => !isNil$1(link.source) && !isNil$1(link.target)), isVertical$1(this.options.direction) && (nodes.forEach(node => {
82114
- const y0 = node.y0,
82115
- y1 = node.y1;
82116
- node.y0 = node.x0, node.y1 = node.x1, node.x0 = y0, node.x1 = y1;
82088
+ }), links = links.filter(link => !isNil$1(link.source) && !isNil$1(link.target)), isVertical$1(this.options.direction)) {
82089
+ if (this.options.inverse) {
82090
+ const viewY1 = this._viewBox.x1;
82091
+ nodes.forEach(node => {
82092
+ const {
82093
+ y0: y0,
82094
+ y1: y1,
82095
+ x0: x0,
82096
+ x1: x1
82097
+ } = node;
82098
+ node.y0 = viewY1 - x1, node.y1 = viewY1 - x0, node.x0 = y0, node.x1 = y1;
82099
+ }), links.forEach(link => {
82100
+ link.vertical = !0;
82101
+ const {
82102
+ x0: x0,
82103
+ x1: x1,
82104
+ y0: y0,
82105
+ y1: y1
82106
+ } = link;
82107
+ link.x0 = y0, link.x1 = y1, link.y0 = viewY1 - x0, link.y1 = viewY1 - x1;
82108
+ });
82109
+ } else nodes.forEach(node => {
82110
+ const {
82111
+ y0: y0,
82112
+ y1: y1
82113
+ } = node;
82114
+ node.y0 = node.x0, node.y1 = node.x1, node.x0 = y0, node.x1 = y1;
82115
+ }), links.forEach(link => {
82116
+ link.vertical = !0;
82117
+ const x0 = link.x0,
82118
+ x1 = link.x1;
82119
+ link.x0 = link.y0, link.x1 = link.y1, link.y0 = x0, link.y1 = x1;
82120
+ });
82121
+ } else this.options.inverse && (nodes.forEach(node => {
82122
+ const {
82123
+ x0: x0,
82124
+ x1: x1
82125
+ } = node;
82126
+ node.x0 = viewBox.x1 - x1, node.x1 = viewBox.x1 - x0;
82117
82127
  }), links.forEach(link => {
82118
- link.vertical = !0;
82119
- const x0 = link.x0,
82120
- x1 = link.x1;
82121
- link.x0 = link.y0, link.x1 = link.y1, link.y0 = x0, link.y1 = x1;
82122
- })), links.forEach(link => {
82128
+ link.x0 = viewBox.x1 - link.x0, link.x1 = viewBox.x1 - link.x1;
82129
+ }));
82130
+ return links.forEach(link => {
82123
82131
  const sourceNode = this._nodeMap[link.source],
82124
82132
  targetNode = this._nodeMap[link.target];
82125
82133
  link.sourceRect = {
@@ -82887,14 +82895,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
82887
82895
  return (_g = this._colorScale) === null || _g === void 0 ? void 0 : _g.scale(sourceName);
82888
82896
  };
82889
82897
  this._handleEmphasisElement = (params) => {
82890
- var _a;
82898
+ var _a, _b, _c, _d, _e;
82891
82899
  const emphasisSpec = (_a = this._spec.emphasis) !== null && _a !== void 0 ? _a : {};
82892
82900
  const element = params.item;
82893
82901
  if (emphasisSpec.effect === 'adjacency') {
82894
- if (element && element.mark.id().includes('node')) {
82902
+ if (element && element.mark === ((_b = this._nodeMark) === null || _b === void 0 ? void 0 : _b.getProduct())) {
82895
82903
  this._handleNodeAdjacencyClick(element);
82896
82904
  }
82897
- else if (element && element.mark.id().includes('link')) {
82905
+ else if (element && element.mark === ((_c = this._linkMark) === null || _c === void 0 ? void 0 : _c.getProduct())) {
82898
82906
  this._handleLinkAdjacencyClick(element);
82899
82907
  }
82900
82908
  else {
@@ -82902,10 +82910,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
82902
82910
  }
82903
82911
  }
82904
82912
  else if (emphasisSpec.effect === 'related') {
82905
- if (element && element.mark.id().includes('node')) {
82913
+ if (element && element.mark === ((_d = this._nodeMark) === null || _d === void 0 ? void 0 : _d.getProduct())) {
82906
82914
  this._handleNodeRelatedClick(element);
82907
82915
  }
82908
- else if (element && element.mark.id().includes('link')) {
82916
+ else if (element && element.mark === ((_e = this._linkMark) === null || _e === void 0 ? void 0 : _e.getProduct())) {
82909
82917
  this._handleLinkRelatedClick(element);
82910
82918
  }
82911
82919
  else {
@@ -82915,6 +82923,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
82915
82923
  };
82916
82924
  this._handleClearEmpty = () => {
82917
82925
  var _a, _b;
82926
+ if (!this._needClear) {
82927
+ return;
82928
+ }
82918
82929
  const allNodeElements = (_a = this._nodeMark) === null || _a === void 0 ? void 0 : _a.getProductElements();
82919
82930
  if (!allNodeElements || !allNodeElements.length) {
82920
82931
  return;
@@ -82930,6 +82941,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
82930
82941
  allLinkElements.forEach(el => {
82931
82942
  el.removeState(states);
82932
82943
  });
82944
+ this._needClear = false;
82933
82945
  };
82934
82946
  this._handleNodeAdjacencyClick = (element) => {
82935
82947
  const nodeDatum = element.getDatum();
@@ -82979,6 +82991,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
82979
82991
  if (this._nodeMark) {
82980
82992
  this._highLightElements(this._nodeMark.getProductElements(), highlightNodes);
82981
82993
  }
82994
+ this._needClear = true;
82982
82995
  };
82983
82996
  this._handleLinkAdjacencyClick = (element) => {
82984
82997
  const curLinkDatum = element.getDatum();
@@ -83002,6 +83015,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
83002
83015
  if (this._nodeMark) {
83003
83016
  this._highLightElements(this._nodeMark.getProductElements(), highlightNodes);
83004
83017
  }
83018
+ this._needClear = true;
83005
83019
  };
83006
83020
  this._handleNodeRelatedClick = (element) => {
83007
83021
  var _a;
@@ -83185,6 +83199,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
83185
83199
  this._highLightElements(this._nodeMark.getProductElements(), highlightNodes);
83186
83200
  }
83187
83201
  }
83202
+ this._needClear = true;
83188
83203
  };
83189
83204
  this._handleLinkRelatedClick = (element) => {
83190
83205
  var _a;
@@ -83292,6 +83307,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
83292
83307
  });
83293
83308
  this._highLightElements(allNodeElements, highlightNodes);
83294
83309
  }
83310
+ this._needClear = true;
83295
83311
  };
83296
83312
  }
83297
83313
  get direction() {
@@ -83361,7 +83377,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
83361
83377
  nodeHeight: this._spec.nodeHeight,
83362
83378
  linkHeight: this._spec.linkHeight,
83363
83379
  equalNodeHeight: this._spec.equalNodeHeight,
83364
- linkOverlap: this._spec.linkOverlap
83380
+ linkOverlap: this._spec.linkOverlap,
83381
+ inverse: this._spec.inverse
83365
83382
  },
83366
83383
  level: TransformLevel.sankeyLayout
83367
83384
  });
@@ -83465,6 +83482,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
83465
83482
  this._initLinkMarkStyle();
83466
83483
  }
83467
83484
  _initNodeMarkStyle() {
83485
+ var _a, _b;
83468
83486
  const nodeMark = this._nodeMark;
83469
83487
  if (!nodeMark) {
83470
83488
  return;
@@ -83475,11 +83493,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
83475
83493
  },
83476
83494
  x1: (datum) => datum.x1,
83477
83495
  y: (datum) => datum.y0,
83478
- y1: (datum) => datum.y1,
83479
- fill: this._fillByNode
83496
+ y1: (datum) => datum.y1
83480
83497
  }, STATE_VALUE_ENUM.STATE_NORMAL, AttributeLevel.Mark);
83498
+ this.setMarkStyle(nodeMark, {
83499
+ fill: (_b = (_a = this._spec.node.style) === null || _a === void 0 ? void 0 : _a.fill) !== null && _b !== void 0 ? _b : this._fillByNode
83500
+ }, 'normal', AttributeLevel.User_Mark);
83481
83501
  }
83482
83502
  _initLinkMarkStyle() {
83503
+ var _a, _b;
83483
83504
  const linkMark = this._linkMark;
83484
83505
  if (!linkMark) {
83485
83506
  return;
@@ -83490,9 +83511,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
83490
83511
  y0: (datum) => datum.y0,
83491
83512
  y1: (datum) => datum.y1,
83492
83513
  thickness: (datum) => datum.thickness,
83493
- fill: this._fillByLink,
83494
83514
  direction: this.direction
83495
83515
  }, STATE_VALUE_ENUM.STATE_NORMAL, AttributeLevel.Series);
83516
+ this.setMarkStyle(linkMark, {
83517
+ fill: (_b = (_a = this._spec.link.style) === null || _a === void 0 ? void 0 : _a.fill) !== null && _b !== void 0 ? _b : this._fillByLink
83518
+ }, 'normal', AttributeLevel.User_Mark);
83496
83519
  }
83497
83520
  initLabelMarkStyle(labelMark, labelSpec) {
83498
83521
  if (!labelMark) {
@@ -87435,7 +87458,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
87435
87458
  if (!constructor) {
87436
87459
  return;
87437
87460
  }
87438
- const { spec } = specInfo, others = __rest$d(specInfo, ["spec"]);
87461
+ const { spec } = specInfo, others = __rest$e(specInfo, ["spec"]);
87439
87462
  if (spec.type === exports.SeriesTypeEnum.link) {
87440
87463
  spec.dotSeriesSpec = this._spec.series[spec.dotSeriesIndex];
87441
87464
  }
@@ -88183,7 +88206,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
88183
88206
 
88184
88207
  class SankeyChartSpecTransformer extends BaseChartSpecTransformer {
88185
88208
  _getDefaultSeriesSpec(spec) {
88186
- const series = Object.assign(Object.assign({}, super._getDefaultSeriesSpec(spec)), { categoryField: spec.categoryField, valueField: spec.valueField, sourceField: spec.sourceField, targetField: spec.targetField, direction: spec.direction, nodeAlign: spec.nodeAlign, nodeGap: spec.nodeGap, nodeWidth: spec.nodeWidth, linkWidth: spec.linkWidth, minStepWidth: spec.minStepWidth, minNodeHeight: spec.minNodeHeight, minLinkHeight: spec.minLinkHeight, dropIsolatedNode: spec.dropIsolatedNode, nodeHeight: spec.nodeHeight, linkHeight: spec.linkHeight, equalNodeHeight: spec.equalNodeHeight, linkOverlap: spec.linkOverlap, iterations: spec.iterations, nodeKey: spec.nodeKey, linkSortBy: spec.linkSortBy, nodeSortBy: spec.nodeSortBy, setNodeLayer: spec.setNodeLayer, node: spec.node, link: spec.link, label: spec.label, emphasis: spec.emphasis });
88209
+ const series = Object.assign(Object.assign({}, super._getDefaultSeriesSpec(spec)), { categoryField: spec.categoryField, valueField: spec.valueField, sourceField: spec.sourceField, targetField: spec.targetField, direction: spec.direction, nodeAlign: spec.nodeAlign, nodeGap: spec.nodeGap, nodeWidth: spec.nodeWidth, linkWidth: spec.linkWidth, minStepWidth: spec.minStepWidth, minNodeHeight: spec.minNodeHeight, minLinkHeight: spec.minLinkHeight, dropIsolatedNode: spec.dropIsolatedNode, nodeHeight: spec.nodeHeight, linkHeight: spec.linkHeight, equalNodeHeight: spec.equalNodeHeight, linkOverlap: spec.linkOverlap, iterations: spec.iterations, nodeKey: spec.nodeKey, linkSortBy: spec.linkSortBy, nodeSortBy: spec.nodeSortBy, setNodeLayer: spec.setNodeLayer, node: spec.node, link: spec.link, label: spec.label, emphasis: spec.emphasis, inverse: spec.inverse });
88187
88210
  const seriesType = this.seriesType;
88188
88211
  if (seriesType) {
88189
88212
  series.type = seriesType;
@@ -88369,7 +88392,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
88369
88392
  }
88370
88393
 
88371
88394
  function getLegendAttributes(spec, rect) {
88372
- const { title = {}, item = {}, pager = {}, background = {}, type, id, visible, orient, position, data, filter, regionId, regionIndex, seriesIndex, seriesId, padding } = spec, restSpec = __rest$d(spec, ["title", "item", "pager", "background", "type", "id", "visible", "orient", "position", "data", "filter", "regionId", "regionIndex", "seriesIndex", "seriesId", "padding"]);
88395
+ const { title = {}, item = {}, pager = {}, background = {}, type, id, visible, orient, position, data, filter, regionId, regionIndex, seriesIndex, seriesId, padding } = spec, restSpec = __rest$e(spec, ["title", "item", "pager", "background", "type", "id", "visible", "orient", "position", "data", "filter", "regionId", "regionIndex", "seriesIndex", "seriesId", "padding"]);
88373
88396
  const attrs = restSpec;
88374
88397
  if (title.visible) {
88375
88398
  attrs.title = transformLegendTitleAttributes(title);
@@ -88985,7 +89008,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
88985
89008
  };
88986
89009
 
88987
89010
  function getContinuousLegendAttributes(spec) {
88988
- const _a = mergeSpec({}, spec), { title = {}, handler = {}, rail = {}, track = {}, startText, endText, handlerText, sizeBackground, background = {}, type, id, visible, orient, position, data, defaultSelected, field, filter, regionId, regionIndex, seriesIndex, seriesId, padding } = _a, restSpec = __rest$d(_a, ["title", "handler", "rail", "track", "startText", "endText", "handlerText", "sizeBackground", "background", "type", "id", "visible", "orient", "position", "data", "defaultSelected", "field", "filter", "regionId", "regionIndex", "seriesIndex", "seriesId", "padding"]);
89011
+ const _a = mergeSpec({}, spec), { title = {}, handler = {}, rail = {}, track = {}, startText, endText, handlerText, sizeBackground, background = {}, type, id, visible, orient, position, data, defaultSelected, field, filter, regionId, regionIndex, seriesIndex, seriesId, padding } = _a, restSpec = __rest$e(_a, ["title", "handler", "rail", "track", "startText", "endText", "handlerText", "sizeBackground", "background", "type", "id", "visible", "orient", "position", "data", "defaultSelected", "field", "filter", "regionId", "regionIndex", "seriesIndex", "seriesId", "padding"]);
88989
89012
  const attrs = restSpec;
88990
89013
  if (title.visible) {
88991
89014
  attrs.title = transformLegendTitleAttributes(title);
@@ -89525,31 +89548,78 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
89525
89548
  return markInfoList;
89526
89549
  };
89527
89550
 
89528
- const makeDefaultPattern = (series, activeType, dimensionInfo) => {
89529
- var _a, _b;
89530
- return (_b = (_a = series.tooltipHelper) === null || _a === void 0 ? void 0 : _a.getDefaultTooltipPattern(activeType, dimensionInfo)) !== null && _b !== void 0 ? _b : null;
89551
+ const getTooltipActualActiveType = (spec) => {
89552
+ var _a, _b, _c;
89553
+ if ((spec === null || spec === void 0 ? void 0 : spec.visible) === false) {
89554
+ return [];
89555
+ }
89556
+ const activeTypeMap = {
89557
+ mark: ((_a = spec === null || spec === void 0 ? void 0 : spec.mark) === null || _a === void 0 ? void 0 : _a.visible) !== false,
89558
+ dimension: ((_b = spec === null || spec === void 0 ? void 0 : spec.dimension) === null || _b === void 0 ? void 0 : _b.visible) !== false,
89559
+ group: ((_c = spec === null || spec === void 0 ? void 0 : spec.group) === null || _c === void 0 ? void 0 : _c.visible) !== false
89560
+ };
89561
+ if (isValid$1(spec === null || spec === void 0 ? void 0 : spec.activeType)) {
89562
+ Object.keys(activeTypeMap).forEach(t => {
89563
+ var _a;
89564
+ activeTypeMap[t] = (_a = spec === null || spec === void 0 ? void 0 : spec.activeType) === null || _a === void 0 ? void 0 : _a.includes(t);
89565
+ });
89566
+ }
89567
+ return Object.keys(activeTypeMap).filter(t => activeTypeMap[t]);
89531
89568
  };
89569
+ const isActiveTypeVisible = (type, spec) => {
89570
+ if (!spec) {
89571
+ return true;
89572
+ }
89573
+ if (spec.visible === false) {
89574
+ return false;
89575
+ }
89576
+ if (spec[type] && spec[type].visible === false) {
89577
+ return false;
89578
+ }
89579
+ if (spec.activeType && !spec.activeType.includes(type)) {
89580
+ return false;
89581
+ }
89582
+ return true;
89583
+ };
89584
+ function isEmptyPos(params) {
89585
+ return isNil$1(params.mark) && isNil$1(params.model) && isNil$1(params.datum);
89586
+ }
89587
+ function combinePattern(patternList) {
89588
+ if (!patternList || !patternList.length) {
89589
+ return null;
89590
+ }
89591
+ const defaultPatternContent = [];
89592
+ patternList.forEach(({ content }) => {
89593
+ if (isFunction$1(content)) {
89594
+ defaultPatternContent.push(content);
89595
+ }
89596
+ else if (isArray$1(content)) {
89597
+ content.forEach(c => {
89598
+ defaultPatternContent.push(c);
89599
+ });
89600
+ }
89601
+ else if (content) {
89602
+ defaultPatternContent.push(content);
89603
+ }
89604
+ });
89605
+ if (defaultPatternContent.length) {
89606
+ return Object.assign(Object.assign({}, patternList[0]), { content: defaultPatternContent });
89607
+ }
89608
+ return patternList[0];
89609
+ }
89532
89610
 
89533
89611
  const getTooltipSpecForShow = (activeType, globalSpec, series, dimensionInfo) => {
89534
- var _a, _b, _c, _d, _e, _f, _g;
89612
+ var _a, _b, _c, _d, _e, _f;
89535
89613
  const finalSpec = Object.assign(Object.assign({}, globalSpec), { activeType });
89536
89614
  const { style = {} } = globalSpec;
89537
89615
  switch (activeType) {
89538
89616
  case 'mark':
89539
89617
  case 'group':
89540
89618
  if (series) {
89541
- const seriesSpec = ((_b = (_a = series.tooltipHelper) === null || _a === void 0 ? void 0 : _a.spec) !== null && _b !== void 0 ? _b : {});
89542
- if (isValid$1(seriesSpec.visible) || isValid$1(seriesSpec.activeType)) {
89543
- finalSpec.visible = getTooltipActualActiveType(seriesSpec).includes(activeType);
89544
- }
89545
- else if (isValid$1(globalSpec.visible) || isValid$1(globalSpec.activeType)) {
89546
- finalSpec.visible = getTooltipActualActiveType(globalSpec).includes(activeType);
89547
- }
89548
- else {
89549
- finalSpec.visible = true;
89550
- }
89551
- finalSpec.handler = (_d = (_c = seriesSpec.handler) !== null && _c !== void 0 ? _c : globalSpec.handler) !== null && _d !== void 0 ? _d : undefined;
89552
- if ((_e = finalSpec.handler) === null || _e === void 0 ? void 0 : _e.showTooltip) {
89619
+ const seriesSpec = (_a = series.getSpec()) === null || _a === void 0 ? void 0 : _a.tooltip;
89620
+ finalSpec.visible = true;
89621
+ finalSpec.handler = (_b = seriesSpec === null || seriesSpec === void 0 ? void 0 : seriesSpec.handler) !== null && _b !== void 0 ? _b : globalSpec.handler;
89622
+ if ((_c = finalSpec.handler) === null || _c === void 0 ? void 0 : _c.showTooltip) {
89553
89623
  return finalSpec;
89554
89624
  }
89555
89625
  }
@@ -89557,165 +89627,168 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
89557
89627
  case 'dimension':
89558
89628
  if (dimensionInfo === null || dimensionInfo === void 0 ? void 0 : dimensionInfo.length) {
89559
89629
  const seriesList = getSeriesListFromDimensionInfo(dimensionInfo);
89560
- if (seriesList.every(series => { var _a; return !getTooltipActualActiveType((_a = series.tooltipHelper) === null || _a === void 0 ? void 0 : _a.spec).includes('dimension'); })) {
89630
+ if (seriesList.every(series => { var _a; return !isActiveTypeVisible('dimension', (_a = series.tooltipHelper) === null || _a === void 0 ? void 0 : _a.spec); })) {
89561
89631
  finalSpec.visible = false;
89562
89632
  }
89563
- else if (isValid$1(globalSpec.visible) || isValid$1(globalSpec.activeType)) {
89564
- finalSpec.visible = getTooltipActualActiveType(globalSpec).includes('dimension');
89565
- }
89566
89633
  else {
89567
89634
  finalSpec.visible = true;
89568
89635
  }
89569
- finalSpec.handler = (_f = globalSpec.handler) !== null && _f !== void 0 ? _f : undefined;
89570
- if ((_g = finalSpec.handler) === null || _g === void 0 ? void 0 : _g.showTooltip) {
89636
+ finalSpec.handler = (_d = globalSpec.handler) !== null && _d !== void 0 ? _d : undefined;
89637
+ if ((_e = finalSpec.handler) === null || _e === void 0 ? void 0 : _e.showTooltip) {
89571
89638
  return finalSpec;
89572
89639
  }
89573
89640
  }
89574
89641
  break;
89575
89642
  }
89576
- const defaultPattern = getDefaultTooltipPattern(activeType, series, dimensionInfo);
89577
- const seriesPattern = getSeriesTooltipPattern(activeType, series, dimensionInfo);
89578
- const userPattern = mergeSpec({}, cloneDeep(globalSpec[activeType]), seriesPattern);
89579
- const defaultPatternTitle = defaultPattern.title;
89580
- const titleShape = getShapePattern(undefined, userPattern, style.shape, undefined, defaultPatternTitle);
89581
- if (isValid$1(userPattern.title)) {
89582
- userPattern.title = addExtraInfoToTooltipTitlePattern(userPattern.title, Object.assign(Object.assign({}, defaultPatternTitle), titleShape));
89583
- }
89584
- else {
89585
- userPattern.title = addExtraInfoToTooltipTitlePattern(defaultPatternTitle, titleShape, true);
89586
- }
89587
- const defaultPatternContent = array(defaultPattern.content);
89588
- if (isValid$1(userPattern.content)) {
89589
- const shapePatternMap = getShapePatternMapOfEachSeries(defaultPatternContent);
89590
- userPattern.content = addExtraInfoToTooltipContentPattern(userPattern.content, userLine => getShapePattern(userLine, userPattern, style.shape, shapePatternMap));
89591
- }
89592
- else {
89593
- userPattern.content = addExtraInfoToTooltipContentPattern(defaultPatternContent, line => getShapePattern(undefined, userPattern, style.shape, undefined, line), true);
89643
+ const defaultPattern = (_f = getDefaultTooltipPattern(activeType, series, dimensionInfo)) !== null && _f !== void 0 ? _f : {};
89644
+ const userPattern = getSeriesTooltipPattern(activeType, globalSpec, series, dimensionInfo);
89645
+ if (userPattern) {
89646
+ const defaultPatternTitle = defaultPattern.title;
89647
+ const defaultTitleShape = getShapePattern(undefined, userPattern, style.shape, undefined, defaultPatternTitle);
89648
+ if (isValid$1(userPattern.title)) {
89649
+ userPattern.title = addExtraInfoToTooltipTitlePattern(userPattern.title, Object.assign(Object.assign({}, defaultPatternTitle), defaultTitleShape));
89650
+ }
89651
+ else {
89652
+ userPattern.title = addExtraInfoToTooltipTitlePattern(defaultPatternTitle, defaultTitleShape, true);
89653
+ }
89654
+ const defaultPatternContent = array(defaultPattern.content);
89655
+ if (isValid$1(userPattern.content)) {
89656
+ const shapePatternMap = getShapePatternMapOfEachSeries(defaultPatternContent);
89657
+ userPattern.content = addExtraInfoToTooltipContentPattern(userPattern.content, userLine => getShapePattern(userLine, userPattern, style.shape, shapePatternMap));
89658
+ }
89659
+ else {
89660
+ userPattern.content = addExtraInfoToTooltipContentPattern(defaultPatternContent, line => getShapePattern(undefined, userPattern, style.shape, undefined, line), true);
89661
+ }
89594
89662
  }
89595
89663
  finalSpec[activeType] = Object.assign(Object.assign(Object.assign({}, defaultPattern), userPattern), { activeType });
89596
89664
  return finalSpec;
89597
89665
  };
89598
89666
  const getDefaultTooltipPattern = (activeType, series, dimensionInfo) => {
89599
- var _a;
89600
- let defaultPattern = {};
89601
89667
  switch (activeType) {
89602
89668
  case 'mark':
89603
89669
  case 'group':
89604
89670
  if (series) {
89605
- defaultPattern = (_a = makeDefaultPattern(series, activeType)) !== null && _a !== void 0 ? _a : {};
89671
+ return series.tooltipHelper.getDefaultTooltipPattern(activeType);
89606
89672
  }
89607
89673
  break;
89608
89674
  case 'dimension':
89609
89675
  if (dimensionInfo === null || dimensionInfo === void 0 ? void 0 : dimensionInfo.length) {
89610
89676
  const patternList = [];
89611
- dimensionInfo.forEach(({ data }) => data.forEach(data => {
89612
- const { series } = data;
89677
+ dimensionInfo.forEach(info => info.data.forEach(datum => {
89678
+ const { series } = datum;
89613
89679
  const mockDimensionInfo = [
89614
- Object.assign(Object.assign({}, dimensionInfo[0]), { data: [data] })
89680
+ Object.assign(Object.assign({}, info), { data: [datum] })
89615
89681
  ];
89616
- const pattern = makeDefaultPattern(series, 'dimension', mockDimensionInfo);
89682
+ const pattern = series.tooltipHelper.getDefaultTooltipPattern(activeType, mockDimensionInfo);
89617
89683
  if (pattern) {
89618
89684
  patternList.push(pattern);
89619
89685
  }
89620
89686
  }));
89621
- const defaultPatternContent = [];
89622
- patternList.forEach(({ content }) => {
89623
- if (isFunction$1(content)) {
89624
- defaultPatternContent.push(content);
89625
- }
89626
- else {
89627
- defaultPatternContent.push(...array(content));
89628
- }
89629
- });
89630
- defaultPattern = Object.assign(Object.assign({}, patternList[0]), { content: defaultPatternContent });
89687
+ return combinePattern(patternList);
89631
89688
  }
89632
89689
  break;
89633
89690
  }
89634
- return defaultPattern;
89691
+ return undefined;
89635
89692
  };
89636
- const getSeriesTooltipPattern = (activeType, series, dimensionInfo) => {
89637
- var _a, _b;
89638
- let seriesPattern = {};
89639
- switch (activeType) {
89640
- case 'mark':
89641
- case 'group':
89642
- if (series) {
89643
- const seriesSpec = ((_b = (_a = series.tooltipHelper) === null || _a === void 0 ? void 0 : _a.spec) !== null && _b !== void 0 ? _b : {});
89644
- seriesPattern = seriesSpec[activeType] ? cloneDeep(seriesSpec[activeType]) : {};
89645
- }
89646
- break;
89647
- case 'dimension':
89648
- if (dimensionInfo === null || dimensionInfo === void 0 ? void 0 : dimensionInfo.length) {
89649
- const seriesList = getSeriesListFromDimensionInfo(dimensionInfo);
89650
- const seriesPatternList = seriesList
89651
- .filter(series => {
89652
- var _a;
89653
- const spec = (_a = series.tooltipHelper) === null || _a === void 0 ? void 0 : _a.spec;
89654
- return isValid$1(spec === null || spec === void 0 ? void 0 : spec.dimension) && getTooltipActualActiveType(spec).includes('dimension');
89655
- })
89656
- .map(series => series.tooltipHelper.spec.dimension);
89657
- if (seriesPatternList.length) {
89658
- let seriesPatternContent = [];
89659
- if (seriesPatternList.every(({ content }) => isNil$1(content))) {
89660
- seriesPatternContent = undefined;
89693
+ const getSeriesTooltipPattern = (activeType, globalSpec, series, dimensionInfo) => {
89694
+ const allSeries = activeType === 'dimension' && (dimensionInfo === null || dimensionInfo === void 0 ? void 0 : dimensionInfo.length)
89695
+ ? getSeriesListFromDimensionInfo(dimensionInfo)
89696
+ : (activeType === 'mark' || activeType === 'group') && series
89697
+ ? [series]
89698
+ : null;
89699
+ if (allSeries && allSeries.length) {
89700
+ const seriesPatternList = [];
89701
+ allSeries.forEach(s => {
89702
+ var _a;
89703
+ const seriesSpec = (_a = s.tooltipHelper) === null || _a === void 0 ? void 0 : _a.spec;
89704
+ if (isActiveTypeVisible(activeType, seriesSpec)) {
89705
+ let finalPattern = seriesSpec && seriesSpec[activeType]
89706
+ ? Object.assign(Object.assign({}, globalSpec[activeType]), seriesSpec[activeType]) : globalSpec[activeType];
89707
+ if (finalPattern) {
89708
+ finalPattern = cloneDeep(finalPattern);
89709
+ if (finalPattern.title) {
89710
+ finalPattern.title = addExtraInfoToTooltipTitlePattern(finalPattern.title, {
89711
+ seriesId: s.id
89712
+ }, true);
89661
89713
  }
89662
- else {
89663
- seriesPatternList.forEach(({ content }) => {
89664
- if (isNil$1(content)) {
89665
- return;
89666
- }
89667
- if (isFunction$1(content)) {
89668
- seriesPatternContent === null || seriesPatternContent === void 0 ? void 0 : seriesPatternContent.push(content);
89669
- }
89670
- else {
89671
- seriesPatternContent === null || seriesPatternContent === void 0 ? void 0 : seriesPatternContent.push(...array(content));
89672
- }
89673
- });
89714
+ if (finalPattern.content) {
89715
+ finalPattern.content = addExtraInfoToTooltipContentPattern(finalPattern.content, {
89716
+ seriesId: s.id
89717
+ }, true);
89674
89718
  }
89675
- seriesPattern = Object.assign(Object.assign({}, seriesPatternList[0]), { content: seriesPatternContent });
89719
+ seriesPatternList.push(finalPattern);
89676
89720
  }
89677
89721
  }
89678
- break;
89722
+ });
89723
+ return seriesPatternList && seriesPatternList.length ? combinePattern(seriesPatternList) : null;
89679
89724
  }
89680
- return seriesPattern;
89725
+ return undefined;
89726
+ };
89727
+ const getSeriesListFromDimensionInfo = (dimensionInfo) => {
89728
+ const list = [];
89729
+ dimensionInfo.forEach(info => {
89730
+ info.data.forEach(datum => {
89731
+ if (isValid$1(datum.series)) {
89732
+ list.push(datum.series);
89733
+ }
89734
+ });
89735
+ });
89736
+ return list;
89681
89737
  };
89682
- const getSeriesListFromDimensionInfo = memoize((dimensionInfo) => {
89683
- return dimensionInfo.reduce((list, cur) => list.concat(cur.data.map(data => data.series).filter(isValid$1)), []);
89684
- });
89685
89738
  const getShapePatternMapOfEachSeries = (content) => {
89686
89739
  const shapePatternMap = {};
89687
89740
  content.forEach(line => {
89688
- var _a;
89689
- const key = (_a = line.seriesId) !== null && _a !== void 0 ? _a : 0;
89690
- if (!shapePatternMap[key]) {
89741
+ const key = line.seriesId;
89742
+ if (isValid$1(key) && !shapePatternMap[key]) {
89691
89743
  shapePatternMap[key] = line;
89692
89744
  }
89745
+ if (!shapePatternMap[-1]) {
89746
+ shapePatternMap[-1] = line;
89747
+ }
89693
89748
  });
89694
89749
  return shapePatternMap;
89695
89750
  };
89751
+ const isShapeKey = (key) => key.toLowerCase().includes('shape');
89696
89752
  const getShapePattern = (userLinePattern, userPattern, userStyle, shapePatternMap, defaultShapePattern) => {
89697
- var _a, _b, _c;
89753
+ var _a, _b;
89698
89754
  if (userStyle) {
89699
89755
  userStyle.shapeSize = (_a = userStyle.shapeSize) !== null && _a !== void 0 ? _a : userStyle.size;
89700
89756
  }
89701
- const shapePatternFromMap = (_c = shapePatternMap === null || shapePatternMap === void 0 ? void 0 : shapePatternMap[(_b = userLinePattern === null || userLinePattern === void 0 ? void 0 : userLinePattern.seriesId) !== null && _b !== void 0 ? _b : 0]) !== null && _c !== void 0 ? _c : shapePatternMap === null || shapePatternMap === void 0 ? void 0 : shapePatternMap[0];
89702
- const maps = [userLinePattern, userPattern, userStyle, shapePatternFromMap, defaultShapePattern].filter(isValid$1);
89703
- const shapeKeys = new Set(maps
89704
- .reduce((keys, cur) => keys.concat(Object.keys(cur)), [])
89705
- .filter(key => key.toLowerCase().includes('shape')));
89757
+ const shapePatternFromMap = shapePatternMap
89758
+ ? (_b = shapePatternMap[userLinePattern === null || userLinePattern === void 0 ? void 0 : userLinePattern.seriesId]) !== null && _b !== void 0 ? _b : shapePatternMap[-1]
89759
+ : null;
89706
89760
  const shapePattern = {};
89707
- shapeKeys.forEach(key => {
89708
- let value;
89709
- let i = 0;
89710
- do {
89711
- value = maps[i++][key];
89712
- } while (i < maps.length && isNil$1(value));
89713
- if (value !== undefined) {
89714
- shapePattern[key] = value;
89761
+ [userLinePattern, userPattern, userStyle, shapePatternFromMap, defaultShapePattern].forEach(cfg => {
89762
+ if (isValid$1(cfg)) {
89763
+ Object.keys(cfg).forEach(key => {
89764
+ if (isShapeKey(key) && isNil$1(shapePattern[key]) && !isNil$1(cfg[key])) {
89765
+ shapePattern[key] = cfg[key];
89766
+ }
89767
+ });
89715
89768
  }
89716
89769
  });
89717
89770
  return shapePattern;
89718
89771
  };
89772
+ const merge = (source, extraInfo, overwrite) => {
89773
+ const info = isFunction$1(extraInfo) ? extraInfo(source) : extraInfo;
89774
+ return overwrite ? Object.assign(Object.assign({}, source), info) : Object.assign(Object.assign({}, info), source);
89775
+ };
89776
+ const addExtraInfoToTooltipTitlePattern = (pattern, extraInfo, overwrite) => {
89777
+ const result = isValid$1(pattern)
89778
+ ? isFunction$1(pattern)
89779
+ ? (...args) => merge(pattern(...args), extraInfo, overwrite)
89780
+ : merge(pattern, extraInfo, overwrite)
89781
+ : undefined;
89782
+ return result;
89783
+ };
89784
+ const addExtraInfoToTooltipContentPattern = (pattern, extraInfo, overwrite) => {
89785
+ const result = isValid$1(pattern)
89786
+ ? array(pattern).map(patternItem => isFunction$1(patternItem)
89787
+ ? (...args) => array(patternItem(...args)).map(line => merge(line, extraInfo, overwrite))
89788
+ : merge(patternItem, extraInfo, overwrite))
89789
+ : undefined;
89790
+ return result;
89791
+ };
89719
89792
 
89720
89793
  const getTooltipContentValue = (field, datum, params, formatter) => {
89721
89794
  let value;
@@ -89784,6 +89857,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
89784
89857
  key: '其他',
89785
89858
  value: '...'
89786
89859
  };
89860
+ const TOOLTIP_TYPES = ['group', 'mark', 'dimension'];
89787
89861
 
89788
89862
  const getTimeString = (value, timeFormat, timeFormatMode) => {
89789
89863
  if (!timeFormat && !timeFormatMode) {
@@ -89860,7 +89934,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
89860
89934
  case 'dimension':
89861
89935
  for (const { data: d } of data) {
89862
89936
  for (const { datum: datumList, series } of d) {
89863
- if (!getTooltipActualActiveType((_c = series.tooltipHelper) === null || _c === void 0 ? void 0 : _c.spec).includes('dimension')) {
89937
+ if (!isActiveTypeVisible('dimension', (_c = series.tooltipHelper) === null || _c === void 0 ? void 0 : _c.spec)) {
89864
89938
  continue;
89865
89939
  }
89866
89940
  const contentPatterns = (_d = patternContent === null || patternContent === void 0 ? void 0 : patternContent.filter(c => isNil$1(c.seriesId) || c.seriesId === series.id)) !== null && _d !== void 0 ? _d : [];
@@ -89994,6 +90068,48 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
89994
90068
  }
89995
90069
  return undefined;
89996
90070
  }
90071
+ _updateViewSpec(params) {
90072
+ const { changePositionOnly, model, dimensionInfo } = params;
90073
+ if (!changePositionOnly || !this._cacheViewSpec) {
90074
+ this._cacheViewSpec = getTooltipSpecForShow(this.activeType, this.component.getSpec(), model, dimensionInfo);
90075
+ }
90076
+ }
90077
+ _updateActualTooltip(data, params) {
90078
+ var _a, _b, _c, _d;
90079
+ const pattern = this._cacheViewSpec[this.activeType];
90080
+ const { changePositionOnly } = params;
90081
+ if (!changePositionOnly || !this._cacheActualTooltip) {
90082
+ const tooltipContent = getShowContent(pattern, data, params);
90083
+ const visible = isValid$1(tooltipContent) ? getTooltipPatternValue(pattern.visible, data, params) !== false : false;
90084
+ this._cacheActualTooltip = Object.assign(Object.assign({}, tooltipContent), { visible, activeType: pattern.activeType, data });
90085
+ const { title, content } = this._cacheActualTooltip;
90086
+ this._cacheActualTooltip.title = (_b = (_a = pattern.updateTitle) === null || _a === void 0 ? void 0 : _a.call(pattern, title, data, params)) !== null && _b !== void 0 ? _b : title;
90087
+ this._cacheActualTooltip.content = (_d = (_c = pattern.updateContent) === null || _c === void 0 ? void 0 : _c.call(pattern, content, data, params)) !== null && _d !== void 0 ? _d : content;
90088
+ }
90089
+ }
90090
+ shouldHandleTooltip(params, mouseEventData) {
90091
+ var _a, _b;
90092
+ const { tooltipInfo: info } = mouseEventData;
90093
+ if (isNil$1(info)) {
90094
+ return false;
90095
+ }
90096
+ return isActiveTypeVisible(this.activeType, (_b = (_a = params.model) === null || _a === void 0 ? void 0 : _a.tooltipHelper) === null || _b === void 0 ? void 0 : _b.spec);
90097
+ }
90098
+ clearCache() {
90099
+ this._cacheViewSpec = undefined;
90100
+ this._cacheActualTooltip = undefined;
90101
+ }
90102
+ }
90103
+
90104
+ class DimensionTooltipProcessor extends BaseTooltipProcessor {
90105
+ constructor() {
90106
+ super(...arguments);
90107
+ this.activeType = 'dimension';
90108
+ }
90109
+ showTooltip(info, params, changePositionOnly) {
90110
+ const newParams = Object.assign(Object.assign({}, params), { dimensionInfo: this._preprocessDimensionInfo(info), changePositionOnly, tooltip: this.component });
90111
+ return this._showTooltipByHandler(info, newParams);
90112
+ }
89997
90113
  _getDimensionInfo(params) {
89998
90114
  var _a, _b;
89999
90115
  let targetDimensionInfo;
@@ -90051,53 +90167,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90051
90167
  }
90052
90168
  return targetDimensionInfo;
90053
90169
  }
90054
- _updateViewSpec(params) {
90055
- const { changePositionOnly, model, dimensionInfo } = params;
90056
- if (!changePositionOnly || !this._cacheViewSpec) {
90057
- this._cacheViewSpec = getTooltipSpecForShow(this.activeType, this.component.getSpec(), model, dimensionInfo);
90058
- }
90059
- }
90060
- _updateActualTooltip(data, params) {
90061
- var _a, _b, _c, _d;
90062
- const pattern = this._cacheViewSpec[this.activeType];
90063
- const { changePositionOnly } = params;
90064
- if (!changePositionOnly || !this._cacheActualTooltip) {
90065
- const tooltipContent = getShowContent(pattern, data, params);
90066
- const visible = isValid$1(tooltipContent) ? getTooltipPatternValue(pattern.visible, data, params) !== false : false;
90067
- this._cacheActualTooltip = Object.assign(Object.assign({}, tooltipContent), { visible, activeType: pattern.activeType, data });
90068
- const { title, content } = this._cacheActualTooltip;
90069
- this._cacheActualTooltip.title = (_b = (_a = pattern.updateTitle) === null || _a === void 0 ? void 0 : _a.call(pattern, title, data, params)) !== null && _b !== void 0 ? _b : title;
90070
- this._cacheActualTooltip.content = (_d = (_c = pattern.updateContent) === null || _c === void 0 ? void 0 : _c.call(pattern, content, data, params)) !== null && _d !== void 0 ? _d : content;
90071
- }
90072
- }
90073
- clearCache() {
90074
- this._cacheViewSpec = undefined;
90075
- this._cacheActualTooltip = undefined;
90076
- }
90077
- }
90078
-
90079
- class DimensionTooltipProcessor extends BaseTooltipProcessor {
90080
- constructor() {
90081
- super(...arguments);
90082
- this.activeType = 'dimension';
90083
- }
90084
- showTooltip(info, params, changePositionOnly) {
90085
- const newParams = Object.assign(Object.assign({}, params), { dimensionInfo: this._preprocessDimensionInfo(info), changePositionOnly, tooltip: this.component });
90086
- return this._showTooltipByHandler(info, newParams);
90087
- }
90088
- shouldHandleTooltip(params, mouseEventData) {
90089
- var _a, _b;
90090
- const { tooltipInfo: info } = mouseEventData;
90091
- if (isNil$1(info)) {
90092
- return false;
90093
- }
90094
- const helper = (_a = params.model) === null || _a === void 0 ? void 0 : _a.tooltipHelper;
90095
- const activeType = (_b = helper === null || helper === void 0 ? void 0 : helper.activeType) !== null && _b !== void 0 ? _b : this.component.getSpec().activeType;
90096
- if (!activeType.includes('dimension')) {
90097
- return false;
90098
- }
90099
- return true;
90100
- }
90101
90170
  getMouseEventData(params) {
90102
90171
  var _a;
90103
90172
  return {
@@ -90117,24 +90186,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90117
90186
  this.activeType = 'mark';
90118
90187
  }
90119
90188
  showTooltip(info, params, changePositionOnly) {
90120
- const { datum, series, dimensionInfo } = info;
90189
+ const { datum, series } = info;
90121
90190
  const tooltipData = [{ datum: [datum], series }];
90122
- const newParams = Object.assign(Object.assign({}, params), { dimensionInfo: this._preprocessDimensionInfo(dimensionInfo), changePositionOnly, tooltip: this.component });
90191
+ const newParams = Object.assign(Object.assign({}, params), { changePositionOnly, tooltip: this.component });
90123
90192
  return this._showTooltipByHandler(tooltipData, newParams);
90124
90193
  }
90125
- shouldHandleTooltip(params, mouseEventData) {
90126
- var _a;
90127
- const { tooltipInfo: info } = mouseEventData;
90128
- if (isNil$1(info)) {
90129
- return false;
90130
- }
90131
- const helper = (_a = params.model) === null || _a === void 0 ? void 0 : _a.tooltipHelper;
90132
- if (!(helper === null || helper === void 0 ? void 0 : helper.activeType.includes('mark'))) {
90133
- return false;
90134
- }
90135
- return true;
90136
- }
90137
- getMouseEventData(params, dimensionInfo) {
90194
+ getMouseEventData(params) {
90138
90195
  var _a;
90139
90196
  let info;
90140
90197
  let ignore;
@@ -90147,8 +90204,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90147
90204
  info = {
90148
90205
  mark: params.mark,
90149
90206
  datum: params.datum,
90150
- series,
90151
- dimensionInfo
90207
+ series
90152
90208
  };
90153
90209
  }
90154
90210
  else if ((ignoreTriggers === null || ignoreTriggers === void 0 ? void 0 : ignoreTriggers.has(params.model)) || (ignoreTriggers === null || ignoreTriggers === void 0 ? void 0 : ignoreTriggers.has(params.mark))) {
@@ -90168,24 +90224,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90168
90224
  this.activeType = 'group';
90169
90225
  }
90170
90226
  showTooltip(info, params, changePositionOnly) {
90171
- const { datum, series, dimensionInfo } = info;
90227
+ const { datum, series } = info;
90172
90228
  const tooltipData = [{ datum: array(datum), series }];
90173
- const newParams = Object.assign(Object.assign({}, params), { groupDatum: this._getGroupDatum(params), dimensionInfo: this._preprocessDimensionInfo(dimensionInfo), changePositionOnly, tooltip: this.component });
90229
+ const newParams = Object.assign(Object.assign({}, params), { groupDatum: this._getGroupDatum(params), changePositionOnly, tooltip: this.component });
90174
90230
  return this._showTooltipByHandler(tooltipData, newParams);
90175
90231
  }
90176
- shouldHandleTooltip(params, mouseEventData) {
90177
- var _a;
90178
- const { tooltipInfo: info } = mouseEventData;
90179
- if (isNil$1(info)) {
90180
- return false;
90181
- }
90182
- const helper = (_a = params.model) === null || _a === void 0 ? void 0 : _a.tooltipHelper;
90183
- if (!(helper === null || helper === void 0 ? void 0 : helper.activeType.includes('group'))) {
90184
- return false;
90185
- }
90186
- return true;
90187
- }
90188
- getMouseEventData(params, dimensionInfo) {
90232
+ getMouseEventData(params) {
90189
90233
  var _a, _b;
90190
90234
  let info;
90191
90235
  let ignore;
@@ -90201,8 +90245,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90201
90245
  info = {
90202
90246
  mark: params.mark,
90203
90247
  datum: params.datum,
90204
- series,
90205
- dimensionInfo
90248
+ series
90206
90249
  };
90207
90250
  }
90208
90251
  }
@@ -90361,12 +90404,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90361
90404
  dimension: false,
90362
90405
  group: false
90363
90406
  };
90364
- success.group = this._showTooltipByMouseEvent('group', mouseEventData, params, isClick);
90365
- if (!success.group) {
90366
- success.mark = this._showTooltipByMouseEvent('mark', mouseEventData, params, isClick);
90367
- }
90368
- if (!success.mark && !success.group) {
90369
- success.dimension = this._showTooltipByMouseEvent('dimension', mouseEventData, params, isClick);
90407
+ for (let i = 0, len = TOOLTIP_TYPES.length; i < len; i++) {
90408
+ const type = TOOLTIP_TYPES[i];
90409
+ const res = this.processor[type] ? this._showTooltipByMouseEvent(type, mouseEventData, params, isClick) : false;
90410
+ if (res) {
90411
+ success[type] = true;
90412
+ break;
90413
+ }
90370
90414
  }
90371
90415
  if (Object.values(success).every(val => !val) && !isEmptyPos(params)) {
90372
90416
  if (ignoreMark && isMarkInfo(this._cacheInfo)) {
@@ -90431,22 +90475,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90431
90475
  tooltipInfo: {},
90432
90476
  ignore: {}
90433
90477
  };
90434
- let activeType = 'dimension';
90435
- const { tooltipInfo, ignore } = this.processor[activeType].getMouseEventData(params);
90436
- result.tooltipInfo[activeType] = tooltipInfo;
90437
- result.ignore[activeType] = ignore;
90438
- const dimensionInfo = tooltipInfo;
90439
- for (activeType of Object.keys(this.processor)) {
90440
- if (activeType !== 'dimension') {
90441
- const { tooltipInfo, ignore } = this.processor[activeType].getMouseEventData(params, dimensionInfo);
90442
- result.tooltipInfo[activeType] = tooltipInfo;
90443
- result.ignore[activeType] = ignore;
90444
- }
90445
- }
90478
+ Object.keys(this.processor).forEach(activeType => {
90479
+ const { tooltipInfo, ignore } = this.processor[activeType].getMouseEventData(params);
90480
+ result.tooltipInfo[activeType] = tooltipInfo;
90481
+ result.ignore[activeType] = ignore;
90482
+ });
90446
90483
  return result;
90447
90484
  };
90448
90485
  this._hideTooltipByHandler = (params) => {
90449
- var _a, _b, _c, _d;
90486
+ var _a, _b, _c;
90450
90487
  if (!this._isTooltipShown && !((_b = (_a = this.tooltipHandler) === null || _a === void 0 ? void 0 : _a.isTooltipShown) === null || _b === void 0 ? void 0 : _b.call(_a))) {
90451
90488
  return 0;
90452
90489
  }
@@ -90454,15 +90491,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90454
90491
  Object.values(this.processor).forEach((processor) => {
90455
90492
  processor.clearCache();
90456
90493
  });
90457
- let hideTooltip;
90458
- if ((_c = this._spec.handler) === null || _c === void 0 ? void 0 : _c.hideTooltip) {
90459
- hideTooltip = this._spec.handler.hideTooltip.bind(this._spec.handler);
90460
- }
90461
- else if ((_d = this.tooltipHandler) === null || _d === void 0 ? void 0 : _d.hideTooltip) {
90462
- hideTooltip = this.tooltipHandler.hideTooltip.bind(this.tooltipHandler);
90463
- }
90464
- if (hideTooltip) {
90465
- const result = hideTooltip(params);
90494
+ const handler = (_c = this._spec.handler) !== null && _c !== void 0 ? _c : this.tooltipHandler;
90495
+ if (handler.hideTooltip) {
90496
+ const result = handler.hideTooltip.call(handler, params);
90466
90497
  if (!result) {
90467
90498
  this._isTooltipShown = false;
90468
90499
  }
@@ -90563,11 +90594,17 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90563
90594
  }
90564
90595
  }
90565
90596
  _initProcessor() {
90566
- this.processor = {
90567
- mark: new MarkTooltipProcessor(this),
90568
- dimension: new DimensionTooltipProcessor(this),
90569
- group: new GroupTooltipProcessor(this)
90570
- };
90597
+ const activeType = this._spec.activeType;
90598
+ this.processor = {};
90599
+ if (activeType.includes('dimension')) {
90600
+ this.processor.dimension = new DimensionTooltipProcessor(this);
90601
+ }
90602
+ if (activeType.includes('group')) {
90603
+ this.processor.group = new GroupTooltipProcessor(this);
90604
+ }
90605
+ if (activeType.includes('mark')) {
90606
+ this.processor.mark = new MarkTooltipProcessor(this);
90607
+ }
90571
90608
  }
90572
90609
  _initEvent() {
90573
90610
  var _a;
@@ -91056,7 +91093,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91056
91093
  else {
91057
91094
  const style = line.style || {};
91058
91095
  const { stroke, fill, lineWidth } = style;
91059
- const _d = style, { strokeOpacity, fillOpacity, opacity } = _d, restStyle = __rest$d(_d, ["strokeOpacity", "fillOpacity", "opacity"]);
91096
+ const _d = style, { strokeOpacity, fillOpacity, opacity } = _d, restStyle = __rest$e(_d, ["strokeOpacity", "fillOpacity", "opacity"]);
91060
91097
  const isLineType = hair.type === 'line';
91061
91098
  let finalOpacity = isLineType ? strokeOpacity : fillOpacity;
91062
91099
  if (isNumber$1(opacity)) {
@@ -91085,7 +91122,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91085
91122
  if (!!label.visible) {
91086
91123
  const labelBackground = label.labelBackground || {};
91087
91124
  const labelStyle = label.style || {};
91088
- const _e = labelBackground.style || {}, { fill: rectFill = 'rgba(47, 59, 82, 0.9)', stroke: rectStroke, outerBorder } = _e, rectStyle = __rest$d(_e, ["fill", "stroke", "outerBorder"]);
91125
+ const _e = labelBackground.style || {}, { fill: rectFill = 'rgba(47, 59, 82, 0.9)', stroke: rectStroke, outerBorder } = _e, rectStyle = __rest$e(_e, ["fill", "stroke", "outerBorder"]);
91089
91126
  hair.label = {
91090
91127
  visible: true,
91091
91128
  formatMethod: label.formatMethod,
@@ -91778,7 +91815,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91778
91815
  const bandWidth = series.angleAxisHelper.getBandwidth(0);
91779
91816
  currValueAngle.forEach((_a) => {
91780
91817
  var _b;
91781
- var { axis, value, coord } = _a, rest = __rest$d(_a, ["axis", "value", "coord"]);
91818
+ var { axis, value, coord } = _a, rest = __rest$e(_a, ["axis", "value", "coord"]);
91782
91819
  value = value !== null && value !== void 0 ? value : '';
91783
91820
  mergeSpec(angleCrossHairInfo, rest);
91784
91821
  const angle = series.angleAxisHelper.dataToPosition([value]);
@@ -91798,7 +91835,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91798
91835
  radiusCrossHairInfo.visible = !!currValueRadius.size;
91799
91836
  currValueRadius.forEach((_a) => {
91800
91837
  var _b;
91801
- var { axis, value, coord } = _a, rest = __rest$d(_a, ["axis", "value", "coord"]);
91838
+ var { axis, value, coord } = _a, rest = __rest$e(_a, ["axis", "value", "coord"]);
91802
91839
  value = value !== null && value !== void 0 ? value : '';
91803
91840
  const niceLabelFormatter = axis.niceLabelFormatter;
91804
91841
  if ((_b = radiusHair.label) === null || _b === void 0 ? void 0 : _b.visible) {
@@ -92756,9 +92793,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
92756
92793
  }
92757
92794
  _modeCheck(statePoint, mode) {
92758
92795
  if (statePoint === 'start') {
92759
- return (mode === 'percent' && this._spec.start) || (mode === 'value' && this._spec.startValue);
92796
+ return (mode === 'percent' && isValid$1(this._spec.start)) || (mode === 'value' && isValid$1(this._spec.startValue));
92760
92797
  }
92761
- return (mode === 'percent' && this._spec.end) || (mode === 'value' && this._spec.endValue);
92798
+ return (mode === 'percent' && isValid$1(this._spec.end)) || (mode === 'value' && isValid$1(this._spec.endValue));
92762
92799
  }
92763
92800
  _setStateFromSpec() {
92764
92801
  var _a, _b;
@@ -93742,11 +93779,17 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
93742
93779
  super.updateLayoutAttribute();
93743
93780
  }
93744
93781
  _getIndicatorAttrs() {
93782
+ if (this._spec.visible === false || (this._spec.fixed === false && this._activeDatum === null)) {
93783
+ return {
93784
+ visible: false
93785
+ };
93786
+ }
93745
93787
  const region = this._regions[0];
93746
93788
  const { width, height } = region.getLayoutRect();
93747
93789
  const { x, y } = region.getLayoutStartPoint();
93790
+ const _a = this._spec, { content, offsetX, offsetY, limitRatio, title } = _a, restSpec = __rest$e(_a, ["content", "offsetX", "offsetY", "limitRatio", "title"]);
93748
93791
  const contentComponentSpec = [];
93749
- array(this._spec.content).forEach((eachItem) => {
93792
+ array(content).forEach((eachItem) => {
93750
93793
  const contentSpec = mergeSpec({}, this._theme.content, eachItem);
93751
93794
  contentComponentSpec.push({
93752
93795
  visible: contentSpec.visible !== false && (contentSpec.field ? this._activeDatum !== null : true),
@@ -93758,29 +93801,18 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
93758
93801
  style: Object.assign(Object.assign({}, transformIndicatorStyle(pickWithout(contentSpec.style, ['text']), this._activeDatum)), { text: this._createText(contentSpec.field, contentSpec.style.text) })
93759
93802
  });
93760
93803
  });
93761
- return {
93762
- visible: this._spec.visible !== false && (this._spec.fixed !== false || this._activeDatum !== null),
93763
- size: {
93804
+ return Object.assign({ visible: true, size: {
93764
93805
  width: width,
93765
93806
  height: height
93766
- },
93767
- zIndex: this.layoutZIndex,
93768
- x: x,
93769
- y: y,
93770
- dx: this._spec.offsetX ? getActualNumValue(this._spec.offsetX, this._computeLayoutRadius()) : 0,
93771
- dy: this._spec.offsetY ? getActualNumValue(this._spec.offsetY, this._computeLayoutRadius()) : 0,
93772
- limitRatio: this._spec.limitRatio || Infinity,
93773
- title: {
93774
- visible: this._spec.title.visible !== false && (!isValid$1(this._spec.title.field) || this._activeDatum !== null),
93775
- space: this._spec.title.space || this._gap,
93776
- autoLimit: this._spec.title.autoLimit,
93777
- autoFit: this._spec.title.autoFit,
93778
- fitPercent: this._spec.title.fitPercent,
93779
- fitStrategy: this._spec.title.fitStrategy,
93780
- style: Object.assign(Object.assign({}, transformIndicatorStyle(pickWithout(this._spec.title.style, ['text']), this._activeDatum)), { text: this._createText(this._spec.title.field, this._spec.title.style.text) })
93781
- },
93782
- content: contentComponentSpec
93783
- };
93807
+ }, zIndex: this.layoutZIndex, x: x, y: y, dx: offsetX ? getActualNumValue(offsetX, this._computeLayoutRadius()) : 0, dy: offsetY ? getActualNumValue(offsetY, this._computeLayoutRadius()) : 0, limitRatio: limitRatio || Infinity, title: {
93808
+ visible: title.visible !== false && (!isValid$1(title.field) || this._activeDatum !== null),
93809
+ space: title.space || this._gap,
93810
+ autoLimit: title.autoLimit,
93811
+ autoFit: title.autoFit,
93812
+ fitPercent: title.fitPercent,
93813
+ fitStrategy: title.fitStrategy,
93814
+ style: Object.assign(Object.assign({}, transformIndicatorStyle(pickWithout(title.style, ['text']), this._activeDatum)), { text: this._createText(title.field, title.style.text) })
93815
+ }, content: contentComponentSpec }, restSpec);
93784
93816
  }
93785
93817
  _createOrUpdateIndicatorComponent(attrs) {
93786
93818
  if (this._indicatorComponent) {
@@ -94156,7 +94188,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
94156
94188
  return { minX, maxX, minY, maxY };
94157
94189
  }
94158
94190
  function transformLabelAttributes(label, markerData) {
94159
- const { labelBackground = {}, style, shape } = label, restLabel = __rest$d(label, ["labelBackground", "style", "shape"]);
94191
+ const { labelBackground = {}, style, shape } = label, restLabel = __rest$e(label, ["labelBackground", "style", "shape"]);
94160
94192
  if (label.visible !== false) {
94161
94193
  const labelAttrs = restLabel;
94162
94194
  if (shape === null || shape === void 0 ? void 0 : shape.visible) {
@@ -94393,7 +94425,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
94393
94425
  function markerAggregation(_data, options) {
94394
94426
  let markerSource;
94395
94427
  if (options.coordinates) {
94396
- const _a = options, { coordinates: coordinatesInOptions, coordinateType, getSeriesByIdOrIndex } = _a, rest = __rest$d(_a, ["coordinates", "coordinateType", "getSeriesByIdOrIndex"]);
94428
+ const _a = options, { coordinates: coordinatesInOptions, coordinateType, getSeriesByIdOrIndex } = _a, rest = __rest$e(_a, ["coordinates", "coordinateType", "getSeriesByIdOrIndex"]);
94397
94429
  let coordinates;
94398
94430
  if (isFunction$1(coordinatesInOptions)) {
94399
94431
  const relativeSeries = options.getRelativeSeries();
@@ -96597,7 +96629,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
96597
96629
  _createMarkerComponent() {
96598
96630
  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;
96599
96631
  const { itemContent = {}, itemLine = {}, targetSymbol = {} } = this._spec;
96600
- const { text: label = {}, symbol, image, richText } = itemContent, restItemContent = __rest$d(itemContent, ["text", "symbol", "image", "richText"]);
96632
+ const { text: label = {}, symbol, image, richText } = itemContent, restItemContent = __rest$e(itemContent, ["text", "symbol", "image", "richText"]);
96601
96633
  const markPointAttrs = {
96602
96634
  zIndex: this.layoutZIndex,
96603
96635
  interactive: (_a = this._spec.interactive) !== null && _a !== void 0 ? _a : true,
@@ -96641,7 +96673,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
96641
96673
  if (richText === null || richText === void 0 ? void 0 : richText.style) {
96642
96674
  markPointAttrs.itemContent.richTextStyle = transformStyle(richText.style, this._markerData);
96643
96675
  }
96644
- const { visible, line = {} } = itemLine, restItemLine = __rest$d(itemLine, ["visible", "line"]);
96676
+ const { visible, line = {} } = itemLine, restItemLine = __rest$e(itemLine, ["visible", "line"]);
96645
96677
  if (visible !== false) {
96646
96678
  markPointAttrs.itemLine = Object.assign(Object.assign({}, restItemLine), { visible: true, lineStyle: transformToGraphic(line.style) });
96647
96679
  }
@@ -96985,13 +97017,19 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
96985
97017
  this._needDisablePickable = false;
96986
97018
  const { operateMask } = e.detail;
96987
97019
  this._handleBrushChange(ChartEvent.brushEnd, region, e);
96988
- this._setAxisAndDataZoom(operateMask, region);
97020
+ const inBrushData = this._extendDataInBrush(this._inBrushElementsMap);
97021
+ if (!this._spec.zoomWhenEmpty && inBrushData.length > 0) {
97022
+ this._setAxisAndDataZoom(operateMask, region);
97023
+ }
96989
97024
  this._emitEvent(ChartEvent.brushEnd, region);
96990
97025
  });
96991
97026
  brush.addEventListener(IOperateType.moveEnd, (e) => {
96992
97027
  const { operateMask } = e.detail;
96993
97028
  this._handleBrushChange(ChartEvent.brushEnd, region, e);
96994
- this._setAxisAndDataZoom(operateMask, region);
97029
+ const inBrushData = this._extendDataInBrush(this._inBrushElementsMap);
97030
+ if (!this._spec.zoomWhenEmpty && inBrushData.length > 0) {
97031
+ this._setAxisAndDataZoom(operateMask, region);
97032
+ }
96995
97033
  this._emitEvent(ChartEvent.brushEnd, region);
96996
97034
  });
96997
97035
  }
@@ -98624,22 +98662,26 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
98624
98662
  };
98625
98663
  const getHorizontalPositionType = (position, defaultCase) => { var _a, _b; return (_b = (_a = positionType[position]) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : defaultCase; };
98626
98664
  const getVerticalPositionType = (position, defaultCase) => { var _a, _b; return (_b = (_a = positionType[position]) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : defaultCase; };
98627
- const getCartesianCrosshairRect = (dimensionInfo, series, layoutStartPoint) => {
98665
+ const getCartesianCrosshairRect = (dimensionData, layoutStartPoint) => {
98666
+ var _a;
98628
98667
  const currValueX = new Map();
98629
98668
  const currValueY = new Map();
98630
- dimensionInfo.forEach(({ axis, value }) => {
98631
- if (['top', 'bottom'].includes(axis.getOrient())) {
98632
- currValueX.set(axis.getSpecIndex(), {
98633
- value,
98634
- axis
98635
- });
98636
- }
98637
- else {
98638
- currValueY.set(axis.getSpecIndex(), {
98639
- value,
98640
- axis
98641
- });
98642
- }
98669
+ const { series, datum } = dimensionData;
98670
+ const isHorizontal = series.direction === "horizontal";
98671
+ const axisHelper = isHorizontal
98672
+ ? series.getYAxisHelper()
98673
+ : series.getXAxisHelper();
98674
+ const axisId = axisHelper.getAxisId();
98675
+ const axis = series
98676
+ .getChart()
98677
+ .getComponentsByKey('axes')
98678
+ .find(axis => axis.id === axisId);
98679
+ if (!axis) {
98680
+ return undefined;
98681
+ }
98682
+ (isHorizontal ? currValueY : currValueX).set(axis.getSpecIndex(), {
98683
+ value: (_a = series.getDatumPositionValues(datum[0], series.getDimensionField())) === null || _a === void 0 ? void 0 : _a[0],
98684
+ axis
98643
98685
  });
98644
98686
  const xHair = {
98645
98687
  visible: !!currValueX.size,
@@ -98953,29 +98995,28 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
98953
98995
  return 0;
98954
98996
  };
98955
98997
  this._getActualTooltipPosition = (actualTooltip, params, tooltipBoxSize) => {
98956
- var _a, _b, _c, _d, _e, _f, _g, _h;
98957
- const event = params.event;
98998
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
98958
98999
  const { tooltipSpec } = params;
98959
- const firstDimensionInfo = (_a = params.dimensionInfo) === null || _a === void 0 ? void 0 : _a[0];
98960
99000
  const invalidPosition = {
98961
99001
  x: Infinity,
98962
99002
  y: Infinity
98963
99003
  };
98964
- let { offsetX, offsetY } = this._option;
98965
99004
  if (!tooltipSpec) {
98966
99005
  this._cacheTooltipPosition = undefined;
98967
99006
  return invalidPosition;
98968
99007
  }
99008
+ const event = params.event;
98969
99009
  const { activeType, data } = actualTooltip;
98970
- const pattern = tooltipSpec[activeType];
98971
- const position = getTooltipPatternValue(pattern.position, data, params);
98972
- const positionMode = (_b = getTooltipPatternValue(pattern.positionMode, data, params)) !== null && _b !== void 0 ? _b : (activeType === 'mark' ? 'mark' : 'pointer');
98973
- const tooltipParentElement = this._getParentElement(tooltipSpec);
99010
+ const firstDim = activeType === 'dimension' ? (_b = (_a = data[0]) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b[0] : data === null || data === void 0 ? void 0 : data[0];
99011
+ let { offsetX, offsetY } = this._option;
99012
+ const spec = tooltipSpec[activeType];
99013
+ const position = getTooltipPatternValue(spec.position, data, params);
99014
+ const positionMode = (_c = getTooltipPatternValue(spec.positionMode, data, params)) !== null && _c !== void 0 ? _c : (activeType === 'mark' ? 'mark' : 'pointer');
98974
99015
  const { width: tooltipBoxWidth = 0, height: tooltipBoxHeight = 0 } = tooltipBoxSize !== null && tooltipBoxSize !== void 0 ? tooltipBoxSize : {};
98975
99016
  const isCanvas = tooltipSpec.renderMode === 'canvas';
98976
- const canvasRect = (_c = params === null || params === void 0 ? void 0 : params.chart) === null || _c === void 0 ? void 0 : _c.getCanvasRect();
98977
- const canvasWidth = (_d = canvasRect === null || canvasRect === void 0 ? void 0 : canvasRect.width) !== null && _d !== void 0 ? _d : DEFAULT_CHART_WIDTH;
98978
- const canvasHeight = (_e = canvasRect === null || canvasRect === void 0 ? void 0 : canvasRect.height) !== null && _e !== void 0 ? _e : DEFAULT_CHART_HEIGHT;
99017
+ const canvasRect = (_d = params === null || params === void 0 ? void 0 : params.chart) === null || _d === void 0 ? void 0 : _d.getCanvasRect();
99018
+ const canvasWidth = (_e = canvasRect === null || canvasRect === void 0 ? void 0 : canvasRect.width) !== null && _e !== void 0 ? _e : DEFAULT_CHART_WIDTH;
99019
+ const canvasHeight = (_f = canvasRect === null || canvasRect === void 0 ? void 0 : canvasRect.height) !== null && _f !== void 0 ? _f : DEFAULT_CHART_HEIGHT;
98979
99020
  let isFixedPosition = false;
98980
99021
  const containerSize = {
98981
99022
  width: 0,
@@ -98989,8 +99030,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
98989
99030
  containerSize.width = window.innerWidth;
98990
99031
  containerSize.height = window.innerHeight;
98991
99032
  if (!isCanvas) {
98992
- tooltipParentElementRect = (_g = (_f = tooltipParentElement === null || tooltipParentElement === void 0 ? void 0 : tooltipParentElement.getBoundingClientRect) === null || _f === void 0 ? void 0 : _f.call(tooltipParentElement)) !== null && _g !== void 0 ? _g : invalidPosition;
98993
- const chartElement = ((_h = this._compiler.getCanvas()) !== null && _h !== void 0 ? _h : this._chartContainer);
99033
+ const tooltipParentElement = this._getParentElement(tooltipSpec);
99034
+ tooltipParentElementRect = (_h = (_g = tooltipParentElement === null || tooltipParentElement === void 0 ? void 0 : tooltipParentElement.getBoundingClientRect) === null || _g === void 0 ? void 0 : _g.call(tooltipParentElement)) !== null && _h !== void 0 ? _h : invalidPosition;
99035
+ const chartElement = ((_j = this._compiler.getCanvas()) !== null && _j !== void 0 ? _j : this._chartContainer);
98994
99036
  const chartElementRect = chartElement === null || chartElement === void 0 ? void 0 : chartElement.getBoundingClientRect();
98995
99037
  relativePosOffset = {
98996
99038
  x: chartElementRect.x - tooltipParentElementRect.x,
@@ -99027,9 +99069,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
99027
99069
  x2 = bounds.x2 + startPoint.x;
99028
99070
  }
99029
99071
  }
99030
- else if (mode === 'crosshair' && ((_a = firstDimensionInfo === null || firstDimensionInfo === void 0 ? void 0 : firstDimensionInfo.axis) === null || _a === void 0 ? void 0 : _a.getCoordinateType()) === 'cartesian') {
99072
+ else if (mode === 'crosshair' &&
99073
+ ((_a = firstDim === null || firstDim === void 0 ? void 0 : firstDim.series) === null || _a === void 0 ? void 0 : _a.coordinate) === 'cartesian' &&
99074
+ firstDim.datum &&
99075
+ firstDim.datum.length) {
99031
99076
  isFixedPosition = true;
99032
- const rect = getCartesianCrosshairRect(params.dimensionInfo, getFirstSeries(this._component.getRegions(), 'cartesian'), startPoint);
99077
+ const rect = getCartesianCrosshairRect(firstDim, startPoint);
99033
99078
  if (rect) {
99034
99079
  x1 = rect.start.x;
99035
99080
  x2 = rect.end.x;
@@ -99074,9 +99119,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
99074
99119
  y2 = bounds.y2 + startPoint.y;
99075
99120
  }
99076
99121
  }
99077
- else if (mode === 'crosshair' && ((_a = firstDimensionInfo === null || firstDimensionInfo === void 0 ? void 0 : firstDimensionInfo.axis) === null || _a === void 0 ? void 0 : _a.getCoordinateType()) === 'cartesian') {
99122
+ else if (mode === 'crosshair' &&
99123
+ ((_a = firstDim === null || firstDim === void 0 ? void 0 : firstDim.series) === null || _a === void 0 ? void 0 : _a.coordinate) === 'cartesian' &&
99124
+ firstDim.datum &&
99125
+ firstDim.datum.length) {
99078
99126
  isFixedPosition = true;
99079
- const rect = getCartesianCrosshairRect(params.dimensionInfo, getFirstSeries(this._component.getRegions(), 'cartesian'), startPoint);
99127
+ const rect = getCartesianCrosshairRect(firstDim, startPoint);
99080
99128
  if (rect) {
99081
99129
  y1 = rect.start.y;
99082
99130
  y2 = rect.end.y;
@@ -99273,49 +99321,23 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
99273
99321
  y = (containerHeight - tooltipParentElementRect.y) / tooltipParentElementScale - tooltipBoxHeight;
99274
99322
  }
99275
99323
  };
99276
- switch (getHorizontalPositionType(position, 'right')) {
99277
- case 'center':
99278
- case 'centerLeft':
99279
- case 'centerRight':
99280
- if (isLeftOut()) {
99281
- detectLeftFirst();
99282
- detectRightLast();
99283
- }
99284
- else {
99285
- detectRightFirst();
99286
- detectLeftLast();
99287
- }
99288
- break;
99289
- case 'left':
99290
- detectLeftFirst();
99291
- detectRightLast();
99292
- break;
99293
- case 'right':
99294
- detectRightFirst();
99295
- detectLeftLast();
99296
- break;
99324
+ const horizontalType = getHorizontalPositionType(position, 'right');
99325
+ if (horizontalType === 'left' || (horizontalType.includes('center') && isLeftOut())) {
99326
+ detectLeftFirst();
99327
+ detectRightLast();
99297
99328
  }
99298
- switch (getVerticalPositionType(position, 'bottom')) {
99299
- case 'center':
99300
- case 'centerTop':
99301
- case 'centerBottom':
99302
- if (isTopOut()) {
99303
- detectTopFirst();
99304
- detectBottomLast();
99305
- }
99306
- else {
99307
- detectBottomFirst();
99308
- detectTopLast();
99309
- }
99310
- break;
99311
- case 'top':
99312
- detectTopFirst();
99313
- detectBottomLast();
99314
- break;
99315
- case 'bottom':
99316
- detectBottomFirst();
99317
- detectTopLast();
99318
- break;
99329
+ else {
99330
+ detectRightFirst();
99331
+ detectLeftLast();
99332
+ }
99333
+ const verticalType = getVerticalPositionType(position, 'bottom');
99334
+ if (verticalType === 'top' || (verticalType.includes('center') && isTopOut())) {
99335
+ detectTopFirst();
99336
+ detectBottomLast();
99337
+ }
99338
+ else {
99339
+ detectBottomFirst();
99340
+ detectTopLast();
99319
99341
  }
99320
99342
  const result = { x, y };
99321
99343
  this._cacheTooltipPosition = result;