@visactor/vgrammar-core 0.7.7 → 0.8.0-alpha.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 (547) hide show
  1. package/cjs/component/axis.js.map +1 -1
  2. package/cjs/component/datazoom.d.ts +7 -4
  3. package/cjs/component/datazoom.js +21 -43
  4. package/cjs/component/datazoom.js.map +1 -1
  5. package/cjs/component/grid.js.map +1 -1
  6. package/cjs/component/index.d.ts +0 -2
  7. package/cjs/component/index.js +1 -19
  8. package/cjs/component/index.js.map +1 -1
  9. package/cjs/component/label.js.map +1 -1
  10. package/cjs/component/legend.d.ts +1 -3
  11. package/cjs/component/legend.js +5 -26
  12. package/cjs/component/legend.js.map +1 -1
  13. package/cjs/component/player.d.ts +1 -2
  14. package/cjs/component/player.js +15 -31
  15. package/cjs/component/player.js.map +1 -1
  16. package/cjs/component/scale.d.ts +1 -0
  17. package/cjs/component/scale.js +3 -0
  18. package/cjs/component/scale.js.map +1 -1
  19. package/cjs/component/scrollbar.d.ts +3 -4
  20. package/cjs/component/scrollbar.js +12 -54
  21. package/cjs/component/scrollbar.js.map +1 -1
  22. package/cjs/component/slider.d.ts +2 -5
  23. package/cjs/component/slider.js +4 -26
  24. package/cjs/component/slider.js.map +1 -1
  25. package/cjs/component/title.js.map +1 -1
  26. package/cjs/core/factory.d.ts +6 -3
  27. package/cjs/core/factory.js +9 -2
  28. package/cjs/core/factory.js.map +1 -1
  29. package/cjs/env.d.ts +1 -0
  30. package/cjs/env.js +20 -0
  31. package/cjs/env.js.map +1 -0
  32. package/cjs/glyph/index.js +2 -1
  33. package/cjs/glyph/link-path.js +1 -2
  34. package/cjs/graph/animation/animate.js +25 -19
  35. package/cjs/graph/animation/animate.js.map +1 -1
  36. package/cjs/graph/animation/animation/grow-cartesian.js.map +1 -1
  37. package/cjs/graph/animation/animator.js +4 -4
  38. package/cjs/graph/animation/animator.js.map +1 -1
  39. package/cjs/graph/animation/attribute.d.ts +2 -2
  40. package/cjs/graph/animation/attribute.js +12 -12
  41. package/cjs/graph/animation/attribute.js.map +1 -1
  42. package/cjs/graph/animation/morph.js +4 -4
  43. package/cjs/graph/animation/morph.js.map +1 -1
  44. package/cjs/graph/attributes/index.js +1 -1
  45. package/cjs/graph/attributes/index.js.map +1 -1
  46. package/cjs/graph/canvas-renderer.d.ts +1 -1
  47. package/cjs/graph/canvas-renderer.js +5 -5
  48. package/cjs/graph/canvas-renderer.js.map +1 -1
  49. package/cjs/graph/element.d.ts +1 -1
  50. package/cjs/graph/element.js +4 -4
  51. package/cjs/graph/element.js.map +1 -1
  52. package/cjs/graph/enums.d.ts +25 -8
  53. package/cjs/graph/enums.js +23 -14
  54. package/cjs/graph/enums.js.map +1 -1
  55. package/cjs/graph/glyph-element.d.ts +1 -1
  56. package/cjs/graph/glyph-element.js.map +1 -1
  57. package/cjs/graph/mark/encode.d.ts +0 -3
  58. package/cjs/graph/mark/encode.js +3 -12
  59. package/cjs/graph/mark/encode.js.map +1 -1
  60. package/cjs/graph/mark/large-rects.d.ts +2 -2
  61. package/cjs/graph/mark/large-rects.js +3 -3
  62. package/cjs/graph/mark/large-rects.js.map +1 -1
  63. package/cjs/graph/mark/large-symbols.d.ts +2 -2
  64. package/cjs/graph/mark/large-symbols.js +3 -3
  65. package/cjs/graph/mark/large-symbols.js.map +1 -1
  66. package/cjs/graph/util/env.js +2 -2
  67. package/cjs/graph/util/env.js.map +1 -1
  68. package/cjs/graph/util/events-extend.d.ts +1 -1
  69. package/cjs/graph/util/events-extend.js +1 -1
  70. package/cjs/graph/util/events-extend.js.map +1 -1
  71. package/cjs/graph/util/graphic.d.ts +3 -3
  72. package/cjs/graph/util/graphic.js +21 -21
  73. package/cjs/graph/util/graphic.js.map +1 -1
  74. package/cjs/index.d.ts +5 -1
  75. package/cjs/index.js +13 -3
  76. package/cjs/index.js.map +1 -1
  77. package/cjs/interactions/base-tooltip.d.ts +29 -0
  78. package/cjs/interactions/base-tooltip.js +74 -0
  79. package/cjs/interactions/base-tooltip.js.map +1 -0
  80. package/cjs/interactions/base.d.ts +14 -0
  81. package/cjs/interactions/base.js +41 -0
  82. package/cjs/interactions/base.js.map +1 -0
  83. package/cjs/interactions/brush-active.d.ts +17 -0
  84. package/cjs/interactions/brush-active.js +27 -0
  85. package/cjs/interactions/brush-active.js.map +1 -0
  86. package/cjs/interactions/brush-base.d.ts +43 -0
  87. package/cjs/interactions/brush-base.js +106 -0
  88. package/cjs/interactions/brush-base.js.map +1 -0
  89. package/cjs/interactions/brush-filter.d.ts +24 -0
  90. package/cjs/interactions/brush-filter.js +34 -0
  91. package/cjs/interactions/brush-filter.js.map +1 -0
  92. package/cjs/interactions/brush-highlight.d.ts +17 -0
  93. package/cjs/interactions/brush-highlight.js +34 -0
  94. package/cjs/interactions/brush-highlight.js.map +1 -0
  95. package/cjs/interactions/crosshair.d.ts +53 -0
  96. package/cjs/{component → interactions}/crosshair.js +80 -79
  97. package/cjs/interactions/crosshair.js.map +1 -0
  98. package/cjs/interactions/datazoom-filter.d.ts +13 -0
  99. package/cjs/interactions/datazoom-filter.js +42 -0
  100. package/cjs/interactions/datazoom-filter.js.map +1 -0
  101. package/cjs/interactions/dimension-tooltip.d.ts +18 -0
  102. package/cjs/interactions/dimension-tooltip.js +99 -0
  103. package/cjs/interactions/dimension-tooltip.js.map +1 -0
  104. package/cjs/interactions/drill-down.d.ts +25 -0
  105. package/cjs/interactions/drill-down.js +48 -0
  106. package/cjs/interactions/drill-down.js.map +1 -0
  107. package/cjs/interactions/element-active-by-legend.d.ts +17 -0
  108. package/cjs/interactions/element-active-by-legend.js +44 -0
  109. package/cjs/interactions/element-active-by-legend.js.map +1 -0
  110. package/cjs/interactions/element-active.d.ts +16 -0
  111. package/cjs/interactions/element-active.js +33 -0
  112. package/cjs/interactions/element-active.js.map +1 -0
  113. package/cjs/interactions/element-highlight-by-group.d.ts +17 -0
  114. package/cjs/interactions/element-highlight-by-group.js +53 -0
  115. package/cjs/interactions/element-highlight-by-group.js.map +1 -0
  116. package/cjs/interactions/element-highlight-by-key.d.ts +17 -0
  117. package/cjs/interactions/element-highlight-by-key.js +53 -0
  118. package/cjs/interactions/element-highlight-by-key.js.map +1 -0
  119. package/cjs/interactions/element-highlight-by-legend.d.ts +17 -0
  120. package/cjs/interactions/element-highlight-by-legend.js +47 -0
  121. package/cjs/interactions/element-highlight-by-legend.js.map +1 -0
  122. package/cjs/interactions/element-highlight-by-name.d.ts +18 -0
  123. package/cjs/interactions/element-highlight-by-name.js +59 -0
  124. package/cjs/interactions/element-highlight-by-name.js.map +1 -0
  125. package/cjs/interactions/element-highlight.d.ts +17 -0
  126. package/cjs/interactions/element-highlight.js +48 -0
  127. package/cjs/interactions/element-highlight.js.map +1 -0
  128. package/cjs/interactions/element-select.d.ts +18 -0
  129. package/cjs/interactions/element-select.js +42 -0
  130. package/cjs/interactions/element-select.js.map +1 -0
  131. package/cjs/interactions/filter.d.ts +20 -0
  132. package/cjs/interactions/filter.js +37 -0
  133. package/cjs/interactions/filter.js.map +1 -0
  134. package/cjs/interactions/fish-eye.d.ts +38 -0
  135. package/cjs/interactions/fish-eye.js +109 -0
  136. package/cjs/interactions/fish-eye.js.map +1 -0
  137. package/cjs/interactions/index.d.ts +50 -0
  138. package/cjs/interactions/index.js +386 -0
  139. package/cjs/interactions/index.js.map +1 -0
  140. package/cjs/interactions/legend-filter.d.ts +13 -0
  141. package/cjs/interactions/legend-filter.js +33 -0
  142. package/cjs/interactions/legend-filter.js.map +1 -0
  143. package/cjs/interactions/player-filter.d.ts +14 -0
  144. package/cjs/interactions/player-filter.js +32 -0
  145. package/cjs/interactions/player-filter.js.map +1 -0
  146. package/cjs/interactions/roll-up.d.ts +16 -0
  147. package/cjs/interactions/roll-up.js +47 -0
  148. package/cjs/interactions/roll-up.js.map +1 -0
  149. package/cjs/interactions/scrollbar-filter.d.ts +13 -0
  150. package/cjs/interactions/scrollbar-filter.js +54 -0
  151. package/cjs/interactions/scrollbar-filter.js.map +1 -0
  152. package/cjs/interactions/slider-filter.d.ts +13 -0
  153. package/cjs/interactions/slider-filter.js +32 -0
  154. package/cjs/interactions/slider-filter.js.map +1 -0
  155. package/cjs/interactions/tooltip.d.ts +15 -0
  156. package/cjs/interactions/tooltip.js +62 -0
  157. package/cjs/interactions/tooltip.js.map +1 -0
  158. package/cjs/interactions/view-drag-mixin.d.ts +22 -0
  159. package/cjs/interactions/view-drag-mixin.js +52 -0
  160. package/cjs/interactions/view-drag-mixin.js.map +1 -0
  161. package/cjs/interactions/view-drag.d.ts +19 -0
  162. package/cjs/interactions/view-drag.js +49 -0
  163. package/cjs/interactions/view-drag.js.map +1 -0
  164. package/cjs/interactions/view-navigation-base.d.ts +17 -0
  165. package/cjs/interactions/view-navigation-base.js +81 -0
  166. package/cjs/interactions/view-navigation-base.js.map +1 -0
  167. package/cjs/interactions/view-roam.d.ts +30 -0
  168. package/cjs/interactions/view-roam.js +93 -0
  169. package/cjs/interactions/view-roam.js.map +1 -0
  170. package/cjs/interactions/view-scroll-mixin.d.ts +10 -0
  171. package/cjs/interactions/view-scroll-mixin.js +45 -0
  172. package/cjs/interactions/view-scroll-mixin.js.map +1 -0
  173. package/cjs/interactions/view-scroll.d.ts +17 -0
  174. package/cjs/interactions/view-scroll.js +37 -0
  175. package/cjs/interactions/view-scroll.js.map +1 -0
  176. package/cjs/interactions/view-utils.d.ts +14 -0
  177. package/cjs/interactions/view-utils.js +73 -0
  178. package/cjs/interactions/view-utils.js.map +1 -0
  179. package/cjs/interactions/view-zoom-mixin.d.ts +29 -0
  180. package/cjs/interactions/view-zoom-mixin.js +77 -0
  181. package/cjs/interactions/view-zoom-mixin.js.map +1 -0
  182. package/cjs/interactions/view-zoom.d.ts +23 -0
  183. package/cjs/interactions/view-zoom.js +53 -0
  184. package/cjs/interactions/view-zoom.js.map +1 -0
  185. package/cjs/parse/coordinate.js +1 -1
  186. package/cjs/parse/event.d.ts +2 -0
  187. package/cjs/parse/event.js +8 -4
  188. package/cjs/parse/event.js.map +1 -1
  189. package/cjs/parse/mark.js +1 -1
  190. package/cjs/parse/option.js +2 -1
  191. package/cjs/parse/scale.js +1 -1
  192. package/cjs/parse/transform.js +1 -1
  193. package/cjs/parse/util.js +1 -1
  194. package/cjs/parse/view.js +1 -1
  195. package/cjs/semantic-marks/cell.d.ts +1 -1
  196. package/cjs/semantic-marks/cell.js +4 -4
  197. package/cjs/semantic-marks/cell.js.map +1 -1
  198. package/cjs/semantic-marks/interval.d.ts +1 -1
  199. package/cjs/semantic-marks/interval.js +1 -1
  200. package/cjs/semantic-marks/text.js +1 -1
  201. package/cjs/theme/dark.js +1 -1
  202. package/cjs/theme/default.js +1 -1
  203. package/cjs/theme/theme-manager.js +1 -1
  204. package/cjs/transforms/index.js +1 -1
  205. package/cjs/transforms/mark/dodge.js +4 -4
  206. package/cjs/transforms/mark/dodge.js.map +1 -1
  207. package/cjs/transforms/mark/jitter.js +2 -2
  208. package/cjs/transforms/mark/jitter.js.map +1 -1
  209. package/cjs/types/animate.d.ts +1 -1
  210. package/cjs/types/animate.js +1 -1
  211. package/cjs/types/animate.js.map +1 -1
  212. package/cjs/types/base.js +1 -1
  213. package/cjs/types/component.d.ts +16 -88
  214. package/cjs/types/component.js +1 -1
  215. package/cjs/types/component.js.map +1 -1
  216. package/cjs/types/coordinate.js +1 -1
  217. package/cjs/types/data.js +2 -1
  218. package/cjs/types/dataflow.js +1 -1
  219. package/cjs/types/element.d.ts +1 -1
  220. package/cjs/types/element.js +1 -1
  221. package/cjs/types/element.js.map +1 -1
  222. package/cjs/types/event.d.ts +11 -4
  223. package/cjs/types/event.js +1 -1
  224. package/cjs/types/event.js.map +1 -1
  225. package/cjs/types/glyph.js +1 -1
  226. package/cjs/types/grammar.d.ts +6 -2
  227. package/cjs/types/grammar.js +1 -1
  228. package/cjs/types/grammar.js.map +1 -1
  229. package/cjs/types/hooks.js +1 -1
  230. package/cjs/types/index.d.ts +1 -0
  231. package/cjs/types/index.js +3 -2
  232. package/cjs/types/index.js.map +1 -1
  233. package/cjs/types/interaction.d.ts +353 -0
  234. package/cjs/types/interaction.js +6 -0
  235. package/cjs/types/interaction.js.map +1 -0
  236. package/cjs/types/mark.d.ts +2 -3
  237. package/cjs/types/mark.js.map +1 -1
  238. package/cjs/types/morph.d.ts +1 -1
  239. package/cjs/types/morph.js.map +1 -1
  240. package/cjs/types/plot.d.ts +1 -1
  241. package/cjs/types/plot.js.map +1 -1
  242. package/cjs/types/renderer.d.ts +1 -1
  243. package/cjs/types/renderer.js.map +1 -1
  244. package/cjs/types/theme.d.ts +1 -1
  245. package/cjs/types/theme.js.map +1 -1
  246. package/cjs/types/view.d.ts +13 -14
  247. package/cjs/types/view.js.map +1 -1
  248. package/cjs/util/scale.d.ts +4 -0
  249. package/cjs/util/scale.js +24 -0
  250. package/cjs/util/scale.js.map +1 -0
  251. package/cjs/util/text.d.ts +1 -1
  252. package/cjs/util/text.js +3 -3
  253. package/cjs/util/text.js.map +1 -1
  254. package/cjs/view/View.d.ts +9 -13
  255. package/cjs/view/View.js +49 -74
  256. package/cjs/view/View.js.map +1 -1
  257. package/cjs/view/component.d.ts +2 -6
  258. package/cjs/view/component.js +1 -19
  259. package/cjs/view/component.js.map +1 -1
  260. package/cjs/view/dataflow.js +1 -1
  261. package/cjs/view/dataflow.js.map +1 -1
  262. package/cjs/view/events.d.ts +1 -1
  263. package/cjs/view/mark.d.ts +2 -2
  264. package/cjs/view/mark.js +12 -10
  265. package/cjs/view/mark.js.map +1 -1
  266. package/cjs/view/scale.d.ts +7 -1
  267. package/cjs/view/scale.js +17 -3
  268. package/cjs/view/scale.js.map +1 -1
  269. package/es/component/axis.js.map +1 -1
  270. package/es/component/datazoom.d.ts +7 -4
  271. package/es/component/datazoom.js +26 -42
  272. package/es/component/datazoom.js.map +1 -1
  273. package/es/component/grid.js.map +1 -1
  274. package/es/component/index.d.ts +0 -2
  275. package/es/component/index.js +0 -4
  276. package/es/component/index.js.map +1 -1
  277. package/es/component/label.js.map +1 -1
  278. package/es/component/legend.d.ts +1 -3
  279. package/es/component/legend.js +11 -26
  280. package/es/component/legend.js.map +1 -1
  281. package/es/component/player.d.ts +1 -2
  282. package/es/component/player.js +17 -30
  283. package/es/component/player.js.map +1 -1
  284. package/es/component/scale.d.ts +1 -0
  285. package/es/component/scale.js +3 -0
  286. package/es/component/scale.js.map +1 -1
  287. package/es/component/scrollbar.d.ts +3 -4
  288. package/es/component/scrollbar.js +17 -53
  289. package/es/component/scrollbar.js.map +1 -1
  290. package/es/component/slider.d.ts +2 -5
  291. package/es/component/slider.js +9 -25
  292. package/es/component/slider.js.map +1 -1
  293. package/es/component/title.js.map +1 -1
  294. package/es/core/factory.d.ts +6 -3
  295. package/es/core/factory.js +9 -2
  296. package/es/core/factory.js.map +1 -1
  297. package/es/env.d.ts +1 -0
  298. package/es/env.js +1 -0
  299. package/es/env.js.map +1 -0
  300. package/es/glyph/index.js +2 -1
  301. package/es/glyph/link-path.js +1 -2
  302. package/es/graph/animation/animate.js +24 -19
  303. package/es/graph/animation/animate.js.map +1 -1
  304. package/es/graph/animation/animation/grow-cartesian.js.map +1 -1
  305. package/es/graph/animation/animator.js +1 -1
  306. package/es/graph/animation/animator.js.map +1 -1
  307. package/es/graph/animation/attribute.d.ts +2 -2
  308. package/es/graph/animation/attribute.js +7 -7
  309. package/es/graph/animation/attribute.js.map +1 -1
  310. package/es/graph/animation/morph.js +1 -1
  311. package/es/graph/animation/morph.js.map +1 -1
  312. package/es/graph/attributes/index.js +1 -1
  313. package/es/graph/attributes/index.js.map +1 -1
  314. package/es/graph/canvas-renderer.d.ts +1 -1
  315. package/es/graph/canvas-renderer.js +3 -1
  316. package/es/graph/canvas-renderer.js.map +1 -1
  317. package/es/graph/element.d.ts +1 -1
  318. package/es/graph/element.js +3 -3
  319. package/es/graph/element.js.map +1 -1
  320. package/es/graph/enums.d.ts +25 -8
  321. package/es/graph/enums.js +27 -11
  322. package/es/graph/enums.js.map +1 -1
  323. package/es/graph/glyph-element.d.ts +1 -1
  324. package/es/graph/glyph-element.js.map +1 -1
  325. package/es/graph/mark/encode.d.ts +0 -3
  326. package/es/graph/mark/encode.js +0 -10
  327. package/es/graph/mark/encode.js.map +1 -1
  328. package/es/graph/mark/large-rects.d.ts +2 -2
  329. package/es/graph/mark/large-rects.js +1 -1
  330. package/es/graph/mark/large-rects.js.map +1 -1
  331. package/es/graph/mark/large-symbols.d.ts +2 -2
  332. package/es/graph/mark/large-symbols.js +1 -1
  333. package/es/graph/mark/large-symbols.js.map +1 -1
  334. package/es/graph/util/env.js +1 -1
  335. package/es/graph/util/env.js.map +1 -1
  336. package/es/graph/util/events-extend.d.ts +1 -1
  337. package/es/graph/util/events-extend.js +1 -1
  338. package/es/graph/util/events-extend.js.map +1 -1
  339. package/es/graph/util/graphic.d.ts +3 -3
  340. package/es/graph/util/graphic.js +1 -1
  341. package/es/graph/util/graphic.js.map +1 -1
  342. package/es/index.d.ts +5 -1
  343. package/es/index.js +11 -2
  344. package/es/index.js.map +1 -1
  345. package/es/interactions/base-tooltip.d.ts +29 -0
  346. package/es/interactions/base-tooltip.js +73 -0
  347. package/es/interactions/base-tooltip.js.map +1 -0
  348. package/es/interactions/base.d.ts +14 -0
  349. package/es/interactions/base.js +32 -0
  350. package/es/interactions/base.js.map +1 -0
  351. package/es/interactions/brush-active.d.ts +17 -0
  352. package/es/interactions/brush-active.js +23 -0
  353. package/es/interactions/brush-active.js.map +1 -0
  354. package/es/interactions/brush-base.d.ts +43 -0
  355. package/es/interactions/brush-base.js +103 -0
  356. package/es/interactions/brush-base.js.map +1 -0
  357. package/es/interactions/brush-filter.d.ts +24 -0
  358. package/es/interactions/brush-filter.js +32 -0
  359. package/es/interactions/brush-filter.js.map +1 -0
  360. package/es/interactions/brush-highlight.d.ts +17 -0
  361. package/es/interactions/brush-highlight.js +31 -0
  362. package/es/interactions/brush-highlight.js.map +1 -0
  363. package/es/interactions/crosshair.d.ts +53 -0
  364. package/es/{component → interactions}/crosshair.js +82 -81
  365. package/es/interactions/crosshair.js.map +1 -0
  366. package/es/interactions/datazoom-filter.d.ts +13 -0
  367. package/es/interactions/datazoom-filter.js +40 -0
  368. package/es/interactions/datazoom-filter.js.map +1 -0
  369. package/es/interactions/dimension-tooltip.d.ts +18 -0
  370. package/es/interactions/dimension-tooltip.js +99 -0
  371. package/es/interactions/dimension-tooltip.js.map +1 -0
  372. package/es/interactions/drill-down.d.ts +25 -0
  373. package/es/interactions/drill-down.js +46 -0
  374. package/es/interactions/drill-down.js.map +1 -0
  375. package/es/interactions/element-active-by-legend.d.ts +17 -0
  376. package/es/interactions/element-active-by-legend.js +43 -0
  377. package/es/interactions/element-active-by-legend.js.map +1 -0
  378. package/es/interactions/element-active.d.ts +16 -0
  379. package/es/interactions/element-active.js +29 -0
  380. package/es/interactions/element-active.js.map +1 -0
  381. package/es/interactions/element-highlight-by-group.d.ts +17 -0
  382. package/es/interactions/element-highlight-by-group.js +50 -0
  383. package/es/interactions/element-highlight-by-group.js.map +1 -0
  384. package/es/interactions/element-highlight-by-key.d.ts +17 -0
  385. package/es/interactions/element-highlight-by-key.js +50 -0
  386. package/es/interactions/element-highlight-by-key.js.map +1 -0
  387. package/es/interactions/element-highlight-by-legend.d.ts +17 -0
  388. package/es/interactions/element-highlight-by-legend.js +46 -0
  389. package/es/interactions/element-highlight-by-legend.js.map +1 -0
  390. package/es/interactions/element-highlight-by-name.d.ts +18 -0
  391. package/es/interactions/element-highlight-by-name.js +56 -0
  392. package/es/interactions/element-highlight-by-name.js.map +1 -0
  393. package/es/interactions/element-highlight.d.ts +17 -0
  394. package/es/interactions/element-highlight.js +43 -0
  395. package/es/interactions/element-highlight.js.map +1 -0
  396. package/es/interactions/element-select.d.ts +18 -0
  397. package/es/interactions/element-select.js +38 -0
  398. package/es/interactions/element-select.js.map +1 -0
  399. package/es/interactions/filter.d.ts +20 -0
  400. package/es/interactions/filter.js +31 -0
  401. package/es/interactions/filter.js.map +1 -0
  402. package/es/interactions/fish-eye.d.ts +38 -0
  403. package/es/interactions/fish-eye.js +105 -0
  404. package/es/interactions/fish-eye.js.map +1 -0
  405. package/es/interactions/index.d.ts +50 -0
  406. package/es/interactions/index.js +148 -0
  407. package/es/interactions/index.js.map +1 -0
  408. package/es/interactions/legend-filter.d.ts +13 -0
  409. package/es/interactions/legend-filter.js +32 -0
  410. package/es/interactions/legend-filter.js.map +1 -0
  411. package/es/interactions/player-filter.d.ts +14 -0
  412. package/es/interactions/player-filter.js +32 -0
  413. package/es/interactions/player-filter.js.map +1 -0
  414. package/es/interactions/roll-up.d.ts +16 -0
  415. package/es/interactions/roll-up.js +45 -0
  416. package/es/interactions/roll-up.js.map +1 -0
  417. package/es/interactions/scrollbar-filter.d.ts +13 -0
  418. package/es/interactions/scrollbar-filter.js +50 -0
  419. package/es/interactions/scrollbar-filter.js.map +1 -0
  420. package/es/interactions/slider-filter.d.ts +13 -0
  421. package/es/interactions/slider-filter.js +29 -0
  422. package/es/interactions/slider-filter.js.map +1 -0
  423. package/es/interactions/tooltip.d.ts +15 -0
  424. package/es/interactions/tooltip.js +58 -0
  425. package/es/interactions/tooltip.js.map +1 -0
  426. package/es/interactions/view-drag-mixin.d.ts +22 -0
  427. package/es/interactions/view-drag-mixin.js +46 -0
  428. package/es/interactions/view-drag-mixin.js.map +1 -0
  429. package/es/interactions/view-drag.d.ts +19 -0
  430. package/es/interactions/view-drag.js +47 -0
  431. package/es/interactions/view-drag.js.map +1 -0
  432. package/es/interactions/view-navigation-base.d.ts +17 -0
  433. package/es/interactions/view-navigation-base.js +78 -0
  434. package/es/interactions/view-navigation-base.js.map +1 -0
  435. package/es/interactions/view-roam.d.ts +30 -0
  436. package/es/interactions/view-roam.js +91 -0
  437. package/es/interactions/view-roam.js.map +1 -0
  438. package/es/interactions/view-scroll-mixin.d.ts +10 -0
  439. package/es/interactions/view-scroll-mixin.js +37 -0
  440. package/es/interactions/view-scroll-mixin.js.map +1 -0
  441. package/es/interactions/view-scroll.d.ts +17 -0
  442. package/es/interactions/view-scroll.js +35 -0
  443. package/es/interactions/view-scroll.js.map +1 -0
  444. package/es/interactions/view-utils.d.ts +14 -0
  445. package/es/interactions/view-utils.js +60 -0
  446. package/es/interactions/view-utils.js.map +1 -0
  447. package/es/interactions/view-zoom-mixin.d.ts +29 -0
  448. package/es/interactions/view-zoom-mixin.js +68 -0
  449. package/es/interactions/view-zoom-mixin.js.map +1 -0
  450. package/es/interactions/view-zoom.d.ts +23 -0
  451. package/es/interactions/view-zoom.js +51 -0
  452. package/es/interactions/view-zoom.js.map +1 -0
  453. package/es/parse/coordinate.js +1 -1
  454. package/es/parse/event.d.ts +2 -0
  455. package/es/parse/event.js +6 -2
  456. package/es/parse/event.js.map +1 -1
  457. package/es/parse/mark.js +1 -1
  458. package/es/parse/option.js +2 -1
  459. package/es/parse/scale.js +1 -1
  460. package/es/parse/transform.js +1 -1
  461. package/es/parse/util.js +1 -1
  462. package/es/parse/view.js +1 -1
  463. package/es/semantic-marks/cell.d.ts +1 -1
  464. package/es/semantic-marks/cell.js +4 -2
  465. package/es/semantic-marks/cell.js.map +1 -1
  466. package/es/semantic-marks/interval.d.ts +1 -1
  467. package/es/semantic-marks/interval.js +1 -1
  468. package/es/semantic-marks/text.js +1 -1
  469. package/es/theme/dark.js +1 -1
  470. package/es/theme/default.js +1 -1
  471. package/es/theme/theme-manager.js +1 -1
  472. package/es/transforms/index.js +1 -1
  473. package/es/transforms/mark/dodge.js +2 -2
  474. package/es/transforms/mark/dodge.js.map +1 -1
  475. package/es/transforms/mark/jitter.js +2 -2
  476. package/es/transforms/mark/jitter.js.map +1 -1
  477. package/es/types/animate.d.ts +1 -1
  478. package/es/types/animate.js +1 -1
  479. package/es/types/animate.js.map +1 -1
  480. package/es/types/base.js +1 -1
  481. package/es/types/component.d.ts +16 -88
  482. package/es/types/component.js +1 -1
  483. package/es/types/component.js.map +1 -1
  484. package/es/types/coordinate.js +1 -1
  485. package/es/types/data.js +2 -1
  486. package/es/types/dataflow.js +1 -1
  487. package/es/types/element.d.ts +1 -1
  488. package/es/types/element.js +1 -1
  489. package/es/types/element.js.map +1 -1
  490. package/es/types/event.d.ts +11 -4
  491. package/es/types/event.js +1 -1
  492. package/es/types/event.js.map +1 -1
  493. package/es/types/glyph.js +1 -1
  494. package/es/types/grammar.d.ts +6 -2
  495. package/es/types/grammar.js +1 -1
  496. package/es/types/grammar.js.map +1 -1
  497. package/es/types/hooks.js +1 -1
  498. package/es/types/index.d.ts +1 -0
  499. package/es/types/index.js +3 -1
  500. package/es/types/index.js.map +1 -1
  501. package/es/types/interaction.d.ts +353 -0
  502. package/es/types/interaction.js +2 -0
  503. package/es/types/interaction.js.map +1 -0
  504. package/es/types/mark.d.ts +2 -3
  505. package/es/types/mark.js.map +1 -1
  506. package/es/types/morph.d.ts +1 -1
  507. package/es/types/morph.js.map +1 -1
  508. package/es/types/plot.d.ts +1 -1
  509. package/es/types/plot.js.map +1 -1
  510. package/es/types/renderer.d.ts +1 -1
  511. package/es/types/renderer.js.map +1 -1
  512. package/es/types/theme.d.ts +1 -1
  513. package/es/types/theme.js.map +1 -1
  514. package/es/types/view.d.ts +13 -14
  515. package/es/types/view.js.map +1 -1
  516. package/es/util/scale.d.ts +4 -0
  517. package/es/util/scale.js +15 -0
  518. package/es/util/scale.js.map +1 -0
  519. package/es/util/text.d.ts +1 -1
  520. package/es/util/text.js +1 -1
  521. package/es/util/text.js.map +1 -1
  522. package/es/view/View.d.ts +9 -13
  523. package/es/view/View.js +49 -69
  524. package/es/view/View.js.map +1 -1
  525. package/es/view/component.d.ts +2 -6
  526. package/es/view/component.js +0 -20
  527. package/es/view/component.js.map +1 -1
  528. package/es/view/dataflow.js +1 -1
  529. package/es/view/dataflow.js.map +1 -1
  530. package/es/view/events.d.ts +1 -1
  531. package/es/view/mark.d.ts +2 -2
  532. package/es/view/mark.js +12 -10
  533. package/es/view/mark.js.map +1 -1
  534. package/es/view/scale.d.ts +7 -1
  535. package/es/view/scale.js +17 -2
  536. package/es/view/scale.js.map +1 -1
  537. package/package.json +10 -9
  538. package/cjs/component/crosshair.d.ts +0 -50
  539. package/cjs/component/crosshair.js.map +0 -1
  540. package/cjs/component/tooltip.d.ts +0 -62
  541. package/cjs/component/tooltip.js +0 -305
  542. package/cjs/component/tooltip.js.map +0 -1
  543. package/es/component/crosshair.d.ts +0 -50
  544. package/es/component/crosshair.js.map +0 -1
  545. package/es/component/tooltip.d.ts +0 -62
  546. package/es/component/tooltip.js +0 -303
  547. package/es/component/tooltip.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types/animate.ts"],"names":[],"mappings":"","file":"animate.js","sourcesContent":["import type { IGraphic, ACustomAnimate, EasingType } from '@visactor/vrender';\nimport type { IPointLike } from '@visactor/vutils';\nimport type { MarkFunctionCallback, MarkFunctionType } from './mark';\nimport type { IMark } from './grammar';\nimport type { IElement } from './element';\n\nexport type TypeAnimation<T extends IElement> = (\n element: T,\n options: any,\n animationParameters: IAnimationParameters\n) => { from?: { [channel: string]: any }; to?: { [channel: string]: any } };\n\nexport interface IClipAnimationOptions {\n clipDimension?: 'x' | 'y' | 'auto' | 'default';\n}\n\nexport interface IGrowCartesianAnimationOptions {\n orient?: 'positive' | 'negative';\n overall?: boolean | number;\n direction?: 'x' | 'y' | 'xy';\n}\n\nexport interface IGrowAngleAnimationOptions {\n orient?: 'clockwise' | 'anticlockwise';\n overall?: boolean | number;\n}\n\nexport interface IGrowRadiusAnimationOptions {\n orient?: 'inside' | 'outside';\n overall?: boolean | number;\n}\n\nexport interface IGrowPointsAnimationOptions {\n orient?: 'positive' | 'negative';\n}\n\nexport interface IGrowPointsOverallAnimationOptions extends IGrowPointsAnimationOptions {\n center?: IPointLike;\n}\n\nexport interface IScaleAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n}\n\nexport interface IMoveAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n orient?: 'positive' | 'negative';\n offset?: number;\n point?: { x?: number; y?: number };\n}\n\nexport interface IRotateAnimationOptions {\n orient?: 'clockwise' | 'anticlockwise';\n angle?: number;\n}\n\n/** VGrammar 层提供的图元text上的图形属性,现在暂时会和VRender不一致 */\nexport interface TextItemAttributes {\n fontSize?: number;\n lineHeight?: number;\n font?: string;\n fontStyle?: string;\n fontVariant?: string;\n fontWeight?: string | number;\n lineBreak?: string;\n text?: string | string[];\n limit?: number;\n align?: string;\n baseline?: string;\n ellipsis?: string | boolean;\n dir?: string;\n}\n\n/** animation */\nexport type MarkFunctionValueType<T> = MarkFunctionCallback<T> | T;\n\nexport type IAnimationConfig = IAnimationTimeline | IAnimationTypeConfig;\n\n/**\n * state动画,暂时只支持简单配置\n */\nexport interface IStateAnimationConfig {\n duration?: number;\n easing?: EasingType;\n}\n\n/**\n * 动画 config 简化配置\n */\nexport interface IAnimationTypeConfig {\n type?: string;\n channel?: IAnimationChannelAttrs | IAnimationChannelAttributes;\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: MarkFunctionValueType<any>;\n easing?: EasingType;\n delay?: MarkFunctionValueType<number>;\n duration?: MarkFunctionValueType<number>;\n oneByOne?: MarkFunctionValueType<boolean | number>;\n startTime?: MarkFunctionValueType<number>;\n totalTime?: MarkFunctionValueType<number>;\n /** loop: true 无限循环; loop: 正整数,表示循环的次数 */\n loop?: boolean | number;\n /** 动画 effect 配置项 */\n options?: MarkFunctionValueType<any>;\n /** 动画执行相关控制配置项 */\n controlOptions?: IAnimationControlOptions;\n}\n\n/**\n * 动画 timeline 完整配置,一条时间线内的动画单元只能串行\n * 多个timeline是可以并行的\n * 考虑到同一图元不能在多个timeline上,所以timeline不应该提供数组配置的能力\n */\nexport interface IAnimationTimeline {\n /** 为了方便动画编排,用户可以设置 id 用于识别时间线 */\n id?: string;\n /** 时间切片 */\n timeSlices: IAnimationTimeSlice | IAnimationTimeSlice[];\n /** 动画开始的相对时间,可以为负数 */\n startTime?: MarkFunctionValueType<number>;\n /** 动画时长 */\n totalTime?: MarkFunctionValueType<number>;\n /** 动画依次执行的延迟 */\n oneByOne?: MarkFunctionValueType<number | boolean>;\n /** loop: true 无限循环; loop: 正整数,表示循环的次数 */\n loop?: MarkFunctionValueType<number | boolean>;\n /** 对图元元素进行划分,和过滤类似,但是不同时间线不能同时作用在相同的元素上 */\n partitioner?: MarkFunctionCallback<boolean>;\n /** 对同一时间线上的元素进行排序 */\n sort?: (datumA: any, datumB: any, elementA: IElement, elementB: IElement, parameters: any) => number;\n /** 动画执行相关控制配置项 */\n controlOptions?: IAnimationControlOptions;\n}\n\nexport interface IAnimationTimeSlice {\n effects: IAnimationEffect | IAnimationEffect[];\n duration?: MarkFunctionValueType<number>;\n delay?: MarkFunctionValueType<number>;\n}\n\nexport type IAnimationChannelFunction = (datum: any, element: IElement, parameters: IAnimationParameters) => any;\nexport type IAnimationChannelAttrs = Record<\n string,\n {\n from?: any | IAnimationChannelFunction;\n to?: any | IAnimationChannelFunction;\n }\n>;\nexport type IAnimationChannelAttributes = string[];\nexport type IAnimationChannelInterpolator = (\n ratio: number,\n from: any,\n to: any,\n nextAttributes: any,\n datum: any,\n element: IElement,\n parameters: IAnimationParameters\n) => boolean | void;\n\n// TODO: fix ACustomAnimate<any>\nexport interface IAnimationCustomConstructor {\n new (from: any, to: any, duration: number, ease: EasingType, parameters?: any): ACustomAnimate<any>;\n}\n\nexport interface IAnimationEffect {\n type?: string;\n channel?: IAnimationChannelAttrs | IAnimationChannelAttributes;\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: MarkFunctionValueType<any>;\n easing?: EasingType;\n /** options暂时没有处理 */\n options?: MarkFunctionValueType<any>;\n}\n\nexport interface IAnimationControlOptions {\n /** 当动画状态变更时清空动画 */\n stopWhenStateChange?: boolean;\n /** 是否立即应用动画初始状态 */\n immediatelyApply?: boolean;\n}\n\n/**\n * Animation timeline should be parsed into animation units,\n * which record all necessary configs for animator to execute animation.\n *\n * animation unit time:\n * |<--initialDelay-->| |<--loopDelay--><--Slices--><--looDelayAfter-->| |<--loopDuration-->|\n * |<-----------------loopDuration--------------->|\n */\nexport interface IAnimationUnit {\n /**\n * initial delay time before any animation loop\n */\n initialDelay: number;\n /**\n * total time for one animation loop\n */\n loopDuration: number;\n /**\n * delay time before time slices\n */\n loopDelay: number;\n /**\n * delay time after time slices\n */\n loopDelayAfter: number;\n /**\n * animating time in one animation loop\n */\n loopAnimateDuration: number;\n loopCount: number;\n totalTime: number;\n timeSlices: IAnimationTimeSlice[];\n}\n\nexport interface IAnimationRecord {\n start: IGraphic;\n end: IGraphic;\n changes: any[];\n}\n\nexport interface IAnimationParameters {\n width: number;\n height: number;\n mark: IMark;\n group: IMark | null;\n elementIndex: number;\n elementCount: number;\n view: any;\n}\n\nexport interface IParsedAnimationConfig {\n state: string;\n timeline: IAnimationTimeline;\n originConfig: IAnimationConfig;\n id: string;\n}\n\nexport interface IParsedAnimationAttrs {\n from?: any;\n to?: any;\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: any;\n}\n\n// animate structure\n\nexport interface IAnimatorOptions {\n state: string;\n timeline: IAnimationTimeline;\n id: string;\n}\n\nexport interface IAnimator {\n id: number;\n element: IElement;\n animationOptions: IAnimatorOptions;\n isAnimating: boolean;\n\n /** execute animation */\n animate: (animationParameters: IAnimationParameters, parameters: any) => this;\n /** set animation callback */\n callback: (callbackFunction: (...args: any[]) => void) => this;\n\n // animation control\n stop: (stopState?: 'start' | 'end', invokeCallback?: boolean) => this;\n pause: () => this;\n resume: () => this;\n\n /** set additional initial animation delay */\n startAt: (startTime: number) => this;\n /** get total animation execution time */\n getTotalAnimationTime: () => number;\n\n getEndAttributes: () => Record<string, any>;\n}\n\nexport interface IAnimateArranger {\n // animation control api\n parallel: (arranger: IAnimateArranger) => this;\n after: (arranger: IAnimateArranger) => this;\n\n // internal properties\n afterArranger: IAnimateArranger;\n parallelArrangers: IAnimateArranger[];\n animators: IAnimator[];\n totalTime: number;\n startTime: number;\n endTime: number;\n arrangeTime: () => void;\n}\n\nexport interface IBaseAnimate {\n // animation control\n stop: () => this;\n pause: () => this;\n resume: () => this;\n\n // internal animation process api\n animate: () => this;\n enable: () => this;\n disable: () => this;\n enableAnimationState: (state: string | string[]) => this;\n disableAnimationState: (state: string | string[]) => this;\n isAnimating: () => boolean;\n\n release: () => void;\n}\n\nexport interface IViewAnimate extends IBaseAnimate {\n animateAddition: (mark: IMark) => this;\n}\n\nexport interface IAnimate extends IBaseAnimate {\n mark: IMark;\n\n // additional animation control\n run: (config: IAnimationConfig | IAnimationConfig[]) => IAnimateArranger;\n runAnimationByState: (animationState: string) => IAnimateArranger;\n stopAnimationByState: (animationState: string) => this;\n pauseAnimationByState: (animationState: string) => this;\n resumeAnimationByState: (animationState: string) => this;\n reverse: () => this;\n restart: () => this;\n record: () => this;\n recordEnd: () => this;\n\n // internal animation process api\n updateConfig: (config: Record<string, IAnimationConfig | IAnimationConfig[]>) => void;\n updateState: (state: MarkFunctionType<string> | null) => void;\n isElementAnimating: (element: IElement) => boolean;\n getAnimatorCount: () => number;\n getElementAnimators: (element: IElement | IElement[], animationState?: string) => IAnimator[];\n release: () => void;\n}\n"]}
