@visactor/vchart 1.2.3 → 1.3.0-beta.10

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 (741) hide show
  1. package/build/es5/index.js +3 -3
  2. package/build/index.js +23611 -20832
  3. package/build/index.min.js +15 -1
  4. package/build/tsconfig.tsbuildinfo +1 -1
  5. package/cjs/animation/spec.d.ts +1 -1
  6. package/cjs/animation/spec.js.map +1 -1
  7. package/cjs/chart/area/area.js +2 -3
  8. package/cjs/chart/area/area.js.map +1 -1
  9. package/cjs/chart/bar/bar-3d.js +2 -2
  10. package/cjs/chart/bar/bar-3d.js.map +1 -1
  11. package/cjs/chart/bar/bar.js +2 -2
  12. package/cjs/chart/bar/bar.js.map +1 -1
  13. package/cjs/chart/base-chart.d.ts +4 -2
  14. package/cjs/chart/base-chart.js +33 -34
  15. package/cjs/chart/base-chart.js.map +1 -1
  16. package/cjs/chart/box-plot/box-plot.js +2 -2
  17. package/cjs/chart/box-plot/box-plot.js.map +1 -1
  18. package/cjs/chart/cartesian/cartesian.js +2 -1
  19. package/cjs/chart/cartesian/cartesian.js.map +1 -1
  20. package/cjs/chart/circle-packing/circle-packing.js +2 -2
  21. package/cjs/chart/circle-packing/circle-packing.js.map +1 -1
  22. package/cjs/chart/funnel/funnel-3d.js +2 -2
  23. package/cjs/chart/funnel/funnel-3d.js.map +1 -1
  24. package/cjs/chart/funnel/funnel.js +2 -2
  25. package/cjs/chart/funnel/funnel.js.map +1 -1
  26. package/cjs/chart/gauge/gauge.js +2 -2
  27. package/cjs/chart/gauge/gauge.js.map +1 -1
  28. package/cjs/chart/heatmap/heatmap.js +2 -2
  29. package/cjs/chart/heatmap/heatmap.js.map +1 -1
  30. package/cjs/chart/histogram/histogram-3d.js +2 -2
  31. package/cjs/chart/histogram/histogram-3d.js.map +1 -1
  32. package/cjs/chart/histogram/histogram.js +2 -2
  33. package/cjs/chart/histogram/histogram.js.map +1 -1
  34. package/cjs/chart/interface/chart.d.ts +4 -2
  35. package/cjs/chart/interface/chart.js.map +1 -1
  36. package/cjs/chart/line/line.js +2 -3
  37. package/cjs/chart/line/line.js.map +1 -1
  38. package/cjs/chart/map/map.js +2 -2
  39. package/cjs/chart/map/map.js.map +1 -1
  40. package/cjs/chart/pie/pie-3d.js +2 -2
  41. package/cjs/chart/pie/pie-3d.js.map +1 -1
  42. package/cjs/chart/pie/pie.js +2 -2
  43. package/cjs/chart/pie/pie.js.map +1 -1
  44. package/cjs/chart/progress/circular/circular.js +2 -2
  45. package/cjs/chart/progress/circular/circular.js.map +1 -1
  46. package/cjs/chart/progress/linear/linear.js +2 -2
  47. package/cjs/chart/progress/linear/linear.js.map +1 -1
  48. package/cjs/chart/radar/radar.js +2 -3
  49. package/cjs/chart/radar/radar.js.map +1 -1
  50. package/cjs/chart/range-area/range-area.js +2 -2
  51. package/cjs/chart/range-area/range-area.js.map +1 -1
  52. package/cjs/chart/range-column/range-column-3d.js +2 -2
  53. package/cjs/chart/range-column/range-column-3d.js.map +1 -1
  54. package/cjs/chart/range-column/range-column.js +2 -2
  55. package/cjs/chart/range-column/range-column.js.map +1 -1
  56. package/cjs/chart/rose/rose.js +2 -2
  57. package/cjs/chart/rose/rose.js.map +1 -1
  58. package/cjs/chart/sankey/sankey.js +2 -2
  59. package/cjs/chart/sankey/sankey.js.map +1 -1
  60. package/cjs/chart/scatter/scatter.js +2 -2
  61. package/cjs/chart/scatter/scatter.js.map +1 -1
  62. package/cjs/chart/sequence/sequence.js +2 -2
  63. package/cjs/chart/sequence/sequence.js.map +1 -1
  64. package/cjs/chart/stack.d.ts +1 -0
  65. package/cjs/chart/stack.js +14 -0
  66. package/cjs/chart/stack.js.map +1 -1
  67. package/cjs/chart/sunburst/sunburst.js +2 -2
  68. package/cjs/chart/sunburst/sunburst.js.map +1 -1
  69. package/cjs/chart/treemap/treemap.js +2 -2
  70. package/cjs/chart/treemap/treemap.js.map +1 -1
  71. package/cjs/chart/util.d.ts +8 -0
  72. package/cjs/chart/util.js +32 -3
  73. package/cjs/chart/util.js.map +1 -1
  74. package/cjs/chart/waterfall/waterfall.js +2 -2
  75. package/cjs/chart/waterfall/waterfall.js.map +1 -1
  76. package/cjs/chart/word-cloud/word-cloud-3d.js +2 -2
  77. package/cjs/chart/word-cloud/word-cloud-3d.js.map +1 -1
  78. package/cjs/chart/word-cloud/word-cloud.js +2 -2
  79. package/cjs/chart/word-cloud/word-cloud.js.map +1 -1
  80. package/cjs/compile/compiler.d.ts +1 -1
  81. package/cjs/compile/compiler.js +4 -3
  82. package/cjs/compile/compiler.js.map +1 -1
  83. package/cjs/compile/mark/compilable-mark.js +9 -10
  84. package/cjs/compile/mark/compilable-mark.js.map +1 -1
  85. package/cjs/compile/mark/interface.d.ts +2 -1
  86. package/cjs/compile/mark/interface.js.map +1 -1
  87. package/cjs/compile/mark/util.d.ts +2 -1
  88. package/cjs/compile/mark/util.js +21 -5
  89. package/cjs/compile/mark/util.js.map +1 -1
  90. package/cjs/component/axis/base-axis.d.ts +1 -12
  91. package/cjs/component/axis/base-axis.js +7 -17
  92. package/cjs/component/axis/base-axis.js.map +1 -1
  93. package/cjs/component/axis/cartesian/axis.js +15 -6
  94. package/cjs/component/axis/cartesian/axis.js.map +1 -1
  95. package/cjs/component/axis/cartesian/band-axis.d.ts +1 -0
  96. package/cjs/component/axis/cartesian/band-axis.js +1 -0
  97. package/cjs/component/axis/cartesian/band-axis.js.map +1 -1
  98. package/cjs/component/axis/cartesian/index.d.ts +1 -0
  99. package/cjs/component/axis/cartesian/index.js +2 -1
  100. package/cjs/component/axis/cartesian/index.js.map +1 -1
  101. package/cjs/component/axis/cartesian/interface/common.d.ts +6 -1
  102. package/cjs/component/axis/cartesian/interface/common.js.map +1 -1
  103. package/cjs/component/axis/cartesian/interface/spec.d.ts +4 -1
  104. package/cjs/component/axis/cartesian/interface/spec.js.map +1 -1
  105. package/cjs/component/axis/cartesian/linear-axis.js +4 -3
  106. package/cjs/component/axis/cartesian/linear-axis.js.map +1 -1
  107. package/cjs/component/axis/cartesian/symlog-axis.d.ts +15 -0
  108. package/cjs/component/axis/cartesian/symlog-axis.js +23 -0
  109. package/cjs/component/axis/cartesian/symlog-axis.js.map +1 -0
  110. package/cjs/component/axis/interface.d.ts +3 -1
  111. package/cjs/component/axis/interface.js.map +1 -1
  112. package/cjs/component/axis/polar/axis.d.ts +1 -0
  113. package/cjs/component/axis/polar/axis.js +5 -2
  114. package/cjs/component/axis/polar/axis.js.map +1 -1
  115. package/cjs/component/axis/polar/band-axis.d.ts +1 -0
  116. package/cjs/component/base/base-component.d.ts +3 -2
  117. package/cjs/component/base/base-component.js +3 -3
  118. package/cjs/component/base/base-component.js.map +1 -1
  119. package/cjs/component/base/util.js +3 -0
  120. package/cjs/component/base/util.js.map +1 -1
  121. package/cjs/component/brush/brush.d.ts +11 -1
  122. package/cjs/component/brush/brush.js +61 -51
  123. package/cjs/component/brush/brush.js.map +1 -1
  124. package/cjs/component/crosshair/base.d.ts +1 -0
  125. package/cjs/component/crosshair/cartesian.js +1 -1
  126. package/cjs/component/crosshair/cartesian.js.map +1 -1
  127. package/cjs/component/crosshair/polar.js +3 -3
  128. package/cjs/component/crosshair/polar.js.map +1 -1
  129. package/cjs/component/custom-mark/custom-mark.d.ts +1 -0
  130. package/cjs/component/data-zoom/data-filter-base-component.d.ts +1 -0
  131. package/cjs/component/geo/geo-coordinate.d.ts +7 -2
  132. package/cjs/component/geo/geo-coordinate.js +54 -14
  133. package/cjs/component/geo/geo-coordinate.js.map +1 -1
  134. package/cjs/component/index.d.ts +3 -2
  135. package/cjs/component/index.js +15 -1
  136. package/cjs/component/index.js.map +1 -1
  137. package/cjs/component/indicator/indicator.js.map +1 -1
  138. package/cjs/component/interface/theme.d.ts +2 -0
  139. package/cjs/component/interface/theme.js.map +1 -1
  140. package/cjs/component/interface/type.d.ts +2 -0
  141. package/cjs/component/interface/type.js +13 -12
  142. package/cjs/component/interface/type.js.map +1 -1
  143. package/cjs/component/label/base-label.d.ts +40 -0
  144. package/cjs/component/label/base-label.js +44 -0
  145. package/cjs/component/label/base-label.js.map +1 -0
  146. package/cjs/component/label/interface.d.ts +7 -0
  147. package/cjs/component/label/interface.js.map +1 -1
  148. package/cjs/component/label/label.d.ts +5 -27
  149. package/cjs/component/label/label.js +31 -38
  150. package/cjs/component/label/label.js.map +1 -1
  151. package/cjs/component/label/pie.d.ts +5 -0
  152. package/cjs/component/label/pie.js +21 -0
  153. package/cjs/component/label/pie.js.map +1 -0
  154. package/cjs/component/label/totalLabel.d.ts +27 -0
  155. package/cjs/component/label/totalLabel.js +107 -0
  156. package/cjs/component/label/totalLabel.js.map +1 -0
  157. package/cjs/component/label/util.d.ts +3 -1
  158. package/cjs/component/label/util.js +5 -5
  159. package/cjs/component/label/util.js.map +1 -1
  160. package/cjs/component/legend/base-legend.d.ts +1 -0
  161. package/cjs/component/marker/base-marker.d.ts +6 -0
  162. package/cjs/component/marker/base-marker.js +14 -0
  163. package/cjs/component/marker/base-marker.js.map +1 -1
  164. package/cjs/component/marker/interface.d.ts +1 -0
  165. package/cjs/component/marker/interface.js.map +1 -1
  166. package/cjs/component/marker/mark-area/mark-area.js +17 -6
  167. package/cjs/component/marker/mark-area/mark-area.js.map +1 -1
  168. package/cjs/component/marker/mark-line/mark-line.js +17 -6
  169. package/cjs/component/marker/mark-line/mark-line.js.map +1 -1
  170. package/cjs/component/marker/mark-point/mark-point.js +18 -7
  171. package/cjs/component/marker/mark-point/mark-point.js.map +1 -1
  172. package/cjs/component/title/title.d.ts +1 -0
  173. package/cjs/component/title/title.js +2 -1
  174. package/cjs/component/title/title.js.map +1 -1
  175. package/cjs/component/tooltip/handler/base.js.map +1 -1
  176. package/cjs/component/tooltip/handler/dom/dom-tooltip-handler.d.ts +1 -1
  177. package/cjs/component/tooltip/handler/dom/dom-tooltip-handler.js.map +1 -1
  178. package/cjs/component/tooltip/handler/dom/interface.d.ts +9 -12
  179. package/cjs/component/tooltip/handler/dom/interface.js.map +1 -1
  180. package/cjs/component/tooltip/handler/dom/model/content-column-model.d.ts +4 -6
  181. package/cjs/component/tooltip/handler/dom/model/content-column-model.js +17 -15
  182. package/cjs/component/tooltip/handler/dom/model/content-column-model.js.map +1 -1
  183. package/cjs/component/tooltip/handler/dom/model/title-model.js +3 -3
  184. package/cjs/component/tooltip/handler/dom/model/title-model.js.map +1 -1
  185. package/cjs/component/tooltip/handler/dom/util.js +18 -11
  186. package/cjs/component/tooltip/handler/dom/util.js.map +1 -1
  187. package/cjs/component/tooltip/handler/utils/attribute.js +25 -24
  188. package/cjs/component/tooltip/handler/utils/attribute.js.map +1 -1
  189. package/cjs/component/tooltip/handler/utils/compose.d.ts +2 -2
  190. package/cjs/component/tooltip/handler/utils/compose.js +13 -10
  191. package/cjs/component/tooltip/handler/utils/compose.js.map +1 -1
  192. package/cjs/component/tooltip/handler/utils/get-spec.js +2 -2
  193. package/cjs/component/tooltip/handler/utils/get-spec.js.map +1 -1
  194. package/cjs/component/tooltip/handler/utils/style.d.ts +1 -1
  195. package/cjs/component/tooltip/handler/utils/style.js +15 -10
  196. package/cjs/component/tooltip/handler/utils/style.js.map +1 -1
  197. package/cjs/component/tooltip/interface/theme.d.ts +1 -0
  198. package/cjs/component/tooltip/interface/theme.js.map +1 -1
  199. package/cjs/component/tooltip/tooltip.d.ts +1 -1
  200. package/cjs/component/tooltip/tooltip.js +10 -7
  201. package/cjs/component/tooltip/tooltip.js.map +1 -1
  202. package/cjs/constant/index.d.ts +3 -0
  203. package/cjs/constant/index.js +4 -3
  204. package/cjs/constant/index.js.map +1 -1
  205. package/cjs/core/index.d.ts +1 -1
  206. package/cjs/core/index.js +1 -1
  207. package/cjs/core/index.js.map +1 -1
  208. package/cjs/core/interface.d.ts +3 -0
  209. package/cjs/core/interface.js.map +1 -1
  210. package/cjs/core/vchart.d.ts +6 -1
  211. package/cjs/core/vchart.js +51 -11
  212. package/cjs/core/vchart.js.map +1 -1
  213. package/cjs/data/initialize.js +9 -7
  214. package/cjs/data/initialize.js.map +1 -1
  215. package/cjs/data/transforms/dimension-statistics.d.ts +11 -5
  216. package/cjs/data/transforms/dimension-statistics.js +34 -22
  217. package/cjs/data/transforms/dimension-statistics.js.map +1 -1
  218. package/cjs/data/transforms/invalid-travel.js +1 -2
  219. package/cjs/data/transforms/invalid-travel.js.map +1 -1
  220. package/cjs/data/transforms/tick-data/continuous.js +6 -3
  221. package/cjs/data/transforms/tick-data/continuous.js.map +1 -1
  222. package/cjs/data/transforms/tick-data/interface.d.ts +3 -0
  223. package/cjs/data/transforms/tick-data/interface.js.map +1 -1
  224. package/cjs/event/event-dispatcher.js +4 -2
  225. package/cjs/event/event-dispatcher.js.map +1 -1
  226. package/cjs/event/events/dimension/dimension-click.d.ts +1 -3
  227. package/cjs/event/events/dimension/dimension-click.js +9 -10
  228. package/cjs/event/events/dimension/dimension-click.js.map +1 -1
  229. package/cjs/event/events/dimension/dimension-hover.d.ts +2 -3
  230. package/cjs/event/events/dimension/dimension-hover.js +26 -17
  231. package/cjs/event/events/dimension/dimension-hover.js.map +1 -1
  232. package/cjs/event/interface.d.ts +3 -3
  233. package/cjs/event/interface.js.map +1 -1
  234. package/cjs/interaction/trigger.js +4 -0
  235. package/cjs/interaction/trigger.js.map +1 -1
  236. package/cjs/layout/label/arc-label.js.map +1 -1
  237. package/cjs/mark/base/base-mark.d.ts +1 -0
  238. package/cjs/mark/base/base-mark.js +20 -3
  239. package/cjs/mark/base/base-mark.js.map +1 -1
  240. package/cjs/mark/symbol.js +1 -1
  241. package/cjs/mark/symbol.js.map +1 -1
  242. package/cjs/model/base-model.d.ts +2 -0
  243. package/cjs/model/base-model.js +2 -0
  244. package/cjs/model/base-model.js.map +1 -1
  245. package/cjs/model/interface.d.ts +6 -1
  246. package/cjs/model/interface.js.map +1 -1
  247. package/cjs/model/layout-item.d.ts +4 -4
  248. package/cjs/model/layout-item.js.map +1 -1
  249. package/cjs/plugin/components/index.d.ts +0 -2
  250. package/cjs/plugin/components/index.js +1 -2
  251. package/cjs/plugin/components/index.js.map +1 -1
  252. package/cjs/region/region.d.ts +1 -0
  253. package/cjs/series/area/area.d.ts +6 -3
  254. package/cjs/series/area/area.js +36 -12
  255. package/cjs/series/area/area.js.map +1 -1
  256. package/cjs/series/area/tooltip-helpter.d.ts +5 -0
  257. package/cjs/series/area/tooltip-helpter.js +24 -0
  258. package/cjs/series/area/tooltip-helpter.js.map +1 -0
  259. package/cjs/series/bar/bar.d.ts +1 -0
  260. package/cjs/series/bar/bar.js +1 -1
  261. package/cjs/series/bar/bar.js.map +1 -1
  262. package/cjs/series/base/base-series.d.ts +4 -0
  263. package/cjs/series/base/base-series.js +62 -16
  264. package/cjs/series/base/base-series.js.map +1 -1
  265. package/cjs/series/base/tooltip-helper.js +4 -2
  266. package/cjs/series/base/tooltip-helper.js.map +1 -1
  267. package/cjs/series/box-plot/box-plot.js +1 -1
  268. package/cjs/series/box-plot/box-plot.js.map +1 -1
  269. package/cjs/series/cartesian/cartesian.d.ts +7 -3
  270. package/cjs/series/cartesian/cartesian.js +27 -17
  271. package/cjs/series/cartesian/cartesian.js.map +1 -1
  272. package/cjs/series/dot/dot.d.ts +1 -0
  273. package/cjs/series/dot/dot.js +3 -0
  274. package/cjs/series/dot/dot.js.map +1 -1
  275. package/cjs/series/funnel/funnel.d.ts +1 -0
  276. package/cjs/series/geo/geo.d.ts +2 -0
  277. package/cjs/series/geo/geo.js +5 -1
  278. package/cjs/series/geo/geo.js.map +1 -1
  279. package/cjs/series/heatmap/heatmap.d.ts +1 -0
  280. package/cjs/series/interface/common.d.ts +1 -0
  281. package/cjs/series/interface/common.js.map +1 -1
  282. package/cjs/series/interface/series.d.ts +3 -2
  283. package/cjs/series/interface/series.js.map +1 -1
  284. package/cjs/series/line/interface.d.ts +0 -2
  285. package/cjs/series/line/interface.js.map +1 -1
  286. package/cjs/series/line/line.d.ts +1 -2
  287. package/cjs/series/line/line.js +1 -1
  288. package/cjs/series/line/line.js.map +1 -1
  289. package/cjs/series/link/link.js +1 -1
  290. package/cjs/series/link/link.js.map +1 -1
  291. package/cjs/series/map/interface.d.ts +1 -0
  292. package/cjs/series/map/interface.js.map +1 -1
  293. package/cjs/series/map/map.d.ts +1 -2
  294. package/cjs/series/map/map.js +9 -9
  295. package/cjs/series/map/map.js.map +1 -1
  296. package/cjs/series/mixin/line-mixin.d.ts +4 -1
  297. package/cjs/series/mixin/line-mixin.js +37 -21
  298. package/cjs/series/mixin/line-mixin.js.map +1 -1
  299. package/cjs/series/pie/interface.d.ts +4 -7
  300. package/cjs/series/pie/interface.js.map +1 -1
  301. package/cjs/series/pie/pie.d.ts +2 -0
  302. package/cjs/series/pie/pie.js +19 -56
  303. package/cjs/series/pie/pie.js.map +1 -1
  304. package/cjs/series/polar/polar.d.ts +1 -0
  305. package/cjs/series/polar/polar.js +2 -1
  306. package/cjs/series/polar/polar.js.map +1 -1
  307. package/cjs/series/range-area/range-area.d.ts +2 -0
  308. package/cjs/series/range-area/range-area.js +8 -2
  309. package/cjs/series/range-area/range-area.js.map +1 -1
  310. package/cjs/series/range-column/range-column.js +1 -1
  311. package/cjs/series/range-column/range-column.js.map +1 -1
  312. package/cjs/series/rose/interface.d.ts +3 -0
  313. package/cjs/series/rose/interface.js.map +1 -1
  314. package/cjs/series/rose/rose.d.ts +1 -2
  315. package/cjs/series/rose/rose.js +17 -36
  316. package/cjs/series/rose/rose.js.map +1 -1
  317. package/cjs/series/sankey/interface.d.ts +3 -2
  318. package/cjs/series/sankey/interface.js.map +1 -1
  319. package/cjs/series/sankey/sankey.d.ts +2 -0
  320. package/cjs/series/sankey/sankey.js +198 -79
  321. package/cjs/series/sankey/sankey.js.map +1 -1
  322. package/cjs/series/scatter/interface.d.ts +1 -2
  323. package/cjs/series/scatter/interface.js.map +1 -1
  324. package/cjs/series/scatter/scatter.d.ts +2 -3
  325. package/cjs/series/scatter/scatter.js +19 -13
  326. package/cjs/series/scatter/scatter.js.map +1 -1
  327. package/cjs/series/word-cloud/base.d.ts +1 -0
  328. package/cjs/theme/buildin-theme/light/component/axis/symlog-axis.d.ts +2 -0
  329. package/cjs/theme/buildin-theme/light/component/axis/symlog-axis.js +22 -0
  330. package/cjs/theme/buildin-theme/light/component/axis/symlog-axis.js.map +1 -0
  331. package/cjs/theme/buildin-theme/light/component/index.js +3 -2
  332. package/cjs/theme/buildin-theme/light/component/index.js.map +1 -1
  333. package/cjs/theme/buildin-theme/light/component/total-label.d.ts +2 -0
  334. package/cjs/theme/buildin-theme/light/component/total-label.js +24 -0
  335. package/cjs/theme/buildin-theme/light/component/total-label.js.map +1 -0
  336. package/cjs/theme/buildin-theme/light/series/rose.js +0 -1
  337. package/cjs/theme/buildin-theme/light/series/rose.js.map +1 -1
  338. package/cjs/theme/buildin-theme/light/series/sankey.js +0 -1
  339. package/cjs/theme/buildin-theme/light/series/sankey.js.map +1 -1
  340. package/cjs/typings/spec/common.d.ts +10 -4
  341. package/cjs/typings/spec/common.js.map +1 -1
  342. package/cjs/typings/tooltip/label.d.ts +10 -0
  343. package/cjs/typings/tooltip/label.js +6 -0
  344. package/cjs/typings/tooltip/label.js.map +1 -0
  345. package/cjs/typings/tooltip/line.d.ts +3 -2
  346. package/cjs/typings/tooltip/line.js.map +1 -1
  347. package/cjs/typings/tooltip/shape.d.ts +2 -0
  348. package/cjs/typings/tooltip/shape.js.map +1 -1
  349. package/cjs/typings/visual.d.ts +11 -21
  350. package/cjs/typings/visual.js.map +1 -1
  351. package/cjs/util/data.d.ts +0 -8
  352. package/cjs/util/data.js +2 -9
  353. package/cjs/util/data.js.map +1 -1
  354. package/cjs/util/object.d.ts +0 -2
  355. package/cjs/util/object.js +2 -13
  356. package/cjs/util/object.js.map +1 -1
  357. package/cjs/util/scale.d.ts +2 -6
  358. package/cjs/util/scale.js +1 -6
  359. package/cjs/util/scale.js.map +1 -1
  360. package/cjs/util/space.d.ts +3 -9
  361. package/cjs/util/space.js +14 -30
  362. package/cjs/util/space.js.map +1 -1
  363. package/cjs/util/text.d.ts +1 -2
  364. package/cjs/util/text.js +1 -11
  365. package/cjs/util/text.js.map +1 -1
  366. package/cjs/vchart-all.js +1 -1
  367. package/cjs/vchart-all.js.map +1 -1
  368. package/cjs/vchart-simple.js +3 -4
  369. package/cjs/vchart-simple.js.map +1 -1
  370. package/esm/animation/spec.d.ts +1 -1
  371. package/esm/animation/spec.js.map +1 -1
  372. package/esm/chart/area/area.js +3 -4
  373. package/esm/chart/area/area.js.map +1 -1
  374. package/esm/chart/bar/bar-3d.js +2 -2
  375. package/esm/chart/bar/bar-3d.js.map +1 -1
  376. package/esm/chart/bar/bar.js +2 -2
  377. package/esm/chart/bar/bar.js.map +1 -1
  378. package/esm/chart/base-chart.d.ts +4 -2
  379. package/esm/chart/base-chart.js +36 -35
  380. package/esm/chart/base-chart.js.map +1 -1
  381. package/esm/chart/box-plot/box-plot.js +1 -1
  382. package/esm/chart/box-plot/box-plot.js.map +1 -1
  383. package/esm/chart/cartesian/cartesian.js +2 -1
  384. package/esm/chart/cartesian/cartesian.js.map +1 -1
  385. package/esm/chart/circle-packing/circle-packing.js +1 -1
  386. package/esm/chart/circle-packing/circle-packing.js.map +1 -1
  387. package/esm/chart/funnel/funnel-3d.js +1 -1
  388. package/esm/chart/funnel/funnel-3d.js.map +1 -1
  389. package/esm/chart/funnel/funnel.js +1 -1
  390. package/esm/chart/funnel/funnel.js.map +1 -1
  391. package/esm/chart/gauge/gauge.js +2 -2
  392. package/esm/chart/gauge/gauge.js.map +1 -1
  393. package/esm/chart/heatmap/heatmap.js +1 -1
  394. package/esm/chart/heatmap/heatmap.js.map +1 -1
  395. package/esm/chart/histogram/histogram-3d.js +2 -2
  396. package/esm/chart/histogram/histogram-3d.js.map +1 -1
  397. package/esm/chart/histogram/histogram.js +2 -2
  398. package/esm/chart/histogram/histogram.js.map +1 -1
  399. package/esm/chart/interface/chart.d.ts +4 -2
  400. package/esm/chart/interface/chart.js.map +1 -1
  401. package/esm/chart/line/line.js +1 -2
  402. package/esm/chart/line/line.js.map +1 -1
  403. package/esm/chart/map/map.js +2 -2
  404. package/esm/chart/map/map.js.map +1 -1
  405. package/esm/chart/pie/pie-3d.js +2 -2
  406. package/esm/chart/pie/pie-3d.js.map +1 -1
  407. package/esm/chart/pie/pie.js +2 -2
  408. package/esm/chart/pie/pie.js.map +1 -1
  409. package/esm/chart/progress/circular/circular.js +1 -1
  410. package/esm/chart/progress/circular/circular.js.map +1 -1
  411. package/esm/chart/progress/linear/linear.js +1 -1
  412. package/esm/chart/progress/linear/linear.js.map +1 -1
  413. package/esm/chart/radar/radar.js +2 -3
  414. package/esm/chart/radar/radar.js.map +1 -1
  415. package/esm/chart/range-area/range-area.js +1 -1
  416. package/esm/chart/range-area/range-area.js.map +1 -1
  417. package/esm/chart/range-column/range-column-3d.js +1 -1
  418. package/esm/chart/range-column/range-column-3d.js.map +1 -1
  419. package/esm/chart/range-column/range-column.js +1 -1
  420. package/esm/chart/range-column/range-column.js.map +1 -1
  421. package/esm/chart/rose/rose.js +2 -2
  422. package/esm/chart/rose/rose.js.map +1 -1
  423. package/esm/chart/sankey/sankey.js +1 -1
  424. package/esm/chart/sankey/sankey.js.map +1 -1
  425. package/esm/chart/scatter/scatter.js +2 -2
  426. package/esm/chart/scatter/scatter.js.map +1 -1
  427. package/esm/chart/sequence/sequence.js +4 -2
  428. package/esm/chart/sequence/sequence.js.map +1 -1
  429. package/esm/chart/stack.d.ts +1 -0
  430. package/esm/chart/stack.js +16 -2
  431. package/esm/chart/stack.js.map +1 -1
  432. package/esm/chart/sunburst/sunburst.js +1 -1
  433. package/esm/chart/sunburst/sunburst.js.map +1 -1
  434. package/esm/chart/treemap/treemap.js +1 -1
  435. package/esm/chart/treemap/treemap.js.map +1 -1
  436. package/esm/chart/util.d.ts +8 -0
  437. package/esm/chart/util.js +33 -1
  438. package/esm/chart/util.js.map +1 -1
  439. package/esm/chart/waterfall/waterfall.js +1 -1
  440. package/esm/chart/waterfall/waterfall.js.map +1 -1
  441. package/esm/chart/word-cloud/word-cloud-3d.js +1 -1
  442. package/esm/chart/word-cloud/word-cloud-3d.js.map +1 -1
  443. package/esm/chart/word-cloud/word-cloud.js +1 -1
  444. package/esm/chart/word-cloud/word-cloud.js.map +1 -1
  445. package/esm/compile/compiler.d.ts +1 -1
  446. package/esm/compile/compiler.js +5 -4
  447. package/esm/compile/compiler.js.map +1 -1
  448. package/esm/compile/mark/compilable-mark.js +9 -11
  449. package/esm/compile/mark/compilable-mark.js.map +1 -1
  450. package/esm/compile/mark/interface.d.ts +2 -1
  451. package/esm/compile/mark/interface.js.map +1 -1
  452. package/esm/compile/mark/util.d.ts +2 -1
  453. package/esm/compile/mark/util.js +19 -3
  454. package/esm/compile/mark/util.js.map +1 -1
  455. package/esm/component/axis/base-axis.d.ts +1 -12
  456. package/esm/component/axis/base-axis.js +8 -18
  457. package/esm/component/axis/base-axis.js.map +1 -1
  458. package/esm/component/axis/cartesian/axis.js +15 -6
  459. package/esm/component/axis/cartesian/axis.js.map +1 -1
  460. package/esm/component/axis/cartesian/band-axis.d.ts +1 -0
  461. package/esm/component/axis/cartesian/band-axis.js +1 -0
  462. package/esm/component/axis/cartesian/band-axis.js.map +1 -1
  463. package/esm/component/axis/cartesian/index.d.ts +1 -0
  464. package/esm/component/axis/cartesian/index.js +2 -0
  465. package/esm/component/axis/cartesian/index.js.map +1 -1
  466. package/esm/component/axis/cartesian/interface/common.d.ts +6 -1
  467. package/esm/component/axis/cartesian/interface/common.js.map +1 -1
  468. package/esm/component/axis/cartesian/interface/spec.d.ts +4 -1
  469. package/esm/component/axis/cartesian/interface/spec.js.map +1 -1
  470. package/esm/component/axis/cartesian/linear-axis.js +3 -4
  471. package/esm/component/axis/cartesian/linear-axis.js.map +1 -1
  472. package/esm/component/axis/cartesian/symlog-axis.d.ts +15 -0
  473. package/esm/component/axis/cartesian/symlog-axis.js +24 -0
  474. package/esm/component/axis/cartesian/symlog-axis.js.map +1 -0
  475. package/esm/component/axis/interface.d.ts +3 -1
  476. package/esm/component/axis/interface.js.map +1 -1
  477. package/esm/component/axis/polar/axis.d.ts +1 -0
  478. package/esm/component/axis/polar/axis.js +5 -2
  479. package/esm/component/axis/polar/axis.js.map +1 -1
  480. package/esm/component/axis/polar/band-axis.d.ts +1 -0
  481. package/esm/component/base/base-component.d.ts +3 -2
  482. package/esm/component/base/base-component.js +3 -3
  483. package/esm/component/base/base-component.js.map +1 -1
  484. package/esm/component/base/util.js +3 -0
  485. package/esm/component/base/util.js.map +1 -1
  486. package/esm/component/brush/brush.d.ts +11 -1
  487. package/esm/component/brush/brush.js +60 -51
  488. package/esm/component/brush/brush.js.map +1 -1
  489. package/esm/component/crosshair/base.d.ts +1 -0
  490. package/esm/component/crosshair/cartesian.js +1 -1
  491. package/esm/component/crosshair/cartesian.js.map +1 -1
  492. package/esm/component/crosshair/polar.js +3 -3
  493. package/esm/component/crosshair/polar.js.map +1 -1
  494. package/esm/component/custom-mark/custom-mark.d.ts +1 -0
  495. package/esm/component/data-zoom/data-filter-base-component.d.ts +1 -0
  496. package/esm/component/geo/geo-coordinate.d.ts +7 -2
  497. package/esm/component/geo/geo-coordinate.js +56 -14
  498. package/esm/component/geo/geo-coordinate.js.map +1 -1
  499. package/esm/component/index.d.ts +3 -2
  500. package/esm/component/index.js +4 -2
  501. package/esm/component/index.js.map +1 -1
  502. package/esm/component/indicator/indicator.js.map +1 -1
  503. package/esm/component/interface/theme.d.ts +2 -0
  504. package/esm/component/interface/theme.js.map +1 -1
  505. package/esm/component/interface/type.d.ts +2 -0
  506. package/esm/component/interface/type.js +13 -12
  507. package/esm/component/interface/type.js.map +1 -1
  508. package/esm/component/label/base-label.d.ts +40 -0
  509. package/esm/component/label/base-label.js +42 -0
  510. package/esm/component/label/base-label.js.map +1 -0
  511. package/esm/component/label/interface.d.ts +7 -0
  512. package/esm/component/label/interface.js.map +1 -1
  513. package/esm/component/label/label.d.ts +5 -27
  514. package/esm/component/label/label.js +34 -40
  515. package/esm/component/label/label.js.map +1 -1
  516. package/esm/component/label/pie.d.ts +5 -0
  517. package/esm/component/label/pie.js +13 -0
  518. package/esm/component/label/pie.js.map +1 -0
  519. package/esm/component/label/totalLabel.d.ts +27 -0
  520. package/esm/component/label/totalLabel.js +110 -0
  521. package/esm/component/label/totalLabel.js.map +1 -0
  522. package/esm/component/label/util.d.ts +3 -1
  523. package/esm/component/label/util.js +6 -4
  524. package/esm/component/label/util.js.map +1 -1
  525. package/esm/component/legend/base-legend.d.ts +1 -0
  526. package/esm/component/marker/base-marker.d.ts +6 -0
  527. package/esm/component/marker/base-marker.js +14 -0
  528. package/esm/component/marker/base-marker.js.map +1 -1
  529. package/esm/component/marker/interface.d.ts +1 -0
  530. package/esm/component/marker/interface.js.map +1 -1
  531. package/esm/component/marker/mark-area/mark-area.js +17 -6
  532. package/esm/component/marker/mark-area/mark-area.js.map +1 -1
  533. package/esm/component/marker/mark-line/mark-line.js +17 -6
  534. package/esm/component/marker/mark-line/mark-line.js.map +1 -1
  535. package/esm/component/marker/mark-point/mark-point.js +18 -7
  536. package/esm/component/marker/mark-point/mark-point.js.map +1 -1
  537. package/esm/component/title/title.d.ts +1 -0
  538. package/esm/component/title/title.js +2 -1
  539. package/esm/component/title/title.js.map +1 -1
  540. package/esm/component/tooltip/handler/base.js.map +1 -1
  541. package/esm/component/tooltip/handler/dom/dom-tooltip-handler.d.ts +1 -1
  542. package/esm/component/tooltip/handler/dom/dom-tooltip-handler.js.map +1 -1
  543. package/esm/component/tooltip/handler/dom/interface.d.ts +9 -12
  544. package/esm/component/tooltip/handler/dom/interface.js.map +1 -1
  545. package/esm/component/tooltip/handler/dom/model/content-column-model.d.ts +4 -6
  546. package/esm/component/tooltip/handler/dom/model/content-column-model.js +16 -14
  547. package/esm/component/tooltip/handler/dom/model/content-column-model.js.map +1 -1
  548. package/esm/component/tooltip/handler/dom/model/title-model.js +3 -3
  549. package/esm/component/tooltip/handler/dom/model/title-model.js.map +1 -1
  550. package/esm/component/tooltip/handler/dom/util.js +18 -11
  551. package/esm/component/tooltip/handler/dom/util.js.map +1 -1
  552. package/esm/component/tooltip/handler/utils/attribute.js +24 -24
  553. package/esm/component/tooltip/handler/utils/attribute.js.map +1 -1
  554. package/esm/component/tooltip/handler/utils/compose.d.ts +2 -2
  555. package/esm/component/tooltip/handler/utils/compose.js +11 -10
  556. package/esm/component/tooltip/handler/utils/compose.js.map +1 -1
  557. package/esm/component/tooltip/handler/utils/get-spec.js +3 -1
  558. package/esm/component/tooltip/handler/utils/get-spec.js.map +1 -1
  559. package/esm/component/tooltip/handler/utils/style.d.ts +1 -1
  560. package/esm/component/tooltip/handler/utils/style.js +16 -9
  561. package/esm/component/tooltip/handler/utils/style.js.map +1 -1
  562. package/esm/component/tooltip/interface/theme.d.ts +1 -0
  563. package/esm/component/tooltip/interface/theme.js.map +1 -1
  564. package/esm/component/tooltip/tooltip.d.ts +1 -1
  565. package/esm/component/tooltip/tooltip.js +10 -7
  566. package/esm/component/tooltip/tooltip.js.map +1 -1
  567. package/esm/constant/index.d.ts +3 -0
  568. package/esm/constant/index.js +6 -0
  569. package/esm/constant/index.js.map +1 -1
  570. package/esm/core/index.d.ts +1 -1
  571. package/esm/core/index.js +1 -1
  572. package/esm/core/index.js.map +1 -1
  573. package/esm/core/interface.d.ts +3 -0
  574. package/esm/core/interface.js.map +1 -1
  575. package/esm/core/vchart.d.ts +6 -1
  576. package/esm/core/vchart.js +54 -11
  577. package/esm/core/vchart.js.map +1 -1
  578. package/esm/data/initialize.js +10 -7
  579. package/esm/data/initialize.js.map +1 -1
  580. package/esm/data/transforms/dimension-statistics.d.ts +11 -5
  581. package/esm/data/transforms/dimension-statistics.js +33 -22
  582. package/esm/data/transforms/dimension-statistics.js.map +1 -1
  583. package/esm/data/transforms/invalid-travel.js +1 -2
  584. package/esm/data/transforms/invalid-travel.js.map +1 -1
  585. package/esm/data/transforms/tick-data/continuous.js +6 -3
  586. package/esm/data/transforms/tick-data/continuous.js.map +1 -1
  587. package/esm/data/transforms/tick-data/interface.d.ts +3 -0
  588. package/esm/data/transforms/tick-data/interface.js.map +1 -1
  589. package/esm/event/event-dispatcher.js +3 -2
  590. package/esm/event/event-dispatcher.js.map +1 -1
  591. package/esm/event/events/dimension/dimension-click.d.ts +1 -3
  592. package/esm/event/events/dimension/dimension-click.js +9 -10
  593. package/esm/event/events/dimension/dimension-click.js.map +1 -1
  594. package/esm/event/events/dimension/dimension-hover.d.ts +2 -3
  595. package/esm/event/events/dimension/dimension-hover.js +25 -16
  596. package/esm/event/events/dimension/dimension-hover.js.map +1 -1
  597. package/esm/event/interface.d.ts +3 -3
  598. package/esm/event/interface.js.map +1 -1
  599. package/esm/interaction/trigger.js +4 -0
  600. package/esm/interaction/trigger.js.map +1 -1
  601. package/esm/layout/label/arc-label.js.map +1 -1
  602. package/esm/mark/base/base-mark.d.ts +1 -0
  603. package/esm/mark/base/base-mark.js +20 -3
  604. package/esm/mark/base/base-mark.js.map +1 -1
  605. package/esm/mark/symbol.js +1 -1
  606. package/esm/mark/symbol.js.map +1 -1
  607. package/esm/model/base-model.d.ts +2 -0
  608. package/esm/model/base-model.js +2 -0
  609. package/esm/model/base-model.js.map +1 -1
  610. package/esm/model/interface.d.ts +6 -1
  611. package/esm/model/interface.js.map +1 -1
  612. package/esm/model/layout-item.d.ts +4 -4
  613. package/esm/model/layout-item.js.map +1 -1
  614. package/esm/plugin/components/index.d.ts +0 -2
  615. package/esm/plugin/components/index.js +0 -3
  616. package/esm/plugin/components/index.js.map +1 -1
  617. package/esm/region/region.d.ts +1 -0
  618. package/esm/series/area/area.d.ts +6 -3
  619. package/esm/series/area/area.js +39 -10
  620. package/esm/series/area/area.js.map +1 -1
  621. package/esm/series/area/tooltip-helpter.d.ts +5 -0
  622. package/esm/series/area/tooltip-helpter.js +18 -0
  623. package/esm/series/area/tooltip-helpter.js.map +1 -0
  624. package/esm/series/bar/bar.d.ts +1 -0
  625. package/esm/series/bar/bar.js +1 -1
  626. package/esm/series/bar/bar.js.map +1 -1
  627. package/esm/series/base/base-series.d.ts +4 -0
  628. package/esm/series/base/base-series.js +62 -17
  629. package/esm/series/base/base-series.js.map +1 -1
  630. package/esm/series/base/tooltip-helper.js +4 -2
  631. package/esm/series/base/tooltip-helper.js.map +1 -1
  632. package/esm/series/box-plot/box-plot.js +1 -1
  633. package/esm/series/box-plot/box-plot.js.map +1 -1
  634. package/esm/series/cartesian/cartesian.d.ts +7 -3
  635. package/esm/series/cartesian/cartesian.js +26 -17
  636. package/esm/series/cartesian/cartesian.js.map +1 -1
  637. package/esm/series/dot/dot.d.ts +1 -0
  638. package/esm/series/dot/dot.js +3 -0
  639. package/esm/series/dot/dot.js.map +1 -1
  640. package/esm/series/funnel/funnel.d.ts +1 -0
  641. package/esm/series/geo/geo.d.ts +2 -0
  642. package/esm/series/geo/geo.js +4 -1
  643. package/esm/series/geo/geo.js.map +1 -1
  644. package/esm/series/heatmap/heatmap.d.ts +1 -0
  645. package/esm/series/interface/common.d.ts +1 -0
  646. package/esm/series/interface/common.js.map +1 -1
  647. package/esm/series/interface/series.d.ts +3 -2
  648. package/esm/series/interface/series.js.map +1 -1
  649. package/esm/series/line/interface.d.ts +0 -2
  650. package/esm/series/line/interface.js.map +1 -1
  651. package/esm/series/line/line.d.ts +1 -2
  652. package/esm/series/line/line.js +1 -1
  653. package/esm/series/line/line.js.map +1 -1
  654. package/esm/series/link/link.js +1 -1
  655. package/esm/series/link/link.js.map +1 -1
  656. package/esm/series/map/interface.d.ts +1 -0
  657. package/esm/series/map/interface.js.map +1 -1
  658. package/esm/series/map/map.d.ts +1 -2
  659. package/esm/series/map/map.js +10 -8
  660. package/esm/series/map/map.js.map +1 -1
  661. package/esm/series/mixin/line-mixin.d.ts +4 -1
  662. package/esm/series/mixin/line-mixin.js +39 -19
  663. package/esm/series/mixin/line-mixin.js.map +1 -1
  664. package/esm/series/pie/interface.d.ts +4 -7
  665. package/esm/series/pie/interface.js.map +1 -1
  666. package/esm/series/pie/pie.d.ts +2 -0
  667. package/esm/series/pie/pie.js +22 -54
  668. package/esm/series/pie/pie.js.map +1 -1
  669. package/esm/series/polar/polar.d.ts +1 -0
  670. package/esm/series/polar/polar.js +2 -1
  671. package/esm/series/polar/polar.js.map +1 -1
  672. package/esm/series/range-area/range-area.d.ts +2 -0
  673. package/esm/series/range-area/range-area.js +7 -3
  674. package/esm/series/range-area/range-area.js.map +1 -1
  675. package/esm/series/range-column/range-column.js +1 -1
  676. package/esm/series/range-column/range-column.js.map +1 -1
  677. package/esm/series/rose/interface.d.ts +3 -0
  678. package/esm/series/rose/interface.js.map +1 -1
  679. package/esm/series/rose/rose.d.ts +1 -2
  680. package/esm/series/rose/rose.js +17 -37
  681. package/esm/series/rose/rose.js.map +1 -1
  682. package/esm/series/sankey/interface.d.ts +3 -2
  683. package/esm/series/sankey/interface.js.map +1 -1
  684. package/esm/series/sankey/sankey.d.ts +2 -0
  685. package/esm/series/sankey/sankey.js +198 -80
  686. package/esm/series/sankey/sankey.js.map +1 -1
  687. package/esm/series/scatter/interface.d.ts +1 -2
  688. package/esm/series/scatter/interface.js.map +1 -1
  689. package/esm/series/scatter/scatter.d.ts +2 -3
  690. package/esm/series/scatter/scatter.js +20 -14
  691. package/esm/series/scatter/scatter.js.map +1 -1
  692. package/esm/series/word-cloud/base.d.ts +1 -0
  693. package/esm/theme/buildin-theme/light/component/axis/symlog-axis.d.ts +2 -0
  694. package/esm/theme/buildin-theme/light/component/axis/symlog-axis.js +18 -0
  695. package/esm/theme/buildin-theme/light/component/axis/symlog-axis.js.map +1 -0
  696. package/esm/theme/buildin-theme/light/component/index.js +4 -1
  697. package/esm/theme/buildin-theme/light/component/index.js.map +1 -1
  698. package/esm/theme/buildin-theme/light/component/total-label.d.ts +2 -0
  699. package/esm/theme/buildin-theme/light/component/total-label.js +20 -0
  700. package/esm/theme/buildin-theme/light/component/total-label.js.map +1 -0
  701. package/esm/theme/buildin-theme/light/series/rose.js +0 -1
  702. package/esm/theme/buildin-theme/light/series/rose.js.map +1 -1
  703. package/esm/theme/buildin-theme/light/series/sankey.js +0 -1
  704. package/esm/theme/buildin-theme/light/series/sankey.js.map +1 -1
  705. package/esm/typings/spec/common.d.ts +10 -4
  706. package/esm/typings/spec/common.js.map +1 -1
  707. package/esm/typings/tooltip/label.d.ts +10 -0
  708. package/esm/typings/tooltip/label.js +2 -0
  709. package/esm/typings/tooltip/label.js.map +1 -0
  710. package/esm/typings/tooltip/line.d.ts +3 -2
  711. package/esm/typings/tooltip/line.js.map +1 -1
  712. package/esm/typings/tooltip/shape.d.ts +2 -0
  713. package/esm/typings/tooltip/shape.js.map +1 -1
  714. package/esm/typings/visual.d.ts +11 -21
  715. package/esm/typings/visual.js.map +1 -1
  716. package/esm/util/data.d.ts +0 -8
  717. package/esm/util/data.js +1 -7
  718. package/esm/util/data.js.map +1 -1
  719. package/esm/util/object.d.ts +0 -2
  720. package/esm/util/object.js +0 -11
  721. package/esm/util/object.js.map +1 -1
  722. package/esm/util/scale.d.ts +2 -6
  723. package/esm/util/scale.js +1 -5
  724. package/esm/util/scale.js.map +1 -1
  725. package/esm/util/space.d.ts +3 -9
  726. package/esm/util/space.js +8 -26
  727. package/esm/util/space.js.map +1 -1
  728. package/esm/util/text.d.ts +1 -2
  729. package/esm/util/text.js +1 -9
  730. package/esm/util/text.js.map +1 -1
  731. package/esm/vchart-all.js +2 -2
  732. package/esm/vchart-all.js.map +1 -1
  733. package/esm/vchart-simple.js +18 -2
  734. package/esm/vchart-simple.js.map +1 -1
  735. package/package.json +21 -14
  736. package/cjs/plugin/components/axis-label-overlap-plugin.d.ts +0 -10
  737. package/cjs/plugin/components/axis-label-overlap-plugin.js +0 -75
  738. package/cjs/plugin/components/axis-label-overlap-plugin.js.map +0 -1
  739. package/esm/plugin/components/axis-label-overlap-plugin.d.ts +0 -10
  740. package/esm/plugin/components/axis-label-overlap-plugin.js +0 -72
  741. package/esm/plugin/components/axis-label-overlap-plugin.js.map +0 -1
