@visactor/vchart 1.12.7 → 1.12.8

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 (309) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.js +1117 -1665
  3. package/build/index.min.js +1 -1
  4. package/build/tsconfig.tsbuildinfo +1 -1
  5. package/cjs/chart/base/base-chart.js.map +1 -1
  6. package/cjs/chart/gauge/interface.d.ts +1 -1
  7. package/cjs/chart/gauge/interface.js.map +1 -1
  8. package/cjs/chart/treemap/interface.d.ts +1 -1
  9. package/cjs/chart/treemap/interface.js.map +1 -1
  10. package/cjs/chart/venn/interface.d.ts +2 -2
  11. package/cjs/chart/venn/interface.js.map +1 -1
  12. package/cjs/compile/compilable-base.js +1 -2
  13. package/cjs/compile/util.js +2 -1
  14. package/cjs/component/axis/base-axis.js +1 -1
  15. package/cjs/component/axis/base-axis.js.map +1 -1
  16. package/cjs/component/axis/cartesian/axis.js +5 -4
  17. package/cjs/component/axis/cartesian/axis.js.map +1 -1
  18. package/cjs/component/axis/cartesian/interface/common.d.ts +1 -0
  19. package/cjs/component/axis/cartesian/interface/common.js.map +1 -1
  20. package/cjs/component/axis/polar/axis.js.map +1 -1
  21. package/cjs/component/geo/geo-coordinate.js +5 -2
  22. package/cjs/component/geo/geo-coordinate.js.map +1 -1
  23. package/cjs/component/interface/index.d.ts +0 -1
  24. package/cjs/component/interface/index.js +1 -1
  25. package/cjs/component/interface/index.js.map +1 -1
  26. package/cjs/component/label/util.js +1 -1
  27. package/cjs/component/label/util.js.map +1 -1
  28. package/cjs/component/title/interface/spec.d.ts +3 -3
  29. package/cjs/component/title/interface/spec.js.map +1 -1
  30. package/cjs/component/tooltip/constant.d.ts +5 -4
  31. package/cjs/component/tooltip/constant.js +7 -7
  32. package/cjs/component/tooltip/constant.js.map +1 -1
  33. package/cjs/component/tooltip/interface/common.d.ts +1 -1
  34. package/cjs/component/tooltip/interface/common.js.map +1 -1
  35. package/cjs/component/tooltip/interface/spec.d.ts +8 -0
  36. package/cjs/component/tooltip/interface/spec.js.map +1 -1
  37. package/cjs/component/tooltip/interface/theme.d.ts +2 -2
  38. package/cjs/component/tooltip/interface/theme.js.map +1 -1
  39. package/cjs/component/tooltip/processor/base.d.ts +3 -5
  40. package/cjs/component/tooltip/processor/base.js +24 -27
  41. package/cjs/component/tooltip/processor/base.js.map +1 -1
  42. package/cjs/component/tooltip/processor/group-tooltip.js +1 -1
  43. package/cjs/component/tooltip/processor/group-tooltip.js.map +1 -1
  44. package/cjs/component/tooltip/processor/mark-tooltip.js +2 -2
  45. package/cjs/component/tooltip/processor/mark-tooltip.js.map +1 -1
  46. package/cjs/component/tooltip/tooltip-transformer.js +0 -1
  47. package/cjs/component/tooltip/tooltip-transformer.js.map +1 -1
  48. package/cjs/component/tooltip/tooltip.d.ts +9 -4
  49. package/cjs/component/tooltip/tooltip.js +64 -53
  50. package/cjs/component/tooltip/tooltip.js.map +1 -1
  51. package/cjs/component/tooltip/utils/common.d.ts +6 -4
  52. package/cjs/component/tooltip/utils/common.js +52 -7
  53. package/cjs/component/tooltip/utils/common.js.map +1 -1
  54. package/cjs/component/tooltip/utils/get-spec.d.ts +4 -4
  55. package/cjs/component/tooltip/utils/get-spec.js +20 -82
  56. package/cjs/component/tooltip/utils/get-spec.js.map +1 -1
  57. package/cjs/component/tooltip/utils/get-value.d.ts +1 -2
  58. package/cjs/component/tooltip/utils/get-value.js +2 -12
  59. package/cjs/component/tooltip/utils/get-value.js.map +1 -1
  60. package/cjs/component/tooltip/utils/index.d.ts +0 -1
  61. package/cjs/component/tooltip/utils/index.js +1 -2
  62. package/cjs/component/tooltip/utils/index.js.map +1 -1
  63. package/cjs/constant/correlation.js +2 -1
  64. package/cjs/constant/layout.js +1 -2
  65. package/cjs/core/index.d.ts +1 -1
  66. package/cjs/core/index.js +1 -1
  67. package/cjs/core/index.js.map +1 -1
  68. package/cjs/core/vchart.js +14 -11
  69. package/cjs/core/vchart.js.map +1 -1
  70. package/cjs/data/transforms/pie.d.ts +3 -0
  71. package/cjs/data/transforms/pie.js +8 -3
  72. package/cjs/data/transforms/pie.js.map +1 -1
  73. package/cjs/model/interface.d.ts +14 -0
  74. package/cjs/model/interface.js.map +1 -1
  75. package/cjs/plugin/components/tooltip-handler/base.d.ts +1 -13
  76. package/cjs/plugin/components/tooltip-handler/base.js +83 -220
  77. package/cjs/plugin/components/tooltip-handler/base.js.map +1 -1
  78. package/cjs/plugin/components/tooltip-handler/canvas/canvas-tooltip-handler.js +1 -1
  79. package/cjs/plugin/components/tooltip-handler/canvas/canvas-tooltip-handler.js.map +1 -1
  80. package/cjs/plugin/components/tooltip-handler/dom/dom-tooltip-handler.d.ts +0 -1
  81. package/cjs/plugin/components/tooltip-handler/dom/dom-tooltip-handler.js +7 -19
  82. package/cjs/plugin/components/tooltip-handler/dom/dom-tooltip-handler.js.map +1 -1
  83. package/cjs/plugin/components/tooltip-handler/dom/model/content-column-model.js +16 -14
  84. package/cjs/plugin/components/tooltip-handler/dom/model/content-column-model.js.map +1 -1
  85. package/cjs/plugin/components/tooltip-handler/dom/model/title-model.js +2 -2
  86. package/cjs/plugin/components/tooltip-handler/dom/model/title-model.js.map +1 -1
  87. package/cjs/plugin/components/tooltip-handler/interface/style.d.ts +1 -2
  88. package/cjs/plugin/components/tooltip-handler/interface/style.js.map +1 -1
  89. package/cjs/plugin/components/tooltip-handler/utils/attribute.js +7 -7
  90. package/cjs/plugin/components/tooltip-handler/utils/attribute.js.map +1 -1
  91. package/cjs/plugin/components/tooltip-handler/utils/common.js.map +1 -1
  92. package/cjs/plugin/components/tooltip-handler/utils/position.d.ts +3 -5
  93. package/cjs/plugin/components/tooltip-handler/utils/position.js +22 -29
  94. package/cjs/plugin/components/tooltip-handler/utils/position.js.map +1 -1
  95. package/cjs/region/interface.d.ts +3 -1
  96. package/cjs/region/interface.js.map +1 -1
  97. package/cjs/series/base/base-series.js +1 -1
  98. package/cjs/series/base/base-series.js.map +1 -1
  99. package/cjs/series/base/tooltip-helper.d.ts +30 -6
  100. package/cjs/series/base/tooltip-helper.js +80 -73
  101. package/cjs/series/base/tooltip-helper.js.map +1 -1
  102. package/cjs/series/box-plot/tooltip-helper.d.ts +2 -2
  103. package/cjs/series/box-plot/tooltip-helper.js +26 -67
  104. package/cjs/series/box-plot/tooltip-helper.js.map +1 -1
  105. package/cjs/series/cartesian/cartesian.d.ts +1 -1
  106. package/cjs/series/circle-packing/circle-packing.js +1 -2
  107. package/cjs/series/circle-packing/circle-packing.js.map +1 -1
  108. package/cjs/series/dot/tooltip-helper.d.ts +8 -2
  109. package/cjs/series/dot/tooltip-helper.js +42 -41
  110. package/cjs/series/dot/tooltip-helper.js.map +1 -1
  111. package/cjs/series/gauge/pointer-tooltip-helper.d.ts +2 -1
  112. package/cjs/series/gauge/pointer-tooltip-helper.js +3 -8
  113. package/cjs/series/gauge/pointer-tooltip-helper.js.map +1 -1
  114. package/cjs/series/heatmap/tooltip-helper.d.ts +2 -3
  115. package/cjs/series/heatmap/tooltip-helper.js +3 -5
  116. package/cjs/series/heatmap/tooltip-helper.js.map +1 -1
  117. package/cjs/series/interface/tooltip-helper.d.ts +5 -4
  118. package/cjs/series/interface/tooltip-helper.js.map +1 -1
  119. package/cjs/series/link/tooltip-helper.d.ts +5 -2
  120. package/cjs/series/link/tooltip-helper.js +26 -27
  121. package/cjs/series/link/tooltip-helper.js.map +1 -1
  122. package/cjs/series/liquid/tooltip-helper.d.ts +4 -5
  123. package/cjs/series/liquid/tooltip-helper.js +2 -22
  124. package/cjs/series/liquid/tooltip-helper.js.map +1 -1
  125. package/cjs/series/pie/pie.js +6 -2
  126. package/cjs/series/pie/pie.js.map +1 -1
  127. package/cjs/series/progress/linear/tooltip-helper.d.ts +2 -3
  128. package/cjs/series/progress/linear/tooltip-helper.js +2 -11
  129. package/cjs/series/progress/linear/tooltip-helper.js.map +1 -1
  130. package/cjs/series/range-area/tooltip-helper.d.ts +1 -3
  131. package/cjs/series/range-area/tooltip-helper.js +2 -50
  132. package/cjs/series/range-area/tooltip-helper.js.map +1 -1
  133. package/cjs/series/range-column/tooltip-helper.d.ts +1 -2
  134. package/cjs/series/range-column/tooltip-helper.js +2 -19
  135. package/cjs/series/range-column/tooltip-helper.js.map +1 -1
  136. package/cjs/series/sankey/sankey.d.ts +1 -1
  137. package/cjs/series/sankey/tooltip-helper.d.ts +3 -3
  138. package/cjs/series/sankey/tooltip-helper.js +10 -57
  139. package/cjs/series/sankey/tooltip-helper.js.map +1 -1
  140. package/cjs/typings/spec/common.d.ts +3 -3
  141. package/cjs/typings/spec/common.js.map +1 -1
  142. package/cjs/typings/tooltip/position.d.ts +1 -0
  143. package/cjs/typings/tooltip/position.js.map +1 -1
  144. package/cjs/typings/tooltip/shape.d.ts +0 -1
  145. package/cjs/typings/tooltip/shape.js.map +1 -1
  146. package/cjs/typings/tooltip/tooltip.d.ts +7 -0
  147. package/cjs/typings/tooltip/tooltip.js.map +1 -1
  148. package/esm/chart/base/base-chart.js.map +1 -1
  149. package/esm/chart/gauge/interface.d.ts +1 -1
  150. package/esm/chart/gauge/interface.js.map +1 -1
  151. package/esm/chart/treemap/interface.d.ts +1 -1
  152. package/esm/chart/treemap/interface.js.map +1 -1
  153. package/esm/chart/venn/interface.d.ts +2 -2
  154. package/esm/chart/venn/interface.js.map +1 -1
  155. package/esm/compile/compilable-base.js +1 -2
  156. package/esm/compile/util.js +2 -1
  157. package/esm/component/axis/base-axis.js +1 -1
  158. package/esm/component/axis/base-axis.js.map +1 -1
  159. package/esm/component/axis/cartesian/axis.js +5 -4
  160. package/esm/component/axis/cartesian/axis.js.map +1 -1
  161. package/esm/component/axis/cartesian/interface/common.d.ts +1 -0
  162. package/esm/component/axis/cartesian/interface/common.js.map +1 -1
  163. package/esm/component/axis/polar/axis.js.map +1 -1
  164. package/esm/component/geo/geo-coordinate.js +5 -2
  165. package/esm/component/geo/geo-coordinate.js.map +1 -1
  166. package/esm/component/interface/index.d.ts +0 -1
  167. package/esm/component/interface/index.js +0 -2
  168. package/esm/component/interface/index.js.map +1 -1
  169. package/esm/component/label/util.js +1 -1
  170. package/esm/component/label/util.js.map +1 -1
  171. package/esm/component/title/interface/spec.d.ts +3 -3
  172. package/esm/component/title/interface/spec.js.map +1 -1
  173. package/esm/component/tooltip/constant.d.ts +5 -4
  174. package/esm/component/tooltip/constant.js +6 -3
  175. package/esm/component/tooltip/constant.js.map +1 -1
  176. package/esm/component/tooltip/interface/common.d.ts +1 -1
  177. package/esm/component/tooltip/interface/common.js.map +1 -1
  178. package/esm/component/tooltip/interface/spec.d.ts +8 -0
  179. package/esm/component/tooltip/interface/spec.js.map +1 -1
  180. package/esm/component/tooltip/interface/theme.d.ts +2 -2
  181. package/esm/component/tooltip/interface/theme.js.map +1 -1
  182. package/esm/component/tooltip/processor/base.d.ts +3 -5
  183. package/esm/component/tooltip/processor/base.js +24 -28
  184. package/esm/component/tooltip/processor/base.js.map +1 -1
  185. package/esm/component/tooltip/processor/group-tooltip.js +1 -1
  186. package/esm/component/tooltip/processor/group-tooltip.js.map +1 -1
  187. package/esm/component/tooltip/processor/mark-tooltip.js +2 -2
  188. package/esm/component/tooltip/processor/mark-tooltip.js.map +1 -1
  189. package/esm/component/tooltip/tooltip-transformer.js +0 -1
  190. package/esm/component/tooltip/tooltip-transformer.js.map +1 -1
  191. package/esm/component/tooltip/tooltip.d.ts +9 -4
  192. package/esm/component/tooltip/tooltip.js +66 -54
  193. package/esm/component/tooltip/tooltip.js.map +1 -1
  194. package/esm/component/tooltip/utils/common.d.ts +6 -4
  195. package/esm/component/tooltip/utils/common.js +46 -5
  196. package/esm/component/tooltip/utils/common.js.map +1 -1
  197. package/esm/component/tooltip/utils/get-spec.d.ts +4 -4
  198. package/esm/component/tooltip/utils/get-spec.js +24 -80
  199. package/esm/component/tooltip/utils/get-spec.js.map +1 -1
  200. package/esm/component/tooltip/utils/get-value.d.ts +1 -2
  201. package/esm/component/tooltip/utils/get-value.js +1 -9
  202. package/esm/component/tooltip/utils/get-value.js.map +1 -1
  203. package/esm/component/tooltip/utils/index.d.ts +0 -1
  204. package/esm/component/tooltip/utils/index.js +0 -2
  205. package/esm/component/tooltip/utils/index.js.map +1 -1
  206. package/esm/constant/correlation.js +2 -1
  207. package/esm/constant/layout.js +1 -2
  208. package/esm/core/index.d.ts +1 -1
  209. package/esm/core/index.js +1 -1
  210. package/esm/core/index.js.map +1 -1
  211. package/esm/core/vchart.js +14 -10
  212. package/esm/core/vchart.js.map +1 -1
  213. package/esm/data/transforms/pie.d.ts +3 -0
  214. package/esm/data/transforms/pie.js +6 -3
  215. package/esm/data/transforms/pie.js.map +1 -1
  216. package/esm/model/interface.d.ts +14 -0
  217. package/esm/model/interface.js.map +1 -1
  218. package/esm/plugin/components/tooltip-handler/base.d.ts +1 -13
  219. package/esm/plugin/components/tooltip-handler/base.js +79 -212
  220. package/esm/plugin/components/tooltip-handler/base.js.map +1 -1
  221. package/esm/plugin/components/tooltip-handler/canvas/canvas-tooltip-handler.js +1 -1
  222. package/esm/plugin/components/tooltip-handler/canvas/canvas-tooltip-handler.js.map +1 -1
  223. package/esm/plugin/components/tooltip-handler/dom/dom-tooltip-handler.d.ts +0 -1
  224. package/esm/plugin/components/tooltip-handler/dom/dom-tooltip-handler.js +6 -19
  225. package/esm/plugin/components/tooltip-handler/dom/dom-tooltip-handler.js.map +1 -1
  226. package/esm/plugin/components/tooltip-handler/dom/model/content-column-model.js +16 -14
  227. package/esm/plugin/components/tooltip-handler/dom/model/content-column-model.js.map +1 -1
  228. package/esm/plugin/components/tooltip-handler/dom/model/title-model.js +2 -2
  229. package/esm/plugin/components/tooltip-handler/dom/model/title-model.js.map +1 -1
  230. package/esm/plugin/components/tooltip-handler/interface/style.d.ts +1 -2
  231. package/esm/plugin/components/tooltip-handler/interface/style.js.map +1 -1
  232. package/esm/plugin/components/tooltip-handler/utils/attribute.js +7 -7
  233. package/esm/plugin/components/tooltip-handler/utils/attribute.js.map +1 -1
  234. package/esm/plugin/components/tooltip-handler/utils/common.js.map +1 -1
  235. package/esm/plugin/components/tooltip-handler/utils/position.d.ts +3 -5
  236. package/esm/plugin/components/tooltip-handler/utils/position.js +20 -25
  237. package/esm/plugin/components/tooltip-handler/utils/position.js.map +1 -1
  238. package/esm/region/interface.d.ts +3 -1
  239. package/esm/region/interface.js.map +1 -1
  240. package/esm/series/base/base-series.js +1 -1
  241. package/esm/series/base/base-series.js.map +1 -1
  242. package/esm/series/base/tooltip-helper.d.ts +30 -6
  243. package/esm/series/base/tooltip-helper.js +85 -74
  244. package/esm/series/base/tooltip-helper.js.map +1 -1
  245. package/esm/series/box-plot/tooltip-helper.d.ts +2 -2
  246. package/esm/series/box-plot/tooltip-helper.js +26 -67
  247. package/esm/series/box-plot/tooltip-helper.js.map +1 -1
  248. package/esm/series/cartesian/cartesian.d.ts +1 -1
  249. package/esm/series/circle-packing/circle-packing.js +1 -2
  250. package/esm/series/circle-packing/circle-packing.js.map +1 -1
  251. package/esm/series/dot/tooltip-helper.d.ts +8 -2
  252. package/esm/series/dot/tooltip-helper.js +42 -41
  253. package/esm/series/dot/tooltip-helper.js.map +1 -1
  254. package/esm/series/gauge/pointer-tooltip-helper.d.ts +2 -1
  255. package/esm/series/gauge/pointer-tooltip-helper.js +2 -9
  256. package/esm/series/gauge/pointer-tooltip-helper.js.map +1 -1
  257. package/esm/series/heatmap/tooltip-helper.d.ts +2 -3
  258. package/esm/series/heatmap/tooltip-helper.js +2 -6
  259. package/esm/series/heatmap/tooltip-helper.js.map +1 -1
  260. package/esm/series/interface/tooltip-helper.d.ts +5 -4
  261. package/esm/series/interface/tooltip-helper.js.map +1 -1
  262. package/esm/series/link/tooltip-helper.d.ts +5 -2
  263. package/esm/series/link/tooltip-helper.js +26 -27
  264. package/esm/series/link/tooltip-helper.js.map +1 -1
  265. package/esm/series/liquid/tooltip-helper.d.ts +4 -5
  266. package/esm/series/liquid/tooltip-helper.js +2 -22
  267. package/esm/series/liquid/tooltip-helper.js.map +1 -1
  268. package/esm/series/pie/pie.js +7 -3
  269. package/esm/series/pie/pie.js.map +1 -1
  270. package/esm/series/progress/linear/tooltip-helper.d.ts +2 -3
  271. package/esm/series/progress/linear/tooltip-helper.js +2 -11
  272. package/esm/series/progress/linear/tooltip-helper.js.map +1 -1
  273. package/esm/series/range-area/tooltip-helper.d.ts +1 -3
  274. package/esm/series/range-area/tooltip-helper.js +2 -50
  275. package/esm/series/range-area/tooltip-helper.js.map +1 -1
  276. package/esm/series/range-column/tooltip-helper.d.ts +1 -2
  277. package/esm/series/range-column/tooltip-helper.js +2 -19
  278. package/esm/series/range-column/tooltip-helper.js.map +1 -1
  279. package/esm/series/sankey/sankey.d.ts +1 -1
  280. package/esm/series/sankey/tooltip-helper.d.ts +3 -3
  281. package/esm/series/sankey/tooltip-helper.js +10 -57
  282. package/esm/series/sankey/tooltip-helper.js.map +1 -1
  283. package/esm/typings/spec/common.d.ts +3 -3
  284. package/esm/typings/spec/common.js.map +1 -1
  285. package/esm/typings/tooltip/position.d.ts +1 -0
  286. package/esm/typings/tooltip/position.js.map +1 -1
  287. package/esm/typings/tooltip/shape.d.ts +0 -1
  288. package/esm/typings/tooltip/shape.js.map +1 -1
  289. package/esm/typings/tooltip/tooltip.d.ts +7 -0
  290. package/esm/typings/tooltip/tooltip.js.map +1 -1
  291. package/package.json +13 -13
  292. package/cjs/component/interface/tooltip-helper.d.ts +0 -5
  293. package/cjs/component/interface/tooltip-helper.js +0 -6
  294. package/cjs/component/interface/tooltip-helper.js.map +0 -1
  295. package/cjs/component/tooltip/utils/compose.d.ts +0 -4
  296. package/cjs/component/tooltip/utils/compose.js +0 -120
  297. package/cjs/component/tooltip/utils/compose.js.map +0 -1
  298. package/cjs/model/tooltip-helper.d.ts +0 -29
  299. package/cjs/model/tooltip-helper.js +0 -19
  300. package/cjs/model/tooltip-helper.js.map +0 -1
  301. package/esm/component/interface/tooltip-helper.d.ts +0 -5
  302. package/esm/component/interface/tooltip-helper.js +0 -2
  303. package/esm/component/interface/tooltip-helper.js.map +0 -1
  304. package/esm/component/tooltip/utils/compose.d.ts +0 -4
  305. package/esm/component/tooltip/utils/compose.js +0 -105
  306. package/esm/component/tooltip/utils/compose.js.map +0 -1
  307. package/esm/model/tooltip-helper.d.ts +0 -29
  308. package/esm/model/tooltip-helper.js +0 -11
  309. package/esm/model/tooltip-helper.js.map +0 -1
package/build/index.js CHANGED
@@ -600,7 +600,7 @@
600
600
  function eq(value, other) {
601
601
  return value === other || Number.isNaN(value) && Number.isNaN(other);
602
602
  }
603
- function merge$2(target) {
603
+ function merge$1(target) {
604
604
  let sourceIndex = -1;
605
605
  const length = arguments.length <= 1 ? 0 : arguments.length - 1;
606
606
  for (; ++sourceIndex < length;) {
@@ -2633,14 +2633,6 @@
2633
2633
  y: y
2634
2634
  };
2635
2635
  }
2636
- function hasParentElement(element, target) {
2637
- let parent = element.parentNode;
2638
- for (; null !== parent;) {
2639
- if (parent === target) return !0;
2640
- parent = parent.parentNode;
2641
- }
2642
- return !1;
2643
- }
2644
2636
  const styleStringToObject = function () {
2645
2637
  let styleStr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
2646
2638
  const res = {};
@@ -3988,7 +3980,7 @@
3988
3980
 
3989
3981
  bisector(ascending);
3990
3982
 
3991
- function merge$1 (arrays) {
3983
+ function merge (arrays) {
3992
3984
  var n = arrays.length,
3993
3985
  m,
3994
3986
  i = -1,
@@ -4031,7 +4023,7 @@
4031
4023
  clip.point = point;
4032
4024
  clip.lineStart = lineStart;
4033
4025
  clip.lineEnd = lineEnd;
4034
- segments = merge$1(segments);
4026
+ segments = merge(segments);
4035
4027
  var startInside = polygonContains(polygon, start);
4036
4028
  if (segments.length) {
4037
4029
  if (!polygonStarted) sink.polygonStart(), polygonStarted = true;
@@ -4500,7 +4492,7 @@
4500
4492
  function polygonEnd() {
4501
4493
  var startInside = polygonInside(),
4502
4494
  cleanInside = clean && startInside,
4503
- visible = (segments = merge$1(segments)).length;
4495
+ visible = (segments = merge(segments)).length;
4504
4496
  if (cleanInside || visible) {
4505
4497
  stream.polygonStart();
4506
4498
  if (cleanInside) {
@@ -7111,7 +7103,7 @@
7111
7103
  }
7112
7104
  setFields(f) {
7113
7105
  let foreMerge = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
7114
- this._fields = f && foreMerge ? merge$2({}, this._fields, f) : f;
7106
+ this._fields = f && foreMerge ? merge$1({}, this._fields, f) : f;
7115
7107
  const fieldsOption = this.transformsArr.find(_op => "fields" === _op.type);
7116
7108
  !isNil$1(this._fields) && isNil$1(fieldsOption) ? (this.dataSet.registerTransform("fields", fields), this.transform({
7117
7109
  type: "fields",
@@ -9445,8 +9437,14 @@
9445
9437
  return needTestLetter && (index = testLetter(desc, index)), index;
9446
9438
  }
9447
9439
  function testLetter(string, index) {
9440
+ let negativeWrongMatch = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
9448
9441
  let i = index;
9449
- for (; regLetter.test(string[i - 1]) && regLetter.test(string[i]) || regPunctuation.test(string[i]);) if (i--, i <= 0) return index;
9442
+ for (; regLetter.test(string[i - 1]) && regLetter.test(string[i]) || regPunctuation.test(string[i]);) if (i--, i <= 0) return negativeWrongMatch ? testLetter2(string, index) : index;
9443
+ return i;
9444
+ }
9445
+ function testLetter2(string, index) {
9446
+ let i = index;
9447
+ for (; regLetter.test(string[i - 1]) && regLetter.test(string[i]) || regPunctuation.test(string[i]);) if (i++, i >= string.length) return i;
9450
9448
  return i;
9451
9449
  }
9452
9450
  function measureTextCanvas(text, character) {
@@ -9544,7 +9542,7 @@
9544
9542
  width: length
9545
9543
  };
9546
9544
  }
9547
- clipText(text, options, width, wordBreak) {
9545
+ clipText(text, options, width, wordBreak, keepAllBreak) {
9548
9546
  if (0 === text.length) return {
9549
9547
  str: "",
9550
9548
  width: 0
@@ -9560,8 +9558,8 @@
9560
9558
  };
9561
9559
  const data = this._clipText(text, options, width, 0, text.length - 1, "end", !1);
9562
9560
  if (wordBreak && data.str !== text) {
9563
- const index = testLetter(text, data.str.length);
9564
- index !== data.str.length && (data.str = text.substring(0, index), data.width = this.measureTextWidth(data.str, options));
9561
+ let index = testLetter(text, data.str.length, keepAllBreak);
9562
+ index !== data.str.length && (index > data.str.length && (data.wordBreaked = index, index = data.str.length), data.str = text.substring(0, index), data.width = this.measureTextWidth(data.str, options));
9565
9563
  }
9566
9564
  return data;
9567
9565
  }
@@ -15234,7 +15232,7 @@
15234
15232
  const path = "function" == typeof graphic.pathProxy ? graphic.pathProxy(graphic.attribute) : graphic.pathProxy;
15235
15233
  return renderCommandList(path.commandList, context, x, y), context.setShadowBlendStyle && context.setShadowBlendStyle(graphic, graphic.attribute, themeAttributes), doStroke && (strokeCb ? strokeCb(context, graphic.attribute, themeAttributes) : sVisible && (context.setStrokeStyle(graphic, graphic.attribute, x - originX, y - originY, themeAttributes), context.stroke())), doFill && (fillCb ? fillCb(context, graphic.attribute, themeAttributes) : fVisible && (context.setCommonStyle(graphic, graphic.attribute, x - originX, y - originY, themeAttributes), context.fill())), !0;
15236
15234
  }
15237
- function intersect$2(x0, y0, x1, y1, x2, y2, x3, y3) {
15235
+ function intersect(x0, y0, x1, y1, x2, y2, x3, y3) {
15238
15236
  const x10 = x1 - x0,
15239
15237
  y10 = y1 - y0,
15240
15238
  x32 = x3 - x2,
@@ -15303,7 +15301,7 @@
15303
15301
  yire = innerRadius * sin$1(innerEndAngle);
15304
15302
  let xore, yore, xirs, yirs;
15305
15303
  if ((maxInnerCornerRadius > epsilon$1 || maxOuterCornerRadius > epsilon$1) && (xore = outerRadius * cos$1(outerEndAngle), yore = outerRadius * sin$1(outerEndAngle), xirs = innerRadius * cos$1(innerStartAngle), yirs = innerRadius * sin$1(innerStartAngle), deltaAngle < pi$1)) {
15306
- const oc = intersect$2(xors, yors, xirs, yirs, xore, yore, xire, yire);
15304
+ const oc = intersect(xors, yors, xirs, yirs, xore, yore, xire, yire);
15307
15305
  if (oc) {
15308
15306
  const ax = xors - oc[0],
15309
15307
  ay = yors - oc[1],
@@ -19171,20 +19169,22 @@
19171
19169
  });
19172
19170
  break;
19173
19171
  }
19174
- const clip = layoutObj.textMeasure.clipText(str, layoutObj.textOptions, maxLineWidth, "break-word" === wordBreak);
19175
- if ("" !== str && "" === clip.str) {
19172
+ const clip = layoutObj.textMeasure.clipText(str, layoutObj.textOptions, maxLineWidth, "break-all" !== wordBreak, "keep-all" === wordBreak);
19173
+ if ("" !== str && "" === clip.str || clip.wordBreaked) {
19176
19174
  if (ellipsis) {
19177
19175
  const clipEllipsis = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1, suffixPosition);
19178
19176
  clip.str = null !== (_c = clipEllipsis.str) && void 0 !== _c ? _c : "", clip.width = null !== (_d = clipEllipsis.width) && void 0 !== _d ? _d : 0;
19179
19177
  } else clip.str = "", clip.width = 0;
19180
19178
  needCut = !1;
19181
19179
  }
19182
- if (linesLayout.push({
19180
+ linesLayout.push({
19183
19181
  str: clip.str,
19184
19182
  width: clip.width
19185
- }), clip.str.length === str.length) ;else if (needCut) {
19186
- const newStr = str.substring(clip.str.length);
19187
- lines.splice(i + 1, 0, newStr);
19183
+ });
19184
+ let cutLength = clip.str.length;
19185
+ if (!clip.wordBreaked || "" !== str && "" === clip.str || (needCut = !0, cutLength = clip.wordBreaked), clip.str.length === str.length) ;else if (needCut) {
19186
+ let newStr = str.substring(cutLength);
19187
+ "keep-all" === wordBreak && (newStr = newStr.replace(/^\s+/g, "")), lines.splice(i + 1, 0, newStr);
19188
19188
  }
19189
19189
  }
19190
19190
  let maxWidth = 0;
@@ -20171,7 +20171,7 @@
20171
20171
  } = attribute,
20172
20172
  b = aabbBounds;
20173
20173
  return points.forEach(p => {
20174
- !1 === p.defined && "zero" !== connectedType || b.add(p.x, p.y);
20174
+ !1 === p.defined && "zero" !== connectedType && "connect" !== connectedType || b.add(p.x, p.y);
20175
20175
  }), b;
20176
20176
  }
20177
20177
  updateLineAABBBoundsBySegments(attribute, lineTheme, aabbBounds, graphic) {
@@ -20182,7 +20182,7 @@
20182
20182
  b = aabbBounds;
20183
20183
  return segments.forEach(s => {
20184
20184
  s.points.forEach(p => {
20185
- !1 === p.defined && "zero" !== connectedType || b.add(p.x, p.y);
20185
+ !1 === p.defined && "zero" !== connectedType && "connect" !== connectedType || b.add(p.x, p.y);
20186
20186
  });
20187
20187
  }), b;
20188
20188
  }
@@ -25180,7 +25180,7 @@
25180
25180
  });
25181
25181
  }
25182
25182
  setAttribute(key, value, forceUpdateTag) {
25183
- isPlainObject$1(this.attribute[key]) && isPlainObject$1(value) && !isFunction$1(this.attribute[key]) && !isFunction$1(value) ? merge$2(this.attribute[key], value) : this.attribute[key] = value, GROUP_ATTRIBUTES.includes(key) || this.render(), this.valid = this.isValid(), this.updateShapeAndBoundsTagSetted() || !forceUpdateTag && !this.needUpdateTag(key) ? this.addUpdateBoundTag() : this.addUpdateShapeAndBoundsTag(), this.addUpdatePositionTag(), this.onAttributeUpdate();
25183
+ isPlainObject$1(this.attribute[key]) && isPlainObject$1(value) && !isFunction$1(this.attribute[key]) && !isFunction$1(value) ? merge$1(this.attribute[key], value) : this.attribute[key] = value, GROUP_ATTRIBUTES.includes(key) || this.render(), this.valid = this.isValid(), this.updateShapeAndBoundsTagSetted() || !forceUpdateTag && !this.needUpdateTag(key) ? this.addUpdateBoundTag() : this.addUpdateShapeAndBoundsTag(), this.addUpdatePositionTag(), this.onAttributeUpdate();
25184
25184
  }
25185
25185
  setAttributes(params, forceUpdateTag) {
25186
25186
  const keys = Object.keys(params);
@@ -25190,7 +25190,7 @@
25190
25190
  isNil$1(keys) && (keys = Object.keys(params));
25191
25191
  for (let i = 0; i < keys.length; i++) {
25192
25192
  const key = keys[i];
25193
- !isPlainObject$1(this.attribute[key]) || isFunction$1(this.attribute[key]) || isFunction$1(params[key]) ? this.attribute[key] = params[key] : merge$2(this.attribute[key], params[key]);
25193
+ !isPlainObject$1(this.attribute[key]) || isFunction$1(this.attribute[key]) || isFunction$1(params[key]) ? this.attribute[key] = params[key] : merge$1(this.attribute[key], params[key]);
25194
25194
  }
25195
25195
  }
25196
25196
  bindEvents() {}
@@ -25742,7 +25742,7 @@
25742
25742
  const bez = arr[i];
25743
25743
  this.bezierCurveTo(bez[0], bez[1], bez[2], bez[3], bez[4], bez[5], z);
25744
25744
  }
25745
- } else this.nativeContext.arc(x, y, radius, startAngle, endAngle, anticlockwise);
25745
+ } else this.nativeContext.arc(x, y, Math.max(0, radius), startAngle, endAngle, anticlockwise);
25746
25746
  }
25747
25747
  arcTo(x1, y1, x2, y2, radiusX) {
25748
25748
  this.nativeContext.arcTo(x1, y1, x2, y2, radiusX);
@@ -25796,7 +25796,7 @@
25796
25796
  return 2 === a.length ? this.nativeContext.createImageData(a[0], a[1]) : 1 === a.length ? this.nativeContext.createImageData(a[0]) : null;
25797
25797
  }
25798
25798
  createLinearGradient(x0, y0, x1, y1) {
25799
- return this.nativeContext.createLinearGradient(x0, y0, x1, y1);
25799
+ return isFinite(x0 + y0 + x1 + y1) || (x0 = 0, y0 = 0, x1 = 0, y1 = 0), this.nativeContext.createLinearGradient(x0, y0, x1, y1);
25800
25800
  }
25801
25801
  createPattern(image, repetition) {
25802
25802
  return 0 === image.width || 0 === image.height ? null : this.nativeContext.createPattern(image, repetition);
@@ -30112,7 +30112,7 @@
30112
30112
  loadScrollbarComponent();
30113
30113
  let ScrollBar$1 = class ScrollBar extends AbstractComponent {
30114
30114
  constructor(attributes, options) {
30115
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, ScrollBar.defaultAttributes, attributes)), this.name = "scrollbar", this._onRailPointerDown = e => {
30115
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, ScrollBar.defaultAttributes, attributes)), this.name = "scrollbar", this._onRailPointerDown = e => {
30116
30116
  const {
30117
30117
  viewX: viewX,
30118
30118
  viewY: viewY
@@ -30608,7 +30608,7 @@
30608
30608
  return this._textShape;
30609
30609
  }
30610
30610
  constructor(attributes, options) {
30611
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, Tag.defaultAttributes, attributes)), this.name = "tag", this._tagStates = [], this._rectStates = [], this._symbolStates = [], this._textStates = [];
30611
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, Tag.defaultAttributes, attributes)), this.name = "tag", this._tagStates = [], this._rectStates = [], this._symbolStates = [], this._textStates = [];
30612
30612
  }
