@visactor/vchart 1.4.2-beta.1 → 1.4.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 (295) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.js +464 -302
  3. package/build/index.min.js +1 -1
  4. package/build/tsconfig.tsbuildinfo +1 -1
  5. package/cjs/chart/base-chart.js +3 -1
  6. package/cjs/chart/base-chart.js.map +1 -1
  7. package/cjs/component/brush/brush.d.ts +1 -1
  8. package/cjs/component/brush/brush.js +32 -22
  9. package/cjs/component/brush/brush.js.map +1 -1
  10. package/cjs/component/custom-mark/custom-mark.js +2 -1
  11. package/cjs/component/custom-mark/custom-mark.js.map +1 -1
  12. package/cjs/component/data-zoom/data-filter-base-component.js +6 -4
  13. package/cjs/component/data-zoom/data-filter-base-component.js.map +1 -1
  14. package/cjs/component/legend/discrete/legend.js +12 -9
  15. package/cjs/component/legend/discrete/legend.js.map +1 -1
  16. package/cjs/component/marker/mark-area/mark-area.js +3 -3
  17. package/cjs/component/marker/mark-area/mark-area.js.map +1 -1
  18. package/cjs/component/marker/mark-line/mark-line.js +2 -2
  19. package/cjs/component/marker/mark-line/mark-line.js.map +1 -1
  20. package/cjs/component/marker/mark-point/mark-point.js +3 -3
  21. package/cjs/component/marker/mark-point/mark-point.js.map +1 -1
  22. package/cjs/component/tooltip/handler/base.d.ts +2 -4
  23. package/cjs/component/tooltip/handler/base.js +15 -38
  24. package/cjs/component/tooltip/handler/base.js.map +1 -1
  25. package/cjs/component/tooltip/handler/canvas/canvas-tooltip-handler.js +2 -2
  26. package/cjs/component/tooltip/handler/canvas/canvas-tooltip-handler.js.map +1 -1
  27. package/cjs/component/tooltip/handler/dom/dom-tooltip-handler.js +2 -2
  28. package/cjs/component/tooltip/handler/dom/dom-tooltip-handler.js.map +1 -1
  29. package/cjs/component/tooltip/handler/dom/util.d.ts +1 -2
  30. package/cjs/component/tooltip/handler/dom/util.js +14 -13
  31. package/cjs/component/tooltip/handler/dom/util.js.map +1 -1
  32. package/cjs/component/tooltip/handler/interface/style.d.ts +4 -23
  33. package/cjs/component/tooltip/handler/interface/style.js.map +1 -1
  34. package/cjs/component/tooltip/handler/utils/attribute.d.ts +9 -11
  35. package/cjs/component/tooltip/handler/utils/attribute.js +136 -126
  36. package/cjs/component/tooltip/handler/utils/attribute.js.map +1 -1
  37. package/cjs/component/tooltip/handler/utils/common.d.ts +8 -0
  38. package/cjs/component/tooltip/handler/utils/common.js +42 -2
  39. package/cjs/component/tooltip/handler/utils/common.js.map +1 -1
  40. package/cjs/component/tooltip/handler/utils/index.d.ts +0 -1
  41. package/cjs/component/tooltip/handler/utils/index.js +1 -2
  42. package/cjs/component/tooltip/handler/utils/index.js.map +1 -1
  43. package/cjs/component/tooltip/interface/common.d.ts +2 -2
  44. package/cjs/component/tooltip/interface/common.js.map +1 -1
  45. package/cjs/component/tooltip/interface/theme.d.ts +5 -3
  46. package/cjs/component/tooltip/interface/theme.js.map +1 -1
  47. package/cjs/component/tooltip/tooltip.d.ts +1 -0
  48. package/cjs/component/tooltip/tooltip.js +7 -4
  49. package/cjs/component/tooltip/tooltip.js.map +1 -1
  50. package/cjs/core/index.d.ts +1 -1
  51. package/cjs/core/index.js +1 -1
  52. package/cjs/core/index.js.map +1 -1
  53. package/cjs/core/util.d.ts +3 -0
  54. package/cjs/core/util.js +12 -0
  55. package/cjs/core/util.js.map +1 -0
  56. package/cjs/core/vchart.d.ts +3 -0
  57. package/cjs/core/vchart.js +2 -2
  58. package/cjs/core/vchart.js.map +1 -1
  59. package/cjs/interaction/trigger.js +1 -2
  60. package/cjs/layout/base-layout.js +2 -1
  61. package/cjs/mark/box-plot.js +1 -1
  62. package/cjs/model/base-model.d.ts +1 -0
  63. package/cjs/model/base-model.js +1 -0
  64. package/cjs/model/base-model.js.map +1 -1
  65. package/cjs/model/interface.d.ts +2 -1
  66. package/cjs/model/interface.js.map +1 -1
  67. package/cjs/series/area/area.d.ts +4 -1
  68. package/cjs/series/area/area.js +11 -0
  69. package/cjs/series/area/area.js.map +1 -1
  70. package/cjs/series/bar/bar.d.ts +2 -0
  71. package/cjs/series/bar/bar.js +3 -0
  72. package/cjs/series/bar/bar.js.map +1 -1
  73. package/cjs/series/base/base-series.d.ts +1 -0
  74. package/cjs/series/base/base-series.js +1 -1
  75. package/cjs/series/base/base-series.js.map +1 -1
  76. package/cjs/series/box-plot/box-plot.d.ts +2 -0
  77. package/cjs/series/box-plot/box-plot.js +3 -0
  78. package/cjs/series/box-plot/box-plot.js.map +1 -1
  79. package/cjs/series/circle-packing/circle-packing.d.ts +2 -0
  80. package/cjs/series/circle-packing/circle-packing.js +3 -0
  81. package/cjs/series/circle-packing/circle-packing.js.map +1 -1
  82. package/cjs/series/dot/dot.d.ts +1 -0
  83. package/cjs/series/dot/dot.js +3 -0
  84. package/cjs/series/dot/dot.js.map +1 -1
  85. package/cjs/series/funnel/funnel.d.ts +2 -0
  86. package/cjs/series/funnel/funnel.js +3 -0
  87. package/cjs/series/funnel/funnel.js.map +1 -1
  88. package/cjs/series/gauge/gauge-pointer.d.ts +2 -0
  89. package/cjs/series/gauge/gauge-pointer.js +3 -0
  90. package/cjs/series/gauge/gauge-pointer.js.map +1 -1
  91. package/cjs/series/gauge/gauge.d.ts +2 -0
  92. package/cjs/series/gauge/gauge.js +3 -0
  93. package/cjs/series/gauge/gauge.js.map +1 -1
  94. package/cjs/series/geo/geo.d.ts +2 -0
  95. package/cjs/series/geo/geo.js +3 -0
  96. package/cjs/series/geo/geo.js.map +1 -1
  97. package/cjs/series/heatmap/heatmap.d.ts +2 -0
  98. package/cjs/series/heatmap/heatmap.js +3 -0
  99. package/cjs/series/heatmap/heatmap.js.map +1 -1
  100. package/cjs/series/interface/series.d.ts +1 -0
  101. package/cjs/series/interface/series.js.map +1 -1
  102. package/cjs/series/line/line.d.ts +2 -0
  103. package/cjs/series/line/line.js +4 -1
  104. package/cjs/series/line/line.js.map +1 -1
  105. package/cjs/series/link/link.d.ts +1 -0
  106. package/cjs/series/link/link.js +3 -0
  107. package/cjs/series/link/link.js.map +1 -1
  108. package/cjs/series/map/map.d.ts +2 -0
  109. package/cjs/series/map/map.js +3 -0
  110. package/cjs/series/map/map.js.map +1 -1
  111. package/cjs/series/pie/pie.d.ts +1 -0
  112. package/cjs/series/pie/pie.js +3 -0
  113. package/cjs/series/pie/pie.js.map +1 -1
  114. package/cjs/series/polar/polar.js +1 -1
  115. package/cjs/series/polar/polar.js.map +1 -1
  116. package/cjs/series/progress/circular/circular.d.ts +2 -0
  117. package/cjs/series/progress/circular/circular.js +3 -0
  118. package/cjs/series/progress/circular/circular.js.map +1 -1
  119. package/cjs/series/progress/linear/linear.d.ts +2 -0
  120. package/cjs/series/progress/linear/linear.js +3 -0
  121. package/cjs/series/progress/linear/linear.js.map +1 -1
  122. package/cjs/series/radar/radar.d.ts +4 -2
  123. package/cjs/series/radar/radar.js +11 -0
  124. package/cjs/series/radar/radar.js.map +1 -1
  125. package/cjs/series/range-area/range-area.js.map +1 -1
  126. package/cjs/series/rose/rose.d.ts +2 -0
  127. package/cjs/series/rose/rose.js +3 -0
  128. package/cjs/series/rose/rose.js.map +1 -1
  129. package/cjs/series/sankey/sankey.d.ts +2 -0
  130. package/cjs/series/sankey/sankey.js +3 -0
  131. package/cjs/series/sankey/sankey.js.map +1 -1
  132. package/cjs/series/scatter/scatter.d.ts +2 -0
  133. package/cjs/series/scatter/scatter.js +3 -0
  134. package/cjs/series/scatter/scatter.js.map +1 -1
  135. package/cjs/series/sunburst/sunburst.d.ts +2 -0
  136. package/cjs/series/sunburst/sunburst.js +3 -0
  137. package/cjs/series/sunburst/sunburst.js.map +1 -1
  138. package/cjs/series/treemap/treemap.d.ts +2 -0
  139. package/cjs/series/treemap/treemap.js +3 -0
  140. package/cjs/series/treemap/treemap.js.map +1 -1
  141. package/cjs/series/word-cloud/base.d.ts +2 -0
  142. package/cjs/series/word-cloud/base.js +3 -0
  143. package/cjs/series/word-cloud/base.js.map +1 -1
  144. package/cjs/util/text.d.ts +3 -3
  145. package/cjs/util/text.js +5 -1
  146. package/cjs/util/text.js.map +1 -1
  147. package/esm/chart/base-chart.js +3 -1
  148. package/esm/chart/base-chart.js.map +1 -1
  149. package/esm/component/brush/brush.d.ts +1 -1
  150. package/esm/component/brush/brush.js +34 -21
  151. package/esm/component/brush/brush.js.map +1 -1
  152. package/esm/component/custom-mark/custom-mark.js +2 -1
  153. package/esm/component/custom-mark/custom-mark.js.map +1 -1
  154. package/esm/component/data-zoom/data-filter-base-component.js +6 -4
  155. package/esm/component/data-zoom/data-filter-base-component.js.map +1 -1
  156. package/esm/component/legend/discrete/legend.js +12 -9
  157. package/esm/component/legend/discrete/legend.js.map +1 -1
  158. package/esm/component/marker/mark-area/mark-area.js +5 -5
  159. package/esm/component/marker/mark-area/mark-area.js.map +1 -1
  160. package/esm/component/marker/mark-line/mark-line.js +4 -4
  161. package/esm/component/marker/mark-line/mark-line.js.map +1 -1
  162. package/esm/component/marker/mark-point/mark-point.js +5 -5
  163. package/esm/component/marker/mark-point/mark-point.js.map +1 -1
  164. package/esm/component/tooltip/handler/base.d.ts +2 -4
  165. package/esm/component/tooltip/handler/base.js +14 -39
  166. package/esm/component/tooltip/handler/base.js.map +1 -1
  167. package/esm/component/tooltip/handler/canvas/canvas-tooltip-handler.js +2 -2
  168. package/esm/component/tooltip/handler/canvas/canvas-tooltip-handler.js.map +1 -1
  169. package/esm/component/tooltip/handler/dom/dom-tooltip-handler.js +2 -2
  170. package/esm/component/tooltip/handler/dom/dom-tooltip-handler.js.map +1 -1
  171. package/esm/component/tooltip/handler/dom/util.d.ts +1 -2
  172. package/esm/component/tooltip/handler/dom/util.js +14 -14
  173. package/esm/component/tooltip/handler/dom/util.js.map +1 -1
  174. package/esm/component/tooltip/handler/interface/style.d.ts +4 -23
  175. package/esm/component/tooltip/handler/interface/style.js.map +1 -1
  176. package/esm/component/tooltip/handler/utils/attribute.d.ts +9 -11
  177. package/esm/component/tooltip/handler/utils/attribute.js +131 -123
  178. package/esm/component/tooltip/handler/utils/attribute.js.map +1 -1
  179. package/esm/component/tooltip/handler/utils/common.d.ts +8 -0
  180. package/esm/component/tooltip/handler/utils/common.js +41 -1
  181. package/esm/component/tooltip/handler/utils/common.js.map +1 -1
  182. package/esm/component/tooltip/handler/utils/index.d.ts +0 -1
  183. package/esm/component/tooltip/handler/utils/index.js +0 -2
  184. package/esm/component/tooltip/handler/utils/index.js.map +1 -1
  185. package/esm/component/tooltip/interface/common.d.ts +2 -2
  186. package/esm/component/tooltip/interface/common.js.map +1 -1
  187. package/esm/component/tooltip/interface/theme.d.ts +5 -3
  188. package/esm/component/tooltip/interface/theme.js.map +1 -1
  189. package/esm/component/tooltip/tooltip.d.ts +1 -0
  190. package/esm/component/tooltip/tooltip.js +7 -4
  191. package/esm/component/tooltip/tooltip.js.map +1 -1
  192. package/esm/core/index.d.ts +1 -1
  193. package/esm/core/index.js +1 -1
  194. package/esm/core/index.js.map +1 -1
  195. package/esm/core/util.d.ts +3 -0
  196. package/esm/core/util.js +6 -0
  197. package/esm/core/util.js.map +1 -0
  198. package/esm/core/vchart.d.ts +3 -0
  199. package/esm/core/vchart.js +3 -1
  200. package/esm/core/vchart.js.map +1 -1
  201. package/esm/interaction/trigger.js +1 -2
  202. package/esm/layout/base-layout.js +2 -1
  203. package/esm/mark/box-plot.js +1 -1
  204. package/esm/model/base-model.d.ts +1 -0
  205. package/esm/model/base-model.js +1 -0
  206. package/esm/model/base-model.js.map +1 -1
  207. package/esm/model/interface.d.ts +2 -1
  208. package/esm/model/interface.js.map +1 -1
  209. package/esm/series/area/area.d.ts +4 -1
  210. package/esm/series/area/area.js +12 -1
  211. package/esm/series/area/area.js.map +1 -1
  212. package/esm/series/bar/bar.d.ts +2 -0
  213. package/esm/series/bar/bar.js +3 -0
  214. package/esm/series/bar/bar.js.map +1 -1
  215. package/esm/series/base/base-series.d.ts +1 -0
  216. package/esm/series/base/base-series.js +1 -1
  217. package/esm/series/base/base-series.js.map +1 -1
  218. package/esm/series/box-plot/box-plot.d.ts +2 -0
  219. package/esm/series/box-plot/box-plot.js +3 -0
  220. package/esm/series/box-plot/box-plot.js.map +1 -1
  221. package/esm/series/circle-packing/circle-packing.d.ts +2 -0
  222. package/esm/series/circle-packing/circle-packing.js +3 -0
  223. package/esm/series/circle-packing/circle-packing.js.map +1 -1
  224. package/esm/series/dot/dot.d.ts +1 -0
  225. package/esm/series/dot/dot.js +3 -0
  226. package/esm/series/dot/dot.js.map +1 -1
  227. package/esm/series/funnel/funnel.d.ts +2 -0
  228. package/esm/series/funnel/funnel.js +3 -0
  229. package/esm/series/funnel/funnel.js.map +1 -1
  230. package/esm/series/gauge/gauge-pointer.d.ts +2 -0
  231. package/esm/series/gauge/gauge-pointer.js +3 -0
  232. package/esm/series/gauge/gauge-pointer.js.map +1 -1
  233. package/esm/series/gauge/gauge.d.ts +2 -0
  234. package/esm/series/gauge/gauge.js +3 -0
  235. package/esm/series/gauge/gauge.js.map +1 -1
  236. package/esm/series/geo/geo.d.ts +2 -0
  237. package/esm/series/geo/geo.js +3 -0
  238. package/esm/series/geo/geo.js.map +1 -1
  239. package/esm/series/heatmap/heatmap.d.ts +2 -0
  240. package/esm/series/heatmap/heatmap.js +3 -0
  241. package/esm/series/heatmap/heatmap.js.map +1 -1
  242. package/esm/series/interface/series.d.ts +1 -0
  243. package/esm/series/interface/series.js.map +1 -1
  244. package/esm/series/line/line.d.ts +2 -0
  245. package/esm/series/line/line.js +4 -1
  246. package/esm/series/line/line.js.map +1 -1
  247. package/esm/series/link/link.d.ts +1 -0
  248. package/esm/series/link/link.js +3 -0
  249. package/esm/series/link/link.js.map +1 -1
  250. package/esm/series/map/map.d.ts +2 -0
  251. package/esm/series/map/map.js +3 -0
  252. package/esm/series/map/map.js.map +1 -1
  253. package/esm/series/pie/pie.d.ts +1 -0
  254. package/esm/series/pie/pie.js +3 -0
  255. package/esm/series/pie/pie.js.map +1 -1
  256. package/esm/series/polar/polar.js +1 -1
  257. package/esm/series/polar/polar.js.map +1 -1
  258. package/esm/series/progress/circular/circular.d.ts +2 -0
  259. package/esm/series/progress/circular/circular.js +3 -0
  260. package/esm/series/progress/circular/circular.js.map +1 -1
  261. package/esm/series/progress/linear/linear.d.ts +2 -0
  262. package/esm/series/progress/linear/linear.js +3 -0
  263. package/esm/series/progress/linear/linear.js.map +1 -1
  264. package/esm/series/radar/radar.d.ts +4 -2
  265. package/esm/series/radar/radar.js +12 -1
  266. package/esm/series/radar/radar.js.map +1 -1
  267. package/esm/series/range-area/range-area.js.map +1 -1
  268. package/esm/series/rose/rose.d.ts +2 -0
  269. package/esm/series/rose/rose.js +3 -0
  270. package/esm/series/rose/rose.js.map +1 -1
  271. package/esm/series/sankey/sankey.d.ts +2 -0
  272. package/esm/series/sankey/sankey.js +3 -0
  273. package/esm/series/sankey/sankey.js.map +1 -1
  274. package/esm/series/scatter/scatter.d.ts +2 -0
  275. package/esm/series/scatter/scatter.js +3 -0
  276. package/esm/series/scatter/scatter.js.map +1 -1
  277. package/esm/series/sunburst/sunburst.d.ts +2 -0
  278. package/esm/series/sunburst/sunburst.js +3 -0
  279. package/esm/series/sunburst/sunburst.js.map +1 -1
  280. package/esm/series/treemap/treemap.d.ts +2 -0
  281. package/esm/series/treemap/treemap.js +3 -0
  282. package/esm/series/treemap/treemap.js.map +1 -1
  283. package/esm/series/word-cloud/base.d.ts +2 -0
  284. package/esm/series/word-cloud/base.js +3 -0
  285. package/esm/series/word-cloud/base.js.map +1 -1
  286. package/esm/util/text.d.ts +3 -3
  287. package/esm/util/text.js +2 -0
  288. package/esm/util/text.js.map +1 -1
  289. package/package.json +7 -7
  290. package/cjs/component/tooltip/handler/utils/style.d.ts +0 -4
  291. package/cjs/component/tooltip/handler/utils/style.js +0 -32
  292. package/cjs/component/tooltip/handler/utils/style.js.map +0 -1
  293. package/esm/component/tooltip/handler/utils/style.d.ts +0 -4
  294. package/esm/component/tooltip/handler/utils/style.js +0 -26
  295. package/esm/component/tooltip/handler/utils/style.js.map +0 -1
