@visactor/vrender-components 0.15.0-alpha.6 → 0.15.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 (423) hide show
  1. package/cjs/axis/animate/group-fade.js.map +1 -1
  2. package/cjs/axis/animate/group-transition.js.map +1 -1
  3. package/cjs/axis/animate/index.js.map +1 -1
  4. package/cjs/axis/base.js.map +1 -1
  5. package/cjs/axis/circle.js.map +1 -1
  6. package/cjs/axis/config.js.map +1 -1
  7. package/cjs/axis/constant.js.map +1 -1
  8. package/cjs/axis/grid/base.js.map +1 -1
  9. package/cjs/axis/grid/circle.js.map +1 -1
  10. package/cjs/axis/grid/index.js.map +1 -1
  11. package/cjs/axis/grid/line.js.map +1 -1
  12. package/cjs/axis/grid/type.js.map +1 -1
  13. package/cjs/axis/index.js.map +1 -1
  14. package/cjs/axis/line.js +50 -1
  15. package/cjs/axis/line.js.map +1 -1
  16. package/cjs/axis/mixin/circle.js.map +1 -1
  17. package/cjs/axis/mixin/line.js.map +1 -1
  18. package/cjs/axis/overlap/auto-hide.js.map +1 -1
  19. package/cjs/axis/overlap/auto-limit.js.map +1 -1
  20. package/cjs/axis/overlap/auto-rotate.js +2 -2
  21. package/cjs/axis/overlap/auto-rotate.js.map +1 -1
  22. package/cjs/axis/type.d.ts +1 -0
  23. package/cjs/axis/type.js.map +1 -1
  24. package/cjs/brush/brush.d.ts +1 -0
  25. package/cjs/brush/brush.js +5 -0
  26. package/cjs/brush/brush.js.map +1 -1
  27. package/cjs/brush/config.js.map +1 -1
  28. package/cjs/brush/index.js.map +1 -1
  29. package/cjs/brush/type.js.map +1 -1
  30. package/cjs/constant.js.map +1 -1
  31. package/cjs/core/base.d.ts +2 -1
  32. package/cjs/core/base.js +4 -2
  33. package/cjs/core/base.js.map +1 -1
  34. package/cjs/core/type.js.map +1 -1
  35. package/cjs/crosshair/base.js.map +1 -1
  36. package/cjs/crosshair/circle.js.map +1 -1
  37. package/cjs/crosshair/index.js.map +1 -1
  38. package/cjs/crosshair/line.js.map +1 -1
  39. package/cjs/crosshair/polygon.js.map +1 -1
  40. package/cjs/crosshair/rect.js.map +1 -1
  41. package/cjs/crosshair/sector.js.map +1 -1
  42. package/cjs/crosshair/type.js.map +1 -1
  43. package/cjs/data-zoom/config.js.map +1 -1
  44. package/cjs/data-zoom/data-zoom.js.map +1 -1
  45. package/cjs/data-zoom/index.js.map +1 -1
  46. package/cjs/data-zoom/type.js.map +1 -1
  47. package/cjs/index.d.ts +1 -1
  48. package/cjs/index.js +1 -1
  49. package/cjs/index.js.map +1 -1
  50. package/cjs/indicator/config.js.map +1 -1
  51. package/cjs/indicator/index.js.map +1 -1
  52. package/cjs/indicator/indicator.js.map +1 -1
  53. package/cjs/indicator/type.js.map +1 -1
  54. package/cjs/interface.js.map +1 -1
  55. package/cjs/jsx/component-type.js.map +1 -1
  56. package/cjs/jsx/index.js.map +1 -1
  57. package/cjs/label/animate/animate.js.map +1 -1
  58. package/cjs/label/animate/index.js.map +1 -1
  59. package/cjs/label/arc.d.ts +12 -5
  60. package/cjs/label/arc.js +83 -41
  61. package/cjs/label/arc.js.map +1 -1
  62. package/cjs/label/base.d.ts +12 -9
  63. package/cjs/label/base.js +126 -140
  64. package/cjs/label/base.js.map +1 -1
  65. package/cjs/label/dataLabel.js +4 -4
  66. package/cjs/label/dataLabel.js.map +1 -1
  67. package/cjs/label/index.js.map +1 -1
  68. package/cjs/label/line.js.map +1 -1
  69. package/cjs/label/overlap/bitmap.js.map +1 -1
  70. package/cjs/label/overlap/index.js.map +1 -1
  71. package/cjs/label/overlap/place.d.ts +2 -2
  72. package/cjs/label/overlap/place.js +15 -8
  73. package/cjs/label/overlap/place.js.map +1 -1
  74. package/cjs/label/overlap/scaler.js.map +1 -1
  75. package/cjs/label/polygon.d.ts +12 -0
  76. package/cjs/label/polygon.js +35 -0
  77. package/cjs/label/polygon.js.map +1 -0
  78. package/cjs/label/rect.js.map +1 -1
  79. package/cjs/label/symbol.js.map +1 -1
  80. package/cjs/label/type.d.ts +9 -5
  81. package/cjs/label/type.js.map +1 -1
  82. package/cjs/label/util.js.map +1 -1
  83. package/cjs/legend/base.js.map +1 -1
  84. package/cjs/legend/color/color.js.map +1 -1
  85. package/cjs/legend/color/index.js.map +1 -1
  86. package/cjs/legend/color/type.js.map +1 -1
  87. package/cjs/legend/constant.js.map +1 -1
  88. package/cjs/legend/discrete/discrete.js +28 -27
  89. package/cjs/legend/discrete/discrete.js.map +1 -1
  90. package/cjs/legend/discrete/index.js.map +1 -1
  91. package/cjs/legend/discrete/type.js.map +1 -1
  92. package/cjs/legend/index.js.map +1 -1
  93. package/cjs/legend/size/index.js.map +1 -1
  94. package/cjs/legend/size/size.d.ts +2 -2
  95. package/cjs/legend/size/size.js.map +1 -1
  96. package/cjs/legend/size/type.js.map +1 -1
  97. package/cjs/legend/type.js.map +1 -1
  98. package/cjs/link-path/index.js +1 -2
  99. package/cjs/link-path/index.js.map +1 -1
  100. package/cjs/link-path/link-path.js +2 -1
  101. package/cjs/link-path/link-path.js.map +1 -1
  102. package/cjs/link-path/type.js.map +1 -1
  103. package/cjs/marker/area.d.ts +1 -20
  104. package/cjs/marker/area.js +37 -37
  105. package/cjs/marker/area.js.map +1 -1
  106. package/cjs/marker/base.d.ts +1 -0
  107. package/cjs/marker/base.js +28 -18
  108. package/cjs/marker/base.js.map +1 -1
  109. package/cjs/marker/config.d.ts +1 -1
  110. package/cjs/marker/config.js.map +1 -1
  111. package/cjs/marker/index.js.map +1 -1
  112. package/cjs/marker/line.js +31 -16
  113. package/cjs/marker/line.js.map +1 -1
  114. package/cjs/marker/point.d.ts +7 -7
  115. package/cjs/marker/point.js +6 -5
  116. package/cjs/marker/point.js.map +1 -1
  117. package/cjs/marker/type.d.ts +8 -5
  118. package/cjs/marker/type.js.map +1 -1
  119. package/cjs/marker/util.d.ts +1 -0
  120. package/cjs/marker/util.js +3 -0
  121. package/cjs/marker/util.js.map +1 -0
  122. package/cjs/pager/index.js.map +1 -1
  123. package/cjs/pager/pager.js +4 -2
  124. package/cjs/pager/pager.js.map +1 -1
  125. package/cjs/pager/type.js.map +1 -1
  126. package/cjs/player/base-player.d.ts +9 -1
  127. package/cjs/player/base-player.js +25 -22
  128. package/cjs/player/base-player.js.map +1 -1
  129. package/cjs/player/constant.d.ts +1 -0
  130. package/cjs/player/constant.js +1 -0
  131. package/cjs/player/constant.js.map +1 -1
  132. package/cjs/player/continuous-player.js +6 -6
  133. package/cjs/player/continuous-player.js.map +1 -1
  134. package/cjs/player/controller/assets/index.js.map +1 -1
  135. package/cjs/player/controller/constant.js.map +1 -1
  136. package/cjs/player/controller/controller.d.ts +2 -2
  137. package/cjs/player/controller/controller.js +15 -7
  138. package/cjs/player/controller/controller.js.map +1 -1
  139. package/cjs/player/controller/icon/icon.js.map +1 -1
  140. package/cjs/player/controller/icon/index.js.map +1 -1
  141. package/cjs/player/controller/icon/type.js.map +1 -1
  142. package/cjs/player/controller/index.js.map +1 -1
  143. package/cjs/player/controller/type.d.ts +14 -6
  144. package/cjs/player/controller/type.js.map +1 -1
  145. package/cjs/player/discrete-player.js +11 -11
  146. package/cjs/player/discrete-player.js.map +1 -1
  147. package/cjs/player/index.js.map +1 -1
  148. package/cjs/player/type/base.js.map +1 -1
  149. package/cjs/player/type/continuous-player.d.ts +2 -2
  150. package/cjs/player/type/continuous-player.js.map +1 -1
  151. package/cjs/player/type/direction.js.map +1 -1
  152. package/cjs/player/type/discrete-player.js.map +1 -1
  153. package/cjs/player/type/event.d.ts +12 -6
  154. package/cjs/player/type/event.js +5 -3
  155. package/cjs/player/type/event.js.map +1 -1
  156. package/cjs/player/type/index.js.map +1 -1
  157. package/cjs/player/type/layout.d.ts +5 -2
  158. package/cjs/player/type/layout.js.map +1 -1
  159. package/cjs/player/utils.js.map +1 -1
  160. package/cjs/poptip/contribution.js +3 -1
  161. package/cjs/poptip/contribution.js.map +1 -1
  162. package/cjs/poptip/index.js.map +1 -1
  163. package/cjs/poptip/poptip-plugin.js.map +1 -1
  164. package/cjs/poptip/poptip.js +30 -11
  165. package/cjs/poptip/poptip.js.map +1 -1
  166. package/cjs/poptip/register.d.ts +1 -1
  167. package/cjs/poptip/register.js +8 -6
  168. package/cjs/poptip/register.js.map +1 -1
  169. package/cjs/poptip/theme.js.map +1 -1
  170. package/cjs/poptip/type.d.ts +3 -0
  171. package/cjs/poptip/type.js.map +1 -1
  172. package/cjs/scrollbar/index.js.map +1 -1
  173. package/cjs/scrollbar/scrollbar.js.map +1 -1
  174. package/cjs/scrollbar/type.js.map +1 -1
  175. package/cjs/segment/index.js.map +1 -1
  176. package/cjs/segment/segment.d.ts +11 -6
  177. package/cjs/segment/segment.js +82 -40
  178. package/cjs/segment/segment.js.map +1 -1
  179. package/cjs/segment/type.d.ts +5 -3
  180. package/cjs/segment/type.js.map +1 -1
  181. package/cjs/slider/constant.js.map +1 -1
  182. package/cjs/slider/index.js.map +1 -1
  183. package/cjs/slider/slider.js.map +1 -1
  184. package/cjs/slider/type.js.map +1 -1
  185. package/cjs/tag/index.js.map +1 -1
  186. package/cjs/tag/tag.js.map +1 -1
  187. package/cjs/tag/type.js.map +1 -1
  188. package/cjs/title/index.js.map +1 -1
  189. package/cjs/title/title.js.map +1 -1
  190. package/cjs/title/type.js.map +1 -1
  191. package/cjs/tooltip/config.js.map +1 -1
  192. package/cjs/tooltip/index.js.map +1 -1
  193. package/cjs/tooltip/tooltip.js.map +1 -1
  194. package/cjs/tooltip/type.js.map +1 -1
  195. package/cjs/tooltip/util.js.map +1 -1
  196. package/cjs/util/align.js.map +1 -1
  197. package/cjs/util/common.js.map +1 -1
  198. package/cjs/util/index.d.ts +1 -1
  199. package/cjs/util/index.js +1 -1
  200. package/cjs/util/index.js.map +1 -1
  201. package/cjs/util/{labelSmartInvert.d.ts → label-smartInvert.d.ts} +1 -0
  202. package/cjs/util/{labelSmartInvert.js → label-smartInvert.js} +21 -3
  203. package/cjs/util/label-smartInvert.js.map +1 -0
  204. package/cjs/util/limit-shape.d.ts +3 -0
  205. package/cjs/util/limit-shape.js +14 -0
  206. package/cjs/util/limit-shape.js.map +1 -0
  207. package/cjs/util/matrix.js.map +1 -1
  208. package/cjs/util/text.js +3 -3
  209. package/cjs/util/text.js.map +1 -1
  210. package/dist/index.js +787 -484
  211. package/dist/index.min.js +1 -1
  212. package/es/axis/animate/group-fade.js.map +1 -1
  213. package/es/axis/animate/group-transition.js.map +1 -1
  214. package/es/axis/animate/index.js.map +1 -1
  215. package/es/axis/base.js.map +1 -1
  216. package/es/axis/circle.js.map +1 -1
  217. package/es/axis/config.js.map +1 -1
  218. package/es/axis/constant.js.map +1 -1
  219. package/es/axis/grid/base.js.map +1 -1
  220. package/es/axis/grid/circle.js.map +1 -1
  221. package/es/axis/grid/index.js.map +1 -1
  222. package/es/axis/grid/line.js.map +1 -1
  223. package/es/axis/grid/type.js.map +1 -1
  224. package/es/axis/index.js.map +1 -1
  225. package/es/axis/line.js +50 -2
  226. package/es/axis/line.js.map +1 -1
  227. package/es/axis/mixin/circle.js.map +1 -1
  228. package/es/axis/mixin/line.js.map +1 -1
  229. package/es/axis/overlap/auto-hide.js.map +1 -1
  230. package/es/axis/overlap/auto-limit.js.map +1 -1
  231. package/es/axis/overlap/auto-rotate.js +2 -2
  232. package/es/axis/overlap/auto-rotate.js.map +1 -1
  233. package/es/axis/type.d.ts +1 -0
  234. package/es/axis/type.js.map +1 -1
  235. package/es/brush/brush.d.ts +1 -0
  236. package/es/brush/brush.js +5 -0
  237. package/es/brush/brush.js.map +1 -1
  238. package/es/brush/config.js.map +1 -1
  239. package/es/brush/index.js.map +1 -1
  240. package/es/brush/type.js.map +1 -1
  241. package/es/constant.js.map +1 -1
  242. package/es/core/base.d.ts +2 -1
  243. package/es/core/base.js +3 -3
  244. package/es/core/base.js.map +1 -1
  245. package/es/core/type.js.map +1 -1
  246. package/es/crosshair/base.js.map +1 -1
  247. package/es/crosshair/circle.js.map +1 -1
  248. package/es/crosshair/index.js.map +1 -1
  249. package/es/crosshair/line.js.map +1 -1
  250. package/es/crosshair/polygon.js.map +1 -1
  251. package/es/crosshair/rect.js.map +1 -1
  252. package/es/crosshair/sector.js.map +1 -1
  253. package/es/crosshair/type.js.map +1 -1
  254. package/es/data-zoom/config.js.map +1 -1
  255. package/es/data-zoom/data-zoom.js.map +1 -1
  256. package/es/data-zoom/index.js.map +1 -1
  257. package/es/data-zoom/type.js.map +1 -1
  258. package/es/index.d.ts +1 -1
  259. package/es/index.js +1 -1
  260. package/es/index.js.map +1 -1
  261. package/es/indicator/config.js.map +1 -1
  262. package/es/indicator/index.js.map +1 -1
  263. package/es/indicator/indicator.js.map +1 -1
  264. package/es/indicator/type.js.map +1 -1
  265. package/es/interface.js.map +1 -1
  266. package/es/jsx/component-type.js.map +1 -1
  267. package/es/jsx/index.js.map +1 -1
  268. package/es/label/animate/animate.js.map +1 -1
  269. package/es/label/animate/index.js.map +1 -1
  270. package/es/label/arc.d.ts +12 -5
  271. package/es/label/arc.js +83 -39
  272. package/es/label/arc.js.map +1 -1
  273. package/es/label/base.d.ts +12 -9
  274. package/es/label/base.js +124 -135
  275. package/es/label/base.js.map +1 -1
  276. package/es/label/dataLabel.js +5 -3
  277. package/es/label/dataLabel.js.map +1 -1
  278. package/es/label/index.js.map +1 -1
  279. package/es/label/line.js.map +1 -1
  280. package/es/label/overlap/bitmap.js.map +1 -1
  281. package/es/label/overlap/index.js.map +1 -1
  282. package/es/label/overlap/place.d.ts +2 -2
  283. package/es/label/overlap/place.js +15 -8
  284. package/es/label/overlap/place.js.map +1 -1
  285. package/es/label/overlap/scaler.js.map +1 -1
  286. package/es/label/polygon.d.ts +12 -0
  287. package/es/label/polygon.js +31 -0
  288. package/es/label/polygon.js.map +1 -0
  289. package/es/label/rect.js.map +1 -1
  290. package/es/label/symbol.js.map +1 -1
  291. package/es/label/type.d.ts +9 -5
  292. package/es/label/type.js.map +1 -1
  293. package/es/label/util.js.map +1 -1
  294. package/es/legend/base.js.map +1 -1
  295. package/es/legend/color/color.js.map +1 -1
  296. package/es/legend/color/index.js.map +1 -1
  297. package/es/legend/color/type.js.map +1 -1
  298. package/es/legend/constant.js.map +1 -1
  299. package/es/legend/discrete/discrete.js +26 -25
  300. package/es/legend/discrete/discrete.js.map +1 -1
  301. package/es/legend/discrete/index.js.map +1 -1
  302. package/es/legend/discrete/type.js.map +1 -1
  303. package/es/legend/index.js.map +1 -1
  304. package/es/legend/size/index.js.map +1 -1
  305. package/es/legend/size/size.d.ts +2 -2
  306. package/es/legend/size/size.js.map +1 -1
  307. package/es/legend/size/type.js.map +1 -1
  308. package/es/legend/type.js.map +1 -1
  309. package/es/link-path/index.js +1 -2
  310. package/es/link-path/index.js.map +1 -1
  311. package/es/link-path/link-path.js +2 -1
  312. package/es/link-path/link-path.js.map +1 -1
  313. package/es/link-path/type.js.map +1 -1
  314. package/es/marker/area.d.ts +1 -20
  315. package/es/marker/area.js +38 -36
  316. package/es/marker/area.js.map +1 -1
  317. package/es/marker/base.d.ts +1 -0
  318. package/es/marker/base.js +27 -19
  319. package/es/marker/base.js.map +1 -1
  320. package/es/marker/config.d.ts +1 -1
  321. package/es/marker/config.js.map +1 -1
  322. package/es/marker/index.js.map +1 -1
  323. package/es/marker/line.js +32 -15
  324. package/es/marker/line.js.map +1 -1
  325. package/es/marker/point.d.ts +7 -7
  326. package/es/marker/point.js +6 -5
  327. package/es/marker/point.js.map +1 -1
  328. package/es/marker/type.d.ts +8 -5
  329. package/es/marker/type.js.map +1 -1
  330. package/es/marker/util.d.ts +1 -0
  331. package/es/marker/util.js +3 -0
  332. package/es/marker/util.js.map +1 -0
  333. package/es/pager/index.js.map +1 -1
  334. package/es/pager/pager.js +4 -2
  335. package/es/pager/pager.js.map +1 -1
  336. package/es/pager/type.js.map +1 -1
  337. package/es/player/base-player.d.ts +9 -1
  338. package/es/player/base-player.js +25 -22
  339. package/es/player/base-player.js.map +1 -1
  340. package/es/player/constant.d.ts +1 -0
  341. package/es/player/constant.js +1 -0
  342. package/es/player/constant.js.map +1 -1
  343. package/es/player/continuous-player.js +6 -6
  344. package/es/player/continuous-player.js.map +1 -1
  345. package/es/player/controller/assets/index.js.map +1 -1
  346. package/es/player/controller/constant.js.map +1 -1
  347. package/es/player/controller/controller.d.ts +2 -2
  348. package/es/player/controller/controller.js +15 -7
  349. package/es/player/controller/controller.js.map +1 -1
  350. package/es/player/controller/icon/icon.js.map +1 -1
  351. package/es/player/controller/icon/index.js.map +1 -1
  352. package/es/player/controller/icon/type.js.map +1 -1
  353. package/es/player/controller/index.js.map +1 -1
  354. package/es/player/controller/type.d.ts +14 -6
  355. package/es/player/controller/type.js.map +1 -1
  356. package/es/player/discrete-player.js +10 -10
  357. package/es/player/discrete-player.js.map +1 -1
  358. package/es/player/index.js.map +1 -1
  359. package/es/player/type/base.js.map +1 -1
  360. package/es/player/type/continuous-player.d.ts +2 -2
  361. package/es/player/type/continuous-player.js.map +1 -1
  362. package/es/player/type/direction.js.map +1 -1
  363. package/es/player/type/discrete-player.js.map +1 -1
  364. package/es/player/type/event.d.ts +12 -6
  365. package/es/player/type/event.js +5 -3
  366. package/es/player/type/event.js.map +1 -1
  367. package/es/player/type/index.js.map +1 -1
  368. package/es/player/type/layout.d.ts +5 -2
  369. package/es/player/type/layout.js.map +1 -1
  370. package/es/player/utils.js.map +1 -1
  371. package/es/poptip/contribution.js +3 -1
  372. package/es/poptip/contribution.js.map +1 -1
  373. package/es/poptip/index.js.map +1 -1
  374. package/es/poptip/poptip-plugin.js.map +1 -1
  375. package/es/poptip/poptip.js +31 -9
  376. package/es/poptip/poptip.js.map +1 -1
  377. package/es/poptip/register.d.ts +1 -1
  378. package/es/poptip/register.js +7 -6
  379. package/es/poptip/register.js.map +1 -1
  380. package/es/poptip/theme.js.map +1 -1
  381. package/es/poptip/type.d.ts +3 -0
  382. package/es/poptip/type.js.map +1 -1
  383. package/es/scrollbar/index.js.map +1 -1
  384. package/es/scrollbar/scrollbar.js.map +1 -1
  385. package/es/scrollbar/type.js.map +1 -1
  386. package/es/segment/index.js.map +1 -1
  387. package/es/segment/segment.d.ts +11 -6
  388. package/es/segment/segment.js +81 -41
  389. package/es/segment/segment.js.map +1 -1
  390. package/es/segment/type.d.ts +5 -3
  391. package/es/segment/type.js.map +1 -1
  392. package/es/slider/constant.js.map +1 -1
  393. package/es/slider/index.js.map +1 -1
  394. package/es/slider/slider.js.map +1 -1
  395. package/es/slider/type.js.map +1 -1
  396. package/es/tag/index.js.map +1 -1
  397. package/es/tag/tag.js.map +1 -1
  398. package/es/tag/type.js.map +1 -1
  399. package/es/title/index.js.map +1 -1
  400. package/es/title/title.js.map +1 -1
  401. package/es/title/type.js.map +1 -1
  402. package/es/tooltip/config.js.map +1 -1
  403. package/es/tooltip/index.js.map +1 -1
  404. package/es/tooltip/tooltip.js.map +1 -1
  405. package/es/tooltip/type.js.map +1 -1
  406. package/es/tooltip/util.js.map +1 -1
  407. package/es/util/align.js.map +1 -1
  408. package/es/util/common.js.map +1 -1
  409. package/es/util/index.d.ts +1 -1
  410. package/es/util/index.js +1 -1
  411. package/es/util/index.js.map +1 -1
  412. package/es/util/{labelSmartInvert.d.ts → label-smartInvert.d.ts} +1 -0
  413. package/es/util/{labelSmartInvert.js → label-smartInvert.js} +18 -1
  414. package/es/util/label-smartInvert.js.map +1 -0
  415. package/es/util/limit-shape.d.ts +3 -0
  416. package/es/util/limit-shape.js +8 -0
  417. package/es/util/limit-shape.js.map +1 -0
  418. package/es/util/matrix.js.map +1 -1
  419. package/es/util/text.js +3 -3
  420. package/es/util/text.js.map +1 -1
  421. package/package.json +4 -4
  422. package/cjs/util/labelSmartInvert.js.map +0 -1
  423. package/es/util/labelSmartInvert.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["data-zoom/type.ts"],"names":[],"mappings":"","file":"type.js","sourcesContent":["import type {\n IAreaGraphicAttribute,\n ICurveType,\n IGroupGraphicAttribute,\n ILineGraphicAttribute,\n IRectGraphicAttribute,\n ISymbolGraphicAttribute\n} from '@visactor/vrender';\nimport type { IPointLike } from '@visactor/vutils';\nimport type { OrientType } from '../interface';\nimport type { TagAttributes } from '../tag';\n\nexport interface DataZoomAttributes extends IGroupGraphicAttribute {\n /**\n * DataZoom位置\n */\n position: IPointLike;\n /**\n * DataZoom 尺寸\n */\n size: {\n width: number;\n height: number;\n };\n /**\n * DataZoom方向\n * @default 'bottom'\n */\n orient?: OrientType;\n\n /**\n * 起点配置(比例):范围[0, 1]\n * @default 0\n */\n start?: number;\n\n /**\n * 终点配置(比例):范围[0, 1]\n * @default 1\n */\n end?: number;\n\n /**\n * 背景样式\n */\n backgroundStyle?: IRectGraphicAttribute;\n\n /**\n * 起点手柄样式\n */\n startHandlerStyle?: ISymbolGraphicAttribute;\n\n /**\n * 中间手柄样式\n */\n middleHandlerStyle?: {\n /**\n * 是否显示\n * @default false\n */\n visible?: boolean;\n /**\n * 中间手柄的中间symbol样式\n */\n icon?: ISymbolGraphicAttribute;\n /**\n * 中间手柄的背景rect样式\n */\n background?: {\n style?: IRectGraphicAttribute;\n size?: number;\n };\n };\n\n /**\n * 终点手柄样式\n */\n endHandlerStyle?: ISymbolGraphicAttribute;\n\n /**\n * 起点文字样式\n */\n startTextStyle?: {\n formatMethod?: (text: string | number) => (string | number) | (string | number)[];\n } & Partial<TagAttributes>;\n\n /**\n * 终点文字样式\n */\n endTextStyle?: {\n formatMethod?: (text: string | number) => (string | number) | (string | number)[];\n } & Partial<TagAttributes>;\n\n /**\n * 选中背景样式\n */\n selectedBackgroundStyle?: IRectGraphicAttribute;\n\n /**\n * 拖拽进行中的选中背景样式\n */\n dragMaskStyle?: IRectGraphicAttribute;\n\n /**\n * 背景图表样式\n */\n backgroundChartStyle?: {\n line?: {\n visible?: boolean;\n } & ILineGraphicAttribute;\n area?: {\n /**\n * @default true\n */\n visible?: boolean;\n curveType?: ICurveType;\n } & Omit<IAreaGraphicAttribute, 'curveType'>;\n };\n\n /**\n * 选中的背景图表样式\n */\n selectedBackgroundChartStyle?: {\n line?: {\n /**\n * @default true\n */\n visible?: boolean;\n } & ILineGraphicAttribute;\n area?: {\n /**\n * @default true\n */\n visible?: boolean;\n curveType?: ICurveType;\n } & Omit<IAreaGraphicAttribute, 'curveType'>;\n };\n\n /**\n * 是否显示startText和endText\n * @default 'auto' 鼠标hover在选中区域时才显示startText和endText\n */\n showDetail?: 'auto' | boolean;\n\n /**\n * 是否开启框选, 如果不开启则支持selectedBackground拖拽(框选和拖拽两者互斥)\n * @default true\n */\n brushSelect?: boolean;\n\n /**\n * todo: 是否锁定选择区域(或叫做数据窗口)的大小\n */\n zoomLock?: boolean;\n\n /**\n * 绘制背景图表的数据 & 映射函数\n */\n previewData?: any[];\n previewCallbackX?: (datum: any) => number;\n previewCallbackY?: (datum: any) => number;\n previewCallbackX1?: (datum: any) => number;\n previewCallbackY1?: (datum: any) => number;\n updateStateCallback?: (start: number, end: number) => any;\n}\n"]}