package/cjs/util/scale.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
- }), exports.isSpecValueWithScale = exports.valueInScaleRange = exports.isValidScaleType = exports.initScaleWithSpec = exports.createScaleWithSpec = exports.createScale = void 0;
5
+ }), exports.isSpecValueWithScale = exports.valueInScaleRange = exports.createScaleWithSpec = exports.createScale = void 0;
6
6
 
7
7
  const vutils_1 = require("@visactor/vutils"), vscale_1 = require("@visactor/vscale"), color_ordinal_scale_1 = require("../scale/color-ordinal-scale"), defaultScaleMap = {
8
8
  linear: vscale_1.LinearScale,
@@ -29,10 +29,6 @@ function initScaleWithSpec(scale, spec) {
29
29
  spec.specified && scale.specified && scale.specified(spec.specified));
30
30
  }
31
31
 
32
- function isValidScaleType(type) {
33
- return Object.keys(defaultScaleMap).includes(type);
34
- }
35
-
36
32
  function valueInScaleRange(v, s) {
37
33
  if (!s) return v;
38
34
  const range = s.range(), min = Math.min(range[0], range[range.length - 1]), max = Math.max(range[0], range[range.length - 1]);
@@ -45,6 +41,5 @@ function isSpecValueWithScale(specValue) {
45
41
  }
46
42
 
47
43
  exports.createScale = createScale, exports.createScaleWithSpec = createScaleWithSpec,
48
- exports.initScaleWithSpec = initScaleWithSpec, exports.isValidScaleType = isValidScaleType,
49
44
  exports.valueInScaleRange = valueInScaleRange, exports.isSpecValueWithScale = isSpecValueWithScale;
50
45
  //# sourceMappingURL=scale.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/util/scale.ts"],"names":[],"mappings":";;;AAGA,6CAAqD;AAGrD,6CAAoG;AAKpG,sEAAiE;AAEjE,MAAM,eAAe,GAAG;IACtB,MAAM,EAAE,oBAAW;IACnB,IAAI,EAAE,kBAAS;IACf,KAAK,EAAE,mBAAU;IACjB,OAAO,EAAE,qBAAY;IACrB,SAAS,EAAE,uBAAc;IACzB,YAAY,EAAE,uCAAiB;CAChC,CAAC;AAEF,SAAgB,WAAW,CAAC,IAAkC;IAC5D,MAAM,gBAAgB,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IAC/C,IAAI,gBAAgB,EAAE;QACpB,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C;AACrD,CAAC;AAFD,4CAEC;AAED,SAAgB,iBAAiB,CAAC,CAAS,EAAE,CAAc;IACzD,IAAI,CAAC,CAAC,EAAE;QACN,OAAO,CAAC,CAAC;KACV;IACD,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC;IACxB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;IACxD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;IACxD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AACzC,CAAC;AARD,8CAQC;AAED,SAAgB,oBAAoB,CAAC,SAAc;IACjD,OAAO,IAAA,gBAAO,EAAC,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,KAAK,CAAC,IAAI,IAAA,gBAAO,EAAC,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,KAAK,CAAC,CAAC;AAChE,CAAC;AAFD,oDAEC","file":"scale.js","sourcesContent":["/**\n * @description Scale 相关的工具函数\n */\nimport { isString, isValid } from '@visactor/vutils';\nimport type { DataView } from '@visactor/vdataset';\nimport type { IGlobalScale } from '../scale/interface';\nimport { BandScale, LinearScale, OrdinalScale, PointScale, ThresholdScale } from '@visactor/vscale';\n// eslint-disable-next-line no-duplicate-imports\nimport type { IBaseScale } from '@visactor/vscale';\nimport type { ScaleType } from '../typings/scale';\nimport type { IVisual, IVisualSpecBase } from '../typings/visual';\nimport { ColorOrdinalScale } from '../scale/color-ordinal-scale';\n\nconst defaultScaleMap = {\n linear: LinearScale,\n band: BandScale,\n point: PointScale,\n ordinal: OrdinalScale,\n threshold: ThresholdScale,\n colorOrdinal: ColorOrdinalScale\n};\n\nexport function createScale(type: keyof typeof defaultScaleMap): IBaseScale | null {\n const scaleConstructor = defaultScaleMap[type];\n if (scaleConstructor) {\n return new scaleConstructor();\n }\n\n return null;\n}\n\nexport function createScaleWithSpec(\n spec: IVisual<any>,\n context: {\n globalScale: IGlobalScale;\n dataStatistics: DataView;\n }\n): IBaseScale | null {\n if ('scale' in spec && spec.scale) {\n if (isString(spec.scale) && context?.globalScale) {\n return context.globalScale.registerMarkAttributeScale(spec, context.dataStatistics);\n }\n return spec.scale as unknown as IBaseScale;\n }\n const scale = createScale((spec as IVisualSpecBase<any, any>).type);\n if (scale) {\n initScaleWithSpec(scale, spec as IVisualSpecBase<any, any>);\n }\n return scale;\n}\n\n// 需要一个通用的从spec初始化scale的方法,避免在scale属性更新后需要维护多组逻辑\nexport function initScaleWithSpec(scale: IBaseScale, spec: IVisualSpecBase<any, any>) {\n if (!scale || !spec) {\n return;\n }\n\n if (spec.domain) {\n scale.domain(spec.domain);\n }\n\n if (spec.range) {\n scale.range(spec.range);\n }\n\n if (spec.specified && (<OrdinalScale>scale).specified) {\n (<OrdinalScale>scale).specified(spec.specified);\n }\n}\n\nexport function isValidScaleType(type: ScaleType): boolean {\n return Object.keys(defaultScaleMap).includes(type);\n}\n\nexport function valueInScaleRange(v: number, s?: IBaseScale) {\n if (!s) {\n return v;\n }\n const range = s.range();\n const min = Math.min(range[0], range[range.length - 1]);\n const max = Math.max(range[0], range[range.length - 1]);\n return Math.min(Math.max(min, v), max);\n}\n\nexport function isSpecValueWithScale(specValue: any) {\n return isValid(specValue?.field) && isValid(specValue?.scale);\n}\n"]}
1
+ {"version":3,"sources":["../src/util/scale.ts"],"names":[],"mappings":";;;AAGA,6CAAqD;AAGrD,6CAAqH;AAErH,sEAAiE;AAEjE,MAAM,eAAe,GAAG;IACtB,MAAM,EAAE,oBAAW;IACnB,IAAI,EAAE,kBAAS;IACf,KAAK,EAAE,mBAAU;IACjB,OAAO,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AM,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;KACjD;AACH,CAAC;AAED,SAAgB,iBAAiB,CAAC,CAAS,EAAE,CAAc;IACzD,IAAI,CAAC,CAAC,EAAE;QACN,OAAO,CAAC,CAAC;KACV;IACD,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC;IACxB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;IACxD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;IACxD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AACzC,CAAC;AARD,8CAQC;AAED,SAAgB,oBAAoB,CAAC,SAAc;IACjD,OAAO,IAAA,gBAAO,EAAC,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,KAAK,CAAC,IAAI,IAAA,gBAAO,EAAC,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,KAAK,CAAC,CAAC;AAChE,CAAC;AAFD,oDAEC","file":"scale.js","sourcesContent":["/**\n * @description Scale 相关的工具函数\n */\nimport { isString, isValid } from '@visactor/vutils';\nimport type { DataView } from '@visactor/vdataset';\nimport type { IGlobalScale } from '../scale/interface';\nimport { type IBaseScale, BandScale, LinearScale, OrdinalScale, PointScale, ThresholdScale } from '@visactor/vscale';\nimport type { IVisual, IVisualSpecBase } from '../typings/visual';\nimport { ColorOrdinalScale } from '../scale/color-ordinal-scale';\n\nconst defaultScaleMap = {\n linear: LinearScale,\n band: BandScale,\n point: PointScale,\n ordinal: OrdinalScale,\n threshold: ThresholdScale,\n colorOrdinal: ColorOrdinalScale\n};\n\nexport function createScale(type: keyof typeof defaultScaleMap): IBaseScale | null {\n const scaleConstructor = defaultScaleMap[type];\n if (scaleConstructor) {\n return new scaleConstructor();\n }\n\n return null;\n}\n\nexport function createScaleWithSpec(\n spec: IVisual<any>,\n context: {\n globalScale: IGlobalScale;\n dataStatistics: DataView;\n }\n): IBaseScale | null {\n if ('scale' in spec && spec.scale) {\n if (isString(spec.scale) && context?.globalScale) {\n return context.globalScale.registerMarkAttributeScale(spec, context.dataStatistics);\n }\n return spec.scale as unknown as IBaseScale;\n }\n const scale = createScale((spec as IVisualSpecBase<any, any>).type);\n if (scale) {\n initScaleWithSpec(scale, spec as IVisualSpecBase<any, any>);\n }\n return scale;\n}\n\n// 需要一个通用的从spec初始化scale的方法,避免在scale属性更新后需要维护多组逻辑\nfunction initScaleWithSpec(scale: IBaseScale, spec: IVisualSpecBase<any, any>) {\n if (!scale || !spec) {\n return;\n }\n\n if (spec.domain) {\n scale.domain(spec.domain);\n }\n\n if (spec.range) {\n scale.range(spec.range);\n }\n\n if (spec.specified && (<OrdinalScale>scale).specified) {\n (<OrdinalScale>scale).specified(spec.specified);\n }\n}\n\nexport function valueInScaleRange(v: number, s?: IBaseScale) {\n if (!s) {\n return v;\n }\n const range = s.range();\n const min = Math.min(range[0], range[range.length - 1]);\n const max = Math.max(range[0], range[range.length - 1]);\n return Math.min(Math.max(min, v), max);\n}\n\nexport function isSpecValueWithScale(specValue: any) {\n return isValid(specValue?.field) && isValid(specValue?.scale);\n}\n"]}
@@ -1,19 +1,13 @@
1
- import type { ILayoutPaddingSpec } from '../model/interface';
2
- import type { IBoundsLike } from '@visactor/vutils';
3
- import type { ILayoutNumber, IPercent, ILayoutOrientPadding, ILayoutRect } from '../model/interface';
1
+ import { type IBoundsLike } from '@visactor/vutils';
2
+ import type { ILayoutPaddingSpec, IPercentOffset, ILayoutNumber, IPercent, ILayoutOrientPadding, ILayoutRect } from '../model/interface';
4
3
  import type { IPadding, IRect } from '../typings/space';
5
- import { Direction } from '../typings/space';
6
4
  import type { IPoint } from '../typings/coordinate';
7
5
  export declare function isValidOrient(orient: string): boolean;
8
- export declare function getSpecPadding(padding: IPadding | number | undefined | null, defaultPadding: IPadding): IPadding;
9
6
  export declare function isPointInRect(point: IPoint, rect: IRect): boolean;
10
7
  export declare function isPercent(v: any): v is IPercent;
8
+ export declare function isPercentOffset(v: any): v is IPercentOffset;
11
9
  export declare function calcLayoutNumber(v: ILayoutNumber | undefined, size: number, callOp?: ILayoutRect): number;
12
10
  export declare function calcPadding(paddingSpec: ILayoutOrientPadding, rect: ILayoutRect, callOp: ILayoutRect): IPadding;
13
11
  export declare function boundsInRect(bounds: IBoundsLike, rect: ILayoutRect): ILayoutRect;
14
- export declare function boundsOutViewBox(bounds: IBoundsLike, box: IBoundsLike, direction: Direction): {
15
- start: number;
16
- end: number;
17
- };
18
12
  export declare function normalizeLayoutPaddingSpec(spec: ILayoutPaddingSpec): ILayoutOrientPadding;
19
13
  export declare function convertPoint(point: IPoint, relativePoint: IPoint, convert: boolean): IPoint;
package/cjs/util/space.js CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
- }), exports.convertPoint = exports.normalizeLayoutPaddingSpec = exports.boundsOutViewBox = exports.boundsInRect = exports.calcPadding = exports.calcLayoutNumber = exports.isPercent = exports.isPointInRect = exports.getSpecPadding = exports.isValidOrient = void 0;
5
+ }), exports.convertPoint = exports.normalizeLayoutPaddingSpec = exports.boundsInRect = exports.calcPadding = exports.calcLayoutNumber = exports.isPercentOffset = exports.isPercent = exports.isPointInRect = exports.isValidOrient = void 0;
6
6
 