package/build/index.js CHANGED
@@ -14723,10 +14723,10 @@
14723
14723
  lineEnd() {
14724
14724
  switch (this._point) {
14725
14725
  case 2:
14726
- this.context.lineTo(this._x1, this._y1, !1 !== this._lastDefined2, this.lastPoint1);
14726
+ this.context.lineTo(this._x1, this._y1, !1 !== this._lastDefined1 && !1 !== this._lastDefined2, this.lastPoint1);
14727
14727
  break;
14728
14728
  case 3:
14729
- point$2(this, this._t0, slope2(this, this._t0), !1 !== this._lastDefined2, this.lastPoint1);
14729
+ point$2(this, this._t0, slope2(this, this._t0), !1 !== this._lastDefined1 && !1 !== this._lastDefined2, this.lastPoint1);
14730
14730
  }
14731
14731
  (this._line || 0 !== this._line && 1 === this._point) && this.context.closePath(), this._line = 1 - this._line;
14732
14732
  }
@@ -57268,6 +57268,9 @@
57268
57268
  fontSize: THEME_CONSTANTS.defaultFontSize
57269
57269
  });
57270
57270
  };
57271
+ const measureText = (text, textSpec, option, useNaiveCanvas) => {
57272
+ return initTextMeasure(textSpec, option, useNaiveCanvas).measure(text);
57273
+ };
57271
57274
 
