@antv/g2 5.2.10 → 5.2.12

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 (493) hide show
  1. package/README.md +2 -2
  2. package/README.zh-CN.md +2 -2
  3. package/dist/g2.lite.min.js +22 -22
  4. package/dist/g2.min.js +22 -22
  5. package/esm/animation/scaleInY.js +2 -20
  6. package/esm/animation/scaleInY.js.map +1 -1
  7. package/esm/animation/waveIn.js +1 -1
  8. package/esm/animation/waveIn.js.map +1 -1
  9. package/esm/api/runtime.js +2 -1
  10. package/esm/api/runtime.js.map +1 -1
  11. package/esm/component/axis.js +2 -2
  12. package/esm/component/axis.js.map +1 -1
  13. package/esm/component/legendCategory.js +6 -2
  14. package/esm/component/legendCategory.js.map +1 -1
  15. package/esm/component/legendContinuous.js +1 -1
  16. package/esm/component/legendContinuous.js.map +1 -1
  17. package/esm/component/slider.js +1 -1
  18. package/esm/component/slider.js.map +1 -1
  19. package/esm/composition/d3Projection.d.ts +1 -1
  20. package/esm/composition/d3Projection.js +1 -1
  21. package/esm/composition/d3Projection.js.map +1 -1
  22. package/esm/composition/facetRect.js +1 -1
  23. package/esm/composition/facetRect.js.map +1 -1
  24. package/esm/composition/geoView.js +1 -1
  25. package/esm/composition/geoView.js.map +1 -1
  26. package/esm/data/cluster.d.ts +1 -1
  27. package/esm/data/cluster.js +1 -1
  28. package/esm/data/cluster.js.map +1 -1
  29. package/esm/data/fetch.js +1 -1
  30. package/esm/data/fetch.js.map +1 -1
  31. package/esm/data/join.js +1 -1
  32. package/esm/data/join.js.map +1 -1
  33. package/esm/data/kde.js +1 -1
  34. package/esm/data/kde.js.map +1 -1
  35. package/esm/data/tree.js +1 -1
  36. package/esm/data/tree.js.map +1 -1
  37. package/esm/data/utils/arc/arc.d.ts +25 -2
  38. package/esm/data/utils/arc/arc.js +1 -1
  39. package/esm/data/utils/arc/arc.js.map +1 -1
  40. package/esm/data/utils/arc/types.d.ts +27 -2
  41. package/esm/data/utils/d3-sankey/align.js +1 -1
  42. package/esm/data/utils/d3-sankey/align.js.map +1 -1
  43. package/esm/data/utils/d3-sankey/sankey.js +1 -1
  44. package/esm/data/utils/d3-sankey/sankey.js.map +1 -1
  45. package/esm/data/wordCloud.js +1 -1
  46. package/esm/data/wordCloud.js.map +1 -1
  47. package/esm/exports.d.ts +2 -0
  48. package/esm/exports.js +2 -0
  49. package/esm/exports.js.map +1 -1
  50. package/esm/index.d.ts +2 -0
  51. package/esm/interaction/chartIndex.js +1 -1
  52. package/esm/interaction/chartIndex.js.map +1 -1
  53. package/esm/interaction/elementHighlight.js +1 -1
  54. package/esm/interaction/elementHighlight.js.map +1 -1
  55. package/esm/interaction/elementSelect.d.ts +1 -0
  56. package/esm/interaction/elementSelect.js +32 -3
  57. package/esm/interaction/elementSelect.js.map +1 -1
  58. package/esm/interaction/event.d.ts +0 -1
  59. package/esm/interaction/event.js +2 -13
  60. package/esm/interaction/event.js.map +1 -1
  61. package/esm/interaction/legendHighlight.js +1 -1
  62. package/esm/interaction/legendHighlight.js.map +1 -1
  63. package/esm/interaction/tooltip.js +8 -35
  64. package/esm/interaction/tooltip.js.map +1 -1
  65. package/esm/interaction/treemapDrillDown.d.ts +2 -2
  66. package/esm/interaction/treemapDrillDown.js.map +1 -1
  67. package/esm/interaction/utils.js +2 -2
  68. package/esm/interaction/utils.js.map +1 -1
  69. package/esm/label-transform/contrastReverse.js +1 -1
  70. package/esm/label-transform/contrastReverse.js.map +1 -1
  71. package/esm/label-transform/overlapDodgeY.js +1 -1
  72. package/esm/label-transform/overlapDodgeY.js.map +1 -1
  73. package/esm/lib/core.d.ts +1 -0
  74. package/esm/lib/core.js +2 -1
  75. package/esm/lib/core.js.map +1 -1
  76. package/esm/lib/std.d.ts +1 -0
  77. package/esm/mark/area.js +1 -1
  78. package/esm/mark/area.js.map +1 -1
  79. package/esm/mark/boxplot.js +1 -1
  80. package/esm/mark/boxplot.js.map +1 -1
  81. package/esm/mark/forceGraph.js +1 -1
  82. package/esm/mark/forceGraph.js.map +1 -1
  83. package/esm/mark/line.js +1 -1
  84. package/esm/mark/line.js.map +1 -1
  85. package/esm/mark/pack.js +1 -1
  86. package/esm/mark/pack.js.map +1 -1
  87. package/esm/mark/utils.d.ts +1 -1
  88. package/esm/runtime/component.js +2 -2
  89. package/esm/runtime/component.js.map +1 -1
  90. package/esm/runtime/layout.js +1 -1
  91. package/esm/runtime/layout.js.map +1 -1
  92. package/esm/runtime/mark.js +1 -1
  93. package/esm/runtime/mark.js.map +1 -1
  94. package/esm/runtime/plot.js +2 -2
  95. package/esm/runtime/plot.js.map +1 -1
  96. package/esm/runtime/scale.js +2 -2
  97. package/esm/runtime/scale.js.map +1 -1
  98. package/esm/runtime/transform.d.ts +1 -0
  99. package/esm/runtime/transform.js +3 -2
  100. package/esm/runtime/transform.js.map +1 -1
  101. package/esm/runtime/types/mark.d.ts +1 -1
  102. package/esm/shape/area/area.js +1 -1
  103. package/esm/shape/area/area.js.map +1 -1
  104. package/esm/shape/area/curve.d.ts +1 -1
  105. package/esm/shape/area/curve.js +1 -1
  106. package/esm/shape/area/curve.js.map +1 -1
  107. package/esm/shape/area/hv.js +1 -1
  108. package/esm/shape/area/hv.js.map +1 -1
  109. package/esm/shape/area/hvh.js +1 -1
  110. package/esm/shape/area/hvh.js.map +1 -1
  111. package/esm/shape/area/smooth.js +1 -1
  112. package/esm/shape/area/smooth.js.map +1 -1
  113. package/esm/shape/area/vh.js +1 -1
  114. package/esm/shape/area/vh.js.map +1 -1
  115. package/esm/shape/box/box.js +1 -1
  116. package/esm/shape/box/box.js.map +1 -1
  117. package/esm/shape/box/violin.js +1 -1
  118. package/esm/shape/box/violin.js.map +1 -1
  119. package/esm/shape/connector/connector.js +1 -1
  120. package/esm/shape/connector/connector.js.map +1 -1
  121. package/esm/shape/density/density.js +1 -1
  122. package/esm/shape/density/density.js.map +1 -1
  123. package/esm/shape/heatmap/heatmap.js +2 -2
  124. package/esm/shape/heatmap/heatmap.js.map +1 -1
  125. package/esm/shape/interval/color.js +1 -1
  126. package/esm/shape/interval/color.js.map +1 -1
  127. package/esm/shape/interval/funnel.js +1 -1
  128. package/esm/shape/interval/funnel.js.map +1 -1
  129. package/esm/shape/label/position/area.js +1 -1
  130. package/esm/shape/label/position/area.js.map +1 -1
  131. package/esm/shape/label/position/utils.js +1 -1
  132. package/esm/shape/label/position/utils.js.map +1 -1
  133. package/esm/shape/line/curve.d.ts +1 -1
  134. package/esm/shape/line/curve.js +1 -1
  135. package/esm/shape/line/curve.js.map +1 -1
  136. package/esm/shape/line/hv.js +1 -1
  137. package/esm/shape/line/hv.js.map +1 -1
  138. package/esm/shape/line/hvh.js +1 -1
  139. package/esm/shape/line/hvh.js.map +1 -1
  140. package/esm/shape/line/line.js +1 -1
  141. package/esm/shape/line/line.js.map +1 -1
  142. package/esm/shape/line/smooth.js +1 -1
  143. package/esm/shape/line/smooth.js.map +1 -1
  144. package/esm/shape/line/trail.js +1 -1
  145. package/esm/shape/line/trail.js.map +1 -1
  146. package/esm/shape/line/vh.js +1 -1
  147. package/esm/shape/line/vh.js.map +1 -1
  148. package/esm/shape/lineXY/line.js +1 -1
  149. package/esm/shape/lineXY/line.js.map +1 -1
  150. package/esm/shape/link/arc.js +1 -1
  151. package/esm/shape/link/arc.js.map +1 -1
  152. package/esm/shape/link/smooth.js +1 -1
  153. package/esm/shape/link/smooth.js.map +1 -1
  154. package/esm/shape/link/vhv.js +1 -1
  155. package/esm/shape/link/vhv.js.map +1 -1
  156. package/esm/shape/polygon/polygon.js +1 -1
  157. package/esm/shape/polygon/polygon.js.map +1 -1
  158. package/esm/shape/polygon/ribbon.js +1 -1
  159. package/esm/shape/polygon/ribbon.js.map +1 -1
  160. package/esm/shape/text/advance.js +1 -1
  161. package/esm/shape/text/advance.js.map +1 -1
  162. package/esm/shape/utils.d.ts +1 -1
  163. package/esm/shape/utils.js +1 -1
  164. package/esm/shape/utils.js.map +1 -1
  165. package/esm/shape/vector/vector.js +1 -1
  166. package/esm/shape/vector/vector.js.map +1 -1
  167. package/esm/spec/interaction.d.ts +1 -0
  168. package/esm/transform/bin.js +1 -1
  169. package/esm/transform/bin.js.map +1 -1
  170. package/esm/transform/flexX.js +1 -1
  171. package/esm/transform/flexX.js.map +1 -1
  172. package/esm/transform/groupN.js +1 -1
  173. package/esm/transform/groupN.js.map +1 -1
  174. package/esm/transform/normalizeY.js +1 -1
  175. package/esm/transform/normalizeY.js.map +1 -1
  176. package/esm/transform/sample.js +1 -1
  177. package/esm/transform/sample.js.map +1 -1
  178. package/esm/transform/select.js +1 -1
  179. package/esm/transform/select.js.map +1 -1
  180. package/esm/transform/sort.d.ts +1 -1
  181. package/esm/transform/sort.js +20 -52
  182. package/esm/transform/sort.js.map +1 -1
  183. package/esm/transform/stackEnter.js +1 -1
  184. package/esm/transform/stackEnter.js.map +1 -1
  185. package/esm/transform/symmetryY.js +1 -1
  186. package/esm/transform/symmetryY.js.map +1 -1
  187. package/esm/transform/utils/order.d.ts +1 -1
  188. package/esm/transform/utils/order.js +1 -1
  189. package/esm/transform/utils/order.js.map +1 -1
  190. package/esm/utils/bounds.d.ts +4 -2
  191. package/esm/utils/bounds.js +11 -4
  192. package/esm/utils/bounds.js.map +1 -1
  193. package/esm/utils/helper.d.ts +24 -0
  194. package/esm/utils/helper.js +76 -0
  195. package/esm/utils/helper.js.map +1 -1
  196. package/esm/utils/scale.js +1 -1
  197. package/esm/utils/scale.js.map +1 -1
  198. package/esm/utils/selection.js +1 -1
  199. package/esm/utils/selection.js.map +1 -1
  200. package/esm/utils/treeDataTransform.d.ts +9 -2
  201. package/esm/utils/treeDataTransform.js +6 -2
  202. package/esm/utils/treeDataTransform.js.map +1 -1
  203. package/lib/animation/scaleInY.js +1 -19
  204. package/lib/animation/scaleInY.js.map +1 -1
  205. package/lib/animation/waveIn.js +1 -1
  206. package/lib/animation/waveIn.js.map +1 -1
  207. package/lib/api/runtime.js +2 -1
  208. package/lib/api/runtime.js.map +1 -1
  209. package/lib/component/axis.js +2 -2
  210. package/lib/component/axis.js.map +1 -1
  211. package/lib/component/legendCategory.js +6 -2
  212. package/lib/component/legendCategory.js.map +1 -1
  213. package/lib/component/legendContinuous.js +1 -1
  214. package/lib/component/legendContinuous.js.map +1 -1
  215. package/lib/component/slider.js +1 -1
  216. package/lib/component/slider.js.map +1 -1
  217. package/lib/composition/d3Projection.d.ts +1 -1
  218. package/lib/composition/d3Projection.js +1 -1
  219. package/lib/composition/d3Projection.js.map +1 -1
  220. package/lib/composition/facetRect.js +1 -1
  221. package/lib/composition/facetRect.js.map +1 -1
  222. package/lib/composition/geoView.js +1 -1
  223. package/lib/composition/geoView.js.map +1 -1
  224. package/lib/data/cluster.d.ts +1 -1
  225. package/lib/data/cluster.js +1 -1
  226. package/lib/data/cluster.js.map +1 -1
  227. package/lib/data/fetch.js +1 -1
  228. package/lib/data/fetch.js.map +1 -1
  229. package/lib/data/join.js +1 -1
  230. package/lib/data/join.js.map +1 -1
  231. package/lib/data/kde.js +1 -1
  232. package/lib/data/kde.js.map +1 -1
  233. package/lib/data/tree.js +1 -1
  234. package/lib/data/tree.js.map +1 -1
  235. package/lib/data/utils/arc/arc.d.ts +25 -2
  236. package/lib/data/utils/arc/arc.js +1 -1
  237. package/lib/data/utils/arc/arc.js.map +1 -1
  238. package/lib/data/utils/arc/types.d.ts +27 -2
  239. package/lib/data/utils/d3-sankey/align.js +1 -1
  240. package/lib/data/utils/d3-sankey/align.js.map +1 -1
  241. package/lib/data/utils/d3-sankey/sankey.js +1 -1
  242. package/lib/data/utils/d3-sankey/sankey.js.map +1 -1
  243. package/lib/data/wordCloud.js +1 -1
  244. package/lib/data/wordCloud.js.map +1 -1
  245. package/lib/exports.d.ts +2 -0
  246. package/lib/exports.js +7 -1
  247. package/lib/exports.js.map +1 -1
  248. package/lib/index.d.ts +2 -0
  249. package/lib/interaction/chartIndex.js +1 -1
  250. package/lib/interaction/chartIndex.js.map +1 -1
  251. package/lib/interaction/elementHighlight.js +1 -1
  252. package/lib/interaction/elementHighlight.js.map +1 -1
  253. package/lib/interaction/elementSelect.d.ts +1 -0
  254. package/lib/interaction/elementSelect.js +32 -3
  255. package/lib/interaction/elementSelect.js.map +1 -1
  256. package/lib/interaction/event.d.ts +0 -1
  257. package/lib/interaction/event.js +3 -15
  258. package/lib/interaction/event.js.map +1 -1
  259. package/lib/interaction/legendHighlight.js +1 -1
  260. package/lib/interaction/legendHighlight.js.map +1 -1
  261. package/lib/interaction/tooltip.js +10 -37
  262. package/lib/interaction/tooltip.js.map +1 -1
  263. package/lib/interaction/treemapDrillDown.d.ts +2 -2
  264. package/lib/interaction/treemapDrillDown.js.map +1 -1
  265. package/lib/interaction/utils.js +2 -2
  266. package/lib/interaction/utils.js.map +1 -1
  267. package/lib/label-transform/contrastReverse.js +1 -1
  268. package/lib/label-transform/contrastReverse.js.map +1 -1
  269. package/lib/label-transform/overlapDodgeY.js +1 -1
  270. package/lib/label-transform/overlapDodgeY.js.map +1 -1
  271. package/lib/lib/core.d.ts +1 -0
  272. package/lib/lib/core.js +1 -0
  273. package/lib/lib/core.js.map +1 -1
  274. package/lib/lib/std.d.ts +1 -0
  275. package/lib/mark/area.js +1 -1
  276. package/lib/mark/area.js.map +1 -1
  277. package/lib/mark/boxplot.js +1 -1
  278. package/lib/mark/boxplot.js.map +1 -1
  279. package/lib/mark/forceGraph.js +1 -1
  280. package/lib/mark/forceGraph.js.map +1 -1
  281. package/lib/mark/line.js +1 -1
  282. package/lib/mark/line.js.map +1 -1
  283. package/lib/mark/pack.js +1 -1
  284. package/lib/mark/pack.js.map +1 -1
  285. package/lib/mark/utils.d.ts +1 -1
  286. package/lib/runtime/component.js +2 -2
  287. package/lib/runtime/component.js.map +1 -1
  288. package/lib/runtime/layout.js +1 -1
  289. package/lib/runtime/layout.js.map +1 -1
  290. package/lib/runtime/mark.js +1 -1
  291. package/lib/runtime/mark.js.map +1 -1
  292. package/lib/runtime/plot.js +2 -2
  293. package/lib/runtime/plot.js.map +1 -1
  294. package/lib/runtime/scale.js +2 -2
  295. package/lib/runtime/scale.js.map +1 -1
  296. package/lib/runtime/transform.d.ts +1 -0
  297. package/lib/runtime/transform.js +4 -3
  298. package/lib/runtime/transform.js.map +1 -1
  299. package/lib/runtime/types/mark.d.ts +1 -1
  300. package/lib/shape/area/area.js +1 -1
  301. package/lib/shape/area/area.js.map +1 -1
  302. package/lib/shape/area/curve.d.ts +1 -1
  303. package/lib/shape/area/curve.js +1 -1
  304. package/lib/shape/area/curve.js.map +1 -1
  305. package/lib/shape/area/hv.js +1 -1
  306. package/lib/shape/area/hv.js.map +1 -1
  307. package/lib/shape/area/hvh.js +1 -1
  308. package/lib/shape/area/hvh.js.map +1 -1
  309. package/lib/shape/area/smooth.js +1 -1
  310. package/lib/shape/area/smooth.js.map +1 -1
  311. package/lib/shape/area/vh.js +1 -1
  312. package/lib/shape/area/vh.js.map +1 -1
  313. package/lib/shape/box/box.js +1 -1
  314. package/lib/shape/box/box.js.map +1 -1
  315. package/lib/shape/box/violin.js +1 -1
  316. package/lib/shape/box/violin.js.map +1 -1
  317. package/lib/shape/connector/connector.js +1 -1
  318. package/lib/shape/connector/connector.js.map +1 -1
  319. package/lib/shape/density/density.js +1 -1
  320. package/lib/shape/density/density.js.map +1 -1
  321. package/lib/shape/heatmap/heatmap.js +2 -2
  322. package/lib/shape/heatmap/heatmap.js.map +1 -1
  323. package/lib/shape/interval/color.js +1 -1
  324. package/lib/shape/interval/color.js.map +1 -1
  325. package/lib/shape/interval/funnel.js +1 -1
  326. package/lib/shape/interval/funnel.js.map +1 -1
  327. package/lib/shape/label/position/area.js +1 -1
  328. package/lib/shape/label/position/area.js.map +1 -1
  329. package/lib/shape/label/position/utils.js +1 -1
  330. package/lib/shape/label/position/utils.js.map +1 -1
  331. package/lib/shape/line/curve.d.ts +1 -1
  332. package/lib/shape/line/curve.js +1 -1
  333. package/lib/shape/line/curve.js.map +1 -1
  334. package/lib/shape/line/hv.js +1 -1
  335. package/lib/shape/line/hv.js.map +1 -1
  336. package/lib/shape/line/hvh.js +1 -1
  337. package/lib/shape/line/hvh.js.map +1 -1
  338. package/lib/shape/line/line.js +1 -1
  339. package/lib/shape/line/line.js.map +1 -1
  340. package/lib/shape/line/smooth.js +1 -1
  341. package/lib/shape/line/smooth.js.map +1 -1
  342. package/lib/shape/line/trail.js +1 -1
  343. package/lib/shape/line/trail.js.map +1 -1
  344. package/lib/shape/line/vh.js +1 -1
  345. package/lib/shape/line/vh.js.map +1 -1
  346. package/lib/shape/lineXY/line.js +1 -1
  347. package/lib/shape/lineXY/line.js.map +1 -1
  348. package/lib/shape/link/arc.js +1 -1
  349. package/lib/shape/link/arc.js.map +1 -1
  350. package/lib/shape/link/smooth.js +1 -1
  351. package/lib/shape/link/smooth.js.map +1 -1
  352. package/lib/shape/link/vhv.js +1 -1
  353. package/lib/shape/link/vhv.js.map +1 -1
  354. package/lib/shape/polygon/polygon.js +1 -1
  355. package/lib/shape/polygon/polygon.js.map +1 -1
  356. package/lib/shape/polygon/ribbon.js +1 -1
  357. package/lib/shape/polygon/ribbon.js.map +1 -1
  358. package/lib/shape/text/advance.js +1 -1
  359. package/lib/shape/text/advance.js.map +1 -1
  360. package/lib/shape/utils.d.ts +1 -1
  361. package/lib/shape/utils.js +1 -1
  362. package/lib/shape/utils.js.map +1 -1
  363. package/lib/shape/vector/vector.js +1 -1
  364. package/lib/shape/vector/vector.js.map +1 -1
  365. package/lib/spec/interaction.d.ts +1 -0
  366. package/lib/transform/bin.js +1 -1
  367. package/lib/transform/bin.js.map +1 -1
  368. package/lib/transform/flexX.js +1 -1
  369. package/lib/transform/flexX.js.map +1 -1
  370. package/lib/transform/groupN.js +1 -1
  371. package/lib/transform/groupN.js.map +1 -1
  372. package/lib/transform/normalizeY.js +1 -1
  373. package/lib/transform/normalizeY.js.map +1 -1
  374. package/lib/transform/sample.js +1 -1
  375. package/lib/transform/sample.js.map +1 -1
  376. package/lib/transform/select.js +1 -1
  377. package/lib/transform/select.js.map +1 -1
  378. package/lib/transform/sort.d.ts +1 -1
  379. package/lib/transform/sort.js +20 -52
  380. package/lib/transform/sort.js.map +1 -1
  381. package/lib/transform/stackEnter.js +1 -1
  382. package/lib/transform/stackEnter.js.map +1 -1
  383. package/lib/transform/symmetryY.js +1 -1
  384. package/lib/transform/symmetryY.js.map +1 -1
  385. package/lib/transform/utils/order.d.ts +1 -1
  386. package/lib/transform/utils/order.js +1 -1
  387. package/lib/transform/utils/order.js.map +1 -1
  388. package/lib/utils/bounds.d.ts +4 -2
  389. package/lib/utils/bounds.js +11 -4
  390. package/lib/utils/bounds.js.map +1 -1
  391. package/lib/utils/helper.d.ts +24 -0
  392. package/lib/utils/helper.js +81 -1
  393. package/lib/utils/helper.js.map +1 -1
  394. package/lib/utils/scale.js +1 -1
  395. package/lib/utils/scale.js.map +1 -1
  396. package/lib/utils/selection.js +1 -1
  397. package/lib/utils/selection.js.map +1 -1
  398. package/lib/utils/treeDataTransform.d.ts +9 -2
  399. package/lib/utils/treeDataTransform.js +6 -2
  400. package/lib/utils/treeDataTransform.js.map +1 -1
  401. package/package.json +7 -24
  402. package/src/animation/scaleInY.ts +2 -45
  403. package/src/animation/waveIn.ts +1 -1
  404. package/src/api/runtime.ts +3 -1
  405. package/src/component/axis.ts +2 -2
  406. package/src/component/legendCategory.ts +10 -2
  407. package/src/component/legendContinuous.ts +1 -1
  408. package/src/component/slider.ts +1 -1
  409. package/src/composition/d3Projection.ts +1 -1
  410. package/src/composition/facetRect.ts +1 -1
  411. package/src/composition/geoView.ts +1 -1
  412. package/src/data/cluster.ts +1 -1
  413. package/src/data/fetch.ts +1 -1
  414. package/src/data/join.ts +1 -1
  415. package/src/data/kde.ts +1 -1
  416. package/src/data/tree.ts +1 -1
  417. package/src/data/utils/arc/arc.ts +6 -6
  418. package/src/data/utils/arc/types.ts +28 -2
  419. package/src/data/utils/d3-sankey/align.ts +1 -1
  420. package/src/data/utils/d3-sankey/sankey.ts +1 -1
  421. package/src/data/wordCloud.ts +1 -1
  422. package/src/exports.ts +3 -0
  423. package/src/interaction/chartIndex.ts +1 -1
  424. package/src/interaction/elementHighlight.ts +1 -1
  425. package/src/interaction/elementSelect.ts +33 -3
  426. package/src/interaction/event.ts +2 -15
  427. package/src/interaction/legendHighlight.ts +4 -2
  428. package/src/interaction/tooltip.ts +10 -39
  429. package/src/interaction/treemapDrillDown.ts +2 -3
  430. package/src/interaction/utils.ts +2 -2
  431. package/src/label-transform/contrastReverse.ts +1 -1
  432. package/src/label-transform/overlapDodgeY.ts +1 -1
  433. package/src/lib/core.ts +2 -0
  434. package/src/mark/area.ts +1 -1
  435. package/src/mark/boxplot.ts +6 -1
  436. package/src/mark/forceGraph.ts +1 -1
  437. package/src/mark/line.ts +1 -1
  438. package/src/mark/pack.ts +5 -1
  439. package/src/mark/utils.ts +1 -1
  440. package/src/runtime/component.ts +2 -2
  441. package/src/runtime/layout.ts +15 -2
  442. package/src/runtime/mark.ts +1 -1
  443. package/src/runtime/plot.ts +2 -2
  444. package/src/runtime/scale.ts +2 -2
  445. package/src/runtime/transform.ts +6 -3
  446. package/src/runtime/types/mark.ts +1 -1
  447. package/src/shape/area/area.ts +1 -1
  448. package/src/shape/area/curve.ts +1 -1
  449. package/src/shape/area/hv.ts +1 -1
  450. package/src/shape/area/hvh.ts +1 -1
  451. package/src/shape/area/smooth.ts +1 -1
  452. package/src/shape/area/vh.ts +1 -1
  453. package/src/shape/box/box.ts +1 -1
  454. package/src/shape/box/violin.ts +1 -1
  455. package/src/shape/connector/connector.ts +1 -1
  456. package/src/shape/density/density.ts +1 -1
  457. package/src/shape/heatmap/heatmap.ts +2 -2
  458. package/src/shape/interval/color.ts +1 -1
  459. package/src/shape/interval/funnel.ts +1 -1
  460. package/src/shape/label/position/area.ts +1 -1
  461. package/src/shape/label/position/utils.ts +1 -1
  462. package/src/shape/line/curve.ts +6 -1
  463. package/src/shape/line/hv.ts +1 -1
  464. package/src/shape/line/hvh.ts +1 -1
  465. package/src/shape/line/line.ts +1 -1
  466. package/src/shape/line/smooth.ts +1 -1
  467. package/src/shape/line/trail.ts +1 -1
  468. package/src/shape/line/vh.ts +1 -1
  469. package/src/shape/lineXY/line.ts +1 -1
  470. package/src/shape/link/arc.ts +1 -1
  471. package/src/shape/link/smooth.ts +1 -1
  472. package/src/shape/link/vhv.ts +1 -1
  473. package/src/shape/polygon/polygon.ts +1 -1
  474. package/src/shape/polygon/ribbon.ts +1 -1
  475. package/src/shape/text/advance.ts +1 -1
  476. package/src/shape/utils.ts +2 -2
  477. package/src/shape/vector/vector.ts +1 -1
  478. package/src/spec/interaction.ts +1 -0
  479. package/src/transform/bin.ts +8 -3
  480. package/src/transform/flexX.ts +1 -1
  481. package/src/transform/groupN.ts +1 -1
  482. package/src/transform/normalizeY.ts +1 -1
  483. package/src/transform/sample.ts +1 -1
  484. package/src/transform/select.ts +1 -1
  485. package/src/transform/sort.ts +21 -43
  486. package/src/transform/stackEnter.ts +1 -1
  487. package/src/transform/symmetryY.ts +1 -1
  488. package/src/transform/utils/order.ts +1 -1
  489. package/src/utils/bounds.ts +22 -4
  490. package/src/utils/helper.ts +83 -0
  491. package/src/utils/scale.ts +1 -1
  492. package/src/utils/selection.ts +1 -1
  493. package/src/utils/treeDataTransform.ts +26 -13
