@visactor/vchart 1.10.3 → 1.10.5-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (329) hide show
  1. package/build/es5/index.js +2 -2
  2. package/build/index.js +789 -725
  3. package/build/index.min.js +1 -1
  4. package/build/tsconfig.tsbuildinfo +1 -1
  5. package/cjs/animation/utils.js +2 -2
  6. package/cjs/animation/utils.js.map +1 -1
  7. package/cjs/chart/base/base-chart-transformer.js +5 -2
  8. package/cjs/chart/base/base-chart-transformer.js.map +1 -1
  9. package/cjs/chart/base/base-chart.d.ts +2 -1
  10. package/cjs/chart/base/base-chart.js +14 -6
  11. package/cjs/chart/base/base-chart.js.map +1 -1
  12. package/cjs/chart/cartesian/cartesian-transformer.js +2 -2
  13. package/cjs/chart/cartesian/cartesian-transformer.js.map +1 -1
  14. package/cjs/chart/common/common-transformer.js +3 -2
  15. package/cjs/chart/common/common-transformer.js.map +1 -1
  16. package/cjs/chart/common/interface.d.ts +2 -2
  17. package/cjs/chart/common/interface.js.map +1 -1
  18. package/cjs/chart/interface/chart.d.ts +4 -1
  19. package/cjs/chart/interface/chart.js.map +1 -1
  20. package/cjs/chart/polar/progress-like/progress-like-transformer.js +3 -3
  21. package/cjs/chart/polar/progress-like/progress-like-transformer.js.map +1 -1
  22. package/cjs/chart/radar/radar-transformer.js +3 -3
  23. package/cjs/chart/radar/radar-transformer.js.map +1 -1
  24. package/cjs/chart/rose/rose-transformer.js +2 -2
  25. package/cjs/chart/rose/rose-transformer.js.map +1 -1
  26. package/cjs/chart/util.js +2 -2
  27. package/cjs/chart/util.js.map +1 -1
  28. package/cjs/component/axis/base-axis.js +6 -6
  29. package/cjs/component/axis/base-axis.js.map +1 -1
  30. package/cjs/component/axis/cartesian/axis.js +14 -13
  31. package/cjs/component/axis/cartesian/axis.js.map +1 -1
  32. package/cjs/component/axis/cartesian/interface/common.d.ts +1 -0
  33. package/cjs/component/axis/cartesian/interface/common.js.map +1 -1
  34. package/cjs/component/axis/cartesian/time-axis.js +2 -2
  35. package/cjs/component/axis/cartesian/time-axis.js.map +1 -1
  36. package/cjs/component/axis/mixin/linear-axis-mixin.d.ts +4 -0
  37. package/cjs/component/axis/mixin/linear-axis-mixin.js +7 -2
  38. package/cjs/component/axis/mixin/linear-axis-mixin.js.map +1 -1
  39. package/cjs/component/axis/polar/axis.js +3 -3
  40. package/cjs/component/axis/polar/axis.js.map +1 -1
  41. package/cjs/component/axis/util.js +3 -3
  42. package/cjs/component/axis/util.js.map +1 -1
  43. package/cjs/component/base/util.js +12 -12
  44. package/cjs/component/base/util.js.map +1 -1
  45. package/cjs/component/crosshair/cartesian.js +1 -3
  46. package/cjs/component/crosshair/cartesian.js.map +1 -1
  47. package/cjs/component/crosshair/interface/cartesian.d.ts +11 -24
  48. package/cjs/component/crosshair/interface/cartesian.js.map +1 -1
  49. package/cjs/component/crosshair/interface/polar.d.ts +7 -5
  50. package/cjs/component/crosshair/interface/polar.js.map +1 -1
  51. package/cjs/component/crosshair/polar.js +2 -5
  52. package/cjs/component/crosshair/polar.js.map +1 -1
  53. package/cjs/component/crosshair/utils/cartesian.js +14 -14
  54. package/cjs/component/crosshair/utils/cartesian.js.map +1 -1
  55. package/cjs/component/crosshair/utils/common.js +6 -5
  56. package/cjs/component/crosshair/utils/common.js.map +1 -1
  57. package/cjs/component/crosshair/utils/polar.js +17 -11
  58. package/cjs/component/crosshair/utils/polar.js.map +1 -1
  59. package/cjs/component/data-zoom/data-filter-base-component.d.ts +1 -0
  60. package/cjs/component/data-zoom/data-filter-base-component.js +9 -7
  61. package/cjs/component/data-zoom/data-filter-base-component.js.map +1 -1
  62. package/cjs/component/data-zoom/data-zoom/data-zoom-transformer.js +2 -2
  63. package/cjs/component/data-zoom/data-zoom/data-zoom-transformer.js.map +1 -1
  64. package/cjs/component/data-zoom/data-zoom/data-zoom.js +3 -3
  65. package/cjs/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
  66. package/cjs/component/data-zoom/util.js.map +1 -1
  67. package/cjs/component/geo/geo-coordinate.js +2 -2
  68. package/cjs/component/geo/geo-coordinate.js.map +1 -1
  69. package/cjs/component/indicator/indicator.js +2 -2
  70. package/cjs/component/indicator/indicator.js.map +1 -1
  71. package/cjs/component/label/label.js +4 -5
  72. package/cjs/component/label/label.js.map +1 -1
  73. package/cjs/component/label/total-label.js +2 -2
  74. package/cjs/component/label/total-label.js.map +1 -1
  75. package/cjs/component/legend/base-legend.js +6 -5
  76. package/cjs/component/legend/base-legend.js.map +1 -1
  77. package/cjs/component/legend/continuous/util.js +3 -3
  78. package/cjs/component/legend/continuous/util.js.map +1 -1
  79. package/cjs/component/legend/discrete/legend.js.map +1 -1
  80. package/cjs/component/legend/discrete/util.js +2 -2
  81. package/cjs/component/legend/discrete/util.js.map +1 -1
  82. package/cjs/component/legend/util.js +2 -2
  83. package/cjs/component/legend/util.js.map +1 -1
  84. package/cjs/component/tooltip/tooltip-transformer.js +3 -2
  85. package/cjs/component/tooltip/tooltip-transformer.js.map +1 -1
  86. package/cjs/component/tooltip/tooltip.js +4 -2
  87. package/cjs/component/tooltip/tooltip.js.map +1 -1
  88. package/cjs/core/index.d.ts +1 -1
  89. package/cjs/core/index.js +1 -1
  90. package/cjs/core/index.js.map +1 -1
  91. package/cjs/core/interface.d.ts +2 -0
  92. package/cjs/core/interface.js.map +1 -1
  93. package/cjs/core/vchart.d.ts +2 -2
  94. package/cjs/core/vchart.js +30 -14
  95. package/cjs/core/vchart.js.map +1 -1
  96. package/cjs/event/interface.d.ts +2 -0
  97. package/cjs/event/interface.js.map +1 -1
  98. package/cjs/layout/grid-layout/grid-layout.d.ts +1 -1
  99. package/cjs/layout/grid-layout/grid-layout.js +4 -4
  100. package/cjs/layout/grid-layout/grid-layout.js.map +1 -1
  101. package/cjs/mark/base/base-mark.js +2 -2
  102. package/cjs/mark/base/base-mark.js.map +1 -1
  103. package/cjs/model/base-model-transformer.js +2 -2
  104. package/cjs/model/base-model-transformer.js.map +1 -1
  105. package/cjs/plugin/chart/media-query/media-query.js +4 -4
  106. package/cjs/plugin/chart/media-query/media-query.js.map +1 -1
  107. package/cjs/plugin/chart/media-query/util/action.js +4 -3
  108. package/cjs/plugin/chart/media-query/util/action.js.map +1 -1
  109. package/cjs/plugin/components/tooltip-handler/dom/dom-tooltip-handler.js.map +1 -1
  110. package/cjs/plugin/components/tooltip-handler/dom/model/content-column-model.js +5 -5
  111. package/cjs/plugin/components/tooltip-handler/dom/model/content-column-model.js.map +1 -1
  112. package/cjs/plugin/components/tooltip-handler/dom/model/content-model.js +2 -2
  113. package/cjs/plugin/components/tooltip-handler/dom/model/content-model.js.map +1 -1
  114. package/cjs/plugin/components/tooltip-handler/dom/model/title-model.js +2 -2
  115. package/cjs/plugin/components/tooltip-handler/dom/model/title-model.js.map +1 -1
  116. package/cjs/plugin/components/tooltip-handler/dom/model/tooltip-model.js +2 -2
  117. package/cjs/plugin/components/tooltip-handler/dom/model/tooltip-model.js.map +1 -1
  118. package/cjs/plugin/components/tooltip-handler/dom/utils/style.js +4 -4
  119. package/cjs/plugin/components/tooltip-handler/dom/utils/style.js.map +1 -1
  120. package/cjs/plugin/components/tooltip-handler/utils/attribute.js +4 -4
  121. package/cjs/plugin/components/tooltip-handler/utils/attribute.js.map +1 -1
  122. package/cjs/plugin/components/tooltip-handler/utils/get-spec.js +2 -2
  123. package/cjs/plugin/components/tooltip-handler/utils/get-spec.js.map +1 -1
  124. package/cjs/region/interface.d.ts +2 -0
  125. package/cjs/region/interface.js.map +1 -1
  126. package/cjs/region/region.d.ts +1 -0
  127. package/cjs/region/region.js +5 -1
  128. package/cjs/region/region.js.map +1 -1
  129. package/cjs/series/area/area-transformer.js +6 -5
  130. package/cjs/series/area/area-transformer.js.map +1 -1
  131. package/cjs/series/bar/bar.js.map +1 -1
  132. package/cjs/series/base/base-series-transformer.js +4 -4
  133. package/cjs/series/base/base-series-transformer.js.map +1 -1
  134. package/cjs/series/base/base-series.js +4 -4
  135. package/cjs/series/base/base-series.js.map +1 -1
  136. package/cjs/series/dot/dot.js +2 -2
  137. package/cjs/series/dot/dot.js.map +1 -1
  138. package/cjs/series/mixin/line-mixin.js +2 -2
  139. package/cjs/series/mixin/line-mixin.js.map +1 -1
  140. package/cjs/series/pie/pie-transformer.js +4 -4
  141. package/cjs/series/pie/pie-transformer.js.map +1 -1
  142. package/cjs/series/util/stack.js +29 -15
  143. package/cjs/series/util/stack.js.map +1 -1
  144. package/cjs/typings/spec/common.d.ts +1 -0
  145. package/cjs/typings/spec/common.js.map +1 -1
  146. package/cjs/util/data.d.ts +21 -4
  147. package/cjs/util/data.js +42 -14
  148. package/cjs/util/data.js.map +1 -1
  149. package/cjs/util/index.d.ts +1 -0
  150. package/cjs/util/index.js +4 -4
  151. package/cjs/util/index.js.map +1 -1
  152. package/cjs/util/spec/index.d.ts +0 -5
  153. package/cjs/util/spec/index.js +1 -4
  154. package/cjs/util/spec/index.js.map +1 -1
  155. package/cjs/util/spec/transform.js.map +1 -1
  156. package/cjs/util/theme/merge-theme.js +3 -3
  157. package/cjs/util/theme/merge-theme.js.map +1 -1
  158. package/esm/animation/utils.js +1 -1
  159. package/esm/animation/utils.js.map +1 -1
  160. package/esm/chart/base/base-chart-transformer.js +5 -1
  161. package/esm/chart/base/base-chart-transformer.js.map +1 -1
  162. package/esm/chart/base/base-chart.d.ts +2 -1
  163. package/esm/chart/base/base-chart.js +14 -6
  164. package/esm/chart/base/base-chart.js.map +1 -1
  165. package/esm/chart/cartesian/cartesian-transformer.js +3 -1
  166. package/esm/chart/cartesian/cartesian-transformer.js.map +1 -1
  167. package/esm/chart/common/common-transformer.js +3 -1
  168. package/esm/chart/common/common-transformer.js.map +1 -1
  169. package/esm/chart/common/interface.d.ts +2 -2
  170. package/esm/chart/common/interface.js.map +1 -1
  171. package/esm/chart/interface/chart.d.ts +4 -1
  172. package/esm/chart/interface/chart.js.map +1 -1
  173. package/esm/chart/polar/progress-like/progress-like-transformer.js +1 -1
  174. package/esm/chart/polar/progress-like/progress-like-transformer.js.map +1 -1
  175. package/esm/chart/radar/radar-transformer.js +3 -1
  176. package/esm/chart/radar/radar-transformer.js.map +1 -1
  177. package/esm/chart/rose/rose-transformer.js +1 -1
  178. package/esm/chart/rose/rose-transformer.js.map +1 -1
  179. package/esm/chart/util.js +3 -1
  180. package/esm/chart/util.js.map +1 -1
  181. package/esm/component/axis/base-axis.js +1 -1
  182. package/esm/component/axis/base-axis.js.map +1 -1
  183. package/esm/component/axis/cartesian/axis.js +13 -10
  184. package/esm/component/axis/cartesian/axis.js.map +1 -1
  185. package/esm/component/axis/cartesian/interface/common.d.ts +1 -0
  186. package/esm/component/axis/cartesian/interface/common.js.map +1 -1
  187. package/esm/component/axis/cartesian/time-axis.js +2 -2
  188. package/esm/component/axis/cartesian/time-axis.js.map +1 -1
  189. package/esm/component/axis/mixin/linear-axis-mixin.d.ts +4 -0
  190. package/esm/component/axis/mixin/linear-axis-mixin.js +7 -2
  191. package/esm/component/axis/mixin/linear-axis-mixin.js.map +1 -1
  192. package/esm/component/axis/polar/axis.js +2 -2
  193. package/esm/component/axis/polar/axis.js.map +1 -1
  194. package/esm/component/axis/util.js +1 -1
  195. package/esm/component/axis/util.js.map +1 -1
  196. package/esm/component/base/util.js +2 -2
  197. package/esm/component/base/util.js.map +1 -1
  198. package/esm/component/crosshair/cartesian.js +3 -5
  199. package/esm/component/crosshair/cartesian.js.map +1 -1
  200. package/esm/component/crosshair/interface/cartesian.d.ts +11 -24
  201. package/esm/component/crosshair/interface/cartesian.js.map +1 -1
  202. package/esm/component/crosshair/interface/polar.d.ts +7 -5
  203. package/esm/component/crosshair/interface/polar.js.map +1 -1
  204. package/esm/component/crosshair/polar.js +4 -7
  205. package/esm/component/crosshair/polar.js.map +1 -1
  206. package/esm/component/crosshair/utils/cartesian.js +14 -14
  207. package/esm/component/crosshair/utils/cartesian.js.map +1 -1
  208. package/esm/component/crosshair/utils/common.js +2 -2
  209. package/esm/component/crosshair/utils/common.js.map +1 -1
  210. package/esm/component/crosshair/utils/polar.js +15 -9
  211. package/esm/component/crosshair/utils/polar.js.map +1 -1
  212. package/esm/component/data-zoom/data-filter-base-component.d.ts +1 -0
  213. package/esm/component/data-zoom/data-filter-base-component.js +9 -7
  214. package/esm/component/data-zoom/data-filter-base-component.js.map +1 -1
  215. package/esm/component/data-zoom/data-zoom/data-zoom-transformer.js +3 -1
  216. package/esm/component/data-zoom/data-zoom/data-zoom-transformer.js.map +1 -1
  217. package/esm/component/data-zoom/data-zoom/data-zoom.js +1 -1
  218. package/esm/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
  219. package/esm/component/data-zoom/util.js.map +1 -1
  220. package/esm/component/geo/geo-coordinate.js +1 -1
  221. package/esm/component/geo/geo-coordinate.js.map +1 -1
  222. package/esm/component/indicator/indicator.js +1 -1
  223. package/esm/component/indicator/indicator.js.map +1 -1
  224. package/esm/component/label/label.js +3 -4
  225. package/esm/component/label/label.js.map +1 -1
  226. package/esm/component/label/total-label.js +1 -1
  227. package/esm/component/label/total-label.js.map +1 -1
  228. package/esm/component/legend/base-legend.js +3 -2
  229. package/esm/component/legend/base-legend.js.map +1 -1
  230. package/esm/component/legend/continuous/util.js +1 -1
  231. package/esm/component/legend/continuous/util.js.map +1 -1
  232. package/esm/component/legend/discrete/legend.js.map +1 -1
  233. package/esm/component/legend/discrete/util.js +1 -1
  234. package/esm/component/legend/discrete/util.js.map +1 -1
  235. package/esm/component/legend/util.js +1 -1
  236. package/esm/component/legend/util.js.map +1 -1
  237. package/esm/component/tooltip/tooltip-transformer.js +3 -1
  238. package/esm/component/tooltip/tooltip-transformer.js.map +1 -1
  239. package/esm/component/tooltip/tooltip.js +4 -2
  240. package/esm/component/tooltip/tooltip.js.map +1 -1
  241. package/esm/core/index.d.ts +1 -1
  242. package/esm/core/index.js +1 -1
  243. package/esm/core/index.js.map +1 -1
  244. package/esm/core/interface.d.ts +2 -0
  245. package/esm/core/interface.js.map +1 -1
  246. package/esm/core/vchart.d.ts +2 -2
  247. package/esm/core/vchart.js +25 -11
  248. package/esm/core/vchart.js.map +1 -1
  249. package/esm/event/interface.d.ts +2 -0
  250. package/esm/event/interface.js.map +1 -1
  251. package/esm/layout/grid-layout/grid-layout.d.ts +1 -1
  252. package/esm/layout/grid-layout/grid-layout.js +4 -4
  253. package/esm/layout/grid-layout/grid-layout.js.map +1 -1
  254. package/esm/mark/base/base-mark.js +1 -1
  255. package/esm/mark/base/base-mark.js.map +1 -1
  256. package/esm/model/base-model-transformer.js +3 -1
  257. package/esm/model/base-model-transformer.js.map +1 -1
  258. package/esm/plugin/chart/media-query/media-query.js +3 -1
  259. package/esm/plugin/chart/media-query/media-query.js.map +1 -1
  260. package/esm/plugin/chart/media-query/util/action.js +2 -2
  261. package/esm/plugin/chart/media-query/util/action.js.map +1 -1
  262. package/esm/plugin/components/tooltip-handler/dom/dom-tooltip-handler.js.map +1 -1
  263. package/esm/plugin/components/tooltip-handler/dom/model/content-column-model.js +1 -1
  264. package/esm/plugin/components/tooltip-handler/dom/model/content-column-model.js.map +1 -1
  265. package/esm/plugin/components/tooltip-handler/dom/model/content-model.js +1 -1
  266. package/esm/plugin/components/tooltip-handler/dom/model/content-model.js.map +1 -1
  267. package/esm/plugin/components/tooltip-handler/dom/model/title-model.js +1 -1
  268. package/esm/plugin/components/tooltip-handler/dom/model/title-model.js.map +1 -1
  269. package/esm/plugin/components/tooltip-handler/dom/model/tooltip-model.js +1 -1
  270. package/esm/plugin/components/tooltip-handler/dom/model/tooltip-model.js.map +1 -1
  271. package/esm/plugin/components/tooltip-handler/dom/utils/style.js +1 -1
  272. package/esm/plugin/components/tooltip-handler/dom/utils/style.js.map +1 -1
  273. package/esm/plugin/components/tooltip-handler/utils/attribute.js +1 -1
  274. package/esm/plugin/components/tooltip-handler/utils/attribute.js.map +1 -1
  275. package/esm/plugin/components/tooltip-handler/utils/get-spec.js +1 -1
  276. package/esm/plugin/components/tooltip-handler/utils/get-spec.js.map +1 -1
  277. package/esm/region/interface.d.ts +2 -0
  278. package/esm/region/interface.js.map +1 -1
  279. package/esm/region/region.d.ts +1 -0
  280. package/esm/region/region.js +5 -1
  281. package/esm/region/region.js.map +1 -1
  282. package/esm/series/area/area-transformer.js +1 -1
  283. package/esm/series/area/area-transformer.js.map +1 -1
  284. package/esm/series/bar/bar.js.map +1 -1
  285. package/esm/series/base/base-series-transformer.js +3 -1
  286. package/esm/series/base/base-series-transformer.js.map +1 -1
  287. package/esm/series/base/base-series.js +1 -1
  288. package/esm/series/base/base-series.js.map +1 -1
  289. package/esm/series/dot/dot.js +1 -1
  290. package/esm/series/dot/dot.js.map +1 -1
  291. package/esm/series/mixin/line-mixin.js +1 -1
  292. package/esm/series/mixin/line-mixin.js.map +1 -1
  293. package/esm/series/pie/pie-transformer.js +1 -1
  294. package/esm/series/pie/pie-transformer.js.map +1 -1
  295. package/esm/series/util/stack.js +28 -15
  296. package/esm/series/util/stack.js.map +1 -1
  297. package/esm/typings/spec/common.d.ts +1 -0
  298. package/esm/typings/spec/common.js.map +1 -1
  299. package/esm/util/data.d.ts +21 -4
  300. package/esm/util/data.js +39 -10
  301. package/esm/util/data.js.map +1 -1
  302. package/esm/util/index.d.ts +1 -0
  303. package/esm/util/index.js +2 -0
  304. package/esm/util/index.js.map +1 -1
  305. package/esm/util/spec/index.d.ts +0 -5
  306. package/esm/util/spec/index.js +0 -10
  307. package/esm/util/spec/index.js.map +1 -1
  308. package/esm/util/spec/transform.js.map +1 -1
  309. package/esm/util/theme/merge-theme.js +1 -1
  310. package/esm/util/theme/merge-theme.js.map +1 -1
  311. package/package.json +12 -12
  312. package/cjs/util/spec/clone-deep.d.ts +0 -1
  313. package/cjs/util/spec/clone-deep.js +0 -27
  314. package/cjs/util/spec/clone-deep.js.map +0 -1
  315. package/cjs/util/spec/common.d.ts +0 -3
  316. package/cjs/util/spec/common.js +0 -23
  317. package/cjs/util/spec/common.js.map +0 -1
  318. package/cjs/util/spec/merge-spec.d.ts +0 -5
  319. package/cjs/util/spec/merge-spec.js +0 -69
  320. package/cjs/util/spec/merge-spec.js.map +0 -1
  321. package/esm/util/spec/clone-deep.d.ts +0 -1
  322. package/esm/util/spec/clone-deep.js +0 -20
  323. package/esm/util/spec/clone-deep.js.map +0 -1
  324. package/esm/util/spec/common.d.ts +0 -3
  325. package/esm/util/spec/common.js +0 -15
  326. package/esm/util/spec/common.js.map +0 -1
  327. package/esm/util/spec/merge-spec.d.ts +0 -5
  328. package/esm/util/spec/merge-spec.js +0 -57
  329. package/esm/util/spec/merge-spec.js.map +0 -1
