@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,1637 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerGeometry = exports.View = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var util_1 = require("@antv/util");
6
+ var constant_1 = require("../constant");
7
+ var base_1 = (0, tslib_1.__importDefault)(require("../base"));
8
+ var facet_1 = require("../facet");
9
+ var interaction_1 = require("../interaction");
10
+ var theme_1 = require("../theme");
11
+ var bbox_1 = require("../util/bbox");
12
+ var coordinate_1 = require("../util/coordinate");
13
+ var helper_1 = require("../util/helper");
14
+ var tooltip_1 = require("../util/tooltip");
15
+ var padding_1 = require("../util/padding");
16
+ var scale_1 = require("../util/scale");
17
+ var util_2 = require("../theme/util");
18
+ var controller_1 = require("./controller");
19
+ var coordinate_2 = (0, tslib_1.__importDefault)(require("./controller/coordinate"));
20
+ var event_1 = (0, tslib_1.__importDefault)(require("./event"));
21
+ var layout_1 = (0, tslib_1.__importDefault)(require("./layout"));
22
+ var scale_pool_1 = require("./util/scale-pool");
23
+ var padding_cal_1 = require("./layout/padding-cal");
24
+ var auto_1 = require("./layout/auto");
25
+ var sync_view_padding_1 = require("./util/sync-view-padding");
26
+ /**
27
+ * G2 视图 View 类
28
+ */
29
+ var View = /** @class */ (function (_super) {
30
+ (0, tslib_1.__extends)(View, _super);
31
+ function View(props) {
32
+ var _this = _super.call(this, { visible: props.visible }) || this;
33
+ /** 所有的子 view。 */
34
+ _this.views = [];
35
+ /** 所有的 geometry 实例。 */
36
+ _this.geometries = [];
37
+ /** 所有的组件 controllers。 */
38
+ _this.controllers = [];
39
+ /** 所有的 Interaction 实例。 */
40
+ _this.interactions = {};
41
+ /** 是否对超出坐标系范围的 Geometry 进行剪切 */
42
+ _this.limitInPlot = false;
43
+ // 配置信息存储
44
+ _this.options = {
45
+ data: [],
46
+ animate: true, // 默认开启动画
47
+ }; // 初始化为空
48
+ /** 配置开启的组件插件,默认为全局配置的组件。 */
49
+ _this.usedControllers = (0, controller_1.getComponentControllerNames)();
50
+ /** 所有的 scales */
51
+ _this.scalePool = new scale_pool_1.ScalePool();
52
+ /** 布局函数 */
53
+ _this.layoutFunc = layout_1.default;
54
+ /** 当前鼠标是否在 plot 内(CoordinateBBox) */
55
+ _this.isPreMouseInPlot = false;
56
+ /** 默认标识位,用于判定数据是否更新 */
57
+ _this.isDataChanged = false;
58
+ /** 用于判断坐标系范围是否发生变化的标志位 */
59
+ _this.isCoordinateChanged = false;
60
+ /** 从当前这个 view 创建的 scale key */
61
+ _this.createdScaleKeys = new Map();
62
+ _this.onCanvasEvent = function (evt) {
63
+ var name = evt.name;
64
+ if (!name.includes(':')) {
65
+ // 非委托事件
66
+ var e = _this.createViewEvent(evt);
67
+ // 处理 plot 事件
68
+ _this.doPlotEvent(e);
69
+ _this.emit(name, e);
70
+ }
71
+ };
72
+ /**
73
+ * 触发事件之后
74
+ * @param evt
75
+ */
76
+ _this.onDelegateEvents = function (evt) {
77
+ // 阻止继续冒泡,防止重复事件触发
78
+ // evt.preventDefault();
79
+ var name = evt.name;
80
+ if (!name.includes(':')) {
81
+ return;
82
+ }
83
+ // 事件在 view 嵌套中冒泡(暂不提供阻止冒泡的机制)
84
+ var e = _this.createViewEvent(evt);
85
+ // 包含有基本事件、组合事件
86
+ _this.emit(name, e);
87
+ // const currentTarget = evt.currentTarget as IShape;
88
+ // const inheritNames = currentTarget.get('inheritNames');
89
+ // if (evt.delegateObject || inheritNames) {
90
+ // const events = this.getEvents();
91
+ // each(inheritNames, (subName) => {
92
+ // const eventName = `${subName}:${type}`;
93
+ // if (events[eventName]) {
94
+ // this.emit(eventName, e);
95
+ // }
96
+ // });
97
+ // }
98
+ };
99
+ var _a = props.id, id = _a === void 0 ? (0, util_1.uniqueId)('view') : _a, parent = props.parent, canvas = props.canvas, backgroundGroup = props.backgroundGroup, middleGroup = props.middleGroup, foregroundGroup = props.foregroundGroup, _b = props.region, region = _b === void 0 ? { start: { x: 0, y: 0 }, end: { x: 1, y: 1 } } : _b, padding = props.padding, appendPadding = props.appendPadding, theme = props.theme, options = props.options, limitInPlot = props.limitInPlot, syncViewPadding = props.syncViewPadding;
100
+ _this.parent = parent;
101
+ _this.canvas = canvas;
102
+ _this.backgroundGroup = backgroundGroup;
103
+ _this.middleGroup = middleGroup;
104
+ _this.foregroundGroup = foregroundGroup;
105
+ _this.region = region;
106
+ _this.padding = padding;
107
+ _this.appendPadding = appendPadding;
108
+ // 接受父 view 传入的参数
109
+ _this.options = (0, tslib_1.__assign)((0, tslib_1.__assign)({}, _this.options), options);
110
+ _this.limitInPlot = limitInPlot;
111
+ _this.id = id;
112
+ _this.syncViewPadding = syncViewPadding;
113
+ // 初始化 theme
114
+ _this.themeObject = (0, util_1.isObject)(theme) ? (0, util_1.deepMix)({}, (0, theme_1.getTheme)('default'), (0, util_2.createTheme)(theme)) : (0, theme_1.getTheme)(theme);
115
+ _this.init();
116
+ return _this;
117
+ }
118
+ /**
119
+ * 设置 layout 布局函数
120
+ * @param layout 布局函数
121
+ * @returns void
122
+ */
123
+ View.prototype.setLayout = function (layout) {
124
+ this.layoutFunc = layout;
125
+ };
126
+ /**
127
+ * 生命周期:初始化
128
+ * @returns voids
129
+ */
130
+ View.prototype.init = function () {
131
+ // 计算画布的 viewBBox
132
+ this.calculateViewBBox();
133
+ // 事件委托机制
134
+ this.initEvents();
135
+ // 初始化组件 controller
136
+ this.initComponentController();
137
+ this.initOptions();
138
+ };
139
+ /**
140
+ * 生命周期:渲染流程,渲染过程需要处理数据更新的情况。
141
+ * render 函数仅仅会处理 view 和子 view。
142
+ * @param isUpdate 是否触发更新流程。
143
+ * @param params render 事件参数
144
+ */
145
+ View.prototype.render = function (isUpdate, payload) {
146
+ if (isUpdate === void 0) { isUpdate = false; }
147
+ this.emit(constant_1.VIEW_LIFE_CIRCLE.BEFORE_RENDER, event_1.default.fromData(this, constant_1.VIEW_LIFE_CIRCLE.BEFORE_RENDER, payload));
148
+ // 递归渲染
149
+ this.paint(isUpdate);
150
+ this.emit(constant_1.VIEW_LIFE_CIRCLE.AFTER_RENDER, event_1.default.fromData(this, constant_1.VIEW_LIFE_CIRCLE.AFTER_RENDER, payload));
151
+ if (this.visible === false) {
152
+ // 用户在初始化的时候声明 visible: false
153
+ this.changeVisible(false);
154
+ }
155
+ };
156
+ /**
157
+ * 生命周期:清空图表上所有的绘制内容,但是不销毁图表,chart 仍可使用。
158
+ * @returns void
159
+ */
160
+ View.prototype.clear = function () {
161
+ var _this = this;
162
+ this.emit(constant_1.VIEW_LIFE_CIRCLE.BEFORE_CLEAR);
163
+ // 1. 清空缓存和计算数据
164
+ this.filteredData = [];
165
+ this.coordinateInstance = undefined;
166
+ this.isDataChanged = false; // 复位
167
+ this.isCoordinateChanged = false; // 复位
168
+ // 2. 清空 geometries
169
+ var geometries = this.geometries;
170
+ for (var i = 0; i < geometries.length; i++) {
171
+ geometries[i].clear();
172
+ // view 中使用 geometry 的时候,还需要清空它的容器,不然下一次 chart.geometry() 的时候,又创建了一个,导致泄露, #2799。
173
+ geometries[i].container.remove(true);
174
+ geometries[i].labelsContainer.remove(true);
175
+ }
176
+ this.geometries = [];
177
+ // 3. 清空 controllers
178
+ var controllers = this.controllers;
179
+ for (var i = 0; i < controllers.length; i++) {
180
+ if (controllers[i].name === 'annotation') {
181
+ // 需要清空配置项
182
+ controllers[i].clear(true);
183
+ }
184
+ else {
185
+ controllers[i].clear();
186
+ }
187
+ }
188
+ // 4. 删除 scale 缓存
189
+ this.createdScaleKeys.forEach(function (v, k) {
190
+ _this.getRootView().scalePool.deleteScale(k);
191
+ });
192
+ this.createdScaleKeys.clear();
193
+ // 递归处理子 view
194
+ var views = this.views;
195
+ for (var i = 0; i < views.length; i++) {
196
+ views[i].clear();
197
+ }
198
+ this.emit(constant_1.VIEW_LIFE_CIRCLE.AFTER_CLEAR);
199
+ };
200
+ /**
201
+ * 生命周期:销毁,完全无法使用。
202
+ * @returns void
203
+ */
204
+ View.prototype.destroy = function () {
205
+ // 销毁前事件,销毁之后已经没有意义了,所以不抛出事件
206
+ this.emit(constant_1.VIEW_LIFE_CIRCLE.BEFORE_DESTROY);
207
+ var interactions = this.interactions;
208
+ // 销毁 interactions
209
+ (0, util_1.each)(interactions, function (interaction) {
210
+ if (interaction) {
211
+ // 有可能已经销毁,设置了 undefined
212
+ interaction.destroy();
213
+ }
214
+ });
215
+ this.clear();
216
+ // 销毁 controller 中的组件
217
+ var controllers = this.controllers;
218
+ for (var i = 0, len = controllers.length; i < len; i++) {
219
+ var controller = controllers[i];
220
+ controller.destroy();
221
+ }
222
+ this.backgroundGroup.remove(true);
223
+ this.middleGroup.remove(true);
224
+ this.foregroundGroup.remove(true);
225
+ _super.prototype.destroy.call(this);
226
+ };
227
+ /* end 生命周期函数 */
228
+ /**
229
+ * 显示或者隐藏整个 view。
230
+ * @param visible 是否可见
231
+ * @returns View
232
+ */
233
+ View.prototype.changeVisible = function (visible) {
234
+ _super.prototype.changeVisible.call(this, visible);
235
+ var geometries = this.geometries;
236
+ for (var i = 0, len = geometries.length; i < len; i++) {
237
+ var geometry = geometries[i];
238
+ geometry.changeVisible(visible);
239
+ }
240
+ var controllers = this.controllers;
241
+ for (var i = 0, len = controllers.length; i < len; i++) {
242
+ var controller = controllers[i];
243
+ controller.changeVisible(visible);
244
+ }
245
+ this.foregroundGroup.set('visible', visible);
246
+ this.middleGroup.set('visible', visible);
247
+ this.backgroundGroup.set('visible', visible);
248
+ // group.set('visible', visible) 不会触发自动刷新
249
+ this.getCanvas().draw();
250
+ return this;
251
+ };
252
+ /**
253
+ * 装载数据源。
254
+ *
255
+ * ```ts
256
+ * view.data([{ city: '杭州', sale: 100 }, { city: '上海', sale: 110 } ]);
257
+ * ```
258
+ *
259
+ * @param data 数据源,json 数组。
260
+ * @returns View
261
+ */
262
+ View.prototype.data = function (data) {
263
+ (0, util_1.set)(this.options, 'data', data);
264
+ this.isDataChanged = true;
265
+ return this;
266
+ };
267
+ /**
268
+ * @deprecated
269
+ * This method will be removed at G2 V4.1. Replaced by {@link #data(data)}
270
+ */
271
+ View.prototype.source = function (data) {
272
+ console.warn('This method will be removed at G2 V4.1. Please use chart.data() instead.');
273
+ return this.data(data);
274
+ };
275
+ /**
276
+ * 设置数据筛选规则。
277
+ *
278
+ * ```ts
279
+ * view.filter('city', (value: any, datum: Datum) => value !== '杭州');
280
+ *
281
+ * // 删除 'city' 字段对应的筛选规则。
282
+ * view.filter('city', null);
283
+ * ```
284
+ *
285
+ * @param field 数据字段
286
+ * @param condition 筛选规则
287
+ * @returns View
288
+ */
289
+ View.prototype.filter = function (field, condition) {
290
+ if ((0, util_1.isFunction)(condition)) {
291
+ (0, util_1.set)(this.options, ['filters', field], condition);
292
+ return this;
293
+ }
294
+ // condition 为空,则表示删除过滤条件
295
+ if (!condition && (0, util_1.get)(this.options, ['filters', field])) {
296
+ delete this.options.filters[field];
297
+ }
298
+ return this;
299
+ };
300
+ View.prototype.axis = function (field, axisOption) {
301
+ if ((0, util_1.isBoolean)(field)) {
302
+ (0, util_1.set)(this.options, ['axes'], field);
303
+ }
304
+ else {
305
+ (0, util_1.set)(this.options, ['axes', field], axisOption);
306
+ }
307
+ return this;
308
+ };
309
+ View.prototype.legend = function (field, legendOption) {
310
+ if ((0, util_1.isBoolean)(field)) {
311
+ (0, util_1.set)(this.options, ['legends'], field);
312
+ }
313
+ else if ((0, util_1.isString)(field)) {
314
+ (0, util_1.set)(this.options, ['legends', field], legendOption);
315
+ if ((0, util_1.isPlainObject)(legendOption) && (legendOption === null || legendOption === void 0 ? void 0 : legendOption.selected)) {
316
+ (0, util_1.set)(this.options, ['filters', field], function (name) {
317
+ var _a;
318
+ return (_a = legendOption === null || legendOption === void 0 ? void 0 : legendOption.selected[name]) !== null && _a !== void 0 ? _a : true;
319
+ });
320
+ }
321
+ }
322
+ else {
323
+ // 设置全局的 legend 配置
324
+ (0, util_1.set)(this.options, ['legends'], field);
325
+ }
326
+ return this;
327
+ };
328
+ View.prototype.scale = function (field, scaleOption) {
329
+ var _this = this;
330
+ if ((0, util_1.isString)(field)) {
331
+ (0, util_1.set)(this.options, ['scales', field], scaleOption);
332
+ }
333
+ else if ((0, util_1.isObject)(field)) {
334
+ (0, util_1.each)(field, function (v, k) {
335
+ (0, util_1.set)(_this.options, ['scales', k], v);
336
+ });
337
+ }
338
+ return this;
339
+ };
340
+ /**
341
+ * tooltip 提示信息配置。
342
+ *
343
+ * ```ts
344
+ * view.tooltip(false); // 关闭 tooltip
345
+ *
346
+ * view.tooltip({
347
+ * shared: true
348
+ * });
349
+ * ```
350
+ *
351
+ * @param cfg Tooltip 配置,更详细的配置项参考:https://github.com/antvis/component#tooltip
352
+ * @returns View
353
+ */
354
+ View.prototype.tooltip = function (cfg) {
355
+ (0, util_1.set)(this.options, 'tooltip', cfg);
356
+ return this;
357
+ };
358
+ /**
359
+ * 辅助标记配置。
360
+ *
361
+ * ```ts
362
+ * view.annotation().line({
363
+ * start: ['min', 85],
364
+ * end: ['max', 85],
365
+ * style: {
366
+ * stroke: '#595959',
367
+ * lineWidth: 1,
368
+ * lineDash: [3, 3],
369
+ * },
370
+ * });
371
+ * ```
372
+ * 更详细的配置项:https://github.com/antvis/component#annotation
373
+ * @returns [[Annotation]]
374
+ */
375
+ View.prototype.annotation = function () {
376
+ return this.getController('annotation');
377
+ };
378
+ /**
379
+ * @deprecated
380
+ * This method will be removed at G2 V4.1. Replaced by {@link #guide()}
381
+ */
382
+ View.prototype.guide = function () {
383
+ console.warn('This method will be removed at G2 V4.1. Please use chart.annotation() instead.');
384
+ return this.annotation();
385
+ };
386
+ View.prototype.coordinate = function (type, coordinateCfg) {
387
+ // 提供语法糖,使用更简单
388
+ if ((0, util_1.isString)(type)) {
389
+ (0, util_1.set)(this.options, 'coordinate', { type: type, cfg: coordinateCfg });
390
+ }
391
+ else {
392
+ (0, util_1.set)(this.options, 'coordinate', type);
393
+ }
394
+ // 更新 coordinate 配置
395
+ this.coordinateController.update(this.options.coordinate);
396
+ return this.coordinateController;
397
+ };
398
+ /**
399
+ * @deprecated
400
+ * This method will be removed at G2 V4.1. Replaced by {@link #coordinate()}
401
+ */
402
+ View.prototype.coord = function (type, coordinateCfg) {
403
+ console.warn('This method will be removed at G2 V4.1. Please use chart.coordinate() instead.');
404
+ // @ts-ignore
405
+ return this.coordinate(type, coordinateCfg);
406
+ };
407
+ /**
408
+ * view 分面绘制。
409
+ *
410
+ * ```ts
411
+ * view.facet('rect', {
412
+ * rowField: 'province',
413
+ * columnField: 'category',
414
+ * eachView: (innerView: View, facet?: FacetData) => {
415
+ * innerView.line().position('city*sale');
416
+ * },
417
+ * });
418
+ * ```
419
+ *
420
+ * @param type 分面类型
421
+ * @param cfg 分面配置, [[FacetCfgMap]]
422
+ * @returns View
423
+ */
424
+ View.prototype.facet = function (type, cfg) {
425
+ // 先销毁掉之前的分面
426
+ if (this.facetInstance) {
427
+ this.facetInstance.destroy();
428
+ }
429
+ // 创建新的分面
430
+ var Ctor = (0, facet_1.getFacet)(type);
431
+ if (!Ctor) {
432
+ throw new Error("facet '".concat(type, "' is not exist!"));
433
+ }
434
+ this.facetInstance = new Ctor(this, (0, tslib_1.__assign)((0, tslib_1.__assign)({}, cfg), { type: type }));
435
+ return this;
436
+ };
437
+ /*
438
+ * 开启或者关闭动画。
439
+ *
440
+ * ```ts
441
+ * view.animate(false);
442
+ * ```
443
+ *
444
+ * @param status 动画状态,true 表示开始,false 表示关闭
445
+ * @returns View
446
+ */
447
+ View.prototype.animate = function (status) {
448
+ (0, util_1.set)(this.options, 'animate', status);
449
+ return this;
450
+ };
451
+ /**
452
+ * 更新配置项,用于配置项式声明。
453
+ * @param options 配置项
454
+ */
455
+ View.prototype.updateOptions = function (options) {
456
+ this.clear(); // 清空
457
+ (0, util_1.mix)(this.options, options);
458
+ // 需要把已存在的 view 销毁,否则会重复创建
459
+ // 目前针对配置项还没有特别好的 view 更新机制,为了不影响主流流程,所以在这里直接销毁
460
+ this.views.forEach(function (view) { return view.destroy(); });
461
+ this.views = [];
462
+ this.initOptions();
463
+ // 初始化坐标系大小,保证 padding 计算正确
464
+ this.coordinateBBox = this.viewBBox;
465
+ return this;
466
+ };
467
+ /**
468
+ * 往 `view.options` 属性中存储配置项。
469
+ * @param name 属性名称
470
+ * @param opt 属性值
471
+ * @returns view
472
+ */
473
+ View.prototype.option = function (name, opt) {
474
+ // 对于内置的 option,避免覆盖。
475
+ // name 在原型上,说明可能是内置 API,存在 option 被覆盖的风险,不处理
476
+ if (View.prototype[name]) {
477
+ throw new Error("Can't use built in variable name \"".concat(name, "\", please change another one."));
478
+ }
479
+ // 存入到 option 中
480
+ (0, util_1.set)(this.options, name, opt);
481
+ return this;
482
+ };
483
+ /**
484
+ * 设置主题。
485
+ *
486
+ * ```ts
487
+ * view.theme('dark'); // 'dark' 需要事先通过 `registerTheme()` 接口注册完成
488
+ *
489
+ * view.theme({ defaultColor: 'red' });
490
+ * ```
491
+ *
492
+ * @param theme 主题名或者主题配置
493
+ * @returns View
494
+ */
495
+ View.prototype.theme = function (theme) {
496
+ this.themeObject = (0, util_1.isObject)(theme) ? (0, util_1.deepMix)({}, this.themeObject, (0, util_2.createTheme)(theme)) : (0, theme_1.getTheme)(theme);
497
+ return this;
498
+ };
499
+ /* end 一系列传入配置的 API */
500
+ /**
501
+ * Call the interaction based on the interaction name
502
+ *
503
+ * ```ts
504
+ * view.interaction('my-interaction', { extra: 'hello world' });
505
+ * ```
506
+ * 详细文档可以参考:https://g2.antv.vision/zh/docs/api/general/interaction
507
+ * @param name interaction name
508
+ * @param cfg interaction config
509
+ * @returns
510
+ */
511
+ View.prototype.interaction = function (name, cfg) {
512
+ var existInteraction = this.interactions[name];
513
+ // 存在则先销毁已有的
514
+ if (existInteraction) {
515
+ existInteraction.destroy();
516
+ }
517
+ // 新建交互实例
518
+ var interaction = (0, interaction_1.createInteraction)(name, this, cfg);
519
+ if (interaction) {
520
+ interaction.init();
521
+ this.interactions[name] = interaction;
522
+ }
523
+ return this;
524
+ };
525
+ /**
526
+ * 移除当前 View 的 interaction
527
+ * ```ts
528
+ * view.removeInteraction('my-interaction');
529
+ * ```
530
+ * @param name interaction name
531
+ */
532
+ View.prototype.removeInteraction = function (name) {
533
+ var existInteraction = this.interactions[name];
534
+ // 存在则先销毁已有的
535
+ if (existInteraction) {
536
+ existInteraction.destroy();
537
+ this.interactions[name] = undefined;
538
+ }
539
+ };
540
+ /**
541
+ * 修改数据,数据更新逻辑,数据更新仅仅影响当前这一层的 view
542
+ *
543
+ * ```ts
544
+ * view.changeData([{ city: '北京', sale: '200' }]);
545
+ * ```
546
+ *
547
+ * @param data
548
+ * @returns void
549
+ */
550
+ View.prototype.changeData = function (data) {
551
+ this.isDataChanged = true;
552
+ this.emit(constant_1.VIEW_LIFE_CIRCLE.BEFORE_CHANGE_DATA, event_1.default.fromData(this, constant_1.VIEW_LIFE_CIRCLE.BEFORE_CHANGE_DATA, null));
553
+ // 1. 保存数据
554
+ this.data(data);
555
+ // 2. 渲染
556
+ this.paint(true);
557
+ // 3. 遍历子 view 进行 change data
558
+ var views = this.views;
559
+ for (var i = 0, len = views.length; i < len; i++) {
560
+ var view = views[i];
561
+ // FIXME 子 view 有自己的数据的情况,该如何处理?
562
+ view.changeData(data);
563
+ }
564
+ this.emit(constant_1.VIEW_LIFE_CIRCLE.AFTER_CHANGE_DATA, event_1.default.fromData(this, constant_1.VIEW_LIFE_CIRCLE.AFTER_CHANGE_DATA, null));
565
+ };
566
+ /* View 管理相关的 API */
567
+ /**
568
+ * 创建子 view
569
+ *
570
+ * ```ts
571
+ * const innerView = view.createView({
572
+ * start: { x: 0, y: 0 },
573
+ * end: { x: 0.5, y: 0.5 },
574
+ * padding: 8,
575
+ * });
576
+ * ```
577
+ *
578
+ * @param cfg
579
+ * @returns View
580
+ */
581
+ View.prototype.createView = function (cfg) {
582
+ // 将会在 4.1 版本中移除递归嵌套 view,仅仅只允许 chart - view 两层。
583
+ // 这个 API 理论上用户量不多,所以暂时不发大版本,所以先暂时打一个 warning。
584
+ if (this.parent && this.parent.parent) {
585
+ // 存在 3 层 结构了
586
+ console.warn('The view nesting recursive feature will be removed at G2 V4.1. Please avoid to use it.');
587
+ }
588
+ // 子 view 共享 options 配置数据
589
+ var sharedOptions = {
590
+ data: this.options.data,
591
+ scales: (0, util_1.clone)(this.options.scales),
592
+ axes: (0, util_1.clone)(this.options.axes),
593
+ coordinate: (0, util_1.clone)(this.coordinateController.getOption()),
594
+ tooltip: (0, util_1.clone)(this.options.tooltip),
595
+ legends: (0, util_1.clone)(this.options.legends),
596
+ animate: this.options.animate,
597
+ visible: this.visible,
598
+ };
599
+ var v = new View((0, tslib_1.__assign)((0, tslib_1.__assign)({ parent: this, canvas: this.canvas,
600
+ // 子 view 共用三层 group
601
+ backgroundGroup: this.backgroundGroup.addGroup({ zIndex: constant_1.GROUP_Z_INDEX.BG }), middleGroup: this.middleGroup.addGroup({ zIndex: constant_1.GROUP_Z_INDEX.MID }), foregroundGroup: this.foregroundGroup.addGroup({ zIndex: constant_1.GROUP_Z_INDEX.FORE }), theme: this.themeObject, padding: this.padding }, cfg), { options: (0, tslib_1.__assign)((0, tslib_1.__assign)({}, sharedOptions), (0, util_1.get)(cfg, 'options', {})) }));
602
+ this.views.push(v);
603
+ return v;
604
+ };
605
+ /**
606
+ * @deprecated
607
+ * This method will be removed at G2 V4.1. Replaced by {@link #createView()}
608
+ */
609
+ View.prototype.view = function (cfg) {
610
+ console.warn('This method will be removed at G2 V4.1. Please use chart.createView() instead.');
611
+ return this.createView(cfg);
612
+ };
613
+ /**
614
+ * 删除一个子 view
615
+ * @param view
616
+ * @return removedView
617
+ */
618
+ View.prototype.removeView = function (view) {
619
+ var removedView = (0, util_1.remove)(this.views, function (v) { return v === view; })[0];
620
+ if (removedView) {
621
+ removedView.destroy();
622
+ }
623
+ return removedView;
624
+ };
625
+ /* end View 管理相关的 API */
626
+ // 一些 get 方法
627
+ /**
628
+ * 获取当前坐标系实例。
629
+ * @returns [[Coordinate]]
630
+ */
631
+ View.prototype.getCoordinate = function () {
632
+ return this.coordinateInstance;
633
+ };
634
+ /**
635
+ * 获取当前 view 的主题配置。
636
+ * @returns themeObject
637
+ */
638
+ View.prototype.getTheme = function () {
639
+ return this.themeObject;
640
+ };
641
+ /**
642
+ * 获得 x 轴字段的 scale 实例。
643
+ * @returns view 中 Geometry 对于的 x scale
644
+ */
645
+ View.prototype.getXScale = function () {
646
+ // 拿第一个 Geometry 的 X scale
647
+ // 隐藏逻辑:一个 view 中的 Geometry 必须 x 字段一致
648
+ var g = this.geometries[0];
649
+ return g ? g.getXScale() : null;
650
+ };
651
+ /**
652
+ * 获取 y 轴字段的 scales 实例。
653
+ * @returns view 中 Geometry 对于的 y scale 数组
654
+ */
655
+ View.prototype.getYScales = function () {
656
+ // 拿到所有的 Geometry 的 Y scale,然后去重
657
+ var tmpMap = {};
658
+ var yScales = [];
659
+ this.geometries.forEach(function (g) {
660
+ var yScale = g.getYScale();
661
+ var field = yScale.field;
662
+ if (!tmpMap[field]) {
663
+ tmpMap[field] = true;
664
+ yScales.push(yScale);
665
+ }
666
+ });
667
+ return yScales;
668
+ };
669
+ /**
670
+ * 获取 x 轴或者 y 轴对应的所有 scale 实例。
671
+ * @param dimType x | y
672
+ * @returns x 轴或者 y 轴对应的所有 scale 实例。
673
+ */
674
+ View.prototype.getScalesByDim = function (dimType) {
675
+ var geometries = this.geometries;
676
+ var scales = {};
677
+ for (var i = 0, len = geometries.length; i < len; i++) {
678
+ var geometry = geometries[i];
679
+ var scale = dimType === 'x' ? geometry.getXScale() : geometry.getYScale();
680
+ if (scale && !scales[scale.field]) {
681
+ scales[scale.field] = scale;
682
+ }
683
+ }
684
+ return scales;
685
+ };
686
+ /**
687
+ * 根据字段名去获取 scale 实例。
688
+ * @param field 数据字段名称
689
+ * @param key id
690
+ */
691
+ View.prototype.getScale = function (field, key) {
692
+ var defaultKey = key ? key : this.getScaleKey(field);
693
+ // 调用根节点 view 的方法获取
694
+ return this.getRootView().scalePool.getScale(defaultKey);
695
+ };
696
+ /**
697
+ * @deprecated
698
+ * This method will be removed at G2 V4.1. Please use `getScale`.
699
+ */
700
+ View.prototype.getScaleByField = function (field, key) {
701
+ return this.getScale(field, key);
702
+ };
703
+ /**
704
+ * 返回所有配置信息。
705
+ * @returns 所有的 view API 配置。
706
+ */
707
+ View.prototype.getOptions = function () {
708
+ return this.options;
709
+ };
710
+ /**
711
+ * 获取 view 的数据(过滤后的数据)。
712
+ * @returns 处理过滤器之后的数据。
713
+ */
714
+ View.prototype.getData = function () {
715
+ return this.filteredData;
716
+ };
717
+ /**
718
+ * 获取原始数据
719
+ * @returns 传入 G2 的原始数据
720
+ */
721
+ View.prototype.getOriginalData = function () {
722
+ return this.options.data;
723
+ };
724
+ /**
725
+ * 获取布局后的边距 padding
726
+ * @returns
727
+ */
728
+ View.prototype.getPadding = function () {
729
+ return this.autoPadding.getPadding();
730
+ };
731
+ /**
732
+ * 获取当前 view 有的 geometries
733
+ * @returns
734
+ */
735
+ View.prototype.getGeometries = function () {
736
+ return this.geometries;
737
+ };
738
+ /**
739
+ * 获取 view 中的所有 geome
740
+ */
741
+ View.prototype.getElements = function () {
742
+ return (0, util_1.reduce)(this.geometries, function (elements, geometry) {
743
+ return elements.concat(geometry.getElements());
744
+ }, []);
745
+ };
746
+ /**
747
+ * 根据一定的规则查找 Geometry 的 Elements。
748
+ *
749
+ * ```typescript
750
+ * getElementsBy((element) => {
751
+ * const data = element.getData();
752
+ *
753
+ * return data.a === 'a';
754
+ * });
755
+ * ```
756
+ *
757
+ * @param condition 定义查找规则的回调函数。
758
+ * @returns
759
+ */
760
+ View.prototype.getElementsBy = function (condition) {
761
+ return this.getElements().filter(function (el) { return condition(el); });
762
+ };
763
+ /**
764
+ * 获得绘制的层级 group。
765
+ * @param layer 层级名称。
766
+ * @returns 对应层级的 Group。
767
+ */
768
+ View.prototype.getLayer = function (layer) {
769
+ return layer === constant_1.LAYER.BG
770
+ ? this.backgroundGroup
771
+ : layer === constant_1.LAYER.MID
772
+ ? this.middleGroup
773
+ : layer === constant_1.LAYER.FORE
774
+ ? this.foregroundGroup
775
+ : this.foregroundGroup;
776
+ };
777
+ /**
778
+ * 对外暴露方法,判断一个点是否在绘图区域(即坐标系范围)内部。
779
+ * @param point 坐标点
780
+ */
781
+ View.prototype.isPointInPlot = function (point) {
782
+ return (0, coordinate_1.isPointInCoordinate)(this.getCoordinate(), point);
783
+ };
784
+ /**
785
+ * 获得所有的 legend 对应的 attribute 实例。
786
+ * @returns 维度字段的 Attribute 数组
787
+ */
788
+ View.prototype.getLegendAttributes = function () {
789
+ return (0, util_1.flatten)(this.geometries.map(function (g) { return g.getGroupAttributes(); }));
790
+ };
791
+ /**
792
+ * 获取所有的分组字段的 scale 实例。
793
+ * @returns 获得分组字段的 scale 实例数组。
794
+ */
795
+ View.prototype.getGroupScales = function () {
796
+ // 拿到所有的 Geometry 的 分组字段 scale,然后打平去重
797
+ var scales = this.geometries.map(function (g) { return g.getGroupScales(); });
798
+ return (0, helper_1.uniq)((0, util_1.flatten)(scales));
799
+ };
800
+ /**
801
+ * 获取 G.Canvas 实例。
802
+ * @returns G.Canvas 画布实例。
803
+ */
804
+ View.prototype.getCanvas = function () {
805
+ return this.getRootView().canvas;
806
+ };
807
+ /**
808
+ * 获得根节点 view。
809
+ */
810
+ View.prototype.getRootView = function () {
811
+ var v = this;
812
+ while (true) {
813
+ if (v.parent) {
814
+ v = v.parent;
815
+ continue;
816
+ }
817
+ break;
818
+ }
819
+ return v;
820
+ };
821
+ /**
822
+ * 获取该数据在可视化后,对应的画布坐标点。
823
+ * @param data 原始数据记录
824
+ * @returns 对应的画布坐标点
825
+ */
826
+ View.prototype.getXY = function (data) {
827
+ var coordinate = this.getCoordinate();
828
+ var xScales = this.getScalesByDim('x');
829
+ var yScales = this.getScalesByDim('y');
830
+ var x;
831
+ var y;
832
+ (0, util_1.each)(data, function (value, key) {
833
+ if (xScales[key]) {
834
+ x = xScales[key].scale(value);
835
+ }
836
+ if (yScales[key]) {
837
+ y = yScales[key].scale(value);
838
+ }
839
+ });
840
+ if (!(0, util_1.isNil)(x) && !(0, util_1.isNil)(y)) {
841
+ return coordinate.convert({ x: x, y: y });
842
+ }
843
+ };
844
+ /**
845
+ * 获取 name 对应的 controller 实例
846
+ * @param name
847
+ */
848
+ View.prototype.getController = function (name) {
849
+ return (0, util_1.find)(this.controllers, function (c) { return c.name === name; });
850
+ };
851
+ /**
852
+ * 显示 point 坐标点对应的 tooltip。
853
+ * @param point 画布坐标点
854
+ * @returns View
855
+ */
856
+ View.prototype.showTooltip = function (point) {
857
+ var tooltip = this.getController('tooltip');
858
+ if (tooltip) {
859
+ tooltip.showTooltip(point);
860
+ }
861
+ return this;
862
+ };
863
+ /**
864
+ * 隐藏 tooltip。
865
+ * @returns View
866
+ */
867
+ View.prototype.hideTooltip = function () {
868
+ var tooltip = this.getController('tooltip');
869
+ if (tooltip) {
870
+ tooltip.hideTooltip();
871
+ }
872
+ return this;
873
+ };
874
+ /**
875
+ * 将 tooltip 锁定到当前位置不能移动。
876
+ * @returns View
877
+ */
878
+ View.prototype.lockTooltip = function () {
879
+ var tooltip = this.getController('tooltip');
880
+ if (tooltip) {
881
+ tooltip.lockTooltip();
882
+ }
883
+ return this;
884
+ };
885
+ /**
886
+ * 将 tooltip 锁定解除。
887
+ * @returns View
888
+ */
889
+ View.prototype.unlockTooltip = function () {
890
+ var tooltip = this.getController('tooltip');
891
+ if (tooltip) {
892
+ tooltip.unlockTooltip();
893
+ }
894
+ return this;
895
+ };
896
+ /**
897
+ * 是否锁定 tooltip。
898
+ * @returns 是否锁定
899
+ */
900
+ View.prototype.isTooltipLocked = function () {
901
+ var tooltip = this.getController('tooltip');
902
+ return tooltip && tooltip.isTooltipLocked();
903
+ };
904
+ /**
905
+ * 获取当前 point 对应的 tooltip 数据项。
906
+ * @param point 坐标点
907
+ * @returns tooltip 数据项
908
+ */
909
+ View.prototype.getTooltipItems = function (point) {
910
+ var tooltip = this.getController('tooltip');
911
+ return tooltip ? tooltip.getTooltipItems(point) : [];
912
+ };
913
+ /**
914
+ * 获取逼近的点的数据集合
915
+ * @param point 当前坐标点
916
+ * @returns 数据
917
+ */
918
+ View.prototype.getSnapRecords = function (point) {
919
+ var geometries = this.geometries;
920
+ var rst = [];
921
+ for (var i = 0, len = geometries.length; i < len; i++) {
922
+ var geom = geometries[i];
923
+ var dataArray = geom.dataArray;
924
+ geom.sort(dataArray); // 先进行排序,便于 tooltip 查找
925
+ var record = void 0;
926
+ for (var j = 0, dataLen = dataArray.length; j < dataLen; j++) {
927
+ var data = dataArray[j];
928
+ record = (0, tooltip_1.findDataByPoint)(point, data, geom);
929
+ if (record) {
930
+ rst.push(record);
931
+ }
932
+ }
933
+ }
934
+ // 同样递归处理子 views
935
+ var views = this.views;
936
+ for (var i = 0, len = views.length; i < len; i++) {
937
+ var view = views[i];
938
+ var snapRecords = view.getSnapRecords(point);
939
+ rst = rst.concat(snapRecords);
940
+ }
941
+ return rst;
942
+ };
943
+ /**
944
+ * 获取所有的 pure component 组件,用于布局。
945
+ */
946
+ View.prototype.getComponents = function () {
947
+ var components = [];
948
+ var controllers = this.controllers;
949
+ for (var i = 0, len = controllers.length; i < len; i++) {
950
+ var controller = controllers[i];
951
+ components = components.concat(controller.getComponents());
952
+ }
953
+ return components;
954
+ };
955
+ /**
956
+ * 将 data 数据进行过滤。
957
+ * @param data
958
+ * @returns 过滤之后的数据
959
+ */
960
+ View.prototype.filterData = function (data) {
961
+ var filters = this.options.filters;
962
+ // 不存在 filters,则不需要进行数据过滤
963
+ if ((0, util_1.size)(filters) === 0) {
964
+ return data;
965
+ }
966
+ // 存在过滤器,则逐个执行过滤,过滤器之间是 与 的关系
967
+ return (0, util_1.filter)(data, function (datum, idx) {
968
+ // 所有的 filter 字段
969
+ var fields = Object.keys(filters);
970
+ // 所有的条件都通过,才算通过
971
+ return fields.every(function (field) {
972
+ var condition = filters[field];
973
+ // condition 返回 true,则保留
974
+ return condition(datum[field], datum, idx);
975
+ });
976
+ });
977
+ };
978
+ /**
979
+ * 对某一个字段进行过滤
980
+ * @param field
981
+ * @param data
982
+ */
983
+ View.prototype.filterFieldData = function (field, data) {
984
+ var filters = this.options.filters;
985
+ var condition = (0, util_1.get)(filters, field);
986
+ if ((0, util_1.isUndefined)(condition)) {
987
+ return data;
988
+ }
989
+ return data.filter(function (datum, idx) { return condition(datum[field], datum, idx); });
990
+ };
991
+ /**
992
+ * 调整 coordinate 的坐标范围。
993
+ */
994
+ View.prototype.adjustCoordinate = function () {
995
+ var _a = this.getCoordinate(), curStart = _a.start, curEnd = _a.end;
996
+ var start = this.coordinateBBox.bl;
997
+ var end = this.coordinateBBox.tr;
998
+ // 在 defaultLayoutFn 中只会在 coordinateBBox 发生变化的时候会调用 adjustCoordinate(),所以不用担心被置位
999
+ if ((0, util_1.isEqual)(curStart, start) && (0, util_1.isEqual)(curEnd, end)) {
1000
+ this.isCoordinateChanged = false;
1001
+ // 如果大小没有变化则不更新
1002
+ return;
1003
+ }
1004
+ this.isCoordinateChanged = true;
1005
+ this.coordinateInstance = this.coordinateController.adjust(start, end);
1006
+ };
1007
+ View.prototype.paint = function (isUpdate) {
1008
+ this.renderDataRecursive(isUpdate);
1009
+ // 处理 sync scale 的逻辑
1010
+ this.syncScale();
1011
+ this.emit(constant_1.VIEW_LIFE_CIRCLE.BEFORE_PAINT);
1012
+ // 初始化图形、组件位置,计算 padding
1013
+ this.renderPaddingRecursive(isUpdate);
1014
+ // 布局图形、组件
1015
+ this.renderLayoutRecursive(isUpdate);
1016
+ // 背景色 shape
1017
+ this.renderBackgroundStyleShape();
1018
+ // 最终的绘制 render
1019
+ this.renderPaintRecursive(isUpdate);
1020
+ this.emit(constant_1.VIEW_LIFE_CIRCLE.AFTER_PAINT);
1021
+ this.isDataChanged = false; // 渲染完毕复位
1022
+ };
1023
+ /**
1024
+ * 渲染背景样式的 shape。
1025
+ * 放到 view 中创建的原因是让使用 view 绘制图形的时候,也能够处理背景色
1026
+ */
1027
+ View.prototype.renderBackgroundStyleShape = function () {
1028
+ // 只有根节点才处理
1029
+ if (this.parent) {
1030
+ return;
1031
+ }
1032
+ var background = (0, util_1.get)(this.themeObject, 'background');
1033
+ // 配置了背景色
1034
+ if (background) {
1035
+ // 1. 不存在则创建
1036
+ if (!this.backgroundStyleRectShape) {
1037
+ this.backgroundStyleRectShape = this.backgroundGroup.addShape('rect', {
1038
+ attrs: {},
1039
+ zIndex: -1,
1040
+ // 背景色 shape 不设置事件捕获
1041
+ capture: false,
1042
+ });
1043
+ this.backgroundStyleRectShape.toBack();
1044
+ }
1045
+ // 2. 有了 shape 之后设置背景,位置(更新的时候)
1046
+ var _a = this.viewBBox, x = _a.x, y = _a.y, width = _a.width, height = _a.height;
1047
+ this.backgroundStyleRectShape.attr({
1048
+ fill: background,
1049
+ x: x,
1050
+ y: y,
1051
+ width: width,
1052
+ height: height,
1053
+ });
1054
+ }
1055
+ else {
1056
+ // 没有配置背景色
1057
+ if (this.backgroundStyleRectShape) {
1058
+ this.backgroundStyleRectShape.remove(true);
1059
+ this.backgroundStyleRectShape = undefined;
1060
+ }
1061
+ }
1062
+ };
1063
+ /**
1064
+ * 递归计算每个 view 的 padding 值,coordinateBBox 和 coordinateInstance
1065
+ * @param isUpdate
1066
+ */
1067
+ View.prototype.renderPaddingRecursive = function (isUpdate) {
1068
+ // 1. 子 view 大小相对 coordinateBBox,changeSize 的时候需要重新计算
1069
+ this.calculateViewBBox();
1070
+ // 2. 更新 coordinate
1071
+ this.adjustCoordinate();
1072
+ // 3. 初始化组件 component
1073
+ this.initComponents(isUpdate);
1074
+ // 4. 布局计算每隔 view 的 padding 值
1075
+ // 4.1. 自动加 auto padding -> absolute padding,并且增加 appendPadding
1076
+ this.autoPadding = (0, auto_1.calculatePadding)(this).shrink((0, padding_1.parsePadding)(this.appendPadding));
1077
+ // 4.2. 计算出新的 coordinateBBox,更新 Coordinate
1078
+ // 这里必须保留,原因是后面子 view 的 viewBBox 或根据 parent 的 coordinateBBox
1079
+ this.coordinateBBox = this.viewBBox.shrink(this.autoPadding.getPadding());
1080
+ this.adjustCoordinate();
1081
+ // 同样递归处理子 views
1082
+ var views = this.views;
1083
+ for (var i = 0, len = views.length; i < len; i++) {
1084
+ var view = views[i];
1085
+ view.renderPaddingRecursive(isUpdate);
1086
+ }
1087
+ };
1088
+ /**
1089
+ * 递归处理 view 的布局,最终是计算各个 view 的 coordinateBBox 和 coordinateInstance
1090
+ * @param isUpdate
1091
+ */
1092
+ View.prototype.renderLayoutRecursive = function (isUpdate) {
1093
+ // 1. 同步子 view padding
1094
+ // 根据配置获取 padding
1095
+ var syncViewPaddingFn = this.syncViewPadding === true
1096
+ ? sync_view_padding_1.defaultSyncViewPadding
1097
+ : (0, util_1.isFunction)(this.syncViewPadding)
1098
+ ? this.syncViewPadding
1099
+ : undefined;
1100
+ if (syncViewPaddingFn) {
1101
+ syncViewPaddingFn(this, this.views, padding_cal_1.PaddingCal);
1102
+ // 同步 padding 之后,更新 coordinate
1103
+ this.views.forEach(function (v) {
1104
+ v.coordinateBBox = v.viewBBox.shrink(v.autoPadding.getPadding());
1105
+ v.adjustCoordinate();
1106
+ });
1107
+ }
1108
+ // 3. 将 view 中的组件按照 view padding 移动到对应的位置
1109
+ this.doLayout();
1110
+ // 同样递归处理子 views
1111
+ var views = this.views;
1112
+ for (var i = 0, len = views.length; i < len; i++) {
1113
+ var view = views[i];
1114
+ view.renderLayoutRecursive(isUpdate);
1115
+ }
1116
+ };
1117
+ /**
1118
+ * 最终递归绘制组件和图形
1119
+ * @param isUpdate
1120
+ */
1121
+ View.prototype.renderPaintRecursive = function (isUpdate) {
1122
+ var middleGroup = this.middleGroup;
1123
+ if (this.limitInPlot) {
1124
+ var _a = (0, coordinate_1.getCoordinateClipCfg)(this.coordinateInstance), type = _a.type, attrs = _a.attrs;
1125
+ middleGroup.setClip({
1126
+ type: type,
1127
+ attrs: attrs,
1128
+ });
1129
+ }
1130
+ else {
1131
+ // 清除已有的 clip
1132
+ middleGroup.setClip(undefined);
1133
+ }
1134
+ // 1. 渲染几何标记
1135
+ this.paintGeometries(isUpdate);
1136
+ // 2. 绘制组件
1137
+ this.renderComponents(isUpdate);
1138
+ // 同样递归处理子 views
1139
+ var views = this.views;
1140
+ for (var i = 0, len = views.length; i < len; i++) {
1141
+ var view = views[i];
1142
+ view.renderPaintRecursive(isUpdate);
1143
+ }
1144
+ };
1145
+ // end Get 方法
1146
+ /**
1147
+ * 创建 scale,递归到顶层 view 去创建和缓存 scale
1148
+ * @param field
1149
+ * @param data
1150
+ * @param scaleDef
1151
+ * @param key
1152
+ */
1153
+ View.prototype.createScale = function (field, data, scaleDef, key) {
1154
+ // 1. 合并 field 对应的 scaleDef,合并原则是底层覆盖顶层(就近原则)
1155
+ var currentScaleDef = (0, util_1.get)(this.options.scales, [field]);
1156
+ var mergedScaleDef = (0, tslib_1.__assign)((0, tslib_1.__assign)({}, currentScaleDef), scaleDef);
1157
+ // 2. 是否存在父 view,在则递归,否则创建
1158
+ if (this.parent) {
1159
+ return this.parent.createScale(field, data, mergedScaleDef, key);
1160
+ }
1161
+ // 3. 在根节点 view 通过 scalePool 创建
1162
+ return this.scalePool.createScale(field, data, mergedScaleDef, key);
1163
+ };
1164
+ /**
1165
+ * 递归渲染中的数据处理
1166
+ * @param isUpdate
1167
+ */
1168
+ View.prototype.renderDataRecursive = function (isUpdate) {
1169
+ // 1. 处理数据
1170
+ this.doFilterData();
1171
+ // 2. 创建实例
1172
+ this.createCoordinate();
1173
+ // 3. 初始化 Geometry
1174
+ this.initGeometries(isUpdate);
1175
+ // 4. 处理分面逻辑,最终都是生成子 view 和 geometry
1176
+ this.renderFacet(isUpdate);
1177
+ // 同样递归处理子 views
1178
+ var views = this.views;
1179
+ for (var i = 0, len = views.length; i < len; i++) {
1180
+ var view = views[i];
1181
+ view.renderDataRecursive(isUpdate);
1182
+ }
1183
+ };
1184
+ /**
1185
+ * 计算 region,计算实际的像素范围坐标
1186
+ * @private
1187
+ */
1188
+ View.prototype.calculateViewBBox = function () {
1189
+ var x;
1190
+ var y;
1191
+ var width;
1192
+ var height;
1193
+ if (this.parent) {
1194
+ var bbox = this.parent.coordinateBBox;
1195
+ // 存在 parent, 那么就是通过父容器大小计算
1196
+ x = bbox.x;
1197
+ y = bbox.y;
1198
+ width = bbox.width;
1199
+ height = bbox.height;
1200
+ }
1201
+ else {
1202
+ // 顶层容器,从 canvas 中取值 宽高
1203
+ x = 0;
1204
+ y = 0;
1205
+ width = this.canvas.get('width');
1206
+ height = this.canvas.get('height');
1207
+ }
1208
+ var _a = this.region, start = _a.start, end = _a.end;
1209
+ // 根据 region 计算当前 view 的 bbox 大小。
1210
+ var viewBBox = new bbox_1.BBox(x + width * start.x, y + height * start.y, width * (end.x - start.x), height * (end.y - start.y));
1211
+ if (!this.viewBBox || !this.viewBBox.isEqual(viewBBox)) {
1212
+ // viewBBox 发生变化的时候进行更新
1213
+ this.viewBBox = new bbox_1.BBox(x + width * start.x, y + height * start.y, width * (end.x - start.x), height * (end.y - start.y));
1214
+ }
1215
+ // 初始的 coordinate bbox 大小
1216
+ this.coordinateBBox = this.viewBBox;
1217
+ };
1218
+ /**
1219
+ * 初始化事件机制:G 4.0 底层内置支持 name:event 的机制,那么只要所有组件都有自己的 name 即可。
1220
+ *
1221
+ * G2 的事件只是获取事件委托,然后在 view 嵌套结构中,形成事件冒泡机制。
1222
+ * 当前 view 只委托自己 view 中的 Component 和 Geometry 事件,并向上冒泡
1223
+ * @private
1224
+ */
1225
+ View.prototype.initEvents = function () {
1226
+ // 三层 group 中的 shape 事件都会通过 G 冒泡上来的
1227
+ this.foregroundGroup.on('*', this.onDelegateEvents);
1228
+ this.middleGroup.on('*', this.onDelegateEvents);
1229
+ this.backgroundGroup.on('*', this.onDelegateEvents);
1230
+ this.canvas.on('*', this.onCanvasEvent);
1231
+ };
1232
+ /**
1233
+ * 初始化插件
1234
+ */
1235
+ View.prototype.initComponentController = function () {
1236
+ var usedControllers = this.usedControllers;
1237
+ for (var i = 0, len = usedControllers.length; i < len; i++) {
1238
+ var controllerName = usedControllers[i];
1239
+ var Ctor = (0, controller_1.getComponentController)(controllerName);
1240
+ if (Ctor) {
1241
+ this.controllers.push(new Ctor(this));
1242
+ }
1243
+ }
1244
+ };
1245
+ View.prototype.createViewEvent = function (evt) {
1246
+ var shape = evt.shape, name = evt.name;
1247
+ var data = shape ? shape.get('origin') : null;
1248
+ // 事件在 view 嵌套中冒泡(暂不提供阻止冒泡的机制)
1249
+ var e = new event_1.default(this, evt, data);
1250
+ e.type = name;
1251
+ return e;
1252
+ };
1253
+ /**
1254
+ * 处理 PLOT_EVENTS
1255
+ * plot event 需要处理所有的基础事件,并判断是否在画布中,然后再决定是否要 emit。
1256
+ * 对于 mouseenter、mouseleave 比较特殊,需要做一下数学比较。
1257
+ * @param e
1258
+ */
1259
+ View.prototype.doPlotEvent = function (e) {
1260
+ var type = e.type, x = e.x, y = e.y;
1261
+ var point = { x: x, y: y };
1262
+ var ALL_EVENTS = [
1263
+ 'mousedown',
1264
+ 'mouseup',
1265
+ 'mousemove',
1266
+ 'mouseleave',
1267
+ 'mousewheel',
1268
+ 'touchstart',
1269
+ 'touchmove',
1270
+ 'touchend',
1271
+ 'touchcancel',
1272
+ 'click',
1273
+ 'dblclick',
1274
+ 'contextmenu',
1275
+ ];
1276
+ if (ALL_EVENTS.includes(type)) {
1277
+ var currentInPlot = this.isPointInPlot(point);
1278
+ var newEvent = e.clone();
1279
+ if (currentInPlot) {
1280
+ var TYPE = "plot:".concat(type); // 组合 plot 事件
1281
+ newEvent.type = TYPE;
1282
+ this.emit(TYPE, newEvent);
1283
+ if (type === 'mouseleave' || type === 'touchend') {
1284
+ // 在plot 内部却离开画布
1285
+ this.isPreMouseInPlot = false;
1286
+ }
1287
+ }
1288
+ // 对于 mouseenter, mouseleave 的计算处理
1289
+ if (type === 'mousemove' || type === 'touchmove') {
1290
+ if (this.isPreMouseInPlot && !currentInPlot) {
1291
+ if (type === 'mousemove') {
1292
+ newEvent.type = constant_1.PLOT_EVENTS.MOUSE_LEAVE;
1293
+ this.emit(constant_1.PLOT_EVENTS.MOUSE_LEAVE, newEvent);
1294
+ }
1295
+ newEvent.type = constant_1.PLOT_EVENTS.LEAVE;
1296
+ this.emit(constant_1.PLOT_EVENTS.LEAVE, newEvent);
1297
+ }
1298
+ else if (!this.isPreMouseInPlot && currentInPlot) {
1299
+ if (type === 'mousemove') {
1300
+ newEvent.type = constant_1.PLOT_EVENTS.MOUSE_ENTER;
1301
+ this.emit(constant_1.PLOT_EVENTS.MOUSE_ENTER, newEvent);
1302
+ }
1303
+ newEvent.type = constant_1.PLOT_EVENTS.ENTER;
1304
+ this.emit(constant_1.PLOT_EVENTS.ENTER, newEvent);
1305
+ }
1306
+ // 赋新的状态值
1307
+ this.isPreMouseInPlot = currentInPlot;
1308
+ }
1309
+ else if (type === 'mouseleave' || type === 'touchend') {
1310
+ // 可能不在 currentInPlot 中
1311
+ if (this.isPreMouseInPlot) {
1312
+ if (type === 'mouseleave') {
1313
+ newEvent.type = constant_1.PLOT_EVENTS.MOUSE_LEAVE;
1314
+ this.emit(constant_1.PLOT_EVENTS.MOUSE_LEAVE, newEvent);
1315
+ }
1316
+ newEvent.type = constant_1.PLOT_EVENTS.LEAVE;
1317
+ this.emit(constant_1.PLOT_EVENTS.LEAVE, newEvent);
1318
+ this.isPreMouseInPlot = false;
1319
+ }
1320
+ }
1321
+ }
1322
+ };
1323
+ // view 生命周期 —— 渲染流程
1324
+ /**
1325
+ * 处理筛选器,筛选数据
1326
+ * @private
1327
+ */
1328
+ View.prototype.doFilterData = function () {
1329
+ var data = this.options.data;
1330
+ this.filteredData = this.filterData(data);
1331
+ };
1332
+ /**
1333
+ * 初始化 Geometries
1334
+ * @private
1335
+ */
1336
+ View.prototype.initGeometries = function (isUpdate) {
1337
+ // 初始化图形的之前,先创建 / 更新 scales
1338
+ this.createOrUpdateScales();
1339
+ // 实例化 Geometry,然后 view 将所有的 scale 管理起来
1340
+ var coordinate = this.getCoordinate();
1341
+ var scaleDefs = (0, util_1.get)(this.options, 'scales', {});
1342
+ var geometries = this.geometries;
1343
+ for (var i = 0, len = geometries.length; i < len; i++) {
1344
+ var geometry = geometries[i];
1345
+ // 保持 scales 引用不要变化
1346
+ geometry.scales = this.getGeometryScales();
1347
+ var cfg = {
1348
+ coordinate: coordinate,
1349
+ scaleDefs: scaleDefs,
1350
+ data: this.filteredData,
1351
+ theme: this.themeObject,
1352
+ isDataChanged: this.isDataChanged,
1353
+ isCoordinateChanged: this.isCoordinateChanged,
1354
+ };
1355
+ if (isUpdate) {
1356
+ // 数据发生更新
1357
+ geometry.update(cfg);
1358
+ }
1359
+ else {
1360
+ geometry.init(cfg);
1361
+ }
1362
+ }
1363
+ // Geometry 初始化之后,生成了 scale,然后进行调整 scale 配置
1364
+ this.adjustScales();
1365
+ };
1366
+ /**
1367
+ * 根据 Geometry 的所有字段创建 scales
1368
+ * 如果存在,则更新,不存在则创建
1369
+ */
1370
+ View.prototype.createOrUpdateScales = function () {
1371
+ var fields = this.getScaleFields();
1372
+ var groupedFields = this.getGroupedFields();
1373
+ var _a = this.getOptions(), data = _a.data, _b = _a.scales, scales = _b === void 0 ? {} : _b;
1374
+ var filteredData = this.filteredData;
1375
+ for (var i = 0, len = fields.length; i < len; i++) {
1376
+ var field = fields[i];
1377
+ var scaleDef = scales[field];
1378
+ // 调用方法,递归去创建
1379
+ var key = this.getScaleKey(field);
1380
+ this.createScale(field,
1381
+ // 分组字段的 scale 使用未过滤的数据创建
1382
+ groupedFields.includes(field) ? data : filteredData, scaleDef, key);
1383
+ // 缓存从当前 view 创建的 scale key
1384
+ this.createdScaleKeys.set(key, true);
1385
+ }
1386
+ };
1387
+ /**
1388
+ * 处理 scale 同步逻辑
1389
+ */
1390
+ View.prototype.syncScale = function () {
1391
+ // 最终调用 root view 的
1392
+ this.getRootView().scalePool.sync(this.getCoordinate(), this.theme);
1393
+ };
1394
+ /**
1395
+ * 获得 Geometry 中的 scale 对象
1396
+ */
1397
+ View.prototype.getGeometryScales = function () {
1398
+ var fields = this.getScaleFields();
1399
+ var scales = {};
1400
+ for (var i = 0; i < fields.length; i++) {
1401
+ var field = fields[i];
1402
+ scales[field] = this.getScaleByField(field);
1403
+ }
1404
+ return scales;
1405
+ };
1406
+ View.prototype.getScaleFields = function () {
1407
+ var fields = [];
1408
+ var tmpMap = new Map();
1409
+ var geometries = this.geometries;
1410
+ for (var i = 0; i < geometries.length; i++) {
1411
+ var geometry = geometries[i];
1412
+ var geometryScales = geometry.getScaleFields();
1413
+ (0, helper_1.uniq)(geometryScales, fields, tmpMap);
1414
+ }
1415
+ return fields;
1416
+ };
1417
+ View.prototype.getGroupedFields = function () {
1418
+ var fields = [];
1419
+ var tmpMap = new Map();
1420
+ var geometries = this.geometries;
1421
+ for (var i = 0; i < geometries.length; i++) {
1422
+ var geometry = geometries[i];
1423
+ var groupFields = geometry.getGroupFields();
1424
+ (0, helper_1.uniq)(groupFields, fields, tmpMap);
1425
+ }
1426
+ return fields;
1427
+ };
1428
+ /**
1429
+ * 调整 scale 配置
1430
+ * @private
1431
+ */
1432
+ View.prototype.adjustScales = function () {
1433
+ // 调整目前包括:
1434
+ // 分类 scale,调整 range 范围
1435
+ this.adjustCategoryScaleRange();
1436
+ };
1437
+ /**
1438
+ * 调整分类 scale 的 range,防止超出坐标系外面
1439
+ * @private
1440
+ */
1441
+ View.prototype.adjustCategoryScaleRange = function () {
1442
+ var _this = this;
1443
+ var xyScales = (0, tslib_1.__spreadArray)([this.getXScale()], this.getYScales(), true).filter(function (e) { return !!e; });
1444
+ var coordinate = this.getCoordinate();
1445
+ var scaleOptions = this.options.scales;
1446
+ (0, util_1.each)(xyScales, function (scale) {
1447
+ var field = scale.field, values = scale.values, isCategory = scale.isCategory, isIdentity = scale.isIdentity;
1448
+ // 分类或者 identity 的 scale 才进行处理
1449
+ if (isCategory || isIdentity) {
1450
+ // 存在 value 值,且用户没有配置 range 配置
1451
+ if (values && !(0, util_1.get)(scaleOptions, [field, 'range'])) {
1452
+ // 更新 range
1453
+ scale.range = (0, scale_1.getDefaultCategoryScaleRange)(scale, coordinate, _this.theme);
1454
+ }
1455
+ }
1456
+ });
1457
+ };
1458
+ /**
1459
+ * 根据 options 配置、Geometry 字段配置,自动生成 components
1460
+ * @param isUpdate 是否是更新
1461
+ * @private
1462
+ */
1463
+ View.prototype.initComponents = function (isUpdate) {
1464
+ // 先全部清空,然后 render
1465
+ var controllers = this.controllers;
1466
+ for (var i = 0; i < controllers.length; i++) {
1467
+ var controller = controllers[i];
1468
+ // 更新则走更新逻辑;否则清空载重绘
1469
+ if (isUpdate) {
1470
+ controller.update();
1471
+ }
1472
+ else {
1473
+ controller.clear();
1474
+ controller.render();
1475
+ }
1476
+ }
1477
+ };
1478
+ View.prototype.doLayout = function () {
1479
+ this.layoutFunc(this);
1480
+ };
1481
+ /**
1482
+ * 创建坐标系
1483
+ * @private
1484
+ */
1485
+ View.prototype.createCoordinate = function () {
1486
+ var start = this.coordinateBBox.bl;
1487
+ var end = this.coordinateBBox.tr;
1488
+ this.coordinateInstance = this.coordinateController.create(start, end);
1489
+ };
1490
+ /**
1491
+ * 根据 options 配置自动渲染 geometry
1492
+ * @private
1493
+ */
1494
+ View.prototype.paintGeometries = function (isUpdate) {
1495
+ var doAnimation = this.options.animate;
1496
+ // geometry 的 paint 阶段
1497
+ var coordinate = this.getCoordinate();
1498
+ var canvasRegion = {
1499
+ x: this.viewBBox.x,
1500
+ y: this.viewBBox.y,
1501
+ minX: this.viewBBox.minX,
1502
+ minY: this.viewBBox.minY,
1503
+ maxX: this.viewBBox.maxX,
1504
+ maxY: this.viewBBox.maxY,
1505
+ width: this.viewBBox.width,
1506
+ height: this.viewBBox.height,
1507
+ };
1508
+ var geometries = this.geometries;
1509
+ for (var i = 0; i < geometries.length; i++) {
1510
+ var geometry = geometries[i];
1511
+ geometry.coordinate = coordinate;
1512
+ geometry.canvasRegion = canvasRegion;
1513
+ if (!doAnimation) {
1514
+ // 如果 view 不执行动画,那么 view 下所有的 geometry 都不执行动画
1515
+ geometry.animate(false);
1516
+ }
1517
+ geometry.paint(isUpdate);
1518
+ }
1519
+ };
1520
+ /**
1521
+ * 最后的绘制组件
1522
+ * @param isUpdate
1523
+ */
1524
+ View.prototype.renderComponents = function (isUpdate) {
1525
+ // 先全部清空,然后 render
1526
+ for (var i = 0; i < this.getComponents().length; i++) {
1527
+ var co = this.getComponents()[i];
1528
+ co.component.render();
1529
+ }
1530
+ };
1531
+ /**
1532
+ * 渲染分面,会在其中进行数据分面,然后进行子 view 创建
1533
+ * @param isUpdate
1534
+ */
1535
+ View.prototype.renderFacet = function (isUpdate) {
1536
+ if (this.facetInstance) {
1537
+ if (isUpdate) {
1538
+ this.facetInstance.update();
1539
+ }
1540
+ else {
1541
+ this.facetInstance.clear();
1542
+ // 计算分面数据
1543
+ this.facetInstance.init();
1544
+ // 渲染组件和 views
1545
+ this.facetInstance.render();
1546
+ }
1547
+ }
1548
+ };
1549
+ View.prototype.initOptions = function () {
1550
+ var _this = this;
1551
+ var _a = this.options, _b = _a.geometries, geometries = _b === void 0 ? [] : _b, _c = _a.interactions, interactions = _c === void 0 ? [] : _c, _d = _a.views, views = _d === void 0 ? [] : _d, _e = _a.annotations, annotations = _e === void 0 ? [] : _e, coordinate = _a.coordinate, events = _a.events, facets = _a.facets;
1552
+ // 设置坐标系
1553
+ if (this.coordinateController) {
1554
+ // 更新 coordinate controller
1555
+ coordinate && this.coordinateController.update(coordinate);
1556
+ }
1557
+ else {
1558
+ // 创建 coordinate controller
1559
+ this.coordinateController = new coordinate_2.default(coordinate);
1560
+ }
1561
+ // 创建 geometry 实例
1562
+ for (var i = 0; i < geometries.length; i++) {
1563
+ var geometryOption = geometries[i];
1564
+ this.createGeometry(geometryOption);
1565
+ }
1566
+ // 创建 interactions 实例
1567
+ for (var j = 0; j < interactions.length; j++) {
1568
+ var interactionOption = interactions[j];
1569
+ var type = interactionOption.type, cfg = interactionOption.cfg;
1570
+ this.interaction(type, cfg);
1571
+ }
1572
+ // 创建 view 实例
1573
+ for (var k = 0; k < views.length; k++) {
1574
+ var viewOption = views[k];
1575
+ this.createView(viewOption);
1576
+ }
1577
+ // 设置 annotation
1578
+ var annotationComponent = this.getController('annotation');
1579
+ for (var l = 0; l < annotations.length; l++) {
1580
+ var annotationOption = annotations[l];
1581
+ annotationComponent.annotation(annotationOption);
1582
+ }
1583
+ // 设置 events
1584
+ if (events) {
1585
+ (0, util_1.each)(events, function (eventCallback, eventName) {
1586
+ _this.on(eventName, eventCallback);
1587
+ });
1588
+ }
1589
+ if (facets) {
1590
+ (0, util_1.each)(facets, function (facet) {
1591
+ var type = facet.type, rest = (0, tslib_1.__rest)(facet, ["type"]);
1592
+ _this.facet(type, rest);
1593
+ });
1594
+ }
1595
+ };
1596
+ View.prototype.createGeometry = function (geometryOption) {
1597
+ var type = geometryOption.type, _a = geometryOption.cfg, cfg = _a === void 0 ? {} : _a;
1598
+ if (this[type]) {
1599
+ var geometry_1 = this[type](cfg);
1600
+ (0, util_1.each)(geometryOption, function (v, k) {
1601
+ if ((0, util_1.isFunction)(geometry_1[k])) {
1602
+ geometry_1[k](v);
1603
+ }
1604
+ });
1605
+ }
1606
+ };
1607
+ /**
1608
+ * scale key 的创建方式
1609
+ * @param field
1610
+ */
1611
+ View.prototype.getScaleKey = function (field) {
1612
+ return "".concat(this.id, "-").concat(field);
1613
+ };
1614
+ return View;
1615
+ }(base_1.default));
1616
+ exports.View = View;
1617
+ /**
1618
+ * 注册 geometry 组件
1619
+ * @param name
1620
+ * @param Ctor
1621
+ * @returns Geometry
1622
+ */
1623
+ function registerGeometry(name, Ctor) {
1624
+ // 语法糖,在 view API 上增加原型方法
1625
+ View.prototype[name.toLowerCase()] = function (cfg) {
1626
+ if (cfg === void 0) { cfg = {}; }
1627
+ var props = (0, tslib_1.__assign)({
1628
+ /** 图形容器 */
1629
+ container: this.middleGroup.addGroup(), labelsContainer: this.foregroundGroup.addGroup() }, cfg);
1630
+ var geometry = new Ctor(props);
1631
+ this.geometries.push(geometry);
1632
+ return geometry;
1633
+ };
1634
+ }
1635
+ exports.registerGeometry = registerGeometry;
1636
+ exports.default = View;
1637
+ //# sourceMappingURL=view.js.map