@antv/g2 4.1.43 → 4.1.44

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 (1336) hide show
  1. package/dist/g2.min.js +44 -0
  2. package/dist/g2.min.js.map +1 -0
  3. package/esm/animate/animation/fade.d.ts +21 -0
  4. package/esm/animate/animation/fade.js +42 -0
  5. package/esm/animate/animation/fade.js.map +1 -0
  6. package/esm/animate/animation/grow-in.d.ts +30 -0
  7. package/esm/animate/animation/grow-in.js +38 -0
  8. package/esm/animate/animation/grow-in.js.map +1 -0
  9. package/esm/animate/animation/index.d.ts +16 -0
  10. package/esm/animate/animation/index.js +17 -0
  11. package/esm/animate/animation/index.js.map +1 -0
  12. package/esm/animate/animation/path-in.d.ts +12 -0
  13. package/esm/animate/animation/path-in.js +21 -0
  14. package/esm/animate/animation/path-in.js.map +1 -0
  15. package/esm/animate/animation/position-update.d.ts +11 -0
  16. package/esm/animate/animation/position-update.js +24 -0
  17. package/esm/animate/animation/position-update.js.map +1 -0
  18. package/esm/animate/animation/scale-in.d.ts +19 -0
  19. package/esm/animate/animation/scale-in.js +60 -0
  20. package/esm/animate/animation/scale-in.js.map +1 -0
  21. package/esm/animate/animation/sector-path-update.d.ts +11 -0
  22. package/esm/animate/animation/sector-path-update.js +131 -0
  23. package/esm/animate/animation/sector-path-update.js.map +1 -0
  24. package/esm/animate/animation/util.d.ts +19 -0
  25. package/esm/animate/animation/util.js +88 -0
  26. package/esm/animate/animation/util.js.map +1 -0
  27. package/esm/animate/animation/wave-in.d.ts +13 -0
  28. package/esm/animate/animation/wave-in.js +26 -0
  29. package/esm/animate/animation/wave-in.js.map +1 -0
  30. package/esm/animate/animation/zoom.d.ts +21 -0
  31. package/esm/animate/animation/zoom.js +66 -0
  32. package/esm/animate/animation/zoom.js.map +1 -0
  33. package/esm/animate/index.d.ts +48 -0
  34. package/esm/animate/index.js +249 -0
  35. package/esm/animate/index.js.map +1 -0
  36. package/esm/animate/interface.d.ts +12 -0
  37. package/esm/animate/interface.js +2 -0
  38. package/esm/animate/interface.js.map +1 -0
  39. package/esm/api.d.ts +2 -0
  40. package/esm/api.js +3 -0
  41. package/esm/api.js.map +1 -0
  42. package/esm/base.d.ts +33 -0
  43. package/esm/base.js +55 -0
  44. package/esm/base.js.map +1 -0
  45. package/esm/chart/chart.d.ts +61 -0
  46. package/esm/chart/chart.js +157 -0
  47. package/esm/chart/chart.js.map +1 -0
  48. package/esm/chart/controller/annotation.d.ts +162 -0
  49. package/esm/chart/controller/annotation.js +581 -0
  50. package/esm/chart/controller/annotation.js.map +1 -0
  51. package/esm/chart/controller/axis.d.ts +93 -0
  52. package/esm/chart/controller/axis.js +578 -0
  53. package/esm/chart/controller/axis.js.map +1 -0
  54. package/esm/chart/controller/base.d.ts +64 -0
  55. package/esm/chart/controller/base.js +62 -0
  56. package/esm/chart/controller/base.js.map +1 -0
  57. package/esm/chart/controller/coordinate.d.ts +74 -0
  58. package/esm/chart/controller/coordinate.js +145 -0
  59. package/esm/chart/controller/coordinate.js.map +1 -0
  60. package/esm/chart/controller/gesture.d.ts +37 -0
  61. package/esm/chart/controller/gesture.js +258 -0
  62. package/esm/chart/controller/gesture.js.map +1 -0
  63. package/esm/chart/controller/index.d.ts +25 -0
  64. package/esm/chart/controller/index.js +34 -0
  65. package/esm/chart/controller/index.js.map +1 -0
  66. package/esm/chart/controller/legend.d.ts +106 -0
  67. package/esm/chart/controller/legend.js +484 -0
  68. package/esm/chart/controller/legend.js.map +1 -0
  69. package/esm/chart/controller/scrollbar.d.ts +64 -0
  70. package/esm/chart/controller/scrollbar.js +316 -0
  71. package/esm/chart/controller/scrollbar.js.map +1 -0
  72. package/esm/chart/controller/slider.d.ts +88 -0
  73. package/esm/chart/controller/slider.js +296 -0
  74. package/esm/chart/controller/slider.js.map +1 -0
  75. package/esm/chart/controller/tooltip.d.ts +68 -0
  76. package/esm/chart/controller/tooltip.js +644 -0
  77. package/esm/chart/controller/tooltip.js.map +1 -0
  78. package/esm/chart/event.d.ts +47 -0
  79. package/esm/chart/event.js +91 -0
  80. package/esm/chart/event.js.map +1 -0
  81. package/esm/chart/index.d.ts +4 -0
  82. package/esm/chart/index.js +5 -0
  83. package/esm/chart/index.js.map +1 -0
  84. package/esm/chart/layout/auto.d.ts +8 -0
  85. package/esm/chart/layout/auto.js +64 -0
  86. package/esm/chart/layout/auto.js.map +1 -0
  87. package/esm/chart/layout/constraint/bounds.d.ts +32 -0
  88. package/esm/chart/layout/constraint/bounds.js +30 -0
  89. package/esm/chart/layout/constraint/bounds.js.map +1 -0
  90. package/esm/chart/layout/constraint/constraint.d.ts +31 -0
  91. package/esm/chart/layout/constraint/constraint.js +81 -0
  92. package/esm/chart/layout/constraint/constraint.js.map +1 -0
  93. package/esm/chart/layout/constraint/gauss.d.ts +11 -0
  94. package/esm/chart/layout/constraint/gauss.js +63 -0
  95. package/esm/chart/layout/constraint/gauss.js.map +1 -0
  96. package/esm/chart/layout/constraint/index.d.ts +5 -0
  97. package/esm/chart/layout/constraint/index.js +30 -0
  98. package/esm/chart/layout/constraint/index.js.map +1 -0
  99. package/esm/chart/layout/constraint/solver.d.ts +40 -0
  100. package/esm/chart/layout/constraint/solver.js +77 -0
  101. package/esm/chart/layout/constraint/solver.js.map +1 -0
  102. package/esm/chart/layout/constraint/types.d.ts +21 -0
  103. package/esm/chart/layout/constraint/types.js +13 -0
  104. package/esm/chart/layout/constraint/types.js.map +1 -0
  105. package/esm/chart/layout/constraint/variable.d.ts +24 -0
  106. package/esm/chart/layout/constraint/variable.js +28 -0
  107. package/esm/chart/layout/constraint/variable.js.map +1 -0
  108. package/esm/chart/layout/index.d.ts +15 -0
  109. package/esm/chart/layout/index.js +26 -0
  110. package/esm/chart/layout/index.js.map +1 -0
  111. package/esm/chart/layout/padding-cal.d.ts +53 -0
  112. package/esm/chart/layout/padding-cal.js +108 -0
  113. package/esm/chart/layout/padding-cal.js.map +1 -0
  114. package/esm/chart/util/scale-pool.d.ts +57 -0
  115. package/esm/chart/util/scale-pool.js +212 -0
  116. package/esm/chart/util/scale-pool.js.map +1 -0
  117. package/esm/chart/util/sync-view-padding.d.ts +9 -0
  118. package/esm/chart/util/sync-view-padding.js +14 -0
  119. package/esm/chart/util/sync-view-padding.js.map +1 -0
  120. package/esm/chart/view.d.ts +747 -0
  121. package/esm/chart/view.js +1633 -0
  122. package/esm/chart/view.js.map +1 -0
  123. package/esm/component/labels.d.ts +47 -0
  124. package/esm/component/labels.js +274 -0
  125. package/esm/component/labels.js.map +1 -0
  126. package/esm/component/update-label.d.ts +21 -0
  127. package/esm/component/update-label.js +57 -0
  128. package/esm/component/update-label.js.map +1 -0
  129. package/esm/constant.d.ts +122 -0
  130. package/esm/constant.js +134 -0
  131. package/esm/constant.js.map +1 -0
  132. package/esm/core.d.ts +46 -0
  133. package/esm/core.js +60 -0
  134. package/esm/core.js.map +1 -0
  135. package/esm/dependents.d.ts +21 -0
  136. package/esm/dependents.js +33 -0
  137. package/esm/dependents.js.map +1 -0
  138. package/esm/engine/index.d.ts +13 -0
  139. package/esm/engine/index.js +22 -0
  140. package/esm/engine/index.js.map +1 -0
  141. package/esm/facet/circle.d.ts +36 -0
  142. package/esm/facet/circle.js +119 -0
  143. package/esm/facet/circle.js.map +1 -0
  144. package/esm/facet/facet.d.ts +165 -0
  145. package/esm/facet/facet.js +291 -0
  146. package/esm/facet/facet.js.map +1 -0
  147. package/esm/facet/index.d.ts +13 -0
  148. package/esm/facet/index.js +22 -0
  149. package/esm/facet/index.js.map +1 -0
  150. package/esm/facet/list.d.ts +46 -0
  151. package/esm/facet/list.js +134 -0
  152. package/esm/facet/list.js.map +1 -0
  153. package/esm/facet/matrix.d.ts +34 -0
  154. package/esm/facet/matrix.js +119 -0
  155. package/esm/facet/matrix.js.map +1 -0
  156. package/esm/facet/mirror.d.ts +31 -0
  157. package/esm/facet/mirror.js +144 -0
  158. package/esm/facet/mirror.js.map +1 -0
  159. package/esm/facet/rect.d.ts +35 -0
  160. package/esm/facet/rect.js +141 -0
  161. package/esm/facet/rect.js.map +1 -0
  162. package/esm/facet/tree.d.ts +40 -0
  163. package/esm/facet/tree.js +288 -0
  164. package/esm/facet/tree.js.map +1 -0
  165. package/esm/geometry/area.d.ts +46 -0
  166. package/esm/geometry/area.js +62 -0
  167. package/esm/geometry/area.js.map +1 -0
  168. package/esm/geometry/base.d.ts +793 -0
  169. package/esm/geometry/base.js +1487 -0
  170. package/esm/geometry/base.js.map +1 -0
  171. package/esm/geometry/edge.d.ts +15 -0
  172. package/esm/geometry/edge.js +24 -0
  173. package/esm/geometry/edge.js.map +1 -0
  174. package/esm/geometry/element/index.d.ts +127 -0
  175. package/esm/geometry/element/index.js +436 -0
  176. package/esm/geometry/element/index.js.map +1 -0
  177. package/esm/geometry/heatmap.d.ts +31 -0
  178. package/esm/geometry/heatmap.js +190 -0
  179. package/esm/geometry/heatmap.js.map +1 -0
  180. package/esm/geometry/interval.d.ts +41 -0
  181. package/esm/geometry/interval.js +98 -0
  182. package/esm/geometry/interval.js.map +1 -0
  183. package/esm/geometry/label/base.d.ts +76 -0
  184. package/esm/geometry/label/base.js +404 -0
  185. package/esm/geometry/label/base.js.map +1 -0
  186. package/esm/geometry/label/index.d.ts +38 -0
  187. package/esm/geometry/label/index.js +35 -0
  188. package/esm/geometry/label/index.js.map +1 -0
  189. package/esm/geometry/label/interface.d.ts +50 -0
  190. package/esm/geometry/label/interface.js +2 -0
  191. package/esm/geometry/label/interface.js.map +1 -0
  192. package/esm/geometry/label/interval.d.ts +27 -0
  193. package/esm/geometry/label/interval.js +146 -0
  194. package/esm/geometry/label/interval.js.map +1 -0
  195. package/esm/geometry/label/layout/adjust-color.d.ts +3 -0
  196. package/esm/geometry/label/layout/adjust-color.js +36 -0
  197. package/esm/geometry/label/layout/adjust-color.js.map +1 -0
  198. package/esm/geometry/label/layout/hide-overlap.d.ts +8 -0
  199. package/esm/geometry/label/layout/hide-overlap.js +29 -0
  200. package/esm/geometry/label/layout/hide-overlap.js.map +1 -0
  201. package/esm/geometry/label/layout/interval/adjust-position.d.ts +9 -0
  202. package/esm/geometry/label/layout/interval/adjust-position.js +61 -0
  203. package/esm/geometry/label/layout/interval/adjust-position.js.map +1 -0
  204. package/esm/geometry/label/layout/interval/hide-overlap.d.ts +9 -0
  205. package/esm/geometry/label/layout/interval/hide-overlap.js +78 -0
  206. package/esm/geometry/label/layout/interval/hide-overlap.js.map +1 -0
  207. package/esm/geometry/label/layout/limit-in-canvas.d.ts +9 -0
  208. package/esm/geometry/label/layout/limit-in-canvas.js +44 -0
  209. package/esm/geometry/label/layout/limit-in-canvas.js.map +1 -0
  210. package/esm/geometry/label/layout/limit-in-plot.d.ts +18 -0
  211. package/esm/geometry/label/layout/limit-in-plot.js +75 -0
  212. package/esm/geometry/label/layout/limit-in-plot.js.map +1 -0
  213. package/esm/geometry/label/layout/limit-in-shape.d.ts +7 -0
  214. package/esm/geometry/label/layout/limit-in-shape.js +18 -0
  215. package/esm/geometry/label/layout/limit-in-shape.js.map +1 -0
  216. package/esm/geometry/label/layout/overlap.d.ts +15 -0
  217. package/esm/geometry/label/layout/overlap.js +223 -0
  218. package/esm/geometry/label/layout/overlap.js.map +1 -0
  219. package/esm/geometry/label/layout/path/adjust-position.d.ts +17 -0
  220. package/esm/geometry/label/layout/path/adjust-position.js +94 -0
  221. package/esm/geometry/label/layout/path/adjust-position.js.map +1 -0
  222. package/esm/geometry/label/layout/pie/distribute.d.ts +3 -0
  223. package/esm/geometry/label/layout/pie/distribute.js +185 -0
  224. package/esm/geometry/label/layout/pie/distribute.js.map +1 -0
  225. package/esm/geometry/label/layout/pie/outer.d.ts +6 -0
  226. package/esm/geometry/label/layout/pie/outer.js +207 -0
  227. package/esm/geometry/label/layout/pie/outer.js.map +1 -0
  228. package/esm/geometry/label/layout/pie/spider.d.ts +7 -0
  229. package/esm/geometry/label/layout/pie/spider.js +181 -0
  230. package/esm/geometry/label/layout/pie/spider.js.map +1 -0
  231. package/esm/geometry/label/layout/pie/util.d.ts +10 -0
  232. package/esm/geometry/label/layout/pie/util.js +73 -0
  233. package/esm/geometry/label/layout/pie/util.js.map +1 -0
  234. package/esm/geometry/label/layout/point/adjust-position.d.ts +17 -0
  235. package/esm/geometry/label/layout/point/adjust-position.js +94 -0
  236. package/esm/geometry/label/layout/point/adjust-position.js.map +1 -0
  237. package/esm/geometry/label/pie.d.ts +22 -0
  238. package/esm/geometry/label/pie.js +95 -0
  239. package/esm/geometry/label/pie.js.map +1 -0
  240. package/esm/geometry/label/polar.d.ts +64 -0
  241. package/esm/geometry/label/polar.js +221 -0
  242. package/esm/geometry/label/polar.js.map +1 -0
  243. package/esm/geometry/label/util/index.d.ts +26 -0
  244. package/esm/geometry/label/util/index.js +61 -0
  245. package/esm/geometry/label/util/index.js.map +1 -0
  246. package/esm/geometry/line.d.ts +11 -0
  247. package/esm/geometry/line.js +21 -0
  248. package/esm/geometry/line.js.map +1 -0
  249. package/esm/geometry/path.d.ts +40 -0
  250. package/esm/geometry/path.js +122 -0
  251. package/esm/geometry/path.js.map +1 -0
  252. package/esm/geometry/point.d.ts +19 -0
  253. package/esm/geometry/point.js +30 -0
  254. package/esm/geometry/point.js.map +1 -0
  255. package/esm/geometry/polygon.d.ts +19 -0
  256. package/esm/geometry/polygon.js +62 -0
  257. package/esm/geometry/polygon.js.map +1 -0
  258. package/esm/geometry/schema.d.ts +18 -0
  259. package/esm/geometry/schema.js +48 -0
  260. package/esm/geometry/schema.js.map +1 -0
  261. package/esm/geometry/shape/area/index.d.ts +2 -0
  262. package/esm/geometry/shape/area/index.js +44 -0
  263. package/esm/geometry/shape/area/index.js.map +1 -0
  264. package/esm/geometry/shape/area/line.d.ts +1 -0
  265. package/esm/geometry/shape/area/line.js +31 -0
  266. package/esm/geometry/shape/area/line.js.map +1 -0
  267. package/esm/geometry/shape/area/smooth-line.d.ts +1 -0
  268. package/esm/geometry/shape/area/smooth-line.js +30 -0
  269. package/esm/geometry/shape/area/smooth-line.js.map +1 -0
  270. package/esm/geometry/shape/area/smooth.d.ts +1 -0
  271. package/esm/geometry/shape/area/smooth.js +31 -0
  272. package/esm/geometry/shape/area/smooth.js.map +1 -0
  273. package/esm/geometry/shape/area/util.d.ts +22 -0
  274. package/esm/geometry/shape/area/util.js +88 -0
  275. package/esm/geometry/shape/area/util.js.map +1 -0
  276. package/esm/geometry/shape/base.d.ts +22 -0
  277. package/esm/geometry/shape/base.js +162 -0
  278. package/esm/geometry/shape/base.js.map +1 -0
  279. package/esm/geometry/shape/constant.d.ts +4 -0
  280. package/esm/geometry/shape/constant.js +5 -0
  281. package/esm/geometry/shape/constant.js.map +1 -0
  282. package/esm/geometry/shape/edge/arc.d.ts +1 -0
  283. package/esm/geometry/shape/edge/arc.js +84 -0
  284. package/esm/geometry/shape/edge/arc.js.map +1 -0
  285. package/esm/geometry/shape/edge/index.d.ts +2 -0
  286. package/esm/geometry/shape/edge/index.js +31 -0
  287. package/esm/geometry/shape/edge/index.js.map +1 -0
  288. package/esm/geometry/shape/edge/smooth.d.ts +1 -0
  289. package/esm/geometry/shape/edge/smooth.js +30 -0
  290. package/esm/geometry/shape/edge/smooth.js.map +1 -0
  291. package/esm/geometry/shape/edge/util.d.ts +17 -0
  292. package/esm/geometry/shape/edge/util.js +32 -0
  293. package/esm/geometry/shape/edge/util.js.map +1 -0
  294. package/esm/geometry/shape/edge/vhv.d.ts +1 -0
  295. package/esm/geometry/shape/edge/vhv.js +42 -0
  296. package/esm/geometry/shape/edge/vhv.js.map +1 -0
  297. package/esm/geometry/shape/interval/funnel.d.ts +1 -0
  298. package/esm/geometry/shape/interval/funnel.js +31 -0
  299. package/esm/geometry/shape/interval/funnel.js.map +1 -0
  300. package/esm/geometry/shape/interval/hollow-rect.d.ts +1 -0
  301. package/esm/geometry/shape/interval/hollow-rect.js +51 -0
  302. package/esm/geometry/shape/interval/hollow-rect.js.map +1 -0
  303. package/esm/geometry/shape/interval/index.d.ts +3 -0
  304. package/esm/geometry/shape/interval/index.js +63 -0
  305. package/esm/geometry/shape/interval/index.js.map +1 -0
  306. package/esm/geometry/shape/interval/line.d.ts +1 -0
  307. package/esm/geometry/shape/interval/line.js +54 -0
  308. package/esm/geometry/shape/interval/line.js.map +1 -0
  309. package/esm/geometry/shape/interval/pyramid.d.ts +1 -0
  310. package/esm/geometry/shape/interval/pyramid.js +31 -0
  311. package/esm/geometry/shape/interval/pyramid.js.map +1 -0
  312. package/esm/geometry/shape/interval/tick.d.ts +1 -0
  313. package/esm/geometry/shape/interval/tick.js +77 -0
  314. package/esm/geometry/shape/interval/tick.js.map +1 -0
  315. package/esm/geometry/shape/interval/util.d.ts +55 -0
  316. package/esm/geometry/shape/interval/util.js +311 -0
  317. package/esm/geometry/shape/interval/util.js.map +1 -0
  318. package/esm/geometry/shape/line/index.d.ts +8 -0
  319. package/esm/geometry/shape/line/index.js +105 -0
  320. package/esm/geometry/shape/line/index.js.map +1 -0
  321. package/esm/geometry/shape/line/step.d.ts +1 -0
  322. package/esm/geometry/shape/line/step.js +84 -0
  323. package/esm/geometry/shape/line/step.js.map +1 -0
  324. package/esm/geometry/shape/line/util.d.ts +16 -0
  325. package/esm/geometry/shape/line/util.js +83 -0
  326. package/esm/geometry/shape/line/util.js.map +1 -0
  327. package/esm/geometry/shape/point/hollow.d.ts +1 -0
  328. package/esm/geometry/shape/point/hollow.js +24 -0
  329. package/esm/geometry/shape/point/hollow.js.map +1 -0
  330. package/esm/geometry/shape/point/image.d.ts +1 -0
  331. package/esm/geometry/shape/point/image.js +48 -0
  332. package/esm/geometry/shape/point/image.js.map +1 -0
  333. package/esm/geometry/shape/point/index.d.ts +2 -0
  334. package/esm/geometry/shape/point/index.js +32 -0
  335. package/esm/geometry/shape/point/index.js.map +1 -0
  336. package/esm/geometry/shape/point/solid.d.ts +1 -0
  337. package/esm/geometry/shape/point/solid.js +23 -0
  338. package/esm/geometry/shape/point/solid.js.map +1 -0
  339. package/esm/geometry/shape/point/util.d.ts +15 -0
  340. package/esm/geometry/shape/point/util.js +39 -0
  341. package/esm/geometry/shape/point/util.js.map +1 -0
  342. package/esm/geometry/shape/polygon/index.d.ts +2 -0
  343. package/esm/geometry/shape/polygon/index.js +65 -0
  344. package/esm/geometry/shape/polygon/index.js.map +1 -0
  345. package/esm/geometry/shape/polygon/square.d.ts +1 -0
  346. package/esm/geometry/shape/polygon/square.js +44 -0
  347. package/esm/geometry/shape/polygon/square.js.map +1 -0
  348. package/esm/geometry/shape/schema/box.d.ts +1 -0
  349. package/esm/geometry/shape/schema/box.js +142 -0
  350. package/esm/geometry/shape/schema/box.js.map +1 -0
  351. package/esm/geometry/shape/schema/candle.d.ts +1 -0
  352. package/esm/geometry/shape/schema/candle.js +80 -0
  353. package/esm/geometry/shape/schema/candle.js.map +1 -0
  354. package/esm/geometry/shape/schema/index.d.ts +2 -0
  355. package/esm/geometry/shape/schema/index.js +6 -0
  356. package/esm/geometry/shape/schema/index.js.map +1 -0
  357. package/esm/geometry/shape/util/get-path-points.d.ts +38 -0
  358. package/esm/geometry/shape/util/get-path-points.js +131 -0
  359. package/esm/geometry/shape/util/get-path-points.js.map +1 -0
  360. package/esm/geometry/shape/util/get-style.d.ts +18 -0
  361. package/esm/geometry/shape/util/get-style.js +47 -0
  362. package/esm/geometry/shape/util/get-style.js.map +1 -0
  363. package/esm/geometry/shape/util/path.d.ts +32 -0
  364. package/esm/geometry/shape/util/path.js +311 -0
  365. package/esm/geometry/shape/util/path.js.map +1 -0
  366. package/esm/geometry/shape/util/split-points.d.ts +13 -0
  367. package/esm/geometry/shape/util/split-points.js +24 -0
  368. package/esm/geometry/shape/util/split-points.js.map +1 -0
  369. package/esm/geometry/shape/violin/hollow.d.ts +1 -0
  370. package/esm/geometry/shape/violin/hollow.js +51 -0
  371. package/esm/geometry/shape/violin/hollow.js.map +1 -0
  372. package/esm/geometry/shape/violin/index.d.ts +2 -0
  373. package/esm/geometry/shape/violin/index.js +60 -0
  374. package/esm/geometry/shape/violin/index.js.map +1 -0
  375. package/esm/geometry/shape/violin/smooth.d.ts +1 -0
  376. package/esm/geometry/shape/violin/smooth.js +28 -0
  377. package/esm/geometry/shape/violin/smooth.js.map +1 -0
  378. package/esm/geometry/util/diff.d.ts +11 -0
  379. package/esm/geometry/util/diff.js +30 -0
  380. package/esm/geometry/util/diff.js.map +1 -0
  381. package/esm/geometry/util/get-shape-type.d.ts +8 -0
  382. package/esm/geometry/util/get-shape-type.js +16 -0
  383. package/esm/geometry/util/get-shape-type.js.map +1 -0
  384. package/esm/geometry/util/group-data.d.ts +3 -0
  385. package/esm/geometry/util/group-data.js +31 -0
  386. package/esm/geometry/util/group-data.js.map +1 -0
  387. package/esm/geometry/util/is-model-change.d.ts +9 -0
  388. package/esm/geometry/util/is-model-change.js +14 -0
  389. package/esm/geometry/util/is-model-change.js.map +1 -0
  390. package/esm/geometry/util/parse-fields.d.ts +2 -0
  391. package/esm/geometry/util/parse-fields.js +9 -0
  392. package/esm/geometry/util/parse-fields.js.map +1 -0
  393. package/esm/geometry/util/shape-size.d.ts +2 -0
  394. package/esm/geometry/util/shape-size.js +124 -0
  395. package/esm/geometry/util/shape-size.js.map +1 -0
  396. package/esm/geometry/violin.d.ts +25 -0
  397. package/esm/geometry/violin.js +67 -0
  398. package/esm/geometry/violin.js.map +1 -0
  399. package/esm/index.d.ts +107 -0
  400. package/esm/index.js +581 -0
  401. package/esm/index.js.map +1 -0
  402. package/esm/interaction/action/active-region.d.ts +33 -0
  403. package/esm/interaction/action/active-region.js +198 -0
  404. package/esm/interaction/action/active-region.js.map +1 -0
  405. package/esm/interaction/action/base.d.ts +29 -0
  406. package/esm/interaction/action/base.js +36 -0
  407. package/esm/interaction/action/base.js.map +1 -0
  408. package/esm/interaction/action/callback.d.ts +17 -0
  409. package/esm/interaction/action/callback.js +27 -0
  410. package/esm/interaction/action/callback.js.map +1 -0
  411. package/esm/interaction/action/component/list-active.d.ts +14 -0
  412. package/esm/interaction/action/component/list-active.js +24 -0
  413. package/esm/interaction/action/component/list-active.js.map +1 -0
  414. package/esm/interaction/action/component/list-checked.d.ts +30 -0
  415. package/esm/interaction/action/component/list-checked.js +82 -0
  416. package/esm/interaction/action/component/list-checked.js.map +1 -0
  417. package/esm/interaction/action/component/list-focus.d.ts +5 -0
  418. package/esm/interaction/action/component/list-focus.js +55 -0
  419. package/esm/interaction/action/component/list-focus.js.map +1 -0
  420. package/esm/interaction/action/component/list-highlight-util.d.ts +7 -0
  421. package/esm/interaction/action/component/list-highlight-util.js +20 -0
  422. package/esm/interaction/action/component/list-highlight-util.js.map +1 -0
  423. package/esm/interaction/action/component/list-highlight.d.ts +20 -0
  424. package/esm/interaction/action/component/list-highlight.js +97 -0
  425. package/esm/interaction/action/component/list-highlight.js.map +1 -0
  426. package/esm/interaction/action/component/list-radio.d.ts +24 -0
  427. package/esm/interaction/action/component/list-radio.js +116 -0
  428. package/esm/interaction/action/component/list-radio.js.map +1 -0
  429. package/esm/interaction/action/component/list-selected.d.ts +10 -0
  430. package/esm/interaction/action/component/list-selected.js +20 -0
  431. package/esm/interaction/action/component/list-selected.js.map +1 -0
  432. package/esm/interaction/action/component/list-state.d.ts +46 -0
  433. package/esm/interaction/action/component/list-state.js +167 -0
  434. package/esm/interaction/action/component/list-state.js.map +1 -0
  435. package/esm/interaction/action/component/list-unchecked.d.ts +13 -0
  436. package/esm/interaction/action/component/list-unchecked.js +23 -0
  437. package/esm/interaction/action/component/list-unchecked.js.map +1 -0
  438. package/esm/interaction/action/component/tooltip/ellipsis-text.d.ts +25 -0
  439. package/esm/interaction/action/component/tooltip/ellipsis-text.js +93 -0
  440. package/esm/interaction/action/component/tooltip/ellipsis-text.js.map +1 -0
  441. package/esm/interaction/action/component/tooltip/geometry.d.ts +24 -0
  442. package/esm/interaction/action/component/tooltip/geometry.js +71 -0
  443. package/esm/interaction/action/component/tooltip/geometry.js.map +1 -0
  444. package/esm/interaction/action/component/tooltip/sibling.d.ts +21 -0
  445. package/esm/interaction/action/component/tooltip/sibling.js +39 -0
  446. package/esm/interaction/action/component/tooltip/sibling.js.map +1 -0
  447. package/esm/interaction/action/cursor.d.ts +69 -0
  448. package/esm/interaction/action/cursor.js +113 -0
  449. package/esm/interaction/action/cursor.js.map +1 -0
  450. package/esm/interaction/action/data/filter.d.ts +13 -0
  451. package/esm/interaction/action/data/filter.js +66 -0
  452. package/esm/interaction/action/data/filter.js.map +1 -0
  453. package/esm/interaction/action/data/range-filter.d.ts +56 -0
  454. package/esm/interaction/action/data/range-filter.js +163 -0
  455. package/esm/interaction/action/data/range-filter.js.map +1 -0
  456. package/esm/interaction/action/data/sibling-filter.d.ts +22 -0
  457. package/esm/interaction/action/data/sibling-filter.js +39 -0
  458. package/esm/interaction/action/data/sibling-filter.js.map +1 -0
  459. package/esm/interaction/action/element/active.d.ts +14 -0
  460. package/esm/interaction/action/element/active.js +24 -0
  461. package/esm/interaction/action/element/active.js.map +1 -0
  462. package/esm/interaction/action/element/filter.d.ts +20 -0
  463. package/esm/interaction/action/element/filter.js +89 -0
  464. package/esm/interaction/action/element/filter.js.map +1 -0
  465. package/esm/interaction/action/element/highlight-by-color.d.ts +10 -0
  466. package/esm/interaction/action/element/highlight-by-color.js +30 -0
  467. package/esm/interaction/action/element/highlight-by-color.js.map +1 -0
  468. package/esm/interaction/action/element/highlight-by-x.d.ts +15 -0
  469. package/esm/interaction/action/element/highlight-by-x.js +51 -0
  470. package/esm/interaction/action/element/highlight-by-x.js.map +1 -0
  471. package/esm/interaction/action/element/highlight-util.d.ts +18 -0
  472. package/esm/interaction/action/element/highlight-util.js +45 -0
  473. package/esm/interaction/action/element/highlight-util.js.map +1 -0
  474. package/esm/interaction/action/element/highlight.d.ts +21 -0
  475. package/esm/interaction/action/element/highlight.js +93 -0
  476. package/esm/interaction/action/element/highlight.js.map +1 -0
  477. package/esm/interaction/action/element/link-by-color.d.ts +51 -0
  478. package/esm/interaction/action/element/link-by-color.js +156 -0
  479. package/esm/interaction/action/element/link-by-color.js.map +1 -0
  480. package/esm/interaction/action/element/range-active.d.ts +13 -0
  481. package/esm/interaction/action/element/range-active.js +23 -0
  482. package/esm/interaction/action/element/range-active.js.map +1 -0
  483. package/esm/interaction/action/element/range-highlight.d.ts +27 -0
  484. package/esm/interaction/action/element/range-highlight.js +54 -0
  485. package/esm/interaction/action/element/range-highlight.js.map +1 -0
  486. package/esm/interaction/action/element/range-selected.d.ts +13 -0
  487. package/esm/interaction/action/element/range-selected.js +23 -0
  488. package/esm/interaction/action/element/range-selected.js.map +1 -0
  489. package/esm/interaction/action/element/range-state.d.ts +38 -0
  490. package/esm/interaction/action/element/range-state.js +164 -0
  491. package/esm/interaction/action/element/range-state.js.map +1 -0
  492. package/esm/interaction/action/element/selected.d.ts +14 -0
  493. package/esm/interaction/action/element/selected.js +24 -0
  494. package/esm/interaction/action/element/selected.js.map +1 -0
  495. package/esm/interaction/action/element/sibling-filter.d.ts +19 -0
  496. package/esm/interaction/action/element/sibling-filter.js +93 -0
  497. package/esm/interaction/action/element/sibling-filter.js.map +1 -0
  498. package/esm/interaction/action/element/single-active.d.ts +13 -0
  499. package/esm/interaction/action/element/single-active.js +23 -0
  500. package/esm/interaction/action/element/single-active.js.map +1 -0
  501. package/esm/interaction/action/element/single-highlight.d.ts +16 -0
  502. package/esm/interaction/action/element/single-highlight.js +35 -0
  503. package/esm/interaction/action/element/single-highlight.js.map +1 -0
  504. package/esm/interaction/action/element/single-selected.d.ts +13 -0
  505. package/esm/interaction/action/element/single-selected.js +23 -0
  506. package/esm/interaction/action/element/single-selected.js.map +1 -0
  507. package/esm/interaction/action/element/single-state.d.ts +18 -0
  508. package/esm/interaction/action/element/single-state.js +53 -0
  509. package/esm/interaction/action/element/single-state.js.map +1 -0
  510. package/esm/interaction/action/element/state-base.d.ts +39 -0
  511. package/esm/interaction/action/element/state-base.js +59 -0
  512. package/esm/interaction/action/element/state-base.js.map +1 -0
  513. package/esm/interaction/action/element/state.d.ts +28 -0
  514. package/esm/interaction/action/element/state.js +99 -0
  515. package/esm/interaction/action/element/state.js.map +1 -0
  516. package/esm/interaction/action/index.d.ts +2 -0
  517. package/esm/interaction/action/index.js +3 -0
  518. package/esm/interaction/action/index.js.map +1 -0
  519. package/esm/interaction/action/mask/base.d.ts +62 -0
  520. package/esm/interaction/action/mask/base.js +169 -0
  521. package/esm/interaction/action/mask/base.js.map +1 -0
  522. package/esm/interaction/action/mask/circle.d.ts +14 -0
  523. package/esm/interaction/action/mask/circle.js +37 -0
  524. package/esm/interaction/action/mask/circle.js.map +1 -0
  525. package/esm/interaction/action/mask/dim-rect.d.ts +11 -0
  526. package/esm/interaction/action/mask/dim-rect.js +62 -0
  527. package/esm/interaction/action/mask/dim-rect.js.map +1 -0
  528. package/esm/interaction/action/mask/path.d.ts +16 -0
  529. package/esm/interaction/action/mask/path.js +44 -0
  530. package/esm/interaction/action/mask/path.js.map +1 -0
  531. package/esm/interaction/action/mask/rect.d.ts +17 -0
  532. package/esm/interaction/action/mask/rect.js +39 -0
  533. package/esm/interaction/action/mask/rect.js.map +1 -0
  534. package/esm/interaction/action/mask/smooth-path.d.ts +9 -0
  535. package/esm/interaction/action/mask/smooth-path.js +21 -0
  536. package/esm/interaction/action/mask/smooth-path.js.map +1 -0
  537. package/esm/interaction/action/register.d.ts +36 -0
  538. package/esm/interaction/action/register.js +60 -0
  539. package/esm/interaction/action/register.js.map +1 -0
  540. package/esm/interaction/action/util.d.ts +140 -0
  541. package/esm/interaction/action/util.js +361 -0
  542. package/esm/interaction/action/util.js.map +1 -0
  543. package/esm/interaction/action/view/button.d.ts +25 -0
  544. package/esm/interaction/action/view/button.js +116 -0
  545. package/esm/interaction/action/view/button.js.map +1 -0
  546. package/esm/interaction/action/view/drag.d.ts +24 -0
  547. package/esm/interaction/action/view/drag.js +73 -0
  548. package/esm/interaction/action/view/drag.js.map +1 -0
  549. package/esm/interaction/action/view/mousewheel-scroll.d.ts +5 -0
  550. package/esm/interaction/action/view/mousewheel-scroll.js +35 -0
  551. package/esm/interaction/action/view/mousewheel-scroll.js.map +1 -0
  552. package/esm/interaction/action/view/move.d.ts +28 -0
  553. package/esm/interaction/action/view/move.js +80 -0
  554. package/esm/interaction/action/view/move.js.map +1 -0
  555. package/esm/interaction/action/view/scale-transform.d.ts +18 -0
  556. package/esm/interaction/action/view/scale-transform.js +51 -0
  557. package/esm/interaction/action/view/scale-transform.js.map +1 -0
  558. package/esm/interaction/action/view/scale-translate.d.ts +30 -0
  559. package/esm/interaction/action/view/scale-translate.js +112 -0
  560. package/esm/interaction/action/view/scale-translate.js.map +1 -0
  561. package/esm/interaction/action/view/scale-zoom.d.ts +20 -0
  562. package/esm/interaction/action/view/scale-zoom.js +83 -0
  563. package/esm/interaction/action/view/scale-zoom.js.map +1 -0
  564. package/esm/interaction/context.d.ts +65 -0
  565. package/esm/interaction/context.js +142 -0
  566. package/esm/interaction/context.js.map +1 -0
  567. package/esm/interaction/grammar-interaction.d.ts +158 -0
  568. package/esm/interaction/grammar-interaction.js +285 -0
  569. package/esm/interaction/grammar-interaction.js.map +1 -0
  570. package/esm/interaction/index.d.ts +25 -0
  571. package/esm/interaction/index.js +43 -0
  572. package/esm/interaction/index.js.map +1 -0
  573. package/esm/interaction/interaction.d.ts +29 -0
  574. package/esm/interaction/interaction.js +32 -0
  575. package/esm/interaction/interaction.js.map +1 -0
  576. package/esm/interface.d.ts +2264 -0
  577. package/esm/interface.js +2 -0
  578. package/esm/interface.js.map +1 -0
  579. package/esm/theme/index.d.ts +12 -0
  580. package/esm/theme/index.js +23 -0
  581. package/esm/theme/index.js.map +1 -0
  582. package/esm/theme/style-sheet/dark.d.ts +825 -0
  583. package/esm/theme/style-sheet/dark.js +496 -0
  584. package/esm/theme/style-sheet/dark.js.map +1 -0
  585. package/esm/theme/style-sheet/light.d.ts +817 -0
  586. package/esm/theme/style-sheet/light.js +492 -0
  587. package/esm/theme/style-sheet/light.js.map +1 -0
  588. package/esm/theme/util/create-by-style-sheet.d.ts +6 -0
  589. package/esm/theme/util/create-by-style-sheet.js +1422 -0
  590. package/esm/theme/util/create-by-style-sheet.js.map +1 -0
  591. package/esm/theme/util/create-theme.d.ts +6 -0
  592. package/esm/theme/util/create-theme.js +12 -0
  593. package/esm/theme/util/create-theme.js.map +1 -0
  594. package/esm/theme/util/index.d.ts +1 -0
  595. package/esm/theme/util/index.js +2 -0
  596. package/esm/theme/util/index.js.map +1 -0
  597. package/esm/util/annotation.d.ts +7 -0
  598. package/esm/util/annotation.js +39 -0
  599. package/esm/util/annotation.js.map +1 -0
  600. package/esm/util/attr.d.ts +10 -0
  601. package/esm/util/attr.js +25 -0
  602. package/esm/util/attr.js.map +1 -0
  603. package/esm/util/axis.d.ts +100 -0
  604. package/esm/util/axis.js +236 -0
  605. package/esm/util/axis.js.map +1 -0
  606. package/esm/util/bbox.d.ts +105 -0
  607. package/esm/util/bbox.js +282 -0
  608. package/esm/util/bbox.js.map +1 -0
  609. package/esm/util/collision-detect.d.ts +16 -0
  610. package/esm/util/collision-detect.js +127 -0
  611. package/esm/util/collision-detect.js.map +1 -0
  612. package/esm/util/color.d.ts +1 -0
  613. package/esm/util/color.js +18 -0
  614. package/esm/util/color.js.map +1 -0
  615. package/esm/util/context.d.ts +4 -0
  616. package/esm/util/context.js +11 -0
  617. package/esm/util/context.js.map +1 -0
  618. package/esm/util/coordinate.d.ts +86 -0
  619. package/esm/util/coordinate.js +147 -0
  620. package/esm/util/coordinate.js.map +1 -0
  621. package/esm/util/direction.d.ts +19 -0
  622. package/esm/util/direction.js +120 -0
  623. package/esm/util/direction.js.map +1 -0
  624. package/esm/util/dom.d.ts +19 -0
  625. package/esm/util/dom.js +61 -0
  626. package/esm/util/dom.js.map +1 -0
  627. package/esm/util/event.d.ts +8 -0
  628. package/esm/util/event.js +14 -0
  629. package/esm/util/event.js.map +1 -0
  630. package/esm/util/facet.d.ts +16 -0
  631. package/esm/util/facet.js +43 -0
  632. package/esm/util/facet.js.map +1 -0
  633. package/esm/util/graphics.d.ts +58 -0
  634. package/esm/util/graphics.js +203 -0
  635. package/esm/util/graphics.js.map +1 -0
  636. package/esm/util/grid.d.ts +36 -0
  637. package/esm/util/grid.js +118 -0
  638. package/esm/util/grid.js.map +1 -0
  639. package/esm/util/helper.d.ts +34 -0
  640. package/esm/util/helper.js +72 -0
  641. package/esm/util/helper.js.map +1 -0
  642. package/esm/util/legend.d.ts +45 -0
  643. package/esm/util/legend.js +145 -0
  644. package/esm/util/legend.js.map +1 -0
  645. package/esm/util/marker.d.ts +10 -0
  646. package/esm/util/marker.js +58 -0
  647. package/esm/util/marker.js.map +1 -0
  648. package/esm/util/padding.d.ts +14 -0
  649. package/esm/util/padding.js +40 -0
  650. package/esm/util/padding.js.map +1 -0
  651. package/esm/util/scale.d.ts +42 -0
  652. package/esm/util/scale.js +128 -0
  653. package/esm/util/scale.js.map +1 -0
  654. package/esm/util/stat.d.ts +10 -0
  655. package/esm/util/stat.js +36 -0
  656. package/esm/util/stat.js.map +1 -0
  657. package/esm/util/text.d.ts +23 -0
  658. package/esm/util/text.js +84 -0
  659. package/esm/util/text.js.map +1 -0
  660. package/esm/util/tooltip.d.ts +26 -0
  661. package/esm/util/tooltip.js +419 -0
  662. package/esm/util/tooltip.js.map +1 -0
  663. package/esm/util/transform.d.ts +33 -0
  664. package/esm/util/transform.js +61 -0
  665. package/esm/util/transform.js.map +1 -0
  666. package/esm/util/types.d.ts +6 -0
  667. package/esm/util/types.js +2 -0
  668. package/esm/util/types.js.map +1 -0
  669. package/lib/animate/animation/fade.d.ts +21 -0
  670. package/lib/animate/animation/fade.js +47 -0
  671. package/lib/animate/animation/fade.js.map +1 -0
  672. package/lib/animate/animation/grow-in.d.ts +30 -0
  673. package/lib/animate/animation/grow-in.js +44 -0
  674. package/lib/animate/animation/grow-in.js.map +1 -0
  675. package/lib/animate/animation/index.d.ts +16 -0
  676. package/lib/animate/animation/index.js +22 -0
  677. package/lib/animate/animation/index.js.map +1 -0
  678. package/lib/animate/animation/path-in.d.ts +12 -0
  679. package/lib/animate/animation/path-in.js +25 -0
  680. package/lib/animate/animation/path-in.js.map +1 -0
  681. package/lib/animate/animation/position-update.d.ts +11 -0
  682. package/lib/animate/animation/position-update.js +28 -0
  683. package/lib/animate/animation/position-update.js.map +1 -0
  684. package/lib/animate/animation/scale-in.d.ts +19 -0
  685. package/lib/animate/animation/scale-in.js +65 -0
  686. package/lib/animate/animation/scale-in.js.map +1 -0
  687. package/lib/animate/animation/sector-path-update.d.ts +11 -0
  688. package/lib/animate/animation/sector-path-update.js +135 -0
  689. package/lib/animate/animation/sector-path-update.js.map +1 -0
  690. package/lib/animate/animation/util.d.ts +19 -0
  691. package/lib/animate/animation/util.js +93 -0
  692. package/lib/animate/animation/util.js.map +1 -0
  693. package/lib/animate/animation/wave-in.d.ts +13 -0
  694. package/lib/animate/animation/wave-in.js +30 -0
  695. package/lib/animate/animation/wave-in.js.map +1 -0
  696. package/lib/animate/animation/zoom.d.ts +21 -0
  697. package/lib/animate/animation/zoom.js +71 -0
  698. package/lib/animate/animation/zoom.js.map +1 -0
  699. package/lib/animate/index.d.ts +48 -0
  700. package/lib/animate/index.js +255 -0
  701. package/lib/animate/index.js.map +1 -0
  702. package/lib/animate/interface.d.ts +12 -0
  703. package/lib/animate/interface.js +3 -0
  704. package/lib/animate/interface.js.map +1 -0
  705. package/lib/api.d.ts +2 -0
  706. package/lib/api.js +7 -0
  707. package/lib/api.js.map +1 -0
  708. package/lib/base.d.ts +33 -0
  709. package/lib/base.js +57 -0
  710. package/lib/base.js.map +1 -0
  711. package/lib/chart/chart.d.ts +61 -0
  712. package/lib/chart/chart.js +159 -0
  713. package/lib/chart/chart.js.map +1 -0
  714. package/lib/chart/controller/annotation.d.ts +162 -0
  715. package/lib/chart/controller/annotation.js +583 -0
  716. package/lib/chart/controller/annotation.js.map +1 -0
  717. package/lib/chart/controller/axis.d.ts +93 -0
  718. package/lib/chart/controller/axis.js +580 -0
  719. package/lib/chart/controller/axis.js.map +1 -0
  720. package/lib/chart/controller/base.d.ts +64 -0
  721. package/lib/chart/controller/base.js +65 -0
  722. package/lib/chart/controller/base.js.map +1 -0
  723. package/lib/chart/controller/coordinate.d.ts +74 -0
  724. package/lib/chart/controller/coordinate.js +147 -0
  725. package/lib/chart/controller/coordinate.js.map +1 -0
  726. package/lib/chart/controller/gesture.d.ts +37 -0
  727. package/lib/chart/controller/gesture.js +260 -0
  728. package/lib/chart/controller/gesture.js.map +1 -0
  729. package/lib/chart/controller/index.d.ts +25 -0
  730. package/lib/chart/controller/index.js +41 -0
  731. package/lib/chart/controller/index.js.map +1 -0
  732. package/lib/chart/controller/legend.d.ts +106 -0
  733. package/lib/chart/controller/legend.js +486 -0
  734. package/lib/chart/controller/legend.js.map +1 -0
  735. package/lib/chart/controller/scrollbar.d.ts +64 -0
  736. package/lib/chart/controller/scrollbar.js +318 -0
  737. package/lib/chart/controller/scrollbar.js.map +1 -0
  738. package/lib/chart/controller/slider.d.ts +88 -0
  739. package/lib/chart/controller/slider.js +298 -0
  740. package/lib/chart/controller/slider.js.map +1 -0
  741. package/lib/chart/controller/tooltip.d.ts +68 -0
  742. package/lib/chart/controller/tooltip.js +646 -0
  743. package/lib/chart/controller/tooltip.js.map +1 -0
  744. package/lib/chart/event.d.ts +47 -0
  745. package/lib/chart/event.js +93 -0
  746. package/lib/chart/event.js.map +1 -0
  747. package/lib/chart/index.d.ts +4 -0
  748. package/lib/chart/index.js +16 -0
  749. package/lib/chart/index.js.map +1 -0
  750. package/lib/chart/layout/auto.d.ts +8 -0
  751. package/lib/chart/layout/auto.js +68 -0
  752. package/lib/chart/layout/auto.js.map +1 -0
  753. package/lib/chart/layout/constraint/bounds.d.ts +32 -0
  754. package/lib/chart/layout/constraint/bounds.js +33 -0
  755. package/lib/chart/layout/constraint/bounds.js.map +1 -0
  756. package/lib/chart/layout/constraint/constraint.d.ts +31 -0
  757. package/lib/chart/layout/constraint/constraint.js +84 -0
  758. package/lib/chart/layout/constraint/constraint.js.map +1 -0
  759. package/lib/chart/layout/constraint/gauss.d.ts +11 -0
  760. package/lib/chart/layout/constraint/gauss.js +68 -0
  761. package/lib/chart/layout/constraint/gauss.js.map +1 -0
  762. package/lib/chart/layout/constraint/index.d.ts +5 -0
  763. package/lib/chart/layout/constraint/index.js +38 -0
  764. package/lib/chart/layout/constraint/index.js.map +1 -0
  765. package/lib/chart/layout/constraint/solver.d.ts +40 -0
  766. package/lib/chart/layout/constraint/solver.js +80 -0
  767. package/lib/chart/layout/constraint/solver.js.map +1 -0
  768. package/lib/chart/layout/constraint/types.d.ts +21 -0
  769. package/lib/chart/layout/constraint/types.js +16 -0
  770. package/lib/chart/layout/constraint/types.js.map +1 -0
  771. package/lib/chart/layout/constraint/variable.d.ts +24 -0
  772. package/lib/chart/layout/constraint/variable.js +31 -0
  773. package/lib/chart/layout/constraint/variable.js.map +1 -0
  774. package/lib/chart/layout/index.d.ts +15 -0
  775. package/lib/chart/layout/index.js +29 -0
  776. package/lib/chart/layout/index.js.map +1 -0
  777. package/lib/chart/layout/padding-cal.d.ts +53 -0
  778. package/lib/chart/layout/padding-cal.js +111 -0
  779. package/lib/chart/layout/padding-cal.js.map +1 -0
  780. package/lib/chart/util/scale-pool.d.ts +57 -0
  781. package/lib/chart/util/scale-pool.js +215 -0
  782. package/lib/chart/util/scale-pool.js.map +1 -0
  783. package/lib/chart/util/sync-view-padding.d.ts +9 -0
  784. package/lib/chart/util/sync-view-padding.js +18 -0
  785. package/lib/chart/util/sync-view-padding.js.map +1 -0
  786. package/lib/chart/view.d.ts +747 -0
  787. package/lib/chart/view.js +1637 -0
  788. package/lib/chart/view.js.map +1 -0
  789. package/lib/component/labels.d.ts +47 -0
  790. package/lib/component/labels.js +276 -0
  791. package/lib/component/labels.js.map +1 -0
  792. package/lib/component/update-label.d.ts +21 -0
  793. package/lib/component/update-label.js +61 -0
  794. package/lib/component/update-label.js.map +1 -0
  795. package/lib/constant.d.ts +122 -0
  796. package/lib/constant.js +137 -0
  797. package/lib/constant.js.map +1 -0
  798. package/lib/core.d.ts +46 -0
  799. package/lib/core.js +101 -0
  800. package/lib/core.js.map +1 -0
  801. package/lib/dependents.d.ts +21 -0
  802. package/lib/dependents.js +55 -0
  803. package/lib/dependents.js.map +1 -0
  804. package/lib/engine/index.d.ts +13 -0
  805. package/lib/engine/index.js +27 -0
  806. package/lib/engine/index.js.map +1 -0
  807. package/lib/facet/circle.d.ts +36 -0
  808. package/lib/facet/circle.js +121 -0
  809. package/lib/facet/circle.js.map +1 -0
  810. package/lib/facet/facet.d.ts +165 -0
  811. package/lib/facet/facet.js +294 -0
  812. package/lib/facet/facet.js.map +1 -0
  813. package/lib/facet/index.d.ts +13 -0
  814. package/lib/facet/index.js +28 -0
  815. package/lib/facet/index.js.map +1 -0
  816. package/lib/facet/list.d.ts +46 -0
  817. package/lib/facet/list.js +136 -0
  818. package/lib/facet/list.js.map +1 -0
  819. package/lib/facet/matrix.d.ts +34 -0
  820. package/lib/facet/matrix.js +121 -0
  821. package/lib/facet/matrix.js.map +1 -0
  822. package/lib/facet/mirror.d.ts +31 -0
  823. package/lib/facet/mirror.js +146 -0
  824. package/lib/facet/mirror.js.map +1 -0
  825. package/lib/facet/rect.d.ts +35 -0
  826. package/lib/facet/rect.js +143 -0
  827. package/lib/facet/rect.js.map +1 -0
  828. package/lib/facet/tree.d.ts +40 -0
  829. package/lib/facet/tree.js +290 -0
  830. package/lib/facet/tree.js.map +1 -0
  831. package/lib/geometry/area.d.ts +46 -0
  832. package/lib/geometry/area.js +64 -0
  833. package/lib/geometry/area.js.map +1 -0
  834. package/lib/geometry/base.d.ts +793 -0
  835. package/lib/geometry/base.js +1489 -0
  836. package/lib/geometry/base.js.map +1 -0
  837. package/lib/geometry/edge.d.ts +15 -0
  838. package/lib/geometry/edge.js +26 -0
  839. package/lib/geometry/edge.js.map +1 -0
  840. package/lib/geometry/element/index.d.ts +127 -0
  841. package/lib/geometry/element/index.js +438 -0
  842. package/lib/geometry/element/index.js.map +1 -0
  843. package/lib/geometry/heatmap.d.ts +31 -0
  844. package/lib/geometry/heatmap.js +192 -0
  845. package/lib/geometry/heatmap.js.map +1 -0
  846. package/lib/geometry/interval.d.ts +41 -0
  847. package/lib/geometry/interval.js +100 -0
  848. package/lib/geometry/interval.js.map +1 -0
  849. package/lib/geometry/label/base.d.ts +76 -0
  850. package/lib/geometry/label/base.js +406 -0
  851. package/lib/geometry/label/base.js.map +1 -0
  852. package/lib/geometry/label/index.d.ts +38 -0
  853. package/lib/geometry/label/index.js +42 -0
  854. package/lib/geometry/label/index.js.map +1 -0
  855. package/lib/geometry/label/interface.d.ts +50 -0
  856. package/lib/geometry/label/interface.js +3 -0
  857. package/lib/geometry/label/interface.js.map +1 -0
  858. package/lib/geometry/label/interval.d.ts +27 -0
  859. package/lib/geometry/label/interval.js +148 -0
  860. package/lib/geometry/label/interval.js.map +1 -0
  861. package/lib/geometry/label/layout/adjust-color.d.ts +3 -0
  862. package/lib/geometry/label/layout/adjust-color.js +40 -0
  863. package/lib/geometry/label/layout/adjust-color.js.map +1 -0
  864. package/lib/geometry/label/layout/hide-overlap.d.ts +8 -0
  865. package/lib/geometry/label/layout/hide-overlap.js +33 -0
  866. package/lib/geometry/label/layout/hide-overlap.js.map +1 -0
  867. package/lib/geometry/label/layout/interval/adjust-position.d.ts +9 -0
  868. package/lib/geometry/label/layout/interval/adjust-position.js +65 -0
  869. package/lib/geometry/label/layout/interval/adjust-position.js.map +1 -0
  870. package/lib/geometry/label/layout/interval/hide-overlap.d.ts +9 -0
  871. package/lib/geometry/label/layout/interval/hide-overlap.js +82 -0
  872. package/lib/geometry/label/layout/interval/hide-overlap.js.map +1 -0
  873. package/lib/geometry/label/layout/limit-in-canvas.d.ts +9 -0
  874. package/lib/geometry/label/layout/limit-in-canvas.js +48 -0
  875. package/lib/geometry/label/layout/limit-in-canvas.js.map +1 -0
  876. package/lib/geometry/label/layout/limit-in-plot.d.ts +18 -0
  877. package/lib/geometry/label/layout/limit-in-plot.js +79 -0
  878. package/lib/geometry/label/layout/limit-in-plot.js.map +1 -0
  879. package/lib/geometry/label/layout/limit-in-shape.d.ts +7 -0
  880. package/lib/geometry/label/layout/limit-in-shape.js +22 -0
  881. package/lib/geometry/label/layout/limit-in-shape.js.map +1 -0
  882. package/lib/geometry/label/layout/overlap.d.ts +15 -0
  883. package/lib/geometry/label/layout/overlap.js +228 -0
  884. package/lib/geometry/label/layout/overlap.js.map +1 -0
  885. package/lib/geometry/label/layout/path/adjust-position.d.ts +17 -0
  886. package/lib/geometry/label/layout/path/adjust-position.js +98 -0
  887. package/lib/geometry/label/layout/path/adjust-position.js.map +1 -0
  888. package/lib/geometry/label/layout/pie/distribute.d.ts +3 -0
  889. package/lib/geometry/label/layout/pie/distribute.js +189 -0
  890. package/lib/geometry/label/layout/pie/distribute.js.map +1 -0
  891. package/lib/geometry/label/layout/pie/outer.d.ts +6 -0
  892. package/lib/geometry/label/layout/pie/outer.js +211 -0
  893. package/lib/geometry/label/layout/pie/outer.js.map +1 -0
  894. package/lib/geometry/label/layout/pie/spider.d.ts +7 -0
  895. package/lib/geometry/label/layout/pie/spider.js +185 -0
  896. package/lib/geometry/label/layout/pie/spider.js.map +1 -0
  897. package/lib/geometry/label/layout/pie/util.d.ts +10 -0
  898. package/lib/geometry/label/layout/pie/util.js +77 -0
  899. package/lib/geometry/label/layout/pie/util.js.map +1 -0
  900. package/lib/geometry/label/layout/point/adjust-position.d.ts +17 -0
  901. package/lib/geometry/label/layout/point/adjust-position.js +98 -0
  902. package/lib/geometry/label/layout/point/adjust-position.js.map +1 -0
  903. package/lib/geometry/label/pie.d.ts +22 -0
  904. package/lib/geometry/label/pie.js +97 -0
  905. package/lib/geometry/label/pie.js.map +1 -0
  906. package/lib/geometry/label/polar.d.ts +64 -0
  907. package/lib/geometry/label/polar.js +223 -0
  908. package/lib/geometry/label/polar.js.map +1 -0
  909. package/lib/geometry/label/util/index.d.ts +26 -0
  910. package/lib/geometry/label/util/index.js +68 -0
  911. package/lib/geometry/label/util/index.js.map +1 -0
  912. package/lib/geometry/line.d.ts +11 -0
  913. package/lib/geometry/line.js +23 -0
  914. package/lib/geometry/line.js.map +1 -0
  915. package/lib/geometry/path.d.ts +40 -0
  916. package/lib/geometry/path.js +124 -0
  917. package/lib/geometry/path.js.map +1 -0
  918. package/lib/geometry/point.d.ts +19 -0
  919. package/lib/geometry/point.js +32 -0
  920. package/lib/geometry/point.js.map +1 -0
  921. package/lib/geometry/polygon.d.ts +19 -0
  922. package/lib/geometry/polygon.js +64 -0
  923. package/lib/geometry/polygon.js.map +1 -0
  924. package/lib/geometry/schema.d.ts +18 -0
  925. package/lib/geometry/schema.js +50 -0
  926. package/lib/geometry/schema.js.map +1 -0
  927. package/lib/geometry/shape/area/index.d.ts +2 -0
  928. package/lib/geometry/shape/area/index.js +46 -0
  929. package/lib/geometry/shape/area/index.js.map +1 -0
  930. package/lib/geometry/shape/area/line.d.ts +1 -0
  931. package/lib/geometry/shape/area/line.js +33 -0
  932. package/lib/geometry/shape/area/line.js.map +1 -0
  933. package/lib/geometry/shape/area/smooth-line.d.ts +1 -0
  934. package/lib/geometry/shape/area/smooth-line.js +32 -0
  935. package/lib/geometry/shape/area/smooth-line.js.map +1 -0
  936. package/lib/geometry/shape/area/smooth.d.ts +1 -0
  937. package/lib/geometry/shape/area/smooth.js +33 -0
  938. package/lib/geometry/shape/area/smooth.js.map +1 -0
  939. package/lib/geometry/shape/area/util.d.ts +22 -0
  940. package/lib/geometry/shape/area/util.js +93 -0
  941. package/lib/geometry/shape/area/util.js.map +1 -0
  942. package/lib/geometry/shape/base.d.ts +22 -0
  943. package/lib/geometry/shape/base.js +168 -0
  944. package/lib/geometry/shape/base.js.map +1 -0
  945. package/lib/geometry/shape/constant.d.ts +4 -0
  946. package/lib/geometry/shape/constant.js +8 -0
  947. package/lib/geometry/shape/constant.js.map +1 -0
  948. package/lib/geometry/shape/edge/arc.d.ts +1 -0
  949. package/lib/geometry/shape/edge/arc.js +86 -0
  950. package/lib/geometry/shape/edge/arc.js.map +1 -0
  951. package/lib/geometry/shape/edge/index.d.ts +2 -0
  952. package/lib/geometry/shape/edge/index.js +33 -0
  953. package/lib/geometry/shape/edge/index.js.map +1 -0
  954. package/lib/geometry/shape/edge/smooth.d.ts +1 -0
  955. package/lib/geometry/shape/edge/smooth.js +32 -0
  956. package/lib/geometry/shape/edge/smooth.js.map +1 -0
  957. package/lib/geometry/shape/edge/util.d.ts +17 -0
  958. package/lib/geometry/shape/edge/util.js +37 -0
  959. package/lib/geometry/shape/edge/util.js.map +1 -0
  960. package/lib/geometry/shape/edge/vhv.d.ts +1 -0
  961. package/lib/geometry/shape/edge/vhv.js +44 -0
  962. package/lib/geometry/shape/edge/vhv.js.map +1 -0
  963. package/lib/geometry/shape/interval/funnel.d.ts +1 -0
  964. package/lib/geometry/shape/interval/funnel.js +33 -0
  965. package/lib/geometry/shape/interval/funnel.js.map +1 -0
  966. package/lib/geometry/shape/interval/hollow-rect.d.ts +1 -0
  967. package/lib/geometry/shape/interval/hollow-rect.js +53 -0
  968. package/lib/geometry/shape/interval/hollow-rect.js.map +1 -0
  969. package/lib/geometry/shape/interval/index.d.ts +3 -0
  970. package/lib/geometry/shape/interval/index.js +65 -0
  971. package/lib/geometry/shape/interval/index.js.map +1 -0
  972. package/lib/geometry/shape/interval/line.d.ts +1 -0
  973. package/lib/geometry/shape/interval/line.js +56 -0
  974. package/lib/geometry/shape/interval/line.js.map +1 -0
  975. package/lib/geometry/shape/interval/pyramid.d.ts +1 -0
  976. package/lib/geometry/shape/interval/pyramid.js +33 -0
  977. package/lib/geometry/shape/interval/pyramid.js.map +1 -0
  978. package/lib/geometry/shape/interval/tick.d.ts +1 -0
  979. package/lib/geometry/shape/interval/tick.js +79 -0
  980. package/lib/geometry/shape/interval/tick.js.map +1 -0
  981. package/lib/geometry/shape/interval/util.d.ts +55 -0
  982. package/lib/geometry/shape/interval/util.js +321 -0
  983. package/lib/geometry/shape/interval/util.js.map +1 -0
  984. package/lib/geometry/shape/line/index.d.ts +8 -0
  985. package/lib/geometry/shape/line/index.js +109 -0
  986. package/lib/geometry/shape/line/index.js.map +1 -0
  987. package/lib/geometry/shape/line/step.d.ts +1 -0
  988. package/lib/geometry/shape/line/step.js +86 -0
  989. package/lib/geometry/shape/line/step.js.map +1 -0
  990. package/lib/geometry/shape/line/util.d.ts +16 -0
  991. package/lib/geometry/shape/line/util.js +87 -0
  992. package/lib/geometry/shape/line/util.js.map +1 -0
  993. package/lib/geometry/shape/point/hollow.d.ts +1 -0
  994. package/lib/geometry/shape/point/hollow.js +26 -0
  995. package/lib/geometry/shape/point/hollow.js.map +1 -0
  996. package/lib/geometry/shape/point/image.d.ts +1 -0
  997. package/lib/geometry/shape/point/image.js +50 -0
  998. package/lib/geometry/shape/point/image.js.map +1 -0
  999. package/lib/geometry/shape/point/index.d.ts +2 -0
  1000. package/lib/geometry/shape/point/index.js +34 -0
  1001. package/lib/geometry/shape/point/index.js.map +1 -0
  1002. package/lib/geometry/shape/point/solid.d.ts +1 -0
  1003. package/lib/geometry/shape/point/solid.js +25 -0
  1004. package/lib/geometry/shape/point/solid.js.map +1 -0
  1005. package/lib/geometry/shape/point/util.d.ts +15 -0
  1006. package/lib/geometry/shape/point/util.js +43 -0
  1007. package/lib/geometry/shape/point/util.js.map +1 -0
  1008. package/lib/geometry/shape/polygon/index.d.ts +2 -0
  1009. package/lib/geometry/shape/polygon/index.js +67 -0
  1010. package/lib/geometry/shape/polygon/index.js.map +1 -0
  1011. package/lib/geometry/shape/polygon/square.d.ts +1 -0
  1012. package/lib/geometry/shape/polygon/square.js +46 -0
  1013. package/lib/geometry/shape/polygon/square.js.map +1 -0
  1014. package/lib/geometry/shape/schema/box.d.ts +1 -0
  1015. package/lib/geometry/shape/schema/box.js +144 -0
  1016. package/lib/geometry/shape/schema/box.js.map +1 -0
  1017. package/lib/geometry/shape/schema/candle.d.ts +1 -0
  1018. package/lib/geometry/shape/schema/candle.js +82 -0
  1019. package/lib/geometry/shape/schema/candle.js.map +1 -0
  1020. package/lib/geometry/shape/schema/index.d.ts +2 -0
  1021. package/lib/geometry/shape/schema/index.js +8 -0
  1022. package/lib/geometry/shape/schema/index.js.map +1 -0
  1023. package/lib/geometry/shape/util/get-path-points.d.ts +38 -0
  1024. package/lib/geometry/shape/util/get-path-points.js +137 -0
  1025. package/lib/geometry/shape/util/get-path-points.js.map +1 -0
  1026. package/lib/geometry/shape/util/get-style.d.ts +18 -0
  1027. package/lib/geometry/shape/util/get-style.js +52 -0
  1028. package/lib/geometry/shape/util/get-style.js.map +1 -0
  1029. package/lib/geometry/shape/util/path.d.ts +32 -0
  1030. package/lib/geometry/shape/util/path.js +320 -0
  1031. package/lib/geometry/shape/util/path.js.map +1 -0
  1032. package/lib/geometry/shape/util/split-points.d.ts +13 -0
  1033. package/lib/geometry/shape/util/split-points.js +28 -0
  1034. package/lib/geometry/shape/util/split-points.js.map +1 -0
  1035. package/lib/geometry/shape/violin/hollow.d.ts +1 -0
  1036. package/lib/geometry/shape/violin/hollow.js +53 -0
  1037. package/lib/geometry/shape/violin/hollow.js.map +1 -0
  1038. package/lib/geometry/shape/violin/index.d.ts +2 -0
  1039. package/lib/geometry/shape/violin/index.js +62 -0
  1040. package/lib/geometry/shape/violin/index.js.map +1 -0
  1041. package/lib/geometry/shape/violin/smooth.d.ts +1 -0
  1042. package/lib/geometry/shape/violin/smooth.js +30 -0
  1043. package/lib/geometry/shape/violin/smooth.js.map +1 -0
  1044. package/lib/geometry/util/diff.d.ts +11 -0
  1045. package/lib/geometry/util/diff.js +34 -0
  1046. package/lib/geometry/util/diff.js.map +1 -0
  1047. package/lib/geometry/util/get-shape-type.d.ts +8 -0
  1048. package/lib/geometry/util/get-shape-type.js +20 -0
  1049. package/lib/geometry/util/get-shape-type.js.map +1 -0
  1050. package/lib/geometry/util/group-data.d.ts +3 -0
  1051. package/lib/geometry/util/group-data.js +35 -0
  1052. package/lib/geometry/util/group-data.js.map +1 -0
  1053. package/lib/geometry/util/is-model-change.d.ts +9 -0
  1054. package/lib/geometry/util/is-model-change.js +18 -0
  1055. package/lib/geometry/util/is-model-change.js.map +1 -0
  1056. package/lib/geometry/util/parse-fields.d.ts +2 -0
  1057. package/lib/geometry/util/parse-fields.js +13 -0
  1058. package/lib/geometry/util/parse-fields.js.map +1 -0
  1059. package/lib/geometry/util/shape-size.d.ts +2 -0
  1060. package/lib/geometry/util/shape-size.js +128 -0
  1061. package/lib/geometry/util/shape-size.js.map +1 -0
  1062. package/lib/geometry/violin.d.ts +25 -0
  1063. package/lib/geometry/violin.js +69 -0
  1064. package/lib/geometry/violin.js.map +1 -0
  1065. package/lib/index.d.ts +107 -0
  1066. package/lib/index.js +586 -0
  1067. package/lib/index.js.map +1 -0
  1068. package/lib/interaction/action/active-region.d.ts +33 -0
  1069. package/lib/interaction/action/active-region.js +202 -0
  1070. package/lib/interaction/action/active-region.js.map +1 -0
  1071. package/lib/interaction/action/base.d.ts +29 -0
  1072. package/lib/interaction/action/base.js +38 -0
  1073. package/lib/interaction/action/base.js.map +1 -0
  1074. package/lib/interaction/action/callback.d.ts +17 -0
  1075. package/lib/interaction/action/callback.js +29 -0
  1076. package/lib/interaction/action/callback.js.map +1 -0
  1077. package/lib/interaction/action/component/list-active.d.ts +14 -0
  1078. package/lib/interaction/action/component/list-active.js +26 -0
  1079. package/lib/interaction/action/component/list-active.js.map +1 -0
  1080. package/lib/interaction/action/component/list-checked.d.ts +30 -0
  1081. package/lib/interaction/action/component/list-checked.js +84 -0
  1082. package/lib/interaction/action/component/list-checked.js.map +1 -0
  1083. package/lib/interaction/action/component/list-focus.d.ts +5 -0
  1084. package/lib/interaction/action/component/list-focus.js +57 -0
  1085. package/lib/interaction/action/component/list-focus.js.map +1 -0
  1086. package/lib/interaction/action/component/list-highlight-util.d.ts +7 -0
  1087. package/lib/interaction/action/component/list-highlight-util.js +24 -0
  1088. package/lib/interaction/action/component/list-highlight-util.js.map +1 -0
  1089. package/lib/interaction/action/component/list-highlight.d.ts +20 -0
  1090. package/lib/interaction/action/component/list-highlight.js +99 -0
  1091. package/lib/interaction/action/component/list-highlight.js.map +1 -0
  1092. package/lib/interaction/action/component/list-radio.d.ts +24 -0
  1093. package/lib/interaction/action/component/list-radio.js +118 -0
  1094. package/lib/interaction/action/component/list-radio.js.map +1 -0
  1095. package/lib/interaction/action/component/list-selected.d.ts +10 -0
  1096. package/lib/interaction/action/component/list-selected.js +22 -0
  1097. package/lib/interaction/action/component/list-selected.js.map +1 -0
  1098. package/lib/interaction/action/component/list-state.d.ts +46 -0
  1099. package/lib/interaction/action/component/list-state.js +169 -0
  1100. package/lib/interaction/action/component/list-state.js.map +1 -0
  1101. package/lib/interaction/action/component/list-unchecked.d.ts +13 -0
  1102. package/lib/interaction/action/component/list-unchecked.js +25 -0
  1103. package/lib/interaction/action/component/list-unchecked.js.map +1 -0
  1104. package/lib/interaction/action/component/tooltip/ellipsis-text.d.ts +25 -0
  1105. package/lib/interaction/action/component/tooltip/ellipsis-text.js +95 -0
  1106. package/lib/interaction/action/component/tooltip/ellipsis-text.js.map +1 -0
  1107. package/lib/interaction/action/component/tooltip/geometry.d.ts +24 -0
  1108. package/lib/interaction/action/component/tooltip/geometry.js +73 -0
  1109. package/lib/interaction/action/component/tooltip/geometry.js.map +1 -0
  1110. package/lib/interaction/action/component/tooltip/sibling.d.ts +21 -0
  1111. package/lib/interaction/action/component/tooltip/sibling.js +41 -0
  1112. package/lib/interaction/action/component/tooltip/sibling.js.map +1 -0
  1113. package/lib/interaction/action/cursor.d.ts +69 -0
  1114. package/lib/interaction/action/cursor.js +115 -0
  1115. package/lib/interaction/action/cursor.js.map +1 -0
  1116. package/lib/interaction/action/data/filter.d.ts +13 -0
  1117. package/lib/interaction/action/data/filter.js +68 -0
  1118. package/lib/interaction/action/data/filter.js.map +1 -0
  1119. package/lib/interaction/action/data/range-filter.d.ts +56 -0
  1120. package/lib/interaction/action/data/range-filter.js +166 -0
  1121. package/lib/interaction/action/data/range-filter.js.map +1 -0
  1122. package/lib/interaction/action/data/sibling-filter.d.ts +22 -0
  1123. package/lib/interaction/action/data/sibling-filter.js +41 -0
  1124. package/lib/interaction/action/data/sibling-filter.js.map +1 -0
  1125. package/lib/interaction/action/element/active.d.ts +14 -0
  1126. package/lib/interaction/action/element/active.js +26 -0
  1127. package/lib/interaction/action/element/active.js.map +1 -0
  1128. package/lib/interaction/action/element/filter.d.ts +20 -0
  1129. package/lib/interaction/action/element/filter.js +91 -0
  1130. package/lib/interaction/action/element/filter.js.map +1 -0
  1131. package/lib/interaction/action/element/highlight-by-color.d.ts +10 -0
  1132. package/lib/interaction/action/element/highlight-by-color.js +32 -0
  1133. package/lib/interaction/action/element/highlight-by-color.js.map +1 -0
  1134. package/lib/interaction/action/element/highlight-by-x.d.ts +15 -0
  1135. package/lib/interaction/action/element/highlight-by-x.js +53 -0
  1136. package/lib/interaction/action/element/highlight-by-x.js.map +1 -0
  1137. package/lib/interaction/action/element/highlight-util.d.ts +18 -0
  1138. package/lib/interaction/action/element/highlight-util.js +50 -0
  1139. package/lib/interaction/action/element/highlight-util.js.map +1 -0
  1140. package/lib/interaction/action/element/highlight.d.ts +21 -0
  1141. package/lib/interaction/action/element/highlight.js +96 -0
  1142. package/lib/interaction/action/element/highlight.js.map +1 -0
  1143. package/lib/interaction/action/element/link-by-color.d.ts +51 -0
  1144. package/lib/interaction/action/element/link-by-color.js +158 -0
  1145. package/lib/interaction/action/element/link-by-color.js.map +1 -0
  1146. package/lib/interaction/action/element/range-active.d.ts +13 -0
  1147. package/lib/interaction/action/element/range-active.js +25 -0
  1148. package/lib/interaction/action/element/range-active.js.map +1 -0
  1149. package/lib/interaction/action/element/range-highlight.d.ts +27 -0
  1150. package/lib/interaction/action/element/range-highlight.js +57 -0
  1151. package/lib/interaction/action/element/range-highlight.js.map +1 -0
  1152. package/lib/interaction/action/element/range-selected.d.ts +13 -0
  1153. package/lib/interaction/action/element/range-selected.js +25 -0
  1154. package/lib/interaction/action/element/range-selected.js.map +1 -0
  1155. package/lib/interaction/action/element/range-state.d.ts +38 -0
  1156. package/lib/interaction/action/element/range-state.js +166 -0
  1157. package/lib/interaction/action/element/range-state.js.map +1 -0
  1158. package/lib/interaction/action/element/selected.d.ts +14 -0
  1159. package/lib/interaction/action/element/selected.js +26 -0
  1160. package/lib/interaction/action/element/selected.js.map +1 -0
  1161. package/lib/interaction/action/element/sibling-filter.d.ts +19 -0
  1162. package/lib/interaction/action/element/sibling-filter.js +95 -0
  1163. package/lib/interaction/action/element/sibling-filter.js.map +1 -0
  1164. package/lib/interaction/action/element/single-active.d.ts +13 -0
  1165. package/lib/interaction/action/element/single-active.js +25 -0
  1166. package/lib/interaction/action/element/single-active.js.map +1 -0
  1167. package/lib/interaction/action/element/single-highlight.d.ts +16 -0
  1168. package/lib/interaction/action/element/single-highlight.js +37 -0
  1169. package/lib/interaction/action/element/single-highlight.js.map +1 -0
  1170. package/lib/interaction/action/element/single-selected.d.ts +13 -0
  1171. package/lib/interaction/action/element/single-selected.js +25 -0
  1172. package/lib/interaction/action/element/single-selected.js.map +1 -0
  1173. package/lib/interaction/action/element/single-state.d.ts +18 -0
  1174. package/lib/interaction/action/element/single-state.js +55 -0
  1175. package/lib/interaction/action/element/single-state.js.map +1 -0
  1176. package/lib/interaction/action/element/state-base.d.ts +39 -0
  1177. package/lib/interaction/action/element/state-base.js +61 -0
  1178. package/lib/interaction/action/element/state-base.js.map +1 -0
  1179. package/lib/interaction/action/element/state.d.ts +28 -0
  1180. package/lib/interaction/action/element/state.js +101 -0
  1181. package/lib/interaction/action/element/state.js.map +1 -0
  1182. package/lib/interaction/action/index.d.ts +2 -0
  1183. package/lib/interaction/action/index.js +13 -0
  1184. package/lib/interaction/action/index.js.map +1 -0
  1185. package/lib/interaction/action/mask/base.d.ts +62 -0
  1186. package/lib/interaction/action/mask/base.js +171 -0
  1187. package/lib/interaction/action/mask/base.js.map +1 -0
  1188. package/lib/interaction/action/mask/circle.d.ts +14 -0
  1189. package/lib/interaction/action/mask/circle.js +39 -0
  1190. package/lib/interaction/action/mask/circle.js.map +1 -0
  1191. package/lib/interaction/action/mask/dim-rect.d.ts +11 -0
  1192. package/lib/interaction/action/mask/dim-rect.js +64 -0
  1193. package/lib/interaction/action/mask/dim-rect.js.map +1 -0
  1194. package/lib/interaction/action/mask/path.d.ts +16 -0
  1195. package/lib/interaction/action/mask/path.js +46 -0
  1196. package/lib/interaction/action/mask/path.js.map +1 -0
  1197. package/lib/interaction/action/mask/rect.d.ts +17 -0
  1198. package/lib/interaction/action/mask/rect.js +41 -0
  1199. package/lib/interaction/action/mask/rect.js.map +1 -0
  1200. package/lib/interaction/action/mask/smooth-path.d.ts +9 -0
  1201. package/lib/interaction/action/mask/smooth-path.js +23 -0
  1202. package/lib/interaction/action/mask/smooth-path.js.map +1 -0
  1203. package/lib/interaction/action/register.d.ts +36 -0
  1204. package/lib/interaction/action/register.js +69 -0
  1205. package/lib/interaction/action/register.js.map +1 -0
  1206. package/lib/interaction/action/util.d.ts +140 -0
  1207. package/lib/interaction/action/util.js +387 -0
  1208. package/lib/interaction/action/util.js.map +1 -0
  1209. package/lib/interaction/action/view/button.d.ts +25 -0
  1210. package/lib/interaction/action/view/button.js +118 -0
  1211. package/lib/interaction/action/view/button.js.map +1 -0
  1212. package/lib/interaction/action/view/drag.d.ts +24 -0
  1213. package/lib/interaction/action/view/drag.js +75 -0
  1214. package/lib/interaction/action/view/drag.js.map +1 -0
  1215. package/lib/interaction/action/view/mousewheel-scroll.d.ts +5 -0
  1216. package/lib/interaction/action/view/mousewheel-scroll.js +37 -0
  1217. package/lib/interaction/action/view/mousewheel-scroll.js.map +1 -0
  1218. package/lib/interaction/action/view/move.d.ts +28 -0
  1219. package/lib/interaction/action/view/move.js +82 -0
  1220. package/lib/interaction/action/view/move.js.map +1 -0
  1221. package/lib/interaction/action/view/scale-transform.d.ts +18 -0
  1222. package/lib/interaction/action/view/scale-transform.js +53 -0
  1223. package/lib/interaction/action/view/scale-transform.js.map +1 -0
  1224. package/lib/interaction/action/view/scale-translate.d.ts +30 -0
  1225. package/lib/interaction/action/view/scale-translate.js +114 -0
  1226. package/lib/interaction/action/view/scale-translate.js.map +1 -0
  1227. package/lib/interaction/action/view/scale-zoom.d.ts +20 -0
  1228. package/lib/interaction/action/view/scale-zoom.js +85 -0
  1229. package/lib/interaction/action/view/scale-zoom.js.map +1 -0
  1230. package/lib/interaction/context.d.ts +65 -0
  1231. package/lib/interaction/context.js +144 -0
  1232. package/lib/interaction/context.js.map +1 -0
  1233. package/lib/interaction/grammar-interaction.d.ts +158 -0
  1234. package/lib/interaction/grammar-interaction.js +289 -0
  1235. package/lib/interaction/grammar-interaction.js.map +1 -0
  1236. package/lib/interaction/index.d.ts +25 -0
  1237. package/lib/interaction/index.js +54 -0
  1238. package/lib/interaction/index.js.map +1 -0
  1239. package/lib/interaction/interaction.d.ts +29 -0
  1240. package/lib/interaction/interaction.js +34 -0
  1241. package/lib/interaction/interaction.js.map +1 -0
  1242. package/lib/interface.d.ts +2264 -0
  1243. package/lib/interface.js +3 -0
  1244. package/lib/interface.js.map +1 -0
  1245. package/lib/theme/index.d.ts +12 -0
  1246. package/lib/theme/index.js +28 -0
  1247. package/lib/theme/index.js.map +1 -0
  1248. package/lib/theme/style-sheet/dark.d.ts +825 -0
  1249. package/lib/theme/style-sheet/dark.js +500 -0
  1250. package/lib/theme/style-sheet/dark.js.map +1 -0
  1251. package/lib/theme/style-sheet/light.d.ts +817 -0
  1252. package/lib/theme/style-sheet/light.js +496 -0
  1253. package/lib/theme/style-sheet/light.js.map +1 -0
  1254. package/lib/theme/util/create-by-style-sheet.d.ts +6 -0
  1255. package/lib/theme/util/create-by-style-sheet.js +1426 -0
  1256. package/lib/theme/util/create-by-style-sheet.js.map +1 -0
  1257. package/lib/theme/util/create-theme.d.ts +6 -0
  1258. package/lib/theme/util/create-theme.js +16 -0
  1259. package/lib/theme/util/create-theme.js.map +1 -0
  1260. package/lib/theme/util/index.d.ts +1 -0
  1261. package/lib/theme/util/index.js +6 -0
  1262. package/lib/theme/util/index.js.map +1 -0
  1263. package/lib/util/annotation.d.ts +7 -0
  1264. package/lib/util/annotation.js +43 -0
  1265. package/lib/util/annotation.js.map +1 -0
  1266. package/lib/util/attr.d.ts +10 -0
  1267. package/lib/util/attr.js +29 -0
  1268. package/lib/util/attr.js.map +1 -0
  1269. package/lib/util/axis.d.ts +100 -0
  1270. package/lib/util/axis.js +251 -0
  1271. package/lib/util/axis.js.map +1 -0
  1272. package/lib/util/bbox.d.ts +105 -0
  1273. package/lib/util/bbox.js +287 -0
  1274. package/lib/util/bbox.js.map +1 -0
  1275. package/lib/util/collision-detect.d.ts +16 -0
  1276. package/lib/util/collision-detect.js +132 -0
  1277. package/lib/util/collision-detect.js.map +1 -0
  1278. package/lib/util/color.d.ts +1 -0
  1279. package/lib/util/color.js +23 -0
  1280. package/lib/util/color.js.map +1 -0
  1281. package/lib/util/context.d.ts +4 -0
  1282. package/lib/util/context.js +15 -0
  1283. package/lib/util/context.js.map +1 -0
  1284. package/lib/util/coordinate.d.ts +86 -0
  1285. package/lib/util/coordinate.js +157 -0
  1286. package/lib/util/coordinate.js.map +1 -0
  1287. package/lib/util/direction.d.ts +19 -0
  1288. package/lib/util/direction.js +125 -0
  1289. package/lib/util/direction.js.map +1 -0
  1290. package/lib/util/dom.d.ts +19 -0
  1291. package/lib/util/dom.js +68 -0
  1292. package/lib/util/dom.js.map +1 -0
  1293. package/lib/util/event.d.ts +8 -0
  1294. package/lib/util/event.js +18 -0
  1295. package/lib/util/event.js.map +1 -0
  1296. package/lib/util/facet.d.ts +16 -0
  1297. package/lib/util/facet.js +48 -0
  1298. package/lib/util/facet.js.map +1 -0
  1299. package/lib/util/graphics.d.ts +58 -0
  1300. package/lib/util/graphics.js +212 -0
  1301. package/lib/util/graphics.js.map +1 -0
  1302. package/lib/util/grid.d.ts +36 -0
  1303. package/lib/util/grid.js +125 -0
  1304. package/lib/util/grid.js.map +1 -0
  1305. package/lib/util/helper.d.ts +34 -0
  1306. package/lib/util/helper.js +79 -0
  1307. package/lib/util/helper.js.map +1 -0
  1308. package/lib/util/legend.d.ts +45 -0
  1309. package/lib/util/legend.js +152 -0
  1310. package/lib/util/legend.js.map +1 -0
  1311. package/lib/util/marker.d.ts +10 -0
  1312. package/lib/util/marker.js +61 -0
  1313. package/lib/util/marker.js.map +1 -0
  1314. package/lib/util/padding.d.ts +14 -0
  1315. package/lib/util/padding.js +45 -0
  1316. package/lib/util/padding.js.map +1 -0
  1317. package/lib/util/scale.d.ts +42 -0
  1318. package/lib/util/scale.js +137 -0
  1319. package/lib/util/scale.js.map +1 -0
  1320. package/lib/util/stat.d.ts +10 -0
  1321. package/lib/util/stat.js +41 -0
  1322. package/lib/util/stat.js.map +1 -0
  1323. package/lib/util/text.d.ts +23 -0
  1324. package/lib/util/text.js +88 -0
  1325. package/lib/util/text.js.map +1 -0
  1326. package/lib/util/tooltip.d.ts +26 -0
  1327. package/lib/util/tooltip.js +426 -0
  1328. package/lib/util/tooltip.js.map +1 -0
  1329. package/lib/util/transform.d.ts +33 -0
  1330. package/lib/util/transform.js +69 -0
  1331. package/lib/util/transform.js.map +1 -0
  1332. package/lib/util/types.d.ts +6 -0
  1333. package/lib/util/types.js +3 -0
  1334. package/lib/util/types.js.map +1 -0
  1335. package/package.json +4 -3
  1336. package/src/core.ts +1 -1
