@visactor/vchart 1.2.0-beta.1 → 1.2.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/build/index.js +329 -134
  2. package/build/index.min.js +1 -1
  3. package/cjs/chart/area/area.js +3 -1
  4. package/cjs/chart/area/area.js.map +1 -1
  5. package/cjs/chart/base-chart.d.ts +6 -2
  6. package/cjs/chart/base-chart.js +34 -11
  7. package/cjs/chart/base-chart.js.map +1 -1
  8. package/cjs/chart/line/line.js +3 -1
  9. package/cjs/chart/line/line.js.map +1 -1
  10. package/cjs/chart/radar/radar.js +3 -1
  11. package/cjs/chart/radar/radar.js.map +1 -1
  12. package/cjs/chart/stack.js +3 -3
  13. package/cjs/chart/stack.js.map +1 -1
  14. package/cjs/component/axis/mixin/linear-axis-mixin.js +4 -1
  15. package/cjs/component/axis/mixin/linear-axis-mixin.js.map +1 -1
  16. package/cjs/component/geo/geo-coordinate.d.ts +4 -0
  17. package/cjs/component/geo/geo-coordinate.js +18 -2
  18. package/cjs/component/geo/geo-coordinate.js.map +1 -1
  19. package/cjs/component/indicator/indicator.js +1 -1
  20. package/cjs/component/indicator/indicator.js.map +1 -1
  21. package/cjs/component/tooltip/handler/base.d.ts +1 -1
  22. package/cjs/component/tooltip/handler/base.js +1 -1
  23. package/cjs/component/tooltip/handler/base.js.map +1 -1
  24. package/cjs/component/tooltip/handler/canvas/canvas-tooltip-handler.d.ts +1 -0
  25. package/cjs/component/tooltip/handler/canvas/canvas-tooltip-handler.js +11 -4
  26. package/cjs/component/tooltip/handler/canvas/canvas-tooltip-handler.js.map +1 -1
  27. package/cjs/component/tooltip/handler/dom/dom-tooltip-handler.d.ts +1 -0
  28. package/cjs/component/tooltip/handler/dom/dom-tooltip-handler.js +3 -0
  29. package/cjs/component/tooltip/handler/dom/dom-tooltip-handler.js.map +1 -1
  30. package/cjs/component/tooltip/interface/event.d.ts +8 -0
  31. package/cjs/component/tooltip/interface/event.js +6 -0
  32. package/cjs/component/tooltip/interface/event.js.map +1 -0
  33. package/cjs/component/tooltip/interface/spec.d.ts +2 -2
  34. package/cjs/component/tooltip/interface/spec.js.map +1 -1
  35. package/cjs/component/tooltip/processor/base.js +6 -2
  36. package/cjs/component/tooltip/processor/base.js.map +1 -1
  37. package/cjs/component/tooltip/processor/dimension-tooltip.js +5 -5
  38. package/cjs/component/tooltip/processor/dimension-tooltip.js.map +1 -1
  39. package/cjs/component/tooltip/processor/mark-tooltip.js +1 -2
  40. package/cjs/component/tooltip/processor/mark-tooltip.js.map +1 -1
  41. package/cjs/component/tooltip/tooltip.d.ts +4 -2
  42. package/cjs/component/tooltip/tooltip.js +21 -9
  43. package/cjs/component/tooltip/tooltip.js.map +1 -1
  44. package/cjs/constant/event.d.ts +3 -1
  45. package/cjs/constant/event.js +2 -1
  46. package/cjs/constant/event.js.map +1 -1
  47. package/cjs/core/index.d.ts +1 -1
  48. package/cjs/core/index.js +1 -1
  49. package/cjs/core/index.js.map +1 -1
  50. package/cjs/core/vchart.js +10 -8
  51. package/cjs/core/vchart.js.map +1 -1
  52. package/cjs/data/transforms/legend-data/discrete/discrete.js +3 -2
  53. package/cjs/data/transforms/legend-data/discrete/discrete.js.map +1 -1
  54. package/cjs/data/transforms/sankey.d.ts +2 -0
  55. package/cjs/data/transforms/sankey.js +9 -1
  56. package/cjs/data/transforms/sankey.js.map +1 -1
  57. package/cjs/event/events/dimension/base.js +1 -1
  58. package/cjs/event/events/dimension/base.js.map +1 -1
  59. package/cjs/event/events/dimension/interface.js.map +1 -1
  60. package/cjs/event/events/dimension/util/cartesian.d.ts +2 -2
  61. package/cjs/event/events/dimension/util/cartesian.js +12 -11
  62. package/cjs/event/events/dimension/util/cartesian.js.map +1 -1
  63. package/cjs/event/events/dimension/util/common.d.ts +1 -1
  64. package/cjs/event/events/dimension/util/common.js +13 -6
  65. package/cjs/event/events/dimension/util/common.js.map +1 -1
  66. package/cjs/event/interface.d.ts +3 -0
  67. package/cjs/event/interface.js.map +1 -1
  68. package/cjs/model/interface.d.ts +0 -4
  69. package/cjs/model/interface.js.map +1 -1
  70. package/cjs/model/layout-item.d.ts +0 -3
  71. package/cjs/model/layout-item.js +1 -8
  72. package/cjs/model/layout-item.js.map +1 -1
  73. package/cjs/series/area/area.js +5 -4
  74. package/cjs/series/area/area.js.map +1 -1
  75. package/cjs/series/area/interface.d.ts +1 -0
  76. package/cjs/series/area/interface.js.map +1 -1
  77. package/cjs/series/base/base-series.js.map +1 -1
  78. package/cjs/series/line/interface.d.ts +4 -2
  79. package/cjs/series/line/interface.js.map +1 -1
  80. package/cjs/series/line/line.js +5 -3
  81. package/cjs/series/line/line.js.map +1 -1
  82. package/cjs/series/mixin/line-mixin.d.ts +1 -1
  83. package/cjs/series/mixin/line-mixin.js +3 -2
  84. package/cjs/series/mixin/line-mixin.js.map +1 -1
  85. package/cjs/series/pie/pie.js +1 -1
  86. package/cjs/series/pie/pie.js.map +1 -1
  87. package/cjs/series/radar/interface.d.ts +1 -0
  88. package/cjs/series/radar/interface.js.map +1 -1
  89. package/cjs/series/radar/radar.js +4 -4
  90. package/cjs/series/radar/radar.js.map +1 -1
  91. package/cjs/series/sankey/sankey.js +7 -4
  92. package/cjs/series/sankey/sankey.js.map +1 -1
  93. package/cjs/series/word-cloud/base.d.ts +7 -0
  94. package/cjs/series/word-cloud/base.js +8 -3
  95. package/cjs/series/word-cloud/base.js.map +1 -1
  96. package/cjs/theme/buildin-theme/light/series/area.js +5 -0
  97. package/cjs/theme/buildin-theme/light/series/area.js.map +1 -1
  98. package/cjs/theme/buildin-theme/light/series/line.js +5 -0
  99. package/cjs/theme/buildin-theme/light/series/line.js.map +1 -1
  100. package/cjs/theme/buildin-theme/light/series/radar.js +5 -0
  101. package/cjs/theme/buildin-theme/light/series/radar.js.map +1 -1
  102. package/cjs/typings/spec/common.d.ts +7 -2
  103. package/cjs/typings/spec/common.js.map +1 -1
  104. package/cjs/typings/tooltip/handler.d.ts +1 -0
  105. package/cjs/typings/tooltip/handler.js.map +1 -1
  106. package/cjs/typings/visual.d.ts +1 -1
  107. package/cjs/typings/visual.js.map +1 -1
  108. package/cjs/util/spec.d.ts +4 -0
  109. package/cjs/util/spec.js +24 -2
  110. package/cjs/util/spec.js.map +1 -1
  111. package/esm/chart/area/area.js +3 -1
  112. package/esm/chart/area/area.js.map +1 -1
  113. package/esm/chart/base-chart.d.ts +6 -2
  114. package/esm/chart/base-chart.js +34 -9
  115. package/esm/chart/base-chart.js.map +1 -1
  116. package/esm/chart/line/line.js +3 -1
  117. package/esm/chart/line/line.js.map +1 -1
  118. package/esm/chart/radar/radar.js +3 -1
  119. package/esm/chart/radar/radar.js.map +1 -1
  120. package/esm/chart/stack.js +3 -3
  121. package/esm/chart/stack.js.map +1 -1
  122. package/esm/component/axis/mixin/linear-axis-mixin.js +4 -1
  123. package/esm/component/axis/mixin/linear-axis-mixin.js.map +1 -1
  124. package/esm/component/geo/geo-coordinate.d.ts +4 -0
  125. package/esm/component/geo/geo-coordinate.js +18 -2
  126. package/esm/component/geo/geo-coordinate.js.map +1 -1
  127. package/esm/component/indicator/indicator.js +1 -1
  128. package/esm/component/indicator/indicator.js.map +1 -1
  129. package/esm/component/tooltip/handler/base.d.ts +1 -1
  130. package/esm/component/tooltip/handler/base.js +1 -1
  131. package/esm/component/tooltip/handler/base.js.map +1 -1
  132. package/esm/component/tooltip/handler/canvas/canvas-tooltip-handler.d.ts +1 -0
  133. package/esm/component/tooltip/handler/canvas/canvas-tooltip-handler.js +11 -4
  134. package/esm/component/tooltip/handler/canvas/canvas-tooltip-handler.js.map +1 -1
  135. package/esm/component/tooltip/handler/dom/dom-tooltip-handler.d.ts +1 -0
  136. package/esm/component/tooltip/handler/dom/dom-tooltip-handler.js +3 -0
  137. package/esm/component/tooltip/handler/dom/dom-tooltip-handler.js.map +1 -1
  138. package/esm/component/tooltip/interface/event.d.ts +8 -0
  139. package/esm/component/tooltip/interface/event.js +2 -0
  140. package/esm/component/tooltip/interface/event.js.map +1 -0
  141. package/esm/component/tooltip/interface/spec.d.ts +2 -2
  142. package/esm/component/tooltip/interface/spec.js.map +1 -1
  143. package/esm/component/tooltip/processor/base.js +7 -1
  144. package/esm/component/tooltip/processor/base.js.map +1 -1
  145. package/esm/component/tooltip/processor/dimension-tooltip.js +5 -7
  146. package/esm/component/tooltip/processor/dimension-tooltip.js.map +1 -1
  147. package/esm/component/tooltip/processor/mark-tooltip.js +0 -3
  148. package/esm/component/tooltip/processor/mark-tooltip.js.map +1 -1
  149. package/esm/component/tooltip/tooltip.d.ts +4 -2
  150. package/esm/component/tooltip/tooltip.js +23 -9
  151. package/esm/component/tooltip/tooltip.js.map +1 -1
  152. package/esm/constant/event.d.ts +3 -1
  153. package/esm/constant/event.js +2 -1
  154. package/esm/constant/event.js.map +1 -1
  155. package/esm/core/index.d.ts +1 -1
  156. package/esm/core/index.js +1 -1
  157. package/esm/core/index.js.map +1 -1
  158. package/esm/core/vchart.js +11 -9
  159. package/esm/core/vchart.js.map +1 -1
  160. package/esm/data/transforms/legend-data/discrete/discrete.js +4 -1
  161. package/esm/data/transforms/legend-data/discrete/discrete.js.map +1 -1
  162. package/esm/data/transforms/sankey.d.ts +2 -0
  163. package/esm/data/transforms/sankey.js +9 -1
  164. package/esm/data/transforms/sankey.js.map +1 -1
  165. package/esm/event/events/dimension/base.js +2 -2
  166. package/esm/event/events/dimension/base.js.map +1 -1
  167. package/esm/event/events/dimension/interface.js.map +1 -1
  168. package/esm/event/events/dimension/util/cartesian.d.ts +2 -2
  169. package/esm/event/events/dimension/util/cartesian.js +7 -8
  170. package/esm/event/events/dimension/util/cartesian.js.map +1 -1
  171. package/esm/event/events/dimension/util/common.d.ts +1 -1
  172. package/esm/event/events/dimension/util/common.js +14 -6
  173. package/esm/event/events/dimension/util/common.js.map +1 -1
  174. package/esm/event/interface.d.ts +3 -0
  175. package/esm/event/interface.js.map +1 -1
  176. package/esm/model/interface.d.ts +0 -4
  177. package/esm/model/interface.js.map +1 -1
  178. package/esm/model/layout-item.d.ts +0 -3
  179. package/esm/model/layout-item.js +1 -8
  180. package/esm/model/layout-item.js.map +1 -1
  181. package/esm/series/area/area.js +5 -4
  182. package/esm/series/area/area.js.map +1 -1
  183. package/esm/series/area/interface.d.ts +1 -0
  184. package/esm/series/area/interface.js.map +1 -1
  185. package/esm/series/base/base-series.js.map +1 -1
  186. package/esm/series/line/interface.d.ts +4 -2
  187. package/esm/series/line/interface.js.map +1 -1
  188. package/esm/series/line/line.js +5 -3
  189. package/esm/series/line/line.js.map +1 -1
  190. package/esm/series/mixin/line-mixin.d.ts +1 -1
  191. package/esm/series/mixin/line-mixin.js +3 -2
  192. package/esm/series/mixin/line-mixin.js.map +1 -1
  193. package/esm/series/pie/pie.js +2 -2
  194. package/esm/series/pie/pie.js.map +1 -1
  195. package/esm/series/radar/interface.d.ts +1 -0
  196. package/esm/series/radar/interface.js.map +1 -1
  197. package/esm/series/radar/radar.js +4 -4
  198. package/esm/series/radar/radar.js.map +1 -1
  199. package/esm/series/sankey/sankey.js +7 -4
  200. package/esm/series/sankey/sankey.js.map +1 -1
  201. package/esm/series/word-cloud/base.d.ts +7 -0
  202. package/esm/series/word-cloud/base.js +7 -0
  203. package/esm/series/word-cloud/base.js.map +1 -1
  204. package/esm/theme/buildin-theme/light/series/area.js +5 -0
  205. package/esm/theme/buildin-theme/light/series/area.js.map +1 -1
  206. package/esm/theme/buildin-theme/light/series/line.js +5 -0
  207. package/esm/theme/buildin-theme/light/series/line.js.map +1 -1
  208. package/esm/theme/buildin-theme/light/series/radar.js +5 -0
  209. package/esm/theme/buildin-theme/light/series/radar.js.map +1 -1
  210. package/esm/typings/spec/common.d.ts +7 -2
  211. package/esm/typings/spec/common.js.map +1 -1
  212. package/esm/typings/tooltip/handler.d.ts +1 -0
  213. package/esm/typings/tooltip/handler.js.map +1 -1
  214. package/esm/typings/visual.d.ts +1 -1
  215. package/esm/typings/visual.js.map +1 -1
  216. package/esm/util/spec.d.ts +4 -0
  217. package/esm/util/spec.js +21 -0
  218. package/esm/util/spec.js.map +1 -1
  219. package/package.json +4 -4
