@visactor/vchart 1.8.10-alpha.0 → 1.9.0-alpha.1

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 (965) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.js +11042 -10188
  3. package/build/index.min.js +1 -1
  4. package/build/tsconfig.tsbuildinfo +1 -1
  5. package/cjs/chart/base/base-chart-transformer.d.ts +1 -0
  6. package/cjs/chart/base/base-chart-transformer.js +45 -20
  7. package/cjs/chart/base/base-chart-transformer.js.map +1 -1
  8. package/cjs/chart/base/base-chart.d.ts +1 -0
  9. package/cjs/chart/base/base-chart.js +10 -8
  10. package/cjs/chart/base/base-chart.js.map +1 -1
  11. package/cjs/chart/base/util.d.ts +7 -0
  12. package/cjs/chart/base/util.js +26 -0
  13. package/cjs/chart/base/util.js.map +1 -0
  14. package/cjs/chart/circle-packing/circle-packing-transformer.js +1 -7
  15. package/cjs/chart/circle-packing/circle-packing-transformer.js.map +1 -1
  16. package/cjs/chart/correlation/correlation-transformer.js +1 -7
  17. package/cjs/chart/correlation/correlation-transformer.js.map +1 -1
  18. package/cjs/chart/histogram/base/histogram-base-transformer.js +2 -1
  19. package/cjs/chart/histogram/base/histogram-base-transformer.js.map +1 -1
  20. package/cjs/chart/index.d.ts +5 -3
  21. package/cjs/chart/index.js +16 -2
  22. package/cjs/chart/index.js.map +1 -1
  23. package/cjs/chart/interface/chart.d.ts +1 -0
  24. package/cjs/chart/interface/chart.js.map +1 -1
  25. package/cjs/chart/interface/common.d.ts +1 -4
  26. package/cjs/chart/interface/common.js.map +1 -1
  27. package/cjs/chart/interface/type.d.ts +2 -1
  28. package/cjs/chart/interface/type.js +1 -1
  29. package/cjs/chart/interface/type.js.map +1 -1
  30. package/cjs/chart/liquid/index.d.ts +2 -0
  31. package/cjs/chart/liquid/index.js +21 -0
  32. package/cjs/chart/liquid/index.js.map +1 -0
  33. package/cjs/chart/liquid/interface.d.ts +7 -0
  34. package/cjs/chart/liquid/interface.js.map +1 -0
  35. package/cjs/chart/liquid/liquid-transformer.d.ts +6 -0
  36. package/cjs/chart/liquid/liquid-transformer.js +29 -0
  37. package/cjs/chart/liquid/liquid-transformer.js.map +1 -0
  38. package/cjs/chart/liquid/liquid.d.ts +13 -0
  39. package/cjs/chart/liquid/liquid.js +25 -0
  40. package/cjs/chart/liquid/liquid.js.map +1 -0
  41. package/cjs/chart/polar/polar-transformer.js +1 -7
  42. package/cjs/chart/polar/polar-transformer.js.map +1 -1
  43. package/cjs/chart/sankey/sankey-transformer.js +1 -7
  44. package/cjs/chart/sankey/sankey-transformer.js.map +1 -1
  45. package/cjs/chart/sunburst/sunburst-transformer.js +1 -7
  46. package/cjs/chart/sunburst/sunburst-transformer.js.map +1 -1
  47. package/cjs/chart/treemap/treemap-transformer.js +1 -7
  48. package/cjs/chart/treemap/treemap-transformer.js.map +1 -1
  49. package/cjs/chart/word-cloud/base/word-cloud-base-transformer.js +1 -7
  50. package/cjs/chart/word-cloud/base/word-cloud-base-transformer.js.map +1 -1
  51. package/cjs/compile/compiler.d.ts +16 -5
  52. package/cjs/compile/compiler.js +38 -42
  53. package/cjs/compile/compiler.js.map +1 -1
  54. package/cjs/compile/data/compilable-data.d.ts +1 -1
  55. package/cjs/compile/data/compilable-data.js +1 -1
  56. package/cjs/compile/data/compilable-data.js.map +1 -1
  57. package/cjs/compile/data/interface.d.ts +1 -1
  58. package/cjs/compile/data/interface.js.map +1 -1
  59. package/cjs/compile/grammar-item.js +2 -1
  60. package/cjs/compile/mark/compilable-mark.d.ts +4 -2
  61. package/cjs/compile/mark/compilable-mark.js +4 -1
  62. package/cjs/compile/mark/compilable-mark.js.map +1 -1
  63. package/cjs/compile/mark/interface.d.ts +3 -2
  64. package/cjs/compile/mark/interface.js.map +1 -1
  65. package/cjs/compile/mark/mark-state-manager.d.ts +2 -2
  66. package/cjs/compile/mark/mark-state-manager.js +2 -2
  67. package/cjs/compile/mark/mark-state-manager.js.map +1 -1
  68. package/cjs/compile/signal/state-manager.d.ts +1 -1
  69. package/cjs/compile/signal/state-manager.js +2 -2
  70. package/cjs/compile/signal/state-manager.js.map +1 -1
  71. package/cjs/component/axis/base-axis.d.ts +8 -9
  72. package/cjs/component/axis/base-axis.js +22 -22
  73. package/cjs/component/axis/base-axis.js.map +1 -1
  74. package/cjs/component/axis/cartesian/axis.d.ts +5 -11
  75. package/cjs/component/axis/cartesian/axis.js +23 -30
  76. package/cjs/component/axis/cartesian/axis.js.map +1 -1
  77. package/cjs/component/axis/cartesian/band-axis.d.ts +1 -0
  78. package/cjs/component/axis/cartesian/band-axis.js +2 -1
  79. package/cjs/component/axis/cartesian/band-axis.js.map +1 -1
  80. package/cjs/component/axis/cartesian/interface/common.d.ts +3 -5
  81. package/cjs/component/axis/cartesian/interface/common.js.map +1 -1
  82. package/cjs/component/axis/cartesian/interface/spec.d.ts +4 -19
  83. package/cjs/component/axis/cartesian/interface/spec.js.map +1 -1
  84. package/cjs/component/axis/cartesian/time-axis.js +10 -17
  85. package/cjs/component/axis/cartesian/time-axis.js.map +1 -1
  86. package/cjs/component/axis/interface/common.d.ts +10 -0
  87. package/cjs/component/axis/interface/common.js.map +1 -1
  88. package/cjs/component/axis/interface/spec.d.ts +4 -7
  89. package/cjs/component/axis/interface/spec.js.map +1 -1
  90. package/cjs/component/axis/mixin/band-axis-mixin.d.ts +13 -1
  91. package/cjs/component/axis/mixin/band-axis-mixin.js +33 -1
  92. package/cjs/component/axis/mixin/band-axis-mixin.js.map +1 -1
  93. package/cjs/component/axis/polar/axis.d.ts +7 -3
  94. package/cjs/component/axis/polar/axis.js +50 -58
  95. package/cjs/component/axis/polar/axis.js.map +1 -1
  96. package/cjs/component/axis/polar/band-axis.d.ts +1 -0
  97. package/cjs/component/axis/util.d.ts +6 -0
  98. package/cjs/component/axis/util.js +11 -2
  99. package/cjs/component/axis/util.js.map +1 -1
  100. package/cjs/component/base/base-component.d.ts +0 -5
  101. package/cjs/component/base/base-component.js +0 -6
  102. package/cjs/component/base/base-component.js.map +1 -1
  103. package/cjs/component/brush/brush.js +1 -0
  104. package/cjs/component/brush/brush.js.map +1 -1
  105. package/cjs/component/crosshair/base.d.ts +10 -2
  106. package/cjs/component/crosshair/base.js +108 -83
  107. package/cjs/component/crosshair/base.js.map +1 -1
  108. package/cjs/component/crosshair/cartesian.d.ts +5 -0
  109. package/cjs/component/crosshair/cartesian.js +81 -71
  110. package/cjs/component/crosshair/cartesian.js.map +1 -1
  111. package/cjs/component/crosshair/config.d.ts +1 -2
  112. package/cjs/component/crosshair/config.js +1 -1
  113. package/cjs/component/crosshair/config.js.map +1 -1
  114. package/cjs/component/crosshair/interface/spec.d.ts +2 -1
  115. package/cjs/component/crosshair/interface/spec.js.map +1 -1
  116. package/cjs/component/crosshair/polar.js +2 -1
  117. package/cjs/component/crosshair/polar.js.map +1 -1
  118. package/cjs/component/custom-mark/custom-mark.js +1 -1
  119. package/cjs/component/custom-mark/custom-mark.js.map +1 -1
  120. package/cjs/component/data-zoom/data-zoom/data-zoom.js +2 -1
  121. package/cjs/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
  122. package/cjs/component/data-zoom/scroll-bar/scroll-bar.js +2 -1
  123. package/cjs/component/data-zoom/scroll-bar/scroll-bar.js.map +1 -1
  124. package/cjs/component/geo/geo-coordinate.js +1 -1
  125. package/cjs/component/geo/geo-coordinate.js.map +1 -1
  126. package/cjs/component/indicator/indicator.d.ts +2 -0
  127. package/cjs/component/indicator/indicator.js +21 -12
  128. package/cjs/component/indicator/indicator.js.map +1 -1
  129. package/cjs/component/indicator/interface.d.ts +1 -0
  130. package/cjs/component/indicator/interface.js.map +1 -1
  131. package/cjs/component/interface/common.d.ts +1 -0
  132. package/cjs/component/interface/common.js.map +1 -1
  133. package/cjs/component/label/base-label.d.ts +0 -3
  134. package/cjs/component/label/base-label.js +5 -8
  135. package/cjs/component/label/base-label.js.map +1 -1
  136. package/cjs/component/label/interface.d.ts +1 -0
  137. package/cjs/component/label/interface.js.map +1 -1
  138. package/cjs/component/label/label.js +5 -7
  139. package/cjs/component/label/label.js.map +1 -1
  140. package/cjs/component/label/total-label.js +4 -2
  141. package/cjs/component/label/total-label.js.map +1 -1
  142. package/cjs/component/legend/base-legend.d.ts +1 -1
  143. package/cjs/component/legend/continuous/legend.js +2 -2
  144. package/cjs/component/legend/continuous/legend.js.map +1 -1
  145. package/cjs/component/legend/discrete/legend.js +2 -2
  146. package/cjs/component/legend/discrete/legend.js.map +1 -1
  147. package/cjs/component/legend/util.d.ts +1 -1
  148. package/cjs/component/map-label/component.js +12 -12
  149. package/cjs/component/map-label/component.js.map +1 -1
  150. package/cjs/component/marker/mark-area/mark-area.js +2 -1
  151. package/cjs/component/marker/mark-area/mark-area.js.map +1 -1
  152. package/cjs/component/marker/mark-line/mark-line.js +2 -1
  153. package/cjs/component/marker/mark-line/mark-line.js.map +1 -1
  154. package/cjs/component/marker/mark-point/mark-point.js +2 -1
  155. package/cjs/component/marker/mark-point/mark-point.js.map +1 -1
  156. package/cjs/component/player/player.js +1 -0
  157. package/cjs/component/player/player.js.map +1 -1
  158. package/cjs/component/title/title.js +2 -1
  159. package/cjs/component/title/title.js.map +1 -1
  160. package/cjs/component/tooltip/processor/base.js +2 -1
  161. package/cjs/component/tooltip/processor/base.js.map +1 -1
  162. package/cjs/component/tooltip/tooltip.js +10 -6
  163. package/cjs/component/tooltip/tooltip.js.map +1 -1
  164. package/cjs/constant/base.js +1 -2
  165. package/cjs/constant/scroll-bar.js +2 -1
  166. package/cjs/core/expression-function.js +1 -2
  167. package/cjs/core/factory.d.ts +5 -0
  168. package/cjs/core/factory.js +10 -1
  169. package/cjs/core/factory.js.map +1 -1
  170. package/cjs/core/index.d.ts +1 -1
  171. package/cjs/core/index.js +1 -1
  172. package/cjs/core/index.js.map +1 -1
  173. package/cjs/core/vchart.d.ts +7 -3
  174. package/cjs/core/vchart.js +51 -71
  175. package/cjs/core/vchart.js.map +1 -1
  176. package/cjs/event/event-dispatcher.js +2 -1
  177. package/cjs/event/events/dimension/util/cartesian.d.ts +1 -1
  178. package/cjs/event/events/dimension/util/cartesian.js +28 -12
  179. package/cjs/event/events/dimension/util/cartesian.js.map +1 -1
  180. package/cjs/event/index.js +1 -2
  181. package/cjs/index-lark.js +2 -2
  182. package/cjs/index-lark.js.map +1 -1
  183. package/cjs/index-wx-simple.js +2 -2
  184. package/cjs/index-wx-simple.js.map +1 -1
  185. package/cjs/index-wx.js +2 -2
  186. package/cjs/index-wx.js.map +1 -1
  187. package/cjs/interaction/config.js +4 -4
  188. package/cjs/interaction/config.js.map +1 -1
  189. package/cjs/interaction/drill/drillable.js +1 -1
  190. package/cjs/interaction/drill/drillable.js.map +1 -1
  191. package/cjs/interaction/interface.d.ts +24 -2
  192. package/cjs/interaction/interface.js.map +1 -1
  193. package/cjs/layout/interface.d.ts +3 -0
  194. package/cjs/layout/interface.js.map +1 -1
  195. package/cjs/layout/layout-item.d.ts +2 -1
  196. package/cjs/layout/layout-item.js +2 -1
  197. package/cjs/layout/layout-item.js.map +1 -1
  198. package/cjs/layout/util.js +91 -77
  199. package/cjs/layout/util.js.map +1 -1
  200. package/cjs/mark/interface/type.d.ts +1 -0
  201. package/cjs/mark/interface/type.js +2 -1
  202. package/cjs/mark/interface/type.js.map +1 -1
  203. package/cjs/mark/liquid.d.ts +13 -0
  204. package/cjs/mark/liquid.js +32 -0
  205. package/cjs/mark/liquid.js.map +1 -0
  206. package/cjs/model/base-model.d.ts +1 -2
  207. package/cjs/model/base-model.js +11 -10
  208. package/cjs/model/base-model.js.map +1 -1
  209. package/cjs/model/interface.d.ts +3 -2
  210. package/cjs/model/interface.js.map +1 -1
  211. package/cjs/plugin/chart/media-query/util/filter.js +5 -8
  212. package/cjs/plugin/chart/media-query/util/filter.js.map +1 -1
  213. package/cjs/plugin/components/axis-sync/axis-sync.js.map +1 -0
  214. package/cjs/plugin/components/axis-sync/index.js.map +1 -0
  215. package/cjs/plugin/components/axis-sync/tick-align-transform.js.map +1 -0
  216. package/cjs/plugin/components/axis-sync/zero-align-transform.js.map +1 -0
  217. package/cjs/plugin/components/index.d.ts +1 -1
  218. package/cjs/plugin/components/index.js +2 -2
  219. package/cjs/plugin/components/index.js.map +1 -1
  220. package/cjs/plugin/components/register.d.ts +2 -0
  221. package/cjs/plugin/components/register.js +12 -0
  222. package/cjs/plugin/components/register.js.map +1 -0
  223. package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/base.d.ts +10 -9
  224. package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/base.js +29 -27
  225. package/cjs/plugin/components/tooltip-handler/base.js.map +1 -0
  226. package/{esm/component/tooltip/handler → cjs/plugin/components/tooltip-handler}/canvas/canvas-tooltip-handler.d.ts +7 -4
  227. package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/canvas/canvas-tooltip-handler.js +14 -6
  228. package/cjs/plugin/components/tooltip-handler/canvas/canvas-tooltip-handler.js.map +1 -0
  229. package/cjs/plugin/components/tooltip-handler/canvas/index.js.map +1 -0
  230. package/cjs/plugin/components/tooltip-handler/constants.js.map +1 -0
  231. package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/dom-tooltip-handler.d.ts +7 -4
  232. package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/dom-tooltip-handler.js +15 -7
  233. package/cjs/plugin/components/tooltip-handler/dom/dom-tooltip-handler.js.map +1 -0
  234. package/cjs/plugin/components/tooltip-handler/dom/index.js.map +1 -0
  235. package/cjs/plugin/components/tooltip-handler/dom/interface.js.map +1 -0
  236. package/cjs/plugin/components/tooltip-handler/dom/model/base-tooltip-model.js.map +1 -0
  237. package/cjs/plugin/components/tooltip-handler/dom/model/content-column-model.js.map +1 -0
  238. package/cjs/plugin/components/tooltip-handler/dom/model/content-model.js.map +1 -0
  239. package/cjs/plugin/components/tooltip-handler/dom/model/interface.js +6 -0
  240. package/cjs/plugin/components/tooltip-handler/dom/model/interface.js.map +1 -0
  241. package/cjs/plugin/components/tooltip-handler/dom/model/shape-model.js.map +1 -0
  242. package/cjs/plugin/components/tooltip-handler/dom/model/style-constants.js.map +1 -0
  243. package/cjs/plugin/components/tooltip-handler/dom/model/text-model.js.map +1 -0
  244. package/cjs/plugin/components/tooltip-handler/dom/model/title-model.js.map +1 -0
  245. package/cjs/plugin/components/tooltip-handler/dom/model/tooltip-model.js.map +1 -0
  246. package/cjs/plugin/components/tooltip-handler/dom/util.js.map +1 -0
  247. package/cjs/plugin/components/tooltip-handler/index.js.map +1 -0
  248. package/cjs/plugin/components/tooltip-handler/interface/common.d.ts +4 -0
  249. package/cjs/plugin/components/tooltip-handler/interface/common.js +6 -0
  250. package/cjs/plugin/components/tooltip-handler/interface/common.js.map +1 -0
  251. package/cjs/plugin/components/tooltip-handler/interface/index.d.ts +2 -0
  252. package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/interface/index.js +1 -1
  253. package/cjs/plugin/components/tooltip-handler/interface/index.js.map +1 -0
  254. package/cjs/plugin/components/tooltip-handler/interface/style.js.map +1 -0
  255. package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/utils/attribute.d.ts +1 -2
  256. package/cjs/plugin/components/tooltip-handler/utils/attribute.js.map +1 -0
  257. package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/utils/common.d.ts +1 -1
  258. package/cjs/plugin/components/tooltip-handler/utils/common.js.map +1 -0
  259. package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/utils/compose.d.ts +1 -2
  260. package/cjs/plugin/components/tooltip-handler/utils/compose.js +106 -0
  261. package/cjs/plugin/components/tooltip-handler/utils/compose.js.map +1 -0
  262. package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/utils/get-spec.d.ts +1 -1
  263. package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/utils/get-spec.js +6 -6
  264. package/cjs/plugin/components/tooltip-handler/utils/get-spec.js.map +1 -0
  265. package/cjs/plugin/components/tooltip-handler/utils/index.js.map +1 -0
  266. package/cjs/plugin/components/tooltip-handler/utils/pattern.js.map +1 -0
  267. package/cjs/plugin/components/tooltip-handler/utils/position.js.map +1 -0
  268. package/cjs/region/interface.d.ts +0 -3
  269. package/cjs/region/interface.js.map +1 -1
  270. package/cjs/region/region.js +1 -1
  271. package/cjs/region/region.js.map +1 -1
  272. package/cjs/series/area/area-transformer.js +4 -4
  273. package/cjs/series/area/area-transformer.js.map +1 -1
  274. package/cjs/series/area/area.js +5 -5
  275. package/cjs/series/area/area.js.map +1 -1
  276. package/cjs/series/bar/bar.d.ts +12 -3
  277. package/cjs/series/bar/bar.js +138 -59
  278. package/cjs/series/bar/bar.js.map +1 -1
  279. package/cjs/series/bar/interface.d.ts +5 -2
  280. package/cjs/series/bar/interface.js.map +1 -1
  281. package/cjs/series/base/base-series.d.ts +30 -5
  282. package/cjs/series/base/base-series.js +72 -21
  283. package/cjs/series/base/base-series.js.map +1 -1
  284. package/cjs/series/box-plot/box-plot.js +3 -5
  285. package/cjs/series/box-plot/box-plot.js.map +1 -1
  286. package/cjs/series/cartesian/cartesian.d.ts +6 -0
  287. package/cjs/series/cartesian/cartesian.js +27 -16
  288. package/cjs/series/cartesian/cartesian.js.map +1 -1
  289. package/cjs/series/circle-packing/circle-packing.js +2 -2
  290. package/cjs/series/circle-packing/circle-packing.js.map +1 -1
  291. package/cjs/series/correlation/correlation.js +8 -8
  292. package/cjs/series/correlation/correlation.js.map +1 -1
  293. package/cjs/series/dot/dot.js +12 -12
  294. package/cjs/series/dot/dot.js.map +1 -1
  295. package/cjs/series/funnel/funnel.js +13 -11
  296. package/cjs/series/funnel/funnel.js.map +1 -1
  297. package/cjs/series/gauge/gauge-pointer.d.ts +1 -0
  298. package/cjs/series/gauge/gauge-pointer.js +4 -1
  299. package/cjs/series/gauge/gauge-pointer.js.map +1 -1
  300. package/cjs/series/gauge/gauge.js +4 -4
  301. package/cjs/series/gauge/gauge.js.map +1 -1
  302. package/cjs/series/heatmap/heatmap.d.ts +1 -0
  303. package/cjs/series/heatmap/heatmap.js +9 -4
  304. package/cjs/series/heatmap/heatmap.js.map +1 -1
  305. package/cjs/series/interface/common.d.ts +1 -1
  306. package/cjs/series/interface/common.js.map +1 -1
  307. package/cjs/series/interface/series.d.ts +0 -2
  308. package/cjs/series/interface/series.js.map +1 -1
  309. package/cjs/series/interface/theme.d.ts +2 -0
  310. package/cjs/series/interface/theme.js +3 -2
  311. package/cjs/series/interface/theme.js.map +1 -1
  312. package/cjs/series/interface/type.d.ts +6 -2
  313. package/cjs/series/interface/type.js +4 -2
  314. package/cjs/series/interface/type.js.map +1 -1
  315. package/cjs/series/link/link.d.ts +1 -0
  316. package/cjs/series/link/link.js +9 -4
  317. package/cjs/series/link/link.js.map +1 -1
  318. package/cjs/series/liquid/animation.d.ts +14 -0
  319. package/cjs/series/liquid/animation.js +63 -0
  320. package/cjs/series/liquid/animation.js.map +1 -0
  321. package/cjs/series/liquid/constant.d.ts +2 -0
  322. package/cjs/series/liquid/constant.js +23 -0
  323. package/cjs/series/liquid/constant.js.map +1 -0
  324. package/cjs/series/liquid/interface.d.ts +35 -0
  325. package/cjs/series/liquid/interface.js +6 -0
  326. package/cjs/series/liquid/interface.js.map +1 -0
  327. package/cjs/series/liquid/liquid.d.ts +50 -0
  328. package/cjs/series/liquid/liquid.js +200 -0
  329. package/cjs/series/liquid/liquid.js.map +1 -0
  330. package/cjs/series/liquid/tooltip-helper.d.ts +9 -0
  331. package/cjs/series/liquid/tooltip-helper.js +37 -0
  332. package/cjs/series/liquid/tooltip-helper.js.map +1 -0
  333. package/cjs/series/liquid/util.d.ts +2 -0
  334. package/cjs/series/liquid/util.js +15 -0
  335. package/cjs/series/liquid/util.js.map +1 -0
  336. package/cjs/series/map/map.js +4 -4
  337. package/cjs/series/map/map.js.map +1 -1
  338. package/cjs/series/mixin/line-mixin.d.ts +0 -2
  339. package/cjs/series/mixin/line-mixin.js +11 -8
  340. package/cjs/series/mixin/line-mixin.js.map +1 -1
  341. package/cjs/series/pie/pie.d.ts +1 -0
  342. package/cjs/series/pie/pie.js +9 -5
  343. package/cjs/series/pie/pie.js.map +1 -1
  344. package/cjs/series/polar/polar.js +1 -1
  345. package/cjs/series/polar/polar.js.map +1 -1
  346. package/cjs/series/progress/circular/circular.d.ts +1 -0
  347. package/cjs/series/progress/circular/circular.js +15 -8
  348. package/cjs/series/progress/circular/circular.js.map +1 -1
  349. package/cjs/series/progress/linear/linear.d.ts +1 -0
  350. package/cjs/series/progress/linear/linear.js +56 -52
  351. package/cjs/series/progress/linear/linear.js.map +1 -1
  352. package/cjs/series/radar/radar.js +4 -3
  353. package/cjs/series/radar/radar.js.map +1 -1
  354. package/cjs/series/range-area/range-area.js +4 -3
  355. package/cjs/series/range-area/range-area.js.map +1 -1
  356. package/cjs/series/range-column/range-column.js +7 -6
  357. package/cjs/series/range-column/range-column.js.map +1 -1
  358. package/cjs/series/rose/rose.js +5 -4
  359. package/cjs/series/rose/rose.js.map +1 -1
  360. package/cjs/series/sankey/sankey.js +11 -10
  361. package/cjs/series/sankey/sankey.js.map +1 -1
  362. package/cjs/series/scatter/scatter.js +6 -6
  363. package/cjs/series/scatter/scatter.js.map +1 -1
  364. package/cjs/series/sunburst/sunburst.js +5 -4
  365. package/cjs/series/sunburst/sunburst.js.map +1 -1
  366. package/cjs/series/treemap/treemap.js +7 -5
  367. package/cjs/series/treemap/treemap.js.map +1 -1
  368. package/cjs/series/waterfall/waterfall.js +3 -2
  369. package/cjs/series/waterfall/waterfall.js.map +1 -1
  370. package/cjs/series/word-cloud/base.d.ts +5 -5
  371. package/cjs/series/word-cloud/base.js +40 -47
  372. package/cjs/series/word-cloud/base.js.map +1 -1
  373. package/cjs/series/word-cloud/word-cloud-3d.js +4 -25
  374. package/cjs/series/word-cloud/word-cloud-3d.js.map +1 -1
  375. package/cjs/theme/builtin/common/mark.js +2 -2
  376. package/cjs/theme/builtin/common/mark.js.map +1 -1
  377. package/cjs/theme/builtin/common/series/funnel.js +0 -2
  378. package/cjs/theme/builtin/common/series/funnel.js.map +1 -1
  379. package/cjs/theme/builtin/common/series/funnel3d.js +0 -2
  380. package/cjs/theme/builtin/common/series/funnel3d.js.map +1 -1
  381. package/cjs/theme/builtin/common/series/index.js +3 -2
  382. package/cjs/theme/builtin/common/series/index.js.map +1 -1
  383. package/cjs/theme/builtin/common/series/liquid.d.ts +2 -0
  384. package/cjs/theme/builtin/common/series/liquid.js +19 -0
  385. package/cjs/theme/builtin/common/series/liquid.js.map +1 -0
  386. package/cjs/theme/builtin/common/series/waterfall.js +1 -2
  387. package/cjs/theme/builtin/common/series/waterfall.js.map +1 -1
  388. package/cjs/typings/layout.d.ts +1 -0
  389. package/cjs/typings/layout.js.map +1 -1
  390. package/cjs/typings/spec/common.d.ts +3 -2
  391. package/cjs/typings/spec/common.js.map +1 -1
  392. package/cjs/typings/tooltip/line.d.ts +4 -0
  393. package/cjs/typings/tooltip/line.js.map +1 -1
  394. package/cjs/typings/visual.d.ts +6 -0
  395. package/cjs/typings/visual.js.map +1 -1
  396. package/cjs/util/model.js.map +1 -1
  397. package/cjs/vchart-all.js +2 -2
  398. package/cjs/vchart-all.js.map +1 -1
  399. package/cjs/vchart-simple.js +2 -2
  400. package/cjs/vchart-simple.js.map +1 -1
  401. package/esm/chart/base/base-chart-transformer.d.ts +1 -0
  402. package/esm/chart/base/base-chart-transformer.js +46 -18
  403. package/esm/chart/base/base-chart-transformer.js.map +1 -1
  404. package/esm/chart/base/base-chart.d.ts +1 -0
  405. package/esm/chart/base/base-chart.js +10 -8
  406. package/esm/chart/base/base-chart.js.map +1 -1
  407. package/esm/chart/base/util.d.ts +7 -0
  408. package/esm/chart/base/util.js +16 -0
  409. package/esm/chart/base/util.js.map +1 -0
  410. package/esm/chart/circle-packing/circle-packing-transformer.js +1 -7
  411. package/esm/chart/circle-packing/circle-packing-transformer.js.map +1 -1
  412. package/esm/chart/correlation/correlation-transformer.js +1 -7
  413. package/esm/chart/correlation/correlation-transformer.js.map +1 -1
  414. package/esm/chart/histogram/base/histogram-base-transformer.js +2 -1
  415. package/esm/chart/histogram/base/histogram-base-transformer.js.map +1 -1
  416. package/esm/chart/index.d.ts +5 -3
  417. package/esm/chart/index.js +4 -2
  418. package/esm/chart/index.js.map +1 -1
  419. package/esm/chart/interface/chart.d.ts +1 -0
  420. package/esm/chart/interface/chart.js.map +1 -1
  421. package/esm/chart/interface/common.d.ts +1 -4
  422. package/esm/chart/interface/common.js.map +1 -1
  423. package/esm/chart/interface/type.d.ts +2 -1
  424. package/esm/chart/interface/type.js +1 -1
  425. package/esm/chart/interface/type.js.map +1 -1
  426. package/esm/chart/liquid/index.d.ts +2 -0
  427. package/esm/chart/liquid/index.js +4 -0
  428. package/esm/chart/liquid/index.js.map +1 -0
  429. package/esm/chart/liquid/interface.d.ts +7 -0
  430. package/esm/chart/liquid/interface.js.map +1 -0
  431. package/esm/chart/liquid/liquid-transformer.d.ts +6 -0
  432. package/esm/chart/liquid/liquid-transformer.js +23 -0
  433. package/esm/chart/liquid/liquid-transformer.js.map +1 -0
  434. package/esm/chart/liquid/liquid.d.ts +13 -0
  435. package/esm/chart/liquid/liquid.js +26 -0
  436. package/esm/chart/liquid/liquid.js.map +1 -0
  437. package/esm/chart/polar/polar-transformer.js +1 -7
  438. package/esm/chart/polar/polar-transformer.js.map +1 -1
  439. package/esm/chart/sankey/sankey-transformer.js +1 -7
  440. package/esm/chart/sankey/sankey-transformer.js.map +1 -1
  441. package/esm/chart/sunburst/sunburst-transformer.js +1 -7
  442. package/esm/chart/sunburst/sunburst-transformer.js.map +1 -1
  443. package/esm/chart/treemap/treemap-transformer.js +1 -7
  444. package/esm/chart/treemap/treemap-transformer.js.map +1 -1
  445. package/esm/chart/word-cloud/base/word-cloud-base-transformer.js +1 -7
  446. package/esm/chart/word-cloud/base/word-cloud-base-transformer.js.map +1 -1
  447. package/esm/compile/compiler.d.ts +16 -5
  448. package/esm/compile/compiler.js +39 -41
  449. package/esm/compile/compiler.js.map +1 -1
  450. package/esm/compile/data/compilable-data.d.ts +1 -1
  451. package/esm/compile/data/compilable-data.js +1 -1
  452. package/esm/compile/data/compilable-data.js.map +1 -1
  453. package/esm/compile/data/interface.d.ts +1 -1
  454. package/esm/compile/data/interface.js.map +1 -1
  455. package/esm/compile/grammar-item.js +2 -1
  456. package/esm/compile/mark/compilable-mark.d.ts +4 -2
  457. package/esm/compile/mark/compilable-mark.js +4 -1
  458. package/esm/compile/mark/compilable-mark.js.map +1 -1
  459. package/esm/compile/mark/interface.d.ts +3 -2
  460. package/esm/compile/mark/interface.js.map +1 -1
  461. package/esm/compile/mark/mark-state-manager.d.ts +2 -2
  462. package/esm/compile/mark/mark-state-manager.js +2 -2
  463. package/esm/compile/mark/mark-state-manager.js.map +1 -1
  464. package/esm/compile/signal/state-manager.d.ts +1 -1
  465. package/esm/compile/signal/state-manager.js +1 -1
  466. package/esm/compile/signal/state-manager.js.map +1 -1
  467. package/esm/component/axis/base-axis.d.ts +8 -9
  468. package/esm/component/axis/base-axis.js +23 -21
  469. package/esm/component/axis/base-axis.js.map +1 -1
  470. package/esm/component/axis/cartesian/axis.d.ts +5 -11
  471. package/esm/component/axis/cartesian/axis.js +23 -32
  472. package/esm/component/axis/cartesian/axis.js.map +1 -1
  473. package/esm/component/axis/cartesian/band-axis.d.ts +1 -0
  474. package/esm/component/axis/cartesian/band-axis.js +2 -1
  475. package/esm/component/axis/cartesian/band-axis.js.map +1 -1
  476. package/esm/component/axis/cartesian/interface/common.d.ts +3 -5
  477. package/esm/component/axis/cartesian/interface/common.js.map +1 -1
  478. package/esm/component/axis/cartesian/interface/spec.d.ts +4 -19
  479. package/esm/component/axis/cartesian/interface/spec.js.map +1 -1
  480. package/esm/component/axis/cartesian/time-axis.js +9 -18
  481. package/esm/component/axis/cartesian/time-axis.js.map +1 -1
  482. package/esm/component/axis/interface/common.d.ts +10 -0
  483. package/esm/component/axis/interface/common.js.map +1 -1
  484. package/esm/component/axis/interface/spec.d.ts +4 -7
  485. package/esm/component/axis/interface/spec.js.map +1 -1
  486. package/esm/component/axis/mixin/band-axis-mixin.d.ts +13 -1
  487. package/esm/component/axis/mixin/band-axis-mixin.js +37 -1
  488. package/esm/component/axis/mixin/band-axis-mixin.js.map +1 -1
  489. package/esm/component/axis/polar/axis.d.ts +7 -3
  490. package/esm/component/axis/polar/axis.js +48 -56
  491. package/esm/component/axis/polar/axis.js.map +1 -1
  492. package/esm/component/axis/polar/band-axis.d.ts +1 -0
  493. package/esm/component/axis/util.d.ts +6 -0
  494. package/esm/component/axis/util.js +9 -0
  495. package/esm/component/axis/util.js.map +1 -1
  496. package/esm/component/base/base-component.d.ts +0 -5
  497. package/esm/component/base/base-component.js +0 -6
  498. package/esm/component/base/base-component.js.map +1 -1
  499. package/esm/component/brush/brush.js +1 -0
  500. package/esm/component/brush/brush.js.map +1 -1
  501. package/esm/component/crosshair/base.d.ts +10 -2
  502. package/esm/component/crosshair/base.js +108 -82
  503. package/esm/component/crosshair/base.js.map +1 -1
  504. package/esm/component/crosshair/cartesian.d.ts +5 -0
  505. package/esm/component/crosshair/cartesian.js +79 -71
  506. package/esm/component/crosshair/cartesian.js.map +1 -1
  507. package/esm/component/crosshair/config.d.ts +1 -2
  508. package/esm/component/crosshair/config.js +1 -1
  509. package/esm/component/crosshair/config.js.map +1 -1
  510. package/esm/component/crosshair/interface/spec.d.ts +2 -1
  511. package/esm/component/crosshair/interface/spec.js.map +1 -1
  512. package/esm/component/crosshair/polar.js +2 -1
  513. package/esm/component/crosshair/polar.js.map +1 -1
  514. package/esm/component/custom-mark/custom-mark.js +1 -1
  515. package/esm/component/custom-mark/custom-mark.js.map +1 -1
  516. package/esm/component/data-zoom/data-zoom/data-zoom.js +2 -1
  517. package/esm/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
  518. package/esm/component/data-zoom/scroll-bar/scroll-bar.js +2 -1
  519. package/esm/component/data-zoom/scroll-bar/scroll-bar.js.map +1 -1
  520. package/esm/component/geo/geo-coordinate.js +1 -1
  521. package/esm/component/geo/geo-coordinate.js.map +1 -1
  522. package/esm/component/indicator/indicator.d.ts +2 -0
  523. package/esm/component/indicator/indicator.js +20 -13
  524. package/esm/component/indicator/indicator.js.map +1 -1
  525. package/esm/component/indicator/interface.d.ts +1 -0
  526. package/esm/component/indicator/interface.js.map +1 -1
  527. package/esm/component/interface/common.d.ts +1 -0
  528. package/esm/component/interface/common.js.map +1 -1
  529. package/esm/component/label/base-label.d.ts +0 -3
  530. package/esm/component/label/base-label.js +5 -8
  531. package/esm/component/label/base-label.js.map +1 -1
  532. package/esm/component/label/interface.d.ts +1 -0
  533. package/esm/component/label/interface.js.map +1 -1
  534. package/esm/component/label/label.js +5 -7
  535. package/esm/component/label/label.js.map +1 -1
  536. package/esm/component/label/total-label.js +4 -2
  537. package/esm/component/label/total-label.js.map +1 -1
  538. package/esm/component/legend/base-legend.d.ts +1 -1
  539. package/esm/component/legend/continuous/legend.js +2 -2
  540. package/esm/component/legend/continuous/legend.js.map +1 -1
  541. package/esm/component/legend/discrete/legend.js +2 -2
  542. package/esm/component/legend/discrete/legend.js.map +1 -1
  543. package/esm/component/legend/util.d.ts +1 -1
  544. package/esm/component/map-label/component.js +12 -12
  545. package/esm/component/map-label/component.js.map +1 -1
  546. package/esm/component/marker/mark-area/mark-area.js +2 -1
  547. package/esm/component/marker/mark-area/mark-area.js.map +1 -1
  548. package/esm/component/marker/mark-line/mark-line.js +2 -1
  549. package/esm/component/marker/mark-line/mark-line.js.map +1 -1
  550. package/esm/component/marker/mark-point/mark-point.js +2 -1
  551. package/esm/component/marker/mark-point/mark-point.js.map +1 -1
  552. package/esm/component/player/player.js +1 -0
  553. package/esm/component/player/player.js.map +1 -1
  554. package/esm/component/title/title.js +2 -1
  555. package/esm/component/title/title.js.map +1 -1
  556. package/esm/component/tooltip/processor/base.js +2 -1
  557. package/esm/component/tooltip/processor/base.js.map +1 -1
  558. package/esm/component/tooltip/tooltip.js +12 -10
  559. package/esm/component/tooltip/tooltip.js.map +1 -1
  560. package/esm/constant/base.js +1 -2
  561. package/esm/constant/scroll-bar.js +2 -1
  562. package/esm/core/expression-function.js +1 -2
  563. package/esm/core/factory.d.ts +5 -0
  564. package/esm/core/factory.js +10 -1
  565. package/esm/core/factory.js.map +1 -1
  566. package/esm/core/index.d.ts +1 -1
  567. package/esm/core/index.js +1 -1
  568. package/esm/core/index.js.map +1 -1
  569. package/esm/core/vchart.d.ts +7 -3
  570. package/esm/core/vchart.js +51 -70
  571. package/esm/core/vchart.js.map +1 -1
  572. package/esm/event/event-dispatcher.js +2 -1
  573. package/esm/event/events/dimension/util/cartesian.d.ts +1 -1
  574. package/esm/event/events/dimension/util/cartesian.js +28 -13
  575. package/esm/event/events/dimension/util/cartesian.js.map +1 -1
  576. package/esm/event/index.js +1 -2
  577. package/esm/index-lark.js +7 -1
  578. package/esm/index-lark.js.map +1 -1
  579. package/esm/index-wx-simple.js +5 -1
  580. package/esm/index-wx-simple.js.map +1 -1
  581. package/esm/index-wx.js +7 -1
  582. package/esm/index-wx.js.map +1 -1
  583. package/esm/interaction/config.js +4 -4
  584. package/esm/interaction/config.js.map +1 -1
  585. package/esm/interaction/drill/drillable.js +1 -1
  586. package/esm/interaction/drill/drillable.js.map +1 -1
  587. package/esm/interaction/interface.d.ts +24 -2
  588. package/esm/interaction/interface.js.map +1 -1
  589. package/esm/layout/interface.d.ts +3 -0
  590. package/esm/layout/interface.js.map +1 -1
  591. package/esm/layout/layout-item.d.ts +2 -1
  592. package/esm/layout/layout-item.js +2 -1
  593. package/esm/layout/layout-item.js.map +1 -1
  594. package/esm/layout/util.js +91 -77
  595. package/esm/layout/util.js.map +1 -1
  596. package/esm/mark/interface/type.d.ts +1 -0
  597. package/esm/mark/interface/type.js +2 -1
  598. package/esm/mark/interface/type.js.map +1 -1
  599. package/esm/mark/liquid.d.ts +13 -0
  600. package/esm/mark/liquid.js +32 -0
  601. package/esm/mark/liquid.js.map +1 -0
  602. package/esm/model/base-model.d.ts +1 -2
  603. package/esm/model/base-model.js +11 -8
  604. package/esm/model/base-model.js.map +1 -1
  605. package/esm/model/interface.d.ts +3 -2
  606. package/esm/model/interface.js.map +1 -1
  607. package/esm/plugin/chart/media-query/util/filter.js +5 -8
  608. package/esm/plugin/chart/media-query/util/filter.js.map +1 -1
  609. package/esm/plugin/components/axis-sync/axis-sync.js.map +1 -0
  610. package/esm/plugin/components/axis-sync/index.js.map +1 -0
  611. package/esm/plugin/components/axis-sync/tick-align-transform.js.map +1 -0
  612. package/esm/plugin/components/axis-sync/zero-align-transform.js.map +1 -0
  613. package/esm/plugin/components/index.d.ts +1 -1
  614. package/esm/plugin/components/index.js +1 -1
  615. package/esm/plugin/components/index.js.map +1 -1
  616. package/esm/plugin/components/register.d.ts +2 -0
  617. package/esm/plugin/components/register.js +6 -0
  618. package/esm/plugin/components/register.js.map +1 -0
  619. package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/base.d.ts +10 -9
  620. package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/base.js +19 -13
  621. package/esm/plugin/components/tooltip-handler/base.js.map +1 -0
  622. package/{cjs/component/tooltip/handler → esm/plugin/components/tooltip-handler}/canvas/canvas-tooltip-handler.d.ts +7 -4
  623. package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/canvas/canvas-tooltip-handler.js +13 -2
  624. package/esm/plugin/components/tooltip-handler/canvas/canvas-tooltip-handler.js.map +1 -0
  625. package/esm/plugin/components/tooltip-handler/canvas/index.js.map +1 -0
  626. package/esm/plugin/components/tooltip-handler/constants.js.map +1 -0
  627. package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/dom-tooltip-handler.d.ts +7 -4
  628. package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/dom-tooltip-handler.js +14 -4
  629. package/esm/plugin/components/tooltip-handler/dom/dom-tooltip-handler.js.map +1 -0
  630. package/esm/plugin/components/tooltip-handler/dom/index.js.map +1 -0
  631. package/esm/plugin/components/tooltip-handler/dom/interface.js.map +1 -0
  632. package/esm/plugin/components/tooltip-handler/dom/model/base-tooltip-model.js.map +1 -0
  633. package/esm/plugin/components/tooltip-handler/dom/model/content-column-model.js.map +1 -0
  634. package/esm/plugin/components/tooltip-handler/dom/model/content-model.js.map +1 -0
  635. package/esm/plugin/components/tooltip-handler/dom/model/interface.js +2 -0
  636. package/esm/plugin/components/tooltip-handler/dom/model/interface.js.map +1 -0
  637. package/esm/plugin/components/tooltip-handler/dom/model/shape-model.js.map +1 -0
  638. package/esm/plugin/components/tooltip-handler/dom/model/style-constants.js.map +1 -0
  639. package/esm/plugin/components/tooltip-handler/dom/model/text-model.js.map +1 -0
  640. package/esm/plugin/components/tooltip-handler/dom/model/title-model.js.map +1 -0
  641. package/esm/plugin/components/tooltip-handler/dom/model/tooltip-model.js.map +1 -0
  642. package/esm/plugin/components/tooltip-handler/dom/util.js.map +1 -0
  643. package/esm/plugin/components/tooltip-handler/index.js.map +1 -0
  644. package/esm/plugin/components/tooltip-handler/interface/common.d.ts +4 -0
  645. package/esm/plugin/components/tooltip-handler/interface/common.js +2 -0
  646. package/esm/plugin/components/tooltip-handler/interface/common.js.map +1 -0
  647. package/esm/plugin/components/tooltip-handler/interface/index.d.ts +2 -0
  648. package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/interface/index.js +2 -0
  649. package/esm/plugin/components/tooltip-handler/interface/index.js.map +1 -0
  650. package/esm/plugin/components/tooltip-handler/interface/style.js.map +1 -0
  651. package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/utils/attribute.d.ts +1 -2
  652. package/esm/plugin/components/tooltip-handler/utils/attribute.js.map +1 -0
  653. package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/utils/common.d.ts +1 -1
  654. package/esm/plugin/components/tooltip-handler/utils/common.js.map +1 -0
  655. package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/utils/compose.d.ts +1 -2
  656. package/esm/plugin/components/tooltip-handler/utils/compose.js +94 -0
  657. package/esm/plugin/components/tooltip-handler/utils/compose.js.map +1 -0
  658. package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/utils/get-spec.d.ts +1 -1
  659. package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/utils/get-spec.js +2 -2
  660. package/esm/plugin/components/tooltip-handler/utils/get-spec.js.map +1 -0
  661. package/esm/plugin/components/tooltip-handler/utils/index.js.map +1 -0
  662. package/esm/plugin/components/tooltip-handler/utils/pattern.js.map +1 -0
  663. package/esm/plugin/components/tooltip-handler/utils/position.js.map +1 -0
  664. package/esm/region/interface.d.ts +0 -3
  665. package/esm/region/interface.js.map +1 -1
  666. package/esm/region/region.js +1 -1
  667. package/esm/region/region.js.map +1 -1
  668. package/esm/series/area/area-transformer.js +3 -2
  669. package/esm/series/area/area-transformer.js.map +1 -1
  670. package/esm/series/area/area.js +5 -4
  671. package/esm/series/area/area.js.map +1 -1
  672. package/esm/series/bar/bar.d.ts +12 -3
  673. package/esm/series/bar/bar.js +136 -57
  674. package/esm/series/bar/bar.js.map +1 -1
  675. package/esm/series/bar/interface.d.ts +5 -2
  676. package/esm/series/bar/interface.js.map +1 -1
  677. package/esm/series/base/base-series.d.ts +30 -5
  678. package/esm/series/base/base-series.js +75 -22
  679. package/esm/series/base/base-series.js.map +1 -1
  680. package/esm/series/box-plot/box-plot.js +3 -4
  681. package/esm/series/box-plot/box-plot.js.map +1 -1
  682. package/esm/series/cartesian/cartesian.d.ts +6 -0
  683. package/esm/series/cartesian/cartesian.js +27 -16
  684. package/esm/series/cartesian/cartesian.js.map +1 -1
  685. package/esm/series/circle-packing/circle-packing.js +2 -2
  686. package/esm/series/circle-packing/circle-packing.js.map +1 -1
  687. package/esm/series/correlation/correlation.js +8 -6
  688. package/esm/series/correlation/correlation.js.map +1 -1
  689. package/esm/series/dot/dot.js +12 -12
  690. package/esm/series/dot/dot.js.map +1 -1
  691. package/esm/series/funnel/funnel.js +13 -11
  692. package/esm/series/funnel/funnel.js.map +1 -1
  693. package/esm/series/gauge/gauge-pointer.d.ts +1 -0
  694. package/esm/series/gauge/gauge-pointer.js +4 -1
  695. package/esm/series/gauge/gauge-pointer.js.map +1 -1
  696. package/esm/series/gauge/gauge.js +4 -4
  697. package/esm/series/gauge/gauge.js.map +1 -1
  698. package/esm/series/heatmap/heatmap.d.ts +1 -0
  699. package/esm/series/heatmap/heatmap.js +9 -4
  700. package/esm/series/heatmap/heatmap.js.map +1 -1
  701. package/esm/series/interface/common.d.ts +1 -1
  702. package/esm/series/interface/common.js.map +1 -1
  703. package/esm/series/interface/series.d.ts +0 -2
  704. package/esm/series/interface/series.js.map +1 -1
  705. package/esm/series/interface/theme.d.ts +2 -0
  706. package/esm/series/interface/theme.js +4 -1
  707. package/esm/series/interface/theme.js.map +1 -1
  708. package/esm/series/interface/type.d.ts +6 -2
  709. package/esm/series/interface/type.js +4 -2
  710. package/esm/series/interface/type.js.map +1 -1
  711. package/esm/series/link/link.d.ts +1 -0
  712. package/esm/series/link/link.js +9 -4
  713. package/esm/series/link/link.js.map +1 -1
  714. package/esm/series/liquid/animation.d.ts +14 -0
  715. package/esm/series/liquid/animation.js +55 -0
  716. package/esm/series/liquid/animation.js.map +1 -0
  717. package/esm/series/liquid/constant.d.ts +2 -0
  718. package/esm/series/liquid/constant.js +21 -0
  719. package/esm/series/liquid/constant.js.map +1 -0
  720. package/esm/series/liquid/interface.d.ts +35 -0
  721. package/esm/series/liquid/interface.js +2 -0
  722. package/esm/series/liquid/interface.js.map +1 -0
  723. package/esm/series/liquid/liquid.d.ts +50 -0
  724. package/esm/series/liquid/liquid.js +218 -0
  725. package/esm/series/liquid/liquid.js.map +1 -0
  726. package/esm/series/liquid/tooltip-helper.d.ts +9 -0
  727. package/esm/series/liquid/tooltip-helper.js +29 -0
  728. package/esm/series/liquid/tooltip-helper.js.map +1 -0
  729. package/esm/series/liquid/util.d.ts +2 -0
  730. package/esm/series/liquid/util.js +7 -0
  731. package/esm/series/liquid/util.js.map +1 -0
  732. package/esm/series/map/map.js +4 -4
  733. package/esm/series/map/map.js.map +1 -1
  734. package/esm/series/mixin/line-mixin.d.ts +0 -2
  735. package/esm/series/mixin/line-mixin.js +11 -8
  736. package/esm/series/mixin/line-mixin.js.map +1 -1
  737. package/esm/series/pie/pie.d.ts +1 -0
  738. package/esm/series/pie/pie.js +9 -5
  739. package/esm/series/pie/pie.js.map +1 -1
  740. package/esm/series/polar/polar.js +1 -1
  741. package/esm/series/polar/polar.js.map +1 -1
  742. package/esm/series/progress/circular/circular.d.ts +1 -0
  743. package/esm/series/progress/circular/circular.js +15 -8
  744. package/esm/series/progress/circular/circular.js.map +1 -1
  745. package/esm/series/progress/linear/linear.d.ts +1 -0
  746. package/esm/series/progress/linear/linear.js +56 -52
  747. package/esm/series/progress/linear/linear.js.map +1 -1
  748. package/esm/series/radar/radar.js +4 -3
  749. package/esm/series/radar/radar.js.map +1 -1
  750. package/esm/series/range-area/range-area.js +4 -3
  751. package/esm/series/range-area/range-area.js.map +1 -1
  752. package/esm/series/range-column/range-column.js +7 -6
  753. package/esm/series/range-column/range-column.js.map +1 -1
  754. package/esm/series/rose/rose.js +5 -4
  755. package/esm/series/rose/rose.js.map +1 -1
  756. package/esm/series/sankey/sankey.js +11 -10
  757. package/esm/series/sankey/sankey.js.map +1 -1
  758. package/esm/series/scatter/scatter.js +6 -5
  759. package/esm/series/scatter/scatter.js.map +1 -1
  760. package/esm/series/sunburst/sunburst.js +5 -4
  761. package/esm/series/sunburst/sunburst.js.map +1 -1
  762. package/esm/series/treemap/treemap.js +7 -5
  763. package/esm/series/treemap/treemap.js.map +1 -1
  764. package/esm/series/waterfall/waterfall.js +3 -2
  765. package/esm/series/waterfall/waterfall.js.map +1 -1
  766. package/esm/series/word-cloud/base.d.ts +5 -5
  767. package/esm/series/word-cloud/base.js +39 -45
  768. package/esm/series/word-cloud/base.js.map +1 -1
  769. package/esm/series/word-cloud/word-cloud-3d.js +4 -25
  770. package/esm/series/word-cloud/word-cloud-3d.js.map +1 -1
  771. package/esm/theme/builtin/common/mark.js +2 -2
  772. package/esm/theme/builtin/common/mark.js.map +1 -1
  773. package/esm/theme/builtin/common/series/funnel.js +0 -2
  774. package/esm/theme/builtin/common/series/funnel.js.map +1 -1
  775. package/esm/theme/builtin/common/series/funnel3d.js +0 -2
  776. package/esm/theme/builtin/common/series/funnel3d.js.map +1 -1
  777. package/esm/theme/builtin/common/series/index.js +4 -1
  778. package/esm/theme/builtin/common/series/index.js.map +1 -1
  779. package/esm/theme/builtin/common/series/liquid.d.ts +2 -0
  780. package/esm/theme/builtin/common/series/liquid.js +15 -0
  781. package/esm/theme/builtin/common/series/liquid.js.map +1 -0
  782. package/esm/theme/builtin/common/series/waterfall.js +1 -2
  783. package/esm/theme/builtin/common/series/waterfall.js.map +1 -1
  784. package/esm/typings/layout.d.ts +1 -0
  785. package/esm/typings/layout.js.map +1 -1
  786. package/esm/typings/spec/common.d.ts +3 -2
  787. package/esm/typings/spec/common.js.map +1 -1
  788. package/esm/typings/tooltip/line.d.ts +4 -0
  789. package/esm/typings/tooltip/line.js.map +1 -1
  790. package/esm/typings/visual.d.ts +6 -0
  791. package/esm/typings/visual.js.map +1 -1
  792. package/esm/util/model.js.map +1 -1
  793. package/esm/vchart-all.js +7 -1
  794. package/esm/vchart-all.js.map +1 -1
  795. package/esm/vchart-simple.js +5 -1
  796. package/esm/vchart-simple.js.map +1 -1
  797. package/package.json +10 -10
  798. package/cjs/component/tooltip/handler/base.js.map +0 -1
  799. package/cjs/component/tooltip/handler/canvas/canvas-tooltip-handler.js.map +0 -1
  800. package/cjs/component/tooltip/handler/canvas/index.js.map +0 -1
  801. package/cjs/component/tooltip/handler/constants.js.map +0 -1
  802. package/cjs/component/tooltip/handler/dom/dom-tooltip-handler.js.map +0 -1
  803. package/cjs/component/tooltip/handler/dom/index.js.map +0 -1
  804. package/cjs/component/tooltip/handler/dom/interface.js.map +0 -1
  805. package/cjs/component/tooltip/handler/dom/model/base-tooltip-model.js.map +0 -1
  806. package/cjs/component/tooltip/handler/dom/model/content-column-model.js.map +0 -1
  807. package/cjs/component/tooltip/handler/dom/model/content-model.js.map +0 -1
  808. package/cjs/component/tooltip/handler/dom/model/interface.js.map +0 -1
  809. package/cjs/component/tooltip/handler/dom/model/shape-model.js.map +0 -1
  810. package/cjs/component/tooltip/handler/dom/model/style-constants.js.map +0 -1
  811. package/cjs/component/tooltip/handler/dom/model/text-model.js.map +0 -1
  812. package/cjs/component/tooltip/handler/dom/model/title-model.js.map +0 -1
  813. package/cjs/component/tooltip/handler/dom/model/tooltip-model.js.map +0 -1
  814. package/cjs/component/tooltip/handler/dom/util.js.map +0 -1
  815. package/cjs/component/tooltip/handler/index.js.map +0 -1
  816. package/cjs/component/tooltip/handler/interface/index.d.ts +0 -1
  817. package/cjs/component/tooltip/handler/interface/index.js.map +0 -1
  818. package/cjs/component/tooltip/handler/interface/style.js.map +0 -1
  819. package/cjs/component/tooltip/handler/utils/attribute.js.map +0 -1
  820. package/cjs/component/tooltip/handler/utils/common.js.map +0 -1
  821. package/cjs/component/tooltip/handler/utils/compose.js +0 -106
  822. package/cjs/component/tooltip/handler/utils/compose.js.map +0 -1
  823. package/cjs/component/tooltip/handler/utils/get-spec.js.map +0 -1
  824. package/cjs/component/tooltip/handler/utils/index.js.map +0 -1
  825. package/cjs/component/tooltip/handler/utils/pattern.js.map +0 -1
  826. package/cjs/component/tooltip/handler/utils/position.js.map +0 -1
  827. package/cjs/interaction/trigger.d.ts +0 -39
  828. package/cjs/interaction/trigger.js +0 -141
  829. package/cjs/interaction/trigger.js.map +0 -1
  830. package/cjs/plugin/components/axis-sync-plugin/axis-sync.js.map +0 -1
  831. package/cjs/plugin/components/axis-sync-plugin/index.js.map +0 -1
  832. package/cjs/plugin/components/axis-sync-plugin/tick-align-transform.js.map +0 -1
  833. package/cjs/plugin/components/axis-sync-plugin/zero-align-transform.js.map +0 -1
  834. package/esm/component/tooltip/handler/base.js.map +0 -1
  835. package/esm/component/tooltip/handler/canvas/canvas-tooltip-handler.js.map +0 -1
  836. package/esm/component/tooltip/handler/canvas/index.js.map +0 -1
  837. package/esm/component/tooltip/handler/constants.js.map +0 -1
  838. package/esm/component/tooltip/handler/dom/dom-tooltip-handler.js.map +0 -1
  839. package/esm/component/tooltip/handler/dom/index.js.map +0 -1
  840. package/esm/component/tooltip/handler/dom/interface.js.map +0 -1
  841. package/esm/component/tooltip/handler/dom/model/base-tooltip-model.js.map +0 -1
  842. package/esm/component/tooltip/handler/dom/model/content-column-model.js.map +0 -1
  843. package/esm/component/tooltip/handler/dom/model/content-model.js.map +0 -1
  844. package/esm/component/tooltip/handler/dom/model/interface.js.map +0 -1
  845. package/esm/component/tooltip/handler/dom/model/shape-model.js.map +0 -1
  846. package/esm/component/tooltip/handler/dom/model/style-constants.js.map +0 -1
  847. package/esm/component/tooltip/handler/dom/model/text-model.js.map +0 -1
  848. package/esm/component/tooltip/handler/dom/model/title-model.js.map +0 -1
  849. package/esm/component/tooltip/handler/dom/model/tooltip-model.js.map +0 -1
  850. package/esm/component/tooltip/handler/dom/util.js.map +0 -1
  851. package/esm/component/tooltip/handler/index.js.map +0 -1
  852. package/esm/component/tooltip/handler/interface/index.d.ts +0 -1
  853. package/esm/component/tooltip/handler/interface/index.js.map +0 -1
  854. package/esm/component/tooltip/handler/interface/style.js.map +0 -1
  855. package/esm/component/tooltip/handler/utils/attribute.js.map +0 -1
  856. package/esm/component/tooltip/handler/utils/common.js.map +0 -1
  857. package/esm/component/tooltip/handler/utils/compose.js +0 -89
  858. package/esm/component/tooltip/handler/utils/compose.js.map +0 -1
  859. package/esm/component/tooltip/handler/utils/get-spec.js.map +0 -1
  860. package/esm/component/tooltip/handler/utils/index.js.map +0 -1
  861. package/esm/component/tooltip/handler/utils/pattern.js.map +0 -1
  862. package/esm/component/tooltip/handler/utils/position.js.map +0 -1
  863. package/esm/interaction/trigger.d.ts +0 -39
  864. package/esm/interaction/trigger.js +0 -142
  865. package/esm/interaction/trigger.js.map +0 -1
  866. package/esm/plugin/components/axis-sync-plugin/axis-sync.js.map +0 -1
  867. package/esm/plugin/components/axis-sync-plugin/index.js.map +0 -1
  868. package/esm/plugin/components/axis-sync-plugin/tick-align-transform.js.map +0 -1
  869. package/esm/plugin/components/axis-sync-plugin/zero-align-transform.js.map +0 -1
  870. /package/cjs/{component/tooltip/handler/dom → chart/liquid}/interface.js +0 -0
  871. /package/cjs/plugin/components/{axis-sync-plugin → axis-sync}/axis-sync.d.ts +0 -0
  872. /package/cjs/plugin/components/{axis-sync-plugin → axis-sync}/axis-sync.js +0 -0
  873. /package/cjs/plugin/components/{axis-sync-plugin → axis-sync}/index.d.ts +0 -0
  874. /package/cjs/plugin/components/{axis-sync-plugin → axis-sync}/index.js +0 -0
  875. /package/cjs/plugin/components/{axis-sync-plugin → axis-sync}/tick-align-transform.d.ts +0 -0
  876. /package/cjs/plugin/components/{axis-sync-plugin → axis-sync}/tick-align-transform.js +0 -0
  877. /package/cjs/plugin/components/{axis-sync-plugin → axis-sync}/zero-align-transform.d.ts +0 -0
  878. /package/cjs/plugin/components/{axis-sync-plugin → axis-sync}/zero-align-transform.js +0 -0
  879. /package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/canvas/index.d.ts +0 -0
  880. /package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/canvas/index.js +0 -0
  881. /package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/constants.d.ts +0 -0
  882. /package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/constants.js +0 -0
  883. /package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/index.d.ts +0 -0
  884. /package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/index.js +0 -0
  885. /package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/interface.d.ts +0 -0
  886. /package/cjs/{component/tooltip/handler/dom/model → plugin/components/tooltip-handler/dom}/interface.js +0 -0
  887. /package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/model/base-tooltip-model.d.ts +0 -0
  888. /package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/model/base-tooltip-model.js +0 -0
  889. /package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/model/content-column-model.d.ts +0 -0
  890. /package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/model/content-column-model.js +0 -0
  891. /package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/model/content-model.d.ts +0 -0
  892. /package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/model/content-model.js +0 -0
  893. /package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/model/interface.d.ts +0 -0
  894. /package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/model/shape-model.d.ts +0 -0
  895. /package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/model/shape-model.js +0 -0
  896. /package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/model/style-constants.d.ts +0 -0
  897. /package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/model/style-constants.js +0 -0
  898. /package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/model/text-model.d.ts +0 -0
  899. /package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/model/text-model.js +0 -0
  900. /package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/model/title-model.d.ts +0 -0
  901. /package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/model/title-model.js +0 -0
  902. /package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/model/tooltip-model.d.ts +0 -0
  903. /package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/model/tooltip-model.js +0 -0
  904. /package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/util.d.ts +0 -0
  905. /package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/util.js +0 -0
  906. /package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/index.d.ts +0 -0
  907. /package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/index.js +0 -0
  908. /package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/interface/style.d.ts +0 -0
  909. /package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/interface/style.js +0 -0
  910. /package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/utils/attribute.js +0 -0
  911. /package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/utils/common.js +0 -0
  912. /package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/utils/index.d.ts +0 -0
  913. /package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/utils/index.js +0 -0
  914. /package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/utils/pattern.d.ts +0 -0
  915. /package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/utils/pattern.js +0 -0
  916. /package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/utils/position.d.ts +0 -0
  917. /package/cjs/{component/tooltip/handler → plugin/components/tooltip-handler}/utils/position.js +0 -0
  918. /package/esm/{component/tooltip/handler/dom → chart/liquid}/interface.js +0 -0
  919. /package/esm/plugin/components/{axis-sync-plugin → axis-sync}/axis-sync.d.ts +0 -0
  920. /package/esm/plugin/components/{axis-sync-plugin → axis-sync}/axis-sync.js +0 -0
  921. /package/esm/plugin/components/{axis-sync-plugin → axis-sync}/index.d.ts +0 -0
  922. /package/esm/plugin/components/{axis-sync-plugin → axis-sync}/index.js +0 -0
  923. /package/esm/plugin/components/{axis-sync-plugin → axis-sync}/tick-align-transform.d.ts +0 -0
  924. /package/esm/plugin/components/{axis-sync-plugin → axis-sync}/tick-align-transform.js +0 -0
  925. /package/esm/plugin/components/{axis-sync-plugin → axis-sync}/zero-align-transform.d.ts +0 -0
  926. /package/esm/plugin/components/{axis-sync-plugin → axis-sync}/zero-align-transform.js +0 -0
  927. /package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/canvas/index.d.ts +0 -0
  928. /package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/canvas/index.js +0 -0
  929. /package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/constants.d.ts +0 -0
  930. /package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/constants.js +0 -0
  931. /package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/index.d.ts +0 -0
  932. /package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/index.js +0 -0
  933. /package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/interface.d.ts +0 -0
  934. /package/esm/{component/tooltip/handler/dom/model → plugin/components/tooltip-handler/dom}/interface.js +0 -0
  935. /package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/model/base-tooltip-model.d.ts +0 -0
  936. /package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/model/base-tooltip-model.js +0 -0
  937. /package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/model/content-column-model.d.ts +0 -0
  938. /package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/model/content-column-model.js +0 -0
  939. /package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/model/content-model.d.ts +0 -0
  940. /package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/model/content-model.js +0 -0
  941. /package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/model/interface.d.ts +0 -0
  942. /package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/model/shape-model.d.ts +0 -0
  943. /package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/model/shape-model.js +0 -0
  944. /package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/model/style-constants.d.ts +0 -0
  945. /package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/model/style-constants.js +0 -0
  946. /package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/model/text-model.d.ts +0 -0
  947. /package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/model/text-model.js +0 -0
  948. /package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/model/title-model.d.ts +0 -0
  949. /package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/model/title-model.js +0 -0
  950. /package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/model/tooltip-model.d.ts +0 -0
  951. /package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/model/tooltip-model.js +0 -0
  952. /package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/util.d.ts +0 -0
  953. /package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/dom/util.js +0 -0
  954. /package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/index.d.ts +0 -0
  955. /package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/index.js +0 -0
  956. /package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/interface/style.d.ts +0 -0
  957. /package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/interface/style.js +0 -0
  958. /package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/utils/attribute.js +0 -0
  959. /package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/utils/common.js +0 -0
  960. /package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/utils/index.d.ts +0 -0
  961. /package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/utils/index.js +0 -0
  962. /package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/utils/pattern.d.ts +0 -0
  963. /package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/utils/pattern.js +0 -0
  964. /package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/utils/position.d.ts +0 -0
  965. /package/esm/{component/tooltip/handler → plugin/components/tooltip-handler}/utils/position.js +0 -0
