@antv/g2 5.0.0-rc.2 → 5.0.0

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 (465) hide show
  1. package/README.en-US.md +4 -4
  2. package/README.md +4 -6
  3. package/dist/g2-lite.min.js +4 -4
  4. package/dist/g2.min.js +4 -4
  5. package/esm/api/chart.d.ts +5 -3
  6. package/esm/api/chart.js +14 -11
  7. package/esm/api/chart.js.map +1 -1
  8. package/esm/api/composition/base.d.ts +7 -1
  9. package/esm/api/composition/base.js +26 -0
  10. package/esm/api/composition/base.js.map +1 -1
  11. package/esm/component/axis.js +41 -27
  12. package/esm/component/axis.js.map +1 -1
  13. package/esm/component/axisRadar.js +4 -3
  14. package/esm/component/axisRadar.js.map +1 -1
  15. package/esm/component/axisX.js.map +1 -1
  16. package/esm/component/legendCategory.js +61 -36
  17. package/esm/component/legendCategory.js.map +1 -1
  18. package/esm/component/legendContinuous.js +8 -6
  19. package/esm/component/legendContinuous.js.map +1 -1
  20. package/esm/component/legendContinuousBlockSize.js +1 -1
  21. package/esm/component/legendContinuousBlockSize.js.map +1 -1
  22. package/esm/component/legendContinuousSize.js +1 -1
  23. package/esm/component/legendContinuousSize.js.map +1 -1
  24. package/esm/component/scrollbar.js +1 -1
  25. package/esm/component/scrollbar.js.map +1 -1
  26. package/esm/component/slider.js +1 -1
  27. package/esm/component/slider.js.map +1 -1
  28. package/esm/component/title.js +13 -2
  29. package/esm/component/title.js.map +1 -1
  30. package/esm/component/utils.d.ts +1 -0
  31. package/esm/component/utils.js +25 -1
  32. package/esm/component/utils.js.map +1 -1
  33. package/esm/coordinate/fisheye.js +1 -1
  34. package/esm/coordinate/fisheye.js.map +1 -1
  35. package/esm/interaction/brushFilter.js +1 -1
  36. package/esm/interaction/brushFilter.js.map +1 -1
  37. package/esm/interaction/fisheye.js +1 -1
  38. package/esm/interaction/fisheye.js.map +1 -1
  39. package/esm/interaction/legendFilter.d.ts +1 -1
  40. package/esm/interaction/legendFilter.js +33 -27
  41. package/esm/interaction/legendFilter.js.map +1 -1
  42. package/esm/interaction/sliderFilter.js +2 -2
  43. package/esm/interaction/sliderFilter.js.map +1 -1
  44. package/esm/mark/boxplot.js +2 -2
  45. package/esm/mark/boxplot.js.map +1 -1
  46. package/esm/runtime/component.d.ts +3 -3
  47. package/esm/runtime/component.js +4 -4
  48. package/esm/runtime/component.js.map +1 -1
  49. package/esm/runtime/plot.js +2 -2
  50. package/esm/runtime/plot.js.map +1 -1
  51. package/esm/runtime/render.d.ts +1 -1
  52. package/esm/runtime/render.js +19 -3
  53. package/esm/runtime/render.js.map +1 -1
  54. package/esm/runtime/types/common.d.ts +12 -9
  55. package/esm/runtime/types/component.d.ts +13 -4
  56. package/esm/shape/area/area.js +1 -1
  57. package/esm/shape/area/area.js.map +1 -1
  58. package/esm/shape/area/curve.js +2 -1
  59. package/esm/shape/area/curve.js.map +1 -1
  60. package/esm/shape/area/hv.js +1 -1
  61. package/esm/shape/area/hv.js.map +1 -1
  62. package/esm/shape/area/hvh.js +1 -1
  63. package/esm/shape/area/hvh.js.map +1 -1
  64. package/esm/shape/area/smooth.js +1 -1
  65. package/esm/shape/area/smooth.js.map +1 -1
  66. package/esm/shape/area/vh.js +1 -1
  67. package/esm/shape/area/vh.js.map +1 -1
  68. package/esm/shape/box/box.js +1 -0
  69. package/esm/shape/box/box.js.map +1 -1
  70. package/esm/shape/connector/connector.d.ts +2 -2
  71. package/esm/shape/connector/connector.js +3 -2
  72. package/esm/shape/connector/connector.js.map +1 -1
  73. package/esm/shape/interval/funnel.js +1 -1
  74. package/esm/shape/interval/funnel.js.map +1 -1
  75. package/esm/shape/interval/hollow.js +1 -1
  76. package/esm/shape/interval/hollow.js.map +1 -1
  77. package/esm/shape/interval/pyramid.js +1 -1
  78. package/esm/shape/interval/pyramid.js.map +1 -1
  79. package/esm/shape/interval/rect.js +1 -1
  80. package/esm/shape/interval/rect.js.map +1 -1
  81. package/esm/shape/label/label.js +3 -1
  82. package/esm/shape/label/label.js.map +1 -1
  83. package/esm/shape/line/curve.js +2 -1
  84. package/esm/shape/line/curve.js.map +1 -1
  85. package/esm/shape/line/hv.js +1 -1
  86. package/esm/shape/line/hv.js.map +1 -1
  87. package/esm/shape/line/hvh.js +1 -1
  88. package/esm/shape/line/hvh.js.map +1 -1
  89. package/esm/shape/line/line.js +1 -1
  90. package/esm/shape/line/line.js.map +1 -1
  91. package/esm/shape/line/smooth.js +1 -1
  92. package/esm/shape/line/smooth.js.map +1 -1
  93. package/esm/shape/line/vh.js +1 -1
  94. package/esm/shape/line/vh.js.map +1 -1
  95. package/esm/shape/lineXY/line.js +1 -0
  96. package/esm/shape/lineXY/line.js.map +1 -1
  97. package/esm/shape/link/arc.js +1 -0
  98. package/esm/shape/link/arc.js.map +1 -1
  99. package/esm/shape/link/link.js +1 -0
  100. package/esm/shape/link/link.js.map +1 -1
  101. package/esm/shape/link/smooth.js +1 -0
  102. package/esm/shape/link/smooth.js.map +1 -1
  103. package/esm/shape/link/vhv.js +1 -0
  104. package/esm/shape/link/vhv.js.map +1 -1
  105. package/esm/shape/path/hollow.js +1 -0
  106. package/esm/shape/path/hollow.js.map +1 -1
  107. package/esm/shape/path/path.js +1 -0
  108. package/esm/shape/path/path.js.map +1 -1
  109. package/esm/shape/point/bowtie.js +1 -1
  110. package/esm/shape/point/bowtie.js.map +1 -1
  111. package/esm/shape/point/color.js +2 -2
  112. package/esm/shape/point/color.js.map +1 -1
  113. package/esm/shape/point/cross.js +1 -1
  114. package/esm/shape/point/cross.js.map +1 -1
  115. package/esm/shape/point/diamond.js +1 -1
  116. package/esm/shape/point/diamond.js.map +1 -1
  117. package/esm/shape/point/hexagon.js +1 -1
  118. package/esm/shape/point/hexagon.js.map +1 -1
  119. package/esm/shape/point/hollow.js +1 -1
  120. package/esm/shape/point/hollow.js.map +1 -1
  121. package/esm/shape/point/hollowBowtie.js +1 -1
  122. package/esm/shape/point/hollowBowtie.js.map +1 -1
  123. package/esm/shape/point/hollowDiamond.js +1 -1
  124. package/esm/shape/point/hollowDiamond.js.map +1 -1
  125. package/esm/shape/point/hollowHexagon.js +1 -1
  126. package/esm/shape/point/hollowHexagon.js.map +1 -1
  127. package/esm/shape/point/hollowSquare.js +1 -1
  128. package/esm/shape/point/hollowSquare.js.map +1 -1
  129. package/esm/shape/point/hollowTriangle.js +1 -1
  130. package/esm/shape/point/hollowTriangle.js.map +1 -1
  131. package/esm/shape/point/hollowTriangleDown.js +1 -1
  132. package/esm/shape/point/hollowTriangleDown.js.map +1 -1
  133. package/esm/shape/point/hyphen.js +1 -1
  134. package/esm/shape/point/hyphen.js.map +1 -1
  135. package/esm/shape/point/line.js +1 -1
  136. package/esm/shape/point/line.js.map +1 -1
  137. package/esm/shape/point/plus.js +1 -1
  138. package/esm/shape/point/plus.js.map +1 -1
  139. package/esm/shape/point/point.js +1 -1
  140. package/esm/shape/point/point.js.map +1 -1
  141. package/esm/shape/point/square.js +1 -1
  142. package/esm/shape/point/square.js.map +1 -1
  143. package/esm/shape/point/tick.js +1 -1
  144. package/esm/shape/point/tick.js.map +1 -1
  145. package/esm/shape/point/triangle.js +1 -1
  146. package/esm/shape/point/triangle.js.map +1 -1
  147. package/esm/shape/point/triangleDown.js +1 -1
  148. package/esm/shape/point/triangleDown.js.map +1 -1
  149. package/esm/shape/polygon/polygon.js +1 -0
  150. package/esm/shape/polygon/polygon.js.map +1 -1
  151. package/esm/shape/polygon/ribbon.js +1 -0
  152. package/esm/shape/polygon/ribbon.js.map +1 -1
  153. package/esm/shape/shape/shape.js +1 -0
  154. package/esm/shape/shape/shape.js.map +1 -1
  155. package/esm/shape/text/badge.js +1 -0
  156. package/esm/shape/text/badge.js.map +1 -1
  157. package/esm/shape/text/text.js +1 -0
  158. package/esm/shape/text/text.js.map +1 -1
  159. package/esm/shape/utils.d.ts +1 -16
  160. package/esm/shape/utils.js +2 -2
  161. package/esm/shape/utils.js.map +1 -1
  162. package/esm/shape/vector/vector.js +1 -0
  163. package/esm/shape/vector/vector.js.map +1 -1
  164. package/esm/spec/component.d.ts +10 -9
  165. package/esm/spec/coordinateTransform.d.ts +1 -1
  166. package/esm/spec/theme.d.ts +8 -2
  167. package/esm/stdlib/index.js +2 -2
  168. package/esm/stdlib/index.js.map +1 -1
  169. package/esm/theme/academy.js +73 -74
  170. package/esm/theme/academy.js.map +1 -1
  171. package/esm/theme/classic.d.ts +6 -0
  172. package/esm/theme/{light.js → classic.js} +76 -84
  173. package/esm/theme/classic.js.map +1 -0
  174. package/esm/theme/classicDark.d.ts +6 -0
  175. package/esm/theme/{dark.js → classicDark.js} +74 -83
  176. package/esm/theme/classicDark.js.map +1 -0
  177. package/esm/theme/index.d.ts +2 -2
  178. package/esm/theme/index.js +2 -2
  179. package/esm/theme/index.js.map +1 -1
  180. package/esm/utils/marker.d.ts +10 -0
  181. package/esm/utils/marker.js +250 -0
  182. package/esm/utils/marker.js.map +1 -0
  183. package/lib/api/chart.d.ts +5 -3
  184. package/lib/api/chart.js +15 -12
  185. package/lib/api/chart.js.map +1 -1
  186. package/lib/api/composition/base.d.ts +7 -1
  187. package/lib/api/composition/base.js +26 -0
  188. package/lib/api/composition/base.js.map +1 -1
  189. package/lib/component/axis.js +40 -26
  190. package/lib/component/axis.js.map +1 -1
  191. package/lib/component/axisRadar.js +4 -3
  192. package/lib/component/axisRadar.js.map +1 -1
  193. package/lib/component/axisX.js.map +1 -1
  194. package/lib/component/legendCategory.js +60 -35
  195. package/lib/component/legendCategory.js.map +1 -1
  196. package/lib/component/legendContinuous.js +7 -5
  197. package/lib/component/legendContinuous.js.map +1 -1
  198. package/lib/component/legendContinuousBlockSize.js +1 -1
  199. package/lib/component/legendContinuousBlockSize.js.map +1 -1
  200. package/lib/component/legendContinuousSize.js +1 -1
  201. package/lib/component/legendContinuousSize.js.map +1 -1
  202. package/lib/component/scrollbar.js +1 -1
  203. package/lib/component/scrollbar.js.map +1 -1
  204. package/lib/component/slider.js +1 -1
  205. package/lib/component/slider.js.map +1 -1
  206. package/lib/component/title.js +13 -2
  207. package/lib/component/title.js.map +1 -1
  208. package/lib/component/utils.d.ts +1 -0
  209. package/lib/component/utils.js +26 -1
  210. package/lib/component/utils.js.map +1 -1
  211. package/lib/coordinate/fisheye.js +1 -1
  212. package/lib/coordinate/fisheye.js.map +1 -1
  213. package/lib/interaction/brushFilter.js +1 -1
  214. package/lib/interaction/brushFilter.js.map +1 -1
  215. package/lib/interaction/fisheye.js +1 -1
  216. package/lib/interaction/fisheye.js.map +1 -1
  217. package/lib/interaction/legendFilter.d.ts +1 -1
  218. package/lib/interaction/legendFilter.js +33 -27
  219. package/lib/interaction/legendFilter.js.map +1 -1
  220. package/lib/interaction/sliderFilter.js +2 -2
  221. package/lib/interaction/sliderFilter.js.map +1 -1
  222. package/lib/mark/boxplot.js +2 -2
  223. package/lib/mark/boxplot.js.map +1 -1
  224. package/lib/runtime/component.d.ts +3 -3
  225. package/lib/runtime/component.js +4 -4
  226. package/lib/runtime/component.js.map +1 -1
  227. package/lib/runtime/plot.js +2 -2
  228. package/lib/runtime/plot.js.map +1 -1
  229. package/lib/runtime/render.d.ts +1 -1
  230. package/lib/runtime/render.js +19 -3
  231. package/lib/runtime/render.js.map +1 -1
  232. package/lib/runtime/types/common.d.ts +12 -9
  233. package/lib/runtime/types/component.d.ts +13 -4
  234. package/lib/shape/area/area.js +1 -1
  235. package/lib/shape/area/area.js.map +1 -1
  236. package/lib/shape/area/curve.js +2 -1
  237. package/lib/shape/area/curve.js.map +1 -1
  238. package/lib/shape/area/hv.js +1 -1
  239. package/lib/shape/area/hv.js.map +1 -1
  240. package/lib/shape/area/hvh.js +1 -1
  241. package/lib/shape/area/hvh.js.map +1 -1
  242. package/lib/shape/area/smooth.js +1 -1
  243. package/lib/shape/area/smooth.js.map +1 -1
  244. package/lib/shape/area/vh.js +1 -1
  245. package/lib/shape/area/vh.js.map +1 -1
  246. package/lib/shape/box/box.js +1 -0
  247. package/lib/shape/box/box.js.map +1 -1
  248. package/lib/shape/connector/connector.d.ts +2 -2
  249. package/lib/shape/connector/connector.js +3 -2
  250. package/lib/shape/connector/connector.js.map +1 -1
  251. package/lib/shape/interval/funnel.js +1 -1
  252. package/lib/shape/interval/funnel.js.map +1 -1
  253. package/lib/shape/interval/hollow.js +1 -1
  254. package/lib/shape/interval/hollow.js.map +1 -1
  255. package/lib/shape/interval/pyramid.js +1 -1
  256. package/lib/shape/interval/pyramid.js.map +1 -1
  257. package/lib/shape/interval/rect.js +1 -1
  258. package/lib/shape/interval/rect.js.map +1 -1
  259. package/lib/shape/label/label.js +3 -1
  260. package/lib/shape/label/label.js.map +1 -1
  261. package/lib/shape/line/curve.js +2 -1
  262. package/lib/shape/line/curve.js.map +1 -1
  263. package/lib/shape/line/hv.js +1 -1
  264. package/lib/shape/line/hv.js.map +1 -1
  265. package/lib/shape/line/hvh.js +1 -1
  266. package/lib/shape/line/hvh.js.map +1 -1
  267. package/lib/shape/line/line.js +1 -1
  268. package/lib/shape/line/line.js.map +1 -1
  269. package/lib/shape/line/smooth.js +1 -1
  270. package/lib/shape/line/smooth.js.map +1 -1
  271. package/lib/shape/line/vh.js +1 -1
  272. package/lib/shape/line/vh.js.map +1 -1
  273. package/lib/shape/lineXY/line.js +1 -0
  274. package/lib/shape/lineXY/line.js.map +1 -1
  275. package/lib/shape/link/arc.js +1 -0
  276. package/lib/shape/link/arc.js.map +1 -1
  277. package/lib/shape/link/link.js +1 -0
  278. package/lib/shape/link/link.js.map +1 -1
  279. package/lib/shape/link/smooth.js +1 -0
  280. package/lib/shape/link/smooth.js.map +1 -1
  281. package/lib/shape/link/vhv.js +1 -0
  282. package/lib/shape/link/vhv.js.map +1 -1
  283. package/lib/shape/path/hollow.js +1 -0
  284. package/lib/shape/path/hollow.js.map +1 -1
  285. package/lib/shape/path/path.js +1 -0
  286. package/lib/shape/path/path.js.map +1 -1
  287. package/lib/shape/point/bowtie.js +1 -1
  288. package/lib/shape/point/bowtie.js.map +1 -1
  289. package/lib/shape/point/color.js +2 -25
  290. package/lib/shape/point/color.js.map +1 -1
  291. package/lib/shape/point/cross.js +1 -1
  292. package/lib/shape/point/cross.js.map +1 -1
  293. package/lib/shape/point/diamond.js +1 -1
  294. package/lib/shape/point/diamond.js.map +1 -1
  295. package/lib/shape/point/hexagon.js +1 -1
  296. package/lib/shape/point/hexagon.js.map +1 -1
  297. package/lib/shape/point/hollow.js +1 -1
  298. package/lib/shape/point/hollow.js.map +1 -1
  299. package/lib/shape/point/hollowBowtie.js +1 -1
  300. package/lib/shape/point/hollowBowtie.js.map +1 -1
  301. package/lib/shape/point/hollowDiamond.js +1 -1
  302. package/lib/shape/point/hollowDiamond.js.map +1 -1
  303. package/lib/shape/point/hollowHexagon.js +1 -1
  304. package/lib/shape/point/hollowHexagon.js.map +1 -1
  305. package/lib/shape/point/hollowSquare.js +1 -1
  306. package/lib/shape/point/hollowSquare.js.map +1 -1
  307. package/lib/shape/point/hollowTriangle.js +1 -1
  308. package/lib/shape/point/hollowTriangle.js.map +1 -1
  309. package/lib/shape/point/hollowTriangleDown.js +1 -1
  310. package/lib/shape/point/hollowTriangleDown.js.map +1 -1
  311. package/lib/shape/point/hyphen.js +1 -1
  312. package/lib/shape/point/hyphen.js.map +1 -1
  313. package/lib/shape/point/line.js +1 -1
  314. package/lib/shape/point/line.js.map +1 -1
  315. package/lib/shape/point/plus.js +1 -1
  316. package/lib/shape/point/plus.js.map +1 -1
  317. package/lib/shape/point/point.js +1 -1
  318. package/lib/shape/point/point.js.map +1 -1
  319. package/lib/shape/point/square.js +1 -1
  320. package/lib/shape/point/square.js.map +1 -1
  321. package/lib/shape/point/tick.js +1 -1
  322. package/lib/shape/point/tick.js.map +1 -1
  323. package/lib/shape/point/triangle.js +1 -1
  324. package/lib/shape/point/triangle.js.map +1 -1
  325. package/lib/shape/point/triangleDown.js +1 -1
  326. package/lib/shape/point/triangleDown.js.map +1 -1
  327. package/lib/shape/polygon/polygon.js +1 -0
  328. package/lib/shape/polygon/polygon.js.map +1 -1
  329. package/lib/shape/polygon/ribbon.js +1 -0
  330. package/lib/shape/polygon/ribbon.js.map +1 -1
  331. package/lib/shape/shape/shape.js +1 -0
  332. package/lib/shape/shape/shape.js.map +1 -1
  333. package/lib/shape/text/badge.js +1 -0
  334. package/lib/shape/text/badge.js.map +1 -1
  335. package/lib/shape/text/text.js +1 -0
  336. package/lib/shape/text/text.js.map +1 -1
  337. package/lib/shape/utils.d.ts +1 -16
  338. package/lib/shape/utils.js +2 -2
  339. package/lib/shape/utils.js.map +1 -1
  340. package/lib/shape/vector/vector.js +1 -0
  341. package/lib/shape/vector/vector.js.map +1 -1
  342. package/lib/spec/component.d.ts +10 -9
  343. package/lib/spec/coordinateTransform.d.ts +1 -1
  344. package/lib/spec/theme.d.ts +8 -2
  345. package/lib/stdlib/index.js +1 -1
  346. package/lib/stdlib/index.js.map +1 -1
  347. package/lib/theme/academy.js +73 -74
  348. package/lib/theme/academy.js.map +1 -1
  349. package/lib/theme/classic.d.ts +6 -0
  350. package/lib/theme/{light.js → classic.js} +78 -86
  351. package/lib/theme/classic.js.map +1 -0
  352. package/lib/theme/classicDark.d.ts +6 -0
  353. package/lib/theme/{dark.js → classicDark.js} +76 -85
  354. package/lib/theme/classicDark.js.map +1 -0
  355. package/lib/theme/index.d.ts +2 -2
  356. package/lib/theme/index.js +5 -5
  357. package/lib/theme/index.js.map +1 -1
  358. package/lib/utils/marker.d.ts +10 -0
  359. package/lib/utils/marker.js +256 -0
  360. package/lib/utils/marker.js.map +1 -0
  361. package/package.json +2 -2
  362. package/src/.DS_Store +0 -0
  363. package/src/api/chart.ts +17 -14
  364. package/src/api/composition/base.ts +26 -1
  365. package/src/component/axis.ts +77 -62
  366. package/src/component/axisRadar.ts +4 -3
  367. package/src/component/axisX.ts +0 -1
  368. package/src/component/legendCategory.ts +68 -63
  369. package/src/component/legendContinuous.ts +29 -21
  370. package/src/component/legendContinuousBlockSize.ts +1 -1
  371. package/src/component/legendContinuousSize.ts +1 -1
  372. package/src/component/scrollbar.ts +1 -1
  373. package/src/component/slider.ts +1 -1
  374. package/src/component/title.ts +3 -5
  375. package/src/component/utils.ts +25 -1
  376. package/src/coordinate/fisheye.ts +2 -2
  377. package/src/data/.DS_Store +0 -0
  378. package/src/interaction/brushFilter.ts +2 -2
  379. package/src/interaction/fisheye.ts +1 -1
  380. package/src/interaction/legendFilter.ts +39 -30
  381. package/src/interaction/sliderFilter.ts +2 -2
  382. package/src/mark/boxplot.ts +2 -2
  383. package/src/runtime/component.ts +7 -4
  384. package/src/runtime/plot.ts +2 -0
  385. package/src/runtime/render.ts +22 -2
  386. package/src/runtime/types/common.ts +13 -10
  387. package/src/runtime/types/component.ts +16 -8
  388. package/src/shape/.DS_Store +0 -0
  389. package/src/shape/area/area.ts +1 -0
  390. package/src/shape/area/curve.ts +2 -1
  391. package/src/shape/area/hv.ts +1 -0
  392. package/src/shape/area/hvh.ts +1 -0
  393. package/src/shape/area/smooth.ts +1 -0
  394. package/src/shape/area/vh.ts +1 -0
  395. package/src/shape/box/box.ts +1 -0
  396. package/src/shape/connector/connector.ts +6 -4
  397. package/src/shape/interval/funnel.ts +1 -0
  398. package/src/shape/interval/hollow.ts +1 -0
  399. package/src/shape/interval/pyramid.ts +1 -0
  400. package/src/shape/interval/rect.ts +1 -0
  401. package/src/shape/label/label.ts +3 -1
  402. package/src/shape/line/curve.ts +2 -1
  403. package/src/shape/line/hv.ts +1 -0
  404. package/src/shape/line/hvh.ts +1 -0
  405. package/src/shape/line/line.ts +1 -0
  406. package/src/shape/line/smooth.ts +1 -0
  407. package/src/shape/line/vh.ts +1 -0
  408. package/src/shape/lineXY/line.ts +1 -0
  409. package/src/shape/link/arc.ts +1 -0
  410. package/src/shape/link/link.ts +1 -0
  411. package/src/shape/link/smooth.ts +1 -0
  412. package/src/shape/link/vhv.ts +1 -0
  413. package/src/shape/path/hollow.ts +1 -0
  414. package/src/shape/path/path.ts +1 -0
  415. package/src/shape/point/bowtie.ts +1 -0
  416. package/src/shape/point/color.ts +4 -4
  417. package/src/shape/point/cross.ts +1 -0
  418. package/src/shape/point/diamond.ts +1 -0
  419. package/src/shape/point/hexagon.ts +1 -0
  420. package/src/shape/point/hollow.ts +1 -0
  421. package/src/shape/point/hollowBowtie.ts +1 -0
  422. package/src/shape/point/hollowDiamond.ts +1 -0
  423. package/src/shape/point/hollowHexagon.ts +1 -0
  424. package/src/shape/point/hollowSquare.ts +1 -0
  425. package/src/shape/point/hollowTriangle.ts +1 -0
  426. package/src/shape/point/hollowTriangleDown.ts +1 -0
  427. package/src/shape/point/hyphen.ts +1 -0
  428. package/src/shape/point/line.ts +1 -0
  429. package/src/shape/point/plus.ts +1 -0
  430. package/src/shape/point/point.ts +1 -0
  431. package/src/shape/point/square.ts +1 -0
  432. package/src/shape/point/tick.ts +1 -0
  433. package/src/shape/point/triangle.ts +1 -0
  434. package/src/shape/point/triangleDown.ts +1 -0
  435. package/src/shape/polygon/polygon.ts +1 -0
  436. package/src/shape/polygon/ribbon.ts +1 -0
  437. package/src/shape/shape/shape.ts +1 -0
  438. package/src/shape/text/badge.ts +1 -0
  439. package/src/shape/text/text.ts +1 -0
  440. package/src/shape/utils.ts +4 -22
  441. package/src/shape/vector/vector.ts +1 -0
  442. package/src/spec/component.ts +10 -9
  443. package/src/spec/coordinateTransform.ts +1 -1
  444. package/src/spec/theme.ts +22 -2
  445. package/src/stdlib/index.ts +3 -3
  446. package/src/theme/academy.ts +73 -74
  447. package/src/theme/{light.ts → classic.ts} +76 -84
  448. package/src/theme/{dark.ts → classicDark.ts} +74 -84
  449. package/src/theme/index.ts +2 -2
  450. package/src/utils/marker.ts +293 -0
  451. package/esm/shape/point/symbol.d.ts +0 -49
  452. package/esm/shape/point/symbol.js +0 -143
  453. package/esm/shape/point/symbol.js.map +0 -1
  454. package/esm/theme/dark.d.ts +0 -6
  455. package/esm/theme/dark.js.map +0 -1
  456. package/esm/theme/light.d.ts +0 -6
  457. package/esm/theme/light.js.map +0 -1
  458. package/lib/shape/point/symbol.d.ts +0 -49
  459. package/lib/shape/point/symbol.js +0 -158
  460. package/lib/shape/point/symbol.js.map +0 -1
  461. package/lib/theme/dark.d.ts +0 -6
  462. package/lib/theme/dark.js.map +0 -1
  463. package/lib/theme/light.d.ts +0 -6
  464. package/lib/theme/light.js.map +0 -1
  465. package/src/shape/point/symbol.ts +0 -154
