@antv/g2 5.0.0-alpha.0 → 5.0.0-alpha.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 (923) hide show
  1. package/README.en-US.md +47 -75
  2. package/README.md +47 -83
  3. package/dist/g2.min.js +3 -3
  4. package/esm/animation/fadeIn.js +4 -6
  5. package/esm/animation/fadeIn.js.map +1 -1
  6. package/esm/animation/fadeOut.js +4 -4
  7. package/esm/animation/fadeOut.js.map +1 -1
  8. package/esm/animation/morphing.js +4 -5
  9. package/esm/animation/morphing.js.map +1 -1
  10. package/esm/animation/scaleInX.js +4 -5
  11. package/esm/animation/scaleInX.js.map +1 -1
  12. package/esm/animation/scaleInY.js +4 -5
  13. package/esm/animation/scaleInY.js.map +1 -1
  14. package/esm/animation/scaleOutX.js +4 -5
  15. package/esm/animation/scaleOutX.js.map +1 -1
  16. package/esm/animation/scaleOutY.js +4 -5
  17. package/esm/animation/scaleOutY.js.map +1 -1
  18. package/esm/api/chart.d.ts +4 -1
  19. package/esm/api/chart.js +12 -4
  20. package/esm/api/chart.js.map +1 -1
  21. package/esm/api/composition/circle.js.map +1 -1
  22. package/esm/api/composition/flex.js.map +1 -1
  23. package/esm/api/composition/keyframe.js.map +1 -1
  24. package/esm/api/composition/layer.js.map +1 -1
  25. package/esm/api/composition/matrix.js.map +1 -1
  26. package/esm/api/composition/rect.js.map +1 -1
  27. package/esm/api/composition/view.js.map +1 -1
  28. package/esm/api/index.d.ts +1 -0
  29. package/esm/api/index.js +1 -0
  30. package/esm/api/index.js.map +1 -1
  31. package/esm/api/library.d.ts +3 -0
  32. package/esm/api/library.js +7 -0
  33. package/esm/api/library.js.map +1 -0
  34. package/esm/api/mark/mark.js.map +1 -1
  35. package/esm/composition/circle.js +1 -1
  36. package/esm/composition/circle.js.map +1 -1
  37. package/esm/composition/flex.js +4 -2
  38. package/esm/composition/flex.js.map +1 -1
  39. package/esm/composition/layer.js +3 -3
  40. package/esm/composition/layer.js.map +1 -1
  41. package/esm/composition/mark.js +2 -1
  42. package/esm/composition/mark.js.map +1 -1
  43. package/esm/composition/rect.js +29 -30
  44. package/esm/composition/rect.js.map +1 -1
  45. package/esm/composition/utils.d.ts +6 -0
  46. package/esm/composition/utils.js +19 -0
  47. package/esm/composition/utils.js.map +1 -1
  48. package/esm/composition/view.js +3 -2
  49. package/esm/composition/view.js.map +1 -1
  50. package/esm/coordinate/fisheye.d.ts +1 -1
  51. package/esm/coordinate/fisheye.js +1 -1
  52. package/esm/coordinate/fisheye.js.map +1 -1
  53. package/esm/coordinate/fisheyeX.d.ts +7 -0
  54. package/esm/coordinate/fisheyeX.js +6 -0
  55. package/esm/coordinate/fisheyeX.js.map +1 -0
  56. package/esm/coordinate/fisheyeY.d.ts +7 -0
  57. package/esm/coordinate/fisheyeY.js +6 -0
  58. package/esm/coordinate/fisheyeY.js.map +1 -0
  59. package/esm/coordinate/helix.d.ts +7 -0
  60. package/esm/coordinate/helix.js +11 -0
  61. package/esm/coordinate/helix.js.map +1 -0
  62. package/esm/coordinate/index.d.ts +7 -0
  63. package/esm/coordinate/index.js +7 -0
  64. package/esm/coordinate/index.js.map +1 -1
  65. package/esm/coordinate/reflect.d.ts +7 -0
  66. package/esm/coordinate/reflect.js +10 -0
  67. package/esm/coordinate/reflect.js.map +1 -0
  68. package/esm/coordinate/reflectX.d.ts +7 -0
  69. package/esm/coordinate/reflectX.js +10 -0
  70. package/esm/coordinate/reflectX.js.map +1 -0
  71. package/esm/coordinate/reflectY.d.ts +7 -0
  72. package/esm/coordinate/reflectY.js +10 -0
  73. package/esm/coordinate/reflectY.js.map +1 -0
  74. package/esm/coordinate/theta.d.ts +7 -0
  75. package/esm/coordinate/theta.js +11 -0
  76. package/esm/coordinate/theta.js.map +1 -0
  77. package/esm/data/arc.d.ts +0 -0
  78. package/esm/data/arc.js +19 -0
  79. package/esm/data/arc.js.map +1 -0
  80. package/esm/data/cluster.d.ts +0 -0
  81. package/esm/data/cluster.js +47 -0
  82. package/esm/data/cluster.js.map +1 -0
  83. package/esm/data/connector.d.ts +7 -0
  84. package/esm/data/connector.js +9 -0
  85. package/esm/data/connector.js.map +1 -0
  86. package/esm/data/fetch.d.ts +4 -0
  87. package/esm/{transform/preprocessor → data}/fetch.js +10 -19
  88. package/esm/data/fetch.js.map +1 -0
  89. package/esm/{transform/preprocessor → data}/filterBy.d.ts +3 -3
  90. package/esm/{transform/preprocessor → data}/filterBy.js +2 -7
  91. package/esm/data/filterBy.js.map +1 -0
  92. package/esm/data/fold.d.ts +10 -0
  93. package/esm/data/fold.js +24 -0
  94. package/esm/data/fold.js.map +1 -0
  95. package/esm/data/index.d.ts +9 -0
  96. package/esm/data/index.js +10 -0
  97. package/esm/data/index.js.map +1 -0
  98. package/esm/data/inline.d.ts +4 -0
  99. package/esm/data/inline.js +6 -0
  100. package/esm/data/inline.js.map +1 -0
  101. package/esm/data/pick.d.ts +7 -0
  102. package/esm/{transform/preprocessor → data}/pick.js +1 -3
  103. package/esm/data/pick.js.map +1 -0
  104. package/esm/{transform/preprocessor → data}/rename.d.ts +3 -3
  105. package/esm/{transform/preprocessor → data}/rename.js +4 -7
  106. package/esm/data/rename.js.map +1 -0
  107. package/esm/data/sankey.d.ts +0 -0
  108. package/esm/data/sankey.js +96 -0
  109. package/esm/data/sankey.js.map +1 -0
  110. package/esm/data/sortBy.d.ts +7 -0
  111. package/esm/{transform/preprocessor → data}/sortBy.js +4 -9
  112. package/esm/data/sortBy.js.map +1 -0
  113. package/esm/data/subset.d.ts +7 -0
  114. package/esm/{transform/preprocessor → data}/subset.js +5 -10
  115. package/esm/data/subset.js.map +1 -0
  116. package/esm/data/tree.d.ts +0 -0
  117. package/esm/data/tree.js +10 -0
  118. package/esm/data/tree.js.map +1 -0
  119. package/esm/{transform → data}/utils/arc/arc.d.ts +0 -0
  120. package/esm/{transform → data}/utils/arc/arc.js +0 -0
  121. package/esm/data/utils/arc/arc.js.map +1 -0
  122. package/esm/{transform → data}/utils/arc/index.d.ts +0 -0
  123. package/esm/{transform → data}/utils/arc/index.js +0 -0
  124. package/esm/data/utils/arc/index.js.map +1 -0
  125. package/esm/{transform → data}/utils/arc/sort.d.ts +0 -0
  126. package/esm/{transform → data}/utils/arc/sort.js +0 -0
  127. package/esm/data/utils/arc/sort.js.map +1 -0
  128. package/esm/{transform → data}/utils/arc/types.d.ts +0 -0
  129. package/esm/{transform → data}/utils/arc/types.js +0 -0
  130. package/esm/data/utils/arc/types.js.map +1 -0
  131. package/esm/{transform → data}/utils/d3-cloud/index.d.ts +0 -0
  132. package/esm/{transform → data}/utils/d3-cloud/index.js +0 -0
  133. package/esm/data/utils/d3-cloud/index.js.map +1 -0
  134. package/esm/{transform → data}/utils/d3-sankey/align.d.ts +0 -0
  135. package/esm/{transform → data}/utils/d3-sankey/align.js +0 -0
  136. package/esm/data/utils/d3-sankey/align.js.map +1 -0
  137. package/esm/{transform → data}/utils/d3-sankey/constant.d.ts +0 -0
  138. package/esm/{transform → data}/utils/d3-sankey/constant.js +0 -0
  139. package/esm/data/utils/d3-sankey/constant.js.map +1 -0
  140. package/esm/{transform → data}/utils/d3-sankey/index.d.ts +0 -0
  141. package/esm/{transform → data}/utils/d3-sankey/index.js +0 -0
  142. package/esm/data/utils/d3-sankey/index.js.map +1 -0
  143. package/esm/{transform → data}/utils/d3-sankey/sankey.d.ts +0 -0
  144. package/esm/{transform → data}/utils/d3-sankey/sankey.js +0 -0
  145. package/esm/data/utils/d3-sankey/sankey.js.map +1 -0
  146. package/esm/{transform → data}/utils/flow.d.ts +0 -0
  147. package/esm/{transform → data}/utils/flow.js +0 -0
  148. package/esm/data/utils/flow.js.map +1 -0
  149. package/esm/{transform → data}/utils/memo.d.ts +0 -0
  150. package/esm/{transform → data}/utils/memo.js +0 -0
  151. package/esm/data/utils/memo.js.map +1 -0
  152. package/esm/data/voronoi.d.ts +0 -0
  153. package/esm/data/voronoi.js +27 -0
  154. package/esm/data/voronoi.js.map +1 -0
  155. package/esm/data/wordCloud.d.ts +0 -0
  156. package/esm/data/wordCloud.js +100 -0
  157. package/esm/data/wordCloud.js.map +1 -0
  158. package/esm/index.d.ts +1 -1
  159. package/esm/index.js +1 -1
  160. package/esm/index.js.map +1 -1
  161. package/esm/interaction/action/service/fisheyeFocus.js +7 -3
  162. package/esm/interaction/action/service/fisheyeFocus.js.map +1 -1
  163. package/esm/interaction/action/transformer/filter.js +9 -3
  164. package/esm/interaction/action/transformer/filter.js.map +1 -1
  165. package/esm/interaction/builtin/fisheye.d.ts +2 -0
  166. package/esm/labelLayout/hideOverlap.d.ts +2 -0
  167. package/esm/labelLayout/hideOverlap.js +38 -0
  168. package/esm/labelLayout/hideOverlap.js.map +1 -0
  169. package/esm/labelLayout/index.d.ts +1 -0
  170. package/esm/labelLayout/index.js +2 -0
  171. package/esm/labelLayout/index.js.map +1 -0
  172. package/esm/mark/utils.d.ts +1 -3
  173. package/esm/mark/utils.js +1 -1
  174. package/esm/mark/utils.js.map +1 -1
  175. package/esm/runtime/component.js +11 -3
  176. package/esm/runtime/component.js.map +1 -1
  177. package/esm/runtime/coordinate.d.ts +4 -0
  178. package/esm/runtime/coordinate.js +16 -0
  179. package/esm/runtime/coordinate.js.map +1 -1
  180. package/esm/runtime/index.d.ts +1 -0
  181. package/esm/runtime/index.js +1 -0
  182. package/esm/runtime/index.js.map +1 -1
  183. package/esm/runtime/layout.js.map +1 -1
  184. package/esm/runtime/mark.d.ts +3 -3
  185. package/esm/runtime/mark.js +34 -90
  186. package/esm/runtime/mark.js.map +1 -1
  187. package/esm/runtime/plot.js +19 -13
  188. package/esm/runtime/plot.js.map +1 -1
  189. package/esm/runtime/render.js +4 -15
  190. package/esm/runtime/render.js.map +1 -1
  191. package/esm/runtime/scale.js +14 -5
  192. package/esm/runtime/scale.js.map +1 -1
  193. package/esm/runtime/transform.d.ts +9 -0
  194. package/esm/runtime/transform.js +144 -0
  195. package/esm/runtime/transform.js.map +1 -0
  196. package/esm/runtime/types/common.d.ts +5 -3
  197. package/esm/runtime/types/component.d.ts +5 -2
  198. package/esm/runtime/types/data.d.ts +7 -0
  199. package/esm/runtime/types/data.js +2 -0
  200. package/esm/runtime/types/data.js.map +1 -0
  201. package/esm/runtime/types/encode.d.ts +4 -2
  202. package/esm/runtime/types/options.d.ts +6 -3
  203. package/esm/runtime/types/transform.d.ts +6 -12
  204. package/esm/shape/interval/colorRect.js +4 -22
  205. package/esm/shape/interval/colorRect.js.map +1 -1
  206. package/esm/shape/label/label.js +81 -10
  207. package/esm/shape/label/label.js.map +1 -1
  208. package/esm/shape/utils.d.ts +7 -0
  209. package/esm/shape/utils.js +23 -0
  210. package/esm/shape/utils.js.map +1 -1
  211. package/esm/spec/composition.d.ts +8 -5
  212. package/esm/spec/coordinate.d.ts +46 -2
  213. package/esm/spec/data.d.ts +54 -0
  214. package/esm/spec/data.js +2 -0
  215. package/esm/spec/data.js.map +1 -0
  216. package/esm/spec/geometry.d.ts +2 -1
  217. package/esm/spec/index.d.ts +2 -1
  218. package/esm/spec/index.js +2 -1
  219. package/esm/spec/index.js.map +1 -1
  220. package/esm/spec/labelLayout.d.ts +4 -0
  221. package/esm/spec/labelLayout.js +2 -0
  222. package/esm/spec/labelLayout.js.map +1 -0
  223. package/esm/spec/transform.d.ts +58 -166
  224. package/esm/spec/transform.js +133 -0
  225. package/esm/spec/transform.js.map +1 -1
  226. package/esm/stdlib/index.js +28 -17
  227. package/esm/stdlib/index.js.map +1 -1
  228. package/esm/theme/light.js +1 -0
  229. package/esm/theme/light.js.map +1 -1
  230. package/esm/transform/{statistic/Select.d.ts → Select.d.ts} +2 -2
  231. package/esm/transform/{statistic/Select.js → Select.js} +9 -14
  232. package/esm/transform/Select.js.map +1 -0
  233. package/esm/transform/{statistic/SelectX.d.ts → SelectX.d.ts} +2 -2
  234. package/esm/transform/{statistic/SelectX.js → SelectX.js} +1 -3
  235. package/esm/transform/SelectX.js.map +1 -0
  236. package/esm/transform/{statistic/SelectY.d.ts → SelectY.d.ts} +2 -2
  237. package/esm/transform/{statistic/SelectY.js → SelectY.js} +1 -3
  238. package/esm/transform/SelectY.js.map +1 -0
  239. package/esm/transform/{statistic/dodgeX.d.ts → dodgeX.d.ts} +2 -2
  240. package/esm/transform/{statistic/dodgeX.js → dodgeX.js} +19 -19
  241. package/esm/transform/dodgeX.js.map +1 -0
  242. package/{lib/transform/statistic → esm/transform}/groupX.d.ts +3 -2
  243. package/esm/transform/{statistic/groupX.js → groupX.js} +23 -19
  244. package/esm/transform/groupX.js.map +1 -0
  245. package/esm/transform/index.d.ts +21 -36
  246. package/esm/transform/index.js +21 -39
  247. package/esm/transform/index.js.map +1 -1
  248. package/esm/transform/{statistic/jitter.d.ts → jitter.d.ts} +3 -3
  249. package/esm/transform/{statistic/jitter.js → jitter.js} +14 -18
  250. package/esm/transform/jitter.js.map +1 -0
  251. package/{lib/transform/statistic → esm/transform}/jitterY.d.ts +2 -2
  252. package/esm/transform/jitterY.js +21 -0
  253. package/esm/transform/jitterY.js.map +1 -0
  254. package/esm/transform/maybeKey.d.ts +6 -0
  255. package/esm/transform/{inference/maybeKey.js → maybeKey.js} +11 -12
  256. package/esm/transform/maybeKey.js.map +1 -0
  257. package/esm/transform/maybeSeries.d.ts +6 -0
  258. package/esm/transform/maybeSeries.js +17 -0
  259. package/esm/transform/maybeSeries.js.map +1 -0
  260. package/esm/transform/maybeSize.d.ts +7 -0
  261. package/esm/transform/maybeSize.js +20 -0
  262. package/esm/transform/maybeSize.js.map +1 -0
  263. package/{lib/transform/inference → esm/transform}/maybeStackY.d.ts +1 -1
  264. package/esm/transform/{inference/maybeStackY.js → maybeStackY.js} +11 -13
  265. package/esm/transform/maybeStackY.js.map +1 -0
  266. package/esm/transform/maybeTitleX.d.ts +6 -0
  267. package/esm/transform/maybeTitleX.js +17 -0
  268. package/esm/transform/maybeTitleX.js.map +1 -0
  269. package/esm/transform/maybeTooltip.d.ts +8 -0
  270. package/esm/transform/maybeTooltip.js +29 -0
  271. package/esm/transform/maybeTooltip.js.map +1 -0
  272. package/esm/transform/{inference/maybeTooltipPosition.d.ts → maybeTooltipPosition.d.ts} +3 -3
  273. package/esm/transform/maybeTooltipPosition.js +10 -0
  274. package/esm/transform/maybeTooltipPosition.js.map +1 -0
  275. package/esm/transform/maybeTooltipY.d.ts +6 -0
  276. package/esm/transform/maybeTooltipY.js +9 -0
  277. package/esm/transform/maybeTooltipY.js.map +1 -0
  278. package/{lib/transform/inference → esm/transform}/maybeZeroX.d.ts +1 -1
  279. package/esm/transform/maybeZeroX.js +22 -0
  280. package/esm/transform/maybeZeroX.js.map +1 -0
  281. package/esm/transform/maybeZeroY.d.ts +6 -0
  282. package/esm/transform/maybeZeroY.js +21 -0
  283. package/esm/transform/maybeZeroY.js.map +1 -0
  284. package/esm/transform/maybeZeroY1.d.ts +6 -0
  285. package/esm/transform/maybeZeroY1.js +21 -0
  286. package/esm/transform/maybeZeroY1.js.map +1 -0
  287. package/esm/transform/{statistic/normalizeY.d.ts → normalizeY.d.ts} +2 -2
  288. package/esm/transform/{statistic/normalizeY.js → normalizeY.js} +16 -17
  289. package/esm/transform/normalizeY.js.map +1 -0
  290. package/esm/transform/{statistic/stackEnter.d.ts → stackEnter.d.ts} +2 -2
  291. package/esm/transform/{statistic/stackEnter.js → stackEnter.js} +22 -19
  292. package/esm/transform/stackEnter.js.map +1 -0
  293. package/esm/transform/{statistic/stackY.d.ts → stackY.d.ts} +2 -2
  294. package/esm/transform/{statistic/stackY.js → stackY.js} +20 -19
  295. package/esm/transform/stackY.js.map +1 -0
  296. package/esm/transform/{statistic/symmetryY.d.ts → symmetryY.d.ts} +2 -2
  297. package/esm/transform/{statistic/symmetryY.js → symmetryY.js} +16 -17
  298. package/esm/transform/symmetryY.js.map +1 -0
  299. package/esm/transform/utils/helper.d.ts +11 -10
  300. package/esm/transform/utils/helper.js +27 -33
  301. package/esm/transform/utils/helper.js.map +1 -1
  302. package/esm/transform/{statistic/utils.d.ts → utils/order.d.ts} +4 -4
  303. package/esm/transform/{statistic/utils.js → utils/order.js} +7 -5
  304. package/esm/transform/utils/order.js.map +1 -0
  305. package/esm/utils/coordinate.d.ts +1 -0
  306. package/esm/utils/coordinate.js +4 -0
  307. package/esm/utils/coordinate.js.map +1 -1
  308. package/lib/animation/fadeIn.js +4 -6
  309. package/lib/animation/fadeIn.js.map +1 -1
  310. package/lib/animation/fadeOut.js +4 -4
  311. package/lib/animation/fadeOut.js.map +1 -1
  312. package/lib/animation/morphing.js +4 -5
  313. package/lib/animation/morphing.js.map +1 -1
  314. package/lib/animation/scaleInX.js +4 -5
  315. package/lib/animation/scaleInX.js.map +1 -1
  316. package/lib/animation/scaleInY.js +4 -5
  317. package/lib/animation/scaleInY.js.map +1 -1
  318. package/lib/animation/scaleOutX.js +4 -5
  319. package/lib/animation/scaleOutX.js.map +1 -1
  320. package/lib/animation/scaleOutY.js +4 -5
  321. package/lib/animation/scaleOutY.js.map +1 -1
  322. package/lib/api/chart.d.ts +4 -1
  323. package/lib/api/chart.js +12 -4
  324. package/lib/api/chart.js.map +1 -1
  325. package/lib/api/composition/circle.js.map +1 -1
  326. package/lib/api/composition/flex.js.map +1 -1
  327. package/lib/api/composition/keyframe.js.map +1 -1
  328. package/lib/api/composition/layer.js.map +1 -1
  329. package/lib/api/composition/matrix.js.map +1 -1
  330. package/lib/api/composition/rect.js.map +1 -1
  331. package/lib/api/composition/view.js.map +1 -1
  332. package/lib/api/index.d.ts +1 -0
  333. package/lib/api/index.js +3 -1
  334. package/lib/api/index.js.map +1 -1
  335. package/lib/api/library.d.ts +3 -0
  336. package/lib/api/library.js +11 -0
  337. package/lib/api/library.js.map +1 -0
  338. package/lib/api/mark/mark.js.map +1 -1
  339. package/lib/composition/circle.js +1 -1
  340. package/lib/composition/circle.js.map +1 -1
  341. package/lib/composition/flex.js +4 -2
  342. package/lib/composition/flex.js.map +1 -1
  343. package/lib/composition/layer.js +3 -3
  344. package/lib/composition/layer.js.map +1 -1
  345. package/lib/composition/mark.js +2 -1
  346. package/lib/composition/mark.js.map +1 -1
  347. package/lib/composition/rect.js +29 -30
  348. package/lib/composition/rect.js.map +1 -1
  349. package/lib/composition/utils.d.ts +6 -0
  350. package/lib/composition/utils.js +21 -1
  351. package/lib/composition/utils.js.map +1 -1
  352. package/lib/composition/view.js +3 -2
  353. package/lib/composition/view.js.map +1 -1
  354. package/lib/coordinate/fisheye.d.ts +1 -1
  355. package/lib/coordinate/fisheye.js +1 -1
  356. package/lib/coordinate/fisheye.js.map +1 -1
  357. package/lib/coordinate/fisheyeX.d.ts +7 -0
  358. package/lib/coordinate/fisheyeX.js +10 -0
  359. package/lib/coordinate/fisheyeX.js.map +1 -0
  360. package/lib/coordinate/fisheyeY.d.ts +7 -0
  361. package/lib/coordinate/fisheyeY.js +10 -0
  362. package/lib/coordinate/fisheyeY.js.map +1 -0
  363. package/lib/coordinate/helix.d.ts +7 -0
  364. package/lib/coordinate/helix.js +15 -0
  365. package/lib/coordinate/helix.js.map +1 -0
  366. package/lib/coordinate/index.d.ts +7 -0
  367. package/lib/coordinate/index.js +15 -1
  368. package/lib/coordinate/index.js.map +1 -1
  369. package/lib/coordinate/reflect.d.ts +7 -0
  370. package/lib/coordinate/reflect.js +14 -0
  371. package/lib/coordinate/reflect.js.map +1 -0
  372. package/lib/coordinate/reflectX.d.ts +7 -0
  373. package/lib/coordinate/reflectX.js +14 -0
  374. package/lib/coordinate/reflectX.js.map +1 -0
  375. package/lib/coordinate/reflectY.d.ts +7 -0
  376. package/lib/coordinate/reflectY.js +14 -0
  377. package/lib/coordinate/reflectY.js.map +1 -0
  378. package/lib/coordinate/theta.d.ts +7 -0
  379. package/lib/coordinate/theta.js +15 -0
  380. package/lib/coordinate/theta.js.map +1 -0
  381. package/lib/data/arc.d.ts +0 -0
  382. package/lib/data/arc.js +19 -0
  383. package/lib/data/arc.js.map +1 -0
  384. package/lib/data/cluster.d.ts +0 -0
  385. package/lib/data/cluster.js +47 -0
  386. package/lib/data/cluster.js.map +1 -0
  387. package/lib/data/connector.d.ts +7 -0
  388. package/lib/data/connector.js +13 -0
  389. package/lib/data/connector.js.map +1 -0
  390. package/lib/data/fetch.d.ts +4 -0
  391. package/lib/{transform/preprocessor → data}/fetch.js +10 -19
  392. package/lib/data/fetch.js.map +1 -0
  393. package/lib/{transform/preprocessor → data}/filterBy.d.ts +3 -3
  394. package/lib/{transform/preprocessor → data}/filterBy.js +2 -7
  395. package/lib/data/filterBy.js.map +1 -0
  396. package/lib/data/fold.d.ts +10 -0
  397. package/lib/data/fold.js +29 -0
  398. package/lib/data/fold.js.map +1 -0
  399. package/lib/data/index.d.ts +9 -0
  400. package/lib/data/index.js +22 -0
  401. package/lib/data/index.js.map +1 -0
  402. package/lib/data/inline.d.ts +4 -0
  403. package/lib/data/inline.js +10 -0
  404. package/lib/data/inline.js.map +1 -0
  405. package/lib/data/pick.d.ts +7 -0
  406. package/lib/{transform/preprocessor → data}/pick.js +1 -3
  407. package/lib/data/pick.js.map +1 -0
  408. package/lib/{transform/preprocessor → data}/rename.d.ts +3 -3
  409. package/lib/{transform/preprocessor → data}/rename.js +4 -7
  410. package/lib/data/rename.js.map +1 -0
  411. package/lib/data/sankey.d.ts +0 -0
  412. package/lib/data/sankey.js +96 -0
  413. package/lib/data/sankey.js.map +1 -0
  414. package/lib/data/sortBy.d.ts +7 -0
  415. package/lib/{transform/preprocessor → data}/sortBy.js +4 -9
  416. package/lib/data/sortBy.js.map +1 -0
  417. package/lib/data/subset.d.ts +7 -0
  418. package/lib/{transform/preprocessor → data}/subset.js +5 -10
  419. package/lib/data/subset.js.map +1 -0
  420. package/lib/data/tree.d.ts +0 -0
  421. package/lib/data/tree.js +10 -0
  422. package/lib/data/tree.js.map +1 -0
  423. package/lib/{transform → data}/utils/arc/arc.d.ts +0 -0
  424. package/lib/{transform → data}/utils/arc/arc.js +0 -0
  425. package/lib/data/utils/arc/arc.js.map +1 -0
  426. package/lib/{transform → data}/utils/arc/index.d.ts +0 -0
  427. package/lib/{transform → data}/utils/arc/index.js +0 -0
  428. package/lib/data/utils/arc/index.js.map +1 -0
  429. package/lib/{transform → data}/utils/arc/sort.d.ts +0 -0
  430. package/lib/{transform → data}/utils/arc/sort.js +0 -0
  431. package/lib/data/utils/arc/sort.js.map +1 -0
  432. package/lib/{transform → data}/utils/arc/types.d.ts +0 -0
  433. package/lib/{transform → data}/utils/arc/types.js +0 -0
  434. package/lib/data/utils/arc/types.js.map +1 -0
  435. package/lib/{transform → data}/utils/d3-cloud/index.d.ts +0 -0
  436. package/lib/{transform → data}/utils/d3-cloud/index.js +0 -0
  437. package/lib/data/utils/d3-cloud/index.js.map +1 -0
  438. package/lib/{transform → data}/utils/d3-sankey/align.d.ts +0 -0
  439. package/lib/{transform → data}/utils/d3-sankey/align.js +0 -0
  440. package/lib/data/utils/d3-sankey/align.js.map +1 -0
  441. package/lib/{transform → data}/utils/d3-sankey/constant.d.ts +0 -0
  442. package/lib/{transform → data}/utils/d3-sankey/constant.js +0 -0
  443. package/lib/data/utils/d3-sankey/constant.js.map +1 -0
  444. package/lib/{transform → data}/utils/d3-sankey/index.d.ts +0 -0
  445. package/lib/{transform → data}/utils/d3-sankey/index.js +0 -0
  446. package/lib/data/utils/d3-sankey/index.js.map +1 -0
  447. package/lib/{transform → data}/utils/d3-sankey/sankey.d.ts +0 -0
  448. package/lib/{transform → data}/utils/d3-sankey/sankey.js +0 -0
  449. package/lib/data/utils/d3-sankey/sankey.js.map +1 -0
  450. package/lib/{transform → data}/utils/flow.d.ts +0 -0
  451. package/lib/{transform → data}/utils/flow.js +0 -0
  452. package/lib/data/utils/flow.js.map +1 -0
  453. package/lib/{transform → data}/utils/memo.d.ts +0 -0
  454. package/lib/{transform → data}/utils/memo.js +0 -0
  455. package/lib/data/utils/memo.js.map +1 -0
  456. package/lib/data/voronoi.d.ts +0 -0
  457. package/lib/data/voronoi.js +27 -0
  458. package/lib/data/voronoi.js.map +1 -0
  459. package/lib/data/wordCloud.d.ts +0 -0
  460. package/lib/data/wordCloud.js +100 -0
  461. package/lib/data/wordCloud.js.map +1 -0
  462. package/lib/index.d.ts +1 -1
  463. package/lib/index.js +2 -1
  464. package/lib/index.js.map +1 -1
  465. package/lib/interaction/action/service/fisheyeFocus.js +7 -3
  466. package/lib/interaction/action/service/fisheyeFocus.js.map +1 -1
  467. package/lib/interaction/action/transformer/filter.js +9 -3
  468. package/lib/interaction/action/transformer/filter.js.map +1 -1
  469. package/lib/interaction/builtin/fisheye.d.ts +2 -0
  470. package/lib/labelLayout/hideOverlap.d.ts +2 -0
  471. package/lib/labelLayout/hideOverlap.js +42 -0
  472. package/lib/labelLayout/hideOverlap.js.map +1 -0
  473. package/lib/labelLayout/index.d.ts +1 -0
  474. package/lib/labelLayout/index.js +6 -0
  475. package/lib/labelLayout/index.js.map +1 -0
  476. package/lib/mark/utils.d.ts +1 -3
  477. package/lib/mark/utils.js +1 -1
  478. package/lib/mark/utils.js.map +1 -1
  479. package/lib/runtime/component.js +10 -2
  480. package/lib/runtime/component.js.map +1 -1
  481. package/lib/runtime/coordinate.d.ts +4 -0
  482. package/lib/runtime/coordinate.js +21 -1
  483. package/lib/runtime/coordinate.js.map +1 -1
  484. package/lib/runtime/index.d.ts +1 -0
  485. package/lib/runtime/index.js +1 -0
  486. package/lib/runtime/index.js.map +1 -1
  487. package/lib/runtime/layout.js.map +1 -1
  488. package/lib/runtime/mark.d.ts +3 -3
  489. package/lib/runtime/mark.js +34 -90
  490. package/lib/runtime/mark.js.map +1 -1
  491. package/lib/runtime/plot.js +17 -11
  492. package/lib/runtime/plot.js.map +1 -1
  493. package/lib/runtime/render.js +4 -15
  494. package/lib/runtime/render.js.map +1 -1
  495. package/lib/runtime/scale.js +13 -4
  496. package/lib/runtime/scale.js.map +1 -1
  497. package/lib/runtime/transform.d.ts +9 -0
  498. package/lib/runtime/transform.js +154 -0
  499. package/lib/runtime/transform.js.map +1 -0
  500. package/lib/runtime/types/common.d.ts +5 -3
  501. package/lib/runtime/types/component.d.ts +5 -2
  502. package/lib/runtime/types/data.d.ts +7 -0
  503. package/lib/{spec/statistic.js → runtime/types/data.js} +1 -1
  504. package/lib/runtime/types/data.js.map +1 -0
  505. package/lib/runtime/types/encode.d.ts +4 -2
  506. package/lib/runtime/types/options.d.ts +6 -3
  507. package/lib/runtime/types/transform.d.ts +6 -12
  508. package/lib/shape/interval/colorRect.js +2 -20
  509. package/lib/shape/interval/colorRect.js.map +1 -1
  510. package/lib/shape/label/label.js +80 -9
  511. package/lib/shape/label/label.js.map +1 -1
  512. package/lib/shape/utils.d.ts +7 -0
  513. package/lib/shape/utils.js +25 -1
  514. package/lib/shape/utils.js.map +1 -1
  515. package/lib/spec/composition.d.ts +8 -5
  516. package/lib/spec/coordinate.d.ts +46 -2
  517. package/lib/spec/data.d.ts +54 -0
  518. package/lib/spec/data.js +3 -0
  519. package/lib/spec/data.js.map +1 -0
  520. package/lib/spec/geometry.d.ts +2 -1
  521. package/lib/spec/index.d.ts +2 -1
  522. package/lib/spec/index.js +2 -1
  523. package/lib/spec/index.js.map +1 -1
  524. package/lib/spec/labelLayout.d.ts +4 -0
  525. package/lib/spec/labelLayout.js +3 -0
  526. package/lib/spec/labelLayout.js.map +1 -0
  527. package/lib/spec/transform.d.ts +58 -166
  528. package/lib/spec/transform.js +133 -0
  529. package/lib/spec/transform.js.map +1 -1
  530. package/lib/stdlib/index.js +26 -15
  531. package/lib/stdlib/index.js.map +1 -1
  532. package/lib/theme/light.js +1 -0
  533. package/lib/theme/light.js.map +1 -1
  534. package/lib/transform/{statistic/Select.d.ts → Select.d.ts} +2 -2
  535. package/lib/transform/{statistic/Select.js → Select.js} +9 -14
  536. package/lib/transform/Select.js.map +1 -0
  537. package/lib/transform/{statistic/SelectX.d.ts → SelectX.d.ts} +2 -2
  538. package/lib/transform/{statistic/SelectX.js → SelectX.js} +1 -3
  539. package/lib/transform/SelectX.js.map +1 -0
  540. package/lib/transform/{statistic/SelectY.d.ts → SelectY.d.ts} +2 -2
  541. package/lib/transform/{statistic/SelectY.js → SelectY.js} +1 -3
  542. package/lib/transform/SelectY.js.map +1 -0
  543. package/lib/transform/{statistic/dodgeX.d.ts → dodgeX.d.ts} +2 -2
  544. package/lib/transform/{statistic/dodgeX.js → dodgeX.js} +22 -22
  545. package/lib/transform/dodgeX.js.map +1 -0
  546. package/{esm/transform/statistic → lib/transform}/groupX.d.ts +3 -2
  547. package/lib/transform/{statistic/groupX.js → groupX.js} +23 -19
  548. package/lib/transform/groupX.js.map +1 -0
  549. package/lib/transform/index.d.ts +21 -36
  550. package/lib/transform/index.js +22 -55
  551. package/lib/transform/index.js.map +1 -1
  552. package/lib/transform/{statistic/jitter.d.ts → jitter.d.ts} +3 -3
  553. package/lib/transform/{statistic/jitter.js → jitter.js} +16 -20
  554. package/lib/transform/jitter.js.map +1 -0
  555. package/{esm/transform/statistic → lib/transform}/jitterY.d.ts +2 -2
  556. package/lib/transform/{statistic/jitterY.js → jitterY.js} +9 -15
  557. package/lib/transform/jitterY.js.map +1 -0
  558. package/lib/transform/maybeKey.d.ts +6 -0
  559. package/lib/transform/{inference/maybeKey.js → maybeKey.js} +11 -12
  560. package/lib/transform/maybeKey.js.map +1 -0
  561. package/lib/transform/maybeSeries.d.ts +6 -0
  562. package/lib/transform/maybeSeries.js +21 -0
  563. package/lib/transform/maybeSeries.js.map +1 -0
  564. package/lib/transform/maybeSize.d.ts +7 -0
  565. package/lib/transform/maybeSize.js +24 -0
  566. package/lib/transform/maybeSize.js.map +1 -0
  567. package/{esm/transform/inference → lib/transform}/maybeStackY.d.ts +1 -1
  568. package/lib/transform/{inference/maybeStackY.js → maybeStackY.js} +11 -13
  569. package/lib/transform/maybeStackY.js.map +1 -0
  570. package/lib/transform/maybeTitleX.d.ts +6 -0
  571. package/lib/transform/maybeTitleX.js +21 -0
  572. package/lib/transform/maybeTitleX.js.map +1 -0
  573. package/lib/transform/maybeTooltip.d.ts +8 -0
  574. package/lib/transform/{inference/maybeTooltip.js → maybeTooltip.js} +13 -14
  575. package/lib/transform/maybeTooltip.js.map +1 -0
  576. package/lib/transform/{inference/maybeTooltipPosition.d.ts → maybeTooltipPosition.d.ts} +3 -3
  577. package/lib/transform/{inference/maybeTooltipPosition.js → maybeTooltipPosition.js} +3 -5
  578. package/lib/transform/maybeTooltipPosition.js.map +1 -0
  579. package/lib/transform/maybeTooltipY.d.ts +6 -0
  580. package/lib/transform/{inference/maybeTooltipY.js → maybeTooltipY.js} +2 -5
  581. package/lib/transform/maybeTooltipY.js.map +1 -0
  582. package/{esm/transform/inference → lib/transform}/maybeZeroX.d.ts +1 -1
  583. package/lib/transform/maybeZeroX.js +26 -0
  584. package/lib/transform/maybeZeroX.js.map +1 -0
  585. package/lib/transform/maybeZeroY.d.ts +6 -0
  586. package/lib/transform/maybeZeroY.js +25 -0
  587. package/lib/transform/maybeZeroY.js.map +1 -0
  588. package/lib/transform/maybeZeroY1.d.ts +6 -0
  589. package/lib/transform/maybeZeroY1.js +25 -0
  590. package/lib/transform/maybeZeroY1.js.map +1 -0
  591. package/lib/transform/{statistic/normalizeY.d.ts → normalizeY.d.ts} +2 -2
  592. package/lib/transform/{statistic/normalizeY.js → normalizeY.js} +16 -17
  593. package/lib/transform/normalizeY.js.map +1 -0
  594. package/lib/transform/{statistic/stackEnter.d.ts → stackEnter.d.ts} +2 -2
  595. package/lib/transform/{statistic/stackEnter.js → stackEnter.js} +22 -19
  596. package/lib/transform/stackEnter.js.map +1 -0
  597. package/lib/transform/{statistic/stackY.d.ts → stackY.d.ts} +2 -2
  598. package/lib/transform/{statistic/stackY.js → stackY.js} +22 -21
  599. package/lib/transform/stackY.js.map +1 -0
  600. package/lib/transform/{statistic/symmetryY.d.ts → symmetryY.d.ts} +2 -2
  601. package/lib/transform/{statistic/symmetryY.js → symmetryY.js} +16 -17
  602. package/lib/transform/symmetryY.js.map +1 -0
  603. package/lib/transform/utils/helper.d.ts +11 -10
  604. package/lib/transform/utils/helper.js +32 -38
  605. package/lib/transform/utils/helper.js.map +1 -1
  606. package/lib/transform/{statistic/utils.d.ts → utils/order.d.ts} +4 -4
  607. package/lib/transform/{statistic/utils.js → utils/order.js} +7 -5
  608. package/lib/transform/utils/order.js.map +1 -0
  609. package/lib/utils/coordinate.d.ts +1 -0
  610. package/lib/utils/coordinate.js +6 -1
  611. package/lib/utils/coordinate.js.map +1 -1
  612. package/package.json +6 -5
  613. package/src/animation/fadeIn.ts +4 -6
  614. package/src/animation/fadeOut.ts +4 -4
  615. package/src/animation/morphing.ts +4 -5
  616. package/src/animation/scaleInX.ts +9 -5
  617. package/src/animation/scaleInY.ts +9 -5
  618. package/src/animation/scaleOutX.ts +9 -5
  619. package/src/animation/scaleOutY.ts +9 -5
  620. package/src/api/chart.ts +19 -8
  621. package/src/api/index.ts +1 -0
  622. package/src/api/library.ts +12 -0
  623. package/src/composition/circle.ts +1 -1
  624. package/src/composition/flex.ts +4 -2
  625. package/src/composition/layer.ts +3 -2
  626. package/src/composition/mark.ts +3 -0
  627. package/src/composition/rect.ts +27 -28
  628. package/src/composition/utils.ts +10 -0
  629. package/src/composition/view.ts +3 -2
  630. package/src/coordinate/fisheye.ts +3 -2
  631. package/src/coordinate/fisheyeX.ts +15 -0
  632. package/src/coordinate/fisheyeY.ts +15 -0
  633. package/src/coordinate/helix.ts +21 -0
  634. package/src/coordinate/index.ts +7 -0
  635. package/src/coordinate/reflect.ts +15 -0
  636. package/src/coordinate/reflectX.ts +15 -0
  637. package/src/coordinate/reflectY.ts +15 -0
  638. package/src/coordinate/theta.ts +21 -0
  639. package/src/data/arc.ts +21 -0
  640. package/src/data/cluster.ts +56 -0
  641. package/src/data/connector.ts +14 -0
  642. package/src/data/fetch.ts +23 -0
  643. package/src/data/filterBy.ts +19 -0
  644. package/src/data/fold.ts +29 -0
  645. package/src/data/index.ts +9 -0
  646. package/src/data/inline.ts +11 -0
  647. package/src/{transform/preprocessor → data}/pick.ts +4 -6
  648. package/src/{transform/preprocessor → data}/rename.ts +7 -10
  649. package/src/data/sankey.ts +105 -0
  650. package/src/{transform/preprocessor → data}/sortBy.ts +7 -12
  651. package/src/{transform/preprocessor → data}/subset.ts +8 -13
  652. package/src/data/tree.ts +12 -0
  653. package/src/{transform → data}/utils/arc/arc.ts +0 -0
  654. package/src/{transform → data}/utils/arc/index.ts +0 -0
  655. package/src/{transform → data}/utils/arc/sort.ts +0 -0
  656. package/src/{transform → data}/utils/arc/types.ts +0 -0
  657. package/src/{transform → data}/utils/d3-cloud/index.ts +0 -0
  658. package/src/{transform → data}/utils/d3-sankey/align.ts +0 -0
  659. package/src/{transform → data}/utils/d3-sankey/constant.ts +0 -0
  660. package/src/{transform → data}/utils/d3-sankey/index.ts +0 -0
  661. package/src/{transform → data}/utils/d3-sankey/sankey.ts +0 -0
  662. package/src/{transform → data}/utils/flow.ts +0 -0
  663. package/src/{transform → data}/utils/memo.ts +1 -0
  664. package/src/data/voronoi.ts +30 -0
  665. package/src/data/wordCloud.ts +115 -0
  666. package/src/index.ts +1 -1
  667. package/src/interaction/action/service/fisheyeFocus.ts +16 -3
  668. package/src/interaction/action/transformer/filter.ts +8 -4
  669. package/src/labelLayout/hideOverlap.ts +47 -0
  670. package/src/labelLayout/index.ts +1 -0
  671. package/src/mark/utils.ts +1 -1
  672. package/src/runtime/component.ts +23 -3
  673. package/src/runtime/coordinate.ts +20 -0
  674. package/src/runtime/index.ts +1 -0
  675. package/src/runtime/layout.ts +1 -1
  676. package/src/runtime/mark.ts +56 -135
  677. package/src/runtime/plot.ts +29 -22
  678. package/src/runtime/render.ts +4 -5
  679. package/src/runtime/scale.ts +15 -5
  680. package/src/runtime/transform.ts +159 -0
  681. package/src/runtime/types/common.ts +5 -2
  682. package/src/runtime/types/component.ts +13 -3
  683. package/src/runtime/types/data.ts +10 -0
  684. package/src/runtime/types/encode.ts +6 -2
  685. package/src/runtime/types/options.ts +7 -2
  686. package/src/runtime/types/transform.ts +8 -13
  687. package/src/shape/interval/colorRect.ts +4 -23
  688. package/src/shape/label/label.ts +94 -11
  689. package/src/shape/utils.ts +31 -0
  690. package/src/spec/composition.ts +8 -5
  691. package/src/spec/coordinate.ts +67 -3
  692. package/src/spec/data.ts +81 -0
  693. package/src/spec/geometry.ts +2 -1
  694. package/src/spec/index.ts +2 -1
  695. package/src/spec/labelLayout.ts +5 -0
  696. package/src/spec/transform.ts +245 -194
  697. package/src/stdlib/index.ts +50 -31
  698. package/src/theme/light.ts +1 -0
  699. package/src/transform/{statistic/dodgeX.ts → dodgeX.ts} +24 -21
  700. package/src/transform/{statistic/groupX.ts → groupX.ts} +25 -24
  701. package/src/transform/index.ts +21 -44
  702. package/src/transform/{statistic/jitter.ts → jitter.ts} +17 -21
  703. package/src/transform/{statistic/jitterY.ts → jitterY.ts} +11 -17
  704. package/src/transform/maybeKey.ts +26 -0
  705. package/src/transform/maybeSeries.ts +20 -0
  706. package/src/transform/maybeSize.ts +23 -0
  707. package/src/transform/{inference/maybeStackY.ts → maybeStackY.ts} +12 -13
  708. package/src/transform/maybeTitleX.ts +20 -0
  709. package/src/transform/maybeTooltip.ts +34 -0
  710. package/src/transform/{inference/maybeTooltipPosition.ts → maybeTooltipPosition.ts} +4 -6
  711. package/src/transform/{inference/maybeTooltipY.ts → maybeTooltipY.ts} +3 -6
  712. package/src/transform/maybeZeroX.ts +25 -0
  713. package/src/transform/maybeZeroY.ts +24 -0
  714. package/src/transform/maybeZeroY1.ts +24 -0
  715. package/src/transform/{statistic/normalizeY.ts → normalizeY.ts} +20 -19
  716. package/src/transform/{statistic/select.ts → select.ts} +11 -16
  717. package/src/transform/{statistic/selectX.ts → selectX.ts} +3 -5
  718. package/src/transform/{statistic/selectY.ts → selectY.ts} +3 -5
  719. package/src/transform/{statistic/stackEnter.ts → stackEnter.ts} +29 -21
  720. package/src/transform/{statistic/stackY.ts → stackY.ts} +22 -21
  721. package/src/transform/{statistic/symmetryY.ts → symmetryY.ts} +20 -19
  722. package/src/transform/utils/helper.ts +27 -44
  723. package/src/transform/{statistic/utils.ts → utils/order.ts} +20 -17
  724. package/src/utils/coordinate.ts +5 -0
  725. package/esm/spec/statistic.d.ts +0 -69
  726. package/esm/spec/statistic.js +0 -2
  727. package/esm/spec/statistic.js.map +0 -1
  728. package/esm/transform/inference/maybeArrayField.d.ts +0 -8
  729. package/esm/transform/inference/maybeArrayField.js +0 -47
  730. package/esm/transform/inference/maybeArrayField.js.map +0 -1
  731. package/esm/transform/inference/maybeKey.d.ts +0 -9
  732. package/esm/transform/inference/maybeKey.js.map +0 -1
  733. package/esm/transform/inference/maybeSeries.d.ts +0 -7
  734. package/esm/transform/inference/maybeSeries.js +0 -23
  735. package/esm/transform/inference/maybeSeries.js.map +0 -1
  736. package/esm/transform/inference/maybeSize.d.ts +0 -7
  737. package/esm/transform/inference/maybeSize.js +0 -14
  738. package/esm/transform/inference/maybeSize.js.map +0 -1
  739. package/esm/transform/inference/maybeStackY.js.map +0 -1
  740. package/esm/transform/inference/maybeTitleX.d.ts +0 -7
  741. package/esm/transform/inference/maybeTitleX.js +0 -23
  742. package/esm/transform/inference/maybeTitleX.js.map +0 -1
  743. package/esm/transform/inference/maybeTooltip.d.ts +0 -9
  744. package/esm/transform/inference/maybeTooltip.js +0 -30
  745. package/esm/transform/inference/maybeTooltip.js.map +0 -1
  746. package/esm/transform/inference/maybeTooltipPosition.js +0 -12
  747. package/esm/transform/inference/maybeTooltipPosition.js.map +0 -1
  748. package/esm/transform/inference/maybeTooltipY.d.ts +0 -7
  749. package/esm/transform/inference/maybeTooltipY.js +0 -12
  750. package/esm/transform/inference/maybeTooltipY.js.map +0 -1
  751. package/esm/transform/inference/maybeZeroX.js +0 -14
  752. package/esm/transform/inference/maybeZeroX.js.map +0 -1
  753. package/esm/transform/inference/maybeZeroY.d.ts +0 -7
  754. package/esm/transform/inference/maybeZeroY.js +0 -14
  755. package/esm/transform/inference/maybeZeroY.js.map +0 -1
  756. package/esm/transform/inference/maybeZeroY1.d.ts +0 -7
  757. package/esm/transform/inference/maybeZeroY1.js +0 -14
  758. package/esm/transform/inference/maybeZeroY1.js.map +0 -1
  759. package/esm/transform/preprocessor/arc.d.ts +0 -7
  760. package/esm/transform/preprocessor/arc.js +0 -16
  761. package/esm/transform/preprocessor/arc.js.map +0 -1
  762. package/esm/transform/preprocessor/cluster.d.ts +0 -5
  763. package/esm/transform/preprocessor/cluster.js +0 -40
  764. package/esm/transform/preprocessor/cluster.js.map +0 -1
  765. package/esm/transform/preprocessor/connector.d.ts +0 -7
  766. package/esm/transform/preprocessor/connector.js +0 -16
  767. package/esm/transform/preprocessor/connector.js.map +0 -1
  768. package/esm/transform/preprocessor/fetch.d.ts +0 -8
  769. package/esm/transform/preprocessor/fetch.js.map +0 -1
  770. package/esm/transform/preprocessor/filterBy.js.map +0 -1
  771. package/esm/transform/preprocessor/fold.d.ts +0 -8
  772. package/esm/transform/preprocessor/fold.js +0 -27
  773. package/esm/transform/preprocessor/fold.js.map +0 -1
  774. package/esm/transform/preprocessor/pick.d.ts +0 -7
  775. package/esm/transform/preprocessor/pick.js.map +0 -1
  776. package/esm/transform/preprocessor/rename.js.map +0 -1
  777. package/esm/transform/preprocessor/sankey.d.ts +0 -8
  778. package/esm/transform/preprocessor/sankey.js +0 -80
  779. package/esm/transform/preprocessor/sankey.js.map +0 -1
  780. package/esm/transform/preprocessor/sortBy.d.ts +0 -7
  781. package/esm/transform/preprocessor/sortBy.js.map +0 -1
  782. package/esm/transform/preprocessor/subset.d.ts +0 -7
  783. package/esm/transform/preprocessor/subset.js.map +0 -1
  784. package/esm/transform/preprocessor/tree.d.ts +0 -4
  785. package/esm/transform/preprocessor/tree.js +0 -7
  786. package/esm/transform/preprocessor/tree.js.map +0 -1
  787. package/esm/transform/preprocessor/voronoi.d.ts +0 -4
  788. package/esm/transform/preprocessor/voronoi.js +0 -20
  789. package/esm/transform/preprocessor/voronoi.js.map +0 -1
  790. package/esm/transform/preprocessor/wordCloud.d.ts +0 -6
  791. package/esm/transform/preprocessor/wordCloud.js +0 -106
  792. package/esm/transform/preprocessor/wordCloud.js.map +0 -1
  793. package/esm/transform/statistic/Select.js.map +0 -1
  794. package/esm/transform/statistic/SelectX.js.map +0 -1
  795. package/esm/transform/statistic/SelectY.js.map +0 -1
  796. package/esm/transform/statistic/dodgeX.js.map +0 -1
  797. package/esm/transform/statistic/groupX.js.map +0 -1
  798. package/esm/transform/statistic/jitter.js.map +0 -1
  799. package/esm/transform/statistic/jitterY.js +0 -27
  800. package/esm/transform/statistic/jitterY.js.map +0 -1
  801. package/esm/transform/statistic/normalizeY.js.map +0 -1
  802. package/esm/transform/statistic/stackEnter.js.map +0 -1
  803. package/esm/transform/statistic/stackY.js.map +0 -1
  804. package/esm/transform/statistic/symmetryY.js.map +0 -1
  805. package/esm/transform/statistic/utils.js.map +0 -1
  806. package/esm/transform/utils/arc/arc.js.map +0 -1
  807. package/esm/transform/utils/arc/index.js.map +0 -1
  808. package/esm/transform/utils/arc/sort.js.map +0 -1
  809. package/esm/transform/utils/arc/types.js.map +0 -1
  810. package/esm/transform/utils/d3-cloud/index.js.map +0 -1
  811. package/esm/transform/utils/d3-sankey/align.js.map +0 -1
  812. package/esm/transform/utils/d3-sankey/constant.js.map +0 -1
  813. package/esm/transform/utils/d3-sankey/index.js.map +0 -1
  814. package/esm/transform/utils/d3-sankey/sankey.js.map +0 -1
  815. package/esm/transform/utils/flow.js.map +0 -1
  816. package/esm/transform/utils/memo.js.map +0 -1
  817. package/lib/spec/statistic.d.ts +0 -69
  818. package/lib/spec/statistic.js.map +0 -1
  819. package/lib/transform/inference/maybeArrayField.d.ts +0 -8
  820. package/lib/transform/inference/maybeArrayField.js +0 -51
  821. package/lib/transform/inference/maybeArrayField.js.map +0 -1
  822. package/lib/transform/inference/maybeKey.d.ts +0 -9
  823. package/lib/transform/inference/maybeKey.js.map +0 -1
  824. package/lib/transform/inference/maybeSeries.d.ts +0 -7
  825. package/lib/transform/inference/maybeSeries.js +0 -27
  826. package/lib/transform/inference/maybeSeries.js.map +0 -1
  827. package/lib/transform/inference/maybeSize.d.ts +0 -7
  828. package/lib/transform/inference/maybeSize.js +0 -18
  829. package/lib/transform/inference/maybeSize.js.map +0 -1
  830. package/lib/transform/inference/maybeStackY.js.map +0 -1
  831. package/lib/transform/inference/maybeTitleX.d.ts +0 -7
  832. package/lib/transform/inference/maybeTitleX.js +0 -27
  833. package/lib/transform/inference/maybeTitleX.js.map +0 -1
  834. package/lib/transform/inference/maybeTooltip.d.ts +0 -9
  835. package/lib/transform/inference/maybeTooltip.js.map +0 -1
  836. package/lib/transform/inference/maybeTooltipPosition.js.map +0 -1
  837. package/lib/transform/inference/maybeTooltipY.d.ts +0 -7
  838. package/lib/transform/inference/maybeTooltipY.js.map +0 -1
  839. package/lib/transform/inference/maybeZeroX.js +0 -18
  840. package/lib/transform/inference/maybeZeroX.js.map +0 -1
  841. package/lib/transform/inference/maybeZeroY.d.ts +0 -7
  842. package/lib/transform/inference/maybeZeroY.js +0 -18
  843. package/lib/transform/inference/maybeZeroY.js.map +0 -1
  844. package/lib/transform/inference/maybeZeroY1.d.ts +0 -7
  845. package/lib/transform/inference/maybeZeroY1.js +0 -18
  846. package/lib/transform/inference/maybeZeroY1.js.map +0 -1
  847. package/lib/transform/preprocessor/arc.d.ts +0 -7
  848. package/lib/transform/preprocessor/arc.js +0 -20
  849. package/lib/transform/preprocessor/arc.js.map +0 -1
  850. package/lib/transform/preprocessor/cluster.d.ts +0 -5
  851. package/lib/transform/preprocessor/cluster.js +0 -44
  852. package/lib/transform/preprocessor/cluster.js.map +0 -1
  853. package/lib/transform/preprocessor/connector.d.ts +0 -7
  854. package/lib/transform/preprocessor/connector.js +0 -20
  855. package/lib/transform/preprocessor/connector.js.map +0 -1
  856. package/lib/transform/preprocessor/fetch.d.ts +0 -8
  857. package/lib/transform/preprocessor/fetch.js.map +0 -1
  858. package/lib/transform/preprocessor/filterBy.js.map +0 -1
  859. package/lib/transform/preprocessor/fold.d.ts +0 -8
  860. package/lib/transform/preprocessor/fold.js +0 -32
  861. package/lib/transform/preprocessor/fold.js.map +0 -1
  862. package/lib/transform/preprocessor/pick.d.ts +0 -7
  863. package/lib/transform/preprocessor/pick.js.map +0 -1
  864. package/lib/transform/preprocessor/rename.js.map +0 -1
  865. package/lib/transform/preprocessor/sankey.d.ts +0 -8
  866. package/lib/transform/preprocessor/sankey.js +0 -84
  867. package/lib/transform/preprocessor/sankey.js.map +0 -1
  868. package/lib/transform/preprocessor/sortBy.d.ts +0 -7
  869. package/lib/transform/preprocessor/sortBy.js.map +0 -1
  870. package/lib/transform/preprocessor/subset.d.ts +0 -7
  871. package/lib/transform/preprocessor/subset.js.map +0 -1
  872. package/lib/transform/preprocessor/tree.d.ts +0 -4
  873. package/lib/transform/preprocessor/tree.js +0 -10
  874. package/lib/transform/preprocessor/tree.js.map +0 -1
  875. package/lib/transform/preprocessor/voronoi.d.ts +0 -4
  876. package/lib/transform/preprocessor/voronoi.js +0 -24
  877. package/lib/transform/preprocessor/voronoi.js.map +0 -1
  878. package/lib/transform/preprocessor/wordCloud.d.ts +0 -6
  879. package/lib/transform/preprocessor/wordCloud.js +0 -112
  880. package/lib/transform/preprocessor/wordCloud.js.map +0 -1
  881. package/lib/transform/statistic/Select.js.map +0 -1
  882. package/lib/transform/statistic/SelectX.js.map +0 -1
  883. package/lib/transform/statistic/SelectY.js.map +0 -1
  884. package/lib/transform/statistic/dodgeX.js.map +0 -1
  885. package/lib/transform/statistic/groupX.js.map +0 -1
  886. package/lib/transform/statistic/jitter.js.map +0 -1
  887. package/lib/transform/statistic/jitterY.js.map +0 -1
  888. package/lib/transform/statistic/normalizeY.js.map +0 -1
  889. package/lib/transform/statistic/stackEnter.js.map +0 -1
  890. package/lib/transform/statistic/stackY.js.map +0 -1
  891. package/lib/transform/statistic/symmetryY.js.map +0 -1
  892. package/lib/transform/statistic/utils.js.map +0 -1
  893. package/lib/transform/utils/arc/arc.js.map +0 -1
  894. package/lib/transform/utils/arc/index.js.map +0 -1
  895. package/lib/transform/utils/arc/sort.js.map +0 -1
  896. package/lib/transform/utils/arc/types.js.map +0 -1
  897. package/lib/transform/utils/d3-cloud/index.js.map +0 -1
  898. package/lib/transform/utils/d3-sankey/align.js.map +0 -1
  899. package/lib/transform/utils/d3-sankey/constant.js.map +0 -1
  900. package/lib/transform/utils/d3-sankey/index.js.map +0 -1
  901. package/lib/transform/utils/d3-sankey/sankey.js.map +0 -1
  902. package/lib/transform/utils/flow.js.map +0 -1
  903. package/lib/transform/utils/memo.js.map +0 -1
  904. package/src/spec/statistic.ts +0 -135
  905. package/src/transform/inference/maybeArrayField.ts +0 -55
  906. package/src/transform/inference/maybeKey.ts +0 -29
  907. package/src/transform/inference/maybeSeries.ts +0 -26
  908. package/src/transform/inference/maybeSize.ts +0 -18
  909. package/src/transform/inference/maybeTitleX.ts +0 -26
  910. package/src/transform/inference/maybeTooltip.ts +0 -35
  911. package/src/transform/inference/maybeZeroX.ts +0 -18
  912. package/src/transform/inference/maybeZeroY.ts +0 -18
  913. package/src/transform/inference/maybeZeroY1.ts +0 -18
  914. package/src/transform/preprocessor/arc.ts +0 -21
  915. package/src/transform/preprocessor/cluster.ts +0 -56
  916. package/src/transform/preprocessor/connector.ts +0 -22
  917. package/src/transform/preprocessor/fetch.ts +0 -32
  918. package/src/transform/preprocessor/filterBy.ts +0 -24
  919. package/src/transform/preprocessor/fold.ts +0 -32
  920. package/src/transform/preprocessor/sankey.ts +0 -105
  921. package/src/transform/preprocessor/tree.ts +0 -12
  922. package/src/transform/preprocessor/voronoi.ts +0 -30
  923. package/src/transform/preprocessor/wordCloud.ts +0 -115