package/build/index.js CHANGED
@@ -9735,6 +9735,23 @@
9735
9735
  const keys = Object.keys(obj);
9736
9736
  return obj instanceof DataView || dataViewKeys.every(key => keys.includes(key));
9737
9737
  }
9738
+ function convertBackgroundSpec(bg) {
9739
+ if (!bg) {
9740
+ return null;
9741
+ }
9742
+ if (typeof bg === 'string') {
9743
+ return {
9744
+ fill: bg,
9745
+ fillOpacity: 1
9746
+ };
9747
+ }
9748
+ if (typeof bg !== 'object') {
9749
+ return null;
9750
+ }
9751
+ const { x, y, width, height, x1, y1, image, ...rest } = bg;
9752
+ rest.background = image;
9753
+ return rest;
9754
+ }
9738
9755
 
9739
9756
  var check = function (it) {
9740
9757
  return it && it.Math == Math && it;
@@ -22303,18 +22320,18 @@
22303
22320
  bind(DefaultGlobal).toSelf().inSingletonScope(), bind(Global).toService(DefaultGlobal), bind(DefaultWindow).to(DefaultWindow), bind(Window).toService(DefaultWindow), bind(DefaultGraphicUtil).toSelf().inSingletonScope(), bind(GraphicUtil).toService(DefaultGraphicUtil), bind(DefaultTransformUtil).toSelf().inSingletonScope(), bind(TransformUtil).toService(DefaultTransformUtil), bind(DefaultLayerService).toSelf().inSingletonScope(), bind(LayerService).toService(DefaultLayerService);
22304
22321
  });
22305
22322
 