7
- const vutils_1 = require("@visactor/vutils"), type_1 = require("./type"), space_1 = require("../typings/space");
7
+ const vutils_1 = require("@visactor/vutils"), type_1 = require("./type");
8
8
 
9
9
  function isValidOrient(orient) {
10
10
  switch (orient) {
@@ -19,15 +19,6 @@ function isValidOrient(orient) {
19
19
  }
20
20
  }
21
21
 
22
- function getSpecPadding(padding, defaultPadding) {
23
- return (0, type_1.isNil)(padding) ? Object.assign({}, defaultPadding) : "number" == typeof padding ? {
24
- top: padding,
25
- bottom: padding,
26
- left: padding,
27
- right: padding
28
- } : Object.assign(Object.assign({}, defaultPadding), padding);
29
- }
30
-
31
22
  function isPointInRect(point, rect) {
32
23
  const {x: x, y: y, width: width, height: height} = rect, {x: x0, y: y0} = point;
33
24
  return x0 < x + width && y0 < y + height && y0 > y && x0 > x;
@@ -37,9 +28,14 @@ function isPercent(v) {
37
28
  return !!(0, type_1.isString)(v) && (!!v.endsWith("%") && (0, type_1.couldBeValidNumber)(v.substring(0, v.length - 1)));
38
29
  }
39
30
 
31
+ function isPercentOffset(v) {
32
+ return !!(0, type_1.isObject)(v) && ("percent" in v || "offset" in v);
33
+ }
34
+
40
35
  function calcLayoutNumber(v, size, callOp) {
36
+ var _a, _b;
41
37
  return (0, type_1.isNumber)(v) ? v : isPercent(v) ? Number(v.substring(0, v.length - 1)) * size / 100 : (0,
42
- type_1.isFunction)(v) ? v(callOp) : 0;
38
+ type_1.isFunction)(v) ? v(callOp) : (0, type_1.isObject)(v) ? size * (null !== (_a = v.percent) && void 0 !== _a ? _a : 0) + (null !== (_b = v.offset) && void 0 !== _b ? _b : 0) : 0;
43
39
  }
44
40
 
45
41
  function calcPadding(paddingSpec, rect, callOp) {
@@ -76,25 +72,13 @@ function boundsInRect(bounds, rect) {
76
72
  };
77
73
  }
78
74
 
79
- function boundsOutViewBox(bounds, box, direction) {
80
- if (!bounds || !box) return {
81
- start: 0,
82
- end: 0
83
- };
84
- const start = -(direction === space_1.Direction.horizontal ? bounds.x1 : bounds.y1), end = direction === space_1.Direction.horizontal ? bounds.x2 - (box.x2 - box.x1) : bounds.y2 - (box.y2 - box.y1);
85
- return {
86
- start: start > 0 ? start : 0,
87
- end: end > 0 ? end : 0
88
- };
89
- }
90
-
91
75
  function normalizeLayoutPaddingSpec(spec) {
92
76
  let result = {};
93
77
  return (0, vutils_1.isArray)(spec) ? ((0, type_1.isNil)(spec[0]) || (result.top = result.left = result.bottom = result.right = spec[0]),
94
78
  (0, type_1.isNil)(spec[1]) || (result.left = result.right = spec[1]), (0, type_1.isNil)(spec[2]) || (result.bottom = spec[2]),
95
79
  (0, type_1.isNil)(spec[3]) || (result.left = spec[3]), result) : (0, type_1.isNumber)(spec) || isPercent(spec) || (0,
96
- type_1.isFunction)(spec) ? (result.top = result.left = result.bottom = result.right = spec,
97
- result) : ((0, type_1.isObject)(spec) && (result = Object.assign({}, spec)), result);
80
+ type_1.isFunction)(spec) || isPercentOffset(spec) ? (result.top = result.left = result.bottom = result.right = spec,
81
+ result) : (0, type_1.isObject)(spec) ? (result = Object.assign({}, spec), result) : result;
98
82
  }