1
+ {"version":3,"sources":["../src/types/animate.ts"],"names":[],"mappings":"","file":"animate.js","sourcesContent":["import type { IGraphic, ACustomAnimate, EasingType } from '@visactor/vrender-core';\nimport type { IPointLike } from '@visactor/vutils';\nimport type { MarkFunctionCallback, MarkFunctionType } from './mark';\nimport type { IMark } from './grammar';\nimport type { IElement } from './element';\n\nexport type TypeAnimation<T extends IElement> = (\n element: T,\n options: any,\n animationParameters: IAnimationParameters\n) => { from?: { [channel: string]: any }; to?: { [channel: string]: any } };\n\nexport interface IClipAnimationOptions {\n clipDimension?: 'x' | 'y' | 'auto' | 'default';\n}\n\nexport interface IGrowCartesianAnimationOptions {\n orient?: 'positive' | 'negative';\n overall?: boolean | number;\n direction?: 'x' | 'y' | 'xy';\n}\n\nexport interface IGrowAngleAnimationOptions {\n orient?: 'clockwise' | 'anticlockwise';\n overall?: boolean | number;\n}\n\nexport interface IGrowRadiusAnimationOptions {\n orient?: 'inside' | 'outside';\n overall?: boolean | number;\n}\n\nexport interface IGrowPointsAnimationOptions {\n orient?: 'positive' | 'negative';\n}\n\nexport interface IGrowPointsOverallAnimationOptions extends IGrowPointsAnimationOptions {\n center?: IPointLike;\n}\n\nexport interface IScaleAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n}\n\nexport interface IMoveAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n orient?: 'positive' | 'negative';\n offset?: number;\n point?: { x?: number; y?: number };\n}\n\nexport interface IRotateAnimationOptions {\n orient?: 'clockwise' | 'anticlockwise';\n angle?: number;\n}\n\n/** VGrammar 层提供的图元text上的图形属性,现在暂时会和VRender不一致 */\nexport interface TextItemAttributes {\n fontSize?: number;\n lineHeight?: number;\n font?: string;\n fontStyle?: string;\n fontVariant?: string;\n fontWeight?: string | number;\n lineBreak?: string;\n text?: string | string[];\n limit?: number;\n align?: string;\n baseline?: string;\n ellipsis?: string | boolean;\n dir?: string;\n}\n\n/** animation */\nexport type MarkFunctionValueType<T> = MarkFunctionCallback<T> | T;\n\nexport type IAnimationConfig = IAnimationTimeline | IAnimationTypeConfig;\n\n/**\n * state动画,暂时只支持简单配置\n */\nexport interface IStateAnimationConfig {\n duration?: number;\n easing?: EasingType;\n}\n\n/**\n * 动画 config 简化配置\n */\nexport interface IAnimationTypeConfig {\n type?: string;\n channel?: IAnimationChannelAttrs | IAnimationChannelAttributes;\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: MarkFunctionValueType<any>;\n easing?: EasingType;\n delay?: MarkFunctionValueType<number>;\n duration?: MarkFunctionValueType<number>;\n oneByOne?: MarkFunctionValueType<boolean | number>;\n startTime?: MarkFunctionValueType<number>;\n totalTime?: MarkFunctionValueType<number>;\n /** loop: true 无限循环; loop: 正整数,表示循环的次数 */\n loop?: boolean | number;\n /** 动画 effect 配置项 */\n options?: MarkFunctionValueType<any>;\n /** 动画执行相关控制配置项 */\n controlOptions?: IAnimationControlOptions;\n}\n\n/**\n * 动画 timeline 完整配置,一条时间线内的动画单元只能串行\n * 多个timeline是可以并行的\n * 考虑到同一图元不能在多个timeline上,所以timeline不应该提供数组配置的能力\n */\nexport interface IAnimationTimeline {\n /** 为了方便动画编排,用户可以设置 id 用于识别时间线 */\n id?: string;\n /** 时间切片 */\n timeSlices: IAnimationTimeSlice | IAnimationTimeSlice[];\n /** 动画开始的相对时间,可以为负数 */\n startTime?: MarkFunctionValueType<number>;\n /** 动画时长 */\n totalTime?: MarkFunctionValueType<number>;\n /** 动画依次执行的延迟 */\n oneByOne?: MarkFunctionValueType<number | boolean>;\n /** loop: true 无限循环; loop: 正整数,表示循环的次数 */\n loop?: MarkFunctionValueType<number | boolean>;\n /** 对图元元素进行划分,和过滤类似,但是不同时间线不能同时作用在相同的元素上 */\n partitioner?: MarkFunctionCallback<boolean>;\n /** 对同一时间线上的元素进行排序 */\n sort?: (datumA: any, datumB: any, elementA: IElement, elementB: IElement, parameters: any) => number;\n /** 动画执行相关控制配置项 */\n controlOptions?: IAnimationControlOptions;\n}\n\nexport interface IAnimationTimeSlice {\n effects: IAnimationEffect | IAnimationEffect[];\n duration?: MarkFunctionValueType<number>;\n delay?: MarkFunctionValueType<number>;\n}\n\nexport type IAnimationChannelFunction = (datum: any, element: IElement, parameters: IAnimationParameters) => any;\nexport type IAnimationChannelAttrs = Record<\n string,\n {\n from?: any | IAnimationChannelFunction;\n to?: any | IAnimationChannelFunction;\n }\n>;\nexport type IAnimationChannelAttributes = string[];\nexport type IAnimationChannelInterpolator = (\n ratio: number,\n from: any,\n to: any,\n nextAttributes: any,\n datum: any,\n element: IElement,\n parameters: IAnimationParameters\n) => boolean | void;\n\n// TODO: fix ACustomAnimate<any>\nexport interface IAnimationCustomConstructor {\n new (from: any, to: any, duration: number, ease: EasingType, parameters?: any): ACustomAnimate<any>;\n}\n\nexport interface IAnimationEffect {\n type?: string;\n channel?: IAnimationChannelAttrs | IAnimationChannelAttributes;\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: MarkFunctionValueType<any>;\n easing?: EasingType;\n /** options暂时没有处理 */\n options?: MarkFunctionValueType<any>;\n}\n\nexport interface IAnimationControlOptions {\n /** 当动画状态变更时清空动画 */\n stopWhenStateChange?: boolean;\n /** 是否立即应用动画初始状态 */\n immediatelyApply?: boolean;\n}\n\n/**\n * Animation timeline should be parsed into animation units,\n * which record all necessary configs for animator to execute animation.\n *\n * animation unit time:\n * |<--initialDelay-->| |<--loopDelay--><--Slices--><--looDelayAfter-->| |<--loopDuration-->|\n * |<-----------------loopDuration--------------->|\n */\nexport interface IAnimationUnit {\n /**\n * initial delay time before any animation loop\n */\n initialDelay: number;\n /**\n * total time for one animation loop\n */\n loopDuration: number;\n /**\n * delay time before time slices\n */\n loopDelay: number;\n /**\n * delay time after time slices\n */\n loopDelayAfter: number;\n /**\n * animating time in one animation loop\n */\n loopAnimateDuration: number;\n loopCount: number;\n totalTime: number;\n timeSlices: IAnimationTimeSlice[];\n}\n\nexport interface IAnimationRecord {\n start: IGraphic;\n end: IGraphic;\n changes: any[];\n}\n\nexport interface IAnimationParameters {\n width: number;\n height: number;\n mark: IMark;\n group: IMark | null;\n elementIndex: number;\n elementCount: number;\n view: any;\n}\n\nexport interface IParsedAnimationConfig {\n state: string;\n timeline: IAnimationTimeline;\n originConfig: IAnimationConfig;\n id: string;\n}\n\nexport interface IParsedAnimationAttrs {\n from?: any;\n to?: any;\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: any;\n}\n\n// animate structure\n\nexport interface IAnimatorOptions {\n state: string;\n timeline: IAnimationTimeline;\n id: string;\n}\n\nexport interface IAnimator {\n id: number;\n element: IElement;\n animationOptions: IAnimatorOptions;\n isAnimating: boolean;\n\n /** execute animation */\n animate: (animationParameters: IAnimationParameters, parameters: any) => this;\n /** set animation callback */\n callback: (callbackFunction: (...args: any[]) => void) => this;\n\n // animation control\n stop: (stopState?: 'start' | 'end', invokeCallback?: boolean) => this;\n pause: () => this;\n resume: () => this;\n\n /** set additional initial animation delay */\n startAt: (startTime: number) => this;\n /** get total animation execution time */\n getTotalAnimationTime: () => number;\n\n getEndAttributes: () => Record<string, any>;\n}\n\nexport interface IAnimateArranger {\n // animation control api\n parallel: (arranger: IAnimateArranger) => this;\n after: (arranger: IAnimateArranger) => this;\n\n // internal properties\n afterArranger: IAnimateArranger;\n parallelArrangers: IAnimateArranger[];\n animators: IAnimator[];\n totalTime: number;\n startTime: number;\n endTime: number;\n arrangeTime: () => void;\n}\n\nexport interface IBaseAnimate {\n // animation control\n stop: () => this;\n pause: () => this;\n resume: () => this;\n\n // internal animation process api\n animate: () => this;\n enable: () => this;\n disable: () => this;\n enableAnimationState: (state: string | string[]) => this;\n disableAnimationState: (state: string | string[]) => this;\n isAnimating: () => boolean;\n\n release: () => void;\n}\n\nexport interface IViewAnimate extends IBaseAnimate {\n animateAddition: (mark: IMark) => this;\n}\n\nexport interface IAnimate extends IBaseAnimate {\n mark: IMark;\n\n // additional animation control\n run: (config: IAnimationConfig | IAnimationConfig[]) => IAnimateArranger;\n runAnimationByState: (animationState: string) => IAnimateArranger;\n stopAnimationByState: (animationState: string) => this;\n pauseAnimationByState: (animationState: string) => this;\n resumeAnimationByState: (animationState: string) => this;\n reverse: () => this;\n restart: () => this;\n record: () => this;\n recordEnd: () => this;\n\n // internal animation process api\n updateConfig: (config: Record<string, IAnimationConfig | IAnimationConfig[]>) => void;\n updateState: (state: MarkFunctionType<string> | null) => void;\n isElementAnimating: (element: IElement) => boolean;\n getAnimatorCount: () => number;\n getElementAnimators: (element: IElement | IElement[], animationState?: string) => IAnimator[];\n release: () => void;\n}\n"]}
package/es/types/base.js CHANGED
@@ -1,2 +1,2 @@
1
1
  export { };