57272
57275
  function mergeFields(targetFields, mergeFields) {
57273
57276
  for (let i = 0; i < mergeFields.length; i++) {
@@ -59329,6 +59332,10 @@
59329
59332
  return resultA;
59330
59333
  }
59331
59334
 
59335
+ const VCHART_UTILS = {
59336
+ measureText
59337
+ };
59338
+
59332
59339
  class VChart {
59333
59340
  static useChart(charts) {
59334
59341
  charts.forEach(c => Factory.registerChart(c.type, c));
@@ -60318,6 +60325,7 @@
60318
60325
  VChart.globalConfig = {
60319
60326
  uniqueTooltip: true
60320
60327
  };
60328
+ VChart.Utils = VCHART_UTILS;
60321
60329
 
60322
60330
  var STATE_VALUE_ENUM;
60323
60331
  (function (STATE_VALUE_ENUM) {
@@ -61114,6 +61122,8 @@
61114
61122
  }
61115
61123
  onDataUpdate() {
61116
61124
  }
61125
+ beforeRelease() {
61126
+ }
61117
61127
  release() {
61118
61128
  var _a;
61119
61129
  this._releaseEvent();
@@ -63462,7 +63472,7 @@
63462
63472
  VChart.useMark([ComponentMark, GroupMark, ImageMark]);
63463
63473
  Factory.registerRegion('region', Region);
63464
63474
  Factory.registerLayout('base', Layout);
63465
- const version = "1.4.2-beta.1";
63475
+ const version = "1.4.3";
63466
63476
  Logger.getInstance(LoggerLevel.Error);
63467
63477
 
63468
63478
  const WordCloud3dAnimation = (params) => {
@@ -66359,7 +66369,7 @@
66359
66369
  return [`${this.type}_${this.id}`];
66360
66370
  }
66361
66371
  getSeriesStyle(datum) {
66362
- return (attribute) => { var _a, _b; return (_b = (_a = this._seriesMark) === null || _a === void 0 ? void 0 : _a.getAttribute(attribute, datum)) !== null && _b !== void 0 ? _b : null; };
66372
+ return (attribute) => { var _a, _b; return (_b = (_a = this._seriesMark) === null || _a === void 0 ? void 0 : _a.getAttribute(attribute, datum)) !== null && _b !== void 0 ? _b : undefined; };
66363
66373
  }
66364
66374
  _getSeriesInfo(field, keys) {
66365
66375
  const defaultShapeType = this.getDefaultShapeType();
@@ -67218,6 +67228,23 @@
67218
67228
  getDefaultShapeType() {
67219
67229
  return 'square';
67220
67230
  }
67231
+ getActiveMarks() {
67232
+ return [this._areaMark, this._symbolMark, this._lineMark];
67233
+ }
67234
+ getSeriesStyle(datum) {
67235
+ return (attribute) => {
67236
+ var _a, _b, _c, _d;
67237
+ let result = (_b = (_a = this._seriesMark) === null || _a === void 0 ? void 0 : _a.getAttribute(attribute, datum)) !== null && _b !== void 0 ? _b : undefined;
67238
+ if (attribute === 'fill' && !result) {
67239
+ attribute = 'stroke';
67240
+ result = (_d = (_c = this._seriesMark) === null || _c === void 0 ? void 0 : _c.getAttribute(attribute, datum)) !== null && _d !== void 0 ? _d : undefined;
67241
+ }
67242
+ if (attribute === 'stroke' && isArray$4(result)) {
67243
+ return result[0];
67244
+ }
67245
+ return result;
67246
+ };
67247
+ }
67221
67248
  }
67222
67249
  AreaSeries.type = SeriesTypeEnum.area;
67223
67250
  AreaSeries.mark = areaSeriesMark;
@@ -68423,6 +68450,9 @@
68423
68450
  (_d = (_c = this._option.performanceHook) === null || _c === void 0 ? void 0 : _c.afterComponentCompile) === null || _d === void 0 ? void 0 : _d.call(_c);
68424
68451
  }
68425
68452
  release() {
68453
+ [...this._components, ...this._regions, ...this._series].forEach(m => {
68454
+ m.beforeRelease();
68455
+ });
68426
68456
  super.release();
68427
68457
  this.clear();
68428
68458
  [...this._components, ...this._regions, ...this._series].forEach(m => {
@@ -69153,6 +69183,9 @@
69153
69183
  getDefaultShapeType() {
69154
69184
  return 'square';
69155
69185
  }
69186
+ getActiveMarks() {
69187
+ return [this._rectMark];
69188
+ }
69156
69189
  }
69157
69190
  BarSeries.type = SeriesTypeEnum.bar;
69158
69191
  BarSeries.mark = barSeriesMark;
@@ -69711,6 +69744,9 @@
69711
69744
  getDefaultShapeType() {
69712
69745
  return 'square';
69713
69746
  }
69747
+ getActiveMarks() {
69748
+ return [this._boxPlotMark];
69749
+ }
69714
69750
  }
69715
69751
  BoxPlotSeries.type = SeriesTypeEnum.boxPlot;
69716
69752
  BoxPlotSeries.mark = boxPlotSeriesMark;
@@ -70937,6 +70973,9 @@
70937
70973
  _noAnimationDataKey(datum, index) {
70938
70974
  return undefined;
70939
70975
  }
70976
+ getActiveMarks() {
70977
+ return [this._circlePackingMark];
70978
+ }
70940
70979
  }
70941
70980
  CirclePackingSeries.type = SeriesTypeEnum.circlePacking;
70942
70981
  CirclePackingSeries.mark = circlePackingSeriesMark;
@@ -71773,6 +71812,9 @@
71773
71812
  getDefaultShapeType() {
71774
71813
  return 'square';
71775
71814
  }
71815
+ getActiveMarks() {
71816
+ return [this._funnelMark];
71817
+ }
71776
71818
  }
71777
71819
  FunnelSeries.type = SeriesTypeEnum.funnel;
71778
71820
  FunnelSeries.mark = funnelSeriesMark;
@@ -71963,9 +72005,8 @@
71963
72005
  _buildMarkAttributeContext() {
71964
72006
  super._buildMarkAttributeContext();
71965
72007
  this._markAttributeContext.valueToPosition = this.valueToPosition.bind(this);
71966
- this._markAttributeContext.getCenter = () => {
71967
- return this.angleAxisHelper.center();
71968
- };
72008
+ this._markAttributeContext.getCenter = () => this.angleAxisHelper.center();
72009
+ this._markAttributeContext.getLayoutRadius = () => this._computeLayoutRadius();
71969
72010
  }
71970
72011
  valueToPosition(angleValue, radiusValue) {
71971
72012
  if (isNil$1(angleValue) || isNil$1(radiusValue) || !this.angleAxisHelper || !this.radiusAxisHelper) {
@@ -72454,6 +72495,9 @@
72454
72495
  getDefaultShapeType() {
72455
72496
  return 'circle';
72456
72497
  }
72498
+ getActiveMarks() {
72499
+ return [];
72500
+ }
72457
72501
  }
72458
72502
  GaugePointerSeries.type = SeriesTypeEnum.gaugePointer;
72459
72503
  GaugePointerSeries.mark = gaugePointerSeriesMark;
@@ -72654,6 +72698,9 @@
72654
72698
  getDefaultShapeType() {
72655
72699
  return 'circle';
72656
72700
  }
72701
+ getActiveMarks() {
72702
+ return [];
72703
+ }
72657
72704
  }
72658
72705
  GaugeSeries.type = SeriesTypeEnum.gauge;
72659
72706
  GaugeSeries.mark = gaugeSeriesMark;
@@ -73070,6 +73117,9 @@
73070
73117
  getMeasureField() {
73071
73118
  return this.getFieldValue();
73072
73119
  }
73120
+ getActiveMarks() {
73121
+ return [this._cellMark];
73122
+ }
73073
73123
  }
73074
73124
  HeatmapSeries.type = SeriesTypeEnum.heatmap;
73075
73125
  HeatmapSeries.mark = heatmapSeriesMark;
@@ -73165,12 +73215,15 @@
73165
73215
  if (isLineAsSeriesMark) {
73166
73216
  attribute === 'fill' && (attribute = 'stroke');
73167
73217
  }
73168
- return (_b = (_a = this._seriesMark) === null || _a === void 0 ? void 0 : _a.getAttribute(attribute, datum)) !== null && _b !== void 0 ? _b : null;
73218
+ return (_b = (_a = this._seriesMark) === null || _a === void 0 ? void 0 : _a.getAttribute(attribute, datum)) !== null && _b !== void 0 ? _b : undefined;
73169
73219
  };
73170
73220
  }
73171
73221
  getDefaultShapeType() {
73172
73222
  return 'circle';
73173
73223
  }
73224
+ getActiveMarks() {
73225
+ return [this._lineMark, this._symbolMark];
73226
+ }
73174
73227
  }
73175
73228
  LineSeries.type = SeriesTypeEnum.line;
73176
73229
  LineSeries.mark = lineSeriesMark;
@@ -73527,6 +73580,9 @@
73527
73580
  (_a = this._mapViewData.getDataView()) === null || _a === void 0 ? void 0 : _a.reRunAllTransform();
73528
73581
  (_b = this._mapViewDataStatistics) === null || _b === void 0 ? void 0 : _b.reRunAllTransform();
73529
73582
  }
73583
+ getActiveMarks() {
73584
+ return [];
73585
+ }
73530
73586
  }
73531
73587
 
73532
73588
  const DEFAULT_MAP_LOOK_UP_KEY = `${PREFIX}_MAP_LOOK_UP_KEY`;
@@ -73797,6 +73853,9 @@
73797
73853
  _getDataIdKey() {
73798
73854
  return DEFAULT_DATA_INDEX;
73799
73855
  }
73856
+ getActiveMarks() {
73857
+ return [this._pathMark];
73858
+ }
73800
73859
  }
73801
73860
  MapSeries.type = SeriesTypeEnum.map;
73802
73861
  MapSeries.mark = mapSeriesMark;
@@ -74300,6 +74359,9 @@
74300
74359
  _noAnimationDataKey(datum, index) {
74301
74360
  return index;
74302
74361
  }
74362
+ getActiveMarks() {
74363
+ return [this._pieMark];
74364
+ }
74303
74365
  }
74304
74366
  BasePieSeries.mark = pieSeriesMark;
74305
74367
  class PieSeries extends BasePieSeries {
@@ -74556,6 +74618,9 @@
74556
74618
  }, appearPreset), userAnimationConfig(SeriesMarkNameEnum.progress, this._spec)));
74557
74619
  this._trackMark.setAnimationConfig(animationConfig(DEFAULT_MARK_ANIMATION.progressBackground(), userAnimationConfig(SeriesMarkNameEnum.track, this._spec)));
74558
74620
  }
74621
+ getActiveMarks() {
74622
+ return [this._progressMark];
74623
+ }
74559
74624
  }
74560
74625
  CircularProgressSeries.type = SeriesTypeEnum.circularProgress;
74561
74626
  CircularProgressSeries.mark = circularProgressSeriesMark;
@@ -74775,6 +74840,9 @@
74775
74840
  initTooltip() {
74776
74841
  this._tooltipHelper = new LinearProgressSeriesTooltipHelper(this);
74777
74842
  }
74843
+ getActiveMarks() {
74844
+ return [this._progressMark];
74845
+ }
74778
74846
  }
74779
74847
  LinearProgressSeries.type = SeriesTypeEnum.linearProgress;
74780
74848
  LinearProgressSeries.mark = linearProgressSeriesMark;
@@ -75033,6 +75101,23 @@
75033
75101
  getDefaultShapeType() {
75034
75102
  return 'square';
75035
75103
  }
75104
+ getActiveMarks() {
75105
+ return [this._areaMark, this._symbolMark, this._lineMark];
75106
+ }
75107
+ getSeriesStyle(datum) {
75108
+ return (attribute) => {
75109
+ var _a, _b, _c, _d;
75110
+ let result = (_b = (_a = this._seriesMark) === null || _a === void 0 ? void 0 : _a.getAttribute(attribute, datum)) !== null && _b !== void 0 ? _b : undefined;
75111
+ if (attribute === 'fill' && !result) {
75112
+ attribute = 'stroke';
75113
+ result = (_d = (_c = this._seriesMark) === null || _c === void 0 ? void 0 : _c.getAttribute(attribute, datum)) !== null && _d !== void 0 ? _d : undefined;
75114
+ }
75115
+ if (attribute === 'stroke' && isArray$4(result)) {
75116
+ return result[0];
75117
+ }
75118
+ return result;
75119
+ };
75120
+ }
75036
75121
  }
75037
75122
  RadarSeries.type = SeriesTypeEnum.radar;
75038
75123
  RadarSeries.mark = radarSeriesMark;
@@ -75786,6 +75871,9 @@
75786
75871
  getDefaultShapeType() {
75787
75872
  return 'circle';
75788
75873
  }
75874
+ getActiveMarks() {
75875
+ return [this._roseMark];
75876
+ }
75789
75877
  }
75790
75878
  RoseSeries.type = SeriesTypeEnum.rose;
75791
75879
  RoseSeries.mark = roseSeriesMark;
@@ -77590,6 +77678,9 @@
77590
77678
  _noAnimationDataKey(datum, index) {
77591
77679
  return undefined;
77592
77680
  }
77681
+ getActiveMarks() {
77682
+ return [this._nodeMark, this._linkMark];
77683
+ }
77593
77684
  }
77594
77685
  SankeySeries.type = SeriesTypeEnum.sankey;
77595
77686
  SankeySeries.mark = sankeySeriesMark;
@@ -77864,6 +77955,9 @@
77864
77955
  getDefaultShapeType() {
77865
77956
  return 'circle';
77866
77957
  }
77958
+ getActiveMarks() {
77959
+ return [this._symbolMark];
77960
+ }
77867
77961
  }
77868
77962
  ScatterSeries.type = SeriesTypeEnum.scatter;
77869
77963
  ScatterSeries.mark = scatterSeriesMark;
@@ -78205,6 +78299,9 @@
78205
78299
  var _a, _b;
78206
78300
  return (_b = ((_a = this._linkMark) !== null && _a !== void 0 ? _a : this._arrowMark)) === null || _b === void 0 ? void 0 : _b.getData();
78207
78301
  }
78302
+ getActiveMarks() {
78303
+ return [this._linkMark, this._arrowMark];
78304
+ }
78208
78305
  }
78209
78306
  LinkSeries.type = SeriesTypeEnum.link;
78210
78307
  LinkSeries.mark = linkSeriesMark;
@@ -78643,6 +78740,9 @@
78643
78740
  getStackValueField() {
78644
78741
  return null;
78645
78742
  }
78743
+ getActiveMarks() {
78744
+ return [this._dotMark];
78745
+ }
78646
78746
  }
78647
78747
  DotSeries.type = SeriesTypeEnum.dot;
78648
78748
  DotSeries.mark = dotSeriesMark;
@@ -79206,6 +79306,9 @@
79206
79306
  _noAnimationDataKey(datum, index) {
79207
79307
  return undefined;
79208
79308
  }
79309
+ getActiveMarks() {
79310
+ return [this._sunburstMark];
79311
+ }
79209
79312
  }
79210
79313
  SunburstSeries.type = SeriesTypeEnum.sunburst;
79211
79314
  SunburstSeries.mark = sunburstSeriesMark;
@@ -79885,6 +79988,9 @@
79885
79988
  getDefaultShapeType() {
79886
79989
  return 'square';
79887
79990
  }
79991
+ getActiveMarks() {
79992
+ return [this._nonLeafMark, this._leafMark];
79993
+ }
79888
79994
  }
79889
79995
  TreemapSeries.type = SeriesTypeEnum.treemap;
79890
79996
  TreemapSeries.mark = treemapSeriesMark;
@@ -82887,6 +82993,9 @@
82887
82993
  super.onLayoutEnd(ctx);