@@ -12,4 +12,5 @@ export const Hollow: SC<HollowOptions> = (options) => {
12
12
 
13
13
  Hollow.props = {
14
14
  ...Color.props,
15
+ defaultMarker: 'hollowSquare',
15
16
  };
@@ -47,4 +47,5 @@ export const Pyramid: SC<PyramidOptions> = (options) => {
47
47
 
48
48
  Pyramid.props = {
49
49
  ...Color.props,
50
+ defaultMarker: 'square',
50
51
  };
@@ -13,4 +13,5 @@ export const Rect: SC<RectOptions> = (options) => {
13
13
 
14
14
  Rect.props = {
15
15
  ...Color.props,
16
+ defaultMarker: 'square',
16
17
  };
@@ -63,4 +63,6 @@ export const Label: SC<LabelOptions> = (options) => {
63
63
  };
64
64
  };
65
65
 
66
- Label.props = {};
66
+ Label.props = {
67
+ defaultMarker: 'point',
68
+ };
@@ -80,7 +80,7 @@ export const Curve: SC<CurveOptions> = (options) => {
80
80
  // The color for each segment.
81
81
  gradientColor = 'between',
82
82
  defined = (d) => !Number.isNaN(d) && d !== undefined && d !== null,
83
- connectNulls = false,
83
+ connect: connectNulls = false,
84
84
  ...style
85
85
  } = options;
86
86
  return (P, value, coordinate, theme) => {
@@ -162,6 +162,7 @@ export const Curve: SC<CurveOptions> = (options) => {
162
162
  };
163
163
 
164
164
  Curve.props = {
165
+ defaultMarker: 'smooth',
165
166
  defaultEnterAnimation: 'fadeIn',
166
167
  defaultUpdateAnimation: 'morphing',
167
168
  defaultExitAnimation: 'fadeOut',
@@ -10,4 +10,5 @@ export const HV: SC<HVOptions> = (options) => {
10
10
 
11
11
  HV.props = {
12
12
  ...Curve.props,
13
+ defaultMarker: 'hv',
13
14
  };
@@ -10,4 +10,5 @@ export const HVH: SC<HVHOptions> = (options) => {
10
10
 
11
11
  HVH.props = {
12
12
  ...Curve.props,
13
+ defaultMarker: 'hvh',
13
14
  };
@@ -14,4 +14,5 @@ export const Line: SC<LineOptions> = (options) => {
14
14
 
15
15
  Line.props = {
16
16
  ...Curve.props,
17
+ defaultMarker: 'line',
17
18
  };
@@ -22,4 +22,5 @@ export const Smooth: SC<SmoothOptions> = (options) => {
22
22
 
23
23
  Smooth.props = {
24
24
  ...Curve.props,
25
+ defaultMarker: 'smooth',
25
26
  };
@@ -10,4 +10,5 @@ export const VH: SC<VHOptions> = (options) => {
10
10
 
11
11
  VH.props = {
12
12
  ...Curve.props,
13
+ defaultMarker: 'vh',
13
14
  };
@@ -58,6 +58,7 @@ export const Line: SC<LineOptions> = (options) => {
58
58
  };
59
59
 
60
60
  Line.props = {
61
+ defaultMarker: 'line',
61
62
  defaultEnterAnimation: 'fadeIn',
62
63
  defaultUpdateAnimation: 'morphing',
63
64
  defaultExitAnimation: 'fadeOut',
@@ -49,6 +49,7 @@ export const Arc: SC<ArcOptions> = (options) => {
49
49
  };
50
50
 
51
51
  Arc.props = {
52
+ defaultMarker: 'smooth',
52
53
  defaultEnterAnimation: 'fadeIn',
53
54
  defaultUpdateAnimation: 'morphing',
54
55
  defaultExitAnimation: 'fadeOut',
@@ -48,6 +48,7 @@ export const Link: SC<LinkOptions> = (options) => {
48
48
  };
49
49
 
50
50
  Link.props = {
51
+ defaultMarker: 'line',
51
52
  defaultEnterAnimation: 'fadeIn',
52
53
  defaultUpdateAnimation: 'morphing',
53
54
  defaultExitAnimation: 'fadeOut',
@@ -44,6 +44,7 @@ export const Smooth: SC<SmoothOptions> = (options) => {
44
44
  };
45
45
 
46
46
  Smooth.props = {
47
+ defaultMarker: 'smooth',
47
48
  defaultEnterAnimation: 'fadeIn',
48
49
  defaultUpdateAnimation: 'morphing',
49
50
  defaultExitAnimation: 'fadeOut',
@@ -88,6 +88,7 @@ export const VHV: SC<VHVOptions> = (options) => {
88
88
  };
89
89
 
90
90
  VHV.props = {
91
+ defaultMarker: 'vhv',
91
92
  defaultEnterAnimation: 'fadeIn',
92
93
  defaultUpdateAnimation: 'morphing',
93
94
  defaultExitAnimation: 'fadeOut',
@@ -14,6 +14,7 @@ export const Hollow: SC<PathOptions> = (options) => {
14
14
  };
15
15
 
16
16
  Hollow.props = {
17
+ defaultMarker: 'hvh',
17
18
  defaultEnterAnimation: 'fadeIn',
18
19
  defaultUpdateAnimation: 'morphing',
19
20
  defaultExitAnimation: 'fadeOut',
@@ -14,6 +14,7 @@ export const Path: SC<PathOptions> = (options) => {
14
14
  };
15
15
 
16
16
  Path.props = {
17
+ defaultMarker: 'hvh',
17
18
  defaultEnterAnimation: 'fadeIn',
18
19
  defaultUpdateAnimation: 'morphing',
19
20
  defaultExitAnimation: 'fadeOut',
@@ -11,5 +11,6 @@ export const Bowtie: SC<BowtieOptions> = (options) => {
11
11
  };
12
12
 
13
13
  Bowtie.props = {
14
+ defaultMarker: 'bowtie',
14
15
  ...Color.props,
15
16
  };
@@ -1,10 +1,10 @@
1
- import { Path } from '@antv/g';
2
1
  import { Coordinate, Vector2 } from '@antv/coord';
3
- import { isFisheye } from '../../utils/coordinate';
2
+ import { Path } from '@antv/g';
4
3
  import { ShapeComponent as SC } from '../../runtime';
4
+ import { isFisheye } from '../../utils/coordinate';
5
+ import { Symbols } from '../../utils/marker';
5
6
  import { select } from '../../utils/selection';
6
7
  import { applyStyle, getOrigin, getShapeTheme, toOpacityKey } from '../utils';
7
- import * as Symbols from './symbol';
8
8
 
9
9
  export type ColorOptions = {
10
10
  colorAttribute: 'fill' | 'stroke';
@@ -37,7 +37,7 @@ function getRadius(
37
37
  export const Color: SC<ColorOptions> = (options) => {
38
38
  // Render border only when colorAttribute is stroke.
39
39
  const { colorAttribute, symbol, mode = 'auto', ...style } = options;
40
- const path = Symbols[symbol] || Symbols.point;
40
+ const path = Symbols.get(symbol) || Symbols.get('point');
41
41
  return (points, value, coordinate, theme) => {
42
42
  const { mark, shape, defaultShape } = value;
43
43
  const { defaultColor, lineWidth, ...defaults } = getShapeTheme(
@@ -11,5 +11,6 @@ export const Cross: SC<CrossOptions> = (options) => {
11
11
  };
12
12
 
13
13
  Cross.props = {
14
+ defaultMarker: 'cross',
14
15
  ...Color.props,
15
16
  };
@@ -11,5 +11,6 @@ export const Diamond: SC<DiamondOptions> = (options) => {
11
11
  };
12
12
 
13
13
  Diamond.props = {
14
+ defaultMarker: 'diamond',
14
15
  ...Color.props,
15
16
  };
@@ -11,5 +11,6 @@ export const Hexagon: SC<HexagonOptions> = (options) => {
11
11
  };
12
12
 
13
13
  Hexagon.props = {
14
+ defaultMarker: 'hexagon',
14
15
  ...Color.props,
15
16
  };
@@ -11,5 +11,6 @@ export const HollowPoint: SC<HollowPointOptions> = (options) => {
11
11
  };
12
12
 
13
13
  HollowPoint.props = {
14
+ defaultMarker: 'hollowPoint',
14
15
  ...Color.props,
15
16
  };
@@ -11,5 +11,6 @@ export const HollowBowtie: SC<HollowBowtieOptions> = (options) => {
11
11
  };
12
12
 
13
13
  HollowBowtie.props = {
14
+ defaultMarker: 'hollowBowtie',
14
15
  ...Color.props,
15
16
  };
@@ -15,5 +15,6 @@ export const HollowDiamond: SC<HollowDiamondOptions> = (options) => {
15
15
  };
16
16
 
17
17
  HollowDiamond.props = {
18
+ defaultMarker: 'hollowDiamond',
18
19
  ...Color.props,
19
20
  };
@@ -15,5 +15,6 @@ export const HollowHexagon: SC<HollowHexagonOptions> = (options) => {
15
15
  };
16
16
 
17
17
  HollowHexagon.props = {
18
+ defaultMarker: 'hollowHexagon',
18
19
  ...Color.props,
19
20
  };
@@ -11,5 +11,6 @@ export const HollowSquare: SC<HollowSquareOptions> = (options) => {
11
11
  };
12
12
 
13
13
  HollowSquare.props = {
14
+ defaultMarker: 'hollowSquare',
14
15
  ...Color.props,
15
16
  };
@@ -15,5 +15,6 @@ export const HollowTriangle: SC<HollowTriangleOptions> = (options) => {
15
15
  };
16
16
 
17
17
  HollowTriangle.props = {
18
+ defaultMarker: 'hollowTriangle',
18
19
  ...Color.props,
19
20
  };
@@ -15,5 +15,6 @@ export const HollowTriangleDown: SC<HollowTriangleDownOptions> = (options) => {
15
15
  };
16
16
 
17
17
  HollowTriangleDown.props = {
18
+ defaultMarker: 'hollowTriangleDown',
18
19
  ...Color.props,
19
20
  };
@@ -11,5 +11,6 @@ export const Hyphen: SC<HyphenOptions> = (options) => {
11
11
  };
12
12
 
13
13
  Hyphen.props = {
14
+ defaultMarker: 'hyphen',
14
15
  ...Color.props,
15
16
  };
@@ -11,5 +11,6 @@ export const Line: SC<LineOptions> = (options) => {
11
11
  };
12
12
 
13
13
  Line.props = {
14
+ defaultMarker: 'line',
14
15
  ...Color.props,
15
16
  };
@@ -11,5 +11,6 @@ export const Plus: SC<PlusOptions> = (options) => {
11
11
  };
12
12
 
13
13
  Plus.props = {
14
+ defaultMarker: 'plus',
14
15
  ...Color.props,
15
16
  };
@@ -11,5 +11,6 @@ export const Point: SC<PointOptions> = (options) => {
11
11
  };
12
12
 
13
13
  Point.props = {
14
+ defaultMarker: 'point',
14
15
  ...Color.props,
15
16
  };
@@ -11,5 +11,6 @@ export const Square: SC<SquareOptions> = (options) => {
11
11
  };
12
12
 
13
13
  Square.props = {
14
+ defaultMarker: 'square',
14
15
  ...Color.props,
15
16
  };
@@ -11,5 +11,6 @@ export const Tick: SC<TickOptions> = (options) => {
11
11
  };
12
12
 
13
13
  Tick.props = {
14
+ defaultMarker: 'tick',
14
15
  ...Color.props,
15
16
  };
@@ -11,5 +11,6 @@ export const Triangle: SC<TriangleOptions> = (options) => {
11
11
  };
12
12
 
13
13
  Triangle.props = {
14
+ defaultMarker: 'triangle',
14
15
  ...Color.props,
15
16
  };
@@ -15,5 +15,6 @@ export const TriangleDown: SC<TriangleDownOptions> = (options) => {
15
15
  };
16
16
 
17
17
  TriangleDown.props = {
18
+ defaultMarker: 'triangleDown',
18
19
  ...Color.props,
19
20
  };
@@ -69,6 +69,7 @@ export const Polygon: SC<PolygonOptions> = (options) => {
69
69
  };
70
70
 
71
71
  Polygon.props = {
72
+ defaultMarker: 'square',
72
73
  defaultEnterAnimation: 'fadeIn',
73
74
  defaultUpdateAnimation: 'morphing',
74
75
  defaultExitAnimation: 'fadeOut',
@@ -95,6 +95,7 @@ export const Ribbon: SC<RibbonOptions> = (options) => {
95
95
  };
96
96
 
97
97
  Ribbon.props = {
98
+ defaultMarker: 'square',
98
99
  defaultEnterAnimation: 'fadeIn',
99
100
  defaultUpdateAnimation: 'morphing',
100
101
  defaultExitAnimation: 'fadeOut',
@@ -19,6 +19,7 @@ export const Shape: SC<ShapeOptions> = (options) => {
19
19
  };
20
20
 
21
21
  Shape.props = {
22
+ defaultMarker: 'point',
22
23
  defaultEnterAnimation: 'fadeIn',
23
24
  defaultUpdateAnimation: 'morphing',
24
25
  defaultExitAnimation: 'fadeOut',
@@ -86,6 +86,7 @@ export const Badge: SC<BadgeOptions> = (options) => {
86
86
  };
87
87
 
88
88
  Badge.props = {
89
+ defaultMarker: 'point',
89
90
  defaultEnterAnimation: 'fadeIn',
90
91
  defaultUpdateAnimation: 'morphing',
91
92
  defaultExitAnimation: 'fadeOut',
@@ -37,6 +37,7 @@ export const Text: SC<TextOptions> = (options) => {
37
37
  };
38
38
 
39
39
  Text.props = {
40
+ defaultMarker: 'point',
40
41
  defaultEnterAnimation: 'fadeIn',
41
42
  defaultUpdateAnimation: 'morphing',
42
43
  defaultExitAnimation: 'fadeOut',
@@ -1,31 +1,13 @@
1
- import { Path } from '@antv/g';
2
- import { Path as D3Path } from 'd3-path';
3
- import { extent } from 'd3-array';
4
1
  import { Coordinate } from '@antv/coord';
5
2
  import { Linear } from '@antv/scale';
6
3
  import { lowerFirst } from '@antv/util';
4
+ import { extent } from 'd3-array';
5
+ import { Path as D3Path } from 'd3-path';
7
6
  import { G2Theme, Primitive, Vector2 } from '../runtime';
7
+ import { indexOf } from '../utils/array';
8
8
  import { isPolar, isTranspose } from '../utils/coordinate';
9
- import { angle, angleWithQuadrant, dist, sub } from '../utils/vector';
10
9
  import { Selection } from '../utils/selection';
11
- import { indexOf } from '../utils/array';
12
- import * as Symbols from './point/symbol';
13
-
14
- type A = ['a' | 'A', number, number, number, number, number, number, number];
15
- type C = ['c' | 'C', number, number, number, number, number, number];
16
- type O = ['o' | 'O', number, number];
17
- type H = ['h' | 'H', number];
18
- type L = ['l' | 'L', number, number];
19
- type M = ['m' | 'M', number, number];
20
- type R = ['r' | 'R', number, number, number, number];
21
- type Q = ['q' | 'Q', number, number, number, number];
22
- type S = ['s' | 'S', number, number, number, number, number, number, number];
23
- type T = ['t' | 'T', number, number];
24
- type V = ['v' | 'V', number];
25
- type U = ['u' | 'U', number, number, number];
26
- type Z = ['z' | 'Z'];
27
-
28
- export type PathCommand = A | C | O | H | L | M | R | Q | S | T | V | U | Z;
10
+ import { angle, angleWithQuadrant, dist, sub } from '../utils/vector';
29
11
 
30
12
  export function applyStyle(
31
13
  selection: Selection,
@@ -46,6 +46,7 @@ export const Vector: SC<VectorOptions> = (options) => {
46
46
  };
47
47
 
48
48
  Vector.props = {
49
+ defaultMarker: 'line',
49
50
  defaultEnterAnimation: 'fadeIn',
50
51
  defaultUpdateAnimation: 'morphing',
51
52
  defaultExitAnimation: 'fadeOut',
@@ -22,18 +22,19 @@ export type TitleComponent = {
22
22
  * Text of subtitle.
23
23
  */
24
24
  subtitle?: string | null;
25
- /**
26
- * Align method for title.
27
- */
28
- align?: 'left' | 'center' | 'right';
29
- /**
30
- * The vertical spacing between title and subtitle, default is 2.
31
- */
32
- spacing?: number;
33
25
  /**
34
26
  * Styles.
35
27
  */
36
- style?: UsePrefix<'title' | 'subtitle', Record<string, any>>;
28
+ style?: UsePrefix<'title' | 'subtitle', Record<string, any>> & {
29
+ /**
30
+ * Align method for title.
31
+ */
32
+ align?: 'left' | 'center' | 'right';
33
+ /**
34
+ * The vertical spacing between title and subtitle, default is 2.
35
+ */
36
+ spacing?: number;
37
+ };
37
38
  };
38
39
 
39
40
  export type AxisComponent = {
@@ -12,5 +12,5 @@ export type FisheyeCoordinate = {
12
12
  focusY?: number;
13
13
  distortionX?: number;
14
14
  distortionY?: number;
15
- isVisual?: boolean;
15
+ visual?: boolean;
16
16
  };
package/src/spec/theme.ts CHANGED
@@ -3,9 +3,29 @@ import {
3
3
  ThemeComponent,
4
4
  } from '../runtime/types/component';
5
5
 
6
- export type Theme = LightTheme | DarkTheme | AcademyTheme | CustomTheme;
6
+ export type Theme =
7
+ | ClassicTheme
8
+ | ClassicDarkTheme
9
+ | LightTheme
10
+ | DarkTheme
11
+ | AcademyTheme
12
+ | CustomTheme;
7
13
 
8
- export type ThemeTypes = 'light' | 'dark' | 'academy' | ThemeComponent;
14
+ export type ThemeTypes =
15
+ | 'classic'
16
+ | 'classicDark'
17
+ | 'light'
18
+ | 'dark'
19
+ | 'academy'
20
+ | ThemeComponent;
21
+
22
+ export type ClassicTheme = {
23
+ type?: 'classic';
24
+ } & ThemeOptions;
25
+
26
+ export type ClassicDarkTheme = {
27
+ type?: 'classicDark';
28
+ } & ThemeOptions;
9
29
 
10
30
  export type LightTheme = {
11
31
  type?: 'light';
@@ -110,7 +110,7 @@ import {
110
110
  HollowPath,
111
111
  Shape as CustomShape,
112
112
  } from '../shape';
113
- import { Light, Dark, Academy } from '../theme';
113
+ import { Classic, ClassicDark, Academy } from '../theme';
114
114
  import {
115
115
  AxisLinear,
116
116
  AxisArc,
@@ -424,8 +424,8 @@ export function createLibrary(): G2Library {
424
424
  'shape.rangeY.range': RectShape,
425
425
  'shape.path.path': PathShape,
426
426
  'shape.path.hollow': HollowPath,
427
- 'theme.classic': Light,
428
- 'theme.classicDark': Dark,
427
+ 'theme.classic': Classic,
428
+ 'theme.classicDark': ClassicDark,
429
429
  'theme.academy': Academy,
430
430
  'component.axisX': AxisX,
431
431
  'component.axisY': AxisY,