@visactor/vrender-components 0.17.0-alpha.8 → 0.17.1-alpha.1

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 (455) hide show
  1. package/cjs/axis/base.d.ts +2 -1
  2. package/cjs/axis/base.js +31 -22
  3. package/cjs/axis/base.js.map +1 -1
  4. package/cjs/axis/circle.d.ts +9 -4
  5. package/cjs/axis/circle.js +9 -6
  6. package/cjs/axis/circle.js.map +1 -1
  7. package/cjs/axis/grid/base.js +6 -8
  8. package/cjs/axis/grid/base.js.map +1 -1
  9. package/cjs/axis/grid/circle.d.ts +2 -1
  10. package/cjs/axis/grid/circle.js +2 -2
  11. package/cjs/axis/grid/circle.js.map +1 -1
  12. package/cjs/axis/grid/line.d.ts +2 -1
  13. package/cjs/axis/grid/line.js +2 -3
  14. package/cjs/axis/grid/line.js.map +1 -1
  15. package/cjs/axis/line.d.ts +3 -3
  16. package/cjs/axis/line.js +41 -48
  17. package/cjs/axis/line.js.map +1 -1
  18. package/cjs/axis/overlap/auto-hide.js +8 -7
  19. package/cjs/axis/overlap/auto-hide.js.map +1 -1
  20. package/cjs/axis/overlap/auto-limit.js.map +1 -1
  21. package/cjs/axis/overlap/auto-rotate.js +3 -35
  22. package/cjs/axis/overlap/auto-rotate.js.map +1 -1
  23. package/cjs/axis/overlap/util.d.ts +3 -0
  24. package/cjs/axis/overlap/util.js +44 -0
  25. package/cjs/axis/overlap/util.js.map +1 -0
  26. package/cjs/axis/type.d.ts +6 -6
  27. package/cjs/axis/type.js.map +1 -1
  28. package/cjs/axis/util.d.ts +8 -0
  29. package/cjs/axis/util.js +34 -0
  30. package/cjs/axis/util.js.map +1 -0
  31. package/cjs/brush/brush.d.ts +2 -1
  32. package/cjs/brush/brush.js +9 -6
  33. package/cjs/brush/brush.js.map +1 -1
  34. package/cjs/brush/type.d.ts +2 -1
  35. package/cjs/brush/type.js.map +1 -1
  36. package/cjs/checkbox/checkbox.d.ts +4 -2
  37. package/cjs/checkbox/checkbox.js +26 -12
  38. package/cjs/checkbox/checkbox.js.map +1 -1
  39. package/cjs/checkbox/index.js +1 -2
  40. package/cjs/checkbox/type.d.ts +5 -1
  41. package/cjs/checkbox/type.js +2 -1
  42. package/cjs/checkbox/type.js.map +1 -1
  43. package/cjs/constant.d.ts +6 -0
  44. package/cjs/constant.js +6 -1
  45. package/cjs/constant.js.map +1 -1
  46. package/cjs/core/base.d.ts +4 -2
  47. package/cjs/core/base.js +9 -6
  48. package/cjs/core/base.js.map +1 -1
  49. package/cjs/core/type.d.ts +15 -0
  50. package/cjs/core/type.js.map +1 -1
  51. package/cjs/crosshair/circle.d.ts +2 -1
  52. package/cjs/crosshair/circle.js +2 -2
  53. package/cjs/crosshair/circle.js.map +1 -1
  54. package/cjs/crosshair/line.d.ts +2 -1
  55. package/cjs/crosshair/line.js +2 -2
  56. package/cjs/crosshair/line.js.map +1 -1
  57. package/cjs/crosshair/polygon.d.ts +2 -1
  58. package/cjs/crosshair/polygon.js +2 -2
  59. package/cjs/crosshair/polygon.js.map +1 -1
  60. package/cjs/crosshair/rect.d.ts +2 -1
  61. package/cjs/crosshair/rect.js +2 -2
  62. package/cjs/crosshair/rect.js.map +1 -1
  63. package/cjs/crosshair/sector.d.ts +2 -1
  64. package/cjs/crosshair/sector.js +2 -2
  65. package/cjs/crosshair/sector.js.map +1 -1
  66. package/cjs/data-zoom/config.d.ts +6 -6
  67. package/cjs/data-zoom/config.js +7 -7
  68. package/cjs/data-zoom/config.js.map +1 -1
  69. package/cjs/data-zoom/data-zoom.d.ts +21 -11
  70. package/cjs/data-zoom/data-zoom.js +80 -64
  71. package/cjs/data-zoom/data-zoom.js.map +1 -1
  72. package/cjs/data-zoom/type.d.ts +17 -5
  73. package/cjs/data-zoom/type.js +6 -1
  74. package/cjs/data-zoom/type.js.map +1 -1
  75. package/cjs/index.d.ts +1 -1
  76. package/cjs/index.js +1 -1
  77. package/cjs/index.js.map +1 -1
  78. package/cjs/indicator/config.js +1 -2
  79. package/cjs/indicator/index.js +2 -1
  80. package/cjs/indicator/indicator.js +43 -7
  81. package/cjs/indicator/indicator.js.map +1 -1
  82. package/cjs/indicator/type.d.ts +2 -1
  83. package/cjs/indicator/type.js.map +1 -1
  84. package/cjs/interface.d.ts +5 -0
  85. package/cjs/interface.js.map +1 -1
  86. package/cjs/label/animate/animate.d.ts +8 -2
  87. package/cjs/label/animate/animate.js +37 -3
  88. package/cjs/label/animate/animate.js.map +1 -1
  89. package/cjs/label/arc.d.ts +7 -7
  90. package/cjs/label/arc.js +6 -19
  91. package/cjs/label/arc.js.map +1 -1
  92. package/cjs/label/area.d.ts +15 -0
  93. package/cjs/label/area.js +41 -0
  94. package/cjs/label/area.js.map +1 -0
  95. package/cjs/label/base.d.ts +28 -18
  96. package/cjs/label/base.js +115 -62
  97. package/cjs/label/base.js.map +1 -1
  98. package/cjs/label/dataLabel.d.ts +2 -1
  99. package/cjs/label/dataLabel.js +13 -8
  100. package/cjs/label/dataLabel.js.map +1 -1
  101. package/cjs/label/index.d.ts +2 -0
  102. package/cjs/label/index.js +1 -0
  103. package/cjs/label/index.js.map +1 -1
  104. package/cjs/label/line-data.d.ts +13 -0
  105. package/cjs/label/line-data.js +31 -0
  106. package/cjs/label/line-data.js.map +1 -0
  107. package/cjs/label/line.d.ts +4 -3
  108. package/cjs/label/line.js +8 -14
  109. package/cjs/label/line.js.map +1 -1
  110. package/cjs/label/polygon.d.ts +2 -1
  111. package/cjs/label/polygon.js +3 -2
  112. package/cjs/label/polygon.js.map +1 -1
  113. package/cjs/label/rect.d.ts +2 -1
  114. package/cjs/label/rect.js +29 -3
  115. package/cjs/label/rect.js.map +1 -1
  116. package/cjs/label/symbol.d.ts +2 -1
  117. package/cjs/label/symbol.js +5 -44
  118. package/cjs/label/symbol.js.map +1 -1
  119. package/cjs/label/type.d.ts +42 -8
  120. package/cjs/label/type.js +1 -2
  121. package/cjs/label/type.js.map +1 -1
  122. package/cjs/label/util.d.ts +11 -1
  123. package/cjs/label/util.js +74 -1
  124. package/cjs/label/util.js.map +1 -1
  125. package/cjs/legend/base.js +1 -1
  126. package/cjs/legend/base.js.map +1 -1
  127. package/cjs/legend/color/color.d.ts +2 -1
  128. package/cjs/legend/color/color.js +6 -5
  129. package/cjs/legend/color/color.js.map +1 -1
  130. package/cjs/legend/constant.js +2 -1
  131. package/cjs/legend/discrete/discrete.d.ts +5 -1
  132. package/cjs/legend/discrete/discrete.js +82 -71
  133. package/cjs/legend/discrete/discrete.js.map +1 -1
  134. package/cjs/legend/discrete/type.d.ts +2 -0
  135. package/cjs/legend/discrete/type.js.map +1 -1
  136. package/cjs/legend/index.d.ts +1 -0
  137. package/cjs/legend/index.js +2 -1
  138. package/cjs/legend/index.js.map +1 -1
  139. package/cjs/legend/size/size.d.ts +2 -3
  140. package/cjs/legend/size/size.js +10 -19
  141. package/cjs/legend/size/size.js.map +1 -1
  142. package/cjs/legend/type.d.ts +1 -0
  143. package/cjs/legend/type.js.map +1 -1
  144. package/cjs/legend/util.d.ts +2 -0
  145. package/cjs/legend/util.js +13 -0
  146. package/cjs/legend/util.js.map +1 -0
  147. package/cjs/link-path/link-path.d.ts +2 -1
  148. package/cjs/link-path/link-path.js +3 -3
  149. package/cjs/link-path/link-path.js.map +1 -1
  150. package/cjs/link-path/type.js +1 -1
  151. package/cjs/marker/area.d.ts +8 -2
  152. package/cjs/marker/area.js +15 -5
  153. package/cjs/marker/area.js.map +1 -1
  154. package/cjs/marker/base.d.ts +1 -0
  155. package/cjs/marker/base.js +14 -10
  156. package/cjs/marker/base.js.map +1 -1
  157. package/cjs/marker/line.d.ts +8 -1
  158. package/cjs/marker/line.js +15 -3
  159. package/cjs/marker/line.js.map +1 -1
  160. package/cjs/marker/point.d.ts +7 -4
  161. package/cjs/marker/point.js +10 -7
  162. package/cjs/marker/point.js.map +1 -1
  163. package/cjs/marker/type.d.ts +16 -16
  164. package/cjs/marker/type.js.map +1 -1
  165. package/cjs/pager/pager.d.ts +2 -1
  166. package/cjs/pager/pager.js +9 -10
  167. package/cjs/pager/pager.js.map +1 -1
  168. package/cjs/pager/type.d.ts +1 -0
  169. package/cjs/pager/type.js.map +1 -1
  170. package/cjs/player/base-player.d.ts +2 -1
  171. package/cjs/player/base-player.js +7 -5
  172. package/cjs/player/base-player.js.map +1 -1
  173. package/cjs/player/continuous-player.js +2 -2
  174. package/cjs/player/continuous-player.js.map +1 -1
  175. package/cjs/player/controller/controller.d.ts +2 -1
  176. package/cjs/player/controller/controller.js +5 -5
  177. package/cjs/player/controller/controller.js.map +1 -1
  178. package/cjs/player/controller/type.d.ts +1 -0
  179. package/cjs/player/controller/type.js.map +1 -1
  180. package/cjs/player/discrete-player.d.ts +2 -1
  181. package/cjs/player/discrete-player.js +5 -5
  182. package/cjs/player/discrete-player.js.map +1 -1
  183. package/cjs/player/type/base.d.ts +1 -0
  184. package/cjs/player/type/base.js.map +1 -1
  185. package/cjs/poptip/poptip-plugin.d.ts +1 -0
  186. package/cjs/poptip/poptip-plugin.js +6 -3
  187. package/cjs/poptip/poptip-plugin.js.map +1 -1
  188. package/cjs/poptip/poptip.d.ts +2 -1
  189. package/cjs/poptip/poptip.js +3 -3
  190. package/cjs/poptip/poptip.js.map +1 -1
  191. package/cjs/scrollbar/scrollbar.d.ts +6 -1
  192. package/cjs/scrollbar/scrollbar.js +40 -20
  193. package/cjs/scrollbar/scrollbar.js.map +1 -1
  194. package/cjs/scrollbar/type.d.ts +5 -1
  195. package/cjs/scrollbar/type.js.map +1 -1
  196. package/cjs/segment/segment.d.ts +2 -1
  197. package/cjs/segment/segment.js +8 -6
  198. package/cjs/segment/segment.js.map +1 -1
  199. package/cjs/segment/type.d.ts +6 -2
  200. package/cjs/segment/type.js.map +1 -1
  201. package/cjs/slider/slider.d.ts +2 -1
  202. package/cjs/slider/slider.js +38 -33
  203. package/cjs/slider/slider.js.map +1 -1
  204. package/cjs/slider/type.d.ts +1 -0
  205. package/cjs/slider/type.js.map +1 -1
  206. package/cjs/tag/tag.d.ts +2 -1
  207. package/cjs/tag/tag.js +90 -43
  208. package/cjs/tag/tag.js.map +1 -1
  209. package/cjs/tag/type.d.ts +4 -5
  210. package/cjs/tag/type.js.map +1 -1
  211. package/cjs/title/title.d.ts +2 -1
  212. package/cjs/title/title.js +92 -59
  213. package/cjs/title/title.js.map +1 -1
  214. package/cjs/title/type.d.ts +10 -5
  215. package/cjs/title/type.js.map +1 -1
  216. package/cjs/tooltip/tooltip.d.ts +2 -1
  217. package/cjs/tooltip/tooltip.js +53 -15
  218. package/cjs/tooltip/tooltip.js.map +1 -1
  219. package/cjs/tooltip/type.d.ts +7 -2
  220. package/cjs/tooltip/type.js.map +1 -1
  221. package/cjs/tooltip/util.js +9 -1
  222. package/cjs/tooltip/util.js.map +1 -1
  223. package/cjs/util/label-smartInvert.d.ts +2 -2
  224. package/cjs/util/label-smartInvert.js +9 -5
  225. package/cjs/util/label-smartInvert.js.map +1 -1
  226. package/cjs/util/text.d.ts +2 -2
  227. package/dist/index.js +11581 -15729
  228. package/dist/index.min.js +1 -1
  229. package/es/axis/base.d.ts +2 -1
  230. package/es/axis/base.js +33 -19
  231. package/es/axis/base.js.map +1 -1
  232. package/es/axis/circle.d.ts +9 -4
  233. package/es/axis/circle.js +11 -6
  234. package/es/axis/circle.js.map +1 -1
  235. package/es/axis/grid/base.js +7 -7
  236. package/es/axis/grid/base.js.map +1 -1
  237. package/es/axis/grid/circle.d.ts +2 -1
  238. package/es/axis/grid/circle.js +2 -2
  239. package/es/axis/grid/circle.js.map +1 -1
  240. package/es/axis/grid/line.d.ts +2 -1
  241. package/es/axis/grid/line.js +2 -2
  242. package/es/axis/grid/line.js.map +1 -1
  243. package/es/axis/line.d.ts +3 -3
  244. package/es/axis/line.js +42 -48
  245. package/es/axis/line.js.map +1 -1
  246. package/es/axis/overlap/auto-hide.js +9 -6
  247. package/es/axis/overlap/auto-hide.js.map +1 -1
  248. package/es/axis/overlap/auto-limit.js.map +1 -1
  249. package/es/axis/overlap/auto-rotate.js +3 -33
  250. package/es/axis/overlap/auto-rotate.js.map +1 -1
  251. package/es/axis/overlap/util.d.ts +3 -0
  252. package/es/axis/overlap/util.js +35 -0
  253. package/es/axis/overlap/util.js.map +1 -0
  254. package/es/axis/type.d.ts +6 -6
  255. package/es/axis/type.js.map +1 -1
  256. package/es/axis/util.d.ts +8 -0
  257. package/es/axis/util.js +28 -0
  258. package/es/axis/util.js.map +1 -0
  259. package/es/brush/brush.d.ts +2 -1
  260. package/es/brush/brush.js +13 -9
  261. package/es/brush/brush.js.map +1 -1
  262. package/es/brush/type.d.ts +2 -1
  263. package/es/brush/type.js.map +1 -1
  264. package/es/checkbox/checkbox.d.ts +4 -2
  265. package/es/checkbox/checkbox.js +25 -10
  266. package/es/checkbox/checkbox.js.map +1 -1
  267. package/es/checkbox/index.js +1 -2
  268. package/es/checkbox/type.d.ts +5 -1
  269. package/es/checkbox/type.js +2 -1
  270. package/es/checkbox/type.js.map +1 -1
  271. package/es/constant.d.ts +6 -0
  272. package/es/constant.js +7 -0
  273. package/es/constant.js.map +1 -1
  274. package/es/core/base.d.ts +4 -2
  275. package/es/core/base.js +6 -4
  276. package/es/core/base.js.map +1 -1
  277. package/es/core/type.d.ts +15 -0
  278. package/es/core/type.js.map +1 -1
  279. package/es/crosshair/circle.d.ts +2 -1
  280. package/es/crosshair/circle.js +2 -2
  281. package/es/crosshair/circle.js.map +1 -1
  282. package/es/crosshair/line.d.ts +2 -1
  283. package/es/crosshair/line.js +2 -2
  284. package/es/crosshair/line.js.map +1 -1
  285. package/es/crosshair/polygon.d.ts +2 -1
  286. package/es/crosshair/polygon.js +2 -2
  287. package/es/crosshair/polygon.js.map +1 -1
  288. package/es/crosshair/rect.d.ts +2 -1
  289. package/es/crosshair/rect.js +2 -2
  290. package/es/crosshair/rect.js.map +1 -1
  291. package/es/crosshair/sector.d.ts +2 -1
  292. package/es/crosshair/sector.js +2 -2
  293. package/es/crosshair/sector.js.map +1 -1
  294. package/es/data-zoom/config.d.ts +6 -6
  295. package/es/data-zoom/config.js +6 -7
  296. package/es/data-zoom/config.js.map +1 -1
  297. package/es/data-zoom/data-zoom.d.ts +21 -11
  298. package/es/data-zoom/data-zoom.js +77 -58
  299. package/es/data-zoom/data-zoom.js.map +1 -1
  300. package/es/data-zoom/type.d.ts +17 -5
  301. package/es/data-zoom/type.js +6 -1
  302. package/es/data-zoom/type.js.map +1 -1
  303. package/es/index.d.ts +1 -1
  304. package/es/index.js +1 -1
  305. package/es/index.js.map +1 -1
  306. package/es/indicator/config.js +1 -2
  307. package/es/indicator/index.js +2 -1
  308. package/es/indicator/indicator.js +44 -6
  309. package/es/indicator/indicator.js.map +1 -1
  310. package/es/indicator/type.d.ts +2 -1
  311. package/es/indicator/type.js.map +1 -1
  312. package/es/interface.d.ts +5 -0
  313. package/es/interface.js.map +1 -1
  314. package/es/label/animate/animate.d.ts +8 -2
  315. package/es/label/animate/animate.js +35 -0
  316. package/es/label/animate/animate.js.map +1 -1
  317. package/es/label/arc.d.ts +7 -7
  318. package/es/label/arc.js +7 -19
  319. package/es/label/arc.js.map +1 -1
  320. package/es/label/area.d.ts +15 -0
  321. package/es/label/area.js +39 -0
  322. package/es/label/area.js.map +1 -0
  323. package/es/label/base.d.ts +28 -18
  324. package/es/label/base.js +117 -62
  325. package/es/label/base.js.map +1 -1
  326. package/es/label/dataLabel.d.ts +2 -1
  327. package/es/label/dataLabel.js +18 -7
  328. package/es/label/dataLabel.js.map +1 -1
  329. package/es/label/index.d.ts +2 -0
  330. package/es/label/index.js +4 -0
  331. package/es/label/index.js.map +1 -1
  332. package/es/label/line-data.d.ts +13 -0
  333. package/es/label/line-data.js +29 -0
  334. package/es/label/line-data.js.map +1 -0
  335. package/es/label/line.d.ts +4 -3
  336. package/es/label/line.js +9 -13
  337. package/es/label/line.js.map +1 -1
  338. package/es/label/polygon.d.ts +2 -1
  339. package/es/label/polygon.js +3 -2
  340. package/es/label/polygon.js.map +1 -1
  341. package/es/label/rect.d.ts +2 -1
  342. package/es/label/rect.js +29 -3
  343. package/es/label/rect.js.map +1 -1
  344. package/es/label/symbol.d.ts +2 -1
  345. package/es/label/symbol.js +6 -43
  346. package/es/label/symbol.js.map +1 -1
  347. package/es/label/type.d.ts +42 -8
  348. package/es/label/type.js +1 -2
  349. package/es/label/type.js.map +1 -1
  350. package/es/label/util.d.ts +11 -1
  351. package/es/label/util.js +69 -0
  352. package/es/label/util.js.map +1 -1
  353. package/es/legend/base.js +2 -2
  354. package/es/legend/base.js.map +1 -1
  355. package/es/legend/color/color.d.ts +2 -1
  356. package/es/legend/color/color.js +7 -6
  357. package/es/legend/color/color.js.map +1 -1
  358. package/es/legend/constant.js +2 -1
  359. package/es/legend/discrete/discrete.d.ts +5 -1
  360. package/es/legend/discrete/discrete.js +82 -68
  361. package/es/legend/discrete/discrete.js.map +1 -1
  362. package/es/legend/discrete/type.d.ts +2 -0
  363. package/es/legend/discrete/type.js.map +1 -1
  364. package/es/legend/index.d.ts +1 -0
  365. package/es/legend/index.js +2 -0
  366. package/es/legend/index.js.map +1 -1
  367. package/es/legend/size/size.d.ts +2 -3
  368. package/es/legend/size/size.js +10 -14
  369. package/es/legend/size/size.js.map +1 -1
  370. package/es/legend/type.d.ts +1 -0
  371. package/es/legend/type.js.map +1 -1
  372. package/es/legend/util.d.ts +2 -0
  373. package/es/legend/util.js +7 -0
  374. package/es/legend/util.js.map +1 -0
  375. package/es/link-path/link-path.d.ts +2 -1
  376. package/es/link-path/link-path.js +3 -3
  377. package/es/link-path/link-path.js.map +1 -1
  378. package/es/link-path/type.js +1 -1
  379. package/es/marker/area.d.ts +8 -2
  380. package/es/marker/area.js +16 -5
  381. package/es/marker/area.js.map +1 -1
  382. package/es/marker/base.d.ts +1 -0
  383. package/es/marker/base.js +15 -11
  384. package/es/marker/base.js.map +1 -1
  385. package/es/marker/line.d.ts +8 -1
  386. package/es/marker/line.js +15 -3
  387. package/es/marker/line.js.map +1 -1
  388. package/es/marker/point.d.ts +7 -4
  389. package/es/marker/point.js +11 -6
  390. package/es/marker/point.js.map +1 -1
  391. package/es/marker/type.d.ts +16 -16
  392. package/es/marker/type.js.map +1 -1
  393. package/es/pager/pager.d.ts +2 -1
  394. package/es/pager/pager.js +10 -10
  395. package/es/pager/pager.js.map +1 -1
  396. package/es/pager/type.d.ts +1 -0
  397. package/es/pager/type.js.map +1 -1
  398. package/es/player/base-player.d.ts +2 -1
  399. package/es/player/base-player.js +7 -5
  400. package/es/player/base-player.js.map +1 -1
  401. package/es/player/continuous-player.js +2 -2
  402. package/es/player/continuous-player.js.map +1 -1
  403. package/es/player/controller/controller.d.ts +2 -1
  404. package/es/player/controller/controller.js +5 -5
  405. package/es/player/controller/controller.js.map +1 -1
  406. package/es/player/controller/type.d.ts +1 -0
  407. package/es/player/controller/type.js.map +1 -1
  408. package/es/player/discrete-player.d.ts +2 -1
  409. package/es/player/discrete-player.js +5 -4
  410. package/es/player/discrete-player.js.map +1 -1
  411. package/es/player/type/base.d.ts +1 -0
  412. package/es/player/type/base.js.map +1 -1
  413. package/es/poptip/poptip-plugin.d.ts +1 -0
  414. package/es/poptip/poptip-plugin.js +6 -3
  415. package/es/poptip/poptip-plugin.js.map +1 -1
  416. package/es/poptip/poptip.d.ts +2 -1
  417. package/es/poptip/poptip.js +3 -2
  418. package/es/poptip/poptip.js.map +1 -1
  419. package/es/scrollbar/scrollbar.d.ts +6 -1
  420. package/es/scrollbar/scrollbar.js +42 -20
  421. package/es/scrollbar/scrollbar.js.map +1 -1
  422. package/es/scrollbar/type.d.ts +5 -1
  423. package/es/scrollbar/type.js.map +1 -1
  424. package/es/segment/segment.d.ts +2 -1
  425. package/es/segment/segment.js +9 -7
  426. package/es/segment/segment.js.map +1 -1
  427. package/es/segment/type.d.ts +6 -2
  428. package/es/segment/type.js.map +1 -1
  429. package/es/slider/slider.d.ts +2 -1
  430. package/es/slider/slider.js +39 -33
  431. package/es/slider/slider.js.map +1 -1
  432. package/es/slider/type.d.ts +1 -0
  433. package/es/slider/type.js.map +1 -1
  434. package/es/tag/tag.d.ts +2 -1
  435. package/es/tag/tag.js +89 -40
  436. package/es/tag/tag.js.map +1 -1
  437. package/es/tag/type.d.ts +4 -5
  438. package/es/tag/type.js.map +1 -1
  439. package/es/title/title.d.ts +2 -1
  440. package/es/title/title.js +91 -55
  441. package/es/title/title.js.map +1 -1
  442. package/es/title/type.d.ts +10 -5
  443. package/es/title/type.js.map +1 -1
  444. package/es/tooltip/tooltip.d.ts +2 -1
  445. package/es/tooltip/tooltip.js +55 -15
  446. package/es/tooltip/tooltip.js.map +1 -1
  447. package/es/tooltip/type.d.ts +7 -2
  448. package/es/tooltip/type.js.map +1 -1
  449. package/es/tooltip/util.js +9 -1
  450. package/es/tooltip/util.js.map +1 -1
  451. package/es/util/label-smartInvert.d.ts +2 -2
  452. package/es/util/label-smartInvert.js +9 -5
  453. package/es/util/label-smartInvert.js.map +1 -1
  454. package/es/util/text.d.ts +2 -2
  455. package/package.json +6 -6