22306
- function runFill(fill) {
22307
- return !!fill;
22323
+ function runFill(fill, background) {
22324
+ return !(!fill && !background);
22308
22325
  }
22309
22326
  function runStroke(stroke, lineWidth) {
22310
22327
  let s;
22311
22328
  return s = isArray$3(stroke) ? stroke.some(item => item || void 0 === item) : !!stroke, s && lineWidth > 0;
22312
22329
  }
22313
- function fillVisible(opacity, fillOpacity) {
22314
- return opacity * fillOpacity > 0;
22330
+ function fillVisible(opacity, fillOpacity, fill) {
22331
+ return fill && opacity * fillOpacity > 0;
22315
22332
  }
22316
- function rectFillVisible(opacity, fillOpacity, width, height) {
22317
- return opacity * fillOpacity > 0 && width > 0 && height > 0;
22333
+ function rectFillVisible(opacity, fillOpacity, width, height, fill) {
22334
+ return fill && opacity * fillOpacity > 0 && width > 0 && height > 0;
22318
22335
  }
22319
22336
  function strokeVisible(opacity, strokeOpacity) {
22320
22337
  return opacity * strokeOpacity > 0;
@@ -22334,7 +22351,7 @@
22334
22351
  strokeOpacity = themeAttributes.strokeOpacity,
22335
22352
  visible = themeAttributes.visible
22336
22353
  } = graphic.attribute,
22337
- fVisible = fillVisible(opacity, fillOpacity),
22354
+ fVisible = fillVisible(opacity, fillOpacity, fill),
22338
22355
  sVisible = strokeVisible(opacity, strokeOpacity),
22339
22356
  doFill = runFill(fill),
22340
22357
  doStroke = runStroke(stroke, lineWidth);
@@ -22696,12 +22713,12 @@
22696
22713
  x: originX = arcAttribute.x,
22697
22714
  y: originY = arcAttribute.y
22698
22715
  } = arc.attribute,
22699
- fVisible = fillVisible(opacity, fillOpacity),
22716
+ fVisible = fillVisible(opacity, fillOpacity, fill),
22700
22717
  sVisible = strokeVisible(opacity, strokeOpacity),
22701
- doFill = runFill(fill),
22718
+ doFill = runFill(fill, background),
22702
22719
  doStroke = runStroke(stroke, lineWidth);
22703
22720
  if (!arc.valid || !visible) return;
22704
- if (!(doFill || doStroke || background)) return;
22721
+ if (!doFill && !doStroke) return;
22705
22722
  if (!(fVisible || sVisible || fillCb || strokeCb || background)) return;
22706
22723
  const {
22707
22724
  outerRadius = arcAttribute.outerRadius,
@@ -22714,7 +22731,7 @@
22714
22731
  isFullStroke: isFullStroke,
22715
22732
  stroke: arrayStroke
22716
22733
  } = parseStroke(stroke);
22717
- if (doFill || isFullStroke || background) {
22734
+ if (doFill || isFullStroke) {
22718
22735
  if (context.beginPath(), drawArcPath$1(arc, context, x, y, outerRadius, innerRadius), !this._arcBeforeRenderContribitions) {
22719
22736
  this._arcBeforeRenderContribitions = [], this._arcAfterRenderContribitions = [];
22720
22737
  const contributions = this.arcRenderContribitions.getContributions() || [];
@@ -22838,11 +22855,11 @@
22838
22855
  x: originX = circleAttribute.x,
22839
22856
  y: originY = circleAttribute.y
22840
22857
  } = circle.attribute,
22841
- fVisible = fillVisible(opacity, fillOpacity),
22858
+ fVisible = fillVisible(opacity, fillOpacity, fill),
22842
22859
  sVisible = strokeVisible(opacity, strokeOpacity),
22843
- doFill = runFill(fill),
22860
+ doFill = runFill(fill, background),
22844
22861
  doStroke = runStroke(stroke, lineWidth);
22845
- circle.valid && visible && (doFill || doStroke || background) && (fVisible || sVisible || fillCb || strokeCb || background) && (context.beginPath(), context.arc(x, y, radius, startAngle, endAngle), context.closePath(), this._circleRenderContribitions || (this._circleRenderContribitions = this.circleRenderContribitions.getContributions() || [], this._circleRenderContribitions.sort((a, b) => b.order - a.order)), this._circleRenderContribitions.forEach(c => {
22862
+ circle.valid && visible && (doFill || doStroke) && (fVisible || sVisible || fillCb || strokeCb || background) && (context.beginPath(), context.arc(x, y, radius, startAngle, endAngle), context.closePath(), this._circleRenderContribitions || (this._circleRenderContribitions = this.circleRenderContribitions.getContributions() || [], this._circleRenderContribitions.sort((a, b) => b.order - a.order)), this._circleRenderContribitions.forEach(c => {
22846
22863
  c.time === BaseRenderContributionTime.beforeFillStroke && c.drawShape(circle, context, x, y, doFill, doStroke, fVisible, sVisible, circleAttribute, drawContext, fillCb, strokeCb);
22847
22864
  }), context.setShadowStyle && context.setShadowStyle(circle, circle.attribute, circleAttribute), doFill && (fillCb ? fillCb(context, circle.attribute, circleAttribute) : fVisible && (context.setCommonStyle(circle, circle.attribute, originX - x, originY - y, circleAttribute), context.fill())), doStroke && (strokeCb ? strokeCb(context, circle.attribute, circleAttribute) : sVisible && (context.setStrokeStyle(circle, circle.attribute, originX - x, originY - y, circleAttribute), context.stroke())), this._circleRenderContribitions.forEach(c => {
22848
22865
  c.time === BaseRenderContributionTime.afterFillStroke && c.drawShape(circle, context, x, y, doFill, doStroke, fVisible, sVisible, circleAttribute, drawContext, fillCb, strokeCb);
@@ -25807,10 +25824,14 @@
25807
25824
  return aabbBounds.set(-outerRadius, -outerRadius, outerRadius, outerRadius), aabbBounds;
25808
25825
  }
25809
25826
  updateArcAABBBoundsAccurate(attribute, arcTheme, aabbBounds, graphic) {
25810
- const {
25827
+ let {
25811
25828
  outerRadius = arcTheme.outerRadius,
25812
25829
  innerRadius = arcTheme.innerRadius
25813
25830
  } = attribute;
25831
+ if (outerRadius < innerRadius) {
25832
+ const temp = outerRadius;
25833
+ outerRadius = innerRadius, innerRadius = temp;
25834
+ }
25814
25835
  let {
25815
25836
  endAngle = arcTheme.endAngle,
25816
25837
  startAngle = arcTheme.startAngle
@@ -25933,7 +25954,7 @@
25933
25954
  return isArray$3(text) ? !text.every(t => null == t || "" === t) : null != text && "" !== text;
25934
25955
  }
25935
25956
  updateMultilineAABBBounds(text) {
25936
- var _a;
25957
+ var _a, _b, _c;
25937
25958
  const textTheme = getTheme(this).text,
25938
25959
  {
25939
25960
  fontFamily = textTheme.fontFamily,
@@ -25972,6 +25993,10 @@
25972
25993
  break;
25973
25994
  }
25974
25995
  const clip = layoutObj.textMeasure.clipText(str, layoutObj.textOptions, maxLineWidth);
25996
+ if ("" !== str && "" === clip.str) if (ellipsis) {
25997
+ const clipEllipsis = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis);
25998
+ clip.str = null !== (_b = clipEllipsis.str) && void 0 !== _b ? _b : "", clip.width = null !== (_c = clipEllipsis.width) && void 0 !== _c ? _c : 0;
25999
+ } else clip.str = "", clip.width = 0;
25975
26000
  if (linesLayout.push({
25976
26001
  str: clip.str,
25977
26002
  width: clip.width
@@ -26197,6 +26222,7 @@
26197
26222
  BaseRender = __decorate$1v([injectable()], BaseRender);
26198
26223
 
26199
26224
  function drawSegments(path, segPath, percent, clipRangeByDimension, params) {
26225
+ if (!segPath) return;
26200
26226
  const {
26201
26227
  offsetX = 0,
26202
26228
  offsetY = 0,
@@ -26299,6 +26325,7 @@
26299
26325
  }
26300
26326
  drawSegmentItem(context, cache, fill, stroke, fillOpacity, strokeOpacity, attribute, defaultAttribute, clipRange, clipRangeByDimension, offsetX, offsetY, line, fillCb, strokeCb) {
26301
26327
  var _a;
26328
+ if (!cache) return;
26302
26329
  context.beginPath();
26303
26330
  const z = null !== (_a = this.z) && void 0 !== _a ? _a : 0;
26304
26331
  drawSegments(context.camera ? context : context.nativeContext, cache, clipRange, clipRangeByDimension, {
@@ -26323,7 +26350,7 @@
26323
26350
  lineWidth = lineAttribute.lineWidth,
26324
26351
  visible = lineAttribute.visible
26325
26352
  } = line.attribute,
26326
- fVisible = fillVisible(opacity, fillOpacity),
26353
+ fVisible = fillVisible(opacity, fillOpacity, fill),
26327
26354
  sVisible = strokeVisible(opacity, strokeOpacity),
26328
26355
  doFill = runFill(fill),
26329
26356
  doStroke = runStroke(stroke, lineWidth);
@@ -26504,12 +26531,13 @@
26504
26531
  opacity = areaAttribute.opacity,
26505
26532
  visible = areaAttribute.visible,
26506
26533
  z = areaAttribute.z,
26534
+ background: background,
26507
26535
  stroke = area.attribute.stroke,
26508
26536
  lineWidth = areaAttribute.lineWidth,
26509
26537
  strokeOpacity = areaAttribute.strokeOpacity
26510
26538
  } = area.attribute,
26511
- fVisible = fillVisible(opacity, fillOpacity),
26512
- doFill = runFill(fill),
26539
+ fVisible = fillVisible(opacity, fillOpacity, fill),
26540
+ doFill = runFill(fill, background),
26513
26541
  doStroke = runStroke(stroke, lineWidth),
26514
26542
  sVisible = strokeVisible(opacity, strokeOpacity);
26515
26543
  if (!area.valid || !visible) return;
@@ -26610,6 +26638,7 @@
26610
26638
  drawPathProxy(area, context, x, y, drawContext, params) || this.drawShape(area, context, x, y, drawContext, params), context.highPerformanceRestore();
26611
26639
  }
26612
26640
  drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, fillCb, strokeCb) {
26641
+ if (!cache) return;
26613
26642
  context.beginPath();
26614
26643
  drawAreaSegments(context.camera ? context : context.nativeContext, cache, clipRange, {
26615
26644
  offsetX: offsetX,
@@ -26678,11 +26707,11 @@
26678
26707
  y: originY = pathAttribute.y
26679
26708
  } = path.attribute,
26680
26709
  z = null !== (_a = this.z) && void 0 !== _a ? _a : 0,
26681
- fVisible = fillVisible(opacity, fillOpacity),
26710
+ fVisible = fillVisible(opacity, fillOpacity, fill),
26682
26711
  sVisible = strokeVisible(opacity, strokeOpacity),
26683
- doFill = runFill(fill),
26712
+ doFill = runFill(fill, background),
26684
26713
  doStroke = runStroke(stroke, lineWidth);
26685
- if (path.valid && visible && (doFill || doStroke || background) && (fVisible || sVisible || fillCb || strokeCb || background)) {
26714
+ if (path.valid && visible && (doFill || doStroke) && (fVisible || sVisible || fillCb || strokeCb || background)) {
26686
26715
  if (context.beginPath(), path.pathShape) renderCommandList(path.pathShape.commandList, context, x, y, 1, 1, z);else {
26687
26716
  const path2D = null !== (_b = path.attribute.path) && void 0 !== _b ? _b : pathAttribute.path;
26688
26717
  renderCommandList(path2D.commandList, context, x, y, 1, 1, z);
@@ -26804,12 +26833,12 @@
26804
26833
  x: originX = rectAttribute.x,
26805
26834
  y: originY = rectAttribute.y
26806
26835
  } = rect.attribute,
26807
- fVisible = rectFillVisible(opacity, fillOpacity, width, height),
26836
+ fVisible = rectFillVisible(opacity, fillOpacity, width, height, fill),
26808
26837
  sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height),
26809
- doFill = runFill(fill),
26838
+ doFill = runFill(fill, background),
26810
26839
  doStroke = runStroke(stroke, lineWidth);
26811
26840
  if (!rect.valid || !visible) return;
26812
- if (!(doFill || doStroke || background)) return;
26841
+ if (!doFill && !doStroke) return;
26813
26842
  if (!(fVisible || sVisible || fillCb || strokeCb || background)) return;
26814
26843
  0 === cornerRadius || isArray$3(cornerRadius) && cornerRadius.every(num => 0 === num) ? (context.beginPath(), context.rect(x, y, width, height)) : (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius)), this._rectRenderContribitions || (this._rectRenderContribitions = this.rectRenderContribitions.getContributions() || [], this._rectRenderContribitions.sort((a, b) => b.order - a.order));
26815
26844
  const doFillOrStroke = {
@@ -26879,12 +26908,12 @@
26879
26908
  scaleX = symbolAttribute.scaleX,
26880
26909
  scaleY = symbolAttribute.scaleY
26881
26910
  } = symbol.attribute,
26882
- fVisible = fillVisible(opacity, fillOpacity),
26911
+ fVisible = fillVisible(opacity, fillOpacity, fill),
26883
26912
  sVisible = strokeVisible(opacity, strokeOpacity),
26884
- doFill = runFill(fill),
26913
+ doFill = runFill(fill, background),
26885
26914
  doStroke = runStroke(stroke, lineWidth);
26886
26915
  if (!symbol.valid || !visible) return;
26887
- if (!(doFill || doStroke || background)) return;
26916
+ if (!doFill && !doStroke) return;
26888
26917
  if (!(fVisible || sVisible || fillCb || strokeCb || background)) return;
26889
26918
  const parsedPath = symbol.getParsedPath();
26890
26919
  if (!parsedPath) return;
@@ -26962,7 +26991,7 @@
26962
26991
  y: originY = textAttribute.y
26963
26992
  } = text.attribute,
26964
26993
  lineHeight = null !== (_a = text.attribute.lineHeight) && void 0 !== _a ? _a : fontSize,
26965
- fVisible = fillVisible(opacity, fillOpacity),
26994
+ fVisible = fillVisible(opacity, fillOpacity, fill),
26966
26995
  sVisible = strokeVisible(opacity, strokeOpacity),
26967
26996
  doFill = runFill(fill),
26968
26997
  doStroke = runStroke(stroke, lineWidth);
@@ -27175,11 +27204,11 @@
27175
27204
  x: originX = polygonAttribute.x,
27176
27205
  y: originY = polygonAttribute.y
27177
27206
  } = polygon.attribute,
27178
- fVisible = fillVisible(opacity, fillOpacity),
27207
+ fVisible = fillVisible(opacity, fillOpacity, fill),
27179
27208
  sVisible = strokeVisible(opacity, strokeOpacity),
27180
- doFill = runFill(fill),
27209
+ doFill = runFill(fill, background),
27181
27210
  doStroke = runStroke(stroke, lineWidth);
27182
- polygon.valid && visible && (doFill || doStroke || background) && (fVisible || sVisible || fillCb || strokeCb || background) && (context.beginPath(), cornerRadius <= 0 || isArray$3(cornerRadius) && cornerRadius.every(num => 0 === num) ? drawPolygon(context.camera ? context : context.nativeContext, points, x, y) : drawRoundedPolygon(context.camera ? context : context.nativeContext, points, x, y, cornerRadius), context.closePath(), this._polygonRenderContribitions || (this._polygonRenderContribitions = this.polygonRenderContribitions.getContributions() || [], this._polygonRenderContribitions.sort((a, b) => b.order - a.order)), this._polygonRenderContribitions.forEach(c => {
27211
+ polygon.valid && visible && (doFill || doStroke) && (fVisible || sVisible || fillCb || strokeCb || background) && (context.beginPath(), cornerRadius <= 0 || isArray$3(cornerRadius) && cornerRadius.every(num => 0 === num) ? drawPolygon(context.camera ? context : context.nativeContext, points, x, y) : drawRoundedPolygon(context.camera ? context : context.nativeContext, points, x, y, cornerRadius), context.closePath(), this._polygonRenderContribitions || (this._polygonRenderContribitions = this.polygonRenderContribitions.getContributions() || [], this._polygonRenderContribitions.sort((a, b) => b.order - a.order)), this._polygonRenderContribitions.forEach(c => {
27183
27212
  c.time === BaseRenderContributionTime.beforeFillStroke && c.drawShape(polygon, context, x, y, doFill, doStroke, fVisible, sVisible, polygonAttribute, drawContext, fillCb, strokeCb);
27184
27213
  }), context.setShadowStyle && context.setShadowStyle(polygon, polygon.attribute, polygonAttribute), doFill && (fillCb ? fillCb(context, polygon.attribute, polygonAttribute) : fillOpacity && (context.setCommonStyle(polygon, polygon.attribute, originX - x, originY - y, polygonAttribute), context.fill())), doStroke && (strokeCb ? strokeCb(context, polygon.attribute, polygonAttribute) : strokeOpacity && (context.setStrokeStyle(polygon, polygon.attribute, originX - x, originY - y, polygonAttribute), context.stroke())), this._polygonRenderContribitions.forEach(c => {
27185
27214
  c.time === BaseRenderContributionTime.afterFillStroke && c.drawShape(polygon, context, x, y, doFill, doStroke, fVisible, sVisible, polygonAttribute, drawContext, fillCb, strokeCb);
@@ -27238,7 +27267,7 @@
27238
27267
  repeatY = imageAttribute.repeatY,
27239
27268
  image: url
27240
27269
  } = image.attribute,
27241
- fVisible = fillVisible(opacity, fillOpacity),
27270
+ fVisible = fillVisible(opacity, fillOpacity, fill),
27242
27271
  doFill = runFill(fill);
27243
27272
  if (image.valid && visible && doFill && (fVisible || fillCb)) {
27244
27273
  if (this._imageRenderContribitions || (this._imageRenderContribitions = this.imageRenderContribitions.getContributions() || []), this._imageRenderContribitions.forEach(c => {
@@ -32357,13 +32386,13 @@
32357
32386
  lineWidth = groupAttribute.lineWidth,
32358
32387
  visible = groupAttribute.visible
32359
32388
  } = group.attribute,
32360
- fVisible = rectFillVisible(opacity, fillOpacity, width, height),
32389
+ fVisible = rectFillVisible(opacity, fillOpacity, width, height, fill),
32361
32390
  sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height),
32362
- doFill = runFill(fill),
32391
+ doFill = runFill(fill, background),
32363
32392
  doStroke = runStroke(stroke, lineWidth);
32364
32393
  if (!group.valid || !visible) return;
32365
32394
  if (!clip) {
32366
- if (!(doFill || doStroke || background)) return;
32395
+ if (!doFill && !doStroke) return;
32367
32396
  if (!(fVisible || sVisible || fillCb || strokeCb || background)) return;
32368
32397
  }
32369
32398
  if (path && path.length && drawContext.drawContribution) {
@@ -32445,7 +32474,7 @@
32445
32474
  lineWidth = lineAttribute.lineWidth,
32446
32475
  visible = lineAttribute.visible
32447
32476
  } = line.attribute,
32448
- fVisible = fillVisible(opacity, fillOpacity),
32477
+ fVisible = fillVisible(opacity, fillOpacity, fill),
32449
32478
  sVisible = strokeVisible(opacity, strokeOpacity),
32450
32479
  doFill = runFill(fill),
32451
32480
  doStroke = runStroke(stroke, lineWidth);
@@ -32495,7 +32524,7 @@
32495
32524
  opacity = areaAttribute.opacity,
32496
32525
  visible = areaAttribute.visible
32497
32526
  } = area.attribute,
32498
- fVisible = fillVisible(opacity, fillOpacity),
32527
+ fVisible = fillVisible(opacity, fillOpacity, fill),
32499
32528
  doFill = runFill(fill);
32500
32529
  if (!area.valid || !visible) return;
32501
32530
  if (!doFill) return;
@@ -32685,7 +32714,7 @@
32685
32714
  visible = rectAttribute.visible
32686
32715
  } = rect.attribute,
32687
32716
  z = null !== (_a = this.z) && void 0 !== _a ? _a : 0,
32688
- fVisible = rectFillVisible(opacity, fillOpacity, width, height),
32717
+ fVisible = rectFillVisible(opacity, fillOpacity, width, height, fill),
32689
32718
  sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height),
32690
32719
  doFill = runFill(fill),
32691
32720
  doStroke = runStroke(stroke, lineWidth);
@@ -32813,7 +32842,7 @@
32813
32842
  visible = richtextAttribute.visible
32814
32843
  } = richtext.attribute;
32815
32844
  if (!richtext.valid || !visible) return;
32816
- if (!fillVisible(opacity, fillOpacity)) return;
32845
+ if (!fillVisible(opacity, fillOpacity, !0)) return;
32817
32846
  context.translate(x, y);
32818
32847
  richtext.getFrameCache().draw(context, this.drawIcon);
32819
32848
  }
@@ -32973,13 +33002,13 @@
32973
33002
  strokeOpacity = arcAttribute.strokeOpacity,
32974
33003
  visible = arcAttribute.visible
32975
33004
  } = arc.attribute,
32976
- fVisible = fillVisible(opacity, fillOpacity),
33005
+ fVisible = fillVisible(opacity, fillOpacity, fill),
32977
33006
  sVisible = strokeVisible(opacity, strokeOpacity),
32978
- doFill = runFill(fill),
33007
+ doFill = runFill(fill, background),
32979
33008
  doStroke = runStroke(stroke, lineWidth),
32980
33009
  z = null !== (_a = this.z) && void 0 !== _a ? _a : 0;
32981
33010
  if (!arc.valid || !visible) return;
32982
- if (!(doFill || doStroke || background)) return;
33011
+ if (!doFill && !doStroke) return;
32983
33012
  if (!(fVisible || sVisible || fillCb || strokeCb || background)) return;
32984
33013
  const {
32985
33014
  outerRadius = arcAttribute.outerRadius,
@@ -33066,7 +33095,7 @@
33066
33095
  face = [!0, !0, !0, !0, !0, !0]
33067
33096
  } = pyramid3d.attribute,
33068
33097
  z = null !== (_a = this.z) && void 0 !== _a ? _a : 0,
33069
- fVisible = fillVisible(opacity, fillOpacity),
33098
+ fVisible = fillVisible(opacity, fillOpacity, fill),
33070
33099
  sVisible = strokeVisible(opacity, strokeOpacity),
33071
33100
  doFill = runFill(fill),
33072
33101
  doStroke = runStroke(stroke, lineWidth);
@@ -35072,6 +35101,11 @@
35072
35101
  lineWidth: 2,
35073
35102
  fontSize: THEME_CONSTANTS.LABEL_FONT_SIZE
35074
35103
  }
35104
+ },
35105
+ point: {
35106
+ style: {
35107
+ symbolType: 'circle'
35108
+ }
35075
35109
  }
35076
35110
  };
35077
35111
 
@@ -35267,6 +35301,11 @@
35267
35301
  stroke: 'white',
35268
35302
  fontSize: THEME_CONSTANTS.LABEL_FONT_SIZE
35269
35303
  }
35304
+ },
35305
+ point: {
35306
+ style: {
35307
+ symbolType: 'circle'
35308
+ }
35270
35309
  }
35271
35310
  };
35272
35311
 
@@ -35358,6 +35397,11 @@
35358
35397
  stroke: 'white',
35359
35398
  fontSize: THEME_CONSTANTS.LABEL_FONT_SIZE
35360
35399
  }
35400
+ },
35401
+ point: {
35402
+ style: {
35403
+ symbolType: 'circle'
35404
+ }
35361
35405
  }
35362
35406
  };
35363
35407
 
@@ -40531,7 +40575,8 @@
40531
40575
  maxWidth: maxWidth,
40532
40576
  padding = 4,
40533
40577
  visible: visible,
40534
- state: state
40578
+ state: state,
40579
+ formatMethod: formatMethod
40535
40580
  } = this.attribute,
40536
40581
  parsedPadding = normalizePadding$1(padding),
40537
40582
  group = this.createOrUpdateChild("tag-content", {
@@ -40563,7 +40608,7 @@
40563
40608
  }
40564
40609
  tagWidth += symbolPlaceWidth, textX += symbolPlaceWidth;
40565
40610
  const textAttrs = Object.assign(Object.assign({
40566
- text: text,
40611
+ text: formatMethod ? formatMethod(text) : text,
40567
40612
  visible: isValid(text) && !1 !== visible,
40568
40613
  lineHeight: null == textStyle ? void 0 : textStyle.fontSize
40569
40614
  }, textStyle), {
@@ -43511,13 +43556,14 @@
43511
43556
  previewCallbackX: previewCallbackX,
43512
43557
  previewCallbackY: previewCallbackY,
43513
43558
  previewCallbackX1: previewCallbackX1,
43514
- previewCallbackY1: previewCallbackY1
43559
+ previewCallbackY1: previewCallbackY1,
43560
+ updateStateCallback: updateStateCallback
43515
43561
  } = this.attribute,
43516
43562
  {
43517
43563
  width: width,
43518
43564
  height: height
43519
43565
  } = size;
43520
- start && (this.state.start = start), end && (this.state.end = end), this._isHorizontal = "top" === orient || "bottom" === orient, this._layoutCache.max = this._isHorizontal ? width : height, this._layoutCache.attPos = this._isHorizontal ? "x" : "y", this._layoutCache.attSize = this._isHorizontal ? "width" : "height", this._activeCache.startPos = position, this._activeCache.lastPos = position, this._showText = "auto" !== showDetail && showDetail, previewData && (this._previewData = previewData), isFunction(previewCallbackX) && (this._previewCallbackX = previewCallbackX), isFunction(previewCallbackY) && (this._previewCallbackY = previewCallbackY), isFunction(previewCallbackX1) && (this._previewCallbackX1 = previewCallbackX1), isFunction(previewCallbackY1) && (this._previewCallbackY1 = previewCallbackY1);
43566
+ start && (this.state.start = start), end && (this.state.end = end), this._isHorizontal = "top" === orient || "bottom" === orient, this._layoutCache.max = this._isHorizontal ? width : height, this._layoutCache.attPos = this._isHorizontal ? "x" : "y", this._layoutCache.attSize = this._isHorizontal ? "width" : "height", this._activeCache.startPos = position, this._activeCache.lastPos = position, this._showText = "auto" !== showDetail && showDetail, previewData && (this._previewData = previewData), isFunction(previewCallbackX) && (this._previewCallbackX = previewCallbackX), isFunction(previewCallbackY) && (this._previewCallbackY = previewCallbackY), isFunction(previewCallbackX1) && (this._previewCallbackX1 = previewCallbackX1), isFunction(previewCallbackY1) && (this._previewCallbackY1 = previewCallbackY1), isFunction(updateStateCallback) && (this._updateStateCallback = updateStateCallback);
43521
43567
  }
43522
43568
  bindEvents() {
43523
43569
  const {
@@ -43947,10 +43993,10 @@
43947
43993
  start: startAttr,
43948
43994
  end: endAttr
43949
43995
  } = this.attribute;
43950
- isValid(start) && isValid(end) && (start !== this.state.start || end !== this.state.end) && (this.state.start = start, this.state.end = end, startAttr === this.state.start && endAttr === this.state.end || this.setAttributes({
43996
+ isValid(start) && isValid(end) && (start !== this.state.start || end !== this.state.end) && (this.state.start = start, this.state.end = end, startAttr === this.state.start && endAttr === this.state.end || (this.setAttributes({
43951
43997
  start: start,
43952
43998
  end: end
43953
- }));
43999
+ }), this._updateStateCallback && this._updateStateCallback(start, end)));
43954
44000
  }
43955
44001
  setPreviewData(data) {
43956
44002
  this._previewData = data;
@@ -44991,7 +45037,7 @@
44991
45037
  const innerGroupBounds = innerGroup.AABBBounds,
44992
45038
  innerGroupWidth = innerGroupBounds.width(),
44993
45039
  innerGroupHeight = innerGroupBounds.height(),
44994
- itemGroupWidth = this._itemWidthByUser || innerGroupWidth + parsedPadding[1] + parsedPadding[3],
45040
+ itemGroupWidth = isValid(this.attribute.item.width) ? this.attribute.item.width : innerGroupWidth + parsedPadding[1] + parsedPadding[3],
44995
45041
  itemGroupHeight = this._itemHeightByUser || innerGroupHeight + parsedPadding[0] + parsedPadding[2];
44996
45042
  return itemGroup.attribute.width = itemGroupWidth, itemGroup.attribute.height = itemGroupHeight, innerGroup.translateTo(-innerGroupBounds.x1 + parsedPadding[3], -innerGroupBounds.y1 + parsedPadding[0]), itemGroup;
44997
45043
  }
@@ -51553,6 +51599,8 @@
51553
51599
  ChartEvent["legendItemClick"] = "legendItemClick";
51554
51600
  ChartEvent["legendItemHover"] = "legendItemHover";
51555
51601
  ChartEvent["legendItemUnHover"] = "legendItemUnHover";
51602
+ ChartEvent["tooltipShow"] = "tooltipShow";
51603
+ ChartEvent["tooltipHide"] = "tooltipHide";
51556
51604
  })(ChartEvent || (ChartEvent = {}));
51557
51605
  var Event_Source_Type;
51558
51606
  (function (Event_Source_Type) {
@@ -53171,19 +53219,33 @@
53171
53219
  return true;
53172
53220
  };
53173
53221
  const getDimensionData = (value, axis, coordinate, getDimensionField) => {
53222
+ const scale = axis.getScale();
53223
+ const isDiscreteAxis = isDiscrete(scale.type);
53174
53224
  const data = [];
53175
53225
  const regions = axis.getRegions();
53176
53226
  for (const region of regions) {
53177
53227
  const seriesList = region.getSeries();
53178
53228
  for (const series of seriesList) {
53179
53229
  if (series.coordinate === coordinate) {
53180
- const dimensionField = getDimensionField(series);
53230
+ const dimensionField = array(getDimensionField(series));
53181
53231
  const viewData = series.getViewData()?.latestData;
53182
53232
  if (dimensionField && viewData) {
53183
- data.push({
53184
- series,
53185
- datum: viewData.filter((datum) => datum[dimensionField]?.toString() === value?.toString())
53186
- });
53233
+ if (isDiscreteAxis) {
53234
+ data.push({
53235
+ series,
53236
+ datum: viewData.filter((datum) => datum[dimensionField[0]]?.toString() === value?.toString())
53237
+ });
53238
+ }
53239
+ else {
53240
+ data.push({
53241
+ series,
53242
+ datum: viewData.filter((datum) => datum[dimensionField[0]]?.toString() === value?.toString() ||
53243
+ (isValid(datum[dimensionField[0]]) &&
53244
+ isValid(datum[dimensionField[1]]) &&
53245
+ value >= datum[dimensionField[0]] &&
53246
+ value < datum[dimensionField[1]]))
53247
+ });
53248
+ }
53187
53249
  }
53188
53250
  }
53189
53251
  }
@@ -53276,8 +53338,10 @@
53276
53338
  }
53277
53339
  return null;
53278
53340
  };
53279
- const XAxisGetDimensionField = (series) => series.fieldX[0];
53280
- const YAxisGetDimensionField = (series) => series.fieldY[0];
53341
+ const discreteXAxisGetDimensionField = (series) => series.fieldX[0];
53342
+ const discreteYAxisGetDimensionField = (series) => series.fieldY[0];
53343
+ const continuousXAxisGetDimensionField = (series) => [series.fieldX[0], series.fieldX2];
53344
+ const continuousYAxisGetDimensionField = (series) => [series.fieldY[0], series.fieldY2];
53281
53345
  const getCartesianDimensionInfo = (chart, pos) => {
53282
53346
  if (!chart) {
53283
53347
  return null;
@@ -53292,13 +53356,15 @@
53292
53356
  const targetAxisInfo = [];
53293
53357
  if (xAxisList) {
53294
53358
  xAxisList.forEach(axis => {
53295
- const info = getDiscreteAxisDimensionInfo(axis, x, 'x', XAxisGetDimensionField);
53359
+ const isDiscreteAxis = isDiscrete(axis.getScale().type);
53360
+ const info = getDimensionInfoByPosition(axis, x, 'x', isDiscreteAxis ? discreteXAxisGetDimensionField : continuousXAxisGetDimensionField);
53296
53361
  info && targetAxisInfo.push(info);
53297
53362
  });
53298
53363
  }
53299
53364
  if (yAxisList) {
53300
53365
  yAxisList.forEach(axis => {
53301
- const info = getDiscreteAxisDimensionInfo(axis, y, 'y', YAxisGetDimensionField);
53366
+ const isDiscreteAxis = isDiscrete(axis.getScale().type);
53367
+ const info = getDimensionInfoByPosition(axis, y, 'y', isDiscreteAxis ? discreteYAxisGetDimensionField : continuousYAxisGetDimensionField);
53302
53368
  info && targetAxisInfo.push(info);
53303
53369
  });
53304
53370
  }
@@ -53307,20 +53373,17 @@
53307
53373
  }
53308
53374
  return targetAxisInfo;
53309
53375
  };
53310
- const getDiscreteAxisDimensionInfo = (axis, posValue, posKey, getDimensionField) => {
53376
+ const getDimensionInfoByPosition = (axis, posValue, posKey, getDimensionField) => {
53311
53377
  const scale = axis.getScale();
53312
53378
  const scalePos = posValue - axis.getLayoutStartPoint()[posKey];
53313
53379
  if ((scalePos - scale.range()[0]) * (scalePos - scale.range()[1]) > 0) {
53314
53380
  return null;
53315
53381
  }
53316
53382
  const value = scale.invert(scalePos);
53317
- return getDimensionInfoInAxis(axis, value, getDimensionField);
53383
+ return getDimensionInfoByValue(axis, value, getDimensionField);
53318
53384
  };
53319
- const getDimensionInfoInAxis = (axis, value, getDimensionField) => {
53385
+ const getDimensionInfoByValue = (axis, value, getDimensionField) => {
53320
53386
  const scale = axis.getScale();
53321
- if (!scale || !isDiscrete(scale.type)) {
53322
- return null;
53323
- }
53324
53387
  if (isNil(value)) {
53325
53388
  return null;
53326
53389
  }
@@ -53329,7 +53392,7 @@
53329
53392
  if (index < 0) {
53330
53393
  index = undefined;
53331
53394
  }
53332
- const data = getDimensionData(value, axis, 'cartesian', getDimensionField ?? (isXAxis(axis.orient) ? XAxisGetDimensionField : YAxisGetDimensionField));
53395
+ const data = getDimensionData(value, axis, 'cartesian', getDimensionField ?? (isXAxis(axis.orient) ? discreteXAxisGetDimensionField : discreteYAxisGetDimensionField));
53333
53396
  return { index, value, axis, data };
53334
53397
  };
53335
53398
 
@@ -53498,7 +53561,7 @@
53498
53561
  });
53499
53562
  const dimensionInfo = [];
53500
53563
  axis.forEach(a => {
53501
- const info = getDimensionInfoInAxis(a, v);
53564
+ const info = getDimensionInfoByValue(a, v);
53502
53565
  if (info) {
53503
53566
  dimensionInfo.push(info);
53504
53567
  }
@@ -54071,10 +54134,6 @@
54071
54134
  function getMapSource(type) {
54072
54135
  return geoSourceMap.get(type);
54073
54136
  }
54074
- function clearMapSource() {
54075
- geoSourceMap.clear();
54076
- mapDataSet = null;
54077
- }
54078
54137
 
54079
54138
  function copyOneDataView(d, deep = false) {
54080
54139
  let _deep = deep;
@@ -54679,6 +54738,7 @@
54679
54738
  this._currentThemeName = ThemeManager.getCurrentThemeName();
54680
54739
  this._setSpec(spec);
54681
54740
  this._updateCurrentTheme();
54741
+ const specBackground = typeof spec.background === 'string' ? spec.background : null;
54682
54742
  this._compiler = new Compiler({
54683
54743
  dom: this._container ?? 'none',
54684
54744
  canvas: renderCanvas
@@ -54687,7 +54747,7 @@
54687
54747
  stage,
54688
54748
  pluginList: poptip !== false ? ['poptipForText'] : [],
54689
54749
  ...restOptions,
54690
- background: spec.background || this._currentTheme.background || this._option.background,
54750
+ background: specBackground || this._currentTheme.background || this._option.background,
54691
54751
  onError: this._onError
54692
54752
  });
54693
54753
  this._eventDispatcher = new EventDispatcher(this, this._compiler);
@@ -54911,7 +54971,6 @@
54911
54971
  this._compiler?.release();
54912
54972
  this._eventDispatcher?.release();
54913
54973
  this._unBindResizeEvent();
54914
- clearMapSource();
54915
54974
  this._releaseData();
54916
54975
  this._chart = null;
54917
54976
  this._compiler = null;
@@ -55647,14 +55706,6 @@
55647
55706
  layoutPaddingBottom = 0;
55648
55707
  layoutOffsetX = 0;
55649
55708
  layoutOffsetY = 0;
55650
- _attributeTag = true;
55651
- getAttributeTag() {
55652
- return this._attributeTag;
55653
- }
55654
- setAttributeTag(tag) {
55655
- this._attributeTag = tag;
55656
- return this._attributeTag;
55657
- }
55658
55709
  layoutLevel = LayoutLevel.Region;
55659
55710
  layoutZIndex = 0;
55660
55711
  chartLayoutRect;
@@ -58119,7 +58170,7 @@
58119
58170
  VChart.useMark([ComponentMark, GroupMark, ImageMark]);
58120
58171
  Factory.registerRegion('region', Region);
58121
58172
  Factory.registerLayout('base', Layout);
58122
- const version = "1.2.0-beta.1";
58173
+ const version = "1.2.0-beta.3";
58123
58174
  Logger.getInstance(LoggerLevel.Error);
58124
58175
 
58125
58176
  var SeriesMarkNameEnum;
@@ -58551,7 +58602,7 @@
58551
58602
  }
58552
58603
  stack(stackCache) {
58553
58604
  if (stackCache.values.length > 0) {
58554
- let positiveStart = Number.EPSILON;
58605
+ let positiveStart = 0;
58555
58606
  let negativeStart = 0;
58556
58607
  let sign = 1;
58557
58608
  let value = 0;
@@ -58572,8 +58623,8 @@
58572
58623
  value = v[STACK_FIELD_END];
58573
58624
  const denominator = value >= 0 ? positiveStart : negativeStart;
58574
58625
  sign = value >= 0 ? 1 : -1;
58575
- v[STACK_FIELD_START_PERCENT] = Math.min(1, v[STACK_FIELD_START] / denominator) * sign;
58576
- v[STACK_FIELD_END_PERCENT] = Math.min(1, v[STACK_FIELD_END] / denominator) * sign;
58626
+ v[STACK_FIELD_START_PERCENT] = denominator === 0 ? 0 : Math.min(1, v[STACK_FIELD_START] / denominator) * sign;
58627
+ v[STACK_FIELD_END_PERCENT] = denominator === 0 ? 0 : Math.min(1, v[STACK_FIELD_END] / denominator) * sign;
58577
58628
  });
58578
58629
  }
58579
58630
  for (const key in stackCache.nodes) {
@@ -58665,6 +58716,7 @@
58665
58716
  padding = { top: 0, left: 0, right: 0, bottom: 0 };
58666
58717
  _paddingSpec;
58667
58718
  _canvasRect;
58719
+ _backgroundMark;
58668
58720
  constructor(spec, option) {
58669
58721
  super(option);
58670
58722
  this._theme = option.getTheme();
@@ -58687,6 +58739,7 @@
58687
58739
  created() {
58688
58740
  this.transformSpec(this._spec);
58689
58741
  this.createGlobalScale();
58742
+ this.createBackground(this._spec.background);
58690
58743
  this.createLayout();
58691
58744
  this.createRegion(this._spec.region);
58692
58745
  this.createSeries(this._spec.series);
@@ -58723,6 +58776,28 @@
58723
58776
  this._updateLayoutRect(viewBox);
58724
58777
  this.setLayoutTag(true);
58725
58778
  }
58779
+ createBackground(bg) {
58780
+ if (!bg) {
58781
+ return;
58782
+ }
58783
+ if (typeof bg !== 'object') {
58784
+ return;
58785
+ }
58786
+ this._backgroundMark = Factory.createMark(MarkTypeEnum.group, 'chart-background', {
58787
+ model: this,
58788
+ map: this._option.map,
58789
+ getCompiler: this.getCompiler,
58790
+ globalScale: this._globalScale
58791
+ });
58792
+ this._backgroundMark.created();
58793
+ this._backgroundMark.setStyle(convertBackgroundSpec(bg));
58794
+ this._backgroundMark.setStyle({
58795
+ x: () => this._viewBox.x1,
58796
+ y: () => this._viewBox.y1,
58797
+ width: () => this._viewBox.x2 - this._viewBox.x1,
58798
+ height: () => this._viewBox.y2 - this._viewBox.y1
58799
+ });
58800
+ }
58726
58801
  createRegion(regionSpec) {
58727
58802
  if (!regionSpec) {
58728
58803
  return;
@@ -59297,7 +59372,8 @@
59297
59372
  large: spec.large,
59298
59373
  largeThreshold: spec.largeThreshold,
59299
59374
  progressiveStep: spec.progressiveStep,
59300
- progressiveThreshold: spec.progressiveThreshold
59375
+ progressiveThreshold: spec.progressiveThreshold,
59376
+ background: spec.seriesBackground
59301
59377
  };
59302
59378
  return series;
59303
59379
  }
@@ -59357,6 +59433,7 @@
59357
59433
  });
59358
59434
  }
59359
59435
  compile() {
59436
+ this.compileBackground();
59360
59437
  this.compileLayout();
59361
59438
  this.compileRegions();
59362
59439
  this.compileSeries();
@@ -59377,6 +59454,21 @@
59377
59454
  const { width, height } = this.getCanvasRect();
59378
59455
  this.getCompiler().setSize(width, height);
59379
59456
  }
59457
+ compileBackground() {
59458
+ if (!this._backgroundMark) {
59459
+ return;
59460
+ }
59461
+ this._backgroundMark.compile();
59462
+ this._backgroundMark
59463
+ .getProduct()
59464
+ ?.configure({
59465
+ context: {
59466
+ model: this
59467
+ }
59468
+ })
59469
+ .layout(() => {
59470
+ });
59471
+ }
59380
59472
  compileRegions() {
59381
59473
  this._option.performanceHook?.beforeRegionCompile?.();
59382
59474
  this.getAllRegions().forEach(r => {
@@ -59421,7 +59513,6 @@
59421
59513
  }
59422
59514
  if (model && mark.isUpdated) {
59423
59515
  model.bindSceneNode?.(sceneRoot.elements[0]);
59424
- model.setAttributeTag(true);
59425
59516
  return;
59426
59517
  }
59427
59518
  if (mark.markType === 'group') {
@@ -64043,13 +64134,14 @@
64043
64134
  }
64044
64135
  return lineMark;
64045
64136
  }
64046
- initSymbolMark(progressive) {
64137
+ initSymbolMark(progressive, isSeriesMark) {
64047
64138
  this._symbolMark = this._createMark(lineLikeSeriesMarkMap.point, {
64048
64139
  morph: shouldDoMorph(this._spec.animation, this._spec.morph, userAnimationConfig('point', this._spec)),
64049
64140
  defaultMorphElementKey: this.getDimensionField()[0],
64050
64141
  groupKey: this._seriesField,
64051
64142
  label: merge$2({ animation: this._spec.animation }, this._spec.label),
64052
- progressive
64143
+ progressive,
64144
+ isSeriesMark: !!isSeriesMark
64053
64145
  });
64054
64146
  return this._symbolMark;
64055
64147
  }
@@ -64196,8 +64288,9 @@
64196
64288
  large: this._spec.large,
64197
64289
  largeThreshold: this._spec.largeThreshold
64198
64290
  };
64199
- this.initLineMark(progressive);
64200
- this.initSymbolMark(progressive);
64291
+ const seriesMark = this._spec.seriesMark ?? 'line';
64292
+ this.initLineMark(progressive, seriesMark === 'line');
64293
+ this.initSymbolMark(progressive, seriesMark === 'point');
64201
64294
  }
64202
64295
  initMarkStyle() {
64203
64296
  this.initLineMarkStyle(this._direction);
@@ -64212,8 +64305,11 @@
64212
64305
  }
64213
64306
  }
64214
64307
  getSeriesStyle(datum) {
64308
+ const isLineAsSeriesMark = this._spec.seriesMark !== 'point';
64215
64309
  return (attribute) => {
64216
- attribute === 'fill' && (attribute = 'stroke');
64310
+ if (isLineAsSeriesMark) {
64311
+ attribute === 'fill' && (attribute = 'stroke');
64312
+ }
64217
64313
  return this._seriesMark?.getAttribute(attribute, datum) ?? null;
64218
64314
  };
64219
64315
  }
@@ -64651,14 +64747,15 @@
64651
64747
  largeThreshold: this._spec.largeThreshold
64652
64748
  };
64653
64749
  const isAreaVisible = this._spec.area?.visible !== false && this._spec.area?.style?.visible !== false;
64750
+ const seriesMark = this._spec.seriesMark ?? 'area';
64654
64751
  this._areaMark = this._createMark(AreaSeries.mark.area, {
64655
64752
  groupKey: this._seriesField,
64656
64753
  defaultMorphElementKey: this.getDimensionField()[0],
64657
64754
  progressive,
64658
- isSeriesMark: isAreaVisible
64755
+ isSeriesMark: isAreaVisible && seriesMark === 'area'
64659
64756
  });
64660
- this.initLineMark(progressive, !isAreaVisible);
64661
- this.initSymbolMark(progressive);
64757
+ this.initLineMark(progressive, seriesMark === 'line' || (seriesMark === 'area' && !isAreaVisible));
64758
+ this.initSymbolMark(progressive, seriesMark === 'point');
64662
64759
  }
64663
64760
  initMarkStyle() {
64664
64761
  const userCurveType = this.getSpec().area?.style?.curveType ?? this.getSpec().line?.style?.curveType;
@@ -66577,7 +66674,7 @@
66577
66674
  }, {
66578
66675
  morph: shouldDoMorph(this._spec.animation, this._spec.morph, userAnimationConfig(this.type, this._spec)),
66579
66676
  defaultMorphElementKey: this._seriesField,
66580
- key: this._seriesField,
66677
+ key: DEFAULT_DATA_KEY,
66581
66678
  groupKey: this._seriesField,
66582
66679
  skipBeforeLayouted: true,
66583
66680
  isSeriesMark: true
@@ -67368,9 +67465,10 @@
67368
67465
  largeThreshold: this._spec.largeThreshold
67369
67466
  };
67370
67467
  const isAreaVisible = this._spec.area?.visible !== false && this._spec.area?.style?.visible !== false;
67371
- this.initAreaMark(progressive, isAreaVisible);
67372
- this.initLineMark(progressive, !isAreaVisible);
67373
- this.initSymbolMark(progressive);
67468
+ const seriesMark = this._spec.seriesMark ?? 'area';
67469
+ this.initAreaMark(progressive, isAreaVisible && seriesMark === 'area');
67470
+ this.initLineMark(progressive, seriesMark === 'line' || (seriesMark === 'area' && !isAreaVisible));
67471
+ this.initSymbolMark(progressive, seriesMark === 'point');
67374
67472
  }
67375
67473
  initMarkStyle() {
67376
67474
  this.initAreaMarkStyle();
@@ -70889,6 +70987,16 @@
70889
70987
  }
70890
70988
  setValueFieldToPercent() {
70891
70989
  }
70990
+ updateSpec(spec) {
70991
+ const originalSpec = this._originalSpec;
70992
+ const result = super.updateSpec(spec);
70993
+ if (!isEqual$1(originalSpec, spec)) {
70994
+ result.reMake = true;
70995
+ result.reCompile = true;
70996
+ return result;
70997
+ }
70998
+ return result;
70999
+ }
70892
71000
  }
