@antv/g2 4.1.39 → 4.1.43

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 (1344) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/package.json +7 -5
  3. package/src/chart/controller/annotation.ts +4 -0
  4. package/src/chart/controller/tooltip.ts +19 -4
  5. package/src/core.ts +1 -1
  6. package/src/geometry/base.ts +18 -8
  7. package/src/index.ts +8 -0
  8. package/src/interaction/action/component/list-radio.ts +105 -0
  9. package/src/util/scale.ts +14 -1
  10. package/src/util/tooltip.ts +9 -5
  11. package/dist/g2.min.js +0 -30
  12. package/dist/g2.min.js.map +0 -1
  13. package/esm/animate/animation/fade.d.ts +0 -21
  14. package/esm/animate/animation/fade.js +0 -42
  15. package/esm/animate/animation/fade.js.map +0 -1
  16. package/esm/animate/animation/grow-in.d.ts +0 -30
  17. package/esm/animate/animation/grow-in.js +0 -38
  18. package/esm/animate/animation/grow-in.js.map +0 -1
  19. package/esm/animate/animation/index.d.ts +0 -16
  20. package/esm/animate/animation/index.js +0 -17
  21. package/esm/animate/animation/index.js.map +0 -1
  22. package/esm/animate/animation/path-in.d.ts +0 -12
  23. package/esm/animate/animation/path-in.js +0 -21
  24. package/esm/animate/animation/path-in.js.map +0 -1
  25. package/esm/animate/animation/position-update.d.ts +0 -11
  26. package/esm/animate/animation/position-update.js +0 -24
  27. package/esm/animate/animation/position-update.js.map +0 -1
  28. package/esm/animate/animation/scale-in.d.ts +0 -19
  29. package/esm/animate/animation/scale-in.js +0 -60
  30. package/esm/animate/animation/scale-in.js.map +0 -1
  31. package/esm/animate/animation/sector-path-update.d.ts +0 -11
  32. package/esm/animate/animation/sector-path-update.js +0 -131
  33. package/esm/animate/animation/sector-path-update.js.map +0 -1
  34. package/esm/animate/animation/util.d.ts +0 -19
  35. package/esm/animate/animation/util.js +0 -88
  36. package/esm/animate/animation/util.js.map +0 -1
  37. package/esm/animate/animation/wave-in.d.ts +0 -13
  38. package/esm/animate/animation/wave-in.js +0 -26
  39. package/esm/animate/animation/wave-in.js.map +0 -1
  40. package/esm/animate/animation/zoom.d.ts +0 -21
  41. package/esm/animate/animation/zoom.js +0 -66
  42. package/esm/animate/animation/zoom.js.map +0 -1
  43. package/esm/animate/index.d.ts +0 -48
  44. package/esm/animate/index.js +0 -249
  45. package/esm/animate/index.js.map +0 -1
  46. package/esm/animate/interface.d.ts +0 -12
  47. package/esm/animate/interface.js +0 -2
  48. package/esm/animate/interface.js.map +0 -1
  49. package/esm/api.d.ts +0 -2
  50. package/esm/api.js +0 -3
  51. package/esm/api.js.map +0 -1
  52. package/esm/base.d.ts +0 -33
  53. package/esm/base.js +0 -55
  54. package/esm/base.js.map +0 -1
  55. package/esm/chart/chart.d.ts +0 -61
  56. package/esm/chart/chart.js +0 -157
  57. package/esm/chart/chart.js.map +0 -1
  58. package/esm/chart/controller/annotation.d.ts +0 -162
  59. package/esm/chart/controller/annotation.js +0 -577
  60. package/esm/chart/controller/annotation.js.map +0 -1
  61. package/esm/chart/controller/axis.d.ts +0 -93
  62. package/esm/chart/controller/axis.js +0 -578
  63. package/esm/chart/controller/axis.js.map +0 -1
  64. package/esm/chart/controller/base.d.ts +0 -64
  65. package/esm/chart/controller/base.js +0 -62
  66. package/esm/chart/controller/base.js.map +0 -1
  67. package/esm/chart/controller/coordinate.d.ts +0 -74
  68. package/esm/chart/controller/coordinate.js +0 -145
  69. package/esm/chart/controller/coordinate.js.map +0 -1
  70. package/esm/chart/controller/gesture.d.ts +0 -37
  71. package/esm/chart/controller/gesture.js +0 -258
  72. package/esm/chart/controller/gesture.js.map +0 -1
  73. package/esm/chart/controller/index.d.ts +0 -25
  74. package/esm/chart/controller/index.js +0 -34
  75. package/esm/chart/controller/index.js.map +0 -1
  76. package/esm/chart/controller/legend.d.ts +0 -106
  77. package/esm/chart/controller/legend.js +0 -484
  78. package/esm/chart/controller/legend.js.map +0 -1
  79. package/esm/chart/controller/scrollbar.d.ts +0 -64
  80. package/esm/chart/controller/scrollbar.js +0 -316
  81. package/esm/chart/controller/scrollbar.js.map +0 -1
  82. package/esm/chart/controller/slider.d.ts +0 -88
  83. package/esm/chart/controller/slider.js +0 -296
  84. package/esm/chart/controller/slider.js.map +0 -1
  85. package/esm/chart/controller/tooltip.d.ts +0 -68
  86. package/esm/chart/controller/tooltip.js +0 -630
  87. package/esm/chart/controller/tooltip.js.map +0 -1
  88. package/esm/chart/event.d.ts +0 -47
  89. package/esm/chart/event.js +0 -91
  90. package/esm/chart/event.js.map +0 -1
  91. package/esm/chart/index.d.ts +0 -4
  92. package/esm/chart/index.js +0 -5
  93. package/esm/chart/index.js.map +0 -1
  94. package/esm/chart/layout/auto.d.ts +0 -8
  95. package/esm/chart/layout/auto.js +0 -64
  96. package/esm/chart/layout/auto.js.map +0 -1
  97. package/esm/chart/layout/constraint/bounds.d.ts +0 -32
  98. package/esm/chart/layout/constraint/bounds.js +0 -30
  99. package/esm/chart/layout/constraint/bounds.js.map +0 -1
  100. package/esm/chart/layout/constraint/constraint.d.ts +0 -31
  101. package/esm/chart/layout/constraint/constraint.js +0 -81
  102. package/esm/chart/layout/constraint/constraint.js.map +0 -1
  103. package/esm/chart/layout/constraint/gauss.d.ts +0 -11
  104. package/esm/chart/layout/constraint/gauss.js +0 -63
  105. package/esm/chart/layout/constraint/gauss.js.map +0 -1
  106. package/esm/chart/layout/constraint/index.d.ts +0 -5
  107. package/esm/chart/layout/constraint/index.js +0 -30
  108. package/esm/chart/layout/constraint/index.js.map +0 -1
  109. package/esm/chart/layout/constraint/solver.d.ts +0 -40
  110. package/esm/chart/layout/constraint/solver.js +0 -77
  111. package/esm/chart/layout/constraint/solver.js.map +0 -1
  112. package/esm/chart/layout/constraint/types.d.ts +0 -21
  113. package/esm/chart/layout/constraint/types.js +0 -13
  114. package/esm/chart/layout/constraint/types.js.map +0 -1
  115. package/esm/chart/layout/constraint/variable.d.ts +0 -24
  116. package/esm/chart/layout/constraint/variable.js +0 -28
  117. package/esm/chart/layout/constraint/variable.js.map +0 -1
  118. package/esm/chart/layout/index.d.ts +0 -15
  119. package/esm/chart/layout/index.js +0 -26
  120. package/esm/chart/layout/index.js.map +0 -1
  121. package/esm/chart/layout/padding-cal.d.ts +0 -53
  122. package/esm/chart/layout/padding-cal.js +0 -108
  123. package/esm/chart/layout/padding-cal.js.map +0 -1
  124. package/esm/chart/util/scale-pool.d.ts +0 -57
  125. package/esm/chart/util/scale-pool.js +0 -212
  126. package/esm/chart/util/scale-pool.js.map +0 -1
  127. package/esm/chart/util/sync-view-padding.d.ts +0 -9
  128. package/esm/chart/util/sync-view-padding.js +0 -14
  129. package/esm/chart/util/sync-view-padding.js.map +0 -1
  130. package/esm/chart/view.d.ts +0 -747
  131. package/esm/chart/view.js +0 -1633
  132. package/esm/chart/view.js.map +0 -1
  133. package/esm/component/labels.d.ts +0 -47
  134. package/esm/component/labels.js +0 -274
  135. package/esm/component/labels.js.map +0 -1
  136. package/esm/component/update-label.d.ts +0 -21
  137. package/esm/component/update-label.js +0 -57
  138. package/esm/component/update-label.js.map +0 -1
  139. package/esm/constant.d.ts +0 -122
  140. package/esm/constant.js +0 -134
  141. package/esm/constant.js.map +0 -1
  142. package/esm/core.d.ts +0 -46
  143. package/esm/core.js +0 -60
  144. package/esm/core.js.map +0 -1
  145. package/esm/dependents.d.ts +0 -21
  146. package/esm/dependents.js +0 -33
  147. package/esm/dependents.js.map +0 -1
  148. package/esm/engine/index.d.ts +0 -13
  149. package/esm/engine/index.js +0 -22
  150. package/esm/engine/index.js.map +0 -1
  151. package/esm/facet/circle.d.ts +0 -36
  152. package/esm/facet/circle.js +0 -119
  153. package/esm/facet/circle.js.map +0 -1
  154. package/esm/facet/facet.d.ts +0 -165
  155. package/esm/facet/facet.js +0 -291
  156. package/esm/facet/facet.js.map +0 -1
  157. package/esm/facet/index.d.ts +0 -13
  158. package/esm/facet/index.js +0 -22
  159. package/esm/facet/index.js.map +0 -1
  160. package/esm/facet/list.d.ts +0 -46
  161. package/esm/facet/list.js +0 -134
  162. package/esm/facet/list.js.map +0 -1
  163. package/esm/facet/matrix.d.ts +0 -34
  164. package/esm/facet/matrix.js +0 -119
  165. package/esm/facet/matrix.js.map +0 -1
  166. package/esm/facet/mirror.d.ts +0 -31
  167. package/esm/facet/mirror.js +0 -144
  168. package/esm/facet/mirror.js.map +0 -1
  169. package/esm/facet/rect.d.ts +0 -35
  170. package/esm/facet/rect.js +0 -141
  171. package/esm/facet/rect.js.map +0 -1
  172. package/esm/facet/tree.d.ts +0 -40
  173. package/esm/facet/tree.js +0 -288
  174. package/esm/facet/tree.js.map +0 -1
  175. package/esm/geometry/area.d.ts +0 -46
  176. package/esm/geometry/area.js +0 -62
  177. package/esm/geometry/area.js.map +0 -1
  178. package/esm/geometry/base.d.ts +0 -793
  179. package/esm/geometry/base.js +0 -1481
  180. package/esm/geometry/base.js.map +0 -1
  181. package/esm/geometry/edge.d.ts +0 -15
  182. package/esm/geometry/edge.js +0 -24
  183. package/esm/geometry/edge.js.map +0 -1
  184. package/esm/geometry/element/index.d.ts +0 -127
  185. package/esm/geometry/element/index.js +0 -436
  186. package/esm/geometry/element/index.js.map +0 -1
  187. package/esm/geometry/heatmap.d.ts +0 -31
  188. package/esm/geometry/heatmap.js +0 -190
  189. package/esm/geometry/heatmap.js.map +0 -1
  190. package/esm/geometry/interval.d.ts +0 -41
  191. package/esm/geometry/interval.js +0 -98
  192. package/esm/geometry/interval.js.map +0 -1
  193. package/esm/geometry/label/base.d.ts +0 -76
  194. package/esm/geometry/label/base.js +0 -404
  195. package/esm/geometry/label/base.js.map +0 -1
  196. package/esm/geometry/label/index.d.ts +0 -38
  197. package/esm/geometry/label/index.js +0 -35
  198. package/esm/geometry/label/index.js.map +0 -1
  199. package/esm/geometry/label/interface.d.ts +0 -50
  200. package/esm/geometry/label/interface.js +0 -2
  201. package/esm/geometry/label/interface.js.map +0 -1
  202. package/esm/geometry/label/interval.d.ts +0 -27
  203. package/esm/geometry/label/interval.js +0 -146
  204. package/esm/geometry/label/interval.js.map +0 -1
  205. package/esm/geometry/label/layout/adjust-color.d.ts +0 -3
  206. package/esm/geometry/label/layout/adjust-color.js +0 -36
  207. package/esm/geometry/label/layout/adjust-color.js.map +0 -1
  208. package/esm/geometry/label/layout/hide-overlap.d.ts +0 -8
  209. package/esm/geometry/label/layout/hide-overlap.js +0 -29
  210. package/esm/geometry/label/layout/hide-overlap.js.map +0 -1
  211. package/esm/geometry/label/layout/interval/adjust-position.d.ts +0 -9
  212. package/esm/geometry/label/layout/interval/adjust-position.js +0 -61
  213. package/esm/geometry/label/layout/interval/adjust-position.js.map +0 -1
  214. package/esm/geometry/label/layout/interval/hide-overlap.d.ts +0 -9
  215. package/esm/geometry/label/layout/interval/hide-overlap.js +0 -78
  216. package/esm/geometry/label/layout/interval/hide-overlap.js.map +0 -1
  217. package/esm/geometry/label/layout/limit-in-canvas.d.ts +0 -9
  218. package/esm/geometry/label/layout/limit-in-canvas.js +0 -44
  219. package/esm/geometry/label/layout/limit-in-canvas.js.map +0 -1
  220. package/esm/geometry/label/layout/limit-in-plot.d.ts +0 -18
  221. package/esm/geometry/label/layout/limit-in-plot.js +0 -75
  222. package/esm/geometry/label/layout/limit-in-plot.js.map +0 -1
  223. package/esm/geometry/label/layout/limit-in-shape.d.ts +0 -7
  224. package/esm/geometry/label/layout/limit-in-shape.js +0 -18
  225. package/esm/geometry/label/layout/limit-in-shape.js.map +0 -1
  226. package/esm/geometry/label/layout/overlap.d.ts +0 -15
  227. package/esm/geometry/label/layout/overlap.js +0 -223
  228. package/esm/geometry/label/layout/overlap.js.map +0 -1
  229. package/esm/geometry/label/layout/path/adjust-position.d.ts +0 -17
  230. package/esm/geometry/label/layout/path/adjust-position.js +0 -94
  231. package/esm/geometry/label/layout/path/adjust-position.js.map +0 -1
  232. package/esm/geometry/label/layout/pie/distribute.d.ts +0 -3
  233. package/esm/geometry/label/layout/pie/distribute.js +0 -185
  234. package/esm/geometry/label/layout/pie/distribute.js.map +0 -1
  235. package/esm/geometry/label/layout/pie/outer.d.ts +0 -6
  236. package/esm/geometry/label/layout/pie/outer.js +0 -207
  237. package/esm/geometry/label/layout/pie/outer.js.map +0 -1
  238. package/esm/geometry/label/layout/pie/spider.d.ts +0 -7
  239. package/esm/geometry/label/layout/pie/spider.js +0 -181
  240. package/esm/geometry/label/layout/pie/spider.js.map +0 -1
  241. package/esm/geometry/label/layout/pie/util.d.ts +0 -10
  242. package/esm/geometry/label/layout/pie/util.js +0 -73
  243. package/esm/geometry/label/layout/pie/util.js.map +0 -1
  244. package/esm/geometry/label/layout/point/adjust-position.d.ts +0 -17
  245. package/esm/geometry/label/layout/point/adjust-position.js +0 -94
  246. package/esm/geometry/label/layout/point/adjust-position.js.map +0 -1
  247. package/esm/geometry/label/pie.d.ts +0 -22
  248. package/esm/geometry/label/pie.js +0 -95
  249. package/esm/geometry/label/pie.js.map +0 -1
  250. package/esm/geometry/label/polar.d.ts +0 -64
  251. package/esm/geometry/label/polar.js +0 -221
  252. package/esm/geometry/label/polar.js.map +0 -1
  253. package/esm/geometry/label/util/index.d.ts +0 -26
  254. package/esm/geometry/label/util/index.js +0 -61
  255. package/esm/geometry/label/util/index.js.map +0 -1
  256. package/esm/geometry/line.d.ts +0 -11
  257. package/esm/geometry/line.js +0 -21
  258. package/esm/geometry/line.js.map +0 -1
  259. package/esm/geometry/path.d.ts +0 -40
  260. package/esm/geometry/path.js +0 -122
  261. package/esm/geometry/path.js.map +0 -1
  262. package/esm/geometry/point.d.ts +0 -19
  263. package/esm/geometry/point.js +0 -30
  264. package/esm/geometry/point.js.map +0 -1
  265. package/esm/geometry/polygon.d.ts +0 -19
  266. package/esm/geometry/polygon.js +0 -62
  267. package/esm/geometry/polygon.js.map +0 -1
  268. package/esm/geometry/schema.d.ts +0 -18
  269. package/esm/geometry/schema.js +0 -48
  270. package/esm/geometry/schema.js.map +0 -1
  271. package/esm/geometry/shape/area/index.d.ts +0 -2
  272. package/esm/geometry/shape/area/index.js +0 -44
  273. package/esm/geometry/shape/area/index.js.map +0 -1
  274. package/esm/geometry/shape/area/line.d.ts +0 -1
  275. package/esm/geometry/shape/area/line.js +0 -31
  276. package/esm/geometry/shape/area/line.js.map +0 -1
  277. package/esm/geometry/shape/area/smooth-line.d.ts +0 -1
  278. package/esm/geometry/shape/area/smooth-line.js +0 -30
  279. package/esm/geometry/shape/area/smooth-line.js.map +0 -1
  280. package/esm/geometry/shape/area/smooth.d.ts +0 -1
  281. package/esm/geometry/shape/area/smooth.js +0 -31
  282. package/esm/geometry/shape/area/smooth.js.map +0 -1
  283. package/esm/geometry/shape/area/util.d.ts +0 -22
  284. package/esm/geometry/shape/area/util.js +0 -88
  285. package/esm/geometry/shape/area/util.js.map +0 -1
  286. package/esm/geometry/shape/base.d.ts +0 -22
  287. package/esm/geometry/shape/base.js +0 -162
  288. package/esm/geometry/shape/base.js.map +0 -1
  289. package/esm/geometry/shape/constant.d.ts +0 -4
  290. package/esm/geometry/shape/constant.js +0 -5
  291. package/esm/geometry/shape/constant.js.map +0 -1
  292. package/esm/geometry/shape/edge/arc.d.ts +0 -1
  293. package/esm/geometry/shape/edge/arc.js +0 -84
  294. package/esm/geometry/shape/edge/arc.js.map +0 -1
  295. package/esm/geometry/shape/edge/index.d.ts +0 -2
  296. package/esm/geometry/shape/edge/index.js +0 -31
  297. package/esm/geometry/shape/edge/index.js.map +0 -1
  298. package/esm/geometry/shape/edge/smooth.d.ts +0 -1
  299. package/esm/geometry/shape/edge/smooth.js +0 -30
  300. package/esm/geometry/shape/edge/smooth.js.map +0 -1
  301. package/esm/geometry/shape/edge/util.d.ts +0 -17
  302. package/esm/geometry/shape/edge/util.js +0 -32
  303. package/esm/geometry/shape/edge/util.js.map +0 -1
  304. package/esm/geometry/shape/edge/vhv.d.ts +0 -1
  305. package/esm/geometry/shape/edge/vhv.js +0 -42
  306. package/esm/geometry/shape/edge/vhv.js.map +0 -1
  307. package/esm/geometry/shape/interval/funnel.d.ts +0 -1
  308. package/esm/geometry/shape/interval/funnel.js +0 -31
  309. package/esm/geometry/shape/interval/funnel.js.map +0 -1
  310. package/esm/geometry/shape/interval/hollow-rect.d.ts +0 -1
  311. package/esm/geometry/shape/interval/hollow-rect.js +0 -51
  312. package/esm/geometry/shape/interval/hollow-rect.js.map +0 -1
  313. package/esm/geometry/shape/interval/index.d.ts +0 -3
  314. package/esm/geometry/shape/interval/index.js +0 -63
  315. package/esm/geometry/shape/interval/index.js.map +0 -1
  316. package/esm/geometry/shape/interval/line.d.ts +0 -1
  317. package/esm/geometry/shape/interval/line.js +0 -54
  318. package/esm/geometry/shape/interval/line.js.map +0 -1
  319. package/esm/geometry/shape/interval/pyramid.d.ts +0 -1
  320. package/esm/geometry/shape/interval/pyramid.js +0 -31
  321. package/esm/geometry/shape/interval/pyramid.js.map +0 -1
  322. package/esm/geometry/shape/interval/tick.d.ts +0 -1
  323. package/esm/geometry/shape/interval/tick.js +0 -77
  324. package/esm/geometry/shape/interval/tick.js.map +0 -1
  325. package/esm/geometry/shape/interval/util.d.ts +0 -55
  326. package/esm/geometry/shape/interval/util.js +0 -311
  327. package/esm/geometry/shape/interval/util.js.map +0 -1
  328. package/esm/geometry/shape/line/index.d.ts +0 -8
  329. package/esm/geometry/shape/line/index.js +0 -105
  330. package/esm/geometry/shape/line/index.js.map +0 -1
  331. package/esm/geometry/shape/line/step.d.ts +0 -1
  332. package/esm/geometry/shape/line/step.js +0 -84
  333. package/esm/geometry/shape/line/step.js.map +0 -1
  334. package/esm/geometry/shape/line/util.d.ts +0 -16
  335. package/esm/geometry/shape/line/util.js +0 -83
  336. package/esm/geometry/shape/line/util.js.map +0 -1
  337. package/esm/geometry/shape/point/hollow.d.ts +0 -1
  338. package/esm/geometry/shape/point/hollow.js +0 -24
  339. package/esm/geometry/shape/point/hollow.js.map +0 -1
  340. package/esm/geometry/shape/point/image.d.ts +0 -1
  341. package/esm/geometry/shape/point/image.js +0 -48
  342. package/esm/geometry/shape/point/image.js.map +0 -1
  343. package/esm/geometry/shape/point/index.d.ts +0 -2
  344. package/esm/geometry/shape/point/index.js +0 -32
  345. package/esm/geometry/shape/point/index.js.map +0 -1
  346. package/esm/geometry/shape/point/solid.d.ts +0 -1
  347. package/esm/geometry/shape/point/solid.js +0 -23
  348. package/esm/geometry/shape/point/solid.js.map +0 -1
  349. package/esm/geometry/shape/point/util.d.ts +0 -15
  350. package/esm/geometry/shape/point/util.js +0 -39
  351. package/esm/geometry/shape/point/util.js.map +0 -1
  352. package/esm/geometry/shape/polygon/index.d.ts +0 -2
  353. package/esm/geometry/shape/polygon/index.js +0 -65
  354. package/esm/geometry/shape/polygon/index.js.map +0 -1
  355. package/esm/geometry/shape/polygon/square.d.ts +0 -1
  356. package/esm/geometry/shape/polygon/square.js +0 -44
  357. package/esm/geometry/shape/polygon/square.js.map +0 -1
  358. package/esm/geometry/shape/schema/box.d.ts +0 -1
  359. package/esm/geometry/shape/schema/box.js +0 -142
  360. package/esm/geometry/shape/schema/box.js.map +0 -1
  361. package/esm/geometry/shape/schema/candle.d.ts +0 -1
  362. package/esm/geometry/shape/schema/candle.js +0 -80
  363. package/esm/geometry/shape/schema/candle.js.map +0 -1
  364. package/esm/geometry/shape/schema/index.d.ts +0 -2
  365. package/esm/geometry/shape/schema/index.js +0 -6
  366. package/esm/geometry/shape/schema/index.js.map +0 -1
  367. package/esm/geometry/shape/util/get-path-points.d.ts +0 -38
  368. package/esm/geometry/shape/util/get-path-points.js +0 -131
  369. package/esm/geometry/shape/util/get-path-points.js.map +0 -1
  370. package/esm/geometry/shape/util/get-style.d.ts +0 -18
  371. package/esm/geometry/shape/util/get-style.js +0 -47
  372. package/esm/geometry/shape/util/get-style.js.map +0 -1
  373. package/esm/geometry/shape/util/path.d.ts +0 -32
  374. package/esm/geometry/shape/util/path.js +0 -311
  375. package/esm/geometry/shape/util/path.js.map +0 -1
  376. package/esm/geometry/shape/util/split-points.d.ts +0 -13
  377. package/esm/geometry/shape/util/split-points.js +0 -24
  378. package/esm/geometry/shape/util/split-points.js.map +0 -1
  379. package/esm/geometry/shape/violin/hollow.d.ts +0 -1
  380. package/esm/geometry/shape/violin/hollow.js +0 -51
  381. package/esm/geometry/shape/violin/hollow.js.map +0 -1
  382. package/esm/geometry/shape/violin/index.d.ts +0 -2
  383. package/esm/geometry/shape/violin/index.js +0 -60
  384. package/esm/geometry/shape/violin/index.js.map +0 -1
  385. package/esm/geometry/shape/violin/smooth.d.ts +0 -1
  386. package/esm/geometry/shape/violin/smooth.js +0 -28
  387. package/esm/geometry/shape/violin/smooth.js.map +0 -1
  388. package/esm/geometry/util/diff.d.ts +0 -11
  389. package/esm/geometry/util/diff.js +0 -30
  390. package/esm/geometry/util/diff.js.map +0 -1
  391. package/esm/geometry/util/get-shape-type.d.ts +0 -8
  392. package/esm/geometry/util/get-shape-type.js +0 -16
  393. package/esm/geometry/util/get-shape-type.js.map +0 -1
  394. package/esm/geometry/util/group-data.d.ts +0 -3
  395. package/esm/geometry/util/group-data.js +0 -31
  396. package/esm/geometry/util/group-data.js.map +0 -1
  397. package/esm/geometry/util/is-model-change.d.ts +0 -9
  398. package/esm/geometry/util/is-model-change.js +0 -14
  399. package/esm/geometry/util/is-model-change.js.map +0 -1
  400. package/esm/geometry/util/parse-fields.d.ts +0 -2
  401. package/esm/geometry/util/parse-fields.js +0 -9
  402. package/esm/geometry/util/parse-fields.js.map +0 -1
  403. package/esm/geometry/util/shape-size.d.ts +0 -2
  404. package/esm/geometry/util/shape-size.js +0 -124
  405. package/esm/geometry/util/shape-size.js.map +0 -1
  406. package/esm/geometry/violin.d.ts +0 -25
  407. package/esm/geometry/violin.js +0 -67
  408. package/esm/geometry/violin.js.map +0 -1
  409. package/esm/index.d.ts +0 -107
  410. package/esm/index.js +0 -573
  411. package/esm/index.js.map +0 -1
  412. package/esm/interaction/action/active-region.d.ts +0 -33
  413. package/esm/interaction/action/active-region.js +0 -198
  414. package/esm/interaction/action/active-region.js.map +0 -1
  415. package/esm/interaction/action/base.d.ts +0 -29
  416. package/esm/interaction/action/base.js +0 -36
  417. package/esm/interaction/action/base.js.map +0 -1
  418. package/esm/interaction/action/callback.d.ts +0 -17
  419. package/esm/interaction/action/callback.js +0 -27
  420. package/esm/interaction/action/callback.js.map +0 -1
  421. package/esm/interaction/action/component/list-active.d.ts +0 -14
  422. package/esm/interaction/action/component/list-active.js +0 -24
  423. package/esm/interaction/action/component/list-active.js.map +0 -1
  424. package/esm/interaction/action/component/list-checked.d.ts +0 -30
  425. package/esm/interaction/action/component/list-checked.js +0 -82
  426. package/esm/interaction/action/component/list-checked.js.map +0 -1
  427. package/esm/interaction/action/component/list-focus.d.ts +0 -5
  428. package/esm/interaction/action/component/list-focus.js +0 -55
  429. package/esm/interaction/action/component/list-focus.js.map +0 -1
  430. package/esm/interaction/action/component/list-highlight-util.d.ts +0 -7
  431. package/esm/interaction/action/component/list-highlight-util.js +0 -20
  432. package/esm/interaction/action/component/list-highlight-util.js.map +0 -1
  433. package/esm/interaction/action/component/list-highlight.d.ts +0 -20
  434. package/esm/interaction/action/component/list-highlight.js +0 -97
  435. package/esm/interaction/action/component/list-highlight.js.map +0 -1
  436. package/esm/interaction/action/component/list-radio.d.ts +0 -6
  437. package/esm/interaction/action/component/list-radio.js +0 -26
  438. package/esm/interaction/action/component/list-radio.js.map +0 -1
  439. package/esm/interaction/action/component/list-selected.d.ts +0 -10
  440. package/esm/interaction/action/component/list-selected.js +0 -20
  441. package/esm/interaction/action/component/list-selected.js.map +0 -1
  442. package/esm/interaction/action/component/list-state.d.ts +0 -46
  443. package/esm/interaction/action/component/list-state.js +0 -167
  444. package/esm/interaction/action/component/list-state.js.map +0 -1
  445. package/esm/interaction/action/component/list-unchecked.d.ts +0 -13
  446. package/esm/interaction/action/component/list-unchecked.js +0 -23
  447. package/esm/interaction/action/component/list-unchecked.js.map +0 -1
  448. package/esm/interaction/action/component/tooltip/ellipsis-text.d.ts +0 -25
  449. package/esm/interaction/action/component/tooltip/ellipsis-text.js +0 -93
  450. package/esm/interaction/action/component/tooltip/ellipsis-text.js.map +0 -1
  451. package/esm/interaction/action/component/tooltip/geometry.d.ts +0 -24
  452. package/esm/interaction/action/component/tooltip/geometry.js +0 -71
  453. package/esm/interaction/action/component/tooltip/geometry.js.map +0 -1
  454. package/esm/interaction/action/component/tooltip/sibling.d.ts +0 -21
  455. package/esm/interaction/action/component/tooltip/sibling.js +0 -39
  456. package/esm/interaction/action/component/tooltip/sibling.js.map +0 -1
  457. package/esm/interaction/action/cursor.d.ts +0 -69
  458. package/esm/interaction/action/cursor.js +0 -113
  459. package/esm/interaction/action/cursor.js.map +0 -1
  460. package/esm/interaction/action/data/filter.d.ts +0 -13
  461. package/esm/interaction/action/data/filter.js +0 -66
  462. package/esm/interaction/action/data/filter.js.map +0 -1
  463. package/esm/interaction/action/data/range-filter.d.ts +0 -56
  464. package/esm/interaction/action/data/range-filter.js +0 -163
  465. package/esm/interaction/action/data/range-filter.js.map +0 -1
  466. package/esm/interaction/action/data/sibling-filter.d.ts +0 -22
  467. package/esm/interaction/action/data/sibling-filter.js +0 -39
  468. package/esm/interaction/action/data/sibling-filter.js.map +0 -1
  469. package/esm/interaction/action/element/active.d.ts +0 -14
  470. package/esm/interaction/action/element/active.js +0 -24
  471. package/esm/interaction/action/element/active.js.map +0 -1
  472. package/esm/interaction/action/element/filter.d.ts +0 -20
  473. package/esm/interaction/action/element/filter.js +0 -89
  474. package/esm/interaction/action/element/filter.js.map +0 -1
  475. package/esm/interaction/action/element/highlight-by-color.d.ts +0 -10
  476. package/esm/interaction/action/element/highlight-by-color.js +0 -30
  477. package/esm/interaction/action/element/highlight-by-color.js.map +0 -1
  478. package/esm/interaction/action/element/highlight-by-x.d.ts +0 -15
  479. package/esm/interaction/action/element/highlight-by-x.js +0 -51
  480. package/esm/interaction/action/element/highlight-by-x.js.map +0 -1
  481. package/esm/interaction/action/element/highlight-util.d.ts +0 -18
  482. package/esm/interaction/action/element/highlight-util.js +0 -45
  483. package/esm/interaction/action/element/highlight-util.js.map +0 -1
  484. package/esm/interaction/action/element/highlight.d.ts +0 -21
  485. package/esm/interaction/action/element/highlight.js +0 -93
  486. package/esm/interaction/action/element/highlight.js.map +0 -1
  487. package/esm/interaction/action/element/link-by-color.d.ts +0 -51
  488. package/esm/interaction/action/element/link-by-color.js +0 -156
  489. package/esm/interaction/action/element/link-by-color.js.map +0 -1
  490. package/esm/interaction/action/element/range-active.d.ts +0 -13
  491. package/esm/interaction/action/element/range-active.js +0 -23
  492. package/esm/interaction/action/element/range-active.js.map +0 -1
  493. package/esm/interaction/action/element/range-highlight.d.ts +0 -27
  494. package/esm/interaction/action/element/range-highlight.js +0 -54
  495. package/esm/interaction/action/element/range-highlight.js.map +0 -1
  496. package/esm/interaction/action/element/range-selected.d.ts +0 -13
  497. package/esm/interaction/action/element/range-selected.js +0 -23
  498. package/esm/interaction/action/element/range-selected.js.map +0 -1
  499. package/esm/interaction/action/element/range-state.d.ts +0 -38
  500. package/esm/interaction/action/element/range-state.js +0 -164
  501. package/esm/interaction/action/element/range-state.js.map +0 -1
  502. package/esm/interaction/action/element/selected.d.ts +0 -14
  503. package/esm/interaction/action/element/selected.js +0 -24
  504. package/esm/interaction/action/element/selected.js.map +0 -1
  505. package/esm/interaction/action/element/sibling-filter.d.ts +0 -19
  506. package/esm/interaction/action/element/sibling-filter.js +0 -93
  507. package/esm/interaction/action/element/sibling-filter.js.map +0 -1
  508. package/esm/interaction/action/element/single-active.d.ts +0 -13
  509. package/esm/interaction/action/element/single-active.js +0 -23
  510. package/esm/interaction/action/element/single-active.js.map +0 -1
  511. package/esm/interaction/action/element/single-highlight.d.ts +0 -16
  512. package/esm/interaction/action/element/single-highlight.js +0 -35
  513. package/esm/interaction/action/element/single-highlight.js.map +0 -1
  514. package/esm/interaction/action/element/single-selected.d.ts +0 -13
  515. package/esm/interaction/action/element/single-selected.js +0 -23
  516. package/esm/interaction/action/element/single-selected.js.map +0 -1
  517. package/esm/interaction/action/element/single-state.d.ts +0 -18
  518. package/esm/interaction/action/element/single-state.js +0 -53
  519. package/esm/interaction/action/element/single-state.js.map +0 -1
  520. package/esm/interaction/action/element/state-base.d.ts +0 -39
  521. package/esm/interaction/action/element/state-base.js +0 -59
  522. package/esm/interaction/action/element/state-base.js.map +0 -1
  523. package/esm/interaction/action/element/state.d.ts +0 -28
  524. package/esm/interaction/action/element/state.js +0 -99
  525. package/esm/interaction/action/element/state.js.map +0 -1
  526. package/esm/interaction/action/index.d.ts +0 -2
  527. package/esm/interaction/action/index.js +0 -3
  528. package/esm/interaction/action/index.js.map +0 -1
  529. package/esm/interaction/action/mask/base.d.ts +0 -62
  530. package/esm/interaction/action/mask/base.js +0 -169
  531. package/esm/interaction/action/mask/base.js.map +0 -1
  532. package/esm/interaction/action/mask/circle.d.ts +0 -14
  533. package/esm/interaction/action/mask/circle.js +0 -37
  534. package/esm/interaction/action/mask/circle.js.map +0 -1
  535. package/esm/interaction/action/mask/dim-rect.d.ts +0 -11
  536. package/esm/interaction/action/mask/dim-rect.js +0 -62
  537. package/esm/interaction/action/mask/dim-rect.js.map +0 -1
  538. package/esm/interaction/action/mask/path.d.ts +0 -16
  539. package/esm/interaction/action/mask/path.js +0 -44
  540. package/esm/interaction/action/mask/path.js.map +0 -1
  541. package/esm/interaction/action/mask/rect.d.ts +0 -17
  542. package/esm/interaction/action/mask/rect.js +0 -39
  543. package/esm/interaction/action/mask/rect.js.map +0 -1
  544. package/esm/interaction/action/mask/smooth-path.d.ts +0 -9
  545. package/esm/interaction/action/mask/smooth-path.js +0 -21
  546. package/esm/interaction/action/mask/smooth-path.js.map +0 -1
  547. package/esm/interaction/action/register.d.ts +0 -36
  548. package/esm/interaction/action/register.js +0 -60
  549. package/esm/interaction/action/register.js.map +0 -1
  550. package/esm/interaction/action/util.d.ts +0 -140
  551. package/esm/interaction/action/util.js +0 -361
  552. package/esm/interaction/action/util.js.map +0 -1
  553. package/esm/interaction/action/view/button.d.ts +0 -25
  554. package/esm/interaction/action/view/button.js +0 -116
  555. package/esm/interaction/action/view/button.js.map +0 -1
  556. package/esm/interaction/action/view/drag.d.ts +0 -24
  557. package/esm/interaction/action/view/drag.js +0 -73
  558. package/esm/interaction/action/view/drag.js.map +0 -1
  559. package/esm/interaction/action/view/mousewheel-scroll.d.ts +0 -5
  560. package/esm/interaction/action/view/mousewheel-scroll.js +0 -35
  561. package/esm/interaction/action/view/mousewheel-scroll.js.map +0 -1
  562. package/esm/interaction/action/view/move.d.ts +0 -28
  563. package/esm/interaction/action/view/move.js +0 -80
  564. package/esm/interaction/action/view/move.js.map +0 -1
  565. package/esm/interaction/action/view/scale-transform.d.ts +0 -18
  566. package/esm/interaction/action/view/scale-transform.js +0 -51
  567. package/esm/interaction/action/view/scale-transform.js.map +0 -1
  568. package/esm/interaction/action/view/scale-translate.d.ts +0 -30
  569. package/esm/interaction/action/view/scale-translate.js +0 -112
  570. package/esm/interaction/action/view/scale-translate.js.map +0 -1
  571. package/esm/interaction/action/view/scale-zoom.d.ts +0 -20
  572. package/esm/interaction/action/view/scale-zoom.js +0 -83
  573. package/esm/interaction/action/view/scale-zoom.js.map +0 -1
  574. package/esm/interaction/context.d.ts +0 -65
  575. package/esm/interaction/context.js +0 -142
  576. package/esm/interaction/context.js.map +0 -1
  577. package/esm/interaction/grammar-interaction.d.ts +0 -158
  578. package/esm/interaction/grammar-interaction.js +0 -285
  579. package/esm/interaction/grammar-interaction.js.map +0 -1
  580. package/esm/interaction/index.d.ts +0 -25
  581. package/esm/interaction/index.js +0 -43
  582. package/esm/interaction/index.js.map +0 -1
  583. package/esm/interaction/interaction.d.ts +0 -29
  584. package/esm/interaction/interaction.js +0 -32
  585. package/esm/interaction/interaction.js.map +0 -1
  586. package/esm/interface.d.ts +0 -2264
  587. package/esm/interface.js +0 -2
  588. package/esm/interface.js.map +0 -1
  589. package/esm/theme/index.d.ts +0 -12
  590. package/esm/theme/index.js +0 -23
  591. package/esm/theme/index.js.map +0 -1
  592. package/esm/theme/style-sheet/dark.d.ts +0 -825
  593. package/esm/theme/style-sheet/dark.js +0 -496
  594. package/esm/theme/style-sheet/dark.js.map +0 -1
  595. package/esm/theme/style-sheet/light.d.ts +0 -817
  596. package/esm/theme/style-sheet/light.js +0 -492
  597. package/esm/theme/style-sheet/light.js.map +0 -1
  598. package/esm/theme/util/create-by-style-sheet.d.ts +0 -6
  599. package/esm/theme/util/create-by-style-sheet.js +0 -1422
  600. package/esm/theme/util/create-by-style-sheet.js.map +0 -1
  601. package/esm/theme/util/create-theme.d.ts +0 -6
  602. package/esm/theme/util/create-theme.js +0 -12
  603. package/esm/theme/util/create-theme.js.map +0 -1
  604. package/esm/theme/util/index.d.ts +0 -1
  605. package/esm/theme/util/index.js +0 -2
  606. package/esm/theme/util/index.js.map +0 -1
  607. package/esm/util/annotation.d.ts +0 -7
  608. package/esm/util/annotation.js +0 -39
  609. package/esm/util/annotation.js.map +0 -1
  610. package/esm/util/attr.d.ts +0 -10
  611. package/esm/util/attr.js +0 -25
  612. package/esm/util/attr.js.map +0 -1
  613. package/esm/util/axis.d.ts +0 -100
  614. package/esm/util/axis.js +0 -236
  615. package/esm/util/axis.js.map +0 -1
  616. package/esm/util/bbox.d.ts +0 -105
  617. package/esm/util/bbox.js +0 -282
  618. package/esm/util/bbox.js.map +0 -1
  619. package/esm/util/collision-detect.d.ts +0 -16
  620. package/esm/util/collision-detect.js +0 -127
  621. package/esm/util/collision-detect.js.map +0 -1
  622. package/esm/util/color.d.ts +0 -1
  623. package/esm/util/color.js +0 -18
  624. package/esm/util/color.js.map +0 -1
  625. package/esm/util/context.d.ts +0 -4
  626. package/esm/util/context.js +0 -11
  627. package/esm/util/context.js.map +0 -1
  628. package/esm/util/coordinate.d.ts +0 -86
  629. package/esm/util/coordinate.js +0 -147
  630. package/esm/util/coordinate.js.map +0 -1
  631. package/esm/util/direction.d.ts +0 -19
  632. package/esm/util/direction.js +0 -120
  633. package/esm/util/direction.js.map +0 -1
  634. package/esm/util/dom.d.ts +0 -19
  635. package/esm/util/dom.js +0 -61
  636. package/esm/util/dom.js.map +0 -1
  637. package/esm/util/event.d.ts +0 -8
  638. package/esm/util/event.js +0 -14
  639. package/esm/util/event.js.map +0 -1
  640. package/esm/util/facet.d.ts +0 -16
  641. package/esm/util/facet.js +0 -43
  642. package/esm/util/facet.js.map +0 -1
  643. package/esm/util/graphics.d.ts +0 -58
  644. package/esm/util/graphics.js +0 -203
  645. package/esm/util/graphics.js.map +0 -1
  646. package/esm/util/grid.d.ts +0 -36
  647. package/esm/util/grid.js +0 -118
  648. package/esm/util/grid.js.map +0 -1
  649. package/esm/util/helper.d.ts +0 -34
  650. package/esm/util/helper.js +0 -72
  651. package/esm/util/helper.js.map +0 -1
  652. package/esm/util/legend.d.ts +0 -45
  653. package/esm/util/legend.js +0 -145
  654. package/esm/util/legend.js.map +0 -1
  655. package/esm/util/marker.d.ts +0 -10
  656. package/esm/util/marker.js +0 -58
  657. package/esm/util/marker.js.map +0 -1
  658. package/esm/util/padding.d.ts +0 -14
  659. package/esm/util/padding.js +0 -40
  660. package/esm/util/padding.js.map +0 -1
  661. package/esm/util/scale.d.ts +0 -38
  662. package/esm/util/scale.js +0 -114
  663. package/esm/util/scale.js.map +0 -1
  664. package/esm/util/stat.d.ts +0 -10
  665. package/esm/util/stat.js +0 -36
  666. package/esm/util/stat.js.map +0 -1
  667. package/esm/util/text.d.ts +0 -23
  668. package/esm/util/text.js +0 -84
  669. package/esm/util/text.js.map +0 -1
  670. package/esm/util/tooltip.d.ts +0 -26
  671. package/esm/util/tooltip.js +0 -415
  672. package/esm/util/tooltip.js.map +0 -1
  673. package/esm/util/transform.d.ts +0 -33
  674. package/esm/util/transform.js +0 -61
  675. package/esm/util/transform.js.map +0 -1
  676. package/esm/util/types.d.ts +0 -6
  677. package/esm/util/types.js +0 -2
  678. package/esm/util/types.js.map +0 -1
  679. package/lib/animate/animation/fade.d.ts +0 -21
  680. package/lib/animate/animation/fade.js +0 -47
  681. package/lib/animate/animation/fade.js.map +0 -1
  682. package/lib/animate/animation/grow-in.d.ts +0 -30
  683. package/lib/animate/animation/grow-in.js +0 -44
  684. package/lib/animate/animation/grow-in.js.map +0 -1
  685. package/lib/animate/animation/index.d.ts +0 -16
  686. package/lib/animate/animation/index.js +0 -22
  687. package/lib/animate/animation/index.js.map +0 -1
  688. package/lib/animate/animation/path-in.d.ts +0 -12
  689. package/lib/animate/animation/path-in.js +0 -25
  690. package/lib/animate/animation/path-in.js.map +0 -1
  691. package/lib/animate/animation/position-update.d.ts +0 -11
  692. package/lib/animate/animation/position-update.js +0 -28
  693. package/lib/animate/animation/position-update.js.map +0 -1
  694. package/lib/animate/animation/scale-in.d.ts +0 -19
  695. package/lib/animate/animation/scale-in.js +0 -65
  696. package/lib/animate/animation/scale-in.js.map +0 -1
  697. package/lib/animate/animation/sector-path-update.d.ts +0 -11
  698. package/lib/animate/animation/sector-path-update.js +0 -135
  699. package/lib/animate/animation/sector-path-update.js.map +0 -1
  700. package/lib/animate/animation/util.d.ts +0 -19
  701. package/lib/animate/animation/util.js +0 -93
  702. package/lib/animate/animation/util.js.map +0 -1
  703. package/lib/animate/animation/wave-in.d.ts +0 -13
  704. package/lib/animate/animation/wave-in.js +0 -30
  705. package/lib/animate/animation/wave-in.js.map +0 -1
  706. package/lib/animate/animation/zoom.d.ts +0 -21
  707. package/lib/animate/animation/zoom.js +0 -71
  708. package/lib/animate/animation/zoom.js.map +0 -1
  709. package/lib/animate/index.d.ts +0 -48
  710. package/lib/animate/index.js +0 -255
  711. package/lib/animate/index.js.map +0 -1
  712. package/lib/animate/interface.d.ts +0 -12
  713. package/lib/animate/interface.js +0 -3
  714. package/lib/animate/interface.js.map +0 -1
  715. package/lib/api.d.ts +0 -2
  716. package/lib/api.js +0 -7
  717. package/lib/api.js.map +0 -1
  718. package/lib/base.d.ts +0 -33
  719. package/lib/base.js +0 -57
  720. package/lib/base.js.map +0 -1
  721. package/lib/chart/chart.d.ts +0 -61
  722. package/lib/chart/chart.js +0 -159
  723. package/lib/chart/chart.js.map +0 -1
  724. package/lib/chart/controller/annotation.d.ts +0 -162
  725. package/lib/chart/controller/annotation.js +0 -579
  726. package/lib/chart/controller/annotation.js.map +0 -1
  727. package/lib/chart/controller/axis.d.ts +0 -93
  728. package/lib/chart/controller/axis.js +0 -580
  729. package/lib/chart/controller/axis.js.map +0 -1
  730. package/lib/chart/controller/base.d.ts +0 -64
  731. package/lib/chart/controller/base.js +0 -65
  732. package/lib/chart/controller/base.js.map +0 -1
  733. package/lib/chart/controller/coordinate.d.ts +0 -74
  734. package/lib/chart/controller/coordinate.js +0 -147
  735. package/lib/chart/controller/coordinate.js.map +0 -1
  736. package/lib/chart/controller/gesture.d.ts +0 -37
  737. package/lib/chart/controller/gesture.js +0 -260
  738. package/lib/chart/controller/gesture.js.map +0 -1
  739. package/lib/chart/controller/index.d.ts +0 -25
  740. package/lib/chart/controller/index.js +0 -41
  741. package/lib/chart/controller/index.js.map +0 -1
  742. package/lib/chart/controller/legend.d.ts +0 -106
  743. package/lib/chart/controller/legend.js +0 -486
  744. package/lib/chart/controller/legend.js.map +0 -1
  745. package/lib/chart/controller/scrollbar.d.ts +0 -64
  746. package/lib/chart/controller/scrollbar.js +0 -318
  747. package/lib/chart/controller/scrollbar.js.map +0 -1
  748. package/lib/chart/controller/slider.d.ts +0 -88
  749. package/lib/chart/controller/slider.js +0 -298
  750. package/lib/chart/controller/slider.js.map +0 -1
  751. package/lib/chart/controller/tooltip.d.ts +0 -68
  752. package/lib/chart/controller/tooltip.js +0 -632
  753. package/lib/chart/controller/tooltip.js.map +0 -1
  754. package/lib/chart/event.d.ts +0 -47
  755. package/lib/chart/event.js +0 -93
  756. package/lib/chart/event.js.map +0 -1
  757. package/lib/chart/index.d.ts +0 -4
  758. package/lib/chart/index.js +0 -16
  759. package/lib/chart/index.js.map +0 -1
  760. package/lib/chart/layout/auto.d.ts +0 -8
  761. package/lib/chart/layout/auto.js +0 -68
  762. package/lib/chart/layout/auto.js.map +0 -1
  763. package/lib/chart/layout/constraint/bounds.d.ts +0 -32
  764. package/lib/chart/layout/constraint/bounds.js +0 -33
  765. package/lib/chart/layout/constraint/bounds.js.map +0 -1
  766. package/lib/chart/layout/constraint/constraint.d.ts +0 -31
  767. package/lib/chart/layout/constraint/constraint.js +0 -84
  768. package/lib/chart/layout/constraint/constraint.js.map +0 -1
  769. package/lib/chart/layout/constraint/gauss.d.ts +0 -11
  770. package/lib/chart/layout/constraint/gauss.js +0 -68
  771. package/lib/chart/layout/constraint/gauss.js.map +0 -1
  772. package/lib/chart/layout/constraint/index.d.ts +0 -5
  773. package/lib/chart/layout/constraint/index.js +0 -38
  774. package/lib/chart/layout/constraint/index.js.map +0 -1
  775. package/lib/chart/layout/constraint/solver.d.ts +0 -40
  776. package/lib/chart/layout/constraint/solver.js +0 -80
  777. package/lib/chart/layout/constraint/solver.js.map +0 -1
  778. package/lib/chart/layout/constraint/types.d.ts +0 -21
  779. package/lib/chart/layout/constraint/types.js +0 -16
  780. package/lib/chart/layout/constraint/types.js.map +0 -1
  781. package/lib/chart/layout/constraint/variable.d.ts +0 -24
  782. package/lib/chart/layout/constraint/variable.js +0 -31
  783. package/lib/chart/layout/constraint/variable.js.map +0 -1
  784. package/lib/chart/layout/index.d.ts +0 -15
  785. package/lib/chart/layout/index.js +0 -29
  786. package/lib/chart/layout/index.js.map +0 -1
  787. package/lib/chart/layout/padding-cal.d.ts +0 -53
  788. package/lib/chart/layout/padding-cal.js +0 -111
  789. package/lib/chart/layout/padding-cal.js.map +0 -1
  790. package/lib/chart/util/scale-pool.d.ts +0 -57
  791. package/lib/chart/util/scale-pool.js +0 -215
  792. package/lib/chart/util/scale-pool.js.map +0 -1
  793. package/lib/chart/util/sync-view-padding.d.ts +0 -9
  794. package/lib/chart/util/sync-view-padding.js +0 -18
  795. package/lib/chart/util/sync-view-padding.js.map +0 -1
  796. package/lib/chart/view.d.ts +0 -747
  797. package/lib/chart/view.js +0 -1637
  798. package/lib/chart/view.js.map +0 -1
  799. package/lib/component/labels.d.ts +0 -47
  800. package/lib/component/labels.js +0 -276
  801. package/lib/component/labels.js.map +0 -1
  802. package/lib/component/update-label.d.ts +0 -21
  803. package/lib/component/update-label.js +0 -61
  804. package/lib/component/update-label.js.map +0 -1
  805. package/lib/constant.d.ts +0 -122
  806. package/lib/constant.js +0 -137
  807. package/lib/constant.js.map +0 -1
  808. package/lib/core.d.ts +0 -46
  809. package/lib/core.js +0 -101
  810. package/lib/core.js.map +0 -1
  811. package/lib/dependents.d.ts +0 -21
  812. package/lib/dependents.js +0 -55
  813. package/lib/dependents.js.map +0 -1
  814. package/lib/engine/index.d.ts +0 -13
  815. package/lib/engine/index.js +0 -27
  816. package/lib/engine/index.js.map +0 -1
  817. package/lib/facet/circle.d.ts +0 -36
  818. package/lib/facet/circle.js +0 -121
  819. package/lib/facet/circle.js.map +0 -1
  820. package/lib/facet/facet.d.ts +0 -165
  821. package/lib/facet/facet.js +0 -294
  822. package/lib/facet/facet.js.map +0 -1
  823. package/lib/facet/index.d.ts +0 -13
  824. package/lib/facet/index.js +0 -28
  825. package/lib/facet/index.js.map +0 -1
  826. package/lib/facet/list.d.ts +0 -46
  827. package/lib/facet/list.js +0 -136
  828. package/lib/facet/list.js.map +0 -1
  829. package/lib/facet/matrix.d.ts +0 -34
  830. package/lib/facet/matrix.js +0 -121
  831. package/lib/facet/matrix.js.map +0 -1
  832. package/lib/facet/mirror.d.ts +0 -31
  833. package/lib/facet/mirror.js +0 -146
  834. package/lib/facet/mirror.js.map +0 -1
  835. package/lib/facet/rect.d.ts +0 -35
  836. package/lib/facet/rect.js +0 -143
  837. package/lib/facet/rect.js.map +0 -1
  838. package/lib/facet/tree.d.ts +0 -40
  839. package/lib/facet/tree.js +0 -290
  840. package/lib/facet/tree.js.map +0 -1
  841. package/lib/geometry/area.d.ts +0 -46
  842. package/lib/geometry/area.js +0 -64
  843. package/lib/geometry/area.js.map +0 -1
  844. package/lib/geometry/base.d.ts +0 -793
  845. package/lib/geometry/base.js +0 -1483
  846. package/lib/geometry/base.js.map +0 -1
  847. package/lib/geometry/edge.d.ts +0 -15
  848. package/lib/geometry/edge.js +0 -26
  849. package/lib/geometry/edge.js.map +0 -1
  850. package/lib/geometry/element/index.d.ts +0 -127
  851. package/lib/geometry/element/index.js +0 -438
  852. package/lib/geometry/element/index.js.map +0 -1
  853. package/lib/geometry/heatmap.d.ts +0 -31
  854. package/lib/geometry/heatmap.js +0 -192
  855. package/lib/geometry/heatmap.js.map +0 -1
  856. package/lib/geometry/interval.d.ts +0 -41
  857. package/lib/geometry/interval.js +0 -100
  858. package/lib/geometry/interval.js.map +0 -1
  859. package/lib/geometry/label/base.d.ts +0 -76
  860. package/lib/geometry/label/base.js +0 -406
  861. package/lib/geometry/label/base.js.map +0 -1
  862. package/lib/geometry/label/index.d.ts +0 -38
  863. package/lib/geometry/label/index.js +0 -42
  864. package/lib/geometry/label/index.js.map +0 -1
  865. package/lib/geometry/label/interface.d.ts +0 -50
  866. package/lib/geometry/label/interface.js +0 -3
  867. package/lib/geometry/label/interface.js.map +0 -1
  868. package/lib/geometry/label/interval.d.ts +0 -27
  869. package/lib/geometry/label/interval.js +0 -148
  870. package/lib/geometry/label/interval.js.map +0 -1
  871. package/lib/geometry/label/layout/adjust-color.d.ts +0 -3
  872. package/lib/geometry/label/layout/adjust-color.js +0 -40
  873. package/lib/geometry/label/layout/adjust-color.js.map +0 -1
  874. package/lib/geometry/label/layout/hide-overlap.d.ts +0 -8
  875. package/lib/geometry/label/layout/hide-overlap.js +0 -33
  876. package/lib/geometry/label/layout/hide-overlap.js.map +0 -1
  877. package/lib/geometry/label/layout/interval/adjust-position.d.ts +0 -9
  878. package/lib/geometry/label/layout/interval/adjust-position.js +0 -65
  879. package/lib/geometry/label/layout/interval/adjust-position.js.map +0 -1
  880. package/lib/geometry/label/layout/interval/hide-overlap.d.ts +0 -9
  881. package/lib/geometry/label/layout/interval/hide-overlap.js +0 -82
  882. package/lib/geometry/label/layout/interval/hide-overlap.js.map +0 -1
  883. package/lib/geometry/label/layout/limit-in-canvas.d.ts +0 -9
  884. package/lib/geometry/label/layout/limit-in-canvas.js +0 -48
  885. package/lib/geometry/label/layout/limit-in-canvas.js.map +0 -1
  886. package/lib/geometry/label/layout/limit-in-plot.d.ts +0 -18
  887. package/lib/geometry/label/layout/limit-in-plot.js +0 -79
  888. package/lib/geometry/label/layout/limit-in-plot.js.map +0 -1
  889. package/lib/geometry/label/layout/limit-in-shape.d.ts +0 -7
  890. package/lib/geometry/label/layout/limit-in-shape.js +0 -22
  891. package/lib/geometry/label/layout/limit-in-shape.js.map +0 -1
  892. package/lib/geometry/label/layout/overlap.d.ts +0 -15
  893. package/lib/geometry/label/layout/overlap.js +0 -228
  894. package/lib/geometry/label/layout/overlap.js.map +0 -1
  895. package/lib/geometry/label/layout/path/adjust-position.d.ts +0 -17
  896. package/lib/geometry/label/layout/path/adjust-position.js +0 -98
  897. package/lib/geometry/label/layout/path/adjust-position.js.map +0 -1
  898. package/lib/geometry/label/layout/pie/distribute.d.ts +0 -3
  899. package/lib/geometry/label/layout/pie/distribute.js +0 -189
  900. package/lib/geometry/label/layout/pie/distribute.js.map +0 -1
  901. package/lib/geometry/label/layout/pie/outer.d.ts +0 -6
  902. package/lib/geometry/label/layout/pie/outer.js +0 -211
  903. package/lib/geometry/label/layout/pie/outer.js.map +0 -1
  904. package/lib/geometry/label/layout/pie/spider.d.ts +0 -7
  905. package/lib/geometry/label/layout/pie/spider.js +0 -185
  906. package/lib/geometry/label/layout/pie/spider.js.map +0 -1
  907. package/lib/geometry/label/layout/pie/util.d.ts +0 -10
  908. package/lib/geometry/label/layout/pie/util.js +0 -77
  909. package/lib/geometry/label/layout/pie/util.js.map +0 -1
  910. package/lib/geometry/label/layout/point/adjust-position.d.ts +0 -17
  911. package/lib/geometry/label/layout/point/adjust-position.js +0 -98
  912. package/lib/geometry/label/layout/point/adjust-position.js.map +0 -1
  913. package/lib/geometry/label/pie.d.ts +0 -22
  914. package/lib/geometry/label/pie.js +0 -97
  915. package/lib/geometry/label/pie.js.map +0 -1
  916. package/lib/geometry/label/polar.d.ts +0 -64
  917. package/lib/geometry/label/polar.js +0 -223
  918. package/lib/geometry/label/polar.js.map +0 -1
  919. package/lib/geometry/label/util/index.d.ts +0 -26
  920. package/lib/geometry/label/util/index.js +0 -68
  921. package/lib/geometry/label/util/index.js.map +0 -1
  922. package/lib/geometry/line.d.ts +0 -11
  923. package/lib/geometry/line.js +0 -23
  924. package/lib/geometry/line.js.map +0 -1
  925. package/lib/geometry/path.d.ts +0 -40
  926. package/lib/geometry/path.js +0 -124
  927. package/lib/geometry/path.js.map +0 -1
  928. package/lib/geometry/point.d.ts +0 -19
  929. package/lib/geometry/point.js +0 -32
  930. package/lib/geometry/point.js.map +0 -1
  931. package/lib/geometry/polygon.d.ts +0 -19
  932. package/lib/geometry/polygon.js +0 -64
  933. package/lib/geometry/polygon.js.map +0 -1
  934. package/lib/geometry/schema.d.ts +0 -18
  935. package/lib/geometry/schema.js +0 -50
  936. package/lib/geometry/schema.js.map +0 -1
  937. package/lib/geometry/shape/area/index.d.ts +0 -2
  938. package/lib/geometry/shape/area/index.js +0 -46
  939. package/lib/geometry/shape/area/index.js.map +0 -1
  940. package/lib/geometry/shape/area/line.d.ts +0 -1
  941. package/lib/geometry/shape/area/line.js +0 -33
  942. package/lib/geometry/shape/area/line.js.map +0 -1
  943. package/lib/geometry/shape/area/smooth-line.d.ts +0 -1
  944. package/lib/geometry/shape/area/smooth-line.js +0 -32
  945. package/lib/geometry/shape/area/smooth-line.js.map +0 -1
  946. package/lib/geometry/shape/area/smooth.d.ts +0 -1
  947. package/lib/geometry/shape/area/smooth.js +0 -33
  948. package/lib/geometry/shape/area/smooth.js.map +0 -1
  949. package/lib/geometry/shape/area/util.d.ts +0 -22
  950. package/lib/geometry/shape/area/util.js +0 -93
  951. package/lib/geometry/shape/area/util.js.map +0 -1
  952. package/lib/geometry/shape/base.d.ts +0 -22
  953. package/lib/geometry/shape/base.js +0 -168
  954. package/lib/geometry/shape/base.js.map +0 -1
  955. package/lib/geometry/shape/constant.d.ts +0 -4
  956. package/lib/geometry/shape/constant.js +0 -8
  957. package/lib/geometry/shape/constant.js.map +0 -1
  958. package/lib/geometry/shape/edge/arc.d.ts +0 -1
  959. package/lib/geometry/shape/edge/arc.js +0 -86
  960. package/lib/geometry/shape/edge/arc.js.map +0 -1
  961. package/lib/geometry/shape/edge/index.d.ts +0 -2
  962. package/lib/geometry/shape/edge/index.js +0 -33
  963. package/lib/geometry/shape/edge/index.js.map +0 -1
  964. package/lib/geometry/shape/edge/smooth.d.ts +0 -1
  965. package/lib/geometry/shape/edge/smooth.js +0 -32
  966. package/lib/geometry/shape/edge/smooth.js.map +0 -1
  967. package/lib/geometry/shape/edge/util.d.ts +0 -17
  968. package/lib/geometry/shape/edge/util.js +0 -37
  969. package/lib/geometry/shape/edge/util.js.map +0 -1
  970. package/lib/geometry/shape/edge/vhv.d.ts +0 -1
  971. package/lib/geometry/shape/edge/vhv.js +0 -44
  972. package/lib/geometry/shape/edge/vhv.js.map +0 -1
  973. package/lib/geometry/shape/interval/funnel.d.ts +0 -1
  974. package/lib/geometry/shape/interval/funnel.js +0 -33
  975. package/lib/geometry/shape/interval/funnel.js.map +0 -1
  976. package/lib/geometry/shape/interval/hollow-rect.d.ts +0 -1
  977. package/lib/geometry/shape/interval/hollow-rect.js +0 -53
  978. package/lib/geometry/shape/interval/hollow-rect.js.map +0 -1
  979. package/lib/geometry/shape/interval/index.d.ts +0 -3
  980. package/lib/geometry/shape/interval/index.js +0 -65
  981. package/lib/geometry/shape/interval/index.js.map +0 -1
  982. package/lib/geometry/shape/interval/line.d.ts +0 -1
  983. package/lib/geometry/shape/interval/line.js +0 -56
  984. package/lib/geometry/shape/interval/line.js.map +0 -1
  985. package/lib/geometry/shape/interval/pyramid.d.ts +0 -1
  986. package/lib/geometry/shape/interval/pyramid.js +0 -33
  987. package/lib/geometry/shape/interval/pyramid.js.map +0 -1
  988. package/lib/geometry/shape/interval/tick.d.ts +0 -1
  989. package/lib/geometry/shape/interval/tick.js +0 -79
  990. package/lib/geometry/shape/interval/tick.js.map +0 -1
  991. package/lib/geometry/shape/interval/util.d.ts +0 -55
  992. package/lib/geometry/shape/interval/util.js +0 -321
  993. package/lib/geometry/shape/interval/util.js.map +0 -1
  994. package/lib/geometry/shape/line/index.d.ts +0 -8
  995. package/lib/geometry/shape/line/index.js +0 -109
  996. package/lib/geometry/shape/line/index.js.map +0 -1
  997. package/lib/geometry/shape/line/step.d.ts +0 -1
  998. package/lib/geometry/shape/line/step.js +0 -86
  999. package/lib/geometry/shape/line/step.js.map +0 -1
  1000. package/lib/geometry/shape/line/util.d.ts +0 -16
  1001. package/lib/geometry/shape/line/util.js +0 -87
  1002. package/lib/geometry/shape/line/util.js.map +0 -1
  1003. package/lib/geometry/shape/point/hollow.d.ts +0 -1
  1004. package/lib/geometry/shape/point/hollow.js +0 -26
  1005. package/lib/geometry/shape/point/hollow.js.map +0 -1
  1006. package/lib/geometry/shape/point/image.d.ts +0 -1
  1007. package/lib/geometry/shape/point/image.js +0 -50
  1008. package/lib/geometry/shape/point/image.js.map +0 -1
  1009. package/lib/geometry/shape/point/index.d.ts +0 -2
  1010. package/lib/geometry/shape/point/index.js +0 -34
  1011. package/lib/geometry/shape/point/index.js.map +0 -1
  1012. package/lib/geometry/shape/point/solid.d.ts +0 -1
  1013. package/lib/geometry/shape/point/solid.js +0 -25
  1014. package/lib/geometry/shape/point/solid.js.map +0 -1
  1015. package/lib/geometry/shape/point/util.d.ts +0 -15
  1016. package/lib/geometry/shape/point/util.js +0 -43
  1017. package/lib/geometry/shape/point/util.js.map +0 -1
  1018. package/lib/geometry/shape/polygon/index.d.ts +0 -2
  1019. package/lib/geometry/shape/polygon/index.js +0 -67
  1020. package/lib/geometry/shape/polygon/index.js.map +0 -1
  1021. package/lib/geometry/shape/polygon/square.d.ts +0 -1
  1022. package/lib/geometry/shape/polygon/square.js +0 -46
  1023. package/lib/geometry/shape/polygon/square.js.map +0 -1
  1024. package/lib/geometry/shape/schema/box.d.ts +0 -1
  1025. package/lib/geometry/shape/schema/box.js +0 -144
  1026. package/lib/geometry/shape/schema/box.js.map +0 -1
  1027. package/lib/geometry/shape/schema/candle.d.ts +0 -1
  1028. package/lib/geometry/shape/schema/candle.js +0 -82
  1029. package/lib/geometry/shape/schema/candle.js.map +0 -1
  1030. package/lib/geometry/shape/schema/index.d.ts +0 -2
  1031. package/lib/geometry/shape/schema/index.js +0 -8
  1032. package/lib/geometry/shape/schema/index.js.map +0 -1
  1033. package/lib/geometry/shape/util/get-path-points.d.ts +0 -38
  1034. package/lib/geometry/shape/util/get-path-points.js +0 -137
  1035. package/lib/geometry/shape/util/get-path-points.js.map +0 -1
  1036. package/lib/geometry/shape/util/get-style.d.ts +0 -18
  1037. package/lib/geometry/shape/util/get-style.js +0 -52
  1038. package/lib/geometry/shape/util/get-style.js.map +0 -1
  1039. package/lib/geometry/shape/util/path.d.ts +0 -32
  1040. package/lib/geometry/shape/util/path.js +0 -320
  1041. package/lib/geometry/shape/util/path.js.map +0 -1
  1042. package/lib/geometry/shape/util/split-points.d.ts +0 -13
  1043. package/lib/geometry/shape/util/split-points.js +0 -28
  1044. package/lib/geometry/shape/util/split-points.js.map +0 -1
  1045. package/lib/geometry/shape/violin/hollow.d.ts +0 -1
  1046. package/lib/geometry/shape/violin/hollow.js +0 -53
  1047. package/lib/geometry/shape/violin/hollow.js.map +0 -1
  1048. package/lib/geometry/shape/violin/index.d.ts +0 -2
  1049. package/lib/geometry/shape/violin/index.js +0 -62
  1050. package/lib/geometry/shape/violin/index.js.map +0 -1
  1051. package/lib/geometry/shape/violin/smooth.d.ts +0 -1
  1052. package/lib/geometry/shape/violin/smooth.js +0 -30
  1053. package/lib/geometry/shape/violin/smooth.js.map +0 -1
  1054. package/lib/geometry/util/diff.d.ts +0 -11
  1055. package/lib/geometry/util/diff.js +0 -34
  1056. package/lib/geometry/util/diff.js.map +0 -1
  1057. package/lib/geometry/util/get-shape-type.d.ts +0 -8
  1058. package/lib/geometry/util/get-shape-type.js +0 -20
  1059. package/lib/geometry/util/get-shape-type.js.map +0 -1
  1060. package/lib/geometry/util/group-data.d.ts +0 -3
  1061. package/lib/geometry/util/group-data.js +0 -35
  1062. package/lib/geometry/util/group-data.js.map +0 -1
  1063. package/lib/geometry/util/is-model-change.d.ts +0 -9
  1064. package/lib/geometry/util/is-model-change.js +0 -18
  1065. package/lib/geometry/util/is-model-change.js.map +0 -1
  1066. package/lib/geometry/util/parse-fields.d.ts +0 -2
  1067. package/lib/geometry/util/parse-fields.js +0 -13
  1068. package/lib/geometry/util/parse-fields.js.map +0 -1
  1069. package/lib/geometry/util/shape-size.d.ts +0 -2
  1070. package/lib/geometry/util/shape-size.js +0 -128
  1071. package/lib/geometry/util/shape-size.js.map +0 -1
  1072. package/lib/geometry/violin.d.ts +0 -25
  1073. package/lib/geometry/violin.js +0 -69
  1074. package/lib/geometry/violin.js.map +0 -1
  1075. package/lib/index.d.ts +0 -107
  1076. package/lib/index.js +0 -578
  1077. package/lib/index.js.map +0 -1
  1078. package/lib/interaction/action/active-region.d.ts +0 -33
  1079. package/lib/interaction/action/active-region.js +0 -202
  1080. package/lib/interaction/action/active-region.js.map +0 -1
  1081. package/lib/interaction/action/base.d.ts +0 -29
  1082. package/lib/interaction/action/base.js +0 -38
  1083. package/lib/interaction/action/base.js.map +0 -1
  1084. package/lib/interaction/action/callback.d.ts +0 -17
  1085. package/lib/interaction/action/callback.js +0 -29
  1086. package/lib/interaction/action/callback.js.map +0 -1
  1087. package/lib/interaction/action/component/list-active.d.ts +0 -14
  1088. package/lib/interaction/action/component/list-active.js +0 -26
  1089. package/lib/interaction/action/component/list-active.js.map +0 -1
  1090. package/lib/interaction/action/component/list-checked.d.ts +0 -30
  1091. package/lib/interaction/action/component/list-checked.js +0 -84
  1092. package/lib/interaction/action/component/list-checked.js.map +0 -1
  1093. package/lib/interaction/action/component/list-focus.d.ts +0 -5
  1094. package/lib/interaction/action/component/list-focus.js +0 -57
  1095. package/lib/interaction/action/component/list-focus.js.map +0 -1
  1096. package/lib/interaction/action/component/list-highlight-util.d.ts +0 -7
  1097. package/lib/interaction/action/component/list-highlight-util.js +0 -24
  1098. package/lib/interaction/action/component/list-highlight-util.js.map +0 -1
  1099. package/lib/interaction/action/component/list-highlight.d.ts +0 -20
  1100. package/lib/interaction/action/component/list-highlight.js +0 -99
  1101. package/lib/interaction/action/component/list-highlight.js.map +0 -1
  1102. package/lib/interaction/action/component/list-radio.d.ts +0 -6
  1103. package/lib/interaction/action/component/list-radio.js +0 -28
  1104. package/lib/interaction/action/component/list-radio.js.map +0 -1
  1105. package/lib/interaction/action/component/list-selected.d.ts +0 -10
  1106. package/lib/interaction/action/component/list-selected.js +0 -22
  1107. package/lib/interaction/action/component/list-selected.js.map +0 -1
  1108. package/lib/interaction/action/component/list-state.d.ts +0 -46
  1109. package/lib/interaction/action/component/list-state.js +0 -169
  1110. package/lib/interaction/action/component/list-state.js.map +0 -1
  1111. package/lib/interaction/action/component/list-unchecked.d.ts +0 -13
  1112. package/lib/interaction/action/component/list-unchecked.js +0 -25
  1113. package/lib/interaction/action/component/list-unchecked.js.map +0 -1
  1114. package/lib/interaction/action/component/tooltip/ellipsis-text.d.ts +0 -25
  1115. package/lib/interaction/action/component/tooltip/ellipsis-text.js +0 -95
  1116. package/lib/interaction/action/component/tooltip/ellipsis-text.js.map +0 -1
  1117. package/lib/interaction/action/component/tooltip/geometry.d.ts +0 -24
  1118. package/lib/interaction/action/component/tooltip/geometry.js +0 -73
  1119. package/lib/interaction/action/component/tooltip/geometry.js.map +0 -1
  1120. package/lib/interaction/action/component/tooltip/sibling.d.ts +0 -21
  1121. package/lib/interaction/action/component/tooltip/sibling.js +0 -41
  1122. package/lib/interaction/action/component/tooltip/sibling.js.map +0 -1
  1123. package/lib/interaction/action/cursor.d.ts +0 -69
  1124. package/lib/interaction/action/cursor.js +0 -115
  1125. package/lib/interaction/action/cursor.js.map +0 -1
  1126. package/lib/interaction/action/data/filter.d.ts +0 -13
  1127. package/lib/interaction/action/data/filter.js +0 -68
  1128. package/lib/interaction/action/data/filter.js.map +0 -1
  1129. package/lib/interaction/action/data/range-filter.d.ts +0 -56
  1130. package/lib/interaction/action/data/range-filter.js +0 -166
  1131. package/lib/interaction/action/data/range-filter.js.map +0 -1
  1132. package/lib/interaction/action/data/sibling-filter.d.ts +0 -22
  1133. package/lib/interaction/action/data/sibling-filter.js +0 -41
  1134. package/lib/interaction/action/data/sibling-filter.js.map +0 -1
  1135. package/lib/interaction/action/element/active.d.ts +0 -14
  1136. package/lib/interaction/action/element/active.js +0 -26
  1137. package/lib/interaction/action/element/active.js.map +0 -1
  1138. package/lib/interaction/action/element/filter.d.ts +0 -20
  1139. package/lib/interaction/action/element/filter.js +0 -91
  1140. package/lib/interaction/action/element/filter.js.map +0 -1
  1141. package/lib/interaction/action/element/highlight-by-color.d.ts +0 -10
  1142. package/lib/interaction/action/element/highlight-by-color.js +0 -32
  1143. package/lib/interaction/action/element/highlight-by-color.js.map +0 -1
  1144. package/lib/interaction/action/element/highlight-by-x.d.ts +0 -15
  1145. package/lib/interaction/action/element/highlight-by-x.js +0 -53
  1146. package/lib/interaction/action/element/highlight-by-x.js.map +0 -1
  1147. package/lib/interaction/action/element/highlight-util.d.ts +0 -18
  1148. package/lib/interaction/action/element/highlight-util.js +0 -50
  1149. package/lib/interaction/action/element/highlight-util.js.map +0 -1
  1150. package/lib/interaction/action/element/highlight.d.ts +0 -21
  1151. package/lib/interaction/action/element/highlight.js +0 -96
  1152. package/lib/interaction/action/element/highlight.js.map +0 -1
  1153. package/lib/interaction/action/element/link-by-color.d.ts +0 -51
  1154. package/lib/interaction/action/element/link-by-color.js +0 -158
  1155. package/lib/interaction/action/element/link-by-color.js.map +0 -1
  1156. package/lib/interaction/action/element/range-active.d.ts +0 -13
  1157. package/lib/interaction/action/element/range-active.js +0 -25
  1158. package/lib/interaction/action/element/range-active.js.map +0 -1
  1159. package/lib/interaction/action/element/range-highlight.d.ts +0 -27
  1160. package/lib/interaction/action/element/range-highlight.js +0 -57
  1161. package/lib/interaction/action/element/range-highlight.js.map +0 -1
  1162. package/lib/interaction/action/element/range-selected.d.ts +0 -13
  1163. package/lib/interaction/action/element/range-selected.js +0 -25
  1164. package/lib/interaction/action/element/range-selected.js.map +0 -1
  1165. package/lib/interaction/action/element/range-state.d.ts +0 -38
  1166. package/lib/interaction/action/element/range-state.js +0 -166
  1167. package/lib/interaction/action/element/range-state.js.map +0 -1
  1168. package/lib/interaction/action/element/selected.d.ts +0 -14
  1169. package/lib/interaction/action/element/selected.js +0 -26
  1170. package/lib/interaction/action/element/selected.js.map +0 -1
  1171. package/lib/interaction/action/element/sibling-filter.d.ts +0 -19
  1172. package/lib/interaction/action/element/sibling-filter.js +0 -95
  1173. package/lib/interaction/action/element/sibling-filter.js.map +0 -1
  1174. package/lib/interaction/action/element/single-active.d.ts +0 -13
  1175. package/lib/interaction/action/element/single-active.js +0 -25
  1176. package/lib/interaction/action/element/single-active.js.map +0 -1
  1177. package/lib/interaction/action/element/single-highlight.d.ts +0 -16
  1178. package/lib/interaction/action/element/single-highlight.js +0 -37
  1179. package/lib/interaction/action/element/single-highlight.js.map +0 -1
  1180. package/lib/interaction/action/element/single-selected.d.ts +0 -13
  1181. package/lib/interaction/action/element/single-selected.js +0 -25
  1182. package/lib/interaction/action/element/single-selected.js.map +0 -1
  1183. package/lib/interaction/action/element/single-state.d.ts +0 -18
  1184. package/lib/interaction/action/element/single-state.js +0 -55
  1185. package/lib/interaction/action/element/single-state.js.map +0 -1
  1186. package/lib/interaction/action/element/state-base.d.ts +0 -39
  1187. package/lib/interaction/action/element/state-base.js +0 -61
  1188. package/lib/interaction/action/element/state-base.js.map +0 -1
  1189. package/lib/interaction/action/element/state.d.ts +0 -28
  1190. package/lib/interaction/action/element/state.js +0 -101
  1191. package/lib/interaction/action/element/state.js.map +0 -1
  1192. package/lib/interaction/action/index.d.ts +0 -2
  1193. package/lib/interaction/action/index.js +0 -13
  1194. package/lib/interaction/action/index.js.map +0 -1
  1195. package/lib/interaction/action/mask/base.d.ts +0 -62
  1196. package/lib/interaction/action/mask/base.js +0 -171
  1197. package/lib/interaction/action/mask/base.js.map +0 -1
  1198. package/lib/interaction/action/mask/circle.d.ts +0 -14
  1199. package/lib/interaction/action/mask/circle.js +0 -39
  1200. package/lib/interaction/action/mask/circle.js.map +0 -1
  1201. package/lib/interaction/action/mask/dim-rect.d.ts +0 -11
  1202. package/lib/interaction/action/mask/dim-rect.js +0 -64
  1203. package/lib/interaction/action/mask/dim-rect.js.map +0 -1
  1204. package/lib/interaction/action/mask/path.d.ts +0 -16
  1205. package/lib/interaction/action/mask/path.js +0 -46
  1206. package/lib/interaction/action/mask/path.js.map +0 -1
  1207. package/lib/interaction/action/mask/rect.d.ts +0 -17
  1208. package/lib/interaction/action/mask/rect.js +0 -41
  1209. package/lib/interaction/action/mask/rect.js.map +0 -1
  1210. package/lib/interaction/action/mask/smooth-path.d.ts +0 -9
  1211. package/lib/interaction/action/mask/smooth-path.js +0 -23
  1212. package/lib/interaction/action/mask/smooth-path.js.map +0 -1
  1213. package/lib/interaction/action/register.d.ts +0 -36
  1214. package/lib/interaction/action/register.js +0 -69
  1215. package/lib/interaction/action/register.js.map +0 -1
  1216. package/lib/interaction/action/util.d.ts +0 -140
  1217. package/lib/interaction/action/util.js +0 -387
  1218. package/lib/interaction/action/util.js.map +0 -1
  1219. package/lib/interaction/action/view/button.d.ts +0 -25
  1220. package/lib/interaction/action/view/button.js +0 -118
  1221. package/lib/interaction/action/view/button.js.map +0 -1
  1222. package/lib/interaction/action/view/drag.d.ts +0 -24
  1223. package/lib/interaction/action/view/drag.js +0 -75
  1224. package/lib/interaction/action/view/drag.js.map +0 -1
  1225. package/lib/interaction/action/view/mousewheel-scroll.d.ts +0 -5
  1226. package/lib/interaction/action/view/mousewheel-scroll.js +0 -37
  1227. package/lib/interaction/action/view/mousewheel-scroll.js.map +0 -1
  1228. package/lib/interaction/action/view/move.d.ts +0 -28
  1229. package/lib/interaction/action/view/move.js +0 -82
  1230. package/lib/interaction/action/view/move.js.map +0 -1
  1231. package/lib/interaction/action/view/scale-transform.d.ts +0 -18
  1232. package/lib/interaction/action/view/scale-transform.js +0 -53
  1233. package/lib/interaction/action/view/scale-transform.js.map +0 -1
  1234. package/lib/interaction/action/view/scale-translate.d.ts +0 -30
  1235. package/lib/interaction/action/view/scale-translate.js +0 -114
  1236. package/lib/interaction/action/view/scale-translate.js.map +0 -1
  1237. package/lib/interaction/action/view/scale-zoom.d.ts +0 -20
  1238. package/lib/interaction/action/view/scale-zoom.js +0 -85
  1239. package/lib/interaction/action/view/scale-zoom.js.map +0 -1
  1240. package/lib/interaction/context.d.ts +0 -65
  1241. package/lib/interaction/context.js +0 -144
  1242. package/lib/interaction/context.js.map +0 -1
  1243. package/lib/interaction/grammar-interaction.d.ts +0 -158
  1244. package/lib/interaction/grammar-interaction.js +0 -289
  1245. package/lib/interaction/grammar-interaction.js.map +0 -1
  1246. package/lib/interaction/index.d.ts +0 -25
  1247. package/lib/interaction/index.js +0 -54
  1248. package/lib/interaction/index.js.map +0 -1
  1249. package/lib/interaction/interaction.d.ts +0 -29
  1250. package/lib/interaction/interaction.js +0 -34
  1251. package/lib/interaction/interaction.js.map +0 -1
  1252. package/lib/interface.d.ts +0 -2264
  1253. package/lib/interface.js +0 -3
  1254. package/lib/interface.js.map +0 -1
  1255. package/lib/theme/index.d.ts +0 -12
  1256. package/lib/theme/index.js +0 -28
  1257. package/lib/theme/index.js.map +0 -1
  1258. package/lib/theme/style-sheet/dark.d.ts +0 -825
  1259. package/lib/theme/style-sheet/dark.js +0 -500
  1260. package/lib/theme/style-sheet/dark.js.map +0 -1
  1261. package/lib/theme/style-sheet/light.d.ts +0 -817
  1262. package/lib/theme/style-sheet/light.js +0 -496
  1263. package/lib/theme/style-sheet/light.js.map +0 -1
  1264. package/lib/theme/util/create-by-style-sheet.d.ts +0 -6
  1265. package/lib/theme/util/create-by-style-sheet.js +0 -1426
  1266. package/lib/theme/util/create-by-style-sheet.js.map +0 -1
  1267. package/lib/theme/util/create-theme.d.ts +0 -6
  1268. package/lib/theme/util/create-theme.js +0 -16
  1269. package/lib/theme/util/create-theme.js.map +0 -1
  1270. package/lib/theme/util/index.d.ts +0 -1
  1271. package/lib/theme/util/index.js +0 -6
  1272. package/lib/theme/util/index.js.map +0 -1
  1273. package/lib/util/annotation.d.ts +0 -7
  1274. package/lib/util/annotation.js +0 -43
  1275. package/lib/util/annotation.js.map +0 -1
  1276. package/lib/util/attr.d.ts +0 -10
  1277. package/lib/util/attr.js +0 -29
  1278. package/lib/util/attr.js.map +0 -1
  1279. package/lib/util/axis.d.ts +0 -100
  1280. package/lib/util/axis.js +0 -251
  1281. package/lib/util/axis.js.map +0 -1
  1282. package/lib/util/bbox.d.ts +0 -105
  1283. package/lib/util/bbox.js +0 -287
  1284. package/lib/util/bbox.js.map +0 -1
  1285. package/lib/util/collision-detect.d.ts +0 -16
  1286. package/lib/util/collision-detect.js +0 -132
  1287. package/lib/util/collision-detect.js.map +0 -1
  1288. package/lib/util/color.d.ts +0 -1
  1289. package/lib/util/color.js +0 -23
  1290. package/lib/util/color.js.map +0 -1
  1291. package/lib/util/context.d.ts +0 -4
  1292. package/lib/util/context.js +0 -15
  1293. package/lib/util/context.js.map +0 -1
  1294. package/lib/util/coordinate.d.ts +0 -86
  1295. package/lib/util/coordinate.js +0 -157
  1296. package/lib/util/coordinate.js.map +0 -1
  1297. package/lib/util/direction.d.ts +0 -19
  1298. package/lib/util/direction.js +0 -125
  1299. package/lib/util/direction.js.map +0 -1
  1300. package/lib/util/dom.d.ts +0 -19
  1301. package/lib/util/dom.js +0 -68
  1302. package/lib/util/dom.js.map +0 -1
  1303. package/lib/util/event.d.ts +0 -8
  1304. package/lib/util/event.js +0 -18
  1305. package/lib/util/event.js.map +0 -1
  1306. package/lib/util/facet.d.ts +0 -16
  1307. package/lib/util/facet.js +0 -48
  1308. package/lib/util/facet.js.map +0 -1
  1309. package/lib/util/graphics.d.ts +0 -58
  1310. package/lib/util/graphics.js +0 -212
  1311. package/lib/util/graphics.js.map +0 -1
  1312. package/lib/util/grid.d.ts +0 -36
  1313. package/lib/util/grid.js +0 -125
  1314. package/lib/util/grid.js.map +0 -1
  1315. package/lib/util/helper.d.ts +0 -34
  1316. package/lib/util/helper.js +0 -79
  1317. package/lib/util/helper.js.map +0 -1
  1318. package/lib/util/legend.d.ts +0 -45
  1319. package/lib/util/legend.js +0 -152
  1320. package/lib/util/legend.js.map +0 -1
  1321. package/lib/util/marker.d.ts +0 -10
  1322. package/lib/util/marker.js +0 -61
  1323. package/lib/util/marker.js.map +0 -1
  1324. package/lib/util/padding.d.ts +0 -14
  1325. package/lib/util/padding.js +0 -45
  1326. package/lib/util/padding.js.map +0 -1
  1327. package/lib/util/scale.d.ts +0 -38
  1328. package/lib/util/scale.js +0 -122
  1329. package/lib/util/scale.js.map +0 -1
  1330. package/lib/util/stat.d.ts +0 -10
  1331. package/lib/util/stat.js +0 -41
  1332. package/lib/util/stat.js.map +0 -1
  1333. package/lib/util/text.d.ts +0 -23
  1334. package/lib/util/text.js +0 -88
  1335. package/lib/util/text.js.map +0 -1
  1336. package/lib/util/tooltip.d.ts +0 -26
  1337. package/lib/util/tooltip.js +0 -422
  1338. package/lib/util/tooltip.js.map +0 -1
  1339. package/lib/util/transform.d.ts +0 -33
  1340. package/lib/util/transform.js +0 -69
  1341. package/lib/util/transform.js.map +0 -1
  1342. package/lib/util/types.d.ts +0 -6
  1343. package/lib/util/types.js +0 -3
  1344. package/lib/util/types.js.map +0 -1
package/lib/chart/view.js DELETED
@@ -1,1637 +0,0 @@
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