@antv/g2 5.0.0-beta.3 → 5.0.0-beta.5

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 (459) hide show
  1. package/dist/g2-lite.min.js +5 -2
  2. package/dist/g2.min.js +5 -2
  3. package/esm/api/mark/mark.js +1 -2
  4. package/esm/api/mark/mark.js.map +1 -1
  5. package/esm/api/mark/types.d.ts +1 -2
  6. package/esm/component/axis.js +46 -24
  7. package/esm/component/axis.js.map +1 -1
  8. package/esm/component/index.d.ts +4 -0
  9. package/esm/component/index.js +2 -0
  10. package/esm/component/index.js.map +1 -1
  11. package/esm/component/legendCategory.js +1 -0
  12. package/esm/component/legendCategory.js.map +1 -1
  13. package/esm/component/slider.d.ts +9 -0
  14. package/esm/component/slider.js +57 -0
  15. package/esm/component/slider.js.map +1 -0
  16. package/esm/component/sliderX.d.ts +7 -0
  17. package/esm/component/sliderX.js +9 -0
  18. package/esm/component/sliderX.js.map +1 -0
  19. package/esm/component/sliderY.d.ts +7 -0
  20. package/esm/component/sliderY.js +9 -0
  21. package/esm/component/sliderY.js.map +1 -0
  22. package/esm/composition/facetRect.js +4 -4
  23. package/esm/composition/facetRect.js.map +1 -1
  24. package/esm/composition/mark.js +3 -1
  25. package/esm/composition/mark.js.map +1 -1
  26. package/esm/composition/repeatMatrix.js +2 -2
  27. package/esm/composition/repeatMatrix.js.map +1 -1
  28. package/esm/data/filter.d.ts +3 -3
  29. package/esm/data/filter.js.map +1 -1
  30. package/esm/data/index.d.ts +3 -1
  31. package/esm/data/index.js +1 -0
  32. package/esm/data/index.js.map +1 -1
  33. package/esm/data/sort.d.ts +8 -0
  34. package/esm/data/sort.js +12 -0
  35. package/esm/data/sort.js.map +1 -0
  36. package/esm/interaction/builtin/brushHighlight.d.ts +1 -1
  37. package/esm/interaction/builtin/tooltip.d.ts +6 -4
  38. package/esm/interaction/index.d.ts +5 -0
  39. package/esm/interaction/index.js +5 -0
  40. package/esm/interaction/index.js.map +1 -1
  41. package/esm/interaction/native/brushHighlight.d.ts +15 -0
  42. package/esm/interaction/native/brushHighlight.js +283 -0
  43. package/esm/interaction/native/brushHighlight.js.map +1 -0
  44. package/esm/interaction/native/brushXHighlight.d.ts +1 -0
  45. package/esm/interaction/native/brushXHighlight.js +8 -0
  46. package/esm/interaction/native/brushXHighlight.js.map +1 -0
  47. package/esm/interaction/native/brushYHighlight.d.ts +1 -0
  48. package/esm/interaction/native/brushYHighlight.js +8 -0
  49. package/esm/interaction/native/brushYHighlight.js.map +1 -0
  50. package/esm/interaction/native/legendFilter.d.ts +8 -0
  51. package/esm/interaction/native/legendFilter.js +180 -0
  52. package/esm/interaction/native/legendFilter.js.map +1 -0
  53. package/esm/interaction/native/tooltip.d.ts +2 -2
  54. package/esm/interaction/native/tooltip.js +134 -44
  55. package/esm/interaction/native/tooltip.js.map +1 -1
  56. package/esm/interaction/native/utils.d.ts +5 -1
  57. package/esm/interaction/native/utils.js +25 -2
  58. package/esm/interaction/native/utils.js.map +1 -1
  59. package/esm/label-transform/contrastReverse.d.ts +9 -0
  60. package/esm/label-transform/contrastReverse.js +48 -0
  61. package/esm/label-transform/contrastReverse.js.map +1 -0
  62. package/esm/label-transform/index.d.ts +8 -8
  63. package/esm/label-transform/index.js +4 -4
  64. package/esm/label-transform/index.js.map +1 -1
  65. package/esm/label-transform/overflowHide.d.ts +7 -0
  66. package/esm/label-transform/overflowHide.js +18 -0
  67. package/esm/label-transform/overflowHide.js.map +1 -0
  68. package/esm/label-transform/overlapDodgeY.d.ts +7 -0
  69. package/esm/label-transform/{dodgeY.js → overlapDodgeY.js} +4 -4
  70. package/esm/label-transform/overlapDodgeY.js.map +1 -0
  71. package/esm/label-transform/overlapHide.d.ts +7 -0
  72. package/esm/label-transform/overlapHide.js +24 -0
  73. package/esm/label-transform/overlapHide.js.map +1 -0
  74. package/esm/mark/area.js +1 -1
  75. package/esm/mark/area.js.map +1 -1
  76. package/esm/mark/line.js +1 -1
  77. package/esm/mark/line.js.map +1 -1
  78. package/esm/runtime/component.js +29 -1
  79. package/esm/runtime/component.js.map +1 -1
  80. package/esm/runtime/plot.js +38 -13
  81. package/esm/runtime/plot.js.map +1 -1
  82. package/esm/runtime/scale.js +17 -5
  83. package/esm/runtime/scale.js.map +1 -1
  84. package/esm/runtime/transform.js +10 -4
  85. package/esm/runtime/transform.js.map +1 -1
  86. package/esm/runtime/types/common.d.ts +1 -0
  87. package/esm/runtime/types/mark.d.ts +1 -1
  88. package/esm/runtime/types/options.d.ts +2 -0
  89. package/esm/runtime/types/theme.d.ts +5 -0
  90. package/esm/shape/label/label.js +3 -3
  91. package/esm/shape/label/label.js.map +1 -1
  92. package/esm/shape/label/position/area.d.ts +13 -0
  93. package/esm/shape/label/position/area.js +28 -0
  94. package/esm/shape/label/position/area.js.map +1 -0
  95. package/esm/shape/label/position/bottom.d.ts +1 -0
  96. package/esm/shape/label/position/bottom.js +2 -0
  97. package/esm/shape/label/position/bottom.js.map +1 -0
  98. package/esm/shape/label/position/bottomLeft.d.ts +1 -0
  99. package/esm/shape/label/position/bottomLeft.js +2 -0
  100. package/esm/shape/label/position/bottomLeft.js.map +1 -0
  101. package/esm/shape/label/position/bottomRight.d.ts +1 -0
  102. package/esm/shape/label/position/bottomRight.js +2 -0
  103. package/esm/shape/label/position/bottomRight.js.map +1 -0
  104. package/esm/shape/label/position/default.d.ts +20 -0
  105. package/esm/shape/label/{position.js → position/default.js} +9 -45
  106. package/esm/shape/label/position/default.js.map +1 -0
  107. package/esm/shape/label/position/index.d.ts +13 -0
  108. package/esm/shape/label/position/index.js +14 -0
  109. package/esm/shape/label/position/index.js.map +1 -0
  110. package/esm/shape/label/position/inside.d.ts +1 -0
  111. package/esm/shape/label/position/inside.js +2 -0
  112. package/esm/shape/label/position/inside.js.map +1 -0
  113. package/esm/shape/label/position/left.d.ts +1 -0
  114. package/esm/shape/label/position/left.js +2 -0
  115. package/esm/shape/label/position/left.js.map +1 -0
  116. package/esm/shape/label/position/outside.d.ts +1 -0
  117. package/esm/shape/label/position/outside.js +2 -0
  118. package/esm/shape/label/position/outside.js.map +1 -0
  119. package/esm/shape/label/position/right.d.ts +1 -0
  120. package/esm/shape/label/position/right.js +2 -0
  121. package/esm/shape/label/position/right.js.map +1 -0
  122. package/esm/shape/label/position/spider.d.ts +7 -0
  123. package/esm/shape/label/position/spider.js +40 -0
  124. package/esm/shape/label/position/spider.js.map +1 -0
  125. package/esm/shape/label/position/surround.d.ts +7 -0
  126. package/esm/shape/label/position/surround.js +37 -0
  127. package/esm/shape/label/position/surround.js.map +1 -0
  128. package/esm/shape/label/position/top.d.ts +1 -0
  129. package/esm/shape/label/position/top.js +2 -0
  130. package/esm/shape/label/position/top.js.map +1 -0
  131. package/esm/shape/label/position/topLeft.d.ts +1 -0
  132. package/esm/shape/label/position/topLeft.js +2 -0
  133. package/esm/shape/label/position/topLeft.js.map +1 -0
  134. package/esm/shape/label/position/topRight.d.ts +1 -0
  135. package/esm/shape/label/position/topRight.js +2 -0
  136. package/esm/shape/label/position/topRight.js.map +1 -0
  137. package/esm/spec/composition.d.ts +2 -0
  138. package/esm/spec/data.d.ts +10 -3
  139. package/esm/spec/geometry.d.ts +2 -1
  140. package/esm/spec/interaction.d.ts +28 -5
  141. package/esm/spec/labelTransform.d.ts +24 -11
  142. package/esm/spec/theme.d.ts +5 -2
  143. package/esm/spec/transform.d.ts +7 -2
  144. package/esm/stdlib/index.js +9 -10
  145. package/esm/stdlib/index.js.map +1 -1
  146. package/esm/theme/academy.d.ts +3 -0
  147. package/esm/theme/academy.js +402 -0
  148. package/esm/theme/academy.js.map +1 -0
  149. package/esm/theme/dark.js +80 -29
  150. package/esm/theme/dark.js.map +1 -1
  151. package/esm/theme/index.d.ts +1 -0
  152. package/esm/theme/index.js +1 -0
  153. package/esm/theme/index.js.map +1 -1
  154. package/esm/theme/light.js +71 -19
  155. package/esm/theme/light.js.map +1 -1
  156. package/esm/transform/filter.d.ts +7 -0
  157. package/esm/transform/filter.js +42 -0
  158. package/esm/transform/filter.js.map +1 -0
  159. package/esm/transform/index.d.ts +2 -0
  160. package/esm/transform/index.js +1 -0
  161. package/esm/transform/index.js.map +1 -1
  162. package/esm/transform/maybeTooltip.js +3 -1
  163. package/esm/transform/maybeTooltip.js.map +1 -1
  164. package/esm/utils/bounds.d.ts +26 -0
  165. package/esm/utils/bounds.js +41 -0
  166. package/esm/utils/bounds.js.map +1 -0
  167. package/esm/utils/color.d.ts +6 -0
  168. package/esm/utils/color.js +7 -0
  169. package/esm/utils/color.js.map +1 -0
  170. package/esm/utils/coordinate.d.ts +1 -0
  171. package/esm/utils/coordinate.js +12 -0
  172. package/esm/utils/coordinate.js.map +1 -1
  173. package/esm/utils/helper.d.ts +1 -0
  174. package/esm/utils/helper.js +3 -0
  175. package/esm/utils/helper.js.map +1 -1
  176. package/esm/utils/selection.d.ts +1 -0
  177. package/esm/utils/selection.js.map +1 -1
  178. package/esm/utils/size.js +1 -1
  179. package/esm/utils/size.js.map +1 -1
  180. package/lib/api/mark/mark.js +1 -2
  181. package/lib/api/mark/mark.js.map +1 -1
  182. package/lib/api/mark/types.d.ts +1 -2
  183. package/lib/component/axis.js +46 -24
  184. package/lib/component/axis.js.map +1 -1
  185. package/lib/component/index.d.ts +4 -0
  186. package/lib/component/index.js +5 -1
  187. package/lib/component/index.js.map +1 -1
  188. package/lib/component/legendCategory.js +1 -0
  189. package/lib/component/legendCategory.js.map +1 -1
  190. package/lib/component/slider.d.ts +9 -0
  191. package/lib/component/slider.js +61 -0
  192. package/lib/component/slider.js.map +1 -0
  193. package/lib/component/sliderX.d.ts +7 -0
  194. package/lib/component/sliderX.js +13 -0
  195. package/lib/component/sliderX.js.map +1 -0
  196. package/lib/component/sliderY.d.ts +7 -0
  197. package/lib/component/sliderY.js +13 -0
  198. package/lib/component/sliderY.js.map +1 -0
  199. package/lib/composition/facetRect.js +4 -4
  200. package/lib/composition/facetRect.js.map +1 -1
  201. package/lib/composition/mark.js +3 -1
  202. package/lib/composition/mark.js.map +1 -1
  203. package/lib/composition/repeatMatrix.js +2 -2
  204. package/lib/composition/repeatMatrix.js.map +1 -1
  205. package/lib/data/filter.d.ts +3 -3
  206. package/lib/data/filter.js.map +1 -1
  207. package/lib/data/index.d.ts +3 -1
  208. package/lib/data/index.js +3 -1
  209. package/lib/data/index.js.map +1 -1
  210. package/lib/data/sort.d.ts +8 -0
  211. package/lib/data/sort.js +17 -0
  212. package/lib/data/sort.js.map +1 -0
  213. package/lib/interaction/builtin/brushHighlight.d.ts +1 -1
  214. package/lib/interaction/builtin/tooltip.d.ts +6 -4
  215. package/lib/interaction/index.d.ts +5 -0
  216. package/lib/interaction/index.js +11 -1
  217. package/lib/interaction/index.js.map +1 -1
  218. package/lib/interaction/native/brushHighlight.d.ts +15 -0
  219. package/lib/interaction/native/brushHighlight.js +289 -0
  220. package/lib/interaction/native/brushHighlight.js.map +1 -0
  221. package/lib/interaction/native/brushXHighlight.d.ts +1 -0
  222. package/lib/interaction/native/brushXHighlight.js +12 -0
  223. package/lib/interaction/native/brushXHighlight.js.map +1 -0
  224. package/lib/interaction/native/brushYHighlight.d.ts +1 -0
  225. package/lib/interaction/native/brushYHighlight.js +12 -0
  226. package/lib/interaction/native/brushYHighlight.js.map +1 -0
  227. package/lib/interaction/native/legendFilter.d.ts +8 -0
  228. package/lib/interaction/native/legendFilter.js +184 -0
  229. package/lib/interaction/native/legendFilter.js.map +1 -0
  230. package/lib/interaction/native/tooltip.d.ts +2 -2
  231. package/lib/interaction/native/tooltip.js +131 -41
  232. package/lib/interaction/native/tooltip.js.map +1 -1
  233. package/lib/interaction/native/utils.d.ts +5 -1
  234. package/lib/interaction/native/utils.js +30 -3
  235. package/lib/interaction/native/utils.js.map +1 -1
  236. package/lib/label-transform/contrastReverse.d.ts +9 -0
  237. package/lib/label-transform/contrastReverse.js +52 -0
  238. package/lib/label-transform/contrastReverse.js.map +1 -0
  239. package/lib/label-transform/index.d.ts +8 -8
  240. package/lib/label-transform/index.js +9 -9
  241. package/lib/label-transform/index.js.map +1 -1
  242. package/lib/label-transform/overflowHide.d.ts +7 -0
  243. package/lib/label-transform/overflowHide.js +22 -0
  244. package/lib/label-transform/overflowHide.js.map +1 -0
  245. package/lib/label-transform/overlapDodgeY.d.ts +7 -0
  246. package/lib/label-transform/{dodgeY.js → overlapDodgeY.js} +6 -6
  247. package/lib/label-transform/overlapDodgeY.js.map +1 -0
  248. package/lib/label-transform/overlapHide.d.ts +7 -0
  249. package/lib/label-transform/overlapHide.js +28 -0
  250. package/lib/label-transform/overlapHide.js.map +1 -0
  251. package/lib/mark/area.js +1 -1
  252. package/lib/mark/area.js.map +1 -1
  253. package/lib/mark/line.js +1 -1
  254. package/lib/mark/line.js.map +1 -1
  255. package/lib/runtime/component.js +29 -1
  256. package/lib/runtime/component.js.map +1 -1
  257. package/lib/runtime/plot.js +38 -13
  258. package/lib/runtime/plot.js.map +1 -1
  259. package/lib/runtime/scale.js +16 -4
  260. package/lib/runtime/scale.js.map +1 -1
  261. package/lib/runtime/transform.js +10 -4
  262. package/lib/runtime/transform.js.map +1 -1
  263. package/lib/runtime/types/common.d.ts +1 -0
  264. package/lib/runtime/types/mark.d.ts +1 -1
  265. package/lib/runtime/types/options.d.ts +2 -0
  266. package/lib/runtime/types/theme.d.ts +5 -0
  267. package/lib/shape/label/label.js +3 -3
  268. package/lib/shape/label/label.js.map +1 -1
  269. package/lib/shape/label/position/area.d.ts +13 -0
  270. package/lib/shape/label/position/area.js +32 -0
  271. package/lib/shape/label/position/area.js.map +1 -0
  272. package/lib/shape/label/position/bottom.d.ts +1 -0
  273. package/lib/shape/label/position/bottom.js +6 -0
  274. package/lib/shape/label/position/bottom.js.map +1 -0
  275. package/lib/shape/label/position/bottomLeft.d.ts +1 -0
  276. package/lib/shape/label/position/bottomLeft.js +6 -0
  277. package/lib/shape/label/position/bottomLeft.js.map +1 -0
  278. package/lib/shape/label/position/bottomRight.d.ts +1 -0
  279. package/lib/shape/label/position/bottomRight.js +6 -0
  280. package/lib/shape/label/position/bottomRight.js.map +1 -0
  281. package/lib/shape/label/position/default.d.ts +20 -0
  282. package/lib/shape/label/{position.js → position/default.js} +10 -43
  283. package/lib/shape/label/position/default.js.map +1 -0
  284. package/lib/shape/label/position/index.d.ts +13 -0
  285. package/lib/shape/label/position/index.js +30 -0
  286. package/lib/shape/label/position/index.js.map +1 -0
  287. package/lib/shape/label/position/inside.d.ts +1 -0
  288. package/lib/shape/label/position/inside.js +6 -0
  289. package/lib/shape/label/position/inside.js.map +1 -0
  290. package/lib/shape/label/position/left.d.ts +1 -0
  291. package/lib/shape/label/position/left.js +6 -0
  292. package/lib/shape/label/position/left.js.map +1 -0
  293. package/lib/shape/label/position/outside.d.ts +1 -0
  294. package/lib/shape/label/position/outside.js +6 -0
  295. package/lib/shape/label/position/outside.js.map +1 -0
  296. package/lib/shape/label/position/right.d.ts +1 -0
  297. package/lib/shape/label/position/right.js +6 -0
  298. package/lib/shape/label/position/right.js.map +1 -0
  299. package/lib/shape/label/position/spider.d.ts +7 -0
  300. package/lib/shape/label/position/spider.js +44 -0
  301. package/lib/shape/label/position/spider.js.map +1 -0
  302. package/lib/shape/label/position/surround.d.ts +7 -0
  303. package/lib/shape/label/position/surround.js +41 -0
  304. package/lib/shape/label/position/surround.js.map +1 -0
  305. package/lib/shape/label/position/top.d.ts +1 -0
  306. package/lib/shape/label/position/top.js +6 -0
  307. package/lib/shape/label/position/top.js.map +1 -0
  308. package/lib/shape/label/position/topLeft.d.ts +1 -0
  309. package/lib/shape/label/position/topLeft.js +6 -0
  310. package/lib/shape/label/position/topLeft.js.map +1 -0
  311. package/lib/shape/label/position/topRight.d.ts +1 -0
  312. package/lib/shape/label/position/topRight.js +6 -0
  313. package/lib/shape/label/position/topRight.js.map +1 -0
  314. package/lib/spec/composition.d.ts +2 -0
  315. package/lib/spec/data.d.ts +10 -3
  316. package/lib/spec/geometry.d.ts +2 -1
  317. package/lib/spec/interaction.d.ts +28 -5
  318. package/lib/spec/labelTransform.d.ts +24 -11
  319. package/lib/spec/theme.d.ts +5 -2
  320. package/lib/spec/transform.d.ts +7 -2
  321. package/lib/stdlib/index.js +3 -4
  322. package/lib/stdlib/index.js.map +1 -1
  323. package/lib/theme/academy.d.ts +3 -0
  324. package/lib/theme/academy.js +406 -0
  325. package/lib/theme/academy.js.map +1 -0
  326. package/lib/theme/dark.js +80 -29
  327. package/lib/theme/dark.js.map +1 -1
  328. package/lib/theme/index.d.ts +1 -0
  329. package/lib/theme/index.js +3 -1
  330. package/lib/theme/index.js.map +1 -1
  331. package/lib/theme/light.js +71 -19
  332. package/lib/theme/light.js.map +1 -1
  333. package/lib/transform/filter.d.ts +7 -0
  334. package/lib/transform/filter.js +46 -0
  335. package/lib/transform/filter.js.map +1 -0
  336. package/lib/transform/index.d.ts +2 -0
  337. package/lib/transform/index.js +3 -1
  338. package/lib/transform/index.js.map +1 -1
  339. package/lib/transform/maybeTooltip.js +3 -1
  340. package/lib/transform/maybeTooltip.js.map +1 -1
  341. package/lib/utils/bounds.d.ts +26 -0
  342. package/lib/utils/bounds.js +48 -0
  343. package/lib/utils/bounds.js.map +1 -0
  344. package/lib/utils/color.d.ts +6 -0
  345. package/lib/utils/color.js +11 -0
  346. package/lib/utils/color.js.map +1 -0
  347. package/lib/utils/coordinate.d.ts +1 -0
  348. package/lib/utils/coordinate.js +14 -1
  349. package/lib/utils/coordinate.js.map +1 -1
  350. package/lib/utils/helper.d.ts +1 -0
  351. package/lib/utils/helper.js +5 -1
  352. package/lib/utils/helper.js.map +1 -1
  353. package/lib/utils/selection.d.ts +1 -0
  354. package/lib/utils/selection.js.map +1 -1
  355. package/lib/utils/size.js +1 -1
  356. package/lib/utils/size.js.map +1 -1
  357. package/package.json +4 -3
  358. package/src/api/mark/mark.ts +1 -2
  359. package/src/api/mark/types.ts +1 -2
  360. package/src/component/axis.ts +56 -96
  361. package/src/component/index.ts +4 -0
  362. package/src/component/legendCategory.ts +1 -0
  363. package/src/component/slider.ts +61 -0
  364. package/src/component/sliderX.ts +16 -0
  365. package/src/component/sliderY.ts +16 -0
  366. package/src/composition/facetRect.ts +4 -2
  367. package/src/composition/mark.ts +4 -0
  368. package/src/composition/repeatMatrix.ts +8 -1
  369. package/src/data/filter.ts +3 -3
  370. package/src/data/index.ts +3 -1
  371. package/src/data/sort.ts +18 -0
  372. package/src/interaction/index.ts +6 -0
  373. package/src/interaction/native/brushHighlight.ts +346 -0
  374. package/src/interaction/native/brushXHighlight.ts +11 -0
  375. package/src/interaction/native/brushYHighlight.ts +11 -0
  376. package/src/interaction/native/legendFilter.ts +195 -0
  377. package/src/interaction/native/tooltip.ts +173 -45
  378. package/src/interaction/native/utils.ts +33 -1
  379. package/src/label-transform/contrastReverse.ts +56 -0
  380. package/src/label-transform/index.ts +8 -8
  381. package/src/label-transform/overflowHide.ts +23 -0
  382. package/src/label-transform/{dodgeY.ts → overlapDodgeY.ts} +6 -6
  383. package/src/label-transform/overlapHide.ts +32 -0
  384. package/src/mark/area.ts +1 -1
  385. package/src/mark/line.ts +1 -1
  386. package/src/runtime/component.ts +49 -2
  387. package/src/runtime/plot.ts +46 -11
  388. package/src/runtime/scale.ts +15 -7
  389. package/src/runtime/transform.ts +13 -4
  390. package/src/runtime/types/common.ts +1 -0
  391. package/src/runtime/types/mark.ts +1 -1
  392. package/src/runtime/types/options.ts +2 -0
  393. package/src/runtime/types/theme.ts +5 -0
  394. package/src/shape/label/label.ts +4 -3
  395. package/src/shape/label/position/area.ts +39 -0
  396. package/src/shape/label/position/bottom.ts +1 -0
  397. package/src/shape/label/position/bottomLeft.ts +1 -0
  398. package/src/shape/label/position/bottomRight.ts +1 -0
  399. package/src/shape/label/{position.ts → position/default.ts} +12 -56
  400. package/src/shape/label/position/index.ts +13 -0
  401. package/src/shape/label/position/inside.ts +1 -0
  402. package/src/shape/label/position/left.ts +1 -0
  403. package/src/shape/label/position/outside.ts +1 -0
  404. package/src/shape/label/position/right.ts +1 -0
  405. package/src/shape/label/position/spider.ts +46 -0
  406. package/src/shape/label/position/surround.ts +42 -0
  407. package/src/shape/label/position/top.ts +1 -0
  408. package/src/shape/label/position/topLeft.ts +1 -0
  409. package/src/shape/label/position/topRight.ts +1 -0
  410. package/src/spec/composition.ts +2 -0
  411. package/src/spec/data.ts +12 -2
  412. package/src/spec/geometry.ts +3 -1
  413. package/src/spec/interaction.ts +38 -4
  414. package/src/spec/labelTransform.ts +29 -11
  415. package/src/spec/theme.ts +6 -2
  416. package/src/spec/transform.ts +9 -1
  417. package/src/stdlib/index.ts +31 -9
  418. package/src/theme/academy.ts +408 -0
  419. package/src/theme/dark.ts +81 -29
  420. package/src/theme/index.ts +1 -0
  421. package/src/theme/light.ts +71 -19
  422. package/src/transform/filter.ts +48 -0
  423. package/src/transform/index.ts +2 -0
  424. package/src/transform/maybeTooltip.ts +3 -1
  425. package/src/utils/bounds.ts +52 -0
  426. package/src/utils/color.ts +12 -0
  427. package/src/utils/coordinate.ts +12 -0
  428. package/src/utils/helper.ts +4 -0
  429. package/src/utils/selection.ts +2 -0
  430. package/src/utils/size.ts +1 -1
  431. package/esm/label-transform/dodgeY.d.ts +0 -7
  432. package/esm/label-transform/dodgeY.js.map +0 -1
  433. package/esm/label-transform/hideOverlap.d.ts +0 -4
  434. package/esm/label-transform/hideOverlap.js +0 -48
  435. package/esm/label-transform/hideOverlap.js.map +0 -1
  436. package/esm/label-transform/spider.d.ts +0 -7
  437. package/esm/label-transform/spider.js +0 -30
  438. package/esm/label-transform/spider.js.map +0 -1
  439. package/esm/label-transform/surround.d.ts +0 -7
  440. package/esm/label-transform/surround.js +0 -30
  441. package/esm/label-transform/surround.js.map +0 -1
  442. package/esm/shape/label/position.d.ts +0 -25
  443. package/esm/shape/label/position.js.map +0 -1
  444. package/lib/label-transform/dodgeY.d.ts +0 -7
  445. package/lib/label-transform/dodgeY.js.map +0 -1
  446. package/lib/label-transform/hideOverlap.d.ts +0 -4
  447. package/lib/label-transform/hideOverlap.js +0 -52
  448. package/lib/label-transform/hideOverlap.js.map +0 -1
  449. package/lib/label-transform/spider.d.ts +0 -7
  450. package/lib/label-transform/spider.js +0 -34
  451. package/lib/label-transform/spider.js.map +0 -1
  452. package/lib/label-transform/surround.d.ts +0 -7
  453. package/lib/label-transform/surround.js +0 -34
  454. package/lib/label-transform/surround.js.map +0 -1
  455. package/lib/shape/label/position.d.ts +0 -25
  456. package/lib/shape/label/position.js.map +0 -1
  457. package/src/label-transform/hideOverlap.ts +0 -62
  458. package/src/label-transform/spider.ts +0 -37
  459. package/src/label-transform/surround.ts +0 -37