70893
71001
 
70894
71002
  class WordCloudSeries extends BaseWordCloudSeries {
@@ -73904,6 +74012,29 @@
73904
74012
  else {
73905
74013
  data = data[0];
73906
74014
  }
74015
+ if (op.sourceField !== 'source' || op.targetField !== 'target') {
74016
+ for (const key in data) {
74017
+ if (key === 'links') {
74018
+ const updatedData = [];
74019
+ data[key].forEach((datum) => {
74020
+ const updatedDatum = {};
74021
+ for (const key in datum) {
74022
+ if (key === op.sourceField) {
74023
+ updatedDatum.source = datum[op.sourceField];
74024
+ }
74025
+ else if (key === op.targetField) {
74026
+ updatedDatum.target = datum[op.targetField];
74027
+ }
74028
+ else {
74029
+ updatedDatum[key] = datum[key];
74030
+ }
74031
+ }
74032
+ updatedData.push(updatedDatum);
74033
+ });
74034
+ data[key] = updatedData;
74035
+ }
74036
+ }
74037
+ }
73907
74038
  const layout = new SankeyLayout(op);
73908
74039
  const result = [];
73909
74040
  result.push(layout.layout(data, view));
@@ -74083,13 +74214,15 @@
74083
74214
  y1: this._viewBox.y2
74084
74215
  };