30613
30613
  render() {
30614
30614
  var _a, _b, _c;
@@ -30762,7 +30762,7 @@
30762
30762
  this._textShape = textShape, this._symbol = symbol, this.resetStates();
30763
30763
  }
30764
30764
  initAttributes(params, options) {
30765
- params = (null == options ? void 0 : options.skipDefault) ? params : merge$2({}, Tag.defaultAttributes, params), super.initAttributes(params), this.render();
30765
+ params = (null == options ? void 0 : options.skipDefault) ? params : merge$1({}, Tag.defaultAttributes, params), super.initAttributes(params), this.render();
30766
30766
  }
30767
30767
  addState(stateName, keepCurrentStates, hasAnimation) {
30768
30768
  super.addState(stateName, keepCurrentStates, hasAnimation), this._textShape && this._textShape.addState(stateName, keepCurrentStates, hasAnimation), this._bgRect && this._bgRect.addState(stateName, keepCurrentStates, hasAnimation), this._symbol && this._symbol.addState(stateName, keepCurrentStates, hasAnimation);
@@ -30816,14 +30816,14 @@
30816
30816
  }
30817
30817
  };
30818
30818
  const theme = {
30819
- poptip: merge$2({}, DEFAULT_THEME)
30819
+ poptip: merge$1({}, DEFAULT_THEME)
30820
30820
  };
30821
30821
 
30822
30822
  function loadPoptipComponent() {
30823
30823
  registerGroup(), registerText(), registerSymbol(), registerRect();
30824
30824
  }
30825
30825
  function setPoptipTheme(defaultPoptipTheme) {
30826
- merge$2(theme.poptip, DEFAULT_THEME, defaultPoptipTheme);
30826
+ merge$1(theme.poptip, DEFAULT_THEME, defaultPoptipTheme);
30827
30827
  }
30828
30828
 
30829
30829
  var __rest$c = undefined && undefined.__rest || function (s, e) {
@@ -30839,7 +30839,7 @@
30839
30839
  loadPoptipComponent();
30840
30840
  class PopTip extends AbstractComponent {
30841
30841
  constructor(attributes, options) {
30842
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, PopTip.defaultAttributes, attributes)), this.name = "poptip", this.positionList = ["top", "tl", "tr", "bottom", "bl", "br", "left", "lt", "lb", "right", "rt", "rb"];
30842
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, PopTip.defaultAttributes, attributes)), this.name = "poptip", this.positionList = ["top", "tl", "tr", "bottom", "bl", "br", "left", "lt", "lb", "right", "rt", "rb"];
30843
30843
  }
30844
30844
  render() {
30845
30845
  var _a, _b, _c, _d, _e, _f, _g, _h;
@@ -31092,7 +31092,7 @@
31092
31092
  return c > 3 && r && Object.defineProperty(target, key, r), r;
31093
31093
  };
31094
31094
  function wrapPoptip(target, source) {
31095
- return merge$2(target, theme.poptip, source), target;
31095
+ return merge$1(target, theme.poptip, source), target;
31096
31096
  }
31097
31097
  let PopTipRenderContribution = class {
31098
31098
  render(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb, options) {
@@ -31104,7 +31104,7 @@
31104
31104
  } = graphic.attribute.poptip || {};
31105
31105
  if (!1 === visible || visibleCb && !1 === visibleCb(graphic)) return;
31106
31106
  const attribute = {};
31107
- merge$2(attribute, PopTip.defaultAttributes, graphic.attribute.poptip ? graphic.attribute.poptip : {}), this.poptipComponent ? this.poptipComponent.initAttributes(attribute) : this.poptipComponent = new PopTip(attribute);
31107
+ merge$1(attribute, PopTip.defaultAttributes, graphic.attribute.poptip ? graphic.attribute.poptip : {}), this.poptipComponent ? this.poptipComponent.initAttributes(attribute) : this.poptipComponent = new PopTip(attribute);
31108
31108
  let poptip = graphic.attribute.poptip || {};
31109
31109
  if ("text" === graphic.type && null == poptip.title && null == poptip.content) {
31110
31110
  const out = {};
@@ -31239,7 +31239,7 @@
31239
31239
  loadLineCrosshairComponent();
31240
31240
  class LineCrosshair extends CrosshairBase {
31241
31241
  constructor(attributes, options) {
31242
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, LineCrosshair.defaultAttributes, attributes));
31242
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, LineCrosshair.defaultAttributes, attributes));
31243
31243
  }
31244
31244
  renderCrosshair(container) {
31245
31245
  const {
@@ -31273,7 +31273,7 @@
31273
31273
  loadRectCrosshairComponent();
31274
31274
  class RectCrosshair extends CrosshairBase {
31275
31275
  constructor(attributes, options) {
31276
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, RectCrosshair.defaultAttributes, attributes));
31276
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, RectCrosshair.defaultAttributes, attributes));
31277
31277
  }
31278
31278
  renderCrosshair(container) {
31279
31279
  const {
@@ -31309,7 +31309,7 @@
31309
31309
  loadCircleCrosshairComponent();
31310
31310
  class CircleCrosshair extends CrosshairBase {
31311
31311
  constructor(attributes, options) {
31312
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, CircleCrosshair.defaultAttributes, attributes));
31312
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, CircleCrosshair.defaultAttributes, attributes));
31313
31313
  }
31314
31314
  renderCrosshair(container) {
31315
31315
  const {
@@ -31340,7 +31340,7 @@
31340
31340
  loadSectorCrosshairComponent();
31341
31341
  class SectorCrosshair extends CrosshairBase {
31342
31342
  constructor(attributes, options) {
31343
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, SectorCrosshair.defaultAttributes, attributes));
31343
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, SectorCrosshair.defaultAttributes, attributes));
31344
31344
  }
31345
31345
  renderCrosshair(container) {
31346
31346
  const {
@@ -31384,7 +31384,7 @@
31384
31384
  loadPolygonCrosshairComponent();
31385
31385
  class PolygonCrosshair extends CrosshairBase {
31386
31386
  constructor(attributes, options) {
31387
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, PolygonCrosshair.defaultAttributes, attributes));
31387
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, PolygonCrosshair.defaultAttributes, attributes));
31388
31388
  }
31389
31389
  renderCrosshair(container) {
31390
31390
  const {
@@ -31950,7 +31950,7 @@
31950
31950
  restAttributes = __rest$b(attributes, ["data"]);
31951
31951
  super((null == options ? void 0 : options.skipDefault) ? attributes : Object.assign({
31952
31952
  data: data
31953
- }, merge$2({}, LabelBase.defaultAttributes, restAttributes))), this.name = "label", this._onHover = e => {
31953
+ }, merge$1({}, LabelBase.defaultAttributes, restAttributes))), this.name = "label", this._onHover = e => {
31954
31954
  const target = e.target;
31955
31955
  target === this._lastHover || isEmpty(target.states) || (target.addState(StateValue.hover, !0), traverseGroup(this, node => {
31956
31956
  node === target || isEmpty(node.states) || node.addState(StateValue.hoverReverse, !0);
@@ -32075,9 +32075,9 @@
32075
32075
  } = this.attribute,
32076
32076
  animationCfg = isObject$2(animation) ? animation : {};
32077
32077
  this._animationConfig = {
32078
- enter: !1 !== animationEnter && merge$2({}, DefaultLabelAnimation, animationCfg, null != animationEnter ? animationEnter : {}),
32079
- exit: !1 !== animationExit && merge$2({}, DefaultLabelAnimation, animationCfg, null != animationExit ? animationExit : {}),
32080
- update: !1 !== animationUpdate && (isArray$1(animationUpdate) ? animationUpdate : merge$2({}, DefaultLabelAnimation, animationCfg, null != animationUpdate ? animationUpdate : {}))
32078
+ enter: !1 !== animationEnter && merge$1({}, DefaultLabelAnimation, animationCfg, null != animationEnter ? animationEnter : {}),
32079
+ exit: !1 !== animationExit && merge$1({}, DefaultLabelAnimation, animationCfg, null != animationExit ? animationExit : {}),
32080
+ update: !1 !== animationUpdate && (isArray$1(animationUpdate) ? animationUpdate : merge$1({}, DefaultLabelAnimation, animationCfg, null != animationUpdate ? animationUpdate : {}))
32081
32081
  };
32082
32082
  } else this._animationConfig = {
32083
32083
  enter: !1,
@@ -32405,7 +32405,8 @@
32405
32405
  textType: textType,
32406
32406
  contrastRatiosThreshold: contrastRatiosThreshold,
32407
32407
  alternativeColors: alternativeColors,
32408
- mode: mode
32408
+ mode: mode,
32409
+ interactInvertType: interactInvertType
32409
32410
  } = option,
32410
32411
  fillStrategy = null !== (_a = option.fillStrategy) && void 0 !== _a ? _a : "invertBase",
32411
32412
  strokeStrategy = null !== (_b = option.strokeStrategy) && void 0 !== _b ? _b : "base",
@@ -32419,18 +32420,20 @@
32419
32420
  backgroundColor = baseMark.attribute.fill,
32420
32421
  foregroundColor = label.attribute.fill,
32421
32422
  invertColor = labelSmartInvert(foregroundColor, backgroundColor, textType, contrastRatiosThreshold, alternativeColors, mode),
32422
- similarColor = contrastAccessibilityChecker(invertColor, brightColor) ? brightColor : darkColor;
32423
- if (outsideEnable || this._canPlaceInside(label.AABBBounds, baseMark.AABBBounds)) {
32423
+ similarColor = contrastAccessibilityChecker(invertColor, brightColor) ? brightColor : darkColor,
32424
+ isInside = this._canPlaceInside(label.AABBBounds, baseMark.AABBBounds),
32425
+ isIntersect = !isInside && label.AABBBounds && baseMark.AABBBounds && baseMark.AABBBounds.intersects(label.AABBBounds);
32426
+ if (isInside || outsideEnable || isIntersect && "inside" === interactInvertType) {
32424
32427
  const fill = smartInvertStrategy(fillStrategy, backgroundColor, invertColor, similarColor);
32425
32428
  if (fill && label.setAttributes({
32426
32429
  fill: fill
32427
- }), 0 === label.attribute.lineWidth) continue;
32430
+ }), 0 === label.attribute.lineWidth || 0 === label.attribute.strokeOpacity) continue;
32428
32431
  const stroke = smartInvertStrategy(strokeStrategy, backgroundColor, invertColor, similarColor);
32429
32432
  stroke && label.setAttributes({
32430
32433
  stroke: stroke
32431
32434
  });
32432
- } else if (label.AABBBounds && baseMark.AABBBounds && baseMark.AABBBounds.intersects(label.AABBBounds)) {
32433
- if (0 === label.attribute.lineWidth) continue;
32435
+ } else if (isIntersect && "none" !== interactInvertType) {
32436
+ if (0 === label.attribute.lineWidth || 0 === label.attribute.strokeOpacity) continue;
32434
32437
  if (label.attribute.stroke) {
32435
32438
  label.setAttributes({
32436
32439
  fill: labelSmartInvert(label.attribute.fill, label.attribute.stroke, textType, contrastRatiosThreshold, alternativeColors, mode)
@@ -32495,7 +32498,7 @@
32495
32498
  restAttributes = __rest$a(attributes, ["data"]);
32496
32499
  super((null == options ? void 0 : options.skipDefault) ? attributes : Object.assign({
32497
32500
  data: data
32498
- }, merge$2({}, SymbolLabel.defaultAttributes, restAttributes))), this.name = "symbol-label";
32501
+ }, merge$1({}, SymbolLabel.defaultAttributes, restAttributes))), this.name = "symbol-label";
32499
32502
  }
32500
32503
  labeling(textBounds, graphicBounds) {
32501
32504
  let position = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "top";
@@ -32531,7 +32534,7 @@
32531
32534
  restAttributes = __rest$9(attributes, ["data"]);
32532
32535
  super((null == options ? void 0 : options.skipDefault) ? attributes : Object.assign({
32533
32536
  data: data
32534
- }, merge$2({}, RectLabel.defaultAttributes, restAttributes)));
32537
+ }, merge$1({}, RectLabel.defaultAttributes, restAttributes)));
32535
32538
  }
32536
32539
  labeling(textBounds, graphicBounds) {
32537
32540
  let position = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "top";
@@ -32595,7 +32598,7 @@
32595
32598
  restAttributes = __rest$8(attributes, ["data"]);
32596
32599
  super((null == options ? void 0 : options.skipDefault) ? attributes : Object.assign({
32597
32600
  data: data
32598
- }, merge$2({}, LineLabel.defaultAttributes, restAttributes))), this.name = "line-label";
32601
+ }, merge$1({}, LineLabel.defaultAttributes, restAttributes))), this.name = "line-label";
32599
32602
  }
32600
32603
  getGraphicBounds(graphic) {
32601
32604
  let point = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
@@ -32667,7 +32670,7 @@
32667
32670
  restAttributes = __rest$7(attributes, ["data"]);
32668
32671
  super((null == options ? void 0 : options.skipDefault) ? attributes : Object.assign({
32669
32672
  data: data
32670
- }, merge$2({}, ArcLabel.defaultAttributes, restAttributes))), this.name = "arc-label", this._ellipsisWidth = 0, this._arcLeft = new Map(), this._arcRight = new Map(), this._line2MinLength = 0, this._alignOffset = 0;
32673
+ }, merge$1({}, ArcLabel.defaultAttributes, restAttributes))), this.name = "arc-label", this._ellipsisWidth = 0, this._arcLeft = new Map(), this._arcRight = new Map(), this._line2MinLength = 0, this._alignOffset = 0;
32671
32674
  }
32672
32675
  _overlapping(labels) {
32673
32676
  return labels;
@@ -32877,7 +32880,7 @@
32877
32880
  const radius = this.computeRadius(radiusRatio, attribute.width, attribute.height),
32878
32881
  flag = isQuadrantLeft(quadrant) ? -1 : 1;
32879
32882
  let cx = 0,
32880
- limit = (flag > 0 ? plotLayout_x2 - pointB.x + this._alignOffset : pointB.x - plotLayout_x1 - this._alignOffset) - this._line2MinLength - spaceWidth;
32883
+ limit = (flag > 0 ? plotLayout_x2 - pointB.x : pointB.x - plotLayout_x1) + this._alignOffset - this._line2MinLength - spaceWidth;
32881
32884
  "labelLine" === labelLayoutAlign && (cx = (radius + line1MinLength + this._line2MinLength) * flag + center.x, limit = (flag > 0 ? plotLayout_x2 - cx : cx - plotLayout_x1) - spaceWidth);
32882
32885
  const text = this._getFormatLabelText(arc.refDatum, limit);
32883
32886
  arc.labelText = text;
@@ -33212,7 +33215,7 @@
33212
33215
  restAttributes = __rest$6(attributes, ["dataLabels"]);
33213
33216
  super((null == options ? void 0 : options.skipDefault) ? attributes : Object.assign({
33214
33217
  dataLabels: dataLabels
33215
- }, merge$2({}, DataLabel.defaultAttributes, restAttributes))), this.name = "data-label";
33218
+ }, merge$1({}, DataLabel.defaultAttributes, restAttributes))), this.name = "data-label";
33216
33219
  }
33217
33220
  render() {
33218
33221
  var _a;
@@ -33287,7 +33290,7 @@
33287
33290
  return this._mainSegmentPoints;
33288
33291
  }
33289
33292
  constructor(attributes, options) {
33290
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, Segment.defaultAttributes, attributes)), this.name = "segment", this.key = "segment", this.lines = [];
33293
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, Segment.defaultAttributes, attributes)), this.name = "segment", this.key = "segment", this.lines = [];
33291
33294
  }
33292
33295
  render() {
33293
33296
  this.removeAllChild(!0), this._reset();
@@ -33463,7 +33466,7 @@
33463
33466
  loadArcSegmentComponent();
33464
33467
  class ArcSegment extends Segment {
33465
33468
  constructor(attributes, options) {
33466
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, Segment.defaultAttributes, attributes)), this.name = "arc-segment", this.key = "arc-segment", this.isReverseArc = !1;
33469
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, Segment.defaultAttributes, attributes)), this.name = "arc-segment", this.key = "arc-segment", this.isReverseArc = !1;
33467
33470
  }
33468
33471
  getStartAngle() {
33469
33472
  const tangAng = this.isReverseArc ? this._startAngle + Math.PI / 2 : this._startAngle - Math.PI / 2;
@@ -33611,7 +33614,7 @@
33611
33614
  style = {},
33612
33615
  angle = .5 * Math.PI
33613
33616
  } = props,
33614
- symbolStyle = merge$2({}, DEFAULT_AXIS_BREAK_SYMBOL_STYLE, style),
33617
+ symbolStyle = merge$1({}, DEFAULT_AXIS_BREAK_SYMBOL_STYLE, style),
33615
33618
  symbolSize = null !== (_a = symbolStyle.size) && void 0 !== _a ? _a : DEFAULT_AXIS_BREAK_SYMBOL_STYLE.size;
33616
33619
  return Object.assign(Object.assign({}, symbolStyle), {
33617
33620
  symbolType: null !== (_b = symbolStyle.symbolType) && void 0 !== _b ? _b : `M ${-symbolSize / 2} ${symbolSize * Math.sin(angle)} L ${symbolSize / 2} ${-symbolSize * Math.sin(angle)}`,
@@ -33667,6 +33670,15 @@
33667
33670
  0 === index ? path = `M${point.x},${point.y}` : path += `L${point.x},${point.y}`;
33668
33671
  }), closed && (path += "Z")), path;
33669
33672
  }
33673
+ function textIntersect(textA, textB, sep) {
33674
+ let a = textA.OBBBounds,
33675
+ b = textB.OBBBounds;
33676
+ return a && b && !a.empty() && !b.empty() ? a.intersects(b) : (a = textA.AABBBounds, b = textB.AABBBounds, sep > Math.max(b.x1 - a.x2, a.x1 - b.x2, b.y1 - a.y2, a.y1 - b.y2));
33677
+ }
33678
+ function hasOverlap$1(items, pad) {
33679
+ for (let b, i = 1, n = items.length, a = items[0]; i < n; a = b, ++i) if (b = items[i], textIntersect(a, b, pad)) return !0;
33680
+ return !1;
33681
+ }
33670
33682
 
33671
33683
  const dispatchHoverState = (e, container, lastHover) => {
33672
33684
  const target = e.target;
@@ -33704,7 +33716,7 @@
33704
33716
  }
33705
33717
  getBoundsWithoutRender(attributes) {
33706
33718
  const currentAttribute = cloneDeep(this.attribute);
33707
- merge$2(this.attribute, attributes);
33719
+ merge$1(this.attribute, attributes);
33708
33720
  const offscreenGroup = graphicCreator.group({
33709
33721
  x: this.attribute.x,
33710
33722
  y: this.attribute.y
@@ -33786,7 +33798,7 @@
33786
33798
  const line = graphicCreator.line(Object.assign({}, this._getTickLineAttribute("tick", item, index, tickLineItems)));
33787
33799
  if (line.name = AXIS_ELEMENT_NAME.tick, line.id = this._getNodeId(item.id), isEmpty(null === (_a = this.attribute.tick) || void 0 === _a ? void 0 : _a.state)) line.states = DEFAULT_STATES$2;else {
33788
33800
  const data = this.data[index],
33789
- tickLineState = merge$2({}, DEFAULT_STATES$2, this.attribute.tick.state);
33801
+ tickLineState = merge$1({}, DEFAULT_STATES$2, this.attribute.tick.state);
33790
33802
  Object.keys(tickLineState).forEach(key => {
33791
33803
  isFunction$1(tickLineState[key]) && (tickLineState[key] = tickLineState[key](data.rawValue, index, data, this.data));
33792
33804
  }), line.states = tickLineState;
@@ -33801,7 +33813,7 @@
33801
33813
  subTickLineItems.length && subTickLineItems.forEach((item, index) => {
33802
33814
  const line = graphicCreator.line(Object.assign({}, this._getTickLineAttribute("subTick", item, index, tickLineItems)));
33803
33815
  if (line.name = AXIS_ELEMENT_NAME.subTick, line.id = this._getNodeId(`${index}`), isEmpty(subTick.state)) line.states = DEFAULT_STATES$2;else {
33804
- const subTickLineState = merge$2({}, DEFAULT_STATES$2, subTick.state);
33816
+ const subTickLineState = merge$1({}, DEFAULT_STATES$2, subTick.state);
33805
33817
  Object.keys(subTickLineState).forEach(key => {
33806
33818
  isFunction$1(subTickLineState[key]) && (subTickLineState[key] = subTickLineState[key](item.value, index, item, tickLineItems));
33807
33819
  }), line.states = subTickLineState;
@@ -33826,7 +33838,7 @@
33826
33838
  const labelStyle = this._getLabelAttribute(item, index, data, layer),
33827
33839
  text = createTextGraphicByType(labelStyle);
33828
33840
  if (text.name = AXIS_ELEMENT_NAME.label, text.id = this._getNodeId(`layer${layer}-label-${item.id}`), isEmpty(null === (_a = this.attribute.label) || void 0 === _a ? void 0 : _a.state)) text.states = DEFAULT_STATES$2;else {
33829
- const labelState = merge$2({}, DEFAULT_STATES$2, this.attribute.label.state);
33841
+ const labelState = merge$1({}, DEFAULT_STATES$2, this.attribute.label.state);
33830
33842
  Object.keys(labelState).forEach(key => {
33831
33843
  isFunction$1(labelState[key]) && (labelState[key] = labelState[key](item, index, data, layer));
33832
33844
  }), text.states = labelState;
@@ -33918,7 +33930,7 @@
33918
33930
  _getTickLineAttribute(type, tickItem, index, tickItems) {
33919
33931
  let style = get$1(this.attribute, `${type}.style`);
33920
33932
  const data = this.data[index];
33921
- style = isFunction$1(style) ? merge$2({}, get$1(DEFAULT_AXIS_THEME, `${type}.style`), "tick" === type ? style(data.rawValue, index, data, this.data) : style(tickItem.value, index, tickItem, tickItems)) : style;
33933
+ style = isFunction$1(style) ? merge$1({}, get$1(DEFAULT_AXIS_THEME, `${type}.style`), "tick" === type ? style(data.rawValue, index, data, this.data) : style(tickItem.value, index, tickItem, tickItems)) : style;
33922
33934
  const {
33923
33935
  start: start,
33924
33936
  end: end,
@@ -33953,9 +33965,9 @@
33953
33965
  let {
33954
33966
  style: textStyle
33955
33967
  } = this.attribute.label;
33956
- textStyle = isFunction$1(textStyle) ? merge$2({}, DEFAULT_AXIS_THEME.label.style, textStyle(tickDatum, index, tickData, layer)) : textStyle;
33968
+ textStyle = isFunction$1(textStyle) ? merge$1({}, DEFAULT_AXIS_THEME.label.style, textStyle(tickDatum, index, tickData, layer)) : textStyle;
33957
33969
  const labelAlign = this.getLabelAlign(vector, inside, textStyle.angle);
33958
- return textStyle = merge$2(labelAlign, textStyle), isFunction$1(textStyle.text) && (textStyle.text = textStyle.text({
33970
+ return textStyle = merge$1(labelAlign, textStyle), isFunction$1(textStyle.text) && (textStyle.text = textStyle.text({
33959
33971
  label: tickDatum.label,
33960
33972
  value: tickDatum.rawValue,
33961
33973
  index: tickDatum.index,
@@ -33991,17 +34003,9 @@
33991
34003
  },
33992
34004
  greedy: function (items, sep) {
33993
34005
  let a;
33994
- return items.filter((b, i) => i && intersect$1(a, b, sep) ? b.setAttribute("opacity", 0) : (a = b, 1));
34006
+ return items.filter((b, i) => i && textIntersect(a, b, sep) ? b.setAttribute("opacity", 0) : (a = b, 1));
33995
34007
  }
33996
34008
  };
33997
- function intersect$1(textA, textB, sep) {
33998
- let a = textA.OBBBounds,
33999
- b = textB.OBBBounds;
34000
- return a && b && !a.empty() && !b.empty() ? a.intersects(b) : (a = textA.AABBBounds, b = textB.AABBBounds, sep > Math.max(b.x1 - a.x2, a.x1 - b.x2, b.y1 - a.y2, a.y1 - b.y2));
34001
- }
34002
- function hasOverlap$2(items, pad) {
34003
- for (let b, i = 1, n = items.length, a = items[0]; i < n; a = b, ++i) if (intersect$1(a, b = items[i], pad)) return !0;
34004
- }
34005
34009
  function hasBounds(item) {
34006
34010
  let bounds;
34007
34011
  return bounds = item.OBBBounds.empty() ? item.AABBBounds : item.OBBBounds, bounds.width() > 1 && bounds.height() > 1;
@@ -34009,6 +34013,20 @@
34009
34013
  function reset$1(items) {
34010
34014
  return items.forEach(item => item.setAttribute("opacity", 1)), items;
34011
34015
  }
34016
+ function forceItemVisible$1(sourceItem, items, check, comparator) {
34017
+ let inverse = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
34018
+ if (check && !sourceItem.attribute.opacity) {
34019
+ const remainLength = items.length;
34020
+ if (remainLength > 1) {
34021
+ sourceItem.setAttribute("opacity", 1);
34022
+ for (let i = 0; i < remainLength; i++) {
34023
+ const item = inverse ? items[remainLength - 1 - i] : items[i];
34024
+ if (!comparator(item)) break;
34025
+ item.setAttribute("opacity", 0);
34026
+ }
34027
+ }
34028
+ }
34029
+ }
34012
34030
  function autoHide(labels, config) {
34013
34031
  if (isEmpty(labels)) return;
34014
34032
  const source = labels.filter(hasBounds);
@@ -34020,20 +34038,16 @@
34020
34038
  separation: sep = 0
34021
34039
  } = config,
34022
34040
  reduce = isFunction$1(method) ? method : methods$2[method] || methods$2.parity;
34023
- if (items.length >= 3 && hasOverlap$2(items, sep)) {
34041
+ if (items.length >= 3 && hasOverlap$1(items, sep)) {
34024
34042
  do {
34025
34043
  items = reduce(items, sep);
34026
- } while (items.length >= 3 && hasOverlap$2(items, sep));
34027
- if (items.length < 3 || config.lastVisible) {
34028
- const lastSourceItem = last(source);
34029
- if (!lastSourceItem.attribute.opacity) {
34030
- const remainLength = items.length;
34031
- if (remainLength > 1) {
34032
- lastSourceItem.setAttribute("opacity", 1);
34033
- for (let i = remainLength - 1; i >= 0 && intersect$1(items[i], lastSourceItem, sep); i--) items[i].setAttribute("opacity", 0);
34034
- }
34035
- }
34036
- }
34044
+ } while (items.length >= 3 && hasOverlap$1(items, sep));
34045
+ const shouldCheck = (length, visibility) => length < 3 || visibility,
34046
+ checkFirst = shouldCheck(items.length, config.firstVisible);
34047
+ let checkLast = shouldCheck(items.length, config.lastVisible);
34048
+ const firstSourceItem = source[0],
34049
+ lastSourceItem = last(source);
34050
+ textIntersect(firstSourceItem, lastSourceItem, sep) && (lastSourceItem.setAttribute("opacity", 0), checkLast = !1), forceItemVisible$1(firstSourceItem, items, checkFirst, item => textIntersect(item, firstSourceItem, sep)), forceItemVisible$1(lastSourceItem, items, checkLast, item => textIntersect(item, lastSourceItem, sep) || !(!checkFirst || item === firstSourceItem) && textIntersect(item, firstSourceItem, sep), !0);
34037
34051
  }
34038
34052
  source.forEach(item => {
34039
34053
  item.setAttribute("visible", !!item.attribute.opacity);
@@ -34346,7 +34360,7 @@
34346
34360
  loadLineAxisComponent();
34347
34361
  class LineAxis extends AxisBase {
34348
34362
  constructor(attributes, options) {
34349
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, LineAxis.defaultAttributes, attributes), options);
34363
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, LineAxis.defaultAttributes, attributes), options);
34350
34364
  }
34351
34365
  _renderInner(container) {
34352
34366
  var _a;
@@ -34406,7 +34420,7 @@
34406
34420
  width: axisContainerBounds.width(),
34407
34421
  height: axisContainerBounds.height()
34408
34422
  }, panel.style));
34409
- bgRect.name = AXIS_ELEMENT_NAME.background, bgRect.id = this._getNodeId("background"), bgRect.states = merge$2({}, DEFAULT_STATES$1, null !== (_a = panel.state) && void 0 !== _a ? _a : {}), axisContainer.insertBefore(bgRect, axisContainer.firstChild);
34423
+ bgRect.name = AXIS_ELEMENT_NAME.background, bgRect.id = this._getNodeId("background"), bgRect.states = merge$1({}, DEFAULT_STATES$1, null !== (_a = panel.state) && void 0 !== _a ? _a : {}), axisContainer.insertBefore(bgRect, axisContainer.firstChild);
34410
34424
  }
34411
34425
  }
34412
34426
  renderLine(container) {
@@ -34440,8 +34454,8 @@
34440
34454
  }), linePoints.push([lastStartPoint, end]), lineAttrs.points = linePoints, lineAttrs.multiSegment = !0;
34441
34455
  } else lineAttrs.points = [start, end];
34442
34456
  isEmpty(state) || (lineAttrs.state = {
34443
- line: merge$2({}, DEFAULT_STATES$1, state),
34444
- symbol: merge$2({}, DEFAULT_STATES$1, state)
34457
+ line: merge$1({}, DEFAULT_STATES$1, state),
34458
+ symbol: merge$1({}, DEFAULT_STATES$1, state)
34445
34459
  });
34446
34460
  const axisLineGroup = new Segment(lineAttrs);
34447
34461
  axisLineGroup.name = AXIS_ELEMENT_NAME.line, axisLineGroup.id = this._getNodeId("line"), container.add(axisLineGroup);
@@ -34537,9 +34551,9 @@
34537
34551
  textBaseline: textBaseline
34538
34552
  }, textStyle),
34539
34553
  state: {
34540
- text: merge$2({}, DEFAULT_STATES$1, state.text),
34541
- shape: merge$2({}, DEFAULT_STATES$1, state.shape),
34542
- panel: merge$2({}, DEFAULT_STATES$1, state.background)
34554
+ text: merge$1({}, DEFAULT_STATES$1, state.text),
34555
+ shape: merge$1({}, DEFAULT_STATES$1, state.shape),
34556
+ panel: merge$1({}, DEFAULT_STATES$1, state.background)
34543
34557
  }
34544
34558
  });
34545
34559
  return attrs.angle = angle, shape && shape.visible && (attrs.shape = Object.assign({
@@ -34649,6 +34663,7 @@
34649
34663
  autoHideMethod: autoHideMethod,
34650
34664
  autoHideSeparation: autoHideSeparation,
34651
34665
  lastVisible: lastVisible,
34666
+ firstVisible: firstVisible,
34652
34667
  autoWrap: autoWrap$1,
34653
34668
  overflowLimitLength: overflowLimitLength
34654
34669
  } = label;
@@ -34682,7 +34697,8 @@
34682
34697
  orient: orient,
34683
34698
  method: autoHideMethod,
34684
34699
  separation: autoHideSeparation,
34685
- lastVisible: lastVisible
34700
+ lastVisible: lastVisible,
34701
+ firstVisible: firstVisible
34686
34702
  });
34687
34703
  }
34688
34704
  }
@@ -34850,7 +34866,7 @@
34850
34866
  loadCircleAxisComponent();
34851
34867
  class CircleAxis extends AxisBase {
34852
34868
  constructor(attributes, options) {
34853
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, CircleAxis.defaultAttributes, attributes));
34869
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, CircleAxis.defaultAttributes, attributes));
34854
34870
  }
34855
34871
  renderLine(container) {
34856
34872
  const {
@@ -34880,7 +34896,7 @@
34880
34896
  }), line.style);
34881
34897
  lineGraphic = graphicCreator.circle(arcAttrs);
34882
34898
  }
34883
- lineGraphic.name = AXIS_ELEMENT_NAME.line, lineGraphic.id = this._getNodeId("line"), isEmpty(line.state) || (lineGraphic.states = merge$2({}, DEFAULT_STATES$1, line.state)), container.add(lineGraphic);
34899
+ lineGraphic.name = AXIS_ELEMENT_NAME.line, lineGraphic.id = this._getNodeId("line"), isEmpty(line.state) || (lineGraphic.states = merge$1({}, DEFAULT_STATES$1, line.state)), container.add(lineGraphic);
34884
34900
  }
34885
34901
  getTitleAttribute() {
34886
34902
  var _a, _b, _c;
@@ -34921,9 +34937,9 @@
34921
34937
  textAlign: "center"
34922
34938
  }, textStyle),
34923
34939
  state: {
34924
- text: merge$2({}, DEFAULT_STATES$1, state.text),
34925
- shape: merge$2({}, DEFAULT_STATES$1, state.shape),
34926
- panel: merge$2({}, DEFAULT_STATES$1, state.background)
34940
+ text: merge$1({}, DEFAULT_STATES$1, state.text),
34941
+ shape: merge$1({}, DEFAULT_STATES$1, state.shape),
34942
+ panel: merge$1({}, DEFAULT_STATES$1, state.background)
34927
34943
  }
34928
34944
  }),
34929
34945
  {
@@ -35115,13 +35131,6 @@
35115
35131
  nextBounds = new AABBBounds(nextLabel).expand(gap / 2);
35116
35132
  return prevBounds.intersects(nextBounds);
35117
35133
  };
35118
- function intersect(a, b, sep) {
35119
- return sep > Math.max(b.x1 - a.x2, a.x1 - b.x2, b.y1 - a.y2, a.y1 - b.y2);
35120
- }
35121
- function hasOverlap$1(items, pad) {
35122
- for (let b, i = 1, n = items.length, a = items[0]; i < n; a = b, ++i) if (b = items[i], intersect(a.AABBBounds, b.AABBBounds, pad)) return !0;
35123
- return !1;
35124
- }
35125
35134
  const MIN_TICK_GAP = 12;
35126
35135
  const calculateFlushPos = (basePosition, size, rangePosition, otherEnd) => rangePosition < basePosition ? Math.max(basePosition - size / 2, rangePosition) : rangePosition > basePosition ? Math.min(basePosition - size / 2, rangePosition - size) : rangePosition < otherEnd ? rangePosition : rangePosition - size;
35127
35136
  const getCartesianLabelBounds = (scale, domain, op) => {
@@ -36194,6 +36203,20 @@
36194
36203
  } else scaleTicks = getTicks(count);
36195
36204
  return scaleTicks;
36196
36205
  }
36206
+ function forceItemVisible(sourceItem, items, check, comparator) {
36207
+ let inverse = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
36208
+ if (check && !items.includes(sourceItem)) {
36209
+ let remainLength = items.length;
36210
+ if (remainLength > 1) {
36211
+ inverse ? items.push(sourceItem) : items.unshift(sourceItem);
36212
+ for (let i = 0; i < remainLength; i++) {
36213
+ const index = inverse ? remainLength - 1 - i : i;
36214
+ if (!comparator(items[index])) break;
36215
+ items.splice(index, 1), i--, remainLength--;
36216
+ }
36217
+ }
36218
+ }
36219
+ }
36197
36220
  const continuousTicks = (scale, op) => {
36198
36221
  var _a, _b;
36199
36222
  if (!isContinuous(scale.type)) return convertDomainToTickData(scale.domain());
@@ -36233,7 +36256,8 @@
36233
36256
  customTicks: customTicks
36234
36257
  }));
36235
36258
  }
36236
- if (op.sampling && ("cartesian" === op.coordinateType || "polar" === op.coordinateType && "radius" === op.axisOrientType)) {
36259
+ const domain = scale.domain();
36260
+ if (op.labelFirstVisible && domain[0] !== scaleTicks[0] && !scaleTicks.includes(domain[0]) && scaleTicks.unshift(domain[0]), op.labelLastVisible && domain[domain.length - 1] !== scaleTicks[scaleTicks.length - 1] && !scaleTicks.includes(domain[domain.length - 1]) && scaleTicks.push(domain[domain.length - 1]), op.sampling && scaleTicks.length > 1 && ("cartesian" === op.coordinateType || "polar" === op.coordinateType && "radius" === op.axisOrientType)) {
36237
36261
  const {
36238
36262
  labelGap = 4,
36239
36263
  labelFlush: labelFlush
@@ -36242,8 +36266,15 @@
36242
36266
  AABBBounds: bounds,
36243
36267
  value: scaleTicks[i]
36244
36268
  }));
