@visactor/vgrammar-core 0.7.7 → 0.8.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 (542) 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 +33 -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 +49 -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 +149 -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/event.d.ts +2 -0
  454. package/es/parse/event.js +5 -1
  455. package/es/parse/event.js.map +1 -1
  456. package/es/parse/option.js +2 -1
  457. package/es/parse/scale.js +1 -2
  458. package/es/semantic-marks/cell.d.ts +1 -1
  459. package/es/semantic-marks/cell.js +4 -2
  460. package/es/semantic-marks/cell.js.map +1 -1
  461. package/es/semantic-marks/interval.d.ts +1 -1
  462. package/es/semantic-marks/interval.js +1 -1
  463. package/es/semantic-marks/text.js +1 -1
  464. package/es/theme/dark.js +1 -1
  465. package/es/theme/default.js +1 -1
  466. package/es/theme/theme-manager.js +1 -1
  467. package/es/transforms/index.js +1 -1
  468. package/es/transforms/mark/dodge.js +2 -2
  469. package/es/transforms/mark/dodge.js.map +1 -1
  470. package/es/transforms/mark/jitter.js +2 -2
  471. package/es/transforms/mark/jitter.js.map +1 -1
  472. package/es/types/animate.d.ts +1 -1
  473. package/es/types/animate.js +1 -1
  474. package/es/types/animate.js.map +1 -1
  475. package/es/types/base.js +1 -1
  476. package/es/types/component.d.ts +16 -88
  477. package/es/types/component.js +1 -1
  478. package/es/types/component.js.map +1 -1
  479. package/es/types/coordinate.js +1 -1
  480. package/es/types/data.js +2 -1
  481. package/es/types/dataflow.js +1 -1
  482. package/es/types/element.d.ts +1 -1
  483. package/es/types/element.js +1 -1
  484. package/es/types/element.js.map +1 -1
  485. package/es/types/event.d.ts +11 -4
  486. package/es/types/event.js +1 -1
  487. package/es/types/event.js.map +1 -1
  488. package/es/types/glyph.js +1 -1
  489. package/es/types/grammar.d.ts +6 -2
  490. package/es/types/grammar.js +1 -1
  491. package/es/types/grammar.js.map +1 -1
  492. package/es/types/hooks.js +1 -1
  493. package/es/types/index.d.ts +1 -0
  494. package/es/types/index.js +3 -1
  495. package/es/types/index.js.map +1 -1
  496. package/es/types/interaction.d.ts +353 -0
  497. package/es/types/interaction.js +2 -0
  498. package/es/types/interaction.js.map +1 -0
  499. package/es/types/mark.d.ts +2 -3
  500. package/es/types/mark.js.map +1 -1
  501. package/es/types/morph.d.ts +1 -1
  502. package/es/types/morph.js.map +1 -1
  503. package/es/types/plot.d.ts +1 -1
  504. package/es/types/plot.js.map +1 -1
  505. package/es/types/renderer.d.ts +1 -1
  506. package/es/types/renderer.js.map +1 -1
  507. package/es/types/theme.d.ts +1 -1
  508. package/es/types/theme.js.map +1 -1
  509. package/es/types/view.d.ts +13 -14
  510. package/es/types/view.js.map +1 -1
  511. package/es/util/scale.d.ts +4 -0
  512. package/es/util/scale.js +15 -0
  513. package/es/util/scale.js.map +1 -0
  514. package/es/util/text.d.ts +1 -1
  515. package/es/util/text.js +1 -1
  516. package/es/util/text.js.map +1 -1
  517. package/es/view/View.d.ts +9 -13
  518. package/es/view/View.js +49 -69
  519. package/es/view/View.js.map +1 -1
  520. package/es/view/component.d.ts +2 -6
  521. package/es/view/component.js +0 -20
  522. package/es/view/component.js.map +1 -1
  523. package/es/view/dataflow.js +1 -1
  524. package/es/view/dataflow.js.map +1 -1
  525. package/es/view/events.d.ts +1 -1
  526. package/es/view/mark.d.ts +2 -2
  527. package/es/view/mark.js +12 -10
  528. package/es/view/mark.js.map +1 -1
  529. package/es/view/scale.d.ts +7 -1
  530. package/es/view/scale.js +17 -2
  531. package/es/view/scale.js.map +1 -1
  532. package/package.json +9 -8
  533. package/cjs/component/crosshair.d.ts +0 -50
  534. package/cjs/component/crosshair.js.map +0 -1
  535. package/cjs/component/tooltip.d.ts +0 -62
  536. package/cjs/component/tooltip.js +0 -305
  537. package/cjs/component/tooltip.js.map +0 -1
  538. package/es/component/crosshair.d.ts +0 -50
  539. package/es/component/crosshair.js.map +0 -1
  540. package/es/component/tooltip.d.ts +0 -62
  541. package/es/component/tooltip.js +0 -303
  542. package/es/component/tooltip.js.map +0 -1