74085
74216
  },
74217
+ sourceField: this._spec.sourceField,
74218
+ targetField: this._spec.targetField,
74086
74219
  direction: this._spec.direction,
74087
- nodeAlign: this._spec.nodeAlign,
74088
- nodeGap: this._spec.nodeGap,
74089
- nodeWidth: this._spec.nodeWidth,
74220
+ nodeAlign: this._spec.nodeAlign ?? 'justify',
74221
+ nodeGap: this._spec.nodeGap ?? 8,
74222
+ nodeWidth: this._spec.nodeWidth ?? 10,
74090
74223
  linkWidth: this._spec.linkWidth,
74091
74224
  minStepWidth: this._spec.minStepWidth,
74092
- minNodeHeight: this._spec.minNodeHeight,
74225
+ minNodeHeight: this._spec.minNodeHeight ?? 4,
74093
74226
  minLinkHeight: this._spec.minLinkHeight,
74094
74227
  iterations: this._spec.iterations,
74095
74228
  nodeKey: this._spec.nodeKey,
@@ -75867,7 +76000,8 @@
75867
76000
  invalidType: spec.invalidType || 'break',
75868
76001
  point: spec.point,
75869
76002
  line: spec.line,
75870
- area: spec.area
76003
+ area: spec.area,
76004
+ seriesMark: spec.seriesMark ?? 'area'
75871
76005
  };