@@ -12,28 +12,26 @@ var __rest = (this && this.__rest) || function (s, e) {
12
12
  };
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
14
  exports.SymmetryY = void 0;
15
+ const util_1 = require("@antv/util");
15
16
  const d3_array_1 = require("d3-array");
16
- const helper_1 = require("../utils/helper");
17
- const utils_1 = require("./utils");
17
+ const helper_1 = require("./utils/helper");
18
+ const order_1 = require("./utils/order");
18
19
  /**
19
20
  * The SymmetryY transform apply offset for y channels, say to transform
20
21
  * them to be symmetry.
21
22
  */
22
23
  const SymmetryY = (options = {}) => {
23
24
  const { groupBy = 'x' } = options;
24
- return (0, helper_1.merge)((context) => {
25
- const { I, data, encode, columnOf } = context;
25
+ return (I, mark) => {
26
+ const { encode } = mark;
26
27
  const { x } = encode, rest = __rest(encode, ["x"]);
27
28
  // Extract and create new channels starts with y, such as y, y1.
28
29
  const Yn = Object.entries(rest)
29
30
  .filter(([k]) => k.startsWith('y'))
30
- .map(([k, encode]) => [k, columnOf(data, encode)]);
31
- const newYn = Yn.map(([k, V]) => {
32
- const newV = new Array(I.length);
33
- return [k, (0, helper_1.field)(newV, V)];
34
- });
31
+ .map(([k]) => [k, (0, helper_1.columnOf)(encode, k)[0]]);
32
+ const newYn = Yn.map(([k]) => [k, new Array(I.length)]);
35
33
  // Group marks into series by specified keys.
36
- const groups = (0, utils_1.createGroups)(groupBy, context);
34
+ const groups = (0, order_1.createGroups)(groupBy, I, mark);
37
35
  const MY = new Array(groups.length);
38
36
  for (let i = 0; i < groups.length; i++) {
39
37
  const I = groups[i];
@@ -53,13 +51,14 @@ const SymmetryY = (options = {}) => {
53
51
  }
54
52
  }
55
53
  }
56
- return {
57
- encode: Object.fromEntries(newYn.map(([k, v]) => [k, (0, helper_1.column)(v)])),
58
- };
59
- });
54
+ return [
55
+ I,
56
+ (0, util_1.deepMix)({}, mark, {
57
+ encode: Object.fromEntries(newYn.map(([k, v]) => [k, (0, helper_1.column)(v, (0, helper_1.columnOf)(encode, k)[1])])),
58
+ }),
59
+ ];
60
+ };
60
61
  };