1
+ {"version":3,"sources":["../src/data-zoom/type.ts"],"names":[],"mappings":"","file":"type.js","sourcesContent":["import type {\n IAreaGraphicAttribute,\n ICurveType,\n IGroupGraphicAttribute,\n ILineGraphicAttribute,\n IRectGraphicAttribute,\n ISymbolGraphicAttribute\n} from '@visactor/vrender';\nimport type { IPointLike } from '@visactor/vutils';\nimport type { OrientType } from '../interface';\nimport type { TagAttributes } from '../tag';\n\nexport interface DataZoomAttributes extends IGroupGraphicAttribute {\n /**\n * DataZoom位置\n */\n position: IPointLike;\n /**\n * DataZoom 尺寸\n */\n size: {\n width: number;\n height: number;\n };\n /**\n * DataZoom方向\n * @default 'bottom'\n */\n orient?: OrientType;\n\n /**\n * 起点配置(比例):范围[0, 1]\n * @default 0\n */\n start?: number;\n\n /**\n * 终点配置(比例):范围[0, 1]\n * @default 1\n */\n end?: number;\n\n /**\n * 背景样式\n */\n backgroundStyle?: IRectGraphicAttribute;\n\n /**\n * 起点手柄样式\n */\n startHandlerStyle?: ISymbolGraphicAttribute;\n\n /**\n * 中间手柄样式\n */\n middleHandlerStyle?: {\n /**\n * 是否显示\n * @default false\n */\n visible?: boolean;\n /**\n * 中间手柄的中间symbol样式\n */\n icon?: ISymbolGraphicAttribute;\n /**\n * 中间手柄的背景rect样式\n */\n background?: {\n style?: IRectGraphicAttribute;\n size?: number;\n };\n };\n\n /**\n * 终点手柄样式\n */\n endHandlerStyle?: ISymbolGraphicAttribute;\n\n /**\n * 起点文字样式\n */\n startTextStyle?: {\n formatMethod?: (text: string | number) => (string | number) | (string | number)[];\n } & Partial<TagAttributes>;\n\n /**\n * 终点文字样式\n */\n endTextStyle?: {\n formatMethod?: (text: string | number) => (string | number) | (string | number)[];\n } & Partial<TagAttributes>;\n\n /**\n * 选中背景样式\n */\n selectedBackgroundStyle?: IRectGraphicAttribute;\n\n /**\n * 拖拽进行中的选中背景样式\n */\n dragMaskStyle?: IRectGraphicAttribute;\n\n /**\n * 背景图表样式\n */\n backgroundChartStyle?: {\n line?: {\n visible?: boolean;\n } & ILineGraphicAttribute;\n area?: {\n /**\n * @default true\n */\n visible?: boolean;\n curveType?: ICurveType;\n } & Omit<IAreaGraphicAttribute, 'curveType'>;\n };\n\n /**\n * 选中的背景图表样式\n */\n selectedBackgroundChartStyle?: {\n line?: {\n /**\n * @default true\n */\n visible?: boolean;\n } & ILineGraphicAttribute;\n area?: {\n /**\n * @default true\n */\n visible?: boolean;\n curveType?: ICurveType;\n } & Omit<IAreaGraphicAttribute, 'curveType'>;\n };\n\n /**\n * 是否显示startText和endText\n * @default 'auto' 鼠标hover在选中区域时才显示startText和endText\n */\n showDetail?: 'auto' | boolean;\n\n /**\n * 是否开启框选, 如果不开启则支持selectedBackground拖拽(框选和拖拽两者互斥)\n * @default true\n */\n brushSelect?: boolean;\n\n /**\n * todo: 是否锁定选择区域(或叫做数据窗口)的大小\n */\n zoomLock?: boolean;\n\n /**\n * 绘制背景图表的数据 & 映射函数\n */\n previewData?: any[];\n previewCallbackX?: (datum: any) => number;\n previewCallbackY?: (datum: any) => number;\n previewCallbackX1?: (datum: any) => number;\n previewCallbackY1?: (datum: any) => number;\n updateStateCallback?: (start: number, end: number) => any;\n}\n"]}
package/cjs/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const version = "0.15.0-alpha.6";
1
+ export declare const version = "0.15.1";
2
2
  export * from './core/base';
