@visactor/vchart 2.1.0-alpha.2 → 2.1.0-alpha.20

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 (320) hide show
  1. package/build/es5/index.js +3 -3
  2. package/build/index.es.js +19187 -25472
  3. package/build/index.js +19189 -25474
  4. package/build/index.min.js +2 -2
  5. package/build/tsconfig.tsbuildinfo +1 -1
  6. package/cjs/chart/base/base-chart-transformer.d.ts +0 -3
  7. package/cjs/chart/base/base-chart-transformer.js +1 -21
  8. package/cjs/chart/base/base-chart-transformer.js.map +1 -1
  9. package/cjs/chart/base/base-chart.d.ts +9 -15
  10. package/cjs/chart/base/base-chart.js +24 -115
  11. package/cjs/chart/base/base-chart.js.map +1 -1
  12. package/cjs/chart/interface/chart.d.ts +0 -1
  13. package/cjs/chart/interface/chart.js.map +1 -1
  14. package/cjs/chart/pie/base/pie-transformer.js +2 -2
  15. package/cjs/chart/pie/base/pie-transformer.js.map +1 -1
  16. package/cjs/chart/progress/circular/circular-progress-transformer.js +2 -2
  17. package/cjs/chart/progress/circular/circular-progress-transformer.js.map +1 -1
  18. package/cjs/chart/util.d.ts +1 -4
  19. package/cjs/chart/util.js +4 -40
  20. package/cjs/chart/util.js.map +1 -1
  21. package/cjs/chart/waterfall/waterfall-transformer.js +1 -2
  22. package/cjs/chart/waterfall/waterfall-transformer.js.map +1 -1
  23. package/cjs/compile/compiler.d.ts +0 -2
  24. package/cjs/compile/compiler.js +40 -53
  25. package/cjs/compile/compiler.js.map +1 -1
  26. package/cjs/compile/data/compilable-data.d.ts +1 -1
  27. package/cjs/compile/data/compilable-data.js +1 -1
  28. package/cjs/compile/data/compilable-data.js.map +1 -1
  29. package/cjs/compile/grammar-item.d.ts +1 -1
  30. package/cjs/compile/grammar-item.js.map +1 -1
  31. package/cjs/compile/interface/compilable-item.d.ts +1 -1
  32. package/cjs/compile/interface/compilable-item.js.map +1 -1
  33. package/cjs/compile/interface/compiler.d.ts +1 -2
  34. package/cjs/compile/interface/compiler.js.map +1 -1
  35. package/cjs/component/axis/base-axis.d.ts +7 -2
  36. package/cjs/component/axis/base-axis.js +3 -25
  37. package/cjs/component/axis/base-axis.js.map +1 -1
  38. package/cjs/component/axis/cartesian/band-axis.d.ts +7 -1
  39. package/cjs/component/base/base-component.d.ts +7 -7
  40. package/cjs/component/base/base-component.js +6 -41
  41. package/cjs/component/base/base-component.js.map +1 -1
  42. package/cjs/component/brush/brush.d.ts +7 -2
  43. package/cjs/component/brush/brush.js +12 -16
  44. package/cjs/component/brush/brush.js.map +1 -1
  45. package/cjs/component/crosshair/base.d.ts +7 -1
  46. package/cjs/component/custom-mark/custom-mark.d.ts +7 -1
  47. package/cjs/component/data-zoom/data-filter-base-component.d.ts +7 -1
  48. package/cjs/component/geo/geo-coordinate.d.ts +7 -1
  49. package/cjs/component/index.js +2 -1
  50. package/cjs/component/label/base-label.d.ts +7 -1
  51. package/cjs/component/label/label.js +1 -1
  52. package/cjs/component/label/label.js.map +1 -1
  53. package/cjs/component/legend/base-legend.d.ts +7 -2
  54. package/cjs/component/legend/base-legend.js +4 -21
  55. package/cjs/component/legend/base-legend.js.map +1 -1
  56. package/cjs/component/marker/base-marker.d.ts +7 -7
  57. package/cjs/component/marker/base-marker.js +6 -23
  58. package/cjs/component/marker/base-marker.js.map +1 -1
  59. package/cjs/component/marker/mark-line/base-mark-line.js +4 -2
  60. package/cjs/component/marker/mark-line/base-mark-line.js.map +1 -1
  61. package/cjs/component/marker/mark-line/cartesian-mark-line.js +18 -7
  62. package/cjs/component/marker/mark-line/cartesian-mark-line.js.map +1 -1
  63. package/cjs/component/marker/mark-line/interface/spec.d.ts +9 -2
  64. package/cjs/component/marker/mark-line/interface/spec.js.map +1 -1
  65. package/cjs/component/title/title.d.ts +7 -1
  66. package/cjs/component/title/title.js +2 -6
  67. package/cjs/component/title/title.js.map +1 -1
  68. package/cjs/component/util.js +1 -2
  69. package/cjs/constant/scatter.js +2 -1
  70. package/cjs/constant/scroll-bar.js +1 -2
  71. package/cjs/core/instance-manager.js +1 -1
  72. package/cjs/core/vchart.d.ts +1 -5
  73. package/cjs/core/vchart.js +12 -28
  74. package/cjs/core/vchart.js.map +1 -1
  75. package/cjs/interaction/interaction.js +8 -11
  76. package/cjs/interaction/interaction.js.map +1 -1
  77. package/cjs/interaction/triggers/element-active-by-legend.js +2 -3
  78. package/cjs/interaction/triggers/element-active-by-legend.js.map +1 -1
  79. package/cjs/interaction/triggers/element-active.js +3 -4
  80. package/cjs/interaction/triggers/element-active.js.map +1 -1
  81. package/cjs/interaction/triggers/element-highlight-by-group.js +2 -3
  82. package/cjs/interaction/triggers/element-highlight-by-group.js.map +1 -1
  83. package/cjs/interaction/triggers/element-highlight-by-legend.js +2 -2
  84. package/cjs/interaction/triggers/element-highlight-by-legend.js.map +1 -1
  85. package/cjs/interaction/triggers/element-highlight-by-name.js +2 -2
  86. package/cjs/interaction/triggers/element-highlight-by-name.js.map +1 -1
  87. package/cjs/interaction/triggers/element-highlight.js +2 -2
  88. package/cjs/interaction/triggers/element-highlight.js.map +1 -1
  89. package/cjs/interaction/triggers/element-select.js +3 -3
  90. package/cjs/interaction/triggers/element-select.js.map +1 -1
  91. package/cjs/mark/base/base-line.js +2 -2
  92. package/cjs/mark/base/base-line.js.map +1 -1
  93. package/cjs/mark/base/base-mark.d.ts +2 -13
  94. package/cjs/mark/base/base-mark.js +23 -101
  95. package/cjs/mark/base/base-mark.js.map +1 -1
  96. package/cjs/mark/component.d.ts +0 -9
  97. package/cjs/mark/component.js +3 -51
  98. package/cjs/mark/component.js.map +1 -1
  99. package/cjs/mark/group.js +1 -1
  100. package/cjs/mark/group.js.map +1 -1
  101. package/cjs/mark/interface/mark.d.ts +0 -2
  102. package/cjs/mark/interface/mark.js.map +1 -1
  103. package/cjs/mark/utils/glyph.js +2 -3
  104. package/cjs/mark/utils/glyph.js.map +1 -1
  105. package/cjs/model/base-model.d.ts +15 -3
  106. package/cjs/model/base-model.js.map +1 -1
  107. package/cjs/model/interface.d.ts +0 -13
  108. package/cjs/model/interface.js.map +1 -1
  109. package/cjs/region/region.d.ts +7 -1
  110. package/cjs/series/area/area.d.ts +0 -2
  111. package/cjs/series/area/area.js +0 -6
  112. package/cjs/series/area/area.js.map +1 -1
  113. package/cjs/series/bar/bar.d.ts +0 -3
  114. package/cjs/series/bar/bar.js +4 -30
  115. package/cjs/series/bar/bar.js.map +1 -1
  116. package/cjs/series/base/base-series.d.ts +7 -8
  117. package/cjs/series/base/base-series.js +13 -54
  118. package/cjs/series/base/base-series.js.map +1 -1
  119. package/cjs/series/base/constant.d.ts +0 -3
  120. package/cjs/series/base/constant.js +1 -9
  121. package/cjs/series/base/constant.js.map +1 -1
  122. package/cjs/series/box-plot/box-plot.d.ts +0 -2
  123. package/cjs/series/box-plot/box-plot.js +2 -14
  124. package/cjs/series/box-plot/box-plot.js.map +1 -1
  125. package/cjs/series/heatmap/heatmap.d.ts +0 -2
  126. package/cjs/series/heatmap/heatmap.js +0 -10
  127. package/cjs/series/heatmap/heatmap.js.map +1 -1
  128. package/cjs/series/line/line.d.ts +0 -2
  129. package/cjs/series/line/line.js +0 -6
  130. package/cjs/series/line/line.js.map +1 -1
  131. package/cjs/series/mixin/line-mixin.d.ts +0 -1
  132. package/cjs/series/mixin/line-mixin.js +1 -6
  133. package/cjs/series/mixin/line-mixin.js.map +1 -1
  134. package/cjs/series/pie/pie.d.ts +7 -3
  135. package/cjs/series/pie/pie.js +1 -16
  136. package/cjs/series/pie/pie.js.map +1 -1
  137. package/cjs/series/progress/circular/circular.d.ts +0 -2
  138. package/cjs/series/progress/circular/circular.js +1 -9
  139. package/cjs/series/progress/circular/circular.js.map +1 -1
  140. package/cjs/series/progress/linear/linear.d.ts +0 -2
  141. package/cjs/series/progress/linear/linear.js +1 -17
  142. package/cjs/series/progress/linear/linear.js.map +1 -1
  143. package/cjs/series/sankey/sankey.js +24 -32
  144. package/cjs/series/sankey/sankey.js.map +1 -1
  145. package/cjs/series/scatter/scatter.d.ts +0 -2
  146. package/cjs/series/scatter/scatter.js +1 -9
  147. package/cjs/series/scatter/scatter.js.map +1 -1
  148. package/cjs/series/waterfall/waterfall.d.ts +2 -2
  149. package/cjs/series/waterfall/waterfall.js +12 -14
  150. package/cjs/series/waterfall/waterfall.js.map +1 -1
  151. package/esm/chart/base/base-chart-transformer.d.ts +0 -3
  152. package/esm/chart/base/base-chart-transformer.js +0 -22
  153. package/esm/chart/base/base-chart-transformer.js.map +1 -1
  154. package/esm/chart/base/base-chart.d.ts +9 -15
  155. package/esm/chart/base/base-chart.js +23 -111
  156. package/esm/chart/base/base-chart.js.map +1 -1
  157. package/esm/chart/interface/chart.d.ts +0 -1
  158. package/esm/chart/interface/chart.js.map +1 -1
  159. package/esm/chart/pie/base/pie-transformer.js +2 -2
  160. package/esm/chart/pie/base/pie-transformer.js.map +1 -1
  161. package/esm/chart/progress/circular/circular-progress-transformer.js +2 -2
  162. package/esm/chart/progress/circular/circular-progress-transformer.js.map +1 -1
  163. package/esm/chart/util.d.ts +1 -4
  164. package/esm/chart/util.js +1 -34
  165. package/esm/chart/util.js.map +1 -1
  166. package/esm/chart/waterfall/waterfall-transformer.js +1 -2
  167. package/esm/chart/waterfall/waterfall-transformer.js.map +1 -1
  168. package/esm/compile/compiler.d.ts +0 -2
  169. package/esm/compile/compiler.js +39 -55
  170. package/esm/compile/compiler.js.map +1 -1
  171. package/esm/compile/data/compilable-data.d.ts +1 -1
  172. package/esm/compile/data/compilable-data.js +1 -1
  173. package/esm/compile/data/compilable-data.js.map +1 -1
  174. package/esm/compile/grammar-item.d.ts +1 -1
  175. package/esm/compile/grammar-item.js.map +1 -1
  176. package/esm/compile/interface/compilable-item.d.ts +1 -1
  177. package/esm/compile/interface/compilable-item.js.map +1 -1
  178. package/esm/compile/interface/compiler.d.ts +1 -2
  179. package/esm/compile/interface/compiler.js.map +1 -1
  180. package/esm/component/axis/base-axis.d.ts +7 -2
  181. package/esm/component/axis/base-axis.js +2 -25
  182. package/esm/component/axis/base-axis.js.map +1 -1
  183. package/esm/component/axis/cartesian/band-axis.d.ts +7 -1
  184. package/esm/component/base/base-component.d.ts +7 -7
  185. package/esm/component/base/base-component.js +5 -41
  186. package/esm/component/base/base-component.js.map +1 -1
  187. package/esm/component/brush/brush.d.ts +7 -2
  188. package/esm/component/brush/brush.js +7 -12
  189. package/esm/component/brush/brush.js.map +1 -1
  190. package/esm/component/crosshair/base.d.ts +7 -1
  191. package/esm/component/custom-mark/custom-mark.d.ts +7 -1
  192. package/esm/component/data-zoom/data-filter-base-component.d.ts +7 -1
  193. package/esm/component/geo/geo-coordinate.d.ts +7 -1
  194. package/esm/component/index.js +2 -1
  195. package/esm/component/label/base-label.d.ts +7 -1
  196. package/esm/component/label/label.js +1 -1
  197. package/esm/component/label/label.js.map +1 -1
  198. package/esm/component/legend/base-legend.d.ts +7 -2
  199. package/esm/component/legend/base-legend.js +3 -21
  200. package/esm/component/legend/base-legend.js.map +1 -1
  201. package/esm/component/marker/base-marker.d.ts +7 -7
  202. package/esm/component/marker/base-marker.js +5 -24
  203. package/esm/component/marker/base-marker.js.map +1 -1
  204. package/esm/component/marker/mark-line/base-mark-line.js +4 -2
  205. package/esm/component/marker/mark-line/base-mark-line.js.map +1 -1
  206. package/esm/component/marker/mark-line/cartesian-mark-line.js +18 -8
  207. package/esm/component/marker/mark-line/cartesian-mark-line.js.map +1 -1
  208. package/esm/component/marker/mark-line/interface/spec.d.ts +9 -2
  209. package/esm/component/marker/mark-line/interface/spec.js.map +1 -1
  210. package/esm/component/title/title.d.ts +7 -1
  211. package/esm/component/title/title.js +2 -6
  212. package/esm/component/title/title.js.map +1 -1
  213. package/esm/component/util.js +1 -2
  214. package/esm/constant/scatter.js +2 -1
  215. package/esm/constant/scroll-bar.js +1 -2
  216. package/esm/core/instance-manager.js +1 -1
  217. package/esm/core/vchart.d.ts +1 -5
  218. package/esm/core/vchart.js +12 -29
  219. package/esm/core/vchart.js.map +1 -1
  220. package/esm/interaction/interaction.js +8 -10
  221. package/esm/interaction/interaction.js.map +1 -1
  222. package/esm/interaction/triggers/element-active-by-legend.js +1 -3
  223. package/esm/interaction/triggers/element-active-by-legend.js.map +1 -1
  224. package/esm/interaction/triggers/element-active.js +2 -4
  225. package/esm/interaction/triggers/element-active.js.map +1 -1
  226. package/esm/interaction/triggers/element-highlight-by-group.js +1 -4
  227. package/esm/interaction/triggers/element-highlight-by-group.js.map +1 -1
  228. package/esm/interaction/triggers/element-highlight-by-legend.js +1 -3
  229. package/esm/interaction/triggers/element-highlight-by-legend.js.map +1 -1
  230. package/esm/interaction/triggers/element-highlight-by-name.js +1 -3
  231. package/esm/interaction/triggers/element-highlight-by-name.js.map +1 -1
  232. package/esm/interaction/triggers/element-highlight.js +1 -3
  233. package/esm/interaction/triggers/element-highlight.js.map +1 -1
  234. package/esm/interaction/triggers/element-select.js +2 -4
  235. package/esm/interaction/triggers/element-select.js.map +1 -1
  236. package/esm/mark/base/base-line.js +2 -2
  237. package/esm/mark/base/base-line.js.map +1 -1
  238. package/esm/mark/base/base-mark.d.ts +2 -13
  239. package/esm/mark/base/base-mark.js +22 -102
  240. package/esm/mark/base/base-mark.js.map +1 -1
  241. package/esm/mark/component.d.ts +0 -9
  242. package/esm/mark/component.js +2 -51
  243. package/esm/mark/component.js.map +1 -1
  244. package/esm/mark/group.js +1 -1
  245. package/esm/mark/group.js.map +1 -1
  246. package/esm/mark/interface/mark.d.ts +0 -2
  247. package/esm/mark/interface/mark.js.map +1 -1
  248. package/esm/mark/utils/glyph.js +1 -3
  249. package/esm/mark/utils/glyph.js.map +1 -1
  250. package/esm/model/base-model.d.ts +15 -3
  251. package/esm/model/base-model.js.map +1 -1
  252. package/esm/model/interface.d.ts +0 -13
  253. package/esm/model/interface.js.map +1 -1
  254. package/esm/region/region.d.ts +7 -1
  255. package/esm/series/area/area.d.ts +0 -2
  256. package/esm/series/area/area.js +1 -7
  257. package/esm/series/area/area.js.map +1 -1
  258. package/esm/series/bar/bar.d.ts +0 -3
  259. package/esm/series/bar/bar.js +4 -30
  260. package/esm/series/bar/bar.js.map +1 -1
  261. package/esm/series/base/base-series.d.ts +7 -8
  262. package/esm/series/base/base-series.js +11 -50
  263. package/esm/series/base/base-series.js.map +1 -1
  264. package/esm/series/base/constant.d.ts +0 -3
  265. package/esm/series/base/constant.js +0 -10
  266. package/esm/series/base/constant.js.map +1 -1
  267. package/esm/series/box-plot/box-plot.d.ts +0 -2
  268. package/esm/series/box-plot/box-plot.js +2 -13
  269. package/esm/series/box-plot/box-plot.js.map +1 -1
  270. package/esm/series/heatmap/heatmap.d.ts +0 -2
  271. package/esm/series/heatmap/heatmap.js +0 -10
  272. package/esm/series/heatmap/heatmap.js.map +1 -1
  273. package/esm/series/line/line.d.ts +0 -2
  274. package/esm/series/line/line.js +1 -7
  275. package/esm/series/line/line.js.map +1 -1
  276. package/esm/series/mixin/line-mixin.d.ts +0 -1
  277. package/esm/series/mixin/line-mixin.js +0 -5
  278. package/esm/series/mixin/line-mixin.js.map +1 -1
  279. package/esm/series/pie/pie.d.ts +7 -3
  280. package/esm/series/pie/pie.js +0 -17
  281. package/esm/series/pie/pie.js.map +1 -1
  282. package/esm/series/progress/circular/circular.d.ts +0 -2
  283. package/esm/series/progress/circular/circular.js +0 -10
  284. package/esm/series/progress/circular/circular.js.map +1 -1
  285. package/esm/series/progress/linear/linear.d.ts +0 -2
  286. package/esm/series/progress/linear/linear.js +0 -18
  287. package/esm/series/progress/linear/linear.js.map +1 -1
  288. package/esm/series/sankey/sankey.js +21 -25
  289. package/esm/series/sankey/sankey.js.map +1 -1
  290. package/esm/series/scatter/scatter.d.ts +0 -2
  291. package/esm/series/scatter/scatter.js +0 -10
  292. package/esm/series/scatter/scatter.js.map +1 -1
  293. package/esm/series/waterfall/waterfall.d.ts +2 -2
  294. package/esm/series/waterfall/waterfall.js +12 -14
  295. package/esm/series/waterfall/waterfall.js.map +1 -1
  296. package/package.json +8 -10
  297. package/cjs/compile/stage-app.d.ts +0 -9
  298. package/cjs/compile/stage-app.js +0 -39
  299. package/cjs/compile/stage-app.js.map +0 -1
  300. package/cjs/component/base/release-vrender-component.d.ts +0 -10
  301. package/cjs/component/base/release-vrender-component.js +0 -37
  302. package/cjs/component/base/release-vrender-component.js.map +0 -1
  303. package/cjs/data/data-view-utils.d.ts +0 -5
  304. package/cjs/data/data-view-utils.js +0 -58
  305. package/cjs/data/data-view-utils.js.map +0 -1
  306. package/cjs/util/graphic-state.d.ts +0 -4
  307. package/cjs/util/graphic-state.js +0 -40
  308. package/cjs/util/graphic-state.js.map +0 -1
  309. package/esm/compile/stage-app.d.ts +0 -9
  310. package/esm/compile/stage-app.js +0 -35
  311. package/esm/compile/stage-app.js.map +0 -1
  312. package/esm/component/base/release-vrender-component.d.ts +0 -10
  313. package/esm/component/base/release-vrender-component.js +0 -24
  314. package/esm/component/base/release-vrender-component.js.map +0 -1
  315. package/esm/data/data-view-utils.d.ts +0 -5
  316. package/esm/data/data-view-utils.js +0 -46
  317. package/esm/data/data-view-utils.js.map +0 -1
  318. package/esm/util/graphic-state.d.ts +0 -4
  319. package/esm/util/graphic-state.js +0 -30
  320. package/esm/util/graphic-state.js.map +0 -1
