@antv/g2 5.0.0-rc.2 → 5.0.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 (481) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.en-US.md +5 -5
  3. package/README.md +5 -7
  4. package/dist/g2-lite.min.js +3 -3
  5. package/dist/g2.min.js +3 -3
  6. package/esm/api/chart.d.ts +5 -3
  7. package/esm/api/chart.js +14 -11
  8. package/esm/api/chart.js.map +1 -1
  9. package/esm/api/composition/base.d.ts +7 -1
  10. package/esm/api/composition/base.js +26 -0
  11. package/esm/api/composition/base.js.map +1 -1
  12. package/esm/component/axis.js +41 -27
  13. package/esm/component/axis.js.map +1 -1
  14. package/esm/component/axisRadar.js +4 -3
  15. package/esm/component/axisRadar.js.map +1 -1
  16. package/esm/component/axisX.js.map +1 -1
  17. package/esm/component/legendCategory.js +61 -36
  18. package/esm/component/legendCategory.js.map +1 -1
  19. package/esm/component/legendContinuous.js +8 -6
  20. package/esm/component/legendContinuous.js.map +1 -1
  21. package/esm/component/legendContinuousBlockSize.js +1 -1
  22. package/esm/component/legendContinuousBlockSize.js.map +1 -1
  23. package/esm/component/legendContinuousSize.js +1 -1
  24. package/esm/component/legendContinuousSize.js.map +1 -1
  25. package/esm/component/scrollbar.js +1 -1
  26. package/esm/component/scrollbar.js.map +1 -1
  27. package/esm/component/slider.js +1 -1
  28. package/esm/component/slider.js.map +1 -1
  29. package/esm/component/title.js +13 -2
  30. package/esm/component/title.js.map +1 -1
  31. package/esm/component/utils.d.ts +1 -0
  32. package/esm/component/utils.js +25 -1
  33. package/esm/component/utils.js.map +1 -1
  34. package/esm/coordinate/fisheye.js +1 -1
  35. package/esm/coordinate/fisheye.js.map +1 -1
  36. package/esm/interaction/brushFilter.js +1 -1
  37. package/esm/interaction/brushFilter.js.map +1 -1
  38. package/esm/interaction/fisheye.js +1 -1
  39. package/esm/interaction/fisheye.js.map +1 -1
  40. package/esm/interaction/legendFilter.d.ts +1 -1
  41. package/esm/interaction/legendFilter.js +33 -27
  42. package/esm/interaction/legendFilter.js.map +1 -1
  43. package/esm/interaction/sliderFilter.js +2 -2
  44. package/esm/interaction/sliderFilter.js.map +1 -1
  45. package/esm/interaction/tooltip.d.ts +1 -1
  46. package/esm/interaction/tooltip.js +5 -3
  47. package/esm/interaction/tooltip.js.map +1 -1
  48. package/esm/mark/boxplot.js +2 -2
  49. package/esm/mark/boxplot.js.map +1 -1
  50. package/esm/runtime/component.d.ts +3 -3
  51. package/esm/runtime/component.js +4 -4
  52. package/esm/runtime/component.js.map +1 -1
  53. package/esm/runtime/plot.js +2 -2
  54. package/esm/runtime/plot.js.map +1 -1
  55. package/esm/runtime/render.d.ts +1 -1
  56. package/esm/runtime/render.js +19 -3
  57. package/esm/runtime/render.js.map +1 -1
  58. package/esm/runtime/types/common.d.ts +12 -9
  59. package/esm/runtime/types/component.d.ts +13 -4
  60. package/esm/shape/area/area.js +1 -1
  61. package/esm/shape/area/area.js.map +1 -1
  62. package/esm/shape/area/curve.js +2 -1
  63. package/esm/shape/area/curve.js.map +1 -1
  64. package/esm/shape/area/hv.js +1 -1
  65. package/esm/shape/area/hv.js.map +1 -1
  66. package/esm/shape/area/hvh.js +1 -1
  67. package/esm/shape/area/hvh.js.map +1 -1
  68. package/esm/shape/area/smooth.js +1 -1
  69. package/esm/shape/area/smooth.js.map +1 -1
  70. package/esm/shape/area/vh.js +1 -1
  71. package/esm/shape/area/vh.js.map +1 -1
  72. package/esm/shape/box/box.js +1 -0
  73. package/esm/shape/box/box.js.map +1 -1
  74. package/esm/shape/connector/connector.d.ts +2 -2
  75. package/esm/shape/connector/connector.js +3 -2
  76. package/esm/shape/connector/connector.js.map +1 -1
  77. package/esm/shape/interval/funnel.js +1 -1
  78. package/esm/shape/interval/funnel.js.map +1 -1
  79. package/esm/shape/interval/hollow.js +1 -1
  80. package/esm/shape/interval/hollow.js.map +1 -1
  81. package/esm/shape/interval/pyramid.js +1 -1
  82. package/esm/shape/interval/pyramid.js.map +1 -1
  83. package/esm/shape/interval/rect.js +1 -1
  84. package/esm/shape/interval/rect.js.map +1 -1
  85. package/esm/shape/label/label.js +3 -1
  86. package/esm/shape/label/label.js.map +1 -1
  87. package/esm/shape/line/curve.js +2 -1
  88. package/esm/shape/line/curve.js.map +1 -1
  89. package/esm/shape/line/hv.js +1 -1
  90. package/esm/shape/line/hv.js.map +1 -1
  91. package/esm/shape/line/hvh.js +1 -1
  92. package/esm/shape/line/hvh.js.map +1 -1
  93. package/esm/shape/line/line.js +1 -1
  94. package/esm/shape/line/line.js.map +1 -1
  95. package/esm/shape/line/smooth.js +1 -1
  96. package/esm/shape/line/smooth.js.map +1 -1
  97. package/esm/shape/line/vh.js +1 -1
  98. package/esm/shape/line/vh.js.map +1 -1
  99. package/esm/shape/lineXY/line.js +1 -0
  100. package/esm/shape/lineXY/line.js.map +1 -1
  101. package/esm/shape/link/arc.js +1 -0
  102. package/esm/shape/link/arc.js.map +1 -1
  103. package/esm/shape/link/link.js +1 -0
  104. package/esm/shape/link/link.js.map +1 -1
  105. package/esm/shape/link/smooth.js +1 -0
  106. package/esm/shape/link/smooth.js.map +1 -1
  107. package/esm/shape/link/vhv.js +1 -0
  108. package/esm/shape/link/vhv.js.map +1 -1
  109. package/esm/shape/path/hollow.js +1 -0
  110. package/esm/shape/path/hollow.js.map +1 -1
  111. package/esm/shape/path/path.js +1 -0
  112. package/esm/shape/path/path.js.map +1 -1
  113. package/esm/shape/point/bowtie.js +1 -1
  114. package/esm/shape/point/bowtie.js.map +1 -1
  115. package/esm/shape/point/color.js +2 -2
  116. package/esm/shape/point/color.js.map +1 -1
  117. package/esm/shape/point/cross.js +1 -1
  118. package/esm/shape/point/cross.js.map +1 -1
  119. package/esm/shape/point/diamond.js +1 -1
  120. package/esm/shape/point/diamond.js.map +1 -1
  121. package/esm/shape/point/hexagon.js +1 -1
  122. package/esm/shape/point/hexagon.js.map +1 -1
  123. package/esm/shape/point/hollow.js +1 -1
  124. package/esm/shape/point/hollow.js.map +1 -1
  125. package/esm/shape/point/hollowBowtie.js +1 -1
  126. package/esm/shape/point/hollowBowtie.js.map +1 -1
  127. package/esm/shape/point/hollowDiamond.js +1 -1
  128. package/esm/shape/point/hollowDiamond.js.map +1 -1
  129. package/esm/shape/point/hollowHexagon.js +1 -1
  130. package/esm/shape/point/hollowHexagon.js.map +1 -1
  131. package/esm/shape/point/hollowSquare.js +1 -1
  132. package/esm/shape/point/hollowSquare.js.map +1 -1
  133. package/esm/shape/point/hollowTriangle.js +1 -1
  134. package/esm/shape/point/hollowTriangle.js.map +1 -1
  135. package/esm/shape/point/hollowTriangleDown.js +1 -1
  136. package/esm/shape/point/hollowTriangleDown.js.map +1 -1
  137. package/esm/shape/point/hyphen.js +1 -1
  138. package/esm/shape/point/hyphen.js.map +1 -1
  139. package/esm/shape/point/line.js +1 -1
  140. package/esm/shape/point/line.js.map +1 -1
  141. package/esm/shape/point/plus.js +1 -1
  142. package/esm/shape/point/plus.js.map +1 -1
  143. package/esm/shape/point/point.js +1 -1
  144. package/esm/shape/point/point.js.map +1 -1
  145. package/esm/shape/point/square.js +1 -1
  146. package/esm/shape/point/square.js.map +1 -1
  147. package/esm/shape/point/tick.js +1 -1
  148. package/esm/shape/point/tick.js.map +1 -1
  149. package/esm/shape/point/triangle.js +1 -1
  150. package/esm/shape/point/triangle.js.map +1 -1
  151. package/esm/shape/point/triangleDown.js +1 -1
  152. package/esm/shape/point/triangleDown.js.map +1 -1
  153. package/esm/shape/polygon/polygon.js +1 -0
  154. package/esm/shape/polygon/polygon.js.map +1 -1
  155. package/esm/shape/polygon/ribbon.js +1 -0
  156. package/esm/shape/polygon/ribbon.js.map +1 -1
  157. package/esm/shape/shape/shape.js +1 -0
  158. package/esm/shape/shape/shape.js.map +1 -1
  159. package/esm/shape/text/badge.js +1 -0
  160. package/esm/shape/text/badge.js.map +1 -1
  161. package/esm/shape/text/text.js +1 -0
  162. package/esm/shape/text/text.js.map +1 -1
  163. package/esm/shape/utils.d.ts +1 -16
  164. package/esm/shape/utils.js +2 -2
  165. package/esm/shape/utils.js.map +1 -1
  166. package/esm/shape/vector/vector.js +1 -0
  167. package/esm/shape/vector/vector.js.map +1 -1
  168. package/esm/spec/component.d.ts +10 -9
  169. package/esm/spec/coordinateTransform.d.ts +1 -1
  170. package/esm/spec/interaction.d.ts +19 -33
  171. package/esm/spec/theme.d.ts +8 -2
  172. package/esm/stdlib/index.js +2 -2
  173. package/esm/stdlib/index.js.map +1 -1
  174. package/esm/theme/academy.js +73 -74
  175. package/esm/theme/academy.js.map +1 -1
  176. package/esm/theme/classic.d.ts +6 -0
  177. package/esm/theme/{light.js → classic.js} +76 -84
  178. package/esm/theme/classic.js.map +1 -0
  179. package/esm/theme/classicDark.d.ts +6 -0
  180. package/esm/theme/{dark.js → classicDark.js} +74 -83
  181. package/esm/theme/classicDark.js.map +1 -0
  182. package/esm/theme/index.d.ts +2 -2
  183. package/esm/theme/index.js +2 -2
  184. package/esm/theme/index.js.map +1 -1
  185. package/esm/transform/maybeTitle.js +5 -1
  186. package/esm/transform/maybeTitle.js.map +1 -1
  187. package/esm/utils/marker.d.ts +10 -0
  188. package/esm/utils/marker.js +250 -0
  189. package/esm/utils/marker.js.map +1 -0
  190. package/lib/api/chart.d.ts +5 -3
  191. package/lib/api/chart.js +15 -12
  192. package/lib/api/chart.js.map +1 -1
  193. package/lib/api/composition/base.d.ts +7 -1
  194. package/lib/api/composition/base.js +26 -0
  195. package/lib/api/composition/base.js.map +1 -1
  196. package/lib/component/axis.js +40 -26
  197. package/lib/component/axis.js.map +1 -1
  198. package/lib/component/axisRadar.js +4 -3
  199. package/lib/component/axisRadar.js.map +1 -1
  200. package/lib/component/axisX.js.map +1 -1
  201. package/lib/component/legendCategory.js +60 -35
  202. package/lib/component/legendCategory.js.map +1 -1
  203. package/lib/component/legendContinuous.js +7 -5
  204. package/lib/component/legendContinuous.js.map +1 -1
  205. package/lib/component/legendContinuousBlockSize.js +1 -1
  206. package/lib/component/legendContinuousBlockSize.js.map +1 -1
  207. package/lib/component/legendContinuousSize.js +1 -1
  208. package/lib/component/legendContinuousSize.js.map +1 -1
  209. package/lib/component/scrollbar.js +1 -1
  210. package/lib/component/scrollbar.js.map +1 -1
  211. package/lib/component/slider.js +1 -1
  212. package/lib/component/slider.js.map +1 -1
  213. package/lib/component/title.js +13 -2
  214. package/lib/component/title.js.map +1 -1
  215. package/lib/component/utils.d.ts +1 -0
  216. package/lib/component/utils.js +26 -1
  217. package/lib/component/utils.js.map +1 -1
  218. package/lib/coordinate/fisheye.js +1 -1
  219. package/lib/coordinate/fisheye.js.map +1 -1
  220. package/lib/interaction/brushFilter.js +1 -1
  221. package/lib/interaction/brushFilter.js.map +1 -1
  222. package/lib/interaction/fisheye.js +1 -1
  223. package/lib/interaction/fisheye.js.map +1 -1
  224. package/lib/interaction/legendFilter.d.ts +1 -1
  225. package/lib/interaction/legendFilter.js +33 -27
  226. package/lib/interaction/legendFilter.js.map +1 -1
  227. package/lib/interaction/sliderFilter.js +2 -2
  228. package/lib/interaction/sliderFilter.js.map +1 -1
  229. package/lib/interaction/tooltip.d.ts +1 -1
  230. package/lib/interaction/tooltip.js +4 -2
  231. package/lib/interaction/tooltip.js.map +1 -1
  232. package/lib/mark/boxplot.js +2 -2
  233. package/lib/mark/boxplot.js.map +1 -1
  234. package/lib/runtime/component.d.ts +3 -3
  235. package/lib/runtime/component.js +4 -4
  236. package/lib/runtime/component.js.map +1 -1
  237. package/lib/runtime/plot.js +2 -2
  238. package/lib/runtime/plot.js.map +1 -1
  239. package/lib/runtime/render.d.ts +1 -1
  240. package/lib/runtime/render.js +19 -3
  241. package/lib/runtime/render.js.map +1 -1
  242. package/lib/runtime/types/common.d.ts +12 -9
  243. package/lib/runtime/types/component.d.ts +13 -4
  244. package/lib/shape/area/area.js +1 -1
  245. package/lib/shape/area/area.js.map +1 -1
  246. package/lib/shape/area/curve.js +2 -1
  247. package/lib/shape/area/curve.js.map +1 -1
  248. package/lib/shape/area/hv.js +1 -1
  249. package/lib/shape/area/hv.js.map +1 -1
  250. package/lib/shape/area/hvh.js +1 -1
  251. package/lib/shape/area/hvh.js.map +1 -1
  252. package/lib/shape/area/smooth.js +1 -1
  253. package/lib/shape/area/smooth.js.map +1 -1
  254. package/lib/shape/area/vh.js +1 -1
  255. package/lib/shape/area/vh.js.map +1 -1
  256. package/lib/shape/box/box.js +1 -0
  257. package/lib/shape/box/box.js.map +1 -1
  258. package/lib/shape/connector/connector.d.ts +2 -2
  259. package/lib/shape/connector/connector.js +3 -2
  260. package/lib/shape/connector/connector.js.map +1 -1
  261. package/lib/shape/interval/funnel.js +1 -1
  262. package/lib/shape/interval/funnel.js.map +1 -1
  263. package/lib/shape/interval/hollow.js +1 -1
  264. package/lib/shape/interval/hollow.js.map +1 -1
  265. package/lib/shape/interval/pyramid.js +1 -1
  266. package/lib/shape/interval/pyramid.js.map +1 -1
  267. package/lib/shape/interval/rect.js +1 -1
  268. package/lib/shape/interval/rect.js.map +1 -1
  269. package/lib/shape/label/label.js +3 -1
  270. package/lib/shape/label/label.js.map +1 -1
  271. package/lib/shape/line/curve.js +2 -1
  272. package/lib/shape/line/curve.js.map +1 -1
  273. package/lib/shape/line/hv.js +1 -1
  274. package/lib/shape/line/hv.js.map +1 -1
  275. package/lib/shape/line/hvh.js +1 -1
  276. package/lib/shape/line/hvh.js.map +1 -1
  277. package/lib/shape/line/line.js +1 -1
  278. package/lib/shape/line/line.js.map +1 -1
  279. package/lib/shape/line/smooth.js +1 -1
  280. package/lib/shape/line/smooth.js.map +1 -1
  281. package/lib/shape/line/vh.js +1 -1
  282. package/lib/shape/line/vh.js.map +1 -1
  283. package/lib/shape/lineXY/line.js +1 -0
  284. package/lib/shape/lineXY/line.js.map +1 -1
  285. package/lib/shape/link/arc.js +1 -0
  286. package/lib/shape/link/arc.js.map +1 -1
  287. package/lib/shape/link/link.js +1 -0
  288. package/lib/shape/link/link.js.map +1 -1
  289. package/lib/shape/link/smooth.js +1 -0
  290. package/lib/shape/link/smooth.js.map +1 -1
  291. package/lib/shape/link/vhv.js +1 -0
  292. package/lib/shape/link/vhv.js.map +1 -1
  293. package/lib/shape/path/hollow.js +1 -0
  294. package/lib/shape/path/hollow.js.map +1 -1
  295. package/lib/shape/path/path.js +1 -0
  296. package/lib/shape/path/path.js.map +1 -1
  297. package/lib/shape/point/bowtie.js +1 -1
  298. package/lib/shape/point/bowtie.js.map +1 -1
  299. package/lib/shape/point/color.js +2 -25
  300. package/lib/shape/point/color.js.map +1 -1
  301. package/lib/shape/point/cross.js +1 -1
  302. package/lib/shape/point/cross.js.map +1 -1
  303. package/lib/shape/point/diamond.js +1 -1
  304. package/lib/shape/point/diamond.js.map +1 -1
  305. package/lib/shape/point/hexagon.js +1 -1
  306. package/lib/shape/point/hexagon.js.map +1 -1
  307. package/lib/shape/point/hollow.js +1 -1
  308. package/lib/shape/point/hollow.js.map +1 -1
  309. package/lib/shape/point/hollowBowtie.js +1 -1
  310. package/lib/shape/point/hollowBowtie.js.map +1 -1
  311. package/lib/shape/point/hollowDiamond.js +1 -1
  312. package/lib/shape/point/hollowDiamond.js.map +1 -1
  313. package/lib/shape/point/hollowHexagon.js +1 -1
  314. package/lib/shape/point/hollowHexagon.js.map +1 -1
  315. package/lib/shape/point/hollowSquare.js +1 -1
  316. package/lib/shape/point/hollowSquare.js.map +1 -1
  317. package/lib/shape/point/hollowTriangle.js +1 -1
  318. package/lib/shape/point/hollowTriangle.js.map +1 -1
  319. package/lib/shape/point/hollowTriangleDown.js +1 -1
  320. package/lib/shape/point/hollowTriangleDown.js.map +1 -1
  321. package/lib/shape/point/hyphen.js +1 -1
  322. package/lib/shape/point/hyphen.js.map +1 -1
  323. package/lib/shape/point/line.js +1 -1
  324. package/lib/shape/point/line.js.map +1 -1
  325. package/lib/shape/point/plus.js +1 -1
  326. package/lib/shape/point/plus.js.map +1 -1
  327. package/lib/shape/point/point.js +1 -1
  328. package/lib/shape/point/point.js.map +1 -1
  329. package/lib/shape/point/square.js +1 -1
  330. package/lib/shape/point/square.js.map +1 -1
  331. package/lib/shape/point/tick.js +1 -1
  332. package/lib/shape/point/tick.js.map +1 -1
  333. package/lib/shape/point/triangle.js +1 -1
  334. package/lib/shape/point/triangle.js.map +1 -1
  335. package/lib/shape/point/triangleDown.js +1 -1
  336. package/lib/shape/point/triangleDown.js.map +1 -1
  337. package/lib/shape/polygon/polygon.js +1 -0
  338. package/lib/shape/polygon/polygon.js.map +1 -1
  339. package/lib/shape/polygon/ribbon.js +1 -0
  340. package/lib/shape/polygon/ribbon.js.map +1 -1
  341. package/lib/shape/shape/shape.js +1 -0
  342. package/lib/shape/shape/shape.js.map +1 -1
  343. package/lib/shape/text/badge.js +1 -0
  344. package/lib/shape/text/badge.js.map +1 -1
  345. package/lib/shape/text/text.js +1 -0
  346. package/lib/shape/text/text.js.map +1 -1
  347. package/lib/shape/utils.d.ts +1 -16
  348. package/lib/shape/utils.js +2 -2
  349. package/lib/shape/utils.js.map +1 -1
  350. package/lib/shape/vector/vector.js +1 -0
  351. package/lib/shape/vector/vector.js.map +1 -1
  352. package/lib/spec/component.d.ts +10 -9
  353. package/lib/spec/coordinateTransform.d.ts +1 -1
  354. package/lib/spec/interaction.d.ts +19 -33
  355. package/lib/spec/theme.d.ts +8 -2
  356. package/lib/stdlib/index.js +1 -1
  357. package/lib/stdlib/index.js.map +1 -1
  358. package/lib/theme/academy.js +73 -74
  359. package/lib/theme/academy.js.map +1 -1
  360. package/lib/theme/classic.d.ts +6 -0
  361. package/lib/theme/{light.js → classic.js} +78 -86
  362. package/lib/theme/classic.js.map +1 -0
  363. package/lib/theme/classicDark.d.ts +6 -0
  364. package/lib/theme/{dark.js → classicDark.js} +76 -85
  365. package/lib/theme/classicDark.js.map +1 -0
  366. package/lib/theme/index.d.ts +2 -2
  367. package/lib/theme/index.js +5 -5
  368. package/lib/theme/index.js.map +1 -1
  369. package/lib/transform/maybeTitle.js +5 -1
  370. package/lib/transform/maybeTitle.js.map +1 -1
  371. package/lib/utils/marker.d.ts +10 -0
  372. package/lib/utils/marker.js +256 -0
  373. package/lib/utils/marker.js.map +1 -0
  374. package/package.json +25 -22
  375. package/src/.DS_Store +0 -0
  376. package/src/api/chart.ts +17 -14
  377. package/src/api/composition/base.ts +26 -1
  378. package/src/component/axis.ts +77 -62
  379. package/src/component/axisRadar.ts +4 -3
  380. package/src/component/axisX.ts +0 -1
  381. package/src/component/legendCategory.ts +68 -63
  382. package/src/component/legendContinuous.ts +29 -21
  383. package/src/component/legendContinuousBlockSize.ts +1 -1
  384. package/src/component/legendContinuousSize.ts +1 -1
  385. package/src/component/scrollbar.ts +1 -1
  386. package/src/component/slider.ts +1 -1
  387. package/src/component/title.ts +3 -5
  388. package/src/component/utils.ts +25 -1
  389. package/src/coordinate/fisheye.ts +2 -2
  390. package/src/data/.DS_Store +0 -0
  391. package/src/interaction/brushFilter.ts +2 -2
  392. package/src/interaction/fisheye.ts +1 -1
  393. package/src/interaction/legendFilter.ts +39 -30
  394. package/src/interaction/sliderFilter.ts +2 -2
  395. package/src/interaction/tooltip.ts +5 -3
  396. package/src/mark/boxplot.ts +2 -2
  397. package/src/runtime/component.ts +7 -4
  398. package/src/runtime/plot.ts +2 -0
  399. package/src/runtime/render.ts +22 -2
  400. package/src/runtime/types/common.ts +13 -10
  401. package/src/runtime/types/component.ts +16 -8
  402. package/src/shape/.DS_Store +0 -0
  403. package/src/shape/area/area.ts +1 -0
  404. package/src/shape/area/curve.ts +2 -1
  405. package/src/shape/area/hv.ts +1 -0
  406. package/src/shape/area/hvh.ts +1 -0
  407. package/src/shape/area/smooth.ts +1 -0
  408. package/src/shape/area/vh.ts +1 -0
  409. package/src/shape/box/box.ts +1 -0
  410. package/src/shape/connector/connector.ts +6 -4
  411. package/src/shape/interval/funnel.ts +1 -0
  412. package/src/shape/interval/hollow.ts +1 -0
  413. package/src/shape/interval/pyramid.ts +1 -0
  414. package/src/shape/interval/rect.ts +1 -0
  415. package/src/shape/label/label.ts +3 -1
  416. package/src/shape/line/curve.ts +2 -1
  417. package/src/shape/line/hv.ts +1 -0
  418. package/src/shape/line/hvh.ts +1 -0
  419. package/src/shape/line/line.ts +1 -0
  420. package/src/shape/line/smooth.ts +1 -0
  421. package/src/shape/line/vh.ts +1 -0
  422. package/src/shape/lineXY/line.ts +1 -0
  423. package/src/shape/link/arc.ts +1 -0
  424. package/src/shape/link/link.ts +1 -0
  425. package/src/shape/link/smooth.ts +1 -0
  426. package/src/shape/link/vhv.ts +1 -0
  427. package/src/shape/path/hollow.ts +1 -0
  428. package/src/shape/path/path.ts +1 -0
  429. package/src/shape/point/bowtie.ts +1 -0
  430. package/src/shape/point/color.ts +4 -4
  431. package/src/shape/point/cross.ts +1 -0
  432. package/src/shape/point/diamond.ts +1 -0
  433. package/src/shape/point/hexagon.ts +1 -0
  434. package/src/shape/point/hollow.ts +1 -0
  435. package/src/shape/point/hollowBowtie.ts +1 -0
  436. package/src/shape/point/hollowDiamond.ts +1 -0
  437. package/src/shape/point/hollowHexagon.ts +1 -0
  438. package/src/shape/point/hollowSquare.ts +1 -0
  439. package/src/shape/point/hollowTriangle.ts +1 -0
  440. package/src/shape/point/hollowTriangleDown.ts +1 -0
  441. package/src/shape/point/hyphen.ts +1 -0
  442. package/src/shape/point/line.ts +1 -0
  443. package/src/shape/point/plus.ts +1 -0
  444. package/src/shape/point/point.ts +1 -0
  445. package/src/shape/point/square.ts +1 -0
  446. package/src/shape/point/tick.ts +1 -0
  447. package/src/shape/point/triangle.ts +1 -0
  448. package/src/shape/point/triangleDown.ts +1 -0
  449. package/src/shape/polygon/polygon.ts +1 -0
  450. package/src/shape/polygon/ribbon.ts +1 -0
  451. package/src/shape/shape/shape.ts +1 -0
  452. package/src/shape/text/badge.ts +1 -0
  453. package/src/shape/text/text.ts +1 -0
  454. package/src/shape/utils.ts +4 -22
  455. package/src/shape/vector/vector.ts +1 -0
  456. package/src/spec/component.ts +10 -9
  457. package/src/spec/coordinateTransform.ts +1 -1
  458. package/src/spec/interaction.ts +19 -43
  459. package/src/spec/theme.ts +22 -2
  460. package/src/stdlib/index.ts +3 -3
  461. package/src/theme/academy.ts +73 -74
  462. package/src/theme/{light.ts → classic.ts} +76 -84
  463. package/src/theme/{dark.ts → classicDark.ts} +74 -84
  464. package/src/theme/index.ts +2 -2
  465. package/src/transform/maybeTitle.ts +5 -1
  466. package/src/utils/marker.ts +293 -0
  467. package/esm/shape/point/symbol.d.ts +0 -49
  468. package/esm/shape/point/symbol.js +0 -143
  469. package/esm/shape/point/symbol.js.map +0 -1
  470. package/esm/theme/dark.d.ts +0 -6
  471. package/esm/theme/dark.js.map +0 -1
  472. package/esm/theme/light.d.ts +0 -6
  473. package/esm/theme/light.js.map +0 -1
  474. package/lib/shape/point/symbol.d.ts +0 -49
  475. package/lib/shape/point/symbol.js +0 -158
  476. package/lib/shape/point/symbol.js.map +0 -1
  477. package/lib/theme/dark.d.ts +0 -6
  478. package/lib/theme/dark.js.map +0 -1
  479. package/lib/theme/light.d.ts +0 -6
  480. package/lib/theme/light.js.map +0 -1
  481. package/src/shape/point/symbol.ts +0 -154