99
83
 
100
84
  function convertPoint(point, relativePoint, convert) {
@@ -104,8 +88,8 @@ function convertPoint(point, relativePoint, convert) {
104
88
  } : point;
105
89
  }
106
90
 
107
- exports.isValidOrient = isValidOrient, exports.getSpecPadding = getSpecPadding,
108
- exports.isPointInRect = isPointInRect, exports.isPercent = isPercent, exports.calcLayoutNumber = calcLayoutNumber,
109
- exports.calcPadding = calcPadding, exports.boundsInRect = boundsInRect, exports.boundsOutViewBox = boundsOutViewBox,
110
- exports.normalizeLayoutPaddingSpec = normalizeLayoutPaddingSpec, exports.convertPoint = convertPoint;
91
+ exports.isValidOrient = isValidOrient, exports.isPointInRect = isPointInRect, exports.isPercent = isPercent,
92
+ exports.isPercentOffset = isPercentOffset, exports.calcLayoutNumber = calcLayoutNumber,
93
+ exports.calcPadding = calcPadding, exports.boundsInRect = boundsInRect, exports.normalizeLayoutPaddingSpec = normalizeLayoutPaddingSpec,
94
+ exports.convertPoint = convertPoint;
111
95
  //# sourceMappingURL=space.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/util/space.ts"],"names":[],"mappings":";;;AAEA,6CAA2C;AAC3C,iCAA6F;AAI7F,4CAA6C;AAG7C,SAAgB,aAAa,CAAC,MAAc;IAC1C,QAAQ,MAAM,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,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;SACvB;QACD,OAAO,MAAM,CAAC;KACf;IACD,IAAI,IAAA,eAAQ,EAAC,IAAI,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,IAAA,iBAAU,EAAC,IAAI,CAAC,EAAE;QACzD,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC;QAC/D,OAAO,MAAM,CAAC;KACf;IACD,IAAI,IAAA,eAAQ,EAAC,IAAI,CAAC,EAAE;QAClB,MAAM,qBAAQ,IAAI,CAAE,CAAC;KACtB;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAzBD,gEAyBC;AAED,SAAgB,YAAY,CAAC,KAAa,EAAE,aAAqB,EAAE,OAAgB;IACjF,IAAI,OAAO,EAAE;QACX,OAAO;YACL,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC;YAC5B,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC;SAC7B,CAAC;KACH;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AARD,oCAQC","file":"space.js","sourcesContent":["import type { ILayoutPaddingSpec } from '../model/interface';\nimport type { IBoundsLike } from '@visactor/vutils';\nimport { isArray } from '@visactor/vutils';\nimport { isNumber, isNil, isString, isFunction, couldBeValidNumber, isObject } from './type';\nimport type { ILayoutNumber, IPercent, ILayoutOrientPadding, ILayoutRect } from '../model/interface';\nimport type { IPadding, IRect } from '../typings/space';\n// eslint-disable-next-line no-duplicate-imports\nimport { Direction } from '../typings/space';\nimport type { IPoint } from '../typings/coordinate';\n\nexport function isValidOrient(orient: string): boolean {\n switch (orient) {\n case 'left':\n case 'right':\n case 'top':\n case 'bottom':\n return true;\n default:\n return false;\n }\n}\n\nexport function getSpecPadding(padding: IPadding | number | undefined | null, defaultPadding: IPadding): IPadding {\n if (isNil(padding)) {\n return { ...defaultPadding };\n }\n if (typeof padding === 'number') {\n return {\n top: padding,\n bottom: padding,\n left: padding,\n right: padding\n };\n }\n return {\n ...defaultPadding,\n ...padding\n };\n}\n\nexport function isPointInRect(point: IPoint, rect: IRect) {\n const { x, y, width, height } = rect;\n const { x: x0, y: y0 } = point;\n return x0 < x + width && y0 < y + height && y0 > y && x0 > x;\n}\n\nexport function isPercent(v: any): v is IPercent {\n if (!isString(v)) {\n return false;\n }\n if (!v.endsWith('%')) {\n return false;\n }\n return couldBeValidNumber(v.substring(0, v.length - 1));\n}\n\nexport function calcLayoutNumber(\n v: ILayoutNumber | undefined,\n size: number,\n callOp?: ILayoutRect //如果是函数类型的话,函数的参数\n) {\n if (isNumber(v)) {\n return v;\n }\n if (isPercent(v)) {\n return (Number(v.substring(0, v.length - 1)) * size) / 100;\n }\n if (isFunction(v)) {\n return v(callOp);\n }\n return 0;\n}\n\nexport function calcPadding(\n paddingSpec: ILayoutOrientPadding,\n rect: ILayoutRect,\n callOp: ILayoutRect //如果是函数类型的话,函数的参数\n): IPadding {\n const result: IPadding = {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0\n };\n if (Object.values(paddingSpec).every(value => isNumber(value))) {\n result.top = (<IPadding>paddingSpec).top ?? 0;\n result.right = (<IPadding>paddingSpec).right ?? 0;\n result.bottom = (<IPadding>paddingSpec).bottom ?? 0;\n result.left = (<IPadding>paddingSpec).left ?? 0;\n return result;\n }\n const paddings = [\n {\n orients: ['left', 'right'],\n size: rect.width\n },\n {\n orients: ['top', 'bottom'],\n size: rect.height\n }\n ];\n paddings.forEach(p => {\n p.orients.forEach(o => {\n result[o] = calcLayoutNumber(paddingSpec[o], p.size, callOp);\n });\n });\n return result;\n}\n\nexport function boundsInRect(bounds: IBoundsLike, rect: ILayoutRect): ILayoutRect {\n if (!bounds) {\n return { width: 0, height: 0 };\n }\n return {\n width: Math.ceil(Math.min(bounds.x2 - bounds.x1, rect.width)),\n height: Math.ceil(Math.min(bounds.y2 - bounds.y1, rect.height))\n };\n}\n\nexport function boundsOutViewBox(\n bounds: IBoundsLike,\n box: IBoundsLike,\n direction: Direction\n): {\n start: number;\n end: number;\n} {\n if (!bounds || !box) {\n return { start: 0, end: 0 };\n }\n const start = -(direction === Direction.horizontal ? bounds.x1 : bounds.y1);\n const end = direction === Direction.horizontal ? bounds.x2 - (box.x2 - box.x1) : bounds.y2 - (box.y2 - box.y1);\n return { start: start > 0 ? start : 0, end: end > 0 ? end : 0 };\n}\n\nexport function normalizeLayoutPaddingSpec(spec: ILayoutPaddingSpec): ILayoutOrientPadding {\n let result: ILayoutOrientPadding = {};\n if (isArray(spec)) {\n if (!isNil(spec[0])) {\n result.top = result.left = result.bottom = result.right = spec[0];\n }\n if (!isNil(spec[1])) {\n result.left = result.right = spec[1];\n }\n if (!isNil(spec[2])) {\n result.bottom = spec[2];\n }\n if (!isNil(spec[3])) {\n result.left = spec[3];\n }\n return result;\n }\n if (isNumber(spec) || isPercent(spec) || isFunction(spec)) {\n result.top = result.left = result.bottom = result.right = spec;\n return result;\n }\n if (isObject(spec)) {\n result = { ...spec };\n }\n return result;\n}\n\nexport function convertPoint(point: IPoint, relativePoint: IPoint, convert: boolean) {\n if (convert) {\n return {\n x: point.x + relativePoint.x,\n y: point.y + relativePoint.y\n };\n }\n return point;\n}\n"]}