@@ -1,7 +1,7 @@
1
1
  import type { DisplayObject } from '@antv/g';
2
2
  import { Category } from '@antv/component';
3
3
  import { last } from '@antv/util';
4
- import { format } from 'd3-format';
4
+ import { format } from '@antv/vendor/d3-format';
5
5
  import { Identity } from '@antv/scale';
6
6
  import type {
7
7
  FlexLayout,
@@ -170,6 +170,13 @@ function inferLegendShape(
170
170
  return { width, height };
171
171
  }
172
172
 
173
+ function filterEmptyIds(legendStyle) {
174
+ return {
175
+ ...legendStyle,
176
+ data: legendStyle?.data.filter((item) => item.id !== '') || [],
177
+ };
178
+ }
179
+
173
180
  /**
174
181
  * Guide Component for ordinal color scale.
175
182
  */
@@ -211,8 +218,9 @@ export const LegendCategory: GCC<LegendCategoryOptions> = (options) => {
211
218
 
212
219
  const { legendCategory: legendTheme = {} } = theme;
213
220
 
221
+ // Filter out the data items with empty string IDs in the wordCloud's data before generating the legend.
214
222
  const categoryStyle = adaptor(
215
- Object.assign({}, legendTheme, legendStyle, style),
223
+ Object.assign({}, legendTheme, filterEmptyIds(legendStyle), style),
216
224
  );
217
225
 
218
226
  const layoutWrapper = new LegendCategoryLayout({
@@ -1,7 +1,7 @@
1
1
  import { DisplayObject, parseColor } from '@antv/g';
2
2
  import { Continuous } from '@antv/component';
3
3
  import { Constant, Quantile, Quantize, Threshold } from '@antv/scale';
4
- import { format } from 'd3-format';
4
+ import { format } from '@antv/vendor/d3-format';
5
5
  import type {
6
6
  FlexLayout,
7
7
  G2Theme,
@@ -1,5 +1,5 @@
1
1
  import { Slider as SliderComponent } from '@antv/component';
2
- import { format } from 'd3-format';
2
+ import { format } from '@antv/vendor/d3-format';
3
3
  import { DisplayObject } from '@antv/g';
4
4
  import { isArray } from '@antv/util';
5
5
  import { isTranspose } from '../utils/coordinate';
@@ -30,4 +30,4 @@ export {
30
30
  geoStereographicRaw,
31
31
  geoTransverseMercator,
32
32
  geoTransverseMercatorRaw,
33
- } from 'd3-geo';
33
+ } from '@antv/vendor/d3-geo';
@@ -1,5 +1,5 @@
1
1
  import { deepMix } from '@antv/util';
2
- import { extent, group, max } from 'd3-array';
2
+ import { extent, group, max } from '@antv/vendor/d3-array';
3
3
  import {
4
4
  CompositionComponent as CC,
5
5
  G2MarkChildrenCallback,
@@ -1,6 +1,6 @@
1
1
  import { Linear } from '@antv/scale';
2
2
  import { upperFirst } from '@antv/util';
3
- import { geoPath, geoGraticule10 } from 'd3-geo';
3
+ import { geoPath, geoGraticule10 } from '@antv/vendor/d3-geo';
4
4
  import { maybeTooltip } from '../utils/mark';
5
5
  import { CompositionComponent as CC } from '../runtime';
6
6
  import { GeoViewComposition } from '../spec';
@@ -1,4 +1,4 @@
1
- import { cluster, hierarchy } from 'd3-hierarchy';
1
+ import { cluster, hierarchy } from '@antv/vendor/d3-hierarchy';
2
2
  import { DataComponent as DC } from '../runtime';
3
3
 
4
4
  export type ClusterOptions = Omit<Record<string, any>, 'type'>;
package/src/data/fetch.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { dsvFormat, autoType as d3AutoType } from 'd3-dsv';
1
+ import { dsvFormat, autoType as d3AutoType } from '@antv/vendor/d3-dsv';
2
2
  import { FetchConnector } from '../spec';
3
3
  import { DataComponent as DC } from '../runtime';
4
4
  import { identity } from '../utils/helper';
package/src/data/join.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { rollup } from 'd3-array';
1
+ import { rollup } from '@antv/vendor/d3-array';
2
2
  import { DataComponent as DC } from '../runtime';
3
3
  import { JoinTransform } from '../spec';
4
4
 
package/src/data/kde.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import pdf from 'pdfast';
2
- import { group } from 'd3-array';
2
+ import { group } from '@antv/vendor/d3-array';
3
3
  import { DataComponent as DC } from '../runtime';
4
4
  import { KDEDataTransform } from '../spec';
5
5
 
package/src/data/tree.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { tree } from 'd3-hierarchy';
1
+ import { tree } from '@antv/vendor/d3-hierarchy';
2
2
  import { DataComponent as DC } from '../runtime';
3
3
  import { hierarchyFunction } from './cluster';
4
4
 
@@ -1,6 +1,6 @@
1
- import { group, sum } from 'd3-array';
1
+ import { group, sum } from '@antv/vendor/d3-array';
2
2
  import { error } from '../../../utils/helper';
3
- import { ArcData, ArcOptions } from './types';
3
+ import { ArcData, ArcOptions, ArcEdge, ArcNode } from './types';
4
4
  import * as SortMethods from './sort';
5
5
 
6
6
  const DEFAULT_OPTIONS = {
@@ -53,7 +53,7 @@ export function Arc(options?: ArcOptions) {
53
53
  /**
54
54
  * Calculate id, value, frequency for node, and source,target for edge.
55
55
  */
56
- function preprocess(nodes, edges) {
56
+ function preprocess(nodes: ArcNode[], edges: ArcEdge[]) {
57
57
  edges.forEach((edge) => {
58
58
  edge.source = source(edge);
59
59
  edge.target = target(edge);
@@ -83,7 +83,7 @@ export function Arc(options?: ArcOptions) {
83
83
  return { nodes, edges };
84
84
  }
85
85
 
86
- function sortNodes(nodes, edges) {
86
+ function sortNodes(nodes: ArcNode[], edges: ArcEdge[]) {
87
87
  const method = typeof sortBy === 'function' ? sortBy : SortMethods[sortBy];
88
88
 
89
89
  if (method) {
@@ -91,7 +91,7 @@ export function Arc(options?: ArcOptions) {
91
91
  }
92
92
  }
93
93
 
94
- function layoutNodes(nodes, edges) {
94
+ function layoutNodes(nodes: ArcNode[], edges: ArcEdge[]) {
95
95
  const size = nodes.length;
96
96
  if (!size) {
97
97
  throw error("Invalid nodes: it's empty!");
@@ -145,7 +145,7 @@ export function Arc(options?: ArcOptions) {
145
145
  /**
146
146
  * Get edge layout information from nodes, and save into edge object.
147
147
  */
148
- function layoutEdges(nodes, edges) {
148
+ function layoutEdges(nodes: ArcNode[], edges: ArcEdge[]) {
149
149
  const nodesMap = new Map(nodes.map((d) => [d.id, d]));
150
150
 
151
151
  if (!weight) {
@@ -20,8 +20,34 @@ export type ArcOptions = {
20
20
  /** Thickness of node, default: 0.05 */
21
21
  thickness?: number;
22
22
  };
23
+ export interface ArcEdge {
24
+ source: string;
25
+ target: string;
26
+ sourceWeight: number;
27
+ targetWeight: number;
28
+ x: number[] | number;
29
+ y: number[] | number;
30
+ value: number;
31
+ weight?: number;
32
+ width?: number;
33
+ height?: number;
34
+ frequency?: number;
35
+ [key: string]: any;
36
+ }
37
+
38
+ export interface ArcNode {
39
+ id: string;
40
+ x: number[] | number;
41
+ y: number[] | number;
42
+ value: number;
43
+ frequency: number;
44
+ weight?: number;
45
+ width?: number;
46
+ height?: number;
47
+ [key: string]: any;
48
+ }
23
49
 
24
50
  export type ArcData = {
25
- nodes: any[];
26
- edges: any[];
51
+ nodes: ArcNode[];
52
+ edges: ArcEdge[];
27
53
  };
@@ -1,4 +1,4 @@
1
- import { min } from 'd3-array';
1
+ import { min } from '@antv/vendor/d3-array';
2
2
 
3
3
  function targetDepth(d) {
4
4
  return d.target.depth;
@@ -1,4 +1,4 @@
1
- import { sum, max, min } from 'd3-array';
1
+ import { sum, max, min } from '@antv/vendor/d3-array';
2
2
  import { justify } from './align';
3
3
  import { constant } from './constant';
4
4
 
@@ -1,4 +1,4 @@
1
- import { min, max } from 'd3-array';
1
+ import { min, max } from '@antv/vendor/d3-array';
2
2
  import { DataComponent as DC } from '../runtime';
3
3
  import { flow } from './utils/flow';
4
4
  import { tagCloud } from './utils/d3-cloud';
package/src/exports.ts CHANGED
@@ -37,6 +37,9 @@ export type {
37
37
  Channel,
38
38
  } from './runtime';
39
39
  export { select, Selection } from './utils/selection';
40
+ export { dataOf, seriesOf } from './utils/helper';
41
+ export { selectG2Elements, selectPlotArea } from './interaction/utils';
42
+
40
43
  export * from './transform';
41
44
  export { LinearAxis } from './component/axis';
42
45
  export type { AxisOptions } from './component/axis';
@@ -8,7 +8,7 @@ import {
8
8
  bisectCenter,
9
9
  bisector,
10
10
  group,
11
- } from 'd3-array';
11
+ } from '@antv/vendor/d3-array';
12
12
  import { G2Element } from 'utils/selection';
13
13
  import { subObject } from '../utils/helper';
14
14
  import {
@@ -1,6 +1,6 @@
1
1
  import { DisplayObject } from '@antv/g';
2
2
  import { deepMix } from '@antv/util';
3
- import { group } from 'd3-array';
3
+ import { group } from '@antv/vendor/d3-array';
4
4
  import { subObject } from '../utils/helper';
5
5
  import {
6
6
  createDatumof,
@@ -1,5 +1,5 @@
1
1
  import { DisplayObject } from '@antv/g';
2
- import { group } from 'd3-array';
2
+ import { group } from '@antv/vendor/d3-array';
3
3
  import { deepMix } from '@antv/util';
4
4
  import { subObject } from '../utils/helper';
5
5
  import {
@@ -26,6 +26,7 @@ export function elementSelect(
26
26
  groupKey = (d) => d, // group elements by specified key
27
27
  link = false, // draw link or not
28
28
  single = false, // single select or not
29
+ multipleSelectHotkey, // hotkey for multi-select mode
29
30
  coordinate,
30
31
  background = false,
31
32
  scale,
@@ -68,6 +69,8 @@ export function elementSelect(
68
69
  });
69
70
 
70
71
  const { setState, removeState, hasState } = useState(elementStyle, valueof);
72
+ let isMultiSelectMode = !single; // "single" determines whether to multi-select by default
73
+ let activeHotkey = null; // Track the currently active hotkey
71
74
 
72
75
  const clear = (nativeEvent = true) => {
73
76
  for (const e of elements) {
@@ -151,16 +154,39 @@ export function elementSelect(
151
154
  // Click non-element shape, reset.
152
155
  // Such as the rest of content area(background).
153
156
  if (!elementSet.has(element)) return clear();
154
- if (single) return singleSelect(event, element, nativeEvent);
157
+ if (!isMultiSelectMode) return singleSelect(event, element, nativeEvent);
155
158
  return multipleSelect(event, element, nativeEvent);
156
159
  };
157
160
 
161
+ // Handle keyboard events for multi-select mode
162
+ const hotkeys = Array.isArray(multipleSelectHotkey)
163
+ ? multipleSelectHotkey
164
+ : [multipleSelectHotkey];
165
+ const handleKeyDown = (event) => {
166
+ if (hotkeys.includes(event.code) && !activeHotkey) {
167
+ activeHotkey = event.code;
168
+ isMultiSelectMode = true;
169
+ }
170
+ };
171
+ const handleKeyUp = (event) => {
172
+ if (event.code === activeHotkey) {
173
+ activeHotkey = null;
174
+ isMultiSelectMode = false;
175
+ }
176
+ };
177
+
158
178
  root.addEventListener('click', click);
179
+ if (multipleSelectHotkey) {
180
+ // If a hotkey is set, the initial state should be single mode
181
+ isMultiSelectMode = false;
182
+ document.addEventListener('keydown', handleKeyDown);
183
+ document.addEventListener('keyup', handleKeyUp);
184
+ }
159
185
 
160
186
  const onSelect = (e) => {
161
187
  const { nativeEvent, data } = e;
162
188
  if (nativeEvent) return;
163
- const selectedData = single ? data.data.slice(0, 1) : data.data;
189
+ const selectedData = !isMultiSelectMode ? data.data.slice(0, 1) : data.data;
164
190
  for (const d of selectedData) {
165
191
  const element = selectElementByData(elements, d, datum);
166
192
  click({ target: element, nativeEvent: false });
@@ -177,6 +203,10 @@ export function elementSelect(
177
203
  return () => {
178
204
  for (const e of elements) removeLink(e);
179
205
  root.removeEventListener('click', click);
206
+ if (multipleSelectHotkey) {
207
+ document.removeEventListener('keydown', handleKeyDown);
208
+ document.removeEventListener('keyup', handleKeyUp);
209
+ }
180
210
  emitter.off('element:select', onSelect);
181
211
  emitter.off('element:unselect', onUnSelect);
182
212
  };
@@ -1,20 +1,7 @@
1
1
  import { ChartEvent } from '../utils/event';
2
+ import { dataOf } from '../utils/helper';
2
3
  import { maybeRoot } from './utils';
3
4
 
4
- export function dataOf(element, view) {
5
- const { __data__: datum } = element;
6
- const { markKey, index, seriesIndex } = datum;
7
- const { markState } = view;
8
- const selectedMark: any = Array.from(markState.keys()).find(
9
- (mark) => (mark as any).key === markKey,
10
- );
11
- if (!selectedMark) return;
12
- if (seriesIndex) {
13
- return seriesIndex.map((i) => selectedMark.data[i]);
14
- }
15
- return selectedMark.data[index];
16
- }
17
-
18
5
  // For extended component
19
6
  function maybeComponentRoot(node) {
20
7
  return maybeRoot(node, (node) => node.className === 'component');
@@ -63,7 +50,7 @@ function bubblesEvent(eventType, view, emitter, predicate = (event) => true) {
63
50
  nativeEvent: true,
64
51
  };
65
52
  if (elementType === 'element') {
66
- e1['data'] = { data: dataOf(root, view) };
53
+ e1['data'] = { data: dataOf(root) };
67
54
  emitter.emit(`element:${eventType}`, e1);
68
55
  emitter.emit(`${markType}:${eventType}`, e1);
69
56
  } else if (elementType === 'label') {
@@ -1,4 +1,4 @@
1
- import { group } from 'd3-array';
1
+ import { InternMap, group } from '@antv/vendor/d3-array';
2
2
  import { subObject } from '../utils/helper';
3
3
  import {
4
4
  mergeState,
@@ -66,7 +66,9 @@ export function LegendHighlight() {
66
66
  const highlightItem = (event, item) => {
67
67
  // Update UI.
68
68
  const value = datumOf(item);
69
- const elementSet = new Set(elementGroup.get(value));
69
+ const elementSet = new Set(
70
+ (elementGroup as InternMap<unknown, any[]>).get(value),
71
+ );
70
72
  for (const e of elements) {
71
73
  if (elementSet.has(e)) setState(e, 'active');
72
74
  else setState(e, 'inactive');
@@ -1,13 +1,13 @@
1
1
  import { Circle, DisplayObject, IElement, Line } from '@antv/g';
2
- import { sort, group, mean, bisector, minIndex } from 'd3-array';
2
+ import { sort, group, mean, bisector, minIndex } from '@antv/vendor/d3-array';
3
3
  import { deepMix, lowerFirst, throttle } from '@antv/util';
4
4
  import { Tooltip as TooltipComponent } from '@antv/component';
5
- import { Constant, Band } from '@antv/scale';
6
- import { defined, subObject } from '../utils/helper';
5
+ import { defined, groupNameOf, subObject, dataOf } from '../utils/helper';
7
6
  import { isTranspose, isPolar } from '../utils/coordinate';
8
7
  import { angle, sub, dist } from '../utils/vector';
9
8
  import { invert } from '../utils/scale';
10
9
  import { BBox } from '../runtime';
10
+ import { CALLBACK_ITEM_SYMBOL } from '../runtime/transform';
11
11
  import {
12
12
  selectG2Elements,
13
13
  createXKey,
@@ -19,7 +19,6 @@ import {
19
19
  bboxOf,
20
20
  maybeRoot,
21
21
  } from './utils';
22
- import { dataOf } from './event';
23
22
 
24
23
  function getContainer(
25
24
  group: IElement,
@@ -208,39 +207,6 @@ function singleItem(element) {
208
207
  };
209
208
  }
210
209
 
211
- function groupNameOf(scale, datum) {
212
- const { color: scaleColor, series: scaleSeries, facet = false } = scale;
213
- const { color, series } = datum;
214
- const invertAble = (scale) => {
215
- return (
216
- scale &&
217
- scale.invert &&
218
- !(scale instanceof Band) &&
219
- !(scale instanceof Constant)
220
- );
221
- };
222
- // For non constant color channel.
223
- if (invertAble(scaleSeries)) {
224
- const cloned = scaleSeries.clone();
225
- return cloned.invert(series);
226
- }
227
- if (
228
- series &&
229
- scaleSeries instanceof Band &&
230
- scaleSeries.invert(series) !== color &&
231
- !facet
232
- ) {
233
- return scaleSeries.invert(series);
234
- }
235
- if (invertAble(scaleColor)) {
236
- const name = scaleColor.invert(color);
237
- // For threshold scale.
238
- if (Array.isArray(name)) return null;
239
- return name;
240
- }
241
- return null;
242
- }
243
-
244
210
  function itemColorOf(element) {
245
211
  const fill = element.getAttribute('fill');
246
212
  const stroke = element.getAttribute('stroke');
@@ -279,7 +245,12 @@ function groupItems(
279
245
  return definedItems.map(
280
246
  ({ color = itemColorOf(element) || theme.color, name, ...item }) => {
281
247
  const groupName = groupNameOf(scale, datum);
282
- const name1 = useGroupName ? groupName || name : name || groupName;
248
+ // callback's priority is higher than groupName.
249
+ const name1 =
250
+ useGroupName && !(CALLBACK_ITEM_SYMBOL in item)
251
+ ? groupName || name
252
+ : name || groupName;
253
+
283
254
  return {
284
255
  ...item,
285
256
  color,
@@ -1097,7 +1068,7 @@ export function tooltip(
1097
1068
  nativeEvent: true,
1098
1069
  data: {
1099
1070
  ...data,
1100
- data: dataOf(element, view),
1071
+ data: dataOf(element),
1101
1072
  },
1102
1073
  });
1103
1074
  },
@@ -1,11 +1,10 @@
1
1
  import { Text, Group } from '@antv/g';
2
2
  import { get, deepMix, pick, keys, find, size, last } from '@antv/util';
3
- import type { Node } from 'd3-hierarchy';
4
3
  import type { DisplayObject } from '@antv/g';
5
4
  import { subObject } from '../utils/helper';
6
5
  import { PLOT_CLASS_NAME } from '../runtime';
7
6
  import { select } from '../utils/selection';
8
- import { treeDataTransform } from '../utils/treeDataTransform';
7
+ import { Node, treeDataTransform } from '../utils/treeDataTransform';
9
8
  import { legendClearSetState } from './legendFilter';
10
9
  import { getElements } from './utils';
11
10
 
@@ -14,7 +13,7 @@ function selectPlotArea(root: DisplayObject): DisplayObject {
14
13
  }
15
14
 
16
15
  export type DrillDownOptions = {
17
- originData?: Node[];
16
+ originData?: Node<any>[];
18
17
  layout?: any;
19
18
  [key: string]: any;
20
19
  };
@@ -1,6 +1,6 @@
1
1
  import { DisplayObject, Path, AABB } from '@antv/g';
2
- import { path as d3Path } from 'd3-path';
3
- import { sort } from 'd3-array';
2
+ import { path as d3Path } from '@antv/vendor/d3-path';
3
+ import { sort } from '@antv/vendor/d3-array';
4
4
  import { Vector2 } from '@antv/coord';
5
5
  import { filter } from '@antv/util';
6
6
  import type { PathArray } from '@antv/util';
@@ -1,5 +1,5 @@
1
1
  import { DisplayObject } from '@antv/g';
2
- import { maxIndex } from 'd3-array';
2
+ import { maxIndex } from '@antv/vendor/d3-array';
3
3
  import { ContrastReverseLabelTransform } from '../spec';
4
4
  import { LabelTransformComponent as LLC } from '../runtime';
5
5
  import { parseToRGB } from '../utils/color';
@@ -1,5 +1,5 @@
1
1
  import { DisplayObject } from '@antv/g';
2
- import { ascending } from 'd3-array';
2
+ import { ascending } from '@antv/vendor/d3-array';
3
3
  import { OverlapDodgeYLabelTransform } from '../spec';
4
4
  import { LabelTransformComponent as LLC } from '../runtime';
5
5
 
package/src/lib/core.ts CHANGED
@@ -7,6 +7,7 @@ import {
7
7
  Fisheye,
8
8
  Radial,
9
9
  Radar,
10
+ Helix,
10
11
  } from '../coordinate';
11
12
  import { Constant, Field, Transform, Column } from '../encode';
12
13
  import {
@@ -216,6 +217,7 @@ export function corelib() {
216
217
  'coordinate.fisheye': Fisheye,
217
218
  'coordinate.radial': Radial,
218
219
  'coordinate.radar': Radar,
220
+ 'coordinate.helix': Helix,
219
221
  'encode.constant': Constant,
220
222
  'encode.field': Field,
221
223
  'encode.transform': Transform,
package/src/mark/area.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { group } from 'd3-array';
1
+ import { group } from '@antv/vendor/d3-array';
2
2
  import { MarkComponent as MC } from '../runtime';
3
3
  import { AreaMark } from '../spec';
4
4
  import { AreaShape, AreaHV, AreaHVH, AreaSmooth, AreaVH } from '../shape';
@@ -1,4 +1,9 @@
1
- import { min as d3Min, max as d3Max, quantile, group } from 'd3-array';
1
+ import {
2
+ min as d3Min,
3
+ max as d3Max,
4
+ quantile,
5
+ group,
6
+ } from '@antv/vendor/d3-array';
2
7
  import { CompositeMarkComponent as CC } from '../runtime';
3
8
  import { BoxPlotMark } from '../spec';
4
9
  import { subObject } from '../utils/helper';
@@ -5,7 +5,7 @@ import {
5
5
  forceX,
6
6
  forceY,
7
7
  forceCenter,
8
- } from 'd3-force';
8
+ } from '@antv/vendor/d3-force';
9
9
  import { deepMix } from '@antv/util';
10
10
  import { subObject } from '../utils/helper';
11
11
  import { CompositeMarkComponent as CC } from '../runtime';
package/src/mark/line.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Vector } from '@antv/coord';
2
- import { group } from 'd3-array';
2
+ import { group } from '@antv/vendor/d3-array';
3
3
  import { isParallel } from '../utils/coordinate';
4
4
  import { Mark, MarkComponent as MC, SingleMark, Vector2 } from '../runtime';
5
5
  import { LineMark } from '../spec';
package/src/mark/pack.ts CHANGED
@@ -1,5 +1,9 @@
1
1
  import { deepMix, isArray } from '@antv/util';
2
- import { stratify, hierarchy, pack as packLayout } from 'd3-hierarchy';
2
+ import {
3
+ stratify,
4
+ hierarchy,
5
+ pack as packLayout,
6
+ } from '@antv/vendor/d3-hierarchy';
3
7
  import { CompositionComponent as CC } from '../runtime';
4
8
  import { subObject } from '../utils/helper';
5
9
  import { PackMark } from '../spec';
package/src/mark/utils.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Band } from '@antv/scale';
2
- import { Primitive } from 'd3-array';
2
+ import { Primitive } from '@antv/vendor/d3-array';
3
3
  import { Vector2 } from '@antv/coord';
4
4
  import { Scale } from '../runtime/types/component';
5
5
  import { Channel } from '../runtime';
@@ -3,8 +3,8 @@
3
3
  */
4
4
  import { Coordinate } from '@antv/coord';
5
5
  import { deepMix, isEqual } from '@antv/util';
6
- import { groups, max, sum } from 'd3-array';
7
- import { format } from 'd3-format';
6
+ import { groups, max, sum } from '@antv/vendor/d3-array';
7
+ import { format } from '@antv/vendor/d3-format';
8
8
  import { DisplayObject, Text } from '@antv/g';
9
9
  import {
10
10
  getPolarOptions,
@@ -1,5 +1,12 @@
1
1
  import { Coordinate } from '@antv/coord';
2
- import { ascending, group, max, min, sum } from 'd3-array';
2
+ import {
3
+ NestedInternMap,
4
+ ascending,
5
+ group,
6
+ max,
7
+ min,
8
+ sum,
9
+ } from '@antv/vendor/d3-array';
3
10
  import { deepMix } from '@antv/util';
4
11
  import { isParallel, isPolar, isRadar, radiusOf } from '../utils/coordinate';
5
12
  import { capitalizeFirst, defined } from '../utils/helper';
@@ -389,10 +396,16 @@ export function placeComponents(
389
396
  layout: Layout,
390
397
  ): void {
391
398
  // Group components by plane & position.
392
- const positionComponents = group<G2GuideComponentOptions, string>(
399
+
400
+ const positionComponents: NestedInternMap<
401
+ G2GuideComponentOptions,
402
+ G2GuideComponentOptions[],
403
+ [string]
404
+ > = group<G2GuideComponentOptions, [string]>(
393
405
  components,
394
406
  (d) => `${d.plane || 'xy'}-${d.position}`,
395
407
  );
408
+
396
409
  const {
397
410
  paddingLeft,
398
411
  paddingRight,
@@ -1,4 +1,4 @@
1
- import { rollups } from 'd3-array';
1
+ import { rollups } from '@antv/vendor/d3-array';
2
2
  import { defined } from '../utils/helper';
3
3
  import { useLibrary } from './library';
4
4
  import { G2MarkState } from './types/common';
@@ -1,8 +1,8 @@
1
1
  import { Vector2 } from '@antv/coord';
2
2
  import { DisplayObject, IAnimation as GAnimation, Rect } from '@antv/g';
3
3
  import { deepMix, upperFirst, isArray } from '@antv/util';
4
- import { group, groups } from 'd3-array';
5
- import { format } from 'd3-format';
4
+ import { group, groups } from '@antv/vendor/d3-array';
5
+ import { format } from '@antv/vendor/d3-format';
6
6
  import { mapObject } from '../utils/array';
7
7
  import { ChartEvent } from '../utils/event';
8
8
  import {