@@ -0,0 +1,1489 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var tslib_1 = require("tslib");
4
+ var adjust_1 = require("@antv/adjust");
5
+ var attr_1 = require("@antv/attr");
6
+ var util_1 = require("@antv/util");
7
+ var animate_1 = require("../animate");
8
+ var base_1 = (0, tslib_1.__importDefault)(require("../base"));
9
+ var constant_1 = require("../constant");
10
+ var helper_1 = require("../util/helper");
11
+ var element_1 = (0, tslib_1.__importDefault)(require("./element"));
12
+ var label_1 = require("./label");
13
+ var base_2 = require("./shape/base");
14
+ var group_data_1 = require("./util/group-data");
15
+ var is_model_change_1 = require("./util/is-model-change");
16
+ var parse_fields_1 = require("./util/parse-fields");
17
+ var diff_1 = require("./util/diff");
18
+ var scale_1 = require("../util/scale");
19
+ var coordinate_1 = require("../util/coordinate");
20
+ // 根据 elementId 查找对应的 label,因为有可能一个 element 对应多个 labels,所以在给 labels 打标识时做了处理
21
+ // 打标规则详见 ./label/base.ts#L263
22
+ function filterLabelsById(id, labelsMap) {
23
+ var labels = [];
24
+ (0, util_1.each)(labelsMap, function (label, labelId) {
25
+ var elementId = labelId.split(' ')[0];
26
+ if (elementId === id) {
27
+ labels.push(label);
28
+ }
29
+ });
30
+ return labels;
31
+ }
32
+ /**
33
+ * Geometry 几何标记基类,主要负责数据到图形属性的映射以及绘制逻辑。
34
+ */
35
+ var Geometry = /** @class */ (function (_super) {
36
+ (0, tslib_1.__extends)(Geometry, _super);
37
+ /**
38
+ * 创建 Geometry 实例。
39
+ * @param cfg
40
+ */
41
+ function Geometry(cfg) {
42
+ var _this = _super.call(this, cfg) || this;
43
+ /** Geometry 几何标记类型。 */
44
+ _this.type = 'base';
45
+ // 内部产生的属性
46
+ /** Attribute map */
47
+ _this.attributes = {};
48
+ /** Element map */
49
+ _this.elements = [];
50
+ /** 使用 key-value 结构存储 Element,key 为每个 Element 实例对应的唯一 ID */
51
+ _this.elementsMap = {};
52
+ /** animate 配置项 */
53
+ _this.animateOption = true;
54
+ /** 图形属性映射配置 */
55
+ _this.attributeOption = {};
56
+ /** 存储上一次渲染时的 element 映射表,用于更新逻辑 */
57
+ _this.lastElementsMap = {};
58
+ /** 是否生成多个点来绘制图形。 */
59
+ _this.generatePoints = false;
60
+ /** 存储发生图形属性映射前的数据 */
61
+ _this.beforeMappingData = null;
62
+ _this.adjusts = {};
63
+ _this.idFields = [];
64
+ _this.hasSorted = false;
65
+ _this.isCoordinateChanged = false;
66
+ var container = cfg.container, labelsContainer = cfg.labelsContainer, coordinate = cfg.coordinate, data = cfg.data, _a = cfg.sortable, sortable = _a === void 0 ? false : _a, _b = cfg.visible, visible = _b === void 0 ? true : _b, theme = cfg.theme, _c = cfg.scales, scales = _c === void 0 ? {} : _c, _d = cfg.scaleDefs, scaleDefs = _d === void 0 ? {} : _d,
67
+ // 柱状图间隔与宽度相关配置
68
+ intervalPadding = cfg.intervalPadding, dodgePadding = cfg.dodgePadding, maxColumnWidth = cfg.maxColumnWidth, minColumnWidth = cfg.minColumnWidth, columnWidthRatio = cfg.columnWidthRatio, roseWidthRatio = cfg.roseWidthRatio, multiplePieWidthRatio = cfg.multiplePieWidthRatio, zIndexReversed = cfg.zIndexReversed, sortZIndex = cfg.sortZIndex;
69
+ _this.container = container;
70
+ _this.labelsContainer = labelsContainer;
71
+ _this.coordinate = coordinate;
72
+ _this.data = data;
73
+ _this.sortable = sortable;
74
+ _this.visible = visible;
75
+ _this.userTheme = theme;
76
+ _this.scales = scales;
77
+ _this.scaleDefs = scaleDefs;
78
+ // 柱状图间隔与宽度相关配置
79
+ _this.intervalPadding = intervalPadding;
80
+ _this.dodgePadding = dodgePadding;
81
+ _this.maxColumnWidth = maxColumnWidth;
82
+ _this.minColumnWidth = minColumnWidth;
83
+ _this.columnWidthRatio = columnWidthRatio;
84
+ _this.roseWidthRatio = roseWidthRatio;
85
+ _this.multiplePieWidthRatio = multiplePieWidthRatio;
86
+ _this.zIndexReversed = zIndexReversed;
87
+ _this.sortZIndex = sortZIndex;
88
+ return _this;
89
+ }
90
+ /**
91
+ * 配置 position 通道映射规则。
92
+ *
93
+ * @example
94
+ * ```typescript
95
+ * // 数据结构: [{ x: 'A', y: 10, color: 'red' }]
96
+ * geometry.position('x*y');
97
+ * geometry.position([ 'x', 'y' ]);
98
+ * geometry.position({
99
+ * fields: [ 'x', 'y' ],
100
+ * });
101
+ * ```
102
+ *
103
+ * @param cfg 映射规则
104
+ * @returns
105
+ */
106
+ Geometry.prototype.position = function (cfg) {
107
+ var positionCfg = cfg;
108
+ if (!(0, util_1.isPlainObject)(cfg)) {
109
+ // 字符串字段或者数组字段
110
+ positionCfg = {
111
+ fields: (0, parse_fields_1.parseFields)(cfg),
112
+ };
113
+ }
114
+ var fields = (0, util_1.get)(positionCfg, 'fields');
115
+ if (fields.length === 1) {
116
+ // 默认填充一维 1*xx
117
+ fields.unshift('1');
118
+ (0, util_1.set)(positionCfg, 'fields', fields);
119
+ }
120
+ (0, util_1.set)(this.attributeOption, 'position', positionCfg);
121
+ return this;
122
+ };
123
+ Geometry.prototype.color = function (field, cfg) {
124
+ this.createAttrOption('color', field, cfg);
125
+ return this;
126
+ };
127
+ Geometry.prototype.shape = function (field, cfg) {
128
+ this.createAttrOption('shape', field, cfg);
129
+ return this;
130
+ };
131
+ Geometry.prototype.size = function (field, cfg) {
132
+ this.createAttrOption('size', field, cfg);
133
+ return this;
134
+ };
135
+ /**
136
+ * 设置数据调整方式。G2 目前内置了四种类型:
137
+ * 1. dodge
138
+ * 2. stack
139
+ * 3. symmetric
140
+ * 4. jitter
141
+ *
142
+ *
143
+ * **Tip**
144
+ * + 对于 'dodge' 类型,可以额外进行如下属性的配置:
145
+ * ```typescript
146
+ * geometry.adjust('dodge', {
147
+ * marginRatio: 0, // 取 0 到 1 范围的值(相对于每个柱子宽度),用于控制一个分组中柱子之间的间距
148
+ * dodgeBy: 'x', // 该属性只对 'dodge' 类型生效,声明以哪个数据字段为分组依据
149
+ * });
150
+ * ```
151
+ *
152
+ * + 对于 'stack' 类型,可以额外进行如下属性的配置:
153
+ * ```typescript
154
+ * geometry.adjust('stack', {
155
+ * reverseOrder: false, // 用于控制是否对数据进行反序操作
156
+ * });
157
+ * ```
158
+ *
159
+ * @example
160
+ * ```typescript
161
+ * geometry.adjust('stack');
162
+ *
163
+ * geometry.adjust({
164
+ * type: 'stack',
165
+ * reverseOrder: false,
166
+ * });
167
+ *
168
+ * // 组合使用 adjust
169
+ * geometry.adjust([ 'stack', 'dodge' ]);
170
+ *
171
+ * geometry.adjust([
172
+ * { type: 'stack' },
173
+ * { type: 'dodge', dodgeBy: 'x' },
174
+ * ]);
175
+ * ```
176
+ *
177
+ * @param adjustCfg 数据调整配置
178
+ * @returns
179
+ */
180
+ Geometry.prototype.adjust = function (adjustCfg) {
181
+ var adjusts = adjustCfg;
182
+ if ((0, util_1.isString)(adjustCfg) || (0, util_1.isPlainObject)(adjustCfg)) {
183
+ adjusts = [adjustCfg];
184
+ }
185
+ (0, util_1.each)(adjusts, function (adjust, index) {
186
+ if (!(0, util_1.isObject)(adjust)) {
187
+ adjusts[index] = { type: adjust };
188
+ }
189
+ });
190
+ this.adjustOption = adjusts;
191
+ return this;
192
+ };
193
+ Geometry.prototype.style = function (field, styleFunc) {
194
+ if ((0, util_1.isString)(field)) {
195
+ var fields = (0, parse_fields_1.parseFields)(field);
196
+ this.styleOption = {
197
+ fields: fields,
198
+ callback: styleFunc,
199
+ };
200
+ }
201
+ else {
202
+ var _a = field, fields = _a.fields, callback = _a.callback, cfg = _a.cfg;
203
+ if (fields || callback || cfg) {
204
+ this.styleOption = field;
205
+ }
206
+ else {
207
+ this.styleOption = {
208
+ cfg: field,
209
+ };
210
+ }
211
+ }
212
+ return this;
213
+ };
214
+ Geometry.prototype.tooltip = function (field, cfg) {
215
+ if ((0, util_1.isString)(field)) {
216
+ var fields = (0, parse_fields_1.parseFields)(field);
217
+ this.tooltipOption = {
218
+ fields: fields,
219
+ callback: cfg,
220
+ };
221
+ }
222
+ else {
223
+ this.tooltipOption = field;
224
+ }
225
+ return this;
226
+ };
227
+ /**
228
+ * Geometry 动画配置。
229
+ *
230
+ * + `animate(false)` 关闭动画
231
+ * + `animate(true)` 开启动画,默认开启。
232
+ *
233
+ * 我们将动画分为四个场景:
234
+ * 1. appear: 图表第一次加载时的入场动画;
235
+ * 2. enter: 图表绘制完成,发生更新后,产生的新图形的进场动画;
236
+ * 3. update: 图表绘制完成,数据发生变更后,有状态变更的图形的更新动画;
237
+ * 4. leave: 图表绘制完成,数据发生变更后,被销毁图形的销毁动画。
238
+ *
239
+ * @example
240
+ * ```typescript
241
+ * animate({
242
+ * enter: {
243
+ * duration: 1000, // enter 动画执行时间
244
+ * },
245
+ * leave: false, // 关闭 leave 销毁动画
246
+ * });
247
+ * ```
248
+ *
249
+ * @param cfg 动画配置
250
+ * @returns
251
+ */
252
+ Geometry.prototype.animate = function (cfg) {
253
+ this.animateOption = cfg;
254
+ return this;
255
+ };
256
+ Geometry.prototype.label = function (field, secondParam, thirdParam) {
257
+ if ((0, util_1.isString)(field)) {
258
+ var labelOption = {};
259
+ var fields = (0, parse_fields_1.parseFields)(field);
260
+ labelOption.fields = fields;
261
+ if ((0, util_1.isFunction)(secondParam)) {
262
+ labelOption.callback = secondParam;
263
+ }
264
+ else if ((0, util_1.isPlainObject)(secondParam)) {
265
+ labelOption.cfg = secondParam;
266
+ }
267
+ if (thirdParam) {
268
+ labelOption.cfg = thirdParam;
269
+ }
270
+ this.labelOption = labelOption;
271
+ }
272
+ else {
273
+ this.labelOption = field;
274
+ }
275
+ return this;
276
+ };
277
+ /**
278
+ * 设置状态对应的样式。
279
+ *
280
+ * @example
281
+ * ```ts
282
+ * chart.interval().state({
283
+ * selected: {
284
+ * animate: { duration: 100, easing: 'easeLinear' },
285
+ * style: {
286
+ * lineWidth: 2,
287
+ * stroke: '#000',
288
+ * },
289
+ * },
290
+ * });
291
+ * ```
292
+ *
293
+ * 如果图形 shape 是由多个 shape 组成,即为一个 G.Group 对象,那么针对 group 中的每个 shape,我们需要使用下列方式进行状态样式设置:
294
+ * 如果我们为 group 中的每个 shape 设置了 'name' 属性(shape.set('name', 'xx')),则以 'name' 作为 key,否则默认以索引值(即 shape 的 添加顺序)为 key。
295
+ *
296
+ * ```ts
297
+ * chart.interval().shape('groupShape').state({
298
+ * selected: {
299
+ * style: {
300
+ * 0: { lineWidth: 2 },
301
+ * 1: { fillOpacity: 1 },
302
+ * }
303
+ * }
304
+ * });
305
+ * ```
306
+ *
307
+ * @param cfg 状态样式
308
+ */
309
+ Geometry.prototype.state = function (cfg) {
310
+ this.stateOption = cfg;
311
+ return this;
312
+ };
313
+ /**
314
+ * 用于向 shape 中传入自定义的数据。目前可能仅仅可能用于在自定义 shape 的时候,像自定义 shape 中传入自定义的数据,方便实现自定义 shape 的配置能力。
315
+ *
316
+ * @example
317
+ * ```ts
318
+ * chart.interval().customInfo({ yourData: 'hello, g2!' });
319
+ * ```
320
+ *
321
+ * 然后在自定义 shape 的时候,可以拿到这个信息。
322
+ *
323
+ * ```ts
324
+ * registerShape('interval', 'your-shape', {
325
+ * draw(shapeInfo, container) {
326
+ * const { customInfo } = shapeInfo;
327
+ * console.log(customInfo); // will log { yourData: 'hello, g2!' }.
328
+ * }
329
+ * });
330
+ * ```
331
+ *
332
+ * @param cfg
333
+ */
334
+ Geometry.prototype.customInfo = function (cfg) {
335
+ this.customOption = cfg;
336
+ return this;
337
+ };
338
+ /**
339
+ * 初始化 Geomtry 实例:
340
+ * 创建 [[Attribute]] and [[Scale]] 实例,进行数据处理,包括分组、数值化以及数据调整。
341
+ */
342
+ Geometry.prototype.init = function (cfg) {
343
+ if (cfg === void 0) { cfg = {}; }
344
+ this.setCfg(cfg);
345
+ this.initAttributes(); // 创建图形属性
346
+ // 数据加工:分组 -> 数字化 -> adjust
347
+ this.processData(this.data);
348
+ // 调整 scale
349
+ this.adjustScale();
350
+ };
351
+ /**
352
+ * Geometry 更新。
353
+ * @param [cfg] 更新的配置
354
+ */
355
+ Geometry.prototype.update = function (cfg) {
356
+ if (cfg === void 0) { cfg = {}; }
357
+ var data = cfg.data, isDataChanged = cfg.isDataChanged, isCoordinateChanged = cfg.isCoordinateChanged;
358
+ var _a = this, attributeOption = _a.attributeOption, lastAttributeOption = _a.lastAttributeOption;
359
+ if (!(0, util_1.isEqual)(attributeOption, lastAttributeOption)) {
360
+ // 映射发生改变,则重新创建图形属性
361
+ this.init(cfg);
362
+ }
363
+ else if (data && (isDataChanged || !(0, util_1.isEqual)(data, this.data))) {
364
+ // 数据发生变化
365
+ this.setCfg(cfg);
366
+ this.initAttributes(); // 创建图形属性
367
+ this.processData(data); // 数据加工:分组 -> 数字化 -> adjust
368
+ }
369
+ else {
370
+ // 有可能 coordinate 变化
371
+ this.setCfg(cfg);
372
+ }
373
+ // 调整 scale
374
+ this.adjustScale();
375
+ this.isCoordinateChanged = isCoordinateChanged;
376
+ };
377
+ /**
378
+ * 将原始数据映射至图形空间,同时创建图形对象。
379
+ */
380
+ Geometry.prototype.paint = function (isUpdate) {
381
+ if (isUpdate === void 0) { isUpdate = false; }
382
+ if (this.animateOption) {
383
+ this.animateOption = (0, util_1.deepMix)({}, (0, animate_1.getDefaultAnimateCfg)(this.type, this.coordinate), this.animateOption);
384
+ }
385
+ this.defaultSize = undefined;
386
+ this.elementsMap = {};
387
+ this.elements = [];
388
+ var offscreenGroup = this.getOffscreenGroup();
389
+ offscreenGroup.clear();
390
+ var beforeMappingData = this.beforeMappingData;
391
+ var dataArray = this.beforeMapping(beforeMappingData);
392
+ this.dataArray = new Array(dataArray.length);
393
+ for (var i = 0; i < dataArray.length; i++) {
394
+ var data = dataArray[i];
395
+ this.dataArray[i] = this.mapping(data);
396
+ }
397
+ this.updateElements(this.dataArray, isUpdate);
398
+ this.lastElementsMap = this.elementsMap;
399
+ if (this.canDoGroupAnimation(isUpdate)) {
400
+ // 如果用户没有配置 appear.animation,就默认走整体动画
401
+ var container = this.container;
402
+ var type = this.type;
403
+ var coordinate = this.coordinate;
404
+ var animateCfg = (0, util_1.get)(this.animateOption, 'appear');
405
+ var yScale = this.getYScale();
406
+ var yMinPoint = coordinate.convert({
407
+ x: 0,
408
+ y: yScale.scale(this.getYMinValue()),
409
+ });
410
+ (0, animate_1.doGroupAppearAnimate)(container, animateCfg, type, coordinate, yMinPoint);
411
+ }
412
+ // 添加 label
413
+ if (this.labelOption) {
414
+ this.renderLabels((0, util_1.flatten)(this.dataArray), isUpdate);
415
+ }
416
+ // 缓存,用于更新
417
+ this.lastAttributeOption = (0, tslib_1.__assign)({}, this.attributeOption);
418
+ if (this.visible === false) {
419
+ // 用户在初始化的时候声明 visible: false
420
+ this.changeVisible(false);
421
+ }
422
+ };
423
+ /**
424
+ * 清空当前 Geometry,配置项仍保留,但是内部创建的对象全部清空。
425
+ * @override
426
+ */
427
+ Geometry.prototype.clear = function () {
428
+ var _a = this, container = _a.container, geometryLabel = _a.geometryLabel, offscreenGroup = _a.offscreenGroup;
429
+ if (container) {
430
+ container.clear();
431
+ }
432
+ if (geometryLabel) {
433
+ geometryLabel.clear();
434
+ }
435
+ if (offscreenGroup) {
436
+ offscreenGroup.clear();
437
+ }
438
+ // 属性恢复至出厂状态
439
+ this.scaleDefs = undefined;
440
+ this.attributes = {};
441
+ this.scales = {};
442
+ this.elementsMap = {};
443
+ this.lastElementsMap = {};
444
+ this.elements = [];
445
+ this.adjusts = {};
446
+ this.dataArray = null;
447
+ this.beforeMappingData = null;
448
+ this.lastAttributeOption = undefined;
449
+ this.defaultSize = undefined;
450
+ this.idFields = [];
451
+ this.groupScales = undefined;
452
+ this.hasSorted = false;
453
+ this.isCoordinateChanged = false;
454
+ };
455
+ /**
456
+ * 销毁 Geometry 实例。
457
+ */
458
+ Geometry.prototype.destroy = function () {
459
+ this.clear();
460
+ var container = this.container;
461
+ container.remove(true);
462
+ if (this.offscreenGroup) {
463
+ this.offscreenGroup.remove(true);
464
+ this.offscreenGroup = null;
465
+ }
466
+ if (this.geometryLabel) {
467
+ this.geometryLabel.destroy();
468
+ this.geometryLabel = null;
469
+ }
470
+ this.theme = undefined;
471
+ this.shapeFactory = undefined;
472
+ _super.prototype.destroy.call(this);
473
+ };
474
+ /**
475
+ * 获取决定分组的图形属性对应的 scale 实例。
476
+ * @returns
477
+ */
478
+ Geometry.prototype.getGroupScales = function () {
479
+ return this.groupScales;
480
+ };
481
+ /**
482
+ * 根据名字获取图形属性实例。
483
+ */
484
+ Geometry.prototype.getAttribute = function (name) {
485
+ return this.attributes[name];
486
+ };
487
+ /** 获取 x 轴对应的 scale 实例。 */
488
+ Geometry.prototype.getXScale = function () {
489
+ return this.getAttribute('position').scales[0];
490
+ };
491
+ /** 获取 y 轴对应的 scale 实例。 */
492
+ Geometry.prototype.getYScale = function () {
493
+ return this.getAttribute('position').scales[1];
494
+ };
495
+ /**
496
+ * 获取决定分组的图形属性实例。
497
+ */
498
+ Geometry.prototype.getGroupAttributes = function () {
499
+ var rst = [];
500
+ (0, util_1.each)(this.attributes, function (attr) {
501
+ if (constant_1.GROUP_ATTRS.includes(attr.type)) {
502
+ rst.push(attr);
503
+ }
504
+ });
505
+ return rst;
506
+ };
507
+ /** 获取图形属性默认的映射值。 */
508
+ Geometry.prototype.getDefaultValue = function (attrName) {
509
+ var value;
510
+ var attr = this.getAttribute(attrName);
511
+ if (attr && (0, util_1.isEmpty)(attr.scales)) {
512
+ // 获取映射至常量的值
513
+ value = attr.values[0];
514
+ }
515
+ return value;
516
+ };
517
+ /**
518
+ * 获取该数据发生图形映射后对应的 Attribute 图形空间数据。
519
+ * @param attr Attribute 图形属性实例。
520
+ * @param obj 需要进行映射的原始数据。
521
+ * @returns
522
+ */
523
+ Geometry.prototype.getAttributeValues = function (attr, obj) {
524
+ var params = [];
525
+ var scales = attr.scales;
526
+ for (var index = 0, length_1 = scales.length; index < length_1; index++) {
527
+ var scale = scales[index];
528
+ var field = scale.field;
529
+ if (scale.isIdentity) {
530
+ params.push(scale.values);
531
+ }
532
+ else {
533
+ params.push(obj[field]);
534
+ }
535
+ }
536
+ return attr.mapping.apply(attr, params);
537
+ };
538
+ /**
539
+ * 获取对应的 adjust 实例
540
+ * @param adjustType
541
+ * @returns
542
+ */
543
+ Geometry.prototype.getAdjust = function (adjustType) {
544
+ return this.adjusts[adjustType];
545
+ };
546
+ /**
547
+ * 获得 coordinate 实例
548
+ * @returns
549
+ */
550
+ Geometry.prototype.getCoordinate = function () {
551
+ return this.coordinate;
552
+ };
553
+ Geometry.prototype.getData = function () {
554
+ return this.data;
555
+ };
556
+ /**
557
+ * 获取 shape 对应的 marker 样式。
558
+ * @param shapeName shape 具体名字
559
+ * @param cfg marker 信息
560
+ * @returns
561
+ */
562
+ Geometry.prototype.getShapeMarker = function (shapeName, cfg) {
563
+ var shapeFactory = this.getShapeFactory();
564
+ return shapeFactory.getMarker(shapeName, cfg);
565
+ };
566
+ /**
567
+ * 根据一定的规则查找 Geometry 的 Elements。
568
+ *
569
+ * ```typescript
570
+ * getElementsBy((element) => {
571
+ * const data = element.getData();
572
+ *
573
+ * return data.a === 'a';
574
+ * });
575
+ * ```
576
+ *
577
+ * @param condition 定义查找规则的回调函数。
578
+ * @returns
579
+ */
580
+ Geometry.prototype.getElementsBy = function (condition) {
581
+ return this.elements.filter(function (element) { return condition(element); });
582
+ };
583
+ /**
584
+ * 获取 Geometry 的所有 Elements。
585
+ *
586
+ * ```typescript
587
+ * getElements();
588
+ * ```
589
+ */
590
+ Geometry.prototype.getElements = function () {
591
+ return this.elements;
592
+ };
593
+ /**
594
+ * 获取数据对应的唯一 id。
595
+ * @param data Element 对应的绘制数据
596
+ * @returns
597
+ */
598
+ Geometry.prototype.getElementId = function (data) {
599
+ data = (0, util_1.isArray)(data) ? data[0] : data;
600
+ var originData = data[constant_1.FIELD_ORIGIN];
601
+ // 如果用户声明了使用哪些字段作为 id 值
602
+ if (this.idFields.length) {
603
+ var elementId = originData[this.idFields[0]];
604
+ for (var index = 1; index < this.idFields.length; index++) {
605
+ elementId += '-' + originData[this.idFields[index]];
606
+ }
607
+ return elementId;
608
+ }
609
+ var type = this.type;
610
+ var xScale = this.getXScale();
611
+ var yScale = this.getYScale();
612
+ var xField = xScale.field || 'x';
613
+ var yField = yScale.field || 'y';
614
+ var yVal = originData[yField];
615
+ var xVal;
616
+ if (xScale.type === 'identity') {
617
+ xVal = xScale.values[0];
618
+ }
619
+ else {
620
+ xVal = originData[xField];
621
+ }
622
+ var id;
623
+ if (type === 'interval' || type === 'schema') {
624
+ id = "".concat(xVal);
625
+ }
626
+ else if (type === 'line' || type === 'area' || type === 'path') {
627
+ id = type;
628
+ }
629
+ else {
630
+ id = "".concat(xVal, "-").concat(yVal);
631
+ }
632
+ var groupScales = this.groupScales;
633
+ for (var index = 0, length_2 = groupScales.length; index < length_2; index++) {
634
+ var groupScale = groupScales[index];
635
+ var field = groupScale.field;
636
+ id = "".concat(id, "-").concat(originData[field]);
637
+ }
638
+ // 用户在进行 dodge 类型的 adjust 调整的时候设置了 dodgeBy 属性
639
+ var dodgeAdjust = this.getAdjust('dodge');
640
+ if (dodgeAdjust) {
641
+ var dodgeBy = dodgeAdjust.dodgeBy;
642
+ if (dodgeBy) {
643
+ id = "".concat(id, "-").concat(originData[dodgeBy]);
644
+ }
645
+ }
646
+ if (this.getAdjust('jitter')) {
647
+ id = "".concat(id, "-").concat(data.x, "-").concat(data.y);
648
+ }
649
+ return id;
650
+ };
651
+ /**
652
+ * 获取所有需要创建 scale 的字段名称。
653
+ */
654
+ Geometry.prototype.getScaleFields = function () {
655
+ var fields = [];
656
+ var tmpMap = new Map();
657
+ var _a = this, attributeOption = _a.attributeOption, labelOption = _a.labelOption, tooltipOption = _a.tooltipOption;
658
+ // 获取图形属性上的 fields
659
+ for (var attributeType in attributeOption) {
660
+ if (attributeOption.hasOwnProperty(attributeType)) {
661
+ var eachOpt = attributeOption[attributeType];
662
+ if (eachOpt.fields) {
663
+ (0, helper_1.uniq)(eachOpt.fields, fields, tmpMap);
664
+ }
665
+ else if (eachOpt.values) {
666
+ // 考虑 size(10), shape('circle') 等场景
667
+ (0, helper_1.uniq)(eachOpt.values, fields, tmpMap);
668
+ }
669
+ }
670
+ }
671
+ // 获取 label 上的字段
672
+ if (labelOption && labelOption.fields) {
673
+ (0, helper_1.uniq)(labelOption.fields, fields, tmpMap);
674
+ }
675
+ // 获取 tooltip 上的字段
676
+ if ((0, util_1.isObject)(tooltipOption) && tooltipOption.fields) {
677
+ (0, helper_1.uniq)(tooltipOption.fields, fields, tmpMap);
678
+ }
679
+ return fields;
680
+ };
681
+ /**
682
+ * 显示或者隐藏 geometry。
683
+ * @param visible
684
+ */
685
+ Geometry.prototype.changeVisible = function (visible) {
686
+ _super.prototype.changeVisible.call(this, visible);
687
+ var elements = this.elements;
688
+ for (var index = 0, length_3 = elements.length; index < length_3; index++) {
689
+ var element = elements[index];
690
+ element.changeVisible(visible);
691
+ }
692
+ if (visible) {
693
+ if (this.container) {
694
+ this.container.show();
695
+ }
696
+ if (this.labelsContainer) {
697
+ this.labelsContainer.show();
698
+ }
699
+ }
700
+ else {
701
+ if (this.container) {
702
+ this.container.hide();
703
+ }
704
+ if (this.labelsContainer) {
705
+ this.labelsContainer.hide();
706
+ }
707
+ }
708
+ };
709
+ /**
710
+ * 获得所有的字段
711
+ */
712
+ Geometry.prototype.getFields = function () {
713
+ var uniqMap = new Map();
714
+ var fields = [];
715
+ Object.values(this.attributeOption).forEach(function (cfg) {
716
+ var fs = (cfg === null || cfg === void 0 ? void 0 : cfg.fields) || [];
717
+ fs.forEach(function (f) {
718
+ if (!uniqMap.has(f)) {
719
+ fields.push(f);
720
+ }
721
+ uniqMap.set(f, true);
722
+ });
723
+ }, []);
724
+ return fields;
725
+ };
726
+ /**
727
+ * 获取当前配置中的所有分组 & 分类的字段。
728
+ * @return fields string[]
729
+ */
730
+ Geometry.prototype.getGroupFields = function () {
731
+ var groupFields = [];
732
+ var tmpMap = new Map(); // 用于去重过滤
733
+ for (var index = 0, length_4 = constant_1.GROUP_ATTRS.length; index < length_4; index++) {
734
+ var attributeName = constant_1.GROUP_ATTRS[index];
735
+ var cfg = this.attributeOption[attributeName];
736
+ if (cfg && cfg.fields) {
737
+ (0, helper_1.uniq)(cfg.fields, groupFields, tmpMap);
738
+ }
739
+ }
740
+ return groupFields;
741
+ };
742
+ /**
743
+ * 获得图形的 x y 字段。
744
+ */
745
+ Geometry.prototype.getXYFields = function () {
746
+ var _a = this.attributeOption.position.fields, x = _a[0], y = _a[1];
747
+ return [x, y];
748
+ };
749
+ /**
750
+ * x 字段
751
+ * @returns
752
+ */
753
+ Geometry.prototype.getXField = function () {
754
+ return (0, util_1.get)(this.getXYFields(), [0]);
755
+ };
756
+ /**
757
+ * y 字段
758
+ * @returns
759
+ */
760
+ Geometry.prototype.getYField = function () {
761
+ return (0, util_1.get)(this.getXYFields(), [1]);
762
+ };
763
+ /**
764
+ * 获取该 Geometry 下所有生成的 shapes。
765
+ * @returns shapes
766
+ */
767
+ Geometry.prototype.getShapes = function () {
768
+ return this.elements.map(function (element) { return element.shape; });
769
+ };
770
+ /**
771
+ * 获取虚拟 Group。
772
+ * @returns
773
+ */
774
+ Geometry.prototype.getOffscreenGroup = function () {
775
+ if (!this.offscreenGroup) {
776
+ var GroupCtor = this.container.getGroupBase(); // 获取分组的构造函数
777
+ this.offscreenGroup = new GroupCtor({});
778
+ }
779
+ return this.offscreenGroup;
780
+ };
781
+ // 对数据进行排序
782
+ Geometry.prototype.sort = function (mappingArray) {
783
+ if (!this.hasSorted) {
784
+ // 未发生过排序
785
+ var xScale_1 = this.getXScale();
786
+ var xField_1 = xScale_1.field;
787
+ for (var index = 0; index < mappingArray.length; index++) {
788
+ var itemArr = mappingArray[index];
789
+ itemArr.sort(function (obj1, obj2) {
790
+ return xScale_1.translate(obj1[constant_1.FIELD_ORIGIN][xField_1]) - xScale_1.translate(obj2[constant_1.FIELD_ORIGIN][xField_1]);
791
+ });
792
+ }
793
+ }
794
+ this.hasSorted = true;
795
+ };
796
+ /**
797
+ * 调整度量范围。主要针对发生层叠以及一些特殊需求的 Geometry,比如 Interval 下的柱状图 Y 轴默认从 0 开始。
798
+ */
799
+ Geometry.prototype.adjustScale = function () {
800
+ var yScale = this.getYScale();
801
+ // 如果数据发生过 stack adjust,需要调整下 yScale 的数据范围
802
+ if (yScale && this.getAdjust('stack')) {
803
+ this.updateStackRange(yScale, this.beforeMappingData);
804
+ }
805
+ };
806
+ /**
807
+ * 获取当前 Geometry 对应的 Shape 工厂实例。
808
+ */
809
+ Geometry.prototype.getShapeFactory = function () {
810
+ var shapeType = this.shapeType;
811
+ if (!(0, base_2.getShapeFactory)(shapeType)) {
812
+ return;
813
+ }
814
+ if (!this.shapeFactory) {
815
+ this.shapeFactory = (0, util_1.clone)((0, base_2.getShapeFactory)(shapeType)); // 防止多个 view 共享一个 shapeFactory 实例,导致 coordinate 被篡改
816
+ }
817
+ // 因为这里缓存了 shapeFactory,但是外部可能会变更 coordinate,导致无法重新设置到 shapeFactory 中
818
+ this.shapeFactory.coordinate = this.coordinate;
819
+ // theme 原因同上
820
+ this.shapeFactory.theme = this.theme.geometries[shapeType] || {};
821
+ return this.shapeFactory;
822
+ };
823
+ /**
824
+ * 获取每个 Shape 对应的关键点数据。
825
+ * @param obj 经过分组 -> 数字化 -> adjust 调整后的数据记录
826
+ * @returns
827
+ */
828
+ Geometry.prototype.createShapePointsCfg = function (obj) {
829
+ var xScale = this.getXScale();
830
+ var yScale = this.getYScale();
831
+ var x = this.normalizeValues(obj[xScale.field], xScale);
832
+ var y; // 存在没有 y 的情况
833
+ if (yScale) {
834
+ y = this.normalizeValues(obj[yScale.field], yScale);
835
+ }
836
+ else {
837
+ y = obj.y ? obj.y : 0.1;
838
+ }
839
+ return {
840
+ x: x,
841
+ y: y,
842
+ y0: yScale ? yScale.scale(this.getYMinValue()) : undefined,
843
+ };
844
+ };
845
+ /**
846
+ * 创建 Element 实例。
847
+ * @param mappingDatum Element 对应的绘制数据
848
+ * @param [isUpdate] 是否处于更新阶段
849
+ * @returns element 返回创建的 Element 实例
850
+ */
851
+ Geometry.prototype.createElement = function (mappingDatum, index, isUpdate) {
852
+ if (isUpdate === void 0) { isUpdate = false; }
853
+ var container = this.container;
854
+ var shapeCfg = this.getDrawCfg(mappingDatum); // 获取绘制图形的配置信息
855
+ var shapeFactory = this.getShapeFactory();
856
+ var element = new element_1.default({
857
+ shapeFactory: shapeFactory,
858
+ container: container,
859
+ offscreenGroup: this.getOffscreenGroup(),
860
+ elementIndex: index,
861
+ });
862
+ element.animate = this.animateOption;
863
+ element.geometry = this;
864
+ element.draw(shapeCfg, isUpdate); // 绘制
865
+ return element;
866
+ };
867
+ /**
868
+ * 获取每条数据对应的图形绘制数据。
869
+ * @param mappingDatum 映射后的数据
870
+ * @returns draw cfg
871
+ */
872
+ Geometry.prototype.getDrawCfg = function (mappingDatum) {
873
+ var originData = mappingDatum[constant_1.FIELD_ORIGIN]; // 原始数据
874
+ var cfg = {
875
+ mappingData: mappingDatum,
876
+ data: originData,
877
+ x: mappingDatum.x,
878
+ y: mappingDatum.y,
879
+ color: mappingDatum.color,
880
+ size: mappingDatum.size,
881
+ isInCircle: this.coordinate.isPolar,
882
+ customInfo: this.customOption,
883
+ };
884
+ var shapeName = mappingDatum.shape;
885
+ if (!shapeName && this.getShapeFactory()) {
886
+ shapeName = this.getShapeFactory().defaultShapeType;
887
+ }
888
+ cfg.shape = shapeName;
889
+ // 获取默认样式
890
+ var theme = this.theme.geometries[this.shapeType];
891
+ cfg.defaultStyle = (0, util_1.get)(theme, [shapeName, 'default'], {}).style;
892
+ if (!cfg.defaultStyle && this.getShapeFactory()) {
893
+ cfg.defaultStyle = this.getShapeFactory().getDefaultStyle(theme);
894
+ }
895
+ var styleOption = this.styleOption;
896
+ if (styleOption) {
897
+ cfg.style = this.getStyleCfg(styleOption, originData);
898
+ }
899
+ if (this.generatePoints) {
900
+ cfg.points = mappingDatum.points;
901
+ cfg.nextPoints = mappingDatum.nextPoints;
902
+ }
903
+ return cfg;
904
+ };
905
+ Geometry.prototype.updateElements = function (mappingDataArray, isUpdate) {
906
+ if (isUpdate === void 0) { isUpdate = false; }
907
+ var keyDatum = new Map();
908
+ var keys = [];
909
+ // 用来保持 diff 元素之后 added, updated 的相对顺序
910
+ var keyIndex = new Map();
911
+ var index = 0;
912
+ // 获得更新数据所有的 keys
913
+ // 将更新的数据用 key 索引
914
+ for (var i = 0; i < mappingDataArray.length; i++) {
915
+ var mappingData = mappingDataArray[i];
916
+ for (var j = 0; j < mappingData.length; j++) {
917
+ var mappingDatum = mappingData[j];
918
+ var key = this.getElementId(mappingDatum);
919
+ var finalKey = keyDatum.has(key) ? "".concat(key, "-").concat(i, "-").concat(j) : key;
920
+ keys.push(finalKey);
921
+ keyDatum.set(finalKey, mappingDatum);
922
+ keyIndex.set(finalKey, index);
923
+ index++;
924
+ }
925
+ }
926
+ this.elements = new Array(index);
927
+ var _a = (0, diff_1.diff)(this.lastElementsMap, keys), added = _a.added, updated = _a.updated, removed = _a.removed;
928
+ // 新建 element
929
+ for (var _i = 0, added_1 = added; _i < added_1.length; _i++) {
930
+ var key = added_1[_i];
931
+ var mappingDatum = keyDatum.get(key);
932
+ var i = keyIndex.get(key);
933
+ var element = this.createElement(mappingDatum, i, isUpdate);
934
+ this.elements[i] = element;
935
+ this.elementsMap[key] = element;
936
+ if (element.shape) {
937
+ element.shape.set('zIndex', this.zIndexReversed ? this.elements.length - i : i);
938
+ }
939
+ }
940
+ // 更新 element
941
+ for (var _b = 0, updated_1 = updated; _b < updated_1.length; _b++) {
942
+ var key = updated_1[_b];
943
+ var element = this.lastElementsMap[key];
944
+ var mappingDatum = keyDatum.get(key);
945
+ var currentShapeCfg = this.getDrawCfg(mappingDatum);
946
+ var preShapeCfg = element.getModel();
947
+ var i = keyIndex.get(key);
948
+ if (this.isCoordinateChanged || (0, is_model_change_1.isModelChange)(currentShapeCfg, preShapeCfg)) {
949
+ element.animate = this.animateOption;
950
+ // 通过绘制数据的变更来判断是否需要更新,因为用户有可能会修改图形属性映射
951
+ element.update(currentShapeCfg); // 更新对应的 element
952
+ }
953
+ this.elements[i] = element;
954
+ this.elementsMap[key] = element;
955
+ if (element.shape) {
956
+ element.shape.set('zIndex', this.zIndexReversed ? this.elements.length - i : i);
957
+ }
958
+ }
959
+ // 全部 setZIndex 之后,再执行 sort
960
+ if (this.container) {
961
+ this.container.sort();
962
+ }
963
+ // 销毁被删除的 elements
964
+ for (var _c = 0, removed_1 = removed; _c < removed_1.length; _c++) {
965
+ var key = removed_1[_c];
966
+ var element = this.lastElementsMap[key];
967
+ // 更新动画配置,用户有可能在更新之前有对动画进行配置操作
968
+ element.animate = this.animateOption;
969
+ element.destroy();
970
+ }
971
+ };
972
+ /**
973
+ * 获取渲染的 label 类型。
974
+ */
975
+ Geometry.prototype.getLabelType = function () {
976
+ var _a = this, labelOption = _a.labelOption, coordinate = _a.coordinate, type = _a.type;
977
+ var coordinateType = coordinate.type, isTransposed = coordinate.isTransposed;
978
+ var labelType = (0, util_1.get)(labelOption, ['cfg', 'type']);
979
+ if (!labelType) {
980
+ // 用户未定义,则进行默认的逻辑
981
+ if (coordinateType === 'polar') {
982
+ // 极坐标下使用通用的极坐标文本,转置则使用饼图
983
+ labelType = isTransposed ? 'pie' : 'polar';
984
+ }
985
+ else if (coordinateType === 'theta') {
986
+ // theta 坐标系下使用饼图文本
987
+ labelType = 'pie';
988
+ }
989
+ else if (type === 'interval' || type === 'polygon') {
990
+ labelType = 'interval';
991
+ }
992
+ else {
993
+ labelType = 'base';
994
+ }
995
+ }
996
+ return labelType;
997
+ };
998
+ /**
999
+ * 获取 Y 轴上的最小值。
1000
+ */
1001
+ Geometry.prototype.getYMinValue = function () {
1002
+ var yScale = this.getYScale();
1003
+ var min = yScale.min, max = yScale.max;
1004
+ var value;
1005
+ if (min >= 0) {
1006
+ value = min;
1007
+ }
1008
+ else if (max <= 0) {
1009
+ // 当值全位于负区间时,需要保证 ymin 在区域内,不可为 0
1010
+ value = max;
1011
+ }
1012
+ else {
1013
+ value = 0;
1014
+ }
1015
+ return value;
1016
+ };
1017
+ // 创建图形属性相关的配置项
1018
+ Geometry.prototype.createAttrOption = function (attrName, field, cfg) {
1019
+ if ((0, util_1.isNil)(field) || (0, util_1.isObject)(field)) {
1020
+ if ((0, util_1.isObject)(field) && (0, util_1.isEqual)(Object.keys(field), ['values'])) {
1021
+ // shape({ values: [ 'funnel' ] })
1022
+ (0, util_1.set)(this.attributeOption, attrName, {
1023
+ fields: field.values,
1024
+ });
1025
+ }
1026
+ else {
1027
+ (0, util_1.set)(this.attributeOption, attrName, field);
1028
+ }
1029
+ }
1030
+ else {
1031
+ var attrCfg = {};
1032
+ if ((0, util_1.isNumber)(field)) {
1033
+ // size(3)
1034
+ attrCfg.values = [field];
1035
+ }
1036
+ else {
1037
+ attrCfg.fields = (0, parse_fields_1.parseFields)(field);
1038
+ }
1039
+ if (cfg) {
1040
+ if ((0, util_1.isFunction)(cfg)) {
1041
+ attrCfg.callback = cfg;
1042
+ }
1043
+ else {
1044
+ attrCfg.values = cfg;
1045
+ }
1046
+ }
1047
+ (0, util_1.set)(this.attributeOption, attrName, attrCfg);
1048
+ }
1049
+ };
1050
+ Geometry.prototype.initAttributes = function () {
1051
+ var _this = this;
1052
+ var _a = this, attributes = _a.attributes, attributeOption = _a.attributeOption, theme = _a.theme, shapeType = _a.shapeType;
1053
+ this.groupScales = [];
1054
+ var tmpMap = {};
1055
+ var _loop_1 = function (attrType) {
1056
+ if (attributeOption.hasOwnProperty(attrType)) {
1057
+ var option = attributeOption[attrType];
1058
+ if (!option) {
1059
+ return { value: void 0 };
1060
+ }
1061
+ var attrCfg = (0, tslib_1.__assign)({}, option);
1062
+ var callback = attrCfg.callback, values = attrCfg.values, _b = attrCfg.fields, fields = _b === void 0 ? [] : _b;
1063
+ // 获取每一个字段对应的 scale
1064
+ var scales = fields.map(function (field) {
1065
+ var scale = _this.scales[field];
1066
+ if (!tmpMap[field] && constant_1.GROUP_ATTRS.includes(attrType)) {
1067
+ var inferedScaleType = (0, scale_1.inferScaleType)(scale, (0, util_1.get)(_this.scaleDefs, field), attrType, _this.type);
1068
+ if (inferedScaleType === 'cat') {
1069
+ _this.groupScales.push(scale);
1070
+ tmpMap[field] = true;
1071
+ }
1072
+ }
1073
+ return scale;
1074
+ });
1075
+ attrCfg.scales = scales;
1076
+ if (attrType !== 'position' && scales.length === 1 && scales[0].type === 'identity') {
1077
+ // 用户在图形通道上声明了常量字段 color('red'), size(5)
1078
+ attrCfg.values = scales[0].values;
1079
+ }
1080
+ else if (!callback && !values) {
1081
+ // 用户没有指定任何规则,则使用默认的映射规则
1082
+ if (attrType === 'size') {
1083
+ attrCfg.values = theme.sizes;
1084
+ }
1085
+ else if (attrType === 'shape') {
1086
+ attrCfg.values = theme.shapes[shapeType] || [];
1087
+ }
1088
+ else if (attrType === 'color') {
1089
+ if (scales.length) {
1090
+ // 根据数值个数使用对应的色板
1091
+ attrCfg.values = scales[0].values.length <= 10 ? theme.colors10 : theme.colors20;
1092
+ }
1093
+ else {
1094
+ attrCfg.values = theme.colors10;
1095
+ }
1096
+ }
1097
+ }
1098
+ var AttributeCtor = (0, attr_1.getAttribute)(attrType);
1099
+ attributes[attrType] = new AttributeCtor(attrCfg);
1100
+ }
1101
+ };
1102
+ // 遍历每一个 attrOption,各自创建 Attribute 实例
1103
+ for (var attrType in attributeOption) {
1104
+ var state_1 = _loop_1(attrType);
1105
+ if (typeof state_1 === "object")
1106
+ return state_1.value;
1107
+ }
1108
+ };
1109
+ // 处理数据:分组 -> 数字化 -> adjust 调整
1110
+ Geometry.prototype.processData = function (data) {
1111
+ this.hasSorted = false;
1112
+ var scales = this.getAttribute('position').scales;
1113
+ var categoryScales = scales.filter(function (scale) { return scale.isCategory; });
1114
+ var groupedArray = this.groupData(data); // 数据分组
1115
+ var beforeAdjust = [];
1116
+ for (var i = 0, len = groupedArray.length; i < len; i++) {
1117
+ var subData = groupedArray[i];
1118
+ var arr = [];
1119
+ for (var j = 0, subLen = subData.length; j < subLen; j++) {
1120
+ var originData = subData[j];
1121
+ var item = {};
1122
+ // tslint:disable-next-line: forin
1123
+ for (var k in originData) {
1124
+ item[k] = originData[k];
1125
+ }
1126
+ item[constant_1.FIELD_ORIGIN] = originData;
1127
+ // 将分类数据翻译成数据, 仅对位置相关的度量进行数字化处理
1128
+ for (var _i = 0, categoryScales_1 = categoryScales; _i < categoryScales_1.length; _i++) {
1129
+ var scale = categoryScales_1[_i];
1130
+ var field = scale.field;
1131
+ item[field] = scale.translate(item[field]);
1132
+ }
1133
+ arr.push(item);
1134
+ }
1135
+ beforeAdjust.push(arr);
1136
+ }
1137
+ var dataArray = this.adjustData(beforeAdjust); // 进行 adjust 数据调整
1138
+ this.beforeMappingData = dataArray;
1139
+ return dataArray;
1140
+ };
1141
+ // 调整数据
1142
+ Geometry.prototype.adjustData = function (dataArray) {
1143
+ var adjustOption = this.adjustOption;
1144
+ var _a = this, intervalPadding = _a.intervalPadding, dodgePadding = _a.dodgePadding, theme = _a.theme;
1145
+ // 兼容theme配置
1146
+ var maxColumnWidth = this.maxColumnWidth || theme.maxColumnWidth;
1147
+ var minColumnWidth = this.minColumnWidth || theme.minColumnWidth;
1148
+ var columnWidthRatio = this.columnWidthRatio || theme.columnWidthRatio;
1149
+ var result = dataArray;
1150
+ if (adjustOption) {
1151
+ var xScale_2 = this.getXScale();
1152
+ var yScale = this.getYScale();
1153
+ var xField = xScale_2.field;
1154
+ var yField = yScale ? yScale.field : null;
1155
+ var xDimensionLength = (0, coordinate_1.getXDimensionLength)(this.coordinate);
1156
+ var groupNum = xScale_2.values.length;
1157
+ // 传入size计算相关参数,默认宽度、最大最小宽度约束
1158
+ var sizeAttr = this.getAttribute('size');
1159
+ var defaultSize = void 0;
1160
+ if (sizeAttr) {
1161
+ defaultSize = sizeAttr.values[0];
1162
+ }
1163
+ for (var i = 0, len = adjustOption.length; i < len; i++) {
1164
+ var adjust = adjustOption[i];
1165
+ var adjustCfg = (0, tslib_1.__assign)({ xField: xField, yField: yField, intervalPadding: intervalPadding, dodgePadding: dodgePadding, xDimensionLength: xDimensionLength, groupNum: groupNum, defaultSize: defaultSize, maxColumnWidth: maxColumnWidth, minColumnWidth: minColumnWidth, columnWidthRatio: columnWidthRatio }, adjust);
1166
+ var type = adjust.type;
1167
+ if (type === 'dodge') {
1168
+ var adjustNames = [];
1169
+ if (xScale_2.isCategory || xScale_2.type === 'identity') {
1170
+ adjustNames.push('x');
1171
+ }
1172
+ else if (!yScale) {
1173
+ adjustNames.push('y');
1174
+ }
1175
+ else {
1176
+ throw new Error('dodge is not support linear attribute, please use category attribute!');
1177
+ }
1178
+ adjustCfg.adjustNames = adjustNames;
1179
+ // 每个分组内每条柱子的宽度占比,用户不可指定,用户需要通过 columnWidthRatio 指定
1180
+ // 兼容theme配置
1181
+ adjustCfg.dodgeRatio = columnWidthRatio;
1182
+ }
1183
+ else if (type === 'stack') {
1184
+ var coordinate = this.coordinate;
1185
+ if (!yScale) {
1186
+ // 一维的情况下获取高度和默认size
1187
+ adjustCfg.height = coordinate.getHeight();
1188
+ var size = this.getDefaultValue('size') || 3;
1189
+ adjustCfg.size = size;
1190
+ }
1191
+ // 不进行 transpose 时,用户又没有设置这个参数时,默认从上向下
1192
+ if (!coordinate.isTransposed && (0, util_1.isNil)(adjustCfg.reverseOrder)) {
1193
+ adjustCfg.reverseOrder = true;
1194
+ }
1195
+ }
1196
+ var adjustCtor = (0, adjust_1.getAdjust)(type);
1197
+ adjustCfg.dimValuesMap = {};
1198
+ //生成dimValuesMap
1199
+ if (xScale_2 && xScale_2.values) {
1200
+ adjustCfg.dimValuesMap[xScale_2.field] = xScale_2.values.map(function (v) { return xScale_2.translate(v); });
1201
+ }
1202
+ var adjustInstance = new adjustCtor(adjustCfg);
1203
+ result = adjustInstance.process(result);
1204
+ this.adjusts[type] = adjustInstance;
1205
+ }
1206
+ }
1207
+ return result;
1208
+ };
1209
+ // 对数据进行分组
1210
+ Geometry.prototype.groupData = function (data) {
1211
+ var groupScales = this.getGroupScales();
1212
+ var scaleDefs = this.scaleDefs;
1213
+ var appendConditions = {};
1214
+ var groupFields = [];
1215
+ for (var index = 0; index < groupScales.length; index++) {
1216
+ var scale = groupScales[index];
1217
+ var field = scale.field;
1218
+ groupFields.push(field);
1219
+ if ((0, util_1.get)(scaleDefs, [field, 'values'])) {
1220
+ // 用户通过 view.scale() 接口指定了 values 属性
1221
+ appendConditions[field] = scaleDefs[field].values;
1222
+ }
1223
+ }
1224
+ return (0, group_data_1.group)(data, groupFields, appendConditions);
1225
+ };
1226
+ // 更新发生层叠后的数据对应的度量范围
1227
+ Geometry.prototype.updateStackRange = function (scale, dataArray) {
1228
+ var mergeArray = (0, util_1.flatten)(dataArray);
1229
+ var field = scale.field;
1230
+ var min = scale.min;
1231
+ var max = scale.max;
1232
+ for (var index = 0; index < mergeArray.length; index++) {
1233
+ var obj = mergeArray[index];
1234
+ var tmpMin = Math.min.apply(null, obj[field]);
1235
+ var tmpMax = Math.max.apply(null, obj[field]);
1236
+ if (tmpMin < min) {
1237
+ min = tmpMin;
1238
+ }
1239
+ if (tmpMax > max) {
1240
+ max = tmpMax;
1241
+ }
1242
+ }
1243
+ var scaleDefs = this.scaleDefs;
1244
+ var cfg = {};
1245
+ if (min < scale.min && !(0, util_1.get)(scaleDefs, [field, 'min'])) {
1246
+ // 用户如果在列定义中定义了 min,则以用户定义的为准
1247
+ cfg.min = min;
1248
+ }
1249
+ if (max > scale.max && !(0, util_1.get)(scaleDefs, [field, 'max'])) {
1250
+ // 用户如果在列定义中定义了 max
1251
+ cfg.max = max;
1252
+ }
1253
+ scale.change(cfg);
1254
+ };
1255
+ // 将数据映射至图形空间前的操作:排序以及关键点的生成
1256
+ Geometry.prototype.beforeMapping = function (beforeMappingData) {
1257
+ // 当初加 clone 是因为 points 的引用关系,导致更新失败,可是现在貌似复现不出来了,所以暂时不进行 clone
1258
+ // const source = clone(beforeMappingData);
1259
+ var source = beforeMappingData;
1260
+ if (this.sortable) {
1261
+ this.sort(source);
1262
+ }
1263
+ if (this.generatePoints) {
1264
+ // 需要生成关键点
1265
+ for (var index = 0, length_5 = source.length; index < length_5; index++) {
1266
+ var currentData = source[index];
1267
+ this.generateShapePoints(currentData);
1268
+ var nextData = source[index + 1];
1269
+ if (nextData) {
1270
+ this.generateShapePoints(nextData);
1271
+ currentData[0].nextPoints = nextData[0].points;
1272
+ }
1273
+ }
1274
+ }
1275
+ return source;
1276
+ };
1277
+ // 生成 shape 的关键点
1278
+ Geometry.prototype.generateShapePoints = function (data) {
1279
+ var shapeFactory = this.getShapeFactory();
1280
+ var shapeAttr = this.getAttribute('shape');
1281
+ for (var index = 0; index < data.length; index++) {
1282
+ var obj = data[index];
1283
+ var cfg = this.createShapePointsCfg(obj);
1284
+ var shape = shapeAttr ? this.getAttributeValues(shapeAttr, obj) : null;
1285
+ var points = shapeFactory.getShapePoints(shape, cfg);
1286
+ obj.points = points;
1287
+ }
1288
+ };
1289
+ // 将数据归一化
1290
+ Geometry.prototype.normalizeValues = function (values, scale) {
1291
+ var rst = [];
1292
+ if ((0, util_1.isArray)(values)) {
1293
+ for (var index = 0; index < values.length; index++) {
1294
+ var value = values[index];
1295
+ rst.push(scale.scale(value));
1296
+ }
1297
+ }
1298
+ else {
1299
+ rst = scale.scale(values);
1300
+ }
1301
+ return rst;
1302
+ };
1303
+ // 将数据映射至图形空间
1304
+ Geometry.prototype.mapping = function (data) {
1305
+ var attributes = this.attributes;
1306
+ var mappingData = [];
1307
+ for (var index = 0; index < data.length; index++) {
1308
+ var record = data[index];
1309
+ var newRecord = {
1310
+ _origin: record[constant_1.FIELD_ORIGIN],
1311
+ points: record.points,
1312
+ nextPoints: record.nextPoints,
1313
+ };
1314
+ for (var k in attributes) {
1315
+ if (attributes.hasOwnProperty(k)) {
1316
+ var attr = attributes[k];
1317
+ var names = attr.names;
1318
+ var values = this.getAttributeValues(attr, record);
1319
+ if (names.length > 1) {
1320
+ // position 之类的生成多个字段的属性
1321
+ for (var j = 0; j < values.length; j += 1) {
1322
+ var val = values[j];
1323
+ var name_1 = names[j];
1324
+ newRecord[name_1] = (0, util_1.isArray)(val) && val.length === 1 ? val[0] : val; // 只有一个值时返回第一个属性值
1325
+ }
1326
+ }
1327
+ else {
1328
+ // values.length === 1 的判断是以下情况,获取用户设置的图形属性值
1329
+ // shape('a', ['dot', 'dash']), color('a', ['red', 'yellow'])
1330
+ newRecord[names[0]] = values.length === 1 ? values[0] : values;
1331
+ }
1332
+ }
1333
+ }
1334
+ this.convertPoint(newRecord); // 将 x、y 转换成画布坐标
1335
+ mappingData.push(newRecord);
1336
+ }
1337
+ return mappingData;
1338
+ };
1339
+ // 将归一化的坐标值转换成画布坐标
1340
+ Geometry.prototype.convertPoint = function (mappingRecord) {
1341
+ var x = mappingRecord.x, y = mappingRecord.y;
1342
+ var rstX;
1343
+ var rstY;
1344
+ var obj;
1345
+ var coordinate = this.coordinate;
1346
+ if ((0, util_1.isArray)(x) && (0, util_1.isArray)(y)) {
1347
+ rstX = [];
1348
+ rstY = [];
1349
+ for (var i = 0, j = 0, xLen = x.length, yLen = y.length; i < xLen && j < yLen; i += 1, j += 1) {
1350
+ obj = coordinate.convert({
1351
+ x: x[i],
1352
+ y: y[j],
1353
+ });
1354
+ rstX.push(obj.x);
1355
+ rstY.push(obj.y);
1356
+ }
1357
+ }
1358
+ else if ((0, util_1.isArray)(y)) {
1359
+ rstY = [];
1360
+ for (var index = 0; index < y.length; index++) {
1361
+ var yVal = y[index];
1362
+ obj = coordinate.convert({
1363
+ x: x,
1364
+ y: yVal,
1365
+ });
1366
+ if (rstX && rstX !== obj.x) {
1367
+ if (!(0, util_1.isArray)(rstX)) {
1368
+ rstX = [rstX];
1369
+ }
1370
+ rstX.push(obj.x);
1371
+ }
1372
+ else {
1373
+ rstX = obj.x;
1374
+ }
1375
+ rstY.push(obj.y);
1376
+ }
1377
+ }
1378
+ else if ((0, util_1.isArray)(x)) {
1379
+ rstX = [];
1380
+ for (var index = 0; index < x.length; index++) {
1381
+ var xVal = x[index];
1382
+ obj = coordinate.convert({
1383
+ x: xVal,
1384
+ y: y,
1385
+ });
1386
+ if (rstY && rstY !== obj.y) {
1387
+ if (!(0, util_1.isArray)(rstY)) {
1388
+ rstY = [rstY];
1389
+ }
1390
+ rstY.push(obj.y);
1391
+ }
1392
+ else {
1393
+ rstY = obj.y;
1394
+ }
1395
+ rstX.push(obj.x);
1396
+ }
1397
+ }
1398
+ else {
1399
+ var point = coordinate.convert({
1400
+ x: x,
1401
+ y: y,
1402
+ });
1403
+ rstX = point.x;
1404
+ rstY = point.y;
1405
+ }
1406
+ mappingRecord.x = rstX;
1407
+ mappingRecord.y = rstY;
1408
+ };
1409
+ // 获取 style 配置
1410
+ Geometry.prototype.getStyleCfg = function (styleOption, originData) {
1411
+ var _a = styleOption.fields, fields = _a === void 0 ? [] : _a, callback = styleOption.callback, cfg = styleOption.cfg;
1412
+ if (cfg) {
1413
+ // 用户直接配置样式属性
1414
+ return cfg;
1415
+ }
1416
+ var params = fields.map(function (field) {
1417
+ return originData[field];
1418
+ });
1419
+ return callback.apply(void 0, params);
1420
+ };
1421
+ Geometry.prototype.setCfg = function (cfg) {
1422
+ var _this = this;
1423
+ var coordinate = cfg.coordinate, data = cfg.data, theme = cfg.theme, scaleDefs = cfg.scaleDefs;
1424
+ if (coordinate) {
1425
+ this.coordinate = coordinate;
1426
+ }
1427
+ if (data) {
1428
+ this.data = data;
1429
+ }
1430
+ if (scaleDefs) {
1431
+ this.scaleDefs = scaleDefs;
1432
+ this.idFields = [];
1433
+ (0, util_1.each)(scaleDefs, function (scaleDef, field) {
1434
+ if (scaleDef && scaleDef.key) {
1435
+ _this.idFields.push(field);
1436
+ }
1437
+ });
1438
+ }
1439
+ if (theme) {
1440
+ this.theme = this.userTheme ? (0, util_1.deepMix)({}, theme, this.userTheme) : theme; // 支持 geometry 层级的主题设置
1441
+ }
1442
+ };
1443
+ Geometry.prototype.renderLabels = function (mappingArray, isUpdate) {
1444
+ if (isUpdate === void 0) { isUpdate = false; }
1445
+ var geometryLabel = this.geometryLabel;
1446
+ if (!geometryLabel) {
1447
+ // 初次创建
1448
+ var labelType = this.getLabelType();
1449
+ var GeometryLabelsCtor = (0, label_1.getGeometryLabel)(labelType);
1450
+ geometryLabel = new GeometryLabelsCtor(this);
1451
+ this.geometryLabel = geometryLabel;
1452
+ }
1453
+ geometryLabel.render(mappingArray, isUpdate);
1454
+ // 将 label 同 element 进行关联
1455
+ var labelsMap = geometryLabel.labelsRenderer.shapesMap;
1456
+ (0, util_1.each)(this.elementsMap, function (element, id) {
1457
+ var labels = filterLabelsById(id, labelsMap); // element 实例同 label 进行绑定
1458
+ if (labels.length) {
1459
+ element.labelShape = labels;
1460
+ for (var i = 0; i < labels.length; i++) {
1461
+ var label = labels[i];
1462
+ var labelChildren = label.getChildren();
1463
+ for (var j = 0; j < labelChildren.length; j++) {
1464
+ var child = labelChildren[j];
1465
+ child.cfg.name = ['element', 'label'];
1466
+ child.cfg.element = element;
1467
+ }
1468
+ }
1469
+ }
1470
+ });
1471
+ };
1472
+ /**
1473
+ * 是否需要进行群组入场动画
1474
+ * 规则:
1475
+ * 1. 如果发生更新,则不进行
1476
+ * 2. 如果用户关闭 geometry 动画,则不进行
1477
+ * 3. 如果用户关闭了 appear 动画,则不进行
1478
+ * 4. 如果用户配置了 appear.animation,则不进行
1479
+ */
1480
+ Geometry.prototype.canDoGroupAnimation = function (isUpdate) {
1481
+ return (!isUpdate &&
1482
+ this.animateOption &&
1483
+ ((0, util_1.get)(this.animateOption, 'appear') === undefined ||
1484
+ ((0, util_1.get)(this.animateOption, 'appear') && (0, util_1.get)(this.animateOption, ['appear', 'animation']) === undefined)));
1485
+ };
1486
+ return Geometry;
1487
+ }(base_1.default));
1488
+ exports.default = Geometry;
1489
+ //# sourceMappingURL=base.js.map