36245
- const samplingMethod = breakData && breakData() ? methods$1.greedy : methods$1.parity;
36269
+ const source = [...items],
36270
+ firstSourceItem = source[0],
36271
+ lastSourceItem = last(source),
36272
+ samplingMethod = breakData && breakData() ? methods$1.greedy : methods$1.parity;
36246
36273
  for (; items.length >= 3 && hasOverlap$1(items, labelGap);) items = samplingMethod(items, labelGap);
36274
+ const shouldCheck = (length, visibility) => length < 3 || visibility,
36275
+ checkFirst = shouldCheck(items.length, op.labelFirstVisible);
36276
+ let checkLast = shouldCheck(items.length, op.labelLastVisible);
36277
+ textIntersect(firstSourceItem, lastSourceItem, labelGap) && items.includes(lastSourceItem) && items.length > 1 && (items.splice(items.indexOf(lastSourceItem), 1), checkLast = !1), forceItemVisible(firstSourceItem, items, checkFirst, item => textIntersect(item, firstSourceItem, labelGap)), forceItemVisible(lastSourceItem, items, checkLast, item => textIntersect(item, lastSourceItem, labelGap) || !(!checkFirst || item === firstSourceItem) && textIntersect(item, firstSourceItem, labelGap), !0);
36247
36278
  const ticks = items.map(item => item.value);
36248
36279
  ticks.length < 3 && labelFlush && (ticks.length > 1 && ticks.pop(), last(ticks) !== last(scaleTicks) && ticks.push(last(scaleTicks))), scaleTicks = ticks;
36249
36280
  }
@@ -36255,7 +36286,7 @@
36255
36286
  },
36256
36287
  greedy: function (items, sep) {
36257
36288
  let a;
36258
- return items.filter((b, i) => (!i || !intersect(a.AABBBounds, b.AABBBounds, sep)) && (a = b, !0));
36289
+ return items.filter((b, i) => (!i || !textIntersect(a, b, sep)) && (a = b, !0));
36259
36290
  }
36260
36291
  };
36261
36292
 
@@ -36539,7 +36570,7 @@
36539
36570
  visible && this._renderGridByType(!0, container), this._renderGridByType(!1, container);
36540
36571
  }
36541
36572
  _renderGridByType(isSubGrid, container) {
36542
- const gridAttrs = merge$2({}, this.attribute, this.getGridAttribute(isSubGrid)),
36573
+ const gridAttrs = merge$1({}, this.attribute, this.getGridAttribute(isSubGrid)),
36543
36574
  {
36544
36575
  type: type,
36545
36576
  items: items,
@@ -36564,7 +36595,7 @@
36564
36595
  const shape = graphicCreator.path(Object.assign({
36565
36596
  path: path,
36566
36597
  z: depth
36567
- }, isFunction$1(style) ? merge$2({}, this.skipDefault ? null : BaseGrid.defaultAttributes.style, style(item, index)) : style));
36598
+ }, isFunction$1(style) ? merge$1({}, this.skipDefault ? null : BaseGrid.defaultAttributes.style, style(item, index)) : style));
36568
36599
  shape.name = `${name}-line`, shape.id = this._getNodeId(`${name}-path-${id}`), container.add(shape);
36569
36600
  }), depth && "line" === type && items.forEach((item, index) => {
36570
36601
  const {
@@ -36590,7 +36621,7 @@
36590
36621
  alpha: deltaX > deltaY ? (points[1].x - points[0].x > 0 ? -1 : 1) * pi$1 / 2 : 0,
36591
36622
  beta: deltaX < deltaY ? -pi$1 / 2 : 0,
36592
36623
  anchor3d: deltaX > deltaY ? [nextPoints[0].x, 0] : [0, nextPoints[0].y]
36593
- }, isFunction$1(style) ? merge$2({}, this.skipDefault ? null : BaseGrid.defaultAttributes.style, style(item, index)) : style));
36624
+ }, isFunction$1(style) ? merge$1({}, this.skipDefault ? null : BaseGrid.defaultAttributes.style, style(item, index)) : style));
36594
36625
  shape.name = `${name}-line`, shape.id = this._getNodeId(`${name}-path-${id}`), container.add(shape);
36595
36626
  }), items.length > 1 && alternateColor) {
36596
36627
  const colors = isArray$1(alternateColor) ? alternateColor : [alternateColor, "transparent"],
@@ -36662,7 +36693,7 @@
36662
36693
  loadLineAxisGridComponent();
36663
36694
  class LineAxisGrid extends BaseGrid {
36664
36695
  constructor(attributes, options) {
36665
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, BaseGrid.defaultAttributes, attributes), options);
36696
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, BaseGrid.defaultAttributes, attributes), options);
36666
36697
  }
36667
36698
  _getGridPoint(gridType, point) {
36668
36699
  let gridPoints;
@@ -36696,7 +36727,7 @@
36696
36727
  let gridAttribute,
36697
36728
  items = [];
36698
36729
  if (isSubGrid) {
36699
- gridAttribute = merge$2({}, this.attribute, this.attribute.subGrid);
36730
+ gridAttribute = merge$1({}, this.attribute, this.attribute.subGrid);
36700
36731
  const subGridItems = [],
36701
36732
  {
36702
36733
  count: subCount = 4
@@ -36766,7 +36797,7 @@
36766
36797
  loadCircleAxisGridComponent();
36767
36798
  class CircleAxisGrid extends BaseGrid {
36768
36799
  constructor(attributes, options) {
36769
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, BaseGrid.defaultAttributes, attributes), options);
36800
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, BaseGrid.defaultAttributes, attributes), options);
36770
36801
  }
36771
36802
  getGridPointsByValue(value) {
36772
36803
  const basePoint = this.getTickCoord(value),
@@ -36795,7 +36826,7 @@
36795
36826
  length = radius - innerRadius,
36796
36827
  tickSegment = this._parseTickSegment();
36797
36828
  if (isSubGrid) {
36798
- gridAttribute = merge$2({}, grid, subGrid);
36829
+ gridAttribute = merge$1({}, grid, subGrid);
36799
36830
  const subGridItems = [],
36800
36831
  {
36801
36832
  count: subCount = 4
@@ -37015,7 +37046,7 @@
37015
37046
  this._spanCache = this.state.end - this.state.start, 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", previewData && (this._previewData = previewData), isFunction$1(previewPointsX) && (this._previewPointsX = previewPointsX), isFunction$1(previewPointsY) && (this._previewPointsY = previewPointsY), isFunction$1(previewPointsX1) && (this._previewPointsX1 = previewPointsX1), isFunction$1(previewPointsY1) && (this._previewPointsY1 = previewPointsY1);
37016
37047
  }
37017
37048
  constructor(attributes, options) {
37018
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, DataZoom.defaultAttributes, attributes)), this.name = "dataZoom", this._previewData = [], this._activeState = !1, this._activeCache = {
37049
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, DataZoom.defaultAttributes, attributes)), this.name = "dataZoom", this._previewData = [], this._activeState = !1, this._activeCache = {
37019
37050
  startPos: {
37020
37051
  x: 0,
37021
37052
  y: 0
@@ -37239,7 +37270,7 @@
37239
37270
  }, endTextAlignStyle = {
37240
37271
  textAlign: null !== (_h = null === (_g = null == restEndTextStyle ? void 0 : restEndTextStyle.textStyle) || void 0 === _g ? void 0 : _g.textAlign) && void 0 !== _h ? _h : "center",
37241
37272
  textBaseline: this.isTextOverflow(componentBoundsLike, endTextBounds, "end") ? "bottom" : "top"
37242
- }), this._startText = this.maybeAddLabel(this._container, merge$2({}, restStartTextStyle, {
37273
+ }), this._startText = this.maybeAddLabel(this._container, merge$1({}, restStartTextStyle, {
37243
37274
  text: startTextValue,
37244
37275
  x: startTextPosition.x,
37245
37276
  y: startTextPosition.y,
@@ -37247,7 +37278,7 @@
37247
37278
  pickable: !1,
37248
37279
  childrenPickable: !1,
37249
37280
  textStyle: startTextAlignStyle
37250
- }), `data-zoom-start-text-${position}`), this._endText = this.maybeAddLabel(this._container, merge$2({}, restEndTextStyle, {
37281
+ }), `data-zoom-start-text-${position}`), this._endText = this.maybeAddLabel(this._container, merge$1({}, restEndTextStyle, {
37251
37282
  text: endTextValue,
37252
37283
  x: endTextPosition.x,
37253
37284
  y: endTextPosition.y,
@@ -37723,9 +37754,9 @@
37723
37754
  if (!1 !== this.attribute.animation) {
37724
37755
  const animation = isObject$2(this.attribute.animation) ? this.attribute.animation : {};
37725
37756
  this._animationConfig = {
37726
- enter: merge$2({}, this.defaultUpdateAnimation, animation, null !== (_a = this.attribute.animationEnter) && void 0 !== _a ? _a : {}),
37727
- exit: merge$2({}, this.defaultExitAnimation, animation, null !== (_b = this.attribute.animationExit) && void 0 !== _b ? _b : {}),
37728
- update: merge$2({}, this.defaultUpdateAnimation, animation, null !== (_c = this.attribute.animationUpdate) && void 0 !== _c ? _c : {})
37757
+ enter: merge$1({}, this.defaultUpdateAnimation, animation, null !== (_a = this.attribute.animationEnter) && void 0 !== _a ? _a : {}),
37758
+ exit: merge$1({}, this.defaultExitAnimation, animation, null !== (_b = this.attribute.animationExit) && void 0 !== _b ? _b : {}),
37759
+ update: merge$1({}, this.defaultUpdateAnimation, animation, null !== (_c = this.attribute.animationUpdate) && void 0 !== _c ? _c : {})
37729
37760
  };
37730
37761
  }
37731
37762
  }
@@ -38083,8 +38114,8 @@
38083
38114
  line.name = "mark-common-line-line", this._line = line, container.add(line);
38084
38115
  const markLabel = new Tag(Object.assign(Object.assign({}, label), {
38085
38116
  state: {
38086
- panel: merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
38087
- text: merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
38117
+ panel: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
38118
+ text: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
38088
38119
  }
38089
38120
  }));
38090
38121
  markLabel.name = "mark-common-line-label", this._label = markLabel, container.add(markLabel), this.setLabelPos();
@@ -38099,8 +38130,8 @@
38099
38130
  dy: 0
38100
38131
  }, label), {
38101
38132
  state: {
38102
- panel: merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
38103
- text: merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
38133
+ panel: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
38134
+ text: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
38104
38135
  }
38105
38136
  })), this.setLabelPos());
38106
38137
  }
@@ -38568,7 +38599,7 @@
38568
38599
  MarkLine._animate && this._animationConfig && MarkLine._animate(this._line, this._label, this._animationConfig, state);
38569
38600
  }
38570
38601
  constructor(attributes, options) {
38571
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, MarkLine.defaultAttributes, attributes)), this.name = "markLine";
38602
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, MarkLine.defaultAttributes, attributes)), this.name = "markLine";
38572
38603
  }
38573
38604
  getPointAttrByPosition(position) {
38574
38605
  var _a;
@@ -38630,9 +38661,9 @@
38630
38661
  multiSegment: multiSegment,
38631
38662
  pickable: !1,
38632
38663
  state: {
38633
- line: merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.line),
38634
- startSymbol: merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.lineStartSymbol),
38635
- endSymbol: merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.lineEndSymbol)
38664
+ line: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.line),
38665
+ startSymbol: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.lineStartSymbol),
38666
+ endSymbol: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.lineEndSymbol)
38636
38667
  }
38637
38668
  });
38638
38669
  }
@@ -38654,9 +38685,9 @@
38654
38685
  mainSegmentIndex: mainSegmentIndex,
38655
38686
  multiSegment: multiSegment,
38656
38687
  state: {
38657
- line: merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.line),
38658
- startSymbol: merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.lineStartSymbol),
38659
- endSymbol: merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.lineEndSymbol)
38688
+ line: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.line),
38689
+ startSymbol: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.lineStartSymbol),
38690
+ endSymbol: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.lineEndSymbol)
38660
38691
  }
38661
38692
  });
38662
38693
  }
@@ -38690,7 +38721,7 @@
38690
38721
  return this._label;
38691
38722
  }
38692
38723
  constructor(attributes, options) {
38693
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, MarkArea.defaultAttributes, attributes)), this.name = "markArea", this.defaultUpdateAnimation = DefaultUpdateMarkAreaAnimation, this.defaultExitAnimation = DefaultExitMarkerAnimation;
38724
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, MarkArea.defaultAttributes, attributes)), this.name = "markArea", this.defaultUpdateAnimation = DefaultUpdateMarkAreaAnimation, this.defaultExitAnimation = DefaultExitMarkerAnimation;
38694
38725
  }
38695
38726
  getPointAttrByPosition(position) {
38696
38727
  const {
@@ -38752,11 +38783,11 @@
38752
38783
  area = graphicCreator.polygon(Object.assign({
38753
38784
  points: points
38754
38785
  }, areaStyle));
38755
- area.states = merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.area), area.name = "mark-area-polygon", this._area = area, container.add(area);
38786
+ area.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.area), area.name = "mark-area-polygon", this._area = area, container.add(area);
38756
38787
  const markLabel = new Tag(Object.assign(Object.assign({}, label), {
38757
38788
  state: {
38758
- panel: merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
38759
- text: merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
38789
+ panel: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
38790
+ text: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
38760
38791
  }
38761
38792
  }));
38762
38793
  markLabel.name = "mark-area-label", this._label = markLabel, container.add(markLabel), this.setLabelPos();
@@ -38770,13 +38801,13 @@
38770
38801
  } = this.attribute;
38771
38802
  this._area && (this._area.setAttributes(Object.assign({
38772
38803
  points: points
38773
- }, areaStyle)), this._area.states = merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.area)), this._label && this._label.setAttributes(Object.assign(Object.assign({
38804
+ }, areaStyle)), this._area.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.area)), this._label && this._label.setAttributes(Object.assign(Object.assign({
38774
38805
  dx: 0,
38775
38806
  dy: 0
38776
38807
  }, label), {
38777
38808
  state: {
38778
- panel: merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
38779
- text: merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
38809
+ panel: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
38810
+ text: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
38780
38811
  }
38781
38812
  })), this.setLabelPos();
38782
38813
  }
@@ -38802,7 +38833,7 @@
38802
38833
  MarkArcLine._animate && this._animationConfig && MarkArcLine._animate(this._line, this._label, this._animationConfig, state);
38803
38834
  }
38804
38835
  constructor(attributes, options) {
38805
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, MarkArcLine.defaultAttributes, attributes, {
38836
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, MarkArcLine.defaultAttributes, attributes, {
38806
38837
  label: {
38807
38838
  autoRotate: !0
38808
38839
  }
@@ -38873,9 +38904,9 @@
38873
38904
  endSymbol: endSymbol,
38874
38905
  lineStyle: lineStyle,
38875
38906
  state: {
38876
- line: merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.line),
38877
- startSymbol: merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.lineStartSymbol),
38878
- endSymbol: merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.lineEndSymbol)
38907
+ line: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.line),
38908
+ startSymbol: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.lineStartSymbol),
38909
+ endSymbol: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.lineEndSymbol)
38879
38910
  }
38880
38911
  });
38881
38912
  }
@@ -38899,9 +38930,9 @@
38899
38930
  endSymbol: endSymbol,
38900
38931
  lineStyle: lineStyle,
38901
38932
  state: {
38902
- line: merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.line),
38903
- startSymbol: merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.lineStartSymbol),
38904
- endSymbol: merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.lineEndSymbol)
38933
+ line: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.line),
38934
+ startSymbol: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.lineStartSymbol),
38935
+ endSymbol: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.lineEndSymbol)
38905
38936
  }
38906
38937
  });
38907
38938
  }
@@ -38926,7 +38957,7 @@
38926
38957
  return this._label;
38927
38958
  }
38928
38959
  constructor(attributes, options) {
38929
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, MarkArcArea.defaultAttributes, attributes, {
38960
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, MarkArcArea.defaultAttributes, attributes, {
38930
38961
  label: {
38931
38962
  autoRotate: !0
38932
38963
  }
@@ -39028,11 +39059,11 @@
39028
39059
  startAngle: startAngle,
39029
39060
  endAngle: endAngle
39030
39061
  }, areaStyle));
39031
- area.states = merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.area), area.name = "polar-mark-area-area", this._area = area, container.add(area);
39062
+ area.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.area), area.name = "polar-mark-area-area", this._area = area, container.add(area);
39032
39063
  const markLabel = new Tag(Object.assign(Object.assign({}, label), {
39033
39064
  state: {
39034
- panel: merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
39035
- text: merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
39065
+ panel: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
39066
+ text: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
39036
39067
  }
39037
39068
  }));
39038
39069
  markLabel.name = "mark-area-label", this._label = markLabel, container.add(markLabel), this.setLabelPos();
@@ -39055,13 +39086,13 @@
39055
39086
  outerRadius: outerRadius,
39056
39087
  startAngle: startAngle,
39057
39088
  endAngle: endAngle
39058
- }, areaStyle)), this._area.states = merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.area)), this._label && (this._label.setAttributes(Object.assign(Object.assign({
39089
+ }, areaStyle)), this._area.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.area)), this._label && (this._label.setAttributes(Object.assign(Object.assign({
39059
39090
  dx: 0,
39060
39091
  dy: 0
39061
39092
  }, label), {
39062
39093
  state: {
39063
- panel: merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
39064
- text: merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
39094
+ panel: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
39095
+ text: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
39065
39096
  }
39066
39097
  })), this.setLabelPos());
39067
39098
  }
@@ -39080,7 +39111,7 @@
39080
39111
  MarkPoint._animate && this._animationConfig && MarkPoint._animate([this._line, this._decorativeLine], this._item, this._animationConfig, state);
39081
39112
  }
39082
39113
  constructor(attributes, options) {
39083
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, MarkPoint.defaultAttributes, attributes)), this.name = "markPoint", this.defaultUpdateAnimation = DefaultUpdateMarkPointAnimation, this.defaultExitAnimation = DefaultExitMarkerAnimation, this._isArcLine = !1, this._isStraightLine = !1;
39114
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, MarkPoint.defaultAttributes, attributes)), this.name = "markPoint", this.defaultUpdateAnimation = DefaultUpdateMarkPointAnimation, this.defaultExitAnimation = DefaultExitMarkerAnimation, this._isArcLine = !1, this._isStraightLine = !1;
39084
39115
  }
39085
39116
  setLabelPos() {}
39086
39117
  getTextAlignAttr(autoRotate, offsetX, offsetY, lineEndAngle, itemPosition) {
@@ -39111,17 +39142,17 @@
39111
39142
  item.setAttributes(Object.assign(Object.assign({}, textStyle), {
39112
39143
  textStyle: Object.assign(Object.assign({}, this.getTextAlignAttr(autoRotate, offsetX, offsetY, lineEndAngle, null !== (_b = itemContent.position) && void 0 !== _b ? _b : "end")), textStyle.textStyle),
39113
39144
  state: {
39114
- panel: merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.textBackground),
39115
- text: merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.text)
39145
+ panel: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.textBackground),
39146
+ text: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.text)
39116
39147
  }
39117
39148
  }));
39118
39149
  } else "richText" === itemType ? (item.setAttributes({
39119
39150
  dx: this.getItemDx(item, positionType, richTextStyle) + (richTextStyle.dx || 0),
39120
39151
  dy: this.getItemDy(item, positionType, richTextStyle) + (richTextStyle.dy || 0)
39121
- }), item.states = merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.richText)) : "image" === itemType && (item.setAttributes({
39152
+ }), item.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.richText)) : "image" === itemType && (item.setAttributes({
39122
39153
  dx: this.getItemDx(item, positionType, imageStyle) + (imageStyle.dx || 0),
39123
39154
  dy: this.getItemDy(item, positionType, imageStyle) + (imageStyle.dy || 0)
39124
- }), item.states = merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.image));
39155
+ }), item.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.image));
39125
39156
  const itemAngle = isPostiveXAxis(lineEndAngle) ? lineEndAngle : lineEndAngle - Math.PI;
39126
39157
  item.setAttributes({
39127
39158
  x: newItemPosition.x + (itemRefOffsetX || 0),
@@ -39151,12 +39182,12 @@
39151
39182
  renderCustomCallback: renderCustomCallback
39152
39183
  } = itemContent;
39153
39184
  let item;
39154
- return "symbol" === type ? (item = graphicCreator.symbol(Object.assign(Object.assign({}, newItemPosition), symbolStyle)), item.states = merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.symbol)) : "text" === type ? item = new Tag(Object.assign(Object.assign({}, newItemPosition), {
39185
+ return "symbol" === type ? (item = graphicCreator.symbol(Object.assign(Object.assign({}, newItemPosition), symbolStyle)), item.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.symbol)) : "text" === type ? item = new Tag(Object.assign(Object.assign({}, newItemPosition), {
39155
39186
  state: {
39156
- panel: merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.textBackground),
39157
- text: merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.text)
39187
+ panel: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.textBackground),
39188
+ text: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.text)
39158
39189
  }
39159
- })) : "richText" === type ? (item = graphicCreator.richtext(Object.assign(Object.assign({}, newItemPosition), richTextStyle)), item.states = merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.richText)) : "image" === type ? (item = graphicCreator.image(Object.assign(Object.assign({}, newItemPosition), imageStyle)), item.states = merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.image)) : "custom" === type && renderCustomCallback && (item = renderCustomCallback(), item.states = merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.customMark)), item.name = `mark-point-${type}`, this.setItemAttributes(item, itemContent, newPosition, newItemPosition, type), item;
39190
+ })) : "richText" === type ? (item = graphicCreator.richtext(Object.assign(Object.assign({}, newItemPosition), richTextStyle)), item.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.richText)) : "image" === type ? (item = graphicCreator.image(Object.assign(Object.assign({}, newItemPosition), imageStyle)), item.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.image)) : "custom" === type && renderCustomCallback && (item = renderCustomCallback(), item.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.customMark)), item.name = `mark-point-${type}`, this.setItemAttributes(item, itemContent, newPosition, newItemPosition, type), item;
39160
39191
  }
39161
39192
  getItemLineAttr(itemLine, newPosition, newItemPosition) {
39162
39193
  let points = [],
@@ -39228,9 +39259,9 @@
39228
39259
  lineStyle: lineStyle,
39229
39260
  visible: itemLine.visible,
39230
39261
  state: {
39231
- line: merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.line),
39232
- startSymbol: merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.lineStartSymbol),
39233
- endSymbol: merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.lineEndSymbol)
39262
+ line: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.line),
39263
+ startSymbol: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.lineStartSymbol),
39264
+ endSymbol: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.lineEndSymbol)
39234
39265
  }
39235
39266
  })), this._container.add(this._line);
39236
39267
  }
@@ -39252,9 +39283,9 @@
39252
39283
  lineStyle: lineStyle,
39253
39284
  visible: itemLine.visible,
39254
39285
  state: {
39255
- line: merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.line),
39256
- startSymbol: merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.lineStartSymbol),
39257
- endSymbol: merge$2({}, DEFAULT_STATES$2, null == state ? void 0 : state.lineEndSymbol)
39286
+ line: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.line),
39287
+ startSymbol: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.lineStartSymbol),
39288
+ endSymbol: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.lineEndSymbol)
39258
39289
  }
39259
39290
  })) : this.reDrawLine(itemLine, pointsAttr);
39260
39291
  }
@@ -39292,7 +39323,7 @@
39292
39323
  }]
39293
39324
  }, lineStyle), {
39294
39325
  visible: visible
39295
- })), this._decorativeLine.states = merge$2({}, DEFAULT_STATES$2, null === (_a = this.attribute.state) || void 0 === _a ? void 0 : _a.line);
39326
+ })), this._decorativeLine.states = merge$1({}, DEFAULT_STATES$2, null === (_a = this.attribute.state) || void 0 === _a ? void 0 : _a.line);
39296
39327
  }
39297
39328
  }
39298
39329
  setTargetItemAttributes(targetItem, position) {
@@ -39302,7 +39333,7 @@
39302
39333
  y: position.y,
39303
39334
  visible: null !== (_a = targetItem.visible) && void 0 !== _a && _a,
39304
39335
  size: targetItem.size
39305
- }, targetItem.style)), this._targetItem.states = merge$2({}, DEFAULT_STATES$2, null === (_b = this.attribute.state) || void 0 === _b ? void 0 : _b.targetItem));
39336
+ }, targetItem.style)), this._targetItem.states = merge$1({}, DEFAULT_STATES$2, null === (_b = this.attribute.state) || void 0 === _b ? void 0 : _b.targetItem));
39306
39337
  }
39307
39338
  setAllOfItemsAttr(newPosition, newItemPosition) {
39308
39339
  var _a;
@@ -39478,7 +39509,7 @@
39478
39509
  return this._current;
39479
39510
  }
39480
39511
  constructor(attributes, options) {
39481
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, Pager.defaultAttributes, attributes)), this.name = "pager", this._current = 1, this._onHover = e => {
39512
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, Pager.defaultAttributes, attributes)), this.name = "pager", this._current = 1, this._onHover = e => {
39482
39513
  const target = e.target;
39483
39514
  target.hasState("disable") || target.addState("hover");
39484
39515
  }, this._onUnHover = e => {
@@ -39720,7 +39751,7 @@
39720
39751
  loadDiscreteLegendComponent();
39721
39752
  let DiscreteLegend$1 = class DiscreteLegend extends LegendBase {
39722
39753
  constructor(attributes, options) {
39723
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, DiscreteLegend.defaultAttributes, attributes)), this.name = "discreteLegend", this._itemsContainer = null, this._itemHeightByUser = void 0, this._itemHeight = 0, this._itemMaxWidth = 0, this._onHover = e => {
39754
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, DiscreteLegend.defaultAttributes, attributes)), this.name = "discreteLegend", this._itemsContainer = null, this._itemHeightByUser = void 0, this._itemHeight = 0, this._itemMaxWidth = 0, this._onHover = e => {
39724
39755
  const target = e.target;
39725
39756
  if (target && target.name && target.name.startsWith(LEGEND_ELEMENT_NAME.item)) {
39726
39757
  const legendItem = target.delegate;
@@ -39998,8 +40029,8 @@
39998
40029
  this._autoEllipsis(autoEllipsisStrategy, layoutWidth, labelShape, valueShape), valueAttr.alignRight ? valueShape.setAttributes({
39999
40030
  textAlign: "right",
40000
40031
  x: this._itemWidthByUser - shapeSize / 2 - parsedPadding[1] - parsedPadding[3] - focusSpace - valueSpace
40001
- }) : valueShape.setAttribute("x", valueSpace + (labelShape.AABBBounds.empty() ? 0 : labelShape.AABBBounds.x2));
40002
- } else valueShape.setAttribute("x", valueSpace + (labelShape.AABBBounds.empty() ? 0 : labelShape.AABBBounds.x2));
40032
+ }) : valueShape.setAttribute("x", labelSpace + (labelShape.AABBBounds.empty() ? 0 : labelShape.AABBBounds.x2));
40033
+ } else valueShape.setAttribute("x", labelSpace + (labelShape.AABBBounds.empty() ? 0 : labelShape.AABBBounds.x2));
40003
40034
  focusStartX = valueSpace + (valueShape.AABBBounds.empty() ? 0 : valueShape.AABBBounds.x2), innerGroup.add(valueShape);
40004
40035
  } else this._itemWidthByUser ? (labelShape.setAttribute("maxLineWidth", this._itemWidthByUser - parsedPadding[1] - parsedPadding[3] - shapeSize - shapeSpace - focusSpace), focusStartX = labelSpace + (labelShape.AABBBounds.empty() ? 0 : labelShape.AABBBounds.x2)) : focusStartX = labelSpace + (labelShape.AABBBounds.empty() ? 0 : labelShape.AABBBounds.x2);
40005
40036
  focusShape && (focusShape.setAttribute("x", focusStartX), innerGroup.add(focusShape));
@@ -40030,7 +40061,7 @@
40030
40061
  return this._itemContext.isHorizontal ? new Pager(Object.assign(Object.assign({
40031
40062
  layout: 1 === maxRow ? "horizontal" : "vertical",
40032
40063
  total: estimateTotal(this._itemContext.pages)
40033
- }, merge$2({
40064
+ }, merge$1({
40034
40065
  handler: {
40035
40066
  preShape: "triangleUp",
40036
40067
  nextShape: "triangleDown"
@@ -40065,9 +40096,8 @@
40065
40096
  disableTriggerEvent: disableTriggerEvent
40066
40097
  }));
40067
40098
  }
40068
- _updatePositionOfPager(contentWidth, contentHeight, renderStartY, compWidth, compHeight) {
40099
+ _updatePositionOfPager(renderStartY, compWidth, compHeight) {
40069
40100
  const {
40070
- maxHeight: maxHeight,
40071
40101
  pager: pager
40072
40102
  } = this.attribute,
40073
40103
  {
@@ -40078,14 +40108,14 @@
40078
40108
  if (this._pagerComponent.setTotal(totalPage), isHorizontal) {
40079
40109
  let y;
40080
40110
  y = "start" === position ? renderStartY : "end" === position ? renderStartY + compHeight - this._pagerComponent.AABBBounds.height() / 2 : renderStartY + compHeight / 2 - this._pagerComponent.AABBBounds.height() / 2, this._pagerComponent.setAttributes({
40081
- x: contentWidth,
40111
+ x: compWidth - this._pagerComponent.AABBBounds.width(),
40082
40112
  y: y
40083
40113
  });
40084
40114
  } else {
40085
40115
  let x;
40086
40116
  x = "start" === position ? 0 : "end" === position ? compWidth - this._pagerComponent.AABBBounds.width() : (compWidth - this._pagerComponent.AABBBounds.width()) / 2, this._pagerComponent.setAttributes({
40087
40117
  x: x,
40088
- y: maxHeight - this._pagerComponent.AABBBounds.height()
40118
+ y: compHeight - this._pagerComponent.AABBBounds.height()
40089
40119
  });
40090
40120
  }
40091
40121
  }
@@ -40114,11 +40144,10 @@
40114
40144
  const {
40115
40145
  value: value
40116
40146
  } = e.detail;
40117
- let newPage = value[0] * this._itemContext.totalPage;
40118
- return pager.scrollByPosition ? newPage += 1 : newPage = Math.floor(newPage) + 1, newPage;
40147
+ let newPage;
40148
+ return 0 === value[0] ? newPage = 1 : 1 === value[1] ? newPage = this._itemContext.totalPage : (newPage = value[0] * this._itemContext.totalPage, pager.scrollByPosition ? newPage += 1 : newPage = Math.floor(newPage) + 1), newPage;
40119
40149
  } : e => e.detail.current,
40120
40150
  onScroll = e => {
40121
- e.preventDefault();
40122
40151
  const scrollComponent = this._pagerComponent,
40123
40152
  preScrollRange = scrollComponent.getScrollRange(),
40124
40153
  {
@@ -40147,7 +40176,7 @@
40147
40176
  if (this._itemContext.isScrollbar) {
40148
40177
  if (this._pagerComponent.addEventListener("scrollDrag", onPaging), this._pagerComponent.addEventListener("scrollUp", onPaging), this.attribute.pager.roamScroll) {
40149
40178
  const THROTTLE_TIME = 50;
40150
- this.addEventListener("wheel", throttle(onScroll, THROTTLE_TIME));
40179
+ this.addEventListener("wheel", e => e.nativeEvent.preventDefault()), this.addEventListener("wheel", throttle(onScroll, THROTTLE_TIME));
40151
40180
  }
40152
40181
  } else this._pagerComponent.addEventListener("toPrev", onPaging), this._pagerComponent.addEventListener("toNext", onPaging);
40153
40182
  }
@@ -40195,7 +40224,7 @@
40195
40224
  }), startX += spaceCol + width;
40196
40225
  }), this._itemContext.startX = startX, this._itemContext.startY = startY, this._itemContext.pages = pages;
40197
40226
  const total = Math.ceil(pages / maxRow);
40198
- this._itemContext.totalPage = total, this._updatePositionOfPager(contentWidth, contentHeight, renderStartY, compWidth, compHeight);
40227
+ this._itemContext.totalPage = total, this._updatePositionOfPager(renderStartY, compWidth, compHeight);
40199
40228
  } else {
40200
40229
  if (compWidth = this._itemMaxWidth * maxCol + (maxCol - 1) * spaceCol, compHeight = maxHeight, contentWidth = compWidth, comp = this._createPager(compStyle), this._pagerComponent = comp, this._innerView.add(comp), contentHeight = maxHeight - comp.AABBBounds.height() - pagerSpace - renderStartY, contentHeight <= 0) return this._innerView.removeChild(comp), !1;
40201
40230
  itemsContainer.getChildren().forEach((item, index) => {
@@ -40208,7 +40237,7 @@
40208
40237
  }), startY += spaceRow + height;
40209
40238
  });
40210
40239
  const total = Math.ceil(pages / maxCol);
40211
- this._itemContext.totalPage = total, this._updatePositionOfPager(contentWidth, contentHeight, renderStartY, compWidth, compHeight);
40240
+ this._itemContext.totalPage = total, this._updatePositionOfPager(renderStartY, compWidth, compHeight);
40212
40241
  }
40213
40242
  defaultCurrent > 1 && (isHorizontal ? itemsContainer.setAttribute("y", -(defaultCurrent - 1) * (compHeight + spaceRow)) : itemsContainer.setAttribute("x", -(defaultCurrent - 1) * (compWidth + spaceCol)));
40214
40243
  const clipGroup = graphicCreator.group({
@@ -40310,7 +40339,7 @@
40310
40339
  }
40311
40340
  _appendDataToShape(shape, name, data, delegateShape) {
40312
40341
  let states = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
40313
- shape.name = name, shape.data = data, shape.delegate = delegateShape, shape.states = merge$2({}, DEFAULT_STATES, states);
40342
+ shape.name = name, shape.data = data, shape.delegate = delegateShape, shape.states = merge$1({}, DEFAULT_STATES, states);
40314
40343
  }
40315
40344
  _dispatchLegendEvent(eventName, legendItem, event) {
40316
40345
  const currentSelectedItems = this._getSelectedLegends();
@@ -40331,6 +40360,9 @@
40331
40360
  config.state[key] && (isFunction$1(config.state[key]) ? newConfig.state[key] = config.state[key](item, isSelected, index, items) : newConfig.state[key] = config.state[key]);
40332
40361
  })), newConfig;
40333
40362
  }
40363
+ release() {
40364
+ super.release(), this.removeAllEventListeners();
40365
+ }
40334
40366
  };
40335
40367
  DiscreteLegend$1.defaultAttributes = {
40336
40368
  layout: "horizontal",
@@ -40451,7 +40483,7 @@
40451
40483
  return this._tooltipShape;
40452
40484
  }