@@ -38,7 +38,7 @@ import { ChartEvent, HOOK_EVENT } from "../../constant/event";
38
38
 
39
39
  import { DimensionEventEnum } from "../../event/events/dimension/interface";
40
40
 
41
- import { calculateChartSize, isUpdateSpecResultComponentOnly, isUpdateSpecResultLocalOnly, mergeUpdateResult } from "../util";
41
+ import { calculateChartSize, mergeUpdateResult } from "../util";
42
42
 
43
43
  import { isDiscrete } from "@visactor/vscale";
44
44
 
@@ -50,12 +50,6 @@ import { Interaction } from "../../interaction/interaction";
50
50
 
51
51
  import { animationConfig, userAnimationConfig } from "../../animation/utils";
52
52
 
53
- const MARKER_COMPONENT_SPEC_KEYS = {
54
- [ComponentTypeEnum.markPoint]: !0,
55
- [ComponentTypeEnum.markLine]: !0,
56
- [ComponentTypeEnum.markArea]: !0
57
- };
58
-
59
53
  export class BaseChart extends CompilableBase {
60
54
  getSpec() {
61
55
  return this._spec;
@@ -100,7 +94,7 @@ export class BaseChart extends CompilableBase {
100
94
  constructor(spec, option) {
101
95
  var _a, _b, _c, _d;
102
96
  super(option), this.type = "chart", this.id = createID(), this._regions = [], this._series = [],
103
- this._components = [], this._specTransformer = null, this._layoutRect = {
97
+ this._components = [], this._layoutRect = {
104
98
  x: 0,
105
99
  y: 0,
106
100
  width: DEFAULT_CHART_WIDTH,
@@ -159,8 +153,8 @@ export class BaseChart extends CompilableBase {
159
153
  }), this._setModelOption && this._setModelOption(), this._spec = spec;
160
154
  }
161
155
  created(transformer) {
162
- this._specTransformer = transformer, this._chartData.parseData(this._spec.data),
163
- this._createGlobalScale(), this._createBackground(), this._createLayout(), transformer.forEachRegionInSpec(this._spec, this._createRegion.bind(this)),
156
+ this._chartData.parseData(this._spec.data), this._createGlobalScale(), this._createBackground(),
157
+ this._createLayout(), transformer.forEachRegionInSpec(this._spec, this._createRegion.bind(this)),
164
158
  transformer.forEachSeriesInSpec(this._spec, this._createSeries.bind(this)), transformer.forEachComponentInSpec(this._spec, this._createComponent.bind(this), this._option.getSpecInfo());
165
159
  }
166
160
  _initInteractions() {
@@ -452,14 +446,11 @@ export class BaseChart extends CompilableBase {
452
446
  _getSpecKeys(spec) {
453
447
  const ignoreKeys = {
454
448
  width: !0,
455
- height: !0,
456
- xField: !0,
457
- yField: !0
449
+ height: !0
458
450
  };
459
451
  return Object.keys(spec).filter((key => !ignoreKeys[key])).sort();
460
452
  }
461
453
  updateSpec(spec) {
462
- var _a;
463
454
  const result = {
464
455
  change: !1,
465
456
  reMake: !1,
@@ -467,32 +458,20 @@ export class BaseChart extends CompilableBase {
467
458
  reSize: !1,
468
459
  reCompile: !1
469
460
  };
470
- if (spec.type !== this.type) return result.reMake = !0, this.setLayoutTag(!0, null, !1),
461
+ if (this.setLayoutTag(!0, null, !1), spec.type !== this.type) return result.reMake = !0,
471
462
  result;
472
463
  const currentKeys = this._getSpecKeys(this._spec), nextKeys = this._getSpecKeys(spec);
473
- if (!isEqual(currentKeys, nextKeys)) return result.reMake = !0, this.setLayoutTag(!0, null, !1),
474
- result;
464
+ if (!isEqual(currentKeys, nextKeys)) return result.reMake = !0, result;
475
465
  for (let i = 0; i < currentKeys.length; i++) {
476
- const key = currentKeys[i], currentSpec = this._spec[key], nextSpec = spec[key];
477
- if (isArray(currentSpec) && currentSpec.length !== array(nextSpec).length && !this._canRemoveMarkerComponentsWithoutRemake(key, currentSpec, nextSpec)) return result.reMake = !0,
478
- this.setLayoutTag(!0, null, !1), result;
466
+ const key = currentKeys[i];
467
+ if (isArray(this._spec[key]) && this._spec[key].length !== array(spec[key]).length) return result.reMake = !0,
468
+ result;
479
469
  }
480
- const oldSpec = this._spec, onlyMarkerComponentsRemoved = this._isOnlyMarkerComponentsRemoved(this._spec, spec, currentKeys), onlyComponentSpecsChanged = this._isOnlyComponentSpecsChanged(this._spec, spec, currentKeys), onlySeriesSpecsChanged = this._isOnlySeriesSpecsChanged(this._spec, spec, currentKeys);
481
- if (this._spec = spec, onlyMarkerComponentsRemoved) return this._removeMarkerComponentsForEmptySpecs(result),
482
- result;
483
- if (this.updateChartConfig(result, oldSpec), result.reMake) return this.setLayoutTag(!0, null, !1),
484
- result;
485
- if (this.updateGlobalScale(result), result.reMake) return this.setLayoutTag(!0, null, !1),
486
- result;
487
- if (this.updateRegionSpec(result), result.reMake) return this.setLayoutTag(!0, null, !1),
488
- result;
489
- const componentUpdateResult = this.updateComponentSpec(result);
490
- return result.reMake ? (this.setLayoutTag(!0, null, !1), result) : isUpdateSpecResultLocalOnly(result) ? result : onlyComponentSpecsChanged && !componentUpdateResult.hasNonComponentOnlyUpdate && isUpdateSpecResultComponentOnly(result) ? (componentUpdateResult.componentOnlyUpdatedComponents.forEach((component => {
491
- component.reInit(component.getSpec());
492
- })), (null === (_a = result.effects) || void 0 === _a ? void 0 : _a.layout) && this.setLayoutTag(!0, null, !1),
493
- result) : (this.setLayoutTag(!0, null, !1), this.updateSeriesSpec(result), result.reMake || (this.reInit(),
494
- onlySeriesSpecsChanged && this._canSkipChartDataStages(result) || (this.updateDataSpec(),
495
- this.updateGlobalScaleDomain())), result);
470
+ const oldSpec = this._spec;
471
+ return this._spec = spec, this.updateChartConfig(result, oldSpec), result.reMake ? result : (this.updateGlobalScale(result),
472
+ result.reMake ? result : (this.updateRegionSpec(result), result.reMake ? result : (this.updateComponentSpec(result),
473
+ result.reMake ? result : (this.updateSeriesSpec(result), result.reMake || (this.reInit(),
474
+ this.updateDataSpec(), this.updateGlobalScaleDomain()), result))));
496
475
  }
497
476
  updateChartConfig(result, oldSpec) {
498
477
  var _a, _b;
@@ -509,99 +488,32 @@ export class BaseChart extends CompilableBase {
509
488
  })) : result.reMake = !0);
510
489
  }
511
490
  updateComponentSpec(result) {
512
- const componentOnlyUpdatedComponents = [];
513
- let hasNonComponentOnlyUpdate = !1;
514
491
  const componentCache = {}, checkVisibleComponents = {
515
492
  [ComponentTypeEnum.title]: !0,
516
493
  [ComponentTypeEnum.brush]: !0,
517
494
  [ComponentTypeEnum.indicator]: !0
518
- }, removedComponents = [];
495
+ };
519
496
  this._components.forEach((c => {
520
497
  var _a, _b;
521
498
  if (c.type === ComponentTypeEnum.label || c.type === ComponentTypeEnum.totalLabel) return;
522
499
  checkVisibleComponents[c.type] && (checkVisibleComponents[c.type] = !1);
523
500
  const compSpecKey = c.specKey || c.type, cmpSpec = null !== (_a = this._spec[compSpecKey]) && void 0 !== _a ? _a : {};
524
- if (isArray(cmpSpec)) {
525
- if (componentCache[compSpecKey] = componentCache[compSpecKey] || {
526
- specCount: cmpSpec.length,
527
- componentCount: 0
528
- }, this._canRemoveMarkerComponentsWithoutRemake(compSpecKey, [ c.getSpec() ], cmpSpec)) return void removedComponents.push(c);
529
- componentCache[compSpecKey].componentCount++;
530
- const componentSpec = null !== (_b = cmpSpec[c.getSpecIndex()]) && void 0 !== _b ? _b : {}, previousComponentSpec = c.getSpec(), componentResult = c.updateSpec(componentSpec, cmpSpec);
531
- isUpdateSpecResultComponentOnly(componentResult) ? componentOnlyUpdatedComponents.push(c) : isEqual(previousComponentSpec, componentSpec) || (hasNonComponentOnlyUpdate = !0),
532
- mergeUpdateResult(result, componentResult);
533
- } else {
534
- const previousComponentSpec = c.getSpec(), componentResult = c.updateSpec(cmpSpec);
535
- isUpdateSpecResultComponentOnly(componentResult) ? componentOnlyUpdatedComponents.push(c) : isEqual(previousComponentSpec, cmpSpec) || (hasNonComponentOnlyUpdate = !0),
536
- mergeUpdateResult(result, componentResult);
537
- }
501
+ isArray(cmpSpec) ? (componentCache[compSpecKey] = componentCache[compSpecKey] || {
502
+ specCount: cmpSpec.length,
503
+ componentCount: 0
504
+ }, componentCache[compSpecKey].componentCount++, mergeUpdateResult(result, c.updateSpec(null !== (_b = cmpSpec[c.getSpecIndex()]) && void 0 !== _b ? _b : {}, cmpSpec))) : mergeUpdateResult(result, c.updateSpec(cmpSpec));
538
505
  }));
539
506
  for (const key in componentCache) if (Object.prototype.hasOwnProperty.call(componentCache, key)) {
540
507
  const element = componentCache[key];
541
508
  element.componentCount !== element.specCount && (result.reMake = !0);
542
509
  }
543
- removedComponents.length && (removedComponents.forEach((component => {
544
- this._removeComponent(component);
545
- })), result.change = !0, result.effects = Object.assign(Object.assign({}, result.effects), {
546
- component: !0,
547
- localOnly: !0
548
- }));
549
510
  const isVisible = compSpec => compSpec && !1 !== compSpec.visible;
550
- return Object.keys(checkVisibleComponents).forEach((type => {
511
+ Object.keys(checkVisibleComponents).forEach((type => {
551
512
  if (checkVisibleComponents[type]) {
552
513
  const compSpec = this._spec[type];
553
514
  (isArray(compSpec) ? compSpec.some(isVisible) : isVisible(compSpec)) && (result.reMake = !0);
554
515
  }
555
- })), {
556
- componentOnlyUpdatedComponents: componentOnlyUpdatedComponents,
557
- hasNonComponentOnlyUpdate: hasNonComponentOnlyUpdate
558
- };
559
- }
560
- _canRemoveMarkerComponentsWithoutRemake(key, currentSpec, nextSpec) {
561
- return MARKER_COMPONENT_SPEC_KEYS[key] && isArray(currentSpec) && currentSpec.length > 0 && isArray(nextSpec) && 0 === nextSpec.length;
562
- }
563
- _isOnlyMarkerComponentsRemoved(currentSpec, nextSpec, specKeys) {
564
- let hasMarkerRemoval = !1;
565
- const onlyMarkerRemoval = specKeys.every((key => this._canRemoveMarkerComponentsWithoutRemake(key, currentSpec[key], nextSpec[key]) ? (hasMarkerRemoval = !0,
566
- !0) : isEqual(currentSpec[key], nextSpec[key])));
567
- return hasMarkerRemoval && onlyMarkerRemoval;
568
- }
569
- _isComponentSpecKey(key) {
570
- return this._components.some((component => (component.specKey || component.type) === key));
571
- }
572
- _isOnlyComponentSpecsChanged(currentSpec, nextSpec, specKeys) {
573
- let hasComponentSpecChange = !1;
574
- const currentSpecRecord = currentSpec, nextSpecRecord = nextSpec, onlyComponentSpecChange = specKeys.every((key => !!isEqual(currentSpecRecord[key], nextSpecRecord[key]) || !!this._isComponentSpecKey(key) && (hasComponentSpecChange = !0,
575
- !0)));
576
- return hasComponentSpecChange && onlyComponentSpecChange;
577
- }
578
- _isOnlySeriesSpecsChanged(currentSpec, nextSpec, specKeys) {
579
- var _a, _b;
580
- let hasSeriesSpecChange = !1;
581
- const currentSpecRecord = currentSpec, nextSpecRecord = nextSpec, seriesRelatedSpecKeys = null !== (_b = null === (_a = this._specTransformer) || void 0 === _a ? void 0 : _a.getSeriesRelatedSpecKeys()) && void 0 !== _b ? _b : {}, onlySeriesSpecChange = specKeys.every((key => !!isEqual(currentSpecRecord[key], nextSpecRecord[key]) || !!seriesRelatedSpecKeys[key] && (hasSeriesSpecChange = !0,
582
- !0)));
583
- return hasSeriesSpecChange && onlySeriesSpecChange;
584
- }
585
- _canSkipChartDataStages(result) {
586
- const effects = result.effects;
587
- return !(!(null == effects ? void 0 : effects.series) || effects.remake || effects.data || effects.scaleDomain || result.reMake);
588
- }
589
- _removeMarkerComponentsForEmptySpecs(result) {
590
- const removedComponents = this._components.filter((component => {
591
- var _a;
592
- const compSpecKey = component.specKey || component.type, cmpSpec = null !== (_a = this._spec[compSpecKey]) && void 0 !== _a ? _a : {};
593
- return this._canRemoveMarkerComponentsWithoutRemake(compSpecKey, [ component.getSpec() ], cmpSpec);
594
516
  }));
595
- removedComponents.length && (removedComponents.forEach((component => {
596
- this._removeComponent(component);
597
- })), result.change = !0, result.effects = Object.assign(Object.assign({}, result.effects), {
598
- component: !0,
599
- localOnly: !0
600
- }));
601
- }
602
- _removeComponent(component) {
603
- this._components = this._components.filter((c => c !== component)), this._idMap.delete(component.id),
604
- component.release();
605
517
  }
606
518
  updateSeriesSpec(result) {
607
519
  this._spec.series.length === this._series.length ? this._series.forEach((s => {
@@ -698,8 +610,8 @@ export class BaseChart extends CompilableBase {
698
610
  c.compile();
699
611
  })), null === (_d = null === (_c = this._option.performanceHook) || void 0 === _c ? void 0 : _c.afterComponentCompile) || void 0 === _d || _d.call(_c, this._option.globalInstance);
700
612
  }
701
- release(forceReleaseVRenderComponents = !0) {
702
- forceReleaseVRenderComponents && [ ...this._components, ...this._regions, ...this._series ].forEach((m => {
613
+ release() {
614
+ [ ...this._components, ...this._regions, ...this._series ].forEach((m => {
703
615
  m.beforeRelease();
704
616
  })), super.release(), this.clear(), [ ...this._components, ...this._regions, ...this._series ].forEach((m => {
705
617
  m.release();