@antv/g2 5.0.0-alpha.1 → 5.0.0-alpha.2

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 (477) hide show
  1. package/dist/g2-lite.min.js +10 -0
  2. package/dist/g2.min.js +3 -3
  3. package/esm/adjust/index.d.ts +2 -1
  4. package/esm/adjust/index.js.map +1 -1
  5. package/esm/animation/index.d.ts +14 -7
  6. package/esm/animation/index.js.map +1 -1
  7. package/esm/animation/scaleInX.js +3 -0
  8. package/esm/animation/scaleInX.js.map +1 -1
  9. package/esm/animation/scaleInY.js +3 -0
  10. package/esm/animation/scaleInY.js.map +1 -1
  11. package/esm/api/chart.d.ts +4 -0
  12. package/esm/api/chart.js +20 -3
  13. package/esm/api/chart.js.map +1 -1
  14. package/esm/api/mark/index.d.ts +3 -3
  15. package/esm/api/mark/index.js +2 -2
  16. package/esm/api/mark/index.js.map +1 -1
  17. package/esm/api/mark/mark.d.ts +4 -4
  18. package/esm/api/mark/mark.js +6 -5
  19. package/esm/api/mark/mark.js.map +1 -1
  20. package/esm/api/mark/types.d.ts +1 -0
  21. package/esm/api/node.d.ts +4 -5
  22. package/esm/api/node.js +5 -7
  23. package/esm/api/node.js.map +1 -1
  24. package/esm/api/props.d.ts +1 -0
  25. package/esm/api/props.js +10 -10
  26. package/esm/api/props.js.map +1 -1
  27. package/esm/component/axis.d.ts +1 -1
  28. package/esm/component/axis.js +11 -4
  29. package/esm/component/axis.js.map +1 -1
  30. package/esm/component/index.d.ts +10 -5
  31. package/esm/component/index.js.map +1 -1
  32. package/esm/composition/index.d.ts +16 -8
  33. package/esm/composition/index.js.map +1 -1
  34. package/esm/composition/rect.js +1 -1
  35. package/esm/composition/rect.js.map +1 -1
  36. package/esm/coordinate/index.d.ts +24 -12
  37. package/esm/coordinate/index.js.map +1 -1
  38. package/esm/data/arc.d.ts +7 -0
  39. package/esm/data/arc.js +10 -18
  40. package/esm/data/arc.js.map +1 -1
  41. package/esm/data/cluster.d.ts +8 -0
  42. package/esm/data/cluster.js +36 -46
  43. package/esm/data/cluster.js.map +1 -1
  44. package/esm/data/custom.d.ts +7 -0
  45. package/esm/data/custom.js +10 -0
  46. package/esm/data/custom.js.map +1 -0
  47. package/esm/data/fetch.js +7 -6
  48. package/esm/data/fetch.js.map +1 -1
  49. package/esm/data/filterBy.js +6 -2
  50. package/esm/data/filterBy.js.map +1 -1
  51. package/esm/data/index.d.ts +28 -9
  52. package/esm/data/index.js +6 -1
  53. package/esm/data/index.js.map +1 -1
  54. package/esm/data/map.d.ts +7 -0
  55. package/esm/data/map.js +10 -0
  56. package/esm/data/map.js.map +1 -0
  57. package/esm/data/sankey.d.ts +8 -0
  58. package/esm/data/sankey.js +76 -95
  59. package/esm/data/sankey.js.map +1 -1
  60. package/esm/data/sortBy.js +14 -4
  61. package/esm/data/sortBy.js.map +1 -1
  62. package/esm/data/tree.d.ts +4 -0
  63. package/esm/data/tree.js +6 -9
  64. package/esm/data/tree.js.map +1 -1
  65. package/esm/data/utils/arc/index.d.ts +1 -1
  66. package/esm/data/utils/fields.d.ts +6 -0
  67. package/esm/data/utils/fields.js +15 -0
  68. package/esm/data/utils/fields.js.map +1 -0
  69. package/esm/data/voronoi.d.ts +1 -0
  70. package/esm/data/voronoi.js +1 -22
  71. package/esm/data/voronoi.js.map +1 -1
  72. package/esm/data/wordCloud.d.ts +1 -0
  73. package/esm/data/wordCloud.js +1 -93
  74. package/esm/data/wordCloud.js.map +1 -1
  75. package/esm/encode/index.d.ts +8 -4
  76. package/esm/encode/index.js.map +1 -1
  77. package/esm/interaction/action/index.d.ts +42 -21
  78. package/esm/interaction/action/index.js +8 -8
  79. package/esm/interaction/action/index.js.map +1 -1
  80. package/esm/interaction/index.d.ts +1 -1
  81. package/esm/interaction/index.js +0 -1
  82. package/esm/interaction/index.js.map +1 -1
  83. package/esm/interaction/interactor/index.d.ts +4 -2
  84. package/esm/interaction/interactor/index.js.map +1 -1
  85. package/esm/mark/annotation/index.d.ts +14 -7
  86. package/esm/mark/annotation/index.js +6 -6
  87. package/esm/mark/annotation/index.js.map +1 -1
  88. package/esm/mark/geometry/{schema.d.ts → box.d.ts} +4 -4
  89. package/esm/mark/geometry/{schema.js → box.js} +4 -4
  90. package/esm/mark/geometry/box.js.map +1 -0
  91. package/esm/mark/geometry/image.js +5 -4
  92. package/esm/mark/geometry/image.js.map +1 -1
  93. package/esm/mark/geometry/index.d.ts +22 -13
  94. package/esm/mark/geometry/index.js +1 -3
  95. package/esm/mark/geometry/index.js.map +1 -1
  96. package/esm/mark/geometry/interval.js +0 -1
  97. package/esm/mark/geometry/interval.js.map +1 -1
  98. package/esm/mark/geometry/line.js +5 -1
  99. package/esm/mark/geometry/line.js.map +1 -1
  100. package/esm/mark/geometry/link.js +1 -1
  101. package/esm/mark/geometry/link.js.map +1 -1
  102. package/esm/mark/geometry/point.js +6 -2
  103. package/esm/mark/geometry/point.js.map +1 -1
  104. package/esm/mark/geometry/polygon.js +1 -1
  105. package/esm/mark/geometry/polygon.js.map +1 -1
  106. package/esm/palette/index.d.ts +4 -2
  107. package/esm/palette/index.js.map +1 -1
  108. package/esm/runtime/component.d.ts +1 -1
  109. package/esm/runtime/component.js +8 -3
  110. package/esm/runtime/component.js.map +1 -1
  111. package/esm/runtime/mark.js +4 -3
  112. package/esm/runtime/mark.js.map +1 -1
  113. package/esm/runtime/plot.js +47 -28
  114. package/esm/runtime/plot.js.map +1 -1
  115. package/esm/runtime/render.js +15 -6
  116. package/esm/runtime/render.js.map +1 -1
  117. package/esm/runtime/scale.js +1 -1
  118. package/esm/runtime/scale.js.map +1 -1
  119. package/esm/runtime/types/component.d.ts +4 -6
  120. package/esm/runtime/types/options.d.ts +1 -0
  121. package/esm/scale/index.d.ts +22 -11
  122. package/esm/scale/index.js.map +1 -1
  123. package/esm/shape/annotation/text.js +16 -4
  124. package/esm/shape/annotation/text.js.map +1 -1
  125. package/esm/shape/{schema → box}/box.d.ts +0 -0
  126. package/esm/shape/{schema → box}/box.js +2 -2
  127. package/esm/shape/box/box.js.map +1 -0
  128. package/esm/shape/index.d.ts +86 -48
  129. package/esm/shape/index.js +9 -12
  130. package/esm/shape/index.js.map +1 -1
  131. package/esm/shape/label/label.js +62 -38
  132. package/esm/shape/label/label.js.map +1 -1
  133. package/esm/shape/{edge → link}/arc.d.ts +0 -0
  134. package/esm/shape/{edge → link}/arc.js +0 -0
  135. package/esm/shape/{edge → link}/arc.js.map +1 -1
  136. package/esm/shape/{edge → link}/smoothEdge.d.ts +0 -0
  137. package/esm/shape/{edge → link}/smoothEdge.js +0 -0
  138. package/esm/shape/{edge → link}/smoothEdge.js.map +1 -1
  139. package/esm/shape/{edge → link}/vhv.d.ts +0 -0
  140. package/esm/shape/{edge → link}/vhv.js +0 -0
  141. package/esm/shape/{edge → link}/vhv.js.map +1 -1
  142. package/esm/shape/{edge → polygon}/ribbon.d.ts +0 -0
  143. package/esm/shape/{edge → polygon}/ribbon.js +0 -0
  144. package/esm/shape/polygon/ribbon.js.map +1 -0
  145. package/esm/spec/data.d.ts +145 -8
  146. package/esm/spec/geometry.d.ts +5 -3
  147. package/esm/spec/transform.d.ts +18 -8
  148. package/esm/spec/transform.js +0 -133
  149. package/esm/spec/transform.js.map +1 -1
  150. package/esm/stdlib/index.js +13 -17
  151. package/esm/stdlib/index.js.map +1 -1
  152. package/esm/transform/dodgeX.js +7 -3
  153. package/esm/transform/dodgeX.js.map +1 -1
  154. package/esm/transform/flexX.d.ts +7 -0
  155. package/esm/transform/flexX.js +31 -0
  156. package/esm/transform/flexX.js.map +1 -0
  157. package/esm/transform/groupX.js +17 -19
  158. package/esm/transform/groupX.js.map +1 -1
  159. package/esm/transform/index.d.ts +46 -21
  160. package/esm/transform/index.js +3 -1
  161. package/esm/transform/index.js.map +1 -1
  162. package/esm/transform/normalizeY.js +1 -2
  163. package/esm/transform/normalizeY.js.map +1 -1
  164. package/esm/transform/sortX.d.ts +8 -0
  165. package/esm/transform/sortX.js +60 -0
  166. package/esm/transform/sortX.js.map +1 -0
  167. package/esm/transform/stackY.d.ts +1 -1
  168. package/esm/transform/stackY.js +26 -9
  169. package/esm/transform/stackY.js.map +1 -1
  170. package/esm/utils/coordinate.d.ts +1 -0
  171. package/esm/utils/coordinate.js +3 -0
  172. package/esm/utils/coordinate.js.map +1 -1
  173. package/lib/adjust/index.d.ts +2 -1
  174. package/lib/adjust/index.js.map +1 -1
  175. package/lib/animation/index.d.ts +14 -7
  176. package/lib/animation/index.js.map +1 -1
  177. package/lib/animation/scaleInX.js +3 -0
  178. package/lib/animation/scaleInX.js.map +1 -1
  179. package/lib/animation/scaleInY.js +3 -0
  180. package/lib/animation/scaleInY.js.map +1 -1
  181. package/lib/api/chart.d.ts +4 -0
  182. package/lib/api/chart.js +20 -3
  183. package/lib/api/chart.js.map +1 -1
  184. package/lib/api/mark/index.d.ts +3 -3
  185. package/lib/api/mark/index.js +1 -1
  186. package/lib/api/mark/index.js.map +1 -1
  187. package/lib/api/mark/mark.d.ts +4 -4
  188. package/lib/api/mark/mark.js +7 -6
  189. package/lib/api/mark/mark.js.map +1 -1
  190. package/lib/api/mark/types.d.ts +1 -0
  191. package/lib/api/node.d.ts +4 -5
  192. package/lib/api/node.js +5 -7
  193. package/lib/api/node.js.map +1 -1
  194. package/lib/api/props.d.ts +1 -0
  195. package/lib/api/props.js +10 -10
  196. package/lib/api/props.js.map +1 -1
  197. package/lib/component/axis.d.ts +1 -1
  198. package/lib/component/axis.js +11 -4
  199. package/lib/component/axis.js.map +1 -1
  200. package/lib/component/index.d.ts +10 -5
  201. package/lib/component/index.js.map +1 -1
  202. package/lib/composition/index.d.ts +16 -8
  203. package/lib/composition/index.js.map +1 -1
  204. package/lib/composition/rect.js +1 -1
  205. package/lib/composition/rect.js.map +1 -1
  206. package/lib/coordinate/index.d.ts +24 -12
  207. package/lib/coordinate/index.js.map +1 -1
  208. package/lib/data/arc.d.ts +7 -0
  209. package/lib/data/arc.js +14 -18
  210. package/lib/data/arc.js.map +1 -1
  211. package/lib/data/cluster.d.ts +8 -0
  212. package/lib/data/cluster.js +41 -46
  213. package/lib/data/cluster.js.map +1 -1
  214. package/lib/data/custom.d.ts +7 -0
  215. package/lib/data/custom.js +14 -0
  216. package/lib/data/custom.js.map +1 -0
  217. package/lib/data/fetch.js +6 -5
  218. package/lib/data/fetch.js.map +1 -1
  219. package/lib/data/filterBy.js +6 -2
  220. package/lib/data/filterBy.js.map +1 -1
  221. package/lib/data/index.d.ts +28 -9
  222. package/lib/data/index.js +13 -3
  223. package/lib/data/index.js.map +1 -1
  224. package/lib/data/map.d.ts +7 -0
  225. package/lib/data/map.js +14 -0
  226. package/lib/data/map.js.map +1 -0
  227. package/lib/data/sankey.d.ts +8 -0
  228. package/lib/data/sankey.js +80 -95
  229. package/lib/data/sankey.js.map +1 -1
  230. package/lib/data/sortBy.js +14 -4
  231. package/lib/data/sortBy.js.map +1 -1
  232. package/lib/data/tree.d.ts +4 -0
  233. package/lib/data/tree.js +10 -9
  234. package/lib/data/tree.js.map +1 -1
  235. package/lib/data/utils/arc/index.d.ts +1 -1
  236. package/lib/data/utils/fields.d.ts +6 -0
  237. package/lib/data/utils/fields.js +19 -0
  238. package/lib/data/utils/fields.js.map +1 -0
  239. package/lib/data/voronoi.d.ts +1 -0
  240. package/lib/data/voronoi.js +2 -22
  241. package/lib/data/voronoi.js.map +1 -1
  242. package/lib/data/wordCloud.d.ts +1 -0
  243. package/lib/data/wordCloud.js +2 -93
  244. package/lib/data/wordCloud.js.map +1 -1
  245. package/lib/encode/index.d.ts +8 -4
  246. package/lib/encode/index.js.map +1 -1
  247. package/lib/interaction/action/index.d.ts +42 -21
  248. package/lib/interaction/action/index.js.map +1 -1
  249. package/lib/interaction/index.d.ts +1 -1
  250. package/lib/interaction/index.js +0 -15
  251. package/lib/interaction/index.js.map +1 -1
  252. package/lib/interaction/interactor/index.d.ts +4 -2
  253. package/lib/interaction/interactor/index.js.map +1 -1
  254. package/lib/mark/annotation/index.d.ts +14 -7
  255. package/lib/mark/annotation/index.js.map +1 -1
  256. package/lib/mark/geometry/{schema.d.ts → box.d.ts} +4 -4
  257. package/lib/mark/geometry/{schema.js → box.js} +6 -6
  258. package/lib/mark/geometry/box.js.map +1 -0
  259. package/lib/mark/geometry/image.js +5 -4
  260. package/lib/mark/geometry/image.js.map +1 -1
  261. package/lib/mark/geometry/index.d.ts +22 -13
  262. package/lib/mark/geometry/index.js +3 -7
  263. package/lib/mark/geometry/index.js.map +1 -1
  264. package/lib/mark/geometry/interval.js +0 -1
  265. package/lib/mark/geometry/interval.js.map +1 -1
  266. package/lib/mark/geometry/line.js +5 -1
  267. package/lib/mark/geometry/line.js.map +1 -1
  268. package/lib/mark/geometry/link.js +1 -1
  269. package/lib/mark/geometry/link.js.map +1 -1
  270. package/lib/mark/geometry/point.js +6 -2
  271. package/lib/mark/geometry/point.js.map +1 -1
  272. package/lib/mark/geometry/polygon.js +1 -1
  273. package/lib/mark/geometry/polygon.js.map +1 -1
  274. package/lib/palette/index.d.ts +4 -2
  275. package/lib/palette/index.js.map +1 -1
  276. package/lib/runtime/component.d.ts +1 -1
  277. package/lib/runtime/component.js +8 -3
  278. package/lib/runtime/component.js.map +1 -1
  279. package/lib/runtime/mark.js +4 -3
  280. package/lib/runtime/mark.js.map +1 -1
  281. package/lib/runtime/plot.js +47 -28
  282. package/lib/runtime/plot.js.map +1 -1
  283. package/lib/runtime/render.js +15 -6
  284. package/lib/runtime/render.js.map +1 -1
  285. package/lib/runtime/scale.js +1 -1
  286. package/lib/runtime/scale.js.map +1 -1
  287. package/lib/runtime/types/component.d.ts +4 -6
  288. package/lib/runtime/types/options.d.ts +1 -0
  289. package/lib/scale/index.d.ts +22 -11
  290. package/lib/scale/index.js.map +1 -1
  291. package/lib/shape/annotation/text.js +16 -4
  292. package/lib/shape/annotation/text.js.map +1 -1
  293. package/lib/shape/{schema → box}/box.d.ts +0 -0
  294. package/lib/shape/{schema → box}/box.js +2 -2
  295. package/lib/shape/box/box.js.map +1 -0
  296. package/lib/shape/index.d.ts +86 -48
  297. package/lib/shape/index.js +10 -16
  298. package/lib/shape/index.js.map +1 -1
  299. package/lib/shape/label/label.js +61 -37
  300. package/lib/shape/label/label.js.map +1 -1
  301. package/lib/shape/{edge → link}/arc.d.ts +0 -0
  302. package/lib/shape/{edge → link}/arc.js +0 -0
  303. package/lib/shape/{edge → link}/arc.js.map +1 -1
  304. package/lib/shape/{edge → link}/smoothEdge.d.ts +0 -0
  305. package/lib/shape/{edge → link}/smoothEdge.js +0 -0
  306. package/lib/shape/{edge → link}/smoothEdge.js.map +1 -1
  307. package/lib/shape/{edge → link}/vhv.d.ts +0 -0
  308. package/lib/shape/{edge → link}/vhv.js +0 -0
  309. package/lib/shape/{edge → link}/vhv.js.map +1 -1
  310. package/lib/shape/{edge → polygon}/ribbon.d.ts +0 -0
  311. package/lib/shape/{edge → polygon}/ribbon.js +0 -0
  312. package/lib/shape/polygon/ribbon.js.map +1 -0
  313. package/lib/spec/data.d.ts +145 -8
  314. package/lib/spec/geometry.d.ts +5 -3
  315. package/lib/spec/transform.d.ts +18 -8
  316. package/lib/spec/transform.js +0 -133
  317. package/lib/spec/transform.js.map +1 -1
  318. package/lib/stdlib/index.js +9 -13
  319. package/lib/stdlib/index.js.map +1 -1
  320. package/lib/transform/dodgeX.js +7 -3
  321. package/lib/transform/dodgeX.js.map +1 -1
  322. package/lib/transform/flexX.d.ts +7 -0
  323. package/lib/transform/flexX.js +35 -0
  324. package/lib/transform/flexX.js.map +1 -0
  325. package/lib/transform/groupX.js +16 -18
  326. package/lib/transform/groupX.js.map +1 -1
  327. package/lib/transform/index.d.ts +46 -21
  328. package/lib/transform/index.js +5 -1
  329. package/lib/transform/index.js.map +1 -1
  330. package/lib/transform/normalizeY.js +0 -1
  331. package/lib/transform/normalizeY.js.map +1 -1
  332. package/lib/transform/sortX.d.ts +8 -0
  333. package/lib/transform/sortX.js +64 -0
  334. package/lib/transform/sortX.js.map +1 -0
  335. package/lib/transform/stackY.d.ts +1 -1
  336. package/lib/transform/stackY.js +26 -9
  337. package/lib/transform/stackY.js.map +1 -1
  338. package/lib/utils/coordinate.d.ts +1 -0
  339. package/lib/utils/coordinate.js +5 -1
  340. package/lib/utils/coordinate.js.map +1 -1
  341. package/package.json +19 -4
  342. package/src/.DS_Store +0 -0
  343. package/src/adjust/index.ts +2 -1
  344. package/src/animation/index.ts +15 -7
  345. package/src/animation/morphing.ts +1 -1
  346. package/src/animation/scaleInX.ts +3 -0
  347. package/src/animation/scaleInY.ts +3 -0
  348. package/src/api/chart.ts +40 -3
  349. package/src/api/mark/index.ts +3 -3
  350. package/src/api/mark/mark.ts +6 -5
  351. package/src/api/mark/types.ts +1 -0
  352. package/src/api/node.ts +5 -6
  353. package/src/api/props.ts +14 -10
  354. package/src/component/axis.ts +13 -5
  355. package/src/component/index.ts +11 -5
  356. package/src/composition/index.ts +17 -8
  357. package/src/composition/rect.ts +1 -1
  358. package/src/coordinate/index.ts +25 -12
  359. package/src/data/arc.ts +13 -18
  360. package/src/data/cluster.ts +53 -56
  361. package/src/data/custom.ts +15 -0
  362. package/src/data/fetch.ts +12 -7
  363. package/src/data/filterBy.ts +11 -2
  364. package/src/data/index.ts +29 -9
  365. package/src/data/map.ts +15 -0
  366. package/src/data/sankey.ts +92 -95
  367. package/src/data/sortBy.ts +18 -8
  368. package/src/data/tree.ts +9 -9
  369. package/src/data/utils/arc/index.ts +1 -1
  370. package/src/data/utils/fields.ts +17 -0
  371. package/src/data/voronoi.ts +2 -0
  372. package/src/data/wordCloud.ts +2 -0
  373. package/src/encode/index.ts +9 -4
  374. package/src/interaction/action/index.ts +43 -45
  375. package/src/interaction/index.ts +17 -1
  376. package/src/interaction/interactor/index.ts +5 -2
  377. package/src/interaction/types.ts +1 -1
  378. package/src/mark/annotation/index.ts +15 -25
  379. package/src/mark/geometry/{schema.ts → box.ts} +5 -5
  380. package/src/mark/geometry/image.ts +4 -3
  381. package/src/mark/geometry/index.ts +23 -13
  382. package/src/mark/geometry/interval.ts +0 -1
  383. package/src/mark/geometry/line.ts +6 -1
  384. package/src/mark/geometry/link.ts +1 -1
  385. package/src/mark/geometry/point.ts +5 -2
  386. package/src/mark/geometry/polygon.ts +1 -1
  387. package/src/palette/index.ts +5 -2
  388. package/src/runtime/component.ts +10 -3
  389. package/src/runtime/mark.ts +4 -3
  390. package/src/runtime/plot.ts +66 -41
  391. package/src/runtime/render.ts +16 -10
  392. package/src/runtime/scale.ts +1 -1
  393. package/src/runtime/types/component.ts +1 -10
  394. package/src/runtime/types/options.ts +1 -0
  395. package/src/scale/index.ts +23 -11
  396. package/src/shape/annotation/text.ts +16 -4
  397. package/src/shape/{schema → box}/box.ts +2 -2
  398. package/src/shape/index.ts +92 -60
  399. package/src/shape/label/label.ts +81 -47
  400. package/src/shape/{edge → link}/arc.ts +0 -0
  401. package/src/shape/{edge → link}/smoothEdge.ts +0 -0
  402. package/src/shape/{edge → link}/vhv.ts +0 -0
  403. package/src/shape/{edge → polygon}/ribbon.ts +0 -0
  404. package/src/spec/data.ts +157 -8
  405. package/src/spec/geometry.ts +5 -3
  406. package/src/spec/transform.ts +37 -154
  407. package/src/stdlib/index.ts +18 -20
  408. package/src/transform/dodgeX.ts +5 -4
  409. package/src/transform/flexX.ts +38 -0
  410. package/src/transform/groupX.ts +25 -8
  411. package/src/transform/index.ts +47 -24
  412. package/src/transform/normalizeY.ts +0 -1
  413. package/src/transform/sortX.ts +48 -0
  414. package/src/transform/stackY.ts +34 -9
  415. package/src/utils/coordinate.ts +4 -0
  416. package/esm/data/connector.d.ts +0 -7
  417. package/esm/data/connector.js +0 -9
  418. package/esm/data/connector.js.map +0 -1
  419. package/esm/mark/geometry/edge.d.ts +0 -13
  420. package/esm/mark/geometry/edge.js +0 -31
  421. package/esm/mark/geometry/edge.js.map +0 -1
  422. package/esm/mark/geometry/node.d.ts +0 -8
  423. package/esm/mark/geometry/node.js +0 -27
  424. package/esm/mark/geometry/node.js.map +0 -1
  425. package/esm/mark/geometry/schema.js.map +0 -1
  426. package/esm/renderer/canvas.d.ts +0 -10
  427. package/esm/renderer/canvas.js +0 -18
  428. package/esm/renderer/canvas.js.map +0 -1
  429. package/esm/renderer/index.d.ts +0 -1
  430. package/esm/renderer/index.js +0 -2
  431. package/esm/renderer/index.js.map +0 -1
  432. package/esm/shape/edge/edge.d.ts +0 -6
  433. package/esm/shape/edge/edge.js +0 -11
  434. package/esm/shape/edge/edge.js.map +0 -1
  435. package/esm/shape/edge/ribbon.js.map +0 -1
  436. package/esm/shape/node/point.d.ts +0 -6
  437. package/esm/shape/node/point.js +0 -27
  438. package/esm/shape/node/point.js.map +0 -1
  439. package/esm/shape/node/polygon.d.ts +0 -3
  440. package/esm/shape/node/polygon.js +0 -8
  441. package/esm/shape/node/polygon.js.map +0 -1
  442. package/esm/shape/schema/box.js.map +0 -1
  443. package/lib/data/connector.d.ts +0 -7
  444. package/lib/data/connector.js +0 -13
  445. package/lib/data/connector.js.map +0 -1
  446. package/lib/mark/geometry/edge.d.ts +0 -13
  447. package/lib/mark/geometry/edge.js +0 -35
  448. package/lib/mark/geometry/edge.js.map +0 -1
  449. package/lib/mark/geometry/node.d.ts +0 -8
  450. package/lib/mark/geometry/node.js +0 -31
  451. package/lib/mark/geometry/node.js.map +0 -1
  452. package/lib/mark/geometry/schema.js.map +0 -1
  453. package/lib/renderer/canvas.d.ts +0 -10
  454. package/lib/renderer/canvas.js +0 -22
  455. package/lib/renderer/canvas.js.map +0 -1
  456. package/lib/renderer/index.d.ts +0 -1
  457. package/lib/renderer/index.js +0 -6
  458. package/lib/renderer/index.js.map +0 -1
  459. package/lib/shape/edge/edge.d.ts +0 -6
  460. package/lib/shape/edge/edge.js +0 -15
  461. package/lib/shape/edge/edge.js.map +0 -1
  462. package/lib/shape/edge/ribbon.js.map +0 -1
  463. package/lib/shape/node/point.d.ts +0 -6
  464. package/lib/shape/node/point.js +0 -31
  465. package/lib/shape/node/point.js.map +0 -1
  466. package/lib/shape/node/polygon.d.ts +0 -3
  467. package/lib/shape/node/polygon.js +0 -12
  468. package/lib/shape/node/polygon.js.map +0 -1
  469. package/lib/shape/schema/box.js.map +0 -1
  470. package/src/data/connector.ts +0 -14
  471. package/src/mark/geometry/edge.ts +0 -40
  472. package/src/mark/geometry/node.ts +0 -36
  473. package/src/renderer/canvas.ts +0 -27
  474. package/src/renderer/index.ts +0 -1
  475. package/src/shape/edge/edge.ts +0 -15
  476. package/src/shape/node/point.ts +0 -32
  477. package/src/shape/node/polygon.ts +0 -12