40453
40485
  constructor(attributes, options) {
40454
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, Slider.defaultAttributes, attributes)), this.name = "slider", this._isHorizontal = !0, this._startHandler = null, this._endHandler = null, this._startHandlerText = null, this._endHandlerText = null, this._currentHandler = null, this._currentValue = {}, this._onTooltipShow = e => {
40486
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, Slider.defaultAttributes, attributes)), this.name = "slider", this._isHorizontal = !0, this._startHandler = null, this._endHandler = null, this._startHandlerText = null, this._endHandlerText = null, this._currentHandler = null, this._currentValue = {}, this._onTooltipShow = e => {
40455
40487
  this._isChanging || this._tooltipState && this._tooltipState.isActive || (this._tooltipState ? this._tooltipState.isActive = !0 : this._tooltipState = {
40456
40488
  isActive: !0
40457
40489
  }, this._onTooltipUpdate(e), this._dispatchTooltipEvent("sliderTooltipShow"));
@@ -41052,7 +41084,7 @@
41052
41084
  loadColorContinuousLegendComponent();
41053
41085
  class ColorContinuousLegend extends LegendBase {
41054
41086
  constructor(attributes, options) {
41055
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, ColorContinuousLegend.defaultAttributes, attributes)), this.name = "colorLegend", this._onSliderToolipChange = e => {
41087
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, ColorContinuousLegend.defaultAttributes, attributes)), this.name = "colorLegend", this._onSliderToolipChange = e => {
41056
41088
  const tooltipShape = this._slider.tooltipShape;
41057
41089
  if (tooltipShape && e.detail && !isNil$1(e.detail.value)) {
41058
41090
  const color = this._colorScale.scale(e.detail.value);
@@ -41255,7 +41287,7 @@
41255
41287
  loadSizeContinuousLegendComponent();
41256
41288
  class SizeContinuousLegend extends LegendBase {
41257
41289
  constructor(attributes, options) {
41258
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, SizeContinuousLegend.defaultAttributes, attributes)), this.name = "sizeLegend", this._onSliderChange = e => {
41290
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, SizeContinuousLegend.defaultAttributes, attributes)), this.name = "sizeLegend", this._onSliderChange = e => {
41259
41291
  this.dispatchEvent(e);
41260
41292
  }, this._onSliderToolipChange = e => {
41261
41293
  this.dispatchEvent(e);
@@ -41371,7 +41403,7 @@
41371
41403
  loadTitleComponent();
41372
41404
  let Title$1 = class Title extends AbstractComponent {
41373
41405
  constructor(attributes, options) {
41374
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, Title.defaultAttributes, attributes)), this.name = "title";
41406
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, Title.defaultAttributes, attributes)), this.name = "title";
41375
41407
  }
41376
41408
  render() {
41377
41409
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
@@ -41594,7 +41626,7 @@
41594
41626
  }