@@ -1,20 +1,23 @@
1
1
  import type { Coordinate } from '@antv/coord';
2
2
  import type { DisplayObject } from '@antv/g';
3
3
  import { Category } from '@antv/gui';
4
+ import { last } from '@antv/util';
4
5
  import { format } from 'd3-format';
5
6
  import type {
6
7
  FlexLayout,
7
8
  G2Library,
9
+ G2MarkState,
8
10
  G2Theme,
9
11
  GuideComponentComponent as GCC,
10
12
  GuideComponentOrientation as GCO,
11
13
  GuideComponentPosition as GCP,
12
14
  Scale,
13
15
  } from '../runtime';
14
- import { useLibrary } from '../runtime/library';
15
- import { Shape, ShapeComponent } from '../runtime/types/component';
16
- import type { G2ShapeOptions } from '../runtime/types/options';
16
+ import { GuideComponentContext } from '../runtime/types/component';
17
+ import type { G2Mark } from '../runtime/types/options';
18
+ import { useMarker } from '../utils/marker';
17
19
  import {
20
+ adaptor,
18
21
  domainOf,
19
22
  G2Layout,
20
23
  inferComponentLayout,
@@ -64,53 +67,64 @@ function createShape(
64
67
  theme: G2Theme,
65
68
  style: Record<string, any> = {},
66
69
  ) {
67
- const [useShape] = useLibrary<G2ShapeOptions, ShapeComponent, Shape>(
68
- 'shape',
69
- library,
70
- );
71
- const shapeOptions = [
72
- [
73
- [0, 0],
74
- [0, 0],
75
- ],
76
- { size: 6, ...style },
77
- coordinate,
78
- theme,
79
- ];
80
- return () => {
81
- try {
82
- // @ts-ignore
83
- return useShape({ type: `point.${shape}` })(...shapeOptions);
84
- } catch (e) {
85
- // @ts-ignore
86
- return useShape({ type: 'point.point' })(...shapeOptions);
87
- }
88
- };
70
+ const marker =
71
+ (library[`shape.${shape}`]?.props?.defaultMarker as string) ||
72
+ last(shape.split('.'));
73
+ return () => useMarker(marker, style)(0, 0, 6);
74
+ }
75
+
76
+ function inferShape(scales: Scale[], markState: Map<G2Mark, G2MarkState>) {
77
+ const shapeScale = scaleOf(scales, 'shape');
78
+ const colorScale = scaleOf(scales, 'color');
79
+ // infer the main shape if multiple marks are used
80
+ const shapes: [string, string[]][] = [];
81
+ for (const [mark, state] of markState) {
82
+ const namespace = mark.type;
83
+ const domain =
84
+ colorScale?.getOptions().domain.length > 0
85
+ ? colorScale?.getOptions().domain
86
+ : state.data;
87
+ const shape: string[] = domain.map((d, i) => {
88
+ if (shapeScale) return shapeScale.map(d || 'point');
89
+ return mark?.style?.shape || state.defaultShape || 'point';
90
+ });
91
+ if (typeof namespace === 'string') shapes.push([namespace, shape]);
92
+ }
93
+
94
+ if (shapes.length === 0) return ['point', ['point']];
95
+ if (shapes.length === 1) return shapes[0];
96
+ if (!shapeScale) return shapes[0];
97
+ // Evaluate the maximum likelihood of shape
98
+ const { range } = shapeScale.getOptions();
99
+ return shapes
100
+ .map(([namespace, shape]) => {
101
+ let sum = 0;
102
+ for (let i = 0; i < shapes.length; i++) {
103
+ const targetShape = range[i % range.length];
104
+ if (shape[i] === targetShape) sum++;
105
+ }
106
+ return [sum / shape.length, [namespace, shape]] as const;
107
+ })
108
+ .sort((a, b) => b[0] - a[0])[0][1];
89
109
  }
90
110
 
91
111
  function inferItemMarker(
92
- scales: Scale[],
93
- options: LegendCategoryOptions,
94
- library: G2Library,
95
- coordinate: Coordinate,
96
- theme: G2Theme,
112
+ options,
113
+ { scales, library, coordinate, theme, markState }: GuideComponentContext,
97
114
  ): ((datum: any, i: number, data: any) => () => DisplayObject) | undefined {
98
115
  const shapeScale = scaleOf(scales, 'shape');
116
+ const [namespace, shapes] = inferShape(scales, markState);
99
117
 
100
118
  const { itemMarker } = options;
101
119
  if (shapeScale && !itemMarker) {
102
- const { domain } = shapeScale.getOptions();
103
-
104
120
  return (d, i) =>
105
- createShape(shapeScale.map(domain[i]), library, coordinate, theme, {
121
+ createShape(`${namespace}.${shapes[i]}`, library, coordinate, theme, {
106
122
  color: d.color,
107
123
  });
108
124
  }
109
- if (typeof itemMarker === 'function') {
110
- return itemMarker;
111
- }
125
+ if (typeof itemMarker === 'function') return itemMarker;
112
126
  return (d, i) =>
113
- createShape(itemMarker || 'point', library, coordinate, theme, {
127
+ createShape(itemMarker || shapes[i], library, coordinate, theme, {
114
128
  color: d.color,
115
129
  });
116
130
  }
@@ -132,17 +146,11 @@ function inferItemMarkerSize(scales: Scale[]) {
132
146
  return 8;
133
147
  }
134
148
 
135
- function inferCategoryStyle(
136
- scales: Scale[],
137
- options: LegendCategoryOptions,
138
- library: G2Library,
139
- coordinate: Coordinate,
140
- theme: G2Theme,
141
- ) {
149
+ function inferCategoryStyle(options, context: GuideComponentContext) {
142
150
  const { labelFormatter = (d) => `${d}` } = options;
143
-
151
+ const { scales } = context;
144
152
  const baseStyle = {
145
- itemMarker: inferItemMarker(scales, options, library, coordinate, theme),
153
+ itemMarker: inferItemMarker(options, context),
146
154
  itemMarkerSize: inferItemMarkerSize(scales),
147
155
  itemMarkerOpacity: inferItemMarkerOpacity(scales),
148
156
  };
@@ -187,24 +195,21 @@ function inferLegendShape(
187
195
  */
188
196
  export const LegendCategory: GCC<LegendCategoryOptions> = (options) => {
189
197
  const {
198
+ labelFormatter,
199
+ layout,
190
200
  order,
191
- size,
192
- position,
193
201
  orientation,
194
- itemMarker,
195
- labelFormatter,
196
- dx = 0,
197
- dy = 0,
202
+ position,
203
+ size,
198
204
  title,
199
- gridCol,
200
- gridRow,
201
- layout,
202
- ...rest
205
+ ...style
203
206
  } = options;
204
207
 
205
- return (scales, value, coordinate, theme) => {
206
- const { library, bbox } = value;
207
- const { x, y } = bbox;
208
+ const { gridCol, gridRow } = style;
209
+
210
+ return (context) => {
211
+ const { value, theme } = context;
212
+ const { bbox } = value;
208
213
  const { width, height } = inferLegendShape(value, options, LegendCategory);
209
214
 
210
215
  const finalLayout = inferComponentLayout(
@@ -229,14 +234,14 @@ export const LegendCategory: GCC<LegendCategoryOptions> = (options) => {
229
234
  rowPadding: 0,
230
235
  colPadding: 8,
231
236
  titleText: titleContent(title),
232
- ...inferCategoryStyle(scales, options, library, coordinate, theme),
237
+ ...inferCategoryStyle(options, context),
233
238
  };
234
239
 
235
240
  const { legend: legendTheme = {} } = theme;
236
241
  const layoutWrapper = new G2Layout({
237
242
  style: {
238
- x: x + dx,
239
- y: y + dy,
243
+ x: bbox.x,
244
+ y: bbox.y,
240
245
  width: bbox.width,
241
246
  height: bbox.height,
242
247
  ...finalLayout,
@@ -246,7 +251,7 @@ export const LegendCategory: GCC<LegendCategoryOptions> = (options) => {
246
251
  layoutWrapper.appendChild(
247
252
  new Category({
248
253
  className: 'legend-category',
249
- style: Object.assign({}, legendTheme, legendStyle, rest),
254
+ style: adaptor(Object.assign({}, legendTheme, legendStyle, style)),
250
255
  }),
251
256
  );
252
257
  return layoutWrapper;
@@ -8,6 +8,7 @@ import type {
8
8
  Scale,
9
9
  } from '../runtime';
10
10
  import {
11
+ adaptor,
11
12
  G2Layout,
12
13
  inferComponentLayout,
13
14
  inferComponentShape,
@@ -90,8 +91,6 @@ function inferContinuousConfig(
90
91
  */
91
92
  export const LegendContinuous: GCC<LegendContinuousOptions> = (options) => {
92
93
  const {
93
- dx = 0,
94
- dy = 0,
95
94
  labelFormatter,
96
95
  layout,
97
96
  order,
@@ -99,9 +98,10 @@ export const LegendContinuous: GCC<LegendContinuousOptions> = (options) => {
99
98
  position,
100
99
  size,
101
100
  title,
101
+ style,
102
102
  ...rest
103
103
  } = options;
104
- return (scales, value, coordinate, theme) => {
104
+ return ({ scales, value, theme }) => {
105
105
  const { bbox } = value;
106
106
  const { x, y, width, height } = bbox;
107
107
 
@@ -111,8 +111,8 @@ export const LegendContinuous: GCC<LegendContinuousOptions> = (options) => {
111
111
  );
112
112
  const layoutWrapper = new G2Layout({
113
113
  style: {
114
- x: x + dx,
115
- y: y + dy,
114
+ x,
115
+ y,
116
116
  width,
117
117
  height,
118
118
  ...finalLayout,
@@ -123,22 +123,30 @@ export const LegendContinuous: GCC<LegendContinuousOptions> = (options) => {
123
123
 
124
124
  layoutWrapper.appendChild(
125
125
  new Continuous({
126
- style: Object.assign(
127
- {},
128
- legendTheme,
129
- {
130
- titleText: titleContent(title),
131
- titleFontSize: 12,
132
- showHandle: false,
133
- showIndicator: false,
134
- labelAlign: 'value',
135
- labelFormatter:
136
- typeof labelFormatter === 'string'
137
- ? (d) => format(labelFormatter)(d.label)
138
- : labelFormatter,
139
- ...inferContinuousConfig(scales, value, options, LegendContinuous),
140
- },
141
- rest,
126
+ style: adaptor(
127
+ Object.assign(
128
+ {},
129
+ legendTheme,
130
+ {
131
+ titleText: titleContent(title),
132
+ titleFontSize: 12,
133
+ handle: false,
134
+ indicator: false,
135
+ labelAlign: 'value',
136
+ labelFormatter:
137
+ typeof labelFormatter === 'string'
138
+ ? (d) => format(labelFormatter)(d.label)
139
+ : labelFormatter,
140
+ ...inferContinuousConfig(
141
+ scales,
142
+ value,
143
+ options,
144
+ LegendContinuous,
145
+ ),
146
+ ...style,
147
+ },
148
+ rest,
149
+ ),
142
150
  ),
143
151
  }),
144
152
  );
@@ -7,7 +7,7 @@ export const LegendContinuousBlockSize: GCC<
7
7
  LegendContinuousBlockSizeOptions
8
8
  > = (options) => {
9
9
  return LegendContinuous(
10
- Object.assign({}, { type: 'size', block: true, showTick: false }, options),
10
+ Object.assign({}, { type: 'size', block: true, tick: false }, options),
11
11
  );
12
12
  };
13
13
 
@@ -11,7 +11,7 @@ export const LegendContinuousSize: GCC<LegendContinuousSizeOptions> = (
11
11
  {},
12
12
  {
13
13
  type: 'size',
14
- showTick: false,
14
+ tick: false,
15
15
  labelFilter: (datum, index, data) =>
16
16
  index === 0 || index === data.length - 1,
17
17
  },
@@ -12,7 +12,7 @@ export type ScrollbarOptions = {
12
12
  export const Scrollbar: GCC<ScrollbarOptions> = (options) => {
13
13
  const { orientation, labelFormatter, style, ...rest } = options;
14
14
 
15
- return (scales, value, coordinate, theme) => {
15
+ return ({ value, theme }) => {
16
16
  const { bbox } = value;
17
17
  const { x, y, width, height } = bbox;
18
18
  const { scrollbar: scrollbarTheme = {} } = theme;
@@ -15,7 +15,7 @@ export const Slider: GCC<SliderOptions> = (options) => {
15
15
  // do not pass size.
16
16
  const { orientation, labelFormatter, size, style, ...rest } = options;
17
17
 
18
- return ([scale], value, coordinate, theme) => {
18
+ return ({ scales: [scale], value, theme }) => {
19
19
  const { bbox } = value;
20
20
  const { x, y, width, height } = bbox;
21
21
  const { slider: sliderTheme = {} } = theme;
@@ -17,7 +17,7 @@ function inferStyleByAlign(
17
17
  x: number,
18
18
  y: number,
19
19
  width: number,
20
- align: TitleStyleProps['align'],
20
+ align: TitleStyleProps['style']['align'],
21
21
  ) {
22
22
  switch (align) {
23
23
  case 'center':
@@ -49,9 +49,7 @@ const Title = createComponent<TitleStyleProps>({
49
49
  width,
50
50
  title,
51
51
  subtitle,
52
- spacing = 2,
53
- align = 'left',
54
- style,
52
+ style: { spacing = 2, align = 'left', ...style },
55
53
  } = attributes;
56
54
 
57
55
  const titleStyle = subObject(style, 'title');
@@ -88,7 +86,7 @@ const Title = createComponent<TitleStyleProps>({
88
86
  * Title Component.
89
87
  */
90
88
  export const TitleComponent: GCC<TitleComponentOptions> = (options) => {
91
- return (scales, value, coordinate, theme) => {
89
+ return ({ value, theme }) => {
92
90
  const { x, y, width, height } = value.bbox;
93
91
  return new Title({
94
92
  style: deepMix(
@@ -1,6 +1,6 @@
1
1
  import { CustomElement, DisplayObjectConfig, Group } from '@antv/g';
2
2
  import { Layout } from '@antv/gui';
3
- import { deepMix } from '@antv/util';
3
+ import { deepMix, upperFirst } from '@antv/util';
4
4
  import {
5
5
  FlexLayout,
6
6
  GuideComponentComponent,
@@ -131,3 +131,27 @@ export function domainOf(scales: Scale[]): any[] {
131
131
  .find((scale) => scale.getOptions().domain.length > 0)
132
132
  .getOptions().domain;
133
133
  }
134
+
135
+ export function adaptor<T>(style: T) {
136
+ const reservedKeys = [
137
+ 'arrow',
138
+ 'crosshairs',
139
+ 'grid',
140
+ 'handle',
141
+ 'handleLabel',
142
+ 'indicator',
143
+ 'label',
144
+ 'line',
145
+ 'tick',
146
+ 'tip',
147
+ 'title',
148
+ 'trunc',
149
+ ];
150
+ const finalStyle = {};
151
+ Object.entries(style).forEach(([key, value]) => {
152
+ if (reservedKeys.includes(key))
153
+ finalStyle[`show${upperFirst(key)}`] = value;
154
+ else finalStyle[key] = value;
155
+ });
156
+ return finalStyle as T;
157
+ }
@@ -11,7 +11,7 @@ export const Fisheye: CC<FisheyeOptions> = ({
11
11
  focusY = 0,
12
12
  distortionX = 2,
13
13
  distortionY = 2,
14
- isVisual = false,
15
- }) => [['fisheye', focusX, focusY, distortionX, distortionY, isVisual]];
14
+ visual = false,
15
+ }) => [['fisheye', focusX, focusY, distortionX, distortionY, visual]];
16
16
 
17
17
  Fisheye.props = { transform: true };
Binary file
@@ -104,8 +104,8 @@ export function BrushFilter({ hideX = true, hideY = true, ...rest }) {
104
104
  {
105
105
  // Hide label to keep smooth transition.
106
106
  axis: {
107
- ...(hideX && { x: { labelOverlap: [{ type: 'hide' }] } }),
108
- ...(hideY && { y: { labelOverlap: [{ type: 'hide' }] } }),
107
+ ...(hideX && { x: { transform: [{ type: 'hide' }] } }),
108
+ ...(hideY && { y: { transform: [{ type: 'hide' }] } }),
109
109
  },
110
110
  },
111
111
  mark,
@@ -37,7 +37,7 @@ export function Fisheye({
37
37
  const fisheye = maybeCoordinate(clonedOptions);
38
38
  fisheye.focusX = x;
39
39
  fisheye.focusY = y;
40
- fisheye.isVisual = true;
40
+ fisheye.visual = true;
41
41
  update(clonedOptions);
42
42
  },
43
43
  wait,
@@ -134,11 +134,47 @@ function legendFilter(
134
134
  }
135
135
 
136
136
  export function LegendFilter() {
137
- return (context) => {
137
+ return (context, _, emitter) => {
138
138
  const { container, view, options: viewOptions, update } = context;
139
139
 
140
140
  const legends = legendsOf(container);
141
- if (!legends.length) return () => {};
141
+
142
+ const filter = async (channel, value) => {
143
+ const { scale } = view;
144
+ const { [channel]: scaleOrdinal } = scale;
145
+ const { marks } = viewOptions;
146
+ // Add filter transform for every marks,
147
+ // which will skip for mark without color channel.
148
+ const newMarks = marks.map((mark) => {
149
+ const { transform = [] } = mark;
150
+ const newTransform = [
151
+ { type: 'filter', [channel]: value },
152
+ ...transform,
153
+ ];
154
+ return deepMix({}, mark, {
155
+ transform: newTransform,
156
+ // Set domain of scale to preserve legends.
157
+ scale: {
158
+ [channel]: {
159
+ domain: scaleOrdinal.getOptions().domain,
160
+ },
161
+ },
162
+ });
163
+ });
164
+ const newOptions = {
165
+ ...viewOptions,
166
+ marks: newMarks,
167
+ };
168
+ return update(newOptions);
169
+ };
170
+
171
+ if (!legends.length) {
172
+ emitter.on('legend:filter', (options) => {
173
+ const { values, channel } = options;
174
+ filter(channel, values);
175
+ });
176
+ return () => {};
177
+ }
142
178
 
143
179
  const removes = legends.map((legend) => {
144
180
  const { name: channel, domain } = dataOf(legend).scales[0];
@@ -151,34 +187,7 @@ export function LegendFilter() {
151
187
  const { index } = datum;
152
188
  return domain[index];
153
189
  },
154
- filter: async (value) => {
155
- const { scale } = view;
156
- const { [channel]: scaleOrdinal } = scale;
157
- const { marks } = viewOptions;
158
- // Add filter transform for every marks,
159
- // which will skip for mark without color channel.
160
- const newMarks = marks.map((mark) => {
161
- const { transform = [] } = mark;
162
- const newTransform = [
163
- { type: 'filter', [channel]: value },
164
- ...transform,
165
- ];
166
- return deepMix({}, mark, {
167
- transform: newTransform,
168
- // Set domain of scale to preserve legends.
169
- scale: {
170
- [channel]: {
171
- domain: scaleOrdinal.getOptions().domain,
172
- },
173
- },
174
- });
175
- });
176
- const newOptions = {
177
- ...viewOptions,
178
- marks: newMarks,
179
- };
180
- return update(newOptions);
181
- },
190
+ filter: (value) => filter(channel, value),
182
191
  state: legend.attributes.state,
183
192
  });
184
193
  });
@@ -10,8 +10,8 @@ function filterDataByDomain(options, scaleOptions) {
10
10
  {
11
11
  // Hide label to keep smooth transition.
12
12
  axis: {
13
- x: { labelOverlap: [{ type: 'hide' }] },
14
- y: { labelOverlap: [{ type: 'hide' }] },
13
+ x: { transform: [{ type: 'hide' }] },
14
+ y: { transform: [{ type: 'hide' }] },
15
15
  },
16
16
  },
17
17
  mark,
@@ -1,6 +1,6 @@
1
1
  import { DisplayObject, IElement, Line } from '@antv/g';
2
2
  import { sort, group, mean, bisector } from 'd3-array';
3
- import { lowerFirst, throttle } from '@antv/util';
3
+ import { deepMix, lowerFirst, throttle } from '@antv/util';
4
4
  import { Tooltip as TooltipComponent } from '@antv/gui';
5
5
  import { Constant, Identity } from '@antv/scale';
6
6
  import { defined, subObject } from '../utils/helper';
@@ -275,7 +275,6 @@ export function seriesTooltip(
275
275
  coordinate,
276
276
  crosshairs,
277
277
  render,
278
- style,
279
278
  groupName = true,
280
279
  wait = 50,
281
280
  leading = true,
@@ -286,11 +285,14 @@ export function seriesTooltip(
286
285
  single = true,
287
286
  position,
288
287
  enterable,
288
+ style: _style = {},
289
+ ...rest
289
290
  }: Record<string, any>,
290
291
  ) {
291
292
  const elements = elementsof(root);
292
293
  const transposed = isTranspose(coordinate);
293
294
  const polar = isPolar(coordinate);
295
+ const style = deepMix(_style, rest);
294
296
  const { innerWidth: width, innerHeight: height } = coordinate.getOptions();
295
297
 
296
298
  // Split elements into series elements and item elements.
@@ -386,7 +388,7 @@ export function seriesTooltip(
386
388
  selectedSeriesElements.push(element);
387
389
  const d = seriesData(element, index);
388
390
  const { x, y } = d;
389
- const p = coordinate.map([x + offsetX, y]);
391
+ const p = coordinate.map([(x || 0) + offsetX, y || 0]);
390
392
  selectedSeriesData.push([d, p] as const);
391
393
  }
392
394
  }
@@ -66,7 +66,7 @@ export const Boxplot: CC<BoxPlotOptions> = (options) => {
66
66
  animate,
67
67
  ...rest
68
68
  } = options;
69
- const { extend = false, ...restStyle } = style;
69
+ const { point = true, ...restStyle } = style;
70
70
  const { y } = encode;
71
71
  const encodeY = { y, y1: y, y2: y, y3: y, y4: y };
72
72
  const qy = { y1: q1, y2: q2, y3: q3 };
@@ -93,7 +93,7 @@ export const Boxplot: CC<BoxPlotOptions> = (options) => {
93
93
 
94
94
  // Only show min and max instead of lower and upper.
95
95
  // Only draw a box.
96
- if (extend) {
96
+ if (!point) {
97
97
  return [
98
98
  {
99
99
  type: 'box',
@@ -2,9 +2,8 @@
2
2
  * @see https://github.com/antvis/G2/discussions/4557
3
3
  */
4
4
  import { Coordinate } from '@antv/coord';
5
- import { group } from 'd3-array';
6
5
  import { isEqual } from '@antv/util';
7
- import { defined } from '../utils/helper';
6
+ import { group } from 'd3-array';
8
7
  import {
9
8
  getPolarOptions,
10
9
  getRadialOptions,
@@ -12,6 +11,7 @@ import {
12
11
  type RadialOptions,
13
12
  } from '../coordinate';
14
13
  import { combine } from '../utils/array';
14
+ import { defined } from '../utils/helper';
15
15
  import {
16
16
  coordOf,
17
17
  isHelix,
@@ -27,6 +27,7 @@ import {
27
27
  import { useLibrary } from './library';
28
28
  import { isValidScale, useRelationScale } from './scale';
29
29
  import {
30
+ G2MarkState,
30
31
  G2Theme,
31
32
  GuideComponentOrientation as GCO,
32
33
  GuideComponentPosition as GCP,
@@ -39,6 +40,7 @@ import {
39
40
  G2CoordinateOptions,
40
41
  G2GuideComponentOptions,
41
42
  G2Library,
43
+ G2Mark,
42
44
  G2ScaleOptions,
43
45
  G2View,
44
46
  } from './types/options';
@@ -132,9 +134,10 @@ export function inferComponent(
132
134
 
133
135
  export function renderComponent(
134
136
  component: G2GuideComponentOptions,
135
- coordinates: Coordinate,
137
+ coordinate: Coordinate,
136
138
  theme: G2Theme,
137
139
  library: G2Library,
140
+ markState: Map<G2Mark, G2MarkState>,
138
141
  ) {
139
142
  const [useGuideComponent] = useLibrary<
140
143
  G2GuideComponentOptions,
@@ -147,7 +150,7 @@ export function renderComponent(
147
150
  );
148
151
  const value = { bbox, scales: scaleDescriptors, library };
149
152
  const render = useGuideComponent(options);
150
- return render(scales, value, coordinates, theme);
153
+ return render({ coordinate, library, markState, scales, theme, value });
151
154
  }
152
155
 
153
156
  function inferLegendComponentType(
@@ -723,6 +723,7 @@ async function plotView(
723
723
  coordinate,
724
724
  theme,
725
725
  library,
726
+ markState,
726
727
  ),
727
728
  ),
728
729
  (update) =>
@@ -734,6 +735,7 @@ async function plotView(
734
735
  coordinate,
735
736
  theme,
736
737
  library,
738
+ markState,
737
739
  );
738
740
  const { attributes } = newComponent;
739
741
  const [node] = this.childNodes;