@visactor/vchart 1.10.0-alpha.8 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (435) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.js +775 -509
  3. package/build/index.min.js +1 -1
  4. package/build/tsconfig.tsbuildinfo +1 -1
  5. package/cjs/chart/area/area-transformer.js +1 -2
  6. package/cjs/chart/area/area-transformer.js.map +1 -1
  7. package/cjs/chart/base/base-chart-transformer.js +6 -8
  8. package/cjs/chart/base/base-chart-transformer.js.map +1 -1
  9. package/cjs/chart/base/base-chart.js +3 -5
  10. package/cjs/chart/base/base-chart.js.map +1 -1
  11. package/cjs/chart/base/util.d.ts +2 -2
  12. package/cjs/chart/base/util.js.map +1 -1
  13. package/cjs/chart/interface/chart.js.map +1 -1
  14. package/cjs/chart/interface/common.d.ts +1 -5
  15. package/cjs/chart/interface/common.js.map +1 -1
  16. package/cjs/chart/map/map-transformer.js.map +1 -1
  17. package/cjs/chart/sequence/interface.d.ts +2 -2
  18. package/cjs/chart/sequence/interface.js.map +1 -1
  19. package/cjs/chart/sequence/sequence-transformer.js.map +1 -1
  20. package/cjs/compile/compilable-base.js +1 -1
  21. package/cjs/compile/compilable-base.js.map +1 -1
  22. package/cjs/compile/compiler.d.ts +1 -0
  23. package/cjs/compile/compiler.js +11 -9
  24. package/cjs/compile/compiler.js.map +1 -1
  25. package/cjs/component/axis/base-axis.js +2 -2
  26. package/cjs/component/axis/base-axis.js.map +1 -1
  27. package/cjs/component/axis/polar/axis.js.map +1 -1
  28. package/cjs/component/base/base-component.js +1 -1
  29. package/cjs/component/base/base-component.js.map +1 -1
  30. package/cjs/component/brush/brush.d.ts +8 -0
  31. package/cjs/component/brush/brush.js +71 -16
  32. package/cjs/component/brush/brush.js.map +1 -1
  33. package/cjs/component/brush/interface.d.ts +4 -0
  34. package/cjs/component/brush/interface.js.map +1 -1
  35. package/cjs/component/crosshair/base.js +1 -1
  36. package/cjs/component/crosshair/base.js.map +1 -1
  37. package/cjs/component/crosshair/cartesian.js +8 -4
  38. package/cjs/component/crosshair/cartesian.js.map +1 -1
  39. package/cjs/component/crosshair/polar.js +4 -2
  40. package/cjs/component/crosshair/polar.js.map +1 -1
  41. package/cjs/component/crosshair/utils/cartesian.d.ts +2 -0
  42. package/cjs/component/crosshair/utils/cartesian.js +4 -0
  43. package/cjs/component/crosshair/utils/cartesian.js.map +1 -1
  44. package/cjs/component/custom-mark/custom-mark.d.ts +1 -0
  45. package/cjs/component/custom-mark/custom-mark.js +12 -1
  46. package/cjs/component/custom-mark/custom-mark.js.map +1 -1
  47. package/cjs/component/data-zoom/data-filter-base-component.d.ts +2 -2
  48. package/cjs/component/data-zoom/data-filter-base-component.js +12 -10
  49. package/cjs/component/data-zoom/data-filter-base-component.js.map +1 -1
  50. package/cjs/component/data-zoom/data-zoom/data-zoom.d.ts +2 -0
  51. package/cjs/component/data-zoom/data-zoom/data-zoom.js +20 -9
  52. package/cjs/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
  53. package/cjs/component/data-zoom/data-zoom/interface.d.ts +1 -0
  54. package/cjs/component/data-zoom/data-zoom/interface.js.map +1 -1
  55. package/cjs/component/data-zoom/interface.d.ts +2 -0
  56. package/cjs/component/data-zoom/interface.js.map +1 -1
  57. package/cjs/component/data-zoom/scroll-bar/scroll-bar.js +2 -1
  58. package/cjs/component/data-zoom/scroll-bar/scroll-bar.js.map +1 -1
  59. package/cjs/component/data-zoom/util.js +5 -1
  60. package/cjs/component/data-zoom/util.js.map +1 -1
  61. package/cjs/component/geo/geo-coordinate.js.map +1 -1
  62. package/cjs/component/indicator/indicator.js.map +1 -1
  63. package/cjs/component/label/base-label.d.ts +2 -1
  64. package/cjs/component/label/base-label.js +3 -0
  65. package/cjs/component/label/base-label.js.map +1 -1
  66. package/cjs/component/label/label.d.ts +1 -2
  67. package/cjs/component/label/label.js +7 -10
  68. package/cjs/component/label/label.js.map +1 -1
  69. package/cjs/component/label/total-label.d.ts +1 -0
  70. package/cjs/component/label/total-label.js +9 -1
  71. package/cjs/component/label/total-label.js.map +1 -1
  72. package/cjs/component/tooltip/constant.d.ts +5 -0
  73. package/cjs/component/tooltip/constant.js +13 -0
  74. package/cjs/component/tooltip/constant.js.map +1 -0
  75. package/cjs/component/tooltip/index.d.ts +1 -0
  76. package/cjs/component/tooltip/index.js +1 -1
  77. package/cjs/component/tooltip/index.js.map +1 -1
  78. package/cjs/component/tooltip/interface/spec.d.ts +4 -3
  79. package/cjs/component/tooltip/interface/spec.js.map +1 -1
  80. package/cjs/component/tooltip/tooltip-transformer.d.ts +2 -0
  81. package/cjs/component/tooltip/tooltip-transformer.js +14 -1
  82. package/cjs/component/tooltip/tooltip-transformer.js.map +1 -1
  83. package/cjs/component/tooltip/tooltip.d.ts +3 -3
  84. package/cjs/component/tooltip/tooltip.js +28 -48
  85. package/cjs/component/tooltip/tooltip.js.map +1 -1
  86. package/cjs/core/index.d.ts +1 -1
  87. package/cjs/core/index.js +1 -1
  88. package/cjs/core/index.js.map +1 -1
  89. package/cjs/core/vchart.d.ts +4 -1
  90. package/cjs/core/vchart.js +47 -49
  91. package/cjs/core/vchart.js.map +1 -1
  92. package/cjs/event/event-dispatcher.d.ts +1 -0
  93. package/cjs/event/event-dispatcher.js +4 -1
  94. package/cjs/event/event-dispatcher.js.map +1 -1
  95. package/cjs/event/event.js +1 -1
  96. package/cjs/event/event.js.map +1 -1
  97. package/cjs/event/interface.d.ts +2 -1
  98. package/cjs/event/interface.js.map +1 -1
  99. package/cjs/interaction/index.d.ts +1 -0
  100. package/cjs/interaction/index.js +50 -0
  101. package/cjs/interaction/index.js.map +1 -0
  102. package/cjs/interaction/interface.js +1 -1
  103. package/cjs/interaction/zoom/zoomable.js +4 -6
  104. package/cjs/interaction/zoom/zoomable.js.map +1 -1
  105. package/cjs/model/interface.d.ts +3 -8
  106. package/cjs/model/interface.js.map +1 -1
  107. package/cjs/plugin/base/base-plugin-service.d.ts +2 -2
  108. package/cjs/plugin/base/base-plugin-service.js +5 -5
  109. package/cjs/plugin/base/base-plugin-service.js.map +1 -1
  110. package/cjs/plugin/base/base-plugin.d.ts +1 -0
  111. package/cjs/plugin/base/base-plugin.js +3 -0
  112. package/cjs/plugin/base/base-plugin.js.map +1 -1
  113. package/cjs/plugin/base/interface.d.ts +3 -3
  114. package/cjs/plugin/base/interface.js.map +1 -1
  115. package/cjs/plugin/chart/formatter/formatter.d.ts +2 -2
  116. package/cjs/plugin/chart/formatter/formatter.js +5 -7
  117. package/cjs/plugin/chart/formatter/formatter.js.map +1 -1
  118. package/cjs/plugin/chart/media-query/media-query.d.ts +1 -1
  119. package/cjs/plugin/chart/media-query/media-query.js +4 -4
  120. package/cjs/plugin/chart/media-query/media-query.js.map +1 -1
  121. package/cjs/plugin/chart/plugin-service.d.ts +1 -0
  122. package/cjs/plugin/chart/plugin-service.js +3 -0
  123. package/cjs/plugin/chart/plugin-service.js.map +1 -1
  124. package/cjs/plugin/components/plugin-service.d.ts +1 -0
  125. package/cjs/plugin/components/plugin-service.js +3 -0
  126. package/cjs/plugin/components/plugin-service.js.map +1 -1
  127. package/cjs/plugin/components/tooltip-handler/canvas/canvas-tooltip-handler.js +3 -3
  128. package/cjs/plugin/components/tooltip-handler/canvas/canvas-tooltip-handler.js.map +1 -1
  129. package/cjs/plugin/components/tooltip-handler/constants.d.ts +0 -5
  130. package/cjs/plugin/components/tooltip-handler/constants.js +4 -9
  131. package/cjs/plugin/components/tooltip-handler/constants.js.map +1 -1
  132. package/cjs/plugin/components/tooltip-handler/dom/dom-tooltip-handler.js +3 -3
  133. package/cjs/plugin/components/tooltip-handler/dom/dom-tooltip-handler.js.map +1 -1
  134. package/cjs/plugin/components/tooltip-handler/utils/position.d.ts +1 -0
  135. package/cjs/region/interface.d.ts +2 -1
  136. package/cjs/region/interface.js.map +1 -1
  137. package/cjs/region/region.js +1 -1
  138. package/cjs/region/region.js.map +1 -1
  139. package/cjs/series/area/area-transformer.d.ts +1 -0
  140. package/cjs/series/area/area-transformer.js +4 -1
  141. package/cjs/series/area/area-transformer.js.map +1 -1
  142. package/cjs/series/area/area.d.ts +0 -1
  143. package/cjs/series/area/area.js +1 -1
  144. package/cjs/series/area/area.js.map +1 -1
  145. package/cjs/series/area/interface.d.ts +6 -1
  146. package/cjs/series/area/interface.js.map +1 -1
  147. package/cjs/series/bar/bar-transformer.d.ts +1 -0
  148. package/cjs/series/bar/bar-transformer.js +3 -0
  149. package/cjs/series/bar/bar-transformer.js.map +1 -1
  150. package/cjs/series/bar/bar.d.ts +0 -1
  151. package/cjs/series/bar/bar.js +2 -2
  152. package/cjs/series/bar/bar.js.map +1 -1
  153. package/cjs/series/base/base-series-transformer.d.ts +5 -3
  154. package/cjs/series/base/base-series-transformer.js +9 -2
  155. package/cjs/series/base/base-series-transformer.js.map +1 -1
  156. package/cjs/series/base/base-series.d.ts +0 -4
  157. package/cjs/series/base/base-series.js +12 -17
  158. package/cjs/series/base/base-series.js.map +1 -1
  159. package/cjs/series/cartesian/cartesian.js +3 -3
  160. package/cjs/series/cartesian/cartesian.js.map +1 -1
  161. package/cjs/series/funnel/funnel.js +2 -1
  162. package/cjs/series/funnel/funnel.js.map +1 -1
  163. package/cjs/series/gauge/gauge-pointer-transformer.d.ts +5 -0
  164. package/cjs/series/gauge/gauge-pointer-transformer.js +16 -0
  165. package/cjs/series/gauge/gauge-pointer-transformer.js.map +1 -0
  166. package/cjs/series/gauge/gauge-pointer.d.ts +3 -1
  167. package/cjs/series/gauge/gauge-pointer.js +4 -4
  168. package/cjs/series/gauge/gauge-pointer.js.map +1 -1
  169. package/cjs/series/gauge/gauge-transformer.d.ts +1 -0
  170. package/cjs/series/gauge/gauge-transformer.js +3 -0
  171. package/cjs/series/gauge/gauge-transformer.js.map +1 -1
  172. package/cjs/series/gauge/gauge.d.ts +0 -1
  173. package/cjs/series/gauge/gauge.js +1 -1
  174. package/cjs/series/gauge/gauge.js.map +1 -1
  175. package/cjs/series/interface/common.d.ts +6 -2
  176. package/cjs/series/interface/common.js.map +1 -1
  177. package/cjs/series/map/geo-source.d.ts +1 -1
  178. package/cjs/series/map/geo-source.js.map +1 -1
  179. package/cjs/series/polar/progress-like/progress-like.d.ts +0 -1
  180. package/cjs/series/polar/progress-like/progress-like.js +5 -5
  181. package/cjs/series/polar/progress-like/progress-like.js.map +1 -1
  182. package/cjs/series/polar/rose-like/rose-like.js +1 -1
  183. package/cjs/series/polar/rose-like/rose-like.js.map +1 -1
  184. package/cjs/series/progress/circular/circular-transformer.d.ts +5 -0
  185. package/cjs/series/progress/circular/circular-transformer.js +16 -0
  186. package/cjs/series/progress/circular/circular-transformer.js.map +1 -0
  187. package/cjs/series/progress/circular/circular.d.ts +3 -0
  188. package/cjs/series/progress/circular/circular.js +6 -6
  189. package/cjs/series/progress/circular/circular.js.map +1 -1
  190. package/cjs/series/radar/radar.js +2 -2
  191. package/cjs/series/radar/radar.js.map +1 -1
  192. package/cjs/series/range-column/range-column-transformer.d.ts +1 -0
  193. package/cjs/series/range-column/range-column-transformer.js +3 -0
  194. package/cjs/series/range-column/range-column-transformer.js.map +1 -1
  195. package/cjs/series/range-column/range-column.d.ts +0 -1
  196. package/cjs/series/range-column/range-column.js +1 -2
  197. package/cjs/series/range-column/range-column.js.map +1 -1
  198. package/cjs/series/rose/rose-transformer.d.ts +1 -0
  199. package/cjs/series/rose/rose-transformer.js +3 -0
  200. package/cjs/series/rose/rose-transformer.js.map +1 -1
  201. package/cjs/series/rose/rose.d.ts +0 -1
  202. package/cjs/series/rose/rose.js +2 -2
  203. package/cjs/series/rose/rose.js.map +1 -1
  204. package/cjs/series/waterfall/waterfall-transformer.d.ts +1 -0
  205. package/cjs/series/waterfall/waterfall-transformer.js +3 -0
  206. package/cjs/series/waterfall/waterfall-transformer.js.map +1 -1
  207. package/cjs/series/waterfall/waterfall.d.ts +0 -1
  208. package/cjs/series/waterfall/waterfall.js +1 -1
  209. package/cjs/series/waterfall/waterfall.js.map +1 -1
  210. package/cjs/theme/builtin/common/series/area.js +2 -1
  211. package/cjs/theme/builtin/common/series/area.js.map +1 -1
  212. package/cjs/typings/spec/common.d.ts +2 -2
  213. package/cjs/typings/spec/common.js.map +1 -1
  214. package/cjs/typings/spec/index.d.ts +1 -1
  215. package/cjs/typings/spec/index.js.map +1 -1
  216. package/cjs/vchart-all.js +2 -2
  217. package/cjs/vchart-all.js.map +1 -1
  218. package/cjs/vchart-simple.js +2 -2
  219. package/cjs/vchart-simple.js.map +1 -1
  220. package/esm/chart/area/area-transformer.js +1 -2
  221. package/esm/chart/area/area-transformer.js.map +1 -1
  222. package/esm/chart/base/base-chart-transformer.js +6 -8
  223. package/esm/chart/base/base-chart-transformer.js.map +1 -1
  224. package/esm/chart/base/base-chart.js +3 -5
  225. package/esm/chart/base/base-chart.js.map +1 -1
  226. package/esm/chart/base/util.d.ts +2 -2
  227. package/esm/chart/base/util.js.map +1 -1
  228. package/esm/chart/interface/chart.js.map +1 -1
  229. package/esm/chart/interface/common.d.ts +1 -5
  230. package/esm/chart/interface/common.js.map +1 -1
  231. package/esm/chart/map/map-transformer.js.map +1 -1
  232. package/esm/chart/sequence/interface.d.ts +2 -2
  233. package/esm/chart/sequence/interface.js.map +1 -1
  234. package/esm/chart/sequence/sequence-transformer.js.map +1 -1
  235. package/esm/compile/compilable-base.js +1 -1
  236. package/esm/compile/compilable-base.js.map +1 -1
  237. package/esm/compile/compiler.d.ts +1 -0
  238. package/esm/compile/compiler.js +11 -9
  239. package/esm/compile/compiler.js.map +1 -1
  240. package/esm/component/axis/base-axis.js +2 -2
  241. package/esm/component/axis/base-axis.js.map +1 -1
  242. package/esm/component/axis/polar/axis.js.map +1 -1
  243. package/esm/component/base/base-component.js +1 -1
  244. package/esm/component/base/base-component.js.map +1 -1
  245. package/esm/component/brush/brush.d.ts +8 -0
  246. package/esm/component/brush/brush.js +71 -16
  247. package/esm/component/brush/brush.js.map +1 -1
  248. package/esm/component/brush/interface.d.ts +4 -0
  249. package/esm/component/brush/interface.js.map +1 -1
  250. package/esm/component/crosshair/base.js +1 -1
  251. package/esm/component/crosshair/base.js.map +1 -1
  252. package/esm/component/crosshair/cartesian.js +8 -4
  253. package/esm/component/crosshair/cartesian.js.map +1 -1
  254. package/esm/component/crosshair/polar.js +4 -2
  255. package/esm/component/crosshair/polar.js.map +1 -1
  256. package/esm/component/crosshair/utils/cartesian.d.ts +2 -0
  257. package/esm/component/crosshair/utils/cartesian.js +4 -0
  258. package/esm/component/crosshair/utils/cartesian.js.map +1 -1
  259. package/esm/component/custom-mark/custom-mark.d.ts +1 -0
  260. package/esm/component/custom-mark/custom-mark.js +13 -0
  261. package/esm/component/custom-mark/custom-mark.js.map +1 -1
  262. package/esm/component/data-zoom/data-filter-base-component.d.ts +2 -2
  263. package/esm/component/data-zoom/data-filter-base-component.js +12 -10
  264. package/esm/component/data-zoom/data-filter-base-component.js.map +1 -1
  265. package/esm/component/data-zoom/data-zoom/data-zoom.d.ts +2 -0
  266. package/esm/component/data-zoom/data-zoom/data-zoom.js +21 -10
  267. package/esm/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
  268. package/esm/component/data-zoom/data-zoom/interface.d.ts +1 -0
  269. package/esm/component/data-zoom/data-zoom/interface.js.map +1 -1
  270. package/esm/component/data-zoom/interface.d.ts +2 -0
  271. package/esm/component/data-zoom/interface.js.map +1 -1
  272. package/esm/component/data-zoom/scroll-bar/scroll-bar.js +3 -2
  273. package/esm/component/data-zoom/scroll-bar/scroll-bar.js.map +1 -1
  274. package/esm/component/data-zoom/util.js +5 -1
  275. package/esm/component/data-zoom/util.js.map +1 -1
  276. package/esm/component/geo/geo-coordinate.js.map +1 -1
  277. package/esm/component/indicator/indicator.js.map +1 -1
  278. package/esm/component/label/base-label.d.ts +2 -1
  279. package/esm/component/label/base-label.js +3 -0
  280. package/esm/component/label/base-label.js.map +1 -1
  281. package/esm/component/label/label.d.ts +1 -2
  282. package/esm/component/label/label.js +8 -9
  283. package/esm/component/label/label.js.map +1 -1
  284. package/esm/component/label/total-label.d.ts +1 -0
  285. package/esm/component/label/total-label.js +10 -0
  286. package/esm/component/label/total-label.js.map +1 -1
  287. package/esm/component/tooltip/constant.d.ts +5 -0
  288. package/esm/component/tooltip/constant.js +8 -0
  289. package/esm/component/tooltip/constant.js.map +1 -0
  290. package/esm/component/tooltip/index.d.ts +1 -0
  291. package/esm/component/tooltip/index.js +2 -0
  292. package/esm/component/tooltip/index.js.map +1 -1
  293. package/esm/component/tooltip/interface/spec.d.ts +4 -3
  294. package/esm/component/tooltip/interface/spec.js.map +1 -1
  295. package/esm/component/tooltip/tooltip-transformer.d.ts +2 -0
  296. package/esm/component/tooltip/tooltip-transformer.js +16 -1
  297. package/esm/component/tooltip/tooltip-transformer.js.map +1 -1
  298. package/esm/component/tooltip/tooltip.d.ts +3 -3
  299. package/esm/component/tooltip/tooltip.js +29 -45
  300. package/esm/component/tooltip/tooltip.js.map +1 -1
  301. package/esm/core/index.d.ts +1 -1
  302. package/esm/core/index.js +1 -1
  303. package/esm/core/index.js.map +1 -1
  304. package/esm/core/vchart.d.ts +4 -1
  305. package/esm/core/vchart.js +50 -49
  306. package/esm/core/vchart.js.map +1 -1
  307. package/esm/event/event-dispatcher.d.ts +1 -0
  308. package/esm/event/event-dispatcher.js +4 -1
  309. package/esm/event/event-dispatcher.js.map +1 -1
  310. package/esm/event/event.js +1 -1
  311. package/esm/event/event.js.map +1 -1
  312. package/esm/event/interface.d.ts +2 -1
  313. package/esm/event/interface.js.map +1 -1
  314. package/esm/interaction/index.d.ts +1 -0
  315. package/esm/interaction/index.js +2 -0
  316. package/esm/interaction/index.js.map +1 -0
  317. package/esm/interaction/interface.js +1 -1
  318. package/esm/interaction/zoom/zoomable.js +4 -6
  319. package/esm/interaction/zoom/zoomable.js.map +1 -1
  320. package/esm/model/interface.d.ts +3 -8
  321. package/esm/model/interface.js.map +1 -1
  322. package/esm/plugin/base/base-plugin-service.d.ts +2 -2
  323. package/esm/plugin/base/base-plugin-service.js +5 -5
  324. package/esm/plugin/base/base-plugin-service.js.map +1 -1
  325. package/esm/plugin/base/base-plugin.d.ts +1 -0
  326. package/esm/plugin/base/base-plugin.js +3 -0
  327. package/esm/plugin/base/base-plugin.js.map +1 -1
  328. package/esm/plugin/base/interface.d.ts +3 -3
  329. package/esm/plugin/base/interface.js.map +1 -1
  330. package/esm/plugin/chart/formatter/formatter.d.ts +2 -2
  331. package/esm/plugin/chart/formatter/formatter.js +5 -7
  332. package/esm/plugin/chart/formatter/formatter.js.map +1 -1
  333. package/esm/plugin/chart/media-query/media-query.d.ts +1 -1
  334. package/esm/plugin/chart/media-query/media-query.js +4 -4
  335. package/esm/plugin/chart/media-query/media-query.js.map +1 -1
  336. package/esm/plugin/chart/plugin-service.d.ts +1 -0
  337. package/esm/plugin/chart/plugin-service.js +3 -0
  338. package/esm/plugin/chart/plugin-service.js.map +1 -1
  339. package/esm/plugin/components/plugin-service.d.ts +1 -0
  340. package/esm/plugin/components/plugin-service.js +3 -0
  341. package/esm/plugin/components/plugin-service.js.map +1 -1
  342. package/esm/plugin/components/tooltip-handler/canvas/canvas-tooltip-handler.js +2 -2
  343. package/esm/plugin/components/tooltip-handler/canvas/canvas-tooltip-handler.js.map +1 -1
  344. package/esm/plugin/components/tooltip-handler/constants.d.ts +0 -5
  345. package/esm/plugin/components/tooltip-handler/constants.js +0 -8
  346. package/esm/plugin/components/tooltip-handler/constants.js.map +1 -1
  347. package/esm/plugin/components/tooltip-handler/dom/dom-tooltip-handler.js +3 -1
  348. package/esm/plugin/components/tooltip-handler/dom/dom-tooltip-handler.js.map +1 -1
  349. package/esm/plugin/components/tooltip-handler/utils/position.d.ts +1 -0
  350. package/esm/region/interface.d.ts +2 -1
  351. package/esm/region/interface.js.map +1 -1
  352. package/esm/region/region.js +1 -1
  353. package/esm/region/region.js.map +1 -1
  354. package/esm/series/area/area-transformer.d.ts +1 -0
  355. package/esm/series/area/area-transformer.js +4 -1
  356. package/esm/series/area/area-transformer.js.map +1 -1
  357. package/esm/series/area/area.d.ts +0 -1
  358. package/esm/series/area/area.js +1 -1
  359. package/esm/series/area/area.js.map +1 -1
  360. package/esm/series/area/interface.d.ts +6 -1
  361. package/esm/series/area/interface.js.map +1 -1
  362. package/esm/series/bar/bar-transformer.d.ts +1 -0
  363. package/esm/series/bar/bar-transformer.js +3 -0
  364. package/esm/series/bar/bar-transformer.js.map +1 -1
  365. package/esm/series/bar/bar.d.ts +0 -1
  366. package/esm/series/bar/bar.js +2 -2
  367. package/esm/series/bar/bar.js.map +1 -1
  368. package/esm/series/base/base-series-transformer.d.ts +5 -3
  369. package/esm/series/base/base-series-transformer.js +10 -3
  370. package/esm/series/base/base-series-transformer.js.map +1 -1
  371. package/esm/series/base/base-series.d.ts +0 -4
  372. package/esm/series/base/base-series.js +11 -15
  373. package/esm/series/base/base-series.js.map +1 -1
  374. package/esm/series/cartesian/cartesian.js +3 -2
  375. package/esm/series/cartesian/cartesian.js.map +1 -1
  376. package/esm/series/funnel/funnel.js +2 -1
  377. package/esm/series/funnel/funnel.js.map +1 -1
  378. package/esm/series/gauge/gauge-pointer-transformer.d.ts +5 -0
  379. package/esm/series/gauge/gauge-pointer-transformer.js +8 -0
  380. package/esm/series/gauge/gauge-pointer-transformer.js.map +1 -0
  381. package/esm/series/gauge/gauge-pointer.d.ts +3 -1
  382. package/esm/series/gauge/gauge-pointer.js +6 -3
  383. package/esm/series/gauge/gauge-pointer.js.map +1 -1
  384. package/esm/series/gauge/gauge-transformer.d.ts +1 -0
  385. package/esm/series/gauge/gauge-transformer.js +3 -0
  386. package/esm/series/gauge/gauge-transformer.js.map +1 -1
  387. package/esm/series/gauge/gauge.d.ts +0 -1
  388. package/esm/series/gauge/gauge.js +1 -1
  389. package/esm/series/gauge/gauge.js.map +1 -1
  390. package/esm/series/interface/common.d.ts +6 -2
  391. package/esm/series/interface/common.js.map +1 -1
  392. package/esm/series/map/geo-source.d.ts +1 -1
  393. package/esm/series/map/geo-source.js.map +1 -1
  394. package/esm/series/polar/progress-like/progress-like.d.ts +0 -1
  395. package/esm/series/polar/progress-like/progress-like.js +5 -5
  396. package/esm/series/polar/progress-like/progress-like.js.map +1 -1
  397. package/esm/series/polar/rose-like/rose-like.js +1 -1
  398. package/esm/series/polar/rose-like/rose-like.js.map +1 -1
  399. package/esm/series/progress/circular/circular-transformer.d.ts +5 -0
  400. package/esm/series/progress/circular/circular-transformer.js +8 -0
  401. package/esm/series/progress/circular/circular-transformer.js.map +1 -0
  402. package/esm/series/progress/circular/circular.d.ts +3 -0
  403. package/esm/series/progress/circular/circular.js +8 -5
  404. package/esm/series/progress/circular/circular.js.map +1 -1
  405. package/esm/series/radar/radar.js +2 -2
  406. package/esm/series/radar/radar.js.map +1 -1
  407. package/esm/series/range-column/range-column-transformer.d.ts +1 -0
  408. package/esm/series/range-column/range-column-transformer.js +3 -0
  409. package/esm/series/range-column/range-column-transformer.js.map +1 -1
  410. package/esm/series/range-column/range-column.d.ts +0 -1
  411. package/esm/series/range-column/range-column.js +1 -2
  412. package/esm/series/range-column/range-column.js.map +1 -1
  413. package/esm/series/rose/rose-transformer.d.ts +1 -0
  414. package/esm/series/rose/rose-transformer.js +3 -0
  415. package/esm/series/rose/rose-transformer.js.map +1 -1
  416. package/esm/series/rose/rose.d.ts +0 -1
  417. package/esm/series/rose/rose.js +2 -2
  418. package/esm/series/rose/rose.js.map +1 -1
  419. package/esm/series/waterfall/waterfall-transformer.d.ts +1 -0
  420. package/esm/series/waterfall/waterfall-transformer.js +3 -0
  421. package/esm/series/waterfall/waterfall-transformer.js.map +1 -1
  422. package/esm/series/waterfall/waterfall.d.ts +0 -1
  423. package/esm/series/waterfall/waterfall.js +1 -1
  424. package/esm/series/waterfall/waterfall.js.map +1 -1
  425. package/esm/theme/builtin/common/series/area.js +2 -1
  426. package/esm/theme/builtin/common/series/area.js.map +1 -1
  427. package/esm/typings/spec/common.d.ts +2 -2
  428. package/esm/typings/spec/common.js.map +1 -1
  429. package/esm/typings/spec/index.d.ts +1 -1
  430. package/esm/typings/spec/index.js.map +1 -1
  431. package/esm/vchart-all.js +2 -2
  432. package/esm/vchart-all.js.map +1 -1
  433. package/esm/vchart-simple.js +1 -3
  434. package/esm/vchart-simple.js.map +1 -1
  435. package/package.json +15 -14