41595
41627
  _renderText(group, title, limit, limitRatio, themePath, graphicName) {
41596
41628
  if (!1 !== title.visible) {
41597
- const titleStyle = merge$2({}, get$1(DEFAULT_INDICATOR_THEME, themePath), title.style, {
41629
+ const titleStyle = merge$1({}, get$1(DEFAULT_INDICATOR_THEME, themePath), title.style, {
41598
41630
  visible: title.visible
41599
41631
  });
41600
41632
  titleStyle.lineHeight = isValid$1(titleStyle.lineHeight) ? titleStyle.lineHeight : titleStyle.fontSize, title.formatMethod && (titleStyle._originText = titleStyle.text, titleStyle.text = title.formatMethod(titleStyle.text, titleStyle));
@@ -41712,7 +41744,7 @@
41712
41744
 
41713
41745
  class Controller extends AbstractComponent {
41714
41746
  constructor(attributes, options) {
41715
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, Controller.defaultAttributes, attributes)), this._isPaused = !0, this.updateAttributes = () => {
41747
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, Controller.defaultAttributes, attributes)), this._isPaused = !0, this.updateAttributes = () => {
41716
41748
  this._startAttr = {
41717
41749
  style: Object.assign(Object.assign(Object.assign({
41718
41750
  symbolType: iconPlay
@@ -41898,7 +41930,7 @@
41898
41930
  return this._dataIndex;
41899
41931
  }
41900
41932
  constructor(attributes, options) {
41901
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, BasePlayer.defaultAttributes, attributes)), this._data = [], this._dataIndex = 0, this._layoutInfo = {}, this._updateSliderAttrs = () => {
41933
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, BasePlayer.defaultAttributes, attributes)), this._data = [], this._dataIndex = 0, this._layoutInfo = {}, this._updateSliderAttrs = () => {
41902
41934
  var _a, _b;
41903
41935
  let handlerSize;
41904
41936
  isValidNumber$1(this._handlerStyle.size) ? handlerSize = this._handlerStyle.size : this._handlerStyle.size && this._handlerStyle.size.length && (handlerSize = max$1(this._handlerStyle.size[0], this._handlerStyle.size[1]));
@@ -42110,7 +42142,7 @@
42110
42142
  loadDiscretePlayerComponent();
42111
42143
  class DiscretePlayer extends BasePlayer {
42112
42144
  constructor(attributes, options) {
42113
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, attributes)), this._activeIndex = -1, this._isReachEnd = !1, this._initAttributes = () => {
42145
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, attributes)), this._activeIndex = -1, this._isReachEnd = !1, this._initAttributes = () => {
42114
42146
  var _a, _b, _c;
42115
42147
  super._initAttributes(), this._alternate = null !== (_a = this.attribute.alternate) && void 0 !== _a && _a, this._interval = null !== (_b = this.attribute.interval) && void 0 !== _b ? _b : 1e3, this._direction = null !== (_c = this.attribute.direction) && void 0 !== _c ? _c : DirectionEnum.Default;
42116
42148
  }, this._initDataIndex = () => {
@@ -42307,7 +42339,7 @@
42307
42339
  loadBrushComponent();
42308
42340
  let Brush$1 = class Brush extends AbstractComponent {
42309
42341
  constructor(attributes, options) {
42310
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, Brush.defaultAttributes, attributes)), this.name = "brush", this._activeDrawState = !1, this._cacheDrawPoints = [], this._isDrawedBeforeEnd = !1, this._activeMoveState = !1, this._operatingMaskMoveDx = 0, this._operatingMaskMoveDy = 0, this._operatingMaskMoveRangeX = [-1 / 0, 1 / 0], this._operatingMaskMoveRangeY = [-1 / 0, 1 / 0], this._brushMaskAABBBoundsDict = {}, this._onBrushStart = e => {
42342
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, Brush.defaultAttributes, attributes)), this.name = "brush", this._activeDrawState = !1, this._cacheDrawPoints = [], this._isDrawedBeforeEnd = !1, this._activeMoveState = !1, this._operatingMaskMoveDx = 0, this._operatingMaskMoveDy = 0, this._operatingMaskMoveRangeX = [-1 / 0, 1 / 0], this._operatingMaskMoveRangeY = [-1 / 0, 1 / 0], this._brushMaskAABBBoundsDict = {}, this._onBrushStart = e => {
42311
42343
  var _a;
42312
42344
  if (this._outOfInteractiveRange(e)) return;
42313
42345
  e.stopPropagation();
@@ -42545,10 +42577,10 @@
42545
42577
  const shapeList = [target.shape, ...sources.map(s => null == s ? void 0 : s.shape)],
42546
42578
  keyList = [target.key, ...sources.map(s => null == s ? void 0 : s.key)],
42547
42579
  valueList = [target.value, ...sources.map(s => null == s ? void 0 : s.value)];
42548
- return merge$2(target, ...sources, {
42549
- shape: shapeList.every(isNil$1) ? void 0 : merge$2({}, ...shapeList),
42550
- key: keyList.every(isNil$1) ? void 0 : merge$2({}, ...keyList),
42551
- value: valueList.every(isNil$1) ? void 0 : merge$2({}, ...valueList)
42580
+ return merge$1(target, ...sources, {
42581
+ shape: shapeList.every(isNil$1) ? void 0 : merge$1({}, ...shapeList),
42582
+ key: keyList.every(isNil$1) ? void 0 : merge$1({}, ...keyList),
42583
+ value: valueList.every(isNil$1) ? void 0 : merge$1({}, ...valueList)
42552
42584
  });
42553
42585
  };
42554
42586
  const getRichTextAttribute = attr => {
@@ -42653,7 +42685,7 @@
42653
42685
  loadTooltipComponent();
42654
42686
  let Tooltip$1 = class Tooltip extends AbstractComponent {
42655
42687
  constructor(attributes, options) {
42656
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, Tooltip.defaultAttributes, attributes), options), this.name = "tooltip";
42688
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, Tooltip.defaultAttributes, attributes), options), this.name = "tooltip";
42657
42689
  }
42658
42690
  render() {
42659
42691
  var _a;
@@ -42679,7 +42711,7 @@
42679
42711
  y: padding[0]
42680
42712
  }, "group");
42681
42713
  const titleAttr = Tooltip.getTitleAttr(this.attribute);
42682
- this._tooltipTitleSymbol = this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-shape", merge$2({
42714
+ this._tooltipTitleSymbol = this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-shape", merge$1({
42683
42715
  symbolType: "circle"
42684
42716
  }, titleAttr.shape, {
42685
42717
  visible: isVisible(titleAttr) && isVisible(titleAttr.shape)
@@ -47915,28 +47947,30 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
47915
47947
  }
47916
47948
  addBothStateOfElements(statedElements, state, reverseState) {
47917
47949
  this._marks.forEach(mark => {
47950
+ var _a;
47918
47951
  const hasReverse = reverseState && this._stateMarks[reverseState] && this._stateMarks[reverseState].includes(mark),
47919
47952
  hasState = state && this._stateMarks[state] && this._stateMarks[state].includes(mark);
47920
- (hasReverse || hasState) && mark.elements.forEach(el => {
47953
+ (hasReverse || hasState) && (null === (_a = mark.elements) || void 0 === _a || _a.forEach(el => {
47921
47954
  statedElements && statedElements.includes(el) ? hasState && el.addState(state) : hasReverse && el.addState(reverseState);
47922
- });
47955
+ }));
47923
47956
  });
47924
47957
  }
47925
47958
  addStateOfElements(statedElements, state) {
47926
47959
  this._marks.forEach(mark => {
47960
+ var _a;
47927
47961
  const hasState = state && this._stateMarks[state] && this._stateMarks[state].includes(mark);
47928
- hasState && mark.elements.forEach(el => {
47962
+ hasState && (null === (_a = mark.elements) || void 0 === _a || _a.forEach(el => {
47929
47963
  statedElements && statedElements.includes(el) && hasState && el.addState(state);
47930
- });
47964
+ }));
47931
47965
  });
47932
47966
  }
47933
47967
  clearAllStates(state, reverseState) {
47934
47968
  this._statedElements && this._statedElements.length && this._marks.forEach(mark => {
47935
- reverseState && this._stateMarks[reverseState] && this._stateMarks[reverseState].includes(mark) && mark.elements.forEach(el => {
47969
+ mark && mark.elements && (reverseState && this._stateMarks[reverseState] && this._stateMarks[reverseState].includes(mark) && mark.elements.forEach(el => {
47936
47970
  el.removeState(reverseState);
47937
47971
  }), state && this._stateMarks[state] && this._stateMarks[state].includes(mark) && mark.elements.forEach(el => {
47938
47972
  this._statedElements.includes(el) && el.removeState(state);
47939
- });
47973
+ }));
47940
47974
  });
47941
47975
  }
47942
47976
  }
@@ -52169,28 +52203,28 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
52169
52203
  const generateLineAxisAttributes = (scale, theme, addition, tickCount) => {
52170
52204
  var _a, _b, _c, _d;
52171
52205
  const axisTheme = null !== (_b = null === (_a = null == theme ? void 0 : theme.components) || void 0 === _a ? void 0 : _a.axis) && void 0 !== _b ? _b : {};
52172
- if (!scale) return merge$2({}, axisTheme, null != addition ? addition : {});
52206
+ if (!scale) return merge$1({}, axisTheme, null != addition ? addition : {});
52173
52207
  const items = [(null !== (_d = null === (_c = scale.tickData) || void 0 === _c ? void 0 : _c.call(scale, tickCount)) && void 0 !== _d ? _d : []).map(tick => ({
52174
52208
  id: tick.index,
52175
52209
  label: tick.tick,
52176
52210
  value: tick.value,
52177
52211
  rawValue: tick.tick
52178
52212
  }))];
52179
- return merge$2({}, axisTheme, {
52213
+ return merge$1({}, axisTheme, {
52180
52214
  items: items
52181
52215
  }, null != addition ? addition : {});
52182
52216
  };
52183
52217
  const generateCircleAxisAttributes = (scale, theme, addition, tickCount) => {
52184
52218
  var _a, _b, _c, _d;
52185
52219
  const axisTheme = null !== (_b = null === (_a = null == theme ? void 0 : theme.components) || void 0 === _a ? void 0 : _a.circleAxis) && void 0 !== _b ? _b : {};
52186
- if (!scale) return merge$2({}, axisTheme, null != addition ? addition : {});
52220
+ if (!scale) return merge$1({}, axisTheme, null != addition ? addition : {});
52187
52221
  const items = [(null !== (_d = null === (_c = scale.tickData) || void 0 === _c ? void 0 : _c.call(scale, tickCount)) && void 0 !== _d ? _d : []).map(tick => ({
52188
52222
  id: tick.index,
52189
52223
  label: tick.tick,
52190
52224
  value: tick.value,
52191
52225
  rawValue: tick.tick
52192
52226
  }))];
52193
- return merge$2({}, axisTheme, {
52227
+ return merge$1({}, axisTheme, {
52194
52228
  items: items
52195
52229
  }, null != addition ? addition : {});
52196
52230
  };
@@ -52236,7 +52270,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
52236
52270
  return this.spec.axisType = axisType, this._axisComponentType = null, this._prepareRejoin(), this.commit(), this;
52237
52271
  }
52238
52272
  addGraphicItem(attrs, groupKey) {
52239
- const initialAttributes = merge$2({
52273
+ const initialAttributes = merge$1({
52240
52274
  x: 0,
52241
52275
  y: 0,
52242
52276
  start: {
@@ -52368,7 +52402,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
52368
52402
  if (data && data.length > 0) data.forEach((d, index) => {
52369
52403
  if (mark.elements[index]) {
52370
52404
  const attributes = invokeEncoder(encoder, d, mark.elements[index], labelParameters);
52371
- merge$2(d, themeDatum, attributes);
52405
+ merge$1(d, themeDatum, attributes);
52372
52406
  }
52373
52407
  });else {
52374
52408
  const mergeAttributes = (attributes, themeDatum) => {
@@ -52376,7 +52410,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
52376
52410
  data: labelData
52377
52411
  } = attributes,
52378
52412
  restAttribute = __rest(attributes, ["data"]);
52379
- return Object.assign(Object.assign({}, merge$2({}, themeDatum, restAttribute)), {
52413
+ return Object.assign(Object.assign({}, merge$1({}, themeDatum, restAttribute)), {
52380
52414
  data: labelData
52381
52415
  });
52382
52416
  };
@@ -52393,13 +52427,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
52393
52427
  });
52394
52428
  }
52395
52429
  const graphicItemName = null === (_e = mark.graphicItem) || void 0 === _e ? void 0 : _e.name,
52396
- result = merge$2({}, currentTheme, {
52430
+ result = merge$1({}, currentTheme, {
52397
52431
  baseMarkGroupName: graphicItemName,
52398
52432
  getBaseMarks: () => mark.elements.map(element => element.getGraphicItem())
52399
52433
  }, null != addition ? addition : {});
52400
52434
  return result.data = null != data ? data : currentTheme.data, result;
52401
52435
  }).filter(label => !isNil$1(label)),
52402
- result = merge$2({}, labelTheme, {
52436
+ result = merge$1({}, labelTheme, {
52403
52437
  size: groupSize
52404
52438
  });
52405
52439
  return result.dataLabels = dataLabels, result;
@@ -52463,28 +52497,28 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
52463
52497
  const generateLineAxisGridAttributes = (scale, theme, addition, tickCount) => {
52464
52498
  var _a, _b, _c, _d;
52465
52499
  const gridTheme = null !== (_b = null === (_a = null == theme ? void 0 : theme.components) || void 0 === _a ? void 0 : _a.grid) && void 0 !== _b ? _b : {};
52466
- if (!scale) return merge$2({}, gridTheme, null != addition ? addition : {});
52500
+ if (!scale) return merge$1({}, gridTheme, null != addition ? addition : {});
52467
52501
  const items = (null !== (_d = null === (_c = scale.tickData) || void 0 === _c ? void 0 : _c.call(scale, tickCount)) && void 0 !== _d ? _d : []).map(tick => ({
52468
52502
  id: tick.index,
52469
52503
  label: tick.tick,
52470
52504
  value: tick.value,
52471
52505
  rawValue: tick.tick
52472
52506
  }));
52473
- return merge$2({}, gridTheme, {
52507
+ return merge$1({}, gridTheme, {
52474
52508
  items: items
52475
52509
  }, null != addition ? addition : {});
52476
52510
  };
52477
52511
  const generateCircleAxisGridAttributes = (scale, theme, addition, tickCount) => {
52478
52512
  var _a, _b, _c, _d;
52479
52513
  const gridTheme = null !== (_b = null === (_a = null == theme ? void 0 : theme.components) || void 0 === _a ? void 0 : _a.circleGrid) && void 0 !== _b ? _b : {};
52480
- if (!scale) return merge$2({}, gridTheme, null != addition ? addition : {});
52514
+ if (!scale) return merge$1({}, gridTheme, null != addition ? addition : {});
52481
52515
  const items = (null !== (_d = null === (_c = scale.tickData) || void 0 === _c ? void 0 : _c.call(scale, tickCount)) && void 0 !== _d ? _d : []).map(tick => ({
52482
52516
  id: tick.index,
52483
52517
  label: tick.tick,
52484
52518
  value: tick.value,
52485
52519
  rawValue: tick.tick
52486
52520
  }));
52487
- return merge$2({}, gridTheme, {
52521
+ return merge$1({}, gridTheme, {
52488
52522
  items: items
52489
52523
  }, null != addition ? addition : {});
52490
52524
  };
@@ -52524,7 +52558,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
52524
52558
  return this.setFunctionSpec(baseValue, "baseValue");
52525
52559
  }
52526
52560
  addGraphicItem(attrs, groupKey) {
52527
- const initialAttributes = merge$2({
52561
+ const initialAttributes = merge$1({
52528
52562
  x: 0,
52529
52563
  y: 0,
52530
52564
  start: {
@@ -54203,7 +54237,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
54203
54237
  totalTime: typeConfig.totalTime,
54204
54238
  oneByOne: null !== (_b = typeConfig.oneByOne) && void 0 !== _b ? _b : DefaultAnimationOneByOne,
54205
54239
  loop: null !== (_c = typeConfig.loop) && void 0 !== _c ? _c : DefaultAnimationLoop,
54206
- controlOptions: merge$2({}, DefaultAnimationControlOptions, null !== (_d = typeConfig.controlOptions) && void 0 !== _d ? _d : {}),
54240
+ controlOptions: merge$1({}, DefaultAnimationControlOptions, null !== (_d = typeConfig.controlOptions) && void 0 !== _d ? _d : {}),
54207
54241
  timeSlices: [{
54208
54242
  duration: null !== (_e = typeConfig.duration) && void 0 !== _e ? _e : DefaultAnimationDuration,
54209
54243
  delay: null !== (_f = typeConfig.delay) && void 0 !== _f ? _f : DefaultAnimationDelay,
@@ -54225,7 +54259,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
54225
54259
  totalTime: animationConfig.totalTime,
54226
54260
  oneByOne: null !== (_k = animationConfig.oneByOne) && void 0 !== _k ? _k : DefaultAnimationOneByOne,
54227
54261
  loop: null !== (_l = animationConfig.loop) && void 0 !== _l ? _l : DefaultAnimationLoop,
54228
- controlOptions: merge$2({}, DefaultAnimationControlOptions, null !== (_m = animationConfig.controlOptions) && void 0 !== _m ? _m : {}),
54262
+ controlOptions: merge$1({}, DefaultAnimationControlOptions, null !== (_m = animationConfig.controlOptions) && void 0 !== _m ? _m : {}),
54229
54263
  timeSlices: formattedTimeSlices.map(timeSlice => {
54230
54264
  var _a, _b;
54231
54265
  return {
@@ -55749,7 +55783,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
55749
55783
  }
55750
55784
  initMapDataSet();
55751
55785
  const dataView = new DataView(mapDataSet);
55752
- const options = merge$2({}, { centroid: true, simplify: false }, option);
55786
+ const options = merge$1({}, { centroid: true, simplify: false }, option);
55753
55787
  if (option.type === 'topojson') {
55754
55788
  dataView.parse(source, {
55755
55789
  type: 'topojson',
@@ -56504,7 +56538,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
56504
56538
  }
56505
56539
  this._children.push(mark);
56506
56540
  this._markNameMap[mark.name] = mark;
56507
- this._infoMap.set(mark, merge$2({}, MarkSet.defaultMarkInfo, markInfo));
56541
+ this._infoMap.set(mark, merge$1({}, MarkSet.defaultMarkInfo, markInfo));
56508
56542
  }
56509
56543
  removeMark(markName) {
56510
56544
  const index = this._children.findIndex(m => m.name === markName);
@@ -57106,7 +57140,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
57106
57140
  if (!newState) {
57107
57141
  return;
57108
57142
  }
57109
- merge$2(this._stateMap, newState);
57143
+ merge$1(this._stateMap, newState);
57110
57144
  this.compile(newState);
57111
57145
  if (noRender) {
57112
57146
  return;
@@ -57810,13 +57844,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
57810
57844
  setLayoutStartPosition(pos) {
57811
57845
  return this._layout
57812
57846
  ? this._layout.setLayoutStartPosition(pos)
57813
- : (this._layoutStartPos = merge$2(this._layoutStartPos, pos));
57847
+ : (this._layoutStartPos = merge$1(this._layoutStartPos, pos));
57814
57848
  }
57815
57849
  getLayoutRect() {
57816
57850
  return this._layout ? this._layout.getLayoutRect() : this._layoutRect;
57817
57851
  }
57818
57852
  setLayoutRect(rect, levelMap) {
57819
- return this._layout ? this._layout.setLayoutRect(rect) : (this._lastLayoutRect = merge$2(this._layoutRect, rect));
57853
+ return this._layout ? this._layout.setLayoutRect(rect) : (this._lastLayoutRect = merge$1(this._layoutRect, rect));
57820
57854
  }
57821
57855
  getLastComputeOutBounds() {
57822
57856
  var _a;
@@ -60255,7 +60289,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
60255
60289
  return userUpdateOptions
60256
60290
  ? Object.assign(Object.assign({}, res), userUpdateOptions) : res;
60257
60291
  };
60258
- this._option = merge$2(this._option, { animation: spec.animation !== false }, options);
60292
+ this._option = merge$1(this._option, { animation: spec.animation !== false }, options);
60259
60293
  this._onError = (_a = this._option) === null || _a === void 0 ? void 0 : _a.onError;
60260
60294
  const _j = this._option, { dom, renderCanvas, mode, stage, poptip } = _j, restOptions = __rest$e(_j, ["dom", "renderCanvas", "mode", "stage", "poptip"]);
60261
60295
  const isTrueBrowseEnv = isTrueBrowser(mode);
@@ -60913,33 +60947,38 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
60913
60947
  this._chart.clearHovered();
60914
60948
  }
60915
60949
  _updateCurrentTheme(nextThemeName) {
60916
- var _a, _b, _c, _d, _e, _f;
60950
+ var _a, _b, _c;
60917
60951
  const optionTheme = this._option.theme;
60918
60952
  const specTheme = (_a = this._spec) === null || _a === void 0 ? void 0 : _a.theme;
60919
60953
  const chartType = (_b = this._spec) === null || _b === void 0 ? void 0 : _b.type;
60920
60954
  if (nextThemeName) {
60921
60955
  this._currentThemeName = nextThemeName;
60922
60956
  }
60957
+ const processThemeByChartType = (type, theme) => {
60958
+ var _a;
60959
+ if ((_a = theme.chart) === null || _a === void 0 ? void 0 : _a[type]) {
60960
+ theme = mergeTheme({}, theme, theme.chart[type]);
60961
+ }
60962
+ return theme;
60963
+ };
60923
60964
  let currentTheme;
60924
60965
  if (!isEmpty(optionTheme) || !isEmpty(specTheme)) {
60925
60966
  if ((isString$1(optionTheme) && (!specTheme || isString$1(specTheme))) ||
60926
60967
  (isString$1(specTheme) && (!optionTheme || isString$1(optionTheme)))) {
60927
- currentTheme = getThemeObject(this._currentThemeName, true);
60928
- const finalTheme = mergeTheme({}, currentTheme, (_c = currentTheme.chart) === null || _c === void 0 ? void 0 : _c[chartType], getThemeObject(optionTheme, true), getThemeObject(specTheme, true));
60929
- this._currentTheme = finalTheme;
60968
+ const finalTheme = mergeTheme({}, getThemeObject(this._currentThemeName, true), getThemeObject(optionTheme, true), getThemeObject(specTheme, true));
60969
+ this._currentTheme = processThemeByChartType(chartType, finalTheme);
60930
60970
  }
60931
60971
  else {
60932
- currentTheme = getThemeObject(this._currentThemeName);
60933
- const finalTheme = mergeTheme({}, currentTheme, (_d = currentTheme.chart) === null || _d === void 0 ? void 0 : _d[chartType], getThemeObject(optionTheme), getThemeObject(specTheme));
60934
- this._currentTheme = preprocessTheme(finalTheme);
60972
+ const finalTheme = mergeTheme({}, getThemeObject(this._currentThemeName), getThemeObject(optionTheme), getThemeObject(specTheme));
60973
+ this._currentTheme = preprocessTheme(processThemeByChartType(chartType, finalTheme));
60935
60974
  }
60936
60975
  }
60937
60976
  else {
60938
60977
  currentTheme = getThemeObject(this._currentThemeName, true);
60939
- this._currentTheme = mergeTheme({}, currentTheme, (_e = currentTheme.chart) === null || _e === void 0 ? void 0 : _e[chartType]);
60978
+ this._currentTheme = processThemeByChartType(chartType, currentTheme);
60940
60979
  }
60941
60980
  setPoptipTheme(get$1(this._currentTheme, 'component.poptip'));
60942
- (_f = this._compiler) === null || _f === void 0 ? void 0 : _f.setBackground(this._getBackground());
60981
+ (_c = this._compiler) === null || _c === void 0 ? void 0 : _c.setBackground(this._getBackground());
60943
60982
  }
60944
60983
  _shouldChartResize(oldSpec) {
60945
60984
  var _a, _b;
@@ -61407,7 +61446,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
61407
61446
  };
61408
61447
  registerVChartCore();
61409
61448
 
61410
- const version = "1.12.7";
61449
+ const version = "1.12.8";
61411
61450
 
61412
61451
  const addVChartProperty = (data, op) => {
61413
61452
  const context = op.beforeCall();
@@ -61419,8 +61458,210 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
61419
61458
  return data;
61420
61459
  };
61421
61460
 
61422
- class BaseTooltipHelper {
61423
- constructor() {
61461
+ function getComponentThemeFromOption(type, chartTheme) {
61462
+ return get$1(chartTheme, `component.${type}`);
61463
+ }
61464
+ function getFormatFunction(formatMethod, formatter, text, datum) {
61465
+ if (formatMethod) {
61466
+ return { formatFunc: formatMethod, args: [text, datum] };
61467
+ }
61468
+ const formatterImpl = Factory$1.getFormatter();
61469
+ if (formatter && formatterImpl) {
61470
+ return { formatFunc: formatterImpl, args: [text, datum, formatter] };
61471
+ }
61472
+ return {};
61473
+ }
61474
+ const getSpecInfo = (chartSpec, specKey, compType, filter) => {
61475
+ if (isNil$1(chartSpec[specKey])) {
61476
+ return undefined;
61477
+ }
61478
+ const isArraySpec = isArray$1(chartSpec[specKey]);
61479
+ const spec = isArraySpec ? chartSpec[specKey] : [chartSpec[specKey]];
61480
+ const specInfos = [];
61481
+ spec.forEach((s, i) => {
61482
+ if (s && (!filter || filter(s))) {
61483
+ specInfos.push({
61484
+ spec: s,
61485
+ specPath: isArraySpec ? [specKey, i] : [specKey],
61486
+ specInfoPath: ['component', specKey, i],
61487
+ type: compType
61488
+ });
61489
+ }
61490
+ });
61491
+ return specInfos;
61492
+ };
61493
+
61494
+ const getTooltipContentValue = (field, datum, params, formatter) => {
61495
+ let value;
61496
+ if (isFunction$1(field)) {
61497
+ value = field(datum, params);
61498
+ }
61499
+ else {
61500
+ value = field;
61501
+ }
61502
+ if (formatter) {
61503
+ const { formatFunc, args } = getFormatFunction(undefined, formatter, field, datum);
61504
+ if (formatFunc && args) {
61505
+ value = formatFunc(...args);
61506
+ }
61507
+ }
61508
+ return value;
61509
+ };
61510
+ const getTooltipPatternValue = (field, data, params) => {
61511
+ if (isNil$1(field)) {
61512
+ return field;
61513
+ }
61514
+ if (isFunction$1(field)) {
61515
+ return field(data, params);
61516
+ }
61517
+ return field;
61518
+ };
61519
+ function getFirstDatumFromTooltipData(data) {
61520
+ var _a;
61521
+ const dimInfoList = ((_a = data[0]) === null || _a === void 0 ? void 0 : _a.series)
61522
+ ? [{ data: data, value: '' }]
61523
+ : data;
61524
+ for (const { data: dataList } of dimInfoList) {
61525
+ for (const { datum: datumList } of dataList) {
61526
+ for (const datumItem of datumList !== null && datumList !== void 0 ? datumList : []) {
61527
+ if (datumItem) {
61528
+ return datumItem;
61529
+ }
61530
+ }
61531
+ }
61532
+ }
61533
+ return undefined;
61534
+ }
61535
+
61536
+ const getTooltipActualActiveType = (spec) => {
61537
+ var _a, _b, _c;
61538
+ if ((spec === null || spec === void 0 ? void 0 : spec.visible) === false) {
61539
+ return [];
61540
+ }
61541
+ const activeTypeMap = {
61542
+ mark: ((_a = spec === null || spec === void 0 ? void 0 : spec.mark) === null || _a === void 0 ? void 0 : _a.visible) !== false,
61543
+ dimension: ((_b = spec === null || spec === void 0 ? void 0 : spec.dimension) === null || _b === void 0 ? void 0 : _b.visible) !== false,
61544
+ group: ((_c = spec === null || spec === void 0 ? void 0 : spec.group) === null || _c === void 0 ? void 0 : _c.visible) !== false
61545
+ };
61546
+ if (isValid$1(spec === null || spec === void 0 ? void 0 : spec.activeType)) {
61547
+ Object.keys(activeTypeMap).forEach(t => {
61548
+ var _a;
61549
+ activeTypeMap[t] = (_a = spec === null || spec === void 0 ? void 0 : spec.activeType) === null || _a === void 0 ? void 0 : _a.includes(t);
61550
+ });
61551
+ }
61552
+ return Object.keys(activeTypeMap).filter(t => activeTypeMap[t]);
61553
+ };
61554
+ const isActiveTypeVisible = (type, spec) => {
61555
+ if (!spec) {
61556
+ return true;
61557
+ }
61558
+ if (spec.visible === false) {
61559
+ return false;
61560
+ }
61561
+ if (spec[type] && spec[type].visible === false) {
61562
+ return false;
61563
+ }
61564
+ if (spec.activeType && (isArray$1(spec.activeType) ? !spec.activeType.includes(type) : spec.activeType !== type)) {
61565
+ return false;
61566
+ }
61567
+ return true;
61568
+ };
61569
+ function isEmptyPos(params) {
61570
+ return isNil$1(params.mark) && isNil$1(params.model) && isNil$1(params.datum);
61571
+ }
61572
+ function addContentLine(result, contentSpec, defaultContent, shapeAttrs, datum, params) {
61573
+ const addByDatum = (spec) => {
61574
+ if (spec) {
61575
+ const res = {};
61576
+ const finalSpec = isNil$1(spec.key) && isNil$1(spec.value) && !isEmpty(spec)
61577
+ ? Object.assign(Object.assign(Object.assign({}, shapeAttrs), defaultContent), spec) : Object.assign(Object.assign({}, shapeAttrs), spec);
61578
+ Object.keys(finalSpec).forEach(k => {
61579
+ if (k === 'key') {
61580
+ res.key = getTimeString(getTooltipContentValue(finalSpec.key, datum, params, finalSpec.keyFormatter), finalSpec.keyTimeFormat, finalSpec.keyTimeFormatMode);
61581
+ }
61582
+ else if (k === 'value') {
61583
+ res.value = getTimeString(getTooltipContentValue(finalSpec.value, datum, params, finalSpec.valueFormatter), finalSpec.valueTimeFormat, finalSpec.valueTimeFormatMode);
61584
+ }
61585
+ else {
61586
+ res[k] = getTooltipContentValue(finalSpec[k], datum, params);
61587
+ }
61588
+ });
61589
+ if (res.visible !== false && (isValid$1(res.key) || isValid$1(res.value))) {
61590
+ result.push(res);
61591
+ }
61592
+ }
61593
+ };
61594
+ if (isArray$1(contentSpec)) {
61595
+ contentSpec.forEach(spec => {
61596
+ addByDatum(spec);
61597
+ });
61598
+ }
61599
+ else {
61600
+ addByDatum(contentSpec);
61601
+ }
61602
+ }
61603
+ function parseContentFunction(result, contentSpec, defaultContent, shapeAttrs, data, datum, params) {
61604
+ if (isFunction$1(contentSpec)) {
61605
+ const specs = contentSpec(data, params);
61606
+ addContentLine(result, specs, defaultContent, shapeAttrs, datum, params);
61607
+ }
61608
+ else if (contentSpec) {
61609
+ addContentLine(result, contentSpec, defaultContent, shapeAttrs, datum, params);
61610
+ }
61611
+ }
61612
+ function parseContent(contentSpec, defaultContent, shapeAttrs, data, datum, params) {
61613
+ if (datum && datum.length) {
61614
+ const contents = [];
61615
+ datum.forEach(d => {
61616
+ if (isArray$1(contentSpec)) {
61617
+ contentSpec.forEach(spec => {
61618
+ parseContentFunction(contents, spec, defaultContent, shapeAttrs, data, d, params);
61619
+ });
61620
+ }
61621
+ else if (isFunction$1(contentSpec)) {
61622
+ parseContentFunction(contents, contentSpec, defaultContent, shapeAttrs, data, d, params);
61623
+ }
61624
+ else if (contentSpec) {
61625
+ addContentLine(contents, contentSpec, defaultContent, shapeAttrs, d, params);
61626
+ }
61627
+ });
61628
+ return contents;
61629
+ }
61630
+ return null;
61631
+ }
61632
+ function combineContents(patternList) {
61633
+ if (!patternList || !patternList.length) {
61634
+ return null;
61635
+ }
61636
+ const defaultPatternContent = [];
61637
+ patternList.forEach(({ content }) => {
61638
+ if (content) {
61639
+ content.forEach(c => {
61640
+ defaultPatternContent.push(c);
61641
+ });
61642
+ }
61643
+ });
61644
+ if (defaultPatternContent.length) {
61645
+ return Object.assign(Object.assign({}, patternList[0]), { content: defaultPatternContent });
61646
+ }
61647
+ return patternList[0];
61648
+ }
61649
+ const getTimeString = (value, timeFormat, timeFormatMode) => {
61650
+ if (!timeFormat && !timeFormatMode) {
61651
+ if (typeof value !== 'object') {
61652
+ return value === null || value === void 0 ? void 0 : value.toString();
61653
+ }
61654
+ return value;
61655
+ }
61656
+ const timeUtil = TimeUtil.getInstance();
61657
+ timeFormat = timeFormat || '%Y%m%d';
61658
+ timeFormatMode = timeFormatMode || 'local';
61659
+ const timeFormatter = timeFormatMode === 'local' ? timeUtil.timeFormat : timeUtil.timeUTCFormat;
61660
+ return timeFormatter(timeFormat, value);
61661
+ };
61662
+
61663
+ class BaseSeriesTooltipHelper {
61664
+ constructor(series) {
61424
61665
  this.activeTriggerSet = {
61425
61666
  mark: new Set(),
61426
61667
  group: new Set()
@@ -61428,12 +61669,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
61428
61669
  this.ignoreTriggerSet = {
61429
61670
  mark: new Set()
61430
61671
  };
61431
- }
61432
- }
61433
-
61434
- class BaseSeriesTooltipHelper extends BaseTooltipHelper {
61435
- constructor(series) {
61436
- super();
61437
61672
  this._getSeriesCacheInfo = () => {
61438
61673
  var _a, _b, _c;
61439
61674
  const { series } = this;
@@ -61505,6 +61740,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
61505
61740
  }
61506
61741
  return dimensionFields.map(field => datum === null || datum === void 0 ? void 0 : datum[field]).join('-');
61507
61742
  };
61743
+ this.getHasShape = (isContent) => {
61744
+ return !!isContent;
61745
+ };
61508
61746
  this.series = series;
61509
61747
  this.updateTooltipSpec();
61510
61748
  }
@@ -61514,82 +61752,100 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
61514
61752
  this.spec = seriesTooltipSpec;
61515
61753
  this._seriesCacheInfo = this._getSeriesCacheInfo();
61516
61754
  }
61517
- getDefaultTooltipPattern(activeType, dimensionInfo) {
61518
- switch (activeType) {
61519
- case 'mark':
61520
- return {
61521
- visible: true,
61522
- activeType,
61523
- title: {
61524
- key: undefined,
61525
- value: this.dimensionTooltipTitleCallback,
61526
- hasShape: false
61527
- },
61528
- content: [
61529
- {
61530
- seriesId: this.series.id,
61531
- key: this.markTooltipKeyCallback,
61532
- value: this.markTooltipValueCallback,
61533
- hasShape: true,
61534
- shapeType: this.shapeTypeCallback,
61535
- shapeColor: this.shapeColorCallback,
61536
- shapeStroke: this.shapeStrokeCallback,
61537
- shapeHollow: false
61538
- }
61539
- ]
61540
- };
61541
- case 'group':
61542
- return {
61543
- visible: true,
61544
- activeType,
61545
- title: {
61546
- key: undefined,
61547
- value: this.groupTooltipTitleCallback,
61548
- hasShape: false
61549
- },
61550
- content: [
61551
- {
61552
- seriesId: this.series.id,
61553
- key: this.groupTooltipKeyCallback,
61554
- value: this.markTooltipValueCallback,
61555
- hasShape: true,
61556
- shapeType: this.shapeTypeCallback,
61557
- shapeColor: this.shapeColorCallback,
61558
- shapeStroke: this.shapeStrokeCallback,
61559
- shapeHollow: false
61560
- }
61561
- ]
61562
- };
61563
- case 'dimension':
61564
- if (dimensionInfo) {
61565
- const title = {
61566
- key: undefined,
61567
- value: this.dimensionTooltipTitleCallback,
61568
- hasShape: false
61569
- };
61570
- const content = [];
61571
- dimensionInfo.forEach(({ data }) => data.forEach(({ series }) => {
61572
- content.push({
61573
- seriesId: series.id,
61574
- key: this.markTooltipKeyCallback,
61575
- value: this.markTooltipValueCallback,
61576
- hasShape: true,
61577
- shapeType: this.shapeTypeCallback,
61578
- shapeColor: this.shapeColorCallback,
61579
- shapeStroke: this.shapeStrokeCallback,
61580
- shapeHollow: false
61581
- });
61582
- }));
61583
- return {
61584
- visible: true,
61585
- activeType,
61586
- title,
61587
- content
61588
- };
61589
- }
61590
- break;
61755
+ getShapeAttrs(activeType, isContent, chartTooltipSpec) {
61756
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
61757
+ const key = isContent ? 'content' : 'title';
61758
+ const shapeAttrs = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (_a = chartTooltipSpec === null || chartTooltipSpec === void 0 ? void 0 : chartTooltipSpec.style) === null || _a === void 0 ? void 0 : _a.shape), chartTooltipSpec === null || chartTooltipSpec === void 0 ? void 0 : chartTooltipSpec[activeType]), (_b = chartTooltipSpec === null || chartTooltipSpec === void 0 ? void 0 : chartTooltipSpec[activeType]) === null || _b === void 0 ? void 0 : _b[key]), (_c = this.spec) === null || _c === void 0 ? void 0 : _c[activeType]), (_e = (_d = this.spec) === null || _d === void 0 ? void 0 : _d[activeType]) === null || _e === void 0 ? void 0 : _e[key]);
61759
+ const res = {
61760
+ shapeType: (_f = shapeAttrs.shapeType) !== null && _f !== void 0 ? _f : this.shapeTypeCallback,
61761
+ shapeFill: (_h = (_g = shapeAttrs.shapeFill) !== null && _g !== void 0 ? _g : shapeAttrs.shapeColor) !== null && _h !== void 0 ? _h : this.shapeColorCallback,
61762
+ shapeStroke: (_j = shapeAttrs.shapeStroke) !== null && _j !== void 0 ? _j : this.shapeStrokeCallback,
61763
+ shapeHollow: (_k = shapeAttrs.shapeHollow) !== null && _k !== void 0 ? _k : false,
61764
+ shapeLineWidth: shapeAttrs.shapeLineWidth,
61765
+ shapeSize: (_l = shapeAttrs.shapeSize) !== null && _l !== void 0 ? _l : shapeAttrs.size,
61766
+ hasShape: (_m = shapeAttrs.hasShape) !== null && _m !== void 0 ? _m : this.getHasShape(isContent)
61767
+ };
61768
+ return res;
61769
+ }
61770
+ enableByType(activeType) {
61771
+ return true;
61772
+ }
61773
+ getDefaultContentList(activeType) {
61774
+ return [this.getDefaultContentPattern(activeType)];
61775
+ }
61776
+ getContentList(activeType, spec, shapeAttrs, data, datum, params) {
61777
+ var _a;
61778
+ return parseContent((_a = spec === null || spec === void 0 ? void 0 : spec.content) !== null && _a !== void 0 ? _a : this.getDefaultContentList(activeType), this.getDefaultContentPattern(activeType), shapeAttrs, data, datum, params);
61779
+ }
61780
+ getTitleResult(activeType, titleSpec, shapeAttrs, data, params) {
61781
+ let titlePattern = isFunction$1(titleSpec)
61782
+ ? titleSpec(data, params)
61783
+ : titleSpec;
61784
+ if (!titlePattern) {
61785
+ titlePattern = this.getDefaultTitlePattern(activeType);
61786
+ }
61787
+ else if (isNil$1(titlePattern.value)) {
61788
+ titlePattern = Object.assign(Object.assign({}, this.getDefaultTitlePattern(activeType)), titlePattern);
61789
+ }
61790
+ if (titlePattern && titlePattern.visible !== false) {
61791
+ const datum = getFirstDatumFromTooltipData(data);
61792
+ const res = {
61793
+ visible: getTooltipContentValue(titlePattern.visible, datum, params),
61794
+ value: getTimeString(getTooltipContentValue(titlePattern.value, datum, params, titlePattern.valueFormatter), titlePattern.valueTimeFormat, titlePattern.valueTimeFormatMode),
61795
+ valueStyle: getTooltipContentValue(titlePattern.valueStyle, datum, params),
61796
+ hasShape: titlePattern.hasShape
61797
+ };
61798
+ Object.keys(shapeAttrs).forEach(key => {
61799
+ res[key] = getTooltipContentValue(shapeAttrs[key], datum, params);
61800
+ });
61801
+ return res;
61591
61802
  }
61592
- return null;
61803
+ return {
61804
+ hasShape: false,
61805
+ visible: false
61806
+ };
61807
+ }
61808
+ getTooltipData(activeType, chartTooltipSpec, data, datum, params) {
61809
+ var _a, _b;
61810
+ if (!this.enableByType(activeType) ||
61811
+ !isActiveTypeVisible(activeType, this.spec) ||
61812
+ (activeType === 'dimension' && (!datum || !datum.length))) {
61813
+ return null;
61814
+ }
61815
+ const patternSpec = (_b = (_a = this.spec) === null || _a === void 0 ? void 0 : _a[activeType]) !== null && _b !== void 0 ? _b : chartTooltipSpec === null || chartTooltipSpec === void 0 ? void 0 : chartTooltipSpec[activeType];
61816
+ const contentShapeAttrs = this.getShapeAttrs(activeType, true, chartTooltipSpec);
61817
+ const titleShapeAttrs = this.getShapeAttrs(activeType, false, chartTooltipSpec);
61818
+ let content;
61819
+ if (activeType === 'dimension') {
61820
+ content = [];
61821
+ const userContents = this.getContentList(activeType, patternSpec, contentShapeAttrs, data, datum, params);
61822
+ userContents.forEach(entry => {
61823
+ content.push(entry);
61824
+ });
61825
+ }
61826
+ else {
61827
+ content = this.getContentList(activeType, patternSpec, contentShapeAttrs, data, datum, params);
61828
+ }
61829
+ return {
61830
+ visible: true,
61831
+ activeType,
61832
+ data,
61833
+ title: this.getTitleResult(activeType, patternSpec === null || patternSpec === void 0 ? void 0 : patternSpec.title, titleShapeAttrs, data, params),
61834
+ content
61835
+ };
61836
+ }
61837
+ getDefaultTitlePattern(activeType) {
61838
+ return {
61839
+ key: undefined,
61840
+ value: activeType === 'group' ? this.groupTooltipTitleCallback : this.dimensionTooltipTitleCallback
61841
+ };
61842
+ }
61843
+ getDefaultContentPattern(activeType) {
61844
+ return {
61845
+ seriesId: this.series.id,
61846
+ key: activeType === 'group' ? this.groupTooltipKeyCallback : this.markTooltipKeyCallback,
61847
+ value: this.markTooltipValueCallback
61848
+ };
61593
61849
  }
61594
61850
  }
61595
61851
 
@@ -62598,7 +62854,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
62598
62854
  const result = dimensionStatisticsOfSimpleData(this._rawData.latestData, [
62599
62855
  { key: field, operations: isNumeric ? ['min', 'max'] : ['values'] }
62600
62856
  ])[field];
62601
- this._rawStatisticsCache[field] = merge$2((_c = this._rawStatisticsCache[field]) !== null && _c !== void 0 ? _c : {}, result);
62857
+ this._rawStatisticsCache[field] = merge$1((_c = this._rawStatisticsCache[field]) !== null && _c !== void 0 ? _c : {}, result);
62602
62858
  }
62603
62859
  }
62604
62860
  }
@@ -63071,7 +63327,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
63071
63327
  _compareLabelSpec(newLabels, prevLabels, compareResult) {
63072
63328
  if (newLabels.length !== prevLabels.length ||
63073
63329
  prevLabels.some((prev, index) => {
63074
- return prev.labelLayout !== newLabels[index].labelLayout;
63330
+ return prev.labelLayout !== newLabels[index].labelLayout || prev.visible !== newLabels[index].visible;
63075
63331
  })) {
63076
63332
  compareResult.reMake = true;
63077
63333
  }
@@ -64612,39 +64868,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
64612
64868
  AxisSyncPlugin.pluginType = 'component';
64613
64869
  AxisSyncPlugin.type = 'AxisSyncPlugin';
64614
64870
 
64615
- function getComponentThemeFromOption(type, chartTheme) {
64616
- return get$1(chartTheme, `component.${type}`);
64617
- }
64618
- function getFormatFunction(formatMethod, formatter, text, datum) {
64619
- if (formatMethod) {
64620
- return { formatFunc: formatMethod, args: [text, datum] };
64621
- }
64622
- const formatterImpl = Factory$1.getFormatter();
64623
- if (formatter && formatterImpl) {
64624
- return { formatFunc: formatterImpl, args: [text, datum, formatter] };
64625
- }
64626
- return {};
64627
- }
64628
- const getSpecInfo = (chartSpec, specKey, compType, filter) => {
64629
- if (isNil$1(chartSpec[specKey])) {
64630
- return undefined;
64631
- }
64632
- const isArraySpec = isArray$1(chartSpec[specKey]);
64633
- const spec = isArraySpec ? chartSpec[specKey] : [chartSpec[specKey]];
64634
- const specInfos = [];
64635
- spec.forEach((s, i) => {
64636
- if (s && (!filter || filter(s))) {
64637
- specInfos.push({
64638
- spec: s,
64639
- specPath: isArraySpec ? [specKey, i] : [specKey],
64640
- specInfoPath: ['component', specKey, i],
64641
- type: compType
64642
- });
64643
- }
64644
- });
64645
- return specInfos;
64646
- };
64647
-
64648
64871
  const DEFAULT_TITLE_STYLE = {
64649
64872
  left: {
64650
64873
  textAlign: 'center',
@@ -65280,7 +65503,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
65280
65503
  return result;
65281
65504
  }
65282
65505
  result.reRender = true;
65283
- if ((prevSpec === null || prevSpec === void 0 ? void 0 : prevSpec.type) !== (spec === null || spec === void 0 ? void 0 : spec.type)) {
65506
+ if ((prevSpec === null || prevSpec === void 0 ? void 0 : prevSpec.type) !== (spec === null || spec === void 0 ? void 0 : spec.type) || (prevSpec === null || prevSpec === void 0 ? void 0 : prevSpec.visible) !== (spec === null || spec === void 0 ? void 0 : spec.visible)) {
65284
65507
  result.reMake = true;
65285
65508
  return result;
65286
65509
  }
@@ -65667,12 +65890,18 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
65667
65890
  const position = bindAxis.valueToPosition(0);
65668
65891
  if (isX) {
65669
65892
  axisMark.encode({
65670
- line: Object.assign(Object.assign({}, this._axisStyle.line), { dy: this._orient === 'bottom' ? -(bindAxis.getScale().range()[0] - position) : position })
65893
+ line: Object.assign(Object.assign({}, this._axisStyle.line), { dy: this._orient === 'bottom'
65894
+ ? -((bindAxis.getInverse() ? bindAxis.getScale().range()[1] : bindAxis.getScale().range()[0]) -
65895
+ position)
65896
+ : position })
65671
65897
  });
65672
65898
  }
65673
65899
  else {
65674
65900
  axisMark.encode({
65675
- line: Object.assign(Object.assign({}, this._axisStyle.line), { dx: this._orient === 'left' ? position : -(bindAxis.getScale().range()[1] - position) })
65901
+ line: Object.assign(Object.assign({}, this._axisStyle.line), { dx: this._orient === 'left'
65902
+ ? position
65903
+ : -((bindAxis.getInverse() ? bindAxis.getScale().range()[0] : bindAxis.getScale().range()[1]) -
65904
+ position) })
65676
65905
  });
65677
65906
  }
65678
65907
  }
@@ -65849,8 +66078,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
65849
66078
  return [f[0]];
65850
66079
  }
65851
66080
  _tickTransformOption() {
65852
- var _a, _b, _c;
65853
- return Object.assign(Object.assign({}, super._tickTransformOption()), { noDecimals: (_a = this._tick) === null || _a === void 0 ? void 0 : _a.noDecimals, labelLastVisible: (_b = this._spec.label) === null || _b === void 0 ? void 0 : _b.lastVisible, labelFlush: (_c = this._spec.label) === null || _c === void 0 ? void 0 : _c.flush });
66081
+ var _a, _b, _c, _d;
66082
+ return Object.assign(Object.assign({}, super._tickTransformOption()), { noDecimals: (_a = this._tick) === null || _a === void 0 ? void 0 : _a.noDecimals, labelLastVisible: (_b = this._spec.label) === null || _b === void 0 ? void 0 : _b.lastVisible, labelFirstVisible: (_c = this._spec.label) === null || _c === void 0 ? void 0 : _c.firstVisible, labelFlush: (_d = this._spec.label) === null || _d === void 0 ? void 0 : _d.flush });
65854
66083
  }
65855
66084
  axisHelper() {
65856
66085
  const getScale = (depth = 0) => {
@@ -71658,9 +71887,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
71658
71887
  }
71659
71888
  initEvent() {
71660
71889
  this.event.on(ChartEvent.scaleUpdate, { filter: ({ model }) => (model === null || model === void 0 ? void 0 : model.id) === this.id }, this.effect.scaleUpdate.bind(this));
71661
- if (this._spec.roam) {
71890
+ const { roam } = this._spec;
71891
+ if (roam) {
71662
71892
  this.initZoomEventOfRegions(this._regions, null, this._handleChartZoom);
71663
- this.initDragEventOfRegions(this._regions, () => true, this.pan);
71893
+ this.initDragEventOfRegions(this._regions, roam.blank ? null : () => true, this.pan);
71664
71894
  this._regions.forEach(r => {
71665
71895
  r.getSeries().forEach(s => {
71666
71896
  s.event.on('zoom', e => {
@@ -72537,6 +72767,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
72537
72767
  if (series.type !== exports.SeriesTypeEnum.sankey) {
72538
72768
  const { formatFunc, args } = getFormatFunction(formatMethod, formatter, textAttribute.text, datum);
72539
72769
  if (formatFunc) {
72770
+ textAttribute._originText = textAttribute.text;
72540
72771
  textAttribute.text = formatFunc(...args, { series });
72541
72772
  }
72542
72773
  }
@@ -73226,81 +73457,40 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
73226
73457
  return isValid$1(datum[BOX_PLOT_OUTLIER_VALUE_FIELD]);
73227
73458
  };
73228
73459
  }
73229
- getDefaultTooltipPattern(activeType) {
73230
- return {
73231
- visible: true,
73232
- activeType,
73233
- title: {
73234
- key: undefined,
73235
- value: this.dimensionTooltipTitleCallback,
73236
- hasShape: false
73460
+ getDefaultContentList(activeType) {
73461
+ return [
73462
+ {
73463
+ key: this.getContentKey(BOX_PLOT_TOOLTIP_KEYS.OUTLIER),
73464
+ value: this.getContentValue(BOX_PLOT_TOOLTIP_KEYS.OUTLIER),
73465
+ shapeType: this.shapeTypeCallback,
73466
+ shapeColor: this.getOutlierFillColor,
73467
+ shapeStroke: this.getOutlierFillColor
73237
73468
  },
73238
- content: [
73239
- {
73240
- key: this.getContentKey(BOX_PLOT_TOOLTIP_KEYS.OUTLIER),
73241
- value: this.getContentValue(BOX_PLOT_TOOLTIP_KEYS.OUTLIER),
73242
- hasShape: true,
73243
- shapeType: this.shapeTypeCallback,
73244
- shapeColor: this.getOutlierFillColor,
73245
- shapeStroke: this.getOutlierFillColor,
73246
- shapeHollow: false
73247
- },
73248
- {
73249
- key: this.getContentKey(BOX_PLOT_TOOLTIP_KEYS.MAX),
73250
- value: this.getContentValue(BOX_PLOT_TOOLTIP_KEYS.MAX),
73251
- hasShape: true,
73252
- shapeType: this.shapeTypeCallback,
73253
- shapeColor: this.shapeColorCallback,
73254
- shapeStroke: this.shapeStrokeCallback,
73255
- shapeHollow: false
73256
- },
73257
- {
73258
- key: this.getContentKey(BOX_PLOT_TOOLTIP_KEYS.Q3),
73259
- value: this.getContentValue(BOX_PLOT_TOOLTIP_KEYS.Q3),
73260
- hasShape: true,
73261
- shapeType: this.shapeTypeCallback,
73262
- shapeColor: this.shapeColorCallback,
73263
- shapeStroke: this.shapeStrokeCallback,
73264
- shapeHollow: false
73265
- },
73266
- {
73267
- key: this.getContentKey(BOX_PLOT_TOOLTIP_KEYS.MEDIAN),
73268
- value: this.getContentValue(BOX_PLOT_TOOLTIP_KEYS.MEDIAN),
73269
- hasShape: true,
73270
- shapeType: this.shapeTypeCallback,
73271
- shapeColor: this.shapeColorCallback,
73272
- shapeStroke: this.shapeStrokeCallback,
73273
- shapeHollow: false
73274
- },
73275
- {
73276
- key: this.getContentKey(BOX_PLOT_TOOLTIP_KEYS.Q1),
73277
- value: this.getContentValue(BOX_PLOT_TOOLTIP_KEYS.Q1),
73278
- hasShape: true,
73279
- shapeType: this.shapeTypeCallback,
73280
- shapeColor: this.shapeColorCallback,
73281
- shapeStroke: this.shapeStrokeCallback,
73282
- shapeHollow: false
73283
- },
73284
- {
73285
- key: this.getContentKey(BOX_PLOT_TOOLTIP_KEYS.MIN),
73286
- value: this.getContentValue(BOX_PLOT_TOOLTIP_KEYS.MIN),
73287
- hasShape: true,
73288
- shapeType: this.shapeTypeCallback,
73289
- shapeColor: this.shapeColorCallback,
73290
- shapeStroke: this.shapeStrokeCallback,
73291
- shapeHollow: false
73292
- },
73293
- {
73294
- key: this.getContentKey(BOX_PLOT_TOOLTIP_KEYS.SERIES_FIELD),
73295
- value: this.getContentValue(BOX_PLOT_TOOLTIP_KEYS.SERIES_FIELD),
73296
- hasShape: true,
73297
- shapeType: this.shapeTypeCallback,
73298
- shapeColor: this.shapeColorCallback,
73299
- shapeStroke: this.shapeStrokeCallback,
73300
- shapeHollow: false
73301
- }
73302
- ]
73303
- };
73469
+ {
73470
+ key: this.getContentKey(BOX_PLOT_TOOLTIP_KEYS.MAX),
73471
+ value: this.getContentValue(BOX_PLOT_TOOLTIP_KEYS.MAX)
73472
+ },
73473
+ {
73474
+ key: this.getContentKey(BOX_PLOT_TOOLTIP_KEYS.Q3),
73475
+ value: this.getContentValue(BOX_PLOT_TOOLTIP_KEYS.Q3)
73476
+ },
73477
+ {
73478
+ key: this.getContentKey(BOX_PLOT_TOOLTIP_KEYS.MEDIAN),
73479
+ value: this.getContentValue(BOX_PLOT_TOOLTIP_KEYS.MEDIAN)
73480
+ },
73481
+ {
73482
+ key: this.getContentKey(BOX_PLOT_TOOLTIP_KEYS.Q1),
73483
+ value: this.getContentValue(BOX_PLOT_TOOLTIP_KEYS.Q1)
73484
+ },
73485
+ {
73486
+ key: this.getContentKey(BOX_PLOT_TOOLTIP_KEYS.MIN),
73487
+ value: this.getContentValue(BOX_PLOT_TOOLTIP_KEYS.MIN)
73488
+ },
73489
+ {
73490
+ key: this.getContentKey(BOX_PLOT_TOOLTIP_KEYS.SERIES_FIELD),
73491
+ value: this.getContentValue(BOX_PLOT_TOOLTIP_KEYS.SERIES_FIELD)
73492
+ }
73493
+ ];
73304
73494
  }
73305
73495
  }
73306
73496
 
@@ -73534,7 +73724,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
73534
73724
  this._autoBoxWidth = null;
73535
73725
  }
73536
73726
  _initAnimationSpec(config = {}) {
73537
- const newConfig = merge$2({}, config);
73727
+ const newConfig = merge$1({}, config);
73538
73728
  ['appear', 'enter', 'update', 'exit', 'disappear'].forEach(state => {
73539
73729
  if (newConfig[state] && newConfig[state].type === 'scaleIn') {
73540
73730
  newConfig[state].type = this._shaftShape === 'line' ? 'boxplotScaleIn' : 'barBoxplotScaleIn';
@@ -73776,28 +73966,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
73776
73966
  }
73777
73967
 
73778
73968
  class RangeColumnSeriesTooltipHelper extends BaseSeriesTooltipHelper {
73779
- getDefaultTooltipPattern(activeType) {
73780
- return {
73781
- visible: true,
73782
- activeType,
73783
- title: {
73784
- key: undefined,
73785
- value: this.dimensionTooltipTitleCallback,
73786
- hasShape: false
73787
- },
73788
- content: [
73789
- {
73790
- key: this.markTooltipKeyCallback,
73791
- value: (datum) => this.series.getSpec().direction === "horizontal"
73792
- ? datum[this.series.getSpec().xField[0]] + '-' + datum[this.series.getSpec().xField[1]]
73793
- : datum[this.series.getSpec().yField[0]] + '-' + datum[this.series.getSpec().yField[1]],
73794
- hasShape: true,
73795
- shapeType: this.shapeTypeCallback,
73796
- shapeColor: this.shapeColorCallback,
73797
- shapeStroke: this.shapeStrokeCallback,
73798
- shapeHollow: false
73799
- }
73800
- ]
73969
+ constructor() {
73970
+ super(...arguments);
73971
+ this._getMeasureData = (datum) => {
73972
+ return this.series.getSpec().direction === "horizontal"
73973
+ ? datum[this.series.getSpec().xField[0]] + '-' + datum[this.series.getSpec().xField[1]]
73974
+ : datum[this.series.getSpec().yField[0]] + '-' + datum[this.series.getSpec().yField[1]];
73801
73975
  };
73802
73976
  }
73803
73977
  }
@@ -74040,66 +74214,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
74040
74214
  };
74041
74215
 
74042
74216
  class RangeAreaSeriesTooltipHelper extends BaseSeriesTooltipHelper {
74043
- getDefaultTooltipPattern(activeType, dimensionInfo) {
74044
- switch (activeType) {
74045
- case 'mark':
74046
- case 'group':
74047
- return {
74048
- visible: true,
74049
- activeType,
74050
- title: {
74051
- key: undefined,
74052
- value: this.dimensionTooltipTitleCallback,
74053
- hasShape: false
74054
- },
74055
- content: [
74056
- {
74057
- key: this.markTooltipKeyCallback,
74058
- value: this.markTooltipValueCallback,
74059
- hasShape: true,
74060
- shapeType: this.shapeTypeCallback,
74061
- shapeColor: this.shapeColorCallback,
74062
- shapeStroke: this.shapeStrokeCallback,
74063
- shapeHollow: false
74064
- }
74065
- ]
74066
- };
74067
- case 'dimension':
74068
- if (dimensionInfo) {
74069
- const title = {
74070
- key: undefined,
74071
- value: this._getDimensionData,
74072
- hasShape: false
74073
- };
74074
- const content = [];
74075
- dimensionInfo.forEach(({ data }) => data.forEach(({ series }) => {
74076
- if (series.type === 'rangeArea') {
74077
- content.push({
74078
- seriesId: series.id,
74079
- key: this.markTooltipKeyCallback,
74080
- value: (datum) => {
74081
- return this.series.getSpec().direction === "horizontal"
74082
- ? datum[this.series.getSpec().xField[0]] + '-' + datum[this.series.getSpec().xField[1]]
74083
- : datum[this.series.getSpec().yField[0]] + '-' + datum[this.series.getSpec().yField[1]];
74084
- },
74085
- hasShape: true,
74086
- shapeType: this.shapeTypeCallback,
74087
- shapeColor: this.shapeColorCallback,
74088
- shapeStroke: this.shapeStrokeCallback,
74089
- shapeHollow: false
74090
- });
74091
- }
74092
- }));
74093
- return {
74094
- visible: true,
74095
- activeType,
74096
- title,
74097
- content
74098
- };
74099
- }
74100
- break;
74101
- }
74102
- return null;
74217
+ constructor() {
74218
+ super(...arguments);
74219
+ this._getMeasureData = (datum) => {
74220
+ return this.series.getSpec().direction === "horizontal"
74221
+ ? datum[this.series.getSpec().xField[0]] + '-' + datum[this.series.getSpec().xField[1]]
74222
+ : datum[this.series.getSpec().yField[0]] + '-' + datum[this.series.getSpec().yField[1]];
74223
+ };
74103
74224
  }
74104
74225
  }
74105
74226
 
@@ -74394,15 +74515,18 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
74394
74515
  return Number.parseFloat(value);
74395
74516
  }
74396
74517
  const pie = (originData, op) => {
74397
- const data = originData.map((datum) => (Object.assign({}, datum)));
74398
- if (!data || data.length === 0) {
74399
- return data;
74400
- }
74401
- const { asStartAngle, asEndAngle, asMiddleAngle, asRadian, asRatio, asQuadrant, asK, showAllZero, supportNegative } = op;
74518
+ const { asStartAngle, asEndAngle, asMiddleAngle, asRadian, asRatio, asQuadrant, asK, showAllZero, supportNegative, showEmptyCircle } = op;
74402
74519
  const angleField = op.angleField();
74403
74520
  const startAngle = op.startAngle();
74404
74521
  const endAngle = op.endAngle();
74405
74522
  const minAngle = op.minAngle();
74523
+ const data = originData.map((datum) => (Object.assign({}, datum)));
74524
+ if (!data || data.length === 0) {
74525
+ return data;
74526
+ }
74527
+ if (!showAllZero && showEmptyCircle && isDataEmpty(data, angleField, supportNegative)) {
74528
+ return data;
74529
+ }
74406
74530
  const appendArcInfo = (data, startAngle, angle) => {
74407
74531
  data[asStartAngle] = startAngle;
74408
74532
  data[asEndAngle] = startAngle + angle;
@@ -74477,6 +74601,21 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
74477
74601
  }
74478
74602
  return data;
74479
74603
  };
74604
+ const isDataEmpty = (data, angleField, supportNegative) => {
74605
+ if (isNil$1(data)) {
74606
+ return true;
74607
+ }
74608
+ if (data.length === 0) {
74609
+ return true;
74610
+ }
74611
+ if (data.every(datum => transformInvalidValue(datum[angleField]) === 0)) {
74612
+ return true;
74613
+ }
74614
+ if (!supportNegative && data.reduce((sum, datum) => sum + transformInvalidValue(datum[angleField]), 0) === 0) {
74615
+ return true;
74616
+ }
74617
+ return false;
74618
+ };
74480
74619
 
74481
74620
  function pieGrowOption(pieParams, isOverall, state) {
74482
74621
  return (datum, element, params) => {
@@ -74840,7 +74979,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
74840
74979
  asQuadrant: ARC_QUADRANT,
74841
74980
  asK: ARC_K,
74842
74981
  showAllZero: this._showAllZero,
74843
- supportNegative: this._supportNegative
74982
+ supportNegative: this._supportNegative,
74983
+ showEmptyCircle: this._showEmptyCircle
74844
74984
  }
74845
74985
  }, false);
74846
74986
  const viewDataLabel = new DataView(this._dataSet, { name: `${PREFIX}_series_${this.id}_viewDataLabel` });
@@ -74902,7 +75042,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
74902
75042
  }
74903
75043
  const emptyPieMark = this._emptyArcMark;
74904
75044
  if (emptyPieMark) {
74905
- this.setMarkStyle(emptyPieMark, Object.assign(Object.assign({}, initialStyle), { visible: () => this.getViewData().latestData.length === 0 }), 'normal', AttributeLevel.Series);
75045
+ this.setMarkStyle(emptyPieMark, Object.assign(Object.assign({}, initialStyle), { visible: () => {
75046
+ const angleField = this.getAngleField()[0];
75047
+ return isDataEmpty(this.getViewData().latestData, angleField, this._supportNegative);
75048
+ } }), 'normal', AttributeLevel.Series);
74906
75049
  }
74907
75050
  }
74908
75051
  initInteraction() {
@@ -76276,60 +76419,63 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
76276
76419
  };
76277
76420
 
76278
76421
  class DotSeriesTooltipHelper extends BaseSeriesTooltipHelper {
76279
- getDefaultTooltipPattern(activeType) {
76280
- if (activeType === 'mark') {
76281
- return {
76282
- visible: true,
76283
- activeType,
76284
- title: {
76285
- key: 'event info',
76286
- value: 'event info'
76287
- },
76288
- content: [
76289
- {
76290
- key: (datum) => datum.type,
76291
- value: (datum) => datum.id
76292
- },
76293
- {
76294
- key: 'event_time',
76295
- value: (datum) => TimeUtil.getInstance().timeFormat('%Y%m%d', datum.event_time)
76296
- },
76297
- {
76298
- key: 'action_type',
76299
- value: (datum) => datum.action_type
76300
- },
76301
- {
76302
- key: 'children',
76303
- value: (datum) => {
76304
- return datum.children;
76305
- }
76306
- }
76307
- ].map(entry => {
76308
- return Object.assign({ hasShape: true, shapeType: 'square', shapeColor: this.shapeColorCallback, shapeStroke: this.shapeStrokeCallback }, entry);
76309
- }),
76310
- updateContent: (prev, datum, params) => {
76311
- const childrenContent = [];
76312
- const childrenPrev = prev.filter((p) => p.key === 'children');
76313
- childrenPrev.length > 0 &&
76314
- childrenPrev[0].value.forEach((element) => {
76315
- let flag = true;
76316
- for (const key in element) {
76317
- childrenContent.push({
76318
- shapeType: 'circle',
76319
- hasShape: flag,
76320
- shapeColor: this.shapeColorCallback(datum[0].datum[0]),
76321
- shapeStroke: this.shapeStrokeCallback(datum[0].datum[0]),
76322
- key: key,
76323
- value: element[key] + ''
76324
- });
76325
- flag = false;
76326
- }
76327
- });
76328
- return prev.concat(childrenContent);
76422
+ constructor() {
76423
+ super(...arguments);
76424
+ this.shapeTypeCallback = () => {
76425
+ return 'square';
76426
+ };
76427
+ }
76428
+ enableByType(activeType) {
76429
+ return activeType === 'mark';
76430
+ }
76431
+ getDefaultTitlePattern(activeType) {
76432
+ return {
76433
+ key: 'event info',
76434
+ value: 'event info'
76435
+ };
76436
+ }
76437
+ getDefaultContentList() {
76438
+ return [
76439
+ {
76440
+ key: (datum) => datum.type,
76441
+ value: (datum) => datum.id
76442
+ },
76443
+ {
76444
+ key: 'event_time',
76445
+ value: (datum) => TimeUtil.getInstance().timeFormat('%Y%m%d', datum.event_time)
76446
+ },
76447
+ {
76448
+ key: 'action_type',
76449
+ value: (datum) => datum.action_type
76450
+ },
76451
+ {
76452
+ key: 'children',
76453
+ value: (datum) => {
76454
+ return datum.children;
76329
76455
  }
76456
+ }
76457
+ ];
76458
+ }
76459
+ getTooltipData(activeType, chartTooltipSpec, data, datum, params) {
76460
+ var _a, _b, _c, _d;
76461
+ const res = super.getTooltipData(activeType, chartTooltipSpec, data, datum, params);
76462
+ const userUpdateContent = (_c = (_b = (_a = this.spec) === null || _a === void 0 ? void 0 : _a[activeType]) === null || _b === void 0 ? void 0 : _b.updateContent) !== null && _c !== void 0 ? _c : (_d = chartTooltipSpec === null || chartTooltipSpec === void 0 ? void 0 : chartTooltipSpec[activeType]) === null || _d === void 0 ? void 0 : _d.updateContent;
76463
+ if (res && !userUpdateContent) {
76464
+ res.updateContent = (prev, datum, params) => {
76465
+ const childrenContent = [];
76466
+ const childrenPrev = prev.filter((p) => p.key === 'children');
76467
+ childrenPrev.length > 0 &&
76468
+ childrenPrev[0].value.forEach((element) => {
76469
+ let flag = true;
76470
+ for (const key in element) {
76471
+ childrenContent.push(Object.assign(Object.assign({}, childrenPrev[0]), { shapeType: 'circle', hasShape: flag, key: key, value: element[key] + '' }));
76472
+ flag = false;
76473
+ }
76474
+ });
76475
+ return prev.concat(childrenContent);
76330
76476
  };
76331
76477
  }
76332
- return null;
76478
+ return res;
76333
76479
  }
76334
76480
  }
76335
76481
 
@@ -76673,38 +76819,40 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
76673
76819
  };
76674
76820
 
76675
76821
  class LinkSeriesTooltipHelper extends BaseSeriesTooltipHelper {
76676
- getDefaultTooltipPattern(activeType) {
76677
- if (activeType === 'mark') {
76678
- return {
76679
- visible: true,
76680
- activeType,
76681
- title: {
76682
- key: 'link info',
76683
- value: 'link info'
76684
- },
76685
- content: [
76686
- {
76687
- key: 'time',
76688
- value: (datum) => TimeUtil.getInstance().timeFormat('%Y%m%d %H:%M', datum.from.split('_')[1])
76689
- },
76690
- {
76691
- key: 'type',
76692
- value: (datum) => datum.action_type
76693
- },
76694
- {
76695
- key: 'from',
76696
- value: (datum) => datum.from
76697
- },
76698
- {
76699
- key: 'to',
76700
- value: (datum) => datum.to
76701
- }
76702
- ].map(entry => {
76703
- return Object.assign({ hasShape: true, shapeType: 'square', shapeColor: this.shapeColorCallback, shapeStroke: this.shapeStrokeCallback }, entry);
76704
- })
76705
- };
76706
- }
76707
- return null;
76822
+ constructor() {
76823
+ super(...arguments);
76824
+ this.shapeTypeCallback = () => {
76825
+ return 'square';
76826
+ };
76827
+ }
76828
+ enableByType(activeType) {
76829
+ return activeType === 'mark';
76830
+ }
76831
+ getDefaultTitlePattern(activeType) {
76832
+ return {
76833
+ key: 'link info',
76834
+ value: 'link info'
76835
+ };
76836
+ }
76837
+ getDefaultContentList() {
76838
+ return [
76839
+ {
76840
+ key: 'time',
76841
+ value: (datum) => TimeUtil.getInstance().timeFormat('%Y%m%d %H:%M', datum.from.split('_')[1])
76842
+ },
76843
+ {
76844
+ key: 'type',
76845
+ value: (datum) => datum.action_type
76846
+ },
76847
+ {
76848
+ key: 'from',
76849
+ value: (datum) => datum.from
76850
+ },
76851
+ {
76852
+ key: 'to',
76853
+ value: (datum) => datum.to
76854
+ }
76855
+ ];
76708
76856
  }
76709
76857
  }
76710
76858
 
@@ -77462,17 +77610,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
77462
77610
  };
77463
77611
 
77464
77612
  class LinearProgressSeriesTooltipHelper extends BaseSeriesTooltipHelper {
77465
- getDefaultTooltipPattern(activeType, dimensionInfo) {
77466
- const result = super.getDefaultTooltipPattern(activeType, dimensionInfo);
77467
- switch (activeType) {
77468
- case 'mark':
77469
- case 'group':
77470
- return result;
77471
- case 'dimension':
77472
- result.visible = false;
77473
- return result;
77474
- }
77475
- return null;
77613
+ enableByType(activeType) {
77614
+ return activeType !== 'dimension';
77476
77615
  }
77477
77616
  }
77478
77617
 
@@ -78079,7 +78218,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
78079
78218
  class BaseLayout {
78080
78219
  constructor(options) {
78081
78220
  var _a, _b;
78082
- switch (this.options = merge$2({}, BaseLayout.defaultOptions, options), isFunction$1(this.options.shape) ? this.shape = this.options.shape : this.shape = getShapeFunction(this.options.shape), this.getText = null !== (_a = functor$1(this.options.text)) && void 0 !== _a ? _a : d => d, this.getTextFontWeight = functor$1(this.options.fontWeight), this.getTextFontSize = functor$1(this.options.fontSize), this.getTextFontStyle = functor$1(this.options.fontStyle), this.getTextFontFamily = functor$1(this.options.fontFamily), this.outputCallback = null !== (_b = this.options.outputCallback) && void 0 !== _b ? _b : res => res, this.options.color) {
78221
+ switch (this.options = merge$1({}, BaseLayout.defaultOptions, options), isFunction$1(this.options.shape) ? this.shape = this.options.shape : this.shape = getShapeFunction(this.options.shape), this.getText = null !== (_a = functor$1(this.options.text)) && void 0 !== _a ? _a : d => d, this.getTextFontWeight = functor$1(this.options.fontWeight), this.getTextFontSize = functor$1(this.options.fontSize), this.getTextFontStyle = functor$1(this.options.fontStyle), this.getTextFontFamily = functor$1(this.options.fontFamily), this.outputCallback = null !== (_b = this.options.outputCallback) && void 0 !== _b ? _b : res => res, this.options.color) {
78083
78222
  case "random-dark":
78084
78223
  this.getTextColor = () => randomHslColor(10, 50);
78085
78224
  break;
@@ -78202,7 +78341,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
78202
78341
  class CloudLayout extends BaseLayout {
78203
78342
  constructor(options) {
78204
78343
  var _a;
78205
- super(merge$2({}, CloudLayout.defaultOptions, options)), this.cw = 64, this.ch = 2048, this._size = [256, 256], this._isBoardExpandCompleted = !1, this._placeStatus = 0, this._tTemp = null, this._dtTemp = null, this._dy = 0, this.cacheMap = new Map(), this.options.minFontSize <= CloudLayout.defaultOptions.minFontSize && (this.options.minFontSize = CloudLayout.defaultOptions.minFontSize), this.spiral = isString$1(this.options.spiral) ? null !== (_a = spirals[this.options.spiral]) && void 0 !== _a ? _a : spirals.archimedean : this.options.spiral, this.random = this.options.random ? Math.random : () => 1, this.getTextPadding = functor$1(this.options.padding);
78344
+ super(merge$1({}, CloudLayout.defaultOptions, options)), this.cw = 64, this.ch = 2048, this._size = [256, 256], this._isBoardExpandCompleted = !1, this._placeStatus = 0, this._tTemp = null, this._dtTemp = null, this._dy = 0, this.cacheMap = new Map(), this.options.minFontSize <= CloudLayout.defaultOptions.minFontSize && (this.options.minFontSize = CloudLayout.defaultOptions.minFontSize), this.spiral = isString$1(this.options.spiral) ? null !== (_a = spirals[this.options.spiral]) && void 0 !== _a ? _a : spirals.archimedean : this.options.spiral, this.random = this.options.random ? Math.random : () => 1, this.getTextPadding = functor$1(this.options.padding);
78206
78345
  }
78207
78346
  zoomRatio() {
78208
78347
  return this._originSize[0] / this._size[0];
@@ -78540,7 +78679,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
78540
78679
 
78541
78680
  let GridLayout$1 = class GridLayout extends BaseLayout {
78542
78681
  constructor(options) {
78543
- super(merge$2({}, GridLayout.defaultOptions, options)), this.fillGridAt = (x, y) => {
78682
+ super(merge$1({}, GridLayout.defaultOptions, options)), this.fillGridAt = (x, y) => {
78544
78683
  x >= this.ngx || y >= this.ngy || x < 0 || y < 0 || (this.grid[x][y] = !1);
78545
78684
  }, this.updateGrid = (gx, gy, gw, gh, info) => {
78546
78685
  const occupied = info.occupied;
@@ -78738,7 +78877,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
78738
78877
 
78739
78878
  class FastLayout extends BaseLayout {
78740
78879
  constructor(options) {
78741
- super(merge$2({}, FastLayout.defaultOptions, options)), this.random = this.options.random ? Math.random : () => 0, this.aspectRatio = 1;
78880
+ super(merge$1({}, FastLayout.defaultOptions, options)), this.random = this.options.random ? Math.random : () => 0, this.aspectRatio = 1;
78742
78881
  }
78743
78882
  fit(word) {
78744
78883
  for (let i = 0, len = this.result.length; i < len; i++) if (isOverlap(word, this.result[i])) return !1;
@@ -82416,7 +82555,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
82416
82555
  }
82417
82556
  initTooltip() {
82418
82557
  this._tooltipHelper = new CirclePackingTooltipHelper(this);
82419
- this._tooltipHelper.updateTooltipSpec();
82420
82558
  this._circlePackingMark && this._tooltipHelper.activeTriggerSet.mark.add(this._circlePackingMark);
82421
82559
  this._labelMark && this._tooltipHelper.activeTriggerSet.mark.add(this._labelMark);
82422
82560
  }
@@ -83159,70 +83297,21 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
83159
83297
  };
83160
83298
 
83161
83299
  class SankeySeriesTooltipHelper extends BaseSeriesTooltipHelper {
83162
- getDefaultTooltipPattern(activeType, dimensionInfo) {
83163
- switch (activeType) {
83164
- case 'mark':
83165
- return {
83166
- visible: true,
83167
- activeType,
83168
- title: {
83169
- key: undefined,
83170
- value: (datum) => {
83171
- if (datum.source) {
83172
- if (isNumber$1(datum.source)) {
83173
- const seriesKeys = this.series.getSeriesKeys();
83174
- return seriesKeys[datum.source] + ' => ' + seriesKeys[datum.target];
83175
- }
83176
- return datum.source + ' => ' + datum.target;
83177
- }
83178
- return datum.datum ? datum.datum[this.series.getSpec().categoryField] : datum.key;
83179
- },
83180
- hasShape: false
83181
- },
83182
- content: [
83183
- {
83184
- key: this.markTooltipKeyCallback,
83185
- value: (datum) => {
83186
- return datum.value;
83187
- },
83188
- hasShape: true,
83189
- shapeType: this.shapeTypeCallback,
83190
- shapeColor: this.shapeColorCallback,
83191
- shapeStroke: this.shapeStrokeCallback,
83192
- shapeHollow: false
83193
- }
83194
- ]
83195
- };
83196
- case 'dimension':
83197
- if (dimensionInfo) {
83198
- const title = {
83199
- key: undefined,
83200
- value: this._getDimensionData,
83201
- hasShape: false
83202
- };
83203
- const content = [];
83204
- dimensionInfo.forEach(({ data }) => data.forEach(({ series }) => {
83205
- content.push({
83206
- seriesId: series.id,
83207
- key: this.markTooltipKeyCallback,
83208
- value: this.markTooltipValueCallback,
83209
- hasShape: true,
83210
- shapeType: this.shapeTypeCallback,
83211
- shapeColor: this.shapeColorCallback,
83212
- shapeStroke: this.shapeStrokeCallback,
83213
- shapeHollow: false
83214
- });
83215
- }));
83216
- return {
83217
- visible: true,
83218
- activeType,
83219
- title,
83220
- content
83221
- };
83300
+ constructor() {
83301
+ super(...arguments);
83302
+ this._getDimensionData = (datum) => {
83303
+ if (datum.source) {
83304
+ if (isNumber$1(datum.source)) {
83305
+ const seriesKeys = this.series.getSeriesKeys();
83306
+ return seriesKeys[datum.source] + ' => ' + seriesKeys[datum.target];
83222
83307
  }
83223
- break;
83224
- }
83225
- return null;
83308
+ return datum.source + ' => ' + datum.target;
83309
+ }
83310
+ return datum.datum ? datum.datum[this.series.getSpec().categoryField] : datum.key;
83311
+ };
83312
+ this.markTooltipValueCallback = (datum) => {
83313
+ return datum.value;
83314
+ };
83226
83315
  }
83227
83316
  }
83228
83317
 
@@ -84432,7 +84521,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
84432
84521
  const result = hierarchyDimensionStatistics([this._rawData], {
84433
84522
  fields: [{ key: field, operations: isNumeric ? ['min', 'max'] : ['values'] }]
84434
84523
  })[field];
84435
- this._rawStatisticsCache[field] = merge$2((_a = this._rawStatisticsCache[field]) !== null && _a !== void 0 ? _a : {}, result);
84524
+ this._rawStatisticsCache[field] = merge$1((_a = this._rawStatisticsCache[field]) !== null && _a !== void 0 ? _a : {}, result);
84436
84525
  }
84437
84526
  }
84438
84527
  return this._rawStatisticsCache[field];
@@ -84768,14 +84857,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
84768
84857
  }
84769
84858
 
84770
84859
  class GaugePointerTooltipHelper extends BaseSeriesTooltipHelper {
84771
- updateTooltipSpec() {
84772
- var _a;
84773
- super.updateTooltipSpec();
84774
- if (isNil$1((_a = this.spec) === null || _a === void 0 ? void 0 : _a.dimension)) {
84775
- this.spec = Object.assign(Object.assign({}, this.spec), { dimension: {
84776
- visible: false
84777
- } });
84778
- }
84860
+ enableByType(activeType) {
84861
+ return activeType !== 'dimension';
84779
84862
  }
84780
84863
  }
84781
84864
 
@@ -85134,12 +85217,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
85134
85217
  };
85135
85218
 
85136
85219
  class HeatmapSeriesTooltipHelper extends BaseSeriesTooltipHelper {
85137
- getDefaultTooltipPattern(activeType, dimensionInfo) {
85138
- const pattern = super.getDefaultTooltipPattern(activeType, dimensionInfo);
85139
- if (isValid$1(pattern) && activeType === 'dimension') {
85140
- pattern.visible = false;
85141
- }
85142
- return pattern;
85220
+ enableByType(activeType) {
85221
+ return activeType !== 'dimension';
85143
85222
  }
85144
85223
  }
85145
85224
 
@@ -85888,39 +85967,17 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
85888
85967
  class LiquidSeriesTooltipHelper extends BaseSeriesTooltipHelper {
85889
85968
  constructor() {
85890
85969
  super(...arguments);
85891
- this.getContentKey = () => (datum) => {
85970
+ this.markTooltipKeyCallback = (datum) => {
85892
85971
  return this.series.getValueField();
85893
85972
  };
85894
- this.getContentValue = () => (datum) => {
85973
+ this.markTooltipValueCallback = (datum) => {
85895
85974
  const valueField = this.series.getValueField();
85896
85975
  return datum[valueField];
85897
85976
  };
85898
- this.getLiquidFillColor = (datum) => {
85977
+ this.shapeStrokeCallback = (datum) => {
85899
85978
  return this.series.getMarkInName('liquid').getAttribute('fill', datum);
85900
85979
  };
85901
85980
  }
85902
- getDefaultTooltipPattern(activeType) {
85903
- return {
85904
- visible: true,
85905
- activeType,
85906
- title: {
85907
- key: undefined,
85908
- value: this.dimensionTooltipTitleCallback,
85909
- hasShape: false
85910
- },
85911
- content: [
85912
- {
85913
- key: this.getContentKey(),
85914
- value: this.getContentValue(),
85915
- hasShape: true,
85916
- shapeType: this.shapeTypeCallback,
85917
- shapeColor: this.getLiquidFillColor,
85918
- shapeStroke: this.getLiquidFillColor,
85919
- shapeHollow: false
85920
- }
85921
- ]
85922
- };
85923
- }
85924
85981
  }
85925
85982
 
85926
85983
  class LiquidSeries extends BaseSeries {
@@ -89969,181 +90026,60 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
89969
90026
  return markInfoList;
89970
90027
  };
89971
90028
 
89972
- const getTooltipActualActiveType = (spec) => {
90029
+ const pick_keys = ['updateTitle', 'updateContent', 'updatePosition', 'maxLineCount', 'othersLine'];
90030
+ const getTooltipSpecForShow = (activeType, globalSpec, series, data, params) => {
89973
90031
  var _a, _b, _c;
89974
- if ((spec === null || spec === void 0 ? void 0 : spec.visible) === false) {
89975
- return [];
89976
- }
89977
- const activeTypeMap = {
89978
- mark: ((_a = spec === null || spec === void 0 ? void 0 : spec.mark) === null || _a === void 0 ? void 0 : _a.visible) !== false,
89979
- dimension: ((_b = spec === null || spec === void 0 ? void 0 : spec.dimension) === null || _b === void 0 ? void 0 : _b.visible) !== false,
89980
- group: ((_c = spec === null || spec === void 0 ? void 0 : spec.group) === null || _c === void 0 ? void 0 : _c.visible) !== false
90032
+ const finalSpec = {
90033
+ activeType
89981
90034
  };
89982
- if (isValid$1(spec === null || spec === void 0 ? void 0 : spec.activeType)) {
89983
- Object.keys(activeTypeMap).forEach(t => {
89984
- var _a;
89985
- activeTypeMap[t] = (_a = spec === null || spec === void 0 ? void 0 : spec.activeType) === null || _a === void 0 ? void 0 : _a.includes(t);
89986
- });
89987
- }
89988
- return Object.keys(activeTypeMap).filter(t => activeTypeMap[t]);
89989
- };
89990
- const isActiveTypeVisible = (type, spec) => {
89991
- if (!spec) {
89992
- return true;
89993
- }
89994
- if (spec.visible === false) {
89995
- return false;
89996
- }
89997
- if (spec[type] && spec[type].visible === false) {
89998
- return false;
89999
- }
90000
- if (spec.activeType && !spec.activeType.includes(type)) {
90001
- return false;
90002
- }
90003
- return true;
90004
- };
90005
- function isEmptyPos(params) {
90006
- return isNil$1(params.mark) && isNil$1(params.model) && isNil$1(params.datum);
90007
- }
90008
- function combinePattern(patternList) {
90009
- if (!patternList || !patternList.length) {
90010
- return null;
90011
- }
90012
- const defaultPatternContent = [];
90013
- patternList.forEach(({ content }) => {
90014
- if (isFunction$1(content)) {
90015
- defaultPatternContent.push(content);
90016
- }
90017
- else if (isArray$1(content)) {
90018
- content.forEach(c => {
90019
- defaultPatternContent.push(c);
90020
- });
90021
- }
90022
- else if (content) {
90023
- defaultPatternContent.push(content);
90024
- }
90025
- });
90026
- if (defaultPatternContent.length) {
90027
- return Object.assign(Object.assign({}, patternList[0]), { content: defaultPatternContent });
90028
- }
90029
- return patternList[0];
90030
- }
90031
-
90032
- const getTooltipSpecForShow = (activeType, globalSpec, series, dimensionInfo) => {
90033
- var _a, _b, _c, _d, _e, _f;
90034
- const finalSpec = Object.assign(Object.assign({}, globalSpec), { activeType });
90035
- const { style = {} } = globalSpec;
90036
90035
  switch (activeType) {
90037
90036
  case 'mark':
90038
90037
  case 'group':
90039
90038
  if (series) {
90040
90039
  const seriesSpec = (_a = series.getSpec()) === null || _a === void 0 ? void 0 : _a.tooltip;
90041
90040
  finalSpec.visible = true;
90042
- finalSpec.handler = (_b = seriesSpec === null || seriesSpec === void 0 ? void 0 : seriesSpec.handler) !== null && _b !== void 0 ? _b : globalSpec.handler;
90043
- if ((_c = finalSpec.handler) === null || _c === void 0 ? void 0 : _c.showTooltip) {
90041
+ if (seriesSpec === null || seriesSpec === void 0 ? void 0 : seriesSpec.handler) {
90042
+ finalSpec.handler = seriesSpec.handler;
90043
+ }
90044
+ if ((_b = finalSpec.handler) === null || _b === void 0 ? void 0 : _b.showTooltip) {
90044
90045
  return finalSpec;
90045
90046
  }
90047
+ if (seriesSpec === null || seriesSpec === void 0 ? void 0 : seriesSpec[activeType]) {
90048
+ pick_keys.forEach(k => {
90049
+ if (isValid$1(seriesSpec[activeType][k])) {
90050
+ finalSpec[k] = seriesSpec[activeType][k];
90051
+ }
90052
+ });
90053
+ }
90054
+ return Object.assign(Object.assign({}, finalSpec), series.tooltipHelper.getTooltipData(activeType, globalSpec, data, data[0].datum, params));
90046
90055
  }
90047
90056
  break;
90048
90057
  case 'dimension':
90049
- if (dimensionInfo === null || dimensionInfo === void 0 ? void 0 : dimensionInfo.length) {
90050
- const seriesList = getSeriesListFromDimensionInfo(dimensionInfo);
90058
+ if (data === null || data === void 0 ? void 0 : data.length) {
90059
+ const seriesList = getSeriesListFromDimensionInfo(data);
90051
90060
  if (seriesList.every(series => { var _a; return !isActiveTypeVisible('dimension', (_a = series.tooltipHelper) === null || _a === void 0 ? void 0 : _a.spec); })) {
90052
90061
  finalSpec.visible = false;
90053
90062
  }
90054
90063
  else {
90055
90064
  finalSpec.visible = true;
90056
90065
  }
90057
- finalSpec.handler = (_d = globalSpec.handler) !== null && _d !== void 0 ? _d : undefined;
90058
- if ((_e = finalSpec.handler) === null || _e === void 0 ? void 0 : _e.showTooltip) {
90066
+ finalSpec.handler = globalSpec.handler;
90067
+ if ((_c = finalSpec.handler) === null || _c === void 0 ? void 0 : _c.showTooltip) {
90059
90068
  return finalSpec;
90060
90069
  }
90061
- }
90062
- break;
90063
- }
90064
- const defaultPattern = (_f = getDefaultTooltipPattern(activeType, series, dimensionInfo)) !== null && _f !== void 0 ? _f : {};
90065
- const userPattern = getSeriesTooltipPattern(activeType, globalSpec, series, dimensionInfo);
90066
- if (userPattern) {
90067
- const defaultPatternTitle = defaultPattern.title;
90068
- const defaultTitleShape = getShapePattern(undefined, userPattern, style.shape, undefined, defaultPatternTitle);
90069
- if (isValid$1(userPattern.title)) {
90070
- userPattern.title = addExtraInfoToTooltipTitlePattern(userPattern.title, Object.assign(Object.assign({}, defaultPatternTitle), defaultTitleShape));
90071
- }
90072
- else {
90073
- userPattern.title = addExtraInfoToTooltipTitlePattern(defaultPatternTitle, defaultTitleShape, true);
90074
- }
90075
- const defaultPatternContent = array(defaultPattern.content);
90076
- if (isValid$1(userPattern.content)) {
90077
- const shapePatternMap = getShapePatternMapOfEachSeries(defaultPatternContent);
90078
- userPattern.content = addExtraInfoToTooltipContentPattern(userPattern.content, userLine => getShapePattern(userLine, userPattern, style.shape, shapePatternMap));
90079
- }
90080
- else {
90081
- userPattern.content = addExtraInfoToTooltipContentPattern(defaultPatternContent, line => getShapePattern(undefined, userPattern, style.shape, undefined, line), true);
90082
- }
90083
- }
90084
- finalSpec[activeType] = Object.assign(Object.assign(Object.assign({}, defaultPattern), userPattern), { activeType });
90085
- return finalSpec;
90086
- };
90087
- const getDefaultTooltipPattern = (activeType, series, dimensionInfo) => {
90088
- switch (activeType) {
90089
- case 'mark':
90090
- case 'group':
90091
- if (series) {
90092
- return series.tooltipHelper.getDefaultTooltipPattern(activeType);
90093
- }
90094
- break;
90095
- case 'dimension':
90096
- if (dimensionInfo === null || dimensionInfo === void 0 ? void 0 : dimensionInfo.length) {
90097
90070
  const patternList = [];
90098
- dimensionInfo.forEach(info => info.data.forEach(datum => {
90071
+ data.forEach(info => info.data.forEach(datum => {
90099
90072
  const { series } = datum;
90100
- const mockDimensionInfo = [
90101
- Object.assign(Object.assign({}, info), { data: [datum] })
90102
- ];
90103
- const pattern = series.tooltipHelper.getDefaultTooltipPattern(activeType, mockDimensionInfo);
90073
+ const pattern = series.tooltipHelper.getTooltipData(activeType, globalSpec, data, datum.datum, params);
90104
90074
  if (pattern) {
90105
90075
  patternList.push(pattern);
90106
90076
  }
90107
90077
  }));
90108
- return combinePattern(patternList);
90078
+ return combineContents(patternList);
90109
90079
  }
90110
90080
  break;
90111
90081
  }
90112
- return undefined;
90113
- };
90114
- const getSeriesTooltipPattern = (activeType, globalSpec, series, dimensionInfo) => {
90115
- const allSeries = activeType === 'dimension' && (dimensionInfo === null || dimensionInfo === void 0 ? void 0 : dimensionInfo.length)
90116
- ? getSeriesListFromDimensionInfo(dimensionInfo)
90117
- : (activeType === 'mark' || activeType === 'group') && series
90118
- ? [series]
90119
- : null;
90120
- if (allSeries && allSeries.length) {
90121
- const seriesPatternList = [];
90122
- allSeries.forEach(s => {
90123
- var _a;
90124
- const seriesSpec = (_a = s.tooltipHelper) === null || _a === void 0 ? void 0 : _a.spec;
90125
- if (isActiveTypeVisible(activeType, seriesSpec)) {
90126
- let finalPattern = seriesSpec && seriesSpec[activeType]
90127
- ? Object.assign(Object.assign({}, globalSpec[activeType]), seriesSpec[activeType]) : globalSpec[activeType];
90128
- if (finalPattern) {
90129
- finalPattern = cloneDeep(finalPattern);
90130
- if (finalPattern.title) {
90131
- finalPattern.title = addExtraInfoToTooltipTitlePattern(finalPattern.title, {
90132
- seriesId: s.id
90133
- }, true);
90134
- }
90135
- if (finalPattern.content) {
90136
- finalPattern.content = addExtraInfoToTooltipContentPattern(finalPattern.content, {
90137
- seriesId: s.id
90138
- }, true);
90139
- }
90140
- seriesPatternList.push(finalPattern);
90141
- }
90142
- }
90143
- });
90144
- return seriesPatternList && seriesPatternList.length ? combinePattern(seriesPatternList) : null;
90145
- }
90146
- return undefined;
90082
+ return null;
90147
90083
  };
90148
90084
  const getSeriesListFromDimensionInfo = (dimensionInfo) => {
90149
90085
  const list = [];
@@ -90156,122 +90092,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90156
90092
  });
90157
90093
  return list;
90158
90094
  };
90159
- const getShapePatternMapOfEachSeries = (content) => {
90160
- const shapePatternMap = {};
90161
- content.forEach(line => {
90162
- const key = line.seriesId;
90163
- if (isValid$1(key) && !shapePatternMap[key]) {
90164
- shapePatternMap[key] = line;
90165
- }
90166
- if (!shapePatternMap[-1]) {
90167
- shapePatternMap[-1] = line;
90168
- }
90169
- });
90170
- return shapePatternMap;
90171
- };
90172
- const isShapeKey = (key) => key.toLowerCase().includes('shape');
90173
- const getShapePattern = (userLinePattern, userPattern, userStyle, shapePatternMap, defaultShapePattern) => {
90174
- var _a, _b;
90175
- if (userStyle) {
90176
- userStyle.shapeSize = (_a = userStyle.shapeSize) !== null && _a !== void 0 ? _a : userStyle.size;
90177
- }
90178
- const shapePatternFromMap = shapePatternMap
90179
- ? (_b = shapePatternMap[userLinePattern === null || userLinePattern === void 0 ? void 0 : userLinePattern.seriesId]) !== null && _b !== void 0 ? _b : shapePatternMap[-1]
90180
- : null;
90181
- const shapePattern = {};
90182
- [userLinePattern, userPattern, userStyle, shapePatternFromMap, defaultShapePattern].forEach(cfg => {
90183
- if (isValid$1(cfg)) {
90184
- Object.keys(cfg).forEach(key => {
90185
- if (isShapeKey(key) && isNil$1(shapePattern[key]) && !isNil$1(cfg[key])) {
90186
- shapePattern[key] = cfg[key];
90187
- }
90188
- });
90189
- }
90190
- });
90191
- return shapePattern;
90192
- };
90193
- const merge = (source, extraInfo, overwrite) => {
90194
- const info = isFunction$1(extraInfo) ? extraInfo(source) : extraInfo;
90195
- return overwrite ? Object.assign(Object.assign({}, source), info) : Object.assign(Object.assign({}, info), source);
90196
- };
90197
- const addExtraInfoToTooltipTitlePattern = (pattern, extraInfo, overwrite) => {
90198
- const result = isValid$1(pattern)
90199
- ? isFunction$1(pattern)
90200
- ? (...args) => merge(pattern(...args), extraInfo, overwrite)
90201
- : merge(pattern, extraInfo, overwrite)
90202
- : undefined;
90203
- return result;
90204
- };
90205
- const addExtraInfoToTooltipContentPattern = (pattern, extraInfo, overwrite) => {
90206
- const result = isValid$1(pattern)
90207
- ? array(pattern).map(patternItem => isFunction$1(patternItem)
90208
- ? (...args) => array(patternItem(...args)).map(line => merge(line, extraInfo, overwrite))
90209
- : merge(patternItem, extraInfo, overwrite))
90210
- : undefined;
90211
- return result;
90212
- };
90213
90095
 
90214
- const getTooltipContentValue = (field, datum, params, formatter) => {
90215
- let value;
90216
- if (isFunction$1(field)) {
90217
- value = field(datum, params);
90218
- }
90219
- else {
90220
- value = field;
90221
- }
90222
- if (formatter) {
90223
- const { formatFunc, args } = getFormatFunction(undefined, formatter, field, datum);
90224
- if (formatFunc && args) {
90225
- value = formatFunc(...args);
90226
- }
90227
- }
90228
- return value;
90229
- };
90230
- const getTooltipPatternValue = (field, data, params) => {
90231
- if (isNil$1(field)) {
90232
- return field;
90233
- }
90234
- if (isFunction$1(field)) {
90235
- return field(data, params);
90236
- }
90237
- return field;
90096
+ const TooltipHandlerType = {
90097
+ dom: `${PREFIX}_TOOLTIP_HANDLER_DOM`,
90098
+ canvas: `${PREFIX}_TOOLTIP_HANDLER_CANVAS`
90238
90099
  };
90239
- const getTooltipContentPattern = (field, data, params) => {
90240
- if (isNil$1(field)) {
90241
- return field;
90242
- }
90243
- let result = [];
90244
- array(field).forEach(patternItem => {
90245
- if (isFunction$1(patternItem)) {
90246
- result = result.concat(array(patternItem(data, params)));
90247
- }
90248
- else {
90249
- result.push(patternItem);
90250
- }
90251
- });
90252
- return result;
90253
- };
90254
- function getFirstDatumFromTooltipData(data) {
90255
- var _a;
90256
- const dimInfoList = ((_a = data[0]) === null || _a === void 0 ? void 0 : _a.series)
90257
- ? [{ data: data, value: '' }]
90258
- : data;
90259
- for (const { data: dataList } of dimInfoList) {
90260
- for (const { datum: datumList } of dataList) {
90261
- for (const datumItem of datumList !== null && datumList !== void 0 ? datumList : []) {
90262
- if (datumItem) {
90263
- return datumItem;
90264
- }
90265
- }
90266
- }
90267
- }
90268
- return undefined;
90269
- }
90270
-
90271
- class TooltipHandlerType {
90272
- }
90273
- TooltipHandlerType.dom = `${PREFIX}_TOOLTIP_HANDLER_DOM`;
90274
- TooltipHandlerType.canvas = `${PREFIX}_TOOLTIP_HANDLER_CANVAS`;
90275
90100
  const TOOLTIP_EL_CLASS_NAME = 'vchart-tooltip-element';
90276
90101
  const TOOLTIP_MAX_LINE_COUNT = 20;
90277
90102
  const TOOLTIP_OTHERS_LINE = {
@@ -90279,164 +90104,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90279
90104
  value: '...'
90280
90105
  };
90281
90106
  const TOOLTIP_TYPES = ['group', 'mark', 'dimension'];
90282
-
90283
- const getTimeString = (value, timeFormat, timeFormatMode) => {
90284
- if (!timeFormat && !timeFormatMode) {
90285
- if (typeof value !== 'object') {
90286
- return value === null || value === void 0 ? void 0 : value.toString();
90287
- }
90288
- return value;
90289
- }
90290
- const timeUtil = TimeUtil.getInstance();
90291
- timeFormat = timeFormat || '%Y%m%d';
90292
- timeFormatMode = timeFormatMode || 'local';
90293
- const timeFormatter = timeFormatMode === 'local' ? timeUtil.timeFormat : timeUtil.timeUTCFormat;
90294
- return timeFormatter(timeFormat, value);
90295
- };
90296
- const getShowContent = (pattern, data, params) => {
90297
- var _a, _b, _c, _d;
90298
- if (!data ||
90299
- ((_a = params === null || params === void 0 ? void 0 : params.event) === null || _a === void 0 ? void 0 : _a.type) === 'mouseout') {
90300
- return null;
90301
- }
90302
- const tooltipActualTitleContent = {
90303
- title: {},
90304
- content: []
90305
- };
90306
- const patternTitle = getTooltipPatternValue(pattern.title, data, params);
90307
- const { visible, value, valueTimeFormat, valueTimeFormatMode, valueStyle, hasShape, valueFormatter } = patternTitle !== null && patternTitle !== void 0 ? patternTitle : {};
90308
- const patternTitleVisible = getTooltipContentValue(visible, data, params) !== false;
90309
- if (!patternTitle || !patternTitleVisible) {
90310
- tooltipActualTitleContent.title = {
90311
- hasShape: false,
90312
- visible: false
90313
- };
90314
- }
90315
- else {
90316
- const datum = getFirstDatumFromTooltipData(data);
90317
- tooltipActualTitleContent.title = {
90318
- value: getTimeString(getTooltipContentValue(value, datum, params, valueFormatter), valueTimeFormat, valueTimeFormatMode),
90319
- valueStyle: getTooltipContentValue(valueStyle, datum, params),
90320
- hasShape
90321
- };
90322
- }
90323
- const patternContent = getTooltipContentPattern(pattern.content, data, params);
90324
- const { maxLineCount = TOOLTIP_MAX_LINE_COUNT } = pattern;
90325
- const othersLine = pattern.othersLine
90326
- ? Object.assign(Object.assign({}, TOOLTIP_OTHERS_LINE), pattern.othersLine) : TOOLTIP_OTHERS_LINE;
90327
- const getTooltipContentFromDatumList = (datumList) => {
90328
- if (datumList === null || datumList === void 0 ? void 0 : datumList.length) {
90329
- for (const datum of datumList) {
90330
- for (const content of patternContent !== null && patternContent !== void 0 ? patternContent : []) {
90331
- const oneLineData = getOneLineData(datum, content, params);
90332
- if (oneLineData.visible !== false) {
90333
- if (tooltipActualTitleContent.content.length === maxLineCount - 1) {
90334
- tooltipActualTitleContent.content.push(Object.assign(Object.assign({}, oneLineData), othersLine));
90335
- break;
90336
- }
90337
- else if (tooltipActualTitleContent.content.length < maxLineCount) {
90338
- tooltipActualTitleContent.content.push(oneLineData);
90339
- }
90340
- else {
90341
- break;
90342
- }
90343
- }
90344
- }
90345
- }
90346
- }
90347
- };
90348
- switch (pattern.activeType) {
90349
- case 'mark':
90350
- getTooltipContentFromDatumList((_b = data[0]) === null || _b === void 0 ? void 0 : _b.datum);
90351
- break;
90352
- case 'group':
90353
- getTooltipContentFromDatumList(params.groupDatum);
90354
- break;
90355
- case 'dimension':
90356
- for (const { data: d } of data) {
90357
- for (const { datum: datumList, series } of d) {
90358
- if (!isActiveTypeVisible('dimension', (_c = series.tooltipHelper) === null || _c === void 0 ? void 0 : _c.spec)) {
90359
- continue;
90360
- }
90361
- const contentPatterns = (_d = patternContent === null || patternContent === void 0 ? void 0 : patternContent.filter(c => isNil$1(c.seriesId) || c.seriesId === series.id)) !== null && _d !== void 0 ? _d : [];
90362
- for (const datum of datumList) {
90363
- for (const linePattern of contentPatterns) {
90364
- const oneLineData = getOneLineData(datum, linePattern, params);
90365
- if (oneLineData.visible === false) {
90366
- continue;
90367
- }
90368
- if (tooltipActualTitleContent.content.length === maxLineCount - 1) {
90369
- tooltipActualTitleContent.content.push(Object.assign(Object.assign({}, oneLineData), othersLine));
90370
- break;
90371
- }
90372
- else if (tooltipActualTitleContent.content.length < maxLineCount) {
90373
- tooltipActualTitleContent.content.push(oneLineData);
90374
- }
90375
- else {
90376
- break;
90377
- }
90378
- }
90379
- if (tooltipActualTitleContent.content.length >= maxLineCount) {
90380
- break;
90381
- }
90382
- }
90383
- if (tooltipActualTitleContent.content.length >= maxLineCount) {
90384
- break;
90385
- }
90386
- }
90387
- if (tooltipActualTitleContent.content.length >= maxLineCount) {
90388
- break;
90389
- }
90390
- }
90391
- break;
90392
- }
90393
- if (tooltipActualTitleContent.title) {
90394
- if (tooltipActualTitleContent.content.length > 0 && tooltipActualTitleContent.content[0].shapeType) {
90395
- if (isNil$1(tooltipActualTitleContent.title.shapeType)) {
90396
- tooltipActualTitleContent.title.shapeType = tooltipActualTitleContent.content[0].shapeType;
90397
- }
90398
- if (isNil$1(tooltipActualTitleContent.title.shapeColor)) {
90399
- tooltipActualTitleContent.title.shapeColor = tooltipActualTitleContent.content[0].shapeColor;
90400
- }
90401
- }
90402
- else {
90403
- tooltipActualTitleContent.title.hasShape = false;
90404
- }
90405
- }
90406
- return tooltipActualTitleContent;
90407
- };
90408
- const getOneLineData = (datum, config, params) => {
90409
- const key = getTimeString(getTooltipContentValue(config.key, datum, params, config.keyFormatter), config.keyTimeFormat, config.keyTimeFormatMode);
90410
- const value = getTimeString(getTooltipContentValue(config.value, datum, params, config.valueFormatter), config.valueTimeFormat, config.valueTimeFormatMode);
90411
- const visible = getTooltipContentValue(config.visible, datum, params) !== false && (isValid$1(key) || isValid$1(value));
90412
- const isKeyAdaptive = getTooltipContentValue(config.isKeyAdaptive, datum, params);
90413
- const spaceRow = getTooltipContentValue(config.spaceRow, datum, params);
90414
- const shapeType = getTooltipContentValue(config.shapeType, datum, params);
90415
- const shapeColor = getTooltipContentValue(config.shapeColor, datum, params);
90416
- const shapeFill = getTooltipContentValue(config.shapeFill, datum, params);
90417
- const shapeStroke = getTooltipContentValue(config.shapeStroke, datum, params);
90418
- const shapeLineWidth = getTooltipContentValue(config.shapeLineWidth, datum, params);
90419
- const shapeHollow = getTooltipContentValue(config.shapeHollow, datum, params);
90420
- const keyStyle = getTooltipContentValue(config.keyStyle, datum, params);
90421
- const valueStyle = getTooltipContentValue(config.valueStyle, datum, params);
90422
- return {
90423
- key,
90424
- value,
90425
- visible,
90426
- isKeyAdaptive,
90427
- hasShape: config.hasShape,
90428
- shapeType,
90429
- shapeFill,
90430
- shapeStroke,
90431
- shapeLineWidth,
90432
- shapeHollow,
90433
- shapeColor,
90434
- keyStyle,
90435
- valueStyle,
90436
- spaceRow,
90437
- datum
90438
- };
90439
- };
90107
+ const DEFAULT_SHOW_DELAY = 50;
90440
90108
 
90441
90109
  class BaseTooltipProcessor {
90442
90110
  constructor(component) {
@@ -90448,17 +90116,16 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90448
90116
  if (!params.changePositionOnly) {
90449
90117
  this.clearCache();
90450
90118
  }
90451
- this._updateViewSpec(params);
90452
- const spec = this._cacheViewSpec;
90453
- if (isNil$1(spec === null || spec === void 0 ? void 0 : spec[this.activeType]) || spec.visible === false) {
90119
+ this._updateViewSpec(data, params);
90120
+ const spec = this._cacheActiveSpec;
90121
+ if (isNil$1(spec) || spec.visible === false) {
90454
90122
  return 1;
90455
90123
  }
90456
- params.tooltipSpec = spec;
90457
- this._updateActualTooltip(data, params);
90458
- params.tooltipActual = this._cacheActualTooltip;
90459
- const { title, content } = this._cacheActualTooltip;
90124
+ params.tooltipSpec = this.component.getSpec();
90125
+ params.activeTooltipSpec = spec;
90126
+ const { title, content } = spec;
90460
90127
  const isEmpty = isNil$1(title === null || title === void 0 ? void 0 : title.key) && isNil$1(title === null || title === void 0 ? void 0 : title.value) && !(content === null || content === void 0 ? void 0 : content.length);
90461
- this.component.event.emit(ChartEvent.tooltipShow, Object.assign(Object.assign({}, params), { isEmptyTooltip: isNil$1(title === null || title === void 0 ? void 0 : title.key) && isNil$1(title === null || title === void 0 ? void 0 : title.value) && !(content === null || content === void 0 ? void 0 : content.length), tooltipData: data, activeType: this.activeType, tooltip: this.component }));
90128
+ this.component.event.emit(ChartEvent.tooltipShow, Object.assign(Object.assign({}, params), { isEmptyTooltip: isEmpty, tooltipData: data, activeType: this.activeType, tooltip: this.component }));
90462
90129
  if (isEmpty) {
90463
90130
  return 1;
90464
90131
  }
@@ -90489,23 +90156,38 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90489
90156
  }
90490
90157
  return undefined;
90491
90158
  }
90492
- _updateViewSpec(params) {
90493
- const { changePositionOnly, model, dimensionInfo } = params;
90494
- if (!changePositionOnly || !this._cacheViewSpec) {
90495
- this._cacheViewSpec = getTooltipSpecForShow(this.activeType, this.component.getSpec(), model, dimensionInfo);
90496
- }
90497
- }
90498
- _updateActualTooltip(data, params) {
90499
- var _a, _b, _c, _d;
90500
- const pattern = this._cacheViewSpec[this.activeType];
90501
- const { changePositionOnly } = params;
90502
- if (!changePositionOnly || !this._cacheActualTooltip) {
90503
- const tooltipContent = getShowContent(pattern, data, params);
90504
- const visible = isValid$1(tooltipContent) ? getTooltipPatternValue(pattern.visible, data, params) !== false : false;
90505
- this._cacheActualTooltip = Object.assign(Object.assign({}, tooltipContent), { visible, activeType: pattern.activeType, data });
90506
- const { title, content } = this._cacheActualTooltip;
90507
- this._cacheActualTooltip.title = (_b = (_a = pattern.updateTitle) === null || _a === void 0 ? void 0 : _a.call(pattern, title, data, params)) !== null && _b !== void 0 ? _b : title;
90508
- this._cacheActualTooltip.content = (_d = (_c = pattern.updateContent) === null || _c === void 0 ? void 0 : _c.call(pattern, content, data, params)) !== null && _d !== void 0 ? _d : content;
90159
+ _updateViewSpec(data, params) {
90160
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
90161
+ const { changePositionOnly, model } = params;
90162
+ if (!changePositionOnly || !this._cacheActiveSpec) {
90163
+ const tooltipSpec = this.component.getSpec();
90164
+ this._cacheActiveSpec = getTooltipSpecForShow(this.activeType, this.component.getSpec(), model, data, params);
90165
+ if (this._cacheActiveSpec) {
90166
+ if (isNil$1(this._cacheActiveSpec.handler) && isValid$1(tooltipSpec.handler)) {
90167
+ this._cacheActiveSpec.handler = tooltipSpec.handler;
90168
+ }
90169
+ const specByType = (_a = tooltipSpec[this.activeType]) !== null && _a !== void 0 ? _a : {};
90170
+ const updateTitle = (_b = this._cacheActiveSpec.updateTitle) !== null && _b !== void 0 ? _b : specByType.updateTitle;
90171
+ const updateContent = (_c = this._cacheActiveSpec.updateContent) !== null && _c !== void 0 ? _c : specByType.updateContent;
90172
+ const maxLineCount = (_e = (_d = this._cacheActiveSpec.maxLineCount) !== null && _d !== void 0 ? _d : specByType.maxLineCount) !== null && _e !== void 0 ? _e : TOOLTIP_MAX_LINE_COUNT;
90173
+ if (updateTitle) {
90174
+ this._cacheActiveSpec.title =
90175
+ (_f = updateTitle(this._cacheActiveSpec.title, data, params)) !== null && _f !== void 0 ? _f : this._cacheActiveSpec.title;
90176
+ }
90177
+ if (updateContent) {
90178
+ this._cacheActiveSpec.content =
90179
+ (_g = updateContent(this._cacheActiveSpec.content, data, params)) !== null && _g !== void 0 ? _g : this._cacheActiveSpec.content;
90180
+ }
90181
+ else if (maxLineCount >= 1 && ((_h = this._cacheActiveSpec.content) === null || _h === void 0 ? void 0 : _h.length) > maxLineCount) {
90182
+ const othersLine = (_j = this._cacheActiveSpec.othersLine) !== null && _j !== void 0 ? _j : specByType.othersLine;
90183
+ const otherLine = othersLine
90184
+ ? Object.assign(Object.assign({}, TOOLTIP_OTHERS_LINE), othersLine) : TOOLTIP_OTHERS_LINE;
90185
+ this._cacheActiveSpec.content = [
90186
+ ...this._cacheActiveSpec.content.slice(0, maxLineCount - 1),
90187
+ Object.assign(Object.assign({}, this._cacheActiveSpec.content[maxLineCount - 1]), otherLine)
90188
+ ];
90189
+ }
90190
+ }
90509
90191
  }
90510
90192
  }
90511
90193
  shouldHandleTooltip(params, info) {
@@ -90516,8 +90198,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90516
90198
  return isActiveTypeVisible(this.activeType, (_b = (_a = params.model) === null || _a === void 0 ? void 0 : _a.tooltipHelper) === null || _b === void 0 ? void 0 : _b.spec);
90517
90199
  }
90518
90200
  clearCache() {
90519
- this._cacheViewSpec = undefined;
90520
- this._cacheActualTooltip = undefined;
90201
+ this._cacheActiveSpec = undefined;
90521
90202
  }
90522
90203
  }
90523
90204
 
@@ -90615,14 +90296,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90615
90296
  const helper = series.tooltipHelper;
90616
90297
  const activeTriggers = helper === null || helper === void 0 ? void 0 : helper.activeTriggerSet.mark;
90617
90298
  const ignoreTriggers = helper === null || helper === void 0 ? void 0 : helper.ignoreTriggerSet.mark;
90618
- if ((activeTriggers === null || activeTriggers === void 0 ? void 0 : activeTriggers.has(params.model)) || (activeTriggers === null || activeTriggers === void 0 ? void 0 : activeTriggers.has(params.mark))) {
90299
+ if (activeTriggers === null || activeTriggers === void 0 ? void 0 : activeTriggers.has(params.mark)) {
90619
90300
  info = {
90620
90301
  mark: params.mark,
90621
90302
  datum: params.datum,
90622
90303
  series
90623
90304
  };
90624
90305
  }
90625
- else if ((ignoreTriggers === null || ignoreTriggers === void 0 ? void 0 : ignoreTriggers.has(params.model)) || (ignoreTriggers === null || ignoreTriggers === void 0 ? void 0 : ignoreTriggers.has(params.mark))) {
90306
+ else if (ignoreTriggers === null || ignoreTriggers === void 0 ? void 0 : ignoreTriggers.has(params.mark)) {
90626
90307
  ignore = true;
90627
90308
  }
90628
90309
  }
@@ -90651,7 +90332,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90651
90332
  const series = params.model;
90652
90333
  const helper = series.tooltipHelper;
90653
90334
  const activeTriggers = helper === null || helper === void 0 ? void 0 : helper.activeTriggerSet.group;
90654
- if ((activeTriggers === null || activeTriggers === void 0 ? void 0 : activeTriggers.has(params.model)) || (activeTriggers === null || activeTriggers === void 0 ? void 0 : activeTriggers.has(params.mark))) {
90335
+ if (activeTriggers === null || activeTriggers === void 0 ? void 0 : activeTriggers.has(params.mark)) {
90655
90336
  const patternSpec = this.component.getSpec()[this.activeType];
90656
90337
  const triggerMark = (patternSpec === null || patternSpec === void 0 ? void 0 : patternSpec.triggerMark) ? array(patternSpec.triggerMark) : [];
90657
90338
  if (triggerMark.includes((_b = params.mark) === null || _b === void 0 ? void 0 : _b.name)) {
@@ -90712,12 +90393,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90712
90393
  spec.transitionDuration = (_f = spec.transitionDuration) !== null && _f !== void 0 ? _f : 150;
90713
90394
  spec.triggerOff = (_g = spec.triggerOff) !== null && _g !== void 0 ? _g : spec.trigger;
90714
90395
  spec.confine = (_h = spec.confine) !== null && _h !== void 0 ? _h : spec.renderMode === 'canvas';
90715
- if (isValid$1(spec.mark)) {
90716
- spec.mark.activeType = 'mark';
90717
- }
90718
- if (isValid$1(spec.dimension)) {
90719
- spec.dimension.activeType = 'dimension';
90720
- }
90721
90396
  if (isValid$1(spec.parentElement)) {
90722
90397
  if (isString$1(spec.parentElement)) {
90723
90398
  spec.parentElement = vglobal.getElementById(spec.parentElement);
@@ -90740,7 +90415,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90740
90415
  this.layoutType = 'none';
90741
90416
  this._alwaysShow = false;
90742
90417
  this._eventList = [];
90743
- this._isTooltipShown = false;
90744
90418
  this._clickLock = false;
90745
90419
  this._mountEvent = (eType, query, callback) => {
90746
90420
  this.event.on(eType, query, callback);
@@ -90759,22 +90433,23 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90759
90433
  }
90760
90434
  };
90761
90435
  this._getMouseOutHandler = (needPointerDetection) => (params) => {
90762
- var _a, _b, _c;
90436
+ var _a, _b, _c, _d;
90763
90437
  if (this._alwaysShow || this._clickLock) {
90764
90438
  return;
90765
90439
  }
90766
- if (!this._isTooltipShown && !((_b = (_a = this.tooltipHandler) === null || _a === void 0 ? void 0 : _a.isTooltipShown) === null || _b === void 0 ? void 0 : _b.call(_a))) {
90440
+ if (!((_b = (_a = this.tooltipHandler) === null || _a === void 0 ? void 0 : _a.isTooltipShown) === null || _b === void 0 ? void 0 : _b.call(_a))) {
90767
90441
  return;
90768
90442
  }
90769
90443
  const browserEnv = isTrueBrowser((_c = this._option) === null || _c === void 0 ? void 0 : _c.mode);
90770
90444
  const { clientX, clientY } = params.event;
90771
- if (browserEnv && this._isPointerOnTooltip(params)) {
90772
- return;
90773
- }
90774
90445
  if (browserEnv && needPointerDetection && this._isPointerInChart({ x: clientX, y: clientY })) {
90775
90446
  return;
90776
90447
  }
90777
- this._handleChartMouseOut(params);
90448
+ if (this._enterable) {
90449
+ this._outTimer = setTimeout(() => {
90450
+ this._handleChartMouseOut(params);
90451
+ }, (_d = this._spec.showDelay) !== null && _d !== void 0 ? _d : DEFAULT_SHOW_DELAY);
90452
+ }
90778
90453
  };
90779
90454
  this._handleChartMouseOut = (params) => {
90780
90455
  if (this._alwaysShow) {
@@ -90782,12 +90457,18 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90782
90457
  }
90783
90458
  if (this._spec.triggerOff !== 'none') {
90784
90459
  this._hideTooltipByHandler(Object.assign(Object.assign({}, params), { tooltip: this }));
90460
+ this._cacheEnterableRect = null;
90785
90461
  this._cacheInfo = undefined;
90786
90462
  this._cacheParams = undefined;
90787
90463
  this._cacheActiveType = undefined;
90788
90464
  }
90789
90465
  };
90790
90466
  this._getMouseMoveHandler = (isClick) => (params) => {
90467
+ var _a;
90468
+ if (this._outTimer) {
90469
+ clearTimeout(this._outTimer);
90470
+ this._outTimer = null;
90471
+ }
90791
90472
  if (!this.tooltipHandler) {
90792
90473
  this._initHandler();
90793
90474
  }
@@ -90797,9 +90478,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90797
90478
  if (this._alwaysShow) {
90798
90479
  return;
90799
90480
  }
90800
- if (this._isPointerOnTooltip(params)) {
90801
- return;
90802
- }
90803
90481
  if (this._clickLock) {
90804
90482
  if (isClick) {
90805
90483
  this._handleChartMouseOut(params);
@@ -90807,8 +90485,21 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90807
90485
  }
90808
90486
  return;
90809
90487
  }
90488
+ if (!isClick && this._enterable && this.isTooltipShown()) {
90489
+ if (this._showTimer) {
90490
+ clearTimeout(this._showTimer);
90491
+ }
90492
+ this._showTimer = setTimeout(() => {
90493
+ this._handleChartMouseMove(params, isClick);
90494
+ }, (_a = this._spec.showDelay) !== null && _a !== void 0 ? _a : DEFAULT_SHOW_DELAY);
90495
+ }
90496
+ else {
90497
+ this._handleChartMouseMove(params, isClick);
90498
+ }
90499
+ };
90500
+ this._handleChartMouseMove = (params, isClick) => {
90810
90501
  const mouseEventData = this._getMouseEventData(params);
90811
- const { tooltipInfo: { dimension: dimensionInfo }, ignore: { mark: ignoreMark, dimension: ignoreDimension } } = mouseEventData;
90502
+ const { tooltipInfo: { dimension: dimensionInfo }, ignore: { mark: ignoreMark } } = mouseEventData;
90812
90503
  const success = {
90813
90504
  mark: false,
90814
90505
  dimension: false,
@@ -90833,6 +90524,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90833
90524
  if (!success.mark && !success.group && (!success.dimension || isNil$1(dimensionInfo))) {
90834
90525
  this._handleChartMouseOut(params);
90835
90526
  }
90527
+ else {
90528
+ this._initEventOfTooltipContent();
90529
+ }
90836
90530
  };
90837
90531
  this._showTooltipByMouseEvent = (activeType, mouseEventData, params, isClick, useCache) => {
90838
90532
  var _a;
@@ -90840,8 +90534,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90840
90534
  if (!processor.shouldHandleTooltip(params, mouseEventData.tooltipInfo[activeType])) {
90841
90535
  return false;
90842
90536
  }
90843
- if (this._timer) {
90844
- clearTimeout(this._timer);
90537
+ if (this._hideTimer) {
90538
+ clearTimeout(this._hideTimer);
90845
90539
  }
90846
90540
  let success;
90847
90541
  if (useCache) {
@@ -90858,12 +90552,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90858
90552
  }
90859
90553
  }
90860
90554
  if (success) {
90861
- this._isTooltipShown = true;
90862
90555
  if (isClick && this._spec.lockAfterClick && !this._clickLock) {
90863
90556
  this._clickLock = true;
90864
90557
  }
90865
90558
  else if (Number.isFinite(this._spec.hideTimer)) {
90866
- this._timer = setTimeout(() => {
90559
+ this._hideTimer = setTimeout(() => {
90867
90560
  this._handleChartMouseOut();
90868
90561
  }, this._spec.hideTimer);
90869
90562
  }
@@ -90888,7 +90581,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90888
90581
  };
90889
90582
  this._hideTooltipByHandler = (params) => {
90890
90583
  var _a, _b, _c;
90891
- if (!this._isTooltipShown && !((_b = (_a = this.tooltipHandler) === null || _a === void 0 ? void 0 : _a.isTooltipShown) === null || _b === void 0 ? void 0 : _b.call(_a))) {
90584
+ if (!((_b = (_a = this.tooltipHandler) === null || _a === void 0 ? void 0 : _a.isTooltipShown) === null || _b === void 0 ? void 0 : _b.call(_a))) {
90892
90585
  return 0;
90893
90586
  }
90894
90587
  this.event.emit(ChartEvent.tooltipHide, Object.assign(Object.assign({}, params), { source: Event_Source_Type.chart, tooltip: this }));
@@ -90897,17 +90590,25 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90897
90590
  });
90898
90591
  const handler = (_c = this._spec.handler) !== null && _c !== void 0 ? _c : this.tooltipHandler;
90899
90592
  if (handler.hideTooltip) {
90900
- const result = handler.hideTooltip.call(handler, params);
90901
- if (!result) {
90902
- this._isTooltipShown = false;
90903
- }
90904
- return result;
90593
+ return handler.hideTooltip.call(handler, params);
90905
90594
  }
90906
90595
  return 1;
90907
90596
  };
90597
+ this.hideTooltip = () => {
90598
+ const params = {
90599
+ changePositionOnly: false,
90600
+ tooltip: this,
90601
+ item: undefined,
90602
+ datum: undefined,
90603
+ source: Event_Source_Type.chart
90604
+ };
90605
+ this._alwaysShow = false;
90606
+ return !this._hideTooltipByHandler(params);
90607
+ };
90908
90608
  }
90909
90609
  isTooltipShown() {
90910
- return this._isTooltipShown;
90610
+ var _a, _b;
90611
+ return (_b = (_a = this.tooltipHandler) === null || _a === void 0 ? void 0 : _a.isTooltipShown) === null || _b === void 0 ? void 0 : _b.call(_a);
90911
90612
  }
90912
90613
  changeRegions(regions) {
90913
90614
  }
@@ -90932,15 +90633,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90932
90633
  release() {
90933
90634
  var _a, _b;
90934
90635
  super.release();
90935
- if (this._timer) {
90936
- clearTimeout(this._timer);
90636
+ if (this._hideTimer) {
90637
+ clearTimeout(this._hideTimer);
90937
90638
  }
90938
90639
  this._eventList.forEach(({ eventType, handler }) => {
90939
90640
  this.event.off(eventType, handler);
90940
90641
  });
90941
90642
  this._eventList = [];
90942
90643
  (_b = (_a = this.tooltipHandler) === null || _a === void 0 ? void 0 : _a.release) === null || _b === void 0 ? void 0 : _b.call(_a);
90943
- this._isTooltipShown = false;
90944
90644
  }
90945
90645
  beforeRelease() {
90946
90646
  this.event.emit(ChartEvent.tooltipHide, {
@@ -90958,6 +90658,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90958
90658
  const userTooltipHandler = this._option.globalInstance.getTooltipHandlerByUser();
90959
90659
  if (userTooltipHandler) {
90960
90660
  this.tooltipHandler = userTooltipHandler;
90661
+ this._enterable = false;
90961
90662
  }
90962
90663
  else {
90963
90664
  const type = renderMode === 'canvas' ? TooltipHandlerType.canvas : TooltipHandlerType.dom;
@@ -90969,6 +90670,50 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90969
90670
  handler.name = `${this._spec.className}-${(_b = this._option.globalInstance.id) !== null && _b !== void 0 ? _b : 0}-${this.getSpecIndex()}`;
90970
90671
  (_c = this.pluginService) === null || _c === void 0 ? void 0 : _c.load([handler]);
90971
90672
  this.tooltipHandler = handler;
90673
+ if (this._spec.enterable && renderMode === 'html' && this.tooltipHandler) {
90674
+ this._enterable = true;
90675
+ this._needInitEventOfTooltip = true;
90676
+ }
90677
+ else {
90678
+ this._enterable = false;
90679
+ }
90680
+ }
90681
+ }
90682
+ _initEventOfTooltipContent() {
90683
+ var _a, _b;
90684
+ if (!this._needInitEventOfTooltip || !this._enterable) {
90685
+ return;
90686
+ }
90687
+ const container = (_b = (_a = this.tooltipHandler).getTooltipContainer) === null || _b === void 0 ? void 0 : _b.call(_a);
90688
+ const element = container === null || container === void 0 ? void 0 : container.firstChild;
90689
+ if (element) {
90690
+ element.addEventListener('mouseenter', () => {
90691
+ var _a;
90692
+ const rect = (_a = element.getBoundingClientRect) === null || _a === void 0 ? void 0 : _a.call(element);
90693
+ if (rect) {
90694
+ this._cacheEnterableRect = { x: rect.x, y: rect.y, width: rect.width, height: rect.height };
90695
+ }
90696
+ if (this._outTimer) {
90697
+ clearTimeout(this._outTimer);
90698
+ this._outTimer = null;
90699
+ }
90700
+ if (this._showTimer) {
90701
+ clearTimeout(this._showTimer);
90702
+ this._showTimer = null;
90703
+ }
90704
+ });
90705
+ element.addEventListener('mouseleave', () => {
90706
+ var _a, _b;
90707
+ if (this._cacheEnterableRect) {
90708
+ const newRect = (_a = element.getBoundingClientRect) === null || _a === void 0 ? void 0 : _a.call(element);
90709
+ if (newRect &&
90710
+ Object.keys(this._cacheEnterableRect).every(k => this._cacheEnterableRect[k] === newRect[k])) {
90711
+ this._cacheEnterableRect = null;
90712
+ this._outTimer = setTimeout(this.hideTooltip, (_b = this._spec.showDelay) !== null && _b !== void 0 ? _b : DEFAULT_SHOW_DELAY);
90713
+ }
90714
+ }
90715
+ });
90716
+ this._needInitEventOfTooltip = false;
90972
90717
  }
90973
90718
  }
90974
90719
  _initProcessor() {
@@ -90997,7 +90742,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90997
90742
  this._mountEvent('pointerdown', { source: 'chart' }, this._getMouseMoveHandler(false));
90998
90743
  this._mountEvent('pointerup', { source: 'window' }, this._getMouseOutHandler(true));
90999
90744
  }
91000
- this._mountEvent('pointerout', { source: 'canvas' }, this._getMouseOutHandler(false));
90745
+ this._mountEvent('pointerleave', { source: 'canvas' }, this._getMouseOutHandler(false));
91001
90746
  }
91002
90747
  if (trigger.includes('click')) {
91003
90748
  this._mountEvent('pointertap', { source: 'chart' }, this._getMouseMoveHandler(true));
@@ -91034,17 +90779,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91034
90779
  }
91035
90780
  return result;
91036
90781
  }
91037
- hideTooltip() {
91038
- const params = {
91039
- changePositionOnly: false,
91040
- tooltip: this,
91041
- item: undefined,
91042
- datum: undefined,
91043
- source: Event_Source_Type.chart
91044
- };
91045
- this._alwaysShow = false;
91046
- return !this._hideTooltipByHandler(params);
91047
- }
91048
90782
  _isSameAsCache(nextInfo, nextParams, nextActiveType) {
91049
90783
  if (nextActiveType !== this._cacheActiveType) {
91050
90784
  return false;
@@ -91101,28 +90835,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91101
90835
  }
91102
90836
  return false;
91103
90837
  }
91104
- _isPointerOnTooltip(params) {
91105
- var _a, _b;
91106
- if (this._spec.enterable && this._spec.renderMode === 'html') {
91107
- const { event } = params;
91108
- let newTarget;
91109
- if (isValid$1(event.nativeEvent)) {
91110
- const nativeEvent = event.nativeEvent;
91111
- newTarget = nativeEvent.relatedTarget;
91112
- if (nativeEvent.composedPath && nativeEvent.composedPath().length > 0) {
91113
- newTarget = nativeEvent.composedPath()[0];
91114
- }
91115
- }
91116
- else {
91117
- newTarget = event.relatedTarget;
91118
- }
91119
- const container = (_b = (_a = this.tooltipHandler) === null || _a === void 0 ? void 0 : _a.getTooltipContainer) === null || _b === void 0 ? void 0 : _b.call(_a);
91120
- if (isValid$1(container) && isValid$1(newTarget) && hasParentElement(newTarget, container)) {
91121
- return true;
91122
- }
91123
- }
91124
- return false;
91125
- }
91126
90838
  getVisible() {
91127
90839
  return this._spec.visible !== false;
91128
90840
  }
@@ -93107,19 +92819,19 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
93107
92819
  var _a;
93108
92820
  super.setAttrFromSpec();
93109
92821
  if (this._spec.roamZoom === true || this._spec.roamZoom) {
93110
- this._zoomAttr = merge$2({}, this._zoomAttr, this._spec.roamZoom);
92822
+ this._zoomAttr = merge$1({}, this._zoomAttr, this._spec.roamZoom);
93111
92823
  }
93112
92824
  else {
93113
92825
  this._zoomAttr.enable = false;
93114
92826
  }
93115
92827
  if (this._spec.roamDrag === true || this._spec.roamDrag) {
93116
- this._dragAttr = merge$2({}, this._dragAttr, this._spec.roamDrag);
92828
+ this._dragAttr = merge$1({}, this._dragAttr, this._spec.roamDrag);
93117
92829
  }
93118
92830
  else {
93119
92831
  this._dragAttr.enable = false;
93120
92832
  }
93121
92833
  if (this._spec.roamScroll === true || this._spec.roamScroll) {
93122
- this._scrollAttr = merge$2({}, this._scrollAttr, this._spec.roamScroll);
92834
+ this._scrollAttr = merge$1({}, this._scrollAttr, this._spec.roamScroll);
93123
92835
  }
93124
92836
  else {
93125
92837
  this._scrollAttr.enable = false;
@@ -98778,27 +98490,26 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
98778
98490
  return result;
98779
98491
  };
98780
98492
  const positionType = {
98781
- left: ['left', 'center'],
98782
- right: ['right', 'center'],
98783
- top: ['center', 'top'],
98784
- lt: ['left', 'top'],
98785
- tl: ['left', 'top'],
98786
- rt: ['right', 'top'],
98787
- tr: ['right', 'top'],
98788
- bottom: ['center', 'bottom'],
98789
- bl: ['left', 'bottom'],
98790
- lb: ['left', 'bottom'],
98791
- br: ['right', 'bottom'],
98792
- rb: ['right', 'bottom'],
98793
- inside: ['center', 'center'],
98794
- center: ['center', 'center'],
98795
- centerBottom: ['center', 'centerBottom'],
98796
- centerTop: ['center', 'centerTop'],
98797
- centerLeft: ['centerLeft', 'center'],
98798
- centerRight: ['centerRight', 'center']
98799
- };
98800
- 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; };
98801
- 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; };
98493
+ left: [-2, 0],
98494
+ right: [2, 0],
98495
+ top: [0, -2],
98496
+ lt: [-2, -2],
98497
+ tl: [-2, -2],
98498
+ rt: [2, -2],
98499
+ tr: [2, -2],
98500
+ bottom: [0, 2],
98501
+ bl: [-2, 2],
98502
+ lb: [-2, 2],
98503
+ br: [2, 2],
98504
+ rb: [2, 2],
98505
+ inside: [0, 0],
98506
+ center: [0, 0],
98507
+ centerBottom: [0, 1],
98508
+ centerTop: [0, -1],
98509
+ centerLeft: [-1, 0],
98510
+ centerRight: [1, 0]
98511
+ };
98512
+ const getPositionType = (position, dim, defaultCase = 2) => { var _a, _b; return (_b = (_a = positionType[position]) === null || _a === void 0 ? void 0 : _a[dim === 'x' ? 0 : 1]) !== null && _b !== void 0 ? _b : defaultCase; };
98802
98513
  const getCartesianCrosshairRect = (dimensionData, layoutStartPoint) => {
98803
98514
  var _a;
98804
98515
  const currValueX = new Map();
@@ -98927,10 +98638,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
98927
98638
  let panelHeight = paddingSpec.top + paddingSpec.bottom;
98928
98639
  let panelDomHeight = paddingSpec.top + paddingSpec.bottom;
98929
98640
  let contentMaxWidth = 0;
98930
- const filteredContent = content.filter(item => {
98931
- return (item.key || item.value) && item.visible !== false;
98932
- });
98933
- const hasContent = !!filteredContent.length;
98641
+ const hasContent = !!content.length;
98934
98642
  let maxKeyWidth = 0;
98935
98643
  let maxAdaptiveKeyWidth = 0;
98936
98644
  let maxValueWidth = 0;
@@ -98941,9 +98649,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
98941
98649
  const valueWidths = [];
98942
98650
  const shapeWidths = [];
98943
98651
  let contentHeight = 0;
98944
- attributes.content = filteredContent.map((item, i) => {
98652
+ attributes.content = content.map((item, i) => {
98945
98653
  let itemHeight = 0;
98946
- 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, shapeHollow: actualShapeHollow, shapeColor: actualShapeColor } = item;
98654
+ 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, shapeHollow: actualShapeHollow } = item;
98947
98655
  const itemAttrs = { height: 0, spaceRow: actualSpaceRow !== null && actualSpaceRow !== void 0 ? actualSpaceRow : commonSpaceRow };
98948
98656
  if (isValid$1(actualKey)) {
98949
98657
  const itemKeyStyle = mergeSpec({}, keyStyle, getTextAttributes(actualKeyStyle, undefined, {}));
@@ -98971,14 +98679,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
98971
98679
  visible: true,
98972
98680
  symbolType: actualShapeType
98973
98681
  };
98974
- const adaptiveShapeFill = actualShapeFill !== null && actualShapeFill !== void 0 ? actualShapeFill : actualShapeColor;
98975
98682
  if (actualShapeHollow) {
98976
- shape.stroke = adaptiveShapeFill;
98683
+ shape.stroke = actualShapeFill;
98977
98684
  }
98978
98685
  else {
98979
- shape.fill = adaptiveShapeFill;
98686
+ shape.fill = actualShapeFill;
98980
98687
  }
98981
- shape.stroke = actualShapeStroke !== null && actualShapeStroke !== void 0 ? actualShapeStroke : adaptiveShapeFill;
98688
+ shape.stroke = actualShapeStroke !== null && actualShapeStroke !== void 0 ? actualShapeStroke : actualShapeFill;
98982
98689
  shape.lineWidth = actualShapeLineWidth;
98983
98690
  itemAttrs.shape = shape;
98984
98691
  const shapeWidth = actualShapeSize !== null && actualShapeSize !== void 0 ? actualShapeSize : shapeStyle.size;
@@ -98990,7 +98697,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
98990
98697
  }
98991
98698
  itemAttrs.height = itemHeight;
98992
98699
  contentHeight += itemHeight;
98993
- if (i < filteredContent.length - 1) {
98700
+ if (i < content.length - 1) {
98994
98701
  contentHeight += itemAttrs.spaceRow;
98995
98702
  }
98996
98703
  return itemAttrs;
@@ -99080,52 +98787,37 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
99080
98787
  return 1;
99081
98788
  }
99082
98789
  if (!visible) {
99083
- this._clearAllCache();
99084
98790
  this._updateTooltip(false, params);
99085
98791
  return 0;
99086
98792
  }
99087
98793
  return this._changeTooltipPosition(params, data);
99088
98794
  };
99089
98795
  this._changeTooltipPosition = (params, data) => {
99090
- var _a, _b, _c;
98796
+ var _a, _b, _c, _d, _e;
99091
98797
  if (this._isReleased) {
99092
98798
  return 1;
99093
98799
  }
99094
98800
  const event = params.event;
99095
- const { tooltipSpec, tooltipActual, changePositionOnly } = params;
99096
- if (tooltipSpec.enterable) {
99097
- if (!this._isPointerEscaped && this._isPointerMovingToTooltip(params)) {
99098
- if (!this._isTooltipPaused) {
99099
- this._isTooltipPaused = true;
99100
- this._cachePointerTimer = setTimeout(() => {
99101
- this._isPointerEscaped = true;
99102
- }, 300);
99103
- }
99104
- return 0;
99105
- }
99106
- this._isTooltipPaused = false;
99107
- this._isPointerEscaped = false;
99108
- clearTimeout(this._cachePointerTimer);
99109
- this._cachePointerPosition = this._getPointerPositionRelativeToTooltipParent(params);
99110
- }
99111
- const activeType = tooltipActual.activeType;
99112
- if (tooltipSpec.handler) {
99113
- return (_c = (_b = (_a = tooltipSpec.handler).showTooltip) === null || _b === void 0 ? void 0 : _b.call(_a, activeType, data, params)) !== null && _c !== void 0 ? _c : 0;
99114
- }
99115
- const pattern = tooltipSpec[activeType];
99116
- if (!pattern) {
98801
+ const { tooltipSpec, activeTooltipSpec, changePositionOnly } = params;
98802
+ if (!activeTooltipSpec) {
99117
98803
  return 1;
99118
98804
  }
99119
- const position = this._getActualTooltipPosition(tooltipActual, params, this._getTooltipBoxSize(tooltipActual, changePositionOnly));
99120
- tooltipActual.position = position;
99121
- if (pattern.updatePosition) {
99122
- tooltipActual.position = pattern.updatePosition(tooltipActual.position, data, params);
98805
+ const activeType = activeTooltipSpec.activeType;
98806
+ if (activeTooltipSpec.handler) {
98807
+ return (_c = (_b = (_a = activeTooltipSpec.handler).showTooltip) === null || _b === void 0 ? void 0 : _b.call(_a, activeType, data, params)) !== null && _c !== void 0 ? _c : 0;
98808
+ }
98809
+ const pattern = activeTooltipSpec;
98810
+ const position = this._getActualTooltipPosition(activeTooltipSpec, params, this._getTooltipBoxSize(activeTooltipSpec, changePositionOnly));
98811
+ activeTooltipSpec.position = position;
98812
+ const updatePosition = (_d = activeTooltipSpec.updatePosition) !== null && _d !== void 0 ? _d : (_e = tooltipSpec[activeType]) === null || _e === void 0 ? void 0 : _e.updatePosition;
98813
+ if (updatePosition) {
98814
+ activeTooltipSpec.position = updatePosition(activeTooltipSpec.position, data, params);
99123
98815
  }
99124
98816
  let tooltipVisible = (pattern === null || pattern === void 0 ? void 0 : pattern.visible) !== false;
99125
98817
  if (!data ||
99126
98818
  event.type === 'pointerout' ||
99127
- !tooltipActual.visible ||
99128
- (!tooltipActual.title && !tooltipActual.content)) {
98819
+ !activeTooltipSpec.visible ||
98820
+ (!activeTooltipSpec.title && !activeTooltipSpec.content)) {
99129
98821
  tooltipVisible = false;
99130
98822
  }
99131
98823
  this._updateTooltip(tooltipVisible, Object.assign(Object.assign({}, params), { changePositionOnly }));
@@ -99139,16 +98831,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
99139
98831
  y: Infinity
99140
98832
  };
99141
98833
  if (!tooltipSpec) {
99142
- this._cacheTooltipPosition = undefined;
99143
98834
  return invalidPosition;
99144
98835
  }
99145
98836
  const event = params.event;
99146
98837
  const { activeType, data } = actualTooltip;
99147
98838
  const firstDim = activeType === 'dimension' ? (_b = (_a = data[0]) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b[0] : data === null || data === void 0 ? void 0 : data[0];
99148
- let { offsetX, offsetY } = this._option;
98839
+ const { offsetX, offsetY } = this._option;
99149
98840
  const spec = tooltipSpec[activeType];
99150
- const position = getTooltipPatternValue(spec.position, data, params);
99151
- const positionMode = (_c = getTooltipPatternValue(spec.positionMode, data, params)) !== null && _c !== void 0 ? _c : (activeType === 'mark' ? 'mark' : 'pointer');
98841
+ const position = getTooltipPatternValue(spec === null || spec === void 0 ? void 0 : spec.position, data, params);
98842
+ const positionMode = (_c = getTooltipPatternValue(spec === null || spec === void 0 ? void 0 : spec.positionMode, data, params)) !== null && _c !== void 0 ? _c : (activeType === 'mark' ? 'mark' : 'pointer');
99152
98843
  const { width: tooltipBoxWidth = 0, height: tooltipBoxHeight = 0 } = tooltipBoxSize !== null && tooltipBoxSize !== void 0 ? tooltipBoxSize : {};
99153
98844
  const isCanvas = tooltipSpec.renderMode === 'canvas';
99154
98845
  const canvasRect = (_d = params === null || params === void 0 ? void 0 : params.chart) === null || _d === void 0 ? void 0 : _d.getCanvasRect();
@@ -99184,26 +98875,23 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
99184
98875
  containerSize.height = canvasHeight;
99185
98876
  }
99186
98877
  const tooltipSizeScale = tooltipParentElementScale / chartElementScale;
99187
- let left;
99188
- let top;
99189
- let right;
99190
- let bottom;
99191
- let pointerFixedPositionX = position;
99192
- let pointerFixedPositionY = position;
99193
- const processCartesianFixedPositionX = ({ orient, mode, offset }) => {
98878
+ const calcPos = {};
98879
+ const pointerFixedPosition = { x: position, y: position };
98880
+ const dimToPos = { x: ['left', 'right'], y: ['top', 'bottom'] };
98881
+ const processCartesianFixedPosition = ({ orient, mode, offset }, dim) => {
99194
98882
  var _a;
99195
- let x1;
99196
- let x2;
98883
+ let dim1;
98884
+ let dim2;
99197
98885
  const model = params.model;
99198
98886
  const startPoint = model === null || model === void 0 ? void 0 : model.getLayoutStartPoint();
99199
- offsetX = offset !== null && offset !== void 0 ? offset : offsetX;
98887
+ const dimOffset = offset !== null && offset !== void 0 ? offset : (dim === 'x' ? offsetX : offsetY);
99200
98888
  if (mode === 'mark') {
99201
98889
  isFixedPosition = true;
99202
98890
  const element = params.item;
99203
98891
  const bounds = element === null || element === void 0 ? void 0 : element.getBounds();
99204
98892
  if (bounds && startPoint) {
99205
- x1 = bounds.x1 + startPoint.x;
99206
- x2 = bounds.x2 + startPoint.x;
98893
+ dim1 = (dim === 'x' ? bounds.x1 : bounds.y1) + startPoint[dim];
98894
+ dim2 = (dim === 'x' ? bounds.x2 : bounds.y2) + startPoint[dim];
99207
98895
  }
99208
98896
  }
99209
98897
  else if (mode === 'crosshair' &&
@@ -99213,272 +98901,123 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
99213
98901
  isFixedPosition = true;
99214
98902
  const rect = getCartesianCrosshairRect(firstDim, startPoint);
99215
98903
  if (rect) {
99216
- x1 = rect.start.x;
99217
- x2 = rect.end.x;
98904
+ dim1 = rect.start[dim];
98905
+ dim2 = rect.end[dim];
99218
98906
  }
99219
98907
  }
99220
98908
  else {
99221
- pointerFixedPositionX = orient;
98909
+ pointerFixedPosition[dim] = orient;
99222
98910
  }
99223
98911
  if (isFixedPosition) {
99224
- switch (getHorizontalPositionType(orient)) {
99225
- case 'left':
99226
- left = x1 - tooltipBoxWidth * tooltipSizeScale - offsetX;
98912
+ const posKey = dimToPos[dim][0];
98913
+ const boxSize = dim === 'x' ? tooltipBoxWidth : tooltipBoxHeight;
98914
+ switch (getPositionType(orient, dim)) {
98915
+ case -2:
98916
+ calcPos[posKey] = dim1 - boxSize * tooltipSizeScale - dimOffset;
99227
98917
  break;
99228
- case 'right':
99229
- left = x2 + offsetX;
98918
+ case 0:
98919
+ calcPos[posKey] = (dim1 + dim2) / 2 - (boxSize * tooltipSizeScale) / 2;
99230
98920
  break;
99231
- case 'center':
99232
- left = (x1 + x2) / 2 - (tooltipBoxWidth * tooltipSizeScale) / 2;
98921
+ case -1:
98922
+ calcPos[posKey] = (dim1 + dim2) / 2 - boxSize * tooltipSizeScale - dimOffset;
99233
98923
  break;
99234
- case 'centerLeft':
99235
- left = (x1 + x2) / 2 - tooltipBoxWidth * tooltipSizeScale - offsetX;
98924
+ case 1:
98925
+ calcPos[posKey] = (dim1 + dim2) / 2 + dimOffset;
99236
98926
  break;
99237
- case 'centerRight':
99238
- left = (x1 + x2) / 2 + offsetX;
99239
- break;
99240
- }
99241
- }
99242
- };
99243
- const processCartesianFixedPositionY = ({ orient, mode, offset }) => {
99244
- var _a;
99245
- let y1;
99246
- let y2;
99247
- const model = params.model;
99248
- const startPoint = model === null || model === void 0 ? void 0 : model.getLayoutStartPoint();
99249
- offsetY = offset !== null && offset !== void 0 ? offset : offsetY;
99250
- if (mode === 'mark') {
99251
- isFixedPosition = true;
99252
- const element = params.item;
99253
- const bounds = element === null || element === void 0 ? void 0 : element.getBounds();
99254
- if (bounds && startPoint) {
99255
- y1 = bounds.y1 + startPoint.y;
99256
- y2 = bounds.y2 + startPoint.y;
99257
- }
99258
- }
99259
- else if (mode === 'crosshair' &&
99260
- ((_a = firstDim === null || firstDim === void 0 ? void 0 : firstDim.series) === null || _a === void 0 ? void 0 : _a.coordinate) === 'cartesian' &&
99261
- firstDim.datum &&
99262
- firstDim.datum.length) {
99263
- isFixedPosition = true;
99264
- const rect = getCartesianCrosshairRect(firstDim, startPoint);
99265
- if (rect) {
99266
- y1 = rect.start.y;
99267
- y2 = rect.end.y;
99268
- }
99269
- }
99270
- else {
99271
- pointerFixedPositionY = orient;
99272
- }
99273
- if (isFixedPosition) {
99274
- switch (getVerticalPositionType(orient)) {
99275
- case 'top':
99276
- top = y1 - tooltipBoxHeight * tooltipSizeScale - offsetY;
99277
- break;
99278
- case 'bottom':
99279
- top = y2 + offsetY;
99280
- break;
99281
- case 'center':
99282
- top = (y1 + y2) / 2 - (tooltipBoxHeight * tooltipSizeScale) / 2;
99283
- break;
99284
- case 'centerTop':
99285
- top = (y1 + y2) / 2 - tooltipBoxHeight * tooltipSizeScale - offsetY;
99286
- break;
99287
- case 'centerBottom':
99288
- top = (y1 + y2) / 2 + offsetY;
98927
+ case 2:
98928
+ calcPos[posKey] = dim2 + dimOffset;
99289
98929
  break;
99290
98930
  }
99291
98931
  }
99292
98932
  };
98933
+ const dims = ['x', 'y'];
99293
98934
  if (isObject$2(position)) {
99294
98935
  if (isGlobalTooltipPositionPattern(position)) {
99295
98936
  const { left: posLeft, right: posRight, top: posTop, bottom: posBottom } = position;
99296
- left = getActualTooltipPositionValue(posLeft, event);
99297
- top = getActualTooltipPositionValue(posTop, event);
99298
- right = getActualTooltipPositionValue(posRight, event);
99299
- bottom = getActualTooltipPositionValue(posBottom, event);
98937
+ calcPos.left = getActualTooltipPositionValue(posLeft, event);
98938
+ calcPos.top = getActualTooltipPositionValue(posTop, event);
98939
+ calcPos.right = getActualTooltipPositionValue(posRight, event);
98940
+ calcPos.bottom = getActualTooltipPositionValue(posBottom, event);
99300
98941
  }
99301
98942
  else if (isFixedTooltipPositionPattern(position)) {
99302
- const { x, y } = position;
99303
- if (isNumber$1(x) || isFunction$1(x)) {
99304
- left = getActualTooltipPositionValue(x, event);
99305
- }
99306
- else {
99307
- processCartesianFixedPositionX(x);
99308
- }
99309
- if (isNumber$1(y) || isFunction$1(y)) {
99310
- top = getActualTooltipPositionValue(y, event);
99311
- }
99312
- else {
99313
- processCartesianFixedPositionY(y);
99314
- }
99315
- }
99316
- }
99317
- else if (isValid$1(position)) {
99318
- processCartesianFixedPositionX({ orient: position, mode: positionMode });
99319
- processCartesianFixedPositionY({ orient: position, mode: positionMode });
99320
- }
99321
- let x;
99322
- let y;
99323
- const { canvasX, canvasY } = event;
99324
- if (isValidNumber$1(left)) {
99325
- x = left;
99326
- }
99327
- else if (isValidNumber$1(right)) {
99328
- x = canvasWidth - tooltipBoxWidth * tooltipSizeScale - right;
99329
- }
99330
- else {
99331
- const x0 = canvasX;
99332
- switch (getHorizontalPositionType(pointerFixedPositionX, 'right')) {
99333
- case 'center':
99334
- x = x0 - (tooltipBoxWidth * tooltipSizeScale) / 2;
99335
- break;
99336
- case 'left':
99337
- case 'centerLeft':
99338
- x = x0 - tooltipBoxWidth * tooltipSizeScale - offsetX;
99339
- break;
99340
- case 'right':
99341
- case 'centerRight':
99342
- x = x0 + offsetX;
99343
- break;
99344
- }
99345
- }
99346
- if (isValidNumber$1(top)) {
99347
- y = top;
99348
- }
99349
- else if (isValidNumber$1(bottom)) {
99350
- y = canvasHeight - tooltipBoxHeight * tooltipSizeScale - bottom;
99351
- }
99352
- else {
99353
- const y0 = canvasY;
99354
- switch (getVerticalPositionType(pointerFixedPositionY, 'bottom')) {
99355
- case 'center':
99356
- y = y0 - (tooltipBoxHeight * tooltipSizeScale) / 2;
99357
- break;
99358
- case 'top':
99359
- case 'centerTop':
99360
- y = y0 - tooltipBoxHeight * tooltipSizeScale - offsetY;
99361
- break;
99362
- case 'bottom':
99363
- case 'centerBottom':
99364
- y = y0 + offsetY;
99365
- break;
99366
- }
99367
- }
99368
- x *= chartElementScale;
99369
- y *= chartElementScale;
99370
- if (isTrueBrowser(this._env)) {
99371
- x += relativePosOffset.x;
99372
- y += relativePosOffset.y;
99373
- }
99374
- x /= tooltipParentElementScale;
99375
- y /= tooltipParentElementScale;
99376
- const { width: containerWidth, height: containerHeight } = containerSize;
99377
- const isLeftOut = () => x * tooltipParentElementScale + tooltipParentElementRect.x < 0;
99378
- const isRightOut = () => (x + tooltipBoxWidth) * tooltipParentElementScale + tooltipParentElementRect.x > containerWidth;
99379
- const isTopOut = () => y * tooltipParentElementScale + tooltipParentElementRect.y < 0;
99380
- const isBottomOut = () => (y + tooltipBoxHeight) * tooltipParentElementScale + tooltipParentElementRect.y > containerHeight;
99381
- const detectLeftFirst = () => {
99382
- if (isLeftOut()) {
99383
- if (isFixedPosition) {
99384
- x = -tooltipParentElementRect.x / tooltipParentElementScale;
99385
- }
99386
- else {
99387
- if (getHorizontalPositionType(position, 'right') === 'center') {
99388
- x += offsetX + tooltipBoxWidth / 2;
98943
+ dims.forEach(dim => {
98944
+ const dimValue = position[dim];
98945
+ if (isNumber$1(dimValue) || isFunction$1(dimValue)) {
98946
+ calcPos[dimToPos[dim][0]] = getActualTooltipPositionValue(dimValue, event);
99389
98947
  }
99390
98948
  else {
99391
- x += offsetX * 2 + tooltipBoxWidth;
98949
+ processCartesianFixedPosition(dimValue, dim);
99392
98950
  }
99393
- }
98951
+ });
99394
98952
  }
99395
- };
99396
- const detectLeftLast = () => {
99397
- if (isLeftOut()) {
99398
- x = -tooltipParentElementRect.x / tooltipParentElementScale;
98953
+ }
98954
+ else if (isValid$1(position)) {
98955
+ processCartesianFixedPosition({ orient: position, mode: positionMode }, 'x');
98956
+ processCartesianFixedPosition({ orient: position, mode: positionMode }, 'y');
98957
+ }
98958
+ const result = { x: null, y: null };
98959
+ const isBrowser = isTrueBrowser(this._env);
98960
+ dims.forEach(dim => {
98961
+ const boxSize = dim === 'x' ? tooltipBoxWidth : tooltipBoxHeight;
98962
+ const canvasSize = dim === 'x' ? canvasWidth : canvasHeight;
98963
+ const offset = dim === 'x' ? offsetX : offsetY;
98964
+ const posType = getPositionType(pointerFixedPosition[dim], dim);
98965
+ if (isValidNumber$1(calcPos[dimToPos[dim][0]])) {
98966
+ result[dim] = calcPos[dimToPos[dim][0]];
98967
+ }
98968
+ else if (isValidNumber$1(calcPos[dimToPos[dim][1]])) {
98969
+ result[dim] = canvasSize - boxSize * tooltipSizeScale - calcPos[dimToPos[dim][1]];
99399
98970
  }
99400
- };
99401
- const detectRightFirst = () => {
99402
- if (isRightOut()) {
99403
- if (isFixedPosition) {
99404
- x = (containerWidth - tooltipParentElementRect.x) / tooltipParentElementScale - tooltipBoxWidth;
98971
+ else {
98972
+ const value0 = dim === 'x' ? event.canvasX : event.canvasY;
98973
+ if (posType > 0) {
98974
+ result[dim] = value0 + offset;
99405
98975
  }
99406
98976
  else {
99407
- if (getHorizontalPositionType(position, 'right') === 'center') {
99408
- x -= offsetX + tooltipBoxWidth / 2;
99409
- }
99410
- else {
99411
- x -= offsetX * 2 + tooltipBoxWidth;
99412
- }
98977
+ result[dim] = value0 - (boxSize * tooltipSizeScale) / 2 + (posType < 0 ? -1 : 0) * offset;
99413
98978
  }
99414
98979
  }
99415
- };
99416
- const detectRightLast = () => {
99417
- if (isRightOut()) {
99418
- x = (containerWidth - tooltipParentElementRect.x) / tooltipParentElementScale - tooltipBoxWidth;
98980
+ result[dim] *= chartElementScale;
98981
+ if (isBrowser) {
98982
+ result[dim] += relativePosOffset[dim];
99419
98983
  }
99420
- };
99421
- const detectTopFirst = () => {
99422
- if (isTopOut()) {
98984
+ result[dim] /= tooltipParentElementScale;
98985
+ const containerDimSize = dim === 'x' ? containerSize.width : containerSize.height;
98986
+ const leftOrTop = -tooltipParentElementRect[dim] / tooltipParentElementScale;
98987
+ const rightOrBottom = (containerDimSize - tooltipParentElementRect[dim]) / tooltipParentElementScale - boxSize;
98988
+ if (posType !== 2 && result[dim] < leftOrTop) {
99423
98989
  if (isFixedPosition) {
99424
- y = -tooltipParentElementRect.y / tooltipParentElementScale;
98990
+ result[dim] = leftOrTop;
99425
98991
  }
99426
98992
  else {
99427
- if (getVerticalPositionType(position, 'bottom') === 'center') {
99428
- y += offsetY + tooltipBoxHeight / 2;
98993
+ if (posType === 0) {
98994
+ result[dim] += offset + boxSize / 2;
99429
98995
  }
99430
98996
  else {
99431
- y += offsetY * 2 + tooltipBoxHeight;
98997
+ result[dim] += offset * 2 + boxSize;
98998
+ }
98999
+ if (result[dim] > rightOrBottom) {
99000
+ result[dim] = rightOrBottom;
99432
99001
  }
99433
99002
  }
99434
99003
  }
99435
- };
99436
- const detectTopLast = () => {
99437
- if (isTopOut()) {
99438
- y = 0 - tooltipParentElementRect.y / tooltipParentElementScale;
99439
- }
99440
- };
99441
- const detectBottomFirst = () => {
99442
- if (isBottomOut()) {
99004
+ else if (posType !== -2 && result[dim] > rightOrBottom) {
99443
99005
  if (isFixedPosition) {
99444
- y = (containerHeight - tooltipParentElementRect.y) / tooltipParentElementScale - tooltipBoxHeight;
99006
+ result[dim] = rightOrBottom;
99445
99007
  }
99446
99008
  else {
99447
- if (getVerticalPositionType(position, 'bottom') === 'center') {
99448
- y -= offsetY + tooltipBoxHeight / 2;
99009
+ if (posType === 0) {
99010
+ result[dim] -= offset + boxSize / 2;
99449
99011
  }
99450
99012
  else {
99451
- y -= offsetY * 2 + tooltipBoxHeight;
99013
+ result[dim] -= offset * 2 + boxSize;
99014
+ }
99015
+ if (result[dim] < leftOrTop) {
99016
+ result[dim] = leftOrTop;
99452
99017
  }
99453
99018
  }
99454
99019
  }
99455
- };
99456
- const detectBottomLast = () => {
99457
- if (isBottomOut()) {
99458
- y = (containerHeight - tooltipParentElementRect.y) / tooltipParentElementScale - tooltipBoxHeight;
99459
- }
99460
- };
99461
- const horizontalType = getHorizontalPositionType(position, 'right');
99462
- if (horizontalType === 'left' || (horizontalType.includes('center') && isLeftOut())) {
99463
- detectLeftFirst();
99464
- detectRightLast();
99465
- }
99466
- else {
99467
- detectRightFirst();
99468
- detectLeftLast();
99469
- }
99470
- const verticalType = getVerticalPositionType(position, 'bottom');
99471
- if (verticalType === 'top' || (verticalType.includes('center') && isTopOut())) {
99472
- detectTopFirst();
99473
- detectBottomLast();
99474
- }
99475
- else {
99476
- detectBottomFirst();
99477
- detectTopLast();
99478
- }
99479
- const result = { x, y };
99480
- this._cacheTooltipPosition = result;
99481
- this._cacheTooltipSize = { width: tooltipBoxWidth, height: tooltipBoxHeight };
99020
+ });
99482
99021
  return result;
99483
99022
  };
99484
99023
  }
@@ -99500,7 +99039,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
99500
99039
  }
99501
99040
  release() {
99502
99041
  var _a, _b, _c;
99503
- this._clearAllCache();
99504
99042
  const spec = (_a = this._component.getSpec()) !== null && _a !== void 0 ? _a : {};
99505
99043
  if (spec.handler) {
99506
99044
  (_c = (_b = spec.handler).release) === null || _c === void 0 ? void 0 : _c.call(_b);
@@ -99509,15 +99047,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
99509
99047
  this._removeTooltip();
99510
99048
  this._isReleased = true;
99511
99049
  }
99512
- _clearAllCache() {
99513
- this._isTooltipPaused = false;
99514
- this._isPointerEscaped = false;
99515
- clearTimeout(this._cachePointerTimer);
99516
- this._cachePointerTimer = -1;
99517
- this._cachePointerPosition = undefined;
99518
- this._cacheTooltipPosition = undefined;
99519
- this._cacheTooltipSize = undefined;
99520
- }
99521
99050
  _throttle(callback) {
99522
99051
  const tooltipSpec = this._component.getSpec();
99523
99052
  let wait;
@@ -99552,68 +99081,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
99552
99081
  height: (panelDomHeight !== null && panelDomHeight !== void 0 ? panelDomHeight : panel === null || panel === void 0 ? void 0 : panel.height) + (isCanvas ? panel.lineWidth : 0)
99553
99082
  };
99554
99083
  }
99555
- _getPointerPositionRelativeToTooltipParent(params) {
99556
- var _a, _b;
99557
- let { canvasX: x, canvasY: y } = params.event;
99558
- const { tooltipSpec } = params;
99559
- const invalidPosition = {
99560
- x: Infinity,
99561
- y: Infinity
99562
- };
99563
- const isCanvas = tooltipSpec.renderMode === 'canvas';
99564
- const tooltipParentElement = this._getParentElement(tooltipSpec);
99565
- let relativePosOffset = { x: 0, y: 0 };
99566
- let tooltipParentElementRect = { x: 0, y: 0 };
99567
- let chartElementScale = 1;
99568
- let tooltipParentElementScale = 1;
99569
- if (isTrueBrowser(this._env) && !tooltipSpec.confine) {
99570
- if (!isCanvas) {
99571
- tooltipParentElementRect = (_a = tooltipParentElement === null || tooltipParentElement === void 0 ? void 0 : tooltipParentElement.getBoundingClientRect()) !== null && _a !== void 0 ? _a : invalidPosition;
99572
- const chartElement = ((_b = this._compiler.getCanvas()) !== null && _b !== void 0 ? _b : this._chartContainer);
99573
- const chartElementRect = chartElement === null || chartElement === void 0 ? void 0 : chartElement.getBoundingClientRect();
99574
- relativePosOffset = {
99575
- x: chartElementRect.x - tooltipParentElementRect.x,
99576
- y: chartElementRect.y - tooltipParentElementRect.y
99577
- };
99578
- chartElementScale = getScale(chartElement, chartElementRect);
99579
- tooltipParentElementScale = getScale(tooltipParentElement, tooltipParentElementRect);
99580
- }
99581
- }
99582
- x *= chartElementScale;
99583
- y *= chartElementScale;
99584
- if (isTrueBrowser(this._env)) {
99585
- x += relativePosOffset.x;
99586
- y += relativePosOffset.y;
99587
- }
99588
- x /= tooltipParentElementScale;
99589
- y /= tooltipParentElementScale;
99590
- return { x, y };
99591
- }
99592
- _isPointerMovingToTooltip(params) {
99593
- if (!this._cacheTooltipPosition || !this._cacheTooltipSize || !this._cachePointerPosition) {
99594
- return false;
99595
- }
99596
- const { width: tooltipWidth, height: tooltipHeight } = this._cacheTooltipSize;
99597
- const { x: tooltipX = 0, y: tooltipY } = this._cacheTooltipPosition;
99598
- const pos = this._getPointerPositionRelativeToTooltipParent(params);
99599
- if (pointInRect(pos, {
99600
- x1: tooltipX,
99601
- y1: tooltipY,
99602
- x2: tooltipX + tooltipWidth,
99603
- y2: tooltipY + tooltipHeight
99604
- }, false)) {
99605
- return true;
99606
- }
99607
- const a = { x: tooltipX, y: tooltipY };
99608
- const b = { x: a.x + tooltipWidth, y: a.y };
99609
- const c = { x: a.x, y: a.y + tooltipHeight };
99610
- const d = { x: b.x, y: c.y };
99611
- const oldPos = this._cachePointerPosition;
99612
- return (polygonContainPoint([oldPos, a, b], pos.x, pos.y) ||
99613
- polygonContainPoint([oldPos, c, d], pos.x, pos.y) ||
99614
- polygonContainPoint([oldPos, a, d], pos.x, pos.y) ||
99615
- polygonContainPoint([oldPos, b, c], pos.x, pos.y));
99616
- }
99617
99084
  _getParentElement(spec) {
99618
99085
  return spec.parentElement;
99619
99086
  }
@@ -100071,10 +99538,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
100071
99538
  super.setStyle(mergeSpec({}, defaultContentColumnStyle, tooltipStyle.content, this._getContentColumnStyle()));
100072
99539
  const renderContent = (_b = (_a = this._option.getTooltipActual()) === null || _a === void 0 ? void 0 : _a.content) !== null && _b !== void 0 ? _b : [];
100073
99540
  const contentAttributes = (_d = (_c = this._option.getTooltipAttributes()) === null || _c === void 0 ? void 0 : _c.content) !== null && _d !== void 0 ? _d : [];
100074
- const getKeyItemStyle = (line, i) => {
99541
+ const getKeyItemStyle = (line, attrs, i) => {
100075
99542
  var _a, _b;
100076
99543
  const { key, isKeyAdaptive } = line;
100077
- const { height } = contentAttributes[i];
99544
+ const { height } = attrs;
100078
99545
  const { keyColumn } = tooltipStyle;
100079
99546
  const style = mergeSpec({}, isKeyAdaptive ? defaultAdaptiveKeyStyle : defaultKeyStyle, Object.assign(Object.assign(Object.assign({ height: getPixelPropertyStr(height) }, defaultLabelStyle), keyColumn.common), (_a = keyColumn.items) === null || _a === void 0 ? void 0 : _a[i]));
100080
99547
  const hasContent = (isString$1(key) && ((_b = key === null || key === void 0 ? void 0 : key.trim) === null || _b === void 0 ? void 0 : _b.call(key)) !== '') || isNumber$1(key);
@@ -100086,32 +99553,33 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
100086
99553
  }
100087
99554
  return style;
100088
99555
  };
100089
- const getValueItemStyle = (line, i) => {
99556
+ const getValueItemStyle = (line, attrs, i) => {
100090
99557
  var _a;
100091
- const { height } = contentAttributes[i];
99558
+ const { height } = attrs;
100092
99559
  const { valueColumn } = tooltipStyle;
100093
99560
  const style = mergeSpec({}, defaultValueStyle, Object.assign(Object.assign(Object.assign({ height: getPixelPropertyStr(height) }, defaultLabelStyle), valueColumn.common), (_a = valueColumn.items) === null || _a === void 0 ? void 0 : _a[i]));
100094
99561
  return style;
100095
99562
  };
100096
- const getShapeItemStyle = (line, i) => {
99563
+ const getShapeItemStyle = (line, attrs, i) => {
100097
99564
  var _a, _b, _c, _d;
100098
- const { height } = contentAttributes[i];
99565
+ const { height } = attrs;
100099
99566
  const { shapeColumn } = tooltipStyle;
100100
- const keyStyle = getKeyItemStyle(line, i);
99567
+ const keyStyle = getKeyItemStyle(line, attrs, i);
100101
99568
  const paddingTop = `calc((${(_b = (_a = keyStyle.lineHeight) !== null && _a !== void 0 ? _a : keyStyle.fontSize) !== null && _b !== void 0 ? _b : '18px'} - ${(_c = shapeColumn.width) !== null && _c !== void 0 ? _c : '8px'}) / 2)`;
100102
99569
  const style = mergeSpec({}, defaultShapeStyle, Object.assign(Object.assign({ height: getPixelPropertyStr(height), paddingTop }, shapeColumn.common), (_d = shapeColumn.items) === null || _d === void 0 ? void 0 : _d[i]));
100103
99570
  return style;
100104
99571
  };
100105
- renderContent.forEach((line, i) => {
99572
+ contentAttributes.forEach((attrs, i) => {
100106
99573
  var _a;
99574
+ const line = renderContent[i];
100107
99575
  if (this.className === 'key-box') {
100108
- this.children[i].setStyle(getKeyItemStyle(line, i));
99576
+ this.children[i].setStyle(getKeyItemStyle(line, attrs, i));
100109
99577
  }
100110
99578
  else if (this.className === 'value-box') {
100111
- this.children[i].setStyle(getValueItemStyle(line, i));
99579
+ this.children[i].setStyle(getValueItemStyle(line, attrs, i));
100112
99580
  }
100113
99581
  else if (this.className === 'shape-box') {
100114
- (_a = this.children[i]) === null || _a === void 0 ? void 0 : _a.setStyle(getShapeItemStyle(line, i), this._getShapeSvgOption(line, i));
99582
+ (_a = this.children[i]) === null || _a === void 0 ? void 0 : _a.setStyle(getShapeItemStyle(line, attrs, i), this._getShapeSvgOption(line, i));
100115
99583
  }
100116
99584
  });
100117
99585
  }
@@ -100119,9 +99587,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
100119
99587
  var _a, _b, _c, _d;
100120
99588
  const renderContent = (_b = (_a = this._option.getTooltipActual()) === null || _a === void 0 ? void 0 : _a.content) !== null && _b !== void 0 ? _b : [];
100121
99589
  const contentAttributes = (_d = (_c = this._option.getTooltipAttributes()) === null || _c === void 0 ? void 0 : _c.content) !== null && _d !== void 0 ? _d : [];
100122
- renderContent.forEach((line, i) => {
99590
+ contentAttributes.forEach((attributes, i) => {
100123
99591
  var _a, _b, _c, _d, _e, _f, _g;
100124
99592
  let childContent;
99593
+ const line = renderContent[i];
100125
99594
  if (this.className === 'key-box') {
100126
99595
  const keyContent = line.key;
100127
99596
  if ((isString$1(keyContent) && ((_a = keyContent === null || keyContent === void 0 ? void 0 : keyContent.trim) === null || _a === void 0 ? void 0 : _a.call(keyContent)) !== '') || isNumber$1(keyContent)) {
@@ -100130,7 +99599,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
100130
99599
  else {
100131
99600
  childContent = TOOLTIP_EMPTY_STRING;
100132
99601
  }
100133
- (_b = this.children[i]) === null || _b === void 0 ? void 0 : _b.setContent(childContent, (_c = contentAttributes[i].key) === null || _c === void 0 ? void 0 : _c.multiLine);
99602
+ (_b = this.children[i]) === null || _b === void 0 ? void 0 : _b.setContent(childContent, (_c = attributes.key) === null || _c === void 0 ? void 0 : _c.multiLine);
100134
99603
  }
100135
99604
  else if (this.className === 'value-box') {
100136
99605
  const valueContent = line.value;
@@ -100140,7 +99609,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
100140
99609
  else {
100141
99610
  childContent = TOOLTIP_EMPTY_STRING;
100142
99611
  }
100143
- (_e = this.children[i]) === null || _e === void 0 ? void 0 : _e.setContent(childContent, (_f = contentAttributes[i].value) === null || _f === void 0 ? void 0 : _f.multiLine);
99612
+ (_e = this.children[i]) === null || _e === void 0 ? void 0 : _e.setContent(childContent, (_f = attributes.value) === null || _f === void 0 ? void 0 : _f.multiLine);
100144
99613
  }
100145
99614
  else if (this.className === 'shape-box') {
100146
99615
  childContent = this._getShapeSvgOption(line, i);
@@ -100164,14 +99633,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
100164
99633
  }
100165
99634
  }
100166
99635
  _getShapeSvgOption(line, index) {
100167
- var _a, _b;
99636
+ var _a;
100168
99637
  const tooltipStyle = this._option.getTooltipStyle();
100169
99638
  const shapeColumn = Object.assign(Object.assign({}, tooltipStyle.shapeColumn), (_a = tooltipStyle.shapeColumn.items) === null || _a === void 0 ? void 0 : _a[index]);
100170
99639
  return {
100171
99640
  hasShape: line.hasShape,
100172
99641
  symbolType: line.shapeType,
100173
99642
  size: shapeColumn.width,
100174
- fill: (_b = line.shapeFill) !== null && _b !== void 0 ? _b : line.shapeColor,
99643
+ fill: line.shapeFill,
100175
99644
  stroke: line.shapeStroke,
100176
99645
  lineWidth: line.shapeLineWidth,
100177
99646
  hollow: line.shapeHollow,
@@ -100310,7 +99779,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
100310
99779
  hasShape: title === null || title === void 0 ? void 0 : title.hasShape,
100311
99780
  symbolType: title === null || title === void 0 ? void 0 : title.shapeType,
100312
99781
  size: (_c = tooltipStyle.shapeColumn.common) === null || _c === void 0 ? void 0 : _c.width,
100313
- fill: title === null || title === void 0 ? void 0 : title.shapeColor,
99782
+ fill: title === null || title === void 0 ? void 0 : title.shapeFill,
100314
99783
  hollow: title === null || title === void 0 ? void 0 : title.shapeHollow
100315
99784
  });
100316
99785
  (_d = this.textSpan) === null || _d === void 0 ? void 0 : _d.setStyle({
@@ -100328,7 +99797,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
100328
99797
  hasShape: title === null || title === void 0 ? void 0 : title.hasShape,
100329
99798
  symbolType: title === null || title === void 0 ? void 0 : title.shapeType,
100330
99799
  size: (_b = tooltipStyle.shapeColumn.common) === null || _b === void 0 ? void 0 : _b.width,
100331
- fill: title === null || title === void 0 ? void 0 : title.shapeColor,
99800
+ fill: title === null || title === void 0 ? void 0 : title.shapeFill,
100332
99801
  hollow: title === null || title === void 0 ? void 0 : title.shapeHollow
100333
99802
  });
100334
99803
  (_c = this.textSpan) === null || _c === void 0 ? void 0 : _c.setStyle({
@@ -100514,31 +99983,27 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
100514
99983
  }
100515
99984
  _updateTooltip(visible, params) {
100516
99985
  var _a, _b;
100517
- const { tooltipActual, tooltipSpec } = params;
100518
99986
  if (!visible || !this.model) {
100519
99987
  this.setVisibility(visible);
100520
99988
  this._cacheCustomTooltipPosition = undefined;
100521
99989
  }
100522
99990
  else {
99991
+ const { tooltipSpec, activeTooltipSpec } = params;
100523
99992
  if (!params.changePositionOnly) {
100524
- this._tooltipActual = tooltipActual;
99993
+ this._tooltipActual = activeTooltipSpec;
100525
99994
  this._initStyle();
100526
- const firstInit = !this.model.product;
100527
99995
  this.model.initAll();
100528
- if (firstInit) {
100529
- this._initEvent(this.model.product);
100530
- }
100531
99996
  this.model.setStyle();
100532
99997
  this.model.setContent();
100533
99998
  }
100534
99999
  this.setVisibility(visible);
100535
100000
  const el = this.model.product;
100536
100001
  if (el) {
100537
- const { x = 0, y = 0 } = (_a = tooltipActual.position) !== null && _a !== void 0 ? _a : {};
100002
+ const { x = 0, y = 0 } = (_a = activeTooltipSpec.position) !== null && _a !== void 0 ? _a : {};
100538
100003
  if (tooltipSpec.updateElement) {
100539
100004
  this._updatePosition((_b = this._cacheCustomTooltipPosition) !== null && _b !== void 0 ? _b : { x, y });
100540
- tooltipSpec.updateElement(el, tooltipActual, params);
100541
- const position = this._getActualTooltipPosition(tooltipActual, params, {
100005
+ tooltipSpec.updateElement(el, activeTooltipSpec, params);
100006
+ const position = this._getActualTooltipPosition(activeTooltipSpec, params, {
100542
100007
  width: el.offsetWidth,
100543
100008
  height: el.offsetHeight
100544
100009
  });
@@ -100571,19 +100036,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
100571
100036
  el.style.transform = `translate3d(${x}px, ${y}px, 0)`;
100572
100037
  }
100573
100038
  }
100574
- _initEvent(el) {
100575
- el.addEventListener('pointerleave', event => {
100576
- const { renderMode, enterable } = this._component.getSpec();
100577
- const relatedTarget = event.relatedTarget;
100578
- if (renderMode === 'html' && enterable) {
100579
- if (isNil$1(relatedTarget) ||
100580
- (relatedTarget !== this._compiler.getCanvas() &&
100581
- !hasParentElement(relatedTarget, this.getTooltipContainer()))) {
100582
- this._component.hideTooltip();
100583
- }
100584
- }
100585
- });
100586
- }
100587
100039
  }
100588
100040
  DomTooltipHandler.type = TooltipHandlerType.dom;
100589
100041
  const registerDomTooltipHandler = () => {
@@ -100644,8 +100096,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
100644
100096
  if (!this._tooltipComponent) {
100645
100097
  this._initTooltipComponent(stage);
100646
100098
  }
100647
- const { tooltipActual } = params;
100648
- const pos = tooltipActual.position;
100099
+ const { activeTooltipSpec } = params;
100100
+ const pos = activeTooltipSpec.position;
100649
100101
  if (!params.changePositionOnly) {
100650
100102
  this._tooltipComponent.setAttributes(Object.assign(Object.assign({}, this._attributes), pos));
100651
100103
  }