@visactor/vgrammar-core 0.7.0

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 (873) hide show
  1. package/README.md +160 -0
  2. package/README.zh-CN.md +11 -0
  3. package/cjs/component/axis.d.ts +26 -0
  4. package/cjs/component/axis.js +164 -0
  5. package/cjs/component/axis.js.map +1 -0
  6. package/cjs/component/crosshair.d.ts +50 -0
  7. package/cjs/component/crosshair.js +281 -0
  8. package/cjs/component/crosshair.js.map +1 -0
  9. package/cjs/component/datazoom.d.ts +19 -0
  10. package/cjs/component/datazoom.js +166 -0
  11. package/cjs/component/datazoom.js.map +1 -0
  12. package/cjs/component/grid.d.ts +27 -0
  13. package/cjs/component/grid.js +190 -0
  14. package/cjs/component/grid.js.map +1 -0
  15. package/cjs/component/index.d.ts +11 -0
  16. package/cjs/component/index.js +105 -0
  17. package/cjs/component/index.js.map +1 -0
  18. package/cjs/component/label.d.ts +19 -0
  19. package/cjs/component/label.js +121 -0
  20. package/cjs/component/label.js.map +1 -0
  21. package/cjs/component/legend.d.ts +26 -0
  22. package/cjs/component/legend.js +170 -0
  23. package/cjs/component/legend.js.map +1 -0
  24. package/cjs/component/player.d.ts +25 -0
  25. package/cjs/component/player.js +138 -0
  26. package/cjs/component/player.js.map +1 -0
  27. package/cjs/component/scale.d.ts +8 -0
  28. package/cjs/component/scale.js +25 -0
  29. package/cjs/component/scale.js.map +1 -0
  30. package/cjs/component/scrollbar.d.ts +23 -0
  31. package/cjs/component/scrollbar.js +187 -0
  32. package/cjs/component/scrollbar.js.map +1 -0
  33. package/cjs/component/slider.d.ts +19 -0
  34. package/cjs/component/slider.js +86 -0
  35. package/cjs/component/slider.js.map +1 -0
  36. package/cjs/component/title.d.ts +15 -0
  37. package/cjs/component/title.js +56 -0
  38. package/cjs/component/title.js.map +1 -0
  39. package/cjs/component/tooltip.d.ts +62 -0
  40. package/cjs/component/tooltip.js +305 -0
  41. package/cjs/component/tooltip.js.map +1 -0
  42. package/cjs/core/factory.d.ts +35 -0
  43. package/cjs/core/factory.js +73 -0
  44. package/cjs/core/factory.js.map +1 -0
  45. package/cjs/glyph/boxplot.d.ts +10 -0
  46. package/cjs/glyph/boxplot.js +418 -0
  47. package/cjs/glyph/boxplot.js.map +1 -0
  48. package/cjs/glyph/index.d.ts +7 -0
  49. package/cjs/glyph/index.js +64 -0
  50. package/cjs/glyph/index.js.map +1 -0
  51. package/cjs/glyph/link-path.d.ts +7 -0
  52. package/cjs/glyph/link-path.js +138 -0
  53. package/cjs/glyph/link-path.js.map +1 -0
  54. package/cjs/glyph/ripple.d.ts +1 -0
  55. package/cjs/glyph/ripple.js +44 -0
  56. package/cjs/glyph/ripple.js.map +1 -0
  57. package/cjs/glyph/tree-path.d.ts +7 -0
  58. package/cjs/glyph/tree-path.js +152 -0
  59. package/cjs/glyph/tree-path.js.map +1 -0
  60. package/cjs/glyph/violin.d.ts +1 -0
  61. package/cjs/glyph/violin.js +165 -0
  62. package/cjs/glyph/violin.js.map +1 -0
  63. package/cjs/glyph/wave.d.ts +1 -0
  64. package/cjs/glyph/wave.js +67 -0
  65. package/cjs/glyph/wave.js.map +1 -0
  66. package/cjs/graph/animation/animate.d.ts +48 -0
  67. package/cjs/graph/animation/animate.js +250 -0
  68. package/cjs/graph/animation/animate.js.map +1 -0
  69. package/cjs/graph/animation/animation/clip.d.ts +4 -0
  70. package/cjs/graph/animation/animation/clip.js +54 -0
  71. package/cjs/graph/animation/animation/clip.js.map +1 -0
  72. package/cjs/graph/animation/animation/fade.d.ts +4 -0
  73. package/cjs/graph/animation/animation/fade.js +42 -0
  74. package/cjs/graph/animation/animation/fade.js.map +1 -0
  75. package/cjs/graph/animation/animation/grow-cartesian.d.ts +7 -0
  76. package/cjs/graph/animation/animation/grow-cartesian.js +288 -0
  77. package/cjs/graph/animation/animation/grow-cartesian.js.map +1 -0
  78. package/cjs/graph/animation/animation/grow-interval.d.ts +3 -0
  79. package/cjs/graph/animation/animation/grow-interval.js +194 -0
  80. package/cjs/graph/animation/animation/grow-interval.js.map +1 -0
  81. package/cjs/graph/animation/animation/grow-points.d.ts +7 -0
  82. package/cjs/graph/animation/animation/grow-points.js +118 -0
  83. package/cjs/graph/animation/animation/grow-points.js.map +1 -0
  84. package/cjs/graph/animation/animation/grow-polar.d.ts +5 -0
  85. package/cjs/graph/animation/animation/grow-polar.js +164 -0
  86. package/cjs/graph/animation/animation/grow-polar.js.map +1 -0
  87. package/cjs/graph/animation/animation/index.d.ts +11 -0
  88. package/cjs/graph/animation/animation/index.js +191 -0
  89. package/cjs/graph/animation/animation/index.js.map +1 -0
  90. package/cjs/graph/animation/animation/move.d.ts +3 -0
  91. package/cjs/graph/animation/animation/move.js +90 -0
  92. package/cjs/graph/animation/animation/move.js.map +1 -0
  93. package/cjs/graph/animation/animation/rotate.d.ts +3 -0
  94. package/cjs/graph/animation/animation/rotate.js +42 -0
  95. package/cjs/graph/animation/animation/rotate.js.map +1 -0
  96. package/cjs/graph/animation/animation/scale.d.ts +3 -0
  97. package/cjs/graph/animation/animation/scale.js +84 -0
  98. package/cjs/graph/animation/animation/scale.js.map +1 -0
  99. package/cjs/graph/animation/animation/update.d.ts +6 -0
  100. package/cjs/graph/animation/animation/update.js +22 -0
  101. package/cjs/graph/animation/animation/update.js.map +1 -0
  102. package/cjs/graph/animation/animator.d.ts +26 -0
  103. package/cjs/graph/animation/animator.js +88 -0
  104. package/cjs/graph/animation/animator.js.map +1 -0
  105. package/cjs/graph/animation/arranger.d.ts +13 -0
  106. package/cjs/graph/animation/arranger.js +38 -0
  107. package/cjs/graph/animation/arranger.js.map +1 -0
  108. package/cjs/graph/animation/attribute.d.ts +27 -0
  109. package/cjs/graph/animation/attribute.js +124 -0
  110. package/cjs/graph/animation/attribute.js.map +1 -0
  111. package/cjs/graph/animation/config.d.ts +5 -0
  112. package/cjs/graph/animation/config.js +92 -0
  113. package/cjs/graph/animation/config.js.map +1 -0
  114. package/cjs/graph/animation/morph.d.ts +12 -0
  115. package/cjs/graph/animation/morph.js +174 -0
  116. package/cjs/graph/animation/morph.js.map +1 -0
  117. package/cjs/graph/attributes/common.d.ts +2 -0
  118. package/cjs/graph/attributes/common.js +22 -0
  119. package/cjs/graph/attributes/common.js.map +1 -0
  120. package/cjs/graph/attributes/helpers.d.ts +17 -0
  121. package/cjs/graph/attributes/helpers.js +86 -0
  122. package/cjs/graph/attributes/helpers.js.map +1 -0
  123. package/cjs/graph/attributes/index.d.ts +10 -0
  124. package/cjs/graph/attributes/index.js +257 -0
  125. package/cjs/graph/attributes/index.js.map +1 -0
  126. package/cjs/graph/canvas-renderer.d.ts +34 -0
  127. package/cjs/graph/canvas-renderer.js +121 -0
  128. package/cjs/graph/canvas-renderer.js.map +1 -0
  129. package/cjs/graph/constants.d.ts +23 -0
  130. package/cjs/graph/constants.js +21 -0
  131. package/cjs/graph/constants.js.map +1 -0
  132. package/cjs/graph/element.d.ts +66 -0
  133. package/cjs/graph/element.js +297 -0
  134. package/cjs/graph/element.js.map +1 -0
  135. package/cjs/graph/enums.d.ts +153 -0
  136. package/cjs/graph/enums.js +85 -0
  137. package/cjs/graph/enums.js.map +1 -0
  138. package/cjs/graph/glyph-element.d.ts +53 -0
  139. package/cjs/graph/glyph-element.js +202 -0
  140. package/cjs/graph/glyph-element.js.map +1 -0
  141. package/cjs/graph/index.d.ts +3 -0
  142. package/cjs/graph/index.js +44 -0
  143. package/cjs/graph/index.js.map +1 -0
  144. package/cjs/graph/layout/grid.d.ts +3 -0
  145. package/cjs/graph/layout/grid.js +75 -0
  146. package/cjs/graph/layout/grid.js.map +1 -0
  147. package/cjs/graph/layout/layout.d.ts +3 -0
  148. package/cjs/graph/layout/layout.js +33 -0
  149. package/cjs/graph/layout/layout.js.map +1 -0
  150. package/cjs/graph/layout/relative.d.ts +3 -0
  151. package/cjs/graph/layout/relative.js +86 -0
  152. package/cjs/graph/layout/relative.js.map +1 -0
  153. package/cjs/graph/mark/differ.d.ts +20 -0
  154. package/cjs/graph/mark/differ.js +110 -0
  155. package/cjs/graph/mark/differ.js.map +1 -0
  156. package/cjs/graph/mark/encode.d.ts +10 -0
  157. package/cjs/graph/mark/encode.js +95 -0
  158. package/cjs/graph/mark/encode.js.map +1 -0
  159. package/cjs/graph/mark/large-rects.d.ts +10 -0
  160. package/cjs/graph/mark/large-rects.js +31 -0
  161. package/cjs/graph/mark/large-rects.js.map +1 -0
  162. package/cjs/graph/mark/large-symbols.d.ts +11 -0
  163. package/cjs/graph/mark/large-symbols.js +33 -0
  164. package/cjs/graph/mark/large-symbols.js.map +1 -0
  165. package/cjs/graph/mark-tree.d.ts +2 -0
  166. package/cjs/graph/mark-tree.js +21 -0
  167. package/cjs/graph/mark-tree.js.map +1 -0
  168. package/cjs/graph/util/element.d.ts +2 -0
  169. package/cjs/graph/util/element.js +10 -0
  170. package/cjs/graph/util/element.js.map +1 -0
  171. package/cjs/graph/util/env.d.ts +2 -0
  172. package/cjs/graph/util/env.js +14 -0
  173. package/cjs/graph/util/env.js.map +1 -0
  174. package/cjs/graph/util/events-extend.d.ts +5 -0
  175. package/cjs/graph/util/events-extend.js +18 -0
  176. package/cjs/graph/util/events-extend.js.map +1 -0
  177. package/cjs/graph/util/graphic.d.ts +9 -0
  178. package/cjs/graph/util/graphic.js +59 -0
  179. package/cjs/graph/util/graphic.js.map +1 -0
  180. package/cjs/graph/util/point.d.ts +1 -0
  181. package/cjs/graph/util/point.js +75 -0
  182. package/cjs/graph/util/point.js.map +1 -0
  183. package/cjs/index.d.ts +14 -0
  184. package/cjs/index.js +111 -0
  185. package/cjs/index.js.map +1 -0
  186. package/cjs/parse/coordinate.d.ts +7 -0
  187. package/cjs/parse/coordinate.js +70 -0
  188. package/cjs/parse/coordinate.js.map +1 -0
  189. package/cjs/parse/event.d.ts +8 -0
  190. package/cjs/parse/event.js +33 -0
  191. package/cjs/parse/event.js.map +1 -0
  192. package/cjs/parse/mark.d.ts +4 -0
  193. package/cjs/parse/mark.js +25 -0
  194. package/cjs/parse/mark.js.map +1 -0
  195. package/cjs/parse/option.d.ts +3 -0
  196. package/cjs/parse/option.js +19 -0
  197. package/cjs/parse/option.js.map +1 -0
  198. package/cjs/parse/scale.d.ts +8 -0
  199. package/cjs/parse/scale.js +365 -0
  200. package/cjs/parse/scale.js.map +1 -0
  201. package/cjs/parse/transform.d.ts +5 -0
  202. package/cjs/parse/transform.js +103 -0
  203. package/cjs/parse/transform.js.map +1 -0
  204. package/cjs/parse/util.d.ts +13 -0
  205. package/cjs/parse/util.js +82 -0
  206. package/cjs/parse/util.js.map +1 -0
  207. package/cjs/parse/view.d.ts +17 -0
  208. package/cjs/parse/view.js +108 -0
  209. package/cjs/parse/view.js.map +1 -0
  210. package/cjs/semantic-marks/cell.d.ts +13 -0
  211. package/cjs/semantic-marks/cell.js +61 -0
  212. package/cjs/semantic-marks/cell.js.map +1 -0
  213. package/cjs/semantic-marks/interval.d.ts +14 -0
  214. package/cjs/semantic-marks/interval.js +80 -0
  215. package/cjs/semantic-marks/interval.js.map +1 -0
  216. package/cjs/semantic-marks/text.d.ts +10 -0
  217. package/cjs/semantic-marks/text.js +25 -0
  218. package/cjs/semantic-marks/text.js.map +1 -0
  219. package/cjs/theme/common/component.d.ts +15 -0
  220. package/cjs/theme/common/component.js +493 -0
  221. package/cjs/theme/common/component.js.map +1 -0
  222. package/cjs/theme/common/constants.d.ts +1 -0
  223. package/cjs/theme/common/constants.js +6 -0
  224. package/cjs/theme/common/constants.js.map +1 -0
  225. package/cjs/theme/common/mark.d.ts +2 -0
  226. package/cjs/theme/common/mark.js +15 -0
  227. package/cjs/theme/common/mark.js.map +1 -0
  228. package/cjs/theme/dark.d.ts +2 -0
  229. package/cjs/theme/dark.js +94 -0
  230. package/cjs/theme/dark.js.map +1 -0
  231. package/cjs/theme/default.d.ts +2 -0
  232. package/cjs/theme/default.js +18 -0
  233. package/cjs/theme/default.js.map +1 -0
  234. package/cjs/theme/theme-manager.d.ts +8 -0
  235. package/cjs/theme/theme-manager.js +26 -0
  236. package/cjs/theme/theme-manager.js.map +1 -0
  237. package/cjs/transforms/data/bin.d.ts +2 -0
  238. package/cjs/transforms/data/bin.js +21 -0
  239. package/cjs/transforms/data/bin.js.map +1 -0
  240. package/cjs/transforms/data/circular-relation.d.ts +2 -0
  241. package/cjs/transforms/data/circular-relation.js +56 -0
  242. package/cjs/transforms/data/circular-relation.js.map +1 -0
  243. package/cjs/transforms/data/contour.d.ts +2 -0
  244. package/cjs/transforms/data/contour.js +115 -0
  245. package/cjs/transforms/data/contour.js.map +1 -0
  246. package/cjs/transforms/data/filter.d.ts +2 -0
  247. package/cjs/transforms/data/filter.js +10 -0
  248. package/cjs/transforms/data/filter.js.map +1 -0
  249. package/cjs/transforms/data/fold.d.ts +2 -0
  250. package/cjs/transforms/data/fold.js +24 -0
  251. package/cjs/transforms/data/fold.js.map +1 -0
  252. package/cjs/transforms/data/funnel.d.ts +2 -0
  253. package/cjs/transforms/data/funnel.js +25 -0
  254. package/cjs/transforms/data/funnel.js.map +1 -0
  255. package/cjs/transforms/data/join.d.ts +2 -0
  256. package/cjs/transforms/data/join.js +33 -0
  257. package/cjs/transforms/data/join.js.map +1 -0
  258. package/cjs/transforms/data/kde.d.ts +2 -0
  259. package/cjs/transforms/data/kde.js +90 -0
  260. package/cjs/transforms/data/kde.js.map +1 -0
  261. package/cjs/transforms/data/map.d.ts +2 -0
  262. package/cjs/transforms/data/map.js +23 -0
  263. package/cjs/transforms/data/map.js.map +1 -0
  264. package/cjs/transforms/data/pick.d.ts +2 -0
  265. package/cjs/transforms/data/pick.js +20 -0
  266. package/cjs/transforms/data/pick.js.map +1 -0
  267. package/cjs/transforms/data/pie.d.ts +2 -0
  268. package/cjs/transforms/data/pie.js +24 -0
  269. package/cjs/transforms/data/pie.js.map +1 -0
  270. package/cjs/transforms/data/range.d.ts +4 -0
  271. package/cjs/transforms/data/range.js +15 -0
  272. package/cjs/transforms/data/range.js.map +1 -0
  273. package/cjs/transforms/data/sort.d.ts +2 -0
  274. package/cjs/transforms/data/sort.js +17 -0
  275. package/cjs/transforms/data/sort.js.map +1 -0
  276. package/cjs/transforms/data/stack.d.ts +2 -0
  277. package/cjs/transforms/data/stack.js +74 -0
  278. package/cjs/transforms/data/stack.js.map +1 -0
  279. package/cjs/transforms/data/unfold.d.ts +2 -0
  280. package/cjs/transforms/data/unfold.js +49 -0
  281. package/cjs/transforms/data/unfold.js.map +1 -0
  282. package/cjs/transforms/index.d.ts +23 -0
  283. package/cjs/transforms/index.js +213 -0
  284. package/cjs/transforms/index.js.map +1 -0
  285. package/cjs/transforms/mark/dodge.d.ts +2 -0
  286. package/cjs/transforms/mark/dodge.js +81 -0
  287. package/cjs/transforms/mark/dodge.js.map +1 -0
  288. package/cjs/transforms/mark/jitter.d.ts +4 -0
  289. package/cjs/transforms/mark/jitter.js +53 -0
  290. package/cjs/transforms/mark/jitter.js.map +1 -0
  291. package/cjs/transforms/mark/lttb-sample.d.ts +2 -0
  292. package/cjs/transforms/mark/lttb-sample.js +68 -0
  293. package/cjs/transforms/mark/lttb-sample.js.map +1 -0
  294. package/cjs/transforms/mark/mark-overlap.d.ts +2 -0
  295. package/cjs/transforms/mark/mark-overlap.js +79 -0
  296. package/cjs/transforms/mark/mark-overlap.js.map +1 -0
  297. package/cjs/transforms/mark/symmetry.d.ts +2 -0
  298. package/cjs/transforms/mark/symmetry.js +25 -0
  299. package/cjs/transforms/mark/symmetry.js.map +1 -0
  300. package/cjs/transforms/util/util.d.ts +5 -0
  301. package/cjs/transforms/util/util.js +41 -0
  302. package/cjs/transforms/util/util.js.map +1 -0
  303. package/cjs/transforms/view/identifier.d.ts +2 -0
  304. package/cjs/transforms/view/identifier.js +17 -0
  305. package/cjs/transforms/view/identifier.js.map +1 -0
  306. package/cjs/types/animate.d.ts +224 -0
  307. package/cjs/types/animate.js +6 -0
  308. package/cjs/types/animate.js.map +1 -0
  309. package/cjs/types/base.d.ts +36 -0
  310. package/cjs/types/base.js +6 -0
  311. package/cjs/types/base.js.map +1 -0
  312. package/cjs/types/component.d.ts +240 -0
  313. package/cjs/types/component.js +6 -0
  314. package/cjs/types/component.js.map +1 -0
  315. package/cjs/types/coordinate.d.ts +15 -0
  316. package/cjs/types/coordinate.js +6 -0
  317. package/cjs/types/coordinate.js.map +1 -0
  318. package/cjs/types/data.d.ts +55 -0
  319. package/cjs/types/data.js +5 -0
  320. package/cjs/types/data.js.map +1 -0
  321. package/cjs/types/dataflow.d.ts +13 -0
  322. package/cjs/types/dataflow.js +6 -0
  323. package/cjs/types/dataflow.js.map +1 -0
  324. package/cjs/types/element.d.ts +117 -0
  325. package/cjs/types/element.js +6 -0
  326. package/cjs/types/element.js.map +1 -0
  327. package/cjs/types/event.d.ts +58 -0
  328. package/cjs/types/event.js +6 -0
  329. package/cjs/types/event.js.map +1 -0
  330. package/cjs/types/glyph.d.ts +29 -0
  331. package/cjs/types/glyph.js +6 -0
  332. package/cjs/types/glyph.js.map +1 -0
  333. package/cjs/types/grammar.d.ts +184 -0
  334. package/cjs/types/grammar.js +6 -0
  335. package/cjs/types/grammar.js.map +1 -0
  336. package/cjs/types/hooks.d.ts +45 -0
  337. package/cjs/types/hooks.js +6 -0
  338. package/cjs/types/hooks.js.map +1 -0
  339. package/cjs/types/index.d.ts +22 -0
  340. package/cjs/types/index.js +31 -0
  341. package/cjs/types/index.js.map +1 -0
  342. package/cjs/types/layout.d.ts +5 -0
  343. package/cjs/types/layout.js +6 -0
  344. package/cjs/types/layout.js.map +1 -0
  345. package/cjs/types/mark.d.ts +344 -0
  346. package/cjs/types/mark.js +6 -0
  347. package/cjs/types/mark.js.map +1 -0
  348. package/cjs/types/morph.d.ts +29 -0
  349. package/cjs/types/morph.js +6 -0
  350. package/cjs/types/morph.js.map +1 -0
  351. package/cjs/types/plot.d.ts +326 -0
  352. package/cjs/types/plot.js +6 -0
  353. package/cjs/types/plot.js.map +1 -0
  354. package/cjs/types/projection.d.ts +61 -0
  355. package/cjs/types/projection.js +6 -0
  356. package/cjs/types/projection.js.map +1 -0
  357. package/cjs/types/renderer.d.ts +19 -0
  358. package/cjs/types/renderer.js +6 -0
  359. package/cjs/types/renderer.js.map +1 -0
  360. package/cjs/types/scale.d.ts +111 -0
  361. package/cjs/types/scale.js +6 -0
  362. package/cjs/types/scale.js.map +1 -0
  363. package/cjs/types/signal.d.ts +20 -0
  364. package/cjs/types/signal.js +6 -0
  365. package/cjs/types/signal.js.map +1 -0
  366. package/cjs/types/theme.d.ts +41 -0
  367. package/cjs/types/theme.js +6 -0
  368. package/cjs/types/theme.js.map +1 -0
  369. package/cjs/types/transform.d.ts +291 -0
  370. package/cjs/types/transform.js +6 -0
  371. package/cjs/types/transform.js.map +1 -0
  372. package/cjs/types/view.d.ts +217 -0
  373. package/cjs/types/view.js +6 -0
  374. package/cjs/types/view.js.map +1 -0
  375. package/cjs/util/data.d.ts +3 -0
  376. package/cjs/util/data.js +64 -0
  377. package/cjs/util/data.js.map +1 -0
  378. package/cjs/util/grammar-heap.d.ts +14 -0
  379. package/cjs/util/grammar-heap.js +66 -0
  380. package/cjs/util/grammar-heap.js.map +1 -0
  381. package/cjs/util/text.d.ts +19 -0
  382. package/cjs/util/text.js +32 -0
  383. package/cjs/util/text.js.map +1 -0
  384. package/cjs/util/unique-list.d.ts +12 -0
  385. package/cjs/util/unique-list.js +37 -0
  386. package/cjs/util/unique-list.js.map +1 -0
  387. package/cjs/view/View.d.ts +157 -0
  388. package/cjs/view/View.js +800 -0
  389. package/cjs/view/View.js.map +1 -0
  390. package/cjs/view/animate.d.ts +20 -0
  391. package/cjs/view/animate.js +106 -0
  392. package/cjs/view/animate.js.map +1 -0
  393. package/cjs/view/component.d.ts +26 -0
  394. package/cjs/view/component.js +64 -0
  395. package/cjs/view/component.js.map +1 -0
  396. package/cjs/view/constants.d.ts +17 -0
  397. package/cjs/view/constants.js +13 -0
  398. package/cjs/view/constants.js.map +1 -0
  399. package/cjs/view/coordinate.d.ts +23 -0
  400. package/cjs/view/coordinate.js +59 -0
  401. package/cjs/view/coordinate.js.map +1 -0
  402. package/cjs/view/data.d.ts +37 -0
  403. package/cjs/view/data.js +198 -0
  404. package/cjs/view/data.js.map +1 -0
  405. package/cjs/view/dataflow.d.ts +32 -0
  406. package/cjs/view/dataflow.js +146 -0
  407. package/cjs/view/dataflow.js.map +1 -0
  408. package/cjs/view/events.d.ts +4 -0
  409. package/cjs/view/events.js +34 -0
  410. package/cjs/view/events.js.map +1 -0
  411. package/cjs/view/glyph-meta.d.ts +29 -0
  412. package/cjs/view/glyph-meta.js +45 -0
  413. package/cjs/view/glyph-meta.js.map +1 -0
  414. package/cjs/view/glyph.d.ts +14 -0
  415. package/cjs/view/glyph.js +29 -0
  416. package/cjs/view/glyph.js.map +1 -0
  417. package/cjs/view/grammar-base.d.ts +46 -0
  418. package/cjs/view/grammar-base.js +171 -0
  419. package/cjs/view/grammar-base.js.map +1 -0
  420. package/cjs/view/grammar-record.d.ts +39 -0
  421. package/cjs/view/grammar-record.js +180 -0
  422. package/cjs/view/grammar-record.js.map +1 -0
  423. package/cjs/view/group.d.ts +13 -0
  424. package/cjs/view/group.js +39 -0
  425. package/cjs/view/group.js.map +1 -0
  426. package/cjs/view/index.d.ts +1 -0
  427. package/cjs/view/index.js +21 -0
  428. package/cjs/view/index.js.map +1 -0
  429. package/cjs/view/mark.d.ts +112 -0
  430. package/cjs/view/mark.js +600 -0
  431. package/cjs/view/mark.js.map +1 -0
  432. package/cjs/view/scale.d.ts +26 -0
  433. package/cjs/view/scale.js +86 -0
  434. package/cjs/view/scale.js.map +1 -0
  435. package/cjs/view/signal.d.ts +18 -0
  436. package/cjs/view/signal.js +56 -0
  437. package/cjs/view/signal.js.map +1 -0
  438. package/es/component/axis.d.ts +26 -0
  439. package/es/component/axis.js +162 -0
  440. package/es/component/axis.js.map +1 -0
  441. package/es/component/crosshair.d.ts +50 -0
  442. package/es/component/crosshair.js +275 -0
  443. package/es/component/crosshair.js.map +1 -0
  444. package/es/component/datazoom.d.ts +19 -0
  445. package/es/component/datazoom.js +161 -0
  446. package/es/component/datazoom.js.map +1 -0
  447. package/es/component/grid.d.ts +27 -0
  448. package/es/component/grid.js +193 -0
  449. package/es/component/grid.js.map +1 -0
  450. package/es/component/index.d.ts +11 -0
  451. package/es/component/index.js +22 -0
  452. package/es/component/index.js.map +1 -0
  453. package/es/component/label.d.ts +19 -0
  454. package/es/component/label.js +124 -0
  455. package/es/component/label.js.map +1 -0
  456. package/es/component/legend.d.ts +26 -0
  457. package/es/component/legend.js +169 -0
  458. package/es/component/legend.js.map +1 -0
  459. package/es/component/player.d.ts +25 -0
  460. package/es/component/player.js +136 -0
  461. package/es/component/player.js.map +1 -0
  462. package/es/component/scale.d.ts +8 -0
  463. package/es/component/scale.js +19 -0
  464. package/es/component/scale.js.map +1 -0
  465. package/es/component/scrollbar.d.ts +23 -0
  466. package/es/component/scrollbar.js +184 -0
  467. package/es/component/scrollbar.js.map +1 -0
  468. package/es/component/slider.d.ts +19 -0
  469. package/es/component/slider.js +86 -0
  470. package/es/component/slider.js.map +1 -0
  471. package/es/component/title.d.ts +15 -0
  472. package/es/component/title.js +58 -0
  473. package/es/component/title.js.map +1 -0
  474. package/es/component/tooltip.d.ts +62 -0
  475. package/es/component/tooltip.js +303 -0
  476. package/es/component/tooltip.js.map +1 -0
  477. package/es/core/factory.d.ts +35 -0
  478. package/es/core/factory.js +67 -0
  479. package/es/core/factory.js.map +1 -0
  480. package/es/glyph/boxplot.d.ts +10 -0
  481. package/es/glyph/boxplot.js +410 -0
  482. package/es/glyph/boxplot.js.map +1 -0
  483. package/es/glyph/index.d.ts +7 -0
  484. package/es/glyph/index.js +11 -0
  485. package/es/glyph/index.js.map +1 -0
  486. package/es/glyph/link-path.d.ts +7 -0
  487. package/es/glyph/link-path.js +132 -0
  488. package/es/glyph/link-path.js.map +1 -0
  489. package/es/glyph/ripple.d.ts +1 -0
  490. package/es/glyph/ripple.js +38 -0
  491. package/es/glyph/ripple.js.map +1 -0
  492. package/es/glyph/tree-path.d.ts +7 -0
  493. package/es/glyph/tree-path.js +146 -0
  494. package/es/glyph/tree-path.js.map +1 -0
  495. package/es/glyph/violin.d.ts +1 -0
  496. package/es/glyph/violin.js +163 -0
  497. package/es/glyph/violin.js.map +1 -0
  498. package/es/glyph/wave.d.ts +1 -0
  499. package/es/glyph/wave.js +61 -0
  500. package/es/glyph/wave.js.map +1 -0
  501. package/es/graph/animation/animate.d.ts +48 -0
  502. package/es/graph/animation/animate.js +247 -0
  503. package/es/graph/animation/animate.js.map +1 -0
  504. package/es/graph/animation/animation/clip.d.ts +4 -0
  505. package/es/graph/animation/animation/clip.js +44 -0
  506. package/es/graph/animation/animation/clip.js.map +1 -0
  507. package/es/graph/animation/animation/fade.d.ts +4 -0
  508. package/es/graph/animation/animation/fade.js +32 -0
  509. package/es/graph/animation/animation/fade.js.map +1 -0
  510. package/es/graph/animation/animation/grow-cartesian.d.ts +7 -0
  511. package/es/graph/animation/animation/grow-cartesian.js +272 -0
  512. package/es/graph/animation/animation/grow-cartesian.js.map +1 -0
  513. package/es/graph/animation/animation/grow-interval.d.ts +3 -0
  514. package/es/graph/animation/animation/grow-interval.js +184 -0
  515. package/es/graph/animation/animation/grow-interval.js.map +1 -0
  516. package/es/graph/animation/animation/grow-points.d.ts +7 -0
  517. package/es/graph/animation/animation/grow-points.js +107 -0
  518. package/es/graph/animation/animation/grow-points.js.map +1 -0
  519. package/es/graph/animation/animation/grow-polar.d.ts +5 -0
  520. package/es/graph/animation/animation/grow-polar.js +160 -0
  521. package/es/graph/animation/animation/grow-polar.js.map +1 -0
  522. package/es/graph/animation/animation/index.d.ts +11 -0
  523. package/es/graph/animation/animation/index.js +22 -0
  524. package/es/graph/animation/animation/index.js.map +1 -0
  525. package/es/graph/animation/animation/move.d.ts +3 -0
  526. package/es/graph/animation/animation/move.js +78 -0
  527. package/es/graph/animation/animation/move.js.map +1 -0
  528. package/es/graph/animation/animation/rotate.d.ts +3 -0
  529. package/es/graph/animation/animation/rotate.js +32 -0
  530. package/es/graph/animation/animation/rotate.js.map +1 -0
  531. package/es/graph/animation/animation/scale.d.ts +3 -0
  532. package/es/graph/animation/animation/scale.js +74 -0
  533. package/es/graph/animation/animation/scale.js.map +1 -0
  534. package/es/graph/animation/animation/update.d.ts +6 -0
  535. package/es/graph/animation/animation/update.js +20 -0
  536. package/es/graph/animation/animation/update.js.map +1 -0
  537. package/es/graph/animation/animator.d.ts +26 -0
  538. package/es/graph/animation/animator.js +83 -0
  539. package/es/graph/animation/animator.js.map +1 -0
  540. package/es/graph/animation/arranger.d.ts +13 -0
  541. package/es/graph/animation/arranger.js +29 -0
  542. package/es/graph/animation/arranger.js.map +1 -0
  543. package/es/graph/animation/attribute.d.ts +27 -0
  544. package/es/graph/animation/attribute.js +114 -0
  545. package/es/graph/animation/attribute.js.map +1 -0
  546. package/es/graph/animation/config.d.ts +5 -0
  547. package/es/graph/animation/config.js +84 -0
  548. package/es/graph/animation/config.js.map +1 -0
  549. package/es/graph/animation/morph.d.ts +12 -0
  550. package/es/graph/animation/morph.js +171 -0
  551. package/es/graph/animation/morph.js.map +1 -0
  552. package/es/graph/attributes/common.d.ts +2 -0
  553. package/es/graph/attributes/common.js +13 -0
  554. package/es/graph/attributes/common.js.map +1 -0
  555. package/es/graph/attributes/helpers.d.ts +17 -0
  556. package/es/graph/attributes/helpers.js +75 -0
  557. package/es/graph/attributes/helpers.js.map +1 -0
  558. package/es/graph/attributes/index.d.ts +10 -0
  559. package/es/graph/attributes/index.js +231 -0
  560. package/es/graph/attributes/index.js.map +1 -0
  561. package/es/graph/canvas-renderer.d.ts +34 -0
  562. package/es/graph/canvas-renderer.js +115 -0
  563. package/es/graph/canvas-renderer.js.map +1 -0
  564. package/es/graph/constants.d.ts +23 -0
  565. package/es/graph/constants.js +47 -0
  566. package/es/graph/constants.js.map +1 -0
  567. package/es/graph/element.d.ts +66 -0
  568. package/es/graph/element.js +292 -0
  569. package/es/graph/element.js.map +1 -0
  570. package/es/graph/enums.d.ts +153 -0
  571. package/es/graph/enums.js +129 -0
  572. package/es/graph/enums.js.map +1 -0
  573. package/es/graph/glyph-element.d.ts +53 -0
  574. package/es/graph/glyph-element.js +206 -0
  575. package/es/graph/glyph-element.js.map +1 -0
  576. package/es/graph/index.d.ts +3 -0
  577. package/es/graph/index.js +6 -0
  578. package/es/graph/index.js.map +1 -0
  579. package/es/graph/layout/grid.d.ts +3 -0
  580. package/es/graph/layout/grid.js +66 -0
  581. package/es/graph/layout/grid.js.map +1 -0
  582. package/es/graph/layout/layout.d.ts +3 -0
  583. package/es/graph/layout/layout.js +33 -0
  584. package/es/graph/layout/layout.js.map +1 -0
  585. package/es/graph/layout/relative.d.ts +3 -0
  586. package/es/graph/layout/relative.js +85 -0
  587. package/es/graph/layout/relative.js.map +1 -0
  588. package/es/graph/mark/differ.d.ts +20 -0
  589. package/es/graph/mark/differ.js +104 -0
  590. package/es/graph/mark/differ.js.map +1 -0
  591. package/es/graph/mark/encode.d.ts +10 -0
  592. package/es/graph/mark/encode.js +92 -0
  593. package/es/graph/mark/encode.js.map +1 -0
  594. package/es/graph/mark/large-rects.d.ts +10 -0
  595. package/es/graph/mark/large-rects.js +23 -0
  596. package/es/graph/mark/large-rects.js.map +1 -0
  597. package/es/graph/mark/large-symbols.d.ts +11 -0
  598. package/es/graph/mark/large-symbols.js +27 -0
  599. package/es/graph/mark/large-symbols.js.map +1 -0
  600. package/es/graph/mark-tree.d.ts +2 -0
  601. package/es/graph/mark-tree.js +15 -0
  602. package/es/graph/mark-tree.js.map +1 -0
  603. package/es/graph/util/element.d.ts +2 -0
  604. package/es/graph/util/element.js +8 -0
  605. package/es/graph/util/element.js.map +1 -0
  606. package/es/graph/util/env.d.ts +2 -0
  607. package/es/graph/util/env.js +6 -0
  608. package/es/graph/util/env.js.map +1 -0
  609. package/es/graph/util/events-extend.d.ts +5 -0
  610. package/es/graph/util/events-extend.js +12 -0
  611. package/es/graph/util/events-extend.js.map +1 -0
  612. package/es/graph/util/graphic.d.ts +9 -0
  613. package/es/graph/util/graphic.js +59 -0
  614. package/es/graph/util/graphic.js.map +1 -0
  615. package/es/graph/util/point.d.ts +1 -0
  616. package/es/graph/util/point.js +67 -0
  617. package/es/graph/util/point.js.map +1 -0
  618. package/es/index.d.ts +14 -0
  619. package/es/index.js +27 -0
  620. package/es/index.js.map +1 -0
  621. package/es/parse/coordinate.d.ts +7 -0
  622. package/es/parse/coordinate.js +65 -0
  623. package/es/parse/coordinate.js.map +1 -0
  624. package/es/parse/event.d.ts +8 -0
  625. package/es/parse/event.js +23 -0
  626. package/es/parse/event.js.map +1 -0
  627. package/es/parse/mark.d.ts +4 -0
  628. package/es/parse/mark.js +19 -0
  629. package/es/parse/mark.js.map +1 -0
  630. package/es/parse/option.d.ts +3 -0
  631. package/es/parse/option.js +10 -0
  632. package/es/parse/option.js.map +1 -0
  633. package/es/parse/scale.d.ts +8 -0
  634. package/es/parse/scale.js +347 -0
  635. package/es/parse/scale.js.map +1 -0
  636. package/es/parse/transform.d.ts +5 -0
  637. package/es/parse/transform.js +102 -0
  638. package/es/parse/transform.js.map +1 -0
  639. package/es/parse/util.d.ts +13 -0
  640. package/es/parse/util.js +65 -0
  641. package/es/parse/util.js.map +1 -0
  642. package/es/parse/view.d.ts +17 -0
  643. package/es/parse/view.js +98 -0
  644. package/es/parse/view.js.map +1 -0
  645. package/es/semantic-marks/cell.d.ts +13 -0
  646. package/es/semantic-marks/cell.js +57 -0
  647. package/es/semantic-marks/cell.js.map +1 -0
  648. package/es/semantic-marks/interval.d.ts +14 -0
  649. package/es/semantic-marks/interval.js +87 -0
  650. package/es/semantic-marks/interval.js.map +1 -0
  651. package/es/semantic-marks/text.d.ts +10 -0
  652. package/es/semantic-marks/text.js +22 -0
  653. package/es/semantic-marks/text.js.map +1 -0
  654. package/es/theme/common/component.d.ts +15 -0
  655. package/es/theme/common/component.js +510 -0
  656. package/es/theme/common/component.js.map +1 -0
  657. package/es/theme/common/constants.d.ts +1 -0
  658. package/es/theme/common/constants.js +2 -0
  659. package/es/theme/common/constants.js.map +1 -0
  660. package/es/theme/common/mark.d.ts +2 -0
  661. package/es/theme/common/mark.js +11 -0
  662. package/es/theme/common/mark.js.map +1 -0
  663. package/es/theme/dark.d.ts +2 -0
  664. package/es/theme/dark.js +96 -0
  665. package/es/theme/dark.js.map +1 -0
  666. package/es/theme/default.d.ts +2 -0
  667. package/es/theme/default.js +16 -0
  668. package/es/theme/default.js.map +1 -0
  669. package/es/theme/theme-manager.d.ts +8 -0
  670. package/es/theme/theme-manager.js +22 -0
  671. package/es/theme/theme-manager.js.map +1 -0
  672. package/es/transforms/data/bin.d.ts +2 -0
  673. package/es/transforms/data/bin.js +16 -0
  674. package/es/transforms/data/bin.js.map +1 -0
  675. package/es/transforms/data/circular-relation.d.ts +2 -0
  676. package/es/transforms/data/circular-relation.js +44 -0
  677. package/es/transforms/data/circular-relation.js.map +1 -0
  678. package/es/transforms/data/contour.d.ts +2 -0
  679. package/es/transforms/data/contour.js +111 -0
  680. package/es/transforms/data/contour.js.map +1 -0
  681. package/es/transforms/data/filter.d.ts +2 -0
  682. package/es/transforms/data/filter.js +2 -0
  683. package/es/transforms/data/filter.js.map +1 -0
  684. package/es/transforms/data/fold.d.ts +2 -0
  685. package/es/transforms/data/fold.js +16 -0
  686. package/es/transforms/data/fold.js.map +1 -0
  687. package/es/transforms/data/funnel.d.ts +2 -0
  688. package/es/transforms/data/funnel.js +17 -0
  689. package/es/transforms/data/funnel.js.map +1 -0
  690. package/es/transforms/data/join.d.ts +2 -0
  691. package/es/transforms/data/join.js +26 -0
  692. package/es/transforms/data/join.js.map +1 -0
  693. package/es/transforms/data/kde.d.ts +2 -0
  694. package/es/transforms/data/kde.js +80 -0
  695. package/es/transforms/data/kde.js.map +1 -0
  696. package/es/transforms/data/map.d.ts +2 -0
  697. package/es/transforms/data/map.js +16 -0
  698. package/es/transforms/data/map.js.map +1 -0
  699. package/es/transforms/data/pick.d.ts +2 -0
  700. package/es/transforms/data/pick.js +15 -0
  701. package/es/transforms/data/pick.js.map +1 -0
  702. package/es/transforms/data/pie.d.ts +2 -0
  703. package/es/transforms/data/pie.js +18 -0
  704. package/es/transforms/data/pie.js.map +1 -0
  705. package/es/transforms/data/range.d.ts +4 -0
  706. package/es/transforms/data/range.js +9 -0
  707. package/es/transforms/data/range.js.map +1 -0
  708. package/es/transforms/data/sort.d.ts +2 -0
  709. package/es/transforms/data/sort.js +13 -0
  710. package/es/transforms/data/sort.js.map +1 -0
  711. package/es/transforms/data/stack.d.ts +2 -0
  712. package/es/transforms/data/stack.js +72 -0
  713. package/es/transforms/data/stack.js.map +1 -0
  714. package/es/transforms/data/unfold.d.ts +2 -0
  715. package/es/transforms/data/unfold.js +45 -0
  716. package/es/transforms/data/unfold.js.map +1 -0
  717. package/es/transforms/index.d.ts +23 -0
  718. package/es/transforms/index.js +205 -0
  719. package/es/transforms/index.js.map +1 -0
  720. package/es/transforms/mark/dodge.d.ts +2 -0
  721. package/es/transforms/mark/dodge.js +74 -0
  722. package/es/transforms/mark/dodge.js.map +1 -0
  723. package/es/transforms/mark/jitter.d.ts +4 -0
  724. package/es/transforms/mark/jitter.js +48 -0
  725. package/es/transforms/mark/jitter.js.map +1 -0
  726. package/es/transforms/mark/lttb-sample.d.ts +2 -0
  727. package/es/transforms/mark/lttb-sample.js +60 -0
  728. package/es/transforms/mark/lttb-sample.js.map +1 -0
  729. package/es/transforms/mark/mark-overlap.d.ts +2 -0
  730. package/es/transforms/mark/mark-overlap.js +71 -0
  731. package/es/transforms/mark/mark-overlap.js.map +1 -0
  732. package/es/transforms/mark/symmetry.d.ts +2 -0
  733. package/es/transforms/mark/symmetry.js +20 -0
  734. package/es/transforms/mark/symmetry.js.map +1 -0
  735. package/es/transforms/util/util.d.ts +5 -0
  736. package/es/transforms/util/util.js +33 -0
  737. package/es/transforms/util/util.js.map +1 -0
  738. package/es/transforms/view/identifier.d.ts +2 -0
  739. package/es/transforms/view/identifier.js +13 -0
  740. package/es/transforms/view/identifier.js.map +1 -0
  741. package/es/types/animate.d.ts +224 -0
  742. package/es/types/animate.js +2 -0
  743. package/es/types/animate.js.map +1 -0
  744. package/es/types/base.d.ts +36 -0
  745. package/es/types/base.js +2 -0
  746. package/es/types/base.js.map +1 -0
  747. package/es/types/component.d.ts +240 -0
  748. package/es/types/component.js +2 -0
  749. package/es/types/component.js.map +1 -0
  750. package/es/types/coordinate.d.ts +15 -0
  751. package/es/types/coordinate.js +2 -0
  752. package/es/types/coordinate.js.map +1 -0
  753. package/es/types/data.d.ts +55 -0
  754. package/es/types/data.js +1 -0
  755. package/es/types/data.js.map +1 -0
  756. package/es/types/dataflow.d.ts +13 -0
  757. package/es/types/dataflow.js +2 -0
  758. package/es/types/dataflow.js.map +1 -0
  759. package/es/types/element.d.ts +117 -0
  760. package/es/types/element.js +2 -0
  761. package/es/types/element.js.map +1 -0
  762. package/es/types/event.d.ts +58 -0
  763. package/es/types/event.js +2 -0
  764. package/es/types/event.js.map +1 -0
  765. package/es/types/glyph.d.ts +29 -0
  766. package/es/types/glyph.js +2 -0
  767. package/es/types/glyph.js.map +1 -0
  768. package/es/types/grammar.d.ts +184 -0
  769. package/es/types/grammar.js +2 -0
  770. package/es/types/grammar.js.map +1 -0
  771. package/es/types/hooks.d.ts +45 -0
  772. package/es/types/hooks.js +2 -0
  773. package/es/types/hooks.js.map +1 -0
  774. package/es/types/index.d.ts +22 -0
  775. package/es/types/index.js +44 -0
  776. package/es/types/index.js.map +1 -0
  777. package/es/types/layout.d.ts +5 -0
  778. package/es/types/layout.js +2 -0
  779. package/es/types/layout.js.map +1 -0
  780. package/es/types/mark.d.ts +344 -0
  781. package/es/types/mark.js +2 -0
  782. package/es/types/mark.js.map +1 -0
  783. package/es/types/morph.d.ts +29 -0
  784. package/es/types/morph.js +2 -0
  785. package/es/types/morph.js.map +1 -0
  786. package/es/types/plot.d.ts +326 -0
  787. package/es/types/plot.js +2 -0
  788. package/es/types/plot.js.map +1 -0
  789. package/es/types/projection.d.ts +61 -0
  790. package/es/types/projection.js +2 -0
  791. package/es/types/projection.js.map +1 -0
  792. package/es/types/renderer.d.ts +19 -0
  793. package/es/types/renderer.js +2 -0
  794. package/es/types/renderer.js.map +1 -0
  795. package/es/types/scale.d.ts +111 -0
  796. package/es/types/scale.js +2 -0
  797. package/es/types/scale.js.map +1 -0
  798. package/es/types/signal.d.ts +20 -0
  799. package/es/types/signal.js +2 -0
  800. package/es/types/signal.js.map +1 -0
  801. package/es/types/theme.d.ts +41 -0
  802. package/es/types/theme.js +2 -0
  803. package/es/types/theme.js.map +1 -0
  804. package/es/types/transform.d.ts +291 -0
  805. package/es/types/transform.js +2 -0
  806. package/es/types/transform.js.map +1 -0
  807. package/es/types/view.d.ts +217 -0
  808. package/es/types/view.js +2 -0
  809. package/es/types/view.js.map +1 -0
  810. package/es/util/data.d.ts +3 -0
  811. package/es/util/data.js +60 -0
  812. package/es/util/data.js.map +1 -0
  813. package/es/util/grammar-heap.d.ts +14 -0
  814. package/es/util/grammar-heap.js +58 -0
  815. package/es/util/grammar-heap.js.map +1 -0
  816. package/es/util/text.d.ts +19 -0
  817. package/es/util/text.js +25 -0
  818. package/es/util/text.js.map +1 -0
  819. package/es/util/unique-list.d.ts +12 -0
  820. package/es/util/unique-list.js +29 -0
  821. package/es/util/unique-list.js.map +1 -0
  822. package/es/view/View.d.ts +157 -0
  823. package/es/view/View.js +836 -0
  824. package/es/view/View.js.map +1 -0
  825. package/es/view/animate.d.ts +20 -0
  826. package/es/view/animate.js +98 -0
  827. package/es/view/animate.js.map +1 -0
  828. package/es/view/component.d.ts +26 -0
  829. package/es/view/component.js +64 -0
  830. package/es/view/component.js.map +1 -0
  831. package/es/view/constants.d.ts +17 -0
  832. package/es/view/constants.js +32 -0
  833. package/es/view/constants.js.map +1 -0
  834. package/es/view/coordinate.d.ts +23 -0
  835. package/es/view/coordinate.js +52 -0
  836. package/es/view/coordinate.js.map +1 -0
  837. package/es/view/data.d.ts +37 -0
  838. package/es/view/data.js +195 -0
  839. package/es/view/data.js.map +1 -0
  840. package/es/view/dataflow.d.ts +32 -0
  841. package/es/view/dataflow.js +141 -0
  842. package/es/view/dataflow.js.map +1 -0
  843. package/es/view/events.d.ts +4 -0
  844. package/es/view/events.js +26 -0
  845. package/es/view/events.js.map +1 -0
  846. package/es/view/glyph-meta.d.ts +29 -0
  847. package/es/view/glyph-meta.js +37 -0
  848. package/es/view/glyph-meta.js.map +1 -0
  849. package/es/view/glyph.d.ts +14 -0
  850. package/es/view/glyph.js +27 -0
  851. package/es/view/glyph.js.map +1 -0
  852. package/es/view/grammar-base.d.ts +46 -0
  853. package/es/view/grammar-base.js +165 -0
  854. package/es/view/grammar-base.js.map +1 -0
  855. package/es/view/grammar-record.d.ts +39 -0
  856. package/es/view/grammar-record.js +170 -0
  857. package/es/view/grammar-record.js.map +1 -0
  858. package/es/view/group.d.ts +13 -0
  859. package/es/view/group.js +39 -0
  860. package/es/view/group.js.map +1 -0
  861. package/es/view/index.d.ts +1 -0
  862. package/es/view/index.js +2 -0
  863. package/es/view/index.js.map +1 -0
  864. package/es/view/mark.d.ts +112 -0
  865. package/es/view/mark.js +604 -0
  866. package/es/view/mark.js.map +1 -0
  867. package/es/view/scale.d.ts +26 -0
  868. package/es/view/scale.js +82 -0
  869. package/es/view/scale.js.map +1 -0
  870. package/es/view/signal.d.ts +18 -0
  871. package/es/view/signal.js +52 -0
  872. package/es/view/signal.js.map +1 -0
  873. package/package.json +67 -0