1
+ {"version":3,"sources":["../src/util/space.ts"],"names":[],"mappings":";;;AAAA,6CAA6D;AAC7D,iCAA6F;AAY7F,SAAgB,aAAa,CAAC,MAAc;IAC1C,QAAQ,MAAM,EAAE;QACd,KAAK,MAAM,CAAC;QACZ,KAAK,OAAO,CAAC;QACb,KAAK,KAAK,CAAC;QACX,KAAK,QAAQ;YACX,OAAO,IAAI,CAAC;QACd;YACE,OAAO,KAAK,CAAC;KAChB;AACH,CAAC;AAVD,sCAUC;AAED,SAAgB,aAAa,CAAC,KAAa,EAAE,IAAW;IACtD,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAA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AC,CAAC;SACtC;QACD,IAAI,CAAC,IAAA,YAAK,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE;YACnB,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;SACzB;QACD,IAAI,CAAC,IAAA,YAAK,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE;YACnB,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;SACvB;QACD,OAAO,MAAM,CAAC;KACf;IACD,IAAI,IAAA,eAAQ,EAAC,IAAI,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,IAAA,iBAAU,EAAC,IAAI,CAAC,IAAI,eAAe,CAAC,IAAI,CAAC,EAAE;QAClF,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC;QAC/D,OAAO,MAAM,CAAC;KACf;IACD,IAAI,IAAA,eAAQ,EAAC,IAAI,CAAC,EAAE;QAClB,MAAM,qBAAQ,IAAI,CAAE,CAAC;QACrB,OAAO,MAAM,CAAC;KACf;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AA1BD,gEA0BC;AAED,SAAgB,YAAY,CAAC,KAAa,EAAE,aAAqB,EAAE,OAAgB;IACjF,IAAI,OAAO,EAAE;QACX,OAAO;YACL,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC;YAC5B,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC;SAC7B,CAAC;KACH;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AARD,oCAQC","file":"space.js","sourcesContent":["import { isArray, type IBoundsLike } from '@visactor/vutils';\nimport { isNumber, isNil, isString, isFunction, couldBeValidNumber, isObject } from './type';\nimport type {\n ILayoutPaddingSpec,\n IPercentOffset,\n ILayoutNumber,\n IPercent,\n ILayoutOrientPadding,\n ILayoutRect\n} from '../model/interface';\nimport type { IPadding, IRect } from '../typings/space';\nimport type { IPoint } from '../typings/coordinate';\n\nexport function isValidOrient(orient: string): boolean {\n switch (orient) {\n case 'left':\n case 'right':\n case 'top':\n case 'bottom':\n return true;\n default:\n return false;\n }\n}\n\nexport function isPointInRect(point: IPoint, rect: IRect) {\n const { x, y, width, height } = rect;\n const { x: x0, y: y0 } = point;\n return x0 < x + width && y0 < y + height && y0 > y && x0 > x;\n}\n\nexport function isPercent(v: any): v is IPercent {\n if (!isString(v)) {\n return false;\n }\n if (!v.endsWith('%')) {\n return false;\n }\n return couldBeValidNumber(v.substring(0, v.length - 1));\n}\n\nexport function isPercentOffset(v: any): v is IPercentOffset {\n if (!isObject(v)) {\n return false;\n }\n if ('percent' in v || 'offset' in v) {\n return true;\n }\n return false;\n}\n\nexport function calcLayoutNumber(\n v: ILayoutNumber | undefined,\n size: number,\n callOp?: ILayoutRect //如果是函数类型的话,函数的参数\n) {\n if (isNumber(v)) {\n return v;\n }\n if (isPercent(v)) {\n return (Number(v.substring(0, v.length - 1)) * size) / 100;\n }\n if (isFunction(v)) {\n return v(callOp);\n }\n if (isObject(v)) {\n return size * (v.percent ?? 0) + (v.offset ?? 0);\n }\n return 0;\n}\n\nexport function calcPadding(\n paddingSpec: ILayoutOrientPadding,\n rect: ILayoutRect,\n callOp: ILayoutRect //如果是函数类型的话,函数的参数\n): IPadding {\n const result: IPadding = {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0\n };\n if (Object.values(paddingSpec).every(value => isNumber(value))) {\n result.top = (<IPadding>paddingSpec).top ?? 0;\n result.right = (<IPadding>paddingSpec).right ?? 0;\n result.bottom = (<IPadding>paddingSpec).bottom ?? 0;\n result.left = (<IPadding>paddingSpec).left ?? 0;\n return result;\n }\n const paddings = [\n {\n orients: ['left', 'right'],\n size: rect.width\n },\n {\n orients: ['top', 'bottom'],\n size: rect.height\n }\n ];\n paddings.forEach(p => {\n p.orients.forEach(o => {\n result[o] = calcLayoutNumber(paddingSpec[o], p.size, callOp);\n });\n });\n return result;\n}\n\nexport function boundsInRect(bounds: IBoundsLike, rect: ILayoutRect): ILayoutRect {\n if (!bounds) {\n return { width: 0, height: 0 };\n }\n return {\n width: Math.ceil(Math.min(bounds.x2 - bounds.x1, rect.width)),\n height: Math.ceil(Math.min(bounds.y2 - bounds.y1, rect.height))\n };\n}\n\nexport function normalizeLayoutPaddingSpec(spec: ILayoutPaddingSpec): ILayoutOrientPadding {\n let result: ILayoutOrientPadding = {};\n if (isArray(spec)) {\n if (!isNil(spec[0])) {\n result.top = result.left = result.bottom = result.right = spec[0];\n }\n if (!isNil(spec[1])) {\n result.left = result.right = spec[1];\n }\n if (!isNil(spec[2])) {\n result.bottom = spec[2];\n }\n if (!isNil(spec[3])) {\n result.left = spec[3];\n }\n return result;\n }\n if (isNumber(spec) || isPercent(spec) || isFunction(spec) || isPercentOffset(spec)) {\n result.top = result.left = result.bottom = result.right = spec;\n return result;\n }\n if (isObject(spec)) {\n result = { ...spec };\n return result;\n }\n return result;\n}\n\nexport function convertPoint(point: IPoint, relativePoint: IPoint, convert: boolean) {\n if (convert) {\n return {\n x: point.x + relativePoint.x,\n y: point.y + relativePoint.y\n };\n }\n return point;\n}\n"]}
@@ -1,9 +1,8 @@
1
1
  import type { ITextMeasureOption } from '@visactor/vutils';
2
- import { TextMeasure, TestTextMeasure } from '@visactor/vutils';
2
+ import { TextMeasure } from '@visactor/vutils';
3
3
  import type { IRichTextAttribute } from '@visactor/vrender';
4
4
  import type { ITextMarkSpec } from '../typings';
5
5
  export declare const initTextMeasure: (textSpec?: Partial<ITextMarkSpec>, option?: Partial<ITextMeasureOption>, useNaiveCanvas?: boolean) => TextMeasure<ITextMarkSpec>;
6
- export declare const testTextMeasure: (textSpec?: Partial<ITextMarkSpec>, useVRender?: boolean) => TestTextMeasure<any>;
7
6
  type IRichTextBoundsParams = Partial<IRichTextAttribute>;
8
7
  export declare function getRichTextBounds(params: IRichTextBoundsParams): import("@visactor/vutils").IBounds;
9
8
  export {};
package/cjs/util/text.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
- }), exports.getRichTextBounds = exports.testTextMeasure = exports.initTextMeasure = void 0;
5
+ }), exports.getRichTextBounds = exports.initTextMeasure = void 0;
6
6
 