package/build/index.js CHANGED
@@ -9684,15 +9684,27 @@
9684
9684
  container.getNamed(WindowHandlerContribution, global.env).configure(this, global), this.actived = !0;
9685
9685
  }
9686
9686
  get style() {
9687
- return this._handler.getStyle();
9687
+ var _a;
9688
+ return null !== (_a = this._handler.getStyle()) && void 0 !== _a ? _a : {};
9688
9689
  }
9689
9690
  set style(style) {
9690
9691
  this._handler.setStyle(style);
9691
9692
  }
9692
9693
  create(params) {
9694
+ var _a, _b;
9693
9695
  this._handler.createWindow(params);
9694
9696
  const windowWH = this._handler.getWH();
9695
- this._width = windowWH.width, this._height = windowWH.height, this.title = this._handler.getTitle(), this.resizable = !0;
9697
+ this._width = windowWH.width, this._height = windowWH.height, params.viewBox ? this.setViewBox(params.viewBox) : !1 !== params.canvasControled ? this.setViewBox({
9698
+ x1: 0,
9699
+ y1: 0,
9700
+ x2: this._width,
9701
+ y2: this._height
9702
+ }) : this.setViewBox({
9703
+ x1: 0,
9704
+ y1: 0,
9705
+ x2: null !== (_a = params.width) && void 0 !== _a ? _a : this._width,
9706
+ y2: null !== (_b = params.height) && void 0 !== _b ? _b : this._height
9707
+ }), this.title = this._handler.getTitle(), this.resizable = !0;
9696
9708
  }
9697
9709
  setWindowHandler(handler) {
9698
9710
  this._handler = handler;
@@ -9733,8 +9745,35 @@
9733
9745
  getContainer() {
9734
9746
  return this._handler.container;
9735
9747
  }
9736
- clearViewBox(viewBox, color) {
9737
- this._handler.clearViewBox(viewBox, color);
9748
+ clearViewBox(color) {
9749
+ this._handler.clearViewBox(color);
9750
+ }
9751
+ setViewBox(viewBox) {
9752
+ this._handler.setViewBox(viewBox);
9753
+ }
9754
+ setViewBoxTransform(a, b, c, d, e, f) {
9755
+ this._handler.setViewBoxTransform(a, b, c, d, e, f);
9756
+ }
9757
+ getViewBox() {
9758
+ return this._handler.getViewBox();
9759
+ }
9760
+ getViewBoxTransform() {
9761
+ return this._handler.getViewBoxTransform();
9762
+ }
9763
+ pointTransform(x, y) {
9764
+ const vb = this._handler.getViewBox(),
9765
+ nextP = {
9766
+ x: x,
9767
+ y: y
9768
+ };
9769
+ return this._handler.getViewBoxTransform().transformPoint({
9770
+ x: x,
9771
+ y: y
9772
+ }, nextP), nextP.x -= vb.x1, nextP.y -= vb.y1, nextP;
9773
+ }
9774
+ hasSubView() {
9775
+ const viewBox = this._handler.getViewBox();
9776
+ return !(0 === viewBox.x1 && 0 === viewBox.y1 && this.width === viewBox.width() && this.height === viewBox.height());
9738
9777
  }
9739
9778
  isVisible(bbox) {
9740
9779
  return this._handler.isVisible(bbox);
@@ -9820,8 +9859,16 @@
9820
9859
  const window = container.get(VWindow),
9821
9860
  bounds = graphic.AABBBounds,
9822
9861
  width = bounds.width(),
9823
- height = bounds.height();
9862
+ height = bounds.height(),
9863
+ x1 = -bounds.x1,
9864
+ y1 = -bounds.y1;
9824
9865
  window.create({
9866
+ viewBox: {
9867
+ x1: x1,
9868
+ y1: y1,
9869
+ x2: bounds.x2,
9870
+ y2: bounds.y2
9871
+ },
9825
9872
  width: width,
9826
9873
  height: height,
9827
9874
  canvas: canvas,
@@ -9830,14 +9877,10 @@
9830
9877
  offscreen: !0,
9831
9878
  title: ""
9832
9879
  });
9833
- const x = -bounds.x1,
9834
- y = -bounds.y1,
9835
- disableCheckGraphicWidthOutRange = stage.params.optimize.disableCheckGraphicWidthOutRange;
9880
+ const disableCheckGraphicWidthOutRange = stage.params.optimize.disableCheckGraphicWidthOutRange;
9836
9881
  stage.params.optimize.disableCheckGraphicWidthOutRange = !0, stage.defaultLayer.getNativeHandler().drawTo(window, [graphic], {
9837
- x: x,
9838
- y: y,
9839
- width: width,
9840
- height: height,
9882
+ transMatrix: window.getViewBoxTransform(),
9883
+ viewBox: window.getViewBox(),
9841
9884
  stage: stage,
9842
9885
  layer: stage.defaultLayer,
9843
9886
  renderService: stage.renderService,
@@ -10661,7 +10704,7 @@
10661
10704
  const mappers = this.mappingTable[e.type];
10662
10705
  let target;
10663
10706
  const cacheKey = `${e.canvasX}-${e.canvasY}`;
10664
- if ((null === (_a = this._prePointTargetCache) || void 0 === _a ? void 0 : _a[cacheKey]) && (null === (_c = null === (_b = this._prePointTargetCache) || void 0 === _b ? void 0 : _b[cacheKey]) || void 0 === _c ? void 0 : _c.stage) && (null === (_e = null === (_d = this._prePointTargetCache) || void 0 === _d ? void 0 : _d[cacheKey]) || void 0 === _e ? void 0 : _e.stage.renderCount) === (null === (_f = this._prePointTargetCache) || void 0 === _f ? void 0 : _f.stageRenderCount) ? target = this._prePointTargetCache[cacheKey] : (target = this.pickTarget(e.canvasX, e.canvasY, e), e.pickParams || (this._prePointTargetCache = {
10707
+ if ((null === (_a = this._prePointTargetCache) || void 0 === _a ? void 0 : _a[cacheKey]) && (null === (_c = null === (_b = this._prePointTargetCache) || void 0 === _b ? void 0 : _b[cacheKey]) || void 0 === _c ? void 0 : _c.stage) && (null === (_e = null === (_d = this._prePointTargetCache) || void 0 === _d ? void 0 : _d[cacheKey]) || void 0 === _e ? void 0 : _e.stage.renderCount) === (null === (_f = this._prePointTargetCache) || void 0 === _f ? void 0 : _f.stageRenderCount) ? target = this._prePointTargetCache[cacheKey] : (target = this.pickTarget(e.viewX, e.viewY, e), e.pickParams || (this._prePointTargetCache = {
10665
10708
  [cacheKey]: target,
10666
10709
  stageRenderCount: null !== (_g = null == target ? void 0 : target.stage.renderCount) && void 0 !== _g ? _g : -1
10667
10710
  })), mappers) for (let i = 0, j = mappers.length; i < j; i++) mappers[i].fn(e, target);else Logger.getInstance().warn(`[EventManager]: Event mapping not defined for ${e.type}`);
@@ -10696,12 +10739,14 @@
10696
10739
  return currentTarget;
10697
10740
  }
10698
10741
  createPointerEvent(from, type, target) {
10742
+ var _a, _b;
10699
10743
  const event = this.allocateEvent(FederatedPointerEvent);
10700
- return this.copyPointerData(from, event), this.copyMouseData(from, event), this.copyData(from, event), event.nativeEvent = from.nativeEvent, event.originalEvent = from, event.target = target || this.pickTarget(event.global.x, event.global.y, event), "string" == typeof type && (event.type = type), event;
10744
+ return this.copyPointerData(from, event), this.copyMouseData(from, event), this.copyData(from, event), event.nativeEvent = from.nativeEvent, event.originalEvent = from, event.target = target || this.pickTarget(null !== (_a = event.viewX) && void 0 !== _a ? _a : event.global.x, null !== (_b = event.viewY) && void 0 !== _b ? _b : event.global.y, event), "string" == typeof type && (event.type = type), event;
10701
10745
  }
10702
10746
  createWheelEvent(from, target) {
10747
+ var _a, _b;
10703
10748
  const event = this.allocateEvent(FederatedWheelEvent);
10704
- return this.copyWheelData(from, event), this.copyMouseData(from, event), this.copyData(from, event), event.nativeEvent = from.nativeEvent, event.originalEvent = from, event.target = target || this.pickTarget(event.global.x, event.global.y, event), event;
10749
+ return this.copyWheelData(from, event), this.copyMouseData(from, event), this.copyData(from, event), event.nativeEvent = from.nativeEvent, event.originalEvent = from, event.target = target || this.pickTarget(null !== (_a = event.viewX) && void 0 !== _a ? _a : event.global.x, null !== (_b = event.viewY) && void 0 !== _b ? _b : event.global.y, event), event;
10705
10750
  }
10706
10751
  clonePointerEvent(from, type) {
10707
10752
  const event = this.allocateEvent(FederatedPointerEvent);
@@ -10805,7 +10850,7 @@
10805
10850
  this.setCursor(this.manager.cursor, this.manager.cursorTarget);
10806
10851
  }, this.onPointerUp = nativeEvent => {
10807
10852
  if (this.supportsTouchEvents && "touch" === nativeEvent.pointerType) return;
10808
- const outside = this.isEventOutsideOfTargetElement(nativeEvent) ? "outside" : "",
10853
+ const outside = this.isEventOutsideOfTargetViewPort(nativeEvent) ? "outside" : "",
10809
10854
  normalizedEvents = this.normalizeToPointerData(nativeEvent);
10810
10855
  for (let i = 0, j = normalizedEvents.length; i < j; i++) {
10811
10856
  const event = this.bootstrapEvent(this.rootPointerEvent, normalizedEvents[i]);
@@ -10829,7 +10874,6 @@
10829
10874
  resolution: resolution,
10830
10875
  rootNode: rootNode,
10831
10876
  global: global,
10832
- viewport: viewport,
10833
10877
  autoPreventDefault = !1,
10834
10878
  clickInterval: clickInterval,
10835
10879
  supportsTouchEvents = global.supportsTouchEvents,
@@ -10837,7 +10881,7 @@
10837
10881
  } = params;
10838
10882
  this.manager = new EventManager(rootNode, {
10839
10883
  clickInterval: clickInterval
10840
- }), this.globalObj = global, this.supportsPointerEvents = supportsPointerEvents, this.supportsTouchEvents = supportsTouchEvents, this.supportsMouseEvents = global.supportsMouseEvents, this.applyStyles = global.applyStyles, this.autoPreventDefault = autoPreventDefault, this.eventsAdded = !1, this.viewport = viewport, this.rootPointerEvent = new FederatedPointerEvent(), this.rootWheelEvent = new FederatedWheelEvent(), this.cursorStyles = {
10884
+ }), this.globalObj = global, this.supportsPointerEvents = supportsPointerEvents, this.supportsTouchEvents = supportsTouchEvents, this.supportsMouseEvents = global.supportsMouseEvents, this.applyStyles = global.applyStyles, this.autoPreventDefault = autoPreventDefault, this.eventsAdded = !1, this.rootPointerEvent = new FederatedPointerEvent(), this.rootWheelEvent = new FederatedWheelEvent(), this.cursorStyles = {
10841
10885
  default: "inherit",
10842
10886
  pointer: "pointer"
10843
10887
  }, this.resolution = resolution, this.setTargetElement(targetElement);
@@ -10879,15 +10923,7 @@
10879
10923
  this.supportsPointerEvents ? (globalObj.getDocument() ? (globalObj.getDocument().removeEventListener("pointermove", this.onPointerMove, !0), globalObj.getDocument().removeEventListener("pointerup", this.onPointerUp, !0)) : (domElement.removeEventListener("pointermove", this.onPointerMove, !0), domElement.removeEventListener("pointerup", this.onPointerUp, !0)), domElement.removeEventListener("pointerdown", this.onPointerDown, !0), domElement.removeEventListener("pointerleave", this.onPointerOverOut, !0), domElement.removeEventListener("pointerover", this.onPointerOverOut, !0)) : (globalObj.getDocument() ? (globalObj.getDocument().removeEventListener("mousemove", this.onPointerMove, !0), globalObj.getDocument().removeEventListener("mouseup", this.onPointerUp, !0)) : (domElement.removeEventListener("mousemove", this.onPointerMove, !0), domElement.removeEventListener("mouseup", this.onPointerUp, !0)), domElement.removeEventListener("mousedown", this.onPointerDown, !0), domElement.removeEventListener("mouseout", this.onPointerOverOut, !0), domElement.removeEventListener("mouseover", this.onPointerOverOut, !0)), this.supportsTouchEvents && (domElement.removeEventListener("touchstart", this.onPointerDown, !0), domElement.removeEventListener("touchend", this.onPointerUp, !0), domElement.removeEventListener("touchmove", this.onPointerMove, !0)), domElement.removeEventListener("wheel", this.onWheel, !0), this.domElement = null, this.eventsAdded = !1;
10880
10924
  }
10881
10925
  mapToViewportPoint(event) {
10882
- const viewport = this.viewport,
10883
- {
10884
- x: x,
10885
- y: y
10886
- } = event;
10887
- return {
10888
- x: x - viewport.x,
10889
- y: y - viewport.y
10890
- };
10926
+ return this.domElement.pointTransform ? this.domElement.pointTransform(event.x, event.y) : event;
10891
10927
  }
10892
10928
  mapToCanvasPoint(nativeEvent) {
10893
10929
  var _a;
@@ -10944,6 +10980,17 @@
10944
10980
  transferMouseData(event, nativeEvent) {
10945
10981
  event.isTrusted = nativeEvent.isTrusted, event.srcElement = nativeEvent.srcElement, event.timeStamp = clock.now(), event.type = nativeEvent.type, event.altKey = nativeEvent.altKey, event.button = nativeEvent.button, event.buttons = nativeEvent.buttons, event.client.x = nativeEvent.clientX, event.client.y = nativeEvent.clientY, event.ctrlKey = nativeEvent.ctrlKey, event.shiftKey = nativeEvent.shiftKey, event.metaKey = nativeEvent.metaKey, event.movement.x = nativeEvent.movementX, event.movement.y = nativeEvent.movementY, event.page.x = nativeEvent.pageX, event.page.y = nativeEvent.pageY, event.relatedTarget = null;
10946
10982
  }
10983
+ isEventOutsideOfTargetViewPort(nativeEvent) {
10984
+ if (this.isEventOutsideOfTargetElement(nativeEvent)) return !0;
10985
+ if (this.domElement.getViewBox) {
10986
+ const p = this.mapToViewportPoint(this.mapToCanvasPoint(nativeEvent)),
10987
+ b = this.domElement.getViewBox(),
10988
+ w = b.width(),
10989
+ h = b.height();
10990
+ return !(p.x < w && p.y < h && p.x > 0 && p.y > 0);
10991
+ }
10992
+ return !1;
10993
+ }
10947
10994
  isEventOutsideOfTargetElement(nativeEvent) {
10948
10995
  let target = nativeEvent.target;
10949
10996
  nativeEvent.composedPath && nativeEvent.composedPath().length > 0 && (target = nativeEvent.composedPath()[0]);
@@ -14371,15 +14418,12 @@
14371
14418
  }
14372
14419
  render(params, userParams) {
14373
14420
  var _a;
14374
- const stage = this.stage;
14375
14421
  this.layerHandler.render([this], {
14376
14422
  renderService: params.renderService,
14377
- x: stage.x,
14378
- y: stage.y,
14379
- width: this.viewWidth,
14380
- height: this.viewHeight,
14381
14423
  stage: this.stage,
14382
14424
  layer: this,
14425
+ viewBox: params.viewBox,
14426
+ transMatrix: params.transMatrix,
14383
14427
  background: null !== (_a = params.background) && void 0 !== _a ? _a : this.background,
14384
14428
  updateBounds: params.updateBounds
14385
14429
  }, userParams), this.afterDrawCbs.forEach(c => c(this)), this.tryRenderSecondaryLayer(params, userParams);
@@ -14403,33 +14447,18 @@
14403
14447
  throw new Error("暂不支持");
14404
14448
  }
14405
14449
  prepare(dirtyBounds, params) {}
14406
- combineTo(target, params) {
14407
- var _a, _b, _c;
14408
- this.offscreen && (this.layerHandler.drawTo(target, [this], Object.assign({
14409
- background: null !== (_a = params.background) && void 0 !== _a ? _a : this.background,
14410
- renderService: params.renderService,
14411
- x: null !== (_b = params.x) && void 0 !== _b ? _b : this.stage.x,
14412
- y: null !== (_c = params.y) && void 0 !== _c ? _c : this.stage.y,
14413
- width: this.viewWidth,
14414
- height: this.viewHeight,
14415
- stage: this.stage,
14416
- layer: this
14417
- }, params)), this.afterDrawCbs.forEach(c => c(this)));
14418
- }
14419
14450
  release() {
14420
14451
  super.release(), this.layerHandler.release(), this.subLayers && this.subLayers.forEach(l => {
14421
14452
  application.layerService.releaseLayer(this.stage, l.layer);
14422
14453
  });
14423
14454
  }
14424
14455
  drawTo(target, params) {
14425
- var _a, _b, _c;
14456
+ var _a;
14426
14457
  this.layerHandler.drawTo(target, [this], Object.assign({
14427
14458
  background: null !== (_a = params.background) && void 0 !== _a ? _a : this.background,
14428
14459
  renderService: params.renderService,
14429
- x: null !== (_b = params.x) && void 0 !== _b ? _b : this.stage.x,
14430
- y: null !== (_c = params.y) && void 0 !== _c ? _c : this.stage.y,
14431
- width: this.viewWidth,
14432
- height: this.viewHeight,
14460
+ viewBox: params.viewBox,
14461
+ transMatrix: params.transMatrix,
14433
14462
  stage: this.stage,
14434
14463
  layer: this
14435
14464
  }, params)), this.afterDrawCbs.forEach(c => c(this));
@@ -21659,10 +21688,10 @@
21659
21688
  render(group, params) {
21660
21689
  var _a;
21661
21690
  params.renderService.render(group, Object.assign(Object.assign({
21662
- context: this.context
21691
+ context: this.context,
21692
+ viewBox: params.stage.window.getViewBox(),
21693
+ transMatrix: params.stage.window.getViewBoxTransform()
21663
21694
  }, params), {
21664
- x: 0,
21665
- y: 0,
21666
21695
  clear: null !== (_a = params.background) && void 0 !== _a ? _a : "#ffffff"
21667
21696
  }));
21668
21697
  }
@@ -21677,11 +21706,12 @@
21677
21706
  const context = target.getContext(),
21678
21707
  targetDpr = target.dpr,
21679
21708
  {
21680
- x = 0,
21681
- y = 0,
21682
- width = this.layer.viewWidth,
21683
- height = this.layer.viewHeight
21684
- } = params;
21709
+ viewBox: viewBox
21710
+ } = params,
21711
+ x = viewBox.x1,
21712
+ y = viewBox.y1,
21713
+ width = viewBox.width(),
21714
+ height = viewBox.height();
21685
21715
  context.nativeContext.save(), context.nativeContext.setTransform(targetDpr, 0, 0, targetDpr, 0, 0), params.clear && context.clearRect(x, y, width, height), context.drawImage(this.canvas.nativeCanvas, 0, 0, this.canvas.width, this.canvas.height, x, y, width, height), context.nativeContext.restore();
21686
21716
  }
21687
21717
  merge(layerHandlers) {}
@@ -21837,32 +21867,22 @@
21837
21867
  const {
21838
21868
  context: context,
21839
21869
  stage: stage,
21840
- x = 0,
21841
- y = 0,
21842
- width: width,
21843
- height: height
21870
+ viewBox: viewBox,
21871
+ transMatrix: transMatrix
21844
21872
  } = drawContext;
21845
21873
  if (!context) return;
21846
- if (drawContext.keepMatrix) {
21847
- if (context.nativeContext && context.nativeContext.getTransform) {
21848
- const t = context.nativeContext.getTransform();
21849
- context.setTransformFromMatrix(t, !0, 1);
21850
- }
21851
- } else context.inuse = !0, context.clearMatrix(), context.setTransformForCurrent(!0);
21852
- const dirtyBounds = this.dirtyBounds.setValue(0, 0, width, height);
21874
+ const dirtyBounds = this.dirtyBounds.setValue(0, 0, viewBox.width(), viewBox.height());
21853
21875
  if (stage.dirtyBounds && !stage.dirtyBounds.empty()) {
21854
21876
  const b = getRectIntersect(dirtyBounds, stage.dirtyBounds, !1);
21855
21877
  dirtyBounds.x1 = Math.floor(b.x1), dirtyBounds.y1 = Math.floor(b.y1), dirtyBounds.x2 = Math.ceil(b.x2), dirtyBounds.y2 = Math.ceil(b.y2);
21856
21878
  }
21857
21879
  const d = context.dpr % 1;
21858
- (d || .5 !== d) && (dirtyBounds.x1 = Math.floor(dirtyBounds.x1 * context.dpr) / context.dpr, dirtyBounds.y1 = Math.floor(dirtyBounds.y1 * context.dpr) / context.dpr, dirtyBounds.x2 = Math.ceil(dirtyBounds.x2 * context.dpr) / context.dpr, dirtyBounds.y2 = Math.ceil(dirtyBounds.y2 * context.dpr) / context.dpr), this.backupDirtyBounds.copy(dirtyBounds);
21859
- const drawInArea = dirtyBounds.width() * context.dpr < context.canvas.width || dirtyBounds.height() * context.dpr < context.canvas.height;
21860
- context.save(), context.translate(x, y, !0), drawInArea && (context.beginPath(), context.rect(dirtyBounds.x1, dirtyBounds.y1, dirtyBounds.width(), dirtyBounds.height()), context.clip()), stage.camera && (this.dirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), this.backupDirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0)), this.clearScreen(renderService, context, drawContext), context.save(), renderService.renderTreeRoots.sort((a, b) => {
21880
+ (d || .5 !== d) && (dirtyBounds.x1 = Math.floor(dirtyBounds.x1 * context.dpr) / context.dpr, dirtyBounds.y1 = Math.floor(dirtyBounds.y1 * context.dpr) / context.dpr, dirtyBounds.x2 = Math.ceil(dirtyBounds.x2 * context.dpr) / context.dpr, dirtyBounds.y2 = Math.ceil(dirtyBounds.y2 * context.dpr) / context.dpr), this.backupDirtyBounds.copy(dirtyBounds), context.inuse = !0, context.setClearMatrix(transMatrix.a, transMatrix.b, transMatrix.c, transMatrix.d, transMatrix.e, transMatrix.f), context.clearMatrix(), context.setTransformForCurrent(!0), context.translate(viewBox.x1, viewBox.y1, !0), context.beginPath(), context.rect(dirtyBounds.x1, dirtyBounds.y1, dirtyBounds.width(), dirtyBounds.height()), context.clip(), stage.camera && (this.dirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), this.backupDirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0)), this.clearScreen(renderService, context, drawContext), context.save(), renderService.renderTreeRoots.sort((a, b) => {
21861
21881
  var _a, _b;
21862
21882
  return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
21863
21883
  }).forEach(group => {
21864
21884
  group.isContainer ? this.renderGroup(group, drawContext, matrixAllocate.allocate(1, 0, 0, 1, 0, 0)) : this.renderItem(group, drawContext);
21865
- }), context.restore(), context.restore(), context.draw(), drawContext.keepMatrix || (context.inuse = !1);
21885
+ }), context.restore(), context.draw(), context.setClearMatrix(1, 0, 0, 1, 0, 0), context.inuse = !1;
21866
21886
  }
21867
21887
  doRegister() {
21868
21888
  throw new Error("暂不支持");
@@ -21986,29 +22006,25 @@
21986
22006
  clearScreen(renderService, context, drawContext) {
21987
22007
  var _a, _b;
21988
22008
  const {
21989
- clear: clear
21990
- } = drawContext;
22009
+ clear: clear,
22010
+ viewBox: viewBox
22011
+ } = drawContext,
22012
+ width = viewBox.width(),
22013
+ height = viewBox.height();
21991
22014
  if (clear) {
21992
- const canvas = context.getCanvas(),
21993
- {
21994
- width = canvas.width,
21995
- height = canvas.height
21996
- } = drawContext,
21997
- x = 0,
21998
- y = 0;
21999
- context.clearRect(x, y, width, height);
22015
+ context.clearRect(0, 0, width, height);
22000
22016
  const stage = null === (_a = renderService.drawParams) || void 0 === _a ? void 0 : _a.stage;
22001
22017
  if (stage && (context.globalAlpha = null !== (_b = stage.attribute.opacity) && void 0 !== _b ? _b : 1), stage && stage.backgroundImg && stage.resources) {
22002
22018
  const res = stage.resources.get(clear);
22003
- res && "success" === res.state && res.data && context.drawImage(res.data, x, y, width, height);
22019
+ res && "success" === res.state && res.data && context.drawImage(res.data, 0, 0, width, height);
22004
22020
  } else context.fillStyle = createColor(context, clear, {
22005
22021
  AABBBounds: {
22006
- x1: x,
22007
- y1: y,
22008
- x2: x + width,
22009
- y2: y + height
22022
+ x1: 0,
22023
+ y1: 0,
22024
+ x2: 0 + width,
22025
+ y2: 0 + height
22010
22026
  }
22011
- }, 0, 0), context.fillRect(x, y, width, height);
22027
+ }, 0, 0), context.fillRect(0, 0, width, height);
22012
22028
  }
22013
22029
  }
