@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,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.createElement = void 0;
6
+
7
+ const enums_1 = require("../enums"), element_1 = require("../element"), glyph_element_1 = require("../glyph-element"), createElement = mark => mark.markType === enums_1.GrammarMarkType.glyph ? new glyph_element_1.GlyphElement(mark) : new element_1.Element(mark);
8
+
9
+ exports.createElement = createElement;
10
+ //# sourceMappingURL=element.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/graph/util/element.ts"],"names":[],"mappings":";;;AACA,oCAA2C;AAC3C,wCAAqC;AACrC,oDAAgD;AAEzC,MAAM,aAAa,GAAG,CAAC,IAAW,EAAY,EAAE;IACrD,IAAI,IAAI,CAAC,QAAQ,KAAK,uBAAe,CAAC,KAAK,EAAE;QAC3C,OAAO,IAAI,4BAAY,CAAC,IAAkB,CAAC,CAAC;KAC7C;IACD,OAAO,IAAI,iBAAO,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC,CAAC;AALW,QAAA,aAAa,iBAKxB","file":"element.js","sourcesContent":["import type { IElement, IGlyphMark, IMark } from '../../types';\nimport { GrammarMarkType } from '../enums';\nimport { Element } from '../element';\nimport { GlyphElement } from '../glyph-element';\n\nexport const createElement = (mark: IMark): IElement => {\n if (mark.markType === GrammarMarkType.glyph) {\n return new GlyphElement(mark as IGlyphMark);\n }\n return new Element(mark);\n};\n"]}
@@ -0,0 +1,2 @@
1
+ import type { IEnvironmentOptions } from '../../types';
2
+ export declare function configureEnvironment(options: IEnvironmentOptions): void;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.configureEnvironment = void 0;
6
+
7
+ const vrender_1 = require("@visactor/vrender");
8
+
9
+ function configureEnvironment(options) {
10
+ options.mode && vrender_1.vglobal.setEnv(options.mode, options.modeParams || {});
11
+ }
12
+
13
+ exports.configureEnvironment = configureEnvironment;
14
+ //# sourceMappingURL=env.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/graph/util/env.ts"],"names":[],"mappings":";;;AAAA,+CAA4C;AAG5C,SAAgB,oBAAoB,CAAC,OAA4B;IAC/D,IAAI,OAAO,CAAC,IAAI,EAAE;QAChB,iBAAO,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC;KACxD;AACH,CAAC;AAJD,oDAIC","file":"env.js","sourcesContent":["import { vglobal } from '@visactor/vrender';\nimport type { IEnvironmentOptions } from '../../types';\n\nexport function configureEnvironment(options: IEnvironmentOptions) {\n if (options.mode) {\n vglobal.setEnv(options.mode, options.modeParams || {});\n }\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import type { FederatedEvent } from '@visactor/vrender';
2
+ import type { IElement } from './../../types/element';
3
+ import type { IView } from './../../types/view';
4
+ import type { EventSourceType } from '../../types';
5
+ export default function getExtendedEvents(view: IView, event: FederatedEvent, item: IElement, type: string, source: EventSourceType): FederatedEvent<Event>;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ });
6
+
7
+ const point_1 = require("./point"), constants_1 = require("../../view/constants");
8
+
9
+ function getExtendedEvents(view, event, item, type, source) {
10
+ if (source === constants_1.EVENT_SOURCE_WINDOW) {
11
+ const e = event.changedTouches ? event.changedTouches[0] : event;
12
+ (0, point_1.point)(e);
13
+ }
14
+ return event.element = item, event.vGrammarType = type, event;
15
+ }
16
+
17
+ exports.default = getExtendedEvents;
18
+ //# sourceMappingURL=events-extend.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/graph/util/events-extend.ts"],"names":[],"mappings":";;AAGA,mCAAgC;AAChC,oDAA2D;AAG3D,SAAwB,iBAAiB,CACvC,IAAW,EACX,KAAqB,EACrB,IAAc,EACd,IAAY,EACZ,MAAuB;IAEvB,IAAI,MAAM,KAAK,+BAAmB,EAAE;QAClC,MAAM,CAAC,GAAI,KAAa,CAAC,cAAc,CAAC,CAAC,CAAE,KAAa,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QACnF,IAAA,aAAK,EAAC,CAAC,CAAC,CAAC;KACV;IAEA,KAAa,CAAC,OAAO,GAAG,IAAI,CAAC;IAC7B,KAAa,CAAC,YAAY,GAAG,IAAI,CAAC;IAEnC,OAAO,KAAK,CAAC;AACf,CAAC;AAhBD,oCAgBC","file":"events-extend.js","sourcesContent":["import type { FederatedEvent } from '@visactor/vrender';\nimport type { IElement } from './../../types/element';\nimport type { IView } from './../../types/view';\nimport { point } from './point';\nimport { EVENT_SOURCE_WINDOW } from '../../view/constants';\nimport type { EventSourceType } from '../../types';\n\nexport default function getExtendedEvents(\n view: IView,\n event: FederatedEvent,\n item: IElement,\n type: string,\n source: EventSourceType\n) {\n if (source === EVENT_SOURCE_WINDOW) {\n const e = (event as any).changedTouches ? (event as any).changedTouches[0] : event;\n point(e);\n }\n\n (event as any).element = item;\n (event as any).vGrammarType = type;\n\n return event;\n}\n"]}
@@ -0,0 +1,9 @@
1
+ import type { IGlyphMeta, IMark } from '../../types';
2
+ import type { IGraphic } from '@visactor/vrender';
3
+ import { LargeRects } from '../mark/large-rects';
4
+ import { LargeSymbols } from '../mark/large-symbols';
5
+ export declare const isMarkType: (type: string) => boolean;
6
+ export declare function createGraphicItem(mark: IMark, markType: string, attrs?: any): IGraphic<Partial<import("@visactor/vrender").IGraphicAttribute>> | LargeRects | LargeSymbols;
7
+ export declare function createGlyphGraphicItem(mark: IMark, glyphMeta: IGlyphMeta, attrs?: any): import("@visactor/vrender").IGlyph<Partial<import("@visactor/vrender").IGraphicAttribute>>;
8
+ export declare const removeGraphicItem: (graphicItem: IGraphic) => void;
9
+ export declare const getMarkTypeOfLarge: (markType: string) => string;
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.getMarkTypeOfLarge = exports.removeGraphicItem = exports.createGlyphGraphicItem = exports.createGraphicItem = exports.isMarkType = void 0;
6
+
7
+ const vrender_1 = require("@visactor/vrender"), enums_1 = require("../enums"), constants_1 = require("../constants"), large_rects_1 = require("../mark/large-rects"), large_symbols_1 = require("../mark/large-symbols"), factory_1 = require("../../core/factory"), itemCreator = {
8
+ circle: vrender_1.createCircle,
9
+ arc: vrender_1.createArc,
10
+ arc3d: vrender_1.createArc3d,
11
+ pyramid3d: vrender_1.createPyramid3d,
12
+ area: vrender_1.createArea,
13
+ group: vrender_1.createGroup,
14
+ image: vrender_1.createImage,
15
+ rect3d: vrender_1.createRect3d,
16
+ line: vrender_1.createLine,
17
+ path: vrender_1.createPath,
18
+ rect: vrender_1.createRect,
19
+ rule: vrender_1.createLine,
20
+ shape: vrender_1.createPath,
21
+ symbol: vrender_1.createSymbol,
22
+ text: vrender_1.createText,
23
+ richtext: vrender_1.createRichText,
24
+ polygon: vrender_1.createPolygon,
25
+ cell: vrender_1.createSymbol,
26
+ interval: vrender_1.createRect
27
+ }, isMarkType = type => !!itemCreator[type];
28
+
29
+ function createGraphicItem(mark, markType, attrs = {}) {
30
+ if (mark.emit(enums_1.HOOK_EVENT.BEFORE_CREATE_VRENDER_MARK), markType === enums_1.GrammarMarkType.largeRects) return new large_rects_1.LargeRects(attrs);
31
+ if (markType === enums_1.GrammarMarkType.largeSymbols) return new large_symbols_1.LargeSymbols(attrs);
32
+ const graphicItem = itemCreator[markType] ? itemCreator[markType](attrs) : factory_1.Factory.createGraphicComponent(markType, attrs);
33
+ return mark.emit(enums_1.HOOK_EVENT.AFTER_CREATE_VRENDER_MARK), graphicItem;
34
+ }
35
+
36
+ function createGlyphGraphicItem(mark, glyphMeta, attrs = {}) {
37
+ mark.emit(enums_1.HOOK_EVENT.BEFORE_CREATE_VRENDER_MARK);
38
+ const graphicItem = (0, vrender_1.createGlyph)(attrs), glyphMarks = glyphMeta.getMarks(), subGraphics = Object.keys(glyphMarks).map((name => {
39
+ const graphic = itemCreator[glyphMarks[name]]();
40
+ return graphic.name = name, graphic;
41
+ }));
42
+ return graphicItem.setSubGraphic(subGraphics), mark.emit(enums_1.HOOK_EVENT.AFTER_CREATE_VRENDER_MARK),
43
+ graphicItem;
44
+ }
45
+
46
+ exports.isMarkType = isMarkType, exports.createGraphicItem = createGraphicItem,
47
+ exports.createGlyphGraphicItem = createGlyphGraphicItem;
48
+
49
+ const removeGraphicItem = graphicItem => {
50
+ graphicItem && (graphicItem[constants_1.BridgeElementKey] = null, graphicItem.release(),
51
+ graphicItem.parent && graphicItem.parent.removeChild(graphicItem));
52
+ };
53
+
54
+ exports.removeGraphicItem = removeGraphicItem;
55
+
56
+ const getMarkTypeOfLarge = markType => markType === enums_1.GrammarMarkType.rect ? enums_1.GrammarMarkType.largeRects : markType === enums_1.GrammarMarkType.symbol ? enums_1.GrammarMarkType.largeSymbols : markType;
57
+
58
+ exports.getMarkTypeOfLarge = getMarkTypeOfLarge;
59
+ //# sourceMappingURL=graphic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/graph/util/graphic.ts"],"names":[],"mappings":";;;AAGA,+CAiB2B;AAC3B,oCAAuD;AACvD,4CAAgD;AAChD,qDAAiD;AACjD,yDAAqD;AACrD,gDAA6C;AAE7C,MAAM,WAAW,GAAG;IAClB,MAAM,EAAE,sBAAY;IACpB,GAAG,EAAE,mBAAS;IACd,KAAK,EAAE,qBAAW;IAClB,SAAS,EAAE,yBAAe;IAC1B,IAAI,EAAE,oBAAU;IAChB,KAAK,EAAE,qBAAW;IAClB,KAAK,EAAE,qBAAW;IAClB,MAAM,EAAE,sBAAY;IACpB,IAAI,EAAE,oBAAU;IAChB,IAAI,EAAE,oBAAU;IAChB,IAAI,EAAE,oBAAU;IAChB,IAAI,EAAE,oBAAU;IAChB,KAAK,EAAE,oBAAU;IACjB,MAAM,EAAE,sBAAY;IACpB,IAAI,EAAE,oBAAU;IAChB,QAAQ,EAAE,wBAAc;IACxB,OAAO,EAAE,uBAAa;IACtB,IAAI,EAAE,sBAAY;IAClB,QAAQ,EAAE,oBAAU;CACrB,CAAC;AAEK,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,EAAE;IACzC,OAAO,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC,CAAC;AAFW,QAAA,UAAU,cAErB;AAEF,SAAgB,iBAAiB,CAAC,IAAW,EAAE,QAAgB,EAAE,QAAa,EAAE;IAC9E,IAAI,CAAC,IAAI,CAAC,kBAAU,CAAC,0BAA0B,CAAC,C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,EAAE,EAAE;IACzD,IAAI,WAAW,EAAE;QACf,WAAW,CAAC,4BAAgB,CAAC,GAAG,IAAI,CAAC;QACrC,WAAW,CAAC,OAAO,EAAE,CAAC;QACtB,IAAI,WAAW,CAAC,MAAM,EAAE;YACtB,WAAW,CAAC,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;SAC7C;KACF;AACH,CAAC,CAAC;AARW,QAAA,iBAAiB,qBAQ5B;AAEK,MAAM,kBAAkB,GAAG,CAAC,QAAgB,EAAE,EAAE;IACrD,IAAI,QAAQ,KAAK,uBAAe,CAAC,IAAI,EAAE;QACrC,OAAO,uBAAe,CAAC,UAAU,CAAC;KACnC;IAED,IAAI,QAAQ,KAAK,uBAAe,CAAC,MAAM,EAAE;QACvC,OAAO,uBAAe,CAAC,YAAY,CAAC;KACrC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAVW,QAAA,kBAAkB,sBAU7B","file":"graphic.js","sourcesContent":["import type { IGlyphMeta, IMark } from '../../types';\nimport type { IGraphic } from '@visactor/vrender';\n// eslint-disable-next-line no-duplicate-imports\nimport {\n createArc,\n createArea,\n createGroup,\n createImage,\n createRect3d,\n createLine,\n createPath,\n createRect,\n createSymbol,\n createRichText,\n createText,\n createPolygon,\n createGlyph,\n createArc3d,\n createPyramid3d,\n createCircle\n} from '@visactor/vrender';\nimport { HOOK_EVENT, GrammarMarkType } from '../enums';\nimport { BridgeElementKey } from '../constants';\nimport { LargeRects } from '../mark/large-rects';\nimport { LargeSymbols } from '../mark/large-symbols';\nimport { Factory } from '../../core/factory';\n\nconst itemCreator = {\n circle: createCircle,\n arc: createArc,\n arc3d: createArc3d,\n pyramid3d: createPyramid3d,\n area: createArea,\n group: createGroup,\n image: createImage,\n rect3d: createRect3d,\n line: createLine,\n path: createPath,\n rect: createRect,\n rule: createLine,\n shape: createPath,\n symbol: createSymbol,\n text: createText,\n richtext: createRichText,\n polygon: createPolygon,\n cell: createSymbol,\n interval: createRect\n};\n\nexport const isMarkType = (type: string) => {\n return !!itemCreator[type];\n};\n\nexport function createGraphicItem(mark: IMark, markType: string, attrs: any = {}) {\n mark.emit(HOOK_EVENT.BEFORE_CREATE_VRENDER_MARK);\n\n if (markType === GrammarMarkType.largeRects) {\n return new LargeRects(attrs);\n } else if (markType === GrammarMarkType.largeSymbols) {\n return new LargeSymbols(attrs);\n }\n\n const graphicItem: IGraphic = itemCreator[markType]\n ? itemCreator[markType](attrs)\n : Factory.createGraphicComponent(markType, attrs);\n\n mark.emit(HOOK_EVENT.AFTER_CREATE_VRENDER_MARK);\n return graphicItem;\n}\n\nexport function createGlyphGraphicItem(mark: IMark, glyphMeta: IGlyphMeta, attrs: any = {}) {\n mark.emit(HOOK_EVENT.BEFORE_CREATE_VRENDER_MARK);\n\n const graphicItem = createGlyph(attrs);\n const glyphMarks = glyphMeta.getMarks();\n const subGraphics: IGraphic[] = Object.keys(glyphMarks).map(name => {\n const graphic = itemCreator[glyphMarks[name]]();\n graphic.name = name;\n return graphic;\n });\n graphicItem.setSubGraphic(subGraphics);\n\n mark.emit(HOOK_EVENT.AFTER_CREATE_VRENDER_MARK);\n return graphicItem;\n}\n\nexport const removeGraphicItem = (graphicItem: IGraphic) => {\n if (graphicItem) {\n graphicItem[BridgeElementKey] = null;\n graphicItem.release();\n if (graphicItem.parent) {\n graphicItem.parent.removeChild(graphicItem);\n }\n }\n};\n\nexport const getMarkTypeOfLarge = (markType: string) => {\n if (markType === GrammarMarkType.rect) {\n return GrammarMarkType.largeRects;\n }\n\n if (markType === GrammarMarkType.symbol) {\n return GrammarMarkType.largeSymbols;\n }\n\n return markType;\n};\n"]}
@@ -0,0 +1 @@
1
+ export declare function point(event: Event): number[];
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.point = void 0;
6
+
7
+ const vutils_1 = require("@visactor/vutils");
8
+
9
+ function point(event) {
10
+ [ "touches", "changedTouches", "targetTouches" ].forEach((touchKey => {
11
+ event[touchKey] && event[touchKey].length && Array.from(event[touchKey]).forEach((touch => {
12
+ defineSrPosition(touch, clientToLocal(touch), !1);
13
+ }));
14
+ }));
15
+ const pos = clientToLocal(event);
16
+ return defineSrPosition(event, pos);
17
+ }
18
+
19
+ function clientToLocal(e) {
20
+ return (0, vutils_1.isNil)(e.offsetX) ? (0, vutils_1.isNil)(e.x) ? e.changedTouches && e.changedTouches.length ? getChangedTouchesPos(e) : {
21
+ canvasX: 0,
22
+ canvasY: 0
23
+ } : getXYPos(e) : getOffsetPos(e);
24
+ }
25
+
26
+ function getOffsetPos(e) {
27
+ return {
28
+ canvasX: e.offsetX,
29
+ canvasY: e.offsetY
30
+ };
31
+ }
32
+
33
+ function getBoundingClientRectPos(e, el) {
34
+ const result = {
35
+ canvasX: 0,
36
+ canvasY: 0
37
+ }, rect = el.getBoundingClientRect(), currentWidth = rect.width, widthRatio = currentWidth / (el.offsetWidth || currentWidth), currentHeight = rect.height, heightRatio = currentHeight / (el.offsetHeight || currentHeight);
38
+ return [ "touchstart", "touchmove", "touchend" ].includes(e.type) && e.changedTouches && e.changedTouches.length ? (result.canvasX = (e.changedTouches[0].clientX - rect.left - (el.clientLeft || 0)) / widthRatio,
39
+ result.canvasY = (e.changedTouches[0].clientY - rect.top - (el.clientTop || 0)) / heightRatio,
40
+ result.clientX = e.changedTouches[0].clientX, result.clientY = e.changedTouches[0].clientY) : (result.canvasX = (e.clientX - rect.left - (el.clientLeft || 0)) / widthRatio,
41
+ result.canvasY = (e.clientY - rect.top - (el.clientTop || 0)) / heightRatio), result;
42
+ }
43
+
44
+ function getXYPos(e) {
45
+ return {
46
+ canvasX: e.x,
47
+ canvasY: e.y
48
+ };
49
+ }
50
+
51
+ function getChangedTouchesPos(e) {
52
+ return {
53
+ canvasX: e.changedTouches[0].x,
54
+ canvasY: e.changedTouches[0].y
55
+ };
56
+ }
57
+
58
+ function defineSrPosition(event, pos, client = !0) {
59
+ return (0, vutils_1.isValidNumber)(pos.canvasX) && Object.defineProperty(event, "canvasX", {
60
+ value: pos.canvasX,
61
+ writable: !0
62
+ }), (0, vutils_1.isValidNumber)(pos.canvasY) && Object.defineProperty(event, "canvasY", {
63
+ value: pos.canvasY,
64
+ writable: !0
65
+ }), client && (0, vutils_1.isValidNumber)(pos.clientX) && Object.defineProperty(event, "clientX", {
66
+ value: pos.clientX,
67
+ writable: !0
68
+ }), client && (0, vutils_1.isValidNumber)(pos.clientY) && Object.defineProperty(event, "clientY", {
69
+ value: pos.clientY,
70
+ writable: !0
71
+ }), [ pos.canvasX, pos.canvasY ];
72
+ }
73
+
74
+ exports.point = point;
75
+ //# sourceMappingURL=point.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/graph/util/point.ts"],"names":[],"mappings":";;;AAAA,6CAAwD;AASxD,SAAgB,KAAK,CAAC,KAAY;IAChC,CAAC,SAAS,EAAE,gBAAgB,EAAE,eAAe,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;QAChE,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE;YAC7C,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;gBAC1C,MAAM,aAAa,GAAG,aAAa,CAAC,KAAc,CAAC,CAAC;gBACpD,gBAAgB,CAAC,KAAK,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC;YAChD,CAAC,CAAC,CAAC;SACJ;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,GAAG,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IACjC,OAAO,gBAAgB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AACtC,CAAC;AAZD,sBAYC;AAED,SAAS,aAAa,CAAC,CAAQ;IAE7B,IAAI,CAAC,IAAA,cAAK,EAAE,CAAS,CAAC,OAAO,CAAC,EAAE;QAC9B,OAAO,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,sBAAa,EAAC,GAAG,CAAC,OAAO,CAAC;QACxB,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,SAAS,EAAE;YACtC,KAAK,EAAE,GAAG,CAAC,OAAO;YAClB,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC;IACL,IAAA,sBAAa,EAAC,GAAG,CAAC,OAAO,CAAC;QACxB,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,SAAS,EAAE;YACtC,KAAK,EAAE,GAAG,CAAC,OAAO;YAClB,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC;IACL,MAAM;QACJ,IAAA,sBAAa,EAAC,GAAG,CAAC,OAAO,CAAC;QAC1B,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,SAAS,EAAE;YACtC,KAAK,EAAE,GAAG,CAAC,OAAO;YAClB,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC;IACL,MAAM;QACJ,IAAA,sBAAa,EAAC,GAAG,CAAC,OAAO,CAAC;QAC1B,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,SAAS,EAAE;YACtC,KAAK,EAAE,GAAG,CAAC,OAAO;YAClB,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC;IACL,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;AACpC,CAAC","file":"point.js","sourcesContent":["import { isValidNumber, isNil } from '@visactor/vutils';\n\ninterface EventPosition {\n canvasX: number;\n canvasY: number;\n clientX?: number;\n clientY?: number;\n}\n\nexport function point(event: Event) {\n ['touches', 'changedTouches', 'targetTouches'].forEach(touchKey => {\n if (event[touchKey] && event[touchKey].length) {\n Array.from(event[touchKey]).forEach(touch => {\n const touchPosition = clientToLocal(touch as Event);\n defineSrPosition(touch, touchPosition, false);\n });\n }\n });\n\n const pos = clientToLocal(event);\n return defineSrPosition(event, pos);\n}\n\nfunction clientToLocal(e: Event): EventPosition {\n // For IE6+, chrome, safari, opera. (When will ff support offsetX?)\n if (!isNil((e as any).offsetX)) {\n return getOffsetPos(e);\n }\n\n // if (el && el.getBoundingClientRect) {\n // return getBoundingClientRectPos(e, el);\n // }\n\n // for miniApp\n if (!isNil((e as any).x)) {\n return getXYPos(e);\n }\n\n // for miniApp\n if ((e as any).changedTouches && (e as any).changedTouches.length) {\n return getChangedTouchesPos(e);\n }\n\n // For some other device, e.g., IOS safari.\n return {\n canvasX: 0,\n canvasY: 0\n };\n}\n\nfunction getOffsetPos(e: any) {\n return {\n canvasX: e.offsetX,\n canvasY: e.offsetY\n };\n}\n\nfunction getBoundingClientRectPos(e: any, el: HTMLElement) {\n const result: EventPosition = { canvasX: 0, canvasY: 0 };\n const rect = el.getBoundingClientRect();\n const currentWidth = rect.width;\n const originWidth = el.offsetWidth || currentWidth;\n const widthRatio = currentWidth / originWidth;\n const currentHeight = rect.height;\n const originHeight = el.offsetHeight || currentHeight;\n const heightRatio = currentHeight / originHeight;\n if (['touchstart', 'touchmove', 'touchend'].includes(e.type) && e.changedTouches && e.changedTouches.length) {\n result.canvasX = (e.changedTouches[0].clientX - rect.left - (el.clientLeft || 0)) / widthRatio;\n result.canvasY = (e.changedTouches[0].clientY - rect.top - (el.clientTop || 0)) / heightRatio;\n result.clientX = e.changedTouches[0].clientX;\n result.clientY = e.changedTouches[0].clientY;\n } else {\n result.canvasX = (e.clientX - rect.left - (el.clientLeft || 0)) / widthRatio;\n result.canvasY = (e.clientY - rect.top - (el.clientTop || 0)) / heightRatio;\n }\n return result;\n}\n\nfunction getXYPos(e: any) {\n return { canvasX: e.x, canvasY: e.y };\n}\n\nfunction getChangedTouchesPos(e: any) {\n return { canvasX: e.changedTouches[0].x, canvasY: e.changedTouches[0].y };\n}\n\nfunction defineSrPosition(event: any, pos: EventPosition, client = true) {\n isValidNumber(pos.canvasX) &&\n Object.defineProperty(event, 'canvasX', {\n value: pos.canvasX,\n writable: true\n });\n isValidNumber(pos.canvasY) &&\n Object.defineProperty(event, 'canvasY', {\n value: pos.canvasY,\n writable: true\n });\n client &&\n isValidNumber(pos.clientX) &&\n Object.defineProperty(event, 'clientX', {\n value: pos.clientX,\n writable: true\n });\n client &&\n isValidNumber(pos.clientY) &&\n Object.defineProperty(event, 'clientY', {\n value: pos.clientY,\n writable: true\n });\n return [pos.canvasX, pos.canvasY];\n}\n"]}
package/cjs/index.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ export declare const version = "0.7.0";
2
+ export * from './graph';
3
+ export { View } from './view';
4
+ export { parseFunctionType, invokeFunctionType } from './parse/util';
5
+ export { GrammarBase } from './view/grammar-base';
6
+ export * from './util/text';
7
+ export * from './types';
8
+ export { Factory } from './core/factory';
9
+ export { SIGNAL_AUTOFIT, SIGNAL_HEIGHT, SIGNAL_PADDING, SIGNAL_VIEW_HEIGHT, SIGNAL_VIEW_WIDTH, SIGNAL_WIDTH, SIGNAL_VIEW_BOX } from './view/constants';
10
+ export { ThemeManager } from './theme/theme-manager';
11
+ export * from './glyph';
12
+ export * from './component';
13
+ export * from './transforms';
14
+ export * from './graph/animation/animation';
package/cjs/index.js ADDED
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+
3
+ var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
4
+ void 0 === k2 && (k2 = k);
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ desc && !("get" in desc ? !m.__esModule : desc.writable || desc.configurable) || (desc = {
7
+ enumerable: !0,
8
+ get: function() {
9
+ return m[k];
10
+ }
11
+ }), Object.defineProperty(o, k2, desc);
12
+ } : function(o, m, k, k2) {
13
+ void 0 === k2 && (k2 = k), o[k2] = m[k];
14
+ }), __exportStar = this && this.__exportStar || function(m, exports) {
15
+ for (var p in m) "default" === p || Object.prototype.hasOwnProperty.call(exports, p) || __createBinding(exports, m, p);
16
+ };
17
+
18
+ Object.defineProperty(exports, "__esModule", {
19
+ value: !0
20
+ }), exports.ThemeManager = exports.SIGNAL_VIEW_BOX = exports.SIGNAL_WIDTH = exports.SIGNAL_VIEW_WIDTH = exports.SIGNAL_VIEW_HEIGHT = exports.SIGNAL_PADDING = exports.SIGNAL_HEIGHT = exports.SIGNAL_AUTOFIT = exports.Factory = exports.GrammarBase = exports.invokeFunctionType = exports.parseFunctionType = exports.View = exports.version = void 0,
21
+ exports.version = "0.7.0", __exportStar(require("./graph"), exports);
22
+
23
+ var view_1 = require("./view");
24
+
25
+ Object.defineProperty(exports, "View", {
26
+ enumerable: !0,
27
+ get: function() {
28
+ return view_1.View;
29
+ }
30
+ });
31
+
32
+ var util_1 = require("./parse/util");
33
+
34
+ Object.defineProperty(exports, "parseFunctionType", {
35
+ enumerable: !0,
36
+ get: function() {
37
+ return util_1.parseFunctionType;
38
+ }
39
+ }), Object.defineProperty(exports, "invokeFunctionType", {
40
+ enumerable: !0,
41
+ get: function() {
42
+ return util_1.invokeFunctionType;
43
+ }
44
+ });
45
+
46
+ var grammar_base_1 = require("./view/grammar-base");
47
+
48
+ Object.defineProperty(exports, "GrammarBase", {
49
+ enumerable: !0,
50
+ get: function() {
51
+ return grammar_base_1.GrammarBase;
52
+ }
53
+ }), __exportStar(require("./util/text"), exports), __exportStar(require("./types"), exports);
54
+
55
+ var factory_1 = require("./core/factory");
56
+
57
+ Object.defineProperty(exports, "Factory", {
58
+ enumerable: !0,
59
+ get: function() {
60
+ return factory_1.Factory;
61
+ }
62
+ });
63
+
64
+ var constants_1 = require("./view/constants");
65
+
66
+ Object.defineProperty(exports, "SIGNAL_AUTOFIT", {
67
+ enumerable: !0,
68
+ get: function() {
69
+ return constants_1.SIGNAL_AUTOFIT;
70
+ }
71
+ }), Object.defineProperty(exports, "SIGNAL_HEIGHT", {
72
+ enumerable: !0,
73
+ get: function() {
74
+ return constants_1.SIGNAL_HEIGHT;
75
+ }
76
+ }), Object.defineProperty(exports, "SIGNAL_PADDING", {
77
+ enumerable: !0,
78
+ get: function() {
79
+ return constants_1.SIGNAL_PADDING;
80
+ }
81
+ }), Object.defineProperty(exports, "SIGNAL_VIEW_HEIGHT", {
82
+ enumerable: !0,
83
+ get: function() {
84
+ return constants_1.SIGNAL_VIEW_HEIGHT;
85
+ }
86
+ }), Object.defineProperty(exports, "SIGNAL_VIEW_WIDTH", {
87
+ enumerable: !0,
88
+ get: function() {
89
+ return constants_1.SIGNAL_VIEW_WIDTH;
90
+ }
91
+ }), Object.defineProperty(exports, "SIGNAL_WIDTH", {
92
+ enumerable: !0,
93
+ get: function() {
94
+ return constants_1.SIGNAL_WIDTH;
95
+ }
96
+ }), Object.defineProperty(exports, "SIGNAL_VIEW_BOX", {
97
+ enumerable: !0,
98
+ get: function() {
99
+ return constants_1.SIGNAL_VIEW_BOX;
100
+ }
101
+ });
102
+
103
+ var theme_manager_1 = require("./theme/theme-manager");
104
+
105
+ Object.defineProperty(exports, "ThemeManager", {
106
+ enumerable: !0,
107
+ get: function() {
108
+ return theme_manager_1.ThemeManager;
109
+ }
110
+ }), __exportStar(require("./glyph"), exports), __exportStar(require("./component"), exports),
111
+ __exportStar(require("./transforms"), exports), __exportStar(require("./graph/animation/animation"), exports);
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACa,QAAA,OAAO,GAAG,OAAO,CAAC;AAE/B,0CAAwB;AAExB,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,qCAAqE;AAA5D,yGAAA,iBAAiB,OAAA;AAAE,0GAAA,kBAAkB,OAAA;AAC9C,oDAAkD;AAAzC,2GAAA,WAAW,OAAA;AACpB,8CAA4B;AAC5B,0CAAwB;AACxB,0CAAyC;AAAhC,kGAAA,OAAO,OAAA;AAChB,8CAQ0B;AAPxB,2GAAA,cAAc,OAAA;AACd,0GAAA,aAAa,OAAA;AACb,2GAAA,cAAc,OAAA;AACd,+GAAA,kBAAkB,OAAA;AAClB,8GAAA,iBAAiB,OAAA;AACjB,yGAAA,YAAY,OAAA;AACZ,4GAAA,eAAe,OAAA;AAGjB,uDAAqD;AAA5C,6GAAA,YAAY,OAAA;AAErB,0CAAwB;AACxB,8CAA4B;AAC5B,+CAA6B;AAC7B,8DAA4C","file":"index.js","sourcesContent":["// -- Exports -----\nexport const version = \"0.7.0\";\n\nexport * from './graph';\n\nexport { View } from './view';\nexport { parseFunctionType, invokeFunctionType } from './parse/util';\nexport { GrammarBase } from './view/grammar-base';\nexport * from './util/text';\nexport * from './types';\nexport { Factory } from './core/factory';\nexport {\n SIGNAL_AUTOFIT,\n SIGNAL_HEIGHT,\n SIGNAL_PADDING,\n SIGNAL_VIEW_HEIGHT,\n SIGNAL_VIEW_WIDTH,\n SIGNAL_WIDTH,\n SIGNAL_VIEW_BOX\n} from './view/constants';\n\nexport { ThemeManager } from './theme/theme-manager';\n\nexport * from './glyph';\nexport * from './component';\nexport * from './transforms';\nexport * from './graph/animation/animation';\n"]}
@@ -0,0 +1,7 @@
1
+ import type { CoordinateType, IPolarCoordinate, ICartesianCoordinate } from '@visactor/vgrammar-coordinate';
2
+ import { CartesianCoordinate, PolarCoordinate } from '@visactor/vgrammar-coordinate';
3
+ import type { IGrammarBase, IView } from '../types';
4
+ import type { CoordinateSpec } from '../types/coordinate';
5
+ export declare function createCoordinate(type: CoordinateType): CartesianCoordinate | PolarCoordinate;
6
+ export declare function parseCoordinate(spec: CoordinateSpec, view: IView): IGrammarBase[];
7
+ export declare function configureCoordinate(spec: CoordinateSpec, coordinate: IPolarCoordinate | ICartesianCoordinate, parameters: any): void;
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.configureCoordinate = exports.parseCoordinate = exports.createCoordinate = void 0;
6
+
7
+ const vutils_1 = require("@visactor/vutils"), vgrammar_coordinate_1 = require("@visactor/vgrammar-coordinate"), util_1 = require("./util");
8
+
9
+ function createCoordinate(type) {
10
+ switch (type) {
11
+ case "cartesian":
12
+ default:
13
+ return new vgrammar_coordinate_1.CartesianCoordinate;
14
+
15
+ case "polar":
16
+ return new vgrammar_coordinate_1.PolarCoordinate;
17
+ }
18
+ }
19
+
20
+ function parseCoordinate(spec, view) {
21
+ let dependencies = [];
22
+ return [ "start", "end", "origin", "translate", "rotate", "scale", "transpose" ].forEach((key => {
23
+ dependencies = dependencies.concat((0, util_1.parseFunctionType)(spec[key], view));
24
+ })), dependencies;
25
+ }
26
+
27
+ function configureCoordinate(spec, coordinate, parameters) {
28
+ var _a, _b, _c, _d, _e, _f, _g;
29
+ !(0, vutils_1.isNil)(spec.start) && coordinate.start(null !== (_a = (0, util_1.invokeFunctionType)(spec.start, parameters)) && void 0 !== _a ? _a : [ 0, 0 ]),
30
+ !(0, vutils_1.isNil)(spec.end) && coordinate.end(null !== (_b = (0, util_1.invokeFunctionType)(spec.end, parameters)) && void 0 !== _b ? _b : [ 0, 0 ]),
31
+ !(0, vutils_1.isNil)(spec.origin) && coordinate.origin(null !== (_c = (0, util_1.invokeFunctionType)(spec.origin, parameters)) && void 0 !== _c ? _c : [ 0, 0 ]);
32
+ const transforms = [];
33
+ if (!(0, vutils_1.isNil)(spec.translate)) {
34
+ const translate = (0, util_1.invokeFunctionType)(spec.translate, parameters);
35
+ transforms.push({
36
+ type: "translate",
37
+ offset: {
38
+ x: null !== (_d = null == translate ? void 0 : translate[0]) && void 0 !== _d ? _d : 0,
39
+ y: null !== (_e = null == translate ? void 0 : translate[1]) && void 0 !== _e ? _e : 0
40
+ }
41
+ });
42
+ }
43
+ if (!(0, vutils_1.isNil)(spec.rotate)) {
44
+ const rotate = (0, util_1.invokeFunctionType)(spec.rotate, parameters);
45
+ transforms.push({
46
+ type: "rotate",
47
+ angle: null != rotate ? rotate : 0
48
+ });
49
+ }
50
+ if (!(0, vutils_1.isNil)(spec.scale)) {
51
+ const scale = (0, util_1.invokeFunctionType)(spec.scale, parameters);
52
+ transforms.push({
53
+ type: "scale",
54
+ scale: {
55
+ x: null !== (_f = null == scale ? void 0 : scale[0]) && void 0 !== _f ? _f : 1,
56
+ y: null !== (_g = null == scale ? void 0 : scale[1]) && void 0 !== _g ? _g : 1
57
+ }
58
+ });
59
+ }
60
+ if (!(0, vutils_1.isNil)(spec.transpose)) {
61
+ (0, util_1.invokeFunctionType)(spec.transpose, parameters) && transforms.push({
62
+ type: "transpose"
63
+ });
64
+ }
65
+ coordinate.applyTransforms(transforms);
66
+ }
67
+
68
+ exports.createCoordinate = createCoordinate, exports.parseCoordinate = parseCoordinate,
69
+ exports.configureCoordinate = configureCoordinate;
70
+ //# sourceMappingURL=coordinate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/parse/coordinate.ts"],"names":[],"mappings":";;;AAAA,6CAAyC;AAQzC,uEAAqF;AAGrF,iCAA+D;AAE/D,SAAgB,gBAAgB,CAAC,IAAoB;IACnD,QAAQ,IAAI,EAAE;QACZ,KAAK,WAAW;YACd,OAAO,IAAI,yCAAmB,EAAE,CAAC;QACnC,KAAK,OAAO;YACV,OAAO,IAAI,qCAAe,EAAE,CAAC;QAC/B;YACE,OAAO,IAAI,yCAAmB,EAAE,CAAC;KACpC;AACH,CAAC;AATD,4CASC;AAED,SAAgB,eAAe,CAAC,IAAoB,EAAE,IAAW;IAC/D,MAAM,UAAU,GAAG,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;IAC3F,IAAI,YAAY,GAAmB,EAAE,CAAC;IACtC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QACvB,YAAY,GAAG,YAAY,CAAC,MAAM,CAAC,IAAA,wBAAiB,EAAC,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;IACzE,CAAC,CAAC,CAAC;IACH,OAAO,YAAY,CAAC;AACtB,CAAC;AAPD,0CAOC;AAED,SAAgB,mBAAmB,CACjC,IAAoB,EACpB,UAAmD,EACnD,UAAe;;IAEf,CAAC,IAAA,cAAK,EAAC,IAAI,CAAC,KAAK,CAAC;QACf,UAAmC,CAAC,KAAK,CAAC,MAAA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,CAAC,EAAE,CAAC,CAAC;KACzD;IACD,IAAI,CAAC,IAAA,cAAK,EAAC,IAAI,CAAC,KAAK,CAAC,EAAE;QACtB,MAAM,KAAK,GAAG,IAAA,yBAAkB,EAAC,IAAI,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;QACzD,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,EAAE,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAG,CAAC,CAAC,mCAAI,CAAC,EAAE,CAAC,EAAE,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAG,CAAC,CAAC,mCAAI,CAAC,EAAE,EAAE,CAAC,CAAC;KACvF;IACD,IAAI,CAAC,IAAA,cAAK,EAAC,IAAI,CAAC,SAAS,CAAC,EAAE;QAC1B,MAAM,SAAS,GAAG,IAAA,yBAAkB,EAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;QACjE,IAAI,SAAS,EAAE;YACb,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;SACxC;KACF;IACD,UAAU,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;AACzC,CAAC;AA9BD,kDA8BC","file":"coordinate.js","sourcesContent":["import { isNil } from '@visactor/vutils';\nimport type {\n CoordinateType,\n CoordinateTransform,\n IPolarCoordinate,\n ICartesianCoordinate\n} from '@visactor/vgrammar-coordinate';\n// eslint-disable-next-line no-duplicate-imports\nimport { CartesianCoordinate, PolarCoordinate } from '@visactor/vgrammar-coordinate';\nimport type { IGrammarBase, IView } from '../types';\nimport type { CoordinateSpec } from '../types/coordinate';\nimport { invokeFunctionType, parseFunctionType } from './util';\n\nexport function createCoordinate(type: CoordinateType) {\n switch (type) {\n case 'cartesian':\n return new CartesianCoordinate();\n case 'polar':\n return new PolarCoordinate();\n default:\n return new CartesianCoordinate();\n }\n}\n\nexport function parseCoordinate(spec: CoordinateSpec, view: IView) {\n const parsedKeys = ['start', 'end', 'origin', 'translate', 'rotate', 'scale', 'transpose'];\n let dependencies: IGrammarBase[] = [];\n parsedKeys.forEach(key => {\n dependencies = dependencies.concat(parseFunctionType(spec[key], view));\n });\n return dependencies;\n}\n\nexport function configureCoordinate(\n spec: CoordinateSpec,\n coordinate: IPolarCoordinate | ICartesianCoordinate,\n parameters: any\n) {\n !isNil(spec.start) &&\n (coordinate as ICartesianCoordinate).start(invokeFunctionType(spec.start, parameters) ?? [0, 0]);\n !isNil(spec.end) && (coordinate as ICartesianCoordinate).end(invokeFunctionType(spec.end, parameters) ?? [0, 0]);\n !isNil(spec.origin) && (coordinate as IPolarCoordinate).origin(invokeFunctionType(spec.origin, parameters) ?? [0, 0]);\n\n const transforms: CoordinateTransform[] = [];\n if (!isNil(spec.translate)) {\n const translate = invokeFunctionType(spec.translate, parameters);\n transforms.push({ type: 'translate', offset: { x: translate?.[0] ?? 0, y: translate?.[1] ?? 0 } });\n }\n if (!isNil(spec.rotate)) {\n const rotate = invokeFunctionType(spec.rotate, parameters);\n transforms.push({ type: 'rotate', angle: rotate ?? 0 });\n }\n if (!isNil(spec.scale)) {\n const scale = invokeFunctionType(spec.scale, parameters);\n transforms.push({ type: 'scale', scale: { x: scale?.[0] ?? 1, y: scale?.[1] ?? 1 } });\n }\n if (!isNil(spec.transpose)) {\n const transpose = invokeFunctionType(spec.transpose, parameters);\n if (transpose) {\n transforms.push({ type: 'transpose' });\n }\n }\n coordinate.applyTransforms(transforms);\n}\n"]}
@@ -0,0 +1,8 @@
1
+ import { debounce, throttle } from '@visactor/vutils';
2
+ import type { EventSourceType, ParsedViewEventSpec, ParsedWindowEventSpec, EventCallback, IElement } from '../types';
3
+ export declare const generateFilterByMark: (evtSpec: Partial<ParsedViewEventSpec | ParsedWindowEventSpec>) => (el: IElement) => boolean;
4
+ export declare const parseHandler: (callback: EventCallback, config: {
5
+ debounce?: number;
6
+ throttle?: number;
7
+ }) => (...args: any[]) => any;
8
+ export declare const parseEventSelector: (selector: string, source?: EventSourceType) => Partial<ParsedViewEventSpec | ParsedWindowEventSpec>;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.parseEventSelector = exports.parseHandler = exports.generateFilterByMark = void 0;
6
+
7
+ const vutils_1 = require("@visactor/vutils"), graphic_1 = require("../graph/util/graphic"), constants_1 = require("../view/constants"), generateFilterByMark = evtSpec => (0,
8
+ vutils_1.isNil)(evtSpec.markId) ? el => el && el.mark.id() === evtSpec.markId : (0,
9
+ vutils_1.isNil)(evtSpec.markName) ? el => el && el.mark.name() === evtSpec.markName : (0,
10
+ vutils_1.isNil)(evtSpec.type) ? el => el && el.mark.markType === evtSpec.type : () => !0;
11
+
12
+ exports.generateFilterByMark = generateFilterByMark;
13
+
14
+ const parseHandler = (callback, config) => (null == config ? void 0 : config.debounce) ? (0,
15
+ vutils_1.debounce)(callback, config.debounce) : (null == config ? void 0 : config.throttle) ? (0,
16
+ vutils_1.throttle)(callback, config.throttle) : callback;
17
+
18
+ exports.parseHandler = parseHandler;
19
+
20
+ const JOIN_SYMBOL = ":", NAME_PREFIX = "@", ID_PREFIX = "#", parseEventSelector = (selector, source = constants_1.EVENT_SOURCE_VIEW) => {
21
+ const spec = {}, splitArr = selector.split(":");
22
+ if (2 === splitArr.length) {
23
+ const [space, eventType] = splitArr;
24
+ "#" === space[0] ? (spec.markId = space.slice(1), spec.source = source) : "@" === space[0] ? (spec.markName = space.slice(1),
25
+ spec.source = source) : (0, graphic_1.isMarkType)(space) ? (spec.markType = space,
26
+ spec.source = source) : space === constants_1.EVENT_SOURCE_WINDOW ? spec.source = constants_1.EVENT_SOURCE_WINDOW : spec.source = source,
27
+ spec.type = eventType;
28
+ } else 1 === splitArr.length && (spec.type = selector, spec.source = source);
29
+ return spec;
30
+ };
31
+
32
+ exports.parseEventSelector = parseEventSelector;
33
+ //# sourceMappingURL=event.js.map
@@ -0,0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,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;KACtB;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAnCW,QAAA,kBAAkB,sBAmC7B","file":"event.js","sourcesContent":["import { debounce, isNil, throttle } from '@visactor/vutils';\nimport type {\n EventSourceType,\n ParsedViewEventSpec,\n ParsedWindowEventSpec,\n EventCallback,\n MarkType,\n IElement\n} from '../types';\nimport { isMarkType } from '../graph/util/graphic';\nimport { EVENT_SOURCE_VIEW, EVENT_SOURCE_WINDOW } from '../view/constants';\n\nexport const generateFilterByMark = (evtSpec: Partial<ParsedViewEventSpec | ParsedWindowEventSpec>) => {\n if (isNil(evtSpec.markId)) {\n return (el: IElement) => {\n return el && el.mark.id() === evtSpec.markId;\n };\n }\n\n if (isNil(evtSpec.markName)) {\n return (el: IElement) => {\n return el && el.mark.name() === evtSpec.markName;\n };\n }\n\n if (isNil(evtSpec.type)) {\n return (el: IElement) => {\n return el && el.mark.markType === evtSpec.type;\n };\n }\n\n return () => true;\n};\n\nexport const parseHandler = (callback: EventCallback, config: { debounce?: number; throttle?: number }) => {\n if (config?.debounce) {\n return debounce(callback, config.debounce);\n }\n\n if (config?.throttle) {\n return throttle(callback, config.throttle);\n }\n\n return callback;\n};\n\nconst JOIN_SYMBOL = ':';\nconst NAME_PREFIX = '@';\nconst ID_PREFIX = '#';\n\n/**\n * Parse an event selector string.\n * Supported rules:\n * 1. mousedown\n * 2. rect:mousedown\n * 3. window:mousemove\n * 4. @foo:mousedown\n * Returns an event stream definitions.\n */\nexport const parseEventSelector = (\n selector: string,\n source: EventSourceType = EVENT_SOURCE_VIEW\n): Partial<ParsedViewEventSpec | ParsedWindowEventSpec> => {\n const spec: Partial<ParsedViewEventSpec | ParsedWindowEventSpec> = {};\n\n const splitArr = selector.split(JOIN_SYMBOL);\n\n if (splitArr.length === 2) {\n const [space, eventType] = splitArr;\n\n if (space[0] === ID_PREFIX) {\n // events on marks id\n spec.markId = space.slice(1);\n spec.source = source;\n } else if (space[0] === NAME_PREFIX) {\n // events on marks name\n spec.markName = space.slice(1);\n spec.source = source;\n } else if (isMarkType(space)) {\n spec.markType = space as MarkType;\n spec.source = source;\n } else if (space === EVENT_SOURCE_WINDOW) {\n spec.source = EVENT_SOURCE_WINDOW;\n } else {\n spec.source = source;\n }\n\n spec.type = eventType;\n } else if (splitArr.length === 1) {\n spec.type = selector;\n spec.source = source;\n }\n\n return spec;\n};\n"]}
@@ -0,0 +1,4 @@
1
+ import type { IGrammarBase, IView, MarkFunctionType, ScaleEncodeType, FieldEncodeType } from '../types';
2
+ export declare function isScaleEncode(encode: any): encode is ScaleEncodeType;
3
+ export declare function isFieldEncode(encode: any): encode is FieldEncodeType;
4
+ export declare function parseEncodeType(encoder: MarkFunctionType<any> | ScaleEncodeType, view: IView): IGrammarBase[];
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.parseEncodeType = exports.isFieldEncode = exports.isScaleEncode = void 0;
6
+
7
+ const vutils_1 = require("@visactor/vutils"), util_1 = require("./util");
8
+
9
+ function isScaleEncode(encode) {
10
+ return !!(null == encode ? void 0 : encode.scale);
11
+ }
12
+
13
+ function isFieldEncode(encode) {
14
+ return !!(null == encode ? void 0 : encode.field);
15
+ }
16
+
17
+ function parseEncodeType(encoder, view) {
18
+ if (!encoder) return [];
19
+ let dependencies = [];
20
+ return encoder.scale && (dependencies = (0, util_1.isGrammar)(encoder.scale) ? [ encoder.scale ] : (0,
21
+ vutils_1.array)(view.getScaleById(encoder.scale))), dependencies.concat((0, util_1.parseFunctionType)(encoder, view));
22
+ }
23
+
24
+ exports.isScaleEncode = isScaleEncode, exports.isFieldEncode = isFieldEncode, exports.parseEncodeType = parseEncodeType;
25
+ //# sourceMappingURL=mark.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/parse/mark.ts"],"names":[],"mappings":";;;AAAA,6CAAyC;AAEzC,iCAAsD;AAEtD,SAAgB,aAAa,CAAC,MAAW;IACvC,OAAO,CAAC,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,CAAA,CAAC;AACzB,CAAC;AAFD,sCAEC;AAED,SAAgB,aAAa,CAAC,MAAW;IACvC,OAAO,CAAC,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,CAAA,CAAC;AACzB,CAAC;AAFD,sCAEC;AAED,SAAgB,eAAe,CAAC,OAAgD,EAAE,IAAW;IAC3F,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,EAAE,CAAC;KACX;IACD,IAAI,YAAY,GAAmB,EAAE,CAAC;IACtC,IAAI,OAAO,CAAC,KAAK,EAAE;QACjB,IAAI,IAAA,gBAAS,EAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YAC5B,YAAY,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;SAChC;aAAM;YACL,YAAY,GAAG,IAAA,cAAK,EAAC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,KAAK,CAAiB,CAAC,CAAC;SACxE;KACF;IACD,OAAO,YAAY,CAAC,MAAM,CAAC,IAAA,wBAAiB,EAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;AAC/D,CAAC;AAbD,0CAaC","file":"mark.js","sourcesContent":["import { array } from '@visactor/vutils';\nimport type { IGrammarBase, IView, MarkFunctionType, ScaleEncodeType, FieldEncodeType } from '../types';\nimport { isGrammar, parseFunctionType } from './util';\n\nexport function isScaleEncode(encode: any): encode is ScaleEncodeType {\n return !!encode?.scale;\n}\n\nexport function isFieldEncode(encode: any): encode is FieldEncodeType {\n return !!encode?.field;\n}\n\nexport function parseEncodeType(encoder: MarkFunctionType<any> | ScaleEncodeType, view: IView): IGrammarBase[] {\n if (!encoder) {\n return [];\n }\n let dependencies: IGrammarBase[] = [];\n if (encoder.scale) {\n if (isGrammar(encoder.scale)) {\n dependencies = [encoder.scale];\n } else {\n dependencies = array(view.getScaleById(encoder.scale) as IGrammarBase);\n }\n }\n return dependencies.concat(parseFunctionType(encoder, view));\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import type { IGrammarBase } from '../types';
2
+ export declare const parseOptionValue: (value: IGrammarBase | any, params: any) => any;
3
+ export declare const parseOptions: (options: Record<string, IGrammarBase | any> | Array<IGrammarBase | any>, params: any) => Record<string, any>;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.parseOptions = exports.parseOptionValue = void 0;
6
+
7
+ const vutils_1 = require("@visactor/vutils"), util_1 = require("./util"), parseOptionValue = (value, params) => (0,
8
+ util_1.isGrammar)(value) ? value.output() : value && (0, vutils_1.isObject)(value) ? (0,
9
+ vutils_1.isFunction)(value.callback) ? datum => value.callback(datum, params) : (0,
10
+ vutils_1.isFunction)(value.value) ? value.value(params) : value : value;
11
+
12
+ exports.parseOptionValue = parseOptionValue;
13
+
14
+ const parseOptions = (options, params) => options ? (0, vutils_1.isObject)(options) ? Object.keys(options).reduce(((res, key) => {
15
+ const option = options[key];
16
+ return res[key] = (0, exports.parseOptionValue)(option, params), res;
17
+ }), {}) : options.map((option => (0, exports.parseOptionValue)(option, params))) : options;
18
+
19
+ exports.parseOptions = parseOptions;
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/parse/option.ts"],"names":[],"mappings":";;;AAAA,6CAAwD;AAExD,iCAAmC;AAE5B,MAAM,gBAAgB,GAAG,CAAC,KAAyB,EAAE,MAAW,EAAE,EAAE;IACzE,IAAI,IAAA,gBAAS,EAAC,KAAK,CAAC,EAAE;QACpB,OAAO,KAAK,CAAC,MAAM,EAAE,CAAC;KACvB;SAAM,IAAI,KAAK,IAAI,IAAA,iBAAQ,EAAM,KAAK,CAAC,EAAE;QACxC,IAAI,IAAA,mBAAU,EAAC,KAAK,CAAC,QAAQ,CAAC,EAAE;YAC9B,OAAO,CAAC,KAAU,EAAE,EAAE;gBACpB,OAAO,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;YACvC,CAAC,CAAC;SACH;QAED,IAAI,IAAA,mBAAU,EAAC,KAAK,CAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;SAC5B;QAED,OAAO,KAAK,CAAC;KACd;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAlBW,QAAA,gBAAgB,oBAkB3B;AAEK,MAAM,YAAY,GAAG,CAAC,OAAuE,EAAE,MAAW,EAAE,EAAE;IACnH,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,OAAO,CAAC;KAChB;IAED,IAAI,IAAA,iBAAQ,EAAC,OAAO,CAAC,EAAE;QACrB,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;YAC9C,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;YAE5B,GAAG,CAAC,GAAG,CAAC,GAAG,IAAA,wBAAgB,EAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YAE5C,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,EAAE,CAAC,CAAC;KACR;IAED,OAAQ,OAAqC,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,IAAA,wBAAgB,EAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAChG,CAAC,CAAC;AAhBW,QAAA,YAAY,gBAgBvB","file":"option.js","sourcesContent":["import { isFunction, isObject } from '@visactor/vutils';\nimport type { IGrammarBase } from '../types';\nimport { isGrammar } from './util';\n\nexport const parseOptionValue = (value: IGrammarBase | any, params: any) => {\n if (isGrammar(value)) {\n return value.output();\n } else if (value && isObject<any>(value)) {\n if (isFunction(value.callback)) {\n return (datum: any) => {\n return value.callback(datum, params);\n };\n }\n\n if (isFunction(value.value)) {\n return value.value(params);\n }\n\n return value;\n }\n\n return value;\n};\n\nexport const parseOptions = (options: Record<string, IGrammarBase | any> | Array<IGrammarBase | any>, params: any) => {\n if (!options) {\n return options;\n }\n\n if (isObject(options)) {\n return Object.keys(options).reduce((res, key) => {\n const option = options[key];\n\n res[key] = parseOptionValue(option, params);\n\n return res;\n }, {});\n }\n\n return (options as Array<IGrammarBase | any>).map(option => parseOptionValue(option, params));\n};\n"]}
@@ -0,0 +1,8 @@
1
+ import type { IBaseScale } from '@visactor/vscale';
2
+ import type { IView } from '../types/view';
3
+ import type { IGrammarBase } from '../types/grammar';
4
+ import type { ScaleFunctionType, ScaleData, MultiScaleData, ScaleSpec, ScaleConfigureSpec, GrammarScaleType } from '../types/scale';
5
+ export declare function createScale(type: GrammarScaleType): IBaseScale;
6
+ export declare function parseScaleDomainRange(domain: ScaleFunctionType<any> | ScaleData | MultiScaleData, view: IView): IGrammarBase[];
7
+ export declare function parseScaleConfig(type: GrammarScaleType, config: ScaleConfigureSpec, view: IView): IGrammarBase[];
8
+ export declare function configureScale(spec: ScaleSpec, scale: IBaseScale, parameters: any): void;