75872
76006
  }
75873
76007
  transformSpec(spec) {
@@ -76404,7 +76538,8 @@
76404
76538
  ...super._getDefaultSeriesSpec(spec),
76405
76539
  invalidType: spec.invalidType || 'break',
76406
76540
  point: spec.point,
76407
- line: spec.line
76541
+ line: spec.line,
76542
+ seriesMark: spec.seriesMark ?? 'line'
76408
76543
  };
76409
76544
  }
76410
76545
  transformSpec(spec) {
@@ -76698,7 +76833,8 @@
76698
76833
  percent: spec.percent,
76699
76834
  area: merge$2({
76700
76835
  visible: false
76701
- }, spec.area)
76836
+ }, spec.area),
76837
+ seriesMark: spec.seriesMark ?? 'area'
76702
76838
  };
76703
76839
  }
76704
76840
  transformSpec(spec) {
@@ -81155,8 +81291,19 @@
81155
81291
  if (!this._expand) {
81156
81292
  return;
81157
81293
  }
81158
- const domainMin = domain[0];
81159
- const domainMax = domain[domain.length - 1];
81294
+ let domainMin = domain[0];
81295
+ let domainMax = domain[domain.length - 1];
81296
+ if (domainMin === domainMax) {
81297
+ if (domainMax === 0) {
81298
+ domainMax = 1;
81299
+ }
81300
+ else if (domainMax > 0) {
81301
+ domainMin = 0;
81302
+ }
81303
+ else if (domainMax < 0) {
81304
+ domainMax = 0;
81305
+ }
81306
+ }
81160
81307
  if (isValid(this._expand.min)) {
81161
81308
  domain[0] = domainMin - (domainMax - domainMin) * this._expand.min;
81162
81309
  }
@@ -81165,6 +81312,10 @@
81165
81312
  }