@@ -0,0 +1,836 @@
1
+ var __awaiter = this && this.__awaiter || function(thisArg, _arguments, P, generator) {
2
+ return new (P || (P = Promise))((function(resolve, reject) {
3
+ function fulfilled(value) {
4
+ try {
5
+ step(generator.next(value));
6
+ } catch (e) {
7
+ reject(e);
8
+ }
9
+ }
10
+ function rejected(value) {
11
+ try {
12
+ step(generator.throw(value));
13
+ } catch (e) {
14
+ reject(e);
15
+ }
16
+ }
17
+ function step(result) {
18
+ var value;
19
+ result.done ? resolve(result.value) : (value = result.value, value instanceof P ? value : new P((function(resolve) {
20
+ resolve(value);
21
+ }))).then(fulfilled, rejected);
22
+ }
23
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
24
+ }));
25
+ };
26
+
27
+ import { EventEmitter, debounce, isNil, isObject, isString, getContainerSize, Logger } from "@visactor/vutils";
28
+
29
+ import { vglobal } from "@visactor/vrender";
30
+
31
+ import { Data } from "./data";
32
+
33
+ import { initializeEventConfig, permit, prevent } from "./events";
34
+
35
+ import Dataflow from "./dataflow";
36
+
37
+ import { traverseMarkTree } from "../graph/mark-tree";
38
+
39
+ import { BridgeElementKey } from "../graph/constants";
40
+
41
+ import CanvasRenderer from "../graph/canvas-renderer";
42
+
43
+ import getExtendedEvents from "../graph/util/events-extend";
44
+
45
+ import { BROWSER, NO_TRAP, SIGNAL_WIDTH, SIGNAL_HEIGHT, SIGNAL_PADDING, SIGNAL_AUTOFIT, CURSOR_DEFAULT, DEFAULT_HOVER_STATE, SIGNAL_VIEW_WIDTH, SIGNAL_VIEW_HEIGHT, EVENT_SOURCE_VIEW, EVENT_SOURCE_WINDOW, SIGNAL_VIEW_BOX } from "./constants";
46
+
47
+ import { Signal } from "./signal";
48
+
49
+ import { Scale } from "./scale";
50
+
51
+ import { BuiltInSignalID, builtInSignals, normalizeMarkTree, normalizeRunningConfig, normalizePadding } from "../parse/view";
52
+
53
+ import { parseHandler, parseEventSelector, generateFilterByMark } from "../parse/event";
54
+
55
+ import { parseReference } from "../parse/util";
56
+
57
+ import { configureEnvironment } from "../graph/util/env";
58
+
59
+ import { GroupMark } from "./group";
60
+
61
+ import { Mark } from "./mark";
62
+
63
+ import { defaultDoLayout } from "../graph/layout/layout";
64
+
65
+ import { GlyphMark } from "./glyph";
66
+
67
+ import { Coordinate } from "./coordinate";
68
+
69
+ import { Morph } from "../graph/animation/morph";
70
+
71
+ import { RecordedGrammars, RecordedTreeGrammars } from "./grammar-record";
72
+
73
+ import { ViewAnimate } from "./animate";
74
+
75
+ import { ComponentEnum, HOOK_EVENT, LayoutState, GrammarMarkType } from "../graph/enums";
76
+
77
+ import { Interval } from "../semantic-marks/interval";
78
+
79
+ import { Cell } from "../semantic-marks/cell";
80
+
81
+ import { Text } from "../semantic-marks/text";
82
+
83
+ import { ThemeManager } from "../theme/theme-manager";
84
+
85
+ import { Factory } from "../core/factory";
86
+
87
+ export default class View extends EventEmitter {
88
+ static useRegisters(comps) {
89
+ comps.forEach((fn => {
90
+ fn();
91
+ }));
92
+ }
93
+ static useAnimations(comps) {
94
+ comps.forEach((comp => {
95
+ Factory.registerAnimationType(comp.name, comp);
96
+ }));
97
+ }
98
+ constructor(options = {}, config = {}) {
99
+ super(), this._observer = null, this._onResize = debounce(((...args) => {
100
+ const size = this._getContainerSize();
101
+ size && this.resize(size.width, size.height);
102
+ }), 100), this.delegateEvent = (event, type) => {
103
+ var _a;
104
+ const activeElement = null === (_a = event.target) || void 0 === _a ? void 0 : _a[BridgeElementKey], extendedEvt = getExtendedEvents(this, event, activeElement, type, EVENT_SOURCE_VIEW);
105
+ this.emit(type, extendedEvt, activeElement);
106
+ }, this.handleProgressiveFrame = () => {
107
+ this._progressiveMarks.length && this._progressiveMarks.forEach((mark => {
108
+ mark.isDoingProgressive() && mark.evaluateProgressive();
109
+ })), this.doPreProgressive();
110
+ }, this._config = config, this._options = Object.assign({
111
+ mode: BROWSER,
112
+ cursor: !0
113
+ }, options), this.initialize();
114
+ }
115
+ getGrammarById(id) {
116
+ return this.grammars.getGrammar(id);
117
+ }
118
+ getSignalById(id) {
119
+ return this.grammars.getSignal(id);
120
+ }
121
+ getDataById(id) {
122
+ return this.grammars.getData(id);
123
+ }
124
+ getScaleById(id) {
125
+ return this.grammars.getScale(id);
126
+ }
127
+ getCoordinateById(id) {
128
+ return this.grammars.getCoordinate(id);
129
+ }
130
+ getMarkById(id) {
131
+ return this.grammars.getMark(id);
132
+ }
133
+ getCustomizedById(id) {
134
+ return this.grammars.getCustomized(id);
135
+ }
136
+ getGrammarsByName(name) {
137
+ return this.grammars.filter((grammar => grammar.name() === name));
138
+ }
139
+ getGrammarsByType(grammarType) {
140
+ return this.grammars.filter((grammar => grammar.grammarType === grammarType));
141
+ }
142
+ getMarksByType(markType) {
143
+ return this.grammars.getAllMarks().filter((mark => mark.markType === markType));
144
+ }
145
+ updateSignal(signal, value) {
146
+ isString(signal) && (signal = this.getSignalById(signal)), signal.set(value), this.commit(signal);
147
+ }
148
+ signal(value, update) {
149
+ const signal = new Signal(this);
150
+ return arguments.length >= 1 && signal.value(value), arguments.length >= 2 && signal.update(update),
151
+ this.grammars.record(signal), this._dataflow.add(signal), signal;
152
+ }
153
+ data(values) {
154
+ const data = new Data(this, values);
155
+ return this.grammars.record(data), this._dataflow.add(data), data;
156
+ }
157
+ scale(type) {
158
+ const scale = new Scale(this, type);
159
+ return this.grammars.record(scale), this._dataflow.add(scale), scale;
160
+ }
161
+ coordinate(type) {
162
+ const coordinate = new Coordinate(this, type);
163
+ return this.grammars.record(coordinate), this._dataflow.add(coordinate), coordinate;
164
+ }
165
+ mark(type, group, markOptions) {
166
+ const groupMark = isString(group) ? this.getMarkById(group) : group;
167
+ let mark;
168
+ switch (type) {
169
+ case GrammarMarkType.group:
170
+ mark = new GroupMark(this, groupMark);
171
+ break;
172
+
173
+ case GrammarMarkType.glyph:
174
+ mark = new GlyphMark(this, null == markOptions ? void 0 : markOptions.glyphType, groupMark);
175
+ break;
176
+
177
+ case GrammarMarkType.component:
178
+ mark = Factory.createComponent(null == markOptions ? void 0 : markOptions.componentType, this, groupMark, null == markOptions ? void 0 : markOptions.mode);
179
+ break;
180
+
181
+ case GrammarMarkType.interval:
182
+ mark = new Interval(this, type, groupMark);
183
+ break;
184
+
185
+ case GrammarMarkType.cell:
186
+ mark = new Cell(this, type, groupMark);
187
+ break;
188
+
189
+ case GrammarMarkType.text:
190
+ mark = new Text(this, type, groupMark);
191
+ break;
192
+
193
+ default:
194
+ mark = new Mark(this, type, groupMark);
195
+ }
196
+ return this.grammars.record(mark), this._dataflow.add(mark), mark;
197
+ }
198
+ group(group) {
199
+ return this.mark(GrammarMarkType.group, group);
200
+ }
201
+ glyph(glyphType, group) {
202
+ return this.mark(GrammarMarkType.glyph, group, {
203
+ glyphType: glyphType
204
+ });
205
+ }
206
+ component(componentType, group, mode = "2d") {
207
+ return this.mark(GrammarMarkType.component, group, {
208
+ componentType: componentType,
209
+ mode: mode
210
+ });
211
+ }
212
+ axis(group, mode = "2d") {
213
+ return this.mark(GrammarMarkType.component, group, {
214
+ componentType: ComponentEnum.axis,
215
+ mode: mode
216
+ });
217
+ }
218
+ grid(group, mode = "2d") {
219
+ return this.mark(GrammarMarkType.component, group, {
220
+ componentType: ComponentEnum.grid,
221
+ mode: mode
222
+ });
223
+ }
224
+ legend(group) {
225
+ return this.mark(GrammarMarkType.component, group, {
226
+ componentType: ComponentEnum.legend
227
+ });
228
+ }
229
+ crosshair(group) {
230
+ return this.mark(GrammarMarkType.component, group, {
231
+ componentType: ComponentEnum.crosshair
232
+ });
233
+ }
234
+ slider(group) {
235
+ return this.mark(GrammarMarkType.component, group, {
236
+ componentType: ComponentEnum.slider
237
+ });
238
+ }
239
+ label(group) {
240
+ return this.mark(GrammarMarkType.component, group, {
241
+ componentType: ComponentEnum.label
242
+ });
243
+ }
244
+ datazoom(group) {
245
+ return this.mark(GrammarMarkType.component, group, {
246
+ componentType: ComponentEnum.datazoom
247
+ });
248
+ }
249
+ player(group) {
250
+ return this.mark(GrammarMarkType.component, group, {
251
+ componentType: ComponentEnum.player
252
+ });
253
+ }
254
+ tooltip(group) {
255
+ return this.mark(GrammarMarkType.component, group, {
256
+ componentType: ComponentEnum.tooltip
257
+ });
258
+ }
259
+ dimensionTooltip(group) {
260
+ return this.mark(GrammarMarkType.component, group, {
261
+ componentType: ComponentEnum.dimensionTooltip
262
+ });
263
+ }
264
+ title(group) {
265
+ return this.mark(GrammarMarkType.component, group, {
266
+ componentType: ComponentEnum.title
267
+ });
268
+ }
269
+ scrollbar(group) {
270
+ return this.mark(GrammarMarkType.component, group, {
271
+ componentType: ComponentEnum.scrollbar
272
+ });
273
+ }
274
+ customized(type, spec) {
275
+ const grammar = Factory.createGrammar(type, this);
276
+ if (grammar) return grammar.parse(spec), this.grammars.record(grammar), this._dataflow.add(grammar),
277
+ grammar;
278
+ }
279
+ addGrammar(grammar) {
280
+ return this.grammars.find((storedGrammar => storedGrammar.uid === grammar.uid)) || (this.grammars.record(grammar),
281
+ this._dataflow.add(grammar), grammar.parse(grammar.getSpec()), this._needBuildLayoutTree = !0),
282
+ this;
283
+ }
284
+ removeGrammar(grammar) {
285
+ const recordedGrammar = isString(grammar) ? this.getGrammarById(grammar) : grammar;
286
+ return recordedGrammar && this.grammars.find((storedGrammar => storedGrammar.uid === recordedGrammar.uid)) ? ("mark" === recordedGrammar.grammarType && recordedGrammar.prepareRelease(),
287
+ this._cachedGrammars.record(recordedGrammar), this._dataflow.remove(recordedGrammar),
288
+ this.grammars.unrecord(recordedGrammar), this._needBuildLayoutTree = !0, this) : this;
289
+ }
290
+ removeAllGrammars() {
291
+ return this.grammars.traverse((grammar => {
292
+ "signal" === grammar.grammarType && BuiltInSignalID.includes(grammar.id()) || "mark" === grammar.grammarType && "root" === grammar.id() || this.removeGrammar(grammar);
293
+ })), this;
294
+ }
295
+ parseSpec(spec) {
296
+ var _a, _b, _c, _d, _e, _f, _g, _h;
297
+ if (this.emit(HOOK_EVENT.BEFORE_PARSE_VIEW), this._spec = spec, normalizeMarkTree(spec),
298
+ spec.theme ? this.theme(spec.theme) : this.theme(ThemeManager.getDefaultTheme()),
299
+ spec.width && this.width(spec.width), spec.height && this.height(spec.height), this.padding(null !== (_b = null !== (_a = spec.padding) && void 0 !== _a ? _a : this._options.padding) && void 0 !== _b ? _b : this._theme.padding),
300
+ !this.width() || !this.height()) {
301
+ const size = this._getContainerSize();
302
+ size && (this.updateSignal(SIGNAL_WIDTH, size.width), this.updateSignal(SIGNAL_HEIGHT, size.height));
303
+ }
304
+ (null === (_c = spec.signals) || void 0 === _c ? void 0 : _c.length) && spec.signals.forEach((signal => {
305
+ this.signal().parse(signal);
306
+ })), (null === (_d = spec.data) || void 0 === _d ? void 0 : _d.length) && spec.data.forEach((data => {
307
+ this.data(null).parse(data);
308
+ })), (null === (_e = spec.coordinates) || void 0 === _e ? void 0 : _e.length) && spec.coordinates.forEach((coordinate => {
309
+ this.coordinate(coordinate.type).parse(coordinate);
310
+ })), (null === (_f = spec.scales) || void 0 === _f ? void 0 : _f.length) && spec.scales.forEach((scale => {
311
+ this.scale(scale.type).parse(scale);
312
+ }));
313
+ const customizedGrammars = Factory.getGrammars();
314
+ return Object.keys(customizedGrammars).forEach((key => {
315
+ var _a;
316
+ const {specKey: specKey} = customizedGrammars[key];
317
+ (null === (_a = spec[specKey]) || void 0 === _a ? void 0 : _a.length) && spec[specKey].forEach((specValue => {
318
+ this.customized(key, specValue);
319
+ }));
320
+ })), (null === (_g = spec.marks) || void 0 === _g ? void 0 : _g.length) && spec.marks.forEach((mark => {
321
+ this.parseMarkSpec(mark);
322
+ })), (null === (_h = spec.events) || void 0 === _h ? void 0 : _h.length) && spec.events.forEach((eventConfig => {
323
+ this.event(eventConfig);
324
+ })), this.emit(HOOK_EVENT.AFTER_PARSE_VIEW), this._needBuildLayoutTree = !0, this._layoutState = LayoutState.before,
325
+ this;
326
+ }
327
+ updateSpec(spec) {
328
+ return this.removeAllGrammars(), this.parseSpec(spec);
329
+ }
330
+ parseBuiltIn() {
331
+ builtInSignals(this._options, this._config, this.getCurrentTheme()).map((signalSpec => {
332
+ const signal = this.signal().parse(signalSpec);
333
+ signalSpec.value && signal.set(signalSpec.value);
334
+ }));
335
+ this.parseMarkSpec({
336
+ id: "root",
337
+ type: "group",
338
+ encode: {
339
+ enter: {
340
+ x: 0,
341
+ y: 0
342
+ },
343
+ update: {
344
+ width: {
345
+ signal: "width"
346
+ },
347
+ height: {
348
+ signal: "height"
349
+ }
350
+ }
351
+ }
352
+ }), this.rootMark = this.getMarkById("root");
353
+ }
354
+ parseMarkSpec(spec) {
355
+ var _a;
356
+ const markOptions = spec.type === GrammarMarkType.glyph ? {
357
+ glyphType: spec.glyphType
358
+ } : spec.type === GrammarMarkType.component ? {
359
+ componentType: spec.componentType,
360
+ mode: spec.mode
361
+ } : null;
362
+ this.mark(spec.type, spec.group, markOptions).parse(spec), null === (_a = spec.marks) || void 0 === _a || _a.forEach((childSpec => {
363
+ this.parseMarkSpec(childSpec);
364
+ }));
365
+ }
366
+ theme(theme) {
367
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
368
+ return isString(theme) ? this._theme = null !== (_a = ThemeManager.getTheme(theme)) && void 0 !== _a ? _a : ThemeManager.getDefaultTheme() : this._theme = theme,
369
+ this.background(null !== (_d = null !== (_c = null === (_b = this._spec) || void 0 === _b ? void 0 : _b.background) && void 0 !== _c ? _c : this._options.background) && void 0 !== _d ? _d : this._theme.background),
370
+ this.padding(null !== (_g = null !== (_f = null === (_e = this._spec) || void 0 === _e ? void 0 : _e.padding) && void 0 !== _f ? _f : this._options.padding) && void 0 !== _g ? _g : this._theme.padding),
371
+ null === (_j = null === (_h = this.renderer.stage()) || void 0 === _h ? void 0 : _h.setTheme) || void 0 === _j || _j.call(_h, Object.assign({}, this._theme.marks)),
372
+ this;
373
+ }
374
+ getCurrentTheme() {
375
+ return this._theme;
376
+ }
377
+ setCurrentTheme(theme, render = !0) {
378
+ return __awaiter(this, void 0, void 0, (function*() {
379
+ return this.theme(theme), this.grammars.getAllMarks().forEach((mark => {
380
+ mark.commit();
381
+ })), render ? (yield this.evaluate(), this.renderer.render(!0)) : yield this._dataflow.evaluate(),
382
+ this;
383
+ }));
384
+ }
385
+ background(value) {
386
+ return arguments.length ? (this._background = value, this.renderer.background(value),
387
+ value) : this._background;
388
+ }
389
+ width(value) {
390
+ const signal = this.getSignalById(SIGNAL_WIDTH);
391
+ return arguments.length ? (this._options.width = value, this.updateSignal(signal, value),
392
+ value) : signal.output();
393
+ }
394
+ height(value) {
395
+ const signal = this.getSignalById(SIGNAL_HEIGHT);
396
+ return arguments.length ? (this._options.height = value, this.updateSignal(signal, value),
397
+ value) : signal.output();
398
+ }
399
+ viewWidth(value) {
400
+ const signal = this.getSignalById(SIGNAL_VIEW_WIDTH);
401
+ if (arguments.length) {
402
+ const padding = this.padding();
403
+ return this.width(value + padding.left + padding.right), value;
404
+ }
405
+ return signal.output();
406
+ }
407
+ viewHeight(value) {
408
+ const signal = this.getSignalById(SIGNAL_VIEW_HEIGHT);
409
+ if (arguments.length) {
410
+ const padding = this.padding();
411
+ return this.height(value + padding.top + padding.bottom), value;
412
+ }
413
+ return signal.output();
414
+ }
415
+ padding(value) {
416
+ const signal = this.getSignalById(SIGNAL_PADDING);
417
+ if (arguments.length) {
418
+ const padding = normalizePadding(value);
419
+ return this.updateSignal(signal, padding), padding;
420
+ }
421
+ return normalizePadding(signal.output());
422
+ }
423
+ autoFit(value) {
424
+ const signal = this.getSignalById(SIGNAL_AUTOFIT);
425
+ return arguments.length ? (this.updateSignal(signal, value), value) : signal.output();
426
+ }
427
+ getViewBox() {
428
+ const signal = this.getSignalById(SIGNAL_VIEW_BOX);
429
+ return null == signal ? void 0 : signal.output();
430
+ }
431
+ updateLayoutTag() {
432
+ return this._layoutState = LayoutState.before, this;
433
+ }
434
+ getLayoutState() {
435
+ return this._layoutState;
436
+ }
437
+ buildLayoutTree() {
438
+ const markMap = {}, rootMarks = [];
439
+ this.traverseMarkTree((mark => {
440
+ markMap[mark.id()] = !0, mark.group && markMap[mark.group.id()] || rootMarks.push(mark),
441
+ mark.markType === GrammarMarkType.group && mark.updateLayoutChildren();
442
+ }), (mark => mark.needLayout())), this._layoutMarks = rootMarks;
443
+ }
444
+ doLayout() {
445
+ var _a;
446
+ const doLayout = this._options.doLayout || defaultDoLayout;
447
+ doLayout && (null === (_a = this._layoutMarks) || void 0 === _a ? void 0 : _a.length) && (this.emit(HOOK_EVENT.BEFORE_DO_LAYOUT),
448
+ doLayout(this._layoutMarks, this._options, this), this.emit(HOOK_EVENT.AFTER_DO_LAYOUT));
449
+ }
450
+ handleLayoutEnd() {
451
+ this.emit(HOOK_EVENT.BEFORE_MARK_LAYOUT_END), this._layoutMarks.forEach((layoutMark => {
452
+ traverseMarkTree(layoutMark, "layoutChildren", (mark => {
453
+ mark.handleLayoutEnd();
454
+ }), (mark => mark !== layoutMark));
455
+ })), this.emit(HOOK_EVENT.AFTER_MARK_LAYOUT_END);
456
+ }
457
+ handleRenderEnd() {
458
+ this.emit(HOOK_EVENT.BEFORE_MARK_RENDER_END), traverseMarkTree(this.rootMark, "children", (mark => {
459
+ mark.handleRenderEnd();
460
+ })), this.emit(HOOK_EVENT.AFTER_MARK_RENDER_END);
461
+ }
462
+ commit(grammar) {
463
+ return this._dataflow.commit(grammar), this;
464
+ }
465
+ run(runningConfig) {
466
+ return this.evaluate(runningConfig), this;
467
+ }
468
+ runSync(runningConfig) {
469
+ return this.evaluateSync(runningConfig), this;
470
+ }
471
+ isRunning() {
472
+ return this._running;
473
+ }
474
+ runAsync(runningConfig) {
475
+ return __awaiter(this, void 0, void 0, (function*() {
476
+ for (;this._running; ) yield this._running;
477
+ const clear = () => {
478
+ this._running = null;
479
+ };
480
+ return (this._running = this.evaluate(runningConfig)).then(clear, clear), this._running;
481
+ }));
482
+ }
483
+ runNextTick(runningConfig) {
484
+ return __awaiter(this, void 0, void 0, (function*() {
485
+ return this._currentDataflow || (this._currentDataflow = Promise.resolve().then((() => this.runAsync(runningConfig).then((() => {
486
+ this._currentDataflow = null;
487
+ })).catch((e => {
488
+ this._currentDataflow = null, this.logger.error(e);
489
+ }))))), yield this._currentDataflow, this;
490
+ }));
491
+ }
492
+ doRender(immediately) {
493
+ this.emit(HOOK_EVENT.BEFORE_DO_RENDER), this.renderer && (this._progressiveMarks || this.animate.animate(),
494
+ this.renderer.render(immediately), this.handleRenderEnd()), this.emit(HOOK_EVENT.AFTER_DO_RENDER);
495
+ }
496
+ evaluate(runningConfig) {
497
+ var _a, _b;
498
+ return __awaiter(this, void 0, void 0, (function*() {
499
+ const normalizedRunningConfig = normalizeRunningConfig(runningConfig);
500
+ this.reuseCachedGrammars(normalizedRunningConfig);
501
+ const grammarWillDetach = this._cachedGrammars.size() > 0;
502
+ this.detachCachedGrammar();
503
+ const hasResize = this._resizeRenderer(), hasUpdate = this._dataflow.hasCommitted();
504
+ return grammarWillDetach || hasUpdate || this._layoutState || hasResize ? (this.clearProgressive(),
505
+ yield this._dataflow.evaluate(), this._needBuildLayoutTree && (this.buildLayoutTree(),
506
+ this._needBuildLayoutTree = !1), this._layoutState && (this._layoutState = LayoutState.layouting,
507
+ this.doLayout(), this._dataflow.hasCommitted() && (this._layoutState = LayoutState.reevaluate,
508
+ yield this._dataflow.evaluate()), this._layoutState = LayoutState.after, (null === (_a = this._layoutMarks) || void 0 === _a ? void 0 : _a.length) && this.handleLayoutEnd()),
509
+ this._layoutState = null, this.findProgressiveMarks(), this._resizeRenderer(), this.doRender(!1),
510
+ null === (_b = this._willMorphMarks) || void 0 === _b || _b.forEach((morphMarks => {
511
+ this._morph.morph(morphMarks.prev, morphMarks.next, normalizedRunningConfig);
512
+ })), this._willMorphMarks = null, this.releaseCachedGrammars(normalizedRunningConfig),
513
+ this.doPreProgressive(), this) : this;
514
+ }));
515
+ }
516
+ evaluateSync(runningConfig) {
517
+ var _a, _b;
518
+ const normalizedRunningConfig = normalizeRunningConfig(runningConfig);
519
+ this.reuseCachedGrammars(normalizedRunningConfig);
520
+ const grammarWillDetach = this._cachedGrammars.size() > 0;
521
+ this.detachCachedGrammar();
522
+ const hasResize = this._resizeRenderer(), hasUpdate = this._dataflow.hasCommitted();
523
+ return grammarWillDetach || hasUpdate || this._layoutState || hasResize ? (this.clearProgressive(),
524
+ this._dataflow.evaluateSync(), this._needBuildLayoutTree && (this.buildLayoutTree(),
525
+ this._needBuildLayoutTree = !1), this._layoutState && (this._layoutState = LayoutState.layouting,
526
+ this.doLayout(), this._dataflow.hasCommitted() && (this._layoutState = LayoutState.reevaluate,
527
+ this._dataflow.evaluateSync()), this._layoutState = LayoutState.after, (null === (_a = this._layoutMarks) || void 0 === _a ? void 0 : _a.length) && this.handleLayoutEnd()),
528
+ this._layoutState = null, this.findProgressiveMarks(), this._resizeRenderer(), this.doRender(!0),
529
+ null === (_b = this._willMorphMarks) || void 0 === _b || _b.forEach((morphMarks => {
530
+ this._morph.morph(morphMarks.prev, morphMarks.next, normalizedRunningConfig);
531
+ })), this._willMorphMarks = null, this.releaseCachedGrammars(normalizedRunningConfig),
532
+ this.doPreProgressive(), this) : this;
533
+ }
534
+ reuseCachedGrammars(runningConfig) {
535
+ if (this._willMorphMarks || (this._willMorphMarks = []), runningConfig.reuse) {
536
+ const reuseDiffUpdate = diff => {
537
+ diff.next.reuse(diff.prev), diff.prev.detachAll(), diff.prev.clear(), this._cachedGrammars.unrecord(diff.prev);
538
+ };
539
+ this._morph.diffGrammar(this._cachedGrammars.getAllSignals(), this.grammars.getAllSignals().filter((signal => !BuiltInSignalID.includes(signal.id())))).update.forEach(reuseDiffUpdate);
540
+ this._morph.diffGrammar(this._cachedGrammars.getAllData(), this.grammars.getAllData()).update.forEach(reuseDiffUpdate);
541
+ this._morph.diffGrammar(this._cachedGrammars.getAllScales(), this.grammars.getAllScales()).update.forEach(reuseDiffUpdate);
542
+ this._morph.diffGrammar(this._cachedGrammars.getAllCoordinates(), this.grammars.getAllCoordinates()).update.forEach(reuseDiffUpdate);
543
+ }
544
+ this._morph.diffMark(this._cachedGrammars.getAllMarks(), this.grammars.getAllMarks().filter((mark => "root" !== mark.id())), runningConfig).update.forEach((diff => {
545
+ const matched = 1 === diff.prev.length && 1 === diff.next.length && diff.prev[0].markType === diff.next[0].markType, enableMarkMorphConfig = diff.prev.every((mark => mark.getMorphConfig().morph)) && diff.next.every((mark => mark.getMorphConfig().morph));
546
+ matched && runningConfig.reuse ? (diff.next[0].reuse(diff.prev[0]), diff.prev[0].detachAll(),
547
+ diff.prev[0].clear(), this._cachedGrammars.unrecord(diff.prev[0])) : (runningConfig.morph && enableMarkMorphConfig || runningConfig.morphAll) && this._willMorphMarks.push({
548
+ prev: diff.prev,
549
+ next: diff.next
550
+ });
551
+ }));
552
+ }
553
+ detachCachedGrammar() {
554
+ this._cachedGrammars.traverse((grammar => {
555
+ var _a, _b;
556
+ if (grammar.detachAll(), "mark" === grammar.grammarType) {
557
+ const mark = grammar;
558
+ null === (_b = null === (_a = mark.group) || void 0 === _a ? void 0 : _a.removeChild) || void 0 === _b || _b.call(_a, mark);
559
+ }
560
+ }));
561
+ }
562
+ releaseCachedGrammars(runningConfig) {
563
+ this._cachedGrammars.traverse((grammar => {
564
+ "mark" !== grammar.grammarType && grammar.release();
565
+ }));
566
+ const markNodes = this._cachedGrammars.getAllMarkNodes();
567
+ markNodes.forEach((node => {
568
+ node.mark.animate.stop(), runningConfig.enableExitAnimation && this.animate.animateAddition(node.mark);
569
+ }));
570
+ const releaseUp = node => {
571
+ if (node.mark.view && 0 === node.mark.animate.getAnimatorCount() && (!node.children || 0 === node.children.length)) {
572
+ node.mark.release();
573
+ const parent = node.parent;
574
+ parent && (node.parent.children = node.parent.children.filter((n => n !== node)),
575
+ node.parent = null, releaseUp(parent));
576
+ }
577
+ };
578
+ markNodes.forEach((node => {
579
+ const mark = node.mark;
580
+ 0 === mark.animate.getAnimatorCount() ? releaseUp(node) : mark.addEventListener("animationEnd", (() => {
581
+ 0 === mark.animate.getAnimatorCount() && releaseUp(node);
582
+ }));
583
+ })), this._cachedGrammars.clear();
584
+ }
585
+ runAfter(callback) {
586
+ return this._dataflow.runAfter((() => {
587
+ callback.call(null, this);
588
+ })), this;
589
+ }
590
+ runBefore(callback) {
591
+ return this._dataflow.runBefore((() => {
592
+ callback.call(null, this);
593
+ })), this;
594
+ }
595
+ getImageBuffer() {
596
+ var _a, _b;
597
+ if ("node" !== this._options.mode) return void this.logger.error(new TypeError("getImageBuffer() now only support node environment."));
598
+ const stage = null === (_b = null === (_a = this.renderer) || void 0 === _a ? void 0 : _a.stage) || void 0 === _b ? void 0 : _b.call(_a);
599
+ if (stage) {
600
+ stage.render();
601
+ return stage.window.getImageBuffer();
602
+ }
603
+ return this.logger.error(new ReferenceError("render is not defined")), null;
604
+ }
605
+ traverseMarkTree(apply, filter, leafFirst) {
606
+ return traverseMarkTree(this.rootMark, "children", apply, filter, leafFirst), this;
607
+ }
608
+ _bindResizeEvent() {
609
+ var _a, _b, _c, _d, _e, _f;
610
+ if (this.autoFit()) {
611
+ const container = null === (_e = null === (_d = null === (_c = null === (_b = null === (_a = this.renderer) || void 0 === _a ? void 0 : _a.stage) || void 0 === _b ? void 0 : _b.call(_a)) || void 0 === _c ? void 0 : _c.window) || void 0 === _d ? void 0 : _d.getContainer) || void 0 === _e ? void 0 : _e.call(_d);
612
+ if (container) {
613
+ const ResizeObserverWindow = window.ResizeObserver;
614
+ this._observer = new ResizeObserverWindow(this._onResize), null === (_f = this._observer) || void 0 === _f || _f.observe(container);
615
+ }
616
+ window.addEventListener("resize", this._onResize);
617
+ }
618
+ }
619
+ _unBindResizeEvent() {
620
+ this.autoFit() && (window.removeEventListener("resize", this._onResize), this._observer && (this._observer.disconnect(),
621
+ this._observer = null));
622
+ }
623
+ _getContainerSize() {
624
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
625
+ const container = null === (_e = null === (_d = null === (_c = null === (_b = null === (_a = this.renderer) || void 0 === _a ? void 0 : _a.stage) || void 0 === _b ? void 0 : _b.call(_a)) || void 0 === _c ? void 0 : _c.window) || void 0 === _d ? void 0 : _d.getContainer) || void 0 === _e ? void 0 : _e.call(_d);
626
+ if (container) {
627
+ const {width: containerWidth, height: containerHeight} = getContainerSize(container);
628
+ return {
629
+ width: null !== (_h = null !== (_g = null === (_f = this._spec) || void 0 === _f ? void 0 : _f.width) && void 0 !== _g ? _g : this._options.width) && void 0 !== _h ? _h : containerWidth,
630
+ height: null !== (_l = null !== (_k = null === (_j = this._spec) || void 0 === _j ? void 0 : _j.height) && void 0 !== _k ? _k : this._options.height) && void 0 !== _l ? _l : containerHeight
631
+ };
632
+ }
633
+ return null;
634
+ }
635
+ resize(width, height, render = !0) {
636
+ return __awaiter(this, void 0, void 0, (function*() {
637
+ let needDataflow = !1;
638
+ return width !== this.width() && (needDataflow = !0, this.updateSignal(SIGNAL_WIDTH, width)),
639
+ height !== this.height() && (needDataflow = !0, this.updateSignal(SIGNAL_HEIGHT, height)),
640
+ needDataflow && (render ? yield this.evaluate() : yield this._dataflow.evaluate()),
641
+ this;
642
+ }));
643
+ }
644
+ _resizeRenderer() {
645
+ const width = this.width(), height = this.height();
646
+ return !!this.renderer.shouldResize(width, height) && (this.renderer.resize(width, height),
647
+ this.emit("resize", {}, {
648
+ width: width,
649
+ height: height
650
+ }), !0);
651
+ }
652
+ bindEvents(eventSpec) {
653
+ if (this._eventConfig.disable) return;
654
+ const {type: evtType, filter: filter, callback: callback, throttle: throttle, debounce: debounce, consume: consume, target: target, dependency: dependency} = eventSpec, eventSelector = parseEventSelector(evtType);
655
+ if (!eventSelector) return;
656
+ const {source: source, type: type} = eventSelector, markFilter = generateFilterByMark(eventSelector), validateSignals = (Array.isArray(target) && target.length ? target.map((entry => ({
657
+ signal: this.getSignalById(entry.target),
658
+ callback: entry.callback
659
+ }))) : [ {
660
+ signal: isString(target) ? this.getSignalById(target) : null,
661
+ callback: callback
662
+ } ]).filter((entry => entry.signal || entry.callback)), refs = parseReference(dependency, this), send = parseHandler(((evt, element) => {
663
+ const needPreventDefault = source === EVENT_SOURCE_VIEW && prevent(this._eventConfig, type) || consume && (void 0 === evt.cancelable || evt.cancelable);
664
+ source === EVENT_SOURCE_WINDOW && (evt = getExtendedEvents(this, evt, element, type, EVENT_SOURCE_WINDOW));
665
+ let hasCommitted = !1;
666
+ if ((!filter || filter(evt)) && (!markFilter || markFilter(element)) && validateSignals.length) {
667
+ const params = refs.reduce(((params, ref) => (params[ref.id()] = ref.output(), params)), {});
668
+ validateSignals.forEach((entry => {
669
+ if (entry.callback && entry.signal) {
670
+ entry.signal.set(entry.callback(evt, params)) && (this.commit(entry.signal), hasCommitted = !0);
671
+ } else entry.callback ? entry.callback(evt, params) : (this.commit(entry.signal),
672
+ hasCommitted = !0);
673
+ }));
674
+ }
675
+ needPreventDefault && evt.preventDefault(), consume && evt.stopPropagation(), hasCommitted && this.runAsync();
676
+ }), {
677
+ throttle: throttle,
678
+ debounce: debounce
679
+ });
680
+ if (source === EVENT_SOURCE_VIEW) {
681
+ if (permit(this._eventConfig, EVENT_SOURCE_VIEW, type)) return this.addEventListener(type, send, NO_TRAP),
682
+ () => {
683
+ this.removeEventListener(type, send);
684
+ };
685
+ } else if (source === EVENT_SOURCE_WINDOW) return vglobal.addEventListener(type, send),
686
+ this._eventListeners.push({
687
+ type: type,
688
+ source: vglobal,
689
+ handler: send
690
+ }), () => {
691
+ vglobal.removeEventListener(type, send);
692
+ const index = this._eventListeners.findIndex((entry => entry.type === type && entry.source === vglobal && entry.handler === send));
693
+ index >= 0 && this._eventListeners.splice(index, 1);
694
+ };
695
+ }
696
+ event(eventSpec) {
697
+ if ("between" in eventSpec) {
698
+ const [starEvent, endEvent] = eventSpec.between, id = `${starEvent.type}-${eventSpec.type}-${endEvent.type}`;
699
+ let unbindEndEvent;
700
+ this.bindEvents(Object.assign({}, starEvent, {
701
+ callback: () => {
702
+ if (this._eventCache || (this._eventCache = {}), !this._eventCache[id]) {
703
+ const unbindEvent = this.bindEvents(eventSpec);
704
+ this._eventCache[id] = unbindEvent;
705
+ }
706
+ unbindEndEvent || (unbindEndEvent = this.bindEvents(Object.assign({}, endEvent, {
707
+ callback: () => {
708
+ this._eventCache[id] && (this._eventCache[id](), this._eventCache[id] = null);
709
+ }
710
+ })));
711
+ }
712
+ }));
713
+ } else "merge" in eventSpec ? eventSpec.merge.forEach((entry => {
714
+ const singleEvent = Object.assign({}, eventSpec);
715
+ isString(entry) ? singleEvent.type = entry : isObject(entry) && Object.assign(singleEvent, entry),
716
+ singleEvent.debounce = 50, this.bindEvents(singleEvent);
717
+ })) : this.bindEvents(eventSpec);
718
+ }
719
+ hover(hoverState) {
720
+ const state = hoverState || DEFAULT_HOVER_STATE;
721
+ return this.addEventListener("pointerover", (evt => {
722
+ if (!evt.element) return;
723
+ evt.element.addState(state);
724
+ })), this.addEventListener("pointerout", (evt => {
725
+ if (!evt.element) return;
726
+ evt.element.removeState(state);
727
+ })), this;
728
+ }
729
+ cursor() {
730
+ this._cursorValue = {
731
+ user: CURSOR_DEFAULT,
732
+ element: null
733
+ }, this.addEventListener("mousemove", (evt => {
734
+ var _a, _b, _c;
735
+ const elementCursor = null === (_b = null === (_a = null == evt ? void 0 : evt.element) || void 0 === _a ? void 0 : _a.graphicItem) || void 0 === _b ? void 0 : _b.cursor, value = this._cursorValue, user = value ? isString(value) ? value : value.user : CURSOR_DEFAULT, nextValue = value && user === value.user && (elementCursor === value.element || isNil(elementCursor) && isNil(value.element)) ? value : {
736
+ user: user,
737
+ element: elementCursor
738
+ };
739
+ nextValue !== value && (this._cursorValue = nextValue, this.setCursor(nextValue.user && nextValue.user !== CURSOR_DEFAULT ? nextValue.user : null !== (_c = nextValue.element) && void 0 !== _c ? _c : nextValue.user));
740
+ }));
741
+ }
742
+ initEvent() {
743
+ const stage = this.renderer.stage();
744
+ stage && stage.on("*", this.delegateEvent);
745
+ }
746
+ addEventListener(type, handler, options) {
747
+ let callback = handler;
748
+ return options && !1 === options.trap || (callback = handler, callback.raw = handler),
749
+ options && options.target && (callback.target = options.target), this.on(type, callback),
750
+ this;
751
+ }
752
+ removeEventListener(type, handler) {
753
+ return handler ? this.off(type, handler) : this.off(type), this;
754
+ }
755
+ setCursor(cursor) {
756
+ if (this._options.domBridge && this._options.domBridge.setCursor) return void this._options.domBridge.setCursor(cursor);
757
+ const el = this.globalCursor() ? !isNil(document) && document.body : this.container;
758
+ return el ? isNil(cursor) ? el.style.removeProperty("cursor") : el.style.cursor = cursor : void 0;
759
+ }
760
+ globalCursor(_) {
761
+ if (arguments.length) {
762
+ if (this._globalCursor !== !!_) {
763
+ const prev = this.setCursor(null);
764
+ this._globalCursor = !!_, prev && this.setCursor(prev);
765
+ }
766
+ return this;
767
+ }
768
+ return this._globalCursor;
769
+ }
770
+ initializeRenderer() {
771
+ const width = this._options.width, height = this._options.height;
772
+ this.renderer = new CanvasRenderer(this), this.renderer.initialize(width, height, this._options, this._eventConfig).background(this._background);
773
+ }
774
+ initializeBuiltEvents() {
775
+ this._options.cursor && this.cursor(), this._options.hover && this.hover(), this._bindResizeEvent();
776
+ }
777
+ initialize() {
778
+ var _a;
779
+ this.grammars = new RecordedGrammars((grammar => grammar.id()), ((key, grammar) => this.logger.warn(`Grammar id '${key}' has been occupied`, grammar))),
780
+ this._cachedGrammars = new RecordedTreeGrammars((grammar => grammar.id())), this._options.logger && Logger.setInstance(this._options.logger),
781
+ this.logger = Logger.getInstance(null !== (_a = this._options.logLevel) && void 0 !== _a ? _a : 0),
782
+ this._dataflow = new Dataflow, this.animate = new ViewAnimate(this), this._morph = new Morph,
783
+ this._theme = ThemeManager.getDefaultTheme(), this._options.hooks && (Object.keys(this._options.hooks).forEach((key => {
784
+ this.on(key, this._options.hooks[key]);
785
+ })), this.hooks = this._options.hooks), this.container = null, this.renderer = null,
786
+ this._globalCursor = !1, this._eventListeners = [], this._eventConfig = initializeEventConfig(this._options.eventConfig),
787
+ this.globalCursor(this._eventConfig.globalCursor), this._theme = ThemeManager.getDefaultTheme(),
788
+ this.parseBuiltIn(), configureEnvironment(this._options), this.initializeRenderer(),
789
+ this._eventConfig.disable || this.initEvent(), this.initializeBuiltEvents(), this._currentDataflow = null,
790
+ this._needBuildLayoutTree = !0, this._layoutState = LayoutState.before, this.theme(this._theme);
791
+ }
792
+ normalBrowserEnv() {
793
+ return "browser" === this._options.mode;
794
+ }
795
+ pauseProgressive() {
796
+ return !1;
797
+ }
798
+ resumeProgressive() {
799
+ return !1;
800
+ }
801
+ restartProgressive() {
802
+ return !1;
803
+ }
804
+ findProgressiveMarks() {
805
+ const marks = [];
806
+ return this.traverseMarkTree((mark => {
807
+ marks.push(mark);
808
+ }), (mark => mark.markType !== GrammarMarkType.group && mark.isProgressive())),
809
+ marks.length ? (this._progressiveMarks = marks, this.renderer && this.renderer.combineIncrementalLayers(),
810
+ marks) : (this._progressiveMarks = null, null);
811
+ }
812
+ doPreProgressive() {
813
+ if (this._progressiveMarks && this._progressiveMarks.some((mark => mark.isDoingProgressive()))) {
814
+ const raf = vglobal.getRequestAnimationFrame();
815
+ this._progressiveRafId = raf(this.handleProgressiveFrame);
816
+ }
817
+ }
818
+ clearProgressive() {
819
+ if (this._progressiveRafId) {
820
+ vglobal.getCancelAnimationFrame()(this._progressiveRafId);
821
+ }
822
+ this._progressiveMarks && this._progressiveMarks.length && (this._progressiveMarks.forEach((entry => {
823
+ entry.clearProgressive();
824
+ })), this._progressiveMarks = null);
825
+ }
826
+ release() {
827
+ var _a, _b, _c;
828
+ this._unBindResizeEvent(), this.clearProgressive(), Factory.unregisterRuntimeTransforms(),
829
+ this.animate.stop(), this.grammars.release(), this._cachedGrammars.release(), this._dataflow = null,
830
+ null === (_b = null === (_a = this.renderer) || void 0 === _a ? void 0 : _a.release) || void 0 === _b || _b.call(_a),
831
+ this.renderer = null, this.removeAllListeners(), null === (_c = this._eventListeners) || void 0 === _c || _c.forEach((listener => {
832
+ listener.source.removeEventListener(listener.type, listener.handler);
833
+ })), this._eventListeners = null;
834
+ }
835
+ }
836
+ //# sourceMappingURL=View.js.map