22014
22030
  afterDraw(renderService, drawParams) {}
@@ -22265,25 +22281,16 @@
22265
22281
  this.currentRenderService = renderService;
22266
22282
  const {
22267
22283
  context: context,
22268
- x = 0,
22269
- y = 0
22284
+ viewBox: viewBox
22270
22285
  } = drawContext;
22271
- if (context) {
22272
- if (drawContext.keepMatrix) {
22273
- if (context.nativeContext && context.nativeContext.getTransform) {
22274
- const t = context.nativeContext.getTransform();
22275
- context.setTransformFromMatrix(t, !0, 1);
22276
- }
22277
- } else context.inuse = !0, context.clearMatrix();
22278
- context.setTransformForCurrent(!0), context.save(), drawContext.restartIncremental && this.clearScreen(this.currentRenderService, context, drawContext), context.translate(x, y, !0), context.save(), renderService.renderTreeRoots.sort((a, b) => {
22279
- var _a, _b;
22280
- return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
22281
- }).forEach(group => {
22282
- this.renderGroup(group, drawContext);
22283
- }), this.hooks.completeDraw.tap("top-draw", () => {
22284
- context.restore(), context.restore(), context.draw(), drawContext.keepMatrix || (context.inuse = !1), this.rendering = !1;
22285
- });
22286
- }
22286
+ context && (context.inuse = !0, context.clearMatrix(), context.setTransformForCurrent(!0), context.save(), drawContext.restartIncremental && this.clearScreen(this.currentRenderService, context, drawContext), context.translate(viewBox.x1, viewBox.y1, !0), context.save(), renderService.renderTreeRoots.sort((a, b) => {
22287
+ var _a, _b;
22288
+ return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
22289
+ }).forEach(group => {
22290
+ this.renderGroup(group, drawContext);
22291
+ }), this.hooks.completeDraw.tap("top-draw", () => {
22292
+ context.restore(), context.restore(), context.draw(), context.inuse = !1, this.rendering = !1;
22293
+ }));
22287
22294
  });
22288
22295
  }
22289
22296
  _increaseRender(group, drawContext) {
@@ -22453,12 +22460,10 @@
22453
22460
  if (!layer || !group.layer.subLayers) return;
22454
22461
  const subLayer = group.layer.subLayers.get(group._uid);
22455
22462
  subLayer && subLayer.drawContribution && subLayer.drawContribution.draw(stage.renderService, Object.assign({
22456
- x: stage.x,
22457
- y: stage.y,
22458
- width: layer.viewWidth,
22459
- height: layer.viewHeight,
22460
22463
  stage: stage,
22461
22464
  layer: layer,
22465
+ viewBox: stage.window.getViewBox(),
22466
+ transMatrix: stage.window.getViewBoxTransform(),
22462
22467
  clear: "transparent",
22463
22468
  renderService: stage.renderService,
22464
22469
  updateBounds: !1,
@@ -23007,22 +23012,24 @@
23007
23012
  };
23008
23013
  class Stage extends Group$1 {
23009
23014
  set viewBox(b) {
23010
- this._viewBox.setValue(b.x1, b.y1, b.x2, b.y2);
23015
+ this.window.setViewBox(b);
23011
23016
  }
23012
23017
  get viewBox() {
23013
- return this._viewBox;
23018
+ return this.window.getViewBox();
23014
23019
  }
23015
23020
  get x() {
23016
- return this._viewBox.x1;
23021
+ return this.window.getViewBox().x1;
23017
23022
  }
23018
23023
  set x(x) {
23019
- this._viewBox.translate(x - this._viewBox.x1, 0);
23024
+ const b = this.window.getViewBox();
23025
+ b.translate(x - b.x1, 0), this.window.setViewBox(b);
23020
23026
  }
23021
23027
  get y() {
23022
- return this._viewBox.y1;
23028
+ return this.window.getViewBox().y1;
23023
23029
  }
23024
23030
  set y(y) {
23025
- this._viewBox.translate(0, y - this._viewBox.y1);
23031
+ const b = this.window.getViewBox();
23032
+ b.translate(0, y - b.y1), this.window.setViewBox(b);
23026
23033
  }
23027
23034
  get width() {
23028
23035
  return this.window.width;
@@ -23031,13 +23038,13 @@
23031
23038
  this.resize(w, this.height);
23032
23039
  }
23033
23040
  get viewWidth() {
23034
- return this._viewBox.width();
23041
+ return this.window.getViewBox().width();
23035
23042
  }
23036
23043
  set viewWidth(w) {
23037
23044
  this.resizeView(w, this.viewHeight);
23038
23045
  }
23039
23046
  get viewHeight() {
23040
- return this._viewBox.height();
23047
+ return this.window.getViewBox().height();
23041
23048
  }
23042
23049
  set viewHeight(h) {
23043
23050
  this.resizeView(this.viewWidth, h);
@@ -23071,7 +23078,13 @@
23071
23078
  let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
23072
23079
  var _a;
23073
23080
  super({}), this._onVisibleChange = visible => {
23074
- this._skipRender < 0 || (visible ? (this.dirtyBounds && this.dirtyBounds.setValue(0, 0, this._viewBox.width(), this._viewBox.height()), this._skipRender > 1 && this.renderNextFrame(), this._skipRender = 0) : this._skipRender = 1);
23081
+ if (!(this._skipRender < 0)) if (visible) {
23082
+ if (this.dirtyBounds) {
23083
+ const b = this.window.getViewBox();
23084
+ this.dirtyBounds.setValue(b.x1, b.y1, b.width(), b.height());
23085
+ }
23086
+ this._skipRender > 1 && this.renderNextFrame(), this._skipRender = 0;
23087
+ } else this._skipRender = 1;
23075
23088
  }, this.beforeRender = stage => {
23076
23089
  this._beforeRender && this._beforeRender(stage);
23077
23090
  }, this.afterRender = stage => {
@@ -23082,17 +23095,24 @@
23082
23095
  }, this.global = application.global, !this.global.env && isBrowserEnv() && this.global.setEnv("browser"), this.window = container.get(VWindow), this.renderService = container.get(RenderService), this.pluginService = container.get(PluginService), this.layerService = container.get(LayerService), this.pluginService.active(this, params), this.window.create({
23083
23096
  width: params.width,
23084
23097
  height: params.height,
23098
+ viewBox: params.viewBox,
23085
23099
  container: params.container,
23086
23100
  dpr: params.dpr || this.global.devicePixelRatio,
23087
23101
  canvasControled: !1 !== params.canvasControled,
23088
23102
  title: params.title || "",
23089
23103
  canvas: params.canvas
23090
- }), this._viewBox = new AABBBounds(), params.viewBox ? this._viewBox.setValue(params.viewBox.x1, params.viewBox.y1, params.viewBox.x2, params.viewBox.y2) : this._viewBox.setValue(0, 0, this.width, this.height), this.state = "normal", this.renderCount = 0, this.tryInitEventSystem(), this._subView = !(this._viewBox.width() === this.width && this._viewBox.height() === this.height), this._background = null !== (_a = params.background) && void 0 !== _a ? _a : DefaultConfig$1.BACKGROUND, this.appendChild(this.layerService.createLayer(this, {
23104
+ }), this.state = "normal", this.renderCount = 0, this.tryInitEventSystem(), this._background = null !== (_a = params.background) && void 0 !== _a ? _a : DefaultConfig$1.BACKGROUND, this.appendChild(this.layerService.createLayer(this, {
23091
23105
  main: !0
23092
23106
  })), this.nextFrameRenderLayerSet = new Set(), this.willNextFrameRender = !1, this.stage = this, this.renderStyle = params.renderStyle, params.autoRender && this.enableAutoRender(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute), params.enableLayout && this.enableLayout(), this.hooks.beforeRender.tap("constructor", this.beforeRender), this.hooks.afterRender.tap("constructor", this.afterRender), this._beforeRender = params.beforeRender, this._afterRender = params.afterRender, this.ticker = params.ticker || defaultTicker, this.supportInteractiveLayer = !1 !== params.interactiveLayer, this.timeline = new DefaultTimeline(), this.ticker.addTimeline(this.timeline), this.timeline.pause(), params.optimize || (params.optimize = {}), this.optmize(params.optimize), params.background && isString$1(this._background) && this._background.includes("/") && this.setAttributes({
23093
23107
  background: this._background
23094
23108
  });
23095
23109
  }
23110
+ pauseRender() {
23111
+ this._skipRender = -1;
23112
+ }
23113
+ resumeRender() {
23114
+ this._skipRender = 0;
23115
+ }
23096
23116
  tryInitEventSystem() {
23097
23117
  this.global.supportEvent && !this._eventSystem && (this._eventSystem = new EventSystem(Object.assign({
23098
23118
  targetElement: this.window,
@@ -23100,22 +23120,7 @@
23100
23120
  rootNode: this,
23101
23121
  global: this.global,
23102
23122
  supportsPointerEvents: this.params.supportsPointerEvents,
23103
- supportsTouchEvents: this.params.supportsTouchEvents,
23104
- viewport: {
23105
- viewBox: this._viewBox,
23106
- get x() {
23107
- return this.viewBox.x1;
23108
- },
23109
- get y() {
23110
- return this.viewBox.y1;
23111
- },
23112
- get width() {
23113
- return this.viewBox.width();
23114
- },
23115
- get height() {
23116
- return this.viewBox.height();
23117
- }
23118
- }
23123
+ supportsTouchEvents: this.params.supportsTouchEvents
23119
23124
  }, this.params.event)));
23120
23125
  }
23121
23126
  preventRender(prevent) {
@@ -23262,7 +23267,7 @@
23262
23267
  return this.pluginService.findPluginsByName(name);
23263
23268
  }
23264
23269
  tryUpdateAABBBounds() {
23265
- const viewBox = this._viewBox;
23270
+ const viewBox = this.window.getViewBox();
23266
23271
  return this._AABBBounds.setValue(viewBox.x1, viewBox.y1, viewBox.x2, viewBox.y2), this._AABBBounds;
23267
23272
  }
23268
23273
  combineLayer(ILayer1, ILayer2) {
@@ -23289,12 +23294,12 @@
23289
23294
  this.supportInteractiveLayer && !this.interactiveLayer && (this.interactiveLayer = this.createLayer(), this.interactiveLayer.name = "_builtin_interactive", this.interactiveLayer.attribute.pickable = !1, this.nextFrameRenderLayerSet.add(this.interactiveLayer));
23290
23295
  }
23291
23296
  clearViewBox(color) {
23292
- this.window.clearViewBox(this._viewBox, color);
23297
+ this.window.clearViewBox(color);
23293
23298
  }
23294
23299
  render(layers, params) {
23295
23300
  this.ticker.start(), this.timeline.resume();
23296
23301
  const state = this.state;
23297
- this.state = "rendering", this.layerService.prepareStageLayer(this), this._skipRender || (this.lastRenderparams = params, this.hooks.beforeRender.call(this), this.renderLayerList(this.children, params), this.combineLayersToWindow(), this.nextFrameRenderLayerSet.clear(), this.hooks.afterRender.call(this)), this.state = state, this._skipRender && this._skipRender++;
23302
+ this.state = "rendering", this.layerService.prepareStageLayer(this), this._skipRender || (this.lastRenderparams = params, this.hooks.beforeRender.call(this), this._skipRender || (this.renderLayerList(this.children), this.combineLayersToWindow(), this.nextFrameRenderLayerSet.clear()), this.hooks.afterRender.call(this)), this.state = state, this._skipRender && this._skipRender++;
23298
23303
  }
23299
23304
  combineLayersToWindow() {}
23300
23305
  renderNextFrame(layers, force) {
@@ -23307,7 +23312,7 @@
23307
23312
  _doRenderInThisFrame() {
23308
23313
  this.timeline.resume(), this.ticker.start();
23309
23314
  const state = this.state;
23310
- this.state = "rendering", this.layerService.prepareStageLayer(this), this.nextFrameRenderLayerSet.size && !this._skipRender && (this.hooks.beforeRender.call(this), this.renderLayerList(Array.from(this.nextFrameRenderLayerSet.values()), this.lastRenderparams || {}), this.combineLayersToWindow(), this.hooks.afterRender.call(this), this.nextFrameRenderLayerSet.clear()), this.state = state, this._skipRender && this._skipRender++;
23315
+ this.state = "rendering", this.layerService.prepareStageLayer(this), this.nextFrameRenderLayerSet.size && !this._skipRender && (this.hooks.beforeRender.call(this), this._skipRender || (this.renderLayerList(Array.from(this.nextFrameRenderLayerSet.values()), this.lastRenderparams || {}), this.combineLayersToWindow(), this.nextFrameRenderLayerSet.clear()), this.hooks.afterRender.call(this)), this.state = state, this._skipRender && this._skipRender++;
23311
23316
  }
23312
23317
  renderLayerList(layerList, params) {
23313
23318
  const list = [];
@@ -23319,14 +23324,17 @@
23319
23324
  layer.renderCount > this.renderCount || (layer.renderCount = this.renderCount + 1, layer.render({
23320
23325
  renderService: this.renderService,
23321
23326
  background: layer === this.defaultLayer ? this.background : void 0,
23322
- updateBounds: !(!this.dirtyBounds || this.dirtyBounds.empty())
23327
+ updateBounds: !(!this.dirtyBounds || this.dirtyBounds.empty()),
23328
+ viewBox: this.window.getViewBox(),
23329
+ transMatrix: this.window.getViewBoxTransform()
23323
23330
  }, Object.assign({
23324
- renderStyle: this.renderStyle,
23325
- keepMatrix: this.params.renderKeepMatrix
23331
+ renderStyle: this.renderStyle
23326
23332
  }, params)));
23327
23333
  }), this.interactiveLayer && !layerList.includes(this.interactiveLayer) && this.interactiveLayer.render({
23328
23334
  renderService: this.renderService,
23329
- updateBounds: !(!this.dirtyBounds || this.dirtyBounds.empty())
23335
+ updateBounds: !(!this.dirtyBounds || this.dirtyBounds.empty()),
23336
+ viewBox: this.window.getViewBox(),
23337
+ transMatrix: this.window.getViewBoxTransform()
23330
23338
  }, Object.assign({
23331
23339
  renderStyle: this.renderStyle
23332
23340
  }, params));
@@ -23337,9 +23345,9 @@
23337
23345
  }
23338
23346
  resize(w, h) {
23339
23347
  let rerender = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
23340
- this.window.resize(w, h), this.forEachChildren(c => {
23348
+ this.window.hasSubView() || this.viewBox.setValue(this.viewBox.x1, this.viewBox.y1, this.viewBox.x1 + w, this.viewBox.y1 + h), this.window.resize(w, h), this.forEachChildren(c => {
23341
23349
  c.resize(w, h);
23342
- }), this._subView || this.viewBox.setValue(this.viewBox.x1, this.viewBox.y1, this.viewBox.x1 + w, this.viewBox.y1 + h), this.camera && this.option3d && this.set3dOptions(this.option3d), rerender && this.render();
23350
+ }), this.camera && this.option3d && this.set3dOptions(this.option3d), rerender && this.render();
23343
23351
  }
23344
23352
  resizeView(w, h) {
23345
23353
  let rerender = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
@@ -23393,47 +23401,41 @@
23393
23401
  getLayer(name) {
23394
23402
  return this.children.filter(layer => layer.name === name)[0];
23395
23403
  }
23396
- renderTo(window, params) {
23404
+ renderTo(window) {
23397
23405
  this.forEachChildren((layer, i) => {
23398
- layer.drawTo(window, Object.assign(Object.assign({}, params), {
23406
+ layer.drawTo(window, {
23399
23407
  renderService: this.renderService,
23408
+ viewBox: window.getViewBox(),
23409
+ transMatrix: window.getViewBoxTransform(),
23400
23410
  background: layer === this.defaultLayer ? this.background : void 0,
23401
23411
  clear: 0 === i,
23402
23412
  updateBounds: !(!this.dirtyBounds || this.dirtyBounds.empty())
23403
- }));
23413
+ });
23404
23414
  });
23405
23415
  }
23406
23416
  renderToNewWindow() {
23407
- let fullImage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
23408
23417
  let viewBox = arguments.length > 1 ? arguments[1] : undefined;
23409
- const window = container.get(VWindow);
23410
- if (fullImage) window.create({
23411
- width: this.viewWidth,
23412
- height: this.viewHeight,
23418
+ const window = container.get(VWindow),
23419
+ x1 = viewBox ? -viewBox.x1 : 0,
23420
+ y1 = viewBox ? -viewBox.y1 : 0,
23421
+ x2 = viewBox ? viewBox.x2 : this.viewWidth,
23422
+ y2 = viewBox ? viewBox.y2 : this.viewHeight,
23423
+ width = viewBox ? viewBox.width() : this.viewWidth,
23424
+ height = viewBox ? viewBox.height() : this.viewHeight;
23425
+ return window.create({
23426
+ viewBox: {
23427
+ x1: x1,
23428
+ y1: y1,
23429
+ x2: x2,
23430
+ y2: y2
23431
+ },
23432
+ width: width,
23433
+ height: height,
23413
23434
  dpr: this.window.dpr,
23414
23435
  canvasControled: !0,
23415
23436
  offscreen: !0,
23416
23437
  title: ""
23417
- });else {
23418
- const width = viewBox ? viewBox.width() : Math.min(this.viewWidth, this.window.width - this.x),
23419
- height = viewBox ? viewBox.height() : Math.min(this.viewHeight, this.window.height - this.y);
23420
- window.create({
23421
- width: width,
23422
- height: height,
23423
- dpr: this.window.dpr,
23424
- canvasControled: !0,
23425
- offscreen: !0,
23426
- title: ""
23427
- });
23428
- }
23429
- const x = viewBox ? -viewBox.x1 : 0,
23430
- y = viewBox ? -viewBox.y1 : 0;
23431
- return this.renderTo(window, {
23432
- x: x,
23433
- y: y,
23434
- width: viewBox ? viewBox.x2 : window.width,
23435
- height: viewBox ? viewBox.y2 : window.height
23436
- }), window;
23438
+ }), this.renderTo(window), window;
23437
23439
  }
23438
23440
  toCanvas() {
23439
23441
  let fullImage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
@@ -23463,7 +23465,7 @@
23463
23465
  __metadata$M = undefined && undefined.__metadata || function (k, v) {
23464
23466
  if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
23465
23467
  };
23466
- const initMatrix$1 = new Matrix(1, 0, 0, 1, 0, 0),
23468
+ const initMatrix = new Matrix(1, 0, 0, 1, 0, 0),
23467
23469
  globalPoint = {
23468
23470
  x: 0,
23469
23471
  y: 0
@@ -23473,7 +23475,7 @@
23473
23475
  return this.path;
23474
23476
  }
23475
23477
  constructor(canvas, dpr) {
23476
- this.matrix = new Matrix(1, 0, 0, 1, 0, 0), this.stack = [], this.dpr = dpr, this.applyedMatrix = new Matrix(1, 0, 0, 1, 0, 0), this.path = new CustomPath2D();
23478
+ this.matrix = new Matrix(1, 0, 0, 1, 0, 0), this.stack = [], this.dpr = dpr, this.applyedMatrix = new Matrix(1, 0, 0, 1, 0, 0), this.path = new CustomPath2D(), this._clearMatrix = new Matrix(1, 0, 0, 1, 0, 0);
23477
23479
  }
23478
23480
  getCanvas() {
23479
23481
  throw new Error("不支持getCanvas");
@@ -23657,7 +23659,10 @@
23657
23659
  clearMatrix() {
23658
23660
  let setTransform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
23659
23661
  let dpr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.dpr;
23660
- this.setTransformFromMatrix(initMatrix$1, setTransform, dpr);
23662
+ this.setTransformFromMatrix(initMatrix, setTransform, dpr);
23663
+ }
23664
+ setClearMatrix(a, b, c, d, e, f) {
23665
+ this._clearMatrix.setValue(a, b, c, d, e, f);
23661
23666
  }
23662
23667
  onlyTranslate() {
23663
23668
  let dpr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dpr;
@@ -23863,7 +23868,7 @@
23863
23868
  };
23864
23869
  let BaseWindowHandlerContribution = class {
23865
23870
  constructor() {
23866
- this._uid = Generator.GenAutoIncrementId();
23871
+ this._uid = Generator.GenAutoIncrementId(), this.viewBox = new AABBBounds(), this.modelMatrix = new Matrix(1, 0, 0, 1, 0, 0);
23867
23872
  }
23868
23873
  onChange(cb) {
23869
23874
  this._onChangeCb = cb;
@@ -23884,6 +23889,18 @@
23884
23889
  left: 0
23885
23890
  };
23886
23891
  }
23892
+ setViewBox(vb) {
23893
+ this.viewBox.setValue(vb.x1, vb.y1, vb.x2, vb.y2);
23894
+ }
23895
+ getViewBox() {
23896
+ return this.viewBox;
23897
+ }
23898
+ setViewBoxTransform(a, b, c, d, e, f) {
23899
+ this.modelMatrix.setValue(a, b, c, d, e, f);
23900
+ }
23901
+ getViewBoxTransform() {
23902
+ return this.modelMatrix;
23903
+ }
23887
23904
  };
23888
23905
  BaseWindowHandlerContribution = __decorate$_([injectable(), __metadata$K("design:paramtypes", [])], BaseWindowHandlerContribution);
23889
23906
 
@@ -23915,23 +23932,14 @@
23915
23932
  group: null
23916
23933
  };
23917
23934
  params.pickerService = this;
23918
- let offsetX = 0,
23919
- offsetY = 0;
23920
- if (params && params.bounds) {
23921
- if (!params.bounds.contains(point.x, point.y)) return result;
23922
- offsetX = params.bounds.x1, offsetY = params.bounds.y1;
23923
- }
23924
- if (this.pickContext) if (params.keepMatrix) {
23925
- if (this.pickContext.nativeContext && this.pickContext.nativeContext.getTransform) {
23926
- const t = this.pickContext.nativeContext.getTransform();
23927
- this.pickContext.setTransformFromMatrix(t, !0, 1);
23928
- }
23929
- } else this.pickContext.inuse = !0, this.pickContext.clearMatrix(!0, 1);
23930
- params.pickContext = this.pickContext;
23931
- const parentMatrix = new Matrix(1, 0, 0, 1, offsetX, offsetY);
23935
+ const w = params.bounds.width(),
23936
+ h = params.bounds.height();
23937
+ if (!new AABBBounds().setValue(0, 0, w, h).containsPoint(point)) return result;
23938
+ this.pickContext && (this.pickContext.inuse = !0), params.pickContext = this.pickContext, this.pickContext && this.pickContext.clearMatrix(!0, 1);
23939
+ const parentMatrix = new Matrix(1, 0, 0, 1, 0, 0);
23932
23940
  let group;
23933
23941
  for (let i = graphics.length - 1; i >= 0 && (result = graphics[i].isContainer ? this.pickGroup(graphics[i], point, parentMatrix, params) : this.pickItem(graphics[i], point, parentMatrix, params), !result.graphic); i--) group || (group = result.group);
23934
- if (result.graphic || (result.group = group), this.pickContext && !params.keepMatrix && (this.pickContext.inuse = !1), result.graphic) {
23942
+ if (result.graphic || (result.group = group), this.pickContext && (this.pickContext.inuse = !1), result.graphic) {
23935
23943
  let g = result.graphic;
23936
23944
  for (; g.parent;) g = g.parent;
23937
23945
  g.shadowHost && (result.params = {
@@ -28162,7 +28170,6 @@
28162
28170
  if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
28163
28171
  };
28164
28172
  const outP = [0, 0, 0],
28165
- initMatrix = new Matrix(1, 0, 0, 1, 0, 0),
28166
28173
  addArcToBezierPath = (bezierPath, startAngle, endAngle, cx, cy, rx, ry, clockwise) => {
28167
28174
  if (clockwise) for (; endAngle > startAngle;) endAngle -= pi2;else for (; endAngle < startAngle;) endAngle += pi2;
28168
28175
  const step = pi$1 / 3 * (endAngle > startAngle ? 1 : -1);
@@ -28293,7 +28300,7 @@
28293
28300
  }), this._clearShadowStyle = !1, this._clearFilterStyle = !1, this._clearGlobalCompositeOperationStyle = !1;
28294
28301
  const context = canvas.nativeCanvas.getContext("2d");
28295
28302
  if (!context) throw new Error("发生错误,获取2d上下文失败");
28296
- this.nativeContext = context, this.canvas = canvas, this.matrix = new Matrix(1, 0, 0, 1, 0, 0), this.stack = [], this.dpr = dpr, this.applyedMatrix = new Matrix(1, 0, 0, 1, 0, 0);
28303
+ this.nativeContext = context, this.canvas = canvas, this.matrix = new Matrix(1, 0, 0, 1, 0, 0), this.stack = [], this.dpr = dpr, this.applyedMatrix = new Matrix(1, 0, 0, 1, 0, 0), this._clearMatrix = new Matrix(1, 0, 0, 1, 0, 0);
28297
28304
  }
28298
28305
  reset() {
28299
28306
  this.stack.length && Logger.getInstance().warn("可能存在bug,matrix没有清空"), this.matrix.setValue(1, 0, 0, 1, 0, 0), this.applyedMatrix = new Matrix(1, 0, 0, 1, 0, 0), this.stack.length = 0, this.nativeContext.setTransform(1, 0, 0, 1, 0, 0);
@@ -28655,7 +28662,10 @@
28655
28662
  clearMatrix() {
28656
28663
  let setTransform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
28657
28664
  let dpr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.dpr;
28658
- this.setTransformFromMatrix(initMatrix, setTransform, dpr);
28665
+ this.setTransformFromMatrix(this._clearMatrix, setTransform, dpr);
28666
+ }
28667
+ setClearMatrix(a, b, c, d, e, f) {
28668
+ this._clearMatrix.setValue(a, b, c, d, e, f);
28659
28669
  }
28660
28670
  onlyTranslate() {
28661
28671
  let dpr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dpr;
@@ -28886,10 +28896,10 @@
28886
28896
  return `${BrowserWindowHandlerContribution_1.idprefix}_${BrowserWindowHandlerContribution_1.prefix_count++}`;
28887
28897
  }
28888
28898
  constructor() {
28889
- super(), this.type = "browser", this._canvasIsIntersecting = !0, this.global = application.global;
28899
+ super(), this.type = "browser", this._canvasIsIntersecting = !0, this.global = application.global, this.viewBox = new AABBBounds(), this.modelMatrix = new Matrix(1, 0, 0, 1, 0, 0);
28890
28900
  }
28891
28901
  getTitle() {
28892
- return this.canvas.id.toString();
28902
+ return this.canvas.id && this.canvas.id.toString();
28893
28903
  }
28894
28904
  getWH() {
28895
28905
  return {
@@ -29016,8 +29026,9 @@
29016
29026
  bottom: 0
29017
29027
  };
29018
29028
  }
29019
- clearViewBox(vb, color) {
29020
- const context = this.getContext(),
29029
+ clearViewBox(color) {
29030
+ const vb = this.viewBox,
29031
+ context = this.getContext(),
29021
29032
  dpr = this.getDpr();
29022
29033
  context.nativeContext.save(), context.nativeContext.setTransform(dpr, 0, 0, dpr, 0, 0), context.clearRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1), color && (context.fillStyle = color, context.fillRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1)), context.nativeContext.restore();
29023
29034
  }
@@ -29451,8 +29462,9 @@
29451
29462
  bottom: 0
29452
29463
  };
29453
29464
  }
29454
- clearViewBox(vb, color) {
29455
- const context = this.getContext(),
29465
+ clearViewBox(color) {
29466
+ const vb = this.viewBox,
29467
+ context = this.getContext(),
29456
29468
  dpr = this.getDpr();
29457
29469
  context.nativeContext.save(), context.nativeContext.setTransform(dpr, 0, 0, dpr, 0, 0), context.clearRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1), color && (context.fillStyle = color, context.fillRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1)), context.nativeContext.restore();
29458
29470
  }
@@ -29913,8 +29925,9 @@
29913
29925
  bottom: 0
29914
29926
  };
29915
29927
  }
29916
- clearViewBox(vb, color) {
29917
- const context = this.getContext(),
29928
+ clearViewBox(color) {
29929
+ const vb = this.viewBox,
29930
+ context = this.getContext(),
29918
29931
  dpr = this.getDpr();
29919
29932
  context.nativeContext.save(), context.nativeContext.setTransform(dpr, 0, 0, dpr, 0, 0), context.clearRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1), color && (context.fillStyle = color, context.fillRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1)), context.nativeContext.restore();
29920
29933
  }
@@ -30193,7 +30206,7 @@
30193
30206
  getBoundingClientRect() {
30194
30207
  return null;
30195
30208
  }
30196
- clearViewBox(vb, color) {}
30209
+ clearViewBox(color) {}
30197
30210
  };