@@ -0,0 +1,353 @@
1
+ import type { IView } from './view';
2
+ import type { EventType, InteractionEvent, ViewEventType } from './event';
3
+ import type { BaseCrosshairAttrs, BrushAttributes, TooltipAttributes, TooltipRowAttrs } from '@visactor/vrender-components';
4
+ import type { IPolygon, ISymbolGraphicAttribute, ITextGraphicAttribute } from '@visactor/vrender-core';
5
+ import type { IElement, IGlyphElement } from './element';
6
+ import type { IData, IGrammarBase, IMark, IScale } from './grammar';
7
+ import type { IPointLike } from '@visactor/vutils';
8
+ import type { IBaseScale } from '@visactor/vscale';
9
+ import type { IDatazoom, IScrollbar } from './component';
10
+ import type { FieldEncodeType, MarkFunctionType } from './mark';
11
+ export interface FilterDataTarget {
12
+ data: string | IData;
13
+ filter: string | ((datum: any, filterValues: any[]) => boolean);
14
+ transform?: (data: any[], filterValues: any[]) => any[];
15
+ }
16
+ export interface IBaseInteractionOptions {
17
+ dependencies?: string | string[] | IGrammarBase | IGrammarBase[];
18
+ shouldStart?: (e: any) => boolean;
19
+ shouldUpdate?: (e: any) => boolean;
20
+ shouldEnd?: (e: any) => boolean;
21
+ shouldReset?: (e: any) => boolean;
22
+ onStart?: (e: any) => boolean;
23
+ onUpdate?: (e: any) => boolean;
24
+ onEnd?: (e: any) => boolean;
25
+ onReset?: (e: any) => boolean;
26
+ }
27
+ export interface IInteraction {
28
+ readonly type: string;
29
+ depend: (grammar: IGrammarBase[] | IGrammarBase | string[] | string) => void;
30
+ bind: () => void;
31
+ unbind: () => void;
32
+ }
33
+ export interface IInteractionConstructor {
34
+ readonly type: string;
35
+ new (view: IView, options?: any): IInteraction;
36
+ }
37
+ export interface ElementActiveOptions extends IBaseInteractionOptions {
38
+ selector?: string | string[] | IMark | IMark[];
39
+ trigger?: EventType;
40
+ resetTrigger?: EventType;
41
+ state?: string;
42
+ }
43
+ export interface ElementSelectOptions extends IBaseInteractionOptions {
44
+ selector?: string | string[] | IMark | IMark[];
45
+ trigger?: EventType;
46
+ state?: string;
47
+ resetTrigger?: EventType | ViewEventType | 'empty';
48
+ isMultiple?: boolean;
49
+ }
50
+ export interface ElementHighlightOptions extends IBaseInteractionOptions {
51
+ selector?: string | string[] | IMark | IMark[];
52
+ trigger?: EventType;
53
+ resetTrigger?: EventType;
54
+ highlightState?: string;
55
+ blurState?: string;
56
+ }
57
+ export interface ElementActiveByLegendOptions extends IBaseInteractionOptions {
58
+ selector?: string | string[] | IMark | IMark[];
59
+ state?: string;
60
+ filterType?: 'key' | 'groupKey';
61
+ }
62
+ export interface ElementHighlightByLegendOptions extends IBaseInteractionOptions {
63
+ selector?: string | string[] | IMark | IMark[];
64
+ highlightState?: string;
65
+ blurState?: string;
66
+ filterType?: 'key' | 'groupKey';
67
+ }
68
+ export interface ElementHighlightByNameOptions extends ElementHighlightByLegendOptions {
69
+ name?: string | string[];
70
+ trigger?: EventType;
71
+ resetTrigger?: EventType;
72
+ parseData?: (e: InteractionEvent) => any;
73
+ }
74
+ export interface BrushEventParams {
75
+ operateType: string;
76
+ operateMask: IPolygon;
77
+ activeElements?: (IElement | IGlyphElement)[];
78
+ }
79
+ export interface BrushOptions extends IBaseInteractionOptions, BrushAttributes {
80
+ selector?: string | string[] | IMark | IMark[];
81
+ onStart?: (params: BrushEventParams) => boolean;
82
+ onUpdate?: (params: BrushEventParams) => boolean;
83
+ onEnd?: (params: BrushEventParams) => boolean;
84
+ onReset?: (params: BrushEventParams) => boolean;
85
+ }
86
+ export interface BrushHighlightOptions extends BrushOptions {
87
+ highlightState?: string;
88
+ blurState?: string;
89
+ }
90
+ export interface BrushActiveOptions extends BrushOptions {
91
+ state?: string;
92
+ }
93
+ export interface BrushFilterOptions extends BrushOptions {
94
+ target: {
95
+ data: IData | string;
96
+ transform?: (data: any[], filterValue: any) => any[];
97
+ };
98
+ }
99
+ export interface DataFilterOptions extends IBaseInteractionOptions {
100
+ source?: string | string[] | IMark | IMark[];
101
+ target: {
102
+ data: IData | string;
103
+ filter?: string | ((datum: any, filterValue: any) => boolean);
104
+ transform?: (data: any[], filterValue: any) => any[];
105
+ };
106
+ }
107
+ export interface DrillDownOptions extends BrushOptions {
108
+ brush?: boolean;
109
+ target: {
110
+ data: IData | string;
111
+ transform?: (data: any[], filterValue: any) => any[];
112
+ };
113
+ }
114
+ export interface RollUpOptions extends DataFilterOptions {
115
+ trigger?: EventType;
116
+ resetTrigger?: EventType | ViewEventType | 'empty';
117
+ }
118
+ export type CustomTooltipCallback = (datum: any, element: IElement, parameters: any) => TooltipRowAttrs | TooltipRowAttrs[];
119
+ export interface ITooltipRow {
120
+ visible?: boolean;
121
+ key?: MarkFunctionType<string | Partial<ITextGraphicAttribute>> | FieldEncodeType;
122
+ value?: MarkFunctionType<string | Partial<ITextGraphicAttribute>> | FieldEncodeType;
123
+ symbol?: MarkFunctionType<string | Partial<ISymbolGraphicAttribute>> | FieldEncodeType;
124
+ }
125
+ export type TooltipType = 'x' | 'y' | 'angle' | 'radius';
126
+ export interface TooltipOptions extends IBaseInteractionOptions {
127
+ selector?: string | string[] | IMark | IMark[];
128
+ trigger?: EventType;
129
+ resetTrigger?: EventType;
130
+ title?: ITooltipRow | string | CustomTooltipCallback;
131
+ content?: ITooltipRow | ITooltipRow[] | CustomTooltipCallback;
132
+ attributes?: MarkFunctionType<TooltipAttributes>;
133
+ }
134
+ export interface DimensionTooltipOptions extends TooltipOptions {
135
+ scale?: IScale | string;
136
+ tooltipType?: TooltipType;
137
+ target?: {
138
+ data: IData | string;
139
+ filter: string | ((datum: any, tooltipValue: any) => boolean);
140
+ };
141
+ avoidMark?: string | string[];
142
+ container?: string | IMark;
143
+ center?: IPointLike;
144
+ }
145
+ export type CrosshairType = 'x' | 'y' | 'angle' | 'radius' | 'radius-polygon';
146
+ export type CrosshairShape = 'line' | 'rect';
147
+ export interface CrosshairOptions extends IBaseInteractionOptions {
148
+ trigger?: EventType;
149
+ resetTrigger?: EventType;
150
+ scale?: IScale | string;
151
+ crosshairType?: CrosshairType;
152
+ crosshairShape?: CrosshairShape;
153
+ container?: string | IMark;
154
+ radius?: number;
155
+ center?: IPointLike;
156
+ attributes?: MarkFunctionType<BaseCrosshairAttrs>;
157
+ }
158
+ export interface ViewNavigationBaseOptions {
159
+ enableX?: boolean;
160
+ enableY?: boolean;
161
+ scaleX?: string | IScale;
162
+ scaleY?: string | IScale;
163
+ dataTargetX?: FilterDataTarget;
164
+ dataTargetY?: FilterDataTarget;
165
+ throttle?: number;
166
+ linkedComponentX?: string | IDatazoom | IScrollbar;
167
+ linkedComponentY?: string | IDatazoom | IScrollbar;
168
+ }
169
+ export interface ViewZoomSimpleOptions {
170
+ realtime?: boolean;
171
+ rate?: number;
172
+ focus?: boolean;
173
+ trigger?: EventType;
174
+ endTrigger?: EventType;
175
+ resetTrigger?: EventType;
176
+ }
177
+ export type ViewZoomOptions = ViewZoomSimpleOptions & IBaseInteractionOptions & ViewNavigationBaseOptions;
178
+ export interface ViewScrollSimpleOptions {
179
+ realtime?: boolean;
180
+ reversed?: boolean;
181
+ trigger?: EventType;
182
+ endTrigger?: EventType;
183
+ }
184
+ export type ViewScrollOptions = ViewScrollSimpleOptions & IBaseInteractionOptions & ViewNavigationBaseOptions;
185
+ export interface ViewDragSimpleOptions {
186
+ realtime?: boolean;
187
+ reversed?: boolean;
188
+ trigger?: EventType;
189
+ endTrigger?: EventType;
190
+ updateTrigger?: EventType;
191
+ }
192
+ export type ViewDragOptions = ViewDragSimpleOptions & IBaseInteractionOptions & ViewNavigationBaseOptions;
193
+ export interface ViewRoamOptions extends IBaseInteractionOptions, ViewNavigationBaseOptions {
194
+ zoom?: ViewZoomSimpleOptions & {
195
+ enable?: boolean;
196
+ };
197
+ scroll?: ViewScrollSimpleOptions & {
198
+ enable?: boolean;
199
+ };
200
+ drag?: ViewDragSimpleOptions & {
201
+ enable?: boolean;
202
+ };
203
+ }
204
+ export interface SankeyHighlightOptions extends IBaseInteractionOptions {
205
+ nodeSelector?: string | IMark;
206
+ linkSelector?: string | IMark;
207
+ trigger?: EventType;
208
+ resetTrigger?: EventType;
209
+ highlightState?: string;
210
+ blurState?: string;
211
+ effect?: 'adjacency' | 'related';
212
+ }
213
+ export interface FishEyeOptions extends IBaseInteractionOptions {
214
+ selector?: string | string[] | IMark | IMark[];
215
+ radiusX?: number;
216
+ radiusY?: number;
217
+ radiusRatioX?: number;
218
+ radiusRatioY?: number;
219
+ distortionX?: number;
220
+ distortionY?: number;
221
+ enableX?: boolean;
222
+ enableY?: boolean;
223
+ scaleX?: string | IScale;
224
+ scaleY?: string | IScale;
225
+ throttle?: number;
226
+ trigger?: EventType;
227
+ endTrigger?: EventType;
228
+ updateTrigger?: EventType;
229
+ resetTrigger?: string;
230
+ }
231
+ export interface ElementActiveSpec extends ElementActiveOptions {
232
+ type: 'element-active';
233
+ }
234
+ export interface ElementSelectSpec extends ElementSelectOptions {
235
+ type: 'element-select';
236
+ }
237
+ export interface ElementHighlightSpec extends ElementHighlightOptions {
238
+ type: 'element-highlight';
239
+ }
240
+ export interface ElementHighlightByKeySpec extends ElementHighlightOptions {
241
+ type: 'element-highlight-by-key';
242
+ }
243
+ export interface ElementHighlightByGroupSpec extends ElementHighlightOptions {
244
+ type: 'element-highlight-by-group';
245
+ }
246
+ export interface ElementActiveByLegendSpec extends ElementActiveByLegendOptions {
247
+ type: 'element-active-by-legend';
248
+ }
249
+ export interface ElementHighlightByLegendSpec extends ElementHighlightByLegendOptions {
250
+ type: 'element-highlight-by-legend';
251
+ }
252
+ export interface ElementHighlightByNameSpec extends ElementHighlightByNameOptions {
253
+ type: 'element-highlight-by-name';
254
+ }
255
+ export interface BrushHighlightSpec extends BrushHighlightOptions {
256
+ type: 'brush-highlight';
257
+ }
258
+ export interface BrushActiveSpec extends BrushActiveOptions {
259
+ type: 'brush-active';
260
+ }
261
+ export interface BrushFilterSpec extends BrushFilterOptions {
262
+ type: 'brush-filter';
263
+ }
264
+ export interface LegendFilterSpec extends DataFilterOptions {
265
+ type: 'legend-filter';
266
+ }
267
+ export interface DatazoomFilterSpec extends DataFilterOptions {
268
+ type: 'datazoom-filter';
269
+ }
270
+ export interface SliderFilterSpec extends DataFilterOptions {
271
+ type: 'slider-filter';
272
+ }
273
+ export interface PlayerFilterSpec extends DataFilterOptions {
274
+ type: 'player-filter';
275
+ }
276
+ export interface ScrollbarFilterSpec extends DataFilterOptions {
277
+ type: 'scrollbar-filter';
278
+ }
279
+ export interface DrillDownSpec extends DrillDownOptions {
280
+ type: 'drill-down';
281
+ }
282
+ export interface RollUpSpec extends RollUpOptions {
283
+ type: 'roll-up';
284
+ }
285
+ export interface TooltipSpec extends TooltipOptions {
286
+ type: 'tooltip';
287
+ }
288
+ export interface DimensionTooltipSpec extends DimensionTooltipOptions {
289
+ type: 'dimension-tooltip';
290
+ }
291
+ export interface CrosshairSpec extends CrosshairOptions {
292
+ type: 'crosshair';
293
+ }
294
+ export interface ViewRoamSpec extends ViewRoamOptions {
295
+ type: 'view-roam';
296
+ }
297
+ export interface ViewZoomSpec extends ViewZoomOptions {
298
+ type: 'view-zoom';
299
+ }
300
+ export interface ViewScrollSpec extends ViewScrollOptions {
301
+ type: 'view-scroll';
302
+ }
303
+ export interface ViewDragSpec extends ViewDragOptions {
304
+ type: 'view-drag';
305
+ }
306
+ export interface SankeyHighlightSpec extends SankeyHighlightOptions {
307
+ type: 'sankey-highlight';
308
+ }
309
+ export interface FishEyeSpec extends FishEyeOptions {
310
+ type: 'fish-eye';
311
+ }
312
+ export type InteractionSpec = ElementActiveSpec | ElementSelectSpec | ElementHighlightSpec | ElementHighlightByKeySpec | ElementHighlightByGroupSpec | ElementActiveByLegendSpec | ElementHighlightByLegendSpec | ElementHighlightByNameSpec | BrushHighlightSpec | BrushActiveSpec | BrushFilterSpec | LegendFilterSpec | DatazoomFilterSpec | SliderFilterSpec | PlayerFilterSpec | ScrollbarFilterSpec | DrillDownSpec | RollUpSpec | TooltipSpec | DimensionTooltipSpec | CrosshairSpec | ViewRoamSpec | ViewZoomSpec | ViewScrollSpec | ViewDragSpec | SankeyHighlightSpec | FishEyeSpec;
313
+ export interface ViewNavigationRange {
314
+ needUpdate?: boolean;
315
+ x?: [number, number];
316
+ y?: [number, number];
317
+ }
318
+ export interface IViewZoomMixin {
319
+ updateZoomRange: (rangeFactor: [number, number], range: [number, number], zoomEvent: {
320
+ zoomDelta: number;
321
+ zoomX: number;
322
+ zoomY: number;
323
+ }, zoomOptions?: ViewZoomSimpleOptions) => [number, number];
324
+ formatZoomEvent: (e: InteractionEvent) => InteractionEvent & {
325
+ zoomDelta?: number;
326
+ zoomX?: number;
327
+ zoomY?: number;
328
+ };
329
+ handleZoomStart: (e: InteractionEvent, navState: Partial<Record<'x' | 'y', ViewStateByDim>>, zoomOptions?: ViewZoomSimpleOptions) => ViewNavigationRange;
330
+ handleZoomEnd: (e: InteractionEvent, navState: Partial<Record<'x' | 'y', ViewStateByDim>>, zoomOptions?: ViewZoomSimpleOptions) => ViewNavigationRange;
331
+ handleZoomReset: (e: InteractionEvent, navState: Partial<Record<'x' | 'y', ViewStateByDim>>, zoomOptions?: ViewZoomSimpleOptions) => ViewNavigationRange;
332
+ }
333
+ export interface IViewScrollMixin {
334
+ formatScrollEvent: (e: InteractionEvent) => InteractionEvent & {
335
+ scrollX?: number;
336
+ scrollY?: number;
337
+ };
338
+ handleScrollStart: (e: InteractionEvent, navState: Partial<Record<'x' | 'y', ViewStateByDim>>, scrollOptions?: ViewScrollSimpleOptions) => ViewNavigationRange;
339
+ handleScrollEnd: (e: InteractionEvent, navState: Partial<Record<'x' | 'y', ViewStateByDim>>, scrollOptions?: ViewScrollSimpleOptions) => ViewNavigationRange;
340
+ }
341
+ export interface IViewDragMixin {
342
+ handleDragStart: (e: InteractionEvent, navState: Partial<Record<'x' | 'y', ViewStateByDim>>, dragOptions?: ViewDragSimpleOptions) => ViewNavigationRange;
343
+ handleDragUpdate: (e: InteractionEvent, navState: Partial<Record<'x' | 'y', ViewStateByDim>>, dragOptions?: ViewDragSimpleOptions) => ViewNavigationRange;
344
+ handleDragEnd: (e: InteractionEvent, navState: Partial<Record<'x' | 'y', ViewStateByDim>>, dragOptions?: ViewDragSimpleOptions) => ViewNavigationRange;
345
+ }
346
+ export interface ViewStateByDim {
347
+ scale?: IScale;
348
+ data?: IData;
349
+ linkedComponent?: IDatazoom | IScrollbar;
350
+ filterValue?: any[];
351
+ wholeScale?: IBaseScale;
352
+ rangeFactor?: [number, number];
353
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ });
6
+ //# sourceMappingURL=interaction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/types/interaction.ts"],"names":[],"mappings":"","file":"interaction.js","sourcesContent":["import type { IView } from './view';\nimport type { EventType, InteractionEvent, ViewEventType } from './event';\nimport type {\n BaseCrosshairAttrs,\n BrushAttributes,\n TooltipAttributes,\n TooltipRowAttrs\n} from '@visactor/vrender-components';\nimport type { IPolygon, ISymbolGraphicAttribute, ITextGraphicAttribute } from '@visactor/vrender-core';\nimport type { IElement, IGlyphElement } from './element';\nimport type { IData, IGrammarBase, IMark, IScale } from './grammar';\nimport type { IPointLike } from '@visactor/vutils';\nimport type { IBaseScale } from '@visactor/vscale';\nimport type { IDatazoom, IScrollbar } from './component';\nimport type { FieldEncodeType, MarkFunctionType } from './mark';\n\nexport interface FilterDataTarget {\n data: string | IData;\n filter: string | ((datum: any, filterValues: any[]) => boolean);\n transform?: (data: any[], filterValues: any[]) => any[];\n}\n\nexport interface IBaseInteractionOptions {\n dependencies?: string | string[] | IGrammarBase | IGrammarBase[];\n\n shouldStart?: (e: any) => boolean;\n\n shouldUpdate?: (e: any) => boolean;\n\n shouldEnd?: (e: any) => boolean;\n\n shouldReset?: (e: any) => boolean;\n\n onStart?: (e: any) => boolean;\n\n onUpdate?: (e: any) => boolean;\n\n onEnd?: (e: any) => boolean;\n\n onReset?: (e: any) => boolean;\n}\n\nexport interface IInteraction {\n readonly type: string;\n depend: (grammar: IGrammarBase[] | IGrammarBase | string[] | string) => void;\n bind: () => void;\n unbind: () => void;\n}\n\nexport interface IInteractionConstructor {\n readonly type: string;\n\n new (view: IView, options?: any): IInteraction;\n}\n\n/**\n * the interaction to set the active state of specified marks\n */\nexport interface ElementActiveOptions extends IBaseInteractionOptions {\n /**\n * the selector of marks\n */\n selector?: string | string[] | IMark | IMark[];\n /**\n * the trigger event name\n */\n trigger?: EventType;\n /**\n * the reset trigger event name\n */\n resetTrigger?: EventType;\n /**\n * the active state name\n */\n state?: string;\n}\n\n/**\n * the interaction to set the seleted state of specified marks\n */\nexport interface ElementSelectOptions extends IBaseInteractionOptions {\n /**\n * the selector of marks\n */\n selector?: string | string[] | IMark | IMark[];\n /**\n * the trigger event name\n */\n trigger?: EventType;\n /**\n * the selected state name\n */\n state?: string;\n /**\n * the reset trigger event name\n */\n resetTrigger?: EventType | ViewEventType | 'empty';\n /**\n * whether or not support multiple selected\n */\n isMultiple?: boolean;\n}\n\n/**\n * the interaction to set the highlight state of specified marks\n */\nexport interface ElementHighlightOptions extends IBaseInteractionOptions {\n /**\n * the selector of marks\n */\n selector?: string | string[] | IMark | IMark[];\n /**\n * the trigger event name\n */\n trigger?: EventType;\n /**\n * the reset trigger event name\n */\n resetTrigger?: EventType;\n /**\n * the highlight state name\n */\n highlightState?: string;\n /**\n * the blur state name\n */\n blurState?: string;\n}\n\n/**\n * the interaction to set the active state of specified marks trigger by legend\n */\nexport interface ElementActiveByLegendOptions extends IBaseInteractionOptions {\n /**\n * the selector of marks\n */\n selector?: string | string[] | IMark | IMark[];\n /**\n * the active state name\n */\n state?: string;\n /**\n * the highlight state name\n */\n filterType?: 'key' | 'groupKey';\n}\n\n/**\n * the interaction to set the active state of specified marks trigger by legend\n */\nexport interface ElementHighlightByLegendOptions extends IBaseInteractionOptions {\n /**\n * the selector of marks\n */\n selector?: string | string[] | IMark | IMark[];\n /**\n * the highlight state name\n */\n highlightState?: string;\n /**\n * the blur state name\n */\n blurState?: string;\n /**\n * the highlight state name\n */\n filterType?: 'key' | 'groupKey';\n}\n\nexport interface ElementHighlightByNameOptions extends ElementHighlightByLegendOptions {\n name?: string | string[];\n /**\n * the trigger event name\n */\n trigger?: EventType;\n /**\n * the reset trigger event name\n */\n resetTrigger?: EventType;\n\n parseData?: (e: InteractionEvent) => any;\n}\n\nexport interface BrushEventParams {\n operateType: string;\n operateMask: IPolygon;\n activeElements?: (IElement | IGlyphElement)[];\n}\n\nexport interface BrushOptions extends IBaseInteractionOptions, BrushAttributes {\n /**\n * the selector of marks\n */\n selector?: string | string[] | IMark | IMark[];\n\n onStart?: (params: BrushEventParams) => boolean;\n\n onUpdate?: (params: BrushEventParams) => boolean;\n\n onEnd?: (params: BrushEventParams) => boolean;\n\n onReset?: (params: BrushEventParams) => boolean;\n}\n\nexport interface BrushHighlightOptions extends BrushOptions {\n /**\n * the highlight state name\n */\n highlightState?: string;\n /**\n * the blur state name\n */\n blurState?: string;\n}\n\nexport interface BrushActiveOptions extends BrushOptions {\n /**\n * the active state name\n */\n state?: string;\n}\n\nexport interface BrushFilterOptions extends BrushOptions {\n target: {\n data: IData | string;\n transform?: (data: any[], filterValue: any) => any[];\n };\n}\n\nexport interface DataFilterOptions extends IBaseInteractionOptions {\n /**\n * the selector of marks\n */\n source?: string | string[] | IMark | IMark[];\n\n /**\n * data target\n */\n target: {\n data: IData | string;\n filter?: string | ((datum: any, filterValue: any) => boolean);\n transform?: (data: any[], filterValue: any) => any[];\n };\n}\n\nexport interface DrillDownOptions extends BrushOptions {\n /**\n * enable brush\n */\n brush?: boolean;\n // trigger attribute is included in brush attributes\n target: {\n data: IData | string;\n transform?: (data: any[], filterValue: any) => any[];\n };\n}\n\nexport interface RollUpOptions extends DataFilterOptions {\n /**\n * the trigger event name\n */\n trigger?: EventType;\n /**\n * the reset trigger event name\n */\n resetTrigger?: EventType | ViewEventType | 'empty';\n}\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 type TooltipType = 'x' | 'y' | 'angle' | 'radius';\n\nexport interface TooltipOptions extends IBaseInteractionOptions {\n /**\n * the selector of marks\n */\n selector?: string | string[] | IMark | IMark[];\n /**\n * the trigger event name\n */\n trigger?: EventType;\n /**\n * the reset trigger event name\n */\n resetTrigger?: EventType;\n\n title?: ITooltipRow | string | CustomTooltipCallback;\n content?: ITooltipRow | ITooltipRow[] | CustomTooltipCallback;\n attributes?: MarkFunctionType<TooltipAttributes>;\n}\n\nexport interface DimensionTooltipOptions extends TooltipOptions {\n scale?: IScale | string;\n tooltipType?: TooltipType;\n target?: {\n data: IData | string;\n filter: string | ((datum: any, tooltipValue: any) => boolean);\n };\n avoidMark?: string | string[];\n container?: string | IMark;\n center?: IPointLike;\n}\n\nexport type CrosshairType = 'x' | 'y' | 'angle' | 'radius' | 'radius-polygon';\n\nexport type CrosshairShape = 'line' | 'rect';\n\nexport interface CrosshairOptions extends IBaseInteractionOptions {\n /**\n * the trigger event name\n */\n trigger?: EventType;\n /**\n * the reset trigger event name\n */\n resetTrigger?: EventType;\n scale?: IScale | string;\n crosshairType?: CrosshairType;\n crosshairShape?: CrosshairShape;\n container?: string | IMark;\n radius?: number;\n center?: IPointLike;\n attributes?: MarkFunctionType<BaseCrosshairAttrs>;\n}\nexport interface ViewNavigationBaseOptions {\n enableX?: boolean;\n enableY?: boolean;\n scaleX?: string | IScale;\n scaleY?: string | IScale;\n dataTargetX?: FilterDataTarget;\n dataTargetY?: FilterDataTarget;\n throttle?: number;\n linkedComponentX?: string | IDatazoom | IScrollbar;\n linkedComponentY?: string | IDatazoom | IScrollbar;\n}\n\nexport interface ViewZoomSimpleOptions {\n realtime?: boolean;\n rate?: number;\n focus?: boolean;\n trigger?: EventType;\n endTrigger?: EventType;\n resetTrigger?: EventType;\n}\n\nexport type ViewZoomOptions = ViewZoomSimpleOptions & IBaseInteractionOptions & ViewNavigationBaseOptions;\n\nexport interface ViewScrollSimpleOptions {\n realtime?: boolean;\n reversed?: boolean;\n trigger?: EventType;\n endTrigger?: EventType;\n}\nexport type ViewScrollOptions = ViewScrollSimpleOptions & IBaseInteractionOptions & ViewNavigationBaseOptions;\n\nexport interface ViewDragSimpleOptions {\n realtime?: boolean;\n reversed?: boolean;\n trigger?: EventType;\n endTrigger?: EventType;\n updateTrigger?: EventType;\n}\n\nexport type ViewDragOptions = ViewDragSimpleOptions & IBaseInteractionOptions & ViewNavigationBaseOptions;\n\nexport interface ViewRoamOptions extends IBaseInteractionOptions, ViewNavigationBaseOptions {\n zoom?: ViewZoomSimpleOptions & { enable?: boolean };\n scroll?: ViewScrollSimpleOptions & { enable?: boolean };\n drag?: ViewDragSimpleOptions & { enable?: boolean };\n}\n\n/**\n * the interaction to set the highlight state of specified marks\n */\nexport interface SankeyHighlightOptions extends IBaseInteractionOptions {\n /**\n * the selector of node mark\n */\n nodeSelector?: string | IMark;\n /**\n * the selector of link mark\n */\n linkSelector?: string | IMark;\n /**\n * the trigger event name\n */\n trigger?: EventType;\n /**\n * the reset trigger event name\n */\n resetTrigger?: EventType;\n /**\n * the highlight state name\n */\n highlightState?: string;\n /**\n * the blur state name\n */\n blurState?: string;\n /** set higlight state to different type of nodes */\n effect?: 'adjacency' | 'related';\n}\n\nexport interface FishEyeOptions extends IBaseInteractionOptions {\n selector?: string | string[] | IMark | IMark[];\n /** the radius of x-direction */\n radiusX?: number;\n /** the radius of y-direction */\n radiusY?: number;\n /** the radiusRatio of x-direction */\n radiusRatioX?: number;\n /** the radiusRatio of y-direction */\n radiusRatioY?: number;\n /** x方向的扰动 */\n distortionX?: number;\n /** y方向的扰动 */\n distortionY?: number;\n /** 禁用 x方向的变形 */\n enableX?: boolean;\n /** 禁用y方向的变形 */\n enableY?: boolean;\n /** x方向的scale */\n scaleX?: string | IScale;\n /** y方向的scale */\n scaleY?: string | IScale;\n /** 节流的时长,单位为ms */\n throttle?: number;\n /**\n * the trigger event name\n */\n trigger?: EventType;\n /**\n * the trigger event of end\n */\n endTrigger?: EventType;\n /**\n * the trigger event of updating\n */\n updateTrigger?: EventType;\n /**\n * the trigger event of reset\n */\n resetTrigger?: string;\n}\n\nexport interface ElementActiveSpec extends ElementActiveOptions {\n type: 'element-active';\n}\nexport interface ElementSelectSpec extends ElementSelectOptions {\n type: 'element-select';\n}\nexport interface ElementHighlightSpec extends ElementHighlightOptions {\n type: 'element-highlight';\n}\nexport interface ElementHighlightByKeySpec extends ElementHighlightOptions {\n type: 'element-highlight-by-key';\n}\nexport interface ElementHighlightByGroupSpec extends ElementHighlightOptions {\n type: 'element-highlight-by-group';\n}\nexport interface ElementActiveByLegendSpec extends ElementActiveByLegendOptions {\n type: 'element-active-by-legend';\n}\n\nexport interface ElementHighlightByLegendSpec extends ElementHighlightByLegendOptions {\n type: 'element-highlight-by-legend';\n}\n\nexport interface ElementHighlightByNameSpec extends ElementHighlightByNameOptions {\n type: 'element-highlight-by-name';\n}\n\nexport interface BrushHighlightSpec extends BrushHighlightOptions {\n type: 'brush-highlight';\n}\n\nexport interface BrushActiveSpec extends BrushActiveOptions {\n type: 'brush-active';\n}\n\nexport interface BrushFilterSpec extends BrushFilterOptions {\n type: 'brush-filter';\n}\n\nexport interface LegendFilterSpec extends DataFilterOptions {\n type: 'legend-filter';\n}\n\nexport interface DatazoomFilterSpec extends DataFilterOptions {\n type: 'datazoom-filter';\n}\n\nexport interface SliderFilterSpec extends DataFilterOptions {\n type: 'slider-filter';\n}\n\nexport interface PlayerFilterSpec extends DataFilterOptions {\n type: 'player-filter';\n}\n\nexport interface ScrollbarFilterSpec extends DataFilterOptions {\n type: 'scrollbar-filter';\n}\n\nexport interface DrillDownSpec extends DrillDownOptions {\n type: 'drill-down';\n}\n\nexport interface RollUpSpec extends RollUpOptions {\n type: 'roll-up';\n}\n\nexport interface TooltipSpec extends TooltipOptions {\n type: 'tooltip';\n}\n\nexport interface DimensionTooltipSpec extends DimensionTooltipOptions {\n type: 'dimension-tooltip';\n}\n\nexport interface CrosshairSpec extends CrosshairOptions {\n type: 'crosshair';\n}\nexport interface ViewRoamSpec extends ViewRoamOptions {\n type: 'view-roam';\n}\n\nexport interface ViewZoomSpec extends ViewZoomOptions {\n type: 'view-zoom';\n}\n\nexport interface ViewScrollSpec extends ViewScrollOptions {\n type: 'view-scroll';\n}\n\nexport interface ViewDragSpec extends ViewDragOptions {\n type: 'view-drag';\n}\n\nexport interface SankeyHighlightSpec extends SankeyHighlightOptions {\n type: 'sankey-highlight';\n}\n\nexport interface FishEyeSpec extends FishEyeOptions {\n type: 'fish-eye';\n}\n\nexport type InteractionSpec =\n | ElementActiveSpec\n | ElementSelectSpec\n | ElementHighlightSpec\n | ElementHighlightByKeySpec\n | ElementHighlightByGroupSpec\n | ElementActiveByLegendSpec\n | ElementHighlightByLegendSpec\n | ElementHighlightByNameSpec\n | BrushHighlightSpec\n | BrushActiveSpec\n | BrushFilterSpec\n | LegendFilterSpec\n | DatazoomFilterSpec\n | SliderFilterSpec\n | PlayerFilterSpec\n | ScrollbarFilterSpec\n | DrillDownSpec\n | RollUpSpec\n | TooltipSpec\n | DimensionTooltipSpec\n | CrosshairSpec\n | ViewRoamSpec\n | ViewZoomSpec\n | ViewScrollSpec\n | ViewDragSpec\n | SankeyHighlightSpec\n | FishEyeSpec;\n\nexport interface ViewNavigationRange {\n needUpdate?: boolean;\n x?: [number, number];\n y?: [number, number];\n}\n\nexport interface IViewZoomMixin {\n updateZoomRange: (\n rangeFactor: [number, number],\n range: [number, number],\n zoomEvent: { zoomDelta: number; zoomX: number; zoomY: number },\n zoomOptions?: ViewZoomSimpleOptions\n ) => [number, number];\n formatZoomEvent: (e: InteractionEvent) => InteractionEvent & { zoomDelta?: number; zoomX?: number; zoomY?: number };\n handleZoomStart: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n zoomOptions?: ViewZoomSimpleOptions\n ) => ViewNavigationRange;\n handleZoomEnd: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n zoomOptions?: ViewZoomSimpleOptions\n ) => ViewNavigationRange;\n handleZoomReset: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n zoomOptions?: ViewZoomSimpleOptions\n ) => ViewNavigationRange;\n}\n\nexport interface IViewScrollMixin {\n formatScrollEvent: (e: InteractionEvent) => InteractionEvent & { scrollX?: number; scrollY?: number };\n handleScrollStart: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n scrollOptions?: ViewScrollSimpleOptions\n ) => ViewNavigationRange;\n handleScrollEnd: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n scrollOptions?: ViewScrollSimpleOptions\n ) => ViewNavigationRange;\n}\n\nexport interface IViewDragMixin {\n handleDragStart: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n dragOptions?: ViewDragSimpleOptions\n ) => ViewNavigationRange;\n handleDragUpdate: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n dragOptions?: ViewDragSimpleOptions\n ) => ViewNavigationRange;\n handleDragEnd: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n dragOptions?: ViewDragSimpleOptions\n ) => ViewNavigationRange;\n}\n\nexport interface ViewStateByDim {\n scale?: IScale;\n data?: IData;\n linkedComponent?: IDatazoom | IScrollbar;\n filterValue?: any[];\n wholeScale?: IBaseScale;\n rangeFactor?: [number, number];\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { ICustomPath2D, IPyramid3dGraphicAttribute, IArc3dGraphicAttribute, IRect3dGraphicAttribute, ISymbolAttribute, IRectGraphicAttribute, ILineGraphicAttribute, ICircleGraphicAttribute, IArcGraphicAttribute, IPolygonGraphicAttribute, IAreaGraphicAttribute, IGlyphGraphicAttribute, IImageGraphicAttribute, IPathGraphicAttribute, ISymbolGraphicAttribute, ITextGraphicAttribute, IGraphicAttribute, IGroupGraphicAttribute, IRichTextGraphicAttribute } from '@visactor/vrender';
1
+ import type { ICustomPath2D, IPyramid3dGraphicAttribute, IArc3dGraphicAttribute, IRect3dGraphicAttribute, ISymbolAttribute, IRectGraphicAttribute, ILineGraphicAttribute, ICircleGraphicAttribute, IArcGraphicAttribute, IPolygonGraphicAttribute, IAreaGraphicAttribute, IGlyphGraphicAttribute, IImageGraphicAttribute, IPathGraphicAttribute, ISymbolGraphicAttribute, ITextGraphicAttribute, IGraphicAttribute, IGroupGraphicAttribute, IRichTextGraphicAttribute } from '@visactor/vrender-core';
2
2
  import type { Bounds, IPointLike } from '@visactor/vutils';