61
62
  exports.SymmetryY = SymmetryY;
62
- exports.SymmetryY.props = {
63
- category: 'statistic',
64
- };
63
+ exports.SymmetryY.props = {};
65
64
  //# sourceMappingURL=symmetryY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"symmetryY.js","sourceRoot":"src/","sources":["transform/symmetryY.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qCAAqC;AACrC,uCAAkC;AAGlC,2CAAkD;AAClD,yCAA6C;AAI7C;;;GAGG;AACI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CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAC9D;aACF,CAAC;SACH,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC;AA5CW,QAAA,SAAS,aA4CpB;AAEF,iBAAS,CAAC,KAAK,GAAG,EAAE,CAAC"}
@@ -1,14 +1,15 @@
1
- import { Transform, Primitive, TransformContext, ColumnValue } from '../../runtime';
2
- export declare function applyDefaults<T>(source: Record<string, T>, defaults: Record<string, T>): {
3
- [x: string]: T;
4
- };
5
- export declare function merge(transform: (context: TransformContext) => Partial<TransformContext> | Promise<Partial<TransformContext>>): Transform;
6
- export declare function column(value: ColumnValue): {
1
+ import { Primitive } from '../../runtime';
2
+ export declare function column(value: Primitive[], field?: string): {
7
3
  type: string;
8
- value: ColumnValue;
4
+ value: Primitive[];
5
+ field: string;
9
6
  };
10
- export declare function constant(value: Primitive): {
7
+ export declare function visualColumn(value: Primitive[], field?: string): {
11
8
  type: string;
12
- value: Primitive;
9
+ value: Primitive[];
10
+ field: string;
11
+ visual: boolean;
13
12
  };
14
- export declare function field(target: ColumnValue, source: ColumnValue, formatter?: (d: any) => string): ColumnValue;
13
+ export declare function constant(I: number[], value: any): any[];
14
+ export declare function columnOf(encode: any, key: string): [Primitive[], string];
15
+ export declare function maybeColumnOf(encode: any, ...K: (string | Primitive[])[]): [Primitive[], string];
@@ -1,48 +1,42 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.field = exports.constant = exports.column = exports.merge = exports.applyDefaults = void 0;
13
- function applyDefaults(source, defaults) {
14
- var _a;
15
- const target = Object.assign({}, source);
16
- for (const [key, value] of Object.entries(defaults)) {
17
- target[key] = (_a = target[key]) !== null && _a !== void 0 ? _a : value;
18
- }
19
- return target;
20
- }
21
- exports.applyDefaults = applyDefaults;
22
- function merge(transform) {
23
- return (options) => __awaiter(this, void 0, void 0, function* () {
24
- const newOptions = yield transform(options);
25
- const { encode: newEncode } = newOptions;
26
- const { encode: oldEncode } = options;
27
- return Object.assign(Object.assign(Object.assign({}, options), newOptions), (newEncode && { encode: Object.assign(Object.assign({}, oldEncode), newEncode) }));
28
- });
29
- }
30
- exports.merge = merge;
31
- function column(value) {
3
+ exports.maybeColumnOf = exports.columnOf = exports.constant = exports.visualColumn = exports.column = void 0;
4
+ function column(value, field) {
32
5
  if (value === null)
33
6
  return undefined;
34
- return { type: 'column', value };
7
+ return { type: 'column', value, field };
35
8
  }
36
9
  exports.column = column;
37
- function constant(value) {
38
- return { type: 'constant', value };
10
+ function visualColumn(value, field) {
11
+ if (value === null)
12
+ return undefined;
13
+ return { type: 'column', value, field, visual: true };
14
+ }
15
+ exports.visualColumn = visualColumn;
16
+ function constant(I, value) {
17
+ return new Array(I.length).fill(value);
39
18
  }
40
19
  exports.constant = constant;
41
- function field(target, source, formatter) {
42
- if (!source)
43
- return target;
44
- target.field = formatter ? formatter(source.field) : source.field;
45
- return target;
20
+ function columnOf(encode, key) {
21
+ const channel = encode[key];
22
+ if (!channel)
23
+ return [null, null];
24
+ const { value, field = null } = channel;
25
+ return [value, field];
26
+ }
27
+ exports.columnOf = columnOf;
28
+ function maybeColumnOf(encode, ...K) {
29
+ for (const key of K) {
30
+ if (typeof key === 'string') {
31
+ const [KV, fv] = columnOf(encode, key);
32
+ if (KV !== null)
33
+ return [KV, fv];
34
+ }
35
+ else {
36
+ return [key, null];
37
+ }
38
+ }
39
+ return [null, null];
46
40
  }
47
- exports.field = field;
41
+ exports.maybeColumnOf = maybeColumnOf;
48
42
  //# sourceMappingURL=helper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helper.js","sourceRoot":"src/","sources":["transform/utils/helper.ts"],"names":[],"mappings":";;;;;;;;;;;;AAOA,SAAgB,aAAa,CAC3B,MAAyB,EACzB,QAA2B;;IAE3B,MAAM,MAAM,qBAAQ,MAAM,CAAE,CAAC;IAC7B,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;QACnD,MAAM,CAAC,GAAG,CAAC,GAAG,MAAA,MAAM,CAAC,GAAG,CAAC,mCAAI,KAAK,CAAC;KACpC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AATD,sCASC;AAED,SAAgB,KAAK,CACnB,SAEmE;IAEnE,OAAO,CAAO,OAAO,EAAE,EAAE;QACvB,MAAM,UAAU,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,CAAC;QAC5C,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,UAAU,CAAC;QACzC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;QACtC,qDACK,OAAO,GACP,UAAU,GAEV,CAAC,SAAS,IAAI,EAAE,MAAM,kCAAO,SAAS,GAAK,SAAS,CAAE,EAAE,CAAC,EAC5D;IACJ,CAAC,CAAA,CAAC;AACJ,CAAC;AAhBD,sBAgBC;AAED,SAAgB,MAAM,CAAC,KAAkB;IACvC,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IACrC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AACnC,CAAC;AAHD,wBAGC;AAED,SAAgB,QAAQ,CAAC,KAAgB;IACvC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC;AACrC,CAAC;AAFD,4BAEC;AAED,SAAgB,KAAK,CACnB,MAAmB,EACnB,MA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aAAa,CAC3B,MAAM,EACN,GAAG,CAA2B;IAE9B,KAAK,MAAM,GAAG,IAAI,CAAC,EAAE;QACnB,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;YAC3B,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;YACvC,IAAI,EAAE,KAAK,IAAI;gBAAE,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;SAClC;aAAM;YACL,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;SACpB;KACF;IACD,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AACtB,CAAC;AAbD,sCAaC"}
@@ -1,9 +1,9 @@
1
1
  import { Primitive } from 'd3-array';
2
- import { TransformContext, TabularData, ColumnValue } from '../../runtime';
3
- export declare type IndexComparatorFactory = (data: TabularData, Y: ColumnValue, S: ColumnValue) => IndexComparator;
2
+ import { TabularData, G2Mark } from '../../runtime';
3
+ export declare type IndexComparatorFactory = (data: TabularData, Y: Primitive[], S: Primitive[]) => IndexComparator;
4
4
  export declare type IndexComparator = (i: number, j: number) => number;
5
5
  export declare type Order = 'value' | 'sum' | 'series' | 'maxIndex' | string[] | ((data: Record<string, Primitive>) => Primitive);
6
- export declare function createGroups(groupBy: string | string[], context: TransformContext): number[][];
6
+ export declare function createGroups(groupBy: string | string[], I: number[], mark: G2Mark): number[][];
7
7
  export declare function normalizeComparator(order: Order): IndexComparatorFactory;
8
8
  export declare function applyOrder(groups: number[][], comparator: IndexComparator): void;
9
- export declare function domainOf(value: ColumnValue, scale: Record<string, any>): any;
9
+ export declare function domainOf(value: Primitive[], scale: Record<string, any>): any;
@@ -2,12 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.domainOf = exports.applyOrder = exports.normalizeComparator = exports.createGroups = void 0;
4
4
  const d3_array_1 = require("d3-array");
5
+ const helper_1 = require("../../utils/helper");
5
6
  const array_1 = require("../../utils/array");
6
- function createGroups(groupBy, context) {
7
- const { columnOf, encode, data, I } = context;
7
+ const helper_2 = require("./helper");
8
+ function createGroups(groupBy, I, mark) {
9
+ const { encode } = mark;
8
10
  const G = normalizeGroupBy(groupBy)
9
- .map((k) => [k, columnOf(data, encode[k])])
10
- .filter(([, v]) => v !== null);
11
+ .map((k) => { var _a; return [k, (_a = (0, helper_2.columnOf)(encode, k)) === null || _a === void 0 ? void 0 : _a[0]]; })
12
+ .filter(([, column]) => (0, helper_1.defined)(column));
11
13
  const key = (i) => G.map(([, V]) => V[i]).join('-');
12
14
  return Array.from((0, d3_array_1.group)(I, key).values());
13
15
  }
@@ -74,4 +76,4 @@ function createMaxIndexOrder(data, Y, S) {
74
76
  function ascendingComparator(order) {
75
77
  return (i, j) => (0, d3_array_1.ascending)(order(i), order(j));
76
78
  }
77
- //# sourceMappingURL=utils.js.map
79
+ //# sourceMappingURL=order.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"order.js","sourceRoot":"src/","sources":["transform/utils/order.ts"],"names":[],"mappings":";;;AAAA,uCAAiE;AACjE,+CAA6C;AAE7C,6CAA4C;AAC5C,qCAAoC;AAkBpC,SAAgB,YAAY,CAC1B,OAA0B,EAC1B,CAAW,EACX,IAAY;IAEZ,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACxB,MAAM,CAAC,GAAG,gBAAgB,CAAC,OAAO,CAAC;SAChC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,WAAC,OAAA,CAAC,CAAC,EAAE,MAAA,IAAA,iBAAQ,EAAC,MAAM,EAAE,CAAC,CAAC,0CAAG,CAAC,CAAC,CAAU,CAAA,EAAA,CAAC;SAClD,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,IAAA,gBAAO,EAAC,MAAM,CAAC,CAAC,CAAC;IAC3C,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,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,KAAyB;IACpD,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,IAAA,oBAAS,EAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACjD,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { Coordinate } from '@antv/coord';
2
2
  export declare function isTranspose(coordinate: Coordinate): boolean;
3
3
  export declare function isPolar(coordinate: Coordinate): boolean;
4
+ export declare function isHelix(coordinate: Coordinate): boolean;
4
5
  export declare function isParallel(coordinate: Coordinate): boolean;
5
6
  export declare function isFisheye(coordinate: Coordinate): boolean;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isFisheye = exports.isParallel = exports.isPolar = exports.isTranspose = void 0;
3
+ exports.isFisheye = exports.isParallel = exports.isHelix = exports.isPolar = exports.isTranspose = void 0;
4
4
  function isTranspose(coordinate) {
5
5
  const { transformations } = coordinate.getOptions();
6
6
  const transposes = transformations
@@ -14,6 +14,11 @@ function isPolar(coordinate) {
14
14
  return transformations.some(([type]) => type === 'polar');
15
15
  }
16
16
  exports.isPolar = isPolar;
17
+ function isHelix(coordinate) {
18
+ const { transformations } = coordinate.getOptions();
19
+ return transformations.some(([type]) => type === 'helix');
20
+ }
21
+ exports.isHelix = isHelix;
17
22
  function isParallel(coordinate) {
18
23
  const { transformations } = coordinate.getOptions();
19
24
  return transformations.some(([type]) => type === 'parallel');
@@ -1 +1 @@
1
- {"version":3,"file":"coordinate.js","sourceRoot":"src/","sources":["utils/coordinate.ts"],"names":[],"mappings":";;;AAEA,SAAgB,WAAW,CAAC,UAAsB;IAChD,MAAM,EAAE,eAAe,EAAE,GAAG,UAAU,CAAC,UAAU,EAAE,CAAC;IACpD,MAAM,UAAU,GAAG,eAAe;SAC/B,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC;SACrB,MAAM,CAAC,CAAC,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,CAAC,KAAK,CAAC,CAAC;AACrC,CAAC;AAND,kCAMC;AAED,SAAgB,OAAO,CAAC,UAAsB;IAC5C,MAAM,EAAE,eAAe,EAAE,GAAG,UAAU,CAAC,UAAU,EAAE,CAAC;IACpD,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC;AAC5D,CAAC;AAHD,0BAGC;AAED,SAAgB,OAAO,CAAC,UAAsB;IAC5C,MAAM,EAAE,eAAe,EAAE,GAAG,UAAU,CAAC,UAAU,EAAE,CAAC;IACpD,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC;AAC5D,CAAC;AAHD,0BAGC;AAED,SAAgB,UAAU,CAAC,UAAsB;IAC/C,MAAM,EAAE,eAAe,EAAE,GAAG,UAAU,CAAC,UAAU,EAAE,CAAC;IACpD,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC;AAC/D,CAAC;AAHD,gCAGC;AAED,SAAgB,SAAS,CAAC,UAAsB;IAC9C,MAAM,EAAE,eAAe,EAAE,GAAG,UAAU,CAAC,UAAU,EAAE,CAAC;IACpD,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC;AAC9D,CAAC;AAHD,8BAGC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/g2",
3
- "version": "5.0.0-alpha.0",
3
+ "version": "5.0.0-alpha.1",
4
4
  "description": "the Grammar of Graphics in Javascript",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",
@@ -53,7 +53,7 @@
53
53
  "cross-env": "^7.0.3",
54
54
  "eslint": "^7.22.0",
55
55
  "eslint-plugin-import": "^2.22.1",
56
- "genji-notebook": "^0.1.0",
56
+ "genji-notebook": "^0.1.1",
57
57
  "husky": "^7.0.0",
58
58
  "jest": "^26.0.1",
59
59
  "jest-electron": "^0.1.12",
@@ -103,10 +103,11 @@
103
103
  },
104
104
  "dependencies": {
105
105
  "@antv/coord": "^0.4.1",
106
- "@antv/g": "^5.0.20",
107
- "@antv/g-canvas": "^1.0.13",
108
- "@antv/g-plugin-dragndrop": "^1.5.1",
106
+ "@antv/g": "^5.7.4",
107
+ "@antv/g-canvas": "^1.7.4",
108
+ "@antv/g-plugin-dragndrop": "^1.6.1",
109
109
  "@antv/gui": "^0.4.3-alpha.5",
110
+ "@antv/path-util": "^3.0.1",
110
111
  "@antv/scale": "^0.4.7",
111
112
  "@antv/util": "^2.0.17",
112
113
  "d3-array": "^3.1.1",
@@ -10,16 +10,14 @@ export type FadeInOptions = Animation;
10
10
  export const FadeIn: AC<FadeInOptions> = (options) => {
11
11
  return (from, to, value, coordinate, defaults) => {
12
12
  const [shape] = from;
13
- // shape.animate() can not process `opacity = ""`;
14
- // todo: When G's bug fixed, modify to `shape.style`.
15
- const { fillOpacity, strokeOpacity, opacity } = shape.parsedStyle;
13
+ const { fillOpacity, strokeOpacity, opacity } = shape.style;
16
14
 
17
15
  const keyframes = [
18
16
  { fillOpacity: 0, strokeOpacity: 0, opacity: 0 },
19
17
  {
20
- fillOpacity: fillOpacity.value,
21
- strokeOpacity: strokeOpacity.value,
22
- opacity: opacity.value,
18
+ fillOpacity,
19
+ strokeOpacity,
20
+ opacity,
23
21
  },
24
22
  ];
25
23
 
@@ -10,12 +10,12 @@ export type FadeOutOptions = Animation;
10
10
  export const FadeOut: AC<FadeOutOptions> = (options) => {
11
11
  return (from, to, value, coordinate, defaults) => {
12
12
  const [shape] = from;
13
- const { fillOpacity, strokeOpacity, opacity } = shape.parsedStyle;
13
+ const { fillOpacity, strokeOpacity, opacity } = shape.style;
14
14
  const keyframes = [
15
15
  {
16
- fillOpacity: fillOpacity.value,
17
- strokeOpacity: strokeOpacity.value,
18
- opacity: opacity.value,
16
+ fillOpacity,
17
+ strokeOpacity,
18
+ opacity,
19
19
  },
20
20
  { fillOpacity: 0, strokeOpacity: 0, opacity: 0 },
21
21
  ];
@@ -158,15 +158,14 @@ function multipleToOne(
158
158
  split: SplitFunction,
159
159
  ) {
160
160
  const D = split(to, from.length);
161
- // @todo Replace with to.style.
162
- const { fillOpacity, strokeOpacity, opacity } = to.parsedStyle;
161
+ const { fillOpacity, strokeOpacity, opacity } = to.style;
163
162
  const keyframes = [
164
163
  { fillOpacity: 0, strokeOpacity: 0, opacity: 0 },
165
164
  { fillOpacity: 0, strokeOpacity: 0, opacity: 0, offset: 0.99 },
166
165
  {
167
- fillOpacity: fillOpacity.value,
168
- strokeOpacity: strokeOpacity.value,
169
- opacity: opacity.value,
166
+ fillOpacity,
167
+ strokeOpacity,
168
+ opacity,
170
169
  },
171
170
  ];
172
171
  const animation = to.animate(keyframes, timeEffect);
@@ -16,8 +16,12 @@ export const ScaleInX: AC<ScaleInXOptions> = (options) => {
16
16
  return (from, to, value, coordinate, defaults) => {
17
17
  const [shape] = from;
18
18
  const { height } = shape.getBoundingClientRect();
19
- const { transform: prefix } = shape.style;
20
- const { fillOpacity, strokeOpacity, opacity } = shape.parsedStyle;
19
+ const {
20
+ transform: prefix,
21
+ fillOpacity,
22
+ strokeOpacity,
23
+ opacity,
24
+ } = shape.style;
21
25
  const [transformOrigin, transform]: [[number, number], string] =
22
26
  isTranspose(coordinate)
23
27
  ? [[0, height], `scale(1, ${ZERO})`] // left-bottom corner
@@ -34,9 +38,9 @@ export const ScaleInX: AC<ScaleInXOptions> = (options) => {
34
38
  },
35
39
  {
36
40
  transform: `${prefix} ${transform}`.trimStart(),
37
- fillOpacity: fillOpacity.value,
38
- strokeOpacity: strokeOpacity.value,
39
- opacity: opacity.value,
41
+ fillOpacity,
42
+ strokeOpacity,
43
+ opacity,
40
44
  offset: 0.01,
41
45
  },
42
46
  {
@@ -16,8 +16,12 @@ export const ScaleInY: AC<ScaleInYOptions> = (options) => {
16
16
  return (from, to, value, coordinate, defaults) => {
17
17
  const [shape] = from;
18
18
  const { height } = shape.getBoundingClientRect();
19
- const { transform: prefix } = shape.style;
20
- const { fillOpacity, strokeOpacity, opacity } = shape.parsedStyle;
19
+ const {
20
+ transform: prefix,
21
+ fillOpacity,
22
+ strokeOpacity,
23
+ opacity,
24
+ } = shape.style;
21
25
  const [transformOrigin, transform]: [[number, number], string] =
22
26
  isTranspose(coordinate)
23
27
  ? [[0, 0], `scale(${ZERO}, 1)`] // left-top corner
@@ -34,9 +38,9 @@ export const ScaleInY: AC<ScaleInYOptions> = (options) => {
34
38
  },
35
39
  {
36
40
  transform: `${prefix} ${transform}`.trimStart(),
37
- fillOpacity: fillOpacity.value,
38
- strokeOpacity: strokeOpacity.value,
39
- opacity: opacity.value,
41
+ fillOpacity,
42
+ strokeOpacity,
43
+ opacity,
40
44
  offset: 0.01,
41
45
  },
42
46
  {
@@ -16,8 +16,12 @@ export const ScaleOutX: AC<ScaleOutXOptions> = (options) => {
16
16
  return (from, to, value, coordinate, defaults) => {
17
17
  const [shape] = from;
18
18
  const { height } = shape.getBoundingClientRect();
19
- const { transform: prefix } = shape.style;
20
- const { fillOpacity, strokeOpacity, opacity } = shape.parsedStyle;
19
+ const {
20
+ transform: prefix,
21
+ fillOpacity,
22
+ strokeOpacity,
23
+ opacity,
24
+ } = shape.style;
21
25
  const [transformOrigin, transform]: [[number, number], string] =
22
26
  isTranspose(coordinate)
23
27
  ? [[0, height], `scale(1, ${ZERO})`] // left-bottom corner
@@ -31,9 +35,9 @@ export const ScaleOutX: AC<ScaleOutXOptions> = (options) => {
31
35
  },
32
36
  {
33
37
  transform: `${prefix} ${transform}`.trimStart(),
34
- fillOpacity: fillOpacity.value,
35
- strokeOpacity: strokeOpacity.value,
36
- opacity: opacity.value,
38
+ fillOpacity,
39
+ strokeOpacity,
40
+ opacity,
37
41
  offset: 0.99,
38
42
  },
39
43
  {
@@ -16,8 +16,12 @@ export const ScaleOutY: AC<ScaleOutYOptions> = (options) => {
16
16
  return (from, to, value, coordinate, defaults) => {
17
17
  const [shape] = from;
18
18
  const { height } = shape.getBoundingClientRect();
19
- const { transform: prefix } = shape.style;
20
- const { fillOpacity, strokeOpacity, opacity } = shape.parsedStyle;
19
+ const {
20
+ transform: prefix,
21
+ fillOpacity,
22
+ strokeOpacity,
23
+ opacity,
24
+ } = shape.style;
21
25
  const [transformOrigin, transform]: [[number, number], string] =
22
26
  isTranspose(coordinate)
23
27
  ? [[0, 0], `scale(${ZERO}, 1)`] // left-top corner
@@ -31,9 +35,9 @@ export const ScaleOutY: AC<ScaleOutYOptions> = (options) => {
31
35
  },
32
36
  {
33
37
  transform: `${prefix} ${transform}`.trimStart(),
34
- fillOpacity: fillOpacity.value,
35
- strokeOpacity: strokeOpacity.value,
36
- opacity: opacity.value,
38
+ fillOpacity,
39
+ strokeOpacity,
40
+ opacity,
37
41
  offset: 0.99,
38
42
  },
39
43
  {
package/src/api/chart.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { clone } from '@antv/util';
2
- import { render } from '../runtime';
2
+ import { G2Context, render } from '../runtime';
3
3
  import { ViewComposition } from '../spec';
4
4
  import { Node } from './node';
5
5
  import {
@@ -16,6 +16,7 @@ import {
16
16
  } from './types';
17
17
  import { mark, Mark } from './mark';
18
18
  import { composition, Composition } from './composition';
19
+ import { library } from './library';
19
20
 
20
21
  function normalizeContainer(container: string | HTMLElement): HTMLElement {
21
22
  if (container === undefined) return document.createElement('div');
@@ -100,17 +101,23 @@ export const props: NodePropertyDescriptor[] = [
100
101
 
101
102
  @defineProps(props)
102
103
  export class Chart extends Node<ChartOptions> {
103
- private container: HTMLElement;
104
+ private _container: HTMLElement;
105
+
106
+ private _context: G2Context;
104
107
 
105
108
  constructor(options: ChartOptions = {}) {
106
109
  const { container, ...rest } = options;
107
110
  super(rest, 'view');
108
- this.container = normalizeContainer(container);
111
+ this._container = normalizeContainer(container);
112
+ this._context = { library };
109
113
  }
110
114
 
111
- render() {
112
- const node = render(optionsOf(this));
113
- this.container.append(node);
115
+ render(): Chart {
116
+ const options = optionsOf(this);
117
+ const node = render(options, this._context);
118
+ if (node.parentNode !== this._container) {
119
+ this._container.append(node);
120
+ }
114
121
  return this;
115
122
  }
116
123
 
@@ -118,7 +125,11 @@ export class Chart extends Node<ChartOptions> {
118
125
  return optionsOf(this);
119
126
  }
120
127
 
121
- node() {
122
- return this.container;
128
+ node(): HTMLElement {
129
+ return this._container;
130
+ }
131
+
132
+ context(): G2Context {
133
+ return this._context;
123
134
  }
124
135
  }
package/src/api/index.ts CHANGED
@@ -1 +1,2 @@
1
1
  export { Chart } from './chart';
2
+ export { register } from './library';
@@ -0,0 +1,12 @@
1
+ import { createLibrary } from '../stdlib';
2
+ import { G2ComponentNamespaces, G2Component } from '../runtime';
3
+
4
+ export const library = createLibrary();
5
+
6
+ // @todo Warn if override existing key.
7
+ export function register(
8
+ key: `${G2ComponentNamespaces}.${any}`,
9
+ component: G2Component,
10
+ ) {
11
+ Object.assign(library, { [key]: component });
12
+ }
@@ -85,6 +85,7 @@ export const Circle: CC<CircleComposition> = () => {
85
85
  .call(setEncode)
86
86
  .call(inferColor)
87
87
  .call(setCoordinate)
88
+ .call(setData)
88
89
  .call(
89
90
  setChildren,
90
91
  subLayoutCircle,
@@ -92,7 +93,6 @@ export const Circle: CC<CircleComposition> = () => {
92
93
  createGuideCircle,
93
94
  { frame: false },
94
95
  )
95
- .call(setData)
96
96
  .call(setAnimation)
97
97
  .call(setStyle)
98
98
  .call(setScale)
@@ -1,5 +1,6 @@
1
1
  import { CompositionComponent as CC } from '../runtime';
2
2
  import { FlexComposition } from '../spec';
3
+ import { mergeData } from './utils';
3
4
 
4
5
  export type FlexOptions = Omit<FlexComposition, 'type'>;
5
6
 
@@ -29,13 +30,14 @@ export const Flex: CC<FlexOptions> = () => {
29
30
  const newChildren = [];
30
31
  let next = options[mainStart] || 0;
31
32
  for (let i = 0; i < sizes.length; i += 1) {
32
- const { data = flexData, ...rest } = children[i];
33
+ const { data, ...rest } = children[i];
34
+ const newData = mergeData(data, flexData);
33
35
  newChildren.push({
34
36
  [mainStart]: next,
35
37
  [mainSize]: sizes[i],
36
38
  [crossStart]: options[crossStart] || 0,
37
39
  [crossSize]: options[crossSize],
38
- data,
40
+ data: newData,
39
41
  ...rest,
40
42
  });
41
43
  next += sizes[i] + padding;
@@ -1,5 +1,6 @@
1
1
  import { CompositionComponent as CC } from '../runtime';
2
2
  import { LayerComposition } from '../spec';
3
+ import { mergeData } from './utils';
3
4
 
4
5
  export type LayerOptions = Omit<LayerComposition, 'type'>;
5
6
 
@@ -11,9 +12,9 @@ export const Layer: CC<LayerOptions> = () => {
11
12
  const { children } = options;
12
13
  if (!Array.isArray(children)) return [];
13
14
  const { x = 0, y = 0, width, height, data: layerData } = options;
14
- return children.map(({ data = layerData, ...rest }) => ({
15
+ return children.map(({ data, ...rest }) => ({
15
16
  ...rest,
16
- data,
17
+ data: mergeData(data, layerData),
17
18
  x,
18
19
  y,
19
20
  width,
@@ -23,8 +23,10 @@ export const Mark: CC<MarkOptions> = () => {
23
23
  key,
24
24
  frame,
25
25
  title,
26
+ labelLayout,
26
27
  ...mark
27
28
  } = options;
29
+
28
30
  return [
29
31
  {
30
32
  type: 'standardView',
@@ -43,6 +45,7 @@ export const Mark: CC<MarkOptions> = () => {
43
45
  interaction,
44
46
  frame,
45
47
  title,
48
+ labelLayout,
46
49
  marks: [{ ...mark, key: `${key}-0`, data }],
47
50
  },
48
51
  ];