@@ -1,9 +1,8 @@
1
- import { maxIndex } from 'd3-array';
2
- import { getArcObject } from '../../shape/utils';
3
- import { isCircular, isRadial } from '../../utils/coordinate';
4
- import { maybePercentage } from '../../utils/helper';
5
- import { sub, angle, mid } from '../../utils/vector';
6
- function inferNonCircularStyle(position, points, value, coordinate) {
1
+ import { getArcObject } from '../../../shape/utils';
2
+ import { isCircular, isRadial } from '../../../utils/coordinate';
3
+ import { maybePercentage } from '../../../utils/helper';
4
+ import { mid } from '../../../utils/vector';
5
+ export function inferNonCircularStyle(position, points, value, coordinate) {
7
6
  const { bounds } = value;
8
7
  const [[x0, y0], [x1, y1]] = bounds;
9
8
  const w = x1 - x0;
@@ -40,7 +39,7 @@ function inferNonCircularStyle(position, points, value, coordinate) {
40
39
  textBaseline: 'middle',
41
40
  });
42
41
  }
43
- function inferRadialStyle(position, points, value, coordinate) {
42
+ export function inferRadialStyle(position, points, value, coordinate) {
44
43
  const { y, y1, autoRotate, rotateToAlignArc } = value;
45
44
  const center = coordinate.getCenter();
46
45
  const arcObject = getArcObject(coordinate, points, [y, y1]);
@@ -67,7 +66,7 @@ function inferRotation(angle, autoRotate, rotateToAlignArc) {
67
66
  const append = rotateToAlignArc ? 0 : Math.sin(angle) < 0 ? 90 : -90;
68
67
  return (angle / Math.PI) * 180 + append;
69
68
  }
70
- function inferCircularStyle(position, points, value, coordinate) {
69
+ export function inferCircularStyle(position, points, value, coordinate) {
71
70
  const { y, y1, autoRotate, rotateToAlignArc, connector = true, connectorLength2 = 0, connectorDistance = 0, radius: radiusRatio = 0.5, offset = 0, } = value;
72
71
  const arcObject = getArcObject(coordinate, points, [y, y1]);
73
72
  const { startAngle, endAngle } = arcObject;
@@ -115,7 +114,7 @@ function inferIdentityStyle(position, points, value, coordinate) {
115
114
  y: p[1],
116
115
  };
117
116
  }
118
- function getDefaultStyle(position, points, value, coordinate) {
117
+ export function getDefaultStyle(position, points, value, coordinate) {
119
118
  const { bounds } = value;
120
119
  // When bounds.length = 1
121
120
  // For series mark, such as line and area.
@@ -131,39 +130,4 @@ function getDefaultStyle(position, points, value, coordinate) {
131
130
  : inferNonCircularStyle;
132
131
  return inferDefaultStyle(position, points, value, coordinate);
133
132
  }
134
- export const top = getDefaultStyle;
135
- export const bottom = getDefaultStyle;
136
- export const right = getDefaultStyle;
137
- export const left = getDefaultStyle;
138
- export const topLeft = getDefaultStyle;
139
- export const topRight = getDefaultStyle;
140
- export const bottomLeft = getDefaultStyle;
141
- export const bottomRight = getDefaultStyle;
142
- export const inside = getDefaultStyle;
143
- export const outside = getDefaultStyle;
144
- /**
145
- * Only for Area label.
146
- */
147
- export function area(position, points, value, coordinate) {
148
- const l = points.length / 2;
149
- const Y1 = points.slice(0, l);
150
- const Y0 = points.slice(l);
151
- // Get the maximal space for label.
152
- let idx = maxIndex(Y1, (p, i) => Math.abs(p[1] - Y0[i][1]));
153
- // Do not show label at first and last.
154
- idx = Math.max(Math.min(idx, l - 2), 1);
155
- const mid = (i) => [Y1[i][0], (Y1[i][1] + Y0[i][1]) / 2];
156
- const point = mid(idx);
157
- const prev = mid(idx - 1);
158
- const next = mid(idx + 1);
159
- // todo: G rotate only support deg.
160
- const rotate = (angle(sub(next, prev)) / Math.PI) * 180;
161
- return {
162
- x: point[0],
163
- y: point[1],
164
- transform: `rotate(${rotate}deg)`,
165
- textAlign: 'center',
166
- textBaseline: 'middle',
167
- };
168
- }
169
- //# sourceMappingURL=position.js.map
133
+ //# sourceMappingURL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,EAAE,IAAI,GAAG,CAAC,IAAI,QAAQ,CAAC,UAAU,CAAC,CAAC,GACrD,cAAc,EACjB;AACJ,CAAC;AAED,SAAS,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU;IAC7D,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IACzB,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;IACnB,OAAO;QACL,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACP,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;KACR,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,eAAe,CAC7B,QAAuB,EACvB,MAAiB,EACjB,KAA0B,EAC1B,UAAsB;IAEtB,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IACzB,yBAAyB;IACzB,0CAA0C;IAC1C,sDAAsD;IACtD,wCAAwC;IACxC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;QACvB,OAAO,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;KAChE;IAED,MAAM,iBAAiB,GAAG,QAAQ,CAAC,UAAU,CAAC;QAC5C,CAAC,CAAC,gBAAgB;QAClB,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC;YACxB,CAAC,CAAC,kBAAkB;YACpB,CAAC,CAAC,qBAAqB,CAAC;IAE1B,OAAO,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;AAChE,CAAC"}
@@ -0,0 +1,13 @@
1
+ export { area } from './area';
2
+ export { bottom } from './bottom';
3
+ export { bottomLeft } from './bottomLeft';
4
+ export { bottomRight } from './bottomRight';
5
+ export { inside } from './inside';
6
+ export { left } from './left';
7
+ export { outside } from './outside';
8
+ export { right } from './right';
9
+ export { spider } from './spider';
10
+ export { surround } from './surround';
11
+ export { top } from './top';
12
+ export { topLeft } from './topLeft';
13
+ export { topRight } from './topRight';
@@ -0,0 +1,14 @@
1
+ export { area } from './area';
2
+ export { bottom } from './bottom';
3
+ export { bottomLeft } from './bottomLeft';
4
+ export { bottomRight } from './bottomRight';
5
+ export { inside } from './inside';
6
+ export { left } from './left';
7
+ export { outside } from './outside';
8
+ export { right } from './right';
9
+ export { spider } from './spider';
10
+ export { surround } from './surround';
11
+ export { top } from './top';
12
+ export { topLeft } from './topLeft';
13
+ export { topRight } from './topRight';
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"src/","sources":["shape/label/position/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1 @@
1
+ export { getDefaultStyle as inside } from './default';
@@ -0,0 +1,2 @@
1
+ export { getDefaultStyle as inside } from './default';
2
+ //# sourceMappingURL=inside.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inside.js","sourceRoot":"src/","sources":["shape/label/position/inside.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,MAAM,WAAW,CAAC"}
@@ -0,0 +1 @@
1
+ export { getDefaultStyle as left } from './default';
@@ -0,0 +1,2 @@
1
+ export { getDefaultStyle as left } from './default';
2
+ //# sourceMappingURL=left.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"left.js","sourceRoot":"src/","sources":["shape/label/position/left.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,IAAI,IAAI,EAAE,MAAM,WAAW,CAAC"}
@@ -0,0 +1 @@
1
+ export { getDefaultStyle as outside } from './default';
@@ -0,0 +1,2 @@
1
+ export { getDefaultStyle as outside } from './default';
2
+ //# sourceMappingURL=outside.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outside.js","sourceRoot":"src/","sources":["shape/label/position/outside.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC"}
@@ -0,0 +1 @@
1
+ export { getDefaultStyle as right } from './default';
@@ -0,0 +1,2 @@
1
+ export { getDefaultStyle as right } from './default';
2
+ //# sourceMappingURL=right.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"right.js","sourceRoot":"src/","sources":["shape/label/position/right.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,IAAI,KAAK,EAAE,MAAM,WAAW,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { Coordinate } from '@antv/coord';
2
+ import { Vector2 } from '../../../runtime';
3
+ import { LabelPosition } from './default';
4
+ /**
5
+ * Spider label transform only suitable for the labels in polar coordinate, labels should distinguish coordinate type.
6
+ */
7
+ export declare function spider(position: LabelPosition, points: Vector2[], value: Record<string, any>, coordinate: Coordinate, options: any): any;
@@ -0,0 +1,40 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { sub } from '../../../utils/vector';
13
+ import { isCircular } from '../../../utils/coordinate';
14
+ import { maybePercentage } from '../../../utils/helper';
15
+ import { inferCircularStyle } from './default';
16
+ /**
17
+ * Spider label transform only suitable for the labels in polar coordinate, labels should distinguish coordinate type.
18
+ */
19
+ export function spider(position, points, value, coordinate, options) {
20
+ if (!isCircular(coordinate))
21
+ return {};
22
+ const { edgeDistance = 0 } = options;
23
+ const style = __rest(inferCircularStyle('outside', points, value, coordinate), []);
24
+ const { x: coordX, width } = coordinate.getOptions();
25
+ const center = coordinate.getCenter();
26
+ // todo: How to configure spider.
27
+ const margin = maybePercentage(edgeDistance, width);
28
+ const edgeX = coordX + margin;
29
+ const edgeX1 = coordX + width - margin;
30
+ const { x: originX, x0, y0 } = style;
31
+ const dx = originX <= center[0] ? edgeX - originX : edgeX1 - originX;
32
+ style.x += dx;
33
+ const { x, y } = style;
34
+ const p0 = sub([x0, y0], center);
35
+ const p1 = sub([0, y], center);
36
+ const p1x = p0[1] ? (p0[0] * p1[1]) / p0[1] + center[0] : x;
37
+ style.connectorPoints = [[p1x - x, 0]];
38
+ return style;
39
+ }
40
+ //# sourceMappingURL=spider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spider.js","sourceRoot":"src/","sources":["shape/label/position/spider.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAiB,MAAM,WAAW,CAAC;AA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AAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5D,KAAK,CAAC,eAAe,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAEvC,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { Coordinate } from '@antv/coord';
2
+ import { Vector2 } from '../../../runtime';
3
+ import { LabelPosition } from './default';
4
+ /**
5
+ * Surround label transform is used to make labels surround circular.
6
+ */
7
+ export declare function surround(position: LabelPosition, points: Vector2[], value: Record<string, any>, coordinate: Coordinate, options: any): any;
@@ -0,0 +1,37 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { getRadius, isCircular } from '../../../utils/coordinate';
13
+ import { angleWithQuadrant } from '../../../utils/vector';
14
+ import { inferCircularStyle } from './default';
15
+ /**
16
+ * Surround label transform is used to make labels surround circular.
17
+ */
18
+ export function surround(position, points, value, coordinate, options) {
19
+ if (!isCircular(coordinate))
20
+ return {};
21
+ const { offset = 12 } = options;
22
+ const style = __rest(inferCircularStyle('outside', points, value, coordinate), []);
23
+ const center = coordinate.getCenter();
24
+ const radius = getRadius(coordinate) + offset;
25
+ const { x0, y0, connector, connectorLength2 = 0 } = style;
26
+ const labelAngle = angleWithQuadrant([x0 - center[0], y0 - center[1]]);
27
+ const length2 = connector
28
+ ? connectorLength2 * (Math.sin(labelAngle) < 0 ? -1 : 1)
29
+ : 0;
30
+ const newX = center[0] + Math.sin(labelAngle) * radius;
31
+ const newY = center[1] - Math.cos(labelAngle) * radius;
32
+ style.x = newX + length2;
33
+ style.y = newY;
34
+ style.connectorPoints = [[-length2, 0]];
35
+ return style;
36
+ }
37
+ //# sourceMappingURL=surround.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"surround.js","sourceRoot":"src/","sources":["shape/label/position/surround.ts"],"names":[],"mappings":";;;;;;;;;;;AAGA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAiB,MAAM,WAAW,CAAC;AAE9D;;GAEG;AACH,MAAM,UAAU,QAAQ,CACtB,QAAuB,EACvB,MAAiB,EACjB,KAA0B,EAC1B,UAAsB,EACtB,OAAO;IAEP,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC;QAAE,OAAO,EAAE,CAAC;IAEvC,MAAM,EAAE,MAAM,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC;IAChC,MAAW,KAAK,UAAU,kBAAkB,CAC1C,SAAS,EACT,MAAM,EACN,KAAK,EACL,UAAU,CACX,EALK,EAAY,CAKjB,CAAC;IACF,MAAM,MAAM,GAAG,UAAU,CAAC,SAAS,EAAE,CAAC;IACtC,MAAM,MAAM,GAAG,SAAS,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC;IAE9C,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,gBAAgB,GAAG,CAAC,EAAE,GAAG,KAAK,CAAC;IAC1D,MAAM,UAAU,GAAG,iBAAiB,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACvE,MAAM,OAAO,GAAG,SAAS;QACvB,CAAC,CAAC,gBAAgB,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC,CAAC;IACN,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC;IACvD,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC;IACvD,KAAK,CAAC,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC;IACzB,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC;IACf,KAAK,CAAC,eAAe,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;IAExC,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1 @@
1
+ export { getDefaultStyle as top } from './default';
@@ -0,0 +1,2 @@
1
+ export { getDefaultStyle as top } from './default';
2
+ //# sourceMappingURL=top.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"top.js","sourceRoot":"src/","sources":["shape/label/position/top.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,IAAI,GAAG,EAAE,MAAM,WAAW,CAAC"}
@@ -0,0 +1 @@
1
+ export { getDefaultStyle as topLeft } from './default';
@@ -0,0 +1,2 @@
1
+ export { getDefaultStyle as topLeft } from './default';
2
+ //# sourceMappingURL=topLeft.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"topLeft.js","sourceRoot":"src/","sources":["shape/label/position/topLeft.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC"}
@@ -0,0 +1 @@
1
+ export { getDefaultStyle as topRight } from './default';
@@ -0,0 +1,2 @@
1
+ export { getDefaultStyle as topRight } from './default';
2
+ //# sourceMappingURL=topRight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"topRight.js","sourceRoot":"src/","sources":["shape/label/position/topRight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,IAAI,QAAQ,EAAE,MAAM,WAAW,CAAC"}
@@ -12,6 +12,7 @@ type EventType = (...args: any[]) => void;
12
12
  export type Node = MarkComposition | ViewComposition | SpaceLayerComposition | SpaceFlexComposition | RepeatMatrixComposition | FacetRectComposition | FacetCircleComposition | GeoViewComposition | TimingKeyframeComposition;
13
13
  export type MarkComposition = Geometry & {
14
14
  title?: Title;
15
+ clip?: boolean;
15
16
  };
16
17
  export type ViewComposition = {
17
18
  type?: 'view';
@@ -47,6 +48,7 @@ export type ViewComposition = {
47
48
  legend?: Record<string, any>;
48
49
  on?: Record<string, EventType | EventType[]>;
49
50
  style?: Record<string, any>;
51
+ clip?: boolean;
50
52
  };
51
53
  export type SpaceLayerComposition = {
52
54
  type?: 'spaceLayer';
@@ -14,8 +14,8 @@ export type InlineConnector = {
14
14
  value?: any;
15
15
  transform?: DataTransform[];
16
16
  };
17
- export type DataTransform = SortByTransform | PickTransform | RenameTransform | SubsetTransform | FoldTransform | JoinTransform | FilterTransform | MapTransform | CustomTransform;
18
- export type DataTransformTypes = 'sortBy' | 'pick' | 'rename' | 'subset' | 'fold' | 'join' | 'filter' | 'map' | 'custom' | DataComponent;
17
+ export type DataTransform = SortByTransform | SortTransform | PickTransform | RenameTransform | SubsetTransform | FoldTransform | JoinTransform | FilterDataTransform | MapTransform | CustomTransform;
18
+ export type DataTransformTypes = 'sortBy' | 'sort' | 'pick' | 'rename' | 'subset' | 'fold' | 'join' | 'filter' | 'map' | 'custom' | DataComponent;
19
19
  export type SortByTransform = {
20
20
  type?: 'sortBy';
21
21
  /** type: [field, order]; order: true => ascend, false => descend */
@@ -35,13 +35,20 @@ export type SubsetTransform = {
35
35
  end?: number;
36
36
  fields?: string[];
37
37
  };
38
- export type FilterTransform = {
38
+ export type FilterDataTransform = {
39
39
  type?: 'filter';
40
40
  /**
41
41
  * The filter condition, same with [Array.prototype.filter](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/filter).
42
42
  */
43
43
  callback?: (v: any, idx: number, arr: any[]) => boolean;
44
44
  };
45
+ export type SortTransform = {
46
+ type?: 'sort';
47
+ /**
48
+ * The sort comparator, same with [Array.prototype.sort](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort).
49
+ */
50
+ callback?: (a: any, b: any) => number;
51
+ };
45
52
  export type FoldTransform = {
46
53
  type?: 'fold';
47
54
  fields?: string[];
@@ -9,7 +9,7 @@ import { Theme } from './theme';
9
9
  import { ClusterTransform, Data } from './data';
10
10
  export type Geometry = IntervalGeometry | RectGeometry | LineGeometry | PointGeometry | TextGeometry | CellGeometry | AreaGeometry | NodeGeometry | EdgeGeometry | ImageGeometry | PolygonGeometry | BoxGeometry | VectorGeometry | LineXMark | LineYMark | RangeMark | RangeXMark | RangeYMark | ConnectorMark | SankeyMark | PathMark | TreemapMark | PackMark | BoxPlotMark | ShapeMark | ForceGraphMark | TreeMark | WordCloudMark | CustomComponent;
11
11
  export type GeometryTypes = 'interval' | 'rect' | 'line' | 'point' | 'text' | 'cell' | 'area' | 'node' | 'edge' | 'link' | 'image' | 'polygon' | 'box' | 'vector' | 'lineX' | 'lineY' | 'connector' | 'range' | 'rangeX' | 'rangeY' | 'sankey' | 'path' | 'treemap' | 'pack' | 'boxplot' | 'shape' | 'forceGraph' | 'tree' | 'wordCloud' | MarkComponent;
12
- export type ChannelTypes = 'x' | 'y' | 'x1' | 'y1' | 'series' | 'color' | 'opacity' | 'shape' | 'enterType' | 'enterEasing' | 'enterDuration' | 'enterDelay' | 'enter' | 'size' | 'tooltip' | 'title' | 'key' | 'groupKey' | 'label' | 'position' | 'series';
12
+ export type ChannelTypes = 'x' | 'y' | 'x1' | 'y1' | 'series' | 'color' | 'opacity' | 'shape' | 'enterType' | 'enterEasing' | 'enterDuration' | 'enterDelay' | 'enter' | 'size' | 'tooltip' | 'title' | 'key' | 'groupKey' | 'label' | 'position' | 'series' | `tooltip${number}`;
13
13
  export type BaseGeometry<T extends GeometryTypes, C extends string = ChannelTypes> = {
14
14
  type?: T | string;
15
15
  class?: string;
@@ -35,6 +35,7 @@ export type BaseGeometry<T extends GeometryTypes, C extends string = ChannelType
35
35
  scale?: Partial<Record<C, Scale>>;
36
36
  axis?: Partial<Record<'x' | 'y' | 'position' | `position${number}`, Axis | boolean>> | boolean;
37
37
  legend?: Partial<Record<'size' | 'color', Legend | boolean>> | boolean;
38
+ slider?: Partial<Record<'x' | 'y', any>>;
38
39
  coordinates?: Coordinate[];
39
40
  style?: Record<string, any>;
40
41
  interactions?: Interaction[];
@@ -1,17 +1,34 @@
1
+ import { ChannelTypes } from 'spec';
1
2
  import { InteractionComponent } from '../runtime';
2
3
  import { ActiveRegionAction, PoptipAction, TooltipAction } from './action';
3
4
  import { FisheyeCoordinate } from './coordinate';
4
- export type Interaction = ElementHighlightInteraction | ElementHighlightByColorInteraction | ElementHighlightByXInteraction | ElementSelectByColorInteraction | ElementSelectByXInteraction | ElementSelectInteraction | TooltipInteraction | FisheyeInteraction | ChartIndex | CustomInteraction;
5
- export type InteractionTypes = 'elementHighlight' | 'elementHighlightByX' | 'elementHighlightByColor' | 'fisheye' | 'chartIndex' | 'elementSelect' | 'elementSelectByX' | 'elementSelectByColor' | 'fisheye' | 'tooltip' | InteractionComponent;
5
+ export type Interaction = ElementHighlightInteraction | ElementHighlightByColorInteraction | ElementHighlightByXInteraction | ElementSelectByColorInteraction | ElementSelectByXInteraction | ElementSelectInteraction | TooltipInteraction | FisheyeInteraction | ChartIndex | CustomInteraction | LegendFilterInteraction | BrushHighlightInteraction | BrushXHighlightInteraction | BrushYHighlightInteraction;
6
+ export type InteractionTypes = 'elementHighlight' | 'elementHighlightByX' | 'elementHighlightByColor' | 'fisheye' | 'chartIndex' | 'elementSelect' | 'elementSelectByX' | 'elementSelectByColor' | 'fisheye' | 'tooltip' | 'legendFilter' | 'brushXHighlight' | 'brushYHighlight' | 'brushHighlight' | InteractionComponent;
6
7
  export type BrushInteraction = {
7
8
  type?: 'brush';
8
9
  brushType?: 'rect' | 'rectX' | 'rectY' | 'polygon';
9
10
  };
10
11
  export type BrushHighlightInteraction = {
11
12
  type?: 'brushHighlight';
12
- brushType?: 'rect' | 'rectX' | 'rectY' | 'polygon';
13
- multiple?: boolean;
14
- };
13
+ reverse?: boolean;
14
+ shared?: boolean;
15
+ series?: boolean;
16
+ facet?: boolean;
17
+ } & Record<`${'mask' | 'highlighted' | 'unhighlighted'}${any}`, any>;
18
+ export type BrushXHighlightInteraction = {
19
+ type?: 'brushXHighlight';
20
+ reverse?: boolean;
21
+ shared?: boolean;
22
+ series?: boolean;
23
+ facet?: boolean;
24
+ } & Record<`${'mask' | 'highlighted' | 'unhighlighted'}${any}`, any>;
25
+ export type BrushYHighlightInteraction = {
26
+ type?: 'brushYHighlight';
27
+ reverse?: boolean;
28
+ shared?: boolean;
29
+ series?: boolean;
30
+ facet?: boolean;
31
+ } & Record<`${'mask' | 'highlighted' | 'unhighlighted'}${any}`, any>;
15
32
  export type BrushVisibleInteraction = {
16
33
  type?: 'brushVisible';
17
34
  brushType?: 'rect' | 'rectX' | 'rectY' | 'polygon';
@@ -41,6 +58,11 @@ export type ElementHighlightByColorInteraction = {
41
58
  type?: 'elementHighlightByColor';
42
59
  color?: string;
43
60
  } & Record<`${'link' | 'highlighted' | 'unhighlighted'}${any}`, any>;
61
+ export type LegendFilterInteraction = {
62
+ type?: 'legendFilter';
63
+ channel?: ChannelTypes;
64
+ [key: string]: any;
65
+ } & Record<`${'marker' | 'label'}Unselected${any}`, any>;
44
66
  export type ChartIndex = {
45
67
  type?: 'chartIndex';
46
68
  wait?: number;
@@ -60,6 +82,7 @@ export type TooltipInteraction = Omit<TooltipAction, 'type'> & {
60
82
  type?: 'tooltip';
61
83
  shared?: boolean;
62
84
  series?: boolean;
85
+ facet?: boolean;
63
86
  item?: any;
64
87
  };
65
88
  export type FisheyeInteraction = {
@@ -1,17 +1,30 @@
1
- export type LabelTransform = HideOverlapLabelTransform | DodgeYLabelTransform;
2
- export type HideOverlapLabelTransform = {
3
- type?: 'hideOverlap';
1
+ import { DisplayObject } from '@antv/g';
2
+ export type LabelTransform = OverlapHideTransform | OverlapDodgeYTransform | ContrastReverseTransform | OverflowHideTransform;
3
+ export type OverlapHideTransform = {
4
+ type?: 'overlapHide';
5
+ /**
6
+ * The hide priority, is the comparator for label.sort().
7
+ */
8
+ priority?: (a: DisplayObject, b: DisplayObject) => number;
4
9
  };
5
- export type DodgeYLabelTransform = {
6
- type?: 'dodgeY';
7
- maxIter?: number;
10
+ export type OverlapDodgeYTransform = {
11
+ type?: 'overlapDodgeY';
12
+ maxIterations?: number;
8
13
  maxError?: number;
9
14
  padding?: number;
10
15
  };
11
- export type SpiderLabelTransform = {
12
- type?: 'spider';
13
- edgeDistance?: string | number;
16
+ export type ContrastReverseTransform = {
17
+ type: 'contrastReverse';
18
+ /**
19
+ * Transform when the contrast ratio < threshold.
20
+ * Default is `4.5`.
21
+ */
22
+ threshold?: number;
23
+ /**
24
+ * The optional color palette, default is [#000, #fff].
25
+ */
26
+ palette?: string[];
14
27
  };
15
- export type SurroundLabelTransform = {
16
- type?: 'surround';
28
+ export type OverflowHideTransform = {
29
+ type: 'overflowHide';
17
30
  };
@@ -1,12 +1,15 @@
1
1
  import { Theme as ThemeOptions, ThemeComponent } from '../runtime/types/component';
2
- export type Theme = LightTheme | DarkTheme | CustomTheme;
3
- export type ThemeTypes = 'light' | 'dark' | ThemeComponent;
2
+ export type Theme = LightTheme | DarkTheme | AcademyTheme | CustomTheme;
3
+ export type ThemeTypes = 'light' | 'dark' | 'academy' | ThemeComponent;
4
4
  export type LightTheme = {
5
5
  type?: 'light';
6
6
  } & ThemeOptions;
7
7
  export type DarkTheme = {
8
8
  type?: 'dark';
9
9
  } & ThemeOptions;
10
+ export type AcademyTheme = {
11
+ type?: 'academy';
12
+ } & ThemeOptions;
10
13
  export type CustomTheme = {
11
14
  type?: ThemeComponent;
12
15
  } & ThemeOptions;
@@ -1,7 +1,7 @@
1
1
  import { TransformComponent, Primitive } from '../runtime';
2
2
  import { ChannelTypes } from './geometry';
3
- export type Transform = StackYTransform | DodgeXTransform | NormalizeYTransform | StackEnterTransform | JitterTransform | JitterXTransform | SymmetryYTransform | DiffYTransform | SelectTransform | SelectXTransform | SelectYTransform | GroupXTransform | GroupYTransform | GroupColorTransform | SortXTransform | SortYTransform | SortColorTransform | GroupTransform | PackTransform | BinXTransform | BinTransform | SampleTransform | FlexXTransform;
4
- export type TransformTypes = 'dodgeX' | 'stackY' | 'normalizeY' | 'stackEnter' | 'jitter' | 'jitterX' | 'symmetryY' | 'diffY' | 'select' | 'selectY' | 'selectX' | 'groupX' | 'groupY' | 'group' | 'groupColor' | 'sortX' | 'sortColor' | 'sortY' | 'flexX' | 'pack' | 'sample' | TransformComponent;
3
+ export type Transform = StackYTransform | DodgeXTransform | NormalizeYTransform | StackEnterTransform | JitterTransform | JitterXTransform | SymmetryYTransform | DiffYTransform | SelectTransform | SelectXTransform | SelectYTransform | GroupXTransform | GroupYTransform | GroupColorTransform | SortXTransform | SortYTransform | SortColorTransform | GroupTransform | PackTransform | BinXTransform | BinTransform | SampleTransform | FlexXTransform | FilterTransform;
4
+ export type TransformTypes = 'dodgeX' | 'stackY' | 'normalizeY' | 'stackEnter' | 'jitter' | 'jitterX' | 'symmetryY' | 'diffY' | 'select' | 'selectY' | 'selectX' | 'groupX' | 'groupY' | 'group' | 'groupColor' | 'sortX' | 'sortColor' | 'sortY' | 'flexX' | 'pack' | 'sample' | 'filter' | TransformComponent;
5
5
  export type TransformOrder = 'value' | 'sum' | 'series' | 'maxIndex' | string[] | null | ((data: Record<string, Primitive>) => Primitive);
6
6
  export type DodgeXTransform = {
7
7
  type?: 'dodgeX';
@@ -143,3 +143,8 @@ export type SampleTransform = {
143
143
  } & {
144
144
  [key in ChannelTypes]?: Reducer;
145
145
  };
146
+ export type FilterTransform = {
147
+ type?: 'filter';
148
+ } & {
149
+ [key in ChannelTypes]?: any[] | ((v: Primitive) => boolean);
150
+ };