@@ -1,5 +1,4 @@
1
1
  import { G2Library } from '../runtime';
2
- import { Canvas } from '../renderer';
3
2
  import {
4
3
  Cartesian,
5
4
  Polar,
@@ -22,13 +21,11 @@ import {
22
21
  Point as PointGeometry,
23
22
  Text as TextGeometry,
24
23
  Area as AreaGeometry,
25
- Edge as EdgeGeometry,
26
24
  Image as ImageGeometry,
27
25
  Polygon as PolygonGeometry,
28
- Schema as SchemaGeometry,
26
+ Box as BoxGeometry,
29
27
  Vector as VectorGeometry,
30
28
  Link as LinkGeometry,
31
- Node as NodeGeometry,
32
29
  } from '../mark/geometry';
33
30
  import {
34
31
  AnnotationText,
@@ -87,7 +84,6 @@ import {
87
84
  AnnotationConnector as AnnotationConnectorShape,
88
85
  Area,
89
86
  SmoothArea,
90
- Edge,
91
87
  SmoothEdge,
92
88
  VHVEdge,
93
89
  Arc,
@@ -99,8 +95,6 @@ import {
99
95
  Pyramid,
100
96
  Vector,
101
97
  Link,
102
- PointNode,
103
- PolygonNode,
104
98
  Label,
105
99
  } from '../shape';
106
100
  import { Light } from '../theme';
@@ -170,17 +164,24 @@ import {
170
164
  SelectX,
171
165
  SelectY,
172
166
  GroupX,
167
+ SortX,
168
+ FlexX,
173
169
  } from '../transform';
174
170
  import {
175
171
  Fetch,
176
172
  SortBy,
177
173
  FilterBy,
174
+ Map,
178
175
  Pick,
179
176
  Rename,
180
177
  Subset,
181
178
  Fold,
182
179
  Inline,
183
- Connector,
180
+ Custom,
181
+ Cluster,
182
+ Tree,
183
+ Sankey,
184
+ Arc as ArcTransform,
184
185
  } from '../data';
185
186
  import { HideOverlap } from '../labelLayout/hideOverlap';
186
187
 
@@ -194,13 +195,14 @@ export function createLibrary(): G2Library {
194
195
  'data.rename': Rename,
195
196
  'data.subset': Subset,
196
197
  'data.fold': Fold,
197
- 'data.connector': Connector,
198
+ 'data.custom': Custom,
199
+ 'data.map': Map,
200
+ 'data.cluster': Cluster,
201
+ 'data.tree': Tree,
202
+ 'data.sankey': Sankey,
203
+ 'data.arc': ArcTransform,
198
204
  // 'transform.wordCloud': WordCloud,
199
205
  // 'transform.voronoi': Voronoi,
200
- // 'transform.sankey': Sankey,
201
- // 'transform.arc': ArcTransform,
202
- // 'transform.cluster': ClusterTransform,
203
- // 'transform.tree': TreeTransform,
204
206
  // 'transform.connector': Connector,
205
207
  'transform.maybeZeroY1': MaybeZeroY1,
206
208
  'transform.maybeZeroX': MaybeZeroX,
@@ -223,7 +225,8 @@ export function createLibrary(): G2Library {
223
225
  'transform.maybeSize': MaybeSize,
224
226
  'transform.maybeZeroY': MaybeZeroY,
225
227
  'transform.maybeKey': MaybeKey,
226
- 'renderer.canvas': Canvas,
228
+ 'transform.sortX': SortX,
229
+ 'transform.flexX': FlexX,
227
230
  'coordinate.cartesian': Cartesian,
228
231
  'coordinate.polar': Polar,
229
232
  'coordinate.helix': Helix,
@@ -247,11 +250,9 @@ export function createLibrary(): G2Library {
247
250
  'mark.grid': Grid,
248
251
  'mark.area': AreaGeometry,
249
252
  'mark.link': LinkGeometry,
250
- 'mark.node': NodeGeometry,
251
- 'mark.edge': EdgeGeometry,
252
253
  'mark.image': ImageGeometry,
253
254
  'mark.polygon': PolygonGeometry,
254
- 'mark.schema': SchemaGeometry,
255
+ 'mark.box': BoxGeometry,
255
256
  'mark.vector': VectorGeometry,
256
257
  'mark.annotation.text': AnnotationText,
257
258
  'mark.annotation.lineX': AnnotationLineX,
@@ -304,13 +305,10 @@ export function createLibrary(): G2Library {
304
305
  'shape.text': Text,
305
306
  'shape.area': Area,
306
307
  'shape.smoothArea': SmoothArea,
307
- 'shape.edge': Edge,
308
308
  'shape.smoothEdge': SmoothEdge,
309
309
  'shape.vhvEdge': VHVEdge,
310
310
  'shape.arc': Arc,
311
311
  'shape.link': Link,
312
- 'shape.pointNode': PointNode,
313
- 'shape.polygonNode': PolygonNode,
314
312
  'shape.image': Image,
315
313
  'shape.polygon': Polygon,
316
314
  'shape.ribbon': Ribbon,
@@ -17,7 +17,7 @@ export type DodgeXOptions = Omit<DodgeXTransform, 'type'>;
17
17
  * say to form horizontal "columns" by specified channels.
18
18
  */
19
19
  export const DodgeX: TC<DodgeXOptions> = (options = {}) => {
20
- const { groupBy = 'x', reverse = false, orderBy, ...rest } = options;
20
+ const { groupBy = 'x', reverse = false, orderBy, padding, ...rest } = options;
21
21
  return (I, mark) => {
22
22
  const { data, encode, scale } = mark;
23
23
  const { series: scaleSeries } = scale;
@@ -39,14 +39,15 @@ export const DodgeX: TC<DodgeXOptions> = (options = {}) => {
39
39
  newS[G[i]] = domainSeries[i];
40
40
  }
41
41
  }
42
- // console.log(newS, S);
43
42
 
44
43
  return [
45
44
  I,
46
45
  deepMix({}, mark, {
47
46
  scale: {
48
- domain: domainSeries,
49
- ...rest,
47
+ series: {
48
+ domain: domainSeries,
49
+ paddingInner: padding,
50
+ },
50
51
  },
51
52
  encode: {
52
53
  series: column(newS),
@@ -0,0 +1,38 @@
1
+ import { deepMix } from '@antv/util';
2
+ import { rollups, sum, Primitive } from 'd3-array';
3
+ import { TransformComponent as TC } from '../runtime';
4
+ import { FlexXTransform } from '../spec';
5
+ import { columnOf } from './utils/helper';
6
+
7
+ export type FlexXOptions = Omit<FlexXTransform, 'type'>;
8
+
9
+ function valueOf(data: any, field: FlexXOptions['field']) {
10
+ if (typeof field === 'string') return data.map((d) => d[field]);
11
+ return data.map(field);
12
+ }
13
+
14
+ function createReducer(
15
+ reducer: FlexXOptions['reducer'],
16
+ V: Primitive[],
17
+ ): (I: number[]) => any {
18
+ if (typeof reducer === 'function') return (GI: number[]) => reducer(GI, V);
19
+ if (reducer === 'sum') return (GI: number[]) => sum(GI, (i) => +V[i]);
20
+ throw new Error(`Unknown reducer: ${reducer}`);
21
+ }
22
+
23
+ /**
24
+ * Produce flex options from data for x scale.
25
+ */
26
+ export const FlexX: TC<FlexXOptions> = (options = {}) => {
27
+ const { field, channel = 'y', reducer = 'sum' } = options;
28
+ return (I, mark) => {
29
+ const { data, encode } = mark;
30
+ const [x] = columnOf(encode, 'x');
31
+ const V = field ? valueOf(data, field) : columnOf(encode, channel)[0];
32
+ const reducerFunction = createReducer(reducer, V);
33
+ const flex = rollups(I, reducerFunction, (i) => x[i]).map((d) => d[1]);
34
+ return [I, deepMix({}, mark, { scale: { x: { flex } } })];
35
+ };
36
+ };
37
+
38
+ FlexX.props = {};
@@ -1,9 +1,16 @@
1
1
  import { deepMix } from '@antv/util';
2
- import { group, max as d3Max, mean as d3Mean, sum as d3Sum } from 'd3-array';
2
+ import {
3
+ max as d3Max,
4
+ mean as d3Mean,
5
+ sum as d3Sum,
6
+ min as d3Min,
7
+ median as d3Median,
8
+ } from 'd3-array';
3
9
  import { TransformComponent as TC, Primitive } from '../runtime';
4
10
  import { GroupXTransform, Reducer } from '../spec';
5
11
  import { indexOf } from '../utils/array';
6
12
  import { columnOf, column } from './utils/helper';
13
+ import { createGroups } from './utils/order';
7
14
 
8
15
  export type GroupXOptions = Omit<GroupXTransform, 'type'>;
9
16
 
@@ -13,7 +20,7 @@ type Formatter = (d: Primitive) => string;
13
20
 
14
21
  function normalizeReducer(reducer: Reducer): [ReducerFunction, Formatter] {
15
22
  if (typeof reducer === 'function') return [reducer, null];
16
- const registry = { mean, max, count, first, last, sum };
23
+ const registry = { mean, max, count, first, last, sum, min, median };
17
24
  const reducerFunction = registry[reducer];
18
25
  if (!reducerFunction) throw new Error(`Unknown reducer: ${reducer}.`);
19
26
  return reducerFunction();
@@ -25,15 +32,27 @@ function mean(): [ReducerFunction, Formatter] {
25
32
  return [reducer, formatter];
26
33
  }
27
34
 
35
+ function median(): [ReducerFunction, Formatter] {
36
+ const reducer: ReducerFunction = (I, V) => d3Median(I, (i) => +V[i]);
37
+ const formatter: Formatter = (d) => `median of ${d}`;
38
+ return [reducer, formatter];
39
+ }
40
+
28
41
  function max(): [ReducerFunction, Formatter] {
29
42
  const reducer: ReducerFunction = (I, V) => d3Max(I, (i) => +V[i]);
30
43
  const formatter: Formatter = (d) => `max of ${d}`;
31
44
  return [reducer, formatter];
32
45
  }
33
46
 
47
+ function min(): [ReducerFunction, Formatter] {
48
+ const reducer: ReducerFunction = (I, V) => d3Min(I, (i) => +V[i]);
49
+ const formatter: Formatter = (d) => `min of ${d}`;
50
+ return [reducer, formatter];
51
+ }
52
+
34
53
  function count(): [ReducerFunction, Formatter] {
35
54
  const reducer: ReducerFunction = (I, V) => I.length;
36
- const formatter: Formatter = (d) => `count of ${d}`;
55
+ const formatter: Formatter = (d) => (d === null ? 'count' : `count of ${d}`);
37
56
  return [reducer, formatter];
38
57
  }
39
58
 
@@ -44,7 +63,7 @@ function sum(): [ReducerFunction, Formatter] {
44
63
  }
45
64
 
46
65
  function first(): [ReducerFunction, Formatter] {
47
- const reducer: ReducerFunction = (I, V) => V[0];
66
+ const reducer: ReducerFunction = (I, V) => V[I[0]];
48
67
  const formatter: Formatter = (d) => `first of ${d}`;
49
68
  return [reducer, formatter];
50
69
  }
@@ -61,12 +80,10 @@ function last(): [ReducerFunction, Formatter] {
61
80
  * @todo Test encode after aggregate.
62
81
  */
63
82
  export const GroupX: TC<GroupXOptions> = (options = {}) => {
64
- const { orderBy, reverse = false, ...rest } = options;
65
83
  return (I, mark) => {
66
84
  const { data, encode } = mark;
67
- const [X] = columnOf(encode, 'x');
68
- const groups = X ? Array.from(group(I, (i) => X[i]).values()) : [I];
69
- const outputs = Object.entries(rest).map(([channel, reducer]) => {
85
+ const groups = createGroups(['x', 'color'], I, mark);
86
+ const outputs = Object.entries(options).map(([channel, reducer]) => {
70
87
  const [reducerFunction, formatter] = normalizeReducer(reducer);
71
88
  const [V, field] = columnOf(encode, channel);
72
89
  const RV = groups.map((I) => reducerFunction(I, V ?? data));
@@ -1,24 +1,47 @@
1
- export { MaybeZeroY1, MaybeZeroY1Options } from './maybeZeroY1';
2
- export { MaybeStackY, MaybeStackYOptions } from './maybeStackY';
3
- export { MaybeTitleX, MaybeTitleXOptions } from './maybeTitleX';
4
- export {
5
- MaybeTooltipPosition,
6
- MaybeTooltipPositionOptions,
7
- } from './maybeTooltipPosition';
8
- export { MaybeTooltipY, MaybeTooltipYOptions } from './maybeTooltipY';
9
- export { MaybeZeroX, MaybeZeroXOptions } from './maybeZeroX';
10
- export { MaybeZeroY, MaybeZeroYOptions } from './maybeZeroY';
11
- export { MaybeSize, MaybeSizeOptions } from './maybeSize';
12
- export { MaybeKey, MaybeKeyOptions } from './maybeKey';
13
- export { MaybeSeries, MaybeSeriesOptions } from './maybeSeries';
14
- export { StackY, StackYOptions } from './stackY';
15
- export { DodgeX, DodgeXOptions } from './dodgeX';
16
- export { StackEnter, StackEnterOptions } from './stackEnter';
17
- export { NormalizeY, NormalizeYOptions } from './normalizeY';
18
- export { Jitter, JitterOptions } from './jitter';
19
- export { JitterY, JitterYOptions } from './jitterY';
20
- export { SymmetryY, SymmetryYOptions } from './symmetryY';
21
- export { Select, SelectOptions } from './Select';
22
- export { SelectX, SelectXOptions } from './SelectX';
23
- export { SelectY, SelectYOptions } from './SelectY';
24
- export { GroupX, GroupXOptions } from './groupX';
1
+ export { MaybeZeroY1 } from './maybeZeroY1';
2
+ export { MaybeStackY } from './maybeStackY';
3
+ export { MaybeTitleX } from './maybeTitleX';
4
+ export { MaybeTooltipPosition } from './maybeTooltipPosition';
5
+ export { MaybeTooltipY } from './maybeTooltipY';
6
+ export { MaybeZeroX } from './maybeZeroX';
7
+ export { MaybeZeroY } from './maybeZeroY';
8
+ export { MaybeSize } from './maybeSize';
9
+ export { MaybeKey } from './maybeKey';
10
+ export { MaybeSeries } from './maybeSeries';
11
+ export { StackY } from './stackY';
12
+ export { DodgeX } from './dodgeX';
13
+ export { StackEnter } from './stackEnter';
14
+ export { NormalizeY } from './normalizeY';
15
+ export { Jitter } from './jitter';
16
+ export { JitterY } from './jitterY';
17
+ export { SymmetryY } from './symmetryY';
18
+ export { Select } from './Select';
19
+ export { SelectX } from './SelectX';
20
+ export { SelectY } from './SelectY';
21
+ export { GroupX } from './groupX';
22
+ export { SortX } from './sortX';
23
+ export { FlexX } from './flexX';
24
+
25
+ export type { MaybeZeroY1Options } from './maybeZeroY1';
26
+ export type { MaybeStackYOptions } from './maybeStackY';
27
+ export type { MaybeTitleXOptions } from './maybeTitleX';
28
+ export type { MaybeTooltipPositionOptions } from './maybeTooltipPosition';
29
+ export type { MaybeTooltipYOptions } from './maybeTooltipY';
30
+ export type { MaybeZeroXOptions } from './maybeZeroX';
31
+ export type { MaybeZeroYOptions } from './maybeZeroY';
32
+ export type { MaybeSizeOptions } from './maybeSize';
33
+ export type { MaybeKeyOptions } from './maybeKey';
34
+ export type { MaybeSeriesOptions } from './maybeSeries';
35
+ export type { StackYOptions } from './stackY';
36
+ export type { DodgeXOptions } from './dodgeX';
37
+ export type { StackEnterOptions } from './stackEnter';
38
+ export type { NormalizeYOptions } from './normalizeY';
39
+ export type { JitterOptions } from './jitter';
40
+ export type { JitterYOptions } from './jitterY';
41
+ export type { SymmetryYOptions } from './symmetryY';
42
+ export type { SelectOptions } from './Select';
43
+ export type { SelectXOptions } from './SelectX';
44
+ export type { SelectYOptions } from './SelectY';
45
+ export type { GroupXOptions } from './groupX';
46
+ export type { SortXOptions } from './sortX';
47
+ export type { FlexXOptions } from './flexX';
@@ -14,7 +14,6 @@ function normalizeBasis(basis: NormalizeYOptions['basis']) {
14
14
  first: (d) => d[0],
15
15
  last: (d) => d[d.length - 1],
16
16
  mean,
17
- extent,
18
17
  median,
19
18
  sum,
20
19
  deviation,
@@ -0,0 +1,48 @@
1
+ import { deepMix } from '@antv/util';
2
+ import { groupSort, max, min, sum } from 'd3-array';
3
+ import { TransformComponent as TC } from '../runtime';
4
+ import { SortXTransform } from '../spec';
5
+ import { columnOf } from './utils/helper';
6
+
7
+ function createReducer(options, encode): (I: number[]) => any {
8
+ const { channel = 'y', reducer = 'max' } = options;
9
+ const [V] = columnOf(encode, channel);
10
+ if (typeof reducer === 'function') return (GI: number[]) => reducer(GI, V);
11
+ if (reducer === 'max') return (GI: number[]) => max(GI, (i) => +V[i]);
12
+ if (reducer === 'min') return (GI: number[]) => min(GI, (i) => +V[i]);
13
+ if (reducer === 'sum') return (GI: number[]) => sum(GI, (i) => +V[i]);
14
+ if (reducer === 'first') return (GI: number[]) => V[GI[0]];
15
+ if (reducer === 'last') return (GI: number[]) => V[GI[GI.length - 1]];
16
+ throw new Error(`Unknown reducer: ${reducer}`);
17
+ }
18
+
19
+ export type SortXOptions = Omit<SortXTransform, 'type'>;
20
+
21
+ /**
22
+ * Sort marks groups by groups.
23
+ * @todo Add more reducers: first, last, etc,.
24
+ */
25
+ export const SortX: TC<SortXOptions> = (options = {}) => {
26
+ const { reverse = false, slice, ...rest } = options;
27
+ return (I, mark) => {
28
+ const { encode } = mark;
29
+ const [X] = columnOf(encode, 'x');
30
+ const normalizeReducer = createReducer(rest, encode);
31
+ const sortedDomain = groupSort(I, normalizeReducer, (i) => X[i]);
32
+ if (reverse) sortedDomain.reverse();
33
+ const s = typeof slice === 'number' ? [0, slice] : slice;
34
+ const slicedDomain = slice ? sortedDomain.slice(...s) : sortedDomain;
35
+ return [
36
+ I,
37
+ deepMix(mark, {
38
+ scale: {
39
+ x: {
40
+ domain: slicedDomain,
41
+ },
42
+ },
43
+ }),
44
+ ];
45
+ };
46
+ };
47
+
48
+ SortX.props = {};
@@ -7,17 +7,25 @@ import { normalizeComparator, createGroups, applyOrder } from './utils/order';
7
7
  export type StackYOptions = Omit<StackYTransform, 'type'>;
8
8
 
9
9
  /**
10
- * The stack transform group marks into series by color or series channel,
10
+ * The stack transform group marks into series by color channel,
11
11
  * and then produce new y channel for each series by specified order,
12
12
  * say to form vertical "stacks" by specified channels.
13
13
  */
14
14
  export const StackY: TC<StackYOptions> = (options = {}) => {
15
- const { groupBy = 'x', orderBy, reverse = false, y: from = 'y' } = options;
16
- return (I, mark, context) => {
15
+ const {
16
+ groupBy = 'x',
17
+ orderBy = null,
18
+ reverse = false,
19
+ y: from = 'y',
20
+ series = true,
21
+ } = options;
22
+ return (I, mark) => {
17
23
  const { data, encode } = mark;
18
24
  const [Y, fy] = columnOf(encode, 'y');
19
25
  const [Y1, fy1] = columnOf(encode, 'y1');
20
- const [S] = maybeColumnOf(encode, 'series', 'color');
26
+ const [S] = series
27
+ ? maybeColumnOf(encode, 'series', 'color')
28
+ : columnOf(encode, 'color');
21
29
 
22
30
  // Create groups and apply specified order for each group.
23
31
  const groups = createGroups(groupBy, I, mark);
@@ -28,16 +36,33 @@ export const StackY: TC<StackYOptions> = (options = {}) => {
28
36
  // Stack y channels to produce new y and y1 channel.
29
37
  const newY = new Array(I.length);
30
38
  const newY1 = new Array(I.length);
39
+ const TY = new Array(I.length);
31
40
  for (const G of groups) {
32
41
  if (reverse) G.reverse();
33
42
  // For range interval with specified y and y1.
34
43
  const start = Y1 ? +Y1[G[0]] : 0;
35
- let py = start; // Positive y for next y to stack on.
36
- let ny = start; // Negative y for next y to stack on.
44
+
45
+ // Split positive indices of Y and negative Y.
46
+ const PG = [];
47
+ const NG = [];
37
48
  for (const i of G) {
38
- const y = +Y[i] - start;
39
- if (y < 0) ny = newY[i] = (newY1[i] = ny) + y;
40
- else if (y > 0) py = newY[i] = (newY1[i] = py) + y;
49
+ const y = (TY[i] = +Y[i] - start);
50
+ if (y < 0) NG.push(i);
51
+ else if (y >= 0) PG.push(i);
52
+ }
53
+
54
+ // Stack negative y in reverse order.
55
+ let ny = start;
56
+ for (const i of NG.reverse()) {
57
+ const y = TY[i];
58
+ ny = newY[i] = (newY1[i] = ny) + y;
59
+ }
60
+
61
+ // Stack positive y in input order.
62
+ let py = start;
63
+ for (const i of PG) {
64
+ const y = TY[i];
65
+ if (y > 0) py = newY[i] = (newY1[i] = py) + y;
41
66
  else newY[i] = newY1[i] = py;
42
67
  }
43
68
  }
@@ -27,3 +27,7 @@ export function isFisheye(coordinate: Coordinate): boolean {
27
27
  const { transformations } = coordinate.getOptions();
28
28
  return transformations.some(([type]) => type === 'fisheye');
29
29
  }
30
+
31
+ export function isCircular(coordinate: Coordinate): boolean {
32
+ return isHelix(coordinate) || isParallel(coordinate);
33
+ }
@@ -1,7 +0,0 @@
1
- import { DataComponent as DC } from '../runtime';
2
- import { ConnectorTransform } from '../spec';
3
- export declare type ConnectorOptions = Omit<ConnectorTransform, 'type'>;
4
- /**
5
- * Connector transfom by function.
6
- */
7
- export declare const Connector: DC<ConnectorOptions>;
@@ -1,9 +0,0 @@
1
- /**
2
- * Connector transfom by function.
3
- */
4
- export const Connector = (options) => {
5
- const { callback } = options;
6
- return (data) => (callback ? callback(data) : data);
7
- };
8
- Connector.props = {};
9
- //# sourceMappingURL=connector.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"connector.js","sourceRoot":"src/","sources":["data/connector.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAyB,CAAC,OAAO,EAAE,EAAE;IACzD,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IAC7B,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AACtD,CAAC,CAAC;AAEF,SAAS,CAAC,KAAK,GAAG,EAAE,CAAC"}
@@ -1,13 +0,0 @@
1
- import { MarkComponent as MC } from '../../runtime';
2
- import { EdgeGeometry } from '../../spec';
3
- export declare type EdgeOptions = Omit<EdgeGeometry, 'type'>;
4
- /**
5
- * Convert value for each channel to edge shapes.
6
- *
7
- * input:
8
- * X: [x0, x1, x2, x3, ...]
9
- * Y: [y0, y1, y2, y3, ...]
10
- * output:
11
- * [P0, P1, P2, P3, ...]
12
- */
13
- export declare const Edge: MC<EdgeOptions>;
@@ -1,31 +0,0 @@
1
- import { baseGeometryChannels, basePostInference, basePreInference, } from '../utils';
2
- import { Polygon } from './polygon';
3
- /**
4
- * Convert value for each channel to edge shapes.
5
- *
6
- * input:
7
- * X: [x0, x1, x2, x3, ...]
8
- * Y: [y0, y1, y2, y3, ...]
9
- * output:
10
- * [P0, P1, P2, P3, ...]
11
- */
12
- export const Edge = (...args) => {
13
- return Polygon(...args);
14
- };
15
- Edge.props = {
16
- defaultShape: 'edge',
17
- defaultLabelShape: 'label',
18
- channels: [
19
- ...baseGeometryChannels(),
20
- { name: 'x', required: true },
21
- { name: 'y', required: true },
22
- ],
23
- preInference: [...basePreInference()],
24
- postInference: [
25
- ...basePostInference(),
26
- { type: 'maybeTitleX' },
27
- { type: 'maybeTooltipY' },
28
- ],
29
- shapes: ['edge', 'arc', 'vhv', 'smoothEdge', 'ribbon'],
30
- };
31
- //# sourceMappingURL=edge.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"edge.js","sourceRoot":"src/","sources":["mark/geometry/edge.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,IAAI,GAAoB,CAAC,GAAG,IAAI,EAAE,EAAE;IAC/C,OAAO,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;AAC1B,CAAC,CAAC;AAEF,IAAI,CAAC,KAAK,GAAG;IACX,YAAY,EAAE,MAAM;IACpB,iBAAiB,EAAE,OAAO;IAC1B,QAAQ,EAAE;QACR,GAAG,oBAAoB,EAAE;QACzB,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC7B,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE;KAC9B;IACD,YAAY,EAAE,CAAC,GAAG,gBAAgB,EAAE,CAAC;IACrC,aAAa,EAAE;QACb,GAAG,iBAAiB,EAAE;QACtB,EAAE,IAAI,EAAE,aAAa,EAAE;QACvB,EAAE,IAAI,EAAE,eAAe,EAAE;KAC1B;IACD,MAAM,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,QAAQ,CAAC;CACvD,CAAC"}
@@ -1,8 +0,0 @@
1
- import { MarkComponent as MC } from '../../runtime';
2
- import { NodeGeometry } from '../../spec';
3
- export declare type NodeOptions = Omit<NodeGeometry, 'type'>;
4
- /**
5
- * Convert value for each channel to node shapes.
6
- * Same with polygon.
7
- */
8
- export declare const Node: MC<NodeGeometry>;
@@ -1,27 +0,0 @@
1
- import { baseGeometryChannels, basePostInference, basePreInference, } from '../utils';
2
- import { Polygon } from './polygon';
3
- /**
4
- * Convert value for each channel to node shapes.
5
- * Same with polygon.
6
- */
7
- export const Node = (...args) => {
8
- return Polygon(...args);
9
- };
10
- Node.props = {
11
- defaultShape: 'pointNode',
12
- defaultLabelShape: 'label',
13
- channels: [
14
- ...baseGeometryChannels(),
15
- { name: 'x', required: true },
16
- { name: 'y', required: true },
17
- { name: 'size', required: true },
18
- ],
19
- preInference: [...basePreInference()],
20
- postInference: [
21
- ...basePostInference(),
22
- { type: 'maybeTitleX' },
23
- { type: 'maybeTooltipY' },
24
- ],
25
- shapes: ['pointNode', 'polygonNode'],
26
- };
27
- //# sourceMappingURL=node.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"node.js","sourceRoot":"src/","sources":["mark/geometry/node.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC;;;GAGG;AACH,MAAM,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BAAgB,EAAE,CAAC;IACrC,aAAa,EAAE;QACb,GAAG,iBAAiB,EAAE;QACtB,EAAE,IAAI,EAAE,aAAa,EAAE;QACvB,EAAE,IAAI,EAAE,eAAe,EAAE;KAC1B;IACD,MAAM,EAAE,CAAC,KAAK,CAAC;CAChB,CAAC"}
@@ -1,10 +0,0 @@
1
- import { RendererComponent as RC } from '../runtime';
2
- export declare type CanvasOptions = {
3
- width?: number;
4
- height?: number;
5
- container?: string | HTMLElement;
6
- };
7
- /**
8
- * Returns a canvas renderer.
9
- */
10
- export declare const Canvas: RC<CanvasOptions>;
@@ -1,18 +0,0 @@
1
- import { Canvas as GCanvas } from '@antv/g';
2
- import { Renderer as CanvasRenderer } from '@antv/g-canvas';
3
- import { Plugin as DragAndDropPlugin } from '@antv/g-plugin-dragndrop';
4
- /**
5
- * Returns a canvas renderer.
6
- */
7
- export const Canvas = ({ width, height, container }) => {
8
- const renderer = new CanvasRenderer();
9
- renderer.registerPlugin(new DragAndDropPlugin());
10
- return new GCanvas({
11
- container,
12
- width,
13
- height,
14
- renderer,
15
- });
16
- };
17
- Canvas.props = {};
18
- //# sourceMappingURL=canvas.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"canvas.js","sourceRoot":"src/","sources":["renderer/canvas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,QAAQ,IAAI,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,MAAM,IAAI,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AASvE;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAsB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,EAAE;IACxE,MAAM,QAAQ,GAAG,IAAI,cAAc,EAAE,CAAC;IACtC,QAAQ,CAAC,cAAc,CAAC,IAAI,iBAAiB,EAAE,CAAC,CAAC;IAEjD,OAAO,IAAI,OAAO,CAAC;QACjB,SAAS;QACT,KAAK;QACL,MAAM;QACN,QAAQ;KACT,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,CAAC,KAAK,GAAG,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- export { Canvas, CanvasOptions } from './canvas';
@@ -1,2 +0,0 @@
1
- export { Canvas } from './canvas';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"src/","sources":["renderer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAiB,MAAM,UAAU,CAAC"}
@@ -1,6 +0,0 @@
1
- import { ShapeComponent as SC } from '../../runtime';
2
- export declare type EdgeOptions = Record<string, any>;
3
- /**
4
- * Draw a line from `start` to `end`.
5
- */
6
- export declare const Edge: SC<EdgeOptions>;