package/build/index.js CHANGED
@@ -8652,6 +8652,7 @@
8652
8652
  const DefaultStyle = Object.assign(Object.assign(Object.assign(Object.assign({
8653
8653
  opacity: 1,
8654
8654
  background: null,
8655
+ backgroundOpacity: 1,
8655
8656
  backgroundCornerRadius: 0,
8656
8657
  texture: null,
8657
8658
  textureColor: "black",
@@ -13328,7 +13329,7 @@
13328
13329
  }
13329
13330
  tryUpdateGlobalAABBBounds() {
13330
13331
  const b = this.AABBBounds;
13331
- return this._globalAABBBounds ? this._globalAABBBounds.setValue(b.x1, b.y1, b.x2, b.y2) : this._globalAABBBounds = b.clone(), this.parent && this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix), this._globalAABBBounds;
13332
+ return this._globalAABBBounds ? this._globalAABBBounds.setValue(b.x1, b.y1, b.x2, b.y2) : this._globalAABBBounds = b.clone(), this._globalAABBBounds.empty() || this.parent && this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix), this._globalAABBBounds;
13332
13333
  }
13333
13334
  tryUpdateGlobalTransMatrix() {
13334
13335
  if (this._globalTransMatrix) {
@@ -18918,8 +18919,11 @@
18918
18919
  this.time = BaseRenderContributionTime.beforeFillStroke, this.useStyle = !0, this.order = 0;
18919
18920
  }
18920
18921
  drawShape(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb, options) {
18922
+ var _a;
18921
18923
  const {
18922
18924
  background: background,
18925
+ backgroundOpacity = null !== (_a = graphic.attribute.fillOpacity) && void 0 !== _a ? _a : graphicAttribute.backgroundOpacity,
18926
+ opacity = graphicAttribute.opacity,
18923
18927
  backgroundMode = graphicAttribute.backgroundMode,
18924
18928
  backgroundFit = graphicAttribute.backgroundFit
18925
18929
  } = graphic.attribute;
@@ -18936,8 +18940,8 @@
18936
18940
  }
18937
18941
  context.clip();
18938
18942
  const b = graphic.AABBBounds;
18939
- context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), this.doDrawImage(context, res.data, b, backgroundMode, backgroundFit), context.restore(), graphic.transMatrix.onlyTranslate() || context.setTransformForCurrent();
18940
- } else context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = background, context.fill(), context.highPerformanceRestore();
18943
+ context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.globalAlpha = backgroundOpacity * opacity, this.doDrawImage(context, res.data, b, backgroundMode, backgroundFit), context.restore(), graphic.transMatrix.onlyTranslate() || context.setTransformForCurrent();
18944
+ } else context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.globalAlpha = backgroundOpacity * opacity, context.fillStyle = background, context.fill(), context.highPerformanceRestore();
18941
18945
  }
18942
18946
  doDrawImage(context, data, b, backgroundMode, backgroundFit) {
18943
18947
  if ("no-repeat" === backgroundMode) context.drawImage(data, b.x1, b.y1, b.width(), b.height());else {
@@ -30979,22 +30983,21 @@
30979
30983
  specialCharSet: "-/: .,@%'\"~" + TextMeasure.ALPHABET_CHAR_SET + TextMeasure.ALPHABET_CHAR_SET.toUpperCase()
30980
30984
  }, null != option ? option : {}), textSpec);
30981
30985
  function measureTextSize(text, textSpec) {
30982
- let fontFamily = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULT_TEXT_FONT_FAMILY;
30983
- var _a, _b;
30986
+ let defaultTextTheme = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
30984
30987
  if (!text) return {
30985
30988
  width: 0,
30986
30989
  height: 0
30987
30990
  };
30988
30991
  const bounds = getTextBounds({
30989
30992
  text: text,
30990
- fontFamily: null !== (_a = textSpec.fontFamily) && void 0 !== _a ? _a : fontFamily,
30991
- fontSize: textSpec.fontSize || 12,
30992
- fontWeight: textSpec.fontWeight,
30993
- textAlign: null !== (_b = textSpec.textAlign) && void 0 !== _b ? _b : "center",
30993
+ fontFamily: textSpec.fontFamily || defaultTextTheme.fontFamily || DEFAULT_TEXT_FONT_FAMILY,
30994
+ fontSize: textSpec.fontSize || defaultTextTheme.fontSize || 12,
30995
+ fontWeight: textSpec.fontWeight || defaultTextTheme.fontWeight,
30996
+ textAlign: textSpec.textAlign || "center",
30994
30997
  textBaseline: textSpec.textBaseline,
30995
30998
  ellipsis: !!textSpec.ellipsis,
30996
30999
  maxLineWidth: textSpec.maxLineWidth || 1 / 0,
30997
- lineHeight: textSpec.fontSize || 12
31000
+ lineHeight: textSpec.fontSize || defaultTextTheme.fontSize || 12
30998
31001
  });
30999
31002
  return {
31000
31003
  width: bounds.width(),
@@ -31029,7 +31032,7 @@
31029
31032
  super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, Tag.defaultAttributes, attributes)), this.name = "tag";
31030
31033
  }
31031
31034
  render() {
31032
- var _a, _b;
31035
+ var _a, _b, _c;
31033
31036
  const {
31034
31037
  text = "",
31035
31038
  textStyle = {},
@@ -31110,11 +31113,11 @@
31110
31113
  y: 0
31111
31114
  });
31112
31115
  isNil$3(textAttrs.lineHeight) && (textAttrs.lineHeight = textStyle.fontSize), textShape = group.createOrUpdateChild("tag-text", textAttrs, "text"), isEmpty(null == state ? void 0 : state.text) || (textShape.states = state.text);
31113
- const textBounds = measureTextSize(textAttrs.text, textStyle, null === (_a = this.stage) || void 0 === _a ? void 0 : _a.getTheme().text.fontFamily),
31116
+ const textBounds = measureTextSize(textAttrs.text, textStyle, null === (_b = null === (_a = this.stage) || void 0 === _a ? void 0 : _a.getTheme()) || void 0 === _b ? void 0 : _b.text),
31114
31117
  textWidth = textBounds.width,
31115
31118
  textHeight = textBounds.height;
31116
31119
  tagWidth += textWidth;
31117
- const size = null !== (_b = shape.size) && void 0 !== _b ? _b : 10,
31120
+ const size = null !== (_c = shape.size) && void 0 !== _c ? _c : 10,
31118
31121
  maxSize = isNumber$3(size) ? size : Math.max(size[0], size[1]);
31119
31122
  tagHeight += Math.max(textHeight, shape.visible ? maxSize : 0);
31120
31123
  const {
@@ -32408,7 +32411,9 @@
32408
32411
  state && !isEmpty(state) && (target.states = state);
32409
32412
  }
32410
32413
  _createLabelText(attributes) {
32411
- return isRichText(attributes, "textType") ? graphicCreator.richtext(richTextAttributeTransform(attributes)) : graphicCreator.text(attributes);
32414
+ var _a, _b;
32415
+ const textAttrs = Object.assign(Object.assign({}, null === (_b = null === (_a = this.stage) || void 0 === _a ? void 0 : _a.getTheme()) || void 0 === _b ? void 0 : _b.text), attributes);
32416
+ return isRichText(attributes, "textType") ? graphicCreator.richtext(richTextAttributeTransform(textAttrs)) : graphicCreator.text(textAttrs);
32412
32417
  }
32413
32418
  _prepare() {
32414
32419
  var _a, _b, _c, _d, _e;
@@ -34691,9 +34696,9 @@
34691
34696
  }
34692
34697
  getLabelAlign(vector, inside, angle) {
34693
34698
  const orient = this.attribute.orient;
34694
- if (isValidNumber$1(angle) || 0 === vector[0] && 0 === vector[1]) {
34695
- if ("top" === orient || "bottom" === orient) return getXAxisLabelAlign(orient, angle);
34696
- if ("left" === orient || "right" === orient) return getYAxisLabelAlign(orient, angle);
34699
+ if (["top", "bottom", "right", "left"].includes(orient) || 0 === vector[0] && 0 === vector[1]) {
34700
+ if ("top" === orient || "bottom" === orient) return getXAxisLabelAlign(inside ? "bottom" === orient ? "top" : "bottom" : orient, angle);
34701
+ if ("left" === orient || "right" === orient) return getYAxisLabelAlign(inside ? "left" === orient ? "right" : "left" : orient, angle);
34697
34702
  }
34698
34703
  return {
34699
34704
  textAlign: this.getTextAlign(vector),
@@ -34837,7 +34842,7 @@
34837
34842
  }
34838
34843
  }
34839
34844
  _getAxisLabelLimitLength(limitSize, layerCount) {
34840
- var _a, _b, _c, _d;
34845
+ var _a, _b, _c, _d, _e;
34841
34846
  const {
34842
34847
  label: label,
34843
34848
  title: title,
@@ -34851,7 +34856,7 @@
34851
34856
  const axisLineWidth = line && line.visible ? null !== (_b = line.style.lineWidth) && void 0 !== _b ? _b : 1 : 0,
34852
34857
  tickLength = tick && tick.visible ? null !== (_c = tick.length) && void 0 !== _c ? _c : 4 : 0;
34853
34858
  if (title && title.visible && "string" == typeof title.text) {
34854
- titleHeight = measureTextSize(title.text, title.textStyle, null === (_d = this.stage) || void 0 === _d ? void 0 : _d.getTheme().text.fontFamily).height;
34859
+ titleHeight = measureTextSize(title.text, title.textStyle, null === (_e = null === (_d = this.stage) || void 0 === _d ? void 0 : _d.getTheme()) || void 0 === _e ? void 0 : _e.text).height;
34855
34860
  const padding = normalizePadding$1(title.padding);
34856
34861
  titleSpacing = title.space + padding[0] + padding[2];
34857
34862
  }
@@ -37148,7 +37153,7 @@
37148
37153
  };
37149
37154
  }
37150
37155
  render() {
37151
- var _a, _b;
37156
+ var _a, _b, _c;
37152
37157
  this._reset();
37153
37158
  const {
37154
37159
  layout = "horizontal",
@@ -37190,7 +37195,7 @@
37190
37195
  } = measureTextSize(this._getPageText(total), Object.assign({
37191
37196
  textAlign: "center",
37192
37197
  textBaseline: "middle"
37193
- }, textStyle), null === (_b = this.stage) || void 0 === _b ? void 0 : _b.getTheme().text.fontFamily),
37198
+ }, textStyle), null === (_c = null === (_b = this.stage) || void 0 === _b ? void 0 : _b.getTheme()) || void 0 === _c ? void 0 : _c.text),
37194
37199
  handlerSizeX = isNumber$3(handlerSize) ? handlerSize : handlerSize[0],