2
- //# sourceMappingURL=base.js.map
2
+ //# sourceMappingURL=base.js.map
@@ -1,14 +1,14 @@
1
- import type { IGraphicAttribute, ISymbolGraphicAttribute, ITextAttribute, ITextGraphicAttribute } from '@visactor/vrender';
2
- import type { AxisBaseAttributes, BaseCrosshairAttrs, BaseLabelAttrs, DataLabelAttrs, DataZoomAttributes, Direction, GridBaseAttributes, LegendBaseAttributes, OrientType, PlayerAttributes, ScrollBarAttributes, SliderAttributes, TitleAttrs, TooltipAttributes, TooltipRowAttrs } from '@visactor/vrender-components';
1
+ import type { IGraphicAttribute, ITextAttribute } from '@visactor/vrender-core';
2
+ import type { AxisBaseAttributes, BaseLabelAttrs, DataLabelAttrs, DataZoomAttributes, Direction, GridBaseAttributes, LegendBaseAttributes, OrientType, PlayerAttributes, ScrollBarAttributes, SliderAttributes, TitleAttrs } from '@visactor/vrender-components';
3
3
  import type { AxisEnum, ComponentEnum } from '../graph';
4
4
  import type { Nil } from './base';
5
5
  import type { IComponent, IData, IGroupMark, IMark, IScale } from './grammar';