3
3
  export * from './scrollbar';
4
4
  export * from './tag';
package/cjs/index.js CHANGED
@@ -17,7 +17,7 @@ var __createBinding = this && this.__createBinding || (Object.create ? function(
17
17
 
18
18
  Object.defineProperty(exports, "__esModule", {
19
19
  value: !0
20
- }), exports.version = void 0, exports.version = "0.15.0-alpha.6", __exportStar(require("./core/base"), exports),
20
+ }), exports.version = void 0, exports.version = "0.15.1", __exportStar(require("./core/base"), exports),
21
21
  __exportStar(require("./scrollbar"), exports), __exportStar(require("./tag"), exports),
22
22
  __exportStar(require("./poptip"), exports), __exportStar(require("./crosshair"), exports),
23
23
  __exportStar(require("./label"), exports), __exportStar(require("./axis"), exports),
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACa,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAExC,8CAA4B;AAC5B,8CAA4B;AAC5B,wCAAsB;AACtB,2CAAyB;AACzB,8CAA4B;AAC5B,0CAAwB;AACxB,yCAAuB;AACvB,8CAA4B;AAC5B,4CAA0B;AAC1B,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,8CAA4B;AAC5B,2CAAyB;AACzB,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,4CAA0B;AAC1B,8CAA4B;AAC5B,wCAAsB","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.15.0-alpha.6\";\n\nexport * from './core/base';\nexport * from './scrollbar';\nexport * from './tag';\nexport * from './poptip';\nexport * from './crosshair';\nexport * from './label';\nexport * from './axis';\nexport * from './axis/grid';\nexport * from './segment';\nexport * from './data-zoom';\nexport * from './marker';\nexport * from './pager';\nexport * from './legend';\nexport * from './title';\nexport * from './indicator';\nexport * from './slider';\nexport * from './link-path';\nexport * from './player';\nexport * from './brush';\nexport * from './tooltip';\nexport * from './interface';\nexport * from './jsx';\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACa,QAAA,OAAO,GAAG,QAAQ,CAAC;AAEhC,8CAA4B;AAC5B,8CAA4B;AAC5B,wCAAsB;AACtB,2CAAyB;AACzB,8CAA4B;AAC5B,0CAAwB;AACxB,yCAAuB;AACvB,8CAA4B;AAC5B,4CAA0B;AAC1B,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,8CAA4B;AAC5B,2CAAyB;AACzB,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,4CAA0B;AAC1B,8CAA4B;AAC5B,wCAAsB","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.15.1\";\n\nexport * from './core/base';\nexport * from './scrollbar';\nexport * from './tag';\nexport * from './poptip';\nexport * from './crosshair';\nexport * from './label';\nexport * from './axis';\nexport * from './axis/grid';\nexport * from './segment';\nexport * from './data-zoom';\nexport * from './marker';\nexport * from './pager';\nexport * from './legend';\nexport * from './title';\nexport * from './indicator';\nexport * from './slider';\nexport * from './link-path';\nexport * from './player';\nexport * from './brush';\nexport * from './tooltip';\nexport * from './interface';\nexport * from './jsx';\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["indicator/config.ts"],"names":[],"mappings":";;;AACa,QAAA,uBAAuB,GAAiC;IACnE,KAAK,EAAE;QACL,KAAK,EAAE;YACL,IAAI,EAAE,EAAE;YACR,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,OAAO;YACb,UAAU,EAAE,QAAQ;YACpB,WAAW,EAAE,CAAC;YACd,YAAY,EAAE,KAAK;YACnB,SAAS,EAAE,QAAQ;SACpB;KACF;IACD,OAAO,EAAE;QACP,KAAK,EAAE;YACL,IAAI,EAAE,EAAE;YACR,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,OAAO;YACb,UAAU,EAAE,QAAQ;YACpB,WAAW,EAAE,CAAC;YACd,YAAY,EAAE,KAAK;YACnB,SAAS,EAAE,QAAQ;SACpB;KACF;CACF,CAAC","file":"config.js","sourcesContent":["import { IndicatorAttributes } from './type';\nexport const DEFAULT_INDICATOR_THEME: Partial<IndicatorAttributes> = {\n title: {\n style: {\n text: '',\n fontSize: 20,\n fill: 'black',\n fontWeight: 'normal',\n fillOpacity: 1,\n textBaseline: 'top',\n textAlign: 'center'\n }\n },\n content: {\n style: {\n text: '',\n fontSize: 16,\n fill: 'black',\n fontWeight: 'normal',\n fillOpacity: 1,\n textBaseline: 'top',\n textAlign: 'center'\n }\n }\n};\n"]}
1
+ {"version":3,"sources":["../src/indicator/config.ts"],"names":[],"mappings":";;;AACa,QAAA,uBAAuB,GAAiC;IACnE,KAAK,EAAE;QACL,KAAK,EAAE;YACL,IAAI,EAAE,EAAE;YACR,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,OAAO;YACb,UAAU,EAAE,QAAQ;YACpB,WAAW,EAAE,CAAC;YACd,YAAY,EAAE,KAAK;YACnB,SAAS,EAAE,QAAQ;SACpB;KACF;IACD,OAAO,EAAE;QACP,KAAK,EAAE;YACL,IAAI,EAAE,EAAE;YACR,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,OAAO;YACb,UAAU,EAAE,QAAQ;YACpB,WAAW,EAAE,CAAC;YACd,YAAY,EAAE,KAAK;YACnB,SAAS,EAAE,QAAQ;SACpB;KACF;CACF,CAAC","file":"config.js","sourcesContent":["import { IndicatorAttributes } from './type';\nexport const DEFAULT_INDICATOR_THEME: Partial<IndicatorAttributes> = {\n title: {\n style: {\n text: '',\n fontSize: 20,\n fill: 'black',\n fontWeight: 'normal',\n fillOpacity: 1,\n textBaseline: 'top',\n textAlign: 'center'\n }\n },\n content: {\n style: {\n text: '',\n fontSize: 16,\n fill: 'black',\n fontWeight: 'normal',\n fillOpacity: 1,\n textBaseline: 'top',\n textAlign: 'center'\n }\n }\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["indicator/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,yCAAuB","file":"index.js","sourcesContent":["export * from './indicator';\nexport * from './type';\n"]}
1
+ {"version":3,"sources":["../src/indicator/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,yCAAuB","file":"index.js","sourcesContent":["export * from './indicator';\nexport * from './type';\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["indicator/indicator.ts"],"names":[],"mappings":";;;AAIA,6CAA6E;AAC7E,uCAAiD;AACjD,kCAA0C;AAE1C,qCAAmD;AAEnD,MAAa,SAAU,SAAQ,wBAAgD;IAA/E;;QACE,SAAI,GAAG,WAAW,CAAC;IA0HrB,CAAC;IArHW,MAAM;;QACd,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,GAAG,QAAQ,EAAE,GAAG,IAAI,CAAC,SAAgC,CAAC;QAEvG,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,UAAU,CAAC;QAE7D,MAAM,KAAK,GAAG,IAAI,CAAC,mBAAmB,CAAC,qBAAqB,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,OAAO,CAAW,CAAC;QAG5G,IAAI,OAAO,KAAK,IAAI,EAAE;YACpB,KAAK,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;YACzB,OAAO;SACR;QAED,IAAI,IAAA,gBAAO,EAAC,KAAK,CAAC,EAAE;YAClB,IAAI,KAAK,CAAC,OAAO,KAAK,KAAK,EAAE;gBAC3B,MAAM,UAAU,GAAG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UAAU,mCAAI,GAAG,CAAC,CAAC,GAAG,WAAW,CAAC;YAC5E,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,MAAA,MAAA,iBAAiB,CAAC,KAAK,0CAAE,QAAQ,mCAAI,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC;YAC/E,aAAa,CAAC,YAAY,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;YACjD,aAAa,CAAC,YAAY,CACxB,YAAY,EACZ,IAAA,gBAAO,EAAC,iBAAiB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,CAC5F,CAAC;SACH;IACH,CAAC;CACF;AA3HD,8BA2HC","file":"indicator.js","sourcesContent":["/**\n * @description 指标卡组件\n */\nimport { IGroup, INode, IText } from '@visactor/vrender';\nimport { merge, isValid, array, isValidNumber, get } from '@visactor/vutils';\nimport { AbstractComponent } from '../core/base';\nimport { measureTextSize } from '../util';\nimport { IndicatorAttributes, IndicatorItemSpec } from './type';\nimport { DEFAULT_INDICATOR_THEME } from './config';\n\nexport class Indicator extends AbstractComponent<Required<IndicatorAttributes>> {\n name = 'indicator';\n\n private _title?: IText;\n private _content?: IText | IText[];\n\n protected render() {\n const { visible, title, content, size, limitRatio = Infinity } = this.attribute as IndicatorAttributes;\n\n const limit = Math.min(size.width, size.height) * limitRatio;\n\n const group = this.createOrUpdateChild('indicator-container', { x: 0, y: 0, zIndex: 1 }, 'group') as IGroup;\n\n // 指标卡全部隐藏\n if (visible !== true) {\n group && group.hideAll();\n return;\n }\n\n if (isValid(title)) {\n if (title.visible !== false) {\n const titleStyle = merge({}, get(DEFAULT_INDICATOR_THEME, 'title.style'), title.style);\n this._title = group.createOrUpdateChild(\n 'indicator-title',\n {\n ...titleStyle,\n /**\n * 加入以下逻辑:如果没有声明lineHeight,默认 lineHeight 等于 fontSize\n * 因为如果不声明 vrender 底层会默认给文本加上 2px 的高度,会影响布局计算\n * 注意:在autoFit改变fontsize时,lineHeight也要同步修改\n */\n lineHeight: isValid(titleStyle.lineHeight) ? titleStyle.lineHeight : titleStyle.fontSize,\n visible: title.visible,\n x: 0,\n y: 0\n },\n 'text'\n ) as IText;\n\n // auto-fit\n if (title.autoFit && isValidNumber(limit)) {\n this._setAutoFit(limit, this._title, title);\n }\n\n //auto-limit\n if (title.autoLimit && isValidNumber(limitRatio)) {\n this._title.setAttribute('maxLineWidth', limit);\n }\n } else {\n /**\n * indicator部分隐藏\n * 例如title隐藏了,content还保留。直接设置visible:false 计算group.AABBounts是错的,影响上下居中。\n * 这里把隐藏的nodes删除后,group.AABBounts计算才正确。\n */\n const titleNode = group.find(node => node.name === 'indicator-title', false);\n titleNode && group.removeChild(titleNode as INode);\n this._title = undefined;\n }\n }\n\n const titleHeight = this._title ? this._title.AABBBounds.height() : 0;\n\n if (isValid(content)) {\n const titleSpace = this._title ? (title?.space ? title.space : 0) : 0;\n const contents: IndicatorItemSpec[] = array(content);\n const contentComponents: IText[] = [];\n let lastContentHeight = 0;\n contents.forEach((contentItem, i) => {\n if (contentItem.visible !== false) {\n const contentStyle = merge({}, get(DEFAULT_INDICATOR_THEME, 'content.style'), contentItem.style);\n const contentComponent = group.createOrUpdateChild(\n 'indicator-content-' + i,\n {\n ...contentStyle,\n lineHeight: isValid(contentStyle.lineHeight) ? contentStyle.lineHeight : contentStyle.fontSize,\n visible: contentItem.visible,\n x: 0,\n y: titleHeight + titleSpace + lastContentHeight\n },\n 'text'\n ) as IText;\n\n // auto-fit\n if (contentItem.autoFit && isValidNumber(limit)) {\n this._setAutoFit(limit, contentComponent, contentItem);\n }\n\n //auto-limit\n if (contentItem.autoLimit && isValidNumber(limitRatio)) {\n contentComponent.setAttribute('maxLineWidth', limit);\n }\n\n contentComponents.push(contentComponent);\n const contentSpace = contentItem?.space ? contentItem.space : 0;\n lastContentHeight += contentComponent.AABBBounds.height() + contentSpace;\n } else {\n /**\n * indicator部分隐藏\n */\n const contentItemNode = group.find(node => node.name === 'indicator-content-' + i, false);\n contentItemNode && group.removeChild(contentItemNode as INode);\n }\n });\n this._content = contentComponents;\n }\n\n const totalHeight = group?.AABBBounds.height() ?? 0;\n group.setAttribute('y', size.height / 2 - totalHeight / 2);\n group.setAttribute('x', size.width / 2);\n }\n\n private _setAutoFit(limit: number, indicatorItem: IText, indicatorItemSpec: IndicatorItemSpec) {\n const originWidth = measureTextSize(indicatorItemSpec.style?.text ?? '', indicatorItemSpec.style ?? {}).width;\n if (originWidth > 0) {\n const ratio = (limit * (indicatorItemSpec.fitPercent ?? 0.5)) / originWidth;\n const fontSize = Math.floor((indicatorItemSpec.style?.fontSize ?? 20) * ratio);\n indicatorItem.setAttribute('fontSize', fontSize);\n indicatorItem.setAttribute(\n 'lineHeight',\n isValid(indicatorItemSpec.style.lineHeight) ? indicatorItemSpec.style.lineHeight : fontSize\n );\n }\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/indicator/indicator.ts"],"names":[],"mappings":";;;AAIA,6CAA6E;AAC7E,uCAAiD;AACjD,kCAA0C;AAE1C,qCAAmD;AAEnD,MAAa,SAAU,SAAQ,wBAAgD;IAA/E;;QACE,SAAI,GAAG,WAAW,CAAC;IA0HrB,CAAC;IArHW,MAAM;;QACd,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,GAAG,QAAQ,EAAE,GAAG,IAAI,CAAC,SAAgC,CAAC;QAEvG,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,UAAU,CAAC;QAE7D,MAAM,KAAK,GAAG,IAAI,CAAC,mBAAmB,CAAC,qBAAqB,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,OAAO,CAAW,CAAC;QAG5G,IAAI,OAAO,KAAK,IAAI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AAI,mCAAI,EAAE,EAAE,MAAA,iBAAiB,CAAC,KAAK,mCAAI,EAAE,CAAC,CAAC,KAAK,CAAC;QAC9G,IAAI,WAAW,GAAG,CAAC,EAAE;YACnB,MAAM,KAAK,GAAG,CAAC,KAAK,GAAG,CAAC,MAAA,iBAAiB,CAAC,UAAU,mCAAI,GAAG,CAAC,CAAC,GAAG,WAAW,CAAC;YAC5E,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,MAAA,MAAA,iBAAiB,CAAC,KAAK,0CAAE,QAAQ,mCAAI,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC;YAC/E,aAAa,CAAC,YAAY,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;YACjD,aAAa,CAAC,YAAY,CACxB,YAAY,EACZ,IAAA,gBAAO,EAAC,iBAAiB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,CAC5F,CAAC;SACH;IACH,CAAC;CACF;AA3HD,8BA2HC","file":"indicator.js","sourcesContent":["/**\n * @description 指标卡组件\n */\nimport { IGroup, INode, IText } from '@visactor/vrender';\nimport { merge, isValid, array, isValidNumber, get } from '@visactor/vutils';\nimport { AbstractComponent } from '../core/base';\nimport { measureTextSize } from '../util';\nimport { IndicatorAttributes, IndicatorItemSpec } from './type';\nimport { DEFAULT_INDICATOR_THEME } from './config';\n\nexport class Indicator extends AbstractComponent<Required<IndicatorAttributes>> {\n name = 'indicator';\n\n private _title?: IText;\n private _content?: IText | IText[];\n\n protected render() {\n const { visible, title, content, size, limitRatio = Infinity } = this.attribute as IndicatorAttributes;\n\n const limit = Math.min(size.width, size.height) * limitRatio;\n\n const group = this.createOrUpdateChild('indicator-container', { x: 0, y: 0, zIndex: 1 }, 'group') as IGroup;\n\n // 指标卡全部隐藏\n if (visible !== true) {\n group && group.hideAll();\n return;\n }\n\n if (isValid(title)) {\n if (title.visible !== false) {\n const titleStyle = merge({}, get(DEFAULT_INDICATOR_THEME, 'title.style'), title.style);\n this._title = group.createOrUpdateChild(\n 'indicator-title',\n {\n ...titleStyle,\n /**\n * 加入以下逻辑:如果没有声明lineHeight,默认 lineHeight 等于 fontSize\n * 因为如果不声明 vrender 底层会默认给文本加上 2px 的高度,会影响布局计算\n * 注意:在autoFit改变fontsize时,lineHeight也要同步修改\n */\n lineHeight: isValid(titleStyle.lineHeight) ? titleStyle.lineHeight : titleStyle.fontSize,\n visible: title.visible,\n x: 0,\n y: 0\n },\n 'text'\n ) as IText;\n\n // auto-fit\n if (title.autoFit && isValidNumber(limit)) {\n this._setAutoFit(limit, this._title, title);\n }\n\n //auto-limit\n if (title.autoLimit && isValidNumber(limitRatio)) {\n this._title.setAttribute('maxLineWidth', limit);\n }\n } else {\n /**\n * indicator部分隐藏\n * 例如title隐藏了,content还保留。直接设置visible:false 计算group.AABBounts是错的,影响上下居中。\n * 这里把隐藏的nodes删除后,group.AABBounts计算才正确。\n */\n const titleNode = group.find(node => node.name === 'indicator-title', false);\n titleNode && group.removeChild(titleNode as INode);\n this._title = undefined;\n }\n }\n\n const titleHeight = this._title ? this._title.AABBBounds.height() : 0;\n\n if (isValid(content)) {\n const titleSpace = this._title ? (title?.space ? title.space : 0) : 0;\n const contents: IndicatorItemSpec[] = array(content);\n const contentComponents: IText[] = [];\n let lastContentHeight = 0;\n contents.forEach((contentItem, i) => {\n if (contentItem.visible !== false) {\n const contentStyle = merge({}, get(DEFAULT_INDICATOR_THEME, 'content.style'), contentItem.style);\n const contentComponent = group.createOrUpdateChild(\n 'indicator-content-' + i,\n {\n ...contentStyle,\n lineHeight: isValid(contentStyle.lineHeight) ? contentStyle.lineHeight : contentStyle.fontSize,\n visible: contentItem.visible,\n x: 0,\n y: titleHeight + titleSpace + lastContentHeight\n },\n 'text'\n ) as IText;\n\n // auto-fit\n if (contentItem.autoFit && isValidNumber(limit)) {\n this._setAutoFit(limit, contentComponent, contentItem);\n }\n\n //auto-limit\n if (contentItem.autoLimit && isValidNumber(limitRatio)) {\n contentComponent.setAttribute('maxLineWidth', limit);\n }\n\n contentComponents.push(contentComponent);\n const contentSpace = contentItem?.space ? contentItem.space : 0;\n lastContentHeight += contentComponent.AABBBounds.height() + contentSpace;\n } else {\n /**\n * indicator部分隐藏\n */\n const contentItemNode = group.find(node => node.name === 'indicator-content-' + i, false);\n contentItemNode && group.removeChild(contentItemNode as INode);\n }\n });\n this._content = contentComponents;\n }\n\n const totalHeight = group?.AABBBounds.height() ?? 0;\n group.setAttribute('y', size.height / 2 - totalHeight / 2);\n group.setAttribute('x', size.width / 2);\n }\n\n private _setAutoFit(limit: number, indicatorItem: IText, indicatorItemSpec: IndicatorItemSpec) {\n const originWidth = measureTextSize(indicatorItemSpec.style?.text ?? '', indicatorItemSpec.style ?? {}).width;\n if (originWidth > 0) {\n const ratio = (limit * (indicatorItemSpec.fitPercent ?? 0.5)) / originWidth;\n const fontSize = Math.floor((indicatorItemSpec.style?.fontSize ?? 20) * ratio);\n indicatorItem.setAttribute('fontSize', fontSize);\n indicatorItem.setAttribute(\n 'lineHeight',\n isValid(indicatorItemSpec.style.lineHeight) ? indicatorItemSpec.style.lineHeight : fontSize\n );\n }\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["indicator/type.ts"],"names":[],"mappings":"","file":"type.js","sourcesContent":["import type { IGroupGraphicAttribute, ITextGraphicAttribute } from '@visactor/vrender';\n\nexport interface IndicatorAttributes extends IGroupGraphicAttribute {\n /**\n * 是否显示指标卡组件\n * @default true\n */\n visible?: boolean;\n /**\n * 内容尺寸\n */\n size: { width: number; height: number };\n /**\n * 指标卡 x 方向偏移\n * @default 0\n */\n dx?: number;\n /**\n * 指标卡 y 方向偏移\n * @default 0\n */\n dy?: number;\n /**\n * 指标卡宽度占内容区域的最大比值(从0到1)\n */\n limitRatio?: number;\n /**\n * 指标卡标题文字配置\n */\n title?: IndicatorItemSpec;\n /**\n * 指标卡内容文字配置\n */\n content?: IndicatorItemSpec[] | IndicatorItemSpec;\n}\n\nexport interface IndicatorItemSpec {\n /**\n * 是否显示当前项\n * @default true\n */\n visible?: boolean;\n /**\n * title.space: title 和 content 之间的间距\n * contentItem.space: content 之间的间距\n */\n space?: number;\n /**\n * 是否自适应文字空间进行缩略\n * 按照原字体大小,根据空间大小缩略文字\n * @default false\n */\n autoLimit?: boolean;\n /**\n * 是否自适应文字空间缩放文字大小\n * 不缩略文字,改变字体大小以适应空间\n * @default false\n */\n autoFit?: boolean;\n /**\n * 自适应文字宽度与可用空间的比例\n * @default 0.5\n */\n fitPercent?: number;\n /**\n * 文字样式\n */\n style?: ITextGraphicAttribute;\n}\n"]}
1
+ {"version":3,"sources":["../src/indicator/type.ts"],"names":[],"mappings":"","file":"type.js","sourcesContent":["import type { IGroupGraphicAttribute, ITextGraphicAttribute } from '@visactor/vrender';\n\nexport interface IndicatorAttributes extends IGroupGraphicAttribute {\n /**\n * 是否显示指标卡组件\n * @default true\n */\n visible?: boolean;\n /**\n * 内容尺寸\n */\n size: { width: number; height: number };\n /**\n * 指标卡 x 方向偏移\n * @default 0\n */\n dx?: number;\n /**\n * 指标卡 y 方向偏移\n * @default 0\n */\n dy?: number;\n /**\n * 指标卡宽度占内容区域的最大比值(从0到1)\n */\n limitRatio?: number;\n /**\n * 指标卡标题文字配置\n */\n title?: IndicatorItemSpec;\n /**\n * 指标卡内容文字配置\n */\n content?: IndicatorItemSpec[] | IndicatorItemSpec;\n}\n\nexport interface IndicatorItemSpec {\n /**\n * 是否显示当前项\n * @default true\n */\n visible?: boolean;\n /**\n * title.space: title 和 content 之间的间距\n * contentItem.space: content 之间的间距\n */\n space?: number;\n /**\n * 是否自适应文字空间进行缩略\n * 按照原字体大小,根据空间大小缩略文字\n * @default false\n */\n autoLimit?: boolean;\n /**\n * 是否自适应文字空间缩放文字大小\n * 不缩略文字,改变字体大小以适应空间\n * @default false\n */\n autoFit?: boolean;\n /**\n * 自适应文字宽度与可用空间的比例\n * @default 0.5\n */\n fitPercent?: number;\n /**\n * 文字样式\n */\n style?: ITextGraphicAttribute;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["interface.ts"],"names":[],"mappings":"","file":"interface.js","sourcesContent":["import { IRectGraphicAttribute } from '@visactor/vrender';\n\nexport type Direction = 'horizontal' | 'vertical';\n\nexport type OrientType = 'top' | 'right' | 'bottom' | 'left';\n\nexport type BackgroundAttributes = {\n /**\n * 是否绘制背景层\n */\n visible: boolean;\n} & Partial<IRectGraphicAttribute>;\n"]}
1
+ {"version":3,"sources":["../src/interface.ts"],"names":[],"mappings":"","file":"interface.js","sourcesContent":["import { IRectGraphicAttribute } from '@visactor/vrender';\n\nexport type Direction = 'horizontal' | 'vertical';\n\nexport type OrientType = 'top' | 'right' | 'bottom' | 'left';\n\nexport type BackgroundAttributes = {\n /**\n * 是否绘制背景层\n */\n visible: boolean;\n} & Partial<IRectGraphicAttribute>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["jsx/component-type.ts"],"names":[],"mappings":";;;AAEA,gCAA6B;AAE7B,SAAgB,IAAI,CAAC,MAAgD;IACnE,OAAO,IAAI,SAAG,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACjD,CAAC;AAFD,oBAEC","file":"component-type.js","sourcesContent":["import type { IDefaultGraphicParamsType } from '@visactor/vrender';\nimport type { TagAttributes } from '../tag';\nimport { Tag } from '../tag';\n\nexport function VTag(params: IDefaultGraphicParamsType<TagAttributes>) {\n return new Tag(params ? params.attribute : {});\n}\n"]}
1
+ {"version":3,"sources":["../src/jsx/component-type.ts"],"names":[],"mappings":";;;AAEA,gCAA6B;AAE7B,SAAgB,IAAI,CAAC,MAAgD;IACnE,OAAO,IAAI,SAAG,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACjD,CAAC;AAFD,oBAEC","file":"component-type.js","sourcesContent":["import type { IDefaultGraphicParamsType } from '@visactor/vrender';\nimport type { TagAttributes } from '../tag';\nimport { Tag } from '../tag';\n\nexport function VTag(params: IDefaultGraphicParamsType<TagAttributes>) {\n return new Tag(params ? params.attribute : {});\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["jsx/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC","file":"index.js","sourcesContent":["export * from './component-type';\n"]}
1
+ {"version":3,"sources":["../src/jsx/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC","file":"index.js","sourcesContent":["export * from './component-type';\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["label/animate/animate.ts"],"names":[],"mappings":";;;AAGA,MAAM,MAAM,GAAG,CAAC,gBAAuC,EAAE,EAAE,EAAE;;IAC3D,OAAO;QACL,IAAI,EAAE;YACJ,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,CAAC;YACd,aAAa,EAAE,CAAC;SACjB;QACD,EAAE,EAAE;YACF,OAAO,EAAE,MAAA,aAAa,CAAC,OAAO,mCAAI,CAAC;YACnC,WAAW,EAAE,MAAA,aAAa,CAAC,WAAW,mCAAI,CAAC;YAC3C,aAAa,EAAE,MAAA,aAAa,CAAC,aAAa,mCAAI,CAAC;SAChD;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,OAAO,GAAG,CAAC,gBAAuC,EAAE,EAAE,EAAE;;IAC5D,OAAO;QACL,IAAI,EAAE;YACJ,OAAO,EAAE,MAAA,aAAa,CAAC,OAAO,mCAAI,CAAC;YACnC,WAAW,EAAE,MAAA,aAAa,CAAC,WAAW,mCAAI,CAAC;YAC3C,aAAa,EAAE,MAAA,aAAa,CAAC,aAAa,mCAAI,CAAC;SAChD;QACD,EAAE,EAAE;YACF,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,CAAC;YACd,aAAa,EAAE,CAAC;SACjB;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AAE7C,SAAgB,sBAAsB,CACpC,aAAoC,EACpC,IAA0B;;IAK1B,OAAO,MAAA,MAAA,gBAAgB,CAAC,IAAI,CAAC,iEAAG,aAAa,CAAC,mCAAI,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;AACzE,CAAC;AARD,wDAQC;AAEY,QAAA,qBAAqB,GAAoB;IACpD,IAAI,EAAE,WAAW;IACjB,QAAQ,EAAE,GAAG;IACb,MAAM,EAAE,QAAsB;CAC/B,CAAC","file":"animate.js","sourcesContent":["import { EasingType, ITextGraphicAttribute } from '@visactor/vrender';\nimport { ILabelAnimation } from '../type';\n\nconst fadeIn = (textAttribute: ITextGraphicAttribute = {}) => {\n return {\n from: {\n opacity: 0,\n fillOpacity: 0,\n strokeOpacity: 0\n },\n to: {\n opacity: textAttribute.opacity ?? 1,\n fillOpacity: textAttribute.fillOpacity ?? 1,\n strokeOpacity: textAttribute.strokeOpacity ?? 1\n }\n };\n};\n\nconst fadeOut = (textAttribute: ITextGraphicAttribute = {}) => {\n return {\n from: {\n opacity: textAttribute.opacity ?? 1,\n fillOpacity: textAttribute.fillOpacity ?? 1,\n strokeOpacity: textAttribute.strokeOpacity ?? 1\n },\n to: {\n opacity: 0,\n fillOpacity: 0,\n strokeOpacity: 0\n }\n };\n};\n\nconst animationEffects = { fadeIn, fadeOut };\n\nexport function getAnimationAttributes(\n textAttribute: ITextGraphicAttribute,\n type: 'fadeIn' | 'fadeOut'\n): {\n from: any;\n to: any;\n} {\n return animationEffects[type]?.(textAttribute) ?? { from: {}, to: {} };\n}\n\nexport const DefaultLabelAnimation: ILabelAnimation = {\n mode: 'same-time',\n duration: 300,\n easing: 'linear' as EasingType\n};\n"]}
1
+ {"version":3,"sources":["../src/label/animate/animate.ts"],"names":[],"mappings":";;;AAGA,MAAM,MAAM,GAAG,CAAC,gBAAuC,EAAE,EAAE,EAAE;;IAC3D,OAAO;QACL,IAAI,EAAE;YACJ,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,CAAC;YACd,aAAa,EAAE,CAAC;SACjB;QACD,EAAE,EAAE;YACF,OAAO,EAAE,MAAA,aAAa,CAAC,OAAO,mCAAI,CAAC;YACnC,WAAW,EAAE,MAAA,aAAa,CAAC,WAAW,mCAAI,CAAC;YAC3C,aAAa,EAAE,MAAA,aAAa,CAAC,aAAa,mCAAI,CAAC;SAChD;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,OAAO,GAAG,CAAC,gBAAuC,EAAE,EAAE,EAAE;;IAC5D,OAAO;QACL,IAAI,EAAE;YACJ,OAAO,EAAE,MAAA,aAAa,CAAC,OAAO,mCAAI,CAAC;YACnC,WAAW,EAAE,MAAA,aAAa,CAAC,WAAW,mCAAI,CAAC;YAC3C,aAAa,EAAE,MAAA,aAAa,CAAC,aAAa,mCAAI,CAAC;SAChD;QACD,EAAE,EAAE;YACF,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,CAAC;YACd,aAAa,EAAE,CAAC;SACjB;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AAE7C,SAAgB,sBAAsB,CACpC,aAAoC,EACpC,IAA0B;;IAK1B,OAAO,MAAA,MAAA,gBAAgB,CAAC,IAAI,CAAC,iEAAG,aAAa,CAAC,mCAAI,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;AACzE,CAAC;AARD,wDAQC;AAEY,QAAA,qBAAqB,GAAoB;IACpD,IAAI,EAAE,WAAW;IACjB,QAAQ,EAAE,GAAG;IACb,MAAM,EAAE,QAAsB;CAC/B,CAAC","file":"animate.js","sourcesContent":["import { EasingType, ITextGraphicAttribute } from '@visactor/vrender';\nimport { ILabelAnimation } from '../type';\n\nconst fadeIn = (textAttribute: ITextGraphicAttribute = {}) => {\n return {\n from: {\n opacity: 0,\n fillOpacity: 0,\n strokeOpacity: 0\n },\n to: {\n opacity: textAttribute.opacity ?? 1,\n fillOpacity: textAttribute.fillOpacity ?? 1,\n strokeOpacity: textAttribute.strokeOpacity ?? 1\n }\n };\n};\n\nconst fadeOut = (textAttribute: ITextGraphicAttribute = {}) => {\n return {\n from: {\n opacity: textAttribute.opacity ?? 1,\n fillOpacity: textAttribute.fillOpacity ?? 1,\n strokeOpacity: textAttribute.strokeOpacity ?? 1\n },\n to: {\n opacity: 0,\n fillOpacity: 0,\n strokeOpacity: 0\n }\n };\n};\n\nconst animationEffects = { fadeIn, fadeOut };\n\nexport function getAnimationAttributes(\n textAttribute: ITextGraphicAttribute,\n type: 'fadeIn' | 'fadeOut'\n): {\n from: any;\n to: any;\n} {\n return animationEffects[type]?.(textAttribute) ?? { from: {}, to: {} };\n}\n\nexport const DefaultLabelAnimation: ILabelAnimation = {\n mode: 'same-time',\n duration: 300,\n easing: 'linear' as EasingType\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["label/animate/index.ts"],"names":[],"mappings":"","file":"index.js","sourcesContent":[""]}
1
+ {"version":3,"sources":["../src/label/animate/index.ts"],"names":[],"mappings":"","file":"index.js","sourcesContent":[""]}
@@ -1,7 +1,7 @@
1
- import type { IBoundsLike } from '@visactor/vutils';
1
+ import type { IAABBBounds, IBoundsLike } from '@visactor/vutils';
2
2
  import { LabelBase } from './base';
3
- import type { ArcLabelAttrs, IPoint, Quadrant, BaseLabelAttrs } from './type';
4
- import type { IText, IGraphic } from '@visactor/vrender';
3
+ import type { ArcLabelAttrs, IPoint, Quadrant, BaseLabelAttrs, LabelItem, IArcLabelLineSpec } from './type';
4
+ import { type IText, type IGraphic, type ILine } from '@visactor/vrender';
5
5
  export declare class ArcInfo {
6
6
  key: string;
7
7
  refDatum: any;
@@ -20,12 +20,16 @@ export declare class ArcInfo {
20
20
  pointA: IPoint;
21
21
  pointB: IPoint;
22
22
  pointC: IPoint;
23
+ labelLine: IArcLabelLineSpec;
23
24
  quadrant: Quadrant;
24
25
  radian: number;
25
26
  middleAngle: number;
27
+ innerRadius: number;
28
+ outerRadius: number;
29
+ circleCenter: IPoint;
26
30
  k: number;
27
31
  angle: number;
28
- constructor(refDatum: any, center: IPoint, outerCenter: IPoint, quadrant: Quadrant, radian: number, middleAngle: number);
32
+ constructor(refDatum: any, center: IPoint, outerCenter: IPoint, quadrant: Quadrant, radian: number, middleAngle: number, innerRadius: number, outerRadius: number, circleCenter: IPoint);
29
33
  getLabelBounds(): IBoundsLike;
30
34
  }
31
35
  export declare class ArcLabel extends LabelBase<ArcLabelAttrs> {
@@ -40,6 +44,7 @@ export declare class ArcLabel extends LabelBase<ArcLabelAttrs> {
40
44
  x: number;
41
45
  y: number;
42
46
  } | undefined;
47
+ protected _layout(data?: LabelItem[]): IText[];
43
48
  protected layoutArcLabels(position: BaseLabelAttrs['position'], attribute: any, currentMarks?: IGraphic[], data?: any, textBoundsArray?: any, ellipsisWidth?: number): ArcInfo[];
44
49
  private _layoutInsideLabels;
45
50
  private _layoutOutsideLabels;
@@ -59,8 +64,10 @@ export declare class ArcLabel extends LabelBase<ArcLabelAttrs> {
59
64
  private _restoreY;
60
65
  private _checkYRange;
61
66
  private _coverLabels;
62
- protected computeRadius(r: number, width?: number, height?: number, centerOffset?: number, k?: number): number;
67
+ protected _labelLine(text: IText): ILine;
68
+ protected computeRadius(r: number, width?: number, height?: number, k?: number): number;
63
69
  protected computeLayoutRadius(width: number, height: number): number;
70
+ protected _canPlaceInside(textBound: IBoundsLike, shapeBound: IAABBBounds): boolean;
64
71
  private computeLayoutOuterRadius;
65
72
  private computeDatumRadius;
66
73
  }
package/cjs/label/arc.js CHANGED
@@ -4,12 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.ArcLabel = exports.ArcInfo = void 0;
6
6
 
7
- const vutils_1 = require("@visactor/vutils"), base_1 = require("./base"), util_1 = require("./util");
7
+ const vutils_1 = require("@visactor/vutils"), base_1 = require("./base"), vrender_1 = require("@visactor/vrender"), util_1 = require("./util");
8
8
 
9
9
  class ArcInfo {
10
- constructor(refDatum, center, outerCenter, quadrant, radian, middleAngle) {
10
+ constructor(refDatum, center, outerCenter, quadrant, radian, middleAngle, innerRadius, outerRadius, circleCenter) {
11
11
  this.refDatum = refDatum, this.center = center, this.outerCenter = outerCenter,
12
12
  this.quadrant = quadrant, this.radian = radian, this.middleAngle = middleAngle,
13
+ this.innerRadius = innerRadius, this.outerRadius = outerRadius, this.circleCenter = circleCenter,
13
14
  this.labelVisible = !0, this.labelLimit = 0;
14
15
  }
15
16
  getLabelBounds() {
@@ -43,20 +44,39 @@ class ArcLabel extends base_1.LabelBase {
43
44
  y: 0
44
45
  };
45
46
  }
47
+ _layout(data = []) {
48
+ const labels = super._layout(data), textBoundsArray = labels.map((label => this.getGraphicBounds(label))), ellipsisLabelAttribute = Object.assign(Object.assign({}, this.attribute.textStyle), {
49
+ text: "..."
50
+ }), ellipsisText = this._createLabelText(ellipsisLabelAttribute), ellipsisTextBounds = this.getGraphicBounds(ellipsisText), ellipsisWidth = ellipsisTextBounds.x2 - ellipsisTextBounds.x1, arcs = this.layoutArcLabels(this.attribute.position, this.attribute, Array.from(this._idToGraphic.values()), data, textBoundsArray, ellipsisWidth);
51
+ for (let i = 0; i < data.length; i++) {
52
+ const textData = data[i], basedArc = arcs.find((arc => arc.refDatum.id === textData.id)), labelAttribute = {
53
+ visible: basedArc.labelVisible,
54
+ x: basedArc.labelPosition.x,
55
+ y: basedArc.labelPosition.y,
56
+ angle: basedArc.angle,
57
+ maxLineWidth: basedArc.labelLimit,
58
+ points: (null == basedArc ? void 0 : basedArc.pointA) && (null == basedArc ? void 0 : basedArc.pointB) && (null == basedArc ? void 0 : basedArc.pointC) ? [ basedArc.pointA, basedArc.pointB, basedArc.pointC ] : void 0,
59
+ line: null == basedArc ? void 0 : basedArc.labelLine
60
+ };
61
+ labels[i].setAttributes(labelAttribute);
62
+ }
63
+ return labels;
64
+ }
46
65
  layoutArcLabels(position, attribute, currentMarks, data, textBoundsArray, ellipsisWidth) {
47
- var _a;
48
66
  this._arcLeft.clear(), this._arcRight.clear(), this._ellipsisWidth = ellipsisWidth;
49
- const {width: width, height: height} = attribute, centerOffset = null !== (_a = null == attribute ? void 0 : attribute.centerOffset) && void 0 !== _a ? _a : 0;
50
- currentMarks.forEach(((currentMark, index) => {
67
+ let maxRadius = 0;
68
+ currentMarks.forEach((currentMarks => {
69
+ currentMarks.attribute.outerRadius > maxRadius && (maxRadius = currentMarks.attribute.outerRadius);
70
+ })), currentMarks.forEach(((currentMark, index) => {
51
71
  var _a, _b;
52
- const graphicAttribute = currentMark.attribute, radiusRatio = this.computeLayoutOuterRadius(graphicAttribute.outerRadius, width, height), radius = this.computeRadius(radiusRatio, width, height, centerOffset), center = {
72
+ const graphicAttribute = currentMark.attribute, center = {
53
73
  x: null !== (_a = null == graphicAttribute ? void 0 : graphicAttribute.x) && void 0 !== _a ? _a : 0,
54
74
  y: null !== (_b = null == graphicAttribute ? void 0 : graphicAttribute.y) && void 0 !== _b ? _b : 0
55
75
  }, item = data[index], textBounds = textBoundsArray[index], arcMiddleAngle = (graphicAttribute.startAngle + graphicAttribute.endAngle) / 2, intervalAngle = graphicAttribute.endAngle - graphicAttribute.startAngle, arcQuadrant = (0,
56
76
  util_1.computeQuadrant)(graphicAttribute.endAngle - intervalAngle / 2), arcMiddle = (0,
57
77
  util_1.circlePoint)(center.x, center.y, graphicAttribute.outerRadius, arcMiddleAngle), outerArcMiddle = (0,
58
- util_1.circlePoint)(center.x, center.y, radius + attribute.line.line1MinLength, arcMiddleAngle), arc = new ArcInfo(item, arcMiddle, outerArcMiddle, arcQuadrant, intervalAngle, arcMiddleAngle);
59
- arc.pointA = (0, util_1.circlePoint)(center.x, center.y, this.computeDatumRadius(2 * center.x, 2 * center.y, graphicAttribute.outerRadius, centerOffset), arc.middleAngle),
78
+ util_1.circlePoint)(center.x, center.y, maxRadius + attribute.line.line1MinLength, arcMiddleAngle), arc = new ArcInfo(item, arcMiddle, outerArcMiddle, arcQuadrant, intervalAngle, arcMiddleAngle, graphicAttribute.innerRadius, graphicAttribute.outerRadius, center);
79
+ arc.pointA = (0, util_1.circlePoint)(center.x, center.y, this.computeDatumRadius(2 * center.x, 2 * center.y, graphicAttribute.outerRadius), arc.middleAngle),
60
80
  arc.labelSize = {
61
81
  width: textBounds.x2 - textBounds.x1,
62
82
  height: textBounds.y2 - textBounds.y1
@@ -69,14 +89,10 @@ class ArcLabel extends base_1.LabelBase {
69
89
  arcs.push(...this._layoutOutsideLabels(leftArcs, attribute, currentMarks))), arcs;
70
90
  }
71
91
  _layoutInsideLabels(arcs, attribute, currentMarks) {
72
- var _a, _b, _c, _d, _e;
73
- const center = {
74
- x: null !== (_b = null === (_a = currentMarks[0].attribute) || void 0 === _a ? void 0 : _a.x) && void 0 !== _b ? _b : 0,
75
- y: null !== (_d = null === (_c = currentMarks[0].attribute) || void 0 === _c ? void 0 : _c.y) && void 0 !== _d ? _d : 0
76
- }, centerOffset = null !== (_e = null == attribute ? void 0 : attribute.centerOffset) && void 0 !== _e ? _e : 0, innerRadiusRatio = this.computeLayoutOuterRadius(currentMarks[0].attribute.innerRadius, attribute.width, attribute.height), outerRadiusRatio = this.computeLayoutOuterRadius(currentMarks[0].attribute.outerRadius, attribute.width, attribute.height), labelConfig = attribute, spaceWidth = labelConfig.spaceWidth;
92
+ const labelConfig = attribute, spaceWidth = labelConfig.spaceWidth;
77
93
  return arcs.forEach((arc => {
78
94
  var _a, _b;
79
- const {labelSize: labelSize, radian: radian} = arc, innerRadius = this.computeRadius(innerRadiusRatio, attribute.width, attribute.height, centerOffset, 1), outerRadius = this.computeRadius(outerRadiusRatio, attribute.width, attribute.height, centerOffset, 1);
95
+ const {labelSize: labelSize, radian: radian} = arc, innerRadius = arc.innerRadius, outerRadius = arc.outerRadius;
80
96
  let limit;
81
97
  if (radian < (0, util_1.connectLineRadian)(outerRadius, labelSize.height)) limit = 0; else {
82
98
  let minRadius;
@@ -87,7 +103,7 @@ class ArcLabel extends base_1.LabelBase {
87
103
  const text = this._getFormatLabelText(arc.refDatum, limit);
88
104
  arc.labelText = text;
89
105
  const labelWidth = Math.min(limit, arc.labelSize.width), align = this._computeAlign(arc, attribute), labelRadius = outerRadius - spaceWidth - ("left" === align ? labelWidth : "right" === align ? 0 : labelWidth / 2);
90
- arc.labelPosition = (0, util_1.circlePoint)(center.x, center.y, labelRadius, arc.middleAngle),
106
+ arc.labelPosition = (0, util_1.circlePoint)(arc.circleCenter.x, arc.circleCenter.y, labelRadius, arc.middleAngle),
91
107
  arc.labelLimit = labelWidth, (0, vutils_1.isGreater)(labelWidth, 0) || (arc.labelVisible = !1),
92
108
  arc.angle = null !== (_b = null === (_a = null == attribute ? void 0 : attribute.textStyle) || void 0 === _a ? void 0 : _a.angle) && void 0 !== _b ? _b : arc.middleAngle;
93
109
  })), arcs;
@@ -131,22 +147,28 @@ class ArcLabel extends base_1.LabelBase {
131
147
  var _a, _b;
132
148
  arc.labelVisible && ((0, vutils_1.isLess)(arc.pointB.x, line2MinLength + spaceWidth) || (0,
133
149
  vutils_1.isGreater)(arc.pointB.x, width - line2MinLength - spaceWidth)) && (arc.labelVisible = !1),
134
- arc.angle = null !== (_b = null === (_a = null == attribute ? void 0 : attribute.textStyle) || void 0 === _a ? void 0 : _a.angle) && void 0 !== _b ? _b : 0;
150
+ arc.angle = null !== (_b = null === (_a = null == attribute ? void 0 : attribute.textStyle) || void 0 === _a ? void 0 : _a.angle) && void 0 !== _b ? _b : 0,
151
+ arc.labelLine = Object.assign({}, null == attribute ? void 0 : attribute.line);
135
152
  })), arcs;
136
153
  }
137
154
  _computeX(arc, attribute, currentMarks) {
138
- var _a, _b, _c, _d, _e, _f;
139
- const center_x = null !== (_b = null === (_a = currentMarks[0].attribute) || void 0 === _a ? void 0 : _a.x) && void 0 !== _b ? _b : 0, centerOffset = (_d = null === (_c = currentMarks[0].attribute) || void 0 === _c ? void 0 : _c.y,
140
- null !== (_e = null == attribute ? void 0 : attribute.centerOffset) && void 0 !== _e ? _e : 0), plotLayout_width = 2 * center_x, radiusRatio = this.computeLayoutOuterRadius(currentMarks[0].attribute.outerRadius, attribute.width, attribute.height), line1MinLength = attribute.line.line1MinLength, line2MinLength = attribute.line.line2MinLength, labelLayoutAlign = null === (_f = attribute.layout) || void 0 === _f ? void 0 : _f.align, spaceWidth = attribute.spaceWidth, {labelPosition: labelPosition, quadrant: quadrant, pointB: pointB} = arc;
155
+ var _a;
156
+ const center = arc.circleCenter, plotLayout_width = 2 * center.x;
157
+ center.y;
158
+ let maxRadius = 0;
159
+ currentMarks.forEach((currentMark => {
160
+ currentMark.attribute.outerRadius > maxRadius && (maxRadius = currentMark.attribute.outerRadius);
161
+ }));
162
+ const radiusRatio = this.computeLayoutOuterRadius(maxRadius, attribute.width, attribute.height), line1MinLength = attribute.line.line1MinLength, line2MinLength = attribute.line.line2MinLength, labelLayoutAlign = null === (_a = attribute.layout) || void 0 === _a ? void 0 : _a.align, spaceWidth = attribute.spaceWidth, {labelPosition: labelPosition, quadrant: quadrant, pointB: pointB} = arc;
141
163
  (0, vutils_1.isValidNumber)(pointB.x * pointB.y) || (arc.pointC = {
142
164
  x: NaN,
143
165
  y: NaN
144
166
  }, labelPosition.x = NaN, arc.labelLimit = 0);
145
- const radius = this.computeRadius(radiusRatio, attribute.width, attribute.height, centerOffset), flag = (0,
167
+ const radius = this.computeRadius(radiusRatio, attribute.width, attribute.height), flag = (0,
146
168
  util_1.isQuadrantLeft)(quadrant) ? -1 : 1;
147
169
  let cx = 0;
148
170
  let limit = (flag > 0 ? plotLayout_width - pointB.x : pointB.x) - line2MinLength - spaceWidth;
149
- "labelLine" === labelLayoutAlign && (cx = (radius + line1MinLength + line2MinLength) * flag + center_x,
171
+ "labelLine" === labelLayoutAlign && (cx = (radius + line1MinLength + line2MinLength) * flag + center.x,
150
172
  limit = (flag > 0 ? plotLayout_width - cx : cx) - spaceWidth);
151
173
  const text = this._getFormatLabelText(arc.refDatum, limit);
152
174
  arc.labelText = text;
@@ -282,16 +304,17 @@ class ArcLabel extends base_1.LabelBase {
282
304
  return -1;
283
305
  }
284
306
  _computePointB(arc, r, attribute, currentMarks) {
285
- var _a, _b, _c, _d, _e;
286
- const labelConfig = attribute, radiusRatio = this.computeLayoutOuterRadius(currentMarks[0].attribute.outerRadius, attribute.width, attribute.height), line1MinLength = labelConfig.line.line1MinLength;
307
+ const labelConfig = attribute;
308
+ let maxRadius = 0;
309
+ currentMarks.forEach((currentMark => {
310
+ currentMark.attribute.outerRadius > maxRadius && (maxRadius = currentMark.attribute.outerRadius);
311
+ }));
312
+ const radiusRatio = this.computeLayoutOuterRadius(maxRadius, attribute.width, attribute.height), line1MinLength = labelConfig.line.line1MinLength;
287
313
  if ("none" === labelConfig.layout.strategy) arc.pointB = {
288
314
  x: arc.outerCenter.x,
289
315
  y: arc.outerCenter.y
290
316
  }; else {
291
- const center = {
292
- x: null !== (_b = null === (_a = currentMarks[0].attribute) || void 0 === _a ? void 0 : _a.x) && void 0 !== _b ? _b : 0,
293
- y: null !== (_d = null === (_c = currentMarks[0].attribute) || void 0 === _c ? void 0 : _c.y) && void 0 !== _d ? _d : 0
294
- }, centerOffset = null !== (_e = null == attribute ? void 0 : attribute.centerOffset) && void 0 !== _e ? _e : 0, radius = this.computeRadius(radiusRatio, attribute.width, attribute.height, centerOffset), {labelPosition: labelPosition, quadrant: quadrant} = arc, rd = r - Math.max(radius + line1MinLength, currentMarks[0].attribute.outerRadius), x = Math.sqrt(r ** 2 - Math.abs(center.y - labelPosition.y) ** 2) - rd;
317
+ const center = arc.circleCenter, radius = this.computeRadius(radiusRatio, attribute.width, attribute.height), {labelPosition: labelPosition, quadrant: quadrant} = arc, rd = r - Math.max(radius + line1MinLength, arc.outerRadius), x = Math.sqrt(r ** 2 - Math.abs(center.y - labelPosition.y) ** 2) - rd;
295
318
  (0, vutils_1.isValidNumber)(x) ? arc.pointB = {
296
319
  x: center.x + x * ((0, util_1.isQuadrantLeft)(quadrant) ? -1 : 1),
297
320
  y: labelPosition.y
@@ -305,11 +328,15 @@ class ArcLabel extends base_1.LabelBase {
305
328
  for (const arc of arcs) arc.labelVisible && (arc.lastLabelY = arc.labelPosition.y);
306
329
  }
307
330
  _computeYRange(arc, attribute, currentMarks) {
308
- var _a, _b, _c, _d, _e;
309
- const plotRect = {
310
- width: 2 * (null !== (_b = null === (_a = currentMarks[0].attribute) || void 0 === _a ? void 0 : _a.x) && void 0 !== _b ? _b : 0),
311
- height: 2 * (null !== (_d = null === (_c = currentMarks[0].attribute) || void 0 === _c ? void 0 : _c.y) && void 0 !== _d ? _d : 0)
312
- }, radiusRatio = this.computeLayoutOuterRadius(currentMarks[0].attribute.outerRadius, attribute.width, attribute.height), line1MinLength = attribute.line.line1MinLength, {width: width, height: height} = plotRect, centerOffset = null !== (_e = null == attribute ? void 0 : attribute.centerOffset) && void 0 !== _e ? _e : 0, radius = this.computeRadius(radiusRatio, attribute.width, attribute.height, centerOffset), r = this._computeLayoutRadius(height / 2, attribute, currentMarks), cx = Math.abs(arc.center.x - width / 2), cy = arc.center.y - height / 2;
331
+ const center = arc.circleCenter, plotRect = {
332
+ width: 2 * center.x,
333
+ height: 2 * center.y
334
+ };
335
+ let maxRadius = 0;
336
+ currentMarks.forEach((currentMark => {
337
+ currentMark.attribute.outerRadius > maxRadius && (maxRadius = currentMark.attribute.outerRadius);
338
+ }));
339
+ const radiusRatio = this.computeLayoutOuterRadius(maxRadius, attribute.width, attribute.height), line1MinLength = attribute.line.line1MinLength, {width: width, height: height} = plotRect, radius = this.computeRadius(radiusRatio, attribute.width, attribute.height), r = this._computeLayoutRadius(height / 2, attribute, currentMarks), cx = Math.abs(arc.center.x - width / 2), cy = arc.center.y - height / 2;
313
340
  let a, b, c;
314
341
  if ((0, vutils_1.isNumberClose)(width / 2, cx)) a = 0, b = 1, c = -cy; else if ((0,
315
342
  vutils_1.isNumberClose)(height / 2, cy)) a = 1, b = 0, c = -cx; else {
@@ -325,8 +352,12 @@ class ArcLabel extends base_1.LabelBase {
325
352
  max = Math.max(points[0].y, points[1].y) + height / 2), arc.labelYRange = [ min, max ];
326
353
  }
327
354
  _computeLayoutRadius(halfYLength, attribute, currentMarks) {
328
- var _a;
329
- const labelConfig = attribute, layoutArcGap = labelConfig.layoutArcGap, line1MinLength = labelConfig.line.line1MinLength, radiusRatio = this.computeLayoutOuterRadius(currentMarks[0].attribute.outerRadius, attribute.width, attribute.height), centerOffset = null !== (_a = null == attribute ? void 0 : attribute.centerOffset) && void 0 !== _a ? _a : 0, outerR = this.computeRadius(radiusRatio, attribute.width, attribute.height, centerOffset) + line1MinLength, a = outerR - layoutArcGap;
355
+ const labelConfig = attribute, layoutArcGap = labelConfig.layoutArcGap, line1MinLength = labelConfig.line.line1MinLength;
356
+ let maxRadius = 0;
357
+ currentMarks.forEach((currentMark => {
358
+ currentMark.attribute.outerRadius > maxRadius && (maxRadius = currentMark.attribute.outerRadius);
359
+ }));
360
+ const radiusRatio = this.computeLayoutOuterRadius(maxRadius, attribute.width, attribute.height), outerR = this.computeRadius(radiusRatio, attribute.width, attribute.height) + line1MinLength, a = outerR - layoutArcGap;
330
361
  return Math.max((a ** 2 + halfYLength ** 2) / (2 * a), outerR);
331
362
  }
332
363
  _findNeighborIndex(arcs, priorityArc) {
@@ -371,21 +402,32 @@ class ArcLabel extends base_1.LabelBase {
371
402
  (0, util_1.checkBoundsOverlap)(lastBounds, bounds) ? arcs[i].labelVisible = !1 : lastBounds = bounds;
372
403
  }
373
404
  }
374
- computeRadius(r, width, height, centerOffset, k) {
375
- var _a;
376
- return null !== (_a = this.computeLayoutRadius(width || 0, height || 0) * r * ((0,
377
- vutils_1.isNil)(k) ? 1 : k) + centerOffset) && void 0 !== _a ? _a : 0;
405
+ _labelLine(text) {
406
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
407
+ return (null === (_a = text.attribute) || void 0 === _a ? void 0 : _a.points) ? (0,
408
+ vrender_1.createLine)({
409
+ visible: null === (_g = null !== (_e = (null === (_c = null === (_b = text.attribute) || void 0 === _b ? void 0 : _b.line) || void 0 === _c ? void 0 : _c.visible) && (null === (_d = text.attribute) || void 0 === _d ? void 0 : _d.visible)) && void 0 !== _e ? _e : null === (_f = text.attribute) || void 0 === _f ? void 0 : _f.visible) || void 0 === _g || _g,
410
+ stroke: null !== (_l = null === (_k = null === (_j = null === (_h = text.attribute) || void 0 === _h ? void 0 : _h.line) || void 0 === _j ? void 0 : _j.style) || void 0 === _k ? void 0 : _k.stroke) && void 0 !== _l ? _l : null === (_m = text.attribute) || void 0 === _m ? void 0 : _m.fill,
411
+ lineWidth: null !== (_r = null === (_q = null === (_p = null === (_o = text.attribute) || void 0 === _o ? void 0 : _o.line) || void 0 === _p ? void 0 : _p.style) || void 0 === _q ? void 0 : _q.lineWidth) && void 0 !== _r ? _r : 1,
412
+ points: null === (_s = text.attribute) || void 0 === _s ? void 0 : _s.points,
413
+ curveType: (null === (_u = null === (_t = text.attribute) || void 0 === _t ? void 0 : _t.line) || void 0 === _u ? void 0 : _u.smooth) ? "basis" : null
414
+ }) : void 0;
415
+ }
416
+ computeRadius(r, width, height, k) {
417
+ return this.computeLayoutRadius(width || 0, height || 0) * r * ((0, vutils_1.isNil)(k) ? 1 : k);
378
418
  }
379
419
  computeLayoutRadius(width, height) {
380
420
  return Math.min(width / 2, height / 2);
381
421
  }
422
+ _canPlaceInside(textBound, shapeBound) {
423
+ return "inside" === this.attribute.position;
424
+ }
382
425
  computeLayoutOuterRadius(r, width, height) {
383
426
  return r / (Math.min(width, height) / 2);
384
427
  }
385
- computeDatumRadius(width, height, outerRadius, centerOffset) {
386
- var _a;
428
+ computeDatumRadius(width, height, outerRadius) {
387
429
  const outerRadiusRatio = this.computeLayoutOuterRadius(outerRadius, width, height);
388
- return null !== (_a = this.computeLayoutRadius(width || 0, height || 0) * outerRadiusRatio + centerOffset) && void 0 !== _a ? _a : 0;
430
+ return this.computeLayoutRadius(width || 0, height || 0) * outerRadiusRatio;
389
431
  }
390
432
  }
391
433