30198
30211
  NodeWindowHandlerContribution.env = "node", NodeWindowHandlerContribution = __decorate$C([injectable(), __param$p(0, inject(VGlobal)), __metadata$t("design:paramtypes", [Object])], NodeWindowHandlerContribution);
30199
30212
  const nodeWindowModule = new ContainerModule(bind => {
@@ -30558,8 +30571,9 @@
30558
30571
  bottom: 0
30559
30572
  };
30560
30573
  }
30561
- clearViewBox(vb, color) {
30562
- const context = this.getContext(),
30574
+ clearViewBox(color) {
30575
+ const vb = this.viewBox,
30576
+ context = this.getContext(),
30563
30577
  dpr = this.getDpr();
30564
30578
  context.nativeContext.save(), context.nativeContext.setTransform(dpr, 0, 0, dpr, 0, 0), context.clearRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1), color && (context.fillStyle = color, context.fillRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1)), context.nativeContext.restore();
30565
30579
  }
@@ -30863,8 +30877,9 @@
30863
30877
  bottom: 0
30864
30878
  };
30865
30879
  }
30866
- clearViewBox(vb, color) {
30867
- const context = this.getContext(),
30880
+ clearViewBox(color) {
30881
+ const vb = this.viewBox,
30882
+ context = this.getContext(),
30868
30883
  dpr = this.getDpr();
30869
30884
  context.nativeContext.save(), context.nativeContext.setTransform(dpr, 0, 0, dpr, 0, 0), context.clearRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1), color && (context.fillStyle = color, context.fillRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1)), context.nativeContext.restore();
30870
30885
  }
@@ -32438,6 +32453,28 @@
32438
32453
  registerGroup(), registerRect();
32439
32454
  }
32440
32455
 
32456
+ const POLAR_START_ANGLE = -.5 * Math.PI;
32457
+ const POLAR_END_ANGLE = 1.5 * Math.PI;
32458
+ const DEFAULT_TEXT_FONT_FAMILY = "PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol";
32459
+ const DEFAULT_TEXT_FONT_SIZE = 11;
32460
+ var StateValue;
32461
+ !function (StateValue) {
32462
+ StateValue.selected = "selected", StateValue.selectedReverse = "selected_reverse", StateValue.hover = "hover", StateValue.hoverReverse = "hover_reverse";
32463
+ }(StateValue || (StateValue = {}));
32464
+ const DEFAULT_STATES$2 = {
32465
+ [StateValue.selectedReverse]: {},
32466
+ [StateValue.selected]: {},
32467
+ [StateValue.hover]: {},
32468
+ [StateValue.hoverReverse]: {}
32469
+ };
32470
+ const DEFAULT_HTML_TEXT_SPEC = {
32471
+ container: "",
32472
+ width: 30,
32473
+ height: 30,
32474
+ style: {}
32475
+ };
32476
+ const SCROLLBAR_EVENT = "scrollDrag";
32477
+
32441
32478
  const delayMap$3 = {
32442
32479
  debounce: debounce,
32443
32480
  throttle: throttle
@@ -32477,9 +32514,9 @@
32477
32514
  this._prePos = "horizontal" === direction ? e.clientX : e.clientY, this._dispatchEvent("scrollDown", {
32478
32515
  pos: this._prePos,
32479
32516
  event: e
32480
- }), "browser" === vglobal.env ? (vglobal.addEventListener("pointermove", this._onSliderPointerMove, {
32517
+ }), "browser" === vglobal.env ? (vglobal.addEventListener("pointermove", this._onSliderPointerMoveWithDelay, {
32481
32518
  capture: !0
32482
- }), vglobal.addEventListener("pointerup", this._onSliderPointerUp)) : (this.stage.addEventListener("pointermove", this._onSliderPointerMove, {
32519
+ }), vglobal.addEventListener("pointerup", this._onSliderPointerUp)) : (this.stage.addEventListener("pointermove", this._onSliderPointerMoveWithDelay, {
32483
32520
  capture: !0
32484
32521
  }), this.stage.addEventListener("pointerup", this._onSliderPointerUp), this.stage.addEventListener("pointerupoutside", this._onSliderPointerUp));
32485
32522
  }, this._computeScrollValue = e => {
@@ -32494,12 +32531,12 @@
32494
32531
  height: height
32495
32532
  } = this._getSliderRenderBounds();
32496
32533
  return "vertical" === direction ? (currentPos = e.clientY, delta = currentPos - this._prePos, currentScrollValue = delta / height) : (currentPos = e.clientX, delta = currentPos - this._prePos, currentScrollValue = delta / width), [currentPos, currentScrollValue];
32497
- }, this._onSliderPointerMove = delayMap$3[this.attribute.delayType](e => {
32534
+ }, this._onSliderPointerMove = e => {
32498
32535
  e.stopPropagation();
32499
32536
  const preScrollRange = this.getScrollRange(),
32500
32537
  [currentPos, currentScrollValue] = this._computeScrollValue(e);
32501
32538
  this.setScrollRange([preScrollRange[0] + currentScrollValue, preScrollRange[1] + currentScrollValue], !0), this._prePos = currentPos;
32502
- }, this.attribute.delayTime), this._onSliderPointerUp = e => {
32539
+ }, this._onSliderPointerMoveWithDelay = 0 === this.attribute.delayTime ? this._onSliderPointerMove : delayMap$3[this.attribute.delayType](this._onSliderPointerMove, this.attribute.delayTime), this._onSliderPointerUp = e => {
32503
32540
  e.preventDefault();
32504
32541
  const {
32505
32542
  realTime = !0,
@@ -32512,9 +32549,9 @@
32512
32549
  this._dispatchEvent("scrollUp", {
32513
32550
  pre: preRange,
32514
32551
  value: clampRange$1(range, limitRange[0], limitRange[1])
32515
- }), "browser" === vglobal.env ? (vglobal.removeEventListener("pointermove", this._onSliderPointerMove, {
32552
+ }), "browser" === vglobal.env ? (vglobal.removeEventListener("pointermove", this._onSliderPointerMoveWithDelay, {
32516
32553
  capture: !0
32517
- }), vglobal.removeEventListener("pointerup", this._onSliderPointerUp)) : (this.stage.removeEventListener("pointermove", this._onSliderPointerMove, {
32554
+ }), vglobal.removeEventListener("pointerup", this._onSliderPointerUp)) : (this.stage.removeEventListener("pointermove", this._onSliderPointerMoveWithDelay, {
32518
32555
  capture: !0
32519
32556
  }), this.stage.removeEventListener("pointerup", this._onSliderPointerUp), this.stage.removeEventListener("pointerupoutside", this._onSliderPointerUp));
32520
32557
  };
@@ -32541,7 +32578,7 @@
32541
32578
  }, !0), this.stage && !this.stage.autoRender && this.stage.renderNextFrame();
32542
32579
  }
32543
32580
  }
32544
- this.attribute.range = currScrollRange, realTime && this._dispatchEvent("scrollDrag", {
32581
+ this.attribute.range = currScrollRange, realTime && this._dispatchEvent(SCROLLBAR_EVENT, {
32545
32582
  pre: preRange,
32546
32583
  value: currScrollRange
32547
32584
  });
@@ -32780,27 +32817,6 @@
32780
32817
  return direct ? angleLargeThanPI ? 2 * Math.PI - ang : ang : angleLargeThanPI ? ang : 2 * Math.PI - ang;
32781
32818
  }
32782
32819
 
32783
- const POLAR_START_ANGLE = -.5 * Math.PI;
32784
- const POLAR_END_ANGLE = 1.5 * Math.PI;
32785
- const DEFAULT_TEXT_FONT_FAMILY = "PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol";
32786
- const DEFAULT_TEXT_FONT_SIZE = 11;
32787
- var StateValue;
32788
- !function (StateValue) {
32789
- StateValue.selected = "selected", StateValue.selectedReverse = "selected_reverse", StateValue.hover = "hover", StateValue.hoverReverse = "hover_reverse";
32790
- }(StateValue || (StateValue = {}));
32791
- const DEFAULT_STATES$2 = {
32792
- [StateValue.selectedReverse]: {},
32793
- [StateValue.selected]: {},
32794
- [StateValue.hover]: {},
32795
- [StateValue.hoverReverse]: {}
32796
- };
32797
- const DEFAULT_HTML_TEXT_SPEC = {
32798
- container: "",
32799
- width: 30,
32800
- height: 30,
32801
- style: {}
32802
- };
32803
-
32804
32820
  const initTextMeasure$1 = (textSpec, option, useNaiveCanvas) => new TextMeasure(Object.assign({
32805
32821
  defaultFontParams: {
32806
32822
  fontFamily: DEFAULT_TEXT_FONT_FAMILY,
@@ -33739,7 +33755,7 @@
33739
33755
  w = ~~((width + left + right + ratio) / ratio),
33740
33756
  h = ~~((height + top + bottom + ratio) / ratio),
33741
33757
  scale = _ => ~~(_ / ratio);
33742
- return scale.bitmap = () => bitmap(w, h), scale.x = _ => ~~(_ + left / ratio), scale.y = _ => ~~(_ + top / ratio), scale.ratio = ratio, scale.padding = padding, scale.width = width, scale.height = height, scale;
33758
+ return scale.bitmap = () => bitmap(w, h), scale.x = _ => ~~((_ + left) / ratio), scale.y = _ => ~~((_ + top) / ratio), scale.ratio = ratio, scale.padding = padding, scale.width = width, scale.height = height, scale;
33743
33759
  }
33744
33760
  function boundToRange($, bound) {
33745
33761
  let clamp = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
@@ -33788,7 +33804,7 @@
33788
33804
  const validCandidates = candidates.filter(candidate => isValid$3(candidate));
33789
33805
  for (let i = 0; i < validCandidates.length; i++) {
33790
33806
  const tempText = text.clone();
33791
- if (tempText.setAttributes(validCandidates[i]), tempText.update(), canPlace($, bitmap, boundToRange($, tempText.AABBBounds), clampForce, pad)) return bitmap.setRange(boundToRange($, tempText.AABBBounds, !0)), validCandidates[i];
33807
+ if (tempText.setAttributes(validCandidates[i]), tempText.update(), canPlace($, bitmap, tempText.AABBBounds, clampForce, pad)) return bitmap.setRange(boundToRange($, tempText.AABBBounds, !0)), validCandidates[i];
33792
33808
  }
33793
33809
  return !1;
33794
33810
  }
@@ -37048,17 +37064,9 @@
37048
37064
  }), items.length > 1 && alternateColor) {
37049
37065
  const colors = isArray$3(alternateColor) ? alternateColor : [alternateColor, "transparent"],
37050
37066
  getColor = index => colors[index % colors.length];
37051
- for (let index = 0; index < items.length; index++) {
37052
- const prev = items[index].points;
37053
- let curr;
37054
- curr = index !== items.length - 1 ? items[index + 1].points : [{
37055
- x: items[index].points[0].x + (items[index].points[0].x - items[index - 1].points[0].x),
37056
- y: items[index].points[0].y + (items[index].points[0].y - items[index - 1].points[0].y)
37057
- }, {
37058
- x: items[index].points[1].x + (items[index].points[1].x - items[index - 1].points[1].x),
37059
- y: items[index].points[1].y + (items[index].points[1].y - items[index - 1].points[1].y)
37060
- }];
37061
- const path = getRegionPath(prev, curr, gridAttrs),
37067
+ for (let index = 0; index < items.length - 1; index++) {
37068
+ const [prev, curr] = [items[index].points, items[index + 1].points],
37069
+ path = getRegionPath(prev, curr, gridAttrs),
37062
37070
  shape = graphicCreator.path({
37063
37071
  path: path,
37064
37072
  fill: getColor(index)
@@ -37505,7 +37513,7 @@
37505
37513
  start: start,
37506
37514
  end: end
37507
37515
  } = this.state;
37508
- this._activeState && (this._activeTag === DataZoomActiveTag.middleHandler ? this.moveZoomWithMiddle((this.state.start + this.state.end) / 2 + dis) : this._activeTag === DataZoomActiveTag.startHandler ? start + dis > end ? (start = end, end = start + dis, this._activeTag = DataZoomActiveTag.endHandler) : start += dis : this._activeTag === DataZoomActiveTag.endHandler && (end + dis < start ? (end = start, start = end + dis, this._activeTag = DataZoomActiveTag.startHandler) : end += dis), this._activeCache.lastPos = pos, brushSelect && this.renderDragMask()), start = Math.min(Math.max(start, 0), 1), end = Math.min(Math.max(end, 0), 1), !realTime || startAttr === start && endAttr === end || this.setStateAttr(start, end, !0), realTime && this._dispatchEvent("change", {
37516
+ this._activeState && (this._activeTag === DataZoomActiveTag.middleHandler ? this.moveZoomWithMiddle((this.state.start + this.state.end) / 2 + dis) : this._activeTag === DataZoomActiveTag.startHandler ? start + dis > end ? (start = end, end = start + dis, this._activeTag = DataZoomActiveTag.endHandler) : start += dis : this._activeTag === DataZoomActiveTag.endHandler && (end + dis < start ? (end = start, start = end + dis, this._activeTag = DataZoomActiveTag.startHandler) : end += dis), this._activeCache.lastPos = pos, brushSelect && this.renderDragMask()), start = Math.min(Math.max(start, 0), 1), end = Math.min(Math.max(end, 0), 1), startAttr === start && endAttr === end || this.setStateAttr(start, end, !0), realTime && this._dispatchEvent("change", {
37509
37517
  start: start,
37510
37518
  end: end,
37511
37519
  tag: this._activeTag
@@ -37574,14 +37582,14 @@
37574
37582
  }));
37575
37583
  }
37576
37584
  eventPosToStagePos(e) {
37577
- var _a, _b;
37585
+ var _a, _b, _c, _d, _e, _f;
37578
37586
  const {
37579
37587
  x: x,
37580
37588
  y: y
37581
- } = vglobal.mapToCanvasPoint(e, this.stage.window.getContext().canvas.nativeCanvas);
37589
+ } = vglobal.mapToCanvasPoint(e, null === (_d = null === (_c = null === (_b = null === (_a = this.stage) || void 0 === _a ? void 0 : _a.window) || void 0 === _b ? void 0 : _b.getContext()) || void 0 === _c ? void 0 : _c.canvas) || void 0 === _d ? void 0 : _d.nativeCanvas);
37582
37590
  return {
37583
- x: x - ((null === (_a = this.stage) || void 0 === _a ? void 0 : _a.x) || 0),
37584
- y: y - ((null === (_b = this.stage) || void 0 === _b ? void 0 : _b.y) || 0)
37591
+ x: x - ((null === (_e = this.stage) || void 0 === _e ? void 0 : _e.x) || 0),
37592
+ y: y - ((null === (_f = this.stage) || void 0 === _f ? void 0 : _f.y) || 0)
37585
37593
  };
37586
37594
  }
37587
37595
  _onHandlerPointerEnter(e) {
@@ -42520,7 +42528,7 @@
42520
42528
  this._activeMoveState = brushMoved && this._isPosInBrushMask(e), this._activeDrawState = !this._activeMoveState, this._activeDrawState && this._initDraw(e), this._activeMoveState && this._initMove(e);
42521
42529
  }, this._onBrushing = e => {
42522
42530
  this._outOfInteractiveRange(e) || ((this._activeDrawState || this._activeMoveState) && e.stopPropagation(), this._activeDrawState && this._drawing(e), this._activeMoveState && this._moving(e));
42523
- }, this._onBrushEnd = e => {
42531
+ }, this._onBrushingWithDelay = 0 === this.attribute.delayTime ? this._onBrushing : delayMap$1[this.attribute.delayType](this._onBrushing, this.attribute.delayTime), this._onBrushEnd = e => {
42524
42532
  e.preventDefault();
42525
42533
  const {
42526
42534
  removeOnClick = !0
@@ -42543,14 +42551,12 @@
42543
42551
  _bindBrushEvents() {
42544
42552
  if (this.attribute.disableTriggerEvent) return;
42545
42553
  const {
42546
- delayType = "throttle",
42547
- delayTime = 0,
42548
42554
  trigger = DEFAULT_BRUSH_ATTRIBUTES.trigger,
42549
42555
  updateTrigger = DEFAULT_BRUSH_ATTRIBUTES.updateTrigger,
42550
42556
  endTrigger = DEFAULT_BRUSH_ATTRIBUTES.endTrigger,
42551
42557
  resetTrigger = DEFAULT_BRUSH_ATTRIBUTES.resetTrigger
42552
42558
  } = this.attribute;
42553
- this.stage.addEventListener(trigger, this._onBrushStart), this.stage.addEventListener(updateTrigger, delayMap$1[delayType](this._onBrushing, delayTime)), this.stage.addEventListener(endTrigger, this._onBrushEnd), this.stage.addEventListener(resetTrigger, this._onBrushEnd);
42559
+ this.stage.addEventListener(trigger, this._onBrushStart), this.stage.addEventListener(updateTrigger, this._onBrushingWithDelay), this.stage.addEventListener(endTrigger, this._onBrushEnd), this.stage.addEventListener(resetTrigger, this._onBrushEnd);
42554
42560
  }
42555
42561
  _isPosInBrushMask(e) {
42556
42562
  const pos = this.eventPosToStagePos(e),
@@ -42745,7 +42751,7 @@
42745
42751
  endTrigger = DEFAULT_BRUSH_ATTRIBUTES.endTrigger,
42746
42752
  resetTrigger = DEFAULT_BRUSH_ATTRIBUTES.resetTrigger
42747
42753
  } = this.attribute;
42748
- this.stage.removeEventListener(trigger, this._onBrushStart), this.stage.removeEventListener(updateTrigger, delayMap$1[delayType](this._onBrushing, delayTime)), this.stage.removeEventListener(endTrigger, this._onBrushEnd), this.stage.removeEventListener(resetTrigger, this._onBrushEnd);
42754
+ this.stage.removeEventListener(trigger, this._onBrushStart), this.stage.removeEventListener(updateTrigger, this._onBrushingWithDelay), this.stage.removeEventListener(endTrigger, this._onBrushEnd), this.stage.removeEventListener(resetTrigger, this._onBrushEnd);
42749
42755
  }
42750
42756
  };
42751
42757
  Brush$1.defaultAttributes = DEFAULT_BRUSH_ATTRIBUTES;
@@ -44611,9 +44617,12 @@
44611
44617
  excludedChannels = Object.keys(excludedChannelMap).filter(channel => 0 !== excludedChannelMap[channel]);
44612
44618
  this.subAnimate.animate.preventAttrs(excludedChannels);
44613
44619
  const from = Object.assign({}, this.from),
44614
- to = Object.assign({}, this.to);
44620
+ to = Object.assign({}, this.to),
44621
+ animatedChannels = [];
44615
44622
  Object.keys(to).forEach(k => {
44616
- excludedChannels.includes(k) ? (from[k] = to[k], this.from[k] = to[k]) : isNil$3(from[k]) && (from[k] = this.target.getComputedAttribute(k));
44623
+ excludedChannels.includes(k) ? (from[k] = to[k], this.from[k] = to[k]) : isNil$3(from[k]) ? from[k] = this.target.getComputedAttribute(k) : animatedChannels.push(k);
44624
+ }), this.target.animates.forEach(a => {
44625
+ a !== this.subAnimate.animate && a.preventAttrs(animatedChannels);
44617
44626
  }), this.target.setAttributes(from, !1, {
44618
44627
  type: AttributeUpdateType.ANIMATE_UPDATE,
44619
44628
  animationState: {
@@ -44623,9 +44632,14 @@
44623
44632
  }), this._fromAttribute = from, this._toAttribute = to;
44624
44633
  }
44625
44634
  onEnd() {
44626
- this.target.setAttributes(this._toAttribute, !1, {
44627
- type: AttributeUpdateType.ANIMATE_END
44628
- });
44635
+ if (this._toAttribute) {
44636
+ const out = {};
44637
+ Object.keys(this._toAttribute).forEach(key => {
44638
+ this.subAnimate.animate.validAttr(key) && (out[key] = this._toAttribute[key]);
44639
+ }), this.target.setAttributes(out, !1, {
44640
+ type: AttributeUpdateType.ANIMATE_END
44641
+ });
44642
+ }
44629
44643
  }
44630
44644
  update(end, ratio, out) {
44631
44645
  0 === this.updateCount && this.onFirstRun(), this.updateCount += 1;
@@ -47545,6 +47559,10 @@
47545
47559
  const stage = this.renderer.stage();
47546
47560
  stage && stage.on("*", this.delegateEvent);
47547
47561
  }
47562
+ releaseStageEvent() {
47563
+ const stage = this.renderer.stage();
47564
+ stage && stage.off("*", this.delegateEvent);
47565
+ }
47548
47566
  addEventListener(type, handler, options) {
47549
47567
  let callback = handler;
47550
47568
  return options && !1 === options.trap || (callback = handler, callback.raw = handler), options && options.target && (callback.target = options.target), this.on(type, callback), this;
@@ -47594,7 +47612,7 @@
47594
47612
  }
47595
47613
  release() {
47596
47614
  var _a, _b, _c;
47597
- this._unBindResizeEvent(), this.clearProgressive(), Factory$1.unregisterRuntimeTransforms(), this.animate.stop(), this.grammars.release(), this._cachedGrammars.release(), this._dataflow.release(), this._dataflow = null, null === (_b = null === (_a = this.renderer) || void 0 === _a ? void 0 : _a.release) || void 0 === _b || _b.call(_a), this.renderer = null, this._boundInteractions = null, this.removeAllListeners(), null === (_c = this._eventListeners) || void 0 === _c || _c.forEach(listener => {
47615
+ this.releaseStageEvent(), this._unBindResizeEvent(), this.clearProgressive(), Factory$1.unregisterRuntimeTransforms(), this.animate.stop(), this.grammars.release(), this._cachedGrammars.release(), this._dataflow.release(), this._dataflow = null, null === (_b = null === (_a = this.renderer) || void 0 === _a ? void 0 : _a.release) || void 0 === _b || _b.call(_a), this.renderer = null, this._boundInteractions = null, this.removeAllListeners(), null === (_c = this._eventListeners) || void 0 === _c || _c.forEach(listener => {
47598
47616
  listener.source.removeEventListener(listener.type, listener.handler);
47599
47617
  }), this._eventListeners = null;
47600
47618
  }
@@ -51439,7 +51457,8 @@
51439
51457
  style: {
51440
51458
  symbolType: 'circle'
51441
51459
  }
51442
- }
51460
+ },
51461
+ seriesMark: 'area'
51443
51462
  };
51444
51463
 
51445
51464
  const bar = {
@@ -54013,7 +54032,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
54013
54032
  return this;
54014
54033
  }
54015
54034
  release() {
54016
- this._eventDispatcher.release();
54035
+ this._eventDispatcher.clear();
54017
54036
  this._composedEventMap.clear();
54018
54037
  }
54019
54038
  };
@@ -54158,7 +54177,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
54158
54177
  }
54159
54178
  return this;
54160
54179
  }