37195
37200
  handlerSizeY = isNumber$3(handlerSize) ? handlerSize : handlerSize[1],
37196
37201
  text = graphicCreator.text(Object.assign({
@@ -37420,7 +37425,7 @@
37420
37425
  maxRow = 2,
37421
37426
  maxWidth: maxWidth,
37422
37427
  maxHeight: maxHeight,
37423
- defaultSelected = [],
37428
+ defaultSelected: defaultSelected,
37424
37429
  lazyload: lazyload,
37425
37430
  autoPage: autoPage
37426
37431
  } = this.attribute,
@@ -37446,7 +37451,9 @@
37446
37451
  } = this._itemContext;
37447
37452
  for (let index = startIndex, len = legendItems.length; index < len && !(lazyload && pages > this._itemContext.currentPage * maxPages); index++) {
37448
37453
  lazyload && (this._itemContext.startIndex = index + 1), item = legendItems[index], item.id || (item.id = item.label), item.index = index;
37449
- const itemGroup = this._renderEachItem(item, !!isEmpty(defaultSelected) || (null == defaultSelected ? void 0 : defaultSelected.includes(item.label)), index, legendItems),
37454
+ let isSelected = !0;
37455
+ isArray$3(defaultSelected) && (isSelected = defaultSelected.includes(item.label));
37456
+ const itemGroup = this._renderEachItem(item, isSelected, index, legendItems),
37450
37457
  itemWidth = itemGroup.attribute.width,
37451
37458
  itemHeight = itemGroup.attribute.height;
37452
37459
  this._itemHeight = Math.max(this._itemHeight, itemHeight), maxWidthInCol = Math.max(itemWidth, maxWidthInCol), this._itemMaxWidth = Math.max(itemWidth, this._itemMaxWidth), isHorizontal ? (isValid$3(maxWidth) && (isScrollbar && autoPage ? (pages = Math.ceil((startX + itemWidth) / maxWidth), doWrap = pages > 1) : startX + itemWidth > maxWidth && (doWrap = !0, startX > 0 && (pages += 1, startX = 0, startY += itemHeight + spaceRow))), 0 === startX && 0 === startY || itemGroup.setAttributes({
@@ -40152,12 +40159,12 @@
40152
40159
  group.setAttribute("y", size.height / 2 - totalHeight / 2), group.setAttribute("x", size.width / 2);
40153
40160
  }
40154
40161
  _setLocalAutoFit(limit, indicatorItem, indicatorItemSpec) {
40155
- var _a, _b, _c, _d, _e, _f, _g, _h;
40162
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
40156
40163
  if ("default" !== (null !== (_a = indicatorItemSpec.fitStrategy) && void 0 !== _a ? _a : "default")) return;
40157
- const originWidth = measureTextSize(null !== (_c = null === (_b = indicatorItemSpec.style) || void 0 === _b ? void 0 : _b.text) && void 0 !== _c ? _c : "", null !== (_d = indicatorItemSpec.style) && void 0 !== _d ? _d : {}, null === (_e = this.stage) || void 0 === _e ? void 0 : _e.getTheme().text.fontFamily).width;
40164
+ const originWidth = measureTextSize(null !== (_c = null === (_b = indicatorItemSpec.style) || void 0 === _b ? void 0 : _b.text) && void 0 !== _c ? _c : "", null !== (_d = indicatorItemSpec.style) && void 0 !== _d ? _d : {}, null === (_f = null === (_e = this.stage) || void 0 === _e ? void 0 : _e.getTheme()) || void 0 === _f ? void 0 : _f.text).width;
40158
40165
  if (originWidth > 0) {
40159
- const ratio = limit * (null !== (_f = indicatorItemSpec.fitPercent) && void 0 !== _f ? _f : .5) / originWidth,
40160
- fontSize = Math.floor((null !== (_h = null === (_g = indicatorItemSpec.style) || void 0 === _g ? void 0 : _g.fontSize) && void 0 !== _h ? _h : 20) * ratio);
40166
+ const ratio = limit * (null !== (_g = indicatorItemSpec.fitPercent) && void 0 !== _g ? _g : .5) / originWidth,
40167
+ fontSize = Math.floor((null !== (_j = null === (_h = indicatorItemSpec.style) || void 0 === _h ? void 0 : _h.fontSize) && void 0 !== _j ? _j : 20) * ratio);
40161
40168
  indicatorItem.setAttribute("fontSize", fontSize), indicatorItem.setAttribute("lineHeight", isValid$3(indicatorItemSpec.style.lineHeight) ? indicatorItemSpec.style.lineHeight : fontSize);
40162
40169
  }
40163
40170
  }
@@ -40284,13 +40291,13 @@
40284
40291
  }, this.renderForward = () => {
40285
40292
  this._forwardController.setAttributes(this._forwardAttr.style);
40286
40293
  }, this.play = () => {
40287
- this._dispatchEvent("ControllerEventEnum.OnPlay");
40294
+ this._dispatchEvent(ControllerEventEnum.OnPlay);
40288
40295
  }, this.pause = () => {
40289
- this._dispatchEvent("ControllerEventEnum.OnPause");
40296
+ this._dispatchEvent(ControllerEventEnum.OnPause);
40290
40297
  }, this.forward = () => {
40291
- this._dispatchEvent("ControllerEventEnum.OnForward");
40298
+ this._dispatchEvent(ControllerEventEnum.OnForward);
40292
40299
  }, this.backward = () => {
40293
- this._dispatchEvent("ControllerEventEnum.OnBackward");
40300
+ this._dispatchEvent(ControllerEventEnum.OnBackward);
40294
40301
  }, this.togglePlay = () => {
40295
40302
  this._playController.setAttributes(this._startAttr.style), this._isPaused = !0;
40296
40303
  }, this.togglePause = () => {
@@ -40411,15 +40418,15 @@
40411
40418
 
40412
40419
  class BasePlayer extends AbstractComponent {
40413
40420
  constructor(attributes, options) {
40414
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, BasePlayer.defaultAttributes, attributes)), this._data = [], this._layoutInfo = {}, this._updateSliderAttrs = () => {
40415
- var _a, _b, _c;
40421
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, BasePlayer.defaultAttributes, attributes)), this._data = [], this._dataIndex = 0, this._layoutInfo = {}, this._updateSliderAttrs = () => {
40422
+ var _a, _b;
40416
40423
  let handlerSize;
40417
40424
  isValidNumber$1(this._handlerStyle.size) ? handlerSize = this._handlerStyle.size : this._handlerStyle.size && this._handlerStyle.size.length && (handlerSize = max$1(this._handlerStyle.size[0], this._handlerStyle.size[1]));
40418
40425
  const attrs = {
40419
40426
  visible: this._sliderVisible,
40420
40427
  min: this._minIndex,
40421
40428
  max: this._maxIndex,
40422
- value: null !== (_a = this.attribute.dataIndex) && void 0 !== _a ? _a : 0,
40429
+ value: this._dataIndex,
40423
40430
  railWidth: this._railStyle.width,
40424
40431
  railHeight: this._railStyle.height,
40425
40432
  railStyle: this._railStyle,
@@ -40443,11 +40450,11 @@
40443
40450
  };
40444
40451
  if (isHorizontal$1(this._orient)) {
40445
40452
  const railWidth = Math.max(0, this._layoutInfo.slider.size),
40446
- railHeight = null !== (_b = this._railStyle.height) && void 0 !== _b ? _b : RailDefaultSize[1];
40453
+ railHeight = null !== (_a = this._railStyle.height) && void 0 !== _a ? _a : RailDefaultSize[1];
40447
40454
  attrs.layout = "horizontal", attrs.railHeight = railHeight, attrs.railWidth = railWidth, attrs.x = this._layoutInfo.slider.x, attrs.y = this._layoutInfo.slider.y;
40448
40455
  } else {
40449
40456
  const railHeight = Math.max(0, this._layoutInfo.slider.size),
40450
- railWidth = null !== (_c = this._railStyle.width) && void 0 !== _c ? _c : RailDefaultSize[1];
40457
+ railWidth = null !== (_b = this._railStyle.width) && void 0 !== _b ? _b : RailDefaultSize[1];
40451
40458
  attrs.layout = "vertical", attrs.railWidth = railWidth, attrs.railHeight = railHeight, attrs.x = this._layoutInfo.slider.x, attrs.y = this._layoutInfo.slider.y;
40452
40459
  }
40453
40460
  return attrs;
@@ -40506,7 +40513,7 @@
40506
40513
  }, this._initController = () => {
40507
40514
  const attrs = this._updateControllerAttrs();
40508
40515
  this._controller = new Controller(attrs), this._controllerVisible && this.add(this._controller);
40509
- }, this._initAttributes(), this._initLayoutInfo(), this._initController(), this._initSlider();
40516
+ }, this._initAttributes(), this._initDataIndex(), this._initLayoutInfo(), this._initController(), this._initSlider();
40510
40517
  }
40511
40518
  _initAttributes() {
40512
40519
  this._size = this.attribute.size, this._orient = this.attribute.orient, this._data = this.attribute.data, this._minIndex = 0, this._maxIndex = this._data.length - 1;
@@ -40516,6 +40523,10 @@
40516
40523
  } = this.attribute;
40517
40524
  this._sliderVisible = slider.visible, this._railStyle = Object.assign({}, slider.railStyle), this._trackStyle = Object.assign({}, slider.trackStyle), this._handlerStyle = Object.assign({}, slider.handlerStyle), this._controllerVisible = controller.visible, this._start = Object.assign({}, controller.start), this._pause = Object.assign({}, controller.pause), this._forward = Object.assign({}, controller.forward), this._backward = Object.assign({}, controller.backward);
40518
40525
  }