@@ -1,52 +1,62 @@
1
- import type { IGroup, IGraphic, IText, ILine } from '@visactor/vrender-core';
2
- import type { IAABBBounds, IBoundsLike } from '@visactor/vutils';
1
+ import type { IGroup, IGraphic, IText, ILine, IRichText } from '@visactor/vrender-core';
2
+ import type { IAABBBounds, IBoundsLike, IPointLike } from '@visactor/vutils';
3
3
  import { AbstractComponent } from '../core/base';
4
4
  import type { PointLocationCfg } from '../core/type';
5
5
  import type { Bitmap } from './overlap';
6
6
  import { bitmapTool } from './overlap';
7
- import type { BaseLabelAttrs, ILabelAnimation, LabelItem } from './type';
7
+ import type { BaseLabelAttrs, ILabelAnimation, LabelItem, ILabelEnterAnimation, ILabelExitAnimation, ILabelUpdateAnimation } from './type';
8
+ import type { ComponentOptions } from '../interface';
8
9
  export declare class LabelBase<T extends BaseLabelAttrs> extends AbstractComponent<T> {
9
10
  name: string;
10
11
  protected _baseMarks?: IGraphic[];
12
+ protected _isCollectionBase: boolean;
11
13
  protected _bitmap?: Bitmap;
14
+ protected _animationConfig?: {
15
+ enter: ILabelEnterAnimation;
16
+ exit: ILabelExitAnimation;
17
+ update: ILabelUpdateAnimation;
18
+ };
12
19
  static defaultAttributes: Partial<BaseLabelAttrs>;
13
20
  setBitmap(bitmap: Bitmap): void;
14
21
  protected _bmpTool?: ReturnType<typeof bitmapTool>;
15
22
  setBitmapTool(bmpTool: ReturnType<typeof bitmapTool>): void;
16
23
  protected _graphicToText: Map<IGraphic, {
17
- text: IText;
24
+ text: IText | IRichText;
18
25
  labelLine?: ILine;
19
26
  }>;
20
27
  protected _idToGraphic: Map<string, IGraphic>;
28
+ protected _idToPoint: Map<string, IPointLike>;
21
29
  onAfterLabelOverlap?: (bitmap: Bitmap) => void;
22
30
  private _lastHover;
23
31
  private _lastSelect;
24
32
  private _enableAnimation;
25
- constructor(attributes: BaseLabelAttrs);
33
+ constructor(attributes: BaseLabelAttrs, options?: ComponentOptions);
26
34
  protected labeling(textBounds: IBoundsLike, graphicBounds: IBoundsLike, position?: BaseLabelAttrs['position'], offset?: number): {
27
35
  x: number;
28
36
  y: number;
29
37
  } | undefined;
30
- protected _labelLine(text: IText): ILine | undefined;
38
+ protected _labelLine(text: LabelItem): ILine | undefined;
31
39
  protected render(): void;
32
40
  private _bindEvent;
33
- private _setStates;
41
+ private _setStatesOfText;
42
+ private _setStatesOfLabelLine;
34
43
  private _onHover;
35
44
  private _onUnHover;
36
45
  private _onClick;
37
- protected _createLabelText(attributes: LabelItem): IText;
46
+ protected _createLabelText(attributes: LabelItem): IRichText | IText;
38
47
  private _prepare;
39
- protected _layout(data?: LabelItem[]): IText[];
40
- protected _overlapping(labels: IText[]): IText[];
48
+ protected getRelatedGrphic(item: LabelItem): IGraphic<Partial<import("@visactor/vrender-core").IGraphicAttribute>>;
49
+ protected _layout(data?: LabelItem[]): (IText | IRichText)[];
50
+ protected _overlapping(labels: (IText | IRichText)[]): (IRichText | IText)[];
41
51
  protected getBaseMarkGroup(): IGroup;
42
- protected getGraphicBounds(graphic?: IGraphic, point?: Partial<PointLocationCfg>): IBoundsLike;
43
- protected _renderLabels(labels: IText[]): void;
44
- protected _renderWithAnimation(labels: IText[]): void;
45
- protected _renderWithOutAnimation(labels: IText[]): void;
46
- protected _afterRelatedGraphicAttributeUpdate(text: IText, texts: IText[], index: number, relatedGraphic: IGraphic, { mode, duration, easing, to, delay }: ILabelAnimation & {
47
- to: any;
48
- }): (event: any) => {};
49
- protected _smartInvert(labels: IText[]): void;
52
+ protected getGraphicBounds(graphic?: IGraphic, point?: Partial<PointLocationCfg>, position?: string): IBoundsLike;
53
+ protected _renderLabels(labels: (IText | IRichText)[]): void;
54
+ protected _renderWithAnimation(labels: (IText | IRichText)[]): void;
55
+ protected _renderWithOutAnimation(labels: (IText | IRichText)[]): void;
56
+ protected _handleRelatedGraphicSetState: (e: any) => void;
57
+ protected _syncStateWithRelatedGraphic(relatedGraphic: IGraphic): void;
58
+ protected _afterRelatedGraphicAttributeUpdate(text: IText | IRichText, texts: (IText | IRichText)[], index: number, relatedGraphic: IGraphic, to: any, { mode, duration, easing, delay }: ILabelAnimation): (event: any) => {};
59
+ protected _smartInvert(labels: (IText | IRichText)[]): void;
50
60
  protected _canPlaceInside(textBound: IBoundsLike, shapeBound: IAABBBounds): boolean;
51
61
  setLocation(point: PointLocationCfg): void;
52
62
  disableAnimation(): void;
package/es/label/base.js CHANGED
@@ -1,6 +1,6 @@
1
- import { createText, IncreaseCount, AttributeUpdateType } from "@visactor/vrender-core";
1
+ import { graphicCreator, AttributeUpdateType, IContainPointMode } from "@visactor/vrender-core";
2
2
 
3
- import { isFunction, isValidNumber, isEmpty, isValid, isString, merge, isRectIntersect, isNil } from "@visactor/vutils";
3
+ import { isFunction, isEmpty, isValid, isString, merge, isRectIntersect, isNil, isArray } from "@visactor/vutils";
4
4
 
5
5
  import { AbstractComponent } from "../core/base";
6
6
 
@@ -12,7 +12,11 @@ import { StateValue } from "../constant";
12
12
 
13
13
  import { bitmapTool, boundToRange, canPlace, clampText, place } from "./overlap";
14
14
 
15
- import { DefaultLabelAnimation, getAnimationAttributes } from "./animate/animate";
15
+ import { DefaultLabelAnimation, getAnimationAttributes, updateAnimation } from "./animate/animate";
16
+
17
+ import { getPointsOfLineArea } from "./util";
18
+
19
+ import { DEFAULT_HTML_TEXT_SPEC } from "../constant";
16
20
 
17
21
  export class LabelBase extends AbstractComponent {
18
22
  setBitmap(bitmap) {
@@ -21,9 +25,9 @@ export class LabelBase extends AbstractComponent {
21
25
  setBitmapTool(bmpTool) {
22
26
  this._bmpTool = bmpTool;
23
27
  }
24
- constructor(attributes) {
25
- super(merge({}, LabelBase.defaultAttributes, attributes)), this.name = "label",
26
- this._onHover = e => {
28
+ constructor(attributes, options) {
29
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge({}, LabelBase.defaultAttributes, attributes)),
30
+ this.name = "label", this._onHover = e => {
27
31
  const target = e.target;
28
32
  target === this._lastHover || isEmpty(target.states) || (target.addState(StateValue.hover, !0),
29
33
  traverseGroup(this, (node => {
@@ -42,61 +46,109 @@ export class LabelBase extends AbstractComponent {
42
46
  isEmpty(target.states) || (target.addState(StateValue.selected, !0), traverseGroup(this, (node => {
43
47
  node === target || isEmpty(node.states) || node.addState(StateValue.selectedReverse, !0);
44
48
  })), this._lastSelect = target);
49
+ }, this._handleRelatedGraphicSetState = e => {
50
+ var _a, _b, _c;
51
+ if ((null === (_a = e.detail) || void 0 === _a ? void 0 : _a.type) === AttributeUpdateType.STATE) {
52
+ const currentStates = null !== (_c = null === (_b = e.target) || void 0 === _b ? void 0 : _b.currentStates) && void 0 !== _c ? _c : [];
53
+ (this._isCollectionBase ? [ ...this._graphicToText.values() ] : [ this._graphicToText.get(e.target) ]).forEach((label => {
54
+ label && (label.text && label.text.useStates(currentStates), label.labelLine && label.labelLine.useStates(currentStates));
55
+ }));
56
+ }
45
57
  };
46
58
  }
47
59
  labeling(textBounds, graphicBounds, position, offset) {}
48
60
  _labelLine(text) {}
49
61
  render() {
50
- if (this._prepare(), isNil(this._idToGraphic)) return;
62
+ if (this._prepare(), isNil(this._idToGraphic) || this._isCollectionBase && isNil(this._idToPoint)) return;
51
63
  const {overlap: overlap, smartInvert: smartInvert, dataFilter: dataFilter, customLayoutFunc: customLayoutFunc, customOverlapFunc: customOverlapFunc} = this.attribute;
52
64
  let labels, data = this.attribute.data;
53
- isFunction(dataFilter) && (data = dataFilter(data)), labels = isFunction(customLayoutFunc) ? customLayoutFunc(data, (d => this._idToGraphic.get(d.id))) : this._layout(data),
54
- isFunction(customOverlapFunc) ? labels = customOverlapFunc(labels, (d => this._idToGraphic.get(d.id))) : !1 !== overlap && (labels = this._overlapping(labels)),
65
+ isFunction(dataFilter) && (data = dataFilter(data)), labels = isFunction(customLayoutFunc) ? customLayoutFunc(data, this.getRelatedGrphic, this._isCollectionBase ? d => this._idToPoint.get(d.id) : null) : this._layout(data),
66
+ isFunction(customOverlapFunc) ? labels = customOverlapFunc(labels, this.getRelatedGrphic, this._isCollectionBase ? d => this._idToPoint.get(d.id) : null) : !1 !== overlap && (labels = this._overlapping(labels)),
55
67
  !1 !== smartInvert && this._smartInvert(labels), this._renderLabels(labels);
56
68
  }
57
69
  _bindEvent(target) {
70
+ if (this.attribute.disableTriggerEvent) return;
58
71
  if (!target) return;
59
72
  const {hover: hover, select: select} = this.attribute;
60
73
  hover && (target.addEventListener("pointermove", this._onHover), target.addEventListener("pointerout", this._onUnHover)),
61
74
  select && target.addEventListener("pointerdown", this._onClick);
62
75
  }
63
- _setStates(target) {
76
+ _setStatesOfText(target) {
64
77
  if (!target) return;
65
78
  const state = this.attribute.state;
66
79
  state && !isEmpty(state) && (target.states = state);
67
80
  }
81
+ _setStatesOfLabelLine(target) {
82
+ if (!target) return;
83
+ const state = this.attribute.labelLineState;
84
+ state && !isEmpty(state) && (target.states = state);
85
+ }
68
86
  _createLabelText(attributes) {
69
- const text = createText(attributes);
70
- return this._bindEvent(text), this._setStates(text), text;
87
+ var _a, _b;
88
+ if ("rich" === attributes.textType) {
89
+ attributes.textConfig = attributes.text, attributes.width = null !== (_a = attributes.width) && void 0 !== _a ? _a : 0,
90
+ attributes.height = null !== (_b = attributes.height) && void 0 !== _b ? _b : 0;
91
+ const text = graphicCreator.richtext(attributes);
92
+ return this._bindEvent(text), this._setStatesOfText(text), text;
93
+ }
94
+ if ("html" === attributes.textType) {
95
+ attributes.textConfig = [], attributes.html = Object.assign(Object.assign({
96
+ dom: attributes.text
97
+ }, DEFAULT_HTML_TEXT_SPEC), attributes);
98
+ const text = graphicCreator.richtext(attributes);
99
+ return this._bindEvent(text), this._setStatesOfText(text), text;
100
+ }
101
+ const text = graphicCreator.text(attributes);
102
+ return this._bindEvent(text), this._setStatesOfText(text), text;
71
103
  }
72
104
  _prepare() {
73
- var _a;
105
+ var _a, _b, _c, _d, _e;
74
106
  const currentBaseMarks = [];
75
107
  let baseMarks;
76
108
  if (baseMarks = isFunction(this.attribute.getBaseMarks) ? this.attribute.getBaseMarks() : getMarksByName(this.getRootNode(), this.attribute.baseMarkGroupName),
77
109
  baseMarks.forEach((mark => {
78
110
  "willRelease" !== mark.releaseStatus && currentBaseMarks.push(mark);
79
- })), null === (_a = this._idToGraphic) || void 0 === _a || _a.clear(), this._baseMarks = currentBaseMarks,
111
+ })), null === (_a = this._idToGraphic) || void 0 === _a || _a.clear(), null === (_b = this._idToPoint) || void 0 === _b || _b.clear(),
112
+ this._baseMarks = currentBaseMarks, this._isCollectionBase = "line-data" === this.attribute.type,
80
113
  !currentBaseMarks || 0 === currentBaseMarks.length) return;
81
114
  const {data: data} = this.attribute;
82
115
  if (data && 0 !== data.length) {
83
- this._idToGraphic || (this._idToGraphic = new Map);
84
- for (let i = 0; i < currentBaseMarks.length; i++) {
116
+ if (this._idToGraphic || (this._idToGraphic = new Map), this._isCollectionBase) {
117
+ this._idToPoint || (this._idToPoint = new Map);
118
+ let cur = 0;
119
+ for (let i = 0; i < currentBaseMarks.length; i++) {
120
+ const baseMark = currentBaseMarks[i], points = getPointsOfLineArea(baseMark);
121
+ if (null == points ? void 0 : points.length) for (let j = 0; j < points.length; j++) {
122
+ const textData = data[cur];
123
+ textData && points[j] && (isValid(textData.id) || (textData.id = `vrender-component-${this.name}-${cur}`),
124
+ this._idToPoint.set(textData.id, points[j]), this._idToGraphic.set(textData.id, baseMark)),
125
+ cur++;
126
+ }
127
+ }
128
+ } else for (let i = 0; i < currentBaseMarks.length; i++) {
85
129
  const textData = data[i], baseMark = currentBaseMarks[i];
86
130
  textData && baseMark && (isValid(textData.id) || (textData.id = `vrender-component-${this.name}-${i}`),
87
131
  this._idToGraphic.set(textData.id, baseMark));
88
132
  }
133
+ !1 !== this.attribute.animation && (this._animationConfig = {
134
+ enter: merge({}, DefaultLabelAnimation, this.attribute.animation, null !== (_c = this.attribute.animationEnter) && void 0 !== _c ? _c : {}),
135
+ exit: merge({}, DefaultLabelAnimation, this.attribute.animation, null !== (_d = this.attribute.animationExit) && void 0 !== _d ? _d : {}),
136
+ update: isArray(this.attribute.animationUpdate) ? this.attribute.animationUpdate : merge({}, DefaultLabelAnimation, this.attribute.animation, null !== (_e = this.attribute.animationUpdate) && void 0 !== _e ? _e : {})
137
+ });
89
138
  }
90
139
  }
140
+ getRelatedGrphic(item) {
141
+ return this._idToGraphic.get(item.id);
142
+ }
91
143
  _layout(data = []) {
92
144
  const {textStyle: textStyle = {}, position: position, offset: offset} = this.attribute, labels = [];
93
145
  for (let i = 0; i < data.length; i++) {
94
- const textData = data[i], baseMark = this._idToGraphic.get(textData.id), labelAttribute = Object.assign(Object.assign({
95
- fill: baseMark.attribute.fill
96
- }, textStyle), textData), text = this._createLabelText(labelAttribute), textBounds = this.getGraphicBounds(text), graphicBounds = this.getGraphicBounds(baseMark, {
146
+ const textData = data[i], baseMark = this.getRelatedGrphic(textData), labelAttribute = Object.assign(Object.assign({
147
+ fill: this._isCollectionBase ? isArray(baseMark.attribute.stroke) ? baseMark.attribute.stroke.find((entry => !!entry && !0 !== entry)) : baseMark.attribute.stroke : baseMark.attribute.fill
148
+ }, textStyle), textData), text = this._createLabelText(labelAttribute), textBounds = this.getGraphicBounds(text), actualPosition = isFunction(position) ? position(textData) : position, graphicBounds = this._isCollectionBase ? this.getGraphicBounds(null, this._idToPoint.get(textData.id), actualPosition) : this.getGraphicBounds(baseMark, {
97
149
  x: textData.x,
98
150
  y: textData.y
99
- }), textLocation = this.labeling(textBounds, graphicBounds, isFunction(position) ? position(textData) : position, offset);
151
+ }, actualPosition), textLocation = this.labeling(textBounds, graphicBounds, actualPosition, offset);
100
152
  textLocation && (labelAttribute.x = textLocation.x, labelAttribute.y = textLocation.y,
101
153
  text.setAttributes(textLocation)), labels.push(text);
102
154
  }
@@ -120,7 +172,7 @@ export class LabelBase extends AbstractComponent {
120
172
  }));
121
173
  for (let i = 0; i < labels.length; i++) {
122
174
  if (!1 === labels[i].visible) continue;
123
- const text = labels[i], baseMark = this._idToGraphic.get(text.attribute.id);
175
+ const text = labels[i], baseMark = this.getRelatedGrphic(text.attribute);
124
176
  if (text.update(), !isRectIntersect(baseMark.AABBBounds, {
125
177
  x1: 0,
126
178
  x2: bmpTool.width,
@@ -138,7 +190,7 @@ export class LabelBase extends AbstractComponent {
138
190
  }
139
191
  }
140
192
  let hasPlace = !1;
141
- for (let j = 0; j < strategy.length; j++) if (hasPlace = place(bmpTool, bitmap, strategy[j], this.attribute, text, this.getGraphicBounds(baseMark, labels[i]), this.labeling),
193
+ for (let j = 0; j < strategy.length; j++) if (hasPlace = place(bmpTool, bitmap, strategy[j], this.attribute, text, this._isCollectionBase ? this.getGraphicBounds(null, this._idToPoint.get(labels[i].attribute.id)) : this.getGraphicBounds(baseMark, labels[i].attribute), this.labeling),
142
194
  !1 !== hasPlace) {
143
195
  text.setAttributes({
144
196
  x: hasPlace.x,
@@ -148,12 +200,17 @@ export class LabelBase extends AbstractComponent {
148
200
  }
149
201
  if (!hasPlace && clampForce) {
150
202
  const {dx: dx = 0, dy: dy = 0} = clampText(text, bmpTool.width, bmpTool.height);
151
- if ((0 !== dx || 0 !== dy) && canPlace(bmpTool, bitmap, {
203
+ if (0 === dx && 0 === dy) {
204
+ if (canPlace(bmpTool, bitmap, text.AABBBounds)) {
205
+ bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, !0)), result.push(text);
206
+ continue;
207
+ }
208
+ } else if (canPlace(bmpTool, bitmap, {
152
209
  x1: text.AABBBounds.x1 + dx,
153
210
  x2: text.AABBBounds.x2 + dx,
154
211
  y1: text.AABBBounds.y1 + dy,
155
212
  y2: text.AABBBounds.y2 + dy
156
- }, void 0, overlapPadding)) {
213
+ })) {
157
214
  text.setAttributes({
158
215
  x: text.attribute.x + dx,
159
216
  y: text.attribute.y + dy
@@ -182,47 +239,37 @@ export class LabelBase extends AbstractComponent {
182
239
  !1 === this._enableAnimation || !1 === this.attribute.animation ? this._renderWithOutAnimation(labels) : this._renderWithAnimation(labels);
183
240
  }
184
241
  _renderWithAnimation(labels) {
185
- var _a, _b, _c, _d, _e;
186
- const animationConfig = null !== (_a = this.attribute.animation) && void 0 !== _a ? _a : {}, mode = null !== (_b = animationConfig.mode) && void 0 !== _b ? _b : DefaultLabelAnimation.mode, duration = null !== (_c = animationConfig.duration) && void 0 !== _c ? _c : DefaultLabelAnimation.duration, easing = null !== (_d = animationConfig.easing) && void 0 !== _d ? _d : DefaultLabelAnimation.easing, delay = null !== (_e = animationConfig.delay) && void 0 !== _e ? _e : 0, currentTextMap = new Map, prevTextMap = this._graphicToText || new Map, texts = [];
242
+ const currentTextMap = new Map, prevTextMap = this._graphicToText || new Map, texts = [];
187
243
  labels.forEach(((text, index) => {
188
244
  var _a, _b, _c, _d, _e, _f, _g;
189
- const labelLine = this._labelLine(text), relatedGraphic = this._idToGraphic.get(text.attribute.id), state = (null == prevTextMap ? void 0 : prevTextMap.get(relatedGraphic)) ? "update" : "enter";
245
+ const labelLine = this._labelLine(text), relatedGraphic = this.getRelatedGrphic(text.attribute), textId = text.attribute.id, textKey = this._isCollectionBase ? textId : relatedGraphic, state = (null == prevTextMap ? void 0 : prevTextMap.get(textKey)) ? "update" : "enter";
190
246
  if ("enter" === state) {
191
- if (texts.push(text), currentTextMap.set(relatedGraphic, labelLine ? {
247
+ if (texts.push(text), currentTextMap.set(textKey, labelLine ? {
192
248
  text: text,
193
249
  labelLine: labelLine
194
250
  } : {
195
251
  text: text
196
252
  }), relatedGraphic) {
197
253
  const {from: from, to: to} = getAnimationAttributes(text.attribute, "fadeIn");
198
- this.add(text), labelLine && this.add(labelLine), relatedGraphic.once("animate-bind", (() => {
254
+ this.add(text), labelLine && (this._setStatesOfLabelLine(labelLine), this.add(labelLine)),
255
+ this._syncStateWithRelatedGraphic(relatedGraphic), relatedGraphic.once("animate-bind", (a => {
199
256
  text.setAttributes(from);
200
- const listener = this._afterRelatedGraphicAttributeUpdate(text, texts, index, relatedGraphic, {
201
- mode: mode,
202
- duration: duration,
203
- easing: easing,
204
- to: to,
205
- delay: delay
206
- });
257
+ const listener = this._afterRelatedGraphicAttributeUpdate(text, texts, index, relatedGraphic, to, this._animationConfig.enter);
207
258
  relatedGraphic.on("afterAttributeUpdate", listener);
208
259
  }));
209
260
  }
210
261
  } else if ("update" === state) {
211
- const prevLabel = prevTextMap.get(relatedGraphic);
212
- prevTextMap.delete(relatedGraphic), currentTextMap.set(relatedGraphic, prevLabel);
213
- const prevText = prevLabel.text;
214
- prevText.animate().to(text.attribute, duration, easing), prevLabel.labelLine && prevLabel.labelLine.animate().to(merge({}, prevLabel.labelLine.attribute, {
262
+ const prevLabel = prevTextMap.get(textKey);
263
+ prevTextMap.delete(textKey), currentTextMap.set(textKey, prevLabel);
264
+ const prevText = prevLabel.text, {duration: duration, easing: easing} = this._animationConfig.update;
265
+ updateAnimation(prevText, text, this._animationConfig.update), prevLabel.labelLine && prevLabel.labelLine.animate().to(merge({}, prevLabel.labelLine.attribute, {
215
266
  visible: null === (_f = null !== (_d = (null === (_b = null === (_a = text.attribute) || void 0 === _a ? void 0 : _a.line) || void 0 === _b ? void 0 : _b.visible) && (null === (_c = text.attribute) || void 0 === _c ? void 0 : _c.visible)) && void 0 !== _d ? _d : null === (_e = text.attribute) || void 0 === _e ? void 0 : _e.visible) || void 0 === _f || _f,
216
267
  points: null === (_g = text.attribute) || void 0 === _g ? void 0 : _g.points
217
- }), duration, easing), !1 !== animationConfig.increaseEffect && prevText.attribute.text !== text.attribute.text && isValidNumber(Number(prevText.attribute.text) * Number(text.attribute.text)) && prevText.animate().play(new IncreaseCount({
218
- text: prevText.attribute.text
219
- }, {
220
- text: text.attribute.text
221
- }, duration, easing));
268
+ }), duration, easing);
222
269
  }
223
270
  })), prevTextMap.forEach((label => {
224
271
  var _a;
225
- null === (_a = label.text) || void 0 === _a || _a.animate().to(getAnimationAttributes(label.text.attribute, "fadeOut").to, duration, easing).onEnd((() => {
272
+ null === (_a = label.text) || void 0 === _a || _a.animate().to(getAnimationAttributes(label.text.attribute, "fadeOut").to, this._animationConfig.exit.duration, this._animationConfig.exit.easing).onEnd((() => {
226
273
  this.removeChild(label.text), (null == label ? void 0 : label.labelLine) && this.removeChild(label.labelLine);
227
274
  }));
228
275
  })), this._graphicToText = currentTextMap;
@@ -231,16 +278,16 @@ export class LabelBase extends AbstractComponent {
231
278
  const currentTextMap = new Map, prevTextMap = this._graphicToText || new Map, texts = [];
232
279
  labels.forEach((text => {
233
280
  var _a;
234
- const labelLine = this._labelLine(text), relatedGraphic = this._idToGraphic.get(text.attribute.id), state = (null == prevTextMap ? void 0 : prevTextMap.get(relatedGraphic)) ? "update" : "enter";
235
- if ("enter" === state) texts.push(text), currentTextMap.set(relatedGraphic, labelLine ? {
281
+ const labelLine = this._labelLine(text), relatedGraphic = this.getRelatedGrphic(text.attribute), state = (null == prevTextMap ? void 0 : prevTextMap.get(relatedGraphic)) ? "update" : "enter", textKey = this._isCollectionBase ? text.attribute.id : relatedGraphic;
282
+ if ("enter" === state) texts.push(text), currentTextMap.set(textKey, labelLine ? {
236
283
  text: text,
237
284
  labelLine: labelLine
238
285
  } : {
239
286
  text: text
240
- }), this.add(text), labelLine && this.add(labelLine); else if ("update" === state) {
241
- const prevLabel = prevTextMap.get(relatedGraphic);
242
- prevTextMap.delete(relatedGraphic), currentTextMap.set(relatedGraphic, prevLabel),
243
- prevLabel.text.setAttributes(text.attribute), (null == prevLabel ? void 0 : prevLabel.labelLine) && prevLabel.labelLine.setAttributes({
287
+ }), this.add(text), labelLine && this.add(labelLine), this._syncStateWithRelatedGraphic(relatedGraphic); else if ("update" === state) {
288
+ const prevLabel = prevTextMap.get(textKey);
289
+ prevTextMap.delete(textKey), currentTextMap.set(textKey, prevLabel), prevLabel.text.setAttributes(text.attribute),
290
+ (null == prevLabel ? void 0 : prevLabel.labelLine) && prevLabel.labelLine.setAttributes({
244
291
  points: null === (_a = text.attribute) || void 0 === _a ? void 0 : _a.points
245
292
  });
246
293
  }
@@ -248,34 +295,42 @@ export class LabelBase extends AbstractComponent {
248
295
  this.removeChild(label.text), (null == label ? void 0 : label.labelLine) && this.removeChild(label.labelLine);
249
296
  })), this._graphicToText = currentTextMap;
250
297
  }
251
- _afterRelatedGraphicAttributeUpdate(text, texts, index, relatedGraphic, {mode: mode, duration: duration, easing: easing, to: to, delay: delay}) {
298
+ _syncStateWithRelatedGraphic(relatedGraphic) {
299
+ this.attribute.syncState && relatedGraphic.on("afterAttributeUpdate", this._handleRelatedGraphicSetState);
300
+ }
301
+ _afterRelatedGraphicAttributeUpdate(text, texts, index, relatedGraphic, to, {mode: mode, duration: duration, easing: easing, delay: delay}) {
252
302
  const listener = event => {
253
- var _a;
303
+ var _a, _b;
254
304
  const {detail: detail} = event;
255
305
  if (!detail) return {};
256
306
  if (!(detail && detail.type === AttributeUpdateType.ANIMATE_UPDATE && detail.animationState && "wait" !== (null === (_a = detail.animationState.step) || void 0 === _a ? void 0 : _a.type))) return {};
257
307
  if (detail.type === AttributeUpdateType.ANIMATE_END) return void text.setAttributes(to);
258
- const onEnd = () => {
308
+ const onStart = () => {
259
309
  relatedGraphic && (relatedGraphic.onAnimateBind = void 0, relatedGraphic.removeEventListener("afterAttributeUpdate", listener));
260
310
  };
261
311
  switch (mode) {
262
312
  case "after":
263
313
  detail.animationState.end && text.animate({
264
- onEnd: onEnd
314
+ onStart: onStart
265
315
  }).wait(delay).to(to, duration, easing);
266
316
  break;
267
317
 
268
318
  case "after-all":
269
319
  index === texts.length - 1 && detail.animationState.end && texts.forEach((t => {
270
320
  t.animate({
271
- onEnd: onEnd
321
+ onStart: onStart
272
322
  }).wait(delay).to(to, duration, easing);
273
323
  }));
274
324
  break;
275
325
 
276
326
  default:
277
- detail.animationState.isFirstFrameOfStep && text.animate({
278
- onEnd: onEnd
327
+ if (this._isCollectionBase) {
328
+ const point = this._idToPoint.get(text.attribute.id);
329
+ !point || text.animates && text.animates.has("label-animate") || !relatedGraphic.containsPoint(point.x, point.y, IContainPointMode.LOCAL, null === (_b = this.stage) || void 0 === _b ? void 0 : _b.pickerService) || text.animate({
330
+ onStart: onStart
331
+ }).wait(delay).to(to, duration, easing);
332
+ } else detail.animationState.isFirstFrameOfStep && text.animate({
333
+ onStart: onStart
279
334
  }).wait(delay).to(to, duration, easing);
280
335
  }
281
336
  };
@@ -283,11 +338,11 @@ export class LabelBase extends AbstractComponent {
283
338
  }
284
339
  _smartInvert(labels) {
285
340
  var _a, _b, _c, _d, _e;
286
- const option = this.attribute.smartInvert || {}, {textType: textType, contrastRatiosThreshold: contrastRatiosThreshold, alternativeColors: alternativeColors} = option, fillStrategy = null !== (_a = option.fillStrategy) && void 0 !== _a ? _a : "invertBase", strokeStrategy = null !== (_b = option.strokeStrategy) && void 0 !== _b ? _b : "base", brightColor = null !== (_c = option.brightColor) && void 0 !== _c ? _c : "#ffffff", darkColor = null !== (_d = option.darkColor) && void 0 !== _d ? _d : "#000000", outsideEnable = null !== (_e = option.outsideEnable) && void 0 !== _e && _e;
341
+ const option = this.attribute.smartInvert || {}, {textType: textType, contrastRatiosThreshold: contrastRatiosThreshold, alternativeColors: alternativeColors, mode: mode} = option, fillStrategy = null !== (_a = option.fillStrategy) && void 0 !== _a ? _a : "invertBase", strokeStrategy = null !== (_b = option.strokeStrategy) && void 0 !== _b ? _b : "base", brightColor = null !== (_c = option.brightColor) && void 0 !== _c ? _c : "#ffffff", darkColor = null !== (_d = option.darkColor) && void 0 !== _d ? _d : "#000000", outsideEnable = null !== (_e = option.outsideEnable) && void 0 !== _e && _e;
287
342
  if ("null" !== fillStrategy || "null" !== strokeStrategy) for (let i = 0; i < labels.length; i++) {
288
343
  const label = labels[i];
289
344
  if (!label) continue;
290
- const baseMark = this._idToGraphic.get(label.attribute.id), backgroundColor = baseMark.attribute.fill, foregroundColor = label.attribute.fill, baseColor = backgroundColor, invertColor = labelSmartInvert(foregroundColor, backgroundColor, textType, contrastRatiosThreshold, alternativeColors), similarColor = contrastAccessibilityChecker(invertColor, brightColor) ? brightColor : darkColor;
345
+ const baseMark = this.getRelatedGrphic(label.attribute), backgroundColor = baseMark.attribute.fill, foregroundColor = label.attribute.fill, baseColor = backgroundColor, invertColor = labelSmartInvert(foregroundColor, backgroundColor, textType, contrastRatiosThreshold, alternativeColors, mode), similarColor = contrastAccessibilityChecker(invertColor, brightColor) ? brightColor : darkColor;
291
346
  if (outsideEnable) {
292
347
  const fill = smartInvertStrategy(fillStrategy, baseColor, invertColor, similarColor);
293
348
  if (fill && label.setAttributes({
@@ -311,7 +366,7 @@ export class LabelBase extends AbstractComponent {
311
366
  if (0 === label.attribute.lineWidth) continue;
312
367
  if (label.attribute.stroke) {
313
368
  label.setAttributes({
314
- fill: labelSmartInvert(label.attribute.fill, label.attribute.stroke, textType, contrastRatiosThreshold, alternativeColors)
369
+ fill: labelSmartInvert(label.attribute.fill, label.attribute.stroke, textType, contrastRatiosThreshold, alternativeColors, mode)
315
370
  });
316
371
  continue;
317
372
  }