54161
- release() {
54180
+ clear() {
54162
54181
  for (const entry of this._viewListeners.entries()) {
54163
54182
  this._compiler.removeEventListener(exports.Event_Source_Type.chart, entry[0], entry[1]);
54164
54183
  }
@@ -54184,6 +54203,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
54184
54203
  }
54185
54204
  this._canvasBubbles.clear();
54186
54205
  }
54206
+ release() {
54207
+ this.clear();
54208
+ this.globalInstance = null;
54209
+ this._compiler = null;
54210
+ }
54187
54211
  _filter(filter, evt, params) {
54188
54212
  var _a, _b, _c;
54189
54213
  if (isFunction$1(filter.filter) && !filter.filter(params)) {
@@ -54630,6 +54654,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
54630
54654
  [GrammarType.mark]: {}
54631
54655
  };
54632
54656
  this._compileChart = null;
54657
+ this.handleStageRender = () => {
54658
+ var _a, _b;
54659
+ (_b = (_a = this._compileChart) === null || _a === void 0 ? void 0 : _a.getEvent()) === null || _b === void 0 ? void 0 : _b.emit(exports.ChartEvent.afterRender, { chart: this._compileChart });
54660
+ };
54633
54661
  this._container = container;
54634
54662
  this._option = option;
54635
54663
  }
@@ -54666,10 +54694,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
54666
54694
  (_a = this._compileChart) === null || _a === void 0 ? void 0 : _a.onLayout(this._view);
54667
54695
  }, logger: logger, logLevel: logger.level() }));
54668
54696
  this._setCanvasStyle();
54669
- this.getStage().hooks.afterRender.tap('chart-event', () => {
54670
- var _a, _b;
54671
- (_b = (_a = this._compileChart) === null || _a === void 0 ? void 0 : _a.getEvent()) === null || _b === void 0 ? void 0 : _b.emit(exports.ChartEvent.afterRender, { chart: this._compileChart });
54672
- });
54697
+ this.getStage().hooks.afterRender.tap('chart-event', this.handleStageRender);
54673
54698
  const interactive = this._option.interactive;
54674
54699
  if (interactive !== false) {
54675
54700
  this._viewListeners.forEach(listener => {
@@ -54893,6 +54918,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
54893
54918
  }
54894
54919
  }
54895
54920
  releaseEvent() {
54921
+ const stage = this.getStage();
54922
+ if (stage) {
54923
+ stage.hooks.afterRender.unTap('chart-event', this.handleStageRender);
54924
+ }
54896
54925
  this._viewListeners.clear();
54897
54926
  this._windowListeners.clear();
54898
54927
  this._canvasListeners.clear();
@@ -54905,6 +54934,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
54905
54934
  (_a = this._view) === null || _a === void 0 ? void 0 : _a.release();
54906
54935
  this._view = null;
54907
54936
  this.isInited = false;
54937
+ this._compileChart = null;
54908
54938
  }
54909
54939
  releaseGrammar(removeGraphicItems = false) {
54910
54940
  var _a, _b;
@@ -55491,6 +55521,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
55491
55521
  }
55492
55522
  release() {
55493
55523
  this._option = null;
55524
+ this.getCompiler = null;
55494
55525
  }
55495
55526
  }
55496
55527
 
@@ -56486,7 +56517,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
56486
56517
  const clip = (_a = this._spec.clip) !== null && _a !== void 0 ? _a : this._getClipDefaultValue();
56487
56518
  this._groupMark = this._createGroupMark('regionGroup', this.userId, this.layoutZIndex);
56488
56519
  this._interactionMark = this._createGroupMark('regionInteractionGroup', this.userId + '_interaction', exports.LayoutZIndex.Interaction);
56489
- if (this._spec.style) {
56520
+ if (!isEmpty(this._spec.style)) {
56490
56521
  this._backgroundMark = this._createMark({ type: "rect", name: 'regionBackground' });
56491
56522
  if (clip) {
56492
56523
  this._foregroundMark = this._createMark({ type: "rect", name: 'regionForeground' });
@@ -58719,17 +58750,19 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
58719
58750
  getAll() {
58720
58751
  return this._plugins.slice();
58721
58752
  }
58722
- dispose(pluginsId) {
58753
+ release(pluginsId) {
58723
58754
  const plugin = this._plugins.find(p => p.id === pluginsId);
58724
58755
  if (!plugin) {
58725
58756
  return;
58726
58757
  }
58727
- plugin.dispose && plugin.dispose(this);
58758
+ plugin.release(this);
58759
+ this._plugins = this._plugins.filter(entry => entry !== plugin);
58728
58760
  }
58729
- disposeAll() {
58761
+ releaseAll() {
58730
58762
  this._plugins.forEach(plugin => {
58731
- plugin.dispose && plugin.dispose(this);
58763
+ plugin.release(this);
58732
58764
  });
58765
+ this._plugins = [];
58733
58766
  }
58734
58767
  }
58735
58768
 
@@ -58758,6 +58791,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
58758
58791
  plugin.onBeforeInitChart && plugin.onBeforeInitChart(this, chartSpec, actionSource);
58759
58792
  });
58760
58793
  }
58794
+ releaseAll() {
58795
+ super.releaseAll();
58796
+ this.globalInstance = null;
58797
+ }
58761
58798
  }
58762
58799
 
58763
58800
  class VChart {
@@ -58928,11 +58965,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
58928
58965
  }
58929
58966
  this._spec = spec;
58930
58967
  if (!this._chartSpecTransformer) {
58931
- this._chartSpecTransformer = Factory.createChartSpecTransformer(this._spec.type, {
58932
- type: this._spec.type,
58933
- getTheme: () => { var _a; return (_a = this._currentTheme) !== null && _a !== void 0 ? _a : {}; },
58934
- animation: this._option.animation
58935
- });
58968
+ this._chartSpecTransformer = Factory.createChartSpecTransformer(this._spec.type, this._getChartOption(this._spec.type));
58936
58969
  }
58937
58970
  this._chartSpecTransformer.transformSpec(this._spec);
58938
58971
  this._chartPluginApply('onAfterChartSpecTransform', this._spec, actionSource);
@@ -58942,10 +58975,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
58942
58975
  _updateSpecInfo() {
58943
58976
  var _a;
58944
58977
  if (!this._chartSpecTransformer) {
58945
- this._chartSpecTransformer = Factory.createChartSpecTransformer(this._spec.type, {
58946
- type: this._spec.type,
58947
- getTheme: () => { var _a; return (_a = this._currentTheme) !== null && _a !== void 0 ? _a : {}; }
58948
- });
58978
+ this._chartSpecTransformer = Factory.createChartSpecTransformer(this._spec.type, this._getChartOption(this._spec.type));
58949
58979
  }
58950
58980
  this._specInfo = (_a = this._chartSpecTransformer) === null || _a === void 0 ? void 0 : _a.createSpecInfo(this._spec);
58951
58981
  }
@@ -58959,26 +58989,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
58959
58989
  (_b = this._option) === null || _b === void 0 ? void 0 : _b.onError('chart is already initialized');
58960
58990
  return;
58961
58991
  }
58962
- const chart = Factory.createChart(spec.type, spec, {
58963
- type: spec.type,
58964
- globalInstance: this,
58965
- eventDispatcher: this._eventDispatcher,
58966
- dataSet: this._dataSet,
58967
- container: this._container,
58968
- canvas: this._canvas,
58969
- map: new Map(),
58970
- mode: this._option.mode || exports.RenderModeEnum['desktop-browser'],
58971
- modeParams: this._option.modeParams,
58972
- getCompiler: () => this._compiler,
58973
- performanceHook: this._option.performanceHook,
58974
- viewBox: this._viewBox,
58975
- animation: this._option.animation,
58976
- getTheme: () => { var _a; return (_a = this._currentTheme) !== null && _a !== void 0 ? _a : {}; },
58977
- getSpecInfo: () => { var _a; return (_a = this._specInfo) !== null && _a !== void 0 ? _a : {}; },
58978
- layout: this._option.layout,
58979
- onError: this._onError,
58980
- disableTriggerEvent: this._option.disableTriggerEvent === true
58981
- });
58992
+ const chart = Factory.createChart(spec.type, spec, this._getChartOption(spec.type));
58982
58993
  if (!chart) {
58983
58994
  (_c = this._option) === null || _c === void 0 ? void 0 : _c.onError('init chart fail');
58984
58995
  return;
@@ -59033,7 +59044,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
59033
59044
  return calculateChartSize(this._spec, {
59034
59045
  container: this._container,
59035
59046
  canvas: this._canvas,
59036
- mode: this._option.mode || exports.RenderModeEnum['desktop-browser'],
59047
+ mode: this._getMode(),
59037
59048
  modeParams: this._option.modeParams
59038
59049
  }, {
59039
59050
  width: (_b = (_a = this._currentSize) === null || _a === void 0 ? void 0 : _a.width) !== null && _b !== void 0 ? _b : DEFAULT_CHART_WIDTH,
@@ -59192,16 +59203,23 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
59192
59203
  if ((_a = this._onResize) === null || _a === void 0 ? void 0 : _a.cancel) {
59193
59204
  this._onResize.cancel();
59194
59205
  }
59195
- this._chartPluginApply('disposeAll');
59206
+ this._chartPluginApply('releaseAll');
59207
+ this._chartPlugin = null;
59196
59208
  this._chartSpecTransformer = null;
59197
59209
  (_b = this._chart) === null || _b === void 0 ? void 0 : _b.release();
59198
59210
  (_c = this._compiler) === null || _c === void 0 ? void 0 : _c.release();
59199
59211
  (_d = this._eventDispatcher) === null || _d === void 0 ? void 0 : _d.release();
59200
59212
  this._unBindResizeEvent();
59201
59213
  this._releaseData();
59214
+ this._onError = null;
59215
+ this._onResize = null;
59216
+ this._container = null;
59217
+ this._currentTheme = null;
59218
+ this._option = null;
59202
59219
  this._chart = null;
59203
59220
  this._compiler = null;
59204
59221
  this._spec = null;
59222
+ this._specInfo = null;
59205
59223
  this._originalSpec = null;
59206
59224
  this._userEvents = null;
59207
59225
  this._event = null;
@@ -59883,6 +59901,31 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
59883
59901
  }
59884
59902
  this._chartPlugin[funcName].apply(this._chartPlugin, args);
59885
59903
  }
59904
+ _getMode() {
59905
+ return this._option.mode || exports.RenderModeEnum['desktop-browser'];
59906
+ }
59907
+ _getChartOption(type) {
59908
+ return {
59909
+ type,
59910
+ globalInstance: this,
59911
+ eventDispatcher: this._eventDispatcher,
59912
+ dataSet: this._dataSet,
59913
+ container: this._container,
59914
+ canvas: this._canvas,
59915
+ map: new Map(),
59916
+ mode: this._getMode(),
59917
+ modeParams: this._option.modeParams,
59918
+ getCompiler: () => this._compiler,
59919
+ performanceHook: this._option.performanceHook,
59920
+ viewBox: this._viewBox,
59921
+ animation: this._option.animation,
59922
+ getTheme: () => { var _a; return (_a = this._currentTheme) !== null && _a !== void 0 ? _a : {}; },
59923
+ getSpecInfo: () => { var _a; return (_a = this._specInfo) !== null && _a !== void 0 ? _a : {}; },
59924
+ layout: this._option.layout,
59925
+ onError: this._onError,
59926
+ disableTriggerEvent: this._option.disableTriggerEvent === true
59927
+ };
59928
+ }
59886
59929
  }
59887
59930
  VChart.InstanceManager = InstanceManager;
59888
59931
  VChart.ThemeManager = ThemeManager;
@@ -59897,6 +59940,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
59897
59940
  registerGroupMark();
59898
59941
  View.useRegisters([registerFilterTransform, registerMapTransform]);
59899
59942
  registerVGrammarCommonAnimation();
59943
+ registerElementHighlight();
59944
+ registerElementSelect();
59900
59945
  registerTheme(darkTheme.name, darkTheme);
59901
59946
  Logger.getInstance(LoggerLevel.Error);
59902
59947
  };
@@ -60082,6 +60127,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
60082
60127
  onAdd(service) {
60083
60128
  this.service = service;
60084
60129
  }
60130
+ release() {
60131
+ this.service = null;
60132
+ }
60085
60133
  }
60086
60134
 
60087
60135
  const registerChartPlugin = (plugin) => {
@@ -60157,7 +60205,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
60157
60205
  break;
60158
60206
  }
60159
60207
  if (resetMediaQuery) {
60160
- this.dispose();
60208
+ this.release();
60161
60209
  }
60162
60210
  if (!this._initialized) {
60163
60211
  this.onInit(service, chartSpec);
@@ -60259,7 +60307,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
60259
60307
  this._option.updateSpec(chartSpec, compile, render);
60260
60308
  }
60261
60309
  }
60262
- dispose() {
60310
+ release() {
60311
+ super.release();
60263
60312
  this._initialized = false;
60264
60313
  this._spec = [];
60265
60314
  this._option = undefined;
@@ -60716,7 +60765,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
60716
60765
  };
60717
60766
  };
60718
60767
 
60719
- const TOOLTIP_EL_CLASS_NAME = 'vchart-tooltip-element';
60720
60768
  const TOOLTIP_CONTAINER_EL_CLASS_NAME = 'vchart-tooltip-container';
60721
60769
  const TOOLTIP_MAX_LINE_COUNT = 20;
60722
60770
  const TOOLTIP_EMPTY_STRING = '';
@@ -60729,10 +60777,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
60729
60777
  offsetY: 10,
60730
60778
  sanitize: escapeHTML
60731
60779
  };
60732
- class TooltipHandlerType {
60733
- }
60734
- TooltipHandlerType.dom = `${PREFIX}_TOOLTIP_HANDLER_DOM`;
60735
- TooltipHandlerType.canvas = `${PREFIX}_TOOLTIP_HANDLER_CANVAS`;
60736
60780
 