7
7
  const vutils_1 = require("@visactor/vutils"), vrender_1 = require("@visactor/vrender"), theme_1 = require("../theme"), initTextMeasure = (textSpec, option, useNaiveCanvas) => new vutils_1.TextMeasure(Object.assign({
8
8
  defaultFontParams: {
@@ -15,16 +15,6 @@ const vutils_1 = require("@visactor/vutils"), vrender_1 = require("@visactor/vre
15
15
 
16
16
  exports.initTextMeasure = initTextMeasure;
17
17
 
18
- const testTextMeasure = (textSpec, useVRender) => new vutils_1.TestTextMeasure({
19
- defaultFontParams: {
20
- fontFamily: theme_1.DEFAULT_TEXT_FONT_FAMILY,
21
- fontSize: theme_1.DEFAULT_TEXT_FONT_SIZE
22
- },
23
- getTextBounds: useVRender ? vrender_1.getTextBounds : void 0
24
- }, textSpec);
25
-
26
- exports.testTextMeasure = testTextMeasure;
27
-
28
18
  const richText = (0, vrender_1.createRichText)({});
29
19
 
30
20
  function getRichTextBounds(params) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/util/text.ts"],"names":[],"mappings":";;;AAEA,6CAAgE;AAGhE,+CAAkE;AAElE,oCAA4E;AAErE,MAAM,eAAe,GAAG,CAC7B,QAAiC,EACjC,MAAoC,EACpC,cAAwB,EACI,EAAE;IAC9B,OAAO,IAAI,oBAAW,iBAElB,iBAAiB,EAAE;YACjB,UAAU,EAAE,gCAAwB;YACpC,QAAQ,EAAE,8BAAsB;SACjC,EACD,aAAa,EAAE,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,uBAAa,EACzD,cAAc,EAAE,cAAc,GAAG,oBAAW,CAAC,iBAAiB,GAAG,oBAAW,CAAC,iBAAiB,CAAC,WAAW,EAAE,IACzG,CAAC,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,EAAE,CAAC,GAEnB,QAAQ,CACT,CAAC;AACJ,CAAC,CAAC;AAjBW,QAAA,eAAe,mBAiB1B;AAGK,MAAM,eAAe,GAAG,CAAC,QAAiC,EAAE,UAAoB,EAAwB,EAAE;IAC/G,OAAO,IAAI,wBAAe,CACxB;QACE,iBAAiB,EAAE;YACjB,UAAU,EAAE,gCAAwB;YACpC,QAAQ,EAAE,8BAAsB;SACjC;QACD,aAAa,EAAE,UAAU,CAAC,CAAC,CAAC,uBAAa,CAAC,CAAC,CAAC,SAAS;KACtD,EACD,QAAQ,CACT,CAAC;AACJ,CAAC,CAAC;AAXW,QAAA,eAAe,mBAW1B;AAKF,MAAM,QAAQ,GAAG,IAAA,wBAAc,EAAC,EAAE,CAAC,CAAC;AACpC,SAAgB,iBAAiB,CAAC,MAA6B;IAC7D,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IAC/B,OAAO,QAAQ,CAAC,UAAU,CAAC;AAC7B,CAAC;AAHD,8CAGC","file":"text.js","sourcesContent":["import type { ITextMeasureOption } from '@visactor/vutils';\n// eslint-disable-next-line no-duplicate-imports\nimport { TextMeasure, TestTextMeasure } from '@visactor/vutils';\nimport type { IRichTextAttribute } from '@visactor/vrender';\n// eslint-disable-next-line no-duplicate-imports\nimport { createRichText, getTextBounds } from '@visactor/vrender';\nimport type { ITextMarkSpec } from '../typings';\nimport { DEFAULT_TEXT_FONT_FAMILY, DEFAULT_TEXT_FONT_SIZE } from '../theme';\n\nexport const initTextMeasure = (\n textSpec?: Partial<ITextMarkSpec>,\n option?: Partial<ITextMeasureOption>,\n useNaiveCanvas?: boolean\n): TextMeasure<ITextMarkSpec> => {\n return new TextMeasure<ITextMarkSpec>(\n {\n defaultFontParams: {\n fontFamily: DEFAULT_TEXT_FONT_FAMILY,\n fontSize: DEFAULT_TEXT_FONT_SIZE\n },\n getTextBounds: useNaiveCanvas ? undefined : getTextBounds,\n specialCharSet: '-/: .,@%\\'\"~' + TextMeasure.ALPHABET_CHAR_SET + TextMeasure.ALPHABET_CHAR_SET.toUpperCase(),\n ...(option ?? {})\n },\n textSpec\n );\n};\n\n/** 测试方法 */\nexport const testTextMeasure = (textSpec?: Partial<ITextMarkSpec>, useVRender?: boolean): TestTextMeasure<any> => {\n return new TestTextMeasure(\n {\n defaultFontParams: {\n fontFamily: DEFAULT_TEXT_FONT_FAMILY,\n fontSize: DEFAULT_TEXT_FONT_SIZE\n },\n getTextBounds: useVRender ? getTextBounds : undefined\n },\n textSpec\n );\n};\n\n/** 测量富文本 */\n// FIXME: 等 vrender 支持后删掉\ntype IRichTextBoundsParams = Partial<IRichTextAttribute>;\nconst richText = createRichText({});\nexport function getRichTextBounds(params: IRichTextBoundsParams) {\n richText.setAttributes(params);\n return richText.AABBBounds;\n}\n"]}
1
+ {"version":3,"sources":["../src/util/text.ts"],"names":[],"mappings":";;;AAEA,6CAAgE;AAGhE,+CAAkE;AAElE,oCAA4E;AAErE,MAAM,eAAe,GAAG,CAC7B,QAAiC,EACjC,MAAoC,EACpC,cAAwB,EACI,EAAE;IAC9B,OAAO,IAAI,oBAAW,iBAElB,iBAAiB,EAAE;YACjB,UAAU,EAAE,gCAAwB;YACpC,QAAQ,EAAE,8BAAsB;SACjC,EACD,aAAa,EAAE,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,uBAAa,EACzD,cAAc,EAAE,cAAc,GAAG,oBAAW,CAAC,iBAAiB,GAAG,oBAAW,CAAC,iBAAiB,CAAC,WAAW,EAAE,IACzG,CAAC,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,EAAE,CAAC,GAEnB,QAAQ,CACT,CAAC;AACJ,CAAC,CAAC;AAjBW,QAAA,eAAe,mBAiB1B;AAKF,MAAM,QAAQ,GAAG,IAAA,wBAAc,EAAC,EAAE,CAAC,CAAC;AACpC,SAAgB,iBAAiB,CAAC,MAA6B;IAC7D,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IAC/B,OAAO,QAAQ,CAAC,UAAU,CAAC;AAC7B,CAAC;AAHD,8CAGC","file":"text.js","sourcesContent":["import type { ITextMeasureOption } from '@visactor/vutils';\n// eslint-disable-next-line no-duplicate-imports\nimport { TextMeasure, TestTextMeasure } from '@visactor/vutils';\nimport type { IRichTextAttribute } from '@visactor/vrender';\n// eslint-disable-next-line no-duplicate-imports\nimport { createRichText, getTextBounds } from '@visactor/vrender';\nimport type { ITextMarkSpec } from '../typings';\nimport { DEFAULT_TEXT_FONT_FAMILY, DEFAULT_TEXT_FONT_SIZE } from '../theme';\n\nexport const initTextMeasure = (\n textSpec?: Partial<ITextMarkSpec>,\n option?: Partial<ITextMeasureOption>,\n useNaiveCanvas?: boolean\n): TextMeasure<ITextMarkSpec> => {\n return new TextMeasure<ITextMarkSpec>(\n {\n defaultFontParams: {\n fontFamily: DEFAULT_TEXT_FONT_FAMILY,\n fontSize: DEFAULT_TEXT_FONT_SIZE\n },\n getTextBounds: useNaiveCanvas ? undefined : getTextBounds,\n specialCharSet: '-/: .,@%\\'\"~' + TextMeasure.ALPHABET_CHAR_SET + TextMeasure.ALPHABET_CHAR_SET.toUpperCase(),\n ...(option ?? {})\n },\n textSpec\n );\n};\n\n/** 测量富文本 */\n// FIXME: 等 vrender 支持后删掉\ntype IRichTextBoundsParams = Partial<IRichTextAttribute>;\nconst richText = createRichText({});\nexport function getRichTextBounds(params: IRichTextBoundsParams) {\n richText.setAttributes(params);\n return richText.AABBBounds;\n}\n"]}
package/cjs/vchart-all.js CHANGED
@@ -16,6 +16,6 @@ Object.defineProperty(exports, "VChart", {
16
16
  const chart_1 = require("./chart"), component_1 = require("./component"), layout_1 = require("./layout"), vrender_components_1 = require("@visactor/vrender-components");
17
17
 
18
18
  (0, vrender_components_1.loadPoptip)({}), core_1.VChart.useChart([ chart_1.AreaChart, chart_1.LineChart, chart_1.BarChart, chart_1.Bar3dChart, chart_1.ScatterChart, chart_1.MapChart, chart_1.PieChart, chart_1.Pie3dChart, chart_1.RoseChart, chart_1.RadarChart, chart_1.CommonChart, chart_1.SequenceChart, chart_1.HistogramChart, chart_1.Histogram3dChart, chart_1.CircularProgressChart, chart_1.WordCloudChart, chart_1.WordCloud3dChart, chart_1.FunnelChart, chart_1.Funnel3dChart, chart_1.LinearProgressChart, chart_1.RangeColumnChart, chart_1.RangeColumn3dChart, chart_1.SunburstChart, chart_1.CirclePackingChart, chart_1.TreeMapChart, chart_1.WaterfallChart, chart_1.BoxPlotChart, chart_1.SankeyChart, chart_1.GaugeChart, chart_1.RangeAreaChart, chart_1.HeatmapChart ]),
19
- core_1.VChart.useComponent([ component_1.CartesianLinearAxis, component_1.CartesianBandAxis, component_1.CartesianTimeAxis, component_1.CartesianLogAxis, component_1.PolarBandAxis, component_1.PolarLinearAxis, component_1.DiscreteLegend, component_1.ContinuousLegend, component_1.Tooltip, component_1.CartesianCrossHair, component_1.PolarCrossHair, component_1.DataZoom, component_1.ScrollBar, component_1.Indicator, component_1.GeoCoordinate, component_1.MarkLine, component_1.Title, component_1.MarkArea, component_1.Player, component_1.Label, component_1.MarkPoint, component_1.Brush, component_1.CustomMark, component_1.MapLabelComponent ]),
19
+ core_1.VChart.useComponent([ component_1.CartesianLinearAxis, component_1.CartesianBandAxis, component_1.CartesianTimeAxis, component_1.CartesianLogAxis, component_1.CartesianSymlogAxis, component_1.PolarBandAxis, component_1.PolarLinearAxis, component_1.DiscreteLegend, component_1.ContinuousLegend, component_1.Tooltip, component_1.CartesianCrossHair, component_1.PolarCrossHair, component_1.DataZoom, component_1.ScrollBar, component_1.Indicator, component_1.GeoCoordinate, component_1.MarkLine, component_1.Title, component_1.MarkArea, component_1.Player, component_1.TotalLabel, component_1.Label, component_1.MarkPoint, component_1.Brush, component_1.CustomMark, component_1.MapLabelComponent ]),
20
20
  core_1.Factory.registerLayout("grid", layout_1.GridLayout), core_1.Factory.registerLayout("layout3d", layout_1.Layout3d);
21
21
  //# sourceMappingURL=vchart-all.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/vchart-all.ts"],"names":[],"mappings":";;;AAAA,iCAAyC;AAsIhC,uFAtIA,aAAM,OAsIA;AArIf,mCAgCiB;AAEjB,2CAyBqB;AACrB,qCAAgD;AAChD,qEAA0D;AAG1D,IAAA,+BAAU,EAAC,EAAE,CAAC,CAAC;AAGf,aAAM,CAAC,QAAQ,CAAC;IACd,iBAAS;IACT,iBAAS;IACT,gBAAQ;IACR,kBAAU;IACV,oBAAY;IACZ,gBAAQ;IACR,gBAAQ;IACR,kBAAU;IACV,iBAAS;IACT,kBAAU;IACV,mBAAW;IACX,qBAAa;IACb,sBAAc;IACd,wBAAgB;IAChB,6BAAqB;IACrB,sBAAc;IACd,wBAAgB;IAChB,mBAAW;IACX,qBAAa;IACb,2BAAmB;IACnB,wBAAgB;IAChB,0BAAkB;IAClB,qBAAa;IACb,0BAAkB;IAClB,oBAAY;IACZ,sBAAc;IACd,oBAAY;IACZ,mBAAW;IACX,kBAAU;IACV,sBAAc;IACd,oBAAY;CACb,CAAC,CAAC;AAGH,aAAM,CAAC,YAAY,CAAC;IAClB,+BAAmB;IACnB,6BAAiB;IACjB,6BAAiB;IACjB,4BAAgB;IAChB,yBAAa;IACb,2BAAe;IACf,0BAAc;IACd,4BAAgB;IAChB,mBAAO;IACP,8BAAkB;IAClB,0BAAc;IACd,oBAAQ;IACR,qBAAS;IACT,qBAAS;IACT,yBAAa;IACb,oBAAQ;IACR,iBAAK;IACL,oBAAQ;IACR,kBAAM;IACN,iBAAK;IACL,qBAAS;IACT,iBAAK;IACL,sBAAU;IACV,6BAAiB;CAClB,CAAC,CAAC;AAGH,cAAO,CAAC,cAAc,CAAC,MAAM,EAAE,mBAAiB,CAAC,CAAC;AAClD,cAAO,CAAC,cAAc,CAAC,UAAU,EAAE,iBAAe,CAAC,CAAC","file":"vchart-all.js","sourcesContent":["import { VChart, Factory } from './core';\nimport {\n AreaChart,\n LineChart,\n BarChart,\n Bar3dChart,\n ScatterChart,\n MapChart,\n PieChart,\n Pie3dChart,\n RoseChart,\n RadarChart,\n CommonChart,\n SequenceChart,\n HistogramChart,\n Histogram3dChart,\n CircularProgressChart,\n WordCloudChart,\n WordCloud3dChart,\n FunnelChart,\n Funnel3dChart,\n LinearProgressChart,\n RangeColumnChart,\n RangeColumn3dChart,\n SunburstChart,\n CirclePackingChart,\n TreeMapChart,\n WaterfallChart,\n BoxPlotChart,\n SankeyChart,\n GaugeChart,\n RangeAreaChart,\n HeatmapChart\n} from './chart';\n\nimport {\n CartesianLinearAxis,\n CartesianBandAxis,\n CartesianTimeAxis,\n PolarBandAxis,\n CartesianLogAxis,\n PolarLinearAxis,\n DiscreteLegend,\n ContinuousLegend,\n Tooltip,\n CartesianCrossHair,\n PolarCrossHair,\n DataZoom,\n ScrollBar,\n Indicator,\n GeoCoordinate,\n MarkLine,\n Title,\n MarkArea,\n Player,\n Label,\n MarkPoint,\n Brush,\n CustomMark,\n MapLabelComponent\n} from './component';\nimport { GridLayout, Layout3d } from './layout';\nimport { loadPoptip } from '@visactor/vrender-components';\n\n// 装载 poptip\nloadPoptip({});\n\n// charts\nVChart.useChart([\n AreaChart,\n LineChart,\n BarChart,\n Bar3dChart,\n ScatterChart,\n MapChart,\n PieChart,\n Pie3dChart,\n RoseChart,\n RadarChart,\n CommonChart,\n SequenceChart,\n HistogramChart,\n Histogram3dChart,\n CircularProgressChart,\n WordCloudChart,\n WordCloud3dChart,\n FunnelChart,\n Funnel3dChart,\n LinearProgressChart,\n RangeColumnChart,\n RangeColumn3dChart,\n SunburstChart,\n CirclePackingChart,\n TreeMapChart,\n WaterfallChart,\n BoxPlotChart,\n SankeyChart,\n GaugeChart,\n RangeAreaChart,\n HeatmapChart\n]);\n\n// components\nVChart.useComponent([\n CartesianLinearAxis,\n CartesianBandAxis,\n CartesianTimeAxis,\n CartesianLogAxis,\n PolarBandAxis,\n PolarLinearAxis,\n DiscreteLegend,\n ContinuousLegend,\n Tooltip,\n CartesianCrossHair,\n PolarCrossHair,\n DataZoom,\n ScrollBar,\n Indicator,\n GeoCoordinate,\n MarkLine,\n Title,\n MarkArea,\n Player,\n Label,\n MarkPoint,\n Brush,\n CustomMark,\n MapLabelComponent\n]);\n\n// layout\nFactory.registerLayout('grid', GridLayout as any);\nFactory.registerLayout('layout3d', Layout3d as any);\n\nexport { VChart };\n"]}
1
+ {"version":3,"sources":["../src/vchart-all.ts"],"names":[],"mappings":";;;AAAA,iCAAyC;AA0IhC,uFA1IA,aAAM,OA0IA;AAzIf,mCAgCiB;AAEjB,2CA2BqB;AACrB,qCAAgD;AAChD,qEAA0D;AAG1D,IAAA,+BAAU,EAAC,EAAE,CAAC,CAAC;AAGf,aAAM,CAAC,QAAQ,CAAC;IACd,iBAAS;IACT,iBAAS;IACT,gBAAQ;IACR,kBAAU;IACV,oBAAY;IACZ,gBAAQ;IACR,gBAAQ;IACR,kBAAU;IACV,iBAAS;IACT,kBAAU;IACV,mBAAW;IACX,qBAAa;IACb,sBAAc;IACd,wBAAgB;IAChB,6BAAqB;IACrB,sBAAc;IACd,wBAAgB;IAChB,mBAAW;IACX,qBAAa;IACb,2BAAmB;IACnB,wBAAgB;IAChB,0BAAkB;IAClB,qBAAa;IACb,0BAAkB;IAClB,oBAAY;IACZ,sBAAc;IACd,oBAAY;IACZ,mBAAW;IACX,kBAAU;IACV,sBAAc;IACd,oBAAY;CACb,CAAC,CAAC;AAGH,aAAM,CAAC,YAAY,CAAC;IAClB,+BAAmB;IACnB,6BAAiB;IACjB,6BAAiB;IACjB,4BAAgB;IAChB,+BAAmB;IACnB,yBAAa;IACb,2BAAe;IACf,0BAAc;IACd,4BAAgB;IAChB,mBAAO;IACP,8BAAkB;IAClB,0BAAc;IACd,oBAAQ;IACR,qBAAS;IACT,qBAAS;IACT,yBAAa;IACb,oBAAQ;IACR,iBAAK;IACL,oBAAQ;IACR,kBAAM;IACN,sBAAU;IACV,iBAAK;IACL,qBAAS;IACT,iBAAK;IACL,sBAAU;IACV,6BAAiB;CAClB,CAAC,CAAC;AAGH,cAAO,CAAC,cAAc,CAAC,MAAM,EAAE,mBAAiB,CAAC,CAAC;AAClD,cAAO,CAAC,cAAc,CAAC,UAAU,EAAE,iBAAe,CAAC,CAAC","file":"vchart-all.js","sourcesContent":["import { VChart, Factory } from './core';\nimport {\n AreaChart,\n LineChart,\n BarChart,\n Bar3dChart,\n ScatterChart,\n MapChart,\n PieChart,\n Pie3dChart,\n RoseChart,\n RadarChart,\n CommonChart,\n SequenceChart,\n HistogramChart,\n Histogram3dChart,\n CircularProgressChart,\n WordCloudChart,\n WordCloud3dChart,\n FunnelChart,\n Funnel3dChart,\n LinearProgressChart,\n RangeColumnChart,\n RangeColumn3dChart,\n SunburstChart,\n CirclePackingChart,\n TreeMapChart,\n WaterfallChart,\n BoxPlotChart,\n SankeyChart,\n GaugeChart,\n RangeAreaChart,\n HeatmapChart\n} from './chart';\n\nimport {\n CartesianLinearAxis,\n CartesianBandAxis,\n CartesianTimeAxis,\n PolarBandAxis,\n CartesianLogAxis,\n CartesianSymlogAxis,\n PolarLinearAxis,\n DiscreteLegend,\n ContinuousLegend,\n Tooltip,\n CartesianCrossHair,\n PolarCrossHair,\n DataZoom,\n ScrollBar,\n Indicator,\n GeoCoordinate,\n MarkLine,\n Title,\n MarkArea,\n Player,\n Label,\n MarkPoint,\n Brush,\n CustomMark,\n MapLabelComponent,\n TotalLabel\n} from './component';\nimport { GridLayout, Layout3d } from './layout';\nimport { loadPoptip } from '@visactor/vrender-components';\n\n// 装载 poptip\nloadPoptip({});\n\n// charts\nVChart.useChart([\n AreaChart,\n LineChart,\n BarChart,\n Bar3dChart,\n ScatterChart,\n MapChart,\n PieChart,\n Pie3dChart,\n RoseChart,\n RadarChart,\n CommonChart,\n SequenceChart,\n HistogramChart,\n Histogram3dChart,\n CircularProgressChart,\n WordCloudChart,\n WordCloud3dChart,\n FunnelChart,\n Funnel3dChart,\n LinearProgressChart,\n RangeColumnChart,\n RangeColumn3dChart,\n SunburstChart,\n CirclePackingChart,\n TreeMapChart,\n WaterfallChart,\n BoxPlotChart,\n SankeyChart,\n GaugeChart,\n RangeAreaChart,\n HeatmapChart\n]);\n\n// components\nVChart.useComponent([\n CartesianLinearAxis,\n CartesianBandAxis,\n CartesianTimeAxis,\n CartesianLogAxis,\n CartesianSymlogAxis,\n PolarBandAxis,\n PolarLinearAxis,\n DiscreteLegend,\n ContinuousLegend,\n Tooltip,\n CartesianCrossHair,\n PolarCrossHair,\n DataZoom,\n ScrollBar,\n Indicator,\n GeoCoordinate,\n MarkLine,\n Title,\n MarkArea,\n Player,\n TotalLabel,\n Label,\n MarkPoint,\n Brush,\n CustomMark,\n MapLabelComponent\n]);\n\n// layout\nFactory.registerLayout('grid', GridLayout as any);\nFactory.registerLayout('layout3d', Layout3d as any);\n\nexport { VChart };\n"]}
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.VChart = void 0;
6
6
 
7
- const core_1 = require("./core");
7
+ const label_1 = require("./component/label/label"), cartesian_1 = require("./component/crosshair/cartesian"), tooltip_1 = require("./component/tooltip/tooltip"), legend_1 = require("./component/legend/discrete/legend"), time_axis_1 = require("./component/axis/cartesian/time-axis"), band_axis_1 = require("./component/axis/cartesian/band-axis"), linear_axis_1 = require("./component/axis/cartesian/linear-axis"), core_1 = require("./core");
8
8
 
9
9
  Object.defineProperty(exports, "VChart", {
10
10
  enumerable: !0,
@@ -13,8 +13,7 @@ Object.defineProperty(exports, "VChart", {
13
13
  }
14
14
  });
15
15
 
16
- const chart_1 = require("./chart"), component_1 = require("./component");
16
+ const line_1 = require("./chart/line"), pie_1 = require("./chart/pie"), bar_1 = require("./chart/bar");
17
17
 
18
- core_1.VChart.useChart([ chart_1.LineChart, chart_1.BarChart, chart_1.PieChart ]),
19
- core_1.VChart.useComponent([ component_1.CartesianLinearAxis, component_1.CartesianBandAxis, component_1.CartesianTimeAxis, component_1.DiscreteLegend, component_1.Tooltip, component_1.CartesianCrossHair, component_1.Label ]);
18
+ core_1.VChart.useChart([ line_1.LineChart, bar_1.BarChart, pie_1.PieChart ]), core_1.VChart.useComponent([ linear_axis_1.CartesianLinearAxis, band_axis_1.CartesianBandAxis, time_axis_1.CartesianTimeAxis, legend_1.DiscreteLegend, tooltip_1.Tooltip, cartesian_1.CartesianCrossHair, label_1.Label ]);
20
19
  //# sourceMappingURL=vchart-simple.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/vchart-simple.ts"],"names":[],"mappings":";;;AAGA,iCAAgC;AA0BvB,uFA1BA,aAAM,OA0BA;AAzBf,mCAAwD;AACxD,2CAQqB;AAGrB,aAAM,CAAC,QAAQ,CAAC,CAAC,iBAAS,EAAE,gBAAQ,EAAE,gBAAQ,CAAC,CAAC,CAAC;AAGjD,aAAM,CAAC,YAAY,CAAC;IAClB,+BAAmB;IACnB,6BAAiB;IACjB,6BAAiB;IACjB,0BAAc;IACd,mBAAO;IACP,8BAAkB;IAClB,iBAAK;CACN,CAAC,CAAC","file":"vchart-simple.js","sourcesContent":["/**\n * @description 包含基础的折柱饼图,提供坐标轴、离散图例以及 tooltip、crosshair、label 组件\n */\nimport { VChart } from './core';\nimport { LineChart, BarChart, PieChart } from './chart';\nimport {\n CartesianLinearAxis,\n CartesianBandAxis,\n CartesianTimeAxis,\n DiscreteLegend,\n Tooltip,\n CartesianCrossHair,\n Label\n} from './component';\n\n// charts\nVChart.useChart([LineChart, BarChart, PieChart]);\n\n// components\nVChart.useComponent([\n CartesianLinearAxis,\n CartesianBandAxis,\n CartesianTimeAxis,\n DiscreteLegend,\n Tooltip,\n CartesianCrossHair,\n Label\n]);\n\nexport { VChart };\n"]}
1
+ {"version":3,"sources":["../src/vchart-simple.ts"],"names":[],"mappings":";;;AAAA,mDAAgD;AAChD,+DAAqE;AACrE,yDAAsD;AACtD,+DAAoE;AACpE,oEAAyE;AACzE,oEAAyE;AACzE,wEAA6E;AAI7E,iCAAgC;AAmBvB,uFAnBA,aAAM,OAmBA;AAlBf,uCAAyC;AACzC,qCAAuC;AACvC,qCAAuC;AAGvC,aAAM,CAAC,QAAQ,CAAC,CAAC,gBAAS,EAAE,cAAQ,EAAE,cAAQ,CAAC,CAAC,CAAC;AAGjD,aAAM,CAAC,YAAY,CAAC;IAClB,iCAAmB;IACnB,6BAAiB;IACjB,6BAAiB;IACjB,uBAAc;IACd,iBAAO;IACP,8BAAkB;IAClB,aAAK;CACN,CAAC,CAAC","file":"vchart-simple.js","sourcesContent":["import { Label } from './component/label/label';\nimport { CartesianCrossHair } from './component/crosshair/cartesian';\nimport { Tooltip } from './component/tooltip/tooltip';\nimport { DiscreteLegend } from './component/legend/discrete/legend';\nimport { CartesianTimeAxis } from './component/axis/cartesian/time-axis';\nimport { CartesianBandAxis } from './component/axis/cartesian/band-axis';\nimport { CartesianLinearAxis } from './component/axis/cartesian/linear-axis';\n/**\n * @description 包含基础的折柱饼图,提供坐标轴、离散图例以及 tooltip、crosshair、label 组件\n */\nimport { VChart } from './core';\nimport { LineChart } from './chart/line';\nimport { PieChart } from './chart/pie';\nimport { BarChart } from './chart/bar';\n\n// charts\nVChart.useChart([LineChart, BarChart, PieChart]);\n\n// components\nVChart.useComponent([\n CartesianLinearAxis,\n CartesianBandAxis,\n CartesianTimeAxis,\n DiscreteLegend,\n Tooltip,\n CartesianCrossHair,\n Label\n]);\n\nexport { VChart };\n"]}
@@ -1,6 +1,6 @@
1
1
  import type { IAnimationConfig } from '@visactor/vgrammar';
2
2
  import type { EasingType } from '@visactor/vrender';
3
- export type { IMorphConfig, IMorphAnimationConfig } from '@visactor/vgrammar';
3
+ export type { IRunningConfig as IMorphConfig, IMorphAnimationConfig } from '@visactor/vgrammar';
4
4
  export type IStateAnimateSpec<Preset extends string> = {
5
5
  preset?: Preset | false;
6
6
  duration?: number;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/animation/spec.ts"],"names":[],"mappings":"","file":"spec.js","sourcesContent":["import type { IAnimationConfig } from '@visactor/vgrammar';\nimport type { EasingType } from '@visactor/vrender';\nexport type { IMorphConfig, IMorphAnimationConfig } from '@visactor/vgrammar';\n\nexport type IStateAnimateSpec<Preset extends string> = {\n /**\n * 预设动画效果\n */\n preset?: Preset | false;\n /**\n * 图表动画时长\n */\n duration?: number;\n /**\n * 动画延迟开始的时长\n */\n delay?: number;\n /**\n * 动画缓动效果\n */\n easing?: EasingType;\n /**\n * 是否轮流执行\n */\n oneByOne?: boolean;\n};\n\nexport type IMarkAnimateSpec<MarkName extends string> = Partial<\n Record<MarkName, false | IAnimationConfig | IAnimationConfig[]>\n>;\n\nexport interface IAnimationSpec<MarkName extends string, Preset extends string> {\n /**\n * 图表入场动画\n * 支持配置图表内置不同动画效果\n */\n animationAppear?: boolean | IStateAnimateSpec<Preset> | IMarkAnimateSpec<MarkName>;\n /**\n * 数据更新 - 新增数据动画\n */\n animationEnter?: boolean | Omit<IStateAnimateSpec<Preset>, 'preset'> | IMarkAnimateSpec<MarkName>;\n /**\n * 数据更新 - 数据更新动画\n */\n animationUpdate?: boolean | Omit<IStateAnimateSpec<Preset>, 'preset'> | IMarkAnimateSpec<MarkName>;\n /**\n * 数据更新 - 数据删除动画\n */\n animationExit?: boolean | Omit<IStateAnimateSpec<Preset>, 'preset'> | IMarkAnimateSpec<MarkName>;\n /**\n * 图表退场动画\n */\n animationDisappear?: boolean | Omit<IStateAnimateSpec<Preset>, 'preset'> | IMarkAnimateSpec<MarkName>;\n /**\n * 循环动画\n */\n animationNormal?: IMarkAnimateSpec<MarkName>;\n}\nexport interface IMorphSeriesSpec {\n /**\n * 系列全局动画是否开启\n * @default true\n */\n enable?: boolean;\n /**\n * 图元匹配字段\n * 系列前后根据 morphKey 配置的内容进行关联\n */\n morphKey?: string;\n /**\n * 数据匹配字段\n * 多数据图元可配置\n */\n morphElementKey?: string;\n}\n"]}
1
+ {"version":3,"sources":["../src/animation/spec.ts"],"names":[],"mappings":"","file":"spec.js","sourcesContent":["import type { IAnimationConfig } from '@visactor/vgrammar';\nimport type { EasingType } from '@visactor/vrender';\nexport type { IRunningConfig as IMorphConfig, IMorphAnimationConfig } from '@visactor/vgrammar';\n\nexport type IStateAnimateSpec<Preset extends string> = {\n /**\n * 预设动画效果\n */\n preset?: Preset | false;\n /**\n * 图表动画时长\n */\n duration?: number;\n /**\n * 动画延迟开始的时长\n */\n delay?: number;\n /**\n * 动画缓动效果\n */\n easing?: EasingType;\n /**\n * 是否轮流执行\n */\n oneByOne?: boolean;\n};\n\nexport type IMarkAnimateSpec<MarkName extends string> = Partial<\n Record<MarkName, false | IAnimationConfig | IAnimationConfig[]>\n>;\n\nexport interface IAnimationSpec<MarkName extends string, Preset extends string> {\n /**\n * 图表入场动画\n * 支持配置图表内置不同动画效果\n */\n animationAppear?: boolean | IStateAnimateSpec<Preset> | IMarkAnimateSpec<MarkName>;\n /**\n * 数据更新 - 新增数据动画\n */\n animationEnter?: boolean | Omit<IStateAnimateSpec<Preset>, 'preset'> | IMarkAnimateSpec<MarkName>;\n /**\n * 数据更新 - 数据更新动画\n */\n animationUpdate?: boolean | Omit<IStateAnimateSpec<Preset>, 'preset'> | IMarkAnimateSpec<MarkName>;\n /**\n * 数据更新 - 数据删除动画\n */\n animationExit?: boolean | Omit<IStateAnimateSpec<Preset>, 'preset'> | IMarkAnimateSpec<MarkName>;\n /**\n * 图表退场动画\n */\n animationDisappear?: boolean | Omit<IStateAnimateSpec<Preset>, 'preset'> | IMarkAnimateSpec<MarkName>;\n /**\n * 循环动画\n */\n animationNormal?: IMarkAnimateSpec<MarkName>;\n}\nexport interface IMorphSeriesSpec {\n /**\n * 系列全局动画是否开启\n * @default true\n */\n enable?: boolean;\n /**\n * 图元匹配字段\n * 系列前后根据 morphKey 配置的内容进行关联\n */\n morphKey?: string;\n /**\n * 数据匹配字段\n * 多数据图元可配置\n */\n morphElementKey?: string;\n}\n"]}
@@ -1,14 +1,14 @@
1
+ import { AreaSeries } from "./../../series/area/area";
2
+
1
3
  import { SeriesTypeEnum } from "../../series/interface";
2
4
 
3
5
  import { CartesianChart } from "../cartesian/cartesian";
4
6
 
5
7
  import { ChartTypeEnum } from "../interface";
6
8
 
7
- import { setDefaultCrosshairForCartesianChart } from "../util";
8
-
9
9
  import { VChart } from "../../core/vchart";
10
10
 
11
- import { AreaSeries } from "../../series";
11
+ import { setDefaultCrosshairForCartesianChart } from "../util";
12
12
 
13
13
  VChart.useSeries([ AreaSeries ]);
14
14
 
@@ -19,7 +19,6 @@ export class AreaChart extends CartesianChart {
19
19
  _getDefaultSeriesSpec(spec) {
20
20
  var _a;
21
21
  return Object.assign(Object.assign({}, super._getDefaultSeriesSpec(spec)), {
22
- invalidType: spec.invalidType || "break",
23
22
  point: spec.point,
24
23
  line: spec.line,
25
24
  area: spec.area,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/chart/area/area.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,oCAAoC,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,MAAM,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;AAE/B,MAAM,OAAO,SAAU,SAAQ,cAAc;IAA7C;;QAGW,SAAI,GAAW,aAAa,CAAC,IAAI,CAAC;QAClC,eAAU,GAAW,cAAc,CAAC,IAAI,CAAC;IAkBpD,CAAC;IAhBW,qBAAqB,CAAC,IAAoB;;QAClD,uCACK,KAAK,CAAC,qBAAqB,CAAC,IAAI,CAAC,KACpC,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,OAAO,EACxC,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,UAAU,EAAE,MAAA,IAAI,CAAC,UAAU,mCAAI,MAAM,EACrC,WAAW,EAAE,IAAI,CAAC,WAAW,IAC7B;IACJ,CAAC;IAED,aAAa,CAAC,IAAS;QACrB,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC1B,oCAAoC,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;;AApBe,cAAI,GAAW,aAAa,CAAC,IAAI,CAAC;AAClC,cAAI,GAAW,eAAe,CAAC","file":"area.js","sourcesContent":["import { SeriesTypeEnum } from '../../series/interface';\nimport { CartesianChart } from '../cartesian/cartesian';\nimport { ChartTypeEnum } from '../interface';\nimport type { IAreaChartSpec } from './interface';\nimport { setDefaultCrosshairForCartesianChart } from '../util';\nimport { VChart } from '../../core/vchart';\nimport { AreaSeries } from '../../series';\nVChart.useSeries([AreaSeries]);\n\nexport class AreaChart extends CartesianChart {\n static readonly type: string = ChartTypeEnum.area;\n static readonly view: string = 'singleDefault';\n readonly type: string = ChartTypeEnum.area;\n readonly seriesType: string = SeriesTypeEnum.area;\n\n protected _getDefaultSeriesSpec(spec: IAreaChartSpec): any {\n return {\n ...super._getDefaultSeriesSpec(spec),\n invalidType: spec.invalidType || 'break',\n point: spec.point,\n line: spec.line,\n area: spec.area,\n seriesMark: spec.seriesMark ?? 'area',\n activePoint: spec.activePoint\n };\n }\n\n transformSpec(spec: any): void {\n super.transformSpec(spec);\n setDefaultCrosshairForCartesianChart(spec);\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/chart/area/area.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,oCAAoC,EAAE,MAAM,SAAS,CAAC;AAC/D,MAAM,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;AAE/B,MAAM,OAAO,SAAU,SAAQ,cAAc;IAA7C;;QAGW,SAAI,GAAW,aAAa,CAAC,IAAI,CAAC;QAClC,eAAU,GAAW,cAAc,CAAC,IAAI,CAAC;IAiBpD,CAAC;IAfW,qBAAqB,CAAC,IAAoB;;QAClD,uCACK,KAAK,CAAC,qBAAqB,CAAC,IAAI,CAAC,KACpC,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,UAAU,EAAE,MAAA,IAAI,CAAC,UAAU,mCAAI,MAAM,EACrC,WAAW,EAAE,IAAI,CAAC,WAAW,IAC7B;IACJ,CAAC;IAED,aAAa,CAAC,IAAS;QACrB,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC1B,oCAAoC,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;;AAnBe,cAAI,GAAW,aAAa,CAAC,IAAI,CAAC;AAClC,cAAI,GAAW,eAAe,CAAC","file":"area.js","sourcesContent":["import { AreaSeries } from './../../series/area/area';\nimport { SeriesTypeEnum } from '../../series/interface';\nimport { CartesianChart } from '../cartesian/cartesian';\nimport { ChartTypeEnum } from '../interface';\nimport type { IAreaChartSpec } from './interface';\nimport { VChart } from '../../core/vchart';\nimport { setDefaultCrosshairForCartesianChart } from '../util';\nVChart.useSeries([AreaSeries]);\n\nexport class AreaChart extends CartesianChart {\n static readonly type: string = ChartTypeEnum.area;\n static readonly view: string = 'singleDefault';\n readonly type: string = ChartTypeEnum.area;\n readonly seriesType: string = SeriesTypeEnum.area;\n\n protected _getDefaultSeriesSpec(spec: IAreaChartSpec): any {\n return {\n ...super._getDefaultSeriesSpec(spec),\n point: spec.point,\n line: spec.line,\n area: spec.area,\n seriesMark: spec.seriesMark ?? 'area',\n activePoint: spec.activePoint\n };\n }\n\n transformSpec(spec: any): void {\n super.transformSpec(spec);\n setDefaultCrosshairForCartesianChart(spec);\n }\n}\n"]}
@@ -1,3 +1,5 @@
1
+ import { Bar3dSeries } from "./../../series/bar/bar-3d";
2
+
1
3
  import { SeriesTypeEnum } from "../../series/interface";
2
4
 
3
5
  import { CartesianChart } from "../cartesian/cartesian";
@@ -6,8 +8,6 @@ import { ChartTypeEnum } from "../interface";
6
8
 
7
9
  import { VChart } from "../../core/vchart";
8
10
 
9
- import { Bar3dSeries } from "../../series";
10
-
11
11
  VChart.useSeries([ Bar3dSeries ]);
12
12
 
13
13
  export class Bar3dChart extends CartesianChart {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/chart/bar/bar-3d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;AAEhC,MAAM,OAAO,UAAW,SAAQ,cAAc;IAA9C;;QAGW,SAAI,GAAW,aAAa,CAAC,KAAK,CAAC;QACnC,eAAU,GAAW,cAAc,CAAC,KAAK,CAAC;IAWrD,CAAC;IATW,qBAAqB,CAAC,IAAS;QACvC,uCACK,KAAK,CAAC,qBAAqB,CAAC,IAAI,CAAC,KACpC,QAAQ,EAAoB,IAAK,CAAC,QAAQ,EAC1C,WAAW,EAAoB,IAAK,CAAC,WAAW,EAChD,WAAW,EAAoB,IAAK,CAAC,WAAW,EAChD,aAAa,EAAoB,IAAK,CAAC,aAAa,IACpD;IACJ,CAAC;;AAbe,eAAI,GAAW,aAAa,CAAC,KAAK,CAAC;AACnC,eAAI,GAAW,eAAe,CAAC","file":"bar-3d.js","sourcesContent":["import { SeriesTypeEnum } from '../../series/interface';\nimport { CartesianChart } from '../cartesian/cartesian';\nimport { ChartTypeEnum } from '../interface';\nimport { VChart } from '../../core/vchart';\nimport { Bar3dSeries } from '../../series';\nimport type { IBar3dChartSpec } from './interface';\nVChart.useSeries([Bar3dSeries]);\n\nexport class Bar3dChart extends CartesianChart {\n static readonly type: string = ChartTypeEnum.bar3d;\n static readonly view: string = 'singleDefault';\n readonly type: string = ChartTypeEnum.bar3d;\n readonly seriesType: string = SeriesTypeEnum.bar3d;\n\n protected _getDefaultSeriesSpec(spec: any): any {\n return {\n ...super._getDefaultSeriesSpec(spec),\n barWidth: (<IBar3dChartSpec>spec).barWidth,\n barMaxWidth: (<IBar3dChartSpec>spec).barMaxWidth,\n barMinWidth: (<IBar3dChartSpec>spec).barMinWidth,\n barGapInGroup: (<IBar3dChartSpec>spec).barGapInGroup\n };\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/chart/bar/bar-3d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,MAAM,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;AAEhC,MAAM,OAAO,UAAW,SAAQ,cAAc;IAA9C;;QAGW,SAAI,GAAW,aAAa,CAAC,KAAK,CAAC;QACnC,eAAU,GAAW,cAAc,CAAC,KAAK,CAAC;IAWrD,CAAC;IATW,qBAAqB,CAAC,IAAS;QACvC,uCACK,KAAK,CAAC,qBAAqB,CAAC,IAAI,CAAC,KACpC,QAAQ,EAAoB,IAAK,CAAC,QAAQ,EAC1C,WAAW,EAAoB,IAAK,CAAC,WAAW,EAChD,WAAW,EAAoB,IAAK,CAAC,WAAW,EAChD,aAAa,EAAoB,IAAK,CAAC,aAAa,IACpD;IACJ,CAAC;;AAbe,eAAI,GAAW,aAAa,CAAC,KAAK,CAAC;AACnC,eAAI,GAAW,eAAe,CAAC","file":"bar-3d.js","sourcesContent":["import { Bar3dSeries } from './../../series/bar/bar-3d';\nimport { SeriesTypeEnum } from '../../series/interface';\nimport { CartesianChart } from '../cartesian/cartesian';\nimport { ChartTypeEnum } from '../interface';\nimport { VChart } from '../../core/vchart';\nimport type { IBar3dChartSpec } from './interface';\nVChart.useSeries([Bar3dSeries]);\n\nexport class Bar3dChart extends CartesianChart {\n static readonly type: string = ChartTypeEnum.bar3d;\n static readonly view: string = 'singleDefault';\n readonly type: string = ChartTypeEnum.bar3d;\n readonly seriesType: string = SeriesTypeEnum.bar3d;\n\n protected _getDefaultSeriesSpec(spec: any): any {\n return {\n ...super._getDefaultSeriesSpec(spec),\n barWidth: (<IBar3dChartSpec>spec).barWidth,\n barMaxWidth: (<IBar3dChartSpec>spec).barMaxWidth,\n barMinWidth: (<IBar3dChartSpec>spec).barMinWidth,\n barGapInGroup: (<IBar3dChartSpec>spec).barGapInGroup\n };\n }\n}\n"]}
@@ -1,3 +1,5 @@
1
+ import { BarSeries } from "./../../series/bar/bar";
2
+
1
3
  import { SeriesTypeEnum } from "../../series/interface";
2
4
 
3
5
  import { CartesianChart } from "../cartesian/cartesian";
@@ -8,8 +10,6 @@ import { setDefaultCrosshairForCartesianChart } from "../util";
8
10
 
9
11
  import { VChart } from "../../core/vchart";
10
12
 
11
- import { BarSeries } from "../../series";
12
-
13
13
  VChart.useSeries([ BarSeries ]);
14
14
 
15
15
  export class BarChart extends CartesianChart {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/chart/bar/bar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,oCAAoC,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;AAE9B,MAAM,OAAO,QAAS,SAAQ,cAAc;IAA5C;;QAGW,SAAI,GAAW,aAAa,CAAC,GAAG,CAAC;QACjC,eAAU,GAAW,cAAc,CAAC,GAAG,CAAC;IAgBnD,CAAC;IAdW,qBAAqB,CAAC,IAAS;QACvC,uCACK,KAAK,CAAC,qBAAqB,CAAC,IAAI,CAAC,KACpC,QAAQ,EAAkB,IAAK,CAAC,QAAQ,EACxC,WAAW,EAAkB,IAAK,CAAC,WAAW,EAC9C,WAAW,EAAkB,IAAK,CAAC,WAAW,EAC9C,aAAa,EAAkB,IAAK,CAAC,aAAa,IAClD;IACJ,CAAC;IAED,aAAa,CAAC,IAAS;QACrB,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC1B,oCAAoC,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;;AAlBe,aAAI,GAAW,aAAa,CAAC,GAAG,CAAC;AACjC,aAAI,GAAW,eAAe,CAAC","file":"bar.js","sourcesContent":["import { SeriesTypeEnum } from '../../series/interface';\nimport { CartesianChart } from '../cartesian/cartesian';\nimport { ChartTypeEnum } from '../interface';\nimport { setDefaultCrosshairForCartesianChart } from '../util';\nimport { VChart } from '../../core/vchart';\nimport { BarSeries } from '../../series';\nimport type { IBarChartSpec } from './interface';\nVChart.useSeries([BarSeries]);\n\nexport class BarChart extends CartesianChart {\n static readonly type: string = ChartTypeEnum.bar;\n static readonly view: string = 'singleDefault';\n readonly type: string = ChartTypeEnum.bar;\n readonly seriesType: string = SeriesTypeEnum.bar;\n\n protected _getDefaultSeriesSpec(spec: any): any {\n return {\n ...super._getDefaultSeriesSpec(spec),\n barWidth: (<IBarChartSpec>spec).barWidth,\n barMaxWidth: (<IBarChartSpec>spec).barMaxWidth,\n barMinWidth: (<IBarChartSpec>spec).barMinWidth,\n barGapInGroup: (<IBarChartSpec>spec).barGapInGroup\n };\n }\n\n transformSpec(spec: any): void {\n super.transformSpec(spec);\n setDefaultCrosshairForCartesianChart(spec);\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/chart/bar/bar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,oCAAoC,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,MAAM,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;AAE9B,MAAM,OAAO,QAAS,SAAQ,cAAc;IAA5C;;QAGW,SAAI,GAAW,aAAa,CAAC,GAAG,CAAC;QACjC,eAAU,GAAW,cAAc,CAAC,GAAG,CAAC;IAgBnD,CAAC;IAdW,qBAAqB,CAAC,IAAS;QACvC,uCACK,KAAK,CAAC,qBAAqB,CAAC,IAAI,CAAC,KACpC,QAAQ,EAAkB,IAAK,CAAC,QAAQ,EACxC,WAAW,EAAkB,IAAK,CAAC,WAAW,EAC9C,WAAW,EAAkB,IAAK,CAAC,WAAW,EAC9C,aAAa,EAAkB,IAAK,CAAC,aAAa,IAClD;IACJ,CAAC;IAED,aAAa,CAAC,IAAS;QACrB,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC1B,oCAAoC,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;;AAlBe,aAAI,GAAW,aAAa,CAAC,GAAG,CAAC;AACjC,aAAI,GAAW,eAAe,CAAC","file":"bar.js","sourcesContent":["import { BarSeries } from './../../series/bar/bar';\nimport { SeriesTypeEnum } from '../../series/interface';\nimport { CartesianChart } from '../cartesian/cartesian';\nimport { ChartTypeEnum } from '../interface';\nimport { setDefaultCrosshairForCartesianChart } from '../util';\nimport { VChart } from '../../core/vchart';\nimport type { IBarChartSpec } from './interface';\nVChart.useSeries([BarSeries]);\n\nexport class BarChart extends CartesianChart {\n static readonly type: string = ChartTypeEnum.bar;\n static readonly view: string = 'singleDefault';\n readonly type: string = ChartTypeEnum.bar;\n readonly seriesType: string = SeriesTypeEnum.bar;\n\n protected _getDefaultSeriesSpec(spec: any): any {\n return {\n ...super._getDefaultSeriesSpec(spec),\n barWidth: (<IBarChartSpec>spec).barWidth,\n barMaxWidth: (<IBarChartSpec>spec).barMaxWidth,\n barMinWidth: (<IBarChartSpec>spec).barMinWidth,\n barGapInGroup: (<IBarChartSpec>spec).barGapInGroup\n };\n }\n\n transformSpec(spec: any): void {\n super.transformSpec(spec);\n setDefaultCrosshairForCartesianChart(spec);\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { ISeriesSpec, Datum, IMarkStateSpec, IRegionQuerier, MaybeArray, IPadding, IRect, StringOrNumber, IChartSpec } from '../typings';
1
+ import type { ISeriesSpec, Datum, IMarkStateSpec, IRegionQuerier, MaybeArray, IPadding, IRect, StringOrNumber, IChartSpec, IDataValues } from '../typings';
2
2
  import type { LayoutCallBack } from '../layout/interface';
3
3
  import type { ILayoutModelState, ILayoutOrientPadding, ILayoutRect, IModel, IModelOption, IUpdateSpecResult } from '../model/interface';
4
4
  import type { IChart, IChartLayoutOption, IChartRenderOption, IChartOption, IChartEvaluateOption, ILayoutParams, DimensionIndexOption } from './interface';
@@ -13,7 +13,7 @@ import { Stack } from './stack';
13
13
  import type { ITheme } from '../theme/interface';
14
14
  import type { IParserOptions } from '@visactor/vdataset/es/parser';
15
15
  import type { IBoundsLike } from '@visactor/vutils';
16
- import type { IMorphConfig, IMark as IVGrammarMark, IView } from '@visactor/vgrammar';
16
+ import type { IRunningConfig as IMorphConfig, IMark as IVGrammarMark, IView } from '@visactor/vgrammar';
17
17
  import { CompilableBase } from '../compile/compilable-base';
18
18
  import type { IGlobalScale } from '../scale/interface';
19
19
  import type { IRectMark } from '../mark/rect';
@@ -96,7 +96,9 @@ export declare class BaseChart extends CompilableBase implements IChart {
96
96
  getMarkById(id: number): IMark | undefined;
97
97
  updateParseData(id: string, data: Datum[], options?: IParserOptions): void;
98
98
  updateData(id: StringOrNumber, data: unknown, updateGlobalScale?: boolean, options?: IParserOptions): void;
99
+ updateFullData(data: IDataValues | IDataValues[], updateGlobalScale?: boolean): void;
99
100
  onRender(option: IChartRenderOption): void;
101
+ setCanvasRect(width: number, height: number): void;
100
102
  getCanvasRect(): Omit<IRect, 'x' | 'y'>;
101
103
  getSeriesData(id: StringOrNumber | undefined, index: number | undefined): DataView | undefined;
102
104
  private _transformSpecScale;
@@ -34,7 +34,7 @@ import { Factory } from "../core/factory";
34
34
 
35
35
  import { Event } from "../event/event";
36
36
 
37
- import { isArray, isValid, createID, calcPadding, normalizeLayoutPaddingSpec, array, isTrueBrowser, isString, convertBackgroundSpec, isMiniAppLikeMode } from "../util";
37
+ import { isArray, isValid, createID, calcPadding, normalizeLayoutPaddingSpec, array, convertBackgroundSpec } from "../util";
38
38
 
39
39
  import { Stack } from "./stack";
40
40
 
@@ -46,7 +46,7 @@ import { DEFAULT_CHART_WIDTH, DEFAULT_CHART_HEIGHT } from "../constant/base";
46
46
 
47
47
  import { dataToDataView } from "../data/initialize";
48
48
 
49
- import { has, isFunction, isEmpty, getContainerSize } from "@visactor/vutils";
49
+ import { has, isFunction, isEmpty } from "@visactor/vutils";
50
50
 
51
51
  import { getActualColor, getDataScheme } from "../theme/color-scheme/util";
52
52
 
@@ -58,6 +58,8 @@ import { ChartEvent, VGRAMMAR_HOOK_EVENT } from "../constant";
58
58
 
59
59
  import { DimensionEventEnum } from "../event/events/dimension";
60
60
 
61
+ import { calculateChartSize } from "./util";
62
+
61
63
  export class BaseChart extends CompilableBase {
62
64
  getSpec() {
63
65
  return this._spec;
@@ -333,36 +335,28 @@ export class BaseChart extends CompilableBase {
333
335
  dv && dv.parseNewData(data, options), updateGlobalScale && this.updateGlobalScaleDomain(),
334
336
  this.getAllModels().forEach((model => model.onDataUpdate()));
335
337
  }
338
+ updateFullData(data, updateGlobalScale = !0) {
339
+ const dvs = [];
340
+ array(data).forEach((d => {
341
+ const dv = this._dataSet.getDataView(d.id);
342
+ dv && (dvs.push({
343
+ d: d,
344
+ dv: dv
345
+ }), dv.markRunning());
346
+ })), dvs.forEach((({d: d, dv: dv}) => {
347
+ dv.setFields(d.fields), dv.parseNewData(d.values, d.parser);
348
+ })), updateGlobalScale && this.updateGlobalScaleDomain(), this.getAllModels().forEach((model => model.onDataUpdate()));
349
+ }
336
350
  onRender(option) {}
351
+ setCanvasRect(width, height) {
352
+ this._canvasRect = {
353
+ width: width,
354
+ height: height
355
+ };
356
+ }
337
357
  getCanvasRect() {
338
- var _a;
339
- if (this._canvasRect) return this._canvasRect;
340
- const {width: userWidth, height: userHeight} = this._spec;
341
- if (isValid(userWidth) && isValid(userHeight)) this._canvasRect = {
342
- width: userWidth,
343
- height: userHeight
344
- }; else {
345
- let width = DEFAULT_CHART_WIDTH, height = DEFAULT_CHART_HEIGHT;
346
- const container = this._option.container, canvas = this._option.canvas;
347
- if (container) {
348
- const {width: containerWidth, height: containerHeight} = getContainerSize(this._option.container, DEFAULT_CHART_WIDTH, DEFAULT_CHART_HEIGHT);
349
- width = containerWidth, height = containerHeight;
350
- } else if (canvas && isTrueBrowser(this._option.mode)) {
351
- let canvasNode;
352
- canvasNode = isString(canvas) ? null === document || void 0 === document ? void 0 : document.getElementById(canvas) : canvas;
353
- const {width: containerWidth, height: containerHeight} = getContainerSize(canvasNode, DEFAULT_CHART_WIDTH, DEFAULT_CHART_HEIGHT);
354
- width = containerWidth, height = containerHeight;
355
- } else if (isMiniAppLikeMode(this._option.mode) && (null === (_a = this._option.modeParams) || void 0 === _a ? void 0 : _a.domref)) {
356
- const domRef = this._option.modeParams.domref;
357
- width = domRef.width, height = domRef.height;
358
- }
359
- width = null != userWidth ? userWidth : width, height = null != userHeight ? userHeight : height,
360
- this._canvasRect = {
361
- width: width,
362
- height: height
363
- };
364
- }
365
- return this._canvasRect;
358
+ return this._canvasRect || (this._canvasRect = calculateChartSize(this._spec, this._option)),
359
+ this._canvasRect;
366
360
  }
367
361
  getSeriesData(id, index) {
368
362
  if (!this._spec.data) return this._option.onError("no data in spec!"), null;
@@ -439,9 +433,9 @@ export class BaseChart extends CompilableBase {
439
433
  result))));
440
434
  }
441
435
  updateDataSpec(result) {
442
- this._spec.data && array(this._spec.data).forEach((d => {
436
+ this._spec.data && array(this._spec.data).forEach(((d, i) => {
443
437
  const dataView = this._dataSet.getDataView(d.id);
444
- dataView && (d.values ? dataView.updateRawData(d.values) : d.latestData || dataView.updateRawData([]));
438
+ dataView ? d.values ? dataView.updateRawData(d.values) : d.latestData || dataView.updateRawData([]) : result.reMakeData = !0;
445
439
  }));
446
440
  }
447
441
  updateRegionSpec(result) {
@@ -469,8 +463,14 @@ export class BaseChart extends CompilableBase {
469
463
  }
470
464
  updateSeriesSpec(result) {
471
465
  this._spec.series.length === this._series.length ? this._series.forEach((s => {
472
- this._mergeUpdateResult(result, s.updateSpec(this._spec.series[s.getSpecIndex()])),
473
- s.reInit();
466
+ var _a;
467
+ const spec = this._spec.series[s.getSpecIndex()];
468
+ if (result.reMakeData) {
469
+ let values;
470
+ values = spec.data ? spec.data.values : null === (_a = this.getSeriesData(spec.dataId, spec.dataIndex)) || void 0 === _a ? void 0 : _a.latestData,
471
+ s.updateRawData(values);
472
+ }
473
+ this._mergeUpdateResult(result, s.updateSpec(spec)), s.reInit();
474
474
  })) : result.reMake = !0;
475
475
  }
476
476
  getCanvas() {
@@ -502,7 +502,8 @@ export class BaseChart extends CompilableBase {
502
502
  largeThreshold: spec.largeThreshold,
503
503
  progressiveStep: spec.progressiveStep,
504
504
  progressiveThreshold: spec.progressiveThreshold,
505
- background: spec.seriesBackground
505
+ background: spec.seriesBackground,
506
+ invalidType: spec.invalidType
506
507
  };
507
508
  }
508
509
  _mergeUpdateResult(resultA, resultB) {