@@ -23,9 +23,6 @@ class BaseModel extends compilable_base_1.CompilableBase {
23
23
  get layout() {
24
24
  return this._layout;
25
25
  }
26
- getSpecIndex() {
27
- return this._specIndex;
28
- }
29
26
  getOption() {
30
27
  return this._option;
31
28
  }
@@ -54,14 +51,12 @@ class BaseModel extends compilable_base_1.CompilableBase {
54
51
  return null === (_a = this.getSpecInfo()) || void 0 === _a ? void 0 : _a.theme;
55
52
  }
56
53
  constructor(spec, option) {
57
- var _a, _b;
54
+ var _a;
58
55
  super(option), this.transformerConstructor = base_model_transformer_1.BaseModelSpecTransformer,
59
56
  this.type = "null", this.modelType = "null", this.userId = void 0, this._data = null,
60
- this._layout = null, this._specIndex = 0, this.specKey = "", this._marks = new mark_set_1.MarkSet,
61
- this._lastLayoutRect = null, this.id = (0, id_1.createID)(), this.userId = spec.id,
62
- this._spec = spec, this._specIndex = null !== (_a = option.specIndex) && void 0 !== _a ? _a : 0,
63
- this.effect = {}, this.event = new event_1.Event(option.eventDispatcher, option.mode),
64
- null === (_b = option.map) || void 0 === _b || _b.set(this.id, this);
57
+ this._layout = null, this.specKey = "", this._marks = new mark_set_1.MarkSet, this._lastLayoutRect = null,
58
+ this.id = (0, id_1.createID)(), this.userId = spec.id, this._spec = spec, this.effect = {},
59
+ this.event = new event_1.Event(option.eventDispatcher, option.mode), null === (_a = option.map) || void 0 === _a || _a.set(this.id, this);
65
60
  }
66
61
  _releaseEvent() {
67
62
  this.event.release();
@@ -89,7 +84,7 @@ class BaseModel extends compilable_base_1.CompilableBase {
89
84
  release() {
90
85
  var _a;
91
86
  this._releaseEvent(), this._spec = void 0, this.getMarks().forEach((m => m.release())),
92
- null === (_a = this._data) || void 0 === _a || _a.release(), this._data = this._specIndex = null,
87
+ null === (_a = this._data) || void 0 === _a || _a.release(), this._data = null,
93
88
  this._marks.clear(), super.release();
94
89
  }
95
90
  updateSpec(spec) {
@@ -161,6 +156,12 @@ class BaseModel extends compilable_base_1.CompilableBase {
161
156
  const specInfo = null !== (_c = null === (_b = (_a = this._option).getSpecInfo) || void 0 === _b ? void 0 : _b.call(_a)) && void 0 !== _c ? _c : {};
162
157
  return (0, vutils_extension_1.getProperty)(specInfo, this.getSpecInfoPath());
163
158
  }
159
+ getSpecIndex() {
160
+ const path = this.getSpecPath();
161
+ if (!(null == path ? void 0 : path.length)) return 0;
162
+ const index = Number(path[path.length - 1]);
163
+ return isNaN(index) ? 0 : index;
164
+ }
164
165
  }
165
166
 
166
167
  exports.BaseModel = BaseModel;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/model/base-model.ts"],"names":[],"mappings":";;;AAAA,mCAAsC;AACtC,0CAAuC;AA0BvC,6CAA2C;AAC3C,6CAA0C;AAC1C,+CAA2C;AAE3C,gEAA4D;AAC5D,2CAA0C;AAC1C,qEAAoE;AACpE,iEAAyD;AAEzD,MAAsB,SAAgC,SAAQ,gCAAc;IAI1E,OAAO;QACL,OAAO,IAAI,CAAC,KAAK,IAAK,EAAQ,CAAC;IACjC,CAAC;IAGD,WAAW;QACT,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;IAC/B,CAAC;IAGD,eAAe;;QACb,OAAO,MAAA,IAAI,CAAC,OAAO,CAAC,YAAY,mCAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;IAC5D,CAAC;IAiBD,OAAO;QACL,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAID,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAGD,YAAY;QACV,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAKD,SAAS;QACP,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAGD,QAAQ;;QACN,OAAO,MAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,QAAQ,EAAE,mCAAI,EAAE,CAAC;IACvC,CAAC;IACD,cAAc;;QACZ,OAAO,MAAA,IAAI,CAAC,MAAM,0CAAE,cAAc,EAAE,CAAC;IACvC,CAAC;IACD,UAAU;QACR,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IACD,eAAe;QACb,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAClC,IAAI,EAAE,IAAI,CAAC,IAAoB;YAC/B,IAAI,E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C,UAAU,CAAC,IAAW,EAAE,IAAI,kBAC5C,KAAK,EAAE,IAAI,EACX,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,EACrB,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,WAAW,IAClC,MAAM,EACJ,CAAC;QACR,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,OAAO,EAAE,CAAC;QACb,OAAO,CAAC,CAAC;IACX,CAAC;IAOS,aAAa;QACrB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,cAAc;;QACZ,OAAO,MAAA,MAAA,IAAI,CAAC,OAAO,EAAC,QAAQ,mDAAK,WAAW,CAAC;IAC/C,CAAC;IAED,WAAW;;QACT,MAAM,QAAQ,GAAG,MAAA,MAAA,MAAA,IAAI,CAAC,OAAO,EAAC,WAAW,kDAAI,mCAAI,EAAE,CAAC;QACpD,OAAO,IAAA,8BAAW,EAAiB,QAAQ,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC;IACvE,CAAC;CACF;AA3QD,8BA2QC","file":"base-model.js","sourcesContent":["import { createID } from '../util/id';\nimport { Event } from '../event/event';\nimport type { IEvent } from '../event/interface';\nimport type {\n IEffect,\n IModel,\n IModelInitOption,\n IModelOption,\n IModelRenderOption,\n IModelEvaluateOption,\n IModelSpec,\n IModelMarkInfo,\n IModelSpecInfo\n} from './interface';\nimport type { CoordinateType } from '../typings/coordinate';\nimport type { IMark, IMarkOption, IMarkRaw, IMarkStyle, MarkTypeEnum } from '../mark/interface';\nimport type {\n Datum,\n StateValueType,\n ConvertToMarkStyleSpec,\n ICommonSpec,\n StringOrNumber,\n IRect,\n ILayoutRect\n} from '../typings';\nimport type { CompilableData } from '../compile/data/compilable-data';\nimport type { IGroupMark } from '@visactor/vgrammar-core';\nimport { isValid } from '@visactor/vutils';\nimport { Factory } from '../core/factory';\nimport { MarkSet } from '../mark/mark-set';\nimport type { ILayoutItem } from '../layout/interface';\nimport { CompilableBase } from '../compile/compilable-base';\nimport { PREFIX } from '../constant/base';\nimport { BaseModelSpecTransformer } from './base-model-transformer';\nimport { getProperty } from '@visactor/vutils-extension';\n\nexport abstract class BaseModel<T extends IModelSpec> extends CompilableBase implements IModel {\n readonly transformerConstructor = BaseModelSpecTransformer;\n\n protected _spec: T;\n getSpec(): T {\n return this._spec || ({} as T);\n }\n\n /** 获取当前 model 对应在图表 spec 上的路径 */\n getSpecPath() {\n return this._option.specPath;\n }\n\n /** 获取当前 model 对应在图表 specInfo 上的路径 */\n getSpecInfoPath() {\n return this._option.specInfoPath ?? this._option.specPath;\n }\n\n readonly type: string = 'null';\n readonly modelType: string = 'null';\n\n readonly id;\n\n userId: StringOrNumber | undefined = undefined;\n\n // 事件\n readonly event: IEvent;\n\n // 副作用\n readonly effect: IEffect;\n\n // 数据\n protected _data: CompilableData = null;\n getData() {\n return this._data;\n }\n\n // 布局\n protected _layout?: ILayoutItem = null;\n get layout() {\n return this._layout;\n }\n\n protected _specIndex: number = 0;\n getSpecIndex() {\n return this._specIndex;\n }\n\n readonly specKey: string = '';\n\n protected declare _option: IModelOption;\n getOption() {\n return this._option;\n }\n\n protected _marks: MarkSet = new MarkSet();\n getMarks(): IMark[] {\n return this._marks?.getMarks() ?? [];\n }\n getMarkNameMap() {\n return this._marks?.getMarkNameMap();\n }\n getMarkSet() {\n return this._marks;\n }\n getMarkInfoList(): IModelMarkInfo[] {\n return this.getMarks().map(mark => ({\n type: mark.type as MarkTypeEnum,\n name: mark.name\n }));\n }\n\n getChart() {\n return this._option.getChart();\n }\n\n protected get _theme() {\n return this.getSpecInfo()?.theme;\n }\n\n /** for layout diff */\n protected _lastLayoutRect: ILayoutRect = null;\n\n constructor(spec: T, option: IModelOption) {\n super(option);\n this.id = createID();\n this.userId = spec.id;\n this._spec = spec;\n this._specIndex = option.specIndex ?? 0;\n this.effect = {};\n this.event = new Event(option.eventDispatcher, option.mode);\n option.map?.set(this.id, this);\n }\n coordinate?: CoordinateType;\n\n protected _releaseEvent() {\n this.event.release();\n }\n\n created() {\n this.setAttrFromSpec();\n }\n\n init(option: IModelInitOption) {\n // do nothing\n }\n\n afterInit() {\n // do nothing\n }\n\n getVisible() {\n return (this._spec as unknown as any)?.visible !== false;\n }\n\n onLayoutStart(layoutRect: IRect, viewRect: ILayoutRect, ctx: any): void {\n // do nothing\n this._layout?.onLayoutStart(layoutRect, viewRect, ctx);\n }\n onLayoutEnd(ctx: any): void {\n this._layout?.onLayoutEnd(ctx);\n this.getMarks().forEach(m => m.updateLayoutState(true, true));\n }\n\n onEvaluateEnd(ctx: IModelEvaluateOption) {\n // do nothing\n }\n abstract onRender(ctx: IModelRenderOption): void;\n\n onDataUpdate() {\n // do nothing\n }\n\n beforeRelease() {\n // do nothing\n }\n\n release() {\n this._releaseEvent();\n this._spec = undefined;\n this.getMarks().forEach(m => m.release());\n this._data?.release();\n this._data = this._specIndex = null;\n this._marks.clear();\n super.release();\n }\n\n updateSpec(spec: T) {\n const result = this._compareSpec(spec, this._spec);\n this._spec = spec;\n if (!result.reMake) {\n this.reInit();\n }\n return result;\n }\n\n protected _compareSpec(spec: T, prevSpec: T) {\n const result = {\n change: false,\n reMake: false,\n reRender: false,\n reSize: false,\n reCompile: false\n };\n return result;\n }\n\n reInit(spec?: T) {\n if (spec) {\n this._spec = spec;\n }\n this.setAttrFromSpec();\n }\n\n updateLayoutAttribute() {\n // do nothing\n }\n\n setAttrFromSpec() {\n this._layout?.setAttrFromSpec(this._spec, this._option.getChartViewRect());\n }\n\n /** mark style 内部转换逻辑,override 使用 */\n protected _convertMarkStyle<T extends ICommonSpec = ICommonSpec>(\n style: Partial<IMarkStyle<T> | ConvertToMarkStyleSpec<T>>\n ): Partial<IMarkStyle<T> | ConvertToMarkStyleSpec<T>> {\n const newStyle: any = { ...style };\n return newStyle;\n }\n\n setMarkStyle<T extends ICommonSpec>(\n mark: IMarkRaw<T>,\n style?: Partial<IMarkStyle<T> | ConvertToMarkStyleSpec<T>>,\n state?: StateValueType,\n level?: number\n ) {\n if (!isValid(mark) || !isValid(style)) {\n return;\n }\n mark.setStyle(this._convertMarkStyle(style), state, level);\n }\n\n initMarkStyleWithSpec(mark?: IMark, spec?: any, key?: string) {\n if (!isValid(mark) || !isValid(spec)) {\n return;\n }\n const { style, state } = spec;\n const newSpec = { ...spec };\n\n if (style) {\n newSpec.style = this._convertMarkStyle(style);\n }\n if (state) {\n newSpec.state = {};\n Object.keys(state).forEach(key => {\n newSpec.state[key] = this._convertMarkStyle(state[key]);\n });\n }\n mark.initStyleWithSpec(newSpec, key);\n }\n\n protected stateKeyToSignalName(key: string, opt?: string) {\n let name = `${PREFIX}_${this.modelType}_${this.type}_${this.id}_${key}`;\n opt && (name += `_${opt}`);\n return name;\n }\n\n compileData() {\n this._data?.compile();\n }\n\n compileMarks(group?: string | IGroupMark) {\n this.getMarks().forEach(m => {\n m.compile({ group });\n });\n }\n\n protected _createMark<T extends IMark>(markInfo: IModelMarkInfo, option: Partial<IMarkOption> = {}): T {\n const { type, name } = markInfo;\n const m = Factory.createMark(type as any, name, {\n model: this,\n map: this._option.map,\n getCompiler: this.getCompiler,\n globalScale: this._option.globalScale,\n ...option\n }) as T;\n m?.created();\n return m;\n }\n\n /**\n * 数据唯一ID\n * 根据自身动画数据匹配需求设置返回值。\n * 默认返回 undefined 时,根据 VGrammar 默认数据 ID 进行索引和匹配。\n */\n protected _getDataIdKey(): string | ((datum: Datum) => string) | undefined {\n return undefined;\n }\n\n getColorScheme() {\n return this._option.getTheme?.().colorScheme;\n }\n\n getSpecInfo() {\n const specInfo = this._option.getSpecInfo?.() ?? {};\n return getProperty<IModelSpecInfo>(specInfo, this.getSpecInfoPath());\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/model/base-model.ts"],"names":[],"mappings":";;;AAAA,mCAAsC;AACtC,0CAAuC;AA0BvC,6CAA2C;AAC3C,6CAA0C;AAC1C,+CAA2C;AAE3C,gEAA4D;AAC5D,2CAA0C;AAC1C,qEAA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WAAW;;QACT,MAAM,QAAQ,GAAG,MAAA,MAAA,MAAA,IAAI,CAAC,OAAO,EAAC,WAAW,kDAAI,mCAAI,EAAE,CAAC;QACpD,OAAO,IAAA,8BAAW,EAAiB,QAAQ,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC;IACvE,CAAC;IAED,YAAY;QACV,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QAChC,IAAI,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,CAAA,EAAE;YACjB,OAAO,CAAC,CAAC;SACV;QACD,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;QAC5C,IAAI,KAAK,CAAC,KAAK,CAAC,EAAE;YAChB,OAAO,CAAC,CAAC;SACV;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAjRD,8BAiRC","file":"base-model.js","sourcesContent":["import { createID } from '../util/id';\nimport { Event } from '../event/event';\nimport type { IEvent } from '../event/interface';\nimport type {\n IEffect,\n IModel,\n IModelInitOption,\n IModelOption,\n IModelRenderOption,\n IModelEvaluateOption,\n IModelSpec,\n IModelMarkInfo,\n IModelSpecInfo\n} from './interface';\nimport type { CoordinateType } from '../typings/coordinate';\nimport type { IMark, IMarkOption, IMarkRaw, IMarkStyle, MarkTypeEnum } from '../mark/interface';\nimport type {\n Datum,\n StateValueType,\n ConvertToMarkStyleSpec,\n ICommonSpec,\n StringOrNumber,\n IRect,\n ILayoutRect\n} from '../typings';\nimport type { CompilableData } from '../compile/data/compilable-data';\nimport type { IGroupMark } from '@visactor/vgrammar-core';\nimport { isValid } from '@visactor/vutils';\nimport { Factory } from '../core/factory';\nimport { MarkSet } from '../mark/mark-set';\nimport type { ILayoutItem } from '../layout/interface';\nimport { CompilableBase } from '../compile/compilable-base';\nimport { PREFIX } from '../constant/base';\nimport { BaseModelSpecTransformer } from './base-model-transformer';\nimport { getProperty } from '@visactor/vutils-extension';\n\nexport abstract class BaseModel<T extends IModelSpec> extends CompilableBase implements IModel {\n readonly transformerConstructor = BaseModelSpecTransformer;\n\n protected _spec: T;\n getSpec(): T {\n return this._spec || ({} as T);\n }\n\n /** 获取当前 model 对应在图表 spec 上的路径 */\n getSpecPath() {\n return this._option.specPath;\n }\n\n /** 获取当前 model 对应在图表 specInfo 上的路径 */\n getSpecInfoPath() {\n return this._option.specInfoPath ?? this._option.specPath;\n }\n\n readonly type: string = 'null';\n readonly modelType: string = 'null';\n\n readonly id;\n\n userId: StringOrNumber | undefined = undefined;\n\n // 事件\n readonly event: IEvent;\n\n // 副作用\n readonly effect: IEffect;\n\n // 数据\n protected _data: CompilableData = null;\n getData() {\n return this._data;\n }\n\n // 布局\n protected _layout?: ILayoutItem = null;\n get layout() {\n return this._layout;\n }\n\n readonly specKey: string = '';\n\n protected declare _option: IModelOption;\n getOption() {\n return this._option;\n }\n\n protected _marks: MarkSet = new MarkSet();\n getMarks(): IMark[] {\n return this._marks?.getMarks() ?? [];\n }\n getMarkNameMap() {\n return this._marks?.getMarkNameMap();\n }\n getMarkSet() {\n return this._marks;\n }\n getMarkInfoList(): IModelMarkInfo[] {\n return this.getMarks().map(mark => ({\n type: mark.type as MarkTypeEnum,\n name: mark.name\n }));\n }\n\n getChart() {\n return this._option.getChart();\n }\n\n protected get _theme() {\n return this.getSpecInfo()?.theme;\n }\n\n /** for layout diff */\n protected _lastLayoutRect: ILayoutRect = null;\n\n constructor(spec: T, option: IModelOption) {\n super(option);\n this.id = createID();\n this.userId = spec.id;\n this._spec = spec;\n this.effect = {};\n this.event = new Event(option.eventDispatcher, option.mode);\n option.map?.set(this.id, this);\n }\n coordinate?: CoordinateType;\n\n protected _releaseEvent() {\n this.event.release();\n }\n\n created() {\n this.setAttrFromSpec();\n }\n\n init(option: IModelInitOption) {\n // do nothing\n }\n\n afterInit() {\n // do nothing\n }\n\n getVisible() {\n return (this._spec as unknown as any)?.visible !== false;\n }\n\n onLayoutStart(layoutRect: IRect, viewRect: ILayoutRect, ctx: any): void {\n // do nothing\n this._layout?.onLayoutStart(layoutRect, viewRect, ctx);\n }\n onLayoutEnd(ctx: any): void {\n this._layout?.onLayoutEnd(ctx);\n this.getMarks().forEach(m => m.updateLayoutState(true, true));\n }\n\n onEvaluateEnd(ctx: IModelEvaluateOption) {\n // do nothing\n }\n abstract onRender(ctx: IModelRenderOption): void;\n\n onDataUpdate() {\n // do nothing\n }\n\n beforeRelease() {\n // do nothing\n }\n\n release() {\n this._releaseEvent();\n this._spec = undefined;\n this.getMarks().forEach(m => m.release());\n this._data?.release();\n this._data = null;\n this._marks.clear();\n super.release();\n }\n\n updateSpec(spec: T) {\n const result = this._compareSpec(spec, this._spec);\n this._spec = spec;\n if (!result.reMake) {\n this.reInit();\n }\n return result;\n }\n\n protected _compareSpec(spec: T, prevSpec: T) {\n const result = {\n change: false,\n reMake: false,\n reRender: false,\n reSize: false,\n reCompile: false\n };\n return result;\n }\n\n reInit(spec?: T) {\n if (spec) {\n this._spec = spec;\n }\n this.setAttrFromSpec();\n }\n\n updateLayoutAttribute() {\n // do nothing\n }\n\n setAttrFromSpec() {\n this._layout?.setAttrFromSpec(this._spec, this._option.getChartViewRect());\n }\n\n /** mark style 内部转换逻辑,override 使用 */\n protected _convertMarkStyle<T extends ICommonSpec = ICommonSpec>(\n style: Partial<IMarkStyle<T> | ConvertToMarkStyleSpec<T>>\n ): Partial<IMarkStyle<T> | ConvertToMarkStyleSpec<T>> {\n const newStyle: any = { ...style };\n return newStyle;\n }\n\n setMarkStyle<T extends ICommonSpec>(\n mark: IMarkRaw<T>,\n style?: Partial<IMarkStyle<T> | ConvertToMarkStyleSpec<T>>,\n state?: StateValueType,\n level?: number\n ) {\n if (!isValid(mark) || !isValid(style)) {\n return;\n }\n mark.setStyle(this._convertMarkStyle(style), state, level);\n }\n\n initMarkStyleWithSpec(mark?: IMark, spec?: any, key?: string) {\n if (!isValid(mark) || !isValid(spec)) {\n return;\n }\n const { style, state } = spec;\n const newSpec = { ...spec };\n\n if (style) {\n newSpec.style = this._convertMarkStyle(style);\n }\n if (state) {\n newSpec.state = {};\n Object.keys(state).forEach(key => {\n newSpec.state[key] = this._convertMarkStyle(state[key]);\n });\n }\n mark.initStyleWithSpec(newSpec, key);\n }\n\n protected stateKeyToSignalName(key: string, opt?: string) {\n let name = `${PREFIX}_${this.modelType}_${this.type}_${this.id}_${key}`;\n opt && (name += `_${opt}`);\n return name;\n }\n\n compileData() {\n this._data?.compile();\n }\n\n compileMarks(group?: string | IGroupMark) {\n this.getMarks().forEach(m => {\n m.compile({ group });\n });\n }\n\n protected _createMark<T extends IMark>(markInfo: IModelMarkInfo, option: Partial<IMarkOption> = {}): T {\n const { type, name } = markInfo;\n const m = Factory.createMark(type as any, name, {\n model: this,\n map: this._option.map,\n getCompiler: this.getCompiler,\n globalScale: this._option.globalScale,\n ...option\n }) as T;\n m?.created();\n return m;\n }\n\n /**\n * 数据唯一ID\n * 根据自身动画数据匹配需求设置返回值。\n * 默认返回 undefined 时,根据 VGrammar 默认数据 ID 进行索引和匹配。\n */\n protected _getDataIdKey(): string | ((datum: Datum) => string) | undefined {\n return undefined;\n }\n\n getColorScheme() {\n return this._option.getTheme?.().colorScheme;\n }\n\n getSpecInfo() {\n const specInfo = this._option.getSpecInfo?.() ?? {};\n return getProperty<IModelSpecInfo>(specInfo, this.getSpecInfoPath());\n }\n\n getSpecIndex() {\n const path = this.getSpecPath();\n if (!path?.length) {\n return 0;\n }\n const index = Number(path[path.length - 1]);\n if (isNaN(index)) {\n return 0;\n }\n return index;\n }\n}\n"]}
@@ -100,7 +100,7 @@ export interface IModelOption extends ICompilableInitOption {
100
100
  map: Map<StringOrNumber, IModel | IMark>;
101
101
  mode: RenderMode;
102
102
  globalInstance: VChart;
103
- specIndex?: number;
103
+ regionIndexes?: Array<number>;
104
104
  specKey?: string;
105
105
  specPath?: Array<string | number>;
106
106
  specInfoPath?: Array<string | number>;
@@ -120,8 +120,9 @@ export interface IModelSpecInfo<T extends Record<string, unknown> = any> {
120
120
  spec: T;
121
121
  specPath?: Array<string | number>;
122
122
  specInfoPath?: Array<string | number>;
123
- specIndex?: number;
124
123
  theme?: any;
124
+ regionIndexes?: number[];
125
+ seriesIndexes?: number[];
125
126
  }
126
127
  export interface IModelConstructor {
127
128
  readonly transformerConstructor: new (option: IBaseModelSpecTransformerOption) => IBaseModelSpecTransformer;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/model/interface.ts"],"names":[],"mappings":"","file":"interface.js","sourcesContent":["import type { IBoundsLike } from '@visactor/vutils';\nimport type { DataSet, DataView } from '@visactor/vdataset';\nimport type { IEvent, IEventDispatcher } from '../event/interface';\nimport type { IMark, IMarkRaw, IMarkStyle, MarkTypeEnum } from '../mark/interface';\nimport type { RenderMode } from '../typings/spec/common';\nimport type { VChart } from '../vchart-all';\nimport type { IData } from '@visactor/vgrammar-core';\nimport type { StringOrNumber } from '../typings/common';\nimport type { IGroupMarkSpec, ConvertToMarkStyleSpec, ICommonSpec } from '../typings/visual';\nimport type { IRect } from '../typings/space';\nimport type { IPoint, CoordinateType } from '../typings/coordinate';\nimport type { ITheme } from '../theme';\nimport type { StateValueType } from '../typings/spec';\nimport type { ICompilable, ICompilableInitOption } from '../compile/interface';\nimport type { ICompilableData } from '../compile/data';\nimport type { IGlobalScale } from '../scale/interface';\nimport type { IChart, IChartSpecInfo } from '../chart/interface';\nimport type { IThemeColorScheme } from '../theme/color-scheme/interface';\nimport type { ILayoutItem, ILayoutItemSpec } from '../layout/interface';\nimport type { ILayoutPoint, ILayoutRect } from '../typings/layout';\nimport type { ComponentTypeEnum } from '../component/interface';\nimport type { SeriesMarkNameEnum, SeriesTypeEnum } from '../series';\nimport type { TransformedLabelSpec } from '../component/label';\n\n// TODO:\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface IModelInitOption {}\n// TODO:\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface IModelLayoutOption {}\n// TODO:\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface IModelEvaluateOption {}\n// TODO:\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface IModelRenderOption {}\n\nexport interface IEffect {\n [key: string]: (e?: any) => any;\n}\n\nexport interface IMarkTreeGroup extends Partial<IMarkStyle<IGroupMarkSpec>> {\n // 必须要有名字\n type: 'group';\n name: string;\n marks: (IMarkTreeGroup | IMark)[];\n // TODO: 这里要不要支持复杂场景,有图形组合的场景,用自定义mark?\n // from?: IData;\n}\n\nexport type IMarkTree = IMarkTreeGroup | IMark | (IMarkTreeGroup | IMark)[];\n\nexport interface IUpdateSpecResult {\n change: boolean;\n reMake: boolean;\n reRender?: boolean;\n reSize?: boolean;\n // TODO: compile 的判断应不应该出现在这里?\n reCompile?: boolean;\n}\n\nexport interface IModelProduct {\n srData: IData;\n}\n\nexport interface IModel extends ICompilable {\n readonly modelType: string;\n readonly type: string;\n readonly specKey: string;\n readonly transformerConstructor: new (option: IBaseModelSpecTransformerOption) => IBaseModelSpecTransformer;\n\n readonly id: number;\n\n readonly userId?: StringOrNumber;\n\n // 事件\n readonly event: IEvent;\n\n // 副作用\n readonly effect: IEffect;\n\n coordinate?: CoordinateType;\n\n // 布局\n layout?: ILayoutItem;\n\n /** 是否可见 */\n getVisible: () => boolean;\n\n // 初始化参数\n getOption: () => IModelOption;\n\n getMarks: () => IMark[];\n getMarkNameMap: () => Record<string, IMark>;\n getMarkInfoList: () => IModelMarkInfo[];\n\n getData: () => ICompilableData;\n\n getChart: () => IChart;\n\n //生命周期\n // 创建模块自身内容,设置自身属性\n created: () => void;\n // 用来处理与其他图表模块的联系\n init: (option: IModelInitOption) => void;\n /** updateSpec 或者切换主题后,根据新 spec 执行的初始化过程 */\n reInit: (spec?: any) => void;\n beforeRelease: () => void;\n\n onEvaluateEnd: (ctx: IModelEvaluateOption) => void;\n onRender: (ctx: IModelRenderOption) => void;\n onDataUpdate: () => void;\n\n updateSpec: (spec: any, totalSpec?: any) => IUpdateSpecResult;\n getSpec?: () => any;\n getSpecIndex: () => number;\n getSpecPath: () => Array<string | number>;\n\n //布局周期\n onLayoutStart: (layoutRect: IRect, viewRect: ILayoutRect, ctx: IModelLayoutOption) => void;\n onLayoutEnd: (ctx: IModelLayoutOption) => void;\n\n getColorScheme: () => IThemeColorScheme | undefined;\n\n setMarkStyle: <T extends ICommonSpec>(\n mark?: IMarkRaw<T>,\n style?: Partial<IMarkStyle<T> | ConvertToMarkStyleSpec<T>>,\n state?: StateValueType,\n level?: number\n ) => void;\n\n initMarkStyleWithSpec: (mark?: IMark, spec?: any, key?: string) => void;\n\n getSpecInfo: () => IModelSpecInfo;\n}\n\nexport interface ILayoutModel extends IModel {\n // 布局相关\n getLayoutStartPoint: () => IPoint;\n setLayoutStartPosition: (pos: Partial<IPoint>) => void;\n getLayoutRect: () => ILayoutRect;\n setLayoutRect: (rect: Partial<ILayoutRect>, levelMap?: Partial<ILayoutRect>) => void;\n\n getLastComputeOutBounds: () => IBoundsLike;\n\n getBoundsInRect: (rect: ILayoutRect, fullRect: ILayoutRect) => IBoundsLike;\n\n //布局周期\n afterSetLayoutStartPoint: (pos: ILayoutPoint) => void;\n}\n\nexport interface IModelOption extends ICompilableInitOption {\n type: string;\n eventDispatcher: IEventDispatcher;\n dataSet: DataSet;\n map: Map<StringOrNumber, IModel | IMark>;\n mode: RenderMode;\n globalInstance: VChart;\n specIndex?: number;\n specKey?: string;\n specPath?: Array<string | number>;\n specInfoPath?: Array<string | number>;\n\n getTheme?: () => ITheme;\n getSpecInfo?: () => IChartSpecInfo;\n getChartLayoutRect: () => IRect;\n getChartViewRect: () => ILayoutRect;\n\n getChart: () => IChart;\n getSeriesData: (id: StringOrNumber | undefined, index: number | undefined) => DataView | undefined;\n\n globalScale: IGlobalScale;\n animation: boolean;\n /**\n * 错误消息回调函数\n */\n onError: (...args: any[]) => void;\n\n /**\n * 是否关闭交互效果\n */\n disableTriggerEvent?: boolean;\n}\n\nexport interface IModelSpecInfo<T extends Record<string, unknown> = any> {\n /** model 具体类型 */\n type: string | ComponentTypeEnum | SeriesTypeEnum;\n /** model spec */\n spec: T;\n /** 该 spec 在图表 spec 上的路径 */\n specPath?: Array<string | number>;\n /** 该 spec 在图表 spec info 上的路径 */\n specInfoPath?: Array<string | number>;\n /** spec 在父级的索引 */\n specIndex?: number;\n /** model 当前主题 */\n theme?: any;\n}\n\nexport interface IModelConstructor {\n readonly transformerConstructor: new (option: IBaseModelSpecTransformerOption) => IBaseModelSpecTransformer;\n}\n\nexport type ILayoutModelState = {\n layoutUpdateRank: number;\n [key: string]: unknown;\n};\n\n// TODO: 补充model共有配置\nexport type IModelSpec = ILayoutItemSpec & { id?: StringOrNumber };\n\nexport interface IModelMarkInfo {\n /** mark 类型 */\n type: MarkTypeEnum | string | (MarkTypeEnum | string)[];\n /** mark 名称 */\n name: string;\n}\n\nexport interface IBaseModelSpecTransformerOption {\n type: string;\n getTheme: () => ITheme;\n}\n\nexport interface IBaseModelSpecTransformerResult<T, K> {\n spec: T;\n theme: K;\n markLabelSpec?: Partial<Record<SeriesMarkNameEnum, TransformedLabelSpec[]>>;\n}\n\nexport interface IBaseModelSpecTransformer {\n getTheme: (spec: any, chartSpec: any) => any;\n transformSpec: (\n spec: any,\n chartSpec: any,\n chartSpecInfo?: IChartSpecInfo\n ) => IBaseModelSpecTransformerResult<any, any>;\n}\n"]}
1
+ {"version":3,"sources":["../src/model/interface.ts"],"names":[],"mappings":"","file":"interface.js","sourcesContent":["import type { IBoundsLike } from '@visactor/vutils';\nimport type { DataSet, DataView } from '@visactor/vdataset';\nimport type { IEvent, IEventDispatcher } from '../event/interface';\nimport type { IMark, IMarkRaw, IMarkStyle, MarkTypeEnum } from '../mark/interface';\nimport type { RenderMode } from '../typings/spec/common';\nimport type { VChart } from '../vchart-all';\nimport type { IData } from '@visactor/vgrammar-core';\nimport type { StringOrNumber } from '../typings/common';\nimport type { IGroupMarkSpec, ConvertToMarkStyleSpec, ICommonSpec } from '../typings/visual';\nimport type { IRect } from '../typings/space';\nimport type { IPoint, CoordinateType } from '../typings/coordinate';\nimport type { ITheme } from '../theme';\nimport type { StateValueType } from '../typings/spec';\nimport type { ICompilable, ICompilableInitOption } from '../compile/interface';\nimport type { ICompilableData } from '../compile/data';\nimport type { IGlobalScale } from '../scale/interface';\nimport type { IChart, IChartSpecInfo } from '../chart/interface';\nimport type { IThemeColorScheme } from '../theme/color-scheme/interface';\nimport type { ILayoutItem, ILayoutItemSpec } from '../layout/interface';\nimport type { ILayoutPoint, ILayoutRect } from '../typings/layout';\nimport type { ComponentTypeEnum } from '../component/interface';\nimport type { SeriesMarkNameEnum, SeriesTypeEnum } from '../series';\nimport type { TransformedLabelSpec } from '../component/label';\n\n// TODO:\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface IModelInitOption {}\n// TODO:\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface IModelLayoutOption {}\n// TODO:\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface IModelEvaluateOption {}\n// TODO:\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface IModelRenderOption {}\n\nexport interface IEffect {\n [key: string]: (e?: any) => any;\n}\n\nexport interface IMarkTreeGroup extends Partial<IMarkStyle<IGroupMarkSpec>> {\n // 必须要有名字\n type: 'group';\n name: string;\n marks: (IMarkTreeGroup | IMark)[];\n // TODO: 这里要不要支持复杂场景,有图形组合的场景,用自定义mark?\n // from?: IData;\n}\n\nexport type IMarkTree = IMarkTreeGroup | IMark | (IMarkTreeGroup | IMark)[];\n\nexport interface IUpdateSpecResult {\n change: boolean;\n reMake: boolean;\n reRender?: boolean;\n reSize?: boolean;\n // TODO: compile 的判断应不应该出现在这里?\n reCompile?: boolean;\n}\n\nexport interface IModelProduct {\n srData: IData;\n}\n\nexport interface IModel extends ICompilable {\n readonly modelType: string;\n readonly type: string;\n readonly specKey: string;\n readonly transformerConstructor: new (option: IBaseModelSpecTransformerOption) => IBaseModelSpecTransformer;\n\n readonly id: number;\n\n readonly userId?: StringOrNumber;\n\n // 事件\n readonly event: IEvent;\n\n // 副作用\n readonly effect: IEffect;\n\n coordinate?: CoordinateType;\n\n // 布局\n layout?: ILayoutItem;\n\n /** 是否可见 */\n getVisible: () => boolean;\n\n // 初始化参数\n getOption: () => IModelOption;\n\n getMarks: () => IMark[];\n getMarkNameMap: () => Record<string, IMark>;\n getMarkInfoList: () => IModelMarkInfo[];\n\n getData: () => ICompilableData;\n\n getChart: () => IChart;\n\n //生命周期\n // 创建模块自身内容,设置自身属性\n created: () => void;\n // 用来处理与其他图表模块的联系\n init: (option: IModelInitOption) => void;\n /** updateSpec 或者切换主题后,根据新 spec 执行的初始化过程 */\n reInit: (spec?: any) => void;\n beforeRelease: () => void;\n\n onEvaluateEnd: (ctx: IModelEvaluateOption) => void;\n onRender: (ctx: IModelRenderOption) => void;\n onDataUpdate: () => void;\n\n updateSpec: (spec: any, totalSpec?: any) => IUpdateSpecResult;\n getSpec?: () => any;\n getSpecIndex: () => number;\n getSpecPath: () => Array<string | number>;\n\n //布局周期\n onLayoutStart: (layoutRect: IRect, viewRect: ILayoutRect, ctx: IModelLayoutOption) => void;\n onLayoutEnd: (ctx: IModelLayoutOption) => void;\n\n getColorScheme: () => IThemeColorScheme | undefined;\n\n setMarkStyle: <T extends ICommonSpec>(\n mark?: IMarkRaw<T>,\n style?: Partial<IMarkStyle<T> | ConvertToMarkStyleSpec<T>>,\n state?: StateValueType,\n level?: number\n ) => void;\n\n initMarkStyleWithSpec: (mark?: IMark, spec?: any, key?: string) => void;\n\n getSpecInfo: () => IModelSpecInfo;\n}\n\nexport interface ILayoutModel extends IModel {\n // 布局相关\n getLayoutStartPoint: () => IPoint;\n setLayoutStartPosition: (pos: Partial<IPoint>) => void;\n getLayoutRect: () => ILayoutRect;\n setLayoutRect: (rect: Partial<ILayoutRect>, levelMap?: Partial<ILayoutRect>) => void;\n\n getLastComputeOutBounds: () => IBoundsLike;\n\n getBoundsInRect: (rect: ILayoutRect, fullRect: ILayoutRect) => IBoundsLike;\n\n //布局周期\n afterSetLayoutStartPoint: (pos: ILayoutPoint) => void;\n}\n\nexport interface IModelOption extends ICompilableInitOption {\n type: string;\n eventDispatcher: IEventDispatcher;\n dataSet: DataSet;\n map: Map<StringOrNumber, IModel | IMark>;\n mode: RenderMode;\n globalInstance: VChart;\n regionIndexes?: Array<number>;\n specKey?: string;\n specPath?: Array<string | number>;\n specInfoPath?: Array<string | number>;\n\n getTheme?: () => ITheme;\n getSpecInfo?: () => IChartSpecInfo;\n getChartLayoutRect: () => IRect;\n getChartViewRect: () => ILayoutRect;\n\n getChart: () => IChart;\n getSeriesData: (id: StringOrNumber | undefined, index: number | undefined) => DataView | undefined;\n\n globalScale: IGlobalScale;\n animation: boolean;\n /**\n * 错误消息回调函数\n */\n onError: (...args: any[]) => void;\n\n /**\n * 是否关闭交互效果\n */\n disableTriggerEvent?: boolean;\n}\n\nexport interface IModelSpecInfo<T extends Record<string, unknown> = any> {\n /** model 具体类型 */\n type: string | ComponentTypeEnum | SeriesTypeEnum;\n /** model spec */\n spec: T;\n /** 该 spec 在图表 spec 上的路径 */\n specPath?: Array<string | number>;\n /** 该 spec 在图表 spec info 上的路径 */\n specInfoPath?: Array<string | number>;\n /** model 当前主题 */\n theme?: any;\n /** model 对应的 region 索引 */\n regionIndexes?: number[];\n /** model 对应的 series 索引 */\n seriesIndexes?: number[];\n}\n\nexport interface IModelConstructor {\n readonly transformerConstructor: new (option: IBaseModelSpecTransformerOption) => IBaseModelSpecTransformer;\n}\n\nexport type ILayoutModelState = {\n layoutUpdateRank: number;\n [key: string]: unknown;\n};\n\n// TODO: 补充model共有配置\nexport type IModelSpec = ILayoutItemSpec & { id?: StringOrNumber };\n\nexport interface IModelMarkInfo {\n /** mark 类型 */\n type: MarkTypeEnum | string | (MarkTypeEnum | string)[];\n /** mark 名称 */\n name: string;\n}\n\nexport interface IBaseModelSpecTransformerOption {\n type: string;\n getTheme: () => ITheme;\n}\n\nexport interface IBaseModelSpecTransformerResult<T, K> {\n spec: T;\n theme: K;\n markLabelSpec?: Partial<Record<SeriesMarkNameEnum, TransformedLabelSpec[]>>;\n}\n\nexport interface IBaseModelSpecTransformer {\n getTheme: (spec: any, chartSpec: any) => any;\n transformSpec: (\n spec: any,\n chartSpec: any,\n chartSpecInfo?: IChartSpecInfo\n ) => IBaseModelSpecTransformerResult<any, any>;\n}\n"]}
@@ -16,7 +16,7 @@ const vutils_1 = require("@visactor/vutils"), factory_1 = require("../../../../c
16
16
  exports.executeMediaQueryActionFilter = executeMediaQueryActionFilter;
17
17
 
18
18
  const executeMediaQueryActionFilterType = (filterType = "chart", chartSpec, chartSpecInfo) => {
19
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
19
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
20
20
  const result = {
21
21
  modelInfo: []
22
22
  };
@@ -28,7 +28,6 @@ const executeMediaQueryActionFilterType = (filterType = "chart", chartSpec, char
28
28
  result.modelInfo.push({
29
29
  spec: regionSpec,
30
30
  specPath: [ "region", i ],
31
- specIndex: i,
32
31
  type: "region"
33
32
  });
34
33
  })); else if ("series" === filterType) result.modelType = "series", result.specKey = "series",
@@ -36,7 +35,6 @@ const executeMediaQueryActionFilterType = (filterType = "chart", chartSpec, char
36
35
  result.modelInfo.push({
37
36
  spec: seriesSpec,
38
37
  specPath: [ "series", i ],
39
- specIndex: i,
40
38
  type: seriesSpec.type
41
39
  });
42
40
  })); else if (Object.values(interface_1.SeriesTypeEnum).includes(filterType)) result.modelType = "series",
@@ -44,13 +42,12 @@ const executeMediaQueryActionFilterType = (filterType = "chart", chartSpec, char
44
42
  seriesSpec.type === filterType && result.modelInfo.push({
45
43
  spec: seriesSpec,
46
44
  specPath: [ "series", i ],
47
- specIndex: i,
48
45
  type: filterType
49
46
  });
50
47
  })); else if (Object.values(interface_2.ComponentTypeEnum).includes(filterType)) {
51
48
  result.modelType = "component", result.type = filterType, result.specKey = null === (_d = factory_1.Factory.getComponentInKey(filterType)) || void 0 === _d ? void 0 : _d.specKey;
52
- const {specKey: specKey} = result, infoList = (0, vutils_1.array)(null !== (_e = chartSpecInfo[specKey]) && void 0 !== _e ? _e : []);
53
- null === (_g = (0, vutils_1.array)(null !== (_f = chartSpec[specKey]) && void 0 !== _f ? _f : [])) || void 0 === _g || _g.forEach(((componentSpec, i) => {
49
+ const {specKey: specKey} = result, infoList = (0, vutils_1.array)(null !== (_f = null === (_e = chartSpecInfo.component) || void 0 === _e ? void 0 : _e[specKey]) && void 0 !== _f ? _f : []);
50
+ null === (_h = (0, vutils_1.array)(null !== (_g = chartSpec[specKey]) && void 0 !== _g ? _g : [])) || void 0 === _h || _h.forEach(((componentSpec, i) => {
54
51
  const specInfo = infoList[i];
55
52
  specInfo.type === filterType && result.modelInfo.push(Object.assign(Object.assign({}, specInfo), {
56
53
  spec: componentSpec
@@ -62,8 +59,8 @@ const executeMediaQueryActionFilterType = (filterType = "chart", chartSpec, char
62
59
  result.modelType = "component";
63
60
  const specKey = filterType;
64
61
  result.specKey = specKey;
65
- const infoList = (0, vutils_1.array)(null !== (_h = chartSpecInfo[specKey]) && void 0 !== _h ? _h : []);
66
- (0, vutils_1.array)(null !== (_j = chartSpec[specKey]) && void 0 !== _j ? _j : []).forEach(((componentSpec, i) => {
62
+ const infoList = (0, vutils_1.array)(null !== (_k = null === (_j = chartSpecInfo.component) || void 0 === _j ? void 0 : _j[specKey]) && void 0 !== _k ? _k : []);
63
+ (0, vutils_1.array)(null !== (_l = chartSpec[specKey]) && void 0 !== _l ? _l : []).forEach(((componentSpec, i) => {
67
64
  const specInfo = infoList[i];
68
65
  componentTypes.includes(specInfo.type) && result.modelInfo.push(Object.assign(Object.assign({}, specInfo), {
69
66
  spec: componentSpec
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/plugin/chart/media-query/util/filter.ts"],"names":[],"mappings":";;;AAAA,6CAA4D;AAG5D,sDAAmD;AAQnD,4DAA8D;AA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,MAAM,OAAO,GAAG,UAA8B,CAAC;YAC/C,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC;YAEzB,MAAM,QAAQ,GAAG,IAAA,cAAK,EAAC,MAAA,aAAa,CAAC,OAAO,CAAC,mCAAI,EAAE,CAAC,CAAC;YACrD,IAAA,cAAK,EAAC,MAAA,SAAS,CAAC,OAAO,CAAC,mCAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,aAAa,EAAE,CAAC,EAAE,EAAE;gBAC3D,MAAM,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;gBAC7B,IAAI,cAAc,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAyB,CAAC,EAAE;oBAC/D,MAAM,CAAC,SAAS,CAAC,IAAI,iCAChB,QAAQ,KACX,IAAI,EAAE,aAAa,IACnB,CAAC;iBACJ;YACH,CAAC,CAAC,CAAC;SACJ;KACF;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AA9FW,QAAA,iCAAiC,qCA8F5C","file":"filter.js","sourcesContent":["import { array, isFunction, isNil } from '@visactor/vutils';\nimport type { IChartSpec } from '../../../../typings/spec/common';\n// eslint-disable-next-line no-duplicate-imports\nimport { Factory } from '../../../../core/factory';\nimport type {\n IMediaQueryAction,\n IMediaQueryActionFilterResult,\n IMediaQueryCondition,\n MediaQueryActionFilter,\n MediaQueryActionFilterType\n} from '../interface';\nimport { SeriesTypeEnum } from '../../../../series/interface';\nimport { ComponentTypeEnum } from '../../../../component/interface';\nimport { includeSpec } from '@visactor/vutils-extension';\nimport type { MaybeArray } from '../../../../typings';\nimport type { IChartSpecInfo } from '../../../../chart/interface';\n\n/** 执行元素过滤器 */\nexport const executeMediaQueryActionFilter = <T extends Record<string, unknown>>(\n filterType: MediaQueryActionFilterType = 'chart',\n filter: MaybeArray<MediaQueryActionFilter<T>> | undefined,\n action: IMediaQueryAction<T>,\n query: IMediaQueryCondition,\n chartSpec: any,\n chartSpecInfo: IChartSpecInfo\n): IMediaQueryActionFilterResult => {\n const result = executeMediaQueryActionFilterType<T>(filterType, chartSpec, chartSpecInfo);\n return {\n ...result,\n modelInfo: result.modelInfo.filter(info => {\n if (isNil(filter)) {\n return true;\n }\n return array(filter).some(f => {\n if (isFunction(f)) {\n return f(info, action, query);\n }\n // spec 模糊匹配\n return includeSpec(info.spec, f);\n });\n })\n };\n};\n\n/** 执行元素过滤器的 filterType 部分的筛选 */\nexport const executeMediaQueryActionFilterType = <T extends Record<string, unknown>>(\n filterType: MediaQueryActionFilterType = 'chart',\n chartSpec: any,\n chartSpecInfo: IChartSpecInfo\n): IMediaQueryActionFilterResult<T> => {\n const result: IMediaQueryActionFilterResult<T> = {\n modelInfo: []\n };\n\n if (filterType === 'chart') {\n result.isChart = true;\n result.modelInfo.push({\n spec: chartSpec,\n type: 'chart'\n });\n } else if (filterType === 'region') {\n result.modelType = 'region';\n result.specKey = 'region';\n\n chartSpec.region?.forEach((regionSpec: T, i: number) => {\n result.modelInfo.push({\n spec: regionSpec,\n specPath: ['region', i],\n specIndex: i,\n type: 'region'\n });\n });\n } else if (filterType === 'series') {\n result.modelType = 'series';\n result.specKey = 'series';\n\n chartSpec.series?.forEach((seriesSpec: T, i: number) => {\n result.modelInfo.push({\n spec: seriesSpec,\n specPath: ['series', i],\n specIndex: i,\n type: seriesSpec.type as string\n });\n });\n } else if (Object.values(SeriesTypeEnum).includes(filterType as SeriesTypeEnum)) {\n result.modelType = 'series';\n result.specKey = 'series';\n result.type = filterType as SeriesTypeEnum;\n\n chartSpec.series?.forEach((seriesSpec: T, i: number) => {\n if (seriesSpec.type === filterType) {\n result.modelInfo.push({\n spec: seriesSpec,\n specPath: ['series', i],\n specIndex: i,\n type: filterType\n });\n }\n });\n } else if (Object.values(ComponentTypeEnum).includes(filterType as ComponentTypeEnum)) {\n result.modelType = 'component';\n result.type = filterType as ComponentTypeEnum;\n result.specKey = Factory.getComponentInKey(filterType)?.specKey as keyof IChartSpec;\n\n const { specKey } = result;\n const infoList = array(chartSpecInfo[specKey] ?? []);\n array(chartSpec[specKey] ?? [])?.forEach((componentSpec, i) => {\n const specInfo = infoList[i];\n if (specInfo.type === filterType) {\n result.modelInfo.push({\n ...specInfo,\n spec: componentSpec\n });\n }\n });\n } else {\n // 根据 specKey 进行匹配\n const componentTypes = Factory.getComponents()\n .filter(({ cmp }) => cmp.specKey === filterType)\n .map(({ cmp }) => cmp.type);\n if (componentTypes.length > 0) {\n result.modelType = 'component';\n const specKey = filterType as keyof IChartSpec;\n result.specKey = specKey;\n\n const infoList = array(chartSpecInfo[specKey] ?? []);\n array(chartSpec[specKey] ?? []).forEach((componentSpec, i) => {\n const specInfo = infoList[i];\n if (componentTypes.includes(specInfo.type as ComponentTypeEnum)) {\n result.modelInfo.push({\n ...specInfo,\n spec: componentSpec\n });\n }\n });\n }\n }\n\n return result;\n};\n"]}
1
+ {"version":3,"sources":["../src/plugin/chart/media-query/util/filter.ts"],"names":[],"mappings":";;;AAAA,6CAA4D;AAG5D,sDAAmD;AAQnD,4DAA8D;AAC9D,+DAAoE;AACpE,iEAAyD;AAKlD,MAAM,6BAA6B,GAAG,CAC3C,aAAyC,OAAO,EAChD,MAAyD,EACzD,MAA4B,EAC5B,KAA2B,EAC3B,SAAc,EACd,aAA6B,EACE,EAAE;IACjC,MAAM,MAAM,GAAG,IAAA,yCAAiC,EAAI,UAAU,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;IAC1F,uCACK,MAAM,KACT,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;YACxC,IAAI,IAAA,cAAK,EAAC,MAAM,CAAC,EAAE;gBACjB,OAAO,IAAI,CAAC;aACb;YACD,OAAO,IAAA,cAAK,EAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;gBAC5B,IAAI,IAAA,mBAAU,EAAC,CAAC,CAAC,EAAE;oBACjB,OAAO,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,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2F5C","file":"filter.js","sourcesContent":["import { array, isFunction, isNil } from '@visactor/vutils';\nimport type { IChartSpec } from '../../../../typings/spec/common';\n// eslint-disable-next-line no-duplicate-imports\nimport { Factory } from '../../../../core/factory';\nimport type {\n IMediaQueryAction,\n IMediaQueryActionFilterResult,\n IMediaQueryCondition,\n MediaQueryActionFilter,\n MediaQueryActionFilterType\n} from '../interface';\nimport { SeriesTypeEnum } from '../../../../series/interface';\nimport { ComponentTypeEnum } from '../../../../component/interface';\nimport { includeSpec } from '@visactor/vutils-extension';\nimport type { MaybeArray } from '../../../../typings';\nimport type { IChartSpecInfo } from '../../../../chart/interface';\n\n/** 执行元素过滤器 */\nexport const executeMediaQueryActionFilter = <T extends Record<string, unknown>>(\n filterType: MediaQueryActionFilterType = 'chart',\n filter: MaybeArray<MediaQueryActionFilter<T>> | undefined,\n action: IMediaQueryAction<T>,\n query: IMediaQueryCondition,\n chartSpec: any,\n chartSpecInfo: IChartSpecInfo\n): IMediaQueryActionFilterResult => {\n const result = executeMediaQueryActionFilterType<T>(filterType, chartSpec, chartSpecInfo);\n return {\n ...result,\n modelInfo: result.modelInfo.filter(info => {\n if (isNil(filter)) {\n return true;\n }\n return array(filter).some(f => {\n if (isFunction(f)) {\n return f(info, action, query);\n }\n // spec 模糊匹配\n return includeSpec(info.spec, f);\n });\n })\n };\n};\n\n/** 执行元素过滤器的 filterType 部分的筛选 */\nexport const executeMediaQueryActionFilterType = <T extends Record<string, unknown>>(\n filterType: MediaQueryActionFilterType = 'chart',\n chartSpec: any,\n chartSpecInfo: IChartSpecInfo\n): IMediaQueryActionFilterResult<T> => {\n const result: IMediaQueryActionFilterResult<T> = {\n modelInfo: []\n };\n\n if (filterType === 'chart') {\n result.isChart = true;\n result.modelInfo.push({\n spec: chartSpec,\n type: 'chart'\n });\n } else if (filterType === 'region') {\n result.modelType = 'region';\n result.specKey = 'region';\n\n chartSpec.region?.forEach((regionSpec: T, i: number) => {\n result.modelInfo.push({\n spec: regionSpec,\n specPath: ['region', i],\n type: 'region'\n });\n });\n } else if (filterType === 'series') {\n result.modelType = 'series';\n result.specKey = 'series';\n\n chartSpec.series?.forEach((seriesSpec: T, i: number) => {\n result.modelInfo.push({\n spec: seriesSpec,\n specPath: ['series', i],\n type: seriesSpec.type as string\n });\n });\n } else if (Object.values(SeriesTypeEnum).includes(filterType as SeriesTypeEnum)) {\n result.modelType = 'series';\n result.specKey = 'series';\n result.type = filterType as SeriesTypeEnum;\n\n chartSpec.series?.forEach((seriesSpec: T, i: number) => {\n if (seriesSpec.type === filterType) {\n result.modelInfo.push({\n spec: seriesSpec,\n specPath: ['series', i],\n type: filterType\n });\n }\n });\n } else if (Object.values(ComponentTypeEnum).includes(filterType as ComponentTypeEnum)) {\n result.modelType = 'component';\n result.type = filterType as ComponentTypeEnum;\n result.specKey = Factory.getComponentInKey(filterType)?.specKey as keyof IChartSpec;\n\n const { specKey } = result;\n const infoList = array(chartSpecInfo.component?.[specKey] ?? []);\n array(chartSpec[specKey] ?? [])?.forEach((componentSpec, i) => {\n const specInfo = infoList[i];\n if (specInfo.type === filterType) {\n result.modelInfo.push({\n ...specInfo,\n spec: componentSpec\n });\n }\n });\n } else {\n // 根据 specKey 进行匹配\n const componentTypes = Factory.getComponents()\n .filter(({ cmp }) => cmp.specKey === filterType)\n .map(({ cmp }) => cmp.type);\n if (componentTypes.length > 0) {\n result.modelType = 'component';\n const specKey = filterType as keyof IChartSpec;\n result.specKey = specKey;\n\n const infoList = array(chartSpecInfo.component?.[specKey] ?? []);\n array(chartSpec[specKey] ?? []).forEach((componentSpec, i) => {\n const specInfo = infoList[i];\n if (componentTypes.includes(specInfo.type as ComponentTypeEnum)) {\n result.modelInfo.push({\n ...specInfo,\n spec: componentSpec\n });\n }\n });\n }\n }\n\n return result;\n};\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/plugin/components/axis-sync/axis-sync.ts"],"names":[],"mappings":";;;AAAA,mDAAqD;AACrD,iEAAmD;AAGnD,6CAA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EAAE,CAAC,kBAAU,CAAC,iBAAiB,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE;YAChG,IAAA,gCAAS,EAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QAC9B,CAAC,CAAC,CAAC;IACL,CAAC;IAED,YAAY,CAAC,OAAgC,EAAE,IAAmB;QAChE,MAAM,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,IAAI,EAAE;YACT,OAAO;SACR;QACD,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACnD,IAAI,CAAC,UAAU,EAAE;YACf,OAAO;SACR;QACD,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,IAAA,2CAAgC,EAAC,IAAI,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,gCAAS,CAAC,CAAC;YACnF,MAAM,GAAG,GAAG;gBACV,UAAU,EAAE,GAAG,EAAE,CAAC,UAAU;gBAC5B,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI;aACxB,CAAC;YAEF,IAAI,CAAC,sBAAsB,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,gBAAgB,EAAE,EAAE,KAAK,CAAC,CAAC;SACzG;IACH,CAAC;;AAnEH,wCAoEC;AAhEiB,yBAAU,GAAgB,WAAW,CAAC;AACtC,mBAAI,GAAW,gBAAgB,CAAC","file":"axis-sync.js","sourcesContent":["import { ChartEvent } from '../../../constant/event';\nimport { zeroAlign } from './zero-align-transform';\nimport type { IComponentPlugin, IComponentPluginService } from '../interface';\nimport type { CartesianAxis, ICartesianLinearAxisSpec, ILinearAxisSync } from '../../../component/axis/cartesian';\nimport { isContinuous } from '@visactor/vscale';\nimport { registerDataSetInstanceTransform } from '../../../data/register';\nimport { tickAlign } from './tick-align-transform';\nimport { BasePlugin } from '../../base/base-plugin';\n\nexport class AxisSyncPlugin\n extends BasePlugin<IComponentPluginService>\n implements IComponentPlugin<IComponentPluginService>\n{\n static readonly pluginType: 'component' = 'component';\n static readonly type: string = 'AxisSyncPlugin';\n readonly type: string = 'AxisSyncPlugin';\n\n constructor() {\n super(AxisSyncPlugin.type);\n }\n\n protected _checkEnableSync(axis: CartesianAxis): ILinearAxisSync | false {\n if (!isContinuous(axis.getScale().type)) {\n return false;\n }\n const sync = (axis.getSpec() as ICartesianLinearAxisSpec).sync as ILinearAxisSync;\n if (!sync?.axisId) {\n return false;\n }\n return sync;\n }\n\n private _getTargetAxis(axis: CartesianAxis, sync: ILinearAxisSync) {\n const targetAxis = axis.getOption().getChart().getComponentByUserId(sync.axisId) as CartesianAxis;\n if (!targetAxis?.type.startsWith('cartesianAxis')) {\n return null;\n }\n return targetAxis;\n }\n\n onInit(service: IComponentPluginService, axis: CartesianAxis) {\n const sync = this._checkEnableSync(axis);\n if (!sync) {\n return;\n }\n if (!sync.zeroAlign) {\n return;\n }\n const targetAxis = this._getTargetAxis(axis, sync);\n if (!targetAxis) {\n return;\n }\n // because of if the to axes bind in same region, the region will update them both in the data update.\n axis.event.on(ChartEvent.scaleDomainUpdate, { filter: ({ model }) => model.id === axis.id }, () => {\n zeroAlign(targetAxis, axis);\n });\n }\n\n onDidCompile(service: IComponentPluginService, axis: CartesianAxis) {\n const sync = this._checkEnableSync(axis);\n if (!sync) {\n return;\n }\n const targetAxis = this._getTargetAxis(axis, sync);\n if (!targetAxis) {\n return;\n }\n if (sync.tickAlign) {\n registerDataSetInstanceTransform(axis.getOption().dataSet, 'tickAlign', tickAlign);\n const opt = {\n targetAxis: () => targetAxis,\n currentAxis: () => axis\n };\n // only make this one follow target\n axis.addTransformToTickData({ type: 'tickAlign', options: opt, level: Number.MAX_SAFE_INTEGER }, false);\n }\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/plugin/components/axis-sync/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B","file":"index.js","sourcesContent":["export * from './axis-sync';\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/plugin/components/axis-sync/tick-align-transform.ts"],"names":[],"mappings":";;;AAEA,iEAAqE;AAO9D,MAAM,SAAS,GAAG,CAAC,IAAkB,EAAE,EAAiB,EAAE,EAAE;;IACjE,IAAI,CAAC,IAAI,EAAE;QACT,OAAO,IAAI,CAAC;KACb;IAED,MAAM,UAAU,GAAG,MAAA,EAAE,aAAF,EAAE,uBAAF,EAAE,CAAE,UAAU,kDAAI,CAAC;IACtC,IAAI,CAAC,UAAU,EAAE;QACf,OAAO,IAAI,CAAC;KACb;IACD,MAAM,WAAW,GAAG,MAAA,EAAE,aAAF,EAAE,uBAAF,EAAE,CAAE,WAAW,kDAAI,CAAC;IACxC,IAAI,CAAC,WAAW,EAAE;QAChB,OAAO,IAAI,CAAC;KACb;IACD,MAAM,WAAW,GAAG,MAAA,WAAW,CAAC,WAAW,EAAE,0CAAE,WAAW,EAAE,CAAC;IAC7D,IAAI,CAAC,WAAW,EAAE;QAChB,OAAO,IAAI,CAAC;KACb;IACD,MAAM,oBAAoB,GAAG,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC;IACrF,IAAI,CAAC,oBAAoB,EAAE;QACzB,OAAO,IAAI,CAAC;KACb;IACD,MAAM,YAAY,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC;IAC5C,IAAI,CAAC,YAAY,EAAE;QACjB,OAAO,IAAI,CAAC;KACb;IACD,MAAM,UAAU,GAAG,MAAA,MAAA,UAAU,CAAC,WAAW,EAAE,0CAAE,WAAW,EAAE,0CAAE,UAAU,CAAC;IACvE,IAAI,CAAC,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,MAAM,CAAA,EAAE;QACvB,OAAO,IAAI,CAAC;KACb;IACD,MAAM,WAAW,GAAG,UAAU,CAAC,QAAQ,EAAE,CAAC;IAC1C,IAAI,CAAC,WAAW,EAAE;QAChB,OAAO,IAAI,CAAC;KACb;IACD,MAAM,YAAY,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC;IAC1C,MAAM,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;IACtD,IAAI,WAAW,KAAK,CAAC,EAAE;QACrB,OAAO,IAAI,CAAC;KACb;IACD,MAAM,aAAa,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC;IAC5C,MAAM,YAAY,GAAG,aAAa,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;IACzD,IAAI,WAAW,KAAK,CAAC,EAAE;QACrB,OAAO,IAAI,CAAC;KACb;IAED,MAAM,QAAQ,GAAa,UAAU,CAAC,GAAG,CAAC,CAAC,CAAoB,EAAE,EAAE;QACjE,MAAM,OAAO,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC;QAC1D,OAAO,YAAY,GAAG,OAAO,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;IACH,OAAO,IAAA,0CAAuB,EAAC,QAAQ,CAAC,CAAC;AAC3C,CAAC,CAAC;AAjDW,QAAA,SAAS,aAiDpB","file":"tick-align-transform.js","sourcesContent":["import type { Datum } from '../../../typings';\nimport type { CartesianAxis } from '../../../component';\nimport { convertDomainToTickData } from '@visactor/vutils-extension';\n\nexport interface ITickAlignOpt {\n targetAxis: () => CartesianAxis;\n currentAxis: () => CartesianAxis;\n}\n\nexport const tickAlign = (data: Array<Datum>, op: ITickAlignOpt) => {\n if (!data) {\n return data;\n }\n // check align enable\n const targetAxis = op?.targetAxis?.();\n if (!targetAxis) {\n return data;\n }\n const currentAxis = op?.currentAxis?.();\n if (!currentAxis) {\n return data;\n }\n const currentData = currentAxis.getTickData()?.getDataView();\n if (!currentData) {\n return data;\n }\n const currentTickTransform = currentData.transformsArr.find(t => t.type === 'ticks');\n if (!currentTickTransform) {\n return data;\n }\n const currentScale = currentAxis.getScale();\n if (!currentScale) {\n return data;\n }\n const targetData = targetAxis.getTickData()?.getDataView()?.latestData;\n if (!targetData?.length) {\n return data;\n }\n const targetScale = targetAxis.getScale();\n if (!targetScale) {\n return data;\n }\n const targetDomain = targetScale.domain();\n const targetRange = targetDomain[1] - targetDomain[0];\n if (targetRange === 0) {\n return data;\n }\n const currentDomain = currentScale.domain();\n const currentRange = currentDomain[1] - currentDomain[0];\n if (targetRange === 0) {\n return data;\n }\n // make the tickData of the current axis consistent with the tickData of the target axis\n const newTicks: number[] = targetData.map((d: { value: number }) => {\n const percent = (d.value - targetDomain[0]) / targetRange;\n return currentRange * percent + currentDomain[0];\n });\n return convertDomainToTickData(newTicks);\n};\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/plugin/components/axis-sync/zero-align-transform.ts"],"names":[],"mappings":";;;AAAA,6CAAiD;AACjD,6CAAgD;AAchD,SAAgB,kBAAkB,CAAC,MAAgB;IACjD,OAAO,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,IAAA,sBAAa,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,IAAA,sBAAa,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC;AAC/G,CAAC;AAFD,gDAEC;AAED,SAAgB,YAAY,CAAC,IAAqB,EAAE,MAAgB;IAElE,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IACpC,MAAM,WAAW,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,C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YAAY,IAAI,CAAC,YAAY,EAAE;QACtC,IAAI,CAAC,oBAAoB,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE;YACvC,OAAO;SACR;KACF;SAEI;QAEH,IAAI,SAAS,KAAK,SAAS,EAAE;YAC3B,OAAO;SACR;aAEI,IAAI,SAAS,GAAG,SAAS,EAAE;YAC9B,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE;gBACjC,OAAO;aACR;SACF;aAEI;YACH,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE;gBACjC,OAAO;aACR;SACF;KACF;IACD,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACnB,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AACrB,CAAC,CAAC;AApIW,QAAA,SAAS,aAoIpB","file":"zero-align-transform.js","sourcesContent":["import { isValidNumber } from '@visactor/vutils';\nimport { isContinuous } from '@visactor/vscale';\nimport type { CartesianAxis } from '../../../component';\nimport type { LinearAxisMixin } from '../../../component/axis/mixin/linear-axis-mixin';\n\ntype ScaleInfo = {\n total: number;\n negative: number;\n positive: number;\n includeZero: boolean;\n extendable_min: boolean;\n extendable_max: boolean;\n domain: number[];\n};\n\nexport function isValidAlignDomain(domain: number[]): boolean {\n return domain.length === 2 && isValidNumber(domain[0]) && isValidNumber(domain[1]) && domain[1] >= domain[0];\n}\n\nexport function getScaleInfo(axis: LinearAxisMixin, domain: number[]): ScaleInfo {\n // example: -10 -20 total = 10 negative = 10\n const total = domain[1] - domain[0];\n const includeZero = domain[1] * domain[0] < 0;\n let negative = domain[0] <= 0 ? 0 - domain[0] : 0;\n let positive = domain[1] > 0 ? domain[1] - 0 : 0;\n if (total === 0) {\n if (domain[0] < 0) {\n negative = 1;\n positive = 0;\n } else if (domain[0] > 0) {\n negative = 0;\n positive = 1;\n }\n } else {\n negative = negative / total;\n positive = positive / total;\n }\n const domainSpec = axis.getDomainSpec();\n return {\n total,\n negative,\n positive,\n includeZero,\n domain,\n extendable_min: !isValidNumber(domainSpec.min),\n extendable_max: !isValidNumber(domainSpec.max)\n };\n}\n\nfunction inDifferentCrossZero(info1: ScaleInfo, info2: ScaleInfo): boolean {\n const {\n positive: positive1,\n negative: negative1,\n extendable_min: s1Extendable_min,\n extendable_max: s1Extendable_max,\n domain: domain1\n } = info1;\n const {\n positive: positive2,\n negative: negative2,\n extendable_min: s2Extendable_min,\n extendable_max: s2Extendable_max,\n domain: domain2\n } = info2;\n // make s2 percent same as s1\n if (positive2 > 0) {\n if (!s2Extendable_min) {\n return false;\n }\n let comp = negative1 / positive1;\n // if s1 could extend max, then expand s1\n // example:【0.5,0.5】 + 【0,1】 = 【0.5,1】\n if (s1Extendable_max) {\n // change s1 percent\n comp = negative1 / Math.max(positive1, positive2);\n domain1[1] = -domain1[0] / comp;\n }\n domain2[0] = -domain2[1] * comp;\n } else if (negative2 > 0) {\n if (!s2Extendable_max) {\n return false;\n }\n let comp = positive1 / negative1;\n // if s1 could extend max, then expand s1\n // example:【0.5,0.5】 + 【1,0】 = 【1,0.5】\n if (s1Extendable_min) {\n // change s1 percent\n comp = positive1 / Math.max(negative1, negative1);\n domain1[0] = -domain1[1] / comp;\n }\n domain2[1] = -domain2[0] * comp;\n }\n return true;\n}\n\nfunction inOnlyZeroDomain(info1: ScaleInfo, info2: ScaleInfo): boolean {\n const { extendable_min: s1Extendable_min, extendable_max: s1Extendable_max, domain: domain1 } = info1;\n const { positive: positive2, negative: negative2, domain: domain2 } = info2;\n // both [0,0]\n if (positive2 === 0 && negative2 === 0) {\n return false;\n }\n // 如果副轴 有正值部分 主轴无法正值扩展,跳过\n if (positive2 > 0 && !s1Extendable_max) {\n return false;\n }\n // 如果副轴 有负值部分 主轴无法负值扩展,跳过\n if (negative2 > 0 && !s1Extendable_min) {\n return false;\n }\n // 其他场景,将主轴设置为与副轴相同\n domain1[0] = domain2[0];\n domain1[1] = domain2[1];\n return true;\n}\n\nfunction inAllCrossZero(info1: ScaleInfo, info2: ScaleInfo): boolean {\n const { positive: positive1, negative: negative1, extendable_max: s1Extendable_max, domain: domain1 } = info1;\n const { positive: positive2, negative: negative2, extendable_min: s2Extendable_min, domain: domain2 } = info2;\n if (s1Extendable_max && s2Extendable_min) {\n // percent\n const comp = Math.max(negative1, negative2) / Math.max(positive1, positive2);\n domain1[1] = -domain1[0] / comp;\n domain2[0] = -domain2[1] * comp;\n }\n // only on side extendable\n else if (s2Extendable_min) {\n const comp = negative1 / positive1;\n domain2[0] = -domain2[1] * comp;\n } else if (s1Extendable_max) {\n const comp = negative2 / positive2;\n domain1[1] = -domain1[0] / comp;\n } else {\n // skip\n return false;\n }\n return true;\n}\n\nfunction inNoCrossDifferentSide(info1: ScaleInfo, info2: ScaleInfo): boolean {\n const { extendable_min: s1Extendable_min, domain: domain1 } = info1;\n const { extendable_max: s2Extendable_max, domain: domain2 } = info2;\n // extendable\n if (!s1Extendable_min || !s2Extendable_max) {\n return false;\n }\n domain1[0] = -domain1[1];\n domain2[1] = -domain2[0];\n return true;\n}\n\nexport const zeroAlign = (targetAxis: CartesianAxis, currentAxis: CartesianAxis) => {\n const s1 = targetAxis.getScale();\n const s2 = currentAxis.getScale();\n if (!s1 || !s2) {\n return;\n }\n if (!isContinuous(s1.type) || !isContinuous(s2.type)) {\n return;\n }\n const domain1 = s1.domain().slice();\n const domain2 = s2.domain().slice();\n if (!isValidAlignDomain(domain1) || !isValidAlignDomain(domain2)) {\n return;\n }\n // 先分别获取正负比例\n const info1 = getScaleInfo(<LinearAxisMixin>(<unknown>targetAxis), domain1);\n const info2 = getScaleInfo(<LinearAxisMixin>(<unknown>currentAxis), domain2);\n const {\n positive: positive1,\n negative: negative1,\n extendable_min: s1Extendable_min,\n extendable_max: s1Extendable_max,\n includeZero: includeZero1\n } = info1;\n const {\n positive: positive2,\n negative: negative2,\n extendable_min: s2Extendable_min,\n extendable_max: s2Extendable_max,\n includeZero: includeZero2\n } = info2;\n\n // first check [0,0]\n // axis 1 in [0,0]\n if (positive1 === 0 && negative1 === 0) {\n if (!inOnlyZeroDomain(info1, info2)) {\n return;\n }\n }\n // axis 2 in [0,0]\n else if (positive2 === 0 && negative2 === 0) {\n if (!inOnlyZeroDomain(info2, info1)) {\n return;\n }\n }\n // check of both of axis are not cross zero\n else if (!includeZero1 && !includeZero2) {\n // if in different side s1 * s2 < 0\n // s1 > 0 s2 < 0\n if (negative1 === 0 && positive2 === 0) {\n if (!inNoCrossDifferentSide(info1, info2)) {\n return;\n }\n }\n // s1 < 0 s2 > 0\n else if (negative2 === 0 && positive1 === 0) {\n if (!inNoCrossDifferentSide(info2, info1)) {\n return;\n }\n }\n\n // if in same side s1 * s2 > 0\n // both positive\n if (negative1 === 0 && negative2 === 0) {\n // make sure has zero\n if (domain1[0] === 0 && domain2[0] > 0) {\n if (!s2Extendable_min) {\n return;\n }\n domain2[0] = 0;\n } else if (domain2[0] === 0 && domain1[0] > 0) {\n if (!s1Extendable_min) {\n return;\n }\n domain1[0] = 0;\n } else {\n return;\n }\n }\n // both negative1\n if (positive1 === 0 && positive2 === 0) {\n // s1 has 0 in domain & s2 has not\n if (domain1[1] === 0 && domain2[1] > 0) {\n if (!s2Extendable_max) {\n return;\n }\n domain2[1] = 0;\n }\n // s2 has 0 in domain & s1 has not\n else if (domain2[1] === 0 && domain1[1] > 0) {\n if (!s1Extendable_max) {\n return;\n }\n domain1[1] = 0;\n } else {\n return;\n }\n }\n }\n // check one axis cross zero axis1\n else if (includeZero1 && !includeZero2) {\n if (!inDifferentCrossZero(info1, info2)) {\n return;\n }\n }\n // check one axis cross zero axis2\n else if (includeZero2 && !includeZero1) {\n if (!inDifferentCrossZero(info2, info1)) {\n return;\n }\n }\n // check of both of axis are cross zero\n else {\n // same percent of negative\n if (negative1 === negative2) {\n return;\n }\n // negative percent s1 > s2\n else if (negative1 > negative2) {\n if (!inAllCrossZero(info1, info2)) {\n return;\n }\n }\n // negative percent s1 < s2\n else {\n if (!inAllCrossZero(info2, info1)) {\n return;\n }\n }\n }\n s1.domain(domain1);\n s2.domain(domain2);\n};\n"]}
@@ -1,4 +1,4 @@
1
- import { AxisSyncPlugin } from './axis-sync-plugin/';
1
+ import { AxisSyncPlugin } from './axis-sync';
2
2
  declare const _default: {
3
3
  AxisSyncPlugin: typeof AxisSyncPlugin;
4
4
  };
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  });
6
6
 
7
- const axis_sync_plugin_1 = require("./axis-sync-plugin/");
7
+ const axis_sync_1 = require("./axis-sync");
8
8
 
9
9
  exports.default = {
10
- AxisSyncPlugin: axis_sync_plugin_1.AxisSyncPlugin
10
+ AxisSyncPlugin: axis_sync_1.AxisSyncPlugin
11
11
  };
12
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/plugin/components/index.ts"],"names":[],"mappings":";;AAAA,0DAAqD;AAErD,kBAAe;IACb,cAAc,EAAd,iCAAc;CACf,CAAC","file":"index.js","sourcesContent":["import { AxisSyncPlugin } from './axis-sync-plugin/';\n\nexport default {\n AxisSyncPlugin\n};\n"]}
1
+ {"version":3,"sources":["../src/plugin/components/index.ts"],"names":[],"mappings":";;AAAA,2CAA6C;AAE7C,kBAAe;IACb,cAAc,EAAd,0BAAc;CACf,CAAC","file":"index.js","sourcesContent":["import { AxisSyncPlugin } from './axis-sync';\n\nexport default {\n AxisSyncPlugin\n};\n"]}
@@ -0,0 +1,2 @@
1
+ import type { IComponentPluginConstructor } from './interface';
2
+ export declare const registerComponentPlugin: (plugin: IComponentPluginConstructor) => void;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.registerComponentPlugin = void 0;
6
+
7
+ const core_1 = require("../../core"), registerComponentPlugin = plugin => {
8
+ core_1.Factory.registerComponentPlugin(plugin.type, plugin);
9
+ };
10
+
11
+ exports.registerComponentPlugin = registerComponentPlugin;
12
+ //# sourceMappingURL=register.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/plugin/components/register.ts"],"names":[],"mappings":";;;AAAA,qCAAqC;AAG9B,MAAM,uBAAuB,GAAG,CAAC,MAAmC,EAAE,EAAE;IAC7E,cAAO,CAAC,uBAAuB,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACvD,CAAC,CAAC;AAFW,QAAA,uBAAuB,2BAElC","file":"register.js","sourcesContent":["import { Factory } from '../../core';\nimport type { IComponentPluginConstructor } from './interface';\n\nexport const registerComponentPlugin = (plugin: IComponentPluginConstructor) => {\n Factory.registerComponentPlugin(plugin.type, plugin);\n};\n"]}
@@ -1,23 +1,24 @@
1
1
  import type { Options } from './constants';
2
- import type { Maybe, ILayoutPoint } from '../../../typings';
2
+ import type { Maybe, ILayoutPoint, RenderMode } from '../../../typings';
3
3
  import type { TooltipData, IToolTipActual, TooltipActiveType, ITooltipHandler, ITooltipPattern, ITooltipPositionActual } from '../../../typings/tooltip';
4
- import type { Tooltip } from '../tooltip';
5
- import type { ITooltipSpec, TooltipHandlerParams } from '../interface';
6
- import { TooltipResult } from '../interface/common';
7
4
  import type { IGroup } from '@visactor/vrender-core';
8
5
  import type { Compiler } from '../../../compile/compiler';
9
6
  import type { IContainerSize, TooltipAttributes } from '@visactor/vrender-components';
10
7
  import type { IChartOption } from '../../../chart/interface';
8
+ import type { ITooltipSpec, Tooltip, TooltipHandlerParams } from '../../../component/tooltip';
9
+ import { TooltipResult } from '../../../component/tooltip';
10
+ import type { IComponentPlugin, IComponentPluginService } from '../interface';
11
+ import { BasePlugin } from '../../base/base-plugin';
11
12
  type ChangeTooltipFunc = (visible: boolean, params: TooltipHandlerParams, changePositionOnly?: boolean, activeType?: TooltipActiveType, data?: TooltipData) => TooltipResult;
12
13
  type ChangeTooltipPositionFunc = (changePositionOnly: boolean, data: TooltipData, params: TooltipHandlerParams) => TooltipResult;
13
- export declare abstract class BaseTooltipHandler implements ITooltipHandler {
14
+ export declare abstract class BaseTooltipHandler extends BasePlugin implements ITooltipHandler, IComponentPlugin {
15
+ static readonly pluginType: 'component';
16
+ static readonly specKey = "tooltip";
14
17
  readonly type: string;
15
18
  protected _visible: boolean;
16
19
  protected _option: Options;
17
20
  protected _chartOption: IChartOption;
18
- protected _id: string;
19
- get id(): string;
20
- protected _env: "desktop-browser" | "mobile-browser" | "node" | "worker" | "miniApp" | "wx" | "desktop-miniApp" | "lynx";
21
+ protected _env: RenderMode;
21
22
  get env(): "desktop-browser" | "mobile-browser" | "node" | "worker" | "miniApp" | "wx" | "desktop-miniApp" | "lynx";
22
23
  protected _component: Tooltip;
23
24
  protected _attributes?: TooltipAttributes | null;
@@ -33,7 +34,7 @@ export declare abstract class BaseTooltipHandler implements ITooltipHandler {
33
34
  protected _cacheTooltipSize: IContainerSize;
34
35
  protected _container: Maybe<IGroup | HTMLElement>;
35
36
  protected _isReleased: boolean;
36
- constructor(tooltipId: string, component: Tooltip);
37
+ onAdd(service: IComponentPluginService<any>): void;
37
38
  showTooltip: (activeType: TooltipActiveType, data: TooltipData, params: TooltipHandlerParams) => TooltipResult;
38
39
  protected changeTooltip: ChangeTooltipFunc;
39
40
  protected _changeTooltip: ChangeTooltipFunc;
@@ -4,17 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.BaseTooltipHandler = void 0;
6
6
 
7
- const base_1 = require("../../../constant/base"), constants_1 = require("./constants"), position_1 = require("../../../typings/tooltip/position"), env_1 = require("../../../util/env"), common_1 = require("./utils/common"), position_2 = require("./utils/position"), compose_1 = require("./utils/compose"), get_spec_1 = require("./utils/get-spec"), common_2 = require("../interface/common"), vutils_1 = require("@visactor/vutils"), attribute_1 = require("./utils/attribute");
7
+ const base_1 = require("../../../constant/base"), constants_1 = require("./constants"), position_1 = require("../../../typings/tooltip/position"), env_1 = require("../../../util/env"), common_1 = require("./utils/common"), position_2 = require("./utils/position"), compose_1 = require("./utils/compose"), get_spec_1 = require("./utils/get-spec"), vutils_1 = require("@visactor/vutils"), attribute_1 = require("./utils/attribute"), tooltip_1 = require("../../../component/tooltip"), base_plugin_1 = require("../../base/base-plugin");
8
8
 
9
- class BaseTooltipHandler {
10
- get id() {
11
- return this._id;
12
- }
13
- get env() {
14
- return this._env;
15
- }
16
- constructor(tooltipId, component) {
17
- this._visible = !0, this._id = "", this._attributes = null, this._isReleased = !1,
9
+ class BaseTooltipHandler extends base_plugin_1.BasePlugin {
10
+ constructor() {
11
+ super(...arguments), this._visible = !0, this._attributes = null, this._isReleased = !1,
18
12
  this.showTooltip = (activeType, data, params) => {
19
13
  var _a;
20
14
  let changePositionOnly = !!params.changePositionOnly;
@@ -23,48 +17,48 @@ class BaseTooltipHandler {
23
17
  }, this._changeTooltip = (visible, params, changePositionOnly, activeType, data) => {
24
18
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
25
19
  const tooltipSpec = this._component.getSpec();
26
- if (this._isReleased || !tooltipSpec) return common_2.TooltipResult.failed;
27
- if (!visible) return this._clearAllCache(), tooltipSpec.handler ? null !== (_c = null === (_b = (_a = tooltipSpec.handler).hideTooltip) || void 0 === _b ? void 0 : _b.call(_a, params)) && void 0 !== _c ? _c : common_2.TooltipResult.success : (this._updateTooltip(!1, params),
28
- common_2.TooltipResult.success);
29
- if ((0, vutils_1.isNil)(activeType) || (0, vutils_1.isNil)(data)) return common_2.TooltipResult.failed;
20
+ if (this._isReleased || !tooltipSpec) return tooltip_1.TooltipResult.failed;
21
+ if (!visible) return this._clearAllCache(), tooltipSpec.handler ? null !== (_c = null === (_b = (_a = tooltipSpec.handler).hideTooltip) || void 0 === _b ? void 0 : _b.call(_a, params)) && void 0 !== _c ? _c : tooltip_1.TooltipResult.success : (this._updateTooltip(!1, params),
22
+ tooltip_1.TooltipResult.success);
23
+ if ((0, vutils_1.isNil)(activeType) || (0, vutils_1.isNil)(data)) return tooltip_1.TooltipResult.failed;
30
24
  let spec;
31
25
  if (changePositionOnly && this._cacheViewSpec ? spec = this._cacheViewSpec : (spec = (0,
32
26
  get_spec_1.getTooltipSpecForShow)(activeType, tooltipSpec, params.model, params.dimensionInfo),
33
- this._cacheViewSpec = spec), !1 === spec.visible) return common_2.TooltipResult.failed;
34
- if (spec.handler) return null !== (_f = null === (_e = (_d = spec.handler).showTooltip) || void 0 === _e ? void 0 : _e.call(_d, activeType, data, params)) && void 0 !== _f ? _f : common_2.TooltipResult.success;
27
+ this._cacheViewSpec = spec), !1 === spec.visible) return tooltip_1.TooltipResult.failed;
28
+ if (spec.handler) return null !== (_f = null === (_e = (_d = spec.handler).showTooltip) || void 0 === _e ? void 0 : _e.call(_d, activeType, data, params)) && void 0 !== _f ? _f : tooltip_1.TooltipResult.success;
35
29
  const pattern = spec[activeType];
36
- if (!pattern) return common_2.TooltipResult.failed;
30
+ if (!pattern) return tooltip_1.TooltipResult.failed;
37
31
  let actualTooltip;
38
32
  return changePositionOnly && this._cacheActualTooltip ? actualTooltip = this._cacheActualTooltip : (actualTooltip = this._getActualTooltipContent(pattern, data, params),
39
33
  actualTooltip.title = null !== (_h = null === (_g = pattern.updateTitle) || void 0 === _g ? void 0 : _g.call(pattern, actualTooltip.title, data, params)) && void 0 !== _h ? _h : actualTooltip.title,
40
34
  actualTooltip.content = null !== (_k = null === (_j = pattern.updateContent) || void 0 === _j ? void 0 : _j.call(pattern, actualTooltip.content, data, params)) && void 0 !== _k ? _k : actualTooltip.content),
41
35
  (0, vutils_1.isNil)(null === (_l = actualTooltip.title) || void 0 === _l ? void 0 : _l.key) && (0,
42
- vutils_1.isNil)(null === (_m = actualTooltip.title) || void 0 === _m ? void 0 : _m.value) && !(null === (_o = actualTooltip.content) || void 0 === _o ? void 0 : _o.length) ? common_2.TooltipResult.failed : (this._cacheActualTooltip = actualTooltip,
36
+ vutils_1.isNil)(null === (_m = actualTooltip.title) || void 0 === _m ? void 0 : _m.value) && !(null === (_o = actualTooltip.content) || void 0 === _o ? void 0 : _o.length) ? tooltip_1.TooltipResult.failed : (this._cacheActualTooltip = actualTooltip,
43
37
  this._changeTooltipPosition(!!changePositionOnly, data, params));
44
38
  }, this._changeTooltipPosition = (changePositionOnly, data, params) => {
45
39
  var _a, _b, _c;
46
- if (this._isReleased) return common_2.TooltipResult.failed;
40
+ if (this._isReleased) return tooltip_1.TooltipResult.failed;
47
41
  const event = params.event, spec = this._cacheViewSpec, actualTooltip = this._cacheActualTooltip;
48
- if (!spec || !actualTooltip) return common_2.TooltipResult.failed;
42
+ if (!spec || !actualTooltip) return tooltip_1.TooltipResult.failed;
49
43
  if (spec.enterable) {
50
44
  if (!this._isPointerEscaped && this._isPointerMovingToTooltip(params)) return this._isTooltipPaused || (this._isTooltipPaused = !0,
51
45
  this._cachePointerTimer = setTimeout((() => {
52
46
  this._isPointerEscaped = !0;
53
- }), 300)), common_2.TooltipResult.success;
47
+ }), 300)), tooltip_1.TooltipResult.success;
54
48
  this._isTooltipPaused = !1, this._isPointerEscaped = !1, clearTimeout(this._cachePointerTimer),
55
49
  this._cachePointerPosition = this._getPointerPositionRelativeToTooltipParent(params);
56
50
  }
57
51
  const activeType = actualTooltip.activeType;
58
- if (spec.handler) return null !== (_c = null === (_b = (_a = spec.handler).showTooltip) || void 0 === _b ? void 0 : _b.call(_a, activeType, data, params)) && void 0 !== _c ? _c : common_2.TooltipResult.success;
52
+ if (spec.handler) return null !== (_c = null === (_b = (_a = spec.handler).showTooltip) || void 0 === _b ? void 0 : _b.call(_a, activeType, data, params)) && void 0 !== _c ? _c : tooltip_1.TooltipResult.success;
59
53
  const pattern = spec[activeType];
60
- if (!pattern) return common_2.TooltipResult.failed;
54
+ if (!pattern) return tooltip_1.TooltipResult.failed;
61
55
  const position = this._getActualTooltipPosition(actualTooltip, params, this._getTooltipBoxSize(actualTooltip, changePositionOnly));
62
56
  actualTooltip.position = position, pattern.updatePosition && (actualTooltip.position = pattern.updatePosition(actualTooltip.position, data, params));
63
57
  let tooltipVisible = !1 !== (null == pattern ? void 0 : pattern.visible);
64
58
  return data && "pointerout" !== event.type && actualTooltip.visible && (actualTooltip.title || actualTooltip.content) || (tooltipVisible = !1),
65
59
  this._updateTooltip(tooltipVisible, Object.assign(Object.assign({}, params), {
66
60
  changePositionOnly: changePositionOnly
67
- }), actualTooltip), common_2.TooltipResult.success;
61
+ }), actualTooltip), tooltip_1.TooltipResult.success;
68
62
  }, this._getActualTooltipContent = (pattern, data, params) => {
69
63
  const patternVisible = (0, common_1.getTooltipPatternValue)(pattern.visible, data, params);
70
64
  let tooltipContent = null;
@@ -233,9 +227,17 @@ class BaseTooltipHandler {
233
227
  width: tooltipBoxWidth,
234
228
  height: tooltipBoxHeight
235
229
  }, result;
236
- }, this._component = component, this._chartOption = component.getOption(), this._env = this._chartOption.mode,
230
+ };
231
+ }
232
+ get env() {
233
+ return this._env;
234
+ }
235
+ onAdd(service) {
236
+ super.onAdd(service);
237
+ const component = service.component;
238
+ this._component = component, this._chartOption = component.getOption(), this._env = this._chartOption.mode,
237
239
  this._chartContainer = this._chartOption.globalInstance.getContainer(), this._compiler = component.getCompiler(),
238
- this._id = tooltipId, this._initFromSpec();
240
+ this._initFromSpec();
239
241
  }
240
242
  hideTooltip(params) {
241
243
  return this.changeTooltip(!1, params);
@@ -354,5 +356,5 @@ class BaseTooltipHandler {
354
356
  }
355
357
  }
356
358
 
357
- exports.BaseTooltipHandler = BaseTooltipHandler;
359
+ exports.BaseTooltipHandler = BaseTooltipHandler, BaseTooltipHandler.specKey = "tooltip";
358
360
  //# sourceMappingURL=base.js.map