81166
81313
  }
81167
81314
  niceDomain(domain) {
81315
+ const { min: userMin, max: userMax } = getLinearAxisSpecDomain(this._spec);
81316
+ if (isValid(userMin) || isValid(userMax)) {
81317
+ return domain;
81318
+ }
81168
81319
  if (Math.abs(minInArray(domain) - maxInArray(domain)) <= 1e-12) {
81169
81320
  let num = domain[0];
81170
81321
  const flag = num >= 0 ? 1 : -1;
@@ -82110,7 +82261,7 @@
82110
82261
  selectedData.forEach(s => {
82111
82262
  selectedFilter[s] = true;
82112
82263
  });
82113
- const datumField = field();
82264
+ const datumField = field() ?? DEFAULT_DATA_SERIES_FIELD;
82114
82265
  if (isValid(datumField)) {
82115
82266
  data = data.filter(d => selectedFilter[d[datumField]] === true);
82116
82267
  }
@@ -82819,7 +82970,6 @@
82819
82970
  }
82820
82971
  updateDatum(datum) {
82821
82972
  this._activeDatum = datum;
82822
- this.setAttributeTag(true);
82823
82973
  this._displayData.updateData();
82824
82974
  const attrs = this._getIndicatorAttrs();
82825
82975
  this._createOrUpdateIndicatorComponent(attrs);
@@ -83204,9 +83354,26 @@
83204
83354
  this._actualScale = this._spec.zoomLimit?.max;
83205
83355
  scale = this._spec.zoomLimit?.max / _lastActualScale;
83206
83356
  }
83207
- event.zoomDelta = scale;
83357
+ if (event) {
83358
+ event.zoomDelta = scale;
83359
+ }
83208
83360
  this.zoom(scale, [params.zoomX, params.zoomY]);
83361
+ return scale;
83209
83362
  };