60737
60781
  const DEFAULT_TITLE_STYLE = {
60738
60782
  left: {
@@ -61133,6 +61177,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
61133
61177
  let positionAttribute;
61134
61178
  if (type === 'line') {
61135
61179
  positionAttribute = {
61180
+ visible: true,
61136
61181
  start: { x: x + bandWidth / 2, y: topPos },
61137
61182
  end: { x: x + bandWidth / 2, y: topPos + height }
61138
61183
  };
@@ -61141,6 +61186,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
61141
61186
  const extend = getRectSize(xHair, bandWidth, crosshairInfo.axis);
61142
61187
  const { leftPos, rightPos } = crosshairInfo;
61143
61188
  positionAttribute = {
61189
+ visible: true,
61144
61190
  start: { x: Math.max(x - extend / 2 - offsetWidth / 2, leftPos), y: topPos },
61145
61191
  end: { x: Math.min(x + bandWidth + extend / 2 + offsetWidth / 2, rightPos), y: topPos + height }
61146
61192
  };
@@ -61153,6 +61199,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
61153
61199
  let positionAttribute;
61154
61200
  if (type === 'line') {
61155
61201
  positionAttribute = {
61202
+ visible: true,
61156
61203
  start: { x: leftPos, y: y + bandHeight / 2 },
61157
61204
  end: { x: leftPos + width, y: y + bandHeight / 2 }
61158
61205
  };
@@ -61161,6 +61208,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
61161
61208
  const extend = getRectSize(yHair, bandHeight, crosshairInfo.axis);
61162
61209
  const { topPos, bottomPos } = crosshairInfo;
61163
61210
  positionAttribute = {
61211
+ visible: true,
61164
61212
  start: { x: leftPos, y: Math.max(y - extend / 2 - offsetHeight / 2, topPos) },
61165
61213
  end: { x: leftPos + width, y: Math.min(y + bandHeight + extend / 2 + offsetHeight / 2, bottomPos) }
61166
61214
  };
@@ -63796,6 +63844,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
63796
63844
  Factory.registerComponentPlugin(plugin.type, plugin);
63797
63845
  };
63798
63846
 
63847
+ class TooltipHandlerType {
63848
+ }
63849
+ TooltipHandlerType.dom = `${PREFIX}_TOOLTIP_HANDLER_DOM`;
63850
+ TooltipHandlerType.canvas = `${PREFIX}_TOOLTIP_HANDLER_CANVAS`;
63851
+ const TOOLTIP_EL_CLASS_NAME = 'vchart-tooltip-element';
63852
+
63799
63853
  class DomTooltipHandler extends BaseTooltipHandler {
63800
63854
  getVisibility() {
63801
63855
  var _a;
@@ -64008,7 +64062,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
64008
64062
  registerComponentPlugin(CanvasTooltipHandler);
64009
64063
  };
64010
64064
 
64011
- const version = "1.10.0-alpha.8";
64065
+ const version = "1.10.0";
64012
64066
 
64013
64067
  const addVChartProperty = (data, op) => {
64014
64068
  const context = op.beforeCall();
@@ -64430,17 +64484,35 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
64430
64484
  const type = this._option.type;
64431
64485
  const theme = transformSeriesThemeToMerge(get$1(chartTheme, `series.${type}`), type, mark, markByName);
64432
64486
  const themeWithDirection = get$1(chartTheme, `series.${type}_${direction}`);
64433
- const stack = (_c = (_b = spec.stack) !== null && _b !== void 0 ? _b : themeWithDirection === null || themeWithDirection === void 0 ? void 0 : themeWithDirection.stack) !== null && _c !== void 0 ? _c : theme === null || theme === void 0 ? void 0 : theme.stack;
64487
+ const stack = (_c = (_b = this.stack) !== null && _b !== void 0 ? _b : themeWithDirection === null || themeWithDirection === void 0 ? void 0 : themeWithDirection.stack) !== null && _c !== void 0 ? _c : theme === null || theme === void 0 ? void 0 : theme.stack;
64434
64488
  const themeWithStack = stack ? get$1(chartTheme, `series.${type}_stack`) : undefined;
64435
64489
  return mergeSpec({}, theme, themeWithDirection, themeWithStack);
64436
64490
  }
64437
64491
  transformSpec(spec, chartSpec, chartSpecInfo) {
64492
+ this._transformStack(spec);
64438
64493
  const result = super.transformSpec(spec, chartSpec, chartSpecInfo);
64439
64494
  this._transformLabelSpec(result.spec);
64440
- return Object.assign(Object.assign({}, result), { markLabelSpec: this.markLabelSpec });
64495
+ return Object.assign(Object.assign({}, result), { markLabelSpec: this.markLabelSpec, stack: this.stack });
64441
64496
  }
64442
64497
  _transformLabelSpec(spec) {
64443
64498
  }
64499
+ _transformStack(spec) {
64500
+ if (isBoolean$1(spec.stack)) {
64501
+ this.stack = spec.stack;
64502
+ }
64503
+ if (isBoolean$1(spec.percent)) {
64504
+ this.stack = spec.percent || this.stack;
64505
+ }
64506
+ if (isBoolean$1(spec.stackOffsetSilhouette)) {
64507
+ this.stack = spec.stackOffsetSilhouette || this.stack;
64508
+ }
64509
+ if (isValid$3(spec.stackValue)) {
64510
+ this.stack = true;
64511
+ }
64512
+ if (isNil$3(this.stack) && this._supportStack && spec.seriesField) {
64513
+ this.stack = true;
64514
+ }
64515
+ }
64444
64516
  _addMarkLabelSpec(spec, markName, labelSpecKey = 'label', styleHandlerName = 'initLabelMarkStyle', hasAnimation, head) {
64445
64517
  if (!spec) {
64446
64518
  return;
@@ -64573,17 +64645,18 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
64573
64645
  return this._groups;
64574
64646
  }
64575
64647
  getStack() {
64576
- return this._stack;
64648
+ var _a;
64649
+ return (_a = this.getSpecInfo()) === null || _a === void 0 ? void 0 : _a.stack;
64577
64650
  }
64578
64651
  getStackValue() {
64579
64652
  var _a;
64580
64653
  return (_a = this._spec.stackValue) !== null && _a !== void 0 ? _a : `${PREFIX}_series_${this.type}`;
64581
64654
  }
64582
64655
  getPercent() {
64583
- return this._percent;
64656
+ return this._spec.percent;
64584
64657
  }
64585
64658
  getStackOffsetSilhouette() {
64586
- return this._stackOffsetSilhouette;
64659
+ return this._spec.stackOffsetSilhouette;
64587
64660
  }
64588
64661
  get tooltipHelper() {
64589
64662
  if (!this._tooltipHelper) {
@@ -64630,8 +64703,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
64630
64703
  this._viewDataMap = new Map();
64631
64704
  this._viewDataFilter = null;
64632
64705
  this._data = null;
64633
- this._percent = false;
64634
- this._stackOffsetSilhouette = false;
64635
64706
  this.layoutZIndex = 0;
64636
64707
  this._invalidType = 'break';
64637
64708
  this._getInvalidDefined = (datum) => couldBeValidNumber(datum[this.getStackValueField()]);
@@ -64682,23 +64753,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
64682
64753
  setAttrFromSpec() {
64683
64754
  super.setAttrFromSpec();
64684
64755
  this.setSeriesField(this._spec.seriesField);
64685
- if (isBoolean$1(this._spec.stack)) {
64686
- this._stack = this._spec.stack;
64687
- }
64688
- if (isBoolean$1(this._spec.percent)) {
64689
- this._percent = this._spec.percent;
64690
- this._stack = this._spec.percent || this._stack;
64691
- }
64692
- if (isBoolean$1(this._spec.stackOffsetSilhouette)) {
64693
- this._stackOffsetSilhouette = this._spec.stackOffsetSilhouette;
64694
- this._stack = this._spec.stackOffsetSilhouette || this._stack;
64695
- }
64696
- if (isValid$3(this._spec.stackValue)) {
64697
- this._stack = true;
64698
- }
64699
- if (isNil$3(this._stack) && this._supportStack && this._seriesField) {
64700
- this._stack = true;
64701
- }
64702
64756
  if (isValid$3(this._spec.invalidType)) {
64703
64757
  this._invalidType = this._spec.invalidType;
64704
64758
  }
@@ -64714,16 +64768,16 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
64714
64768
  (_d = (_c = this._rawData) === null || _c === void 0 ? void 0 : _c.target) === null || _d === void 0 ? void 0 : _d.addListener('change', this.rawDataUpdate.bind(this));
64715
64769
  this._addDataIndexAndKey();
64716
64770
  if (this._rawData) {
64717
- if (this._stack) {
64771
+ if (this.getStack()) {
64718
64772
  this._viewDataFilter = dataViewFromDataView(this._rawData, this._dataSet, {
64719
64773
  name: `${this.type}_${this.id}_viewDataFilter`
64720
64774
  });
64721
64775
  }
64722
- const viewData = dataViewFromDataView(this._stack ? this._viewDataFilter : this._rawData, this._dataSet, {
64776
+ const viewData = dataViewFromDataView(this.getStack() ? this._viewDataFilter : this._rawData, this._dataSet, {
64723
64777
  name: `${this.type}_${this.id}_viewData`
64724
64778
  });
64725
64779
  this._data = new SeriesData(this._option, viewData);
64726
- if (this._stack) {
64780
+ if (this.getStack()) {
64727
64781
  this._viewDataFilter.target.removeListener('change', viewData.reRunAllTransform);
64728
64782
  }
64729
64783
  }
@@ -64816,7 +64870,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
64816
64870
  }
64817
64871
  }, false);
64818
64872
  this._data.getDataView().target.removeListener('change', this._viewDataStatistics.reRunAllTransform);
64819
- if (this._stack) {
64873
+ if (this.getStack()) {
64820
64874
  this.createdStackData();
64821
64875
  }
64822
64876
  }
@@ -65818,13 +65872,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
65818
65872
  }
65819
65873
  this.setFieldX2((_a = this._spec) === null || _a === void 0 ? void 0 : _a.x2Field);
65820
65874
  this.setFieldY2((_b = this._spec) === null || _b === void 0 ? void 0 : _b.y2Field);
65821
- if (this._stack) {
65875
+ if (this.getStack()) {
65822
65876
  this.setValueFieldToStack();
65823
65877
  }
65824
- if (this._percent) {
65878
+ if (this.getPercent()) {
65825
65879
  this.setValueFieldToPercent();
65826
65880
  }
65827
- if (this._stackOffsetSilhouette) {
65881
+ if (this.getStackOffsetSilhouette()) {
65828
65882
  this.setValueFieldToStackOffsetSilhouette();
65829
65883
  }
65830
65884
  if (isValid$3(this._spec.sortDataByAxis)) {
@@ -67075,12 +67129,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
67075
67129
  this._spec = spec;
67076
67130
  }
67077
67131
  created() {
67078
- this._transformer = new this.transformerConstructor({
67079
- type: this.type,
67080
- seriesType: this.seriesType,
67081
- getTheme: this._option.getTheme,
67082
- animation: this._option.animation
67083
- });
67132
+ this._transformer = new this.transformerConstructor(Object.assign(Object.assign({}, this._option), { type: this.type, seriesType: this.seriesType }));
67084
67133
  this._chartData.parseData(this._spec.data);
67085
67134
  this._createGlobalScale();
67086
67135
  this._spec.background && typeof this._spec.background === 'object' && this._createBackground();
@@ -67871,10 +67920,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
67871
67920
  transformModelSpec(chartSpec) {
67872
67921
  const transform = (constructor, specInfo, chartSpecInfo) => {
67873
67922
  const { spec, specPath, specInfoPath, type } = specInfo;
67874
- const transformer = new constructor.transformerConstructor({
67875
- type,
67876
- getTheme: this._option.getTheme
67877
- });
67923
+ const transformer = new constructor.transformerConstructor(Object.assign(Object.assign({}, this._option), { type }));
67878
67924
  const transformResult = transformer.transformSpec(spec, chartSpec, chartSpecInfo);
67879
67925
  setProperty(chartSpec, specPath, transformResult.spec);
67880
67926
  setProperty(chartSpecInfo, specInfoPath !== null && specInfoPath !== void 0 ? specInfoPath : specPath, Object.assign(Object.assign({}, specInfo), transformResult));
@@ -67886,10 +67932,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
67886
67932
  if (!transform) {
67887
67933
  transform = (constructor, specInfo, chartSpecInfo) => {
67888
67934
  const { spec, specPath, specInfoPath, type } = specInfo;
67889
- const transformer = new constructor.transformerConstructor({
67890
- type,
67891
- getTheme: this._option.getTheme
67892
- });
67935
+ const transformer = new constructor.transformerConstructor(Object.assign(Object.assign({}, this._option), { type }));
67893
67936
  setProperty(chartSpecInfo, specInfoPath !== null && specInfoPath !== void 0 ? specInfoPath : specPath, Object.assign(Object.assign({}, specInfo), { theme: transformer.getTheme(spec, chartSpec) }));
67894
67937
  };
67895
67938
  }
@@ -68264,6 +68307,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
68264
68307
  };
68265
68308
 
68266
68309
  class AreaSeriesSpecTransformer extends LineLikeSeriesSpecTransformer {
68310
+ constructor() {
68311
+ super(...arguments);
68312
+ this._supportStack = true;
68313
+ }
68267
68314
  _transformLabelSpec(spec) {
68268
68315
  var _a, _b, _c;
68269
68316
  super._transformLabelSpec(spec);
@@ -68276,7 +68323,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
68276
68323
  _transformSpecAfterMergingTheme(spec, chartSpec, chartSpecInfo) {
68277
68324
  var _a, _b, _c, _d, _e;
68278
68325
  super._transformSpecAfterMergingTheme(spec, chartSpec, chartSpecInfo);
68279
- const { area = {}, line = {}, seriesMark = 'area' } = spec;
68326
+ const { area = {}, line = {}, seriesMark } = spec;
68280
68327
  const isAreaVisible = area.visible !== false && ((_a = area.style) === null || _a === void 0 ? void 0 : _a.visible) !== false;
68281
68328
  const isLineVisible = line.visible !== false && ((_b = line.style) === null || _b === void 0 ? void 0 : _b.visible) !== false;
68282
68329
  area.support3d = !!(area.support3d || line.support3d);
@@ -68327,7 +68374,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
68327
68374
  super(...arguments);
68328
68375
  this.type = exports.SeriesTypeEnum.area;
68329
68376
  this.transformerConstructor = AreaSeriesSpecTransformer;
68330
- this._supportStack = true;
68331
68377
  this._sortDataByAxis = false;
68332
68378
  }
68333
68379
  initMark() {
@@ -68480,8 +68526,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
68480
68526
 
68481
68527
  class AreaChartSpecTransformer extends CartesianChartSpecTransformer {
68482
68528
  _getDefaultSeriesSpec(spec) {
68483
- var _a;
68484
- return Object.assign(Object.assign({}, super._getDefaultSeriesSpec(spec)), { point: spec.point, line: spec.line, area: spec.area, seriesMark: (_a = spec.seriesMark) !== null && _a !== void 0 ? _a : 'area', activePoint: spec.activePoint, sampling: spec.sampling, samplingFactor: spec.samplingFactor, pointDis: spec.pointDis, pointDisMul: spec.pointDisMul, markOverlap: spec.markOverlap, areaLabel: spec.areaLabel });
68529
+ return Object.assign(Object.assign({}, super._getDefaultSeriesSpec(spec)), { point: spec.point, line: spec.line, area: spec.area, seriesMark: spec.seriesMark, activePoint: spec.activePoint, sampling: spec.sampling, samplingFactor: spec.samplingFactor, pointDis: spec.pointDis, pointDisMul: spec.pointDisMul, markOverlap: spec.markOverlap, areaLabel: spec.areaLabel });
68485
68530
  }
68486
68531
  transformSpec(spec) {
68487
68532
  super.transformSpec(spec);
@@ -68635,6 +68680,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
68635
68680
  }
68636
68681
 
68637
68682
  class BarSeriesSpecTransformer extends BaseSeriesSpecTransformer {
68683
+ constructor() {
68684
+ super(...arguments);
68685
+ this._supportStack = true;
68686
+ }
68638
68687
  _transformLabelSpec(spec) {
68639
68688
  this._addMarkLabelSpec(spec, "bar");
68640
68689
  }
@@ -68648,7 +68697,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
68648
68697
  this._barMarkName = "bar";
68649
68698
  this._barMarkType = "rect";
68650
68699
  this.transformerConstructor = BarSeriesSpecTransformer;
68651
- this._supportStack = true;
68652
68700
  this._bandPosition = 0;
68653
68701
  this._getBarXStart = (datum, scale) => {
68654
68702
  if (this._shouldDoPreCalculate()) {
@@ -68867,7 +68915,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
68867
68915
  }
68868
68916
  _shouldDoPreCalculate() {
68869
68917
  const region = this.getRegion();
68870
- return this._stack && region.getSeries().filter(s => s.type === this.type && s.getSpec().barMinHeight).length;
68918
+ return this.getStack() && region.getSeries().filter(s => s.type === this.type && s.getSpec().barMinHeight).length;
68871
68919
  }
68872
68920
  _calculateStackRectPosition(isVertical) {
68873
68921
  const region = this.getRegion();
@@ -70124,6 +70172,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
70124
70172
  super();
70125
70173
  this.component = component;
70126
70174
  }
70175
+ releaseAll() {
70176
+ super.releaseAll();
70177
+ this.component = null;
70178
+ }
70127
70179
  }
70128
70180
 
70129
70181
  function getComponentThemeFromGlobalTheme(type, chartTheme, componentSpec, chartSpec) {
@@ -70283,7 +70335,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
70283
70335
  });
70284
70336
  }
70285
70337
  this._container = null;
70286
- (_a = this.pluginService) === null || _a === void 0 ? void 0 : _a.disposeAll();
70338
+ (_a = this.pluginService) === null || _a === void 0 ? void 0 : _a.releaseAll();
70287
70339
  this.pluginService = null;
70288
70340
  }
70289
70341
  compile() {
@@ -70440,7 +70492,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
70440
70492
  }, this._getRegionOrSeriesLayout(regionOrSeries), false)) {
70441
70493
  return;
70442
70494
  }
70443
- this._clickEnable = false;
70444
70495
  if (callback) {
70445
70496
  callback({ zoomDelta, zoomX, zoomY }, event);
70446
70497
  }
@@ -70524,7 +70575,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
70524
70575
  }, this._getRegionOrSeriesLayout(regionOrSeries), false)) {
70525
70576
  return stopBubble;
70526
70577
  }
70527
- this._clickEnable = false;
70528
70578
  if (callback) {
70529
70579
  stopBubble = callback({ scrollX, scrollY }, event);
70530
70580
  }
@@ -70634,7 +70684,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
70634
70684
  if (this._option.disableTriggerEvent) {
70635
70685
  return;
70636
70686
  }
70637
- this._clickEnable = true;
70687
+ this._clickEnable = false;
70638
70688
  if (!this._zoomableTrigger.parserDragEvent(params.event)) {
70639
70689
  return;
70640
70690
  }
@@ -70649,7 +70699,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
70649
70699
  let upX = event.canvasX;
70650
70700
  let upY = event.canvasY;
70651
70701
  const mouseup = delayMap[delayType]((params) => {
70652
- this._clickEnable = false;
70702
+ this._clickEnable = true;
70653
70703
  const event = params.event;
70654
70704
  const dx = event.canvasX - upX;
70655
70705
  const dy = event.canvasY - upY;
@@ -71603,6 +71653,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
71603
71653
  }
71604
71654
 
71605
71655
  class WaterfallSeriesSpecTransformer extends BarSeriesSpecTransformer {
71656
+ constructor() {
71657
+ super(...arguments);
71658
+ this._supportStack = false;
71659
+ }
71606
71660
  _transformLabelSpec(spec) {
71607
71661
  this._addMarkLabelSpec(spec, "bar");
71608
71662
  this._addMarkLabelSpec(spec, "bar", 'stackLabel');
@@ -71614,7 +71668,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
71614
71668
  super(...arguments);
71615
71669
  this.type = exports.SeriesTypeEnum.waterfall;
71616
71670
  this.transformerConstructor = WaterfallSeriesSpecTransformer;
71617
- this._stack = false;
71618
71671
  this._leaderLineMark = null;
71619
71672
  this._stackLabelMark = null;
71620
71673
  this._labelMark = null;
@@ -72563,6 +72616,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
72563
72616
  };
72564
72617
 
72565
72618
  class RangeColumnSeriesSpecTransformer extends BarSeriesSpecTransformer {
72619
+ constructor() {
72620
+ super(...arguments);
72621
+ this._supportStack = false;
72622
+ }
72566
72623
  _transformLabelSpec(spec) {
72567
72624
  var _a;
72568
72625
  const labelPosition = (_a = spec.label) === null || _a === void 0 ? void 0 : _a.position;
@@ -72579,7 +72636,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
72579
72636
  this._barMarkType = "rect";
72580
72637
  this._barName = exports.SeriesTypeEnum.bar;
72581
72638
  this.transformerConstructor = RangeColumnSeriesSpecTransformer;
72582
- this._stack = false;
72583
72639
  }
72584
72640
  initMark() {
72585
72641
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
@@ -73866,10 +73922,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
73866
73922
  this._specAngleField = this._angleField.slice();
73867
73923
  this._specRadiusField = this._radiusField.slice();
73868
73924
  this.setInnerRadiusField(this._spec.valueField || this._spec.radiusField);
73869
- if (this._stack) {
73925
+ if (this.getStack()) {
73870
73926
  this.setValueFieldToStack();
73871
73927
  }
73872
- if (this._percent) {
73928
+ if (this.getPercent()) {
73873
73929
  this.setValueFieldToPercent();
73874
73930
  }
73875
73931
  }
@@ -73893,6 +73949,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
73893
73949
  }
73894
73950
 
73895
73951
  class RoseSeriesSpecTransformer extends BaseSeriesSpecTransformer {
73952
+ constructor() {
73953
+ super(...arguments);
73954
+ this._supportStack = true;
73955
+ }
73896
73956
  _transformLabelSpec(spec) {
73897
73957
  this._addMarkLabelSpec(spec, "rose");
73898
73958
  }
@@ -73904,7 +73964,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
73904
73964
  super(...arguments);
73905
73965
  this.type = exports.SeriesTypeEnum.rose;
73906
73966
  this.transformerConstructor = RoseSeriesSpecTransformer;
73907
- this._supportStack = true;
73908
73967
  this._roseMark = null;
73909
73968
  this._labelMark = null;
73910
73969
  }
@@ -73962,7 +74021,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
73962
74021
  outerRadius: (datum) => valueInScaleRange(this.radiusAxisHelper.dataToPosition([datum[this._radiusField[0]]]), this.radiusAxisHelper.getScale(0)),
73963
74022
  innerRadius: (datum) => {
73964
74023
  var _a;
73965
- if (!this._stack) {
74024
+ if (!this.getStack()) {
73966
74025
  return 0;
73967
74026
  }
73968
74027
  const stackStart = valueInScaleRange(this.radiusAxisHelper.dataToPosition([datum[this._innerRadiusField[0]]]), this.radiusAxisHelper.getScale(0));
@@ -74265,13 +74324,17 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
74265
74324
  if (!datum || !this.angleAxisHelper || !this.radiusAxisHelper) {
74266
74325
  return Number.NaN;
74267
74326
  }
74268
- return this.valueToPosition(this.getDatumPositionValues(datum, this._angleField), this._stack ? this.getDatumPositionValues(datum, this._innerRadiusField) : this.radiusScale.domain()[0]).x;
74327
+ return this.valueToPosition(this.getDatumPositionValues(datum, this._angleField), this.getStack()
74328
+ ? this.getDatumPositionValues(datum, this._innerRadiusField)
74329
+ : this.radiusScale.domain()[0]).x;
74269
74330
  },
74270
74331
  y1: (datum) => {
74271
74332
  if (!datum || !this.angleAxisHelper || !this.radiusAxisHelper) {
74272
74333
  return Number.NaN;
74273
74334
  }
74274
- const value = this.valueToPosition(this.getDatumPositionValues(datum, this._angleField), this._stack ? this.getDatumPositionValues(datum, this._innerRadiusField) : this.radiusScale.domain()[0]).y;
74335
+ const value = this.valueToPosition(this.getDatumPositionValues(datum, this._angleField), this.getStack()
74336
+ ? this.getDatumPositionValues(datum, this._innerRadiusField)
74337
+ : this.radiusScale.domain()[0]).y;
74275
74338
  return value;
74276
74339
  },
74277
74340
  fill: this.getColorAttribute(),
@@ -75145,13 +75208,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
75145
75208
  class ProgressLikeSeries extends PolarSeries {
75146
75209
  constructor() {
75147
75210
  super(...arguments);
75148
- this._supportStack = true;
75149
75211
  this._arcGroupMark = null;
75150
75212
  this._getAngleValueStart = (datum) => {
75151
75213
  const axis = this._getAngleAxis();
75152
75214
  const { tickMask } = this._spec;
75153
75215
  if ((tickMask === null || tickMask === void 0 ? void 0 : tickMask.forceAlign) && this._isTickMaskVisible(axis)) {
75154
- const field = this._stack ? STACK_FIELD_START : SEGMENT_FIELD_START;
75216
+ const field = this.getStack() ? STACK_FIELD_START : SEGMENT_FIELD_START;
75155
75217
  const originValue = datum[field];
75156
75218
  const subTickData = this._getAngleAxisSubTickData(axis);
75157
75219
  const step = subTickData[1].value - subTickData[0].value;
@@ -75181,7 +75243,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
75181
75243
  const axis = this._getAngleAxis();
75182
75244
  const { tickMask } = this._spec;
75183
75245
  if ((tickMask === null || tickMask === void 0 ? void 0 : tickMask.forceAlign) && this._isTickMaskVisible(axis)) {
75184
- const field = this._stack ? STACK_FIELD_END : this._angleField[0];
75246
+ const field = this.getStack() ? STACK_FIELD_END : this._angleField[0];
75185
75247
  const originValue = datum[field];
75186
75248
  const subTickData = this._getAngleAxisSubTickData(axis);
75187
75249
  const step = subTickData[1].value - subTickData[0].value;
@@ -75243,7 +75305,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
75243
75305
  return newStyle;
75244
75306
  }
75245
75307
  _getAngleValueStartWithoutMask(datum) {
75246
- if (this._stack) {
75308
+ if (this.getStack()) {
75247
75309
  const value = valueInScaleRange(this.angleAxisHelper.dataToPosition([datum[STACK_FIELD_START]]), this.angleAxisHelper.getScale(0));
75248
75310
  if (isValidNumber$1(value)) {
75249
75311
  return value;
@@ -75252,7 +75314,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
75252
75314
  return this._startAngle;
75253
75315
  }
75254
75316
  _getAngleValueEndWithoutMask(datum) {
75255
- if (this._stack) {
75317
+ if (this.getStack()) {
75256
75318
  const value = valueInScaleRange(this.angleAxisHelper.dataToPosition([datum[STACK_FIELD_END]]), this.angleAxisHelper.getScale(0));
75257
75319
  if (isValidNumber$1(value)) {
75258
75320
  return value;
@@ -75388,10 +75450,18 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
75388
75450
  }));
75389
75451
  };
75390
75452
 
75453
+ class CircularProgressSeriesSpecTransformer extends BaseSeriesSpecTransformer {
75454
+ constructor() {
75455
+ super(...arguments);
75456
+ this._supportStack = true;
75457
+ }
75458
+ }
75459
+
75391
75460
  class CircularProgressSeries extends ProgressLikeSeries {
75392
75461
  constructor() {
75393
75462
  super(...arguments);
75394
75463
  this.type = exports.SeriesTypeEnum.circularProgress;
75464
+ this.transformerConstructor = CircularProgressSeriesSpecTransformer;
75395
75465
  this._progressMark = null;
75396
75466
  this._trackMark = null;
75397
75467
  this._getRadiusValueStart = (datum) => {
@@ -75499,13 +75569,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
75499
75569
  x: () => this.angleAxisHelper.center().x,
75500
75570
  y: () => this.angleAxisHelper.center().y,
75501
75571
  startAngle: () => {
75502
- const fieldName = this._stack ? STACK_FIELD_START : this._angleField[0];
75572
+ const fieldName = this.getStack() ? STACK_FIELD_START : this._angleField[0];
75503
75573
  const scale = this.angleAxisHelper.getScale(0);
75504
75574
  const domain = scale.domain();
75505
75575
  return this._getAngleValueStart({ [fieldName]: domain[0] });
75506
75576
  },
75507
75577
  endAngle: () => {
75508
- const fieldName = this._stack ? STACK_FIELD_END : this._angleField[0];
75578
+ const fieldName = this.getStack() ? STACK_FIELD_END : this._angleField[0];
75509
75579
  const scale = this.angleAxisHelper.getScale(0);
75510
75580
  const domain = scale.domain();
75511
75581
  return this._getAngleValueEnd({ [fieldName]: domain[domain.length - 1] });
@@ -75530,6 +75600,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
75530
75600
  }
75531
75601
  CircularProgressSeries.type = exports.SeriesTypeEnum.circularProgress;
75532
75602
  CircularProgressSeries.mark = circularProgressSeriesMark;
75603
+ CircularProgressSeries.transformerConstructor = CircularProgressSeriesSpecTransformer;
75533
75604
  const registerCircularProgressSeries = () => {
75534
75605
  registerArcMark();
75535
75606
  registerProgressLikeAnimation();
@@ -78640,6 +78711,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
78640
78711
  _buildMarkAttributeContext() {
78641
78712
  super._buildMarkAttributeContext();
78642
78713
  this._markAttributeContext.valueToPosition = this.valueToPosition.bind(this);
78714
+ this._markAttributeContext.getPoints = this.getPoints.bind(this);
78715
+ this._markAttributeContext.isTransformLevel = this.isTransformLevel.bind(this);
78643
78716
  }
78644
78717
  valueToPosition(category) {
78645
78718
  var _a, _b, _c;
@@ -83011,14 +83084,21 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
83011
83084
  });
83012
83085
  };
83013
83086
 
83087
+ class GaugePointerSeriesSpecTransformer extends BaseSeriesSpecTransformer {
83088
+ constructor() {
83089
+ super(...arguments);
83090
+ this._supportStack = false;
83091
+ }
83092
+ }
83093
+
83014
83094
  class GaugePointerSeries extends ProgressLikeSeries {
83015
83095
  constructor() {
83016
83096
  super(...arguments);
83017
83097
  this.type = exports.SeriesTypeEnum.gaugePointer;
83098
+ this.transformerConstructor = GaugePointerSeriesSpecTransformer;
83018
83099
  this._pinMark = null;
83019
83100
  this._pointerMark = null;
83020
83101
  this._pinBackgroundMark = null;
83021
- this._stack = false;
83022
83102
  }
83023
83103
  setAttrFromSpec() {
83024
83104
  var _a;
@@ -83173,6 +83253,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
83173
83253
  }
83174
83254
  GaugePointerSeries.type = exports.SeriesTypeEnum.gaugePointer;
83175
83255
  GaugePointerSeries.mark = gaugePointerSeriesMark;
83256
+ GaugePointerSeries.transformerConstructor = GaugePointerSeriesSpecTransformer;
83176
83257
  const registerGaugePointerSeries = () => {
83177
83258
  registerPathMark();
83178
83259
  registerRectMark();
@@ -83181,6 +83262,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
83181
83262
  };
83182
83263
 
83183
83264
  class GaugeSeriesSpecTransformer extends BaseSeriesSpecTransformer {
83265
+ constructor() {
83266
+ super(...arguments);
83267
+ this._supportStack = false;
83268
+ }
83184
83269
  _transformLabelSpec(spec) {
83185
83270
  this._addMarkLabelSpec(spec, "segment");
83186
83271
  }
@@ -83193,7 +83278,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
83193
83278
  this.transformerConstructor = GaugeSeriesSpecTransformer;
83194
83279
  this._segmentMark = null;
83195
83280
  this._trackMark = null;
83196
- this._stack = false;
83197
83281
  this._padAngle = 0;
83198
83282
  }
83199
83283
  setAttrFromSpec() {
@@ -85563,6 +85647,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
85563
85647
  skipTheme: true
85564
85648
  });
85565
85649
  gridMark.setZIndex((_f = (_d = (_c = (_b = this._spec.grid) === null || _b === void 0 ? void 0 : _b.style) === null || _c === void 0 ? void 0 : _c.zIndex) !== null && _d !== void 0 ? _d : (_e = this._spec.grid) === null || _e === void 0 ? void 0 : _e.zIndex) !== null && _f !== void 0 ? _f : exports.LayoutZIndex.Axis_Grid);
85650
+ gridMark.setInteractive(false);
85566
85651
  this._marks.addMark(gridMark);
85567
85652
  this._gridMark = gridMark;
85568
85653
  }
@@ -85723,7 +85808,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
85723
85808
  return result;
85724
85809
  }
85725
85810
  _delegateAxisContainerEvent(component) {
85726
- component.addEventListener('*', ((event, type) => this._delegateEvent(component, event, type)));
85811
+ if (component.listenerCount('*') === 0) {
85812
+ component.addEventListener('*', ((event, type) => this._delegateEvent(component, event, type)));
85813
+ }
85727
85814
  }
85728
85815
  _getAxisAttributes() {
85729
85816
  const spec = this._spec;
@@ -88866,6 +88953,34 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
88866
88953
  newSpec.style = mergeSpec({}, this._theme, newSpec.style);
88867
88954
  return { spec: newSpec, theme };
88868
88955
  }
88956
+ _transformSpecAfterMergingTheme(spec, chartSpec, chartSpecInfo) {
88957
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
88958
+ super._transformSpecAfterMergingTheme(spec, chartSpec, chartSpecInfo);
88959
+ spec.visible = (_a = spec.visible) !== null && _a !== void 0 ? _a : true;
88960
+ spec.activeType = getTooltipActualActiveType(spec);
88961
+ spec.renderMode =
88962
+ (_b = spec.renderMode) !== null && _b !== void 0 ? _b : (isMiniAppLikeMode(this._option.mode) || !isTrueBrowser(this._option.mode) ? 'canvas' : 'html');
88963
+ spec.trigger = (_c = spec.trigger) !== null && _c !== void 0 ? _c : 'hover';
88964
+ spec.className = (_d = spec.className) !== null && _d !== void 0 ? _d : TOOLTIP_EL_CLASS_NAME;
88965
+ spec.enterable = (_e = spec.enterable) !== null && _e !== void 0 ? _e : false;
88966
+ spec.transitionDuration = (_f = spec.transitionDuration) !== null && _f !== void 0 ? _f : 150;
88967
+ spec.triggerOff = (_g = spec.triggerOff) !== null && _g !== void 0 ? _g : spec.trigger;
88968
+ spec.confine = (_h = spec.confine) !== null && _h !== void 0 ? _h : spec.renderMode === 'canvas';
88969
+ if (isValid$3(spec.mark)) {
88970
+ spec.mark.activeType = 'mark';
88971
+ }
88972
+ if (isValid$3(spec.dimension)) {
88973
+ spec.dimension.activeType = 'dimension';
88974
+ }
88975
+ if (isValid$3(spec.parentElement)) {
88976
+ if (isString$1(spec.parentElement)) {
88977
+ spec.parentElement = (_j = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _j === void 0 ? void 0 : _j.getElementById(spec.parentElement);
88978
+ }
88979
+ }
88980
+ else if (isTrueBrowser(this._option.mode)) {
88981
+ spec.parentElement = domDocument === null || domDocument === void 0 ? void 0 : domDocument.body;
88982
+ }
88983
+ }
88869
88984
  }
88870
88985
 
88871
88986
  class Tooltip extends BaseComponent {
@@ -88880,6 +88995,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
88880
88995
  this._alwaysShow = false;
88881
88996
  this._eventList = [];
88882
88997
  this._isTooltipShown = false;
88998
+ this._clickLock = false;
88883
88999
  this._mountEvent = (eType, query, callback) => {
88884
89000
  this.event.on(eType, query, callback);
88885
89001
  this._eventList.push({
@@ -88888,14 +89004,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
88888
89004
  });
88889
89005
  };
88890
89006
  this._getMouseOutHandler = (needPointerDetection) => (params) => {
88891
- var _a, _b;
89007
+ var _a, _b, _c;
88892
89008
  if (this._alwaysShow) {
88893
89009
  return;
88894
89010
  }
88895
89011
  if (!this._isTooltipShown && !((_b = (_a = this.tooltipHandler) === null || _a === void 0 ? void 0 : _a.isTooltipShown) === null || _b === void 0 ? void 0 : _b.call(_a))) {
88896
89012
  return;
88897
89013
  }
88898
- const browserEnv = isTrueBrowser(this._option.mode);
89014
+ const browserEnv = isTrueBrowser((_c = this._option) === null || _c === void 0 ? void 0 : _c.mode);
88899
89015
  const { clientX, clientY } = params.event;
88900
89016
  if (browserEnv && this._isPointerOnTooltip(params)) {
88901
89017
  return;
@@ -88915,7 +89031,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
88915
89031
  this._cacheParams = undefined;
88916
89032
  }
88917
89033
  };
88918
- this._handleMouseMove = (params) => {
89034
+ this._getMouseMoveHandler = (isClick) => (params) => {
88919
89035
  if (!this.tooltipHandler) {
88920
89036
  this._initHandler();
88921
89037
  }
@@ -88928,30 +89044,37 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
88928
89044
  if (this._isPointerOnTooltip(params)) {
88929
89045
  return;
88930
89046
  }
89047
+ if (!isClick && this._clickLock) {
89048
+ return;
89049
+ }
88931
89050
  const mouseEventData = this._getMouseEventData(params);
88932
89051
  const { tooltipInfo: { dimension: dimensionInfo }, ignore: { mark: ignoreMark, dimension: ignoreDimension } } = mouseEventData;
88933
89052
  let markTooltipSuccess = false;
88934
89053
  let dimensionTooltipSuccess = false;
88935
- markTooltipSuccess = this._showTooltipByMouseEvent('mark', mouseEventData, params);
89054
+ markTooltipSuccess = this._showTooltipByMouseEvent('mark', mouseEventData, params, isClick);
88936
89055
  if (!markTooltipSuccess) {
88937
- dimensionTooltipSuccess = this._showTooltipByMouseEvent('dimension', mouseEventData, params);
89056
+ dimensionTooltipSuccess = this._showTooltipByMouseEvent('dimension', mouseEventData, params, isClick);
88938
89057
  }
88939
89058
  if (!markTooltipSuccess && !dimensionTooltipSuccess && !isEmptyPos(params)) {
88940
89059
  if (ignoreMark && isMarkInfo(this._cacheInfo)) {
88941
- markTooltipSuccess = this._showTooltipByMouseEvent('mark', mouseEventData, params, true);
89060
+ markTooltipSuccess = this._showTooltipByMouseEvent('mark', mouseEventData, params, isClick, true);
88942
89061
  }
88943
89062
  else if (ignoreDimension && isDimensionInfo(this._cacheInfo)) {
88944
- dimensionTooltipSuccess = this._showTooltipByMouseEvent('dimension', mouseEventData, params, true);
89063
+ dimensionTooltipSuccess = this._showTooltipByMouseEvent('dimension', mouseEventData, params, isClick, true);
88945
89064
  }
88946
89065
  else if (isValid$3(dimensionInfo)) {
88947
- dimensionTooltipSuccess = this._showTooltipByMouseEvent('dimension', mouseEventData, params);
89066
+ dimensionTooltipSuccess = this._showTooltipByMouseEvent('dimension', mouseEventData, params, isClick);
88948
89067
  }
88949
89068
  }
88950
89069
  if (!markTooltipSuccess && (!dimensionTooltipSuccess || isNil$3(dimensionInfo))) {
88951
89070
  this._handleChartMouseOut(params);
89071
+ if (isClick && this._clickLock) {
89072
+ this._clickLock = false;
89073
+ }
88952
89074
  }
88953
89075
  };
88954
- this._showTooltipByMouseEvent = (activeType, mouseEventData, params, useCache) => {
89076
+ this._showTooltipByMouseEvent = (activeType, mouseEventData, params, isClick, useCache) => {
89077
+ var _a;
88955
89078
  const processor = this._processor[activeType];
88956
89079
  if (!processor.shouldHandleTooltip(params, {
88957
89080
  tooltipInfo: mouseEventData.tooltipInfo[activeType],
@@ -88974,9 +89097,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
88974
89097
  }
88975
89098
  if (success) {
88976
89099
  this._isTooltipShown = true;
89100
+ if (isClick && this._spec.lockAfterClick && !this._clickLock) {
89101
+ this._clickLock = true;
89102
+ }
88977
89103
  }
88978
- const vchart = this._option.globalInstance;
88979
- if (success && VChart.globalConfig.uniqueTooltip) {
89104
+ const vchart = (_a = this._option) === null || _a === void 0 ? void 0 : _a.globalInstance;
89105
+ if (success && VChart.globalConfig.uniqueTooltip && vchart) {
88980
89106
  VChart.hideTooltip(vchart.id);
88981
89107
  }
88982
89108
  return success;
@@ -89106,18 +89232,18 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
89106
89232
  if (this._option.disableTriggerEvent) {
89107
89233
  return;
89108
89234
  }
89109
- const trigger = (_a = this._spec.trigger) !== null && _a !== void 0 ? _a : 'hover';
89235
+ const trigger = array((_a = this._spec.trigger) !== null && _a !== void 0 ? _a : 'hover');
89110
89236
  const mode = this._option.mode;
89111
- if (trigger === 'hover') {
89112
- this._mountEvent('pointermove', { source: 'chart' }, this._handleMouseMove);
89237
+ if (trigger.includes('hover')) {
89238
+ this._mountEvent('pointermove', { source: 'chart' }, this._getMouseMoveHandler(false));
89113
89239
  if (isMobileLikeMode(mode) || isMiniAppLikeMode(mode)) {
89114
- this._mountEvent('pointerdown', { source: 'chart' }, this._handleMouseMove);
89240
+ this._mountEvent('pointerdown', { source: 'chart' }, this._getMouseMoveHandler(false));
89115
89241
  this._mountEvent('pointerup', { source: 'window' }, this._getMouseOutHandler(true));
89116
89242
  }
89117
89243
  this._mountEvent('pointerout', { source: 'canvas' }, this._getMouseOutHandler(false));
89118
89244
  }
89119
- else if (trigger === 'click') {
89120
- this._mountEvent('pointertap', { source: 'chart' }, this._handleMouseMove);
89245
+ if (trigger.includes('click')) {
89246
+ this._mountEvent('pointertap', { source: 'chart' }, this._getMouseMoveHandler(true));
89121
89247
  this._mountEvent('pointerup', { source: 'window' }, this._getMouseOutHandler(true));
89122
89248
  }
89123
89249
  }
@@ -89131,42 +89257,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
89131
89257
  this._initHandler();
89132
89258
  }
89133
89259
  }
89134
- setAttrFromSpec() {
89135
- var _a;
89136
- super.setAttrFromSpec();
89137
- const userSpec = this._spec;
89138
- this._spec = Object.assign(Object.assign({}, userSpec), { visible: isValid$3(userSpec.visible) ? userSpec.visible : true, activeType: getTooltipActualActiveType(userSpec), renderMode: 'html', trigger: isValid$3(userSpec.trigger) ? userSpec.trigger : 'hover', className: isValid$3(userSpec.className) ? userSpec.className : TOOLTIP_EL_CLASS_NAME, enterable: isValid$3(userSpec.enterable) ? userSpec.enterable : false, transitionDuration: isValid$3(userSpec.transitionDuration) ? userSpec.transitionDuration : 150 });
89139
- this._spec.triggerOff = isValid$3(userSpec.triggerOff) ? userSpec.triggerOff : this._spec.trigger;
89140
- if (isValid$3(userSpec.renderMode)) {
89141
- this._spec.renderMode = userSpec.renderMode;
89142
- }
89143
- else if (isMiniAppLikeMode(this._option.mode) || !isTrueBrowser(this._option.mode)) {
89144
- this._spec.renderMode = 'canvas';
89145
- }
89146
- if (isValid$3(userSpec.mark)) {
89147
- this._spec.mark = Object.assign(Object.assign({}, cloneDeep(userSpec.mark)), { activeType: 'mark' });
89148
- }
89149
- if (isValid$3(userSpec.dimension)) {
89150
- this._spec.dimension = Object.assign(Object.assign({}, cloneDeep(userSpec.dimension)), { activeType: 'dimension' });
89151
- }
89152
- if (isValid$3(userSpec.parentElement)) {
89153
- if (isString$1(userSpec.parentElement)) {
89154
- this._spec.parentElement = (_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _a === void 0 ? void 0 : _a.getElementById(userSpec.parentElement);
89155
- }
89156
- else {
89157
- this._spec.parentElement = userSpec.parentElement;
89158
- }
89159
- }
89160
- else if (isTrueBrowser(this._option.mode)) {
89161
- this._spec.parentElement = domDocument === null || domDocument === void 0 ? void 0 : domDocument.body;
89162
- }
89163
- if (isValid$3(userSpec.confine)) {
89164
- this._spec.confine = userSpec.confine;
89165
- }
89166
- else {
89167
- this._spec.confine = this._spec.renderMode === 'canvas';
89168
- }
89169
- }
89170
89260
  showTooltip(datum, options) {
89171
89261
  var _a;
89172
89262
  if (!this.tooltipHandler) {
@@ -89231,7 +89321,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
89231
89321
  prevParams.datum === nextParams.datum);
89232
89322
  }
89233
89323
  _isPointerInChart(point) {
89234
- const globalInstance = this._option.globalInstance;
89324
+ var _a;
89325
+ const globalInstance = (_a = this._option) === null || _a === void 0 ? void 0 : _a.globalInstance;
89326
+ if (!globalInstance) {
89327
+ return false;
89328
+ }
89235
89329
  const chart = globalInstance.getChart();
89236
89330
  if (!chart) {
89237
89331
  return false;
@@ -89339,7 +89433,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
89339
89433
  this.showDefault = false;
89340
89434
  this._layoutCrosshair(x, y);
89341
89435
  const components = this._getNeedClearVRenderComponents();
89342
- this._hasActive = components.some(comp => comp && comp.attribute.visible);
89436
+ this._hasActive = components.some(comp => comp && comp.attribute.visible !== false);
89343
89437
  };
89344
89438
  this._handleClickInEvent = (params) => {
89345
89439
  this._handleIn(params);
@@ -89830,7 +89924,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
89830
89924
  const positionAttribute = layoutVerticalCrosshair(this._xHair, crosshairInfo, bandWidth, offsetWidth);
89831
89925
  this._updateCrosshair('x', type, positionAttribute);
89832
89926
  if (top.visible) {
89833
- const updateAttrs = Object.assign(Object.assign(Object.assign({ x: x + bandWidth / 2, y: topPos }, top), this._xHair.label), { textStyle: Object.assign(Object.assign({}, (_a = this._xHair.label) === null || _a === void 0 ? void 0 : _a.textStyle), { textAlign: 'center', textBaseline: 'bottom' }), zIndex: this.labelZIndex });
89927
+ const updateAttrs = Object.assign(Object.assign(Object.assign({ x: x + bandWidth / 2, y: topPos }, top), this._xHair.label), { textStyle: Object.assign(Object.assign({}, (_a = this._xHair.label) === null || _a === void 0 ? void 0 : _a.textStyle), { textAlign: 'center', textBaseline: 'bottom' }), zIndex: this.labelZIndex, visible: true });
89834
89928
  this._updateCrosshairLabel(this._xTopLabel, updateAttrs, label => {
89835
89929
  label.name = 'crosshair-x-top-label';
89836
89930
  this._xTopLabel = label;
@@ -89840,7 +89934,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
89840
89934
  this._xTopLabel && this._xTopLabel.hideAll();
89841
89935
  }
89842
89936
  if (bottom.visible) {
89843
- const updateAttrs = Object.assign(Object.assign(Object.assign({ x: x + bandWidth / 2, y: topPos + height }, bottom), this._xHair.label), { textStyle: Object.assign(Object.assign({}, (_b = this._xHair.label) === null || _b === void 0 ? void 0 : _b.textStyle), { textAlign: 'center', textBaseline: 'top' }), zIndex: this.labelZIndex });
89937
+ const updateAttrs = Object.assign(Object.assign(Object.assign({ x: x + bandWidth / 2, y: topPos + height }, bottom), this._xHair.label), { textStyle: Object.assign(Object.assign({}, (_b = this._xHair.label) === null || _b === void 0 ? void 0 : _b.textStyle), { textAlign: 'center', textBaseline: 'top' }), zIndex: this.labelZIndex, visible: true });
89844
89938
  this._updateCrosshairLabel(this._xBottomLabel, updateAttrs, label => {
89845
89939
  label.name = 'crosshair-x-bottom-label';
89846
89940
  this._xBottomLabel = label;
@@ -89907,10 +90001,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
89907
90001
  else {
89908
90002
  const style = dim === 'x' ? this._xHair.style : this._yHair.style;
89909
90003
  if (type === 'line') {
89910
- crosshair = new LineCrosshair(Object.assign(Object.assign({}, attributes), { lineStyle: style, zIndex: this.gridZIndex + 1, disableTriggerEvent: this._option.disableTriggerEvent }));
90004
+ crosshair = new LineCrosshair(Object.assign(Object.assign({}, attributes), { lineStyle: style, zIndex: this.gridZIndex + 1, disableTriggerEvent: this._option.disableTriggerEvent, pickable: false }));
89911
90005
  }
89912
90006
  else if (type === 'rect') {
89913
- crosshair = new RectCrosshair(Object.assign(Object.assign({}, attributes), { rectStyle: style, zIndex: this.gridZIndex, disableTriggerEvent: this._option.disableTriggerEvent }));
90007
+ crosshair = new RectCrosshair(Object.assign(Object.assign({}, attributes), { rectStyle: style, zIndex: this.gridZIndex, disableTriggerEvent: this._option.disableTriggerEvent, pickable: false }));
89914
90008
  }
89915
90009
  container === null || container === void 0 ? void 0 : container.add(crosshair);
89916
90010
  if (dim === 'x') {
@@ -90287,10 +90381,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90287
90381
  else {
90288
90382
  let crosshair;
90289
90383
  if (crosshairType === 'line') {
90290
- crosshair = new LineCrosshair(Object.assign(Object.assign({}, positionAttrs), { lineStyle: this._angleHair.style, zIndex: this.gridZIndex }));
90384
+ crosshair = new LineCrosshair(Object.assign(Object.assign({}, positionAttrs), { lineStyle: this._angleHair.style, zIndex: this.gridZIndex, pickable: false }));
90291
90385
  }
90292
90386
  else if (crosshairType === 'sector') {
90293
- crosshair = new SectorCrosshair(Object.assign(Object.assign({}, positionAttrs), { sectorStyle: this._angleHair.style, zIndex: this.gridZIndex }));
90387
+ crosshair = new SectorCrosshair(Object.assign(Object.assign({}, positionAttrs), { sectorStyle: this._angleHair.style, zIndex: this.gridZIndex, pickable: false }));
90294
90388
  }
90295
90389
  this._angleCrosshair = crosshair;
90296
90390
  container.add(crosshair);
@@ -90394,13 +90488,19 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90394
90488
  if (newDomain.length === 0) {
90395
90489
  return [];
90396
90490
  }
90491
+ const domainMap = {};
90492
+ newDomain.forEach(d => {
90493
+ if (!domainMap[d]) {
90494
+ domainMap[d] = 1;
90495
+ }
90496
+ });
90397
90497
  let filter = null;
90398
90498
  if (isContinuous()) {
90399
90499
  filter = (d) => d[datumField] >= newDomain[0] && d[datumField] <= newDomain[1];
90400
90500
  }
90401
90501
  else {
90402
90502
  filter = (d) => {
90403
- return newDomain.indexOf(d[datumField] + '') >= 0 || newDomain.indexOf(d[datumField]) >= 0;
90503
+ return domainMap[d[datumField] + ''] || domainMap[d[datumField]];
90404
90504
  };
90405
90505
  }
90406
90506
  return data.filter(filter);
@@ -90445,13 +90545,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90445
90545
  };
90446
90546
 
90447
90547
  class DataFilterBaseComponent extends BaseComponent {
90448
- get orient() {
90449
- return this._orient;
90548
+ get relatedAxisComponent() {
90549
+ return this._relatedAxisComponent;
90450
90550
  }
90451
90551
  setStartAndEnd(start, end, rangeMode = ['percent', 'percent']) {
90452
90552
  const [startMode = 'percent', endMode = 'percent'] = rangeMode;
90453
- const startPercent = (startMode === 'percent' ? start : this._dataToStatePoint(start));
90454
- const endPercent = (endMode === 'percent' ? end : this._dataToStatePoint(end));
90553
+ const startPercent = (startMode === 'percent' ? start : this.dataToStatePoint(start));
90554
+ const endPercent = (endMode === 'percent' ? end : this.dataToStatePoint(end));
90455
90555
  this._handleChange(startPercent, endPercent, true);
90456
90556
  }
90457
90557
  enableInteraction() {
@@ -90477,7 +90577,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90477
90577
  _handleChange(start, end, updateComponent) {
90478
90578
  var _a, _b;
90479
90579
  const zoomLock = (_b = (_a = this._spec) === null || _a === void 0 ? void 0 : _a.zoomLock) !== null && _b !== void 0 ? _b : false;
90480
- if (zoomLock || end - start < this._minSpan || end - start > this._maxSpan) {
90580
+ if (zoomLock) {
90481
90581
  this._shouldChange = false;
90482
90582
  }
90483
90583
  }
@@ -90751,6 +90851,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90751
90851
  this._handleChange(this._start, this._end, true);
90752
90852
  }
90753
90853
  _computeDomainOfStateScale(isContinuous) {
90854
+ if (this._spec.customDomain) {
90855
+ return this._spec.customDomain;
90856
+ }
90754
90857
  const domain = this._data.getLatestData().map((d) => d[this._stateField]);
90755
90858
  if (isContinuous) {
90756
90859
  const domainNum = domain.map((n) => n * 1);
@@ -90873,6 +90976,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90873
90976
  }
90874
90977
  _statePointToData(state) {
90875
90978
  const scale = this._stateScale;
90979
+ const domain = scale.domain();
90980
+ if (isContinuous(scale.type)) {
90981
+ if (this._isReverse()) {
90982
+ return domain[0] + (domain[1] - domain[0]) * (1 - state);
90983
+ }
90984
+ return domain[0] + (domain[1] - domain[0]) * state;
90985
+ }
90876
90986
  let range = scale.range();
90877
90987
  if (this._isReverse()) {
90878
90988
  range = range.slice().reverse();
@@ -90880,7 +90990,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90880
90990
  const posInRange = range[0] + (range[1] - range[0]) * state;
90881
90991
  return scale.invert(posInRange);
90882
90992
  }
90883
- _dataToStatePoint(data) {
90993
+ dataToStatePoint(data) {
90884
90994
  const scale = this._stateScale;
90885
90995
  const pos = scale.scale(data);
90886
90996
  let range = scale.range();
@@ -90903,17 +91013,17 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90903
91013
  if (this._spec.rangeMode) {
90904
91014
  const [startMode, endMode] = this._spec.rangeMode;
90905
91015
  if (this._modeCheck('start', startMode) && this._modeCheck('end', endMode)) {
90906
- start = startMode === 'percent' ? this._spec.start : this._dataToStatePoint(this._spec.startValue);
90907
- end = endMode === 'percent' ? this._spec.end : this._dataToStatePoint(this._spec.endValue);
91016
+ start = startMode === 'percent' ? this._spec.start : this.dataToStatePoint(this._spec.startValue);
91017
+ end = endMode === 'percent' ? this._spec.end : this.dataToStatePoint(this._spec.endValue);
90908
91018
  }
90909
91019
  }
90910
91020
  else {
90911
91021
  start = this._spec.start
90912
91022
  ? this._spec.start
90913
91023
  : this._spec.startValue
90914
- ? this._dataToStatePoint(this._spec.startValue)
91024
+ ? this.dataToStatePoint(this._spec.startValue)
90915
91025
  : 0;
90916
- end = this._spec.end ? this._spec.end : this._spec.endValue ? this._dataToStatePoint(this._spec.endValue) : 1;
91026
+ end = this._spec.end ? this._spec.end : this._spec.endValue ? this.dataToStatePoint(this._spec.endValue) : 1;
90917
91027
  }
90918
91028
  this._startValue = this._statePointToData(start);
90919
91029
  this._endValue = this._statePointToData(end);
@@ -91221,6 +91331,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91221
91331
  this.layoutZIndex = exports.LayoutZIndex.DataZoom;
91222
91332
  this.layoutLevel = exports.LayoutLevel.DataZoom;
91223
91333
  this.layoutType = 'region-relative';
91334
+ this._isReverseCache = false;
91224
91335
  this._dataToPositionX = (datum) => {
91225
91336
  const offsetLeft = this._orient === 'left' ? this._middleHandlerSize : 0;
91226
91337
  const offsetHandler = this._isHorizontal ? this._startHandlerSize / 2 : 0;
@@ -91288,6 +91399,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91288
91399
  }
91289
91400
  onLayoutEnd(ctx) {
91290
91401
  this._updateScaleRange();
91402
+ if (this._isReverse() && !this._isReverseCache) {
91403
+ this._isReverseCache = this._isReverse();
91404
+ this.effect.onZoomChange();
91405
+ }
91291
91406
  if (this._cacheVisibility !== false) {
91292
91407
  super.onLayoutEnd(ctx);
91293
91408
  }
@@ -91302,7 +91417,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91302
91417
  }
91303
91418
  _updateScaleRange() {
91304
91419
  var _a, _b;
91305
- const handlerSize = (this._startHandlerSize + this._endHandlerSize) / 2;
91420
+ const handlerSize = this._startHandlerSize + this._endHandlerSize;
91306
91421
  if (!this._stateScale || !this._valueScale) {
91307
91422
  return;
91308
91423
  }
@@ -91310,19 +91425,28 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91310
91425
  const defaultSize = this._isHorizontal
91311
91426
  ? this.getLayoutRect().width - handlerSize
91312
91427
  : this.getLayoutRect().height - handlerSize;
91313
- const defaultRange = (_b = (_a = this._relatedAxisComponent) === null || _a === void 0 ? void 0 : _a.getScale().range()) !== null && _b !== void 0 ? _b : [0, defaultSize];
91428
+ const defaultRange = (_b = (_a = this._relatedAxisComponent) === null || _a === void 0 ? void 0 : _a.getScale().range()) !== null && _b !== void 0 ? _b : [
91429
+ this._startHandlerSize / 2,
91430
+ defaultSize + this._startHandlerSize / 2
91431
+ ];
91314
91432
  if (this._isHorizontal) {
91315
- stateScaleRange = this._visible ? [0, this._computeWidth() - handlerSize] : defaultRange;
91433
+ stateScaleRange = this._visible
91434
+ ? [this._startHandlerSize / 2, this._computeWidth() - handlerSize + this._startHandlerSize / 2]
91435
+ : defaultRange;
91316
91436
  this._stateScale.range(stateScaleRange);
91317
91437
  this._valueScale.range([this._computeHeight() - this._middleHandlerSize, 0]);
91318
91438
  }
91319
91439
  else if (this.layoutOrient === 'left') {
91320
- stateScaleRange = this._visible ? [0, this._computeHeight() - handlerSize] : defaultRange;
91440
+ stateScaleRange = this._visible
91441
+ ? [this._startHandlerSize / 2, this._computeHeight() - handlerSize + this._startHandlerSize / 2]
91442
+ : defaultRange;
91321
91443
  this._stateScale.range(stateScaleRange);
91322
91444
  this._valueScale.range([this._computeWidth() - this._middleHandlerSize, 0]);
91323
91445
  }
91324
91446
  else {
91325
- stateScaleRange = this._visible ? [0, this._computeHeight() - handlerSize] : defaultRange;
91447
+ stateScaleRange = this._visible
91448
+ ? [this._startHandlerSize / 2, this._computeHeight() - handlerSize + this._startHandlerSize / 2]
91449
+ : defaultRange;
91326
91450
  this._stateScale.range(stateScaleRange);
91327
91451
  this._valueScale.range([0, this._computeWidth() - this._middleHandlerSize]);
91328
91452
  }
@@ -91400,7 +91524,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91400
91524
  }, orient: this._orient, size: {
91401
91525
  width: this.getLayoutRect().width,
91402
91526
  height: this.getLayoutRect().height
91403
- }, showDetail: spec.showDetail, brushSelect: (_b = spec.brushSelect) !== null && _b !== void 0 ? _b : false, zoomLock: (_c = spec.zoomLock) !== null && _c !== void 0 ? _c : false, minSpan: this._minSpan, maxSpan: this._maxSpan, delayType: spec.delayType, delayTime: isValid$3(spec.delayType) ? (_d = spec.delayTime) !== null && _d !== void 0 ? _d : 30 : 0, realTime: (_e = spec.realTime) !== null && _e !== void 0 ? _e : true, previewData: isNeedPreview && this._data.getLatestData(), previewPointsX: isNeedPreview && this._dataToPositionX, previewPointsY: isNeedPreview && this._dataToPositionY }, this._getComponentAttrs());
91527
+ }, showDetail: spec.showDetail, brushSelect: (_b = spec.brushSelect) !== null && _b !== void 0 ? _b : false, zoomLock: (_c = spec.zoomLock) !== null && _c !== void 0 ? _c : false, minSpan: this._minSpan, maxSpan: this._maxSpan, delayType: spec.delayType, delayTime: isValid$3(spec.delayType) ? (_d = spec.delayTime) !== null && _d !== void 0 ? _d : 30 : 0, realTime: (_e = spec.realTime) !== null && _e !== void 0 ? _e : true, previewData: isNeedPreview && this._data.getLatestData(), previewPointsX: isNeedPreview && this._dataToPositionX, previewPointsY: isNeedPreview && this._dataToPositionY, tolerance: this._spec.tolerance }, this._getComponentAttrs());
91404
91528
  }
91405
91529
  _createOrUpdateComponent() {
91406
91530
  if (this._visible) {
@@ -91438,7 +91562,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91438
91562
  }
91439
91563
  this._start = start;
91440
91564
  this._end = end;
91441
- const hasChange = this._handleStateChange(this._statePointToData(start), this._statePointToData(end), tag);
91565
+ const startValue = this._statePointToData(start);
91566
+ const endValue = this._statePointToData(end);
91567
+ const hasChange = isFunction$1(this._spec.updateDataAfterChange)
91568
+ ? this._spec.updateDataAfterChange(start, end, startValue, endValue)
91569
+ : this._handleStateChange(startValue, endValue, tag);
91442
91570
  if (hasChange) {
91443
91571
  this.event.emit(exports.ChartEvent.dataZoomChange, {
91444
91572
  model: this,
@@ -91514,6 +91642,17 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91514
91642
  _getNeedClearVRenderComponents() {
91515
91643
  return [this._component];
91516
91644
  }
91645
+ clear() {
91646
+ if (this._component) {
91647
+ const container = this.getContainer();
91648
+ this._component.removeAllChild();
91649
+ if (container) {
91650
+ container.removeChild(this._component);
91651
+ }
91652
+ this._component = null;
91653
+ }
91654
+ super.clear();
91655
+ }
91517
91656
  }
91518
91657
  DataZoom.type = ComponentTypeEnum.dataZoom;
91519
91658
  DataZoom.transformerConstructor = DataZoomSpecTransformer;
@@ -91632,7 +91771,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91632
91771
  }
91633
91772
  this._start = start;
91634
91773
  this._end = end;
91635
- const hasChange = this._handleStateChange(this._statePointToData(start), this._statePointToData(end));
91774
+ const startValue = this._statePointToData(start);
91775
+ const endValue = this._statePointToData(end);
91776
+ const hasChange = isFunction$1(this._spec.updateDataAfterChange)
91777
+ ? this._spec.updateDataAfterChange(start, end, startValue, endValue)
91778
+ : this._handleStateChange(this._statePointToData(start), this._statePointToData(end));
91636
91779
  if (hasChange) {
91637
91780
  this.event.emit(exports.ChartEvent.scrollBarChange, {
91638
91781
  model: this,
@@ -93705,6 +93848,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
93705
93848
  _getNeedClearVRenderComponents() {
93706
93849
  return [];
93707
93850
  }
93851
+ _delegateLabelEvent(component) {
93852
+ if (component.listenerCount('*') === 0) {
93853
+ component.addEventListener('*', ((event, type) => this._delegateEvent(component, event, type)));
93854
+ }
93855
+ }
93708
93856
  }
93709
93857
  BaseLabelComponent.type = ComponentTypeEnum.label;
93710
93858
 
@@ -93814,23 +93962,19 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
93814
93962
  });
93815
93963
  this.event.off(exports.VGRAMMAR_HOOK_EVENT.AFTER_MARK_RENDER_END, enableAnimation);
93816
93964
  };
93817
- this.event.on('afterElementEncode', eventParams => {
93818
- var _a;
93819
- const mark = eventParams.item;
93820
- if (this._option.getChart().getLayoutTag() === false && ((_a = mark.getContext()) === null || _a === void 0 ? void 0 : _a.model) === this) {
93821
- this._delegateLabelEvent(mark.getGroupGraphicItem());
93965
+ }
93966
+ afterCompile() {
93967
+ this._labelComponentMap.forEach((info, component) => {
93968
+ const product = component.getProduct();
93969
+ if (product) {
93970
+ product.addEventListener(exports.VGRAMMAR_HOOK_EVENT.AFTER_ELEMENT_ENCODE, () => {
93971
+ if (this._isLayout === false) {
93972
+ this._delegateLabelEvent(product.getGroupGraphicItem());
93973
+ }
93974
+ });
93822
93975
  }
93823
93976
  });
93824
93977
  }
93825
- _delegateLabelEvent(component) {
93826
- const textNodes = component === null || component === void 0 ? void 0 : component.findAll(node => node.type === 'text', true).filter(text => !text.__vchart_event);
93827
- if (textNodes && textNodes.length > 0) {
93828
- textNodes.forEach(text => {
93829
- text.__vchart_event = true;
93830
- text.addEventListener('*', ((event, type) => this._delegateEvent(component, event, type, text, text.attribute.data)));
93831
- });
93832
- }
93833
- }
93834
93978
  _initTextMark() {
93835
93979
  if (!this._labelInfoMap) {
93836
93980
  this._labelInfoMap = new Map();
@@ -94083,6 +94227,18 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
94083
94227
  this._marks.addMark(component);
94084
94228
  }
94085
94229
  }
94230
+ afterCompile() {
94231
+ this._marks.forEach((componentMark, index) => {
94232
+ const product = componentMark.getProduct();
94233
+ if (product) {
94234
+ product.addEventListener(exports.VGRAMMAR_HOOK_EVENT.AFTER_ELEMENT_ENCODE, () => {
94235
+ if (this._isLayout === false) {
94236
+ this._delegateLabelEvent(product.getGroupGraphicItem());
94237
+ }
94238
+ });
94239
+ }
94240
+ });
94241
+ }
94086
94242
  updateLayoutAttribute() {
94087
94243
  super.updateLayoutAttribute();
94088
94244
  const series = this._getSeries();
@@ -94342,6 +94498,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
94342
94498
  this._needInitOutState = true;
94343
94499
  this._cacheInteractiveRangeAttrs = [];
94344
94500
  this._needDisablePickable = false;
94501
+ this._releatedAxes = [];
94502
+ this._regionAxisMap = {};
94503
+ this._axisDataZoomMap = {};
94504
+ this._zoomRecord = [];
94345
94505
  }
94346
94506
  init() {
94347
94507
  const inBrushMarkAttr = this._transformBrushedMarkAttr(this._spec.inBrush);
@@ -94374,13 +94534,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
94374
94534
  this.initEvent();
94375
94535
  this._bindRegions();
94376
94536
  this._bindLinkedSeries();
94537
+ this._initRegionAxisMap();
94538
+ this._initAxisDataZoomMap();
94377
94539
  this._initNeedOperatedItem();
94378
94540
  }
94379
94541
  _extendDataInBrush(elementsMap) {
94380
94542
  const data = [];
94381
94543
  for (const brushName in elementsMap) {
94382
94544
  for (const elementKey in elementsMap[brushName]) {
94383
- data.push(elementsMap[brushName][elementKey].data[0]);
94545
+ data.push(Object.assign({}, elementsMap[brushName][elementKey].data[0]));
94384
94546
  }
94385
94547
  }
94386
94548
  return data;
@@ -94440,9 +94602,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
94440
94602
  this._needInitOutState = false;
94441
94603
  this._needDisablePickable = true;
94442
94604
  this._handleBrushChange(exports.ChartEvent.brushChange, region, e);
94605
+ this._emitEvent(exports.ChartEvent.brushChange, region);
94443
94606
  });
94444
94607
  brush.addEventListener(IOperateType.moving, (e) => {
94445
94608
  this._handleBrushChange(exports.ChartEvent.brushChange, region, e);
94609
+ this._emitEvent(exports.ChartEvent.brushChange, region);
94446
94610
  });
94447
94611
  brush.addEventListener(IOperateType.brushClear, (e) => {
94448
94612
  this._initMarkBrushState(componentIndex, '');
@@ -94450,21 +94614,28 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
94450
94614
  this._needDisablePickable = false;
94451
94615
  this._handleBrushChange(exports.ChartEvent.brushChange, region, e);
94452
94616
  this._handleBrushChange(exports.ChartEvent.brushClear, region, e);
94617
+ this._emitEvent(exports.ChartEvent.brushChange, region);
94618
+ this._emitEvent(exports.ChartEvent.brushClear, region);
94453
94619
  });
94454
94620
  brush.addEventListener(IOperateType.drawEnd, (e) => {
94455
94621
  this._needInitOutState = true;
94456
94622
  this._needDisablePickable = false;
94623
+ const { operateMask } = e.detail;
94457
94624
  this._handleBrushChange(exports.ChartEvent.brushEnd, region, e);
94625
+ this._setAxisAndDataZoom(operateMask, region);
94626
+ this._emitEvent(exports.ChartEvent.brushEnd, region);
94458
94627
  });
94459
94628
  brush.addEventListener(IOperateType.moveEnd, (e) => {
94629
+ const { operateMask } = e.detail;
94460
94630
  this._handleBrushChange(exports.ChartEvent.brushEnd, region, e);
94631
+ this._setAxisAndDataZoom(operateMask, region);
94632
+ this._emitEvent(exports.ChartEvent.brushEnd, region);
94461
94633
  });
94462
94634
  }
94463
94635
  _handleBrushChange(eventType, region, e) {
94464
94636
  const { operateMask } = e.detail;
94465
94637
  this._reconfigItem(operateMask, region);
94466
94638
  this._reconfigLinkedItem(operateMask, region);
94467
- this._emitEvent(eventType, region);
94468
94639
  }
94469
94640
  _emitEvent(eventType, region) {
94470
94641
  this.event.emit(eventType, {
@@ -94479,7 +94650,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
94479
94650
  inBrushElementsMap: this._inBrushElementsMap,
94480
94651
  outOfBrushElementsMap: this._outOfBrushElementsMap,
94481
94652
  linkedInBrushElementsMap: this._linkedInBrushElementsMap,
94482
- linkedOutOfBrushElementsMap: this._linkedOutOfBrushElementsMap
94653
+ linkedOutOfBrushElementsMap: this._linkedOutOfBrushElementsMap,
94654
+ zoomRecord: this._zoomRecord
94483
94655
  }
94484
94656
  });
94485
94657
  }
@@ -94638,6 +94810,60 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
94638
94810
  }
94639
94811
  return brushMask.globalAABBBounds.intersects(item.globalAABBBounds);
94640
94812
  }
94813
+ _stateClamp(state) {
94814
+ return Math.min(Math.max(0, state), 1);
94815
+ }
94816
+ _setAxisAndDataZoom(operateMask, region) {
94817
+ var _a;
94818
+ this._zoomRecord = [];
94819
+ if (this._spec.zoomAfterBrush) {
94820
+ const operateMaskBounds = operateMask.AABBBounds;
94821
+ (_a = this._regionAxisMap['region_' + region.id]) === null || _a === void 0 ? void 0 : _a.forEach(axis => {
94822
+ var _a, _b;
94823
+ const isHorizontal = axis.layoutOrient === 'bottom' || axis.layoutOrient === 'top';
94824
+ const axisRangeExpand = (_a = this._spec.axisRangeExpand) !== null && _a !== void 0 ? _a : 0;
94825
+ const { x1, x2, y1, y2 } = operateMaskBounds;
94826
+ const regionStartAttr = isHorizontal ? 'x' : 'y';
94827
+ const boundsStart = isHorizontal ? x1 : y1;
94828
+ const boundsEnd = isHorizontal ? x2 : y2;
94829
+ if (this._axisDataZoomMap[axis.id]) {
94830
+ const dataZoom = this._axisDataZoomMap[axis.id];
94831
+ const releatedAxis = dataZoom.relatedAxisComponent;
94832
+ const startValue = releatedAxis
94833
+ .getScale()
94834
+ .invert(boundsStart - region.getLayoutStartPoint()[regionStartAttr]);
94835
+ const endValue = releatedAxis.getScale().invert(boundsEnd - region.getLayoutStartPoint()[regionStartAttr]);
94836
+ const startPercent = dataZoom.dataToStatePoint(startValue);
94837
+ const endPercent = dataZoom.dataToStatePoint(endValue);
94838
+ const newStartPercent = this._stateClamp(startPercent - axisRangeExpand);
94839
+ const newEndPercent = this._stateClamp(endPercent + axisRangeExpand);
94840
+ dataZoom.setStartAndEnd(newStartPercent, newEndPercent, ['percent', 'percent']);
94841
+ this._zoomRecord.push({
94842
+ operateComponent: dataZoom,
94843
+ start: newStartPercent,
94844
+ end: newEndPercent
94845
+ });
94846
+ }
94847
+ else {
94848
+ const range = axis.getScale().range();
94849
+ const rangeFactor = (_b = axis.getScale().rangeFactor()) !== null && _b !== void 0 ? _b : [0, 1];
94850
+ const startPos = boundsStart - region.getLayoutStartPoint()[regionStartAttr];
94851
+ const endPos = boundsEnd - region.getLayoutStartPoint()[regionStartAttr];
94852
+ const start = ((startPos - range[0]) / (range[1] - range[0])) * (rangeFactor[1] - rangeFactor[0]) + rangeFactor[0];
94853
+ const end = ((endPos - range[0]) / (range[1] - range[0])) * (rangeFactor[1] - rangeFactor[0]) + rangeFactor[0];
94854
+ const newStart = this._stateClamp(start - axisRangeExpand);
94855
+ const newEnd = this._stateClamp(end + axisRangeExpand);
94856
+ axis.getScale().rangeFactor([newStart, newEnd]);
94857
+ axis.effect.scaleUpdate();
94858
+ this._zoomRecord.push({
94859
+ operateComponent: axis,
94860
+ start: newStart,
94861
+ end: newEnd
94862
+ });
94863
+ }
94864
+ });
94865
+ }
94866
+ }
94641
94867
  _bindRegions() {
94642
94868
  if (isValid$3(this._spec.regionId) && isValid$3(this._spec.regionIndex)) {
94643
94869
  this._relativeRegions = this._option.getAllRegions();
@@ -94650,6 +94876,38 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
94650
94876
  }
94651
94877
  this._linkedSeries = this._option.getSeriesInUserIdOrIndex(array(this._spec.brushLinkSeriesId), array(this._spec.brushLinkSeriesIndex));
94652
94878
  }
94879
+ _initRegionAxisMap() {
94880
+ if (isValid$3(this._spec.axisId)) {
94881
+ array(this._spec.axisId).forEach((axisId) => {
94882
+ this._releatedAxes.push(this._option.getComponentByUserId(axisId));
94883
+ });
94884
+ }
94885
+ else if (isValid$3(this._spec.axisIndex)) {
94886
+ array(this._spec.axisIndex).forEach((axisIndex) => {
94887
+ this._releatedAxes.push(this._option.getComponentByIndex('axes', axisIndex));
94888
+ });
94889
+ }
94890
+ else {
94891
+ this._releatedAxes = this._option.getComponentsByKey('axes');
94892
+ }
94893
+ this._releatedAxes.forEach((axis) => {
94894
+ axis === null || axis === void 0 ? void 0 : axis.getRegions().forEach((region) => {
94895
+ if (this._regionAxisMap['region_' + region.id]) {
94896
+ this._regionAxisMap['region_' + region.id].push(axis);
94897
+ }
94898
+ else {
94899
+ this._regionAxisMap['region_' + region.id] = [axis];
94900
+ }
94901
+ });
94902
+ });
94903
+ }
94904
+ _initAxisDataZoomMap() {
94905
+ this._option.getComponentsByKey('dataZoom').forEach((dz) => {
94906
+ if (dz.relatedAxisComponent) {
94907
+ this._axisDataZoomMap[dz.relatedAxisComponent.id] = dz;
94908
+ }
94909
+ });
94910
+ }
94653
94911
  _initNeedOperatedItem() {
94654
94912
  const seriesUserId = this._spec.seriesId;
94655
94913
  const seriesIndex = this._spec.seriesIndex;
@@ -94747,12 +95005,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
94747
95005
  }
94748
95006
  }
94749
95007
  clear() {
94750
- var _a;
94751
95008
  if (this._brushComponents) {
94752
- (_a = this.getContainer()) === null || _a === void 0 ? void 0 : _a.removeChild(this._brushComponents);
95009
+ const container = this.getContainer();
94753
95010
  this._brushComponents.forEach(brush => {
94754
95011
  brush.removeAllChild();
94755
95012
  brush.releaseBrushEvents();
95013
+ if (container) {
95014
+ container.removeChild(brush);
95015
+ }
94756
95016
  });
94757
95017
  this._brushComponents = null;
94758
95018
  }
@@ -94887,6 +95147,21 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
94887
95147
  }
94888
95148
  onRender(ctx) {
94889
95149
  }
95150
+ afterCompile() {
95151
+ this.getMarks().forEach(mark => {
95152
+ const product = mark.getProduct();
95153
+ if (product) {
95154
+ product.addEventListener(exports.VGRAMMAR_HOOK_EVENT.AFTER_ELEMENT_ENCODE, () => {
95155
+ if (this._isLayout === false) {
95156
+ const component = product.getGroupGraphicItem();
95157
+ if (component.listenerCount('*') === 0) {
95158
+ component.addEventListener('*', ((event, type) => this._delegateEvent(component, event, type)));
95159
+ }
95160
+ }
95161
+ });
95162
+ }
95163
+ });
95164
+ }
94890
95165
  _getMarkAttributeContext() {
94891
95166
  return {
94892
95167
  vchart: this._option.globalInstance,
@@ -95890,9 +96165,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
95890
96165
  if (isArray$3(formatter)) {
95891
96166
  return formatter.map(f => this._formatSingleLine(text, datum, f));
95892
96167
  }
95893
- else {
95894
- return this._formatSingleLine(text, datum, formatter);
95895
- }
96168
+ return this._formatSingleLine(text, datum, formatter);
95896
96169
  }
95897
96170
  _formatSingleLine(text, datum, formatter) {
95898
96171
  let isTemplate;
@@ -95912,18 +96185,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
95912
96185
  const value = datum[key.trim()];
95913
96186
  return typeof value !== 'undefined' ? value : match;
95914
96187
  }
95915
- else {
95916
- const parts = key.split(':');
95917
- const value = datum[parts.shift()];
95918
- const valueFormatter = parts.join(':');
95919
- return this._formatSingleText(value, valueFormatter);
95920
- }
96188
+ const parts = key.split(':');
96189
+ const value = datum[parts.shift()];
96190
+ const valueFormatter = parts.join(':');
96191
+ return this._formatSingleText(value, valueFormatter);
95921
96192
  });
95922
96193
  return result;
95923
96194
  }
95924
- else {
95925
- return this._formatSingleText(text, formatter);
95926
- }
96195
+ return this._formatSingleText(text, formatter);
95927
96196
  }
95928
96197
  _formatSingleText(text, formatter) {
95929
96198
  const isNumeric = numberSpecifierReg.test(formatter);
@@ -95944,11 +96213,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
95944
96213
  else if (formatter.includes('%') && this._timeFormatter) {
95945
96214
  return this._timeFormatter(formatter, text);
95946
96215
  }
95947
- else {
95948
- return text;
95949
- }
96216
+ return text;
95950
96217
  }
95951
- dispose() {
96218
+ release() {
96219
+ super.release();
95952
96220
  this._format = null;
95953
96221
  this._timeFormatter = null;
95954
96222
  this._numericFormatter = null;
@@ -96032,8 +96300,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
96032
96300
  registerCanvasTooltipHandler,
96033
96301
  registerFormatPlugin,
96034
96302
  registerElementActive,
96035
- registerElementHighlight,
96036
- registerElementSelect,
96037
96303
  registerElementActiveByLegend,
96038
96304
  registerElementHighlightByLegend,
96039
96305
  registerElementHighlightByName,