82888
82994
  this.compile();
82889
82995
  }
82996
+ getActiveMarks() {
82997
+ return [this._wordMark, this._fillingWordMark];
82998
+ }
82890
82999
  }
82891
83000
  BaseWordCloudSeries.mark = wordCloudSeriesMark;
82892
83001
 
@@ -84013,23 +84122,23 @@
84013
84122
  return undefined;
84014
84123
  }
84015
84124
  _autoUpdate(rect) {
84016
- var _a, _b, _c, _d;
84125
+ var _a, _b, _c, _d, _e;
84017
84126
  if (!this._auto) {
84018
84127
  return true;
84019
84128
  }
84020
84129
  const axisSpec = (_a = this._relatedAxisComponent) === null || _a === void 0 ? void 0 : _a.getSpec();
84021
84130
  const bandSizeResult = this._getAxisBandSize(axisSpec);
84022
84131
  const { bandSize, maxBandSize, minBandSize } = bandSizeResult !== null && bandSizeResult !== void 0 ? bandSizeResult : {};
84023
- if ((rect === null || rect === void 0 ? void 0 : rect.height) === ((_b = this._cacheRect) === null || _b === void 0 ? void 0 : _b.height) &&
84024
- (rect === null || rect === void 0 ? void 0 : rect.width) === ((_c = this._cacheRect) === null || _c === void 0 ? void 0 : _c.width) &&
84025
- this._fixedBandSize === bandSize) {
84026
- return this._cacheVisibility;
84027
- }
84028
- this._cacheRect = rect;
84029
84132
  let isShown = true;
84030
84133
  const scale = this._stateScale;
84031
84134
  scale.range(this._isHorizontal ? [0, rect.width] : axisSpec.inverse ? [0, rect.height] : [rect.height, 0]);
84032
84135
  if (isDiscrete(scale.type)) {
84136
+ if ((rect === null || rect === void 0 ? void 0 : rect.height) === ((_b = this._cacheRect) === null || _b === void 0 ? void 0 : _b.height) &&
84137
+ (rect === null || rect === void 0 ? void 0 : rect.width) === ((_c = this._cacheRect) === null || _c === void 0 ? void 0 : _c.width) &&
84138
+ this._fixedBandSize === bandSize) {
84139
+ return this._cacheVisibility;
84140
+ }
84141
+ this._cacheRect = rect;
84033
84142
  if (bandSizeResult) {
84034
84143
  if (this._start || this._end) {
84035
84144
  scale.rangeFactor([this._start, this._end], true);
@@ -84064,6 +84173,17 @@
84064
84173
  this._start = start;
84065
84174
  this._end = end;
84066
84175
  }
84176
+ else {
84177
+ const [start, end] = (_e = scale.rangeFactor()) !== null && _e !== void 0 ? _e : [this._start, this._end];
84178
+ if (start === 0 && end === 1) {
84179
+ this.hide();
84180
+ isShown = false;
84181
+ }
84182
+ else {
84183
+ this.show();
84184
+ isShown = true;
84185
+ }
84186
+ }
84067
84187
  this.setStartAndEnd(this._start, this._end);
84068
84188
  this._cacheVisibility = isShown;
84069
84189
  return isShown;
@@ -84486,11 +84606,11 @@
84486
84606
  this.layoutLevel = LayoutLevel.CustomMark;
84487
84607
  }
84488
84608
  static createComponent(spec, options) {
84489
- const titleSpec = spec.customMark;
84490
- if (!titleSpec) {
84609
+ const customMarkSpec = spec.customMark;
84610
+ if (!customMarkSpec) {
84491
84611
  return null;
84492
84612
  }
84493
- return [new CustomMark(spec.customMark, Object.assign(Object.assign({}, options), { specIndex: 0, specKey: 'customMark' }))];
84613
+ return [new CustomMark(customMarkSpec, Object.assign(Object.assign({}, options), { specIndex: 0, specKey: 'customMark' }))];
84494
84614
  }
84495
84615
  created() {
84496
84616
  super.created();
@@ -84555,6 +84675,8 @@
84555
84675
  }
84556
84676
  CustomMark.type = ComponentTypeEnum.customMark;
84557
84677
 
84678
+ const IN_BRUSH_STATE = 'inBrush';
84679
+ const OUT_BRUSH_STATE = 'outOfBrush';
84558
84680
  class Brush extends BaseComponent {
84559
84681
  constructor() {
84560
84682
  super(...arguments);
@@ -84570,10 +84692,22 @@
84570
84692
  this._linkedInBrushElementsMap = {};
84571
84693
  this._linkedOutOfBrushElementsMap = {};
84572
84694
  this._needInitOutState = true;
84573
- this._isFirstState = true;
84574
84695
  this._cacheInteractiveRangeAttrs = [];
84575
84696
  this._needEnablePickable = true;
84576
84697
  }
84698
+ init() {
84699
+ var _a, _b;
84700
+ const inBrushMarkAttr = this._transformBrushedMarkAttr((_a = this._spec) === null || _a === void 0 ? void 0 : _a.inBrush);
84701
+ const outOfBrushMarkAttr = this._transformBrushedMarkAttr((_b = this._spec) === null || _b === void 0 ? void 0 : _b.outOfBrush);
84702
+ this._option.getAllSeries().forEach((s) => {
84703
+ s.getActiveMarks().forEach((m) => {
84704
+ if (m) {
84705
+ s.setMarkStyle(m, Object.assign({}, inBrushMarkAttr), IN_BRUSH_STATE, AttributeLevel.Series);
84706
+ s.setMarkStyle(m, Object.assign({}, outOfBrushMarkAttr), OUT_BRUSH_STATE, AttributeLevel.Series);
84707
+ }
84708
+ });
84709
+ });
84710
+ }
84577
84711
  static createComponent(spec, options) {
84578
84712
  const brushSpec = spec.brush || options.defaultSpec;
84579
84713
  if (isNil$1(brushSpec) || brushSpec.visible === false) {
@@ -84638,11 +84772,19 @@
84638
84772
  this._brushComponents.push(brush);
84639
84773
  this._cacheInteractiveRangeAttrs.push(interactiveAttr);
84640
84774
  brush.setUpdateDragMaskCallback((operateParams) => {
84775
+ var _a, _b, _c;
84641
84776
  const { operateType, operateMask } = operateParams;
84642
- if (this._isFirstState ||
84643
- (this._needInitOutState && brushMode === 'single' && operateType === IOperateType.drawing)) {
84644
- this._initMarkBrushState(componentIndex, 'outOfBrush');
84645
- }
84777
+ let operateTypeCache = operateType;
84778
+ if (this._needInitOutState && brushMode === 'single' && operateType === IOperateType.drawing) {
84779
+ this._initMarkBrushState(componentIndex, OUT_BRUSH_STATE);
84780
+ }
84781
+ (_c = (_b = (_a = this._option) === null || _a === void 0 ? void 0 : _a.getChart()) === null || _b === void 0 ? void 0 : _b.getEvent()) === null || _c === void 0 ? void 0 : _c.on('click', p => {
84782
+ if (!p.mark && operateTypeCache === IOperateType.brushClear) {
84783
+ this._initMarkBrushState(componentIndex, '');
84784
+ this._needInitOutState = true;
84785
+ operateTypeCache = null;
84786
+ }
84787
+ });
84646
84788
  if (operateType === IOperateType.drawing) {
84647
84789
  this._needInitOutState = false;
84648
84790
  this._needEnablePickable = true;
@@ -84651,10 +84793,6 @@
84651
84793
  this._needInitOutState = true;
84652
84794
  this._needEnablePickable = false;
84653
84795
  }
84654
- if (operateType === IOperateType.brushClear) {
84655
- this._initMarkBrushState(componentIndex, '');
84656
- this._needInitOutState = true;
84657
- }
84658
84796
  this._reconfigItem(operateMask, region);
84659
84797
  this._reconfigLinkedItem(operateMask, region);
84660
84798
  let eventType = ChartEvent.brushChange;
@@ -84712,7 +84850,7 @@
84712
84850
  const graphicItem = el.getGraphicItem();
84713
84851
  const elementKey = mark.id + '_' + el.key;
84714
84852
  if (((_a = this._outOfBrushElementsMap) === null || _a === void 0 ? void 0 : _a[elementKey]) && this._isBrushContainItem(operateMask, graphicItem)) {
84715
- graphicItem.addState('inBrush');
84853
+ el.addState(IN_BRUSH_STATE);
84716
84854
  if (!this._inBrushElementsMap[operateMask === null || operateMask === void 0 ? void 0 : operateMask.name]) {
84717
84855
  this._inBrushElementsMap[operateMask === null || operateMask === void 0 ? void 0 : operateMask.name] = {};
84718
84856
  }
@@ -84721,8 +84859,8 @@
84721
84859
  }
84722
84860
  else if (((_c = (_b = this._inBrushElementsMap) === null || _b === void 0 ? void 0 : _b[operateMask === null || operateMask === void 0 ? void 0 : operateMask.name]) === null || _c === void 0 ? void 0 : _c[elementKey]) &&
84723
84861
  !this._isBrushContainItem(operateMask, graphicItem)) {
84724
- graphicItem.removeState('inBrush');
84725
- graphicItem.addState('outOfBrush');
84862
+ el.removeState(IN_BRUSH_STATE);
84863
+ el.addState(OUT_BRUSH_STATE);
84726
84864
  this._outOfBrushElementsMap[elementKey] = el;
84727
84865
  delete this._inBrushElementsMap[operateMask.name][elementKey];
84728
84866
  }
@@ -84748,7 +84886,7 @@
84748
84886
  const elementKey = mark.id + '_' + el.key;
84749
84887
  if (((_a = this._linkedOutOfBrushElementsMap) === null || _a === void 0 ? void 0 : _a[elementKey]) &&
84750
84888
  this._isBrushContainItem(operateMask, graphicItem, { dx: regionOffsetX, dy: regionOffsetY })) {
84751
- graphicItem.addState('inBrush');
84889
+ el.addState(IN_BRUSH_STATE);
84752
84890
  if (!this._linkedInBrushElementsMap[operateMask === null || operateMask === void 0 ? void 0 : operateMask.name]) {
84753
84891
  this._linkedInBrushElementsMap[operateMask === null || operateMask === void 0 ? void 0 : operateMask.name] = {};
84754
84892
  }
@@ -84757,8 +84895,8 @@
84757
84895
  }
84758
84896
  else if (((_c = (_b = this._linkedInBrushElementsMap) === null || _b === void 0 ? void 0 : _b[operateMask === null || operateMask === void 0 ? void 0 : operateMask.name]) === null || _c === void 0 ? void 0 : _c[elementKey]) &&
84759
84897
  !this._isBrushContainItem(operateMask, graphicItem, { dx: regionOffsetX, dy: regionOffsetY })) {
84760
- graphicItem.removeState('inBrush');
84761
- graphicItem.addState('outOfBrush');
84898
+ el.removeState(IN_BRUSH_STATE);
84899
+ el.addState(OUT_BRUSH_STATE);
84762
84900
  this._linkedOutOfBrushElementsMap[elementKey] = el;
84763
84901
  }
84764
84902
  graphicItem.setAttribute('pickable', !this._needEnablePickable);
@@ -84866,7 +85004,6 @@
84866
85004
  });
84867
85005
  }
84868
85006
  _initMarkBrushState(componentIndex, stateName) {
84869
- var _a, _b;
84870
85007
  this._brushComponents.forEach((brush, index) => {
84871
85008
  if (index !== componentIndex) {
84872
85009
  brush.children[0].removeAllChild();
@@ -84876,8 +85013,6 @@
84876
85013
  this._outOfBrushElementsMap = {};
84877
85014
  this._linkedInBrushElementsMap = {};
84878
85015
  this._linkedOutOfBrushElementsMap = {};
84879
- const inBrushMarkAttr = this._transformBrushedMarkAttr((_a = this._spec) === null || _a === void 0 ? void 0 : _a.inBrush);
84880
- const outOfBrushMarkAttr = this._transformBrushedMarkAttr((_b = this._spec) === null || _b === void 0 ? void 0 : _b.outOfBrush);
84881
85016
  this._option.getAllSeries().forEach((s) => {
84882
85017
  s.getMarksWithoutRoot().forEach((mark) => {
84883
85018
  const grammarMark = mark.getProduct();
@@ -84886,24 +85021,15 @@
84886
85021
  }
84887
85022
  const elements = grammarMark.elements;
84888
85023
  elements.forEach((el) => {
84889
- const graphicItem = el.getGraphicItem();
84890
85024
  const elementKey = mark.id + '_' + el.key;
84891
- graphicItem.stateProxy = (stateName) => {
84892
- if (stateName === 'inBrush') {
84893
- return inBrushMarkAttr;
84894
- }
84895
- if (stateName === 'outOfBrush') {
84896
- return outOfBrushMarkAttr;
84897
- }
84898
- return;
84899
- };
84900
- graphicItem.addState(stateName);
85025
+ el.removeState(IN_BRUSH_STATE);
85026
+ el.removeState(OUT_BRUSH_STATE);
85027
+ el.addState(stateName);
84901
85028
  this._outOfBrushElementsMap[elementKey] = el;
84902
85029
  this._linkedOutOfBrushElementsMap[elementKey] = el;
84903
85030
  });
84904
85031
  });
84905
85032
  });
84906
- this._isFirstState = false;
84907
85033
  }
84908
85034
  initEvent() {
84909
85035
  }
@@ -84958,7 +85084,7 @@
84958
85084
  }
84959
85085
  }
84960
85086
  Brush.type = ComponentTypeEnum.brush;
84961
- Brush.speckey = 'inBrush';
85087
+ Brush.speckey = 'brush';
84962
85088
 
84963
85089
  function overlap(a, b, sep = 0) {
84964
85090
  return sep > Math.max(b.x1 - a.x2, a.x1 - b.x2, b.y1 - a.y2, a.y1 - b.y2);
@@ -88261,33 +88387,29 @@
88261
88387
  }
88262
88388
  _getLegendItems() {
88263
88389
  const originData = (this._legendData.getLatestData() || []).map((datum) => {
88264
- var _a;
88265
- const fill = datum.style('fill') || datum.style('stroke');
88266
- const stroke = datum.style('stroke');
88267
- const lineWidth = datum.style('lineWidth');
88268
- const symbolType = datum.style('symbolType');
88390
+ var _a, _b;
88269
88391
  const fillOpacity = datum.style('fillOpacity');
88270
88392
  const strokeOpacity = datum.style('strokeOpacity');
88271
88393
  const opacity = datum.style('opacity');
88272
88394
  const texture = datum.style('texture');
88273
- const textureColor = datum.style('textureColor');
88274
- const outerBorder = datum.style('outerBorder');
88275
- const innerBorder = datum.style('innerBorder');
88276
88395
  return {
88277
88396
  label: datum.key,
88278
88397
  shape: {
88279
- fill,
88280
- symbolType: (_a = symbolType !== null && symbolType !== void 0 ? symbolType : datum.shapeType) !== null && _a !== void 0 ? _a : 'circle',
88281
- stroke: lineWidth === 0 || fill === stroke ? null : stroke,
88398
+ symbolType: (_b = (_a = datum.style('symbolType')) !== null && _a !== void 0 ? _a : datum.shapeType) !== null && _b !== void 0 ? _b : 'circle',
88282
88399
  fillOpacity: isValidNumber$1(fillOpacity) ? fillOpacity : 1,
88283
88400
  strokeOpacity: isValidNumber$1(strokeOpacity) ? strokeOpacity : 1,
88284
88401
  opacity: isValidNumber$1(opacity) ? opacity : 1,
88285
- texture: texture,
88286
88402
  texturePadding: texture ? 1 : null,
88287
88403
  textureSize: texture ? 4 : null,
88288
- textureColor,
88289
- innerBorder,
88290
- outerBorder
88404
+ texture,
88405
+ fill: datum.style('fill'),
88406
+ stroke: datum.style('stroke'),
88407
+ textureColor: datum.style('textureColor'),
88408
+ innerBorder: datum.style('innerBorder'),
88409
+ outerBorder: datum.style('outerBorder'),
88410
+ lineDash: datum.style('lineDash'),
88411
+ lineDashOffset: datum.style('lineDashOffset'),
88412
+ lineWidth: datum.style('lineWidth')
88291
88413
  }
88292
88414
  };
88293
88415
  });
@@ -91116,7 +91238,7 @@
91116
91238
  }
91117
91239
  static createComponent(spec, options) {
91118
91240
  const markLineSpec = spec.markLine || options.defaultSpec;
91119
- if (isNil$1(markLineSpec)) {
91241
+ if (isEmpty(markLineSpec)) {
91120
91242
  return undefined;
91121
91243
  }
91122
91244
  if (!isArray$4(markLineSpec) && markLineSpec.visible !== false) {
@@ -91181,8 +91303,12 @@
91181
91303
  else if (isPositionLayout) {
91182
91304
  points = spec.positions;
91183
91305
  }
91184
- const dataPoints = data.latestData[0].latestData ? data.latestData[0].latestData : data.latestData;
91185
91306
  const seriesData = this._relativeSeries.getViewData().latestData;
91307
+ const dataPoints = data
91308
+ ? data.latestData[0].latestData
91309
+ ? data.latestData[0].latestData
91310
+ : data.latestData
91311
+ : seriesData;
91186
91312
  let limitRect;
91187
91313
  if (spec.clip || ((_b = spec.label) === null || _b === void 0 ? void 0 : _b.confine)) {
91188
91314
  const { minX, maxX, minY, maxY } = this._computeClipRange([
@@ -91328,7 +91454,7 @@
91328
91454
  }
91329
91455
  static createComponent(spec, options) {
91330
91456
  const markAreaSpec = spec.markArea || options.defaultSpec;
91331
- if (isNil$1(markAreaSpec)) {
91457
+ if (isEmpty(markAreaSpec)) {
91332
91458
  return undefined;
91333
91459
  }
91334
91460
  if (!isArray$4(markAreaSpec) && markAreaSpec.visible !== false) {
@@ -91390,7 +91516,12 @@
91390
91516
  else if (isPositionLayout) {
91391
91517
  points = spec.positions;
91392
91518
  }
91393
- const dataPoints = data.latestData[0].latestData ? data.latestData[0].latestData : data.latestData;
91519
+ const seriesData = this._relativeSeries.getViewData().latestData;
91520
+ const dataPoints = data
91521
+ ? data.latestData[0].latestData
91522
+ ? data.latestData[0].latestData
91523
+ : data.latestData
91524
+ : seriesData;
91394
91525
  let limitRect;
91395
91526
  if (spec.clip || ((_b = spec.label) === null || _b === void 0 ? void 0 : _b.confine)) {
91396
91527
  const { minX, maxX, minY, maxY } = this._computeClipRange([
@@ -91408,7 +91539,7 @@
91408
91539
  (_c = this._markerComponent) === null || _c === void 0 ? void 0 : _c.setAttributes({
91409
91540
  points: points,
91410
91541
  label: Object.assign(Object.assign({}, (_e = (_d = this._markerComponent) === null || _d === void 0 ? void 0 : _d.attribute) === null || _e === void 0 ? void 0 : _e.label), { text: this._spec.label.formatMethod
91411
- ? this._spec.label.formatMethod(dataPoints, this._relativeSeries.getViewData().latestData)
91542
+ ? this._spec.label.formatMethod(dataPoints, seriesData)
91412
91543
  : (_h = (_g = (_f = this._markerComponent) === null || _f === void 0 ? void 0 : _f.attribute) === null || _g === void 0 ? void 0 : _g.label) === null || _h === void 0 ? void 0 : _h.text }),
91413
91544
  limitRect,
91414
91545
  dx: this.layoutOffsetX,
@@ -91462,7 +91593,7 @@
91462
91593
  }
91463
91594
  static createComponent(spec, options) {
91464
91595
  const markPointSpec = spec.markPoint || options.defaultSpec;
91465
- if (isNil$1(markPointSpec)) {
91596
+ if (isEmpty(markPointSpec)) {
91466
91597
  return undefined;
91467
91598
  }
91468
91599
  if (!isArray$4(markPointSpec) && markPointSpec.visible !== false) {
@@ -91506,7 +91637,12 @@
91506
91637
  else if (isPositionLayout) {
91507
91638
  point = spec.position;
91508
91639
  }
91509
- const dataPoints = data.latestData[0].latestData ? data.latestData[0].latestData : data.latestData;
91640
+ const seriesData = this._relativeSeries.getViewData().latestData;
91641
+ const dataPoints = data
91642
+ ? data.latestData[0].latestData
91643
+ ? data.latestData[0].latestData
91644
+ : data.latestData
91645
+ : seriesData;
91510
91646
  let limitRect;
91511
91647
  if (spec.clip) {
91512
91648
  const { minX, maxX, minY, maxY } = this._computeClipRange([relativeSeries.getRegion()]);
@@ -91520,7 +91656,7 @@
91520
91656
  (_b = this._markerComponent) === null || _b === void 0 ? void 0 : _b.setAttributes({
91521
91657
  position: point,
91522
91658
  itemContent: Object.assign(Object.assign({}, (_d = (_c = this._markerComponent) === null || _c === void 0 ? void 0 : _c.attribute) === null || _d === void 0 ? void 0 : _d.itemContent), { textStyle: Object.assign(Object.assign({}, (_g = (_f = (_e = this._markerComponent) === null || _e === void 0 ? void 0 : _e.attribute) === null || _f === void 0 ? void 0 : _f.itemContent) === null || _g === void 0 ? void 0 : _g.textStyle), { text: ((_h = this._spec.itemContent.text) === null || _h === void 0 ? void 0 : _h.formatMethod)
91523
- ? this._spec.itemContent.text.formatMethod(dataPoints, this._relativeSeries.getViewData().latestData)
91659
+ ? this._spec.itemContent.text.formatMethod(dataPoints, seriesData)
91524
91660
  : (_m = (_l = (_k = (_j = this._markerComponent) === null || _j === void 0 ? void 0 : _j.attribute) === null || _k === void 0 ? void 0 : _k.itemContent) === null || _l === void 0 ? void 0 : _l.textStyle) === null || _m === void 0 ? void 0 : _m.text }) }),
91525
91661
  limitRect,
91526
91662
  dx: this.layoutOffsetX,
@@ -91621,6 +91757,41 @@
91621
91757
  }
91622
91758
  return boundingClientRect.height / element.offsetHeight;
91623
91759
  };
91760
+ const measureTooltipText = (text, style) => {
91761
+ var _a;
91762
+ text = (text !== null && text !== void 0 ? text : '').toString();
91763
+ const measure = initTextMeasure(style);
91764
+ if (!style.multiLine) {
91765
+ const { width, height } = measure.fullMeasure(text);
91766
+ return {
91767
+ width,
91768
+ height,
91769
+ text
91770
+ };
91771
+ }
91772
+ let textLines = text.split('\n');
91773
+ textLines = textLines.map((line, i) => (i < textLines.length - 1 ? line + '\n' : line));
91774
+ const { width, height } = measure.fullMeasure(textLines);
91775
+ if (style.maxWidth && style.maxWidth <= width) {
91776
+ const bound = getRichTextBounds({
91777
+ wordBreak: (_a = style.wordBreak) !== null && _a !== void 0 ? _a : 'break-word',
91778
+ maxWidth: style.maxWidth,
91779
+ width: 0,
91780
+ height: 0,
91781
+ textConfig: textLines.map((line, i) => (Object.assign(Object.assign({}, style), { text: line })))
91782
+ });
91783
+ return {
91784
+ width: bound.width(),
91785
+ height: bound.height(),
91786
+ text: textLines
91787
+ };
91788
+ }
91789
+ return {
91790
+ width,
91791
+ height,
91792
+ text: textLines
91793
+ };
91794
+ };
91624
91795
 
91625
91796
  const TOOLTIP_EL_CLASS_NAME = 'vchart-tooltip-element';
91626
91797
  const TOOLTIP_CONTAINER_EL_CLASS_NAME = 'vchart-tooltip-container';
@@ -91996,182 +92167,208 @@
91996
92167
  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; };
91997
92168
  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; };
91998
92169
 
91999
- const defaultTextAttributes = {
92170
+ const DEFAULT_TEXT_ATTRIBUTES = {
92000
92171
  fontFamily: THEME_CONSTANTS.defaultFontFamily,
92001
92172
  spacing: 10,
92002
- multiLine: false,
92003
92173
  wordBreak: 'break-word'
92004
92174
  };
92005
92175
  function getTextAttributes(style = {}, globalTheme, defaultAttributes) {
92006
92176
  var _a, _b;
92007
- const attrs = Object.assign(Object.assign({}, (defaultAttributes !== null && defaultAttributes !== void 0 ? defaultAttributes : defaultTextAttributes)), { fill: ((_a = style.fill) !== null && _a !== void 0 ? _a : style.fontColor), textAlign: style.textAlign, textBaseline: style.textBaseline, fontFamily: (_b = style.fontFamily) !== null && _b !== void 0 ? _b : globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.fontFamily, fontSize: style.fontSize, fontWeight: style.fontWeight, lineHeight: style.lineHeight, spacing: style.spacing, multiLine: style.multiLine, maxWidth: style.maxWidth, wordBreak: style.wordBreak });
92177
+ const attrs = Object.assign(Object.assign({}, (defaultAttributes !== null && defaultAttributes !== void 0 ? defaultAttributes : DEFAULT_TEXT_ATTRIBUTES)), { fill: ((_a = style.fill) !== null && _a !== void 0 ? _a : style.fontColor), textAlign: style.textAlign, textBaseline: style.textBaseline, fontFamily: (_b = style.fontFamily) !== null && _b !== void 0 ? _b : globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.fontFamily, fontSize: style.fontSize, fontWeight: style.fontWeight, lineHeight: style.lineHeight, spacing: style.spacing, multiLine: style.multiLine, maxWidth: style.maxWidth, wordBreak: style.wordBreak, autoWidth: style.autoWidth });
92008
92178
  return attrs;
92009
92179
  }
92010
-
92011
- const getTooltipAttributes = (actualTooltip, style) => {
92012
- const { spaceRow: commonSpaceRow, padding, title: titleStyle, shape: shapeStyle, key: keyStyle, value: valueStyle } = style;
92013
- const attribute = Object.assign(Object.assign({}, style), { title: {}, content: [], titleStyle: {
92180
+ const getPanelAttributes = (style) => {
92181
+ var _a;
92182
+ const { backgroundColor, border, shadow } = style;
92183
+ const panelAttrs = {
92184
+ lineWidth: (_a = border === null || border === void 0 ? void 0 : border.width) !== null && _a !== void 0 ? _a : 0,
92185
+ shadow: !!shadow
92186
+ };
92187
+ if (border === null || border === void 0 ? void 0 : border.color) {
92188
+ panelAttrs.stroke = border.color;
92189
+ }
92190
+ if (backgroundColor) {
92191
+ panelAttrs.fill = backgroundColor;
92192
+ }
92193
+ if (shadow) {
92194
+ panelAttrs.shadowColor = shadow.color;
92195
+ panelAttrs.shadowBlur = shadow.blur;
92196
+ panelAttrs.shadowOffsetX = shadow.x;
92197
+ panelAttrs.shadowOffsetY = shadow.y;
92198
+ panelAttrs.shadowSpread = shadow.spread;
92199
+ }
92200
+ const { radius } = border !== null && border !== void 0 ? border : {};
92201
+ if (isValid$1(radius)) {
92202
+ panelAttrs.cornerRadius = [radius, radius, radius, radius];
92203
+ }
92204
+ return panelAttrs;
92205
+ };
92206
+ const getTooltipAttributes = (actualTooltip, spec, globalTheme) => {
92207
+ var _a, _b, _c, _d, _e;
92208
+ const { style = {}, enterable, transitionDuration } = spec;
92209
+ const { panel = {}, titleLabel, shape, keyLabel, valueLabel, spaceRow: commonSpaceRow } = style;
92210
+ const padding = normalizePadding$1(panel.padding);
92211
+ const paddingSpec = normalizeLayoutPaddingSpec(panel.padding);
92212
+ const titleStyle = getTextAttributes(titleLabel, globalTheme);
92213
+ const keyStyle = getTextAttributes(keyLabel, globalTheme);
92214
+ const valueStyle = getTextAttributes(valueLabel, globalTheme);
92215
+ const shapeStyle = {
92216
+ fill: true,
92217
+ size: (_a = shape === null || shape === void 0 ? void 0 : shape.size) !== null && _a !== void 0 ? _a : 8,
92218
+ spacing: (_b = shape === null || shape === void 0 ? void 0 : shape.spacing) !== null && _b !== void 0 ? _b : 6
92219
+ };
92220
+ const attributes = {
92221
+ panel: getPanelAttributes(panel),
92222
+ padding,
92223
+ title: {},
92224
+ content: [],
92225
+ titleStyle: {
92014
92226
  value: titleStyle,
92015
92227
  spaceRow: commonSpaceRow
92016
- }, contentStyle: {
92228
+ },
92229
+ contentStyle: {
92017
92230
  shape: shapeStyle,
92018
92231
  key: keyStyle,
92019
92232
  value: valueStyle,
92020
92233
  spaceRow: commonSpaceRow
92021
- }, hasContentShape: false, keyWidth: 0, valueWidth: 0 });
92022
- ['key', 'value', 'shape'].forEach(key => {
92023
- delete attribute[key];
92024
- });
92234
+ },
92235
+ hasContentShape: false,
92236
+ keyWidth: 0,
92237
+ valueWidth: 0,
92238
+ enterable,
92239
+ transitionDuration
92240
+ };
92025
92241
  const { title = {}, content = [] } = actualTooltip;
92026
- let maxWidth = 0;
92027
- let containerHeight = padding.top + padding.bottom;
92028
- let titleMaxHeight = 0;
92029
- const { visible: titleVisible = true, value: titleValue = '', valueStyle: titleValueStyle, hasShape: titleHasShape, shapeType: titleShapeType = '', shapeHollow: titleShapeHollow, shapeColor: titleShapeColor, spaceRow: titleSpaceRow } = title;
92030
- attribute.title.visible = titleVisible;
92031
- attribute.title.spaceRow = titleSpaceRow !== null && titleSpaceRow !== void 0 ? titleSpaceRow : commonSpaceRow;
92032
- if (titleVisible) {
92033
- const lineTitleStyle = mergeSpec({}, titleStyle, getTextAttributes(titleValueStyle, undefined, {}));
92034
- const { text, width, height } = measureTooltipText(titleValue, lineTitleStyle);
92035
- attribute.title.value = Object.assign(Object.assign({ width,
92036
- height }, lineTitleStyle), { text });
92037
- maxWidth = width;
92038
- titleMaxHeight = height;
92039
- if (titleHasShape && builtinSymbolsMap[titleShapeType]) {
92040
- const titleShapeAttrs = {
92041
- symbolType: titleShapeType
92042
- };
92043
- if (titleShapeHollow) {
92044
- titleShapeAttrs.stroke = titleShapeColor;
92045
- }
92046
- else {
92047
- titleShapeAttrs.fill = titleShapeColor;
92048
- }
92049
- attribute.title.shape = titleShapeAttrs;
92050
- maxWidth += shapeStyle.size + shapeStyle.spacing;
92051
- titleMaxHeight = Math.max(shapeStyle.size, titleMaxHeight);
92052
- }
92053
- attribute.title.width = maxWidth;
92054
- attribute.title.height = titleMaxHeight;
92055
- containerHeight += titleMaxHeight;
92056
- }
92057
- if (content.length) {
92058
- const filteredContent = content.filter(item => {
92059
- return (item.key || item.value) && item.visible !== false;
92060
- });
92061
- if (filteredContent.length) {
92062
- if (titleVisible) {
92063
- containerHeight += attribute.title.spaceRow;
92064
- }
92065
- const keyWidths = [];
92066
- const adaptiveKeyWidths = [];
92067
- const valueWidths = [];
92068
- const shapeWidths = [];
92069
- attribute.content = filteredContent.map((item, i) => {
92070
- let itemHeight = 0;
92071
- const { hasShape, key, shapeColor, shapeHollow, shapeType = '', shapeFill, shapeStroke, shapeLineWidth, shapeSize, value, isKeyAdaptive, spaceRow: lineSpaceRow } = item;
92072
- const itemAttrs = { height: 0, spaceRow: lineSpaceRow !== null && lineSpaceRow !== void 0 ? lineSpaceRow : commonSpaceRow };
92073
- if (isValid$1(key)) {
92074
- const lineKeyStyle = mergeSpec({}, keyStyle, getTextAttributes(item.keyStyle, undefined, {}));
92075
- const { width, height, text } = measureTooltipText(key, lineKeyStyle);
92076
- itemAttrs.key = Object.assign(Object.assign({ width,
92077
- height }, lineKeyStyle), { text });
92078
- if (!isKeyAdaptive) {
92079
- keyWidths.push(width);
92080
- }
92081
- else {
92082
- adaptiveKeyWidths.push(width);
92083
- }
92084
- itemHeight = Math.max(itemHeight, height);
92242
+ let containerWidth = paddingSpec.left + paddingSpec.right;
92243
+ let containerHeight = paddingSpec.top + paddingSpec.bottom;
92244
+ let contentMaxWidth = 0;
92245
+ const filteredContent = content.filter(item => {
92246
+ return (item.key || item.value) && item.visible !== false;
92247
+ });
92248
+ const hasContent = !!filteredContent.length;
92249
+ let maxKeyWidth = 0;
92250
+ let maxAdaptiveKeyWidth = 0;
92251
+ let maxValueWidth = 0;
92252
+ let maxShapeWidth = 0;
92253
+ if (hasContent) {
92254
+ const keyWidths = [];
92255
+ const adaptiveKeyWidths = [];
92256
+ const valueWidths = [];
92257
+ const shapeWidths = [];
92258
+ attributes.content = filteredContent.map((item, i) => {
92259
+ let itemHeight = 0;
92260
+ const { hasShape: actualHasShape, key: actualKey, shapeType: actualShapeType = '', shapeFill: actualShapeFill, shapeStroke: actualShapeStroke, shapeLineWidth: actualShapeLineWidth, shapeSize: actualShapeSize, value: actualValue, isKeyAdaptive: actualIsKeyAdaptive, spaceRow: actualSpaceRow, keyStyle: actualKeyStyle, valueStyle: actualValueStyle, shapeColor: actualShapeColor, shapeHollow: actualShapeHollow } = item;
92261
+ const itemAttrs = { height: 0, spaceRow: actualSpaceRow !== null && actualSpaceRow !== void 0 ? actualSpaceRow : commonSpaceRow };
92262
+ if (isValid$1(actualKey)) {
92263
+ const itemKeyStyle = mergeSpec({}, keyStyle, getTextAttributes(actualKeyStyle, undefined, {}));
92264
+ const { width, height, text } = measureTooltipText(actualKey, itemKeyStyle);
92265
+ itemAttrs.key = Object.assign(Object.assign({ width,
92266
+ height }, itemKeyStyle), { text });
92267
+ if (!actualIsKeyAdaptive) {
92268
+ keyWidths.push(width);
92085
92269
  }
92086
- if (isValid$1(value)) {
92087
- const lineValueStyle = mergeSpec({}, valueStyle, getTextAttributes(item.valueStyle, undefined, {}));
92088
- const { width, height, text } = measureTooltipText(value, lineValueStyle);
92089
- itemAttrs.value = Object.assign(Object.assign({ width,
92090
- height }, lineValueStyle), { text });
92091
- valueWidths.push(width);
92092
- itemHeight = Math.max(itemHeight, height);
92270
+ else {
92271
+ adaptiveKeyWidths.push(width);
92093
92272
  }
92094
- if (hasShape) {
92095
- const shape = {
92096
- visible: true,
92097
- symbolType: shapeType
92098
- };
92099
- const adaptiveShapeFill = shapeFill !== null && shapeFill !== void 0 ? shapeFill : shapeColor;
92100
- if (shapeHollow) {
92101
- shape.stroke = adaptiveShapeFill;
92102
- }
92103
- else {
92104
- shape.fill = adaptiveShapeFill;
92105
- }
92106
- shape.stroke = shapeStroke !== null && shapeStroke !== void 0 ? shapeStroke : adaptiveShapeFill;
92107
- shape.lineWidth = shapeLineWidth;
92108
- itemAttrs.shape = shape;
92109
- const shapeWidth = shapeSize !== null && shapeSize !== void 0 ? shapeSize : shapeStyle.size;
92110
- itemHeight = Math.max(shapeWidth, itemHeight);
92111
- shapeWidths.push(shapeWidth);
92273
+ itemHeight = Math.max(itemHeight, height);
92274
+ }
92275
+ if (isValid$1(actualValue)) {
92276
+ const itemValueStyle = mergeSpec({}, valueStyle, getTextAttributes(actualValueStyle, undefined, {}));
92277
+ const { width, height, text } = measureTooltipText(actualValue, itemValueStyle);
92278
+ itemAttrs.value = Object.assign(Object.assign({ width,
92279
+ height }, itemValueStyle), { text });
92280
+ valueWidths.push(width);
92281
+ itemHeight = Math.max(itemHeight, height);
92282
+ }
92283
+ if (actualHasShape) {
92284
+ const shape = {
92285
+ visible: true,
92286
+ symbolType: actualShapeType
92287
+ };
92288
+ const adaptiveShapeFill = actualShapeFill !== null && actualShapeFill !== void 0 ? actualShapeFill : actualShapeColor;
92289
+ if (actualShapeHollow) {
92290
+ shape.stroke = adaptiveShapeFill;
92112
92291
  }
92113
92292
  else {
92114
- itemAttrs.shape = { visible: false };
92115
- }
92116
- itemAttrs.height = itemHeight;
92117
- containerHeight += itemHeight;
92118
- if (i < filteredContent.length - 1) {
92119
- containerHeight += itemAttrs.spaceRow;
92293
+ shape.fill = adaptiveShapeFill;
92120
92294
  }
92121
- return itemAttrs;
92122
- });
92123
- const maxKeyWidth = keyWidths.length ? Math.max(...keyWidths) : 0;
92124
- const maxAdaptiveKeyWidth = adaptiveKeyWidths.length ? Math.max(...adaptiveKeyWidths) : 0;
92125
- const maxValueWidth = valueWidths.length ? Math.max(...valueWidths) : 0;
92126
- const shapeWidth = shapeWidths.length ? Math.max(...shapeWidths) + shapeStyle.spacing : 0;
92127
- maxWidth = Math.max(maxKeyWidth + maxValueWidth + keyStyle.spacing + valueStyle.spacing + shapeWidth, maxAdaptiveKeyWidth + shapeWidth, maxWidth);
92128
- attribute.hasContentShape = !!shapeWidths.length;
92129
- attribute.keyWidth = maxKeyWidth;
92130
- attribute.valueWidth = maxValueWidth;
92131
- }
92132
- }
92133
- const containerSize = {
92134
- width: maxWidth + padding.left + padding.right,
92135
- height: containerHeight
92136
- };
92137
- attribute.panel.width = containerSize.width;
92138
- attribute.panel.height = containerSize.height;
92139
- return attribute;
92140
- };
92141
- const measureTooltipText = (text, style) => {
92142
- var _a;
92143
- text = (text !== null && text !== void 0 ? text : '').toString();
92144
- const measure = initTextMeasure(style);
92145
- if (!style.multiLine) {
92146
- const { width, height } = measure.fullMeasure(text);
92147
- return {
92148
- width,
92149
- height,
92150
- text
92151
- };
92295
+ shape.stroke = actualShapeStroke !== null && actualShapeStroke !== void 0 ? actualShapeStroke : adaptiveShapeFill;
92296
+ shape.lineWidth = actualShapeLineWidth;
92297
+ itemAttrs.shape = shape;
92298
+ const shapeWidth = actualShapeSize !== null && actualShapeSize !== void 0 ? actualShapeSize : shapeStyle.size;
92299
+ itemHeight = Math.max(shapeWidth, itemHeight);
92300
+ shapeWidths.push(shapeWidth);
92301
+ }
92302
+ else {
92303
+ itemAttrs.shape = { visible: false };
92304
+ }
92305
+ itemAttrs.height = itemHeight;
92306
+ containerHeight += itemHeight;
92307
+ if (i < filteredContent.length - 1) {
92308
+ containerHeight += itemAttrs.spaceRow;
92309
+ }
92310
+ return itemAttrs;
92311
+ });
92312
+ maxKeyWidth = keyWidths.length ? Math.max(...keyWidths) : 0;
92313
+ maxAdaptiveKeyWidth = adaptiveKeyWidths.length ? Math.max(...adaptiveKeyWidths) : 0;
92314
+ maxValueWidth = valueWidths.length ? Math.max(...valueWidths) : 0;
92315
+ maxShapeWidth = shapeWidths.length ? Math.max(...shapeWidths) + shapeStyle.spacing : 0;
92316
+ contentMaxWidth = Math.max(maxShapeWidth + maxKeyWidth + keyStyle.spacing + maxValueWidth + valueStyle.spacing, maxShapeWidth + maxAdaptiveKeyWidth, contentMaxWidth);
92317
+ attributes.hasContentShape = !!shapeWidths.length;
92318
+ attributes.keyWidth = maxKeyWidth;
92319
+ attributes.valueWidth = maxValueWidth;
92320
+ }
92321
+ let titleMaxWidth = 0;
92322
+ let titleMaxHeight = 0;
92323
+ const { visible: actualTitleVisible = true, value: actualTitleValue = '', valueStyle: actualTitleValueStyle, spaceRow: actualTitleSpaceRow } = title;
92324
+ attributes.title.visible = actualTitleVisible;
92325
+ attributes.title.spaceRow = actualTitleSpaceRow !== null && actualTitleSpaceRow !== void 0 ? actualTitleSpaceRow : commonSpaceRow;
92326
+ let titleValueStyle = {};
92327
+ const isAutoWidthMode = () => titleValueStyle.autoWidth && titleValueStyle.multiLine !== false;
92328
+ if (actualTitleVisible) {
92329
+ titleValueStyle = mergeSpec({}, titleStyle, getTextAttributes(actualTitleValueStyle, undefined, {}));
92330
+ if (isAutoWidthMode()) {
92331
+ titleValueStyle.multiLine = (_c = titleValueStyle.multiLine) !== null && _c !== void 0 ? _c : true;
92332
+ titleValueStyle.maxWidth = (_d = titleValueStyle.maxWidth) !== null && _d !== void 0 ? _d : (hasContent ? Math.ceil(contentMaxWidth) : undefined);
92333
+ }
92334
+ const { text, width, height } = measureTooltipText(actualTitleValue, titleValueStyle);
92335
+ attributes.title.value = Object.assign(Object.assign({ width: isAutoWidthMode() ? Math.min(width, (_e = titleValueStyle.maxWidth) !== null && _e !== void 0 ? _e : Number.MAX_VALUE) : width, height }, titleValueStyle), { text });
92336
+ titleMaxWidth = attributes.title.value.width;
92337
+ titleMaxHeight = attributes.title.value.height;
92338
+ containerHeight += titleMaxHeight + (hasContent ? attributes.title.spaceRow : 0);
92339
+ }
92340
+ attributes.title.width = titleMaxWidth;
92341
+ attributes.title.height = titleMaxHeight;
92342
+ if (isAutoWidthMode()) {
92343
+ containerWidth += contentMaxWidth ? contentMaxWidth : titleMaxWidth;
92152
92344
  }
92153
- let textLines = text.split('\n');
92154
- textLines = textLines.map((line, i) => (i < textLines.length - 1 ? line + '\n' : line));
92155
- const { width, height } = measure.fullMeasure(textLines);
92156
- if (style.maxWidth && style.maxWidth <= width) {
92157
- const bound = getRichTextBounds({
92158
- wordBreak: (_a = style.wordBreak) !== null && _a !== void 0 ? _a : 'break-word',
92159
- maxWidth: style.maxWidth,
92160
- width: 0,
92161
- height: 0,
92162
- textConfig: textLines.map((line, i) => (Object.assign(Object.assign({}, style), { text: line })))
92345
+ else {
92346
+ containerWidth += Math.max(titleMaxWidth, contentMaxWidth);
92347
+ }
92348
+ if (hasContent) {
92349
+ attributes.content.forEach(item => {
92350
+ var _a;
92351
+ const value = item.value;
92352
+ if (value && ((_a = value.autoWidth) !== null && _a !== void 0 ? _a : true)) {
92353
+ value.width =
92354
+ containerWidth -
92355
+ paddingSpec.left -
92356
+ paddingSpec.right -
92357
+ maxShapeWidth -
92358
+ maxKeyWidth -
92359
+ keyStyle.spacing -
92360
+ valueStyle.spacing;
92361
+ value.multiLine = true;
92362
+ if (!value.maxWidth) {
92363
+ value.maxWidth = Math.ceil(value.width);
92364
+ }
92365
+ attributes.valueWidth = Math.max(attributes.valueWidth, value.width);
92366
+ }
92163
92367
  });
92164
- return {
92165
- width: bound.width(),
92166
- height: bound.height(),
92167
- text: textLines
92168
- };
92169
92368
  }
92170
- return {
92171
- width,
92172
- height,
92173
- text: textLines
92174
- };
92369
+ attributes.panel.width = containerWidth;
92370
+ attributes.panel.height = containerHeight;
92371
+ return attributes;
92175
92372
  };
92176
92373
 
92177
92374
  var TooltipResult;
@@ -92190,7 +92387,8 @@
92190
92387
  constructor(tooltipId, component) {
92191
92388
  this._visible = true;
92192
92389
  this._id = '';
92193
- this._attributeCache = null;
92390
+ this._attributes = null;
92391
+ this._isReleased = false;
92194
92392
  this.showTooltip = (activeType, data, params) => {
92195
92393
  var _a;
92196
92394
  let changePositionOnly = !!params.changePositionOnly;
@@ -92207,7 +92405,7 @@
92207
92405
  this._changeTooltip = (visible, params, changePositionOnly, activeType, data) => {
92208
92406
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
92209
92407
  const tooltipSpec = this._component.getSpec();
92210
- if (!tooltipSpec) {
92408
+ if (this._isReleased || !tooltipSpec) {
92211
92409
  return TooltipResult.failed;
92212
92410
  }
92213
92411
  if (!visible) {
@@ -92257,6 +92455,9 @@
92257
92455
  };
92258
92456
  this._changeTooltipPosition = (changePositionOnly, actualTooltip, spec, activeType, data, params) => {
92259
92457
  var _a, _b, _c;
92458
+ if (this._isReleased) {
92459
+ return TooltipResult.failed;
92460
+ }
92260
92461
  const event = params.event;
92261
92462
  if (spec.handler) {
92262
92463
  return (_c = (_b = (_a = spec.handler).showTooltip) === null || _b === void 0 ? void 0 : _b.call(_a, activeType, data, params)) !== null && _c !== void 0 ? _c : TooltipResult.success;
@@ -92581,6 +92782,7 @@
92581
92782
  return;
92582
92783
  }
92583
92784
  this._removeTooltip();
92785
+ this._isReleased = true;
92584
92786
  }
92585
92787
  _throttle(callback) {
92586
92788
  const tooltipSpec = this._component.getSpec();
@@ -92604,57 +92806,14 @@
92604
92806
  return Object.assign(Object.assign({}, DEFAULT_OPTIONS), { offsetX: (_a = offset === null || offset === void 0 ? void 0 : offset.x) !== null && _a !== void 0 ? _a : DEFAULT_OPTIONS.offsetX, offsetY: (_b = offset === null || offset === void 0 ? void 0 : offset.y) !== null && _b !== void 0 ? _b : DEFAULT_OPTIONS.offsetY });
92605
92807
  }
92606
92808
  _getTooltipBoxSize(actualTooltip, changePositionOnly) {
92607
- var _a, _b, _c, _d;
92608
- if (!changePositionOnly || isNil$1(this._attributeCache)) {
92609
- this._attributeCache = getTooltipAttributes(actualTooltip, this._style);
92610
- }
92611
- return {
92612
- width: (_b = (_a = this._attributeCache) === null || _a === void 0 ? void 0 : _a.panel) === null || _b === void 0 ? void 0 : _b.width,
92613
- height: (_d = (_c = this._attributeCache) === null || _c === void 0 ? void 0 : _c.panel) === null || _d === void 0 ? void 0 : _d.height
92614
- };
92615
- }
92616
- _getStyle() {
92617
- var _a, _b, _c, _d, _e;
92618
- const tooltipSpec = this._component.getSpec();
92619
- const { style = {}, enterable, transitionDuration } = tooltipSpec;
92620
- const { panel = {}, titleLabel, shape, keyLabel, valueLabel, spaceRow } = style;
92621
- const { backgroundColor, border, shadow, padding } = panel;
92622
- const panelStyle = {
92623
- lineWidth: (_a = border === null || border === void 0 ? void 0 : border.width) !== null && _a !== void 0 ? _a : 0,
92624
- shadow: !!shadow
92625
- };
92626
- if (border === null || border === void 0 ? void 0 : border.color) {
92627
- panelStyle.stroke = border.color;
92628
- }
92629
- if (backgroundColor) {
92630
- panelStyle.fill = backgroundColor;
92631
- }
92632
- if (shadow) {
92633
- panelStyle.shadowColor = shadow.color;
92634
- panelStyle.shadowBlur = shadow.blur;
92635
- panelStyle.shadowOffsetX = shadow.x;
92636
- panelStyle.shadowOffsetY = shadow.y;
92637
- panelStyle.shadowSpread = shadow.spread;
92638
- }
92639
- const { radius } = border !== null && border !== void 0 ? border : {};
92640
- if (isValid$1(radius)) {
92641
- panelStyle.cornerRadius = [radius, radius, radius, radius];
92809
+ var _a, _b, _c, _d, _e, _f;
92810
+ if (!changePositionOnly || isNil$1(this._attributes)) {
92811
+ const globalTheme = (_b = (_a = this._chartOption).getTheme) === null || _b === void 0 ? void 0 : _b.call(_a);
92812
+ this._attributes = getTooltipAttributes(actualTooltip, this._component.getSpec(), globalTheme);
92642
92813
  }
92643
- const globalTheme = (_c = (_b = this._chartOption).getTheme) === null || _c === void 0 ? void 0 : _c.call(_b);
92644
92814
  return {
92645
- panel: panelStyle,
92646
- title: getTextAttributes(titleLabel, globalTheme),
92647
- shape: {
92648
- fill: true,
92649
- size: (_d = shape === null || shape === void 0 ? void 0 : shape.size) !== null && _d !== void 0 ? _d : 8,
92650
- spacing: (_e = shape === null || shape === void 0 ? void 0 : shape.spacing) !== null && _e !== void 0 ? _e : 6
92651
- },
92652
- key: getTextAttributes(keyLabel, globalTheme),
92653
- value: getTextAttributes(valueLabel, globalTheme),
92654
- padding,
92655
- spaceRow,
92656
- enterable,
92657
- transitionDuration
92815
+ width: (_d = (_c = this._attributes) === null || _c === void 0 ? void 0 : _c.panel) === null || _d === void 0 ? void 0 : _d.width,
92816
+ height: (_f = (_e = this._attributes) === null || _e === void 0 ? void 0 : _e.panel) === null || _f === void 0 ? void 0 : _f.height
92658
92817
  };
92659
92818
  }
92660
92819
  _getParentElement(spec) {
@@ -92665,7 +92824,6 @@
92665
92824
  }
92666
92825
  _initFromSpec() {
92667
92826
  this._option = this._getDefaultOption();
92668
- this._style = this._getStyle();
92669
92827
  this.changeTooltip = this._throttle(this._changeTooltip);
92670
92828
  this.changeTooltipPosition = this._throttle(this._changeTooltipPosition);
92671
92829
  }
@@ -92699,22 +92857,24 @@
92699
92857
  }
92700
92858
  return numArr;
92701
92859
  };
92702
- function getDomStyles(style, attributeCache) {
92703
- var _a, _b, _c, _d, _e, _f, _g;
92704
- const { panel: { fill: fillColor, shadow, shadowBlur, shadowColor, shadowOffsetX, shadowOffsetY, shadowSpread, cornerRadius, stroke: strokeColor, lineWidth = 0 }, padding, key, value, title, shape, enterable, transitionDuration } = style;
92705
- const { panel: panelAttribute, title: titleAttribute, content: contentAttribute, keyWidth, valueWidth } = attributeCache !== null && attributeCache !== void 0 ? attributeCache : {};
92706
- const backgroundColor = fillColor;
92860
+ function getDomStyles(attributes) {
92861
+ var _a, _b, _c, _d, _e;
92862
+ const { panel = {}, title: titleAttribute, content: contentAttribute, titleStyle = {}, contentStyle = {}, padding, keyWidth, valueWidth, enterable, transitionDuration } = attributes !== null && attributes !== void 0 ? attributes : {};
92863
+ const { fill: backgroundColor, shadow, shadowBlur, shadowColor, shadowOffsetX, shadowOffsetY, shadowSpread, cornerRadius, stroke: strokeColor, lineWidth = 0, width = 0, height = 0 } = panel;
92864
+ const { value: title = {} } = titleStyle;
92865
+ const { shape = {}, key = {}, value = {} } = contentStyle;
92707
92866
  const shapeStyle = getShapeStyle(shape);
92708
92867
  const keyStyle = getLabelStyle(key);
92709
92868
  const valueStyle = getLabelStyle(value);
92869
+ const { bottom, left, right, top } = normalizeLayoutPaddingSpec(padding);
92710
92870
  const styles = {
92711
92871
  panel: {
92712
- width: getPixelPropertyStr(((_a = panelAttribute === null || panelAttribute === void 0 ? void 0 : panelAttribute.width) !== null && _a !== void 0 ? _a : 0) + lineWidth * 2),
92713
- minHeight: getPixelPropertyStr(((_b = panelAttribute === null || panelAttribute === void 0 ? void 0 : panelAttribute.height) !== null && _b !== void 0 ? _b : 0) + lineWidth * 2),
92714
- paddingBottom: getPixelPropertyStr(padding.bottom),
92715
- paddingLeft: getPixelPropertyStr(padding.left),
92716
- paddingRight: getPixelPropertyStr(padding.right),
92717
- paddingTop: getPixelPropertyStr(padding.top),
92872
+ width: getPixelPropertyStr(width + lineWidth * 2),
92873
+ minHeight: getPixelPropertyStr(height + lineWidth * 2),
92874
+ paddingBottom: getPixelPropertyStr(bottom),
92875
+ paddingLeft: getPixelPropertyStr(left),
92876
+ paddingRight: getPixelPropertyStr(right),
92877
+ paddingTop: getPixelPropertyStr(top),
92718
92878
  borderColor: strokeColor,
92719
92879
  borderWidth: getPixelPropertyStr(lineWidth),
92720
92880
  borderRadius: getPixelPropertyStr(cornerRadius),
@@ -92733,20 +92893,20 @@
92733
92893
  common: shapeStyle,
92734
92894
  items: [],
92735
92895
  width: getPixelPropertyStr(shape.size),
92736
- marginRight: getPixelPropertyStr((_c = shape.spacing) !== null && _c !== void 0 ? _c : DEFAULT_SHAPE_SPACING),
92737
- marginBottom: getPixelPropertyStr(-((_e = (_d = contentAttribute === null || contentAttribute === void 0 ? void 0 : contentAttribute[(contentAttribute === null || contentAttribute === void 0 ? void 0 : contentAttribute.length) - 1]) === null || _d === void 0 ? void 0 : _d.spaceRow) !== null && _e !== void 0 ? _e : 0))
92896
+ marginRight: getPixelPropertyStr((_a = shape.spacing) !== null && _a !== void 0 ? _a : DEFAULT_SHAPE_SPACING),
92897
+ marginBottom: getPixelPropertyStr(-((_c = (_b = contentAttribute === null || contentAttribute === void 0 ? void 0 : contentAttribute[(contentAttribute === null || contentAttribute === void 0 ? void 0 : contentAttribute.length) - 1]) === null || _b === void 0 ? void 0 : _b.spaceRow) !== null && _c !== void 0 ? _c : 0))
92738
92898
  },
92739
92899
  keyColumn: {
92740
92900
  common: keyStyle,
92741
92901
  items: contentAttribute === null || contentAttribute === void 0 ? void 0 : contentAttribute.map(({ key, spaceRow }, i) => (Object.assign(Object.assign(Object.assign({ marginTop: '0px', marginBottom: i < contentAttribute.length - 1 ? getPixelPropertyStr(spaceRow) : '0px' }, keyStyle), getLabelStyle(key)), ((key === null || key === void 0 ? void 0 : key.multiLine) ? { width: getPixelPropertyStr(Math.ceil(key.width)) } : undefined)))),
92742
92902
  width: getPixelPropertyStr(keyWidth),
92743
- marginRight: getPixelPropertyStr((_f = key.spacing) !== null && _f !== void 0 ? _f : DEFAULT_KEY_SPACING)
92903
+ marginRight: getPixelPropertyStr((_d = key.spacing) !== null && _d !== void 0 ? _d : DEFAULT_KEY_SPACING)
92744
92904
  },
92745
92905
  valueColumn: {
92746
92906
  common: valueStyle,
92747
92907
  items: contentAttribute === null || contentAttribute === void 0 ? void 0 : contentAttribute.map(({ value, spaceRow }, i) => (Object.assign(Object.assign(Object.assign({ marginTop: '0px', marginBottom: i < contentAttribute.length - 1 ? getPixelPropertyStr(spaceRow) : '0px' }, valueStyle), getLabelStyle(value)), ((value === null || value === void 0 ? void 0 : value.multiLine) ? { width: getPixelPropertyStr(Math.ceil(value.width)) } : undefined)))),
92748
92908
  width: getPixelPropertyStr(valueWidth),
92749
- marginRight: getPixelPropertyStr((_g = value.spacing) !== null && _g !== void 0 ? _g : DEFAULT_VALUE_SPACING)
92909
+ marginRight: getPixelPropertyStr((_e = value.spacing) !== null && _e !== void 0 ? _e : DEFAULT_VALUE_SPACING)
92750
92910
  }
92751
92911
  };
92752
92912
  return styles;
@@ -93451,7 +93611,7 @@
93451
93611
  valueToHtml: this._option.sanitize,
93452
93612
  getTooltipStyle: () => this._domStyle,
93453
93613
  getTooltipActual: () => this._tooltipActual,
93454
- getTooltipAttributes: () => this._attributeCache
93614
+ getTooltipAttributes: () => this._attributes
93455
93615
  }, [tooltipSpec.className], this.id);
93456
93616
  }
93457
93617
  }
@@ -93482,7 +93642,7 @@
93482
93642
  }
93483
93643
  }
93484
93644
  _initStyle() {
93485
- this._domStyle = getDomStyles(this._style, this._attributeCache);
93645
+ this._domStyle = getDomStyles(this._attributes);
93486
93646
  }
93487
93647
  _getParentElement(spec) {
93488
93648
  var _a;
@@ -93528,7 +93688,7 @@
93528
93688
  if (this._layer) {
93529
93689
  this._layer.removeAllChild();
93530
93690
  }
93531
- this._attributeCache = null;
93691
+ this._attributes = null;
93532
93692
  }
93533
93693
  _updateTooltip(visible, params, actualTooltip) {
93534
93694
  this._visible = visible;
@@ -93550,7 +93710,7 @@
93550
93710
  }
93551
93711
  const pos = actualTooltip === null || actualTooltip === void 0 ? void 0 : actualTooltip.position;
93552
93712
  if (!params.changePositionOnly) {
93553
- this._tooltipComponent.setAttributes(Object.assign(Object.assign({}, this._attributeCache), pos));
93713
+ this._tooltipComponent.setAttributes(Object.assign(Object.assign({}, this._attributes), pos));
93554
93714
  }
93555
93715
  else if (isValid$1(pos)) {
93556
93716
  this._tooltipComponent.setAttributes(pos);
@@ -93906,12 +94066,6 @@
93906
94066
  }
93907
94067
  release() {
93908
94068
  var _a, _b;
93909
- this.event.emit(ChartEvent.tooltipHide, {
93910
- tooltip: this
93911
- });
93912
- this.event.emit(ChartEvent.tooltipRelease, {
93913
- tooltip: this
93914
- });
93915
94069
  super.release();
93916
94070
  this._eventList.forEach(({ eventType, handler }) => {
93917
94071
  this.event.off(eventType, handler);
@@ -93920,6 +94074,14 @@
93920
94074
  (_b = (_a = this.tooltipHandler) === null || _a === void 0 ? void 0 : _a.release) === null || _b === void 0 ? void 0 : _b.call(_a);
93921
94075
  this._isTooltipShown = false;
93922
94076
  }
94077
+ beforeRelease() {
94078
+ this.event.emit(ChartEvent.tooltipHide, {
94079
+ tooltip: this
94080
+ });
94081
+ this.event.emit(ChartEvent.tooltipRelease, {
94082
+ tooltip: this
94083
+ });
94084
+ }
93923
94085
  _initHandler() {
93924
94086
  var _a, _b, _c;
93925
94087
  const renderMode = (_a = this._spec.renderMode) !== null && _a !== void 0 ? _a : 'html';