83363
+ dispatchZoom(zoomDelta, center) {
83364
+ const scaleCenter = center || {
83365
+ x: this.getLayoutStartPoint().x + this.getLayoutRect().width / 2,
83366
+ y: this.getLayoutStartPoint().y + this.getLayoutRect().height / 2
83367
+ };
83368
+ const scale = this._handleChartZoom({ zoomDelta, zoomX: scaleCenter.x, zoomY: scaleCenter.y });
83369
+ if (scale !== 1) {
83370
+ this.event.emit('zoom', {
83371
+ scale,
83372
+ scaleCenter,
83373
+ model: this
83374
+ });
83375
+ }
83376
+ }
83210
83377
  initEvent() {
83211
83378
  this.event.on(ChartEvent.scaleUpdate, { filter: ({ model }) => model?.id === this.id }, this.effect.scaleUpdate.bind(this));
83212
83379
  if (this._spec.roam) {
@@ -86435,7 +86602,7 @@
86435
86602
  return TooltipResult.success;
86436
86603
  };
86437
86604
  hideTooltip(params) {
86438
- this.changeTooltip(false, params);
86605
+ return this.changeTooltip(false, params);
86439
86606
  }
86440
86607
  release() {
86441
86608
  this._cacheViewSpec = undefined;
@@ -87499,6 +87666,9 @@
87499
87666
  _getParentElement(spec) {
87500
87667
  return this._container ?? super._getParentElement(spec);
87501
87668
  }
87669
+ isTooltipShown() {
87670
+ return this.getVisibility();
87671
+ }
87502
87672
  reInit() {
87503
87673
  super.reInit();
87504
87674
  this._initStyle();
@@ -87550,7 +87720,9 @@
87550
87720
  if (!visible) {
87551
87721
  if (this._tooltipComponent && this._tooltipComponent.attribute.visible) {
87552
87722
  this._tooltipComponent.hideAll();
87553
- stage.renderNextFrame();
87723
+ this._tooltipComponent.setAttributes({
87724
+ visibleAll: false
87725
+ });
87554
87726
  }
87555
87727
  return;
87556
87728
  }
@@ -87560,7 +87732,6 @@
87560
87732
  const pos = actualTooltip?.position;
87561
87733
  if (!params.changePositionOnly) {
87562
87734
  this._tooltipComponent.setAttributes({
87563
- visible: true,
87564
87735
  ...this._attributeCache,
87565
87736
  ...pos
87566
87737
  });
@@ -87570,8 +87741,14 @@
87570
87741
  }
87571
87742
  if (!this._tooltipComponent.attribute.visible) {
87572
87743
  this._tooltipComponent.showAll();
87744
+ this._tooltipComponent.setAttributes({
87745
+ visibleAll: true
87746
+ });
87573
87747
  }
87574
87748
  }
87749
+ isTooltipShown() {
87750
+ return this._tooltipComponent?.attribute.visibleAll;
87751
+ }
87575
87752
  release() {
87576
87753
  super.release();
87577
87754
  this._layer?.release();
@@ -87585,6 +87762,12 @@
87585
87762
  this.component = component;
87586
87763
  }
87587
87764
  _showTooltipByHandler = (data, params) => {
87765
+ this.component.event.emit(ChartEvent.tooltipShow, {
87766
+ ...params,
87767
+ tooltipData: data,
87768
+ activeType: this.activeType,
87769
+ tooltip: this.component
87770
+ });
87588
87771
  if (this.component.tooltipHandler?.showTooltip && isValid(data)) {
87589
87772
  return this.component.tooltipHandler.showTooltip(this.activeType, data, params) ?? TooltipResult.success;
87590
87773
  }
@@ -87607,14 +87790,9 @@
87607
87790
  if (isNil(info)) {
87608
87791
  return false;
87609
87792
  }
87610
- if (![TooltipHandlerType.dom, TooltipHandlerType.canvas].includes(this.component.tooltipHandler.type)) {
87611
- return true;
87612
- }
87613
87793
  const helper = params.model?.tooltipHelper;
87614
- if (isEmptyPos(params) || isNil(helper)) {
87615
- return true;
87616
- }
87617
- if (!helper.activeType.includes('dimension')) {
87794
+ const activeType = helper?.activeType ?? this.component.getSpec().activeType;
87795
+ if (!activeType.includes('dimension')) {
87618
87796
  return false;
87619
87797
  }
87620
87798
  return true;
@@ -87636,6 +87814,9 @@
87636
87814
  else if (targetDimensionInfo.length > 1) {
87637
87815
  const dimensionAxisInfo = targetDimensionInfo.filter(info => {
87638
87816
  const axis = info.axis;
87817
+ if (!isDiscrete(axis.getScale().type)) {
87818
+ return false;
87819
+ }
87639
87820
  let firstSeries;
87640
87821
  for (const region of axis?.getRegions() ?? []) {
87641
87822
  for (const series of region.getSeries()) {
@@ -87648,7 +87829,7 @@
87648
87829
  break;
87649
87830
  }
87650
87831
  }
87651
- if (isValid(firstSeries) && firstSeries.getDimensionField() === firstSeries.fieldY) {
87832
+ if (isValid(firstSeries) && firstSeries.getDimensionField()[0] === firstSeries.fieldY[0]) {
87652
87833
  return axis.orient === 'left' || axis.orient === 'right';
87653
87834
  }
87654
87835
  return axis.orient === 'bottom' || axis.orient === 'top';
@@ -87700,9 +87881,6 @@
87700
87881
  if (isNil(info)) {
87701
87882
  return false;
87702
87883
  }
87703
- if (![TooltipHandlerType.dom, TooltipHandlerType.canvas].includes(this.component.tooltipHandler.type)) {
87704
- return true;
87705
- }
87706
87884
  const helper = params.model?.tooltipHelper;
87707
87885
  if (!helper?.activeType.includes('mark')) {
87708
87886
  return false;
@@ -87762,6 +87940,10 @@
87762
87940
  _cacheInfo;
87763
87941
  _eventList = [];
87764
87942
  _processor;
87943
+ _isTooltipShown = false;
87944
+ isTooltipShown() {
87945
+ return this._isTooltipShown;
87946
+ }
87765
87947
  changeRegions(regions) {
87766
87948
  }
87767
87949
  _registerEvent() {
@@ -87788,6 +87970,7 @@
87788
87970
  });
87789
87971
  this._eventList = [];
87790
87972
  this.tooltipHandler?.release?.();
87973
+ this._isTooltipShown = false;
87791
87974
  }
87792
87975
  _initHandler() {
87793
87976
  const renderMode = this._spec.renderMode ?? 'html';
@@ -87902,6 +88085,9 @@
87902
88085
  this._cacheInfo = tooltipInfo;
87903
88086
  }
87904
88087
  }
88088
+ if (success) {
88089
+ this._isTooltipShown = true;
88090
+ }
87905
88091
  const vchart = this._option.globalInstance;
87906
88092
  if (success && VChart.globalConfig.uniqueTooltip) {
87907
88093
  VChart.hideTooltip(vchart.id);
@@ -87921,9 +88107,21 @@
87921
88107
  return result;
87922
88108
  };
87923
88109
  _hideTooltipByHandler = (params) => {
88110
+ if (!this._isTooltipShown && !this.tooltipHandler?.isTooltipShown?.()) {
88111
+ return TooltipResult.success;
88112
+ }
88113
+ this.event.emit(ChartEvent.tooltipHide, {
88114
+ ...params,
88115
+ tooltip: this
88116
+ });
87924
88117
  if (this.tooltipHandler?.hideTooltip) {
87925
- this.tooltipHandler.hideTooltip(params);
88118
+ const result = this.tooltipHandler.hideTooltip(params);
88119
+ if (!result) {
88120
+ this._isTooltipShown = false;
88121
+ }
88122
+ return result;
87926
88123
  }
88124
+ return TooltipResult.failed;
87927
88125
  };
87928
88126
  _initTheme(theme) {
87929
88127
  super._initTheme(theme);
@@ -87994,17 +88192,14 @@
87994
88192
  return result;
87995
88193
  }
87996
88194
  hideTooltip() {
87997
- if (!this.tooltipHandler?.hideTooltip) {
87998
- return false;
87999
- }
88000
- this._alwaysShow = false;
88001
- this.tooltipHandler.hideTooltip({
88195
+ const params = {
88002
88196
  changePositionOnly: false,
88003
88197
  item: undefined,
88004
88198
  datum: undefined,
88005
88199
  source: Event_Source_Type.chart
88006
- });
88007
- return true;
88200
+ };
88201
+ this._alwaysShow = false;
88202
+ return !this._hideTooltipByHandler(params);
88008
88203
  }
88009
88204
  _isSameAsCacheInfo(nextInfo) {
88010
88205
  if (nextInfo === this._cacheInfo) {