@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
@@ -1,5 +1,5 @@
1
1
  import type { IBoundsLike } from '@visactor/vutils';
2
- import type { IColor, Stage } from '@visactor/vrender';
2
+ import type { IColor, Stage } from '@visactor/vrender-core';
3
3
  import type { IViewEventConfig, IViewOptions } from './view';
4
4
  export interface IRenderer {
5
5
  initialize: (width: number, height: number, options: IViewOptions, eventConfig: IViewEventConfig) => this;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types/renderer.ts"],"names":[],"mappings":"","file":"renderer.js","sourcesContent":["import type { IBoundsLike } from '@visactor/vutils';\nimport type { IColor, Stage } from '@visactor/vrender';\nimport type { IViewEventConfig, IViewOptions } from './view';\n\nexport interface IRenderer {\n initialize: (width: number, height: number, options: IViewOptions, eventConfig: IViewEventConfig) => this;\n\n render: (immediately?: boolean) => this;\n renderNextFrame: () => this;\n resize: (width: number, height: number) => this;\n shouldResize: (width: number, height: number) => boolean;\n combineIncrementalLayers: () => this;\n\n setDpr: (resolution: number, redraw: boolean) => this;\n background: (color: IColor) => this;\n setViewBox: (viewBox: IBoundsLike, rerender: boolean) => this;\n\n stage: () => Stage;\n canvas: () => HTMLCanvasElement;\n context: () => CanvasRenderingContext2D;\n\n toCanvas: () => HTMLCanvasElement;\n // toImageData: () => Promise<ImageData | undefined>;\n\n release: () => void;\n}\n"]}
1
+ {"version":3,"sources":["../src/types/renderer.ts"],"names":[],"mappings":"","file":"renderer.js","sourcesContent":["import type { IBoundsLike } from '@visactor/vutils';\nimport type { IColor, Stage } from '@visactor/vrender-core';\nimport type { IViewEventConfig, IViewOptions } from './view';\n\nexport interface IRenderer {\n initialize: (width: number, height: number, options: IViewOptions, eventConfig: IViewEventConfig) => this;\n\n render: (immediately?: boolean) => this;\n renderNextFrame: () => this;\n resize: (width: number, height: number) => this;\n shouldResize: (width: number, height: number) => boolean;\n combineIncrementalLayers: () => this;\n\n setDpr: (resolution: number, redraw: boolean) => this;\n background: (color: IColor) => this;\n setViewBox: (viewBox: IBoundsLike, rerender: boolean) => this;\n\n stage: () => Stage;\n canvas: () => HTMLCanvasElement;\n context: () => CanvasRenderingContext2D;\n\n toCanvas: () => HTMLCanvasElement;\n // toImageData: () => Promise<ImageData | undefined>;\n\n release: () => void;\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { IColor } from '@visactor/vrender';
1
+ import type { IColor } from '@visactor/vrender-core';
2
2
  import type { ArcLabelAttrs, BaseLabelAttrs, CircleAxisAttributes, CircleAxisGridAttributes, CircleCrosshairAttrs, ColorLegendAttributes, ContinuousPlayerAttributes, DataLabelAttrs, DataZoomAttributes, DiscreteLegendAttrs, DiscretePlayerAttributes, LineAxisAttributes, LineAxisGridAttributes, LineCrosshairAttrs, LineLabelAttrs, PolygonCrosshairAttrs, RectCrosshairAttrs, RectLabelAttrs, ScrollBarAttributes, SectorCrosshairAttrs, SizeLegendAttributes, SliderAttributes, SymbolLabelAttrs, TitleAttrs, TooltipAttributes } from '@visactor/vrender-components';
3
3
  import type { IPadding } from '@visactor/vutils';
4
4
  import type { RecursivePartial } from './base';
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types/theme.ts"],"names":[],"mappings":"","file":"theme.js","sourcesContent":["import type { IColor } from '@visactor/vrender';\nimport type {\n ArcLabelAttrs,\n BaseLabelAttrs,\n CircleAxisAttributes,\n CircleAxisGridAttributes,\n CircleCrosshairAttrs,\n ColorLegendAttributes,\n ContinuousPlayerAttributes,\n DataLabelAttrs,\n DataZoomAttributes,\n DiscreteLegendAttrs,\n DiscretePlayerAttributes,\n LineAxisAttributes,\n LineAxisGridAttributes,\n LineCrosshairAttrs,\n LineLabelAttrs,\n PolygonCrosshairAttrs,\n RectCrosshairAttrs,\n RectLabelAttrs,\n ScrollBarAttributes,\n SectorCrosshairAttrs,\n SizeLegendAttributes,\n SliderAttributes,\n SymbolLabelAttrs,\n TitleAttrs,\n TooltipAttributes\n} from '@visactor/vrender-components';\nimport type { IPadding } from '@visactor/vutils';\nimport type { RecursivePartial } from './base';\nimport type { BasicEncoderSpecMap } from './mark';\n\n// glyph mark includes multiple types, not support theme for glyph for now\nexport type IMarkTheme = Partial<Omit<BasicEncoderSpecMap, 'glyph'>>;\n\nexport interface IComponentTheme {\n axis?: RecursivePartial<LineAxisAttributes>;\n circleAxis?: RecursivePartial<CircleAxisAttributes>;\n\n grid?: RecursivePartial<LineAxisGridAttributes>;\n circleGrid?: RecursivePartial<CircleAxisGridAttributes>;\n\n discreteLegend?: RecursivePartial<DiscreteLegendAttrs>;\n colorLegend?: RecursivePartial<ColorLegendAttributes>;\n sizeLegend?: RecursivePartial<SizeLegendAttributes>;\n\n lineCrosshair?: RecursivePartial<LineCrosshairAttrs>;\n rectCrosshair?: RecursivePartial<RectCrosshairAttrs>;\n sectorCrosshair?: RecursivePartial<SectorCrosshairAttrs>;\n circleCrosshair?: RecursivePartial<CircleCrosshairAttrs>;\n polygonCrosshair?: RecursivePartial<PolygonCrosshairAttrs>;\n\n slider?: RecursivePartial<SliderAttributes>;\n\n dataLabel?: RecursivePartial<DataLabelAttrs>;\n lineLabel?: RecursivePartial<LineLabelAttrs>;\n rectLabel?: RecursivePartial<RectLabelAttrs>;\n arcLabel?: RecursivePartial<ArcLabelAttrs>;\n symbolLabel?: RecursivePartial<SymbolLabelAttrs>;\n pointLabel?: RecursivePartial<BaseLabelAttrs>;\n\n datazoom?: RecursivePartial<DataZoomAttributes>;\n\n continuousPlayer?: RecursivePartial<ContinuousPlayerAttributes>;\n discretePlayer?: RecursivePartial<DiscretePlayerAttributes>;\n\n tooltip?: RecursivePartial<TooltipAttributes>;\n\n title?: RecursivePartial<TitleAttrs>;\n\n scrollbar?: RecursivePartial<ScrollBarAttributes>;\n}\n\nexport interface ITheme {\n name?: string;\n background?: IColor;\n padding?: IPadding | number;\n palette?: Record<string, IColor[]>;\n marks?: IMarkTheme;\n components?: IComponentTheme;\n}\n"]}
1
+ {"version":3,"sources":["../src/types/theme.ts"],"names":[],"mappings":"","file":"theme.js","sourcesContent":["import type { IColor } from '@visactor/vrender-core';\nimport type {\n ArcLabelAttrs,\n BaseLabelAttrs,\n CircleAxisAttributes,\n CircleAxisGridAttributes,\n CircleCrosshairAttrs,\n ColorLegendAttributes,\n ContinuousPlayerAttributes,\n DataLabelAttrs,\n DataZoomAttributes,\n DiscreteLegendAttrs,\n DiscretePlayerAttributes,\n LineAxisAttributes,\n LineAxisGridAttributes,\n LineCrosshairAttrs,\n LineLabelAttrs,\n PolygonCrosshairAttrs,\n RectCrosshairAttrs,\n RectLabelAttrs,\n ScrollBarAttributes,\n SectorCrosshairAttrs,\n SizeLegendAttributes,\n SliderAttributes,\n SymbolLabelAttrs,\n TitleAttrs,\n TooltipAttributes\n} from '@visactor/vrender-components';\nimport type { IPadding } from '@visactor/vutils';\nimport type { RecursivePartial } from './base';\nimport type { BasicEncoderSpecMap } from './mark';\n\n// glyph mark includes multiple types, not support theme for glyph for now\nexport type IMarkTheme = Partial<Omit<BasicEncoderSpecMap, 'glyph'>>;\n\nexport interface IComponentTheme {\n axis?: RecursivePartial<LineAxisAttributes>;\n circleAxis?: RecursivePartial<CircleAxisAttributes>;\n\n grid?: RecursivePartial<LineAxisGridAttributes>;\n circleGrid?: RecursivePartial<CircleAxisGridAttributes>;\n\n discreteLegend?: RecursivePartial<DiscreteLegendAttrs>;\n colorLegend?: RecursivePartial<ColorLegendAttributes>;\n sizeLegend?: RecursivePartial<SizeLegendAttributes>;\n\n lineCrosshair?: RecursivePartial<LineCrosshairAttrs>;\n rectCrosshair?: RecursivePartial<RectCrosshairAttrs>;\n sectorCrosshair?: RecursivePartial<SectorCrosshairAttrs>;\n circleCrosshair?: RecursivePartial<CircleCrosshairAttrs>;\n polygonCrosshair?: RecursivePartial<PolygonCrosshairAttrs>;\n\n slider?: RecursivePartial<SliderAttributes>;\n\n dataLabel?: RecursivePartial<DataLabelAttrs>;\n lineLabel?: RecursivePartial<LineLabelAttrs>;\n rectLabel?: RecursivePartial<RectLabelAttrs>;\n arcLabel?: RecursivePartial<ArcLabelAttrs>;\n symbolLabel?: RecursivePartial<SymbolLabelAttrs>;\n pointLabel?: RecursivePartial<BaseLabelAttrs>;\n\n datazoom?: RecursivePartial<DataZoomAttributes>;\n\n continuousPlayer?: RecursivePartial<ContinuousPlayerAttributes>;\n discretePlayer?: RecursivePartial<DiscretePlayerAttributes>;\n\n tooltip?: RecursivePartial<TooltipAttributes>;\n\n title?: RecursivePartial<TitleAttrs>;\n\n scrollbar?: RecursivePartial<ScrollBarAttributes>;\n}\n\nexport interface ITheme {\n name?: string;\n background?: IColor;\n padding?: IPadding | number;\n palette?: Record<string, IColor[]>;\n marks?: IMarkTheme;\n components?: IComponentTheme;\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import type { EventEmitter, IBounds, ILogger } from '@visactor/vutils';
3
- import type { EnvType, IStage, IColor, IOption3D, ILayer, IStageParams } from '@visactor/vrender';
3
+ import type { EnvType, IStage, IColor, IOption3D, ILayer, IStageParams } from '@visactor/vrender-core';
4
4
  import type { CoordinateType } from '@visactor/vgrammar-coordinate';
5
5
  import type { DataSpec } from './data';
6
6
  import type { SignalFunctionType, SignalSpec } from './signal';
@@ -14,9 +14,10 @@ import type { CommonPaddingSpec } from './base';
14
14
  import type { IMorphAnimationConfig } from './morph';
15
15
  import type { IBaseAnimate } from './animate';
16
16
  import type { IRenderer } from './renderer';
17
- import type { IAxis, ICrosshair, IDatazoom, IDimensionTooltip, IGrid, ILabel, ILegend, IPlayer, IScrollbar, ISlider, ITitle, ITooltip } from './component';
17
+ import type { IAxis, IDatazoom, IGrid, ILabel, ILegend, IPlayer, IScrollbar, ISlider, ITitle } from './component';
18
18
  import type { CoordinateSpec } from './coordinate';
19
19
  import type { ITheme } from './theme';
20
+ import type { IInteraction, InteractionSpec } from './interaction';
20
21
  export interface IViewThemeConfig {
21
22
  labelMonospace?: boolean;
22
23
  }
@@ -41,15 +42,13 @@ export interface ILayoutOptions {
41
42
  }
42
43
  export interface IViewEventConfig {
43
44
  defaults?: {
44
- prevent?: boolean | Record<string, boolean> | string[];
45
- allow?: boolean | Record<string, boolean> | string[];
45
+ prevent?: boolean | Record<string, boolean>;
46
+ allow?: boolean | Record<string, boolean>;
46
47
  };
47
- view?: boolean | Record<string, boolean> | string[];
48
- window?: boolean | Record<string, boolean> | string[];
48
+ view?: boolean | Record<string, boolean>;
49
49
  disable?: boolean;
50
50
  gesture?: boolean;
51
51
  drag?: boolean;
52
- globalCursor?: boolean;
53
52
  }
54
53
  export interface srIOption3DType extends IOption3D {
55
54
  enable?: boolean;
@@ -61,14 +60,11 @@ export interface IViewOptions extends IEnvironmentOptions, IRendererOptions, ILa
61
60
  padding?: CommonPaddingSpec;
62
61
  autoFit?: boolean;
63
62
  options3d?: srIOption3DType;
64
- hover?: boolean;
65
- select?: boolean;
66
- cursor?: boolean;
67
63
  logger?: ILogger;
68
64
  logLevel?: number;
69
- domBridge?: any;
70
65
  hooks?: Hooks;
71
66
  eventConfig?: IViewEventConfig;
67
+ background?: IColor;
72
68
  }
73
69
  export interface IRunningConfig {
74
70
  reuse?: boolean;
@@ -98,15 +94,15 @@ export interface IView {
98
94
  axis: (group: IGroupMark | string, mode?: '2d' | '3d') => IAxis;
99
95
  grid: (group: IGroupMark | string, mode?: '2d' | '3d') => IGrid;
100
96
  legend: (group: IGroupMark | string) => ILegend;
101
- crosshair: (group: IGroupMark | string) => ICrosshair;
102
97
  slider: (group: IGroupMark | string) => ISlider;
103
98
  label: (group: IGroupMark | string) => ILabel;
104
99
  datazoom: (group: IGroupMark | string) => IDatazoom;
105
100
  player: (group: IGroupMark | string) => IPlayer;
106
- tooltip: (group: IGroupMark | string) => ITooltip;
107
- dimensionTooltip: (group: IGroupMark | string) => IDimensionTooltip;
108
101
  title: (group: IGroupMark | string) => ITitle;
109
102
  scrollbar: (group: IGroupMark | string) => IScrollbar;
103
+ interaction: (type: string, spec: Partial<InteractionSpec>) => IInteraction;
104
+ removeInteraction: (type: string) => this;
105
+ removeAllInteractions: () => this;
110
106
  addGrammar: (grammar: IGrammarBase) => this;
111
107
  removeGrammar: (grammar: string | IGrammarBase) => this;
112
108
  removeAllGrammars: () => this;
@@ -120,6 +116,8 @@ export interface IView {
120
116
  getGrammarsByName: (name: string) => IGrammarBase[];
121
117
  getGrammarsByType: (grammarType: string) => IGrammarBase[];
122
118
  getMarksByType: (markType: string) => IMark[];
119
+ getMarksByName: (name: string) => IMark[] | null;
120
+ getMarksBySelector: (selector: string | string[] | IMark | IMark[]) => IMark[] | null;
123
121
  commit: (grammar: IGrammarBase) => this;
124
122
  parseSpec: (spec: ViewSpec) => this;
125
123
  updateSpec: (spec: ViewSpec) => this;
@@ -183,6 +181,7 @@ export interface ViewSpec {
183
181
  coordinates?: CoordinateSpec[];
184
182
  marks?: MarkSpec[];
185
183
  events?: EventSpec[];
184
+ interactions?: InteractionSpec[];
186
185
  }
187
186
  export interface IRecordedGrammars {
188
187
  record: (grammar: IGrammarBase) => this;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types/view.ts"],"names":[],"mappings":"","file":"view.js","sourcesContent":["import type { EventEmitter, IBounds, IBoundsLike, ILogger } from '@visactor/vutils';\nimport type { EnvType, IStage, IColor, IOption3D, ILayer, IStageParams } from '@visactor/vrender';\nimport type { CoordinateType } from '@visactor/vgrammar-coordinate';\nimport type { DataSpec } from './data';\nimport type { SignalFunctionType, SignalSpec } from './signal';\nimport type {\n IData,\n ISignal,\n IScale,\n IMark,\n IGrammarBase,\n ICoordinate,\n IGlyphMark,\n IGroupMark,\n IComponent\n} from './grammar';\nimport type { ScaleSpec, GrammarScaleType } from './scale';\nimport type { MarkSpec, MarkType } from './mark';\nimport type { Hooks } from './hooks';\nimport type { ProjectionSpec } from './projection';\nimport type { BaseEventHandler, EventSpec } from './event';\nimport type { CommonPaddingSpec } from './base';\nimport type { IMorphAnimationConfig } from './morph';\nimport type { IBaseAnimate } from './animate';\nimport type { IRenderer } from './renderer';\nimport type {\n IAxis,\n ICrosshair,\n IDatazoom,\n IDimensionTooltip,\n IGrid,\n ILabel,\n ILegend,\n IPlayer,\n IScrollbar,\n ISlider,\n ITitle,\n ITooltip\n} from './component';\nimport type { CoordinateSpec } from './coordinate';\nimport type { ITheme } from './theme';\n\nexport interface IViewThemeConfig {\n labelMonospace?: boolean;\n}\n\n/**\n * 获取state相关配置\n */\nexport interface IViewStateOptions {\n signals?: (name?: string, operator?: any) => boolean;\n data?: (name?: string, object?: any) => boolean;\n recurse?: boolean;\n}\n\nexport interface IEnvironmentOptions {\n /** 环境参数 */\n mode?: EnvType;\n /**\n * 环境带的配置\n */\n modeParams?: any;\n}\n\nexport interface IRendererOptions extends Partial<IStageParams> {\n /** 非浏览器环境下,如小程序,需要传入经过包装的伪 canvas 实例 */\n renderCanvas?: string | HTMLCanvasElement;\n /** vRender stage */\n stage?: IStage;\n rendererTitle?: string;\n /** vRender layer */\n layer?: ILayer;\n}\n\nexport interface ILayoutOptions {\n parseMarkBounds?: (bounds: IBounds, mark: IMark) => IBounds;\n doLayout?: (marks: IMark[], options: ILayoutOptions, view: IView) => void;\n}\n\n/** 事件配置 */\nexport interface IViewEventConfig {\n /**\n * preventDefaults相关配置\n */\n defaults?: {\n prevent?: boolean | Record<string, boolean> | string[];\n allow?: boolean | Record<string, boolean> | string[];\n };\n view?: boolean | Record<string, boolean> | string[];\n window?: boolean | Record<string, boolean> | string[];\n disable?: boolean;\n gesture?: boolean;\n drag?: boolean;\n globalCursor?: boolean;\n}\n\nexport interface srIOption3DType extends IOption3D {\n enable?: boolean;\n /* 是否支持3d视角变换 */\n enableView3dTranform?: boolean;\n}\nexport interface IViewOptions extends IEnvironmentOptions, IRendererOptions, ILayoutOptions {\n width?: number;\n height?: number;\n padding?: CommonPaddingSpec;\n autoFit?: boolean;\n\n options3d?: srIOption3DType;\n\n /** 是否默认配置hover交互 */\n hover?: boolean;\n /** 是否开启选中交互 */\n select?: boolean;\n\n /** 是否启用 cursor 设置 */\n cursor?: boolean;\n\n /** 外部传入的logger方法 */\n logger?: ILogger;\n /**\n * 0 - None\n * 1 - Error\n * 2 - Warn\n * 3 - Info\n * 4 - Debug\n */\n logLevel?: number;\n\n /** worker 专用 */\n domBridge?: any;\n\n /** 生命周期等事件钩子 */\n hooks?: Hooks;\n\n /**\n * 事件相关配置\n * {\n * defaults: {\n * prevent: ['mousemove', 'mouseenter']\n * }\n * }\n */\n eventConfig?: IViewEventConfig;\n}\n\nexport interface IRunningConfig {\n /** whether enable reusing of grammar */\n reuse?: boolean;\n /** whether enable morph */\n morph?: boolean;\n /** force all marks to participate in morphing */\n morphAll?: boolean;\n /** morphing animation config */\n animation?: IMorphAnimationConfig;\n /** whether apply exit animations for released marks */\n enableExitAnimation?: boolean;\n}\n\nexport interface IView {\n readonly renderer: IRenderer;\n readonly rootMark: IGroupMark;\n readonly animate: IBaseAnimate;\n readonly grammars: IRecordedGrammars;\n readonly logger: ILogger;\n\n // --- Grammar API ---\n signal: <T>(value?: T, update?: SignalFunctionType<T>) => ISignal<T>;\n data: (values?: any[]) => IData;\n scale: (type: GrammarScaleType) => IScale;\n coordinate: (type: CoordinateType) => ICoordinate;\n mark: (\n type: MarkType,\n group: IGroupMark | string,\n markOptions?: { glyphType?: string; componentType?: string; mode?: '2d' | '3d' }\n ) => IMark;\n group: (group: IGroupMark | string) => IGroupMark;\n glyph: (glyphType: string, group: IGroupMark | string) => IGlyphMark;\n component: (componentType: string, group: IGroupMark | string, mode?: '2d' | '3d') => IComponent;\n axis: (group: IGroupMark | string, mode?: '2d' | '3d') => IAxis;\n grid: (group: IGroupMark | string, mode?: '2d' | '3d') => IGrid;\n legend: (group: IGroupMark | string) => ILegend;\n crosshair: (group: IGroupMark | string) => ICrosshair;\n slider: (group: IGroupMark | string) => ISlider;\n label: (group: IGroupMark | string) => ILabel;\n datazoom: (group: IGroupMark | string) => IDatazoom;\n player: (group: IGroupMark | string) => IPlayer;\n tooltip: (group: IGroupMark | string) => ITooltip;\n dimensionTooltip: (group: IGroupMark | string) => IDimensionTooltip;\n title: (group: IGroupMark | string) => ITitle;\n scrollbar: (group: IGroupMark | string) => IScrollbar;\n\n addGrammar: (grammar: IGrammarBase) => this;\n removeGrammar: (grammar: string | IGrammarBase) => this;\n removeAllGrammars: () => this;\n\n getGrammarById: (id: string) => IGrammarBase | null;\n getCustomizedById: (id: string) => IGrammarBase | null;\n getSignalById: <T>(id: string) => ISignal<T> | null;\n getDataById: (id: string) => IData | null;\n getScaleById: (id: string) => IScale | null;\n getCoordinateById: (id: string) => ICoordinate | null;\n getMarkById: (id: string) => IMark | null;\n getGrammarsByName: (name: string) => IGrammarBase[];\n getGrammarsByType: (grammarType: string) => IGrammarBase[];\n getMarksByType: (markType: string) => IMark[];\n\n commit: (grammar: IGrammarBase) => this;\n\n // --- Spec API ---\n parseSpec: (spec: ViewSpec) => this;\n updateSpec: (spec: ViewSpec) => this;\n\n // --- Evaluate API ---\n run: (runningConfig?: IRunningConfig) => this;\n runNextTick: (runningConfig?: IRunningConfig) => Promise<this>;\n runAsync: (runningConfig?: IRunningConfig) => Promise<this>;\n runSync: (runningConfig?: IRunningConfig) => this;\n runBefore: (callback: (view: IView) => void) => this;\n runAfter: (callback: (view: IView) => void) => this;\n\n // --- Theme API ---\n theme: (theme: ITheme | string) => this;\n getCurrentTheme: () => ITheme;\n setCurrentTheme: (theme: ITheme | string, render?: boolean) => Promise<this>;\n\n // --- Global Config API ---\n background: (value?: IColor) => IColor;\n width: (value?: number) => number;\n height: (value?: number) => number;\n viewWidth: (value?: number) => number;\n viewHeight: (value?: number) => number;\n padding: (p?: number | { left?: number; right?: number; top?: number; bottom?: number }) => {\n left: number;\n right: number;\n top: number;\n bottom: number;\n };\n getViewBox: () => IBounds;\n\n // --- Event API ---\n addEventListener: (type: string, handler: BaseEventHandler, options?: any) => this;\n removeEventListener: (type: string, handler: BaseEventHandler) => this;\n\n // --- Other API ---\n emit: <T extends EventEmitter.EventNames<string | symbol>>(\n event: T,\n ...args: EventEmitter.EventArgs<string | symbol, T>\n ) => boolean;\n\n resize: (width: number, height: number, render?: boolean) => Promise<this>;\n traverseMarkTree: (apply: (mark: IMark) => any, filter?: (mark: IMark) => boolean, leafFirst?: boolean) => this;\n\n getLayoutState: () => string;\n updateLayoutTag: () => this;\n\n pauseProgressive: () => boolean;\n resumeProgressive: () => boolean;\n restartProgressive: () => boolean;\n\n release: () => void;\n getImageBuffer: () => Buffer;\n}\n\nexport interface IViewConstructor {\n new (options?: IViewOptions, config?: IViewThemeConfig): IView;\n}\n\nexport interface ViewSpec {\n /** 梳理详细配置 */\n theme?: string;\n background?: IColor;\n width?: number;\n height?: number;\n padding?: number | { left?: number; right?: number; top?: number; bottom?: number };\n signals?: SignalSpec<any>[];\n projections?: ProjectionSpec[];\n data?: DataSpec[];\n scales?: ScaleSpec[];\n coordinates?: CoordinateSpec[];\n marks?: MarkSpec[];\n events?: EventSpec[];\n}\n\nexport interface IRecordedGrammars {\n record: (grammar: IGrammarBase) => this;\n unrecord: (grammar: IGrammarBase) => this;\n\n size: () => number;\n\n getSignal: <T>(key: string) => ISignal<T> | null;\n getData: (key: string) => IData | null;\n getScale: (key: string) => IScale | null;\n getCoordinate: (key: string) => ICoordinate | null;\n getMark: (key: string) => IMark | null;\n getCustomized: (key: string) => IGrammarBase | null;\n getGrammar: (key: string) => IGrammarBase | null;\n\n getAllSignals: () => ISignal<any>[];\n getAllData: () => IData[];\n getAllScales: () => IScale[];\n getAllCoordinates: () => ICoordinate[];\n getAllMarks: () => IMark[];\n getAllCustomized: () => IGrammarBase[];\n\n clear: () => void;\n\n traverse: (func: (grammar: IGrammarBase) => boolean | void) => void;\n find: (func: (grammar: IGrammarBase) => boolean) => IGrammarBase | null;\n filter: (func: (grammar: IGrammarBase) => boolean) => IGrammarBase[];\n\n release: () => void;\n}\n\nexport interface IMarkTreeNode {\n mark: IMark;\n parent: IMarkTreeNode;\n children: IMarkTreeNode[];\n}\n\nexport interface IRecordedTreeGrammars extends IRecordedGrammars {\n getAllMarkNodes: () => IMarkTreeNode[];\n}\n"]}
1
+ {"version":3,"sources":["../src/types/view.ts"],"names":[],"mappings":"","file":"view.js","sourcesContent":["import type { EventEmitter, IBounds, ILogger } from '@visactor/vutils';\nimport type { EnvType, IStage, IColor, IOption3D, ILayer, IStageParams } from '@visactor/vrender-core';\nimport type { CoordinateType } from '@visactor/vgrammar-coordinate';\nimport type { DataSpec } from './data';\nimport type { SignalFunctionType, SignalSpec } from './signal';\nimport type {\n IData,\n ISignal,\n IScale,\n IMark,\n IGrammarBase,\n ICoordinate,\n IGlyphMark,\n IGroupMark,\n IComponent\n} from './grammar';\nimport type { ScaleSpec, GrammarScaleType } from './scale';\nimport type { MarkSpec, MarkType } from './mark';\nimport type { Hooks } from './hooks';\nimport type { ProjectionSpec } from './projection';\nimport type { BaseEventHandler, EventSpec } from './event';\nimport type { CommonPaddingSpec } from './base';\nimport type { IMorphAnimationConfig } from './morph';\nimport type { IBaseAnimate } from './animate';\nimport type { IRenderer } from './renderer';\nimport type { IAxis, IDatazoom, IGrid, ILabel, ILegend, IPlayer, IScrollbar, ISlider, ITitle } from './component';\nimport type { CoordinateSpec } from './coordinate';\nimport type { ITheme } from './theme';\nimport type { IInteraction, InteractionSpec } from './interaction';\n\nexport interface IViewThemeConfig {\n labelMonospace?: boolean;\n}\n\n/**\n * 获取state相关配置\n */\nexport interface IViewStateOptions {\n signals?: (name?: string, operator?: any) => boolean;\n data?: (name?: string, object?: any) => boolean;\n recurse?: boolean;\n}\n\nexport interface IEnvironmentOptions {\n /** 环境参数 */\n mode?: EnvType;\n /**\n * 环境带的配置\n */\n modeParams?: any;\n}\n\nexport interface IRendererOptions extends Partial<IStageParams> {\n /** 非浏览器环境下,如小程序,需要传入经过包装的伪 canvas 实例 */\n renderCanvas?: string | HTMLCanvasElement;\n /** vRender stage */\n stage?: IStage;\n rendererTitle?: string;\n /** vRender layer */\n layer?: ILayer;\n}\n\nexport interface ILayoutOptions {\n parseMarkBounds?: (bounds: IBounds, mark: IMark) => IBounds;\n doLayout?: (marks: IMark[], options: ILayoutOptions, view: IView) => void;\n}\n\n/** 事件配置 */\nexport interface IViewEventConfig {\n /**\n * preventDefaults相关配置\n */\n defaults?: {\n prevent?: boolean | Record<string, boolean>;\n allow?: boolean | Record<string, boolean>;\n };\n /**\n * whether permit events of view\n */\n view?: boolean | Record<string, boolean>;\n /** disable all the events */\n disable?: boolean;\n /** use gesture events or not */\n gesture?: boolean;\n /** use drag events or not */\n drag?: boolean;\n}\n\nexport interface srIOption3DType extends IOption3D {\n enable?: boolean;\n /* 是否支持3d视角变换 */\n enableView3dTranform?: boolean;\n}\nexport interface IViewOptions extends IEnvironmentOptions, IRendererOptions, ILayoutOptions {\n width?: number;\n height?: number;\n padding?: CommonPaddingSpec;\n autoFit?: boolean;\n\n options3d?: srIOption3DType;\n /** 外部传入的logger方法 */\n logger?: ILogger;\n /**\n * 0 - None\n * 1 - Error\n * 2 - Warn\n * 3 - Info\n * 4 - Debug\n */\n logLevel?: number;\n\n /** 生命周期等事件钩子 */\n hooks?: Hooks;\n\n /**\n * 事件相关配置\n * {\n * defaults: {\n * prevent: ['mousemove', 'mouseenter']\n * }\n * }\n */\n eventConfig?: IViewEventConfig;\n background?: IColor;\n}\n\nexport interface IRunningConfig {\n /** whether enable reusing of grammar */\n reuse?: boolean;\n /** whether enable morph */\n morph?: boolean;\n /** force all marks to participate in morphing */\n morphAll?: boolean;\n /** morphing animation config */\n animation?: IMorphAnimationConfig;\n /** whether apply exit animations for released marks */\n enableExitAnimation?: boolean;\n}\n\nexport interface IView {\n readonly renderer: IRenderer;\n readonly rootMark: IGroupMark;\n readonly animate: IBaseAnimate;\n readonly grammars: IRecordedGrammars;\n readonly logger: ILogger;\n\n // --- Grammar API ---\n signal: <T>(value?: T, update?: SignalFunctionType<T>) => ISignal<T>;\n data: (values?: any[]) => IData;\n scale: (type: GrammarScaleType) => IScale;\n coordinate: (type: CoordinateType) => ICoordinate;\n mark: (\n type: MarkType,\n group: IGroupMark | string,\n markOptions?: { glyphType?: string; componentType?: string; mode?: '2d' | '3d' }\n ) => IMark;\n group: (group: IGroupMark | string) => IGroupMark;\n glyph: (glyphType: string, group: IGroupMark | string) => IGlyphMark;\n component: (componentType: string, group: IGroupMark | string, mode?: '2d' | '3d') => IComponent;\n axis: (group: IGroupMark | string, mode?: '2d' | '3d') => IAxis;\n grid: (group: IGroupMark | string, mode?: '2d' | '3d') => IGrid;\n legend: (group: IGroupMark | string) => ILegend;\n slider: (group: IGroupMark | string) => ISlider;\n label: (group: IGroupMark | string) => ILabel;\n datazoom: (group: IGroupMark | string) => IDatazoom;\n player: (group: IGroupMark | string) => IPlayer;\n title: (group: IGroupMark | string) => ITitle;\n scrollbar: (group: IGroupMark | string) => IScrollbar;\n\n interaction: (type: string, spec: Partial<InteractionSpec>) => IInteraction;\n removeInteraction: (type: string) => this;\n removeAllInteractions: () => this;\n\n addGrammar: (grammar: IGrammarBase) => this;\n removeGrammar: (grammar: string | IGrammarBase) => this;\n removeAllGrammars: () => this;\n\n getGrammarById: (id: string) => IGrammarBase | null;\n getCustomizedById: (id: string) => IGrammarBase | null;\n getSignalById: <T>(id: string) => ISignal<T> | null;\n getDataById: (id: string) => IData | null;\n getScaleById: (id: string) => IScale | null;\n getCoordinateById: (id: string) => ICoordinate | null;\n getMarkById: (id: string) => IMark | null;\n getGrammarsByName: (name: string) => IGrammarBase[];\n getGrammarsByType: (grammarType: string) => IGrammarBase[];\n getMarksByType: (markType: string) => IMark[];\n getMarksByName: (name: string) => IMark[] | null;\n getMarksBySelector: (selector: string | string[] | IMark | IMark[]) => IMark[] | null;\n\n commit: (grammar: IGrammarBase) => this;\n\n // --- Spec API ---\n parseSpec: (spec: ViewSpec) => this;\n updateSpec: (spec: ViewSpec) => this;\n\n // --- Evaluate API ---\n run: (runningConfig?: IRunningConfig) => this;\n runNextTick: (runningConfig?: IRunningConfig) => Promise<this>;\n runAsync: (runningConfig?: IRunningConfig) => Promise<this>;\n runSync: (runningConfig?: IRunningConfig) => this;\n runBefore: (callback: (view: IView) => void) => this;\n runAfter: (callback: (view: IView) => void) => this;\n\n // --- Theme API ---\n theme: (theme: ITheme | string) => this;\n getCurrentTheme: () => ITheme;\n setCurrentTheme: (theme: ITheme | string, render?: boolean) => Promise<this>;\n\n // --- Global Config API ---\n background: (value?: IColor) => IColor;\n width: (value?: number) => number;\n height: (value?: number) => number;\n viewWidth: (value?: number) => number;\n viewHeight: (value?: number) => number;\n padding: (p?: number | { left?: number; right?: number; top?: number; bottom?: number }) => {\n left: number;\n right: number;\n top: number;\n bottom: number;\n };\n getViewBox: () => IBounds;\n\n // --- Event API ---\n addEventListener: (type: string, handler: BaseEventHandler, options?: any) => this;\n removeEventListener: (type: string, handler: BaseEventHandler) => this;\n\n // --- Other API ---\n emit: <T extends EventEmitter.EventNames<string | symbol>>(\n event: T,\n ...args: EventEmitter.EventArgs<string | symbol, T>\n ) => boolean;\n\n resize: (width: number, height: number, render?: boolean) => Promise<this>;\n traverseMarkTree: (apply: (mark: IMark) => any, filter?: (mark: IMark) => boolean, leafFirst?: boolean) => this;\n\n getLayoutState: () => string;\n updateLayoutTag: () => this;\n\n pauseProgressive: () => boolean;\n resumeProgressive: () => boolean;\n restartProgressive: () => boolean;\n\n release: () => void;\n getImageBuffer: () => Buffer;\n}\n\nexport interface IViewConstructor {\n new (options?: IViewOptions, config?: IViewThemeConfig): IView;\n}\n\nexport interface ViewSpec {\n /** 梳理详细配置 */\n theme?: string;\n background?: IColor;\n width?: number;\n height?: number;\n padding?: number | { left?: number; right?: number; top?: number; bottom?: number };\n signals?: SignalSpec<any>[];\n projections?: ProjectionSpec[];\n data?: DataSpec[];\n scales?: ScaleSpec[];\n coordinates?: CoordinateSpec[];\n marks?: MarkSpec[];\n events?: EventSpec[];\n interactions?: InteractionSpec[];\n}\n\nexport interface IRecordedGrammars {\n record: (grammar: IGrammarBase) => this;\n unrecord: (grammar: IGrammarBase) => this;\n\n size: () => number;\n\n getSignal: <T>(key: string) => ISignal<T> | null;\n getData: (key: string) => IData | null;\n getScale: (key: string) => IScale | null;\n getCoordinate: (key: string) => ICoordinate | null;\n getMark: (key: string) => IMark | null;\n getCustomized: (key: string) => IGrammarBase | null;\n getGrammar: (key: string) => IGrammarBase | null;\n\n getAllSignals: () => ISignal<any>[];\n getAllData: () => IData[];\n getAllScales: () => IScale[];\n getAllCoordinates: () => ICoordinate[];\n getAllMarks: () => IMark[];\n getAllCustomized: () => IGrammarBase[];\n\n clear: () => void;\n\n traverse: (func: (grammar: IGrammarBase) => boolean | void) => void;\n find: (func: (grammar: IGrammarBase) => boolean) => IGrammarBase | null;\n filter: (func: (grammar: IGrammarBase) => boolean) => IGrammarBase[];\n\n release: () => void;\n}\n\nexport interface IMarkTreeNode {\n mark: IMark;\n parent: IMarkTreeNode;\n children: IMarkTreeNode[];\n}\n\nexport interface IRecordedTreeGrammars extends IRecordedGrammars {\n getAllMarkNodes: () => IMarkTreeNode[];\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import type { IBaseScale } from '@visactor/vscale';
2
+ export declare function isBandLikeScale(scale: IBaseScale): boolean;
3
+ export declare function getBandWidthOfScale(scale: IBaseScale): number;
4
+ export declare function getScaleRangeRatio(scale: IBaseScale, input: any): number;
@@ -0,0 +1,15 @@
1
+ import { ScaleEnum } from "@visactor/vscale";
2
+
3
+ export function isBandLikeScale(scale) {
4
+ return scale && (scale.type === ScaleEnum.Band || scale.type === ScaleEnum.Point);
5
+ }
6
+
7
+ export function getBandWidthOfScale(scale) {
8
+ if (scale) return scale.type === ScaleEnum.Band ? scale.bandwidth() : scale.type === ScaleEnum.Point ? scale.step() : void 0;
9
+ }
10
+
11
+ export function getScaleRangeRatio(scale, input) {
12
+ const range = scale.range();
13
+ return (scale.scale(input) - range[0]) / (range[range.length - 1] - range[0]);
14
+ }
15
+ //# sourceMappingURL=scale.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/util/scale.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAI7C,MAAM,UAAU,eAAe,CAAC,KAAiB;IAC/C,OAAO,KAAK,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,KAAK,CAAC,CAAC;AACpF,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,KAAiB;IACnD,IAAI,CAAC,KAAK,EAAE;QACV,OAAO,SAAS,CAAC;KAClB;IAED,OAAO,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI;QAClC,CAAC,CAAE,KAAwB,CAAC,SAAS,EAAE;QACvC,CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,KAAK;YAChC,CAAC,CAAE,KAAwB,CAAC,IAAI,EAAE;YAClC,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,KAAiB,EAAE,KAAU;IAC9D,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC;IAC5B,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAChF,CAAC","file":"scale.js","sourcesContent":["import { ScaleEnum } from '@visactor/vscale';\n// eslint-disable-next-line no-duplicate-imports\nimport type { IBandLikeScale, IBaseScale } from '@visactor/vscale';\n\nexport function isBandLikeScale(scale: IBaseScale) {\n return scale && (scale.type === ScaleEnum.Band || scale.type === ScaleEnum.Point);\n}\n\nexport function getBandWidthOfScale(scale: IBaseScale) {\n if (!scale) {\n return undefined;\n }\n\n return scale.type === ScaleEnum.Band\n ? (scale as IBandLikeScale).bandwidth()\n : scale.type === ScaleEnum.Point\n ? (scale as IBandLikeScale).step()\n : undefined;\n}\n\nexport function getScaleRangeRatio(scale: IBaseScale, input: any) {\n const range = scale.range();\n return (scale.scale(input) - range[0]) / (range[range.length - 1] - range[0]);\n}\n"]}
package/es/util/text.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { IRichText, IRichTextCharacter } from '@visactor/vrender';
1
+ import type { IRichText, IRichTextCharacter } from '@visactor/vrender-core';
2
2
  export declare function richXul(strings: TemplateStringsArray, ...insertVars: (string | number)[]): {
3
3
  type: string;
4
4
  text: IRichTextCharacter[];
package/es/util/text.js CHANGED
@@ -1,4 +1,4 @@
1
- import { xul as vRenderXul, RichText } from "@visactor/vrender";
1
+ import { xul as vRenderXul, RichText } from "@visactor/vrender-core";
2
2
 
3
3
  import { isArray } from "@visactor/vutils";
4
4
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/util/text.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,IAAI,UAAU,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,MAAM,UAAU,OAAO,CAAC,OAA6B,EAAE,GAAG,UAA+B;IACvF,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,UAAU,CACd,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE;YAC9B,OAAO,GAAG,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;QACpE,CAAC,EAAE,EAAE,CAAC,CACP;KACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,OAAO,CACrB,QAA8F;IAE9F,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EACF,QAAQ,YAAY,QAAQ;YAC1B,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,UAAU;YAC/B,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;gBACnB,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;oBACnB,OAAQ,KAAyD,CAAC,IAAI;wBACpE,CAAC,CAAE,KAAyD,CAAC,SAAS;wBACtE,CAAC,CAAC,KAAK,CAAC;gBACZ,CAAC,CAAC;gBACJ,CAAC,CAAC,EAAE;KACT,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,OAA6B,EAAE,GAAG,UAA+B;IACxF,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE;YACpC,OAAO,GAAG,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;QACpE,CAAC,EAAE,EAAE,CAAC;KACP,CAAC;AACJ,CAAC","file":"text.js","sourcesContent":["import type { IRichText, IRichTextCharacter } from '@visactor/vrender';\nimport { xul as vRenderXul, RichText } from '@visactor/vrender';\nimport { isArray } from '@visactor/vutils';\n\nexport function richXul(strings: TemplateStringsArray, ...insertVars: (string | number)[]) {\n return {\n type: 'rich',\n text: vRenderXul(\n strings.reduce((res, temp, i) => {\n return res + temp + (i >= insertVars.length ? '' : insertVars[i]);\n }, '')\n )\n };\n}\n\nexport function richJsx(\n richText: IRichText | { attribute: IRichTextCharacter; type: string }[] | IRichTextCharacter[]\n) {\n return {\n type: 'rich',\n text:\n richText instanceof RichText\n ? richText.attribute.textConfig\n : isArray(richText)\n ? richText.map(entry => {\n return (entry as { attribute: IRichTextCharacter; type: string }).type\n ? (entry as { attribute: IRichTextCharacter; type: string }).attribute\n : entry;\n })\n : []\n };\n}\n\nexport function textHtml(strings: TemplateStringsArray, ...insertVars: (string | number)[]) {\n return {\n type: 'html',\n text: strings.reduce((res, temp, i) => {\n return res + temp + (i >= insertVars.length ? '' : insertVars[i]);\n }, '')\n };\n}\n"]}
1
+ {"version":3,"sources":["../src/util/text.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,IAAI,UAAU,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,MAAM,UAAU,OAAO,CAAC,OAA6B,EAAE,GAAG,UAA+B;IACvF,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,UAAU,CACd,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE;YAC9B,OAAO,GAAG,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;QACpE,CAAC,EAAE,EAAE,CAAC,CACP;KACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,OAAO,CACrB,QAA8F;IAE9F,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EACF,QAAQ,YAAY,QAAQ;YAC1B,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,UAAU;YAC/B,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;gBACnB,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;oBACnB,OAAQ,KAAyD,CAAC,IAAI;wBACpE,CAAC,CAAE,KAAyD,CAAC,SAAS;wBACtE,CAAC,CAAC,KAAK,CAAC;gBACZ,CAAC,CAAC;gBACJ,CAAC,CAAC,EAAE;KACT,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,OAA6B,EAAE,GAAG,UAA+B;IACxF,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE;YACpC,OAAO,GAAG,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;QACpE,CAAC,EAAE,EAAE,CAAC;KACP,CAAC;AACJ,CAAC","file":"text.js","sourcesContent":["import type { IRichText, IRichTextCharacter } from '@visactor/vrender-core';\nimport { xul as vRenderXul, RichText } from '@visactor/vrender-core';\nimport { isArray } from '@visactor/vutils';\n\nexport function richXul(strings: TemplateStringsArray, ...insertVars: (string | number)[]) {\n return {\n type: 'rich',\n text: vRenderXul(\n strings.reduce((res, temp, i) => {\n return res + temp + (i >= insertVars.length ? '' : insertVars[i]);\n }, '')\n )\n };\n}\n\nexport function richJsx(\n richText: IRichText | { attribute: IRichTextCharacter; type: string }[] | IRichTextCharacter[]\n) {\n return {\n type: 'rich',\n text:\n richText instanceof RichText\n ? richText.attribute.textConfig\n : isArray(richText)\n ? richText.map(entry => {\n return (entry as { attribute: IRichTextCharacter; type: string }).type\n ? (entry as { attribute: IRichTextCharacter; type: string }).attribute\n : entry;\n })\n : []\n };\n}\n\nexport function textHtml(strings: TemplateStringsArray, ...insertVars: (string | number)[]) {\n return {\n type: 'html',\n text: strings.reduce((res, temp, i) => {\n return res + temp + (i >= insertVars.length ? '' : insertVars[i]);\n }, '')\n };\n}\n"]}
package/es/view/View.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import type { IBounds, ILogger } from '@visactor/vutils';
2
2
  import { EventEmitter } from '@visactor/vutils';
3
- import type { IColor } from '@visactor/vrender';
3
+ import type { IColor } from '@visactor/vrender-core';
4
4
  import type { CoordinateType } from '@visactor/vgrammar-coordinate';
5
- import type { IData, ISignal, ViewSpec, IView, IViewOptions, IViewThemeConfig, Hooks, IMark, EventSpec, MarkType, GrammarScaleType, SignalFunctionType, IScale, IGrammarBase, IGroupMark, IGlyphMark, ICoordinate, BaseEventHandler, IRecordedGrammars, IComponent, IRunningConfig, IViewAnimate, ITheme } from '../types/';
5
+ import type { IData, ISignal, ViewSpec, IView, IViewOptions, IViewThemeConfig, Hooks, IMark, EventSpec, MarkType, GrammarScaleType, SignalFunctionType, IScale, IGrammarBase, IGroupMark, IGlyphMark, ICoordinate, BaseEventHandler, IRecordedGrammars, IComponent, IRunningConfig, IViewAnimate, ITheme, InteractionSpec, IInteraction } from '../types/';
6
6
  import type { IRenderer } from '../types/renderer';
7
7
  import { LayoutState } from '../graph/enums';
8
- import type { IAxis, ICrosshair, IDatazoom, IDimensionTooltip, IGrid, ILabel, ILegend, IPlayer, IScrollbar, ISlider, ITitle, ITooltip } from '../types/component';
8
+ import type { IAxis, IDatazoom, IGrid, ILabel, ILegend, IPlayer, IScrollbar, ISlider, ITitle } from '../types/component';
9
9
  export default class View extends EventEmitter implements IView {
10
10
  container: HTMLElement;
11
11
  renderer: IRenderer;
@@ -21,7 +21,6 @@ export default class View extends EventEmitter implements IView {
21
21
  private _willMorphMarks;
22
22
  private _morph;
23
23
  private _eventConfig;
24
- private _globalCursor;
25
24
  private _eventListeners;
26
25
  private _theme;
27
26
  private _dataflow;
@@ -34,8 +33,8 @@ export default class View extends EventEmitter implements IView {
34
33
  private _eventCache;
35
34
  private _progressiveMarks?;
36
35
  private _progressiveRafId?;
37
- private _cursorValue?;
38
36
  private _observer;
37
+ private _boundInteractions?;
39
38
  static useRegisters(comps: (() => void)[]): void;
40
39
  constructor(options?: IViewOptions, config?: IViewThemeConfig);
41
40
  getGrammarById(id: string): IGrammarBase;
@@ -48,6 +47,8 @@ export default class View extends EventEmitter implements IView {
48
47
  getGrammarsByName(name: string): IGrammarBase[];
49
48
  getGrammarsByType(grammarType: string): IGrammarBase[];
50
49
  getMarksByType(markType: string): IMark[];
50
+ getMarksByName(name: string): IMark[] | null;
51
+ getMarksBySelector(selector: string | string[] | IMark | IMark[]): IMark[] | null;
51
52
  private updateSignal;
52
53
  signal<T>(value?: T, update?: SignalFunctionType<T>): ISignal<T>;
53
54
  data(values?: any[]): IData;
@@ -64,13 +65,10 @@ export default class View extends EventEmitter implements IView {
64
65
  axis(group: IGroupMark | string, mode?: '2d' | '3d'): IAxis;
65
66
  grid(group: IGroupMark | string, mode?: '2d' | '3d'): IGrid;
66
67
  legend(group: IGroupMark | string): ILegend;
67
- crosshair(group: IGroupMark | string): ICrosshair;
68
68
  slider(group: IGroupMark | string): ISlider;
69
69
  label(group: IGroupMark | string): ILabel;
70
70
  datazoom(group: IGroupMark | string): IDatazoom;
71
71
  player(group: IGroupMark | string): IPlayer;
72
- tooltip(group: IGroupMark | string): ITooltip;
73
- dimensionTooltip(group: IGroupMark | string): IDimensionTooltip;
74
72
  title(group: IGroupMark | string): ITitle;
75
73
  scrollbar(group: IGroupMark | string): IScrollbar;
76
74
  customized(type: string, spec: any): IGrammarBase;
@@ -132,16 +130,14 @@ export default class View extends EventEmitter implements IView {
132
130
  private _resizeRenderer;
133
131
  private bindEvents;
134
132
  event(eventSpec: EventSpec): void;
135
- private hover;
136
- cursor(): void;
133
+ interaction(type: string, spec: Partial<InteractionSpec>): IInteraction;
134
+ removeInteraction(type: string | IInteraction): this;
135
+ removeAllInteractions(): this;
137
136
  private initEvent;
138
137
  private delegateEvent;
139
138
  addEventListener(type: string, handler: BaseEventHandler, options?: any): this;
140
139
  removeEventListener(type: string, handler?: BaseEventHandler): this;
141
- private setCursor;
142
- globalCursor(_?: boolean): string | boolean | this;
143
140
  private initializeRenderer;
144
- private initializeBuiltEvents;
145
141
  private initialize;
146
142
  normalBrowserEnv(): boolean;
147
143
  pauseProgressive(): boolean;
package/es/view/View.js CHANGED
@@ -24,9 +24,9 @@ var __awaiter = this && this.__awaiter || function(thisArg, _arguments, P, gener
24
24
  }));
25
25
  };
26
26
 
27
- import { EventEmitter, debounce, isNil, isObject, isString, getContainerSize, Logger } from "@visactor/vutils";
27
+ import { EventEmitter, debounce, isObject, isString, getContainerSize, Logger, array } from "@visactor/vutils";
28
28
 
29
- import { vglobal } from "@visactor/vrender";
29
+ import { vglobal } from "@visactor/vrender-core";
30
30
 
31
31
  import { Data } from "./data";
32
32
 
@@ -42,7 +42,7 @@ import CanvasRenderer from "../graph/canvas-renderer";
42
42
 
43
43
  import getExtendedEvents from "../graph/util/events-extend";
44
44
 
45
- import { BROWSER, NO_TRAP, SIGNAL_WIDTH, SIGNAL_HEIGHT, SIGNAL_PADDING, SIGNAL_AUTOFIT, CURSOR_DEFAULT, DEFAULT_HOVER_STATE, SIGNAL_VIEW_WIDTH, SIGNAL_VIEW_HEIGHT, EVENT_SOURCE_VIEW, EVENT_SOURCE_WINDOW, SIGNAL_VIEW_BOX } from "./constants";
45
+ import { BROWSER, NO_TRAP, SIGNAL_WIDTH, SIGNAL_HEIGHT, SIGNAL_PADDING, SIGNAL_AUTOFIT, SIGNAL_VIEW_WIDTH, SIGNAL_VIEW_HEIGHT, EVENT_SOURCE_VIEW, EVENT_SOURCE_WINDOW, SIGNAL_VIEW_BOX } from "./constants";
46
46
 
47
47
  import { Signal } from "./signal";
48
48
 
@@ -50,9 +50,9 @@ import { Scale } from "./scale";
50
50
 
51
51
  import { BuiltInSignalID, builtInSignals, normalizeMarkTree, normalizeRunningConfig, normalizePadding } from "../parse/view";
52
52
 
53
- import { parseHandler, parseEventSelector, generateFilterByMark } from "../parse/event";
53
+ import { parseHandler, parseEventSelector, generateFilterByMark, ID_PREFIX, NAME_PREFIX } from "../parse/event";
54
54
 
55
- import { parseReference } from "../parse/util";
55
+ import { isGrammar, parseReference } from "../parse/util";
56
56
 
57
57
  import { configureEnvironment } from "../graph/util/env";
58
58
 
@@ -86,6 +86,8 @@ import { Factory } from "../core/factory";
86
86
 
87
87
  import { Component } from "./component";
88
88
 
89
+ import { isMarkType } from "../graph/util/graphic";
90
+
89
91
  export default class View extends EventEmitter {
90
92
  static useRegisters(comps) {
91
93
  comps.forEach((fn => {
@@ -105,8 +107,7 @@ export default class View extends EventEmitter {
105
107
  mark.isDoingProgressive() && mark.evaluateProgressive();
106
108
  })), this.doPreProgressive();
107
109
  }, this._config = config, this._options = Object.assign({
108
- mode: BROWSER,
109
- cursor: !0
110
+ mode: BROWSER
110
111
  }, options), this.initialize();
111
112
  }
112
113
  getGrammarById(id) {
@@ -139,6 +140,19 @@ export default class View extends EventEmitter {
139
140
  getMarksByType(markType) {
140
141
  return this.grammars.getAllMarks().filter((mark => mark.markType === markType));
141
142
  }
143
+ getMarksByName(name) {
144
+ return this.grammars.getAllMarks().filter((mark => mark.name() === name));
145
+ }
146
+ getMarksBySelector(selector) {
147
+ if (!selector) return null;
148
+ const selectors = array(selector);
149
+ let res = [];
150
+ return selectors.forEach((selectorStr => {
151
+ isGrammar(selectorStr) ? res = res.concat(selectorStr) : (selectorStr[0] === ID_PREFIX && (res = res.concat(this.getMarkById(selectorStr.slice(1)))),
152
+ selectorStr[0] === NAME_PREFIX && (res = res.concat(this.getMarksByName(selectorStr.slice(1)))),
153
+ isMarkType(selectorStr) && (res = res.concat(this.getMarksByType(selectorStr))));
154
+ })), res;
155
+ }
142
156
  updateSignal(signal, value) {
143
157
  isString(signal) && (signal = this.getSignalById(signal)), signal.set(value), this.commit(signal);
144
158
  }
@@ -223,11 +237,6 @@ export default class View extends EventEmitter {
223
237
  componentType: ComponentEnum.legend
224
238
  });
225
239
  }
226
- crosshair(group) {
227
- return this.mark(GrammarMarkType.component, group, {
228
- componentType: ComponentEnum.crosshair
229
- });
230
- }
231
240
  slider(group) {
232
241
  return this.mark(GrammarMarkType.component, group, {
233
242
  componentType: ComponentEnum.slider
@@ -248,16 +257,6 @@ export default class View extends EventEmitter {
248
257
  componentType: ComponentEnum.player
249
258
  });
250
259
  }
251
- tooltip(group) {
252
- return this.mark(GrammarMarkType.component, group, {
253
- componentType: ComponentEnum.tooltip
254
- });
255
- }
256
- dimensionTooltip(group) {
257
- return this.mark(GrammarMarkType.component, group, {
258
- componentType: ComponentEnum.dimensionTooltip
259
- });
260
- }
261
260
  title(group) {
262
261
  return this.mark(GrammarMarkType.component, group, {
263
262
  componentType: ComponentEnum.title
@@ -290,7 +289,7 @@ export default class View extends EventEmitter {
290
289
  })), this;
291
290
  }
292
291
  parseSpec(spec) {
293
- var _a, _b, _c, _d, _e, _f, _g, _h;
292
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
294
293
  if (this.emit(HOOK_EVENT.BEFORE_PARSE_VIEW), this._spec = spec, normalizeMarkTree(spec),
295
294
  spec.theme ? this.theme(spec.theme) : this.theme(ThemeManager.getDefaultTheme()),
296
295
  spec.width && this.width(spec.width), spec.height && this.height(spec.height), this.padding(null !== (_b = null !== (_a = spec.padding) && void 0 !== _a ? _a : this._options.padding) && void 0 !== _b ? _b : this._theme.padding),
@@ -318,11 +317,13 @@ export default class View extends EventEmitter {
318
317
  this.parseMarkSpec(mark);
319
318
  })), (null === (_h = spec.events) || void 0 === _h ? void 0 : _h.length) && spec.events.forEach((eventConfig => {
320
319
  this.event(eventConfig);
320
+ })), (null === (_j = spec.interactions) || void 0 === _j ? void 0 : _j.length) && spec.interactions.forEach((interaction => {
321
+ this.interaction(interaction.type, interaction);
321
322
  })), this.emit(HOOK_EVENT.AFTER_PARSE_VIEW), this._needBuildLayoutTree = !0, this._layoutState = LayoutState.before,
322
323
  this;
323
324
  }
324
325
  updateSpec(spec) {
325
- return this.removeAllGrammars(), this.parseSpec(spec);
326
+ return this.removeAllInteractions(), this.removeAllGrammars(), this.parseSpec(spec);
326
327
  }
327
328
  parseBuiltIn() {
328
329
  builtInSignals(this._options, this._config, this.getCurrentTheme()).map((signalSpec => {
@@ -713,28 +714,24 @@ export default class View extends EventEmitter {
713
714
  singleEvent.debounce = 50, this.bindEvents(singleEvent);
714
715
  })) : this.bindEvents(eventSpec);
715
716
  }
716
- hover(hoverState) {
717
- const state = hoverState || DEFAULT_HOVER_STATE;
718
- return this.addEventListener("pointerover", (evt => {
719
- if (!evt.element) return;
720
- evt.element.addState(state);
721
- })), this.addEventListener("pointerout", (evt => {
722
- if (!evt.element) return;
723
- evt.element.removeState(state);
724
- })), this;
717
+ interaction(type, spec) {
718
+ const interaction = Factory.createInteraction(type, this, spec);
719
+ return interaction && (interaction.bind(), this._boundInteractions || (this._boundInteractions = []),
720
+ this._boundInteractions.push(interaction)), interaction;
725
721
  }
726
- cursor() {
727
- this._cursorValue = {
728
- user: CURSOR_DEFAULT,
729
- element: null
730
- }, this.addEventListener("mousemove", (evt => {
731
- var _a, _b, _c;
732
- const elementCursor = null === (_b = null === (_a = null == evt ? void 0 : evt.element) || void 0 === _a ? void 0 : _a.graphicItem) || void 0 === _b ? void 0 : _b.cursor, value = this._cursorValue, user = value ? isString(value) ? value : value.user : CURSOR_DEFAULT, nextValue = value && user === value.user && (elementCursor === value.element || isNil(elementCursor) && isNil(value.element)) ? value : {
733
- user: user,
734
- element: elementCursor
735
- };
736
- nextValue !== value && (this._cursorValue = nextValue, this.setCursor(nextValue.user && nextValue.user !== CURSOR_DEFAULT ? nextValue.user : null !== (_c = nextValue.element) && void 0 !== _c ? _c : nextValue.user));
737
- }));
722
+ removeInteraction(type) {
723
+ if (this._boundInteractions) {
724
+ const instances = this._boundInteractions.filter((interaction => isString(type) && interaction.type === type || interaction === type));
725
+ instances.length && instances.forEach((instance => {
726
+ instance.unbind();
727
+ }));
728
+ }
729
+ return this;
730
+ }
731
+ removeAllInteractions() {
732
+ return this._boundInteractions && (this._boundInteractions.forEach((instance => {
733
+ instance.unbind();
734
+ })), this._boundInteractions = null), this;
738
735
  }
739
736
  initEvent() {
740
737
  const stage = this.renderer.stage();
@@ -749,28 +746,10 @@ export default class View extends EventEmitter {
749
746
  removeEventListener(type, handler) {
750
747
  return handler ? this.off(type, handler) : this.off(type), this;
751
748
  }
752
- setCursor(cursor) {
753
- if (this._options.domBridge && this._options.domBridge.setCursor) return void this._options.domBridge.setCursor(cursor);
754
- const el = this.globalCursor() ? !isNil(document) && document.body : this.container;
755
- return el ? isNil(cursor) ? el.style.removeProperty("cursor") : el.style.cursor = cursor : void 0;
756
- }
757
- globalCursor(_) {
758
- if (arguments.length) {
759
- if (this._globalCursor !== !!_) {
760
- const prev = this.setCursor(null);
761
- this._globalCursor = !!_, prev && this.setCursor(prev);
762
- }
763
- return this;
764
- }
765
- return this._globalCursor;
766
- }
767
749
  initializeRenderer() {
768
750
  const width = this._options.width, height = this._options.height;
769
751
  this.renderer = new CanvasRenderer(this), this.renderer.initialize(width, height, this._options, this._eventConfig).background(this._background);
770
752
  }
771
- initializeBuiltEvents() {
772
- this._options.cursor && this.cursor(), this._options.hover && this.hover(), this._bindResizeEvent();
773
- }
774
753
  initialize() {
775
754
  var _a;
776
755
  this.grammars = new RecordedGrammars((grammar => grammar.id()), ((key, grammar) => this.logger.warn(`Grammar id '${key}' has been occupied`, grammar))),
@@ -780,11 +759,11 @@ export default class View extends EventEmitter {
780
759
  this._theme = ThemeManager.getDefaultTheme(), this._options.hooks && (Object.keys(this._options.hooks).forEach((key => {
781
760
  this.on(key, this._options.hooks[key]);
782
761
  })), this.hooks = this._options.hooks), this.container = null, this.renderer = null,
783
- this._globalCursor = !1, this._eventListeners = [], this._eventConfig = initializeEventConfig(this._options.eventConfig),
784
- this.globalCursor(this._eventConfig.globalCursor), this._theme = ThemeManager.getDefaultTheme(),
785
- this.parseBuiltIn(), configureEnvironment(this._options), this.initializeRenderer(),
786
- this._eventConfig.disable || this.initEvent(), this.initializeBuiltEvents(), this._currentDataflow = null,
787
- this._needBuildLayoutTree = !0, this._layoutState = LayoutState.before, this.theme(this._theme);
762
+ this._eventListeners = [], this._eventConfig = initializeEventConfig(this._options.eventConfig),
763
+ this._theme = ThemeManager.getDefaultTheme(), this.parseBuiltIn(), configureEnvironment(this._options),
764
+ this.initializeRenderer(), this._eventConfig.disable || this.initEvent(), this._bindResizeEvent(),
765
+ this._currentDataflow = null, this._needBuildLayoutTree = !0, this._layoutState = LayoutState.before,
766
+ this.theme(this._theme);
788
767
  }
789
768
  normalBrowserEnv() {
790
769
  return "browser" === this._options.mode;
@@ -825,7 +804,8 @@ export default class View extends EventEmitter {
825
804
  this._unBindResizeEvent(), this.clearProgressive(), Factory.unregisterRuntimeTransforms(),
826
805
  this.animate.stop(), this.grammars.release(), this._cachedGrammars.release(), this._dataflow = null,
827
806
  null === (_b = null === (_a = this.renderer) || void 0 === _a ? void 0 : _a.release) || void 0 === _b || _b.call(_a),
828
- this.renderer = null, this.removeAllListeners(), null === (_c = this._eventListeners) || void 0 === _c || _c.forEach((listener => {
807
+ this.renderer = null, this._boundInteractions = null, this.removeAllListeners(),
808
+ null === (_c = this._eventListeners) || void 0 === _c || _c.forEach((listener => {
829
809
  listener.source.removeEventListener(listener.type, listener.handler);
830
810
  })), this._eventListeners = null;
831
811
  }