6
- import type { ChannelEncodeType, ComponentSpec, FieldEncodeType, GenerateBasicEncoderSpec, MarkFunctionType, ScaleEncodeType } from './mark';
7
- import type { IPointLike } from '@visactor/vutils';
8
- import type { IElement } from './element';
6
+ import type { ChannelEncodeType, ComponentSpec, GenerateBasicEncoderSpec, MarkFunctionType, ScaleEncodeType } from './mark';
9
7
  import type { IView } from './view';
8
+ import type { IBaseScale } from '@visactor/vscale';
10
9
  export interface IScaleComponent extends IComponent {
11
10
  scale: (scale?: IScale | string | Nil) => this;
11
+ getScale: () => IScale;
12
12
  }
13
13
  export interface ScaleComponentSpec<BasicEncoderSpec extends GenerateBasicEncoderSpec<IGraphicAttribute> = GenerateBasicEncoderSpec<IGraphicAttribute>> extends ComponentSpec<BasicEncoderSpec> {
14
14
  scale?: IScale | string;
@@ -49,32 +49,13 @@ export interface GridSpec extends ScaleComponentSpec<Partial<GridBaseAttributes>
49
49
  export type LegendType = 'auto' | 'discrete' | 'color' | 'size';
50
50
  export interface ILegend extends IScaleComponent {
51
51
  legendType: (legendType: LegendType | Nil) => this;
52
- target: (data: IData | string | Nil, filter: string | ((datum: any, legendValues: any) => boolean) | Nil) => this;
53
52
  setSelected: (selectedValues: any[]) => this;
53
+ isContinuousLegend: () => boolean;
54
54
  }
55
55
  export interface LegendSpec extends ScaleComponentSpec<LegendBaseAttributes> {
56
56
  componentType: ComponentEnum.legend;
57
57
  legendType?: LegendType;
58
58
  shapeScale?: IScale | string;
59
- target?: {
60
- data: IData | string;
61
- filter: string | ((datum: any, legendValues: any[]) => boolean);
62
- };
63
- }
64
- export type CrosshairType = 'x' | 'y' | 'angle' | 'radius' | 'radius-polygon';
65
- export type CrosshairShape = 'line' | 'rect';
66
- export interface ICrosshair extends IScaleComponent {
67
- crosshairType: (crosshairType: CrosshairType | Nil) => this;
68
- crosshairShape: (crosshairShape: CrosshairShape | Nil) => this;
69
- }
70
- export interface CrosshairSpec extends ScaleComponentSpec<BaseCrosshairAttrs> {
71
- componentType: ComponentEnum.crosshair;
72
- crosshairType?: CrosshairType;
73
- crosshairShape?: CrosshairShape;
74
- componentConfig?: {
75
- radius?: number;
76
- center?: IPointLike;
77
- };
78
59
  }
79
60
  export type SliderFilterValue = {
80
61
  start: number;
@@ -83,17 +64,12 @@ export type SliderFilterValue = {
83
64
  export interface ISlider extends IComponent {
84
65
  min: (min: MarkFunctionType<number> | Nil) => this;
85
66
  max: (max: MarkFunctionType<number> | Nil) => this;
86
- target: (data: IData | string | Nil, filter: string | ((datum: any, value: SliderFilterValue) => boolean) | Nil) => this;
87
67
  setStartEndValue: (start?: number, end?: number) => this;
88
68
  }
89
69
  export interface SliderSpec extends ComponentSpec<Partial<SliderAttributes>> {
90
70
  componentType: ComponentEnum.slider;
91
71
  min?: MarkFunctionType<number>;
92
72
  max?: MarkFunctionType<number>;
93
- target?: {
94
- data: IData | string;
95
- filter: string | ((datum: any, value: SliderFilterValue) => boolean);
96
- };
97
73
  }
98
74
  export type DatazoomFilterValue = {
99
75
  start: number;
@@ -103,8 +79,13 @@ export type DatazoomFilterValue = {
103
79
  };
104
80
  export interface IDatazoom extends IComponent {
105
81
  preview: (data: IData | string | Nil, x: ScaleEncodeType | Nil, y: ScaleEncodeType | Nil, x1?: ChannelEncodeType | Nil, y1?: ChannelEncodeType | Nil) => this;
106
- target: (data: IData | string | Nil, filter: string | ((datum: any, value: DatazoomFilterValue) => boolean) | Nil) => this;
107
82
  setStartEndValue: (start?: number, end?: number) => this;
83
+ getStartEndValue: () => {
84
+ start: number;
85
+ end: number;
86
+ } | Nil;
87
+ invertDatazoomRatio: (ratio: number) => any;
88
+ getDatazoomMainScale: () => IBaseScale;
108
89
  }
109
90
  export type DataZoomEncoderSpec = GenerateBasicEncoderSpec<Partial<DataZoomAttributes> & {
110
91
  x1?: number;
@@ -119,10 +100,6 @@ export interface DatazoomSpec extends ComponentSpec<DataZoomEncoderSpec> {
119
100
  x1?: ChannelEncodeType;
120
101
  y1?: ChannelEncodeType;
121
102
  };
122
- target?: {
123
- data: IData | string;
124
- filter: string | ((datum: any, value: DatazoomFilterValue) => boolean);
125
- };
126
103
  }
127
104
  export interface ILabel extends IComponent {
128
105
  labelStyle: (attributes: MarkFunctionType<Partial<BaseLabelAttrs>>) => this;
@@ -145,7 +122,7 @@ export type PlayerFilterValue = {
145
122
  };
146
123
  export interface IPlayer extends IComponent {
147
124
  playerType: (playerType: PlayerType) => this;
148
- target: (data: IData | string | Nil, source: IData | string | any[] | Nil) => this;
125
+ source: (source: IData | string | any[] | Nil) => this;
149
126
  play: () => this;
150
127
  pause: () => this;
151
128
  backward: () => this;
@@ -154,52 +131,7 @@ export interface IPlayer extends IComponent {
154
131
  export interface PlayerSpec extends ComponentSpec<Partial<PlayerAttributes>> {
155
132
  componentType: ComponentEnum.player;
156
133
  playerType?: PlayerType;
157
- target?: {
158
- data: IData | string;
159
- source: IData | string | any[];
160
- };
161
- }
162
- export type CustomTooltipCallback = (datum: any, element: IElement, parameters: any) => TooltipRowAttrs | TooltipRowAttrs[];
163
- export interface ITooltipRow {
164
- visible?: boolean;
165
- key?: MarkFunctionType<string | Partial<ITextGraphicAttribute>> | FieldEncodeType;
166
- value?: MarkFunctionType<string | Partial<ITextGraphicAttribute>> | FieldEncodeType;
167
- symbol?: MarkFunctionType<string | Partial<ISymbolGraphicAttribute>> | FieldEncodeType;
168
- }
169
- export interface IBaseTooltip extends IComponent {
170
- title: (title: ITooltipRow | string | CustomTooltipCallback | Nil) => this;
171
- content: (content: ITooltipRow | ITooltipRow[] | CustomTooltipCallback | Nil) => this;
172
- }
173
- export interface ITooltip extends IBaseTooltip {
174
- target: (mark: IMark | IMark[] | string | string[] | Nil) => this;
175
- }
176
- export interface BaseTooltipSpec extends ComponentSpec<TooltipAttributes> {
177
- title?: ITooltipRow | string | CustomTooltipCallback;
178
- content?: ITooltipRow | ITooltipRow[] | CustomTooltipCallback;
179
- }
180
- export interface TooltipSpec extends BaseTooltipSpec {
181
- componentType: ComponentEnum.tooltip;
182
- target?: IMark | IMark[] | string | string[];
183
- }
184
- export type TooltipType = 'x' | 'y' | 'angle' | 'radius';
185
- export interface IDimensionTooltip extends IBaseTooltip {
186
- scale: (scale?: IScale | string | Nil) => this;
187
- tooltipType: (tooltipType: TooltipType | Nil) => this;
188
- target: (data: IData | string | Nil, filter: string | ((datum: any, tooltipValue: any) => boolean) | Nil) => this;
189
- avoidMark: (mark: IMark | IMark[] | string | string[] | Nil) => this;
190
- }
191
- export interface DimensionTooltipSpec extends BaseTooltipSpec {
192
- componentType: ComponentEnum.dimensionTooltip;
193
- scale?: IScale | string;
194
- tooltipType?: TooltipType;
195
- target?: {
196
- data: IData | string;
197
- filter: string | ((datum: any, tooltipValue: any) => boolean);
198
- };
199
- avoidMark?: IMark | IMark[] | string | string[];
200
- componentConfig?: {
201
- center?: IPointLike;
202
- };
134
+ source?: IData | string | any[];
203
135
  }
204
136
  export interface ITitle extends IComponent {
205
137
  title: (text: MarkFunctionType<string | number | number[] | string[]> | Nil) => this;
@@ -217,23 +149,19 @@ export type ScrollbarFilterValue = {
217
149
  endRatio: number;
218
150
  };
219
151
  export interface IScrollbar extends IScaleComponent {
220
- target: (data: IData | string | Nil, filter: string | ((datum: any, value: ScrollbarFilterValue) => boolean) | Nil) => this;
221
152
  container: (container: IGroupMark | string | Nil) => this;
222
153
  direction: (direction: MarkFunctionType<Direction> | Nil) => this;
223
154
  position: (position: MarkFunctionType<OrientType> | Nil) => this;
224
155
  setScrollStart: (start: number) => this;
156
+ getScrollRange: () => [number, number] | Nil;
225
157
  }
226
158
  export interface ScrollbarSpec extends ScaleComponentSpec<Partial<ScrollBarAttributes>> {
227
159
  componentType: ComponentEnum.scrollbar;
228
- target?: {
229
- data: IData | string;
230
- filter: string | ((datum: any, value: ScrollbarFilterValue) => boolean);
231
- };
232
160
  container?: IGroupMark | string;
233
161
  direction?: MarkFunctionType<Direction>;
234
162
  position?: MarkFunctionType<OrientType>;
235
163
  }
236
- export type BuiltInComponentSpec = AxisSpec | LegendSpec | CrosshairSpec | SliderSpec | DatazoomSpec | LabelSpec | PlayerSpec | TooltipSpec | DimensionTooltipSpec | TitleSpec | ScrollbarSpec;
164
+ export type BuiltInComponentSpec = AxisSpec | LegendSpec | SliderSpec | DatazoomSpec | LabelSpec | PlayerSpec | TitleSpec | ScrollbarSpec;
237
165
  export interface IComponentConstructor {
238
166
  readonly componentType: string;
239
167
  new (view: IView, group?: IGroupMark, mode?: '2d' | '3d'): IComponent;
@@ -1,2 +1,2 @@
1
1
  export { };
2
- //# sourceMappingURL=component.js.map
2
+ //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types/component.ts"],"names":[],"mappings":"","file":"component.js","sourcesContent":["import type {\n IGraphicAttribute,\n ISymbolGraphicAttribute,\n ITextAttribute,\n ITextGraphicAttribute\n} from '@visactor/vrender';\nimport type {\n AxisBaseAttributes,\n BaseCrosshairAttrs,\n BaseLabelAttrs,\n DataLabelAttrs,\n DataZoomAttributes,\n Direction,\n GridBaseAttributes,\n LegendBaseAttributes,\n OrientType,\n PlayerAttributes,\n ScrollBarAttributes,\n SliderAttributes,\n TitleAttrs,\n TooltipAttributes,\n TooltipRowAttrs\n} from '@visactor/vrender-components';\nimport type { AxisEnum, ComponentEnum } from '../graph';\nimport type { Nil } from './base';\nimport type { IComponent, IData, IGroupMark, IMark, IScale } from './grammar';\nimport type {\n ChannelEncodeType,\n ComponentSpec,\n FieldEncodeType,\n GenerateBasicEncoderSpec,\n MarkFunctionType,\n ScaleEncodeType\n} from './mark';\nimport type { IPointLike } from '@visactor/vutils';\nimport type { IElement } from './element';\nimport type { IView } from './view';\n\n// scale component\n\nexport interface IScaleComponent extends IComponent {\n scale: (scale?: IScale | string | Nil) => this;\n}\n\nexport interface ScaleComponentSpec<\n BasicEncoderSpec extends GenerateBasicEncoderSpec<IGraphicAttribute> = GenerateBasicEncoderSpec<IGraphicAttribute>\n> extends ComponentSpec<BasicEncoderSpec> {\n scale?: IScale | string;\n}\n\n// axis component\n\nexport type AxisType = 'line' | 'circle';\n\nexport interface IAxis extends IScaleComponent {\n axisType: (axisType: AxisType | Nil) => this;\n tickCount: (tickCount: MarkFunctionType<number> | Nil) => this;\n inside: (inside: MarkFunctionType<boolean> | Nil) => this;\n baseValue: (baseValue: MarkFunctionType<number> | Nil) => this;\n\n // internal interface\n getAxisComponentType: () => keyof typeof AxisEnum;\n}\n\nexport interface AxisSpec extends ScaleComponentSpec<Partial<AxisBaseAttributes>> {\n componentType: ComponentEnum.axis;\n axisType?: AxisType;\n tickCount?: MarkFunctionType<number>;\n inside?: MarkFunctionType<boolean>;\n baseValue?: MarkFunctionType<number>;\n}\n\n// grid component\n\nexport type GridShape = 'line' | 'circle' | 'polygon';\n\nexport interface IGrid extends IScaleComponent {\n gridType: (gridType: AxisType | Nil) => this;\n gridShape: (gridShape: GridShape | Nil) => this;\n target: (axis: IAxis | string | Nil) => this;\n tickCount: (tickCount: MarkFunctionType<number> | Nil) => this;\n inside: (inside: MarkFunctionType<boolean> | Nil) => this;\n baseValue: (baseValue: MarkFunctionType<number> | Nil) => this;\n}\n\nexport interface GridSpec extends ScaleComponentSpec<Partial<GridBaseAttributes>> {\n componentType: ComponentEnum.grid;\n gridType?: AxisType;\n gridShape?: GridShape;\n target?: IAxis | string;\n tickCount?: MarkFunctionType<number>;\n inside?: MarkFunctionType<boolean>;\n baseValue?: MarkFunctionType<number>;\n}\n\n// legend component\n\nexport type LegendType = 'auto' | 'discrete' | 'color' | 'size';\n\nexport interface ILegend extends IScaleComponent {\n legendType: (legendType: LegendType | Nil) => this;\n target: (data: IData | string | Nil, filter: string | ((datum: any, legendValues: any) => boolean) | Nil) => this;\n\n // immediate functions\n setSelected: (selectedValues: any[]) => this;\n}\n\nexport interface LegendSpec extends ScaleComponentSpec<LegendBaseAttributes> {\n componentType: ComponentEnum.legend;\n legendType?: LegendType;\n shapeScale?: IScale | string;\n target?: {\n data: IData | string;\n filter: string | ((datum: any, legendValues: any[]) => boolean);\n };\n}\n\n// crosshair component\n\nexport type CrosshairType = 'x' | 'y' | 'angle' | 'radius' | 'radius-polygon';\n\nexport type CrosshairShape = 'line' | 'rect';\n\nexport interface ICrosshair extends IScaleComponent {\n crosshairType: (crosshairType: CrosshairType | Nil) => this;\n crosshairShape: (crosshairShape: CrosshairShape | Nil) => this;\n}\n\nexport interface CrosshairSpec extends ScaleComponentSpec<BaseCrosshairAttrs> {\n componentType: ComponentEnum.crosshair;\n crosshairType?: CrosshairType;\n crosshairShape?: CrosshairShape;\n componentConfig?: { radius?: number; center?: IPointLike };\n}\n\n// slider component\n\nexport type SliderFilterValue = { start: number; end: number };\n\nexport interface ISlider extends IComponent {\n min: (min: MarkFunctionType<number> | Nil) => this;\n max: (max: MarkFunctionType<number> | Nil) => this;\n target: (\n data: IData | string | Nil,\n filter: string | ((datum: any, value: SliderFilterValue) => boolean) | Nil\n ) => this;\n\n // immediate functions\n setStartEndValue: (start?: number, end?: number) => this;\n}\n\nexport interface SliderSpec extends ComponentSpec<Partial<SliderAttributes>> {\n componentType: ComponentEnum.slider;\n min?: MarkFunctionType<number>;\n max?: MarkFunctionType<number>;\n target?: {\n data: IData | string;\n filter: string | ((datum: any, value: SliderFilterValue) => boolean);\n };\n}\n\n// datazoom component\n\nexport type DatazoomFilterValue = { start: number; end: number; startRatio: number; endRatio: number };\n\nexport interface IDatazoom extends IComponent {\n preview: (\n data: IData | string | Nil,\n x: ScaleEncodeType | Nil,\n y: ScaleEncodeType | Nil,\n x1?: ChannelEncodeType | Nil,\n y1?: ChannelEncodeType | Nil\n ) => this;\n target: (\n data: IData | string | Nil,\n filter: string | ((datum: any, value: DatazoomFilterValue) => boolean) | Nil\n ) => this;\n\n // immediate functions\n setStartEndValue: (start?: number, end?: number) => this;\n}\n\nexport type DataZoomEncoderSpec = GenerateBasicEncoderSpec<Partial<DataZoomAttributes> & { x1?: number; y1?: number }>;\nexport interface DatazoomSpec extends ComponentSpec<DataZoomEncoderSpec> {\n componentType: ComponentEnum.datazoom;\n preview?: {\n data: IData | string;\n x?: ScaleEncodeType;\n y?: ScaleEncodeType;\n x1?: ChannelEncodeType;\n y1?: ChannelEncodeType;\n };\n target?: {\n data: IData | string;\n filter: string | ((datum: any, value: DatazoomFilterValue) => boolean);\n };\n}\n\n// label component\n\nexport interface ILabel extends IComponent {\n labelStyle: (attributes: MarkFunctionType<Partial<BaseLabelAttrs>>) => this;\n size: (attributes: MarkFunctionType<DataLabelAttrs['size']>) => this;\n target: (mark: IMark | IMark[] | string | string[] | Nil) => this;\n}\n\nexport type LabelEncoderSpec = GenerateBasicEncoderSpec<Partial<BaseLabelAttrs> & { text?: ITextAttribute['text'] }>;\nexport interface LabelSpec extends ComponentSpec<LabelEncoderSpec> {\n componentType: ComponentEnum.label;\n labelStyle?: MarkFunctionType<Partial<BaseLabelAttrs>>;\n size?: MarkFunctionType<DataLabelAttrs['size']>;\n target?: IMark | IMark[] | string | string[];\n}\n\n// player component\n\nexport type PlayerType = 'auto' | 'discrete' | 'continuous';\n\nexport type PlayerFilterValue = { index: number; value: any };\n\nexport interface IPlayer extends IComponent {\n playerType: (playerType: PlayerType) => this;\n target: (data: IData | string | Nil, source: IData | string | any[] | Nil) => this;\n\n // immediate functions\n play: () => this;\n pause: () => this;\n backward: () => this;\n forward: () => this;\n}\n\nexport interface PlayerSpec extends ComponentSpec<Partial<PlayerAttributes>> {\n componentType: ComponentEnum.player;\n playerType?: PlayerType;\n target?: {\n data: IData | string;\n source: IData | string | any[];\n };\n}\n\n// tooltip component\n\nexport type CustomTooltipCallback = (\n datum: any,\n element: IElement,\n parameters: any\n) => TooltipRowAttrs | TooltipRowAttrs[];\n\nexport interface ITooltipRow {\n visible?: boolean;\n key?: MarkFunctionType<string | Partial<ITextGraphicAttribute>> | FieldEncodeType;\n value?: MarkFunctionType<string | Partial<ITextGraphicAttribute>> | FieldEncodeType;\n symbol?: MarkFunctionType<string | Partial<ISymbolGraphicAttribute>> | FieldEncodeType;\n}\n\nexport interface IBaseTooltip extends IComponent {\n title: (title: ITooltipRow | string | CustomTooltipCallback | Nil) => this;\n content: (content: ITooltipRow | ITooltipRow[] | CustomTooltipCallback | Nil) => this;\n}\n\nexport interface ITooltip extends IBaseTooltip {\n target: (mark: IMark | IMark[] | string | string[] | Nil) => this;\n}\n\nexport interface BaseTooltipSpec extends ComponentSpec<TooltipAttributes> {\n title?: ITooltipRow | string | CustomTooltipCallback;\n content?: ITooltipRow | ITooltipRow[] | CustomTooltipCallback;\n}\n\nexport interface TooltipSpec extends BaseTooltipSpec {\n componentType: ComponentEnum.tooltip;\n target?: IMark | IMark[] | string | string[];\n}\n\nexport type TooltipType = 'x' | 'y' | 'angle' | 'radius';\n\nexport interface IDimensionTooltip extends IBaseTooltip {\n scale: (scale?: IScale | string | Nil) => this;\n tooltipType: (tooltipType: TooltipType | Nil) => this;\n target: (data: IData | string | Nil, filter: string | ((datum: any, tooltipValue: any) => boolean) | Nil) => this;\n avoidMark: (mark: IMark | IMark[] | string | string[] | Nil) => this;\n}\n\nexport interface DimensionTooltipSpec extends BaseTooltipSpec {\n componentType: ComponentEnum.dimensionTooltip;\n scale?: IScale | string;\n tooltipType?: TooltipType;\n target?: {\n data: IData | string;\n filter: string | ((datum: any, tooltipValue: any) => boolean);\n };\n avoidMark?: IMark | IMark[] | string | string[];\n componentConfig?: { center?: IPointLike };\n}\n\n// title component\n\nexport interface ITitle extends IComponent {\n title: (text: MarkFunctionType<string | number | number[] | string[]> | Nil) => this;\n subTitle: (text: MarkFunctionType<string | number | number[] | string[]> | Nil) => this;\n}\n\nexport interface TitleSpec extends ComponentSpec<Partial<TitleAttrs>> {\n componentType: ComponentEnum.title;\n title?: MarkFunctionType<string | number | number[] | string[]>;\n subTitle?: MarkFunctionType<string | number | number[] | string[]>;\n}\n\n// scrollbar component\n\nexport type ScrollbarFilterValue = { start?: number; end?: number; startRatio: number; endRatio: number };\n\nexport interface IScrollbar extends IScaleComponent {\n target: (\n data: IData | string | Nil,\n filter: string | ((datum: any, value: ScrollbarFilterValue) => boolean) | Nil\n ) => this;\n container: (container: IGroupMark | string | Nil) => this;\n direction: (direction: MarkFunctionType<Direction> | Nil) => this;\n position: (position: MarkFunctionType<OrientType> | Nil) => this;\n\n // immediate functions\n setScrollStart: (start: number) => this;\n}\n\nexport interface ScrollbarSpec extends ScaleComponentSpec<Partial<ScrollBarAttributes>> {\n componentType: ComponentEnum.scrollbar;\n target?: {\n data: IData | string;\n filter: string | ((datum: any, value: ScrollbarFilterValue) => boolean);\n };\n container?: IGroupMark | string;\n direction?: MarkFunctionType<Direction>;\n position?: MarkFunctionType<OrientType>;\n}\n\n// built-in components\n\nexport type BuiltInComponentSpec =\n | AxisSpec\n | LegendSpec\n | CrosshairSpec\n | SliderSpec\n | DatazoomSpec\n | LabelSpec\n | PlayerSpec\n | TooltipSpec\n | DimensionTooltipSpec\n | TitleSpec\n | ScrollbarSpec;\n\nexport interface IComponentConstructor {\n readonly componentType: string;\n\n new (view: IView, group?: IGroupMark, mode?: '2d' | '3d'): IComponent;\n}\n"]}
1
+ {"version":3,"sources":["../src/types/component.ts"],"names":[],"mappings":"","file":"component.js","sourcesContent":["import type { IGraphicAttribute, ITextAttribute } from '@visactor/vrender-core';\nimport type {\n AxisBaseAttributes,\n BaseLabelAttrs,\n DataLabelAttrs,\n DataZoomAttributes,\n Direction,\n GridBaseAttributes,\n LegendBaseAttributes,\n OrientType,\n PlayerAttributes,\n ScrollBarAttributes,\n SliderAttributes,\n TitleAttrs\n} from '@visactor/vrender-components';\nimport type { AxisEnum, ComponentEnum } from '../graph';\nimport type { Nil } from './base';\nimport type { IComponent, IData, IGroupMark, IMark, IScale } from './grammar';\nimport type {\n ChannelEncodeType,\n ComponentSpec,\n GenerateBasicEncoderSpec,\n MarkFunctionType,\n ScaleEncodeType\n} from './mark';\nimport type { IView } from './view';\nimport type { IBaseScale } from '@visactor/vscale';\n\n// scale component\n\nexport interface IScaleComponent extends IComponent {\n scale: (scale?: IScale | string | Nil) => this;\n\n // internal interface\n getScale: () => IScale;\n}\n\nexport interface ScaleComponentSpec<\n BasicEncoderSpec extends GenerateBasicEncoderSpec<IGraphicAttribute> = GenerateBasicEncoderSpec<IGraphicAttribute>\n> extends ComponentSpec<BasicEncoderSpec> {\n scale?: IScale | string;\n}\n\n// axis component\n\nexport type AxisType = 'line' | 'circle';\n\nexport interface IAxis extends IScaleComponent {\n axisType: (axisType: AxisType | Nil) => this;\n tickCount: (tickCount: MarkFunctionType<number> | Nil) => this;\n inside: (inside: MarkFunctionType<boolean> | Nil) => this;\n baseValue: (baseValue: MarkFunctionType<number> | Nil) => this;\n\n // internal interface\n getAxisComponentType: () => keyof typeof AxisEnum;\n}\n\nexport interface AxisSpec extends ScaleComponentSpec<Partial<AxisBaseAttributes>> {\n componentType: ComponentEnum.axis;\n axisType?: AxisType;\n tickCount?: MarkFunctionType<number>;\n inside?: MarkFunctionType<boolean>;\n baseValue?: MarkFunctionType<number>;\n}\n\n// grid component\n\nexport type GridShape = 'line' | 'circle' | 'polygon';\n\nexport interface IGrid extends IScaleComponent {\n gridType: (gridType: AxisType | Nil) => this;\n gridShape: (gridShape: GridShape | Nil) => this;\n target: (axis: IAxis | string | Nil) => this;\n tickCount: (tickCount: MarkFunctionType<number> | Nil) => this;\n inside: (inside: MarkFunctionType<boolean> | Nil) => this;\n baseValue: (baseValue: MarkFunctionType<number> | Nil) => this;\n}\n\nexport interface GridSpec extends ScaleComponentSpec<Partial<GridBaseAttributes>> {\n componentType: ComponentEnum.grid;\n gridType?: AxisType;\n gridShape?: GridShape;\n target?: IAxis | string;\n tickCount?: MarkFunctionType<number>;\n inside?: MarkFunctionType<boolean>;\n baseValue?: MarkFunctionType<number>;\n}\n\n// legend component\n\nexport type LegendType = 'auto' | 'discrete' | 'color' | 'size';\n\nexport interface ILegend extends IScaleComponent {\n legendType: (legendType: LegendType | Nil) => this;\n\n // immediate functions\n setSelected: (selectedValues: any[]) => this;\n\n // internal interface\n isContinuousLegend: () => boolean;\n}\n\nexport interface LegendSpec extends ScaleComponentSpec<LegendBaseAttributes> {\n componentType: ComponentEnum.legend;\n legendType?: LegendType;\n shapeScale?: IScale | string;\n}\n\n// slider component\n\nexport type SliderFilterValue = { start: number; end: number };\n\nexport interface ISlider extends IComponent {\n min: (min: MarkFunctionType<number> | Nil) => this;\n max: (max: MarkFunctionType<number> | Nil) => this;\n\n // immediate functions\n setStartEndValue: (start?: number, end?: number) => this;\n}\n\nexport interface SliderSpec extends ComponentSpec<Partial<SliderAttributes>> {\n componentType: ComponentEnum.slider;\n min?: MarkFunctionType<number>;\n max?: MarkFunctionType<number>;\n}\n\n// datazoom component\n\nexport type DatazoomFilterValue = { start: number; end: number; startRatio: number; endRatio: number };\n\nexport interface IDatazoom extends IComponent {\n preview: (\n data: IData | string | Nil,\n x: ScaleEncodeType | Nil,\n y: ScaleEncodeType | Nil,\n x1?: ChannelEncodeType | Nil,\n y1?: ChannelEncodeType | Nil\n ) => this;\n\n // immediate functions\n setStartEndValue: (start?: number, end?: number) => this;\n getStartEndValue: () => { start: number; end: number } | Nil;\n\n // internal interface\n invertDatazoomRatio: (ratio: number) => any;\n getDatazoomMainScale: () => IBaseScale;\n}\n\nexport type DataZoomEncoderSpec = GenerateBasicEncoderSpec<Partial<DataZoomAttributes> & { x1?: number; y1?: number }>;\nexport interface DatazoomSpec extends ComponentSpec<DataZoomEncoderSpec> {\n componentType: ComponentEnum.datazoom;\n preview?: {\n data: IData | string;\n x?: ScaleEncodeType;\n y?: ScaleEncodeType;\n x1?: ChannelEncodeType;\n y1?: ChannelEncodeType;\n };\n}\n\n// label component\n\nexport interface ILabel extends IComponent {\n labelStyle: (attributes: MarkFunctionType<Partial<BaseLabelAttrs>>) => this;\n size: (attributes: MarkFunctionType<DataLabelAttrs['size']>) => this;\n target: (mark: IMark | IMark[] | string | string[] | Nil) => this;\n}\n\nexport type LabelEncoderSpec = GenerateBasicEncoderSpec<Partial<BaseLabelAttrs> & { text?: ITextAttribute['text'] }>;\nexport interface LabelSpec extends ComponentSpec<LabelEncoderSpec> {\n componentType: ComponentEnum.label;\n labelStyle?: MarkFunctionType<Partial<BaseLabelAttrs>>;\n size?: MarkFunctionType<DataLabelAttrs['size']>;\n target?: IMark | IMark[] | string | string[];\n}\n\n// player component\n\nexport type PlayerType = 'auto' | 'discrete' | 'continuous';\n\nexport type PlayerFilterValue = { index: number; value: any };\n\nexport interface IPlayer extends IComponent {\n playerType: (playerType: PlayerType) => this;\n source: (source: IData | string | any[] | Nil) => this;\n\n // immediate functions\n play: () => this;\n pause: () => this;\n backward: () => this;\n forward: () => this;\n}\n\nexport interface PlayerSpec extends ComponentSpec<Partial<PlayerAttributes>> {\n componentType: ComponentEnum.player;\n playerType?: PlayerType;\n source?: IData | string | any[];\n}\n\n// title component\n\nexport interface ITitle extends IComponent {\n title: (text: MarkFunctionType<string | number | number[] | string[]> | Nil) => this;\n subTitle: (text: MarkFunctionType<string | number | number[] | string[]> | Nil) => this;\n}\n\nexport interface TitleSpec extends ComponentSpec<Partial<TitleAttrs>> {\n componentType: ComponentEnum.title;\n title?: MarkFunctionType<string | number | number[] | string[]>;\n subTitle?: MarkFunctionType<string | number | number[] | string[]>;\n}\n\n// scrollbar component\n\nexport type ScrollbarFilterValue = { start?: number; end?: number; startRatio: number; endRatio: number };\n\nexport interface IScrollbar extends IScaleComponent {\n container: (container: IGroupMark | string | Nil) => this;\n direction: (direction: MarkFunctionType<Direction> | Nil) => this;\n position: (position: MarkFunctionType<OrientType> | Nil) => this;\n\n // immediate functions\n setScrollStart: (start: number) => this;\n getScrollRange: () => [number, number] | Nil;\n}\n\nexport interface ScrollbarSpec extends ScaleComponentSpec<Partial<ScrollBarAttributes>> {\n componentType: ComponentEnum.scrollbar;\n container?: IGroupMark | string;\n direction?: MarkFunctionType<Direction>;\n position?: MarkFunctionType<OrientType>;\n}\n\n// built-in components\n\nexport type BuiltInComponentSpec =\n | AxisSpec\n | LegendSpec\n | SliderSpec\n | DatazoomSpec\n | LabelSpec\n | PlayerSpec\n | TitleSpec\n | ScrollbarSpec;\n\nexport interface IComponentConstructor {\n readonly componentType: string;\n\n new (view: IView, group?: IGroupMark, mode?: '2d' | '3d'): IComponent;\n}\n"]}
@@ -1,2 +1,2 @@
1
1
  export { };
2
- //# sourceMappingURL=coordinate.js.map
2
+ //# sourceMappingURL=coordinate.js.map
package/es/types/data.js CHANGED
@@ -1 +1,2 @@
1
- export { };
1
+ export { };
2
+ //# sourceMappingURL=data.js.map
@@ -1,2 +1,2 @@
1
1
  export { };
2
- //# sourceMappingURL=dataflow.js.map
2
+ //# sourceMappingURL=dataflow.js.map
@@ -1,4 +1,4 @@
1
- import type { IArc, IArc3d, IArea, ICircle, IGlyph, IGraphic, IGroup, IImage, ILine, IPath, IPolygon, IPyramid3d, IRect, IRect3d, IRichText, ISymbol, IText } from '@visactor/vrender';
1
+ import type { IArc, IArc3d, IArea, ICircle, IGlyph, IGraphic, IGroup, IImage, ILine, IPath, IPolygon, IPyramid3d, IRect, IRect3d, IRichText, ISymbol, IText } from '@visactor/vrender-core';
2
2
  import type { DiffState } from '../graph/enums';
3
3
  import type { IMark, IGlyphMark } from './grammar';
4
4
  import type { BaseEncodeSpec, IMarkConfig, MarkFunctionType, MarkKeySpec, MarkType } from './mark';
@@ -1,2 +1,2 @@
1
1
  export { };
2
- //# sourceMappingURL=element.js.map
2
+ //# sourceMappingURL=element.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types/element.ts"],"names":[],"mappings":"","file":"element.js","sourcesContent":["import type {\n IArc,\n IArc3d,\n IArea,\n ICircle,\n IGlyph,\n IGraphic,\n IGroup,\n IImage,\n ILine,\n IPath,\n IPolygon,\n IPyramid3d,\n IRect,\n IRect3d,\n IRichText,\n ISymbol,\n IText\n} from '@visactor/vrender';\nimport type { DiffState } from '../graph/enums';\nimport type { IMark, IGlyphMark } from './grammar';\nimport type { BaseEncodeSpec, IMarkConfig, MarkFunctionType, MarkKeySpec, MarkType } from './mark';\n\nexport interface ElementGraphicMap {\n circle: ICircle;\n arc: IArc;\n area: IArea;\n image: IImage;\n line: ILine;\n path: IPath;\n rule: ILine;\n shape: IPath;\n symbol: ISymbol;\n text: IText;\n richtext: IRichText;\n polygon: IPolygon;\n cell: ISymbol;\n interval: IGraphic;\n rect: IRect;\n rect3d: IRect3d;\n arc3d: IArc3d;\n pyramid3d: IPyramid3d;\n group: IGroup;\n glyph: IGlyph;\n linkPath: IGlyph;\n treePath: IGlyph;\n wave: IGlyph;\n ripplePoint: IGlyph;\n barBoxplot: IGlyph;\n boxPlot: IGlyph;\n component: IGroup;\n axis: IGroup;\n legend: IGroup;\n corsshair: IGroup;\n slider: IGroup;\n datazoom: IGroup;\n label: IGroup;\n player: IGroup;\n}\n\nexport type GetGraphicByType<T> = T extends keyof ElementGraphicMap ? ElementGraphicMap[T] : IGraphic;\n\n/**\n * 保存graphicItem状态\n */\nexport interface MarkElementItem {\n /** 唯一key */\n key: string;\n /** 原始数据 */\n datum: any;\n /** VGrammar view */\n view: any;\n /** 当前渲染帧下graphicItem对应的最新属性 */\n nextAttrs?: any;\n /** 是否初始化过,用于解决collection mark对应的item,可能跳过enter状态的问题 */\n // hasEntered: boolean;\n}\nexport interface IElement {\n mark: IMark;\n isReserved: boolean;\n diffState: DiffState;\n key: string;\n groupKey?: string;\n data?: any[];\n /**\n * 不推荐使用,但是collection图元暂时可能回涉及到相关修改\n */\n items: MarkElementItem[];\n\n initGraphicItem: (attrs?: any) => void;\n updateGraphicItem: (config: IMarkConfig) => void;\n\n getDatum: () => any;\n getBounds: () => any;\n getGraphicItem: () => IGraphic;\n\n /**\n * 获取 graphic 视觉通道属性\n * @param channel 视觉通道\n * @param prev 是否从之前的 graphic 属性上获取,默认为 false\n * @returns 视觉通道值\n */\n getGraphicAttribute: (channel: string, prev?: boolean) => any;\n /**\n * 设置 graphic 视觉通道属性\n * @param channel 视觉通道\n * @param value 视觉通道属性\n * @param final 是否更新 graphic 最终变更的视觉通道结果,默认为 false\n */\n setGraphicAttribute: (channel: string, value: any, final?: boolean) => void;\n /**\n * 设置一系列 graphic 视觉通道属性\n * @param attributes 视觉通道键值对\n * @param final 是否更新 graphic 最终变更的视觉通道结果,默认为 false\n */\n setGraphicAttributes: (attributes: { [channel: string]: any }, final?: boolean) => void;\n\n /**\n * 【慎重使用】获取 VGrammar 自身的视觉通道属性\n * 只有在 'afterEncodeItems' 时机的mark transform中才能调用\n */\n getItemAttribute: (channel?: string) => any;\n /**\n * 【慎重使用】设置 VGrammar 自身的视觉通道\n * 只有在 'afterEncodeItems' 时机的mark transform中才能调用\n * @param attributes\n * @returns\n */\n setItemAttributes: (attributes: { [channel: string]: any } | any[]) => void;\n\n // element 执行流程相关接口\n updateData: (groupKey: string, data: any[], keyGenerator: MarkKeySpec, view: any) => void;\n state: (markState: MarkFunctionType<string | string[]>, parameters?: any) => void;\n encodeItems: (items: MarkElementItem[], encoders: BaseEncodeSpec, isReentered?: boolean, parameters?: any) => void;\n encodeGraphic: (attributes?: any) => void;\n transformElementItems: (items: MarkElementItem[], markType: MarkType, computePoints?: boolean) => Record<string, any>;\n remove: () => void;\n release: () => void;\n\n // 动画相关接口\n\n getFinalGraphicAttributes: () => { [key: string]: any };\n getPrevGraphicAttributes: () => { [key: string]: any };\n getNextGraphicAttributes: () => { [key: string]: any };\n clearChangedGraphicAttributes: () => void;\n clearGraphicAttributes: () => void;\n\n // state相关接口\n getStates: () => string[];\n hasState: (state: string) => boolean;\n clearStates: (noAnimation?: boolean) => void;\n addState: (state: string | string[], attrs?: any) => void;\n removeState: (state: string | string[]) => void;\n useStates: (states: string[], noAnimation?: boolean) => void;\n}\n\nexport interface IGlyphElement<P = any> extends IElement {\n mark: IGlyphMark;\n\n getGlyphGraphicItems: () => { [markName: string]: any };\n\n getGraphicAttribute: (channel: string, prev?: boolean, markName?: any) => any;\n setGraphicAttribute: (channel: string, value: any, final?: boolean, markName?: any) => void;\n setGraphicAttributes: (attributes: { [channel: string]: any }, final?: boolean, markName?: any) => void;\n\n getFinalGraphicAttributes: (markName?: string) => { [key: string]: any };\n getPrevGraphicAttributes: (markName?: string) => { [key: string]: any };\n getNextGraphicAttributes: (markName?: string) => { [key: string]: any };\n\n encodeCustom: (nextAttrs?: any) => { [markName: string]: any };\n}\n"]}
1
+ {"version":3,"sources":["../src/types/element.ts"],"names":[],"mappings":"","file":"element.js","sourcesContent":["import type {\n IArc,\n IArc3d,\n IArea,\n ICircle,\n IGlyph,\n IGraphic,\n IGroup,\n IImage,\n ILine,\n IPath,\n IPolygon,\n IPyramid3d,\n IRect,\n IRect3d,\n IRichText,\n ISymbol,\n IText\n} from '@visactor/vrender-core';\nimport type { DiffState } from '../graph/enums';\nimport type { IMark, IGlyphMark } from './grammar';\nimport type { BaseEncodeSpec, IMarkConfig, MarkFunctionType, MarkKeySpec, MarkType } from './mark';\n\nexport interface ElementGraphicMap {\n circle: ICircle;\n arc: IArc;\n area: IArea;\n image: IImage;\n line: ILine;\n path: IPath;\n rule: ILine;\n shape: IPath;\n symbol: ISymbol;\n text: IText;\n richtext: IRichText;\n polygon: IPolygon;\n cell: ISymbol;\n interval: IGraphic;\n rect: IRect;\n rect3d: IRect3d;\n arc3d: IArc3d;\n pyramid3d: IPyramid3d;\n group: IGroup;\n glyph: IGlyph;\n linkPath: IGlyph;\n treePath: IGlyph;\n wave: IGlyph;\n ripplePoint: IGlyph;\n barBoxplot: IGlyph;\n boxPlot: IGlyph;\n component: IGroup;\n axis: IGroup;\n legend: IGroup;\n corsshair: IGroup;\n slider: IGroup;\n datazoom: IGroup;\n label: IGroup;\n player: IGroup;\n}\n\nexport type GetGraphicByType<T> = T extends keyof ElementGraphicMap ? ElementGraphicMap[T] : IGraphic;\n\n/**\n * 保存graphicItem状态\n */\nexport interface MarkElementItem {\n /** 唯一key */\n key: string;\n /** 原始数据 */\n datum: any;\n /** VGrammar view */\n view: any;\n /** 当前渲染帧下graphicItem对应的最新属性 */\n nextAttrs?: any;\n /** 是否初始化过,用于解决collection mark对应的item,可能跳过enter状态的问题 */\n // hasEntered: boolean;\n}\nexport interface IElement {\n mark: IMark;\n isReserved: boolean;\n diffState: DiffState;\n key: string;\n groupKey?: string;\n data?: any[];\n /**\n * 不推荐使用,但是collection图元暂时可能回涉及到相关修改\n */\n items: MarkElementItem[];\n\n initGraphicItem: (attrs?: any) => void;\n updateGraphicItem: (config: IMarkConfig) => void;\n\n getDatum: () => any;\n getBounds: () => any;\n getGraphicItem: () => IGraphic;\n\n /**\n * 获取 graphic 视觉通道属性\n * @param channel 视觉通道\n * @param prev 是否从之前的 graphic 属性上获取,默认为 false\n * @returns 视觉通道值\n */\n getGraphicAttribute: (channel: string, prev?: boolean) => any;\n /**\n * 设置 graphic 视觉通道属性\n * @param channel 视觉通道\n * @param value 视觉通道属性\n * @param final 是否更新 graphic 最终变更的视觉通道结果,默认为 false\n */\n setGraphicAttribute: (channel: string, value: any, final?: boolean) => void;\n /**\n * 设置一系列 graphic 视觉通道属性\n * @param attributes 视觉通道键值对\n * @param final 是否更新 graphic 最终变更的视觉通道结果,默认为 false\n */\n setGraphicAttributes: (attributes: { [channel: string]: any }, final?: boolean) => void;\n\n /**\n * 【慎重使用】获取 VGrammar 自身的视觉通道属性\n * 只有在 'afterEncodeItems' 时机的mark transform中才能调用\n */\n getItemAttribute: (channel?: string) => any;\n /**\n * 【慎重使用】设置 VGrammar 自身的视觉通道\n * 只有在 'afterEncodeItems' 时机的mark transform中才能调用\n * @param attributes\n * @returns\n */\n setItemAttributes: (attributes: { [channel: string]: any } | any[]) => void;\n\n // element 执行流程相关接口\n updateData: (groupKey: string, data: any[], keyGenerator: MarkKeySpec, view: any) => void;\n state: (markState: MarkFunctionType<string | string[]>, parameters?: any) => void;\n encodeItems: (items: MarkElementItem[], encoders: BaseEncodeSpec, isReentered?: boolean, parameters?: any) => void;\n encodeGraphic: (attributes?: any) => void;\n transformElementItems: (items: MarkElementItem[], markType: MarkType, computePoints?: boolean) => Record<string, any>;\n remove: () => void;\n release: () => void;\n\n // 动画相关接口\n\n getFinalGraphicAttributes: () => { [key: string]: any };\n getPrevGraphicAttributes: () => { [key: string]: any };\n getNextGraphicAttributes: () => { [key: string]: any };\n clearChangedGraphicAttributes: () => void;\n clearGraphicAttributes: () => void;\n\n // state相关接口\n getStates: () => string[];\n hasState: (state: string) => boolean;\n clearStates: (noAnimation?: boolean) => void;\n addState: (state: string | string[], attrs?: any) => void;\n removeState: (state: string | string[]) => void;\n useStates: (states: string[], noAnimation?: boolean) => void;\n}\n\nexport interface IGlyphElement<P = any> extends IElement {\n mark: IGlyphMark;\n\n getGlyphGraphicItems: () => { [markName: string]: any };\n\n getGraphicAttribute: (channel: string, prev?: boolean, markName?: any) => any;\n setGraphicAttribute: (channel: string, value: any, final?: boolean, markName?: any) => void;\n setGraphicAttributes: (attributes: { [channel: string]: any }, final?: boolean, markName?: any) => void;\n\n getFinalGraphicAttributes: (markName?: string) => { [key: string]: any };\n getPrevGraphicAttributes: (markName?: string) => { [key: string]: any };\n getNextGraphicAttributes: (markName?: string) => { [key: string]: any };\n\n encodeCustom: (nextAttrs?: any) => { [markName: string]: any };\n}\n"]}
@@ -1,4 +1,5 @@
1
- import type { IAnimationConfig, IElement, IMark } from '.';
1
+ import type { CustomEvent, FederatedEvent } from '@visactor/vrender-core';
2
+ import type { IAnimationConfig, IElement, IGlyphElement, IMark } from '.';
2
3
  import type { MarkType } from './mark';
3
4
  import type { SignalDependency } from './signal';
4
5
  export type AnimationEvent = {
@@ -6,16 +7,22 @@ export type AnimationEvent = {
6
7
  animationState: string;
7
8
  animationConfig: IAnimationConfig;
8
9
  };
9
- export type GrammarEvent = MouseEvent & TouchEvent & KeyboardEvent & AnimationEvent;
10
+ export type InteractionEvent = (FederatedEvent | CustomEvent) & {
11
+ element?: IElement | IGlyphElement;
12
+ };
13
+ export type GrammarEvent = InteractionEvent | AnimationEvent;
10
14
  export type EventHandler<T> = (event?: GrammarEvent, value?: T) => void;
11
- export type BaseEventHandler = EventHandler<any>;
15
+ export type BaseEventHandler = AnimationEventHandler | InteractionEventHandler;
16
+ export type AnimationEventHandler = (event?: AnimationEvent) => void;
17
+ export type InteractionEventHandler = (event?: InteractionEvent, element?: IElement | IGlyphElement) => void;
12
18
  export type ResizeHandler = EventHandler<{
13
19
  width?: number;
14
20
  height?: number;
15
21
  }>;
16
22
  export type AnimationEventType = 'animationStart' | 'animationEnd' | 'elementAnimationStart' | 'elementAnimationEnd';
17
23
  export type AnimationListenerHandler = (event?: AnimationEvent, el?: IElement) => void;
18
- export type EventType = 'pointerdown' | 'pointerup' | 'pointerupoutside' | 'pointertap' | 'pointerover' | 'pointerenter' | 'pointerleave' | 'pointerout' | 'mousedown' | 'mouseup' | 'mouseupoutside' | 'rightdown' | 'rightup' | 'rightupoutside' | 'click' | 'dblclick' | 'mousemove' | 'mouseover' | 'mouseout' | 'mouseenter' | 'mouseleave' | 'wheel' | 'tap' | 'touchstart' | 'touchend' | 'touchendoutside' | 'touchmove' | 'touchcancel' | 'dragstart' | 'drag' | 'dragenter' | 'dragleave' | 'dragover' | 'dragend' | 'drop' | 'pan' | 'panstart' | 'panend' | 'press' | 'pressup' | 'pressend' | 'pinch' | 'pinchstart' | 'pinchend' | 'swipe' | 'resize';
24
+ export type ViewEventType = 'view:pointerdown' | 'view:pointerup' | 'view:pointerupoutside' | 'view:pointertap' | 'view:pointerover' | 'view:pointerenter' | 'view:pointerleave' | 'view:pointerout' | 'view:mousedown' | 'view:mouseup' | 'view:mouseupoutside' | 'view:rightdown' | 'view:rightup' | 'view:rightupoutside' | 'view:click' | 'view:dblclick' | 'view:mousemove' | 'view:mouseover' | 'view:mouseout' | 'view:mouseenter' | 'view:mouseleave' | 'view:wheel' | 'view:tap' | 'view:touchstart' | 'view:touchend' | 'view:touchendoutside' | 'view:touchmove' | 'view:touchcancel' | 'view:dragstart' | 'view:drag' | 'view:dragenter' | 'view:dragleave' | 'view:dragover' | 'view:dragend' | 'view:drop' | 'view:pan' | 'view:panstart' | 'view:panend' | 'view:press' | 'view:pressup' | 'view:pressend' | 'view:pinch' | 'view:pinchstart' | 'view:pinchend' | 'view:swipe';
25
+ export type EventType = 'pointerdown' | 'pointerup' | 'pointermove' | 'pointerupoutside' | 'pointertap' | 'pointerover' | 'pointermove' | 'pointerenter' | 'pointerleave' | 'pointerout' | 'mousedown' | 'mouseup' | 'mouseupoutside' | 'rightdown' | 'rightup' | 'rightupoutside' | 'click' | 'dblclick' | 'mousemove' | 'mouseover' | 'mouseout' | 'mouseenter' | 'mouseleave' | 'wheel' | 'tap' | 'touchstart' | 'touchend' | 'touchendoutside' | 'touchmove' | 'touchcancel' | 'dragstart' | 'drag' | 'dragenter' | 'dragleave' | 'dragover' | 'dragend' | 'drop' | 'pan' | 'panstart' | 'panend' | 'press' | 'pressup' | 'pressend' | 'pinch' | 'pinchstart' | 'pinchend' | 'swipe' | 'resize';
19
26
  export type WindowEventType = string;
20
27
  export interface EventCallbackContext extends Event {
21
28
  element?: any;
package/es/types/event.js CHANGED
@@ -1,2 +1,2 @@
1
1
  export { };
2
- //# sourceMappingURL=event.js.map
2
+ //# sourceMappingURL=event.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types/event.ts"],"names":[],"mappings":"","file":"event.js","sourcesContent":["import type { IAnimationConfig, IElement, IMark } from '.';\nimport type { MarkType } from './mark';\nimport type { SignalDependency } from './signal';\n\nexport type AnimationEvent = {\n mark: IMark;\n animationState: string;\n animationConfig: IAnimationConfig;\n};\n\nexport type GrammarEvent = MouseEvent & TouchEvent & KeyboardEvent & AnimationEvent;\n\nexport type EventHandler<T> = (event?: GrammarEvent, value?: T) => void;\nexport type BaseEventHandler = EventHandler<any>;\nexport type ResizeHandler = EventHandler<{ width?: number; height?: number }>;\n\nexport type AnimationEventType = 'animationStart' | 'animationEnd' | 'elementAnimationStart' | 'elementAnimationEnd';\n\nexport type AnimationListenerHandler = (event?: AnimationEvent, el?: IElement) => void;\n\nexport type EventType =\n | 'pointerdown'\n | 'pointerup'\n // 指针抬起与按下的图形不同时触发\n | 'pointerupoutside'\n | 'pointertap'\n | 'pointerover'\n | 'pointerenter'\n | 'pointerleave'\n | 'pointerout'\n | 'mousedown'\n | 'mouseup'\n | 'mouseupoutside'\n // 右键操作\n | 'rightdown'\n | 'rightup'\n | 'rightupoutside'\n | 'click'\n // 双击\n | 'dblclick'\n | 'mousemove'\n | 'mouseover'\n | 'mouseout'\n // 不会冒泡\n | 'mouseenter'\n // 不会冒泡\n | 'mouseleave'\n | 'wheel'\n | 'tap'\n | 'touchstart'\n | 'touchend'\n | 'touchendoutside'\n | 'touchmove'\n | 'touchcancel'\n // dragNdrop\n | 'dragstart'\n | 'drag'\n | 'dragenter'\n | 'dragleave'\n | 'dragover'\n | 'dragend'\n | 'drop'\n // gesture\n | 'pan'\n | 'panstart'\n | 'panend'\n | 'press'\n | 'pressup'\n | 'pressend'\n | 'pinch'\n | 'pinchstart'\n | 'pinchend'\n | 'swipe'\n // resize\n | 'resize';\n\nexport type WindowEventType = string;\n\nexport interface EventCallbackContext extends Event {\n element?: any;\n datum?: any;\n}\n\nexport type EventCallback = (context: EventCallbackContext, params?: any) => any;\nexport interface BaseEventSpec {\n type: string;\n filter?: (context: EventCallbackContext) => boolean;\n throttle?: number;\n debounce?: number;\n /** 阻止事件的执行和传播 */\n consume?: boolean;\n callback?: EventCallback;\n dependency?: SignalDependency | SignalDependency[];\n target?:\n | string\n | Array<{\n target: string;\n callback: EventCallback;\n }>;\n}\n\nexport type MergeEventSpec = Omit<BaseEventSpec, 'type'> & { merge: string[] | BaseEventSpec[] };\n\nexport interface ParsedViewEventSpec extends BaseEventSpec {\n source?: 'view';\n type: EventType;\n markId?: string;\n markName?: string;\n markType?: string;\n}\n\nexport interface ParsedWindowEventSpec extends BaseEventSpec {\n source: 'window';\n type: WindowEventType;\n markId?: string;\n markName?: string;\n markType?: MarkType;\n}\n\nexport type EventSpec =\n | BaseEventSpec\n | ({\n between: [BaseEventSpec, BaseEventSpec];\n } & BaseEventSpec)\n | MergeEventSpec;\n\nexport type EventSourceType = 'window' | 'view';\n"]}
1
+ {"version":3,"sources":["../src/types/event.ts"],"names":[],"mappings":"","file":"event.js","sourcesContent":["import type { CustomEvent, FederatedEvent } from '@visactor/vrender-core';\nimport type { IAnimationConfig, IElement, IGlyphElement, IMark } from '.';\nimport type { MarkType } from './mark';\nimport type { SignalDependency } from './signal';\n\nexport type AnimationEvent = {\n mark: IMark;\n animationState: string;\n animationConfig: IAnimationConfig;\n};\n\nexport type InteractionEvent = (FederatedEvent | CustomEvent) & { element?: IElement | IGlyphElement };\nexport type GrammarEvent = InteractionEvent | AnimationEvent;\n\nexport type EventHandler<T> = (event?: GrammarEvent, value?: T) => void;\nexport type BaseEventHandler = AnimationEventHandler | InteractionEventHandler;\nexport type AnimationEventHandler = (event?: AnimationEvent) => void;\nexport type InteractionEventHandler = (event?: InteractionEvent, element?: IElement | IGlyphElement) => void;\nexport type ResizeHandler = EventHandler<{ width?: number; height?: number }>;\n\nexport type AnimationEventType = 'animationStart' | 'animationEnd' | 'elementAnimationStart' | 'elementAnimationEnd';\n\nexport type AnimationListenerHandler = (event?: AnimationEvent, el?: IElement) => void;\n\nexport type ViewEventType =\n | 'view:pointerdown'\n | 'view:pointerup'\n | 'view:pointerupoutside'\n | 'view:pointertap'\n | 'view:pointerover'\n | 'view:pointerenter'\n | 'view:pointerleave'\n | 'view:pointerout'\n | 'view:mousedown'\n | 'view:mouseup'\n | 'view:mouseupoutside'\n // 右键操作\n | 'view:rightdown'\n | 'view:rightup'\n | 'view:rightupoutside'\n | 'view:click'\n // 双击\n | 'view:dblclick'\n | 'view:mousemove'\n | 'view:mouseover'\n | 'view:mouseout'\n // 不会冒泡\n | 'view:mouseenter'\n // 不会冒泡\n | 'view:mouseleave'\n | 'view:wheel'\n | 'view:tap'\n | 'view:touchstart'\n | 'view:touchend'\n | 'view:touchendoutside'\n | 'view:touchmove'\n | 'view:touchcancel'\n // dragNdrop\n | 'view:dragstart'\n | 'view:drag'\n | 'view:dragenter'\n | 'view:dragleave'\n | 'view:dragover'\n | 'view:dragend'\n | 'view:drop'\n // gesture\n | 'view:pan'\n | 'view:panstart'\n | 'view:panend'\n | 'view:press'\n | 'view:pressup'\n | 'view:pressend'\n | 'view:pinch'\n | 'view:pinchstart'\n | 'view:pinchend'\n | 'view:swipe';\n\nexport type EventType =\n | 'pointerdown'\n | 'pointerup'\n | 'pointermove'\n // 指针抬起与按下的图形不同时触发\n | 'pointerupoutside'\n | 'pointertap'\n | 'pointerover'\n | 'pointermove'\n | 'pointerenter'\n | 'pointerleave'\n | 'pointerout'\n | 'mousedown'\n | 'mouseup'\n | 'mouseupoutside'\n // 右键操作\n | 'rightdown'\n | 'rightup'\n | 'rightupoutside'\n | 'click'\n // 双击\n | 'dblclick'\n | 'mousemove'\n | 'mouseover'\n | 'mouseout'\n // 不会冒泡\n | 'mouseenter'\n // 不会冒泡\n | 'mouseleave'\n | 'wheel'\n | 'tap'\n | 'touchstart'\n | 'touchend'\n | 'touchendoutside'\n | 'touchmove'\n | 'touchcancel'\n // dragNdrop\n | 'dragstart'\n | 'drag'\n | 'dragenter'\n | 'dragleave'\n | 'dragover'\n | 'dragend'\n | 'drop'\n // gesture\n | 'pan'\n | 'panstart'\n | 'panend'\n | 'press'\n | 'pressup'\n | 'pressend'\n | 'pinch'\n | 'pinchstart'\n | 'pinchend'\n | 'swipe'\n // resize\n | 'resize';\n\nexport type WindowEventType = string;\n\nexport interface EventCallbackContext extends Event {\n element?: any;\n datum?: any;\n}\n\nexport type EventCallback = (context: EventCallbackContext, params?: any) => any;\nexport interface BaseEventSpec {\n type: string;\n filter?: (context: EventCallbackContext) => boolean;\n throttle?: number;\n debounce?: number;\n /** 阻止事件的执行和传播 */\n consume?: boolean;\n callback?: EventCallback;\n dependency?: SignalDependency | SignalDependency[];\n target?:\n | string\n | Array<{\n target: string;\n callback: EventCallback;\n }>;\n}\n\nexport type MergeEventSpec = Omit<BaseEventSpec, 'type'> & { merge: string[] | BaseEventSpec[] };\n\nexport interface ParsedViewEventSpec extends BaseEventSpec {\n source?: 'view';\n type: EventType;\n markId?: string;\n markName?: string;\n markType?: string;\n}\n\nexport interface ParsedWindowEventSpec extends BaseEventSpec {\n source: 'window';\n type: WindowEventType;\n markId?: string;\n markName?: string;\n markType?: MarkType;\n}\n\nexport type EventSpec =\n | BaseEventSpec\n | ({\n between: [BaseEventSpec, BaseEventSpec];\n } & BaseEventSpec)\n | MergeEventSpec;\n\nexport type EventSourceType = 'window' | 'view';\n"]}
package/es/types/glyph.js CHANGED
@@ -1,2 +1,2 @@
1
1
  export { };
2
- //# sourceMappingURL=glyph.js.map
2
+ //# sourceMappingURL=glyph.js.map
@@ -1,6 +1,6 @@
1
1
  import type { EventEmitter, IBounds, IPointLike } from '@visactor/vutils';
2
- import type { IGraphic, IGroup } from '@visactor/vrender';
3
- import type { IBaseScale, TickData } from '@visactor/vscale';
2
+ import type { IGraphic, IGroup } from '@visactor/vrender-core';
3
+ import type { IBaseScale, ScaleFishEyeOptions, TickData } from '@visactor/vscale';
4
4
  import type { ITransform, TransformSpec } from './transform';
5
5
  import type { DataFormatSpec, IDataFilter } from './data';
6
6
  import type { ParameterFunctionType, SignalFunctionType } from './signal';
@@ -79,6 +79,10 @@ export interface IScale extends IGrammarBase {
79
79
  domain: (domain: ScaleFunctionType<any[]> | ScaleData | MultiScaleData | Nil) => this;
80
80
  range: (range: ScaleFunctionType<any[]> | ScaleData | MultiScaleData | Nil) => this;
81
81
  configure: (config: ScaleConfigureSpec | Nil) => this;
82
+ getRangeFactor: () => [number, number] | Nil;
83
+ setRangeFactor: (range?: [number, number]) => this;
84
+ getFishEye: () => ScaleFishEyeOptions | Nil;
85
+ setFishEye: (option?: ScaleFishEyeOptions) => this;
82
86
  getScaleType: () => GrammarScaleType;
83
87
  getScale: () => IBaseScale;
84
88
  ticks: (count?: number) => TickData[];
@@ -1,2 +1,2 @@
1
1
  export { };
2
- //# sourceMappingURL=grammar.js.map
2
+ //# sourceMappingURL=grammar.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types/grammar.ts"],"names":[],"mappings":"","file":"grammar.js","sourcesContent":["import type { EventEmitter, IBounds, IPointLike } from '@visactor/vutils';\nimport type { IGraphic, IGroup } from '@visactor/vrender';\nimport type { IBaseScale, TickData } from '@visactor/vscale';\nimport type { ITransform, TransformSpec } from './transform';\nimport type { DataFormatSpec, IDataFilter } from './data';\nimport type { ParameterFunctionType, SignalFunctionType } from './signal';\nimport type { IAnimate } from './animate';\nimport type { IGlyphMeta } from './glyph';\nimport type { GrammarTypeEnum } from '../graph/enums';\nimport type { Nil } from './base';\nimport type { CoordinateFunctionType } from './coordinate';\nimport type { IElement } from './element';\nimport type {\n MarkFunctionType,\n MarkAnimationSpec,\n MarkType,\n MarkLayoutSpec,\n MarkLayoutCallback,\n MarkSortSpec,\n MarkKeySpec,\n IMarkConfig,\n ChannelEncodeType,\n AttributeTransform,\n BaseSignleEncodeSpec\n} from './mark';\nimport type { ScaleConfigureSpec, ScaleData, ScaleFunctionType, GrammarScaleType, MultiScaleData } from './scale';\nimport type { IView } from './view';\nimport type { BaseEventHandler } from './event';\nimport type { ICartesianCoordinate, IPolarCoordinate } from '@visactor/vgrammar-coordinate';\n\nexport type BuiltInGrammarType = keyof typeof GrammarTypeEnum;\nexport type GrammarType = BuiltInGrammarType | string;\n\n/** 语法元素内置运行的任务 */\nexport interface IGrammarTask extends ITransform {\n /**\n * 参数依赖\n * 只做一级解析\n */\n options?: Record<string, any | IGrammarBase> | (IGrammarBase | any)[];\n /**\n * 依赖的语法元素\n */\n references?: IGrammarBase[];\n /**\n * 是否只支持简单的options配置,不支持在options引用语法元素\n */\n isRawOptions?: boolean;\n}\n\nexport interface GrammarSpec {\n id?: string;\n dependency?: IGrammarBase[] | IGrammarBase | string[] | string;\n}\n\nexport interface IGrammarBase {\n readonly grammarType: GrammarType;\n readonly view: IView;\n readonly uid: number;\n /**\n * 执行的上游节点\n */\n grammarSource: IGrammarBase;\n /**\n * 影响的下游节点\n */\n targets: IGrammarBase[];\n /**\n * 依赖的上游节点,由于不同 spec 配置项中可能引用同一个节点,需要进行计数\n */\n references: Map<IGrammarBase, number>;\n\n depend: (grammar: IGrammarBase[] | IGrammarBase | string[] | string) => this;\n\n addEventListener: (type: string, handler: BaseEventHandler, options?: any) => this;\n removeEventListener: (type: string, handler: BaseEventHandler) => this;\n\n // extended from EventEmitter\n emit: <T extends EventEmitter.EventNames<string | symbol>>(\n event: T,\n ...args: EventEmitter.EventArgs<string | symbol, T>\n ) => boolean;\n emitGrammarEvent: <T extends EventEmitter.EventNames<string | symbol>>(\n event: T,\n ...args: EventEmitter.EventArgs<string | symbol, T>\n ) => boolean;\n\n tasks?: IGrammarTask[];\n // value?: any;\n /** FIXME: operator执行顺序,改造后,dataflow执行元素,应该抽象出来 */\n rank?: number;\n // todo\n set: (value: any) => boolean;\n id: (() => string) & ((id: string) => this);\n name: (() => string) & ((name: string) => this);\n attach: (reference: IGrammarBase | IGrammarBase[], count?: number) => this;\n detach: (reference: IGrammarBase | IGrammarBase[], count?: number) => this;\n detachAll: () => void;\n commit: () => void;\n output: () => any;\n parse: (spec: any) => this;\n parameters: () => { [key: string]: any };\n evaluateSync?: (upstream: any, parameters: any) => this;\n getSpec: () => any;\n reuse: (grammar: IGrammarBase) => this;\n /** clear references */\n clear: () => void;\n /** release all memory storage */\n release: () => void;\n}\n\nexport interface IData extends IGrammarBase {\n values: (values: any | Nil, format?: ParameterFunctionType<DataFormatSpec>, load?: boolean) => this;\n url: (\n url: ParameterFunctionType<string> | Nil,\n format?: ParameterFunctionType<DataFormatSpec>,\n load?: boolean\n ) => this;\n source: (\n source: string | string[] | IData | IData[],\n format?: ParameterFunctionType<DataFormatSpec>,\n load?: boolean\n ) => this;\n transform: (transform: TransformSpec[] | Nil) => this;\n\n // only used in VGrammar\n addDataFilter: (filter: IDataFilter | IDataFilter[]) => this;\n removeDataFilter: (filter: IDataFilter | IDataFilter[]) => this;\n\n // data util methods\n field: (field: string) => any[];\n getValue: () => any[];\n getInput: () => any[];\n getDataIDKey: () => string;\n}\n\n/** 语法元素,TODO */\nexport interface ISignal<T> extends IGrammarBase {\n value: (value: T | Nil) => this;\n update: (update: SignalFunctionType<T> | Nil) => this;\n\n getValue: () => T;\n}\n\n/** 语法元素,TODO */\nexport interface IScale extends IGrammarBase {\n domain: (domain: ScaleFunctionType<any[]> | ScaleData | MultiScaleData | Nil) => this;\n range: (range: ScaleFunctionType<any[]> | ScaleData | MultiScaleData | Nil) => this;\n configure: (config: ScaleConfigureSpec | Nil) => this;\n\n // scale util methods\n getScaleType: () => GrammarScaleType;\n getScale: () => IBaseScale;\n ticks: (count?: number) => TickData[];\n getCoordinateAxisPoints: (baseValue?: number) => [IPointLike, IPointLike];\n getCoordinate: () => IPolarCoordinate | ICartesianCoordinate;\n getCoordinateAxisPosition: () => 'top' | 'bottom' | 'left' | 'right' | 'inside' | 'outside' | 'start' | 'end';\n}\n\nexport interface ICoordinate extends IGrammarBase {\n start: (start: CoordinateFunctionType<[number, number]> | Nil) => this;\n end: (end: CoordinateFunctionType<[number, number]> | Nil) => this;\n origin: (origin: CoordinateFunctionType<[number, number]> | Nil) => this;\n\n translate: (offset: CoordinateFunctionType<[number, number]> | Nil) => this;\n rotate: (angle: CoordinateFunctionType<number> | Nil) => this;\n scale: (ratio: CoordinateFunctionType<[number, number]> | Nil) => this;\n transpose: (isTransposed: CoordinateFunctionType<boolean> | Nil) => this;\n\n // coordinate util methods\n}\n\n/** 语法元素,TODO */\n\n/** group mark */\nexport interface IGroupMark extends IMark {\n children: (IMark | IGroupMark | IGlyphMark)[];\n\n layoutChildren?: (IMark | IGroupMark | IGlyphMark)[];\n\n appendChild: (mark: IMark | IGroupMark | IGlyphMark) => this;\n removeChild: (mark: IMark | IGroupMark | IGlyphMark) => this;\n includesChild: (mark: IMark, descendant?: boolean) => boolean;\n\n updateLayoutChildren: () => this;\n}\n\nexport interface IGlyphMark extends IMark {\n glyphType: string;\n getGlyphMeta: () => IGlyphMeta;\n configureGlyph: (config: any) => this;\n getGlyphConfig: () => any;\n}\n\nexport interface IComponent extends IMark {\n componentType: string;\n configureComponent: (config: any) => this;\n}\n\nexport interface IProgressiveGrammar {\n /** 是否启动了增量渲染模式 */\n isProgressive: () => boolean;\n /** 是否正在执行增量渲染 */\n isDoingProgressive: () => boolean;\n /** 清除增量渲染相关状态 */\n clearProgressive: () => void;\n /** 从第一帧开始增量计算 */\n restartProgressive: () => void;\n /** 分片执行 */\n evaluateProgressive: () => void;\n}\n\nexport interface IMark extends IGrammarBase, IProgressiveGrammar {\n group?: IGroupMark;\n\n markType: MarkType;\n context: any;\n coord: ICoordinate;\n /**\n * disable coordinate transform when need\n */\n disableCoordinateTransform?: boolean;\n elements: IElement[];\n elementMap: Map<string, IElement>;\n graphicIndex: number;\n graphicItem?: IGroup;\n animate: IAnimate;\n\n join: (\n data: IData | string | Nil,\n key?: MarkKeySpec,\n sort?: MarkSortSpec,\n groupBy?: MarkKeySpec,\n groupSort?: MarkSortSpec\n ) => this;\n coordinate: (coordinate: ICoordinate | string | Nil) => this;\n state: (state: MarkFunctionType<string | string[]> | Nil) => this;\n encode: ((encoders: BaseSignleEncodeSpec) => this) & ((channel: string, value: ChannelEncodeType) => this);\n encodeState: ((state: string, channel: string, value: ChannelEncodeType) => this) &\n ((state: string, encoders: BaseSignleEncodeSpec) => this);\n animation: (animationConfig: MarkAnimationSpec | Nil) => this;\n animationState: (animationState: MarkFunctionType<string> | Nil) => this;\n layout: (layout: MarkLayoutSpec | MarkLayoutCallback | Nil) => this;\n configure: (config: IMarkConfig | Nil) => this;\n transform: (transform: TransformSpec[] | Nil) => this;\n\n needAnimate: () => boolean;\n getBounds: () => IBounds;\n isCollectionMark: () => boolean;\n getAllElements: () => IElement[];\n\n // position: () => this;\n // color: () => this;\n // shape: () => this;\n\n // mark 执行流程相关接口\n\n isUpdated: boolean;\n getGroupGraphicItem: () => any;\n cleanExitElements: () => void;\n addGraphicItem: (attrs: any, groupKey?: string) => IGraphic;\n getMorphConfig: () => { morph: boolean; morphKey: string | undefined; morphElementKey: string | undefined };\n prepareRelease: () => void;\n\n layoutBounds?: IBounds;\n relativePosition?: { top?: number; bottom?: number; left?: number; right?: number };\n needLayout: () => boolean;\n handleLayoutEnd: () => void;\n handleRenderEnd: () => void;\n isLargeMode: () => boolean;\n getAttributeTransforms: () => AttributeTransform[];\n\n getScalesByChannel: () => Record<string, IBaseScale> | undefined;\n getFieldsByChannel: () => Record<string, string> | undefined;\n getScales: () => Record<string, IBaseScale> | undefined;\n}\n\nexport interface IGrammarBaseConstructor {\n new (view: IView): IGrammarBase;\n}\n\nexport interface ProgressiveContext {\n currentIndex: number;\n totalStep: number;\n step: number;\n data: any[];\n groupKeys?: string[];\n groupedData?: Map<string, any[]>;\n}\n"]}
1
+ {"version":3,"sources":["../src/types/grammar.ts"],"names":[],"mappings":"","file":"grammar.js","sourcesContent":["import type { EventEmitter, IBounds, IPointLike } from '@visactor/vutils';\nimport type { IGraphic, IGroup } from '@visactor/vrender-core';\nimport type { IBaseScale, ScaleFishEyeOptions, TickData } from '@visactor/vscale';\nimport type { ITransform, TransformSpec } from './transform';\nimport type { DataFormatSpec, IDataFilter } from './data';\nimport type { ParameterFunctionType, SignalFunctionType } from './signal';\nimport type { IAnimate } from './animate';\nimport type { IGlyphMeta } from './glyph';\nimport type { GrammarTypeEnum } from '../graph/enums';\nimport type { Nil } from './base';\nimport type { CoordinateFunctionType } from './coordinate';\nimport type { IElement } from './element';\nimport type {\n MarkFunctionType,\n MarkAnimationSpec,\n MarkType,\n MarkLayoutSpec,\n MarkLayoutCallback,\n MarkSortSpec,\n MarkKeySpec,\n IMarkConfig,\n ChannelEncodeType,\n AttributeTransform,\n BaseSignleEncodeSpec\n} from './mark';\nimport type { ScaleConfigureSpec, ScaleData, ScaleFunctionType, GrammarScaleType, MultiScaleData } from './scale';\nimport type { IView } from './view';\nimport type { BaseEventHandler } from './event';\nimport type { ICartesianCoordinate, IPolarCoordinate } from '@visactor/vgrammar-coordinate';\n\nexport type BuiltInGrammarType = keyof typeof GrammarTypeEnum;\nexport type GrammarType = BuiltInGrammarType | string;\n\n/** 语法元素内置运行的任务 */\nexport interface IGrammarTask extends ITransform {\n /**\n * 参数依赖\n * 只做一级解析\n */\n options?: Record<string, any | IGrammarBase> | (IGrammarBase | any)[];\n /**\n * 依赖的语法元素\n */\n references?: IGrammarBase[];\n /**\n * 是否只支持简单的options配置,不支持在options引用语法元素\n */\n isRawOptions?: boolean;\n}\n\nexport interface GrammarSpec {\n id?: string;\n dependency?: IGrammarBase[] | IGrammarBase | string[] | string;\n}\n\nexport interface IGrammarBase {\n readonly grammarType: GrammarType;\n readonly view: IView;\n readonly uid: number;\n /**\n * 执行的上游节点\n */\n grammarSource: IGrammarBase;\n /**\n * 影响的下游节点\n */\n targets: IGrammarBase[];\n /**\n * 依赖的上游节点,由于不同 spec 配置项中可能引用同一个节点,需要进行计数\n */\n references: Map<IGrammarBase, number>;\n\n depend: (grammar: IGrammarBase[] | IGrammarBase | string[] | string) => this;\n\n addEventListener: (type: string, handler: BaseEventHandler, options?: any) => this;\n removeEventListener: (type: string, handler: BaseEventHandler) => this;\n\n // extended from EventEmitter\n emit: <T extends EventEmitter.EventNames<string | symbol>>(\n event: T,\n ...args: EventEmitter.EventArgs<string | symbol, T>\n ) => boolean;\n emitGrammarEvent: <T extends EventEmitter.EventNames<string | symbol>>(\n event: T,\n ...args: EventEmitter.EventArgs<string | symbol, T>\n ) => boolean;\n\n tasks?: IGrammarTask[];\n // value?: any;\n /** FIXME: operator执行顺序,改造后,dataflow执行元素,应该抽象出来 */\n rank?: number;\n // todo\n set: (value: any) => boolean;\n id: (() => string) & ((id: string) => this);\n name: (() => string) & ((name: string) => this);\n attach: (reference: IGrammarBase | IGrammarBase[], count?: number) => this;\n detach: (reference: IGrammarBase | IGrammarBase[], count?: number) => this;\n detachAll: () => void;\n commit: () => void;\n output: () => any;\n parse: (spec: any) => this;\n parameters: () => { [key: string]: any };\n evaluateSync?: (upstream: any, parameters: any) => this;\n getSpec: () => any;\n reuse: (grammar: IGrammarBase) => this;\n /** clear references */\n clear: () => void;\n /** release all memory storage */\n release: () => void;\n}\n\nexport interface IData extends IGrammarBase {\n values: (values: any | Nil, format?: ParameterFunctionType<DataFormatSpec>, load?: boolean) => this;\n url: (\n url: ParameterFunctionType<string> | Nil,\n format?: ParameterFunctionType<DataFormatSpec>,\n load?: boolean\n ) => this;\n source: (\n source: string | string[] | IData | IData[],\n format?: ParameterFunctionType<DataFormatSpec>,\n load?: boolean\n ) => this;\n transform: (transform: TransformSpec[] | Nil) => this;\n\n // only used in VGrammar\n addDataFilter: (filter: IDataFilter | IDataFilter[]) => this;\n removeDataFilter: (filter: IDataFilter | IDataFilter[]) => this;\n\n // data util methods\n field: (field: string) => any[];\n getValue: () => any[];\n getInput: () => any[];\n getDataIDKey: () => string;\n}\n\n/** 语法元素,TODO */\nexport interface ISignal<T> extends IGrammarBase {\n value: (value: T | Nil) => this;\n update: (update: SignalFunctionType<T> | Nil) => this;\n\n getValue: () => T;\n}\n\n/** 语法元素,TODO */\nexport interface IScale extends IGrammarBase {\n domain: (domain: ScaleFunctionType<any[]> | ScaleData | MultiScaleData | Nil) => this;\n range: (range: ScaleFunctionType<any[]> | ScaleData | MultiScaleData | Nil) => this;\n configure: (config: ScaleConfigureSpec | Nil) => this;\n\n // only used in VGrammar\n getRangeFactor: () => [number, number] | Nil;\n setRangeFactor: (range?: [number, number]) => this;\n getFishEye: () => ScaleFishEyeOptions | Nil;\n setFishEye: (option?: ScaleFishEyeOptions) => this;\n\n // scale util methods\n getScaleType: () => GrammarScaleType;\n getScale: () => IBaseScale;\n ticks: (count?: number) => TickData[];\n getCoordinateAxisPoints: (baseValue?: number) => [IPointLike, IPointLike];\n getCoordinate: () => IPolarCoordinate | ICartesianCoordinate;\n getCoordinateAxisPosition: () => 'top' | 'bottom' | 'left' | 'right' | 'inside' | 'outside' | 'start' | 'end';\n}\n\nexport interface ICoordinate extends IGrammarBase {\n start: (start: CoordinateFunctionType<[number, number]> | Nil) => this;\n end: (end: CoordinateFunctionType<[number, number]> | Nil) => this;\n origin: (origin: CoordinateFunctionType<[number, number]> | Nil) => this;\n\n translate: (offset: CoordinateFunctionType<[number, number]> | Nil) => this;\n rotate: (angle: CoordinateFunctionType<number> | Nil) => this;\n scale: (ratio: CoordinateFunctionType<[number, number]> | Nil) => this;\n transpose: (isTransposed: CoordinateFunctionType<boolean> | Nil) => this;\n\n // coordinate util methods\n}\n\n/** 语法元素,TODO */\n\n/** group mark */\nexport interface IGroupMark extends IMark {\n children: (IMark | IGroupMark | IGlyphMark)[];\n\n layoutChildren?: (IMark | IGroupMark | IGlyphMark)[];\n\n appendChild: (mark: IMark | IGroupMark | IGlyphMark) => this;\n removeChild: (mark: IMark | IGroupMark | IGlyphMark) => this;\n includesChild: (mark: IMark, descendant?: boolean) => boolean;\n\n updateLayoutChildren: () => this;\n}\n\nexport interface IGlyphMark extends IMark {\n glyphType: string;\n getGlyphMeta: () => IGlyphMeta;\n configureGlyph: (config: any) => this;\n getGlyphConfig: () => any;\n}\n\nexport interface IComponent extends IMark {\n componentType: string;\n configureComponent: (config: any) => this;\n}\n\nexport interface IProgressiveGrammar {\n /** 是否启动了增量渲染模式 */\n isProgressive: () => boolean;\n /** 是否正在执行增量渲染 */\n isDoingProgressive: () => boolean;\n /** 清除增量渲染相关状态 */\n clearProgressive: () => void;\n /** 从第一帧开始增量计算 */\n restartProgressive: () => void;\n /** 分片执行 */\n evaluateProgressive: () => void;\n}\n\nexport interface IMark extends IGrammarBase, IProgressiveGrammar {\n group?: IGroupMark;\n\n markType: MarkType;\n context: any;\n coord: ICoordinate;\n /**\n * disable coordinate transform when need\n */\n disableCoordinateTransform?: boolean;\n elements: IElement[];\n elementMap: Map<string, IElement>;\n graphicIndex: number;\n graphicItem?: IGroup;\n animate: IAnimate;\n\n join: (\n data: IData | string | Nil,\n key?: MarkKeySpec,\n sort?: MarkSortSpec,\n groupBy?: MarkKeySpec,\n groupSort?: MarkSortSpec\n ) => this;\n coordinate: (coordinate: ICoordinate | string | Nil) => this;\n state: (state: MarkFunctionType<string | string[]> | Nil) => this;\n encode: ((encoders: BaseSignleEncodeSpec) => this) & ((channel: string, value: ChannelEncodeType) => this);\n encodeState: ((state: string, channel: string, value: ChannelEncodeType) => this) &\n ((state: string, encoders: BaseSignleEncodeSpec) => this);\n animation: (animationConfig: MarkAnimationSpec | Nil) => this;\n animationState: (animationState: MarkFunctionType<string> | Nil) => this;\n layout: (layout: MarkLayoutSpec | MarkLayoutCallback | Nil) => this;\n configure: (config: IMarkConfig | Nil) => this;\n transform: (transform: TransformSpec[] | Nil) => this;\n\n needAnimate: () => boolean;\n getBounds: () => IBounds;\n isCollectionMark: () => boolean;\n getAllElements: () => IElement[];\n\n // position: () => this;\n // color: () => this;\n // shape: () => this;\n\n // mark 执行流程相关接口\n\n isUpdated: boolean;\n getGroupGraphicItem: () => any;\n cleanExitElements: () => void;\n addGraphicItem: (attrs: any, groupKey?: string) => IGraphic;\n getMorphConfig: () => { morph: boolean; morphKey: string | undefined; morphElementKey: string | undefined };\n prepareRelease: () => void;\n\n layoutBounds?: IBounds;\n relativePosition?: { top?: number; bottom?: number; left?: number; right?: number };\n needLayout: () => boolean;\n handleLayoutEnd: () => void;\n handleRenderEnd: () => void;\n isLargeMode: () => boolean;\n getAttributeTransforms: () => AttributeTransform[];\n\n getScalesByChannel: () => Record<string, IBaseScale> | undefined;\n getFieldsByChannel: () => Record<string, string> | undefined;\n getScales: () => Record<string, IBaseScale> | undefined;\n}\n\nexport interface IGrammarBaseConstructor {\n new (view: IView): IGrammarBase;\n}\n\nexport interface ProgressiveContext {\n currentIndex: number;\n totalStep: number;\n step: number;\n data: any[];\n groupKeys?: string[];\n groupedData?: Map<string, any[]>;\n}\n"]}
package/es/types/hooks.js CHANGED
@@ -1,2 +1,2 @@
1
1
  export { };
2
- //# sourceMappingURL=hooks.js.map
2
+ //# sourceMappingURL=hooks.js.map
@@ -20,3 +20,4 @@ export * from './theme';
20
20
  export * from './transform';
21
21
  export * from './view';
22
22
  export * from './plot';
23
+ export * from './interaction';
package/es/types/index.js CHANGED
@@ -41,4 +41,6 @@ export * from "./transform";
41
41
  export * from "./view";
42
42
 
43
43
  export * from "./plot";
44
- //# sourceMappingURL=index.js.map
44
+
45
+ export * from "./interaction";
46
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC","file":"index.js","sourcesContent":["export * from './animate';\nexport * from './base';\nexport * from './component';\nexport * from './coordinate';\nexport * from './data';\nexport * from './dataflow';\nexport * from './element';\nexport * from './event';\nexport * from './glyph';\nexport * from './grammar';\nexport * from './hooks';\nexport * from './layout';\nexport * from './mark';\nexport * from './morph';\nexport * from './projection';\nexport * from './renderer';\nexport * from './scale';\nexport * from './signal';\nexport * from './theme';\nexport * from './transform';\nexport * from './view';\nexport * from './plot';\n"]}
1
+ {"version":3,"sources":["../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC","file":"index.js","sourcesContent":["export * from './animate';\nexport * from './base';\nexport * from './component';\nexport * from './coordinate';\nexport * from './data';\nexport * from './dataflow';\nexport * from './element';\nexport * from './event';\nexport * from './glyph';\nexport * from './grammar';\nexport * from './hooks';\nexport * from './layout';\nexport * from './mark';\nexport * from './morph';\nexport * from './projection';\nexport * from './renderer';\nexport * from './scale';\nexport * from './signal';\nexport * from './theme';\nexport * from './transform';\nexport * from './view';\nexport * from './plot';\nexport * from './interaction';\n"]}