3
3
  import type { IAnimationConfig, IStateAnimationConfig } from './animate';
4
4
  import type { IElement } from './element';
@@ -7,7 +7,7 @@ import type { GenericFunctionType } from './signal';
7
7
  import type { TransformSpec } from './transform';
8
8
  import type { CommonPaddingSpec } from './base';
9
9
  import type { ILayoutOptions } from './view';
10
- import type { AxisSpec, BuiltInComponentSpec, CrosshairSpec, DatazoomSpec, LabelSpec, LegendSpec, PlayerSpec, SliderSpec } from './component';
10
+ import type { AxisSpec, BuiltInComponentSpec, DatazoomSpec, LabelSpec, LegendSpec, PlayerSpec, SliderSpec } from './component';
11
11
  import type { GrammarMarkType } from '../graph/enums';
12
12
  export type MarkFunctionCallback<T> = (datum: any, element: IElement, parameters: any) => T;
13
13
  export type MarkFunctionType<T> = GenericFunctionType<MarkFunctionCallback<T>, T>;
@@ -324,7 +324,6 @@ export type MarkSpecMap = {
324
324
  component: ComponentSpec;
325
325
  axis: AxisSpec;
326
326
  legend: LegendSpec;
327
- corsshair: CrosshairSpec;
328
327
  slider: SliderSpec;
329
328
  datazoom: DatazoomSpec;
330
329
  label: LabelSpec;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types/mark.ts"],"names":[],"mappings":"","file":"mark.js","sourcesContent":["import type {\n ICustomPath2D,\n IPyramid3dGraphicAttribute,\n IArc3dGraphicAttribute,\n IRect3dGraphicAttribute,\n ISymbolAttribute,\n IRectGraphicAttribute,\n ILineGraphicAttribute,\n ICircleGraphicAttribute,\n IArcGraphicAttribute,\n IPolygonGraphicAttribute,\n IAreaGraphicAttribute,\n IGlyphGraphicAttribute,\n IImageGraphicAttribute,\n IPathGraphicAttribute,\n ISymbolGraphicAttribute,\n ITextGraphicAttribute,\n IGraphicAttribute,\n IGroupGraphicAttribute,\n IRichTextGraphicAttribute\n} from '@visactor/vrender';\nimport type { Bounds, IPointLike } from '@visactor/vutils';\nimport type { IAnimationConfig, IStateAnimationConfig } from './animate';\nimport type { IElement } from './element';\nimport type { IMark, IScale, IGroupMark, ICoordinate, GrammarSpec, IData } from './grammar';\nimport type { GenericFunctionType } from './signal';\nimport type { TransformSpec } from './transform';\nimport type { CommonPaddingSpec } from './base';\nimport type { ILayoutOptions } from './view';\nimport type {\n AxisSpec,\n BuiltInComponentSpec,\n CrosshairSpec,\n DatazoomSpec,\n LabelSpec,\n LegendSpec,\n PlayerSpec,\n SliderSpec\n} from './component';\nimport type { GrammarMarkType } from '../graph/enums';\n\nexport type MarkFunctionCallback<T> = (datum: any, element: IElement, parameters: any) => T;\n\nexport type MarkFunctionType<T> = GenericFunctionType<MarkFunctionCallback<T>, T>;\n\nexport type MarkType = keyof typeof GrammarMarkType | string;\n\nexport interface MarkFromSpec {\n data: string | IData;\n transform?: {\n name: string;\n transform?: TransformSpec[];\n };\n}\n\nexport type MarkStateSpec = MarkFunctionType<string | string[]>;\n\nexport type ScaleEncodeType = {\n scale: IScale | string;\n field?: string | ((datum: any) => any) | string[] | ((datum: any) => any)[];\n value?: any;\n band?: number;\n offset?: number;\n};\n\nexport type FieldEncodeType = {\n field: string | ((datum: any) => any) | string[] | ((datum: any) => any)[];\n};\n\nexport type ChannelEncodeType<T = any> = MarkFunctionType<T> | ScaleEncodeType | FieldEncodeType;\n\nexport type GenerateEncoderSpec<T> = {\n [Key in keyof T]?: ChannelEncodeType<T[Key]>;\n};\n\n/**\n * the common channel supported by graphic marks\n */\nexport type GenerateBasicEncoderSpec<T> = Partial<\n Omit<\n T,\n | 'strokeSeg'\n | 'boundsPadding'\n | 'pickMode'\n | 'boundsMode'\n | 'customPickShape'\n | 'pickable'\n | 'childrenPickable'\n | 'visible'\n | 'zIndex'\n | 'layout'\n | 'keepDirIn3d'\n | 'postMatrix'\n | 'anchor'\n | 'anchor3d'\n >\n>;\n\nexport type BasicEncoderSpecMap = {\n rect: GenerateBasicEncoderSpec<IRectGraphicAttribute & { y1?: number; x1?: number }>;\n line: Omit<GenerateBasicEncoderSpec<ILineGraphicAttribute>, 'points' | 'segments'>;\n circle: GenerateBasicEncoderSpec<ICircleGraphicAttribute>;\n arc: GenerateBasicEncoderSpec<IArcGraphicAttribute>;\n polygon: GenerateBasicEncoderSpec<IPolygonGraphicAttribute>;\n arc3d: GenerateBasicEncoderSpec<IArc3dGraphicAttribute>;\n pyramid3d: GenerateBasicEncoderSpec<IPyramid3dGraphicAttribute>;\n area: Omit<GenerateBasicEncoderSpec<IAreaGraphicAttribute>, 'points' | 'segments'>;\n group: GenerateBasicEncoderSpec<IGroupGraphicAttribute>;\n glyph: GenerateBasicEncoderSpec<IGlyphGraphicAttribute & any>;\n image: GenerateBasicEncoderSpec<IImageGraphicAttribute>;\n rect3d: GenerateBasicEncoderSpec<IRect3dGraphicAttribute>;\n path: GenerateBasicEncoderSpec<IPathGraphicAttribute>;\n rule: Omit<GenerateBasicEncoderSpec<ILineGraphicAttribute>, 'points' | 'segments'> & { x1?: number; y1?: number };\n shape: GenerateBasicEncoderSpec<IPathGraphicAttribute>;\n symbol: GenerateBasicEncoderSpec<ISymbolGraphicAttribute> & {\n shape?: ISymbolGraphicAttribute['symbolType'];\n image?: ISymbolGraphicAttribute['background'];\n };\n text: GenerateBasicEncoderSpec<ITextGraphicAttribute> & {\n limit?: number;\n autoLimit?: number;\n };\n richtext: GenerateBasicEncoderSpec<IRichTextGraphicAttribute>;\n interval: Omit<GenerateBasicEncoderSpec<IRectGraphicAttribute>, 'width' | 'height'> & {\n /**\n * the gap for two graphic elements\n */\n innerGap?: number | string;\n /**\n * only used for rect / interval mark\n */\n maxWidth?: number;\n minWidth?: number;\n /** the gap between two category */\n categoryGap?: number | string;\n };\n cell: GenerateBasicEncoderSpec<ISymbolGraphicAttribute> & {\n padding?: number | [number, number];\n shape?: ISymbolAttribute['symbolType'];\n };\n};\nexport type GenerateBaseEncodeSpec<BasicSpec = GenerateBasicEncoderSpec<IGraphicAttribute>> =\n | GenerateEncoderSpec<BasicSpec>\n | MarkFunctionCallback<BasicSpec>;\n\nexport type StateProxyEncodeSpec<T = any> = (datum: any, element: IElement, state: string, nextStates: string[]) => T;\n\nexport type StateEncodeSpec<BasicSpec = GenerateBasicEncoderSpec<IGraphicAttribute>> =\n | {\n enter?: GenerateBaseEncodeSpec<BasicSpec>;\n update?: GenerateBaseEncodeSpec<BasicSpec>;\n exit?: GenerateBaseEncodeSpec<BasicSpec>;\n }\n | {\n [state: string]: GenerateEncoderSpec<BasicSpec> | StateProxyEncodeSpec<BasicSpec>;\n };\n\nexport type MarkAnimationSpec = Record<string, IAnimationConfig | IAnimationConfig[]> & {\n state?: IStateAnimationConfig;\n};\n\n// TODO: support string[]\nexport type MarkKeySpec = string | ((datum: any) => string);\n\nexport type MarkSortSpec = (datumA: any, datumB: any) => number;\n\nexport type MarkStateSortSpec = (stateA: string, stateB: string) => number;\n\nexport interface MarkGridContainerSpec extends MarkBaseLayoutSpec {\n display: 'grid';\n gridTemplateRows?: (number | string | 'auto')[];\n gridTemplateColumns?: (number | string | 'auto')[];\n gridRowGap?: number;\n gridColumnGap?: number;\n}\n\nexport interface MarkGridItemSpec extends MarkBaseLayoutSpec {\n gridRowStart?: number;\n gridRowEnd?: number;\n gridColumnStart?: number;\n gridColumnEnd?: number;\n}\n\nexport interface MarkBaseLayoutSpec {\n callback?: MarkLayoutCallback;\n skipBeforeLayouted?: boolean;\n updateViewSignals?: boolean;\n}\n\nexport interface MarkRelativeItemSpec extends MarkBaseLayoutSpec {\n position?: 'top' | 'bottom' | 'left' | 'right' | 'content' | 'auto' | string;\n padding?: CommonPaddingSpec;\n align?: 'left' | 'right' | 'center' | 'top' | 'bottom' | 'middle';\n order?: number;\n}\n\nexport interface MarkRelativeContainerSpec extends MarkBaseLayoutSpec {\n display: 'relative';\n maxChildWidth?: string | number;\n maxChildHeight?: string | number;\n}\n\nexport type MarkLayoutSpec =\n | MarkGridContainerSpec\n | MarkGridItemSpec\n | MarkRelativeContainerSpec\n | MarkRelativeItemSpec;\n\nexport type MarkLayoutCallback = (\n group: IGroupMark,\n children: IMark[],\n parentLayoutBounds: Bounds,\n options?: ILayoutOptions\n) => void;\n\nexport interface IMarkConfig {\n clip?: boolean;\n zIndex?: number;\n interactive?: boolean;\n context?: any;\n /**\n * set customized shape\n */\n setCustomizedShape?: (datum: any[], attrs: any, path: ICustomPath2D) => ICustomPath2D;\n /** 是否开启大数据渲染模式 */\n large?: boolean;\n /** 开启大数据渲染优化的阀值,对应的是data的长度 */\n largeThreshold?: number;\n /** 分片长度 */\n progressiveStep?: number;\n /** 开启分片渲染的阀值,对应的是单系列data的长度 */\n progressiveThreshold?: number;\n /**\n * use 'sequential' for symbol chart\n * use 'mod' for bar/line chart\n */\n // largeChunkMode?: 'sequential' | 'mod';\n support3d?: boolean;\n /**\n * enable global morphing animation of the mark\n */\n morph?: boolean;\n /**\n * this key will be used to match the mark to morph\n */\n morphKey?: string;\n /**\n * this key will be used to match the element of two marks to morph\n * If not specified, we'll use the \"key\" of the mark by default\n */\n morphElementKey?: string;\n /** transforms of attributes */\n attributeTransforms?: AttributeTransform[];\n}\n\n/**\n * Base mark specification type\n */\nexport interface GenerateMarkSpec<T extends MarkType = string, P = any> extends IMarkConfig, GrammarSpec {\n type: T;\n name?: string;\n group?: string | IGroupMark;\n // data attributes\n from?: MarkFromSpec;\n key?: MarkKeySpec;\n /**\n * sort all the elements in the mark\n */\n sort?: MarkSortSpec;\n /**\n * set the group key of the mark\n */\n groupBy?: MarkKeySpec;\n /**\n * sort the data of each group\n */\n groupSort?: MarkSortSpec;\n context?: any;\n // coordinate attributes\n coordinate?: string | ICoordinate;\n // encode attributes\n state?: MarkStateSpec;\n stateSort?: MarkStateSortSpec;\n encode?: GetEncoderSpecByType<T, P>;\n // animation attributes\n animationState?: MarkFunctionType<string>;\n animation?: MarkAnimationSpec;\n transform?: TransformSpec[];\n layout?: MarkLayoutSpec | MarkLayoutCallback;\n}\n\nexport type CircleMarkSpec = GenerateMarkSpec<'circle'>;\nexport type ArcMarkSpec = GenerateMarkSpec<'arc'>;\nexport type AreaMarkSpec = GenerateMarkSpec<'area'>;\nexport type LineMarkSpec = GenerateMarkSpec<'line'>;\nexport type RectMarkSpec = GenerateMarkSpec<'rect'>;\nexport type ImageMarkSpec = GenerateMarkSpec<'image'>;\nexport type PathMarkSpec = GenerateMarkSpec<'path'>;\nexport type RuleMarkSpec = GenerateMarkSpec<'rule'>;\nexport type ShapeMarkSpec = GenerateMarkSpec<'shape'>;\nexport type SymbolMarkSpec = GenerateMarkSpec<'symbol'>;\nexport type TextMarkSpec = GenerateMarkSpec<'text'>;\nexport type RichTextMarkSpec = GenerateMarkSpec<'richtext'>;\nexport type PolygonMarkSpec = GenerateMarkSpec<'polygon'>;\nexport type CellMarkSpec = GenerateMarkSpec<'cell'>;\nexport type IntervalMarkSpec = GenerateMarkSpec<'interval'>;\nexport type Arc3dMarkSpec = GenerateMarkSpec<'arc3d'>;\nexport type Pyramid3dMarkSpec = GenerateMarkSpec<'pyramid3d'>;\nexport type Rect3dMarkSpec = GenerateMarkSpec<'rect3d'>;\n\nexport type BasicGlyphEncoderSpec = BasicEncoderSpecMap['glyph'];\nexport type BasicGroupEncoderSpec = BasicEncoderSpecMap['group'];\nexport interface GroupMarkSpec extends GenerateMarkSpec<'group'> {\n marks?: MarkSpec[];\n}\n\nexport interface GlyphMarkSpec<CustomizedEncoderSpec = any> extends GenerateMarkSpec<'glyph', CustomizedEncoderSpec> {\n glyphType: string;\n glyphConfig?: any;\n}\n\nexport interface BoxPlotEncoderSpec extends BasicGlyphEncoderSpec {\n boxWidth?: number;\n boxHeight?: number;\n ruleWidth?: number;\n ruleHeight?: number;\n q1?: number;\n q3?: number;\n min?: number;\n max?: number;\n median?: number;\n angle?: number;\n anchor?: [number, number];\n}\n\nexport interface BarBoxPlotEncoderSpec extends BasicGlyphEncoderSpec {\n minMaxWidth?: number;\n q1q3Width?: number;\n minMaxHeight?: number;\n q1q3Height?: number;\n q1?: number;\n q3?: number;\n min?: number;\n max?: number;\n median?: number;\n angle?: number;\n lineWidth?: number;\n minMaxFillOpacity?: number;\n anchor?: [number, number];\n}\n\nexport interface LinkPathEncoderSpec extends BasicGlyphEncoderSpec {\n x0: number;\n y0: number;\n x1: number;\n y1: number;\n thickness: number;\n curvature?: number;\n /** round all the coordinates */\n round?: boolean;\n /** the ratio of normal style path */\n ratio?: number;\n align?: 'start' | 'end' | 'center';\n pathType?: 'line' | 'smooth' | 'polyline';\n endArrow?: boolean;\n startArrow?: boolean;\n backgroundStyle?: any;\n direction?: 'horizontal' | 'vertical' | 'LR' | 'RL' | 'TB' | 'BL' | 'radial';\n}\nexport interface TreePathEncoderSpec extends BasicGlyphEncoderSpec {\n x0: number;\n y0: number;\n x1: number;\n y1: number;\n curvature?: number;\n /** round all the coordinates */\n round?: boolean;\n /** the ratio of normal style path */\n align?: 'start' | 'end' | 'center';\n pathType?: 'line' | 'smooth' | 'polyline';\n startArrowStyle?: Partial<IGraphicAttribute>;\n endArrowStyle?: Partial<IGraphicAttribute>;\n endArrow?: boolean;\n startArrow?: boolean;\n arrowSize?: number;\n backgroundStyle?: any;\n direction?: 'horizontal' | 'vertical' | 'LR' | 'RL' | 'TB' | 'BL' | 'radial';\n}\n\nexport interface RipplePointEncoderSpec extends BasicGlyphEncoderSpec {\n ripple?: number;\n size?: number;\n}\n\nexport interface ViolinEncoderSpec extends BasicGlyphEncoderSpec {\n violinFill: string;\n violinStroke: string;\n medianFill?: string;\n density?: IPointLike[];\n boxWidth?: number;\n q1?: number;\n q3?: number;\n min?: number;\n max?: number;\n median?: number;\n angle?: number;\n anchor?: [number, number];\n}\n\nexport interface WaveEncoderSpec extends BasicGlyphEncoderSpec {\n wave?: number;\n}\nexport interface BoxPlotGlyphSpec extends GlyphMarkSpec<BoxPlotEncoderSpec> {\n glyphType: 'boxplot';\n}\nexport interface BarBoxPlotGlyphSpec extends GlyphMarkSpec<BarBoxPlotEncoderSpec> {\n glyphType: 'barBoxplot';\n}\nexport interface LinkPathGlyphSpec extends GlyphMarkSpec<LinkPathEncoderSpec> {\n glyphType: 'linkPath';\n}\nexport interface TreePathGlyphSpec extends GlyphMarkSpec<TreePathEncoderSpec> {\n glyphType: 'treePath';\n}\nexport interface RipplePointGlyphSpec extends GlyphMarkSpec<RipplePointEncoderSpec> {\n glyphType: 'ripplePoint';\n}\nexport interface ViolinGlyphSpec extends GlyphMarkSpec<ViolinEncoderSpec> {\n glyphType: 'violin';\n}\nexport interface WaveGlyphSpec extends GlyphMarkSpec<WaveEncoderSpec> {\n glyphType: 'wave';\n}\n\nexport interface ComponentSpec<\n BasicEncoderSpec extends GenerateBasicEncoderSpec<IGraphicAttribute> = GenerateBasicEncoderSpec<IGraphicAttribute>\n> extends GenerateMarkSpec<'component', BasicEncoderSpec> {\n componentType: string;\n componentConfig?: any;\n mode?: '2d' | '3d';\n}\n\nexport type BaseMarkSpec = GenerateMarkSpec<MarkType>;\nexport type MarkSpecMap = {\n circle: CircleMarkSpec;\n arc: ArcMarkSpec;\n area: AreaMarkSpec;\n image: ImageMarkSpec;\n line: LineMarkSpec;\n path: PathMarkSpec;\n rule: RuleMarkSpec;\n shape: ShapeMarkSpec;\n symbol: SymbolMarkSpec;\n text: TextMarkSpec;\n richtext: RichTextMarkSpec;\n polygon: PolygonMarkSpec;\n cell: CellMarkSpec;\n interval: IntervalMarkSpec;\n rect: RectMarkSpec;\n rect3d: Rect3dMarkSpec;\n arc3d: Arc3dMarkSpec;\n pyramid3d: Pyramid3dMarkSpec;\n group: GroupMarkSpec;\n glyph: GlyphMarkSpec;\n linkPath: LinkPathGlyphSpec;\n treePath: TreePathGlyphSpec;\n wave: WaveEncoderSpec;\n ripplePoint: RipplePointGlyphSpec;\n barBoxplot: BarBoxPlotGlyphSpec;\n boxPlot: BoxPlotGlyphSpec;\n component: ComponentSpec;\n axis: AxisSpec;\n legend: LegendSpec;\n corsshair: CrosshairSpec;\n slider: SliderSpec;\n datazoom: DatazoomSpec;\n label: LabelSpec;\n player: PlayerSpec;\n};\n\nexport type GetMarkSpecByType<T, P = any> = T extends keyof MarkSpecMap ? MarkSpecMap[T] : GenerateMarkSpec<string, P>;\nexport type GetBasicEncoderSpecByType<T, P = any> = T extends keyof BasicEncoderSpecMap\n ? BasicEncoderSpecMap[T]\n : GenerateBasicEncoderSpec<IGraphicAttribute & P>;\nexport type GetEncoderSpecByType<T, P = any> = T extends keyof BasicEncoderSpecMap\n ? StateEncodeSpec<BasicEncoderSpecMap[T]>\n : StateEncodeSpec<GenerateBasicEncoderSpec<IGraphicAttribute> & P>;\n\nexport type BaseEncodeSpec<P = any> = StateEncodeSpec<GenerateBasicEncoderSpec<IGraphicAttribute & P>>;\nexport type BaseSignleEncodeSpec<P = any> =\n | GenerateEncoderSpec<GenerateBasicEncoderSpec<IGraphicAttribute & P>>\n | StateProxyEncodeSpec<GenerateBasicEncoderSpec<IGraphicAttribute & P>>;\n\nexport type GetSignleEncodeSpecByType<T, P = any> = T extends keyof BasicEncoderSpecMap\n ? GenerateEncoderSpec<BasicEncoderSpecMap[T]> | StateProxyEncodeSpec<BasicEncoderSpecMap[T]>\n : BaseSignleEncodeSpec<P>;\n\nexport type MarkSpec =\n | GenerateMarkSpec<string, any>\n | CircleMarkSpec\n | ArcMarkSpec\n | AreaMarkSpec\n | ImageMarkSpec\n | LineMarkSpec\n | PathMarkSpec\n | RuleMarkSpec\n | ShapeMarkSpec\n | SymbolMarkSpec\n | TextMarkSpec\n | RichTextMarkSpec\n | PolygonMarkSpec\n | CellMarkSpec\n | IntervalMarkSpec\n | RectMarkSpec\n | Rect3dMarkSpec\n | Arc3dMarkSpec\n | Pyramid3dMarkSpec\n | GroupMarkSpec\n | GlyphMarkSpec\n | LinkPathGlyphSpec\n | TreePathGlyphSpec\n | WaveGlyphSpec\n | RipplePointGlyphSpec\n | BarBoxPlotGlyphSpec\n | BoxPlotGlyphSpec\n | ViolinGlyphSpec\n | ComponentSpec\n | BuiltInComponentSpec;\n\nexport interface AttributeTransform {\n channels: string[];\n transform: (graphicAttributes: any, nextAttrs: any, storedAttrs: any) => void;\n storedAttrs?: string;\n}\n"]}
1
+ {"version":3,"sources":["../src/types/mark.ts"],"names":[],"mappings":"","file":"mark.js","sourcesContent":["import type {\n ICustomPath2D,\n IPyramid3dGraphicAttribute,\n IArc3dGraphicAttribute,\n IRect3dGraphicAttribute,\n ISymbolAttribute,\n IRectGraphicAttribute,\n ILineGraphicAttribute,\n ICircleGraphicAttribute,\n IArcGraphicAttribute,\n IPolygonGraphicAttribute,\n IAreaGraphicAttribute,\n IGlyphGraphicAttribute,\n IImageGraphicAttribute,\n IPathGraphicAttribute,\n ISymbolGraphicAttribute,\n ITextGraphicAttribute,\n IGraphicAttribute,\n IGroupGraphicAttribute,\n IRichTextGraphicAttribute\n} from '@visactor/vrender-core';\nimport type { Bounds, IPointLike } from '@visactor/vutils';\nimport type { IAnimationConfig, IStateAnimationConfig } from './animate';\nimport type { IElement } from './element';\nimport type { IMark, IScale, IGroupMark, ICoordinate, GrammarSpec, IData } from './grammar';\nimport type { GenericFunctionType } from './signal';\nimport type { TransformSpec } from './transform';\nimport type { CommonPaddingSpec } from './base';\nimport type { ILayoutOptions } from './view';\nimport type {\n AxisSpec,\n BuiltInComponentSpec,\n DatazoomSpec,\n LabelSpec,\n LegendSpec,\n PlayerSpec,\n SliderSpec\n} from './component';\nimport type { GrammarMarkType } from '../graph/enums';\n\nexport type MarkFunctionCallback<T> = (datum: any, element: IElement, parameters: any) => T;\n\nexport type MarkFunctionType<T> = GenericFunctionType<MarkFunctionCallback<T>, T>;\n\nexport type MarkType = keyof typeof GrammarMarkType | string;\n\nexport interface MarkFromSpec {\n data: string | IData;\n transform?: {\n name: string;\n transform?: TransformSpec[];\n };\n}\n\nexport type MarkStateSpec = MarkFunctionType<string | string[]>;\n\nexport type ScaleEncodeType = {\n scale: IScale | string;\n field?: string | ((datum: any) => any) | string[] | ((datum: any) => any)[];\n value?: any;\n band?: number;\n offset?: number;\n};\n\nexport type FieldEncodeType = {\n field: string | ((datum: any) => any) | string[] | ((datum: any) => any)[];\n};\n\nexport type ChannelEncodeType<T = any> = MarkFunctionType<T> | ScaleEncodeType | FieldEncodeType;\n\nexport type GenerateEncoderSpec<T> = {\n [Key in keyof T]?: ChannelEncodeType<T[Key]>;\n};\n\n/**\n * the common channel supported by graphic marks\n */\nexport type GenerateBasicEncoderSpec<T> = Partial<\n Omit<\n T,\n | 'strokeSeg'\n | 'boundsPadding'\n | 'pickMode'\n | 'boundsMode'\n | 'customPickShape'\n | 'pickable'\n | 'childrenPickable'\n | 'visible'\n | 'zIndex'\n | 'layout'\n | 'keepDirIn3d'\n | 'postMatrix'\n | 'anchor'\n | 'anchor3d'\n >\n>;\n\nexport type BasicEncoderSpecMap = {\n rect: GenerateBasicEncoderSpec<IRectGraphicAttribute & { y1?: number; x1?: number }>;\n line: Omit<GenerateBasicEncoderSpec<ILineGraphicAttribute>, 'points' | 'segments'>;\n circle: GenerateBasicEncoderSpec<ICircleGraphicAttribute>;\n arc: GenerateBasicEncoderSpec<IArcGraphicAttribute>;\n polygon: GenerateBasicEncoderSpec<IPolygonGraphicAttribute>;\n arc3d: GenerateBasicEncoderSpec<IArc3dGraphicAttribute>;\n pyramid3d: GenerateBasicEncoderSpec<IPyramid3dGraphicAttribute>;\n area: Omit<GenerateBasicEncoderSpec<IAreaGraphicAttribute>, 'points' | 'segments'>;\n group: GenerateBasicEncoderSpec<IGroupGraphicAttribute>;\n glyph: GenerateBasicEncoderSpec<IGlyphGraphicAttribute & any>;\n image: GenerateBasicEncoderSpec<IImageGraphicAttribute>;\n rect3d: GenerateBasicEncoderSpec<IRect3dGraphicAttribute>;\n path: GenerateBasicEncoderSpec<IPathGraphicAttribute>;\n rule: Omit<GenerateBasicEncoderSpec<ILineGraphicAttribute>, 'points' | 'segments'> & { x1?: number; y1?: number };\n shape: GenerateBasicEncoderSpec<IPathGraphicAttribute>;\n symbol: GenerateBasicEncoderSpec<ISymbolGraphicAttribute> & {\n shape?: ISymbolGraphicAttribute['symbolType'];\n image?: ISymbolGraphicAttribute['background'];\n };\n text: GenerateBasicEncoderSpec<ITextGraphicAttribute> & {\n limit?: number;\n autoLimit?: number;\n };\n richtext: GenerateBasicEncoderSpec<IRichTextGraphicAttribute>;\n interval: Omit<GenerateBasicEncoderSpec<IRectGraphicAttribute>, 'width' | 'height'> & {\n /**\n * the gap for two graphic elements\n */\n innerGap?: number | string;\n /**\n * only used for rect / interval mark\n */\n maxWidth?: number;\n minWidth?: number;\n /** the gap between two category */\n categoryGap?: number | string;\n };\n cell: GenerateBasicEncoderSpec<ISymbolGraphicAttribute> & {\n padding?: number | [number, number];\n shape?: ISymbolAttribute['symbolType'];\n };\n};\nexport type GenerateBaseEncodeSpec<BasicSpec = GenerateBasicEncoderSpec<IGraphicAttribute>> =\n | GenerateEncoderSpec<BasicSpec>\n | MarkFunctionCallback<BasicSpec>;\n\nexport type StateProxyEncodeSpec<T = any> = (datum: any, element: IElement, state: string, nextStates: string[]) => T;\n\nexport type StateEncodeSpec<BasicSpec = GenerateBasicEncoderSpec<IGraphicAttribute>> =\n | {\n enter?: GenerateBaseEncodeSpec<BasicSpec>;\n update?: GenerateBaseEncodeSpec<BasicSpec>;\n exit?: GenerateBaseEncodeSpec<BasicSpec>;\n }\n | {\n [state: string]: GenerateEncoderSpec<BasicSpec> | StateProxyEncodeSpec<BasicSpec>;\n };\n\nexport type MarkAnimationSpec = Record<string, IAnimationConfig | IAnimationConfig[]> & {\n state?: IStateAnimationConfig;\n};\n\n// TODO: support string[]\nexport type MarkKeySpec = string | ((datum: any) => string);\n\nexport type MarkSortSpec = (datumA: any, datumB: any) => number;\n\nexport type MarkStateSortSpec = (stateA: string, stateB: string) => number;\n\nexport interface MarkGridContainerSpec extends MarkBaseLayoutSpec {\n display: 'grid';\n gridTemplateRows?: (number | string | 'auto')[];\n gridTemplateColumns?: (number | string | 'auto')[];\n gridRowGap?: number;\n gridColumnGap?: number;\n}\n\nexport interface MarkGridItemSpec extends MarkBaseLayoutSpec {\n gridRowStart?: number;\n gridRowEnd?: number;\n gridColumnStart?: number;\n gridColumnEnd?: number;\n}\n\nexport interface MarkBaseLayoutSpec {\n callback?: MarkLayoutCallback;\n skipBeforeLayouted?: boolean;\n updateViewSignals?: boolean;\n}\n\nexport interface MarkRelativeItemSpec extends MarkBaseLayoutSpec {\n position?: 'top' | 'bottom' | 'left' | 'right' | 'content' | 'auto' | string;\n padding?: CommonPaddingSpec;\n align?: 'left' | 'right' | 'center' | 'top' | 'bottom' | 'middle';\n order?: number;\n}\n\nexport interface MarkRelativeContainerSpec extends MarkBaseLayoutSpec {\n display: 'relative';\n maxChildWidth?: string | number;\n maxChildHeight?: string | number;\n}\n\nexport type MarkLayoutSpec =\n | MarkGridContainerSpec\n | MarkGridItemSpec\n | MarkRelativeContainerSpec\n | MarkRelativeItemSpec;\n\nexport type MarkLayoutCallback = (\n group: IGroupMark,\n children: IMark[],\n parentLayoutBounds: Bounds,\n options?: ILayoutOptions\n) => void;\n\nexport interface IMarkConfig {\n clip?: boolean;\n zIndex?: number;\n interactive?: boolean;\n context?: any;\n /**\n * set customized shape\n */\n setCustomizedShape?: (datum: any[], attrs: any, path: ICustomPath2D) => ICustomPath2D;\n /** 是否开启大数据渲染模式 */\n large?: boolean;\n /** 开启大数据渲染优化的阀值,对应的是data的长度 */\n largeThreshold?: number;\n /** 分片长度 */\n progressiveStep?: number;\n /** 开启分片渲染的阀值,对应的是单系列data的长度 */\n progressiveThreshold?: number;\n /**\n * use 'sequential' for symbol chart\n * use 'mod' for bar/line chart\n */\n // largeChunkMode?: 'sequential' | 'mod';\n support3d?: boolean;\n /**\n * enable global morphing animation of the mark\n */\n morph?: boolean;\n /**\n * this key will be used to match the mark to morph\n */\n morphKey?: string;\n /**\n * this key will be used to match the element of two marks to morph\n * If not specified, we'll use the \"key\" of the mark by default\n */\n morphElementKey?: string;\n /** transforms of attributes */\n attributeTransforms?: AttributeTransform[];\n}\n\n/**\n * Base mark specification type\n */\nexport interface GenerateMarkSpec<T extends MarkType = string, P = any> extends IMarkConfig, GrammarSpec {\n type: T;\n name?: string;\n group?: string | IGroupMark;\n // data attributes\n from?: MarkFromSpec;\n key?: MarkKeySpec;\n /**\n * sort all the elements in the mark\n */\n sort?: MarkSortSpec;\n /**\n * set the group key of the mark\n */\n groupBy?: MarkKeySpec;\n /**\n * sort the data of each group\n */\n groupSort?: MarkSortSpec;\n context?: any;\n // coordinate attributes\n coordinate?: string | ICoordinate;\n // encode attributes\n state?: MarkStateSpec;\n stateSort?: MarkStateSortSpec;\n encode?: GetEncoderSpecByType<T, P>;\n // animation attributes\n animationState?: MarkFunctionType<string>;\n animation?: MarkAnimationSpec;\n transform?: TransformSpec[];\n layout?: MarkLayoutSpec | MarkLayoutCallback;\n}\n\nexport type CircleMarkSpec = GenerateMarkSpec<'circle'>;\nexport type ArcMarkSpec = GenerateMarkSpec<'arc'>;\nexport type AreaMarkSpec = GenerateMarkSpec<'area'>;\nexport type LineMarkSpec = GenerateMarkSpec<'line'>;\nexport type RectMarkSpec = GenerateMarkSpec<'rect'>;\nexport type ImageMarkSpec = GenerateMarkSpec<'image'>;\nexport type PathMarkSpec = GenerateMarkSpec<'path'>;\nexport type RuleMarkSpec = GenerateMarkSpec<'rule'>;\nexport type ShapeMarkSpec = GenerateMarkSpec<'shape'>;\nexport type SymbolMarkSpec = GenerateMarkSpec<'symbol'>;\nexport type TextMarkSpec = GenerateMarkSpec<'text'>;\nexport type RichTextMarkSpec = GenerateMarkSpec<'richtext'>;\nexport type PolygonMarkSpec = GenerateMarkSpec<'polygon'>;\nexport type CellMarkSpec = GenerateMarkSpec<'cell'>;\nexport type IntervalMarkSpec = GenerateMarkSpec<'interval'>;\nexport type Arc3dMarkSpec = GenerateMarkSpec<'arc3d'>;\nexport type Pyramid3dMarkSpec = GenerateMarkSpec<'pyramid3d'>;\nexport type Rect3dMarkSpec = GenerateMarkSpec<'rect3d'>;\n\nexport type BasicGlyphEncoderSpec = BasicEncoderSpecMap['glyph'];\nexport type BasicGroupEncoderSpec = BasicEncoderSpecMap['group'];\nexport interface GroupMarkSpec extends GenerateMarkSpec<'group'> {\n marks?: MarkSpec[];\n}\n\nexport interface GlyphMarkSpec<CustomizedEncoderSpec = any> extends GenerateMarkSpec<'glyph', CustomizedEncoderSpec> {\n glyphType: string;\n glyphConfig?: any;\n}\n\nexport interface BoxPlotEncoderSpec extends BasicGlyphEncoderSpec {\n boxWidth?: number;\n boxHeight?: number;\n ruleWidth?: number;\n ruleHeight?: number;\n q1?: number;\n q3?: number;\n min?: number;\n max?: number;\n median?: number;\n angle?: number;\n anchor?: [number, number];\n}\n\nexport interface BarBoxPlotEncoderSpec extends BasicGlyphEncoderSpec {\n minMaxWidth?: number;\n q1q3Width?: number;\n minMaxHeight?: number;\n q1q3Height?: number;\n q1?: number;\n q3?: number;\n min?: number;\n max?: number;\n median?: number;\n angle?: number;\n lineWidth?: number;\n minMaxFillOpacity?: number;\n anchor?: [number, number];\n}\n\nexport interface LinkPathEncoderSpec extends BasicGlyphEncoderSpec {\n x0: number;\n y0: number;\n x1: number;\n y1: number;\n thickness: number;\n curvature?: number;\n /** round all the coordinates */\n round?: boolean;\n /** the ratio of normal style path */\n ratio?: number;\n align?: 'start' | 'end' | 'center';\n pathType?: 'line' | 'smooth' | 'polyline';\n endArrow?: boolean;\n startArrow?: boolean;\n backgroundStyle?: any;\n direction?: 'horizontal' | 'vertical' | 'LR' | 'RL' | 'TB' | 'BL' | 'radial';\n}\nexport interface TreePathEncoderSpec extends BasicGlyphEncoderSpec {\n x0: number;\n y0: number;\n x1: number;\n y1: number;\n curvature?: number;\n /** round all the coordinates */\n round?: boolean;\n /** the ratio of normal style path */\n align?: 'start' | 'end' | 'center';\n pathType?: 'line' | 'smooth' | 'polyline';\n startArrowStyle?: Partial<IGraphicAttribute>;\n endArrowStyle?: Partial<IGraphicAttribute>;\n endArrow?: boolean;\n startArrow?: boolean;\n arrowSize?: number;\n backgroundStyle?: any;\n direction?: 'horizontal' | 'vertical' | 'LR' | 'RL' | 'TB' | 'BL' | 'radial';\n}\n\nexport interface RipplePointEncoderSpec extends BasicGlyphEncoderSpec {\n ripple?: number;\n size?: number;\n}\n\nexport interface ViolinEncoderSpec extends BasicGlyphEncoderSpec {\n violinFill: string;\n violinStroke: string;\n medianFill?: string;\n density?: IPointLike[];\n boxWidth?: number;\n q1?: number;\n q3?: number;\n min?: number;\n max?: number;\n median?: number;\n angle?: number;\n anchor?: [number, number];\n}\n\nexport interface WaveEncoderSpec extends BasicGlyphEncoderSpec {\n wave?: number;\n}\nexport interface BoxPlotGlyphSpec extends GlyphMarkSpec<BoxPlotEncoderSpec> {\n glyphType: 'boxplot';\n}\nexport interface BarBoxPlotGlyphSpec extends GlyphMarkSpec<BarBoxPlotEncoderSpec> {\n glyphType: 'barBoxplot';\n}\nexport interface LinkPathGlyphSpec extends GlyphMarkSpec<LinkPathEncoderSpec> {\n glyphType: 'linkPath';\n}\nexport interface TreePathGlyphSpec extends GlyphMarkSpec<TreePathEncoderSpec> {\n glyphType: 'treePath';\n}\nexport interface RipplePointGlyphSpec extends GlyphMarkSpec<RipplePointEncoderSpec> {\n glyphType: 'ripplePoint';\n}\nexport interface ViolinGlyphSpec extends GlyphMarkSpec<ViolinEncoderSpec> {\n glyphType: 'violin';\n}\nexport interface WaveGlyphSpec extends GlyphMarkSpec<WaveEncoderSpec> {\n glyphType: 'wave';\n}\n\nexport interface ComponentSpec<\n BasicEncoderSpec extends GenerateBasicEncoderSpec<IGraphicAttribute> = GenerateBasicEncoderSpec<IGraphicAttribute>\n> extends GenerateMarkSpec<'component', BasicEncoderSpec> {\n componentType: string;\n componentConfig?: any;\n mode?: '2d' | '3d';\n}\n\nexport type BaseMarkSpec = GenerateMarkSpec<MarkType>;\nexport type MarkSpecMap = {\n circle: CircleMarkSpec;\n arc: ArcMarkSpec;\n area: AreaMarkSpec;\n image: ImageMarkSpec;\n line: LineMarkSpec;\n path: PathMarkSpec;\n rule: RuleMarkSpec;\n shape: ShapeMarkSpec;\n symbol: SymbolMarkSpec;\n text: TextMarkSpec;\n richtext: RichTextMarkSpec;\n polygon: PolygonMarkSpec;\n cell: CellMarkSpec;\n interval: IntervalMarkSpec;\n rect: RectMarkSpec;\n rect3d: Rect3dMarkSpec;\n arc3d: Arc3dMarkSpec;\n pyramid3d: Pyramid3dMarkSpec;\n group: GroupMarkSpec;\n glyph: GlyphMarkSpec;\n linkPath: LinkPathGlyphSpec;\n treePath: TreePathGlyphSpec;\n wave: WaveEncoderSpec;\n ripplePoint: RipplePointGlyphSpec;\n barBoxplot: BarBoxPlotGlyphSpec;\n boxPlot: BoxPlotGlyphSpec;\n component: ComponentSpec;\n axis: AxisSpec;\n legend: LegendSpec;\n slider: SliderSpec;\n datazoom: DatazoomSpec;\n label: LabelSpec;\n player: PlayerSpec;\n};\n\nexport type GetMarkSpecByType<T, P = any> = T extends keyof MarkSpecMap ? MarkSpecMap[T] : GenerateMarkSpec<string, P>;\nexport type GetBasicEncoderSpecByType<T, P = any> = T extends keyof BasicEncoderSpecMap\n ? BasicEncoderSpecMap[T]\n : GenerateBasicEncoderSpec<IGraphicAttribute & P>;\nexport type GetEncoderSpecByType<T, P = any> = T extends keyof BasicEncoderSpecMap\n ? StateEncodeSpec<BasicEncoderSpecMap[T]>\n : StateEncodeSpec<GenerateBasicEncoderSpec<IGraphicAttribute> & P>;\n\nexport type BaseEncodeSpec<P = any> = StateEncodeSpec<GenerateBasicEncoderSpec<IGraphicAttribute & P>>;\nexport type BaseSignleEncodeSpec<P = any> =\n | GenerateEncoderSpec<GenerateBasicEncoderSpec<IGraphicAttribute & P>>\n | StateProxyEncodeSpec<GenerateBasicEncoderSpec<IGraphicAttribute & P>>;\n\nexport type GetSignleEncodeSpecByType<T, P = any> = T extends keyof BasicEncoderSpecMap\n ? GenerateEncoderSpec<BasicEncoderSpecMap[T]> | StateProxyEncodeSpec<BasicEncoderSpecMap[T]>\n : BaseSignleEncodeSpec<P>;\n\nexport type MarkSpec =\n | GenerateMarkSpec<string, any>\n | CircleMarkSpec\n | ArcMarkSpec\n | AreaMarkSpec\n | ImageMarkSpec\n | LineMarkSpec\n | PathMarkSpec\n | RuleMarkSpec\n | ShapeMarkSpec\n | SymbolMarkSpec\n | TextMarkSpec\n | RichTextMarkSpec\n | PolygonMarkSpec\n | CellMarkSpec\n | IntervalMarkSpec\n | RectMarkSpec\n | Rect3dMarkSpec\n | Arc3dMarkSpec\n | Pyramid3dMarkSpec\n | GroupMarkSpec\n | GlyphMarkSpec\n | LinkPathGlyphSpec\n | TreePathGlyphSpec\n | WaveGlyphSpec\n | RipplePointGlyphSpec\n | BarBoxPlotGlyphSpec\n | BoxPlotGlyphSpec\n | ViolinGlyphSpec\n | ComponentSpec\n | BuiltInComponentSpec;\n\nexport interface AttributeTransform {\n channels: string[];\n transform: (graphicAttributes: any, nextAttrs: any, storedAttrs: any) => void;\n storedAttrs?: string;\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { EasingType } from '@visactor/vrender';
1
+ import type { EasingType } from '@visactor/vrender-core';
2
2
  import type { DiffResult, Nil } from './base';
3
3
  import type { IElement } from './element';
4
4
  import type { IGrammarBase, IMark } from './grammar';
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types/morph.ts"],"names":[],"mappings":"","file":"morph.js","sourcesContent":["import type { EasingType } from '@visactor/vrender';\nimport type { DiffResult, Nil } from './base';\nimport type { IElement } from './element';\nimport type { IGrammarBase, IMark } from './grammar';\nimport type { GenericFunctionType } from './signal';\nimport type { IRunningConfig } from './view';\n\nexport type MorphData = { prev: any[]; next: any[] };\nexport type MorphElements = { prev: IElement[]; next: IElement[] };\n\nexport type MorphFunctionCallback<T> = (datum: MorphData, element: MorphElements, parameters: any) => T;\n\nexport type MorphFunctionType<T> = GenericFunctionType<MorphFunctionCallback<T>, T>;\n\nexport type MorphFunctionValueType<T> = MorphFunctionType<T> | T;\n\nexport interface IMorphAnimationConfig {\n easing?: EasingType;\n delay?: MorphFunctionValueType<number>;\n duration?: MorphFunctionValueType<number>;\n oneByOne?: MorphFunctionValueType<boolean | number>;\n splitPath?: MorphFunctionValueType<'clone' | Nil>;\n}\n\nexport interface IMorph {\n diffGrammar: <U extends IGrammarBase>(prevGrammars: U[], nextGrammars: U[]) => DiffResult<U, U>;\n diffMark: (prevMarks: IMark[], nextMarks: IMark[], runningConfig: IRunningConfig) => DiffResult<IMark[], IMark[]>;\n\n morph: (prevMarks: IMark[], nextMarks: IMark[], runningConfig: IRunningConfig) => void;\n}\n"]}
1
+ {"version":3,"sources":["../src/types/morph.ts"],"names":[],"mappings":"","file":"morph.js","sourcesContent":["import type { EasingType } from '@visactor/vrender-core';\nimport type { DiffResult, Nil } from './base';\nimport type { IElement } from './element';\nimport type { IGrammarBase, IMark } from './grammar';\nimport type { GenericFunctionType } from './signal';\nimport type { IRunningConfig } from './view';\n\nexport type MorphData = { prev: any[]; next: any[] };\nexport type MorphElements = { prev: IElement[]; next: IElement[] };\n\nexport type MorphFunctionCallback<T> = (datum: MorphData, element: MorphElements, parameters: any) => T;\n\nexport type MorphFunctionType<T> = GenericFunctionType<MorphFunctionCallback<T>, T>;\n\nexport type MorphFunctionValueType<T> = MorphFunctionType<T> | T;\n\nexport interface IMorphAnimationConfig {\n easing?: EasingType;\n delay?: MorphFunctionValueType<number>;\n duration?: MorphFunctionValueType<number>;\n oneByOne?: MorphFunctionValueType<boolean | number>;\n splitPath?: MorphFunctionValueType<'clone' | Nil>;\n}\n\nexport interface IMorph {\n diffGrammar: <U extends IGrammarBase>(prevGrammars: U[], nextGrammars: U[]) => DiffResult<U, U>;\n diffMark: (prevMarks: IMark[], nextMarks: IMark[], runningConfig: IRunningConfig) => DiffResult<IMark[], IMark[]>;\n\n morph: (prevMarks: IMark[], nextMarks: IMark[], runningConfig: IRunningConfig) => void;\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import type { AxisBaseAttributes, BaseCrosshairAttrs, BaseLabelAttrs, ColorLegendAttributes, DataZoomAttributes, DiscreteLegendAttrs, GridBaseAttributes, PlayerAttributes, SizeLegendAttributes, SliderAttributes, TitleAttrs } from '@visactor/vrender-components';
3
3
  import type { CoordinateType } from '@visactor/vgrammar-coordinate';
4
- import type { IColor } from '@visactor/vrender';
4
+ import type { IColor } from '@visactor/vrender-core';
5
5
  import type { IEnvironmentOptions, IRendererOptions, IRunningConfig, ViewSpec, srIOption3DType, IView } from './view';
6
6
  import type { CommonPaddingSpec, ValueOf } from './base';
7
7
  import type { BasicEncoderSpecMap, LinkPathEncoderSpec, MarkRelativeItemSpec } from './mark';
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types/plot.ts"],"names":[],"mappings":"","file":"plot.js","sourcesContent":["import type {\n AxisBaseAttributes,\n BaseCrosshairAttrs,\n BaseLabelAttrs,\n ColorLegendAttributes,\n DataZoomAttributes,\n DiscreteLegendAttrs,\n GridBaseAttributes,\n PlayerAttributes,\n SizeLegendAttributes,\n SliderAttributes,\n TitleAttrs\n} from '@visactor/vrender-components';\nimport type { CoordinateType } from '@visactor/vgrammar-coordinate';\nimport type { IColor } from '@visactor/vrender';\nimport type { IEnvironmentOptions, IRendererOptions, IRunningConfig, ViewSpec, srIOption3DType, IView } from './view';\nimport type { CommonPaddingSpec, ValueOf } from './base';\nimport type { BasicEncoderSpecMap, LinkPathEncoderSpec, MarkRelativeItemSpec } from './mark';\nimport type { BaseEventHandler } from './event';\nimport type { TransformSpec } from './transform';\nimport type { IAnimationConfig } from './animate';\nimport type { ScaleSpec } from './scale';\nimport type { DataSpec } from './data';\nimport type { GridShape } from './component';\n\nexport interface IPlotOptions extends IEnvironmentOptions, IRendererOptions {\n width?: number;\n height?: number;\n padding?: CommonPaddingSpec;\n autoFit?: boolean;\n options3d?: srIOption3DType;\n theme?: string;\n logLevel?: number;\n}\n\nexport interface CartesianCoordinateOption {\n id?: string;\n type: 'cartesian';\n transpose?: boolean;\n}\n\nexport interface PolarCoordinateOption {\n id?: string;\n type: 'polar';\n origin?: [string | number, string | number];\n transpose?: boolean;\n}\n\nexport type PlotIntervalEncoderSpec = Omit<BasicEncoderSpecMap['interval'], 'y'> & {\n y?: number | number[];\n y1?: number;\n x1?: number;\n};\n\nexport type PlotRectEncoderSpec = Omit<BasicEncoderSpecMap['rect'], 'y' | 'x'> & {\n y?: number | number[];\n x?: number | number[];\n y1?: number;\n x1?: number;\n};\n\nexport type PlotRectXEncoderSpec = Omit<BasicEncoderSpecMap['rect'], 'x'> & {\n x?: number | number[];\n y1?: number;\n x1?: number;\n};\n\nexport type PlotRectYEncoderSpec = Omit<BasicEncoderSpecMap['rect'], 'y'> & {\n y?: number | number[];\n y1?: number;\n x1?: number;\n};\n\nexport type PlotAreaEncoderSpec = Omit<BasicEncoderSpecMap['area'], 'x' | 'y'> & {\n x?: number | number[];\n y?: number | number[];\n};\n\nexport type PlotRuleEncoderSpec = Omit<BasicEncoderSpecMap['rule'], 'x' | 'y'> & {\n x?: number | number[];\n y?: number | number[];\n};\n\nexport type PlotImageEncoderSpec = Omit<BasicEncoderSpecMap['image'], 'x' | 'y'> & {\n x?: number | number[];\n y?: number | number[];\n};\nexport type PlotPolygonEncoderSpec = Omit<BasicEncoderSpecMap['polygon'], 'x' | 'y'> & {\n x?: number[];\n y?: number[];\n};\n\nexport type PlotSankeyEncoderSpec = Partial<LinkPathEncoderSpec>;\nexport type PlotSunburstEncodeSpec = BasicEncoderSpecMap['arc'];\nexport type PlotTreeEncodeSpec = BasicEncoderSpecMap['symbol'];\nexport type PlotTreemapEncodeSpec = BasicEncoderSpecMap['rect'];\nexport type PlotCirclePackingEncodeSpec = BasicEncoderSpecMap['circle'];\nexport type PlotWordcloudEncodeSpec = BasicEncoderSpecMap['text'];\nexport type PlotWordcloudShapeEncodeSpec = BasicEncoderSpecMap['text'];\n\nexport type CoordinateOption = CartesianCoordinateOption | PolarCoordinateOption;\nexport type PlotIntervalSpec = Partial<ISemanticMarkSpec<PlotIntervalEncoderSpec, IntervalEncodeChannels>> & {\n type: 'interval';\n};\nexport type PlotLineSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['line'], LineEncodeChannels>> & {\n type: 'line';\n};\nexport type PlotCellSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['cell'], CellEncodeChannels>> & {\n type: 'cell';\n};\nexport type PlotRuleXSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['rule'], RuleXEncodeChannels>> & {\n type: 'ruleX';\n};\nexport type PlotRuleYSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['rule'], RuleYEncodeChannels>> & {\n type: 'ruleY';\n};\nexport type PlotAreaSpec = Partial<ISemanticMarkSpec<PlotAreaEncoderSpec, AreaEncodeChannels>> & {\n type: 'area';\n};\nexport type PlotSymbolSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['symbol'], SymbolEncodeChannels>> & {\n type: 'symbol';\n};\nexport type PlotTextSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['text'], TextEncodeChannels>> & {\n type: 'text';\n};\nexport type PlotRectSpec = Partial<ISemanticMarkSpec<PlotRectEncoderSpec, RectEncodeChannels>> & {\n type: 'rect';\n};\nexport type PlotRectXSpec = Partial<ISemanticMarkSpec<PlotRectXEncoderSpec, RectXEncodeChannels>> & {\n type: 'rectX';\n};\nexport type PlotRectYSpec = Partial<ISemanticMarkSpec<PlotRectYEncoderSpec, RectYEncodeChannels>> & {\n type: 'rectY';\n};\nexport type PlotPolygonSpec = Partial<ISemanticMarkSpec<PlotPolygonEncoderSpec, PolygonEncodeChannels>> & {\n type: 'polygon';\n};\nexport type PlotRuleSpec = Partial<ISemanticMarkSpec<PlotRuleEncoderSpec, RuleEncodeChannels>> & {\n type: 'rule';\n};\nexport type PlotImageSpec = Partial<ISemanticMarkSpec<PlotImageEncoderSpec, ImageEncodeChannels>> & {\n type: 'image';\n};\nexport type PlotPathSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['path'], PathEncodeChannels>> & {\n type: 'path';\n};\n\nexport interface PlotSpec {\n background?: IColor;\n width?: number;\n height?: number;\n padding?: number;\n coordinate?: CoordinateOption;\n marks?: Array<\n | PlotIntervalSpec\n | PlotLineSpec\n | PlotCellSpec\n | PlotRuleXSpec\n | PlotRuleYSpec\n | PlotAreaSpec\n | PlotSymbolSpec\n | PlotTextSpec\n | PlotRectSpec\n | PlotRectXSpec\n | PlotRectYSpec\n | PlotPolygonSpec\n | PlotRuleSpec\n | PlotImageSpec\n | PlotPathSpec\n >;\n}\n\nexport interface IPlot {\n readonly view: IView;\n\n theme: (theme: string) => this;\n /**\n * todo: 直接接text图元还是title组件\n */\n // title: (text: ITextAttribute['text'], style: Omit<ITextAttribute, 'text'>) => this;\n coordinate: (type: CoordinateType, option?: Omit<CoordinateOption, 'type'>) => this;\n // interaction: (type: string, options: boolean | any) => this;\n\n // facet: (type: string, options: any) => this;\n\n ///--------- life cycle ---------///\n\n run: (runningConfig?: IRunningConfig) => this;\n runAsync: (runningConfig?: IRunningConfig) => Promise<this>;\n release: () => this;\n parseSpec: (spec: PlotSpec) => this;\n updateSpec: (spec: PlotSpec) => this;\n getImageBuffer: () => Buffer;\n\n ///--------- events api ---------///\n on: (type: string, handler: BaseEventHandler) => this;\n off: (type: string, handler?: BaseEventHandler) => this;\n\n ///--------- marks ---------///\n\n interval: () => IInterval;\n cell: () => ICell;\n area: () => IArea;\n image: () => IImage;\n line: () => ILine;\n ruleX: () => IRuleX;\n ruleY: () => IRectY;\n symbol: () => ISymbol;\n polygon: () => IPolygon;\n text: () => IText;\n rect: () => IRect;\n rectX: () => IRectX;\n rectY: () => IRectY;\n rule: () => IRule;\n\n // wordcloud 包如果没注册,会存在问题\n wordcloud: () => IWordcloud;\n wordcloudShape: () => IWordcloudShape;\n circlePacking: () => ICirclePacking;\n treemap: () => ITreemap;\n tree: () => ITree;\n sunburst: () => ISunburst;\n sankey: () => ISankey;\n\n // P2\n // forceGraph: () => ISemanticMark;\n // geoPath: () => ISemanticMark;\n // vector: () => ISemanticMark;\n // shape: () => ISemanticMark;\n // gauge: () => ISemanticMark;\n // heatmap: () => ISemanticMark;\n // density: () => ISemanticMark;\n // boxplot: () => ISemanticMark;\n // box: () => ISemanticMark;\n // contour: () => ISemanticMark;\n\n // observable auto define type by data\n // auto: () => ISemanticMark;\n}\n\nexport interface IPlotConstructor {\n new (options?: IPlotOptions): IPlot;\n}\n\nexport type WithDefaultEncode<T, K extends string> = {\n [Key in K]?: Key extends keyof T ? ISemanticEncodeValue<T[Key]> : ISemanticEncodeValue<string | number>;\n};\nexport type ISemanticEncodeValue<T> = T extends any[]\n ? string[] | ((datum: any) => any)[]\n : string | ((datum: any) => T);\nexport type ISemanticEncodeSpec<T> = {\n [Key in keyof T]?: ISemanticEncodeValue<T[Key]>;\n};\nexport type ISemanticStyle<T, K extends string> = Omit<T, K>;\n\nexport interface SemanticTooltipContentItem {\n key?: ISemanticEncodeValue<string | number>;\n value?: ISemanticEncodeValue<string | number>;\n symbol?: ISemanticEncodeValue<string>;\n}\nexport type SemanticTooltipOption = {\n disableGraphicTooltip?: boolean;\n disableDimensionTooltip?: boolean;\n staticTitle?: string;\n staticContentKey?: string | string[];\n title?: ISemanticEncodeValue<string | number>;\n dimensionTooltipChannel?: 'x' | 'y';\n content?: SemanticTooltipContentItem[];\n};\n\nexport interface SemanticAxisOption extends Partial<AxisBaseAttributes> {\n tickCount?: number;\n}\n\nexport interface SemanticGridOption extends Partial<GridBaseAttributes> {\n type?: GridShape;\n tickCount?: number;\n inside?: boolean;\n baseValue?: number;\n sides?: number;\n}\nexport type SemanticDataZoomOption = Partial<DataZoomAttributes>;\nexport type SemanticSliderOption = Partial<SliderAttributes>;\nexport type SemanticLegendOption = Partial<ColorLegendAttributes | DiscreteLegendAttrs | SizeLegendAttributes>;\nexport type SemanticCrosshairOption = Partial<BaseCrosshairAttrs>;\nexport type SemanticLabelOption = Partial<BaseLabelAttrs>;\nexport type SemanticPlayerOption = Partial<PlayerAttributes>;\nexport type SemanticTitleOption = Partial<TitleAttrs>;\n\nexport interface ISemanticMark<EncodeSpec, K extends string> {\n readonly uid: number;\n readonly type: string;\n data: (values: any, transform?: TransformSpec[], id?: string) => this;\n style: (style: Partial<EncodeSpec & any>) => this;\n encode: (channel: K, option: ValueOf<WithDefaultEncode<EncodeSpec, K>, K>) => this;\n scale: (channel: K, option: Partial<ScaleSpec>) => this;\n transform: (option: TransformSpec[]) => this;\n animate: (state: string, option: IAnimationConfig | IAnimationConfig[]) => this;\n state: (state: string, option: Partial<EncodeSpec>) => this;\n\n axis: (channel: string, option?: SemanticAxisOption | boolean, layout?: MarkRelativeItemSpec) => this;\n legend: (channel: string, option?: SemanticLegendOption | boolean, layout?: MarkRelativeItemSpec) => this;\n crosshair: (channel: string, option?: SemanticCrosshairOption | boolean) => this;\n tooltip: (option: SemanticTooltipOption | boolean) => this;\n coordinate: (option: CoordinateOption) => this;\n grid: (channel: string, option?: SemanticGridOption | boolean) => this;\n title: (option: SemanticTitleOption, layout?: MarkRelativeItemSpec) => this;\n\n slider: (channel: string, option?: SemanticSliderOption | boolean, layout?: MarkRelativeItemSpec) => this;\n datazoom: (channel: string, option?: SemanticDataZoomOption | boolean, layout?: MarkRelativeItemSpec) => this;\n label: (channel: string, option?: SemanticLabelOption | boolean) => this;\n player: (data?: any[], option?: SemanticPlayerOption | boolean, layout?: MarkRelativeItemSpec) => this;\n\n toViewSpec: () => ViewSpec;\n parseSpec: (spec: Partial<ISemanticMarkSpec<EncodeSpec, K>>) => this;\n}\n\nexport interface ISemanticMarkSpec<EncodeSpec, K extends string> {\n id: string | number;\n data?: DataSpec;\n encode?: WithDefaultEncode<EncodeSpec, K>;\n scale?: Partial<Record<K, ScaleSpec>>;\n style?: Partial<EncodeSpec & any>;\n axis?: Partial<\n Record<K, { option?: SemanticAxisOption | boolean; layout?: MarkRelativeItemSpec } | SemanticAxisOption | boolean>\n >;\n grid?: Partial<Record<K, SemanticGridOption | boolean>>;\n transform?: TransformSpec[];\n state?: Record<string, Partial<EncodeSpec>>;\n animation?: Record<string, IAnimationConfig | IAnimationConfig[]>;\n legend?: Record<\n string,\n { option: SemanticLegendOption | boolean; layout?: MarkRelativeItemSpec } | SemanticLegendOption | boolean\n >;\n crosshair?: Record<string, SemanticCrosshairOption | boolean>;\n tooltip?: SemanticTooltipOption | boolean;\n slider?: Record<\n string,\n { option: SemanticSliderOption | boolean; layout?: MarkRelativeItemSpec } | SemanticSliderOption | boolean\n >;\n datazoom?: Record<\n string,\n { option: SemanticDataZoomOption | boolean; layout?: MarkRelativeItemSpec } | SemanticDataZoomOption | boolean\n >;\n label?: Record<string, SemanticLabelOption | boolean>;\n player?: { data?: any[]; option?: SemanticPlayerOption | boolean; layout?: MarkRelativeItemSpec };\n title?: { option?: SemanticTitleOption; layout?: MarkRelativeItemSpec } | SemanticTitleOption;\n}\n\nexport type ParsedSimpleEncode<T, K extends string> = {\n [Key in K]?: {\n field: Key extends keyof T ? ISemanticEncodeValue<T[Key]> : ISemanticEncodeValue<string>;\n scale: string;\n };\n};\n\nexport type SemanticEncodeChannels = 'x' | 'y' | 'group' | 'color';\nexport type IntervalEncodeChannels = 'x' | 'y' | 'group' | 'color' | 'stroke';\nexport type CellEncodeChannels = 'x' | 'y' | 'group' | 'color' | 'stroke';\nexport type LineEncodeChannels = 'x' | 'y' | 'group' | 'color';\nexport type AreaEncodeChannels = 'x' | 'y' | 'group' | 'color' | 'stroke';\nexport type RuleXEncodeChannels = 'x' | 'x' | 'color' | 'group';\nexport type RuleYEncodeChannels = 'x' | 'y' | 'color' | 'group';\nexport type SymbolEncodeChannels = 'x' | 'y' | 'color' | 'group' | 'size' | 'shape' | 'stroke';\nexport type TextEncodeChannels = 'x' | 'y' | 'color' | 'group' | 'text' | 'stroke';\nexport type RectEncodeChannels = 'x' | 'y' | 'color' | 'group' | 'stroke';\nexport type RectXEncodeChannels = 'x' | 'color' | 'group' | 'stroke';\nexport type RectYEncodeChannels = 'y' | 'color' | 'group' | 'stroke';\nexport type PolygonEncodeChannels = 'x' | 'y' | 'color' | 'group' | 'stroke';\nexport type RuleEncodeChannels = 'x' | 'y' | 'color' | 'group';\nexport type ImageEncodeChannels = 'x' | 'y' | 'color' | 'group' | 'src' | 'stroke';\nexport type PathEncodeChannels = 'color' | 'stroke';\nexport type SankeyEncodeChannels = 'node' | 'value' | 'color' | 'stroke';\nexport type SunburstEncodeChannels = 'node' | 'value' | 'color' | 'stroke';\nexport type TreeEncodeChannels = 'node' | 'value' | 'color' | 'stroke';\nexport type TreemapEncodeChannels = 'node' | 'value' | 'color' | 'stroke';\nexport type CirclepackingEncodeChannels = 'node' | 'value' | 'color' | 'stroke';\nexport type WordcloudEncodeChannels = 'text' | 'color' | 'stroke';\nexport type WordcloudShapeEncodeChannels = 'text' | 'color' | 'stroke';\n\nexport type IInterval = ISemanticMark<PlotIntervalEncoderSpec, IntervalEncodeChannels>;\nexport type ILine = ISemanticMark<BasicEncoderSpecMap['line'], LineEncodeChannels>;\nexport type ICell = ISemanticMark<BasicEncoderSpecMap['cell'], CellEncodeChannels>;\nexport type IRuleX = ISemanticMark<BasicEncoderSpecMap['rule'], RuleXEncodeChannels>;\nexport type IRuleY = ISemanticMark<BasicEncoderSpecMap['rule'], RuleYEncodeChannels>;\nexport type IArea = ISemanticMark<PlotAreaEncoderSpec, AreaEncodeChannels>;\nexport type ISymbol = ISemanticMark<BasicEncoderSpecMap['symbol'], SymbolEncodeChannels>;\nexport type IText = ISemanticMark<BasicEncoderSpecMap['text'], TextEncodeChannels>;\nexport type IRect = ISemanticMark<PlotRectEncoderSpec, RectEncodeChannels>;\nexport type IRectX = ISemanticMark<BasicEncoderSpecMap['rect'], RectXEncodeChannels>;\nexport type IRectY = ISemanticMark<BasicEncoderSpecMap['rect'], RectYEncodeChannels>;\nexport type IPolygon = ISemanticMark<PlotPolygonEncoderSpec, PolygonEncodeChannels>;\nexport type IRule = ISemanticMark<BasicEncoderSpecMap['rule'], RuleEncodeChannels>;\nexport type IImage = ISemanticMark<PlotImageEncoderSpec, ImageEncodeChannels>;\nexport type IPath = ISemanticMark<BasicEncoderSpecMap['path'], PathEncodeChannels>;\nexport type ISankey = ISemanticMark<PlotSankeyEncoderSpec, SankeyEncodeChannels>;\nexport type ISunburst = ISemanticMark<PlotSunburstEncodeSpec, SunburstEncodeChannels>;\nexport type IWordcloud = ISemanticMark<PlotWordcloudEncodeSpec, WordcloudEncodeChannels>;\nexport type IWordcloudShape = ISemanticMark<PlotWordcloudShapeEncodeSpec, WordcloudShapeEncodeChannels>;\nexport type ITree = ISemanticMark<PlotTreeEncodeSpec, TreeEncodeChannels>;\nexport type ITreemap = ISemanticMark<PlotTreemapEncodeSpec, TreemapEncodeChannels>;\nexport type ICirclePacking = ISemanticMark<PlotCirclePackingEncodeSpec, CirclepackingEncodeChannels>;\n\nexport type PlotMark =\n | IInterval\n | IRuleX\n | IRuleY\n | ICell\n | ILine\n | IArea\n | ISymbol\n | IText\n | IRect\n | IRectX\n | IRectY\n | IPolygon\n | IRule\n | IImage\n | IPath\n | ISankey\n | ISunburst\n | ICirclePacking\n | ITreemap\n | ITree\n | IWordcloud\n | IWordcloudShape;\n\nexport interface IPlotMarkConstructor {\n readonly type: string;\n\n new (id?: string): PlotMark;\n}\n"]}
1
+ {"version":3,"sources":["../src/types/plot.ts"],"names":[],"mappings":"","file":"plot.js","sourcesContent":["import type {\n AxisBaseAttributes,\n BaseCrosshairAttrs,\n BaseLabelAttrs,\n ColorLegendAttributes,\n DataZoomAttributes,\n DiscreteLegendAttrs,\n GridBaseAttributes,\n PlayerAttributes,\n SizeLegendAttributes,\n SliderAttributes,\n TitleAttrs\n} from '@visactor/vrender-components';\nimport type { CoordinateType } from '@visactor/vgrammar-coordinate';\nimport type { IColor } from '@visactor/vrender-core';\nimport type { IEnvironmentOptions, IRendererOptions, IRunningConfig, ViewSpec, srIOption3DType, IView } from './view';\nimport type { CommonPaddingSpec, ValueOf } from './base';\nimport type { BasicEncoderSpecMap, LinkPathEncoderSpec, MarkRelativeItemSpec } from './mark';\nimport type { BaseEventHandler } from './event';\nimport type { TransformSpec } from './transform';\nimport type { IAnimationConfig } from './animate';\nimport type { ScaleSpec } from './scale';\nimport type { DataSpec } from './data';\nimport type { GridShape } from './component';\n\nexport interface IPlotOptions extends IEnvironmentOptions, IRendererOptions {\n width?: number;\n height?: number;\n padding?: CommonPaddingSpec;\n autoFit?: boolean;\n options3d?: srIOption3DType;\n theme?: string;\n logLevel?: number;\n}\n\nexport interface CartesianCoordinateOption {\n id?: string;\n type: 'cartesian';\n transpose?: boolean;\n}\n\nexport interface PolarCoordinateOption {\n id?: string;\n type: 'polar';\n origin?: [string | number, string | number];\n transpose?: boolean;\n}\n\nexport type PlotIntervalEncoderSpec = Omit<BasicEncoderSpecMap['interval'], 'y'> & {\n y?: number | number[];\n y1?: number;\n x1?: number;\n};\n\nexport type PlotRectEncoderSpec = Omit<BasicEncoderSpecMap['rect'], 'y' | 'x'> & {\n y?: number | number[];\n x?: number | number[];\n y1?: number;\n x1?: number;\n};\n\nexport type PlotRectXEncoderSpec = Omit<BasicEncoderSpecMap['rect'], 'x'> & {\n x?: number | number[];\n y1?: number;\n x1?: number;\n};\n\nexport type PlotRectYEncoderSpec = Omit<BasicEncoderSpecMap['rect'], 'y'> & {\n y?: number | number[];\n y1?: number;\n x1?: number;\n};\n\nexport type PlotAreaEncoderSpec = Omit<BasicEncoderSpecMap['area'], 'x' | 'y'> & {\n x?: number | number[];\n y?: number | number[];\n};\n\nexport type PlotRuleEncoderSpec = Omit<BasicEncoderSpecMap['rule'], 'x' | 'y'> & {\n x?: number | number[];\n y?: number | number[];\n};\n\nexport type PlotImageEncoderSpec = Omit<BasicEncoderSpecMap['image'], 'x' | 'y'> & {\n x?: number | number[];\n y?: number | number[];\n};\nexport type PlotPolygonEncoderSpec = Omit<BasicEncoderSpecMap['polygon'], 'x' | 'y'> & {\n x?: number[];\n y?: number[];\n};\n\nexport type PlotSankeyEncoderSpec = Partial<LinkPathEncoderSpec>;\nexport type PlotSunburstEncodeSpec = BasicEncoderSpecMap['arc'];\nexport type PlotTreeEncodeSpec = BasicEncoderSpecMap['symbol'];\nexport type PlotTreemapEncodeSpec = BasicEncoderSpecMap['rect'];\nexport type PlotCirclePackingEncodeSpec = BasicEncoderSpecMap['circle'];\nexport type PlotWordcloudEncodeSpec = BasicEncoderSpecMap['text'];\nexport type PlotWordcloudShapeEncodeSpec = BasicEncoderSpecMap['text'];\n\nexport type CoordinateOption = CartesianCoordinateOption | PolarCoordinateOption;\nexport type PlotIntervalSpec = Partial<ISemanticMarkSpec<PlotIntervalEncoderSpec, IntervalEncodeChannels>> & {\n type: 'interval';\n};\nexport type PlotLineSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['line'], LineEncodeChannels>> & {\n type: 'line';\n};\nexport type PlotCellSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['cell'], CellEncodeChannels>> & {\n type: 'cell';\n};\nexport type PlotRuleXSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['rule'], RuleXEncodeChannels>> & {\n type: 'ruleX';\n};\nexport type PlotRuleYSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['rule'], RuleYEncodeChannels>> & {\n type: 'ruleY';\n};\nexport type PlotAreaSpec = Partial<ISemanticMarkSpec<PlotAreaEncoderSpec, AreaEncodeChannels>> & {\n type: 'area';\n};\nexport type PlotSymbolSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['symbol'], SymbolEncodeChannels>> & {\n type: 'symbol';\n};\nexport type PlotTextSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['text'], TextEncodeChannels>> & {\n type: 'text';\n};\nexport type PlotRectSpec = Partial<ISemanticMarkSpec<PlotRectEncoderSpec, RectEncodeChannels>> & {\n type: 'rect';\n};\nexport type PlotRectXSpec = Partial<ISemanticMarkSpec<PlotRectXEncoderSpec, RectXEncodeChannels>> & {\n type: 'rectX';\n};\nexport type PlotRectYSpec = Partial<ISemanticMarkSpec<PlotRectYEncoderSpec, RectYEncodeChannels>> & {\n type: 'rectY';\n};\nexport type PlotPolygonSpec = Partial<ISemanticMarkSpec<PlotPolygonEncoderSpec, PolygonEncodeChannels>> & {\n type: 'polygon';\n};\nexport type PlotRuleSpec = Partial<ISemanticMarkSpec<PlotRuleEncoderSpec, RuleEncodeChannels>> & {\n type: 'rule';\n};\nexport type PlotImageSpec = Partial<ISemanticMarkSpec<PlotImageEncoderSpec, ImageEncodeChannels>> & {\n type: 'image';\n};\nexport type PlotPathSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['path'], PathEncodeChannels>> & {\n type: 'path';\n};\n\nexport interface PlotSpec {\n background?: IColor;\n width?: number;\n height?: number;\n padding?: number;\n coordinate?: CoordinateOption;\n marks?: Array<\n | PlotIntervalSpec\n | PlotLineSpec\n | PlotCellSpec\n | PlotRuleXSpec\n | PlotRuleYSpec\n | PlotAreaSpec\n | PlotSymbolSpec\n | PlotTextSpec\n | PlotRectSpec\n | PlotRectXSpec\n | PlotRectYSpec\n | PlotPolygonSpec\n | PlotRuleSpec\n | PlotImageSpec\n | PlotPathSpec\n >;\n}\n\nexport interface IPlot {\n readonly view: IView;\n\n theme: (theme: string) => this;\n /**\n * todo: 直接接text图元还是title组件\n */\n // title: (text: ITextAttribute['text'], style: Omit<ITextAttribute, 'text'>) => this;\n coordinate: (type: CoordinateType, option?: Omit<CoordinateOption, 'type'>) => this;\n // interaction: (type: string, options: boolean | any) => this;\n\n // facet: (type: string, options: any) => this;\n\n ///--------- life cycle ---------///\n\n run: (runningConfig?: IRunningConfig) => this;\n runAsync: (runningConfig?: IRunningConfig) => Promise<this>;\n release: () => this;\n parseSpec: (spec: PlotSpec) => this;\n updateSpec: (spec: PlotSpec) => this;\n getImageBuffer: () => Buffer;\n\n ///--------- events api ---------///\n on: (type: string, handler: BaseEventHandler) => this;\n off: (type: string, handler?: BaseEventHandler) => this;\n\n ///--------- marks ---------///\n\n interval: () => IInterval;\n cell: () => ICell;\n area: () => IArea;\n image: () => IImage;\n line: () => ILine;\n ruleX: () => IRuleX;\n ruleY: () => IRectY;\n symbol: () => ISymbol;\n polygon: () => IPolygon;\n text: () => IText;\n rect: () => IRect;\n rectX: () => IRectX;\n rectY: () => IRectY;\n rule: () => IRule;\n\n // wordcloud 包如果没注册,会存在问题\n wordcloud: () => IWordcloud;\n wordcloudShape: () => IWordcloudShape;\n circlePacking: () => ICirclePacking;\n treemap: () => ITreemap;\n tree: () => ITree;\n sunburst: () => ISunburst;\n sankey: () => ISankey;\n\n // P2\n // forceGraph: () => ISemanticMark;\n // geoPath: () => ISemanticMark;\n // vector: () => ISemanticMark;\n // shape: () => ISemanticMark;\n // gauge: () => ISemanticMark;\n // heatmap: () => ISemanticMark;\n // density: () => ISemanticMark;\n // boxplot: () => ISemanticMark;\n // box: () => ISemanticMark;\n // contour: () => ISemanticMark;\n\n // observable auto define type by data\n // auto: () => ISemanticMark;\n}\n\nexport interface IPlotConstructor {\n new (options?: IPlotOptions): IPlot;\n}\n\nexport type WithDefaultEncode<T, K extends string> = {\n [Key in K]?: Key extends keyof T ? ISemanticEncodeValue<T[Key]> : ISemanticEncodeValue<string | number>;\n};\nexport type ISemanticEncodeValue<T> = T extends any[]\n ? string[] | ((datum: any) => any)[]\n : string | ((datum: any) => T);\nexport type ISemanticEncodeSpec<T> = {\n [Key in keyof T]?: ISemanticEncodeValue<T[Key]>;\n};\nexport type ISemanticStyle<T, K extends string> = Omit<T, K>;\n\nexport interface SemanticTooltipContentItem {\n key?: ISemanticEncodeValue<string | number>;\n value?: ISemanticEncodeValue<string | number>;\n symbol?: ISemanticEncodeValue<string>;\n}\nexport type SemanticTooltipOption = {\n disableGraphicTooltip?: boolean;\n disableDimensionTooltip?: boolean;\n staticTitle?: string;\n staticContentKey?: string | string[];\n title?: ISemanticEncodeValue<string | number>;\n dimensionTooltipChannel?: 'x' | 'y';\n content?: SemanticTooltipContentItem[];\n};\n\nexport interface SemanticAxisOption extends Partial<AxisBaseAttributes> {\n tickCount?: number;\n}\n\nexport interface SemanticGridOption extends Partial<GridBaseAttributes> {\n type?: GridShape;\n tickCount?: number;\n inside?: boolean;\n baseValue?: number;\n sides?: number;\n}\nexport type SemanticDataZoomOption = Partial<DataZoomAttributes>;\nexport type SemanticSliderOption = Partial<SliderAttributes>;\nexport type SemanticLegendOption = Partial<ColorLegendAttributes | DiscreteLegendAttrs | SizeLegendAttributes>;\nexport type SemanticCrosshairOption = Partial<BaseCrosshairAttrs>;\nexport type SemanticLabelOption = Partial<BaseLabelAttrs>;\nexport type SemanticPlayerOption = Partial<PlayerAttributes>;\nexport type SemanticTitleOption = Partial<TitleAttrs>;\n\nexport interface ISemanticMark<EncodeSpec, K extends string> {\n readonly uid: number;\n readonly type: string;\n data: (values: any, transform?: TransformSpec[], id?: string) => this;\n style: (style: Partial<EncodeSpec & any>) => this;\n encode: (channel: K, option: ValueOf<WithDefaultEncode<EncodeSpec, K>, K>) => this;\n scale: (channel: K, option: Partial<ScaleSpec>) => this;\n transform: (option: TransformSpec[]) => this;\n animate: (state: string, option: IAnimationConfig | IAnimationConfig[]) => this;\n state: (state: string, option: Partial<EncodeSpec>) => this;\n\n axis: (channel: string, option?: SemanticAxisOption | boolean, layout?: MarkRelativeItemSpec) => this;\n legend: (channel: string, option?: SemanticLegendOption | boolean, layout?: MarkRelativeItemSpec) => this;\n crosshair: (channel: string, option?: SemanticCrosshairOption | boolean) => this;\n tooltip: (option: SemanticTooltipOption | boolean) => this;\n coordinate: (option: CoordinateOption) => this;\n grid: (channel: string, option?: SemanticGridOption | boolean) => this;\n title: (option: SemanticTitleOption, layout?: MarkRelativeItemSpec) => this;\n\n slider: (channel: string, option?: SemanticSliderOption | boolean, layout?: MarkRelativeItemSpec) => this;\n datazoom: (channel: string, option?: SemanticDataZoomOption | boolean, layout?: MarkRelativeItemSpec) => this;\n label: (channel: string, option?: SemanticLabelOption | boolean) => this;\n player: (data?: any[], option?: SemanticPlayerOption | boolean, layout?: MarkRelativeItemSpec) => this;\n\n toViewSpec: () => ViewSpec;\n parseSpec: (spec: Partial<ISemanticMarkSpec<EncodeSpec, K>>) => this;\n}\n\nexport interface ISemanticMarkSpec<EncodeSpec, K extends string> {\n id: string | number;\n data?: DataSpec;\n encode?: WithDefaultEncode<EncodeSpec, K>;\n scale?: Partial<Record<K, ScaleSpec>>;\n style?: Partial<EncodeSpec & any>;\n axis?: Partial<\n Record<K, { option?: SemanticAxisOption | boolean; layout?: MarkRelativeItemSpec } | SemanticAxisOption | boolean>\n >;\n grid?: Partial<Record<K, SemanticGridOption | boolean>>;\n transform?: TransformSpec[];\n state?: Record<string, Partial<EncodeSpec>>;\n animation?: Record<string, IAnimationConfig | IAnimationConfig[]>;\n legend?: Record<\n string,\n { option: SemanticLegendOption | boolean; layout?: MarkRelativeItemSpec } | SemanticLegendOption | boolean\n >;\n crosshair?: Record<string, SemanticCrosshairOption | boolean>;\n tooltip?: SemanticTooltipOption | boolean;\n slider?: Record<\n string,\n { option: SemanticSliderOption | boolean; layout?: MarkRelativeItemSpec } | SemanticSliderOption | boolean\n >;\n datazoom?: Record<\n string,\n { option: SemanticDataZoomOption | boolean; layout?: MarkRelativeItemSpec } | SemanticDataZoomOption | boolean\n >;\n label?: Record<string, SemanticLabelOption | boolean>;\n player?: { data?: any[]; option?: SemanticPlayerOption | boolean; layout?: MarkRelativeItemSpec };\n title?: { option?: SemanticTitleOption; layout?: MarkRelativeItemSpec } | SemanticTitleOption;\n}\n\nexport type ParsedSimpleEncode<T, K extends string> = {\n [Key in K]?: {\n field: Key extends keyof T ? ISemanticEncodeValue<T[Key]> : ISemanticEncodeValue<string>;\n scale: string;\n };\n};\n\nexport type SemanticEncodeChannels = 'x' | 'y' | 'group' | 'color';\nexport type IntervalEncodeChannels = 'x' | 'y' | 'group' | 'color' | 'stroke';\nexport type CellEncodeChannels = 'x' | 'y' | 'group' | 'color' | 'stroke';\nexport type LineEncodeChannels = 'x' | 'y' | 'group' | 'color';\nexport type AreaEncodeChannels = 'x' | 'y' | 'group' | 'color' | 'stroke';\nexport type RuleXEncodeChannels = 'x' | 'x' | 'color' | 'group';\nexport type RuleYEncodeChannels = 'x' | 'y' | 'color' | 'group';\nexport type SymbolEncodeChannels = 'x' | 'y' | 'color' | 'group' | 'size' | 'shape' | 'stroke';\nexport type TextEncodeChannels = 'x' | 'y' | 'color' | 'group' | 'text' | 'stroke';\nexport type RectEncodeChannels = 'x' | 'y' | 'color' | 'group' | 'stroke';\nexport type RectXEncodeChannels = 'x' | 'color' | 'group' | 'stroke';\nexport type RectYEncodeChannels = 'y' | 'color' | 'group' | 'stroke';\nexport type PolygonEncodeChannels = 'x' | 'y' | 'color' | 'group' | 'stroke';\nexport type RuleEncodeChannels = 'x' | 'y' | 'color' | 'group';\nexport type ImageEncodeChannels = 'x' | 'y' | 'color' | 'group' | 'src' | 'stroke';\nexport type PathEncodeChannels = 'color' | 'stroke';\nexport type SankeyEncodeChannels = 'node' | 'value' | 'color' | 'stroke';\nexport type SunburstEncodeChannels = 'node' | 'value' | 'color' | 'stroke';\nexport type TreeEncodeChannels = 'node' | 'value' | 'color' | 'stroke';\nexport type TreemapEncodeChannels = 'node' | 'value' | 'color' | 'stroke';\nexport type CirclepackingEncodeChannels = 'node' | 'value' | 'color' | 'stroke';\nexport type WordcloudEncodeChannels = 'text' | 'color' | 'stroke';\nexport type WordcloudShapeEncodeChannels = 'text' | 'color' | 'stroke';\n\nexport type IInterval = ISemanticMark<PlotIntervalEncoderSpec, IntervalEncodeChannels>;\nexport type ILine = ISemanticMark<BasicEncoderSpecMap['line'], LineEncodeChannels>;\nexport type ICell = ISemanticMark<BasicEncoderSpecMap['cell'], CellEncodeChannels>;\nexport type IRuleX = ISemanticMark<BasicEncoderSpecMap['rule'], RuleXEncodeChannels>;\nexport type IRuleY = ISemanticMark<BasicEncoderSpecMap['rule'], RuleYEncodeChannels>;\nexport type IArea = ISemanticMark<PlotAreaEncoderSpec, AreaEncodeChannels>;\nexport type ISymbol = ISemanticMark<BasicEncoderSpecMap['symbol'], SymbolEncodeChannels>;\nexport type IText = ISemanticMark<BasicEncoderSpecMap['text'], TextEncodeChannels>;\nexport type IRect = ISemanticMark<PlotRectEncoderSpec, RectEncodeChannels>;\nexport type IRectX = ISemanticMark<BasicEncoderSpecMap['rect'], RectXEncodeChannels>;\nexport type IRectY = ISemanticMark<BasicEncoderSpecMap['rect'], RectYEncodeChannels>;\nexport type IPolygon = ISemanticMark<PlotPolygonEncoderSpec, PolygonEncodeChannels>;\nexport type IRule = ISemanticMark<BasicEncoderSpecMap['rule'], RuleEncodeChannels>;\nexport type IImage = ISemanticMark<PlotImageEncoderSpec, ImageEncodeChannels>;\nexport type IPath = ISemanticMark<BasicEncoderSpecMap['path'], PathEncodeChannels>;\nexport type ISankey = ISemanticMark<PlotSankeyEncoderSpec, SankeyEncodeChannels>;\nexport type ISunburst = ISemanticMark<PlotSunburstEncodeSpec, SunburstEncodeChannels>;\nexport type IWordcloud = ISemanticMark<PlotWordcloudEncodeSpec, WordcloudEncodeChannels>;\nexport type IWordcloudShape = ISemanticMark<PlotWordcloudShapeEncodeSpec, WordcloudShapeEncodeChannels>;\nexport type ITree = ISemanticMark<PlotTreeEncodeSpec, TreeEncodeChannels>;\nexport type ITreemap = ISemanticMark<PlotTreemapEncodeSpec, TreemapEncodeChannels>;\nexport type ICirclePacking = ISemanticMark<PlotCirclePackingEncodeSpec, CirclepackingEncodeChannels>;\n\nexport type PlotMark =\n | IInterval\n | IRuleX\n | IRuleY\n | ICell\n | ILine\n | IArea\n | ISymbol\n | IText\n | IRect\n | IRectX\n | IRectY\n | IPolygon\n | IRule\n | IImage\n | IPath\n | ISankey\n | ISunburst\n | ICirclePacking\n | ITreemap\n | ITree\n | IWordcloud\n | IWordcloudShape;\n\nexport interface IPlotMarkConstructor {\n readonly type: string;\n\n new (id?: string): PlotMark;\n}\n"]}