40526
+ _initDataIndex() {
40527
+ var _a;
40528
+ this._dataIndex = null !== (_a = this.attribute.dataIndex) && void 0 !== _a ? _a : 0;
40529
+ }
40519
40530
  _initLayoutInfo() {
40520
40531
  var _a, _b, _c;
40521
40532
  const controllers = [this._start, this._backward, this._forward].sort((a, b) => a.order - b.order),
@@ -40640,8 +40651,11 @@
40640
40651
  class DiscretePlayer extends BasePlayer {
40641
40652
  constructor(attributes, options) {
40642
40653
  super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, attributes)), this._activeIndex = -1, this._isReachEnd = !1, this._initAttributes = () => {
40643
- var _a, _b, _c, _d;
40644
- super._initAttributes(), this._alternate = null !== (_a = this.attribute.alternate) && void 0 !== _a && _a, this._interval = null !== (_b = this.attribute.interval) && void 0 !== _b ? _b : 1e3, this._direction = null !== (_c = this.attribute.direction) && void 0 !== _c ? _c : DirectionEnum.Default, this._dataIndex = isNil$3(this.attribute.dataIndex) ? "default" === this._direction ? this._minIndex : this._maxIndex : null !== (_d = this.attribute.dataIndex) && void 0 !== _d ? _d : 0, this._slider.setAttribute("value", this._dataIndex);
40654
+ var _a, _b, _c;
40655
+ super._initAttributes(), this._alternate = null !== (_a = this.attribute.alternate) && void 0 !== _a && _a, this._interval = null !== (_b = this.attribute.interval) && void 0 !== _b ? _b : 1e3, this._direction = null !== (_c = this.attribute.direction) && void 0 !== _c ? _c : DirectionEnum.Default;
40656
+ }, this._initDataIndex = () => {
40657
+ var _a;
40658
+ this._dataIndex = isNil$3(this.attribute.dataIndex) ? "default" === this._direction ? this._minIndex : this._maxIndex : null !== (_a = this.attribute.dataIndex) && void 0 !== _a ? _a : 0, this._slider.setAttribute("value", this._dataIndex);
40645
40659
  }, this._initEvents = () => {
40646
40660
  this.attribute.disableTriggerEvent || (this._controller.addEventListener(ControllerEventEnum.OnPlay, e => {
40647
40661
  e.stopPropagation(), this.play();
@@ -40683,7 +40697,7 @@
40683
40697
  }, this.forward = () => {
40684
40698
  const index = Math.min(this._dataIndex + 1, this._maxIndex);
40685
40699
  this._updateDataIndex(index), this.dispatchCustomEvent(PlayerEventEnum.change), this.dispatchCustomEvent(PlayerEventEnum.forward);
40686
- }, this._initAttributes(), this._initEvents();
40700
+ }, this._initAttributes(), this._initDataIndex(), this._initEvents();
40687
40701
  }
40688
40702
  setAttributes(params, forceUpdateTag) {
40689
40703
  super.setAttributes(params, forceUpdateTag), this._initAttributes();
@@ -40722,10 +40736,13 @@
40722
40736
  class ContinuousPlayer extends BasePlayer {
40723
40737
  constructor(attributes) {
40724
40738
  super(attributes), this._isPlaying = !1, this._startTime = Date.now(), this._initAttributes = () => {
40725
- var _a, _b;
40726
- super._initAttributes(), this._maxIndex = this._data.length, this._slider.setAttribute("max", this._maxIndex), this._isPlaying = !1, this._elapsed = 0, this._interval = null !== (_a = this.attribute.interval) && void 0 !== _a ? _a : 1e3, this._dataIndex = null !== (_b = this.attribute.dataIndex) && void 0 !== _b ? _b : this._minIndex;
40739
+ var _a;
40740
+ super._initAttributes(), this._maxIndex = this._data.length, this._slider.setAttribute("max", this._maxIndex), this._isPlaying = !1, this._elapsed = 0, this._interval = null !== (_a = this.attribute.interval) && void 0 !== _a ? _a : 1e3;
40727
40741
  const frames = this._data.length;
40728
40742
  this.attribute.totalDuration && this._data.length ? (this._totalDuration = this.attribute.totalDuration, this._interval = this._totalDuration / (null != frames ? frames : 1)) : (this._totalDuration = this._interval * frames, this._interval = this.attribute.interval);
40743
+ }, this._initDataIndex = () => {
40744
+ var _a;
40745
+ this._dataIndex = null !== (_a = this.attribute.dataIndex) && void 0 !== _a ? _a : this._minIndex;
40729
40746
  }, this._initEvents = () => {
40730
40747
  this.attribute.disableTriggerEvent || (this._controller.addEventListener(ControllerEventEnum.OnPlay, e => {
40731
40748
  e.stopPropagation(), this.play();
@@ -40771,7 +40788,7 @@
40771
40788
  interval = 1 * this._interval,
40772
40789
  elapsed = this._elapsed + interval;
40773
40790
  elapsed >= this._totalDuration ? (this._startTime = now - this._totalDuration, this._elapsed = this._totalDuration) : (this._startTime = this._startTime - interval, this._elapsed = elapsed), this._updateSlider(), this.dispatchCustomEvent(PlayerEventEnum.forward);
40774
- }, this._initAttributes(), this._initEvents();
40791
+ }, this._initAttributes(), this._initDataIndex(), this._initEvents();
40775
40792
  }
40776
40793
  dispatchCustomEvent(eventType) {
40777
40794
  super.dispatchCustomEvent(eventType, this._dataIndex);
@@ -41787,6 +41804,96 @@
41787
41804
  };
41788
41805
  }
41789
41806
 
41807
+ function isDataView(obj) {
41808
+ return obj instanceof DataView;
41809
+ }
41810
+ function isHTMLElement(obj) {
41811
+ try {
41812
+ return obj instanceof Element;
41813
+ } catch (_a) {
41814
+ const htmlElementKeys = ["children", "innerHTML", "classList", "setAttribute", "tagName", "getBoundingClientRect"],
41815
+ keys = Object.keys(obj);
41816
+ return htmlElementKeys.every(key => keys.includes(key));
41817
+ }
41818
+ }
41819
+
41820
+ function cloneDeepSpec(spec) {
41821
+ let excludeKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ["data"];
41822
+ const value = spec;
41823
+ let result;
41824
+ if (!isValid$3(value) || "object" != typeof value) return value;
41825
+ if (isDataView(value) || isHTMLElement(value)) return value;
41826
+ const isArr = isArray$3(value),
41827
+ length = value.length;
41828
+ result = isArr ? new Array(length) : "object" == typeof value ? {} : isBoolean$1(value) || isNumber$3(value) || isString$1(value) ? value : isDate$1(value) ? new Date(+value) : void 0;
41829
+ const props = isArr ? void 0 : Object.keys(Object(value));
41830
+ let index = -1;
41831
+ if (result) for (; ++index < (props || value).length;) {
41832
+ const key = props ? props[index] : index,
41833
+ subValue = value[key];
41834
+ (null == excludeKeys ? void 0 : excludeKeys.includes(key.toString())) ? result[key] = subValue : result[key] = cloneDeepSpec(subValue, excludeKeys);
41835
+ }
41836
+ return result;
41837
+ }
41838
+
41839
+ function baseMerge(target, source) {
41840
+ let shallowArray = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
41841
+ if (source) {
41842
+ if (target === source) return;
41843
+ if (isValid$3(source) && "object" == typeof source) {
41844
+ const iterable = Object(source),
41845
+ props = [];
41846
+ for (const key in iterable) props.push(key);
41847
+ let {
41848
+ length: length
41849
+ } = props,
41850
+ propIndex = -1;
41851
+ for (; length--;) {
41852
+ const key = props[++propIndex];
41853
+ isValid$3(iterable[key]) && "object" == typeof iterable[key] && !isArray$3(target[key]) ? baseMergeDeep(target, source, key, shallowArray) : assignMergeValue(target, key, iterable[key]);
41854
+ }
41855
+ }
41856
+ }
41857
+ }
41858
+ function baseMergeDeep(target, source, key) {
41859
+ let shallowArray = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
41860
+ const objValue = target[key],
41861
+ srcValue = source[key];
41862
+ let newValue = source[key],
41863
+ isCommon = !0;
41864
+ if (isArray$3(srcValue)) {
41865
+ if (shallowArray) newValue = [];else if (isArray$3(objValue)) newValue = objValue;else if (isArrayLike$1(objValue)) {
41866
+ newValue = new Array(objValue.length);
41867
+ let index = -1;
41868
+ const length = objValue.length;
41869
+ for (; ++index < length;) newValue[index] = objValue[index];
41870
+ }
41871
+ } else isPlainObject$1(srcValue) ? (newValue = null != objValue ? objValue : {}, "function" != typeof objValue && "object" == typeof objValue || (newValue = {})) : isCommon = !1;
41872
+ isCommon && baseMerge(newValue, srcValue, shallowArray), assignMergeValue(target, key, newValue);
41873
+ }
41874
+ function assignMergeValue(target, key, value) {
41875
+ (void 0 !== value && !eq(target[key], value) || void 0 === value && !(key in target)) && (target[key] = value);
41876
+ }
41877
+ function eq(value, other) {
41878
+ return value === other || Number.isNaN(value) && Number.isNaN(other);
41879
+ }
41880
+ function mergeSpec(target) {
41881
+ let sourceIndex = -1;
41882
+ const length = arguments.length <= 1 ? 0 : arguments.length - 1;
41883
+ for (; ++sourceIndex < length;) {
41884
+ baseMerge(target, sourceIndex + 1 < 1 || arguments.length <= sourceIndex + 1 ? undefined : arguments[sourceIndex + 1], !0);
41885
+ }
41886
+ return target;
41887
+ }
41888
+ function mergeSpecWithFilter(target, filter, spec, forceMerge) {
41889
+ Object.keys(target).forEach(k => {
41890
+ if (isObject$2(filter)) filter.type === k && (isArray$3(target[k]) ? target[k].length >= filter.index && (target[k][filter.index] = forceMerge ? mergeSpec({}, target[k][filter.index], spec) : spec) : target[k] = forceMerge ? mergeSpec({}, target[k], spec) : spec);else if (isArray$3(target[k])) {
41891
+ const index = target[k].findIndex(_s => _s.id === filter);
41892
+ index >= 0 && (target[k][index] = forceMerge ? mergeSpec({}, target[k][index], spec) : spec);
41893
+ } else target.id === filter && (target[k] = forceMerge ? mergeSpec({}, target[k], spec) : spec);
41894
+ });
41895
+ }
41896
+
41790
41897
  const isClose = isNumberClose;
41791
41898
  function polarToCartesian(point) {
41792
41899
  if (!point.radius) {
@@ -51112,609 +51219,6 @@
51112
51219
  return originNumValue;
51113
51220
  };
51114
51221
 
51115
- function convertBackgroundSpec(bg) {
51116
- if (!bg) {
51117
- return null;
51118
- }
51119
- if (typeof bg === 'string') {
51120
- return {
51121
- fill: bg,
51122
- fillOpacity: 1
51123
- };
51124
- }
51125
- if (typeof bg !== 'object') {
51126
- return null;
51127
- }
51128
- const result = pickWithout(bg, ['x', 'y', 'width', 'height', 'x1', 'y1', 'image']);
51129
- result.background = bg.image;
51130
- return result;
51131
- }
51132
-
51133
- function isDataView(obj) {
51134
- return obj instanceof DataView;
51135
- }
51136
- function isHTMLElement(obj) {
51137
- try {
51138
- return obj instanceof Element;
51139
- }
51140
- catch (_a) {
51141
- const htmlElementKeys = [
51142
- 'children',
51143
- 'innerHTML',
51144
- 'classList',
51145
- 'setAttribute',
51146
- 'tagName',
51147
- 'getBoundingClientRect'
51148
- ];
51149
- const keys = Object.keys(obj);
51150
- return htmlElementKeys.every(key => keys.includes(key));
51151
- }
51152
- }
51153
-
51154
- function cloneDeepSpec(spec, excludeKeys = ['data']) {
51155
- const value = spec;
51156
- let result;
51157
- if (!isValid$3(value) || typeof value !== 'object') {
51158
- return value;
51159
- }
51160
- if (isDataView(value) || isHTMLElement(value)) {
51161
- return value;
51162
- }
51163
- const isArr = isArray$3(value);
51164
- const length = value.length;
51165
- if (isArr) {
51166
- result = new Array(length);
51167
- }
51168
- else if (typeof value === 'object') {
51169
- result = {};
51170
- }
51171
- else if (isBoolean$1(value) || isNumber$3(value) || isString$1(value)) {
51172
- result = value;
51173
- }
51174
- else if (isDate$1(value)) {
51175
- result = new Date(+value);
51176
- }
51177
- else {
51178
- result = undefined;
51179
- }
51180
- const props = isArr ? undefined : Object.keys(Object(value));
51181
- let index = -1;
51182
- if (result) {
51183
- while (++index < (props || value).length) {
51184
- const key = props ? props[index] : index;
51185
- const subValue = value[key];
51186
- if (excludeKeys === null || excludeKeys === void 0 ? void 0 : excludeKeys.includes(key.toString())) {
51187
- result[key] = subValue;
51188
- }
51189
- else {
51190
- result[key] = cloneDeepSpec(subValue, excludeKeys);
51191
- }
51192
- }
51193
- }
51194
- return result;
51195
- }
51196
-
51197
- function baseMerge(target, source, shallowArray = false) {
51198
- if (source) {
51199
- if (target === source) {
51200
- return;
51201
- }
51202
- if (isValid$3(source) && typeof source === 'object') {
51203
- const iterable = Object(source);
51204
- const props = [];
51205
- for (const key in iterable) {
51206
- props.push(key);
51207
- }
51208
- let { length } = props;
51209
- let propIndex = -1;
51210
- while (length--) {
51211
- const key = props[++propIndex];
51212
- if (isValid$3(iterable[key]) &&
51213
- typeof iterable[key] === 'object' &&
51214
- !isArray$3(target[key])) {
51215
- baseMergeDeep(target, source, key, shallowArray);
51216
- }
51217
- else {
51218
- assignMergeValue(target, key, iterable[key]);
51219
- }
51220
- }
51221
- }
51222
- }
51223
- }
51224
- function baseMergeDeep(target, source, key, shallowArray = false) {
51225
- const objValue = target[key];
51226
- const srcValue = source[key];
51227
- let newValue = source[key];
51228
- let isCommon = true;
51229
- if (isArray$3(srcValue)) {
51230
- if (shallowArray) {
51231
- newValue = [];
51232
- }
51233
- else if (isArray$3(objValue)) {
51234
- newValue = objValue;
51235
- }
51236
- else if (isArrayLike$1(objValue)) {
51237
- newValue = new Array(objValue.length);
51238
- let index = -1;
51239
- const length = objValue.length;
51240
- while (++index < length) {
51241
- newValue[index] = objValue[index];
51242
- }
51243
- }
51244
- }
51245
- else if (isPlainObject$1(srcValue)) {
51246
- newValue = objValue !== null && objValue !== void 0 ? objValue : {};
51247
- if (typeof objValue === 'function' || typeof objValue !== 'object') {
51248
- newValue = {};
51249
- }
51250
- }
51251
- else {
51252
- isCommon = false;
51253
- }
51254
- if (isCommon) {
51255
- baseMerge(newValue, srcValue, shallowArray);
51256
- }
51257
- assignMergeValue(target, key, newValue);
51258
- }
51259
- function assignMergeValue(target, key, value) {
51260
- if ((value !== undefined && !eq(target[key], value)) || (value === undefined && !(key in target))) {
51261
- target[key] = value;
51262
- }
51263
- }
51264
- function eq(value, other) {
51265
- return value === other || (Number.isNaN(value) && Number.isNaN(other));
51266
- }
51267
- function mergeSpec(target, ...sources) {
51268
- let sourceIndex = -1;
51269
- const length = sources.length;
51270
- while (++sourceIndex < length) {
51271
- const source = sources[sourceIndex];
51272
- baseMerge(target, source, true);
51273
- }
51274
- return target;
51275
- }
51276
- function mergeSpecWithFilter(target, filter, spec, forceMerge) {
51277
- Object.keys(target).forEach(k => {
51278
- if (isObject$2(filter)) {
51279
- if (filter.type === k) {
51280
- if (isArray$3(target[k])) {
51281
- if (target[k].length >= filter.index) {
51282
- target[k][filter.index] = forceMerge ? mergeSpec({}, target[k][filter.index], spec) : spec;
51283
- }
51284
- }
51285
- else {
51286
- target[k] = forceMerge ? mergeSpec({}, target[k], spec) : spec;
51287
- }
51288
- }
51289
- }
51290
- else {
51291
- if (isArray$3(target[k])) {
51292
- const index = target[k].findIndex((_s) => _s.id === filter);
51293
- if (index >= 0) {
51294
- target[k][index] = forceMerge ? mergeSpec({}, target[k][index], spec) : spec;
51295
- }
51296
- }
51297
- else if (target.id === filter) {
51298
- target[k] = forceMerge ? mergeSpec({}, target[k], spec) : spec;
51299
- }
51300
- }
51301
- });
51302
- }
51303
-
51304
- function mergeTheme(target, ...sources) {
51305
- return mergeSpec(transformThemeToMerge(target), ...sources.map(transformThemeToMerge));
51306
- }
51307
- function transformThemeToMerge(theme) {
51308
- var _a;
51309
- if (!theme) {
51310
- return theme;
51311
- }
51312
- const colorScheme = transformColorSchemeToMerge(theme.colorScheme);
51313
- const { series } = theme;
51314
- const { mark: markByType, markByName } = theme;
51315
- let newSeriesTheme;
51316
- if (markByType || markByName) {
51317
- newSeriesTheme = Object.keys(seriesMarkInfoMap).reduce((newSeriesTheme, key) => {
51318
- var _a;
51319
- const value = (_a = series === null || series === void 0 ? void 0 : series[key]) !== null && _a !== void 0 ? _a : {};
51320
- newSeriesTheme[key] = transformSeriesThemeToMerge(value, key, markByType, markByName);
51321
- return newSeriesTheme;
51322
- }, {});
51323
- }
51324
- return Object.assign({}, theme, {
51325
- colorScheme,
51326
- token: (_a = theme.token) !== null && _a !== void 0 ? _a : {},
51327
- series: Object.assign({}, theme.series, newSeriesTheme)
51328
- });
51329
- }
51330
- function transformColorSchemeToMerge(colorScheme) {
51331
- if (colorScheme) {
51332
- colorScheme = Object.keys(colorScheme).reduce((scheme, key) => {
51333
- const value = colorScheme[key];
51334
- scheme[key] = transformColorSchemeToStandardStruct(value);
51335
- return scheme;
51336
- }, {});
51337
- }
51338
- return colorScheme;
51339
- }
51340
- function transformSeriesThemeToMerge(seriesTheme, seriesType, markByType, markByName) {
51341
- if (!seriesMarkInfoMap[seriesType]) {
51342
- return seriesTheme;
51343
- }
51344
- const newTheme = {};
51345
- Object.values(seriesMarkInfoMap[seriesType]).forEach(({ type, name }) => {
51346
- newTheme[name] = mergeSpec({}, markByType === null || markByType === void 0 ? void 0 : markByType[array(type)[0]], markByName === null || markByName === void 0 ? void 0 : markByName[name], seriesTheme === null || seriesTheme === void 0 ? void 0 : seriesTheme[name]);
51347
- });
51348
- return Object.assign(Object.assign({}, seriesTheme), newTheme);
51349
- }
51350
-
51351
- function queryToken(tokenMap, tokenKey) {
51352
- if (tokenMap && tokenKey.key in tokenMap) {
51353
- return tokenMap[tokenKey.key];
51354
- }
51355
- return tokenKey.default;
51356
- }
51357
- function isTokenKey(obj) {
51358
- return obj && obj.type === 'token' && !!obj.key;
51359
- }
51360
-
51361
- const token = {
51362
- fontFamily: 'PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol',
51363
- fontSize: 14,
51364
- l1FontSize: 32,
51365
- l1LineHeight: '150%',
51366
- l2FontSize: 20,
51367
- l2LineHeight: '140%',
51368
- l3FontSize: 16,
51369
- l3LineHeight: '150%',
51370
- l4FontSize: 14,
51371
- l4LineHeight: '150%',
51372
- l5FontSize: 12,
51373
- l5LineHeight: '130%',
51374
- l6FontSize: 10,
51375
- l6LineHeight: '120%'
51376
- };
51377
-
51378
- const IGNORE_KEYS = ['animationThreshold', 'colorScheme', 'name', 'padding'];
51379
- function preprocessTheme(obj, colorScheme, tokenMap, seriesSpec) {
51380
- if (!obj) {
51381
- return obj;
51382
- }
51383
- if (!colorScheme) {
51384
- colorScheme = obj.colorScheme;
51385
- }
51386
- if (!tokenMap) {
51387
- tokenMap = obj.token;
51388
- }
51389
- const newObj = {};
51390
- Object.keys(obj).forEach(key => {
51391
- const value = obj[key];
51392
- if (IGNORE_KEYS.includes(key)) {
51393
- newObj[key] = value;
51394
- }
51395
- else if (isPlainObject$1(value)) {
51396
- if (isColorKey(value)) {
51397
- newObj[key] = getActualColor(value, colorScheme, seriesSpec);
51398
- }
51399
- else if (isTokenKey(value)) {
51400
- newObj[key] = queryToken(tokenMap, value);
51401
- }
51402
- else {
51403
- newObj[key] = preprocessTheme(value, colorScheme, tokenMap, seriesSpec);
51404
- }
51405
- }
51406
- else {
51407
- newObj[key] = value;
51408
- }
51409
- });
51410
- return newObj;
51411
- }
51412
-
51413
- function specTransform(spec, special = {
51414
- data: v => v
51415
- }) {
51416
- if (!spec) {
51417
- return spec;
51418
- }
51419
- if (spec.constructor === Object) {
51420
- const result = {};
51421
- for (const key in spec) {
51422
- if (Object.prototype.hasOwnProperty.call(spec, key)) {
51423
- if (special[key]) {
51424
- result[key] = special[key](spec[key]);
51425
- continue;
51426
- }
51427
- result[key] = specTransform(spec[key], special);
51428
- }
51429
- }
51430
- return result;
51431
- }
51432
- if (isArray$3(spec)) {
51433
- return spec.map(s => specTransform(s, special));
51434
- }
51435
- return spec;
51436
- }
51437
- function functionTransform(spec, VChart) {
51438
- if (!spec) {
51439
- return spec;
51440
- }
51441
- if (isPlainObject$1(spec)) {
51442
- const result = {};
51443
- for (const key in spec) {
51444
- if (Object.prototype.hasOwnProperty.call(spec, key)) {
51445
- if (isString$1(spec[key]) && VChart.getFunction(spec[key])) {
51446
- result[key] = VChart.getFunction(spec[key]);
51447
- continue;
51448
- }
51449
- result[key] = functionTransform(spec[key], VChart);
51450
- }
51451
- }
51452
- return result;
51453
- }
51454
- if (isArray$3(spec)) {
51455
- return spec.map((s) => functionTransform(s, VChart));
51456
- }
51457
- return spec;
51458
- }
51459
-
51460
- const initTextMeasure = (textSpec, option, useNaiveCanvas) => {
51461
- return initTextMeasure$2(textSpec, option, useNaiveCanvas, {
51462
- fontFamily: token.fontFamily,
51463
- fontSize: token.fontSize
51464
- });
51465
- };
51466
- const measureText = (text, textSpec, option, useNaiveCanvas) => {
51467
- return initTextMeasure(textSpec, option, useNaiveCanvas).measure(text);
51468
- };
51469
-
51470
- function mergeFields(targetFields, mergeFields) {
51471
- for (let i = 0; i < mergeFields.length; i++) {
51472
- const element = mergeFields[i];
51473
- const _target = findFields(targetFields, element.key);
51474
- if (!_target) {
51475
- targetFields.push(element);
51476
- }
51477
- else {
51478
- _target.operations = [...new Set(_target.operations.concat(element.operations))];
51479
- }
51480
- }
51481
- return targetFields;
51482
- }
51483
- function findFields(list, fieldKey) {
51484
- return list.find(i => i.key === fieldKey);
51485
- }
51486
- function getFieldAlias(dataView, field) {
51487
- var _a;
51488
- if (!dataView) {
51489
- return field !== null && field !== void 0 ? field : null;
51490
- }
51491
- const fields = dataView.getFields();
51492
- if (!fields) {
51493
- return field !== null && field !== void 0 ? field : null;
51494
- }
51495
- if (!fields[field]) {
51496
- return field !== null && field !== void 0 ? field : null;
51497
- }
51498
- return (_a = fields[field].alias) !== null && _a !== void 0 ? _a : field;
51499
- }
51500
- function getRegionStackGroup(region, setInitialValue, filter) {
51501
- const stackValueGroup = {};
51502
- region.getSeries().forEach(s => {
51503
- var _a;
51504
- const stackData = s.getStackData();
51505
- const stackValue = s.getStackValue();
51506
- const stackValueField = s.getStackValueField();
51507
- const filterEnable = filter ? filter(s) : true;
51508
- if (stackData && stackValueField && filterEnable) {
51509
- stackValueGroup[stackValue] = (_a = stackValueGroup[stackValue]) !== null && _a !== void 0 ? _a : {
51510
- nodes: {}
51511
- };
51512
- stackGroup(s, stackData, stackValueGroup[stackValue], stackValueField, setInitialValue);
51513
- }
51514
- });
51515
- return stackValueGroup;
51516
- }
51517
- function stackTotal(stackData, valueField) {
51518
- if ('values' in stackData && stackData.values.length) {
51519
- const total = sum$1(stackData.values, valueField);
51520
- const percent = max(stackData.values, STACK_FIELD_END_PERCENT);
51521
- stackData.values.forEach(v => {
51522
- v[STACK_FIELD_TOTAL] = total;
51523
- v[STACK_FIELD_TOTAL_PERCENT] = percent;
51524
- delete v[STACK_FIELD_TOTAL_TOP];
51525
- });
51526
- const maxNode = stackData.values.reduce((max, current) => {
51527
- return current[STACK_FIELD_END] > max[STACK_FIELD_END] ? current : max;
51528
- });
51529
- maxNode[STACK_FIELD_TOTAL_TOP] = true;
51530
- return;
51531
- }
51532
- for (const key in stackData.nodes) {
51533
- stackTotal(stackData.nodes[key], valueField);
51534
- }
51535
- }
51536
- function stackOffsetSilhouette(stackCache) {
51537
- if (!stackCache.values.length) {
51538
- return;
51539
- }
51540
- const centerValue = stackCache.values[stackCache.values.length - 1][STACK_FIELD_END] / 2;
51541
- for (let j = 0; j < stackCache.values.length; j++) {
51542
- stackCache.values[j][STACK_FIELD_START_OffsetSilhouette] = stackCache.values[j][STACK_FIELD_START] - centerValue;
51543
- stackCache.values[j][STACK_FIELD_END_OffsetSilhouette] = stackCache.values[j][STACK_FIELD_END] - centerValue;
51544
- }
51545
- }
51546
- function stack(stackCache, stackInverse, hasPercent) {
51547
- if (stackCache.values.length > 0) {
51548
- let positiveStart = 0;
51549
- let negativeStart = 0;
51550
- let sign = 1;
51551
- let value = 0;
51552
- const maxLength = stackCache.values.length;
51553
- for (let index = 0; index < maxLength; index++) {
51554
- const v = stackCache.values[stackInverse ? maxLength - 1 - index : index];
51555
- value = v[STACK_FIELD_END];
51556
- if (value >= 0) {
51557
- v[STACK_FIELD_START] = positiveStart;
51558
- positiveStart += v[STACK_FIELD_END];
51559
- v[STACK_FIELD_END] = positiveStart;
51560
- }
51561
- else {
51562
- v[STACK_FIELD_START] = negativeStart;
51563
- negativeStart += v[STACK_FIELD_END];
51564
- v[STACK_FIELD_END] = negativeStart;
51565
- }
51566
- v[STACK_FIELD_KEY] = stackCache.key;
51567
- }
51568
- if (hasPercent) {
51569
- for (let index = 0; index < maxLength; index++) {
51570
- const v = stackCache.values[stackInverse ? maxLength - 1 - index : index];
51571
- value = v[STACK_FIELD_END];
51572
- const denominator = value >= 0 ? positiveStart : negativeStart;
51573
- sign = value >= 0 ? 1 : -1;
51574
- v[STACK_FIELD_START_PERCENT] = denominator === 0 ? 0 : Math.min(1, v[STACK_FIELD_START] / denominator) * sign;
51575
- v[STACK_FIELD_END_PERCENT] = denominator === 0 ? 0 : Math.min(1, v[STACK_FIELD_END] / denominator) * sign;
51576
- }
51577
- }
51578
- }
51579
- for (const key in stackCache.nodes) {
51580
- stack(stackCache.nodes[key], stackInverse, hasPercent);
51581
- }
51582
- }
51583
- function stackGroup(s, stackData, stackCache, valueField, setInitialValue, stackKey) {
51584
- if ('values' in stackData) {
51585
- setInitialValue && stackData.values.forEach(v => (v[STACK_FIELD_END] = toValidNumber(v[valueField])));
51586
- stackCache.values.push(...stackData.values);
51587
- stackCache.series.push({ s: s, values: stackData.values });
51588
- return;
51589
- }
51590
- for (const key in stackData.nodes) {
51591
- const newStackKey = stackKey ? `${stackKey}_${key}` : key;
51592
- !stackCache.nodes[key] &&
51593
- (stackCache.nodes[key] = {
51594
- values: [],
51595
- series: [],
51596
- nodes: {},
51597
- key: newStackKey
51598
- });
51599
- stackGroup(s, stackData.nodes[key], stackCache.nodes[key], valueField, setInitialValue, newStackKey);
51600
- }
51601
- }
51602
-
51603
- const findHierarchyNode = (hierarchyData, key, keyField = 'key', childrenField = 'children') => {
51604
- for (let i = 0; i < hierarchyData.length; i++) {
51605
- const node = hierarchyData[i];
51606
- if (node[keyField] === key) {
51607
- return node;
51608
- }
51609
- if (node[childrenField]) {
51610
- const result = findHierarchyNode(node[childrenField], key, keyField, childrenField);
51611
- if (result) {
51612
- return result;
51613
- }
51614
- }
51615
- }
51616
- return null;
51617
- };
51618
- const findHierarchyNodeParent = (hierarchyData, key, keyField = 'key', childrenField = 'children') => {
51619
- for (let i = 0; i < hierarchyData.length; i++) {
51620
- const node = hierarchyData[i];
51621
- if (node[childrenField]) {
51622
- for (let j = 0; j < node[childrenField].length; j++) {
51623
- const childNode = node[childrenField][j];
51624
- if (childNode[keyField] === key) {
51625
- return node;
51626
- }
51627
- const result = findHierarchyNodeParent([childNode], key, keyField, childrenField);
51628
- if (result) {
51629
- return result;
51630
- }
51631
- }
51632
- }
51633
- }
51634
- return null;
51635
- };
51636
- const findHierarchyPath = (hierarchyData, key, keyField = 'key', childrenField = 'children') => {
51637
- const result = [];
51638
- const dfs = (data, path) => {
51639
- for (const item of data) {
51640
- if (item[keyField] === key) {
51641
- result.push(...path, item[keyField].toString());
51642
- return true;
51643
- }
51644
- if (item[childrenField]) {
51645
- const res = dfs(item[childrenField], [...path, item[keyField]]);
51646
- if (res === true) {
51647
- return res;
51648
- }
51649
- }
51650
- }
51651
- return false;
51652
- };
51653
- dfs(hierarchyData, []);
51654
- return result;
51655
- };
51656
-
51657
- function transformComponentStyle(cfg = {}) {
51658
- const newConfig = Object.assign({}, cfg);
51659
- if (isFunction$1(cfg.style)) {
51660
- newConfig.style = (item, isSelected, index, allItems) => transformToGraphic(cfg.style(item, isSelected, index, allItems));
51661
- }
51662
- else if (!isEmpty(cfg.style)) {
51663
- newConfig.style = transformToGraphic(cfg.style);
51664
- }
51665
- if (!isEmpty(cfg.state)) {
51666
- const newStateStyle = {};
51667
- Object.keys(cfg.state).forEach(key => {
51668
- if (isFunction$1(cfg.state[key])) {
51669
- newStateStyle[key] = (item, isSelected, index, allItems) => transformToGraphic(cfg.state[key](item, isSelected, index, allItems));
51670
- }
51671
- else if (!isEmpty(cfg.state[key])) {
51672
- newStateStyle[key] = transformToGraphic(cfg.state[key]);
51673
- }
51674
- });
51675
- newConfig.state = newStateStyle;
51676
- }
51677
- return newConfig;
51678
- }
51679
- function transformStateStyle(stateStyle) {
51680
- if (isEmpty(stateStyle)) {
51681
- return null;
51682
- }
51683
- const newStateStyle = {};
51684
- Object.keys(stateStyle).forEach(key => {
51685
- if (isFunction$1(stateStyle[key])) {
51686
- newStateStyle[key] = (value, index, datum, data) => transformToGraphic(stateStyle[key](value, index, datum, data));
51687
- }
51688
- else if (!isEmpty(stateStyle[key])) {
51689
- newStateStyle[key] = transformToGraphic(stateStyle[key]);
51690
- }
51691
- });
51692
- return newStateStyle;
51693
- }
51694
- function transformAxisLabelStateStyle(stateStyle) {
51695
- if (isEmpty(stateStyle)) {
51696
- return null;
51697
- }
51698
- const newStateStyle = {};
51699
- Object.keys(stateStyle).forEach(key => {
51700
- if (isFunction$1(stateStyle[key])) {
51701
- newStateStyle[key] = (datum, index, data, layer) => {
51702
- return transformToGraphic(stateStyle[key](datum.rawValue, index, datum, data, layer));
51703
- };
51704
- }
51705
- else if (!isEmpty(stateStyle[key])) {
51706
- newStateStyle[key] = transformToGraphic(stateStyle[key]);
51707
- }
51708
- });
51709
- return newStateStyle;
51710
- }
51711
- function transformToGraphic(style) {
51712
- if (style === null || style === void 0 ? void 0 : style.angle) {
51713
- style.angle = degreeToRadian(style.angle);
51714
- }
51715
- return style;
51716
- }
51717
-
51718
51222
  const dataScheme = [
51719
51223
  {
51720
51224
  maxDomainLength: 10,
@@ -53424,6 +52928,33 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
53424
52928
  scrollBar
53425
52929
  };
53426
52930
 
52931
+ function queryToken(tokenMap, tokenKey) {
52932
+ if (tokenMap && tokenKey.key in tokenMap) {
52933
+ return tokenMap[tokenKey.key];
52934
+ }
52935
+ return tokenKey.default;
52936
+ }
52937
+ function isTokenKey(obj) {
52938
+ return obj && obj.type === 'token' && !!obj.key;
52939
+ }
52940
+
52941
+ const token = {
52942
+ fontFamily: 'PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol',
52943
+ fontSize: 14,
52944
+ l1FontSize: 32,
52945
+ l1LineHeight: '150%',
52946
+ l2FontSize: 20,
52947
+ l2LineHeight: '140%',
52948
+ l3FontSize: 16,
52949
+ l3LineHeight: '150%',
52950
+ l4FontSize: 14,
52951
+ l4LineHeight: '150%',
52952
+ l5FontSize: 12,
52953
+ l5LineHeight: '130%',
52954
+ l6FontSize: 10,
52955
+ l6LineHeight: '120%'
52956
+ };
52957
+
53427
52958
  const lightTheme = {
53428
52959
  name: 'light',
53429
52960
  background: { type: 'palette', key: 'backgroundColor' },
@@ -53490,6 +53021,88 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
53490
53021
  }
53491
53022
  };
53492
53023
 
53024
+ function mergeTheme(target, ...sources) {
53025
+ return mergeSpec(transformThemeToMerge(target), ...sources.map(transformThemeToMerge));
53026
+ }
53027
+ function transformThemeToMerge(theme) {
53028
+ var _a;
53029
+ if (!theme) {
53030
+ return theme;
53031
+ }
53032
+ const colorScheme = transformColorSchemeToMerge(theme.colorScheme);
53033
+ const { series } = theme;
53034
+ const { mark: markByType, markByName } = theme;
53035
+ let newSeriesTheme;
53036
+ if (markByType || markByName) {
53037
+ newSeriesTheme = Object.keys(seriesMarkInfoMap).reduce((newSeriesTheme, key) => {
53038
+ var _a;
53039
+ const value = (_a = series === null || series === void 0 ? void 0 : series[key]) !== null && _a !== void 0 ? _a : {};
53040
+ newSeriesTheme[key] = transformSeriesThemeToMerge(value, key, markByType, markByName);
53041
+ return newSeriesTheme;
53042
+ }, {});
53043
+ }
53044
+ return Object.assign({}, theme, {
53045
+ colorScheme,
53046
+ token: (_a = theme.token) !== null && _a !== void 0 ? _a : {},
53047
+ series: Object.assign({}, theme.series, newSeriesTheme)
53048
+ });
53049
+ }
53050
+ function transformColorSchemeToMerge(colorScheme) {
53051
+ if (colorScheme) {
53052
+ colorScheme = Object.keys(colorScheme).reduce((scheme, key) => {
53053
+ const value = colorScheme[key];
53054
+ scheme[key] = transformColorSchemeToStandardStruct(value);
53055
+ return scheme;
53056
+ }, {});
53057
+ }
53058
+ return colorScheme;
53059
+ }
53060
+ function transformSeriesThemeToMerge(seriesTheme, seriesType, markByType, markByName) {
53061
+ if (!seriesMarkInfoMap[seriesType]) {
53062
+ return seriesTheme;
53063
+ }
53064
+ const newTheme = {};
53065
+ Object.values(seriesMarkInfoMap[seriesType]).forEach(({ type, name }) => {
53066
+ newTheme[name] = mergeSpec({}, markByType === null || markByType === void 0 ? void 0 : markByType[array(type)[0]], markByName === null || markByName === void 0 ? void 0 : markByName[name], seriesTheme === null || seriesTheme === void 0 ? void 0 : seriesTheme[name]);
53067
+ });
53068
+ return Object.assign(Object.assign({}, seriesTheme), newTheme);
53069
+ }
53070
+
53071
+ const IGNORE_KEYS = ['animationThreshold', 'colorScheme', 'name', 'padding'];
53072
+ function preprocessTheme(obj, colorScheme, tokenMap, seriesSpec) {
53073
+ if (!obj) {
53074
+ return obj;
53075
+ }
53076
+ if (!colorScheme) {
53077
+ colorScheme = obj.colorScheme;
53078
+ }
53079
+ if (!tokenMap) {
53080
+ tokenMap = obj.token;
53081
+ }
53082
+ const newObj = {};
53083
+ Object.keys(obj).forEach(key => {
53084
+ const value = obj[key];
53085
+ if (IGNORE_KEYS.includes(key)) {
53086
+ newObj[key] = value;
53087
+ }
53088
+ else if (isPlainObject$1(value)) {
53089
+ if (isColorKey(value)) {
53090
+ newObj[key] = getActualColor(value, colorScheme, seriesSpec);
53091
+ }
53092
+ else if (isTokenKey(value)) {
53093
+ newObj[key] = queryToken(tokenMap, value);
53094
+ }
53095
+ else {
53096
+ newObj[key] = preprocessTheme(value, colorScheme, tokenMap, seriesSpec);
53097
+ }
53098
+ }
53099
+ else {
53100
+ newObj[key] = value;
53101
+ }
53102
+ });
53103
+ return newObj;
53104
+ }
53105
+
53493
53106
  const builtinThemes = {
53494
53107
  [lightTheme.name]: lightTheme
53495
53108
  };
@@ -53602,6 +53215,379 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
53602
53215
  return {};
53603
53216
  }
53604
53217
 
53218
+ function convertBackgroundSpec(bg) {
53219
+ if (!bg) {
53220
+ return null;
53221
+ }
53222
+ if (typeof bg === 'string') {
53223
+ return {
53224
+ fill: bg,
53225
+ fillOpacity: 1
53226
+ };
53227
+ }
53228
+ if (typeof bg !== 'object') {
53229
+ return null;
53230
+ }
53231
+ const result = pickWithout(bg, ['x', 'y', 'width', 'height', 'x1', 'y1', 'image']);
53232
+ result.background = bg.image;
53233
+ return result;
53234
+ }
53235
+
53236
+ function specTransform(spec, special = {
53237
+ data: v => v
53238
+ }) {
53239
+ if (!spec) {
53240
+ return spec;
53241
+ }
53242
+ if (spec.constructor === Object) {
53243
+ const result = {};
53244
+ for (const key in spec) {
53245
+ if (Object.prototype.hasOwnProperty.call(spec, key)) {
53246
+ if (special[key]) {
53247
+ result[key] = special[key](spec[key]);
53248
+ continue;
53249
+ }
53250
+ result[key] = specTransform(spec[key], special);
53251
+ }
53252
+ }
53253
+ return result;
53254
+ }
53255
+ if (isArray$3(spec)) {
53256
+ return spec.map(s => specTransform(s, special));
53257
+ }
53258
+ return spec;
53259
+ }
53260
+ function functionTransform(spec, VChart) {
53261
+ if (!spec) {
53262
+ return spec;
53263
+ }
53264
+ if (isPlainObject$1(spec)) {
53265
+ const result = {};
53266
+ for (const key in spec) {
53267
+ if (Object.prototype.hasOwnProperty.call(spec, key)) {
53268
+ if (isString$1(spec[key]) && VChart.getFunction(spec[key])) {
53269
+ result[key] = VChart.getFunction(spec[key]);
53270
+ continue;
53271
+ }
53272
+ result[key] = functionTransform(spec[key], VChart);
53273
+ }
53274
+ }
53275
+ return result;
53276
+ }
53277
+ if (isArray$3(spec)) {
53278
+ return spec.map((s) => functionTransform(s, VChart));
53279
+ }
53280
+ return spec;
53281
+ }
53282
+
53283
+ const initTextMeasure = (textSpec, option, useNaiveCanvas) => {
53284
+ return initTextMeasure$2(textSpec, option, useNaiveCanvas, {
53285
+ fontFamily: token.fontFamily,
53286
+ fontSize: token.fontSize
53287
+ });
53288
+ };
53289
+ const measureText = (text, textSpec, option, useNaiveCanvas) => {
53290
+ return initTextMeasure(textSpec, option, useNaiveCanvas).measure(text);
53291
+ };
53292
+
53293
+ function mergeFields(targetFields, mergeFields) {
53294
+ for (let i = 0; i < mergeFields.length; i++) {
53295
+ const element = mergeFields[i];
53296
+ const _target = findFields(targetFields, element.key);
53297
+ if (!_target) {
53298
+ targetFields.push(element);
53299
+ }
53300
+ else {
53301
+ _target.operations = [...new Set(_target.operations.concat(element.operations))];
53302
+ }
53303
+ }
53304
+ return targetFields;
53305
+ }
53306
+ function findFields(list, fieldKey) {
53307
+ return list.find(i => i.key === fieldKey);
53308
+ }
53309
+ function getFieldAlias(dataView, field) {
53310
+ var _a;
53311
+ if (!dataView) {
53312
+ return field !== null && field !== void 0 ? field : null;
53313
+ }
53314
+ const fields = dataView.getFields();
53315
+ if (!fields) {
53316
+ return field !== null && field !== void 0 ? field : null;
53317
+ }
53318
+ if (!fields[field]) {
53319
+ return field !== null && field !== void 0 ? field : null;
53320
+ }
53321
+ return (_a = fields[field].alias) !== null && _a !== void 0 ? _a : field;
53322
+ }
53323
+ function getRegionStackGroup(region, setInitialValue, filter) {
53324
+ const stackSort = region.getStackSort();
53325
+ const stackValueGroup = {};
53326
+ let stackSortCache = null;
53327
+ if (stackSort) {
53328
+ stackSortCache = {};
53329
+ region.getSeries().forEach(s => {
53330
+ const seriesField = s.getSeriesField();
53331
+ if (seriesField) {
53332
+ const fieldInfo = s.getRawDataStatisticsByField(seriesField);
53333
+ if (fieldInfo.values) {
53334
+ if (!stackSortCache[seriesField]) {
53335
+ stackSortCache[seriesField] = { lastIndex: 0, sort: {} };
53336
+ }
53337
+ fieldInfo.values.forEach((v, i) => {
53338
+ if (!(v in stackSortCache[seriesField].sort)) {
53339
+ stackSortCache[seriesField].sort[v] = stackSortCache[seriesField].lastIndex;
53340
+ stackSortCache[seriesField].lastIndex++;
53341
+ }
53342
+ });
53343
+ }
53344
+ }
53345
+ });
53346
+ }
53347
+ region.getSeries().forEach(s => {
53348
+ var _a;
53349
+ const stackData = s.getStackData();
53350
+ const stackValue = s.getStackValue();
53351
+ const stackValueField = s.getStackValueField();
53352
+ const filterEnable = filter ? filter(s) : true;
53353
+ if (stackData && stackValueField && filterEnable) {
53354
+ stackValueGroup[stackValue] = (_a = stackValueGroup[stackValue]) !== null && _a !== void 0 ? _a : {
53355
+ nodes: {}
53356
+ };
53357
+ stackGroup(s, stackData, stackValueGroup[stackValue], stackValueField, setInitialValue, stackSortCache);
53358
+ }
53359
+ });
53360
+ return stackSort
53361
+ ? sortStackValueGroup(stackValueGroup)
53362
+ : stackValueGroup;
53363
+ }
53364
+ function sortStackValueGroup(stackValueGroup, stackSortCache) {
53365
+ var _a;
53366
+ for (const key in stackValueGroup) {
53367
+ if ((_a = stackValueGroup[key].sortDatums) === null || _a === void 0 ? void 0 : _a.length) {
53368
+ stackValueGroup[key].sortDatums.sort((a, b) => a.index - b.index);
53369
+ stackValueGroup[key].values = stackValueGroup[key].sortDatums.map(sd => sd.datum);
53370
+ }
53371
+ else {
53372
+ sortStackValueGroup(stackValueGroup[key].nodes);
53373
+ }
53374
+ }
53375
+ return stackValueGroup;
53376
+ }
53377
+ function stackTotal(stackData, valueField) {
53378
+ if ('values' in stackData && stackData.values.length) {
53379
+ const total = sum$1(stackData.values, valueField);
53380
+ const percent = max(stackData.values, STACK_FIELD_END_PERCENT);
53381
+ stackData.values.forEach(v => {
53382
+ v[STACK_FIELD_TOTAL] = total;
53383
+ v[STACK_FIELD_TOTAL_PERCENT] = percent;
53384
+ delete v[STACK_FIELD_TOTAL_TOP];
53385
+ });
53386
+ const maxNode = stackData.values.reduce((max, current) => {
53387
+ return current[STACK_FIELD_END] > max[STACK_FIELD_END] ? current : max;
53388
+ });
53389
+ maxNode[STACK_FIELD_TOTAL_TOP] = true;
53390
+ return;
53391
+ }
53392
+ for (const key in stackData.nodes) {
53393
+ stackTotal(stackData.nodes[key], valueField);
53394
+ }
53395
+ }
53396
+ function stackOffsetSilhouette(stackCache) {
53397
+ if (!stackCache.values.length) {
53398
+ return;
53399
+ }
53400
+ const centerValue = stackCache.values[stackCache.values.length - 1][STACK_FIELD_END] / 2;
53401
+ for (let j = 0; j < stackCache.values.length; j++) {
53402
+ stackCache.values[j][STACK_FIELD_START_OffsetSilhouette] = stackCache.values[j][STACK_FIELD_START] - centerValue;
53403
+ stackCache.values[j][STACK_FIELD_END_OffsetSilhouette] = stackCache.values[j][STACK_FIELD_END] - centerValue;
53404
+ }
53405
+ }
53406
+ function stack(stackCache, stackInverse, hasPercent) {
53407
+ if (stackCache.values.length > 0) {
53408
+ let positiveStart = 0;
53409
+ let negativeStart = 0;
53410
+ let sign = 1;
53411
+ let value = 0;
53412
+ const maxLength = stackCache.values.length;
53413
+ for (let index = 0; index < maxLength; index++) {
53414
+ const v = stackCache.values[stackInverse ? maxLength - 1 - index : index];
53415
+ value = v[STACK_FIELD_END];
53416
+ if (value >= 0) {
53417
+ v[STACK_FIELD_START] = positiveStart;
53418
+ positiveStart += v[STACK_FIELD_END];
53419
+ v[STACK_FIELD_END] = positiveStart;
53420
+ }
53421
+ else {
53422
+ v[STACK_FIELD_START] = negativeStart;
53423
+ negativeStart += v[STACK_FIELD_END];
53424
+ v[STACK_FIELD_END] = negativeStart;
53425
+ }
53426
+ v[STACK_FIELD_KEY] = stackCache.key;
53427
+ }
53428
+ if (hasPercent) {
53429
+ for (let index = 0; index < maxLength; index++) {
53430
+ const v = stackCache.values[stackInverse ? maxLength - 1 - index : index];
53431
+ value = v[STACK_FIELD_END];
53432
+ const denominator = value >= 0 ? positiveStart : negativeStart;
53433
+ sign = value >= 0 ? 1 : -1;
53434
+ v[STACK_FIELD_START_PERCENT] = denominator === 0 ? 0 : Math.min(1, v[STACK_FIELD_START] / denominator) * sign;
53435
+ v[STACK_FIELD_END_PERCENT] = denominator === 0 ? 0 : Math.min(1, v[STACK_FIELD_END] / denominator) * sign;
53436
+ }
53437
+ }
53438
+ }
53439
+ for (const key in stackCache.nodes) {
53440
+ stack(stackCache.nodes[key], stackInverse, hasPercent);
53441
+ }
53442
+ }
53443
+ function stackGroup(s, stackData, stackCache, valueField, setInitialValue, stackSortCache, stackKey) {
53444
+ if ('values' in stackData) {
53445
+ setInitialValue && stackData.values.forEach(v => (v[STACK_FIELD_END] = toValidNumber(v[valueField])));
53446
+ stackCache.series.push({ s: s, values: stackData.values });
53447
+ if (stackSortCache) {
53448
+ const seriesField = s.getSeriesField();
53449
+ stackData.values.forEach(d => {
53450
+ stackCache.sortDatums.push({
53451
+ series: s,
53452
+ datum: d,
53453
+ index: seriesField ? stackSortCache[seriesField].sort[d[seriesField]] : 0
53454
+ });
53455
+ });
53456
+ }
53457
+ else {
53458
+ stackCache.values.push(...stackData.values);
53459
+ }
53460
+ return;
53461
+ }
53462
+ for (const key in stackData.nodes) {
53463
+ const newStackKey = stackKey ? `${stackKey}_${key}` : key;
53464
+ !stackCache.nodes[key] &&
53465
+ (stackCache.nodes[key] = {
53466
+ values: [],
53467
+ series: [],
53468
+ nodes: {},
53469
+ sortDatums: [],
53470
+ key: newStackKey
53471
+ });
53472
+ stackGroup(s, stackData.nodes[key], stackCache.nodes[key], valueField, setInitialValue, stackSortCache, newStackKey);
53473
+ }
53474
+ }
53475
+
53476
+ const findHierarchyNode = (hierarchyData, key, keyField = 'key', childrenField = 'children') => {
53477
+ for (let i = 0; i < hierarchyData.length; i++) {
53478
+ const node = hierarchyData[i];
53479
+ if (node[keyField] === key) {
53480
+ return node;
53481
+ }
53482
+ if (node[childrenField]) {
53483
+ const result = findHierarchyNode(node[childrenField], key, keyField, childrenField);
53484
+ if (result) {
53485
+ return result;
53486
+ }
53487
+ }
53488
+ }
53489
+ return null;
53490
+ };
53491
+ const findHierarchyNodeParent = (hierarchyData, key, keyField = 'key', childrenField = 'children') => {
53492
+ for (let i = 0; i < hierarchyData.length; i++) {
53493
+ const node = hierarchyData[i];
53494
+ if (node[childrenField]) {
53495
+ for (let j = 0; j < node[childrenField].length; j++) {
53496
+ const childNode = node[childrenField][j];
53497
+ if (childNode[keyField] === key) {
53498
+ return node;
53499
+ }
53500
+ const result = findHierarchyNodeParent([childNode], key, keyField, childrenField);
53501
+ if (result) {
53502
+ return result;
53503
+ }
53504
+ }
53505
+ }
53506
+ }
53507
+ return null;
53508
+ };
53509
+ const findHierarchyPath = (hierarchyData, key, keyField = 'key', childrenField = 'children') => {
53510
+ const result = [];
53511
+ const dfs = (data, path) => {
53512
+ for (const item of data) {
53513
+ if (item[keyField] === key) {
53514
+ result.push(...path, item[keyField].toString());
53515
+ return true;
53516
+ }
53517
+ if (item[childrenField]) {
53518
+ const res = dfs(item[childrenField], [...path, item[keyField]]);
53519
+ if (res === true) {
53520
+ return res;
53521
+ }
53522
+ }
53523
+ }
53524
+ return false;
53525
+ };
53526
+ dfs(hierarchyData, []);
53527
+ return result;
53528
+ };
53529
+
53530
+ function transformComponentStyle(cfg = {}) {
53531
+ const newConfig = Object.assign({}, cfg);
53532
+ if (isFunction$1(cfg.style)) {
53533
+ newConfig.style = (item, isSelected, index, allItems) => transformToGraphic(cfg.style(item, isSelected, index, allItems));
53534
+ }
53535
+ else if (!isEmpty(cfg.style)) {
53536
+ newConfig.style = transformToGraphic(cfg.style);
53537
+ }
53538
+ if (!isEmpty(cfg.state)) {
53539
+ const newStateStyle = {};
53540
+ Object.keys(cfg.state).forEach(key => {
53541
+ if (isFunction$1(cfg.state[key])) {
53542
+ newStateStyle[key] = (item, isSelected, index, allItems) => transformToGraphic(cfg.state[key](item, isSelected, index, allItems));
53543
+ }
53544
+ else if (!isEmpty(cfg.state[key])) {
53545
+ newStateStyle[key] = transformToGraphic(cfg.state[key]);
53546
+ }
53547
+ });
53548
+ newConfig.state = newStateStyle;
53549
+ }
53550
+ return newConfig;
53551
+ }
53552
+ function transformStateStyle(stateStyle) {
53553
+ if (isEmpty(stateStyle)) {
53554
+ return null;
53555
+ }
53556
+ const newStateStyle = {};
53557
+ Object.keys(stateStyle).forEach(key => {
53558
+ if (isFunction$1(stateStyle[key])) {
53559
+ newStateStyle[key] = (value, index, datum, data) => transformToGraphic(stateStyle[key](value, index, datum, data));
53560
+ }
53561
+ else if (!isEmpty(stateStyle[key])) {
53562
+ newStateStyle[key] = transformToGraphic(stateStyle[key]);
53563
+ }
53564
+ });
53565
+ return newStateStyle;
53566
+ }
53567
+ function transformAxisLabelStateStyle(stateStyle) {
53568
+ if (isEmpty(stateStyle)) {
53569
+ return null;
53570
+ }
53571
+ const newStateStyle = {};
53572
+ Object.keys(stateStyle).forEach(key => {
53573
+ if (isFunction$1(stateStyle[key])) {
53574
+ newStateStyle[key] = (datum, index, data, layer) => {
53575
+ return transformToGraphic(stateStyle[key](datum.rawValue, index, datum, data, layer));
53576
+ };
53577
+ }
53578
+ else if (!isEmpty(stateStyle[key])) {
53579
+ newStateStyle[key] = transformToGraphic(stateStyle[key]);
53580
+ }
53581
+ });
53582
+ return newStateStyle;
53583
+ }
53584
+ function transformToGraphic(style) {
53585
+ if (style === null || style === void 0 ? void 0 : style.angle) {
53586
+ style.angle = degreeToRadian(style.angle);
53587
+ }
53588
+ return style;
53589
+ }
53590
+
53605
53591
  class Factory {
53606
53592
  static registerChart(key, chart) {
53607
53593
  Factory._charts[key] = chart;
@@ -56842,6 +56828,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
56842
56828
  getStackInverse() {
56843
56829
  return this._spec.stackInverse === true;
56844
56830
  }
56831
+ getStackSort() {
56832
+ return this._spec.stackSort === true;
56833
+ }
56845
56834
  constructor(spec, ctx) {
56846
56835
  var _a;
56847
56836
  super(spec, ctx);
@@ -56854,7 +56843,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
56854
56843
  this.layoutZIndex = exports.LayoutZIndex.Region;
56855
56844
  this.interaction = new Interaction();
56856
56845
  this.seriesDataFilterOver = () => {
56857
- this.event.emit(exports.ChartEvent.regionSeriesDataFilterOver, { model: this });
56846
+ this.event.emit(exports.ChartEvent.regionSeriesDataFilterOver, { model: this, chart: this.getChart() });
56858
56847
  this._series.forEach(s => {
56859
56848
  if (s.getViewDataFilter()) {
56860
56849
  s.reTransformViewData();
@@ -59388,7 +59377,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
59388
59377
  this._chart.setCanvasRect(this._currentSize.width, this._currentSize.height);
59389
59378
  this._chart.created();
59390
59379
  this._chart.init();
59391
- this._event.emit(exports.ChartEvent.initialized, {});
59380
+ this._event.emit(exports.ChartEvent.initialized, {
59381
+ chart,
59382
+ vchart: this
59383
+ });
59392
59384
  }
59393
59385
  _releaseData() {
59394
59386
  if (this._dataSet) {
@@ -59401,10 +59393,16 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
59401
59393
  return;
59402
59394
  }
59403
59395
  this._compiler.getVGrammarView().addEventListener(exports.VGRAMMAR_HOOK_EVENT.ALL_ANIMATION_END, () => {
59404
- this._event.emit(exports.ChartEvent.animationFinished, {});
59396
+ this._event.emit(exports.ChartEvent.animationFinished, {
59397
+ chart: this._chart,
59398
+ vchart: this
59399
+ });
59405
59400
  });
59406
59401
  this._compiler.getVGrammarView().addEventListener(exports.VGRAMMAR_HOOK_EVENT.AFTER_VRENDER_NEXT_RENDER, () => {
59407
- this._event.emit(exports.ChartEvent.renderFinished, {});
59402
+ this._event.emit(exports.ChartEvent.renderFinished, {
59403
+ chart: this._chart,
59404
+ vchart: this
59405
+ });
59408
59406
  });
59409
59407
  }
59410
59408
  _bindResizeEvent() {
@@ -59541,7 +59539,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
59541
59539
  return false;
59542
59540
  }
59543
59541
  this._updateAnimateState();
59544
- this._event.emit(exports.ChartEvent.rendered, {});
59542
+ this._event.emit(exports.ChartEvent.rendered, {
59543
+ chart: this._chart,
59544
+ vchart: this
59545
+ });
59545
59546
  return true;
59546
59547
  }
59547
59548
  renderSync(morphConfig) {
@@ -60165,6 +60166,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
60165
60166
  getComponents() {
60166
60167
  return this._chart.getAllComponents();
60167
60168
  }
60169
+ getScale(scaleId) {
60170
+ var _a;
60171
+ const globalScale = (_a = this._chart) === null || _a === void 0 ? void 0 : _a.getGlobalScale();
60172
+ return globalScale === null || globalScale === void 0 ? void 0 : globalScale.getScale(scaleId);
60173
+ }
60168
60174
  setDimensionIndex(value, opt = {}) {
60169
60175
  var _a;
60170
60176
  return (_a = this._chart) === null || _a === void 0 ? void 0 : _a.setDimensionIndex(value, opt);
@@ -61467,7 +61473,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
61467
61473
  };
61468
61474
 
61469
61475
  const layoutByValue$1 = (tag = 3, series, layoutStartPoint, currValueX, currValueY, xHair, yHair, enableRemain = false, cacheXCrossHairInfo, cacheYCrossHairInfo) => {
61470
- var _a;
61471
61476
  const layoutX = tag & 1;
61472
61477
  const layoutY = tag & 2;
61473
61478
  if (!layoutStartPoint) {
@@ -61531,6 +61536,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
61531
61536
  currValueX.forEach(({ axis, value }) => {
61532
61537
  var _a;
61533
61538
  value = value !== null && value !== void 0 ? value : '';
61539
+ let niceLabelFormatter = null;
61534
61540
  const xScale = axis.getScale();
61535
61541
  if (isDiscrete(xScale.type)) {
61536
61542
  bandWidth = xScale.bandwidth();
@@ -61553,17 +61559,20 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
61553
61559
  }
61554
61560
  x = startX;
61555
61561
  }
61562
+ niceLabelFormatter = axis.niceLabelFormatter;
61556
61563
  }
61557
61564
  if (xCrossHairInfo && ((_a = xHair.label) === null || _a === void 0 ? void 0 : _a.visible) && !xUseCache) {
61558
61565
  const labelOffset = getAxisLabelOffset(axis.getSpec());
61559
61566
  if (axis.getOrient() === 'bottom') {
61560
61567
  xCrossHairInfo.bottom.visible = true;
61568
+ xCrossHairInfo.bottom.defaultFormatter = niceLabelFormatter;
61561
61569
  xCrossHairInfo.bottom.text = value;
61562
61570
  xCrossHairInfo.bottom.dx = 0;
61563
61571
  xCrossHairInfo.bottom.dy = labelOffset;
61564
61572
  }
61565
61573
  else if (axis.getOrient() === 'top') {
61566
61574
  xCrossHairInfo.top.visible = true;
61575
+ xCrossHairInfo.top.defaultFormatter = niceLabelFormatter;
61567
61576
  xCrossHairInfo.top.text = value;
61568
61577
  xCrossHairInfo.top.dx = 0;
61569
61578
  xCrossHairInfo.top.dy = -labelOffset;
@@ -61575,6 +61584,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
61575
61584
  currValueY.forEach(({ axis, value }) => {
61576
61585
  var _a;
61577
61586
  value = value !== null && value !== void 0 ? value : '';
61587
+ let niceLabelFormatter = null;
61578
61588
  const yScale = axis.getScale();
61579
61589
  if (isDiscrete(yScale.type)) {
61580
61590
  bandHeight = yScale.bandwidth();
@@ -61597,17 +61607,20 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
61597
61607
  }
61598
61608
  y = startY;
61599
61609
  }
61610
+ niceLabelFormatter = axis.niceLabelFormatter;
61600
61611
  }
61601
61612
  if (yCrossHairInfo && ((_a = yHair.label) === null || _a === void 0 ? void 0 : _a.visible) && !yUseCache) {
61602
61613
  const labelOffset = getAxisLabelOffset(axis.getSpec());
61603
61614
  if (axis.getOrient() === 'left') {
61604
61615
  yCrossHairInfo.left.visible = true;
61616
+ yCrossHairInfo.left.defaultFormatter = niceLabelFormatter;
61605
61617
  yCrossHairInfo.left.text = value;
61606
61618
  yCrossHairInfo.left.dx = -labelOffset;
61607
61619
  yCrossHairInfo.left.dy = 0;
61608
61620
  }
61609
61621
  else if (axis.getOrient() === 'right') {
61610
61622
  yCrossHairInfo.right.visible = true;
61623
+ yCrossHairInfo.right.defaultFormatter = niceLabelFormatter;
61611
61624
  yCrossHairInfo.right.text = value;
61612
61625
  yCrossHairInfo.right.dx = labelOffset;
61613
61626
  yCrossHairInfo.right.dy = 0;
@@ -61623,11 +61636,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
61623
61636
  xCrossHairInfo.topPos = xRegion.y1;
61624
61637
  xCrossHairInfo.height = xRegion.y2 - xRegion.y1;
61625
61638
  xCrossHairInfo.x = x + layoutStartPoint.x;
61626
- if ((_a = xHair === null || xHair === void 0 ? void 0 : xHair.label) === null || _a === void 0 ? void 0 : _a.formatMethod) {
61627
- const { top, bottom } = xCrossHairInfo;
61628
- bottom.visible && (bottom.text = xHair.label.formatMethod(bottom.text, 'bottom'));
61629
- top.visible && (top.text = xHair.label.formatMethod(top.text, 'top'));
61630
- }
61631
61639
  if (xHair && xHair.label) {
61632
61640
  const { top, bottom } = xCrossHairInfo;
61633
61641
  if (top.visible) {
@@ -61674,6 +61682,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
61674
61682
  if (formatFunc) {
61675
61683
  labelInfo.text = formatFunc(...args);
61676
61684
  }
61685
+ else if (labelInfo.defaultFormatter) {
61686
+ labelInfo.text = labelInfo.defaultFormatter(labelInfo.text);
61687
+ }
61677
61688
  };
61678
61689
  const setRegionArea = (outRegion, currentValue) => {
61679
61690
  currentValue.forEach(({ axis }) => {
@@ -64578,7 +64589,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
64578
64589
  registerComponentPlugin(CanvasTooltipHandler);
64579
64590
  };
64580
64591
 
64581
- const version = "1.10.3";
64592
+ const version = "1.10.5-alpha.1";
64582
64593
 
64583
64594
  const addVChartProperty = (data, op) => {
64584
64595
  const context = op.beforeCall();
@@ -67531,15 +67542,18 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
67531
67542
  getLayoutTag() {
67532
67543
  return this._layoutTag;
67533
67544
  }
67534
- setLayoutTag(tag, morphConfig, reLayout = true) {
67545
+ setLayoutTag(tag, morphConfig, renderNextTick = true) {
67535
67546
  var _a;
67536
67547
  this._layoutTag = tag;
67537
67548
  if ((_a = this.getCompiler()) === null || _a === void 0 ? void 0 : _a.getVGrammarView()) {
67538
67549
  this.getCompiler().getVGrammarView().updateLayoutTag();
67539
- tag && reLayout && this.getCompiler().renderNextTick(morphConfig);
67550
+ tag && renderNextTick && this.getCompiler().renderNextTick(morphConfig);
67540
67551
  }
67541
67552
  return this._layoutTag;
67542
67553
  }
67554
+ getGlobalScale() {
67555
+ return this._globalScale;
67556
+ }
67543
67557
  getEvent() {
67544
67558
  return this._event;
67545
67559
  }
@@ -67832,14 +67846,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
67832
67846
  var _a, _b, _c, _d;
67833
67847
  (_b = (_a = this._option.performanceHook) === null || _a === void 0 ? void 0 : _a.beforeLayoutWithSceneGraph) === null || _b === void 0 ? void 0 : _b.call(_a);
67834
67848
  if (this.getLayoutTag()) {
67835
- this._event.emit(exports.ChartEvent.layoutStart, { chart: this });
67849
+ this._event.emit(exports.ChartEvent.layoutStart, { chart: this, vchart: this._option.globalInstance });
67836
67850
  this.onLayoutStart(params);
67837
67851
  const elements = this.getLayoutElements();
67838
67852
  this._layoutFunc(this, elements, this._layoutRect, this._viewBox);
67839
- this._event.emit(exports.ChartEvent.afterLayout, { elements });
67853
+ this._event.emit(exports.ChartEvent.afterLayout, { elements, chart: this });
67840
67854
  this.setLayoutTag(false);
67841
67855
  this.onLayoutEnd(params);
67842
- this._event.emit(exports.ChartEvent.layoutEnd, { chart: this });
67856
+ this._event.emit(exports.ChartEvent.layoutEnd, { chart: this, vchart: this._option.globalInstance });
67843
67857
  }
67844
67858
  (_d = (_c = this._option.performanceHook) === null || _c === void 0 ? void 0 : _c.afterLayoutWithSceneGraph) === null || _d === void 0 ? void 0 : _d.call(_c);
67845
67859
  }
@@ -68138,7 +68152,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
68138
68152
  this._layoutRect.height = viewRect.height - this.padding.top - this.padding.bottom;
68139
68153
  this._layoutRect.x = this.padding.left;
68140
68154
  this._layoutRect.y = this.padding.top;
68141
- this._event.emit(exports.ChartEvent.layoutRectUpdate, {});
68155
+ this._event.emit(exports.ChartEvent.layoutRectUpdate, { chart: this });
68142
68156
  }
68143
68157
  setCurrentTheme() {
68144
68158
  this.updateChartConfig({ change: true, reMake: false }, this._spec);
@@ -68467,7 +68481,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
68467
68481
  chartSpec.tooltip = {};
68468
68482
  }
68469
68483
  if (isValid$3(chartSpec.stackInverse)) {
68470
- chartSpec.region.forEach((r) => !isValid$3(r.stackInverse) && (r.stackInverse = chartSpec.stackInverse));
68484
+ chartSpec.region.forEach((r) => {
68485
+ !isValid$3(r.stackInverse) && (r.stackInverse = chartSpec.stackInverse);
68486
+ });
68487
+ }
68488
+ if (isValid$3(chartSpec.stackSort)) {
68489
+ chartSpec.region.forEach((r) => {
68490
+ !isValid$3(r.stackSort) && (r.stackSort = chartSpec.stackSort);
68491
+ });
68471
68492
  }
68472
68493
  }
68473
68494
  transformModelSpec(chartSpec) {
@@ -69193,46 +69214,61 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
69193
69214
  };
69194
69215
 
69195
69216
  function stackWithMinHeight(stackCache, stackInverse, context) {
69217
+ var _a, _b;
69196
69218
  if (stackCache.values.length > 0) {
69197
- let seriesInfo = stackCache.series;
69198
- if (stackInverse) {
69199
- seriesInfo = seriesInfo.slice().reverse();
69200
- }
69201
69219
  let lastY;
69202
- seriesInfo.forEach(({ s, values }, sIndex) => {
69203
- var _a, _b;
69204
- const barMinHeight = s.getSpec().barMinHeight;
69205
- const seriesScale = (_b = (_a = s[context.axisHelper]).getScale) === null || _b === void 0 ? void 0 : _b.call(_a, 0);
69206
- const inverse = s[context.axisHelper].isInverse();
69207
- for (let index = 0; index < values.length; index++) {
69208
- const obj = values[stackInverse ? values.length - 1 - index : index];
69209
- const y1 = valueInScaleRange(s[context.startMethod](obj), seriesScale);
69210
- let y = valueInScaleRange(s[context.endMethod](obj), seriesScale);
69211
- if (index === 0 && sIndex === 0) {
69212
- lastY = y1;
69213
- }
69214
- let height = Math.abs(y1 - y);
69215
- if (height < barMinHeight) {
69216
- height = barMinHeight;
69217
- }
69218
- let flag = 1;
69219
- if (y < y1) {
69220
- flag = -1;
69221
- }
69222
- else if (y === y1) {
69223
- flag = context.isVertical ? (inverse ? 1 : -1) : inverse ? -1 : 1;
69224
- }
69225
- y = lastY + flag * height;
69226
- obj[context.start] = lastY;
69227
- obj[context.end] = y;
69228
- lastY = y;
69220
+ if (stackCache.sortDatums.length) {
69221
+ let sortDatums = stackCache.sortDatums;
69222
+ if (stackInverse) {
69223
+ sortDatums = stackCache.sortDatums.slice().reverse();
69229
69224
  }
69230
- });
69225
+ for (let index = 0; index < sortDatums.length; index++) {
69226
+ lastY = computeOneDatumY(sortDatums[index].datum, lastY, sortDatums[index].series, context, (_b = (_a = sortDatums[index].series[context.axisHelper]).getScale) === null || _b === void 0 ? void 0 : _b.call(_a, 0), index === 0);
69227
+ }
69228
+ }
69229
+ else {
69230
+ let seriesInfo = stackCache.series;
69231
+ if (stackInverse) {
69232
+ seriesInfo = seriesInfo.slice().reverse();
69233
+ }
69234
+ seriesInfo.forEach(({ s, values }, sIndex) => {
69235
+ var _a, _b;
69236
+ const seriesScale = (_b = (_a = s[context.axisHelper]).getScale) === null || _b === void 0 ? void 0 : _b.call(_a, 0);
69237
+ for (let index = 0; index < values.length; index++) {
69238
+ const obj = values[stackInverse ? values.length - 1 - index : index];
69239
+ lastY = computeOneDatumY(obj, lastY, s, context, seriesScale, index === 0 && sIndex === 0);
69240
+ }
69241
+ });
69242
+ }
69231
69243
  }
69232
69244
  for (const key in stackCache.nodes) {
69233
69245
  stackWithMinHeight(stackCache.nodes[key], stackInverse, context);
69234
69246
  }
69235
69247
  }
69248
+ function computeOneDatumY(obj, lastY, s, context, seriesScale, isFirst) {
69249
+ const barMinHeight = s.getSpec().barMinHeight;
69250
+ const inverse = s[context.axisHelper].isInverse();
69251
+ const y1 = valueInScaleRange(s[context.startMethod](obj), seriesScale);
69252
+ let y = valueInScaleRange(s[context.endMethod](obj), seriesScale);
69253
+ if (isFirst) {
69254
+ lastY = y1;
69255
+ }
69256
+ let height = Math.abs(y1 - y);
69257
+ if (height < barMinHeight) {
69258
+ height = barMinHeight;
69259
+ }
69260
+ let flag = 1;
69261
+ if (y < y1) {
69262
+ flag = -1;
69263
+ }
69264
+ else if (y === y1) {
69265
+ flag = context.isVertical ? (inverse ? 1 : -1) : inverse ? -1 : 1;
69266
+ }
69267
+ y = lastY + flag * height;
69268
+ obj[context.start] = lastY;
69269
+ obj[context.end] = y;
69270
+ return y;
69271
+ }
69236
69272
 
69237
69273
  class BarSeriesSpecTransformer extends BaseSeriesSpecTransformer {
69238
69274
  constructor() {
@@ -86844,15 +86880,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
86844
86880
  }
86845
86881
  this._delegateAxisContainerEvent(product.getGroupGraphicItem());
86846
86882
  if (this._unitText) {
86847
- const bounds = product.graphicItem.AABBBounds;
86883
+ const { x, y } = this.getLayoutStartPoint();
86848
86884
  const pos = isXAxis(this._orient)
86849
86885
  ? {
86850
- x: bounds.x2,
86851
- y: this.getLayoutStartPoint().y
86886
+ x: maxInArray(this._scale.range()) + x,
86887
+ y
86852
86888
  }
86853
86889
  : {
86854
- x: this.getLayoutStartPoint().x,
86855
- y: bounds.y1
86890
+ x,
86891
+ y: minInArray(this._scale.range()) + y
86856
86892
  };
86857
86893
  this._unitText.setAttributes(pos);
86858
86894
  }
@@ -87181,10 +87217,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
87181
87217
  const { text, style } = this._spec.unit;
87182
87218
  let pos;
87183
87219
  let unitTextStyle;
87220
+ const { x, y } = this.getLayoutStartPoint();
87184
87221
  if (isX) {
87185
87222
  pos = {
87186
- x: bounds.x2,
87187
- y: this.getLayoutStartPoint().y
87223
+ x: maxInArray(this._scale.range()) + x,
87224
+ y
87188
87225
  };
87189
87226
  unitTextStyle = {
87190
87227
  textAlign: 'left',
@@ -87193,8 +87230,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
87193
87230
  }
87194
87231
  else {
87195
87232
  pos = {
87196
- x: this.getLayoutStartPoint().x,
87197
- y: bounds.y1
87233
+ x,
87234
+ y: minInArray(this._scale.range()) + y
87198
87235
  };
87199
87236
  unitTextStyle = {
87200
87237
  textAlign: this._orient === 'left' ? 'left' : 'right',
@@ -87236,6 +87273,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
87236
87273
  class LinearAxisMixin {
87237
87274
  constructor() {
87238
87275
  this._extend = {};
87276
+ this.niceLabelFormatter = null;
87239
87277
  }
87240
87278
  setExtraAttrFromSpec() {
87241
87279
  isValid$3(this._spec.nice) && (this._nice = this._spec.nice);
@@ -87449,9 +87487,21 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
87449
87487
  this.niceDomain(domain);
87450
87488
  this._scale.domain(domain, this._nice);
87451
87489
  this.setScaleNice();
87490
+ this._updateNiceLabelFormatter(domain);
87452
87491
  this.event.emit(exports.ChartEvent.scaleDomainUpdate, { model: this });
87453
87492
  this.event.emit(exports.ChartEvent.scaleUpdate, { model: this, value: 'domain' });
87454
87493
  }
87494
+ _updateNiceLabelFormatter(domain) {
87495
+ const domainSpan = Math.abs(domain[1] - domain[0]);
87496
+ const n = Math.max(-Math.floor(Math.log10(domainSpan)), 0) + 2;
87497
+ const unit = Math.pow(10, n);
87498
+ this.niceLabelFormatter = (value) => {
87499
+ if (isValidNumber$1(+value)) {
87500
+ return Math.round(+value * unit) / unit;
87501
+ }
87502
+ return value;
87503
+ };
87504
+ }
87455
87505
  }
87456
87506
 
87457
87507
  class CartesianLinearAxis extends CartesianAxis {
@@ -88730,7 +88780,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
88730
88780
  return result;
88731
88781
  }
88732
88782
  onDataUpdate() {
88733
- var _a, _b;
88783
+ var _a, _b, _c;
88734
88784
  if (JSON.stringify(this._preSelectedData) === JSON.stringify(this._selectedData)) {
88735
88785
  return;
88736
88786
  }
@@ -88743,6 +88793,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
88743
88793
  }
88744
88794
  }
88745
88795
  (_b = (_a = this.effect).onSelectedDataChange) === null || _b === void 0 ? void 0 : _b.call(_a);
88796
+ (_c = this.getChart()) === null || _c === void 0 ? void 0 : _c.setLayoutTag(true, null, false);
88746
88797
  this.event.emit(exports.ChartEvent.legendSelectedDataChange, { model: this });
88747
88798
  }
88748
88799
  _getNeedClearVRenderComponents() {
@@ -89654,10 +89705,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
89654
89705
  }
89655
89706
  beforeRelease() {
89656
89707
  this.event.emit(exports.ChartEvent.tooltipHide, {
89657
- tooltip: this
89708
+ tooltip: this,
89709
+ chart: this.getChart()
89658
89710
  });
89659
89711
  this.event.emit(exports.ChartEvent.tooltipRelease, {
89660
- tooltip: this
89712
+ tooltip: this,
89713
+ chart: this.getChart()
89661
89714
  });
89662
89715
  }
89663
89716
  _initHandler() {
@@ -90282,10 +90335,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90282
90335
  };
90283
90336
  }
90284
90337
  _getValueAt(axis, p) {
90285
- let value = axis.getScale().invert(p);
90286
- if (isContinuous(axis.getScale().type) && isValidNumber$1(+value)) {
90287
- value = (+value).toFixed(2);
90288
- }
90338
+ const value = axis.getScale().invert(p);
90289
90339
  return value;
90290
90340
  }
90291
90341
  clearAxisValue() {
@@ -90539,8 +90589,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90539
90589
  mergeSpec(angleCrossHairInfo, rest);
90540
90590
  const angle = series.angleAxisHelper.dataToPosition([value]);
90541
90591
  angleCrossHairInfo.angle = angle;
90592
+ const niceLabelFormatter = axis.niceLabelFormatter;
90542
90593
  if ((_b = angleHair.label) === null || _b === void 0 ? void 0 : _b.visible) {
90543
90594
  angleCrossHairInfo.label.visible = true;
90595
+ angleCrossHairInfo.label.defaultFormatter = niceLabelFormatter;
90544
90596
  angleCrossHairInfo.label.text = value;
90545
90597
  angleCrossHairInfo.label.offset = getAxisLabelOffset(axis.getSpec());
90546
90598
  }
@@ -90554,8 +90606,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90554
90606
  var _b;
90555
90607
  var { axis, value, coord } = _a, rest = __rest$7(_a, ["axis", "value", "coord"]);
90556
90608
  value = value !== null && value !== void 0 ? value : '';
90609
+ const niceLabelFormatter = axis.niceLabelFormatter;
90557
90610
  if ((_b = radiusHair.label) === null || _b === void 0 ? void 0 : _b.visible) {
90558
90611
  radiusCrossHairInfo.label.visible = true;
90612
+ radiusCrossHairInfo.label.defaultFormatter = niceLabelFormatter;
90559
90613
  radiusCrossHairInfo.label.text = value;
90560
90614
  radiusCrossHairInfo.label.offset = getAxisLabelOffset(axis.getSpec());
90561
90615
  }
@@ -90579,6 +90633,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90579
90633
  if (formatFunc) {
90580
90634
  label.text = formatFunc(...args);
90581
90635
  }
90636
+ else if (label.defaultFormatter) {
90637
+ label.text = label.defaultFormatter(label.text);
90638
+ }
90582
90639
  }
90583
90640
  }
90584
90641
  }
@@ -90597,6 +90654,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90597
90654
  if (formatFunc) {
90598
90655
  label.text = formatFunc(...args);
90599
90656
  }
90657
+ else if (label.defaultFormatter) {
90658
+ label.text = label.defaultFormatter(label.text);
90659
+ }
90600
90660
  }
90601
90661
  }
90602
90662
  }
@@ -90767,13 +90827,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90767
90827
  _getValueByAxis(axis, point) {
90768
90828
  const { x: axisStartX, y: axisStartY } = axis.getLayoutStartPoint();
90769
90829
  const { x, y } = this.getLayoutStartPoint();
90770
- let value = axis.positionToData({
90830
+ const value = axis.positionToData({
90771
90831
  x: point.x - (axisStartX - x),
90772
90832
  y: point.y - (axisStartY - y)
90773
90833
  });
90774
- if (isContinuous(axis.getScale().type) && isValidNumber$1(+value)) {
90775
- value = (+value).toFixed(2);
90776
- }
90777
90834
  const center = {
90778
90835
  x: axis.getCenter().x + this.getLayoutStartPoint().x,
90779
90836
  y: axis.getCenter().y + this.getLayoutStartPoint().y
@@ -91101,6 +91158,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91101
91158
  this.layoutType = 'none';
91102
91159
  this._orient = 'left';
91103
91160
  this._cacheVisibility = undefined;
91161
+ this._dataUpdating = false;
91104
91162
  this._shouldChange = true;
91105
91163
  this._stateField = 'x';
91106
91164
  this._activeRoam = true;
@@ -91311,9 +91369,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91311
91369
  return;
91312
91370
  }
91313
91371
  onDataUpdate() {
91372
+ var _a;
91314
91373
  const domain = this._computeDomainOfStateScale(isContinuous(this._stateScale.type));
91315
91374
  this._stateScale.domain(domain, true);
91316
91375
  this._handleChange(this._start, this._end, true);
91376
+ if (this._spec.auto) {
91377
+ this._dataUpdating = true;
91378
+ (_a = this.getChart()) === null || _a === void 0 ? void 0 : _a.setLayoutTag(true, null, false);
91379
+ }
91317
91380
  }
91318
91381
  _computeDomainOfStateScale(isContinuous) {
91319
91382
  if (this._spec.customDomain) {
@@ -91379,7 +91442,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91379
91442
  this._originalStateFields = originalStateFields;
91380
91443
  }
91381
91444
  else {
91382
- isNil$3(this._spec.valueField);
91383
91445
  eachSeries(this._regions, s => {
91384
91446
  dataCollection.push(s.getRawData());
91385
91447
  stateFields.push(this._field);
@@ -91630,6 +91692,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91630
91692
  }, {
91631
91693
  [sizeKey]: exports.AttributeLevel.Built_In
91632
91694
  });
91695
+ this._dataUpdating = false;
91633
91696
  }
91634
91697
  getBoundsInRect(rect) {
91635
91698
  const result = { x1: this.getLayoutStartPoint().x, y1: this.getLayoutStartPoint().y, x2: 0, y2: 0 };
@@ -91670,7 +91733,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91670
91733
  const axisSpec = axis === null || axis === void 0 ? void 0 : axis.getSpec();
91671
91734
  const axisScale = axis === null || axis === void 0 ? void 0 : axis.getScale();
91672
91735
  const bandSizeResult = this._getAxisBandSize(axisSpec);
91673
- if (isDiscrete(axisScale.type) &&
91736
+ if (!this._dataUpdating &&
91737
+ isDiscrete(axisScale.type) &&
91674
91738
  (rect === null || rect === void 0 ? void 0 : rect.height) === ((_a = this._cacheRect) === null || _a === void 0 ? void 0 : _a.height) &&
91675
91739
  (rect === null || rect === void 0 ? void 0 : rect.width) === ((_b = this._cacheRect) === null || _b === void 0 ? void 0 : _b.width) &&
91676
91740
  this._fixedBandSize === (bandSizeResult === null || bandSizeResult === void 0 ? void 0 : bandSizeResult.bandSize)) {
@@ -94391,7 +94455,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
94391
94455
  const { markLabelSpec = {} } = seriesInfo;
94392
94456
  return Object.values(markLabelSpec).some(labelSpecList => Array.isArray(labelSpecList) && isLabelVisible(labelSpecList));
94393
94457
  });
94394
- if (chartSpec.labelLayout !== 'region' || hasVisibleLabel) {
94458
+ if (hasVisibleLabel) {
94395
94459
  specInfo.push({
94396
94460
  spec: chartSpec,
94397
94461
  type: ComponentTypeEnum.label,
@@ -96321,7 +96385,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
96321
96385
  this._elementMap.set(item, result);
96322
96386
  return result;
96323
96387
  }
96324
- getSizeFromGird(spec, type) {
96388
+ getSizeFromGrid(spec, type) {
96325
96389
  var _a;
96326
96390
  const sizeList = type === 'col' ? this._colSize : this._rowSize;
96327
96391
  let result = 0;
@@ -96401,10 +96465,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
96401
96465
  var _a, _b;
96402
96466
  const gridSpec = this.getItemGridInfo(item);
96403
96467
  const rect = {
96404
- width: ((_a = this.getSizeFromGird(gridSpec, 'col')) !== null && _a !== void 0 ? _a : this._chartLayoutRect.width) -
96468
+ width: ((_a = this.getSizeFromGrid(gridSpec, 'col')) !== null && _a !== void 0 ? _a : this._chartLayoutRect.width) -
96405
96469
  item.layoutPaddingLeft -
96406
96470
  item.layoutPaddingRight,
96407
- height: ((_b = this.getSizeFromGird(gridSpec, 'row')) !== null && _b !== void 0 ? _b : this._chartLayoutRect.height) -
96471
+ height: ((_b = this.getSizeFromGrid(gridSpec, 'row')) !== null && _b !== void 0 ? _b : this._chartLayoutRect.height) -
96408
96472
  item.layoutPaddingTop -
96409
96473
  item.layoutPaddingBottom
96410
96474
  };
@@ -96454,8 +96518,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
96454
96518
  }
96455
96519
  layoutOneItem(item, sizeType, ignoreTag) {
96456
96520
  var _a, _b;
96457
- const sizeCallRow = sizeType === 'rowGrid' || sizeType === 'grid' ? this.getSizeFromGird.bind(this) : this.getSizeFromUser.bind(this);
96458
- const sizeCallCol = sizeType === 'colGrid' || sizeType === 'grid' ? this.getSizeFromGird.bind(this) : this.getSizeFromUser.bind(this);
96521
+ const sizeCallRow = sizeType === 'rowGrid' || sizeType === 'grid' ? this.getSizeFromGrid.bind(this) : this.getSizeFromUser.bind(this);
96522
+ const sizeCallCol = sizeType === 'colGrid' || sizeType === 'grid' ? this.getSizeFromGrid.bind(this) : this.getSizeFromUser.bind(this);
96459
96523
  const gridSpec = this.getItemGridInfo(item);
96460
96524
  const computeRect = {
96461
96525
  width: ((_a = sizeCallCol(gridSpec, 'col')) !== null && _a !== void 0 ? _a : this._chartLayoutRect.width) -