@visactor/vchart 1.1.2 → 1.2.0-beta.2

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 (271) hide show
  1. package/build/index.js +420 -163
  2. package/build/index.min.js +1 -1
  3. package/cjs/chart/area/area.js +3 -1
  4. package/cjs/chart/area/area.js.map +1 -1
  5. package/cjs/chart/base-chart.d.ts +7 -2
  6. package/cjs/chart/base-chart.js +51 -23
  7. package/cjs/chart/base-chart.js.map +1 -1
  8. package/cjs/chart/interface/chart.d.ts +1 -0
  9. package/cjs/chart/interface/chart.js.map +1 -1
  10. package/cjs/chart/line/line.js +3 -1
  11. package/cjs/chart/line/line.js.map +1 -1
  12. package/cjs/chart/radar/radar.js +3 -1
  13. package/cjs/chart/radar/radar.js.map +1 -1
  14. package/cjs/chart/sequence/sequence.js +5 -3
  15. package/cjs/chart/sequence/sequence.js.map +1 -1
  16. package/cjs/chart/stack.js +3 -3
  17. package/cjs/chart/stack.js.map +1 -1
  18. package/cjs/compile/compiler.js +9 -5
  19. package/cjs/compile/compiler.js.map +1 -1
  20. package/cjs/compile/interface/compiler.d.ts +1 -0
  21. package/cjs/compile/interface/compiler.js.map +1 -1
  22. package/cjs/component/axis/cartesian/axis.js +1 -1
  23. package/cjs/component/axis/cartesian/axis.js.map +1 -1
  24. package/cjs/component/axis/interface.d.ts +25 -27
  25. package/cjs/component/axis/interface.js.map +1 -1
  26. package/cjs/component/axis/polar/axis.js +2 -2
  27. package/cjs/component/axis/polar/axis.js.map +1 -1
  28. package/cjs/component/geo/geo-coordinate.js +1 -1
  29. package/cjs/component/geo/geo-coordinate.js.map +1 -1
  30. package/cjs/component/geo/projection.js +1 -2
  31. package/cjs/component/geo/projection.js.map +1 -1
  32. package/cjs/component/indicator/indicator.js +1 -1
  33. package/cjs/component/indicator/indicator.js.map +1 -1
  34. package/cjs/component/marker/base-marker.js +1 -1
  35. package/cjs/component/marker/base-marker.js.map +1 -1
  36. package/cjs/component/marker/interface.d.ts +2 -2
  37. package/cjs/component/marker/interface.js.map +1 -1
  38. package/cjs/component/tooltip/processor/dimension-tooltip.js +3 -2
  39. package/cjs/component/tooltip/processor/dimension-tooltip.js.map +1 -1
  40. package/cjs/constant/event.d.ts +2 -0
  41. package/cjs/constant/event.js +2 -1
  42. package/cjs/constant/event.js.map +1 -1
  43. package/cjs/core/index.d.ts +1 -1
  44. package/cjs/core/index.js +1 -1
  45. package/cjs/core/index.js.map +1 -1
  46. package/cjs/core/vchart.d.ts +6 -0
  47. package/cjs/core/vchart.js +72 -27
  48. package/cjs/core/vchart.js.map +1 -1
  49. package/cjs/data/initialize.d.ts +2 -1
  50. package/cjs/data/initialize.js +8 -5
  51. package/cjs/data/initialize.js.map +1 -1
  52. package/cjs/data/transforms/legend-data/discrete/discrete.js +3 -2
  53. package/cjs/data/transforms/legend-data/discrete/discrete.js.map +1 -1
  54. package/cjs/data/transforms/sankey.d.ts +2 -0
  55. package/cjs/data/transforms/sankey.js +9 -1
  56. package/cjs/data/transforms/sankey.js.map +1 -1
  57. package/cjs/event/events/dimension/base.js +6 -4
  58. package/cjs/event/events/dimension/base.js.map +1 -1
  59. package/cjs/event/events/dimension/interface.js.map +1 -1
  60. package/cjs/event/events/dimension/util/cartesian.d.ts +2 -2
  61. package/cjs/event/events/dimension/util/cartesian.js +12 -11
  62. package/cjs/event/events/dimension/util/cartesian.js.map +1 -1
  63. package/cjs/event/events/dimension/util/common.d.ts +1 -1
  64. package/cjs/event/events/dimension/util/common.js +13 -6
  65. package/cjs/event/events/dimension/util/common.js.map +1 -1
  66. package/cjs/layout/base-layout.d.ts +3 -0
  67. package/cjs/layout/base-layout.js +8 -4
  68. package/cjs/layout/base-layout.js.map +1 -1
  69. package/cjs/layout/grid-layout/grid-layout.d.ts +3 -1
  70. package/cjs/layout/grid-layout/grid-layout.js +3 -2
  71. package/cjs/layout/grid-layout/grid-layout.js.map +1 -1
  72. package/cjs/layout/interface.d.ts +2 -1
  73. package/cjs/layout/interface.js.map +1 -1
  74. package/cjs/model/interface.d.ts +1 -4
  75. package/cjs/model/interface.js.map +1 -1
  76. package/cjs/model/layout-item.d.ts +0 -3
  77. package/cjs/model/layout-item.js +1 -8
  78. package/cjs/model/layout-item.js.map +1 -1
  79. package/cjs/series/area/area.js +5 -4
  80. package/cjs/series/area/area.js.map +1 -1
  81. package/cjs/series/area/interface.d.ts +1 -0
  82. package/cjs/series/area/interface.js.map +1 -1
  83. package/cjs/series/base/base-series.js +2 -4
  84. package/cjs/series/base/base-series.js.map +1 -1
  85. package/cjs/series/geo/geo.js +3 -3
  86. package/cjs/series/geo/geo.js.map +1 -1
  87. package/cjs/series/line/interface.d.ts +4 -2
  88. package/cjs/series/line/interface.js.map +1 -1
  89. package/cjs/series/line/line.js +5 -3
  90. package/cjs/series/line/line.js.map +1 -1
  91. package/cjs/series/map/map.js +6 -6
  92. package/cjs/series/map/map.js.map +1 -1
  93. package/cjs/series/mixin/line-mixin.d.ts +1 -1
  94. package/cjs/series/mixin/line-mixin.js +3 -2
  95. package/cjs/series/mixin/line-mixin.js.map +1 -1
  96. package/cjs/series/radar/interface.d.ts +1 -0
  97. package/cjs/series/radar/interface.js.map +1 -1
  98. package/cjs/series/radar/radar.js +4 -4
  99. package/cjs/series/radar/radar.js.map +1 -1
  100. package/cjs/series/sankey/sankey.js +7 -4
  101. package/cjs/series/sankey/sankey.js.map +1 -1
  102. package/cjs/series/scatter/scatter.js +7 -4
  103. package/cjs/series/scatter/scatter.js.map +1 -1
  104. package/cjs/series/sunburst/sunburst.d.ts +1 -1
  105. package/cjs/series/word-cloud/base.d.ts +7 -0
  106. package/cjs/series/word-cloud/base.js +8 -3
  107. package/cjs/series/word-cloud/base.js.map +1 -1
  108. package/cjs/theme/buildin-theme/light/series/area.js +5 -0
  109. package/cjs/theme/buildin-theme/light/series/area.js.map +1 -1
  110. package/cjs/theme/buildin-theme/light/series/line.js +5 -0
  111. package/cjs/theme/buildin-theme/light/series/line.js.map +1 -1
  112. package/cjs/theme/buildin-theme/light/series/radar.js +5 -0
  113. package/cjs/theme/buildin-theme/light/series/radar.js.map +1 -1
  114. package/cjs/typings/params.d.ts +5 -0
  115. package/cjs/typings/params.js.map +1 -1
  116. package/cjs/typings/spec/common.d.ts +8 -2
  117. package/cjs/typings/spec/common.js.map +1 -1
  118. package/cjs/typings/visual.d.ts +1 -1
  119. package/cjs/typings/visual.js.map +1 -1
  120. package/cjs/util/debug.d.ts +2 -2
  121. package/cjs/util/debug.js +4 -3
  122. package/cjs/util/debug.js.map +1 -1
  123. package/cjs/util/image.d.ts +2 -1
  124. package/cjs/util/image.js +10 -6
  125. package/cjs/util/image.js.map +1 -1
  126. package/cjs/util/math.js +5 -3
  127. package/cjs/util/math.js.map +1 -1
  128. package/cjs/util/spec.d.ts +4 -0
  129. package/cjs/util/spec.js +24 -2
  130. package/cjs/util/spec.js.map +1 -1
  131. package/esm/chart/area/area.js +3 -1
  132. package/esm/chart/area/area.js.map +1 -1
  133. package/esm/chart/base-chart.d.ts +7 -2
  134. package/esm/chart/base-chart.js +51 -21
  135. package/esm/chart/base-chart.js.map +1 -1
  136. package/esm/chart/interface/chart.d.ts +1 -0
  137. package/esm/chart/interface/chart.js.map +1 -1
  138. package/esm/chart/line/line.js +3 -1
  139. package/esm/chart/line/line.js.map +1 -1
  140. package/esm/chart/radar/radar.js +3 -1
  141. package/esm/chart/radar/radar.js.map +1 -1
  142. package/esm/chart/sequence/sequence.js +5 -3
  143. package/esm/chart/sequence/sequence.js.map +1 -1
  144. package/esm/chart/stack.js +3 -3
  145. package/esm/chart/stack.js.map +1 -1
  146. package/esm/compile/compiler.js +10 -6
  147. package/esm/compile/compiler.js.map +1 -1
  148. package/esm/compile/interface/compiler.d.ts +1 -0
  149. package/esm/compile/interface/compiler.js.map +1 -1
  150. package/esm/component/axis/cartesian/axis.js +1 -1
  151. package/esm/component/axis/cartesian/axis.js.map +1 -1
  152. package/esm/component/axis/interface.d.ts +25 -27
  153. package/esm/component/axis/interface.js.map +1 -1
  154. package/esm/component/axis/polar/axis.js +2 -2
  155. package/esm/component/axis/polar/axis.js.map +1 -1
  156. package/esm/component/geo/geo-coordinate.js +1 -1
  157. package/esm/component/geo/geo-coordinate.js.map +1 -1
  158. package/esm/component/geo/projection.js +1 -1
  159. package/esm/component/geo/projection.js.map +1 -1
  160. package/esm/component/indicator/indicator.js +1 -1
  161. package/esm/component/indicator/indicator.js.map +1 -1
  162. package/esm/component/marker/base-marker.js +1 -1
  163. package/esm/component/marker/base-marker.js.map +1 -1
  164. package/esm/component/marker/interface.d.ts +2 -2
  165. package/esm/component/marker/interface.js.map +1 -1
  166. package/esm/component/tooltip/processor/dimension-tooltip.js +4 -1
  167. package/esm/component/tooltip/processor/dimension-tooltip.js.map +1 -1
  168. package/esm/constant/event.d.ts +2 -0
  169. package/esm/constant/event.js +2 -1
  170. package/esm/constant/event.js.map +1 -1
  171. package/esm/core/index.d.ts +1 -1
  172. package/esm/core/index.js +1 -1
  173. package/esm/core/index.js.map +1 -1
  174. package/esm/core/vchart.d.ts +6 -0
  175. package/esm/core/vchart.js +74 -27
  176. package/esm/core/vchart.js.map +1 -1
  177. package/esm/data/initialize.d.ts +2 -1
  178. package/esm/data/initialize.js +9 -4
  179. package/esm/data/initialize.js.map +1 -1
  180. package/esm/data/transforms/legend-data/discrete/discrete.js +4 -1
  181. package/esm/data/transforms/legend-data/discrete/discrete.js.map +1 -1
  182. package/esm/data/transforms/sankey.d.ts +2 -0
  183. package/esm/data/transforms/sankey.js +9 -1
  184. package/esm/data/transforms/sankey.js.map +1 -1
  185. package/esm/event/events/dimension/base.js +8 -4
  186. package/esm/event/events/dimension/base.js.map +1 -1
  187. package/esm/event/events/dimension/interface.js.map +1 -1
  188. package/esm/event/events/dimension/util/cartesian.d.ts +2 -2
  189. package/esm/event/events/dimension/util/cartesian.js +7 -8
  190. package/esm/event/events/dimension/util/cartesian.js.map +1 -1
  191. package/esm/event/events/dimension/util/common.d.ts +1 -1
  192. package/esm/event/events/dimension/util/common.js +14 -6
  193. package/esm/event/events/dimension/util/common.js.map +1 -1
  194. package/esm/layout/base-layout.d.ts +3 -0
  195. package/esm/layout/base-layout.js +8 -4
  196. package/esm/layout/base-layout.js.map +1 -1
  197. package/esm/layout/grid-layout/grid-layout.d.ts +3 -1
  198. package/esm/layout/grid-layout/grid-layout.js +3 -2
  199. package/esm/layout/grid-layout/grid-layout.js.map +1 -1
  200. package/esm/layout/interface.d.ts +2 -1
  201. package/esm/layout/interface.js.map +1 -1
  202. package/esm/model/interface.d.ts +1 -4
  203. package/esm/model/interface.js.map +1 -1
  204. package/esm/model/layout-item.d.ts +0 -3
  205. package/esm/model/layout-item.js +1 -8
  206. package/esm/model/layout-item.js.map +1 -1
  207. package/esm/series/area/area.js +5 -4
  208. package/esm/series/area/area.js.map +1 -1
  209. package/esm/series/area/interface.d.ts +1 -0
  210. package/esm/series/area/interface.js.map +1 -1
  211. package/esm/series/base/base-series.js +1 -4
  212. package/esm/series/base/base-series.js.map +1 -1
  213. package/esm/series/geo/geo.js +3 -3
  214. package/esm/series/geo/geo.js.map +1 -1
  215. package/esm/series/line/interface.d.ts +4 -2
  216. package/esm/series/line/interface.js.map +1 -1
  217. package/esm/series/line/line.js +5 -3
  218. package/esm/series/line/line.js.map +1 -1
  219. package/esm/series/map/map.js +6 -6
  220. package/esm/series/map/map.js.map +1 -1
  221. package/esm/series/mixin/line-mixin.d.ts +1 -1
  222. package/esm/series/mixin/line-mixin.js +3 -2
  223. package/esm/series/mixin/line-mixin.js.map +1 -1
  224. package/esm/series/radar/interface.d.ts +1 -0
  225. package/esm/series/radar/interface.js.map +1 -1
  226. package/esm/series/radar/radar.js +4 -4
  227. package/esm/series/radar/radar.js.map +1 -1
  228. package/esm/series/sankey/sankey.js +7 -4
  229. package/esm/series/sankey/sankey.js.map +1 -1
  230. package/esm/series/scatter/scatter.js +5 -4
  231. package/esm/series/scatter/scatter.js.map +1 -1
  232. package/esm/series/sunburst/sunburst.d.ts +1 -1
  233. package/esm/series/word-cloud/base.d.ts +7 -0
  234. package/esm/series/word-cloud/base.js +7 -0
  235. package/esm/series/word-cloud/base.js.map +1 -1
  236. package/esm/theme/buildin-theme/light/series/area.js +5 -0
  237. package/esm/theme/buildin-theme/light/series/area.js.map +1 -1
  238. package/esm/theme/buildin-theme/light/series/line.js +5 -0
  239. package/esm/theme/buildin-theme/light/series/line.js.map +1 -1
  240. package/esm/theme/buildin-theme/light/series/radar.js +5 -0
  241. package/esm/theme/buildin-theme/light/series/radar.js.map +1 -1
  242. package/esm/typings/params.d.ts +5 -0
  243. package/esm/typings/params.js.map +1 -1
  244. package/esm/typings/spec/common.d.ts +8 -2
  245. package/esm/typings/spec/common.js.map +1 -1
  246. package/esm/typings/visual.d.ts +1 -1
  247. package/esm/typings/visual.js.map +1 -1
  248. package/esm/util/debug.d.ts +2 -2
  249. package/esm/util/debug.js +4 -3
  250. package/esm/util/debug.js.map +1 -1
  251. package/esm/util/image.d.ts +2 -1
  252. package/esm/util/image.js +6 -3
  253. package/esm/util/image.js.map +1 -1
  254. package/esm/util/math.js +4 -2
  255. package/esm/util/math.js.map +1 -1
  256. package/esm/util/spec.d.ts +4 -0
  257. package/esm/util/spec.js +21 -0
  258. package/esm/util/spec.js.map +1 -1
  259. package/package.json +7 -17
  260. package/chart.d.ts +0 -1
  261. package/chart.js +0 -1
  262. package/component.d.ts +0 -1
  263. package/component.js +0 -1
  264. package/core.d.ts +0 -1
  265. package/core.js +0 -1
  266. package/layout.d.ts +0 -1
  267. package/layout.js +0 -1
  268. package/mark.d.ts +0 -1
  269. package/mark.js +0 -1
  270. package/series.d.ts +0 -1
  271. package/series.js +0 -1
package/build/index.js CHANGED
@@ -7937,8 +7937,11 @@
7937
7937
  return Logger.getInstance().warn(`[VChart warn]: ${msg}`);
7938
7938
  };
7939
7939
  const error$1 = (msg, detail, err) => {
7940
- const errIns = new Error(msg);
7941
- return Logger.getInstance().error(`[VChart error]: ${errIns}`, detail);
7940
+ if (isFunction(config.errorHandler)) {
7941
+ config.errorHandler.call(null, msg, detail);
7942
+ return;
7943
+ }
7944
+ throw new Error(msg);
7942
7945
  };
7943
7946
  const config = {
7944
7947
  silent: false,
@@ -8341,7 +8344,8 @@
8341
8344
  function min$2(data, field) {
8342
8345
  const initialData = field ? +data[0][field] : +data[0];
8343
8346
  if (!isValidNumber(initialData)) {
8344
- throw new Error('invalid data');
8347
+ warn('invalid data');
8348
+ return 0;
8345
8349
  }
8346
8350
  const min = data.reduce((pre, _cur) => {
8347
8351
  const cur = field ? +_cur[field] : +_cur;
@@ -8355,7 +8359,8 @@
8355
8359
  function max$2(data, field) {
8356
8360
  const initialData = field ? +data[0][field] : +data[0];
8357
8361
  if (!isValidNumber(initialData)) {
8358
- throw new Error('invalid data');
8362
+ warn('invalid data');
8363
+ return 0;
8359
8364
  }
8360
8365
  const max = data.reduce((pre, _cur) => {
8361
8366
  const cur = field ? +_cur[field] : +_cur;
@@ -9730,6 +9735,23 @@
9730
9735
  const keys = Object.keys(obj);
9731
9736
  return obj instanceof DataView || dataViewKeys.every(key => keys.includes(key));
9732
9737
  }
9738
+ function convertBackgroundSpec(bg) {
9739
+ if (!bg) {
9740
+ return null;
9741
+ }
9742
+ if (typeof bg === 'string') {
9743
+ return {
9744
+ fill: bg,
9745
+ fillOpacity: 1
9746
+ };
9747
+ }
9748
+ if (typeof bg !== 'object') {
9749
+ return null;
9750
+ }
9751
+ const { x, y, width, height, x1, y1, image, ...rest } = bg;
9752
+ rest.background = image;
9753
+ return rest;
9754
+ }
9733
9755
 
9734
9756
  var check = function (it) {
9735
9757
  return it && it.Math == Math && it;
@@ -22298,18 +22320,18 @@
22298
22320
  bind(DefaultGlobal).toSelf().inSingletonScope(), bind(Global).toService(DefaultGlobal), bind(DefaultWindow).to(DefaultWindow), bind(Window).toService(DefaultWindow), bind(DefaultGraphicUtil).toSelf().inSingletonScope(), bind(GraphicUtil).toService(DefaultGraphicUtil), bind(DefaultTransformUtil).toSelf().inSingletonScope(), bind(TransformUtil).toService(DefaultTransformUtil), bind(DefaultLayerService).toSelf().inSingletonScope(), bind(LayerService).toService(DefaultLayerService);
22299
22321
  });
22300
22322
 
22301
- function runFill(fill) {
22302
- return !!fill;
22323
+ function runFill(fill, background) {
22324
+ return !(!fill && !background);
22303
22325
  }
22304
22326
  function runStroke(stroke, lineWidth) {
22305
22327
  let s;
22306
22328
  return s = isArray$3(stroke) ? stroke.some(item => item || void 0 === item) : !!stroke, s && lineWidth > 0;
22307
22329
  }
22308
- function fillVisible(opacity, fillOpacity) {
22309
- return opacity * fillOpacity > 0;
22330
+ function fillVisible(opacity, fillOpacity, fill) {
22331
+ return fill && opacity * fillOpacity > 0;
22310
22332
  }
22311
- function rectFillVisible(opacity, fillOpacity, width, height) {
22312
- return opacity * fillOpacity > 0 && width > 0 && height > 0;
22333
+ function rectFillVisible(opacity, fillOpacity, width, height, fill) {
22334
+ return fill && opacity * fillOpacity > 0 && width > 0 && height > 0;
22313
22335
  }
22314
22336
  function strokeVisible(opacity, strokeOpacity) {
22315
22337
  return opacity * strokeOpacity > 0;
@@ -22329,7 +22351,7 @@
22329
22351
  strokeOpacity = themeAttributes.strokeOpacity,
22330
22352
  visible = themeAttributes.visible
22331
22353
  } = graphic.attribute,
22332
- fVisible = fillVisible(opacity, fillOpacity),
22354
+ fVisible = fillVisible(opacity, fillOpacity, fill),
22333
22355
  sVisible = strokeVisible(opacity, strokeOpacity),
22334
22356
  doFill = runFill(fill),
22335
22357
  doStroke = runStroke(stroke, lineWidth);
@@ -22691,12 +22713,12 @@
22691
22713
  x: originX = arcAttribute.x,
22692
22714
  y: originY = arcAttribute.y
22693
22715
  } = arc.attribute,
22694
- fVisible = fillVisible(opacity, fillOpacity),
22716
+ fVisible = fillVisible(opacity, fillOpacity, fill),
22695
22717
  sVisible = strokeVisible(opacity, strokeOpacity),
22696
- doFill = runFill(fill),
22718
+ doFill = runFill(fill, background),
22697
22719
  doStroke = runStroke(stroke, lineWidth);
22698
22720
  if (!arc.valid || !visible) return;
22699
- if (!(doFill || doStroke || background)) return;
22721
+ if (!doFill && !doStroke) return;
22700
22722
  if (!(fVisible || sVisible || fillCb || strokeCb || background)) return;
22701
22723
  const {
22702
22724
  outerRadius = arcAttribute.outerRadius,
@@ -22709,7 +22731,7 @@
22709
22731
  isFullStroke: isFullStroke,
22710
22732
  stroke: arrayStroke
22711
22733
  } = parseStroke(stroke);
22712
- if (doFill || isFullStroke || background) {
22734
+ if (doFill || isFullStroke) {
22713
22735
  if (context.beginPath(), drawArcPath$1(arc, context, x, y, outerRadius, innerRadius), !this._arcBeforeRenderContribitions) {
22714
22736
  this._arcBeforeRenderContribitions = [], this._arcAfterRenderContribitions = [];
22715
22737
  const contributions = this.arcRenderContribitions.getContributions() || [];
@@ -22833,11 +22855,11 @@
22833
22855
  x: originX = circleAttribute.x,
22834
22856
  y: originY = circleAttribute.y
22835
22857
  } = circle.attribute,
22836
- fVisible = fillVisible(opacity, fillOpacity),
22858
+ fVisible = fillVisible(opacity, fillOpacity, fill),
22837
22859
  sVisible = strokeVisible(opacity, strokeOpacity),
22838
- doFill = runFill(fill),
22860
+ doFill = runFill(fill, background),
22839
22861
  doStroke = runStroke(stroke, lineWidth);
22840
- circle.valid && visible && (doFill || doStroke || background) && (fVisible || sVisible || fillCb || strokeCb || background) && (context.beginPath(), context.arc(x, y, radius, startAngle, endAngle), context.closePath(), this._circleRenderContribitions || (this._circleRenderContribitions = this.circleRenderContribitions.getContributions() || [], this._circleRenderContribitions.sort((a, b) => b.order - a.order)), this._circleRenderContribitions.forEach(c => {
22862
+ circle.valid && visible && (doFill || doStroke) && (fVisible || sVisible || fillCb || strokeCb || background) && (context.beginPath(), context.arc(x, y, radius, startAngle, endAngle), context.closePath(), this._circleRenderContribitions || (this._circleRenderContribitions = this.circleRenderContribitions.getContributions() || [], this._circleRenderContribitions.sort((a, b) => b.order - a.order)), this._circleRenderContribitions.forEach(c => {
22841
22863
  c.time === BaseRenderContributionTime.beforeFillStroke && c.drawShape(circle, context, x, y, doFill, doStroke, fVisible, sVisible, circleAttribute, drawContext, fillCb, strokeCb);
22842
22864
  }), context.setShadowStyle && context.setShadowStyle(circle, circle.attribute, circleAttribute), doFill && (fillCb ? fillCb(context, circle.attribute, circleAttribute) : fVisible && (context.setCommonStyle(circle, circle.attribute, originX - x, originY - y, circleAttribute), context.fill())), doStroke && (strokeCb ? strokeCb(context, circle.attribute, circleAttribute) : sVisible && (context.setStrokeStyle(circle, circle.attribute, originX - x, originY - y, circleAttribute), context.stroke())), this._circleRenderContribitions.forEach(c => {
22843
22865
  c.time === BaseRenderContributionTime.afterFillStroke && c.drawShape(circle, context, x, y, doFill, doStroke, fVisible, sVisible, circleAttribute, drawContext, fillCb, strokeCb);
@@ -25802,10 +25824,14 @@
25802
25824
  return aabbBounds.set(-outerRadius, -outerRadius, outerRadius, outerRadius), aabbBounds;
25803
25825
  }
25804
25826
  updateArcAABBBoundsAccurate(attribute, arcTheme, aabbBounds, graphic) {
25805
- const {
25827
+ let {
25806
25828
  outerRadius = arcTheme.outerRadius,
25807
25829
  innerRadius = arcTheme.innerRadius
25808
25830
  } = attribute;
25831
+ if (outerRadius < innerRadius) {
25832
+ const temp = outerRadius;
25833
+ outerRadius = innerRadius, innerRadius = temp;
25834
+ }
25809
25835
  let {
25810
25836
  endAngle = arcTheme.endAngle,
25811
25837
  startAngle = arcTheme.startAngle
@@ -25928,7 +25954,7 @@
25928
25954
  return isArray$3(text) ? !text.every(t => null == t || "" === t) : null != text && "" !== text;
25929
25955
  }
25930
25956
  updateMultilineAABBBounds(text) {
25931
- var _a;
25957
+ var _a, _b, _c;
25932
25958
  const textTheme = getTheme(this).text,
25933
25959
  {
25934
25960
  fontFamily = textTheme.fontFamily,
@@ -25967,6 +25993,10 @@
25967
25993
  break;
25968
25994
  }
25969
25995
  const clip = layoutObj.textMeasure.clipText(str, layoutObj.textOptions, maxLineWidth);
25996
+ if ("" !== str && "" === clip.str) if (ellipsis) {
25997
+ const clipEllipsis = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis);
25998
+ clip.str = null !== (_b = clipEllipsis.str) && void 0 !== _b ? _b : "", clip.width = null !== (_c = clipEllipsis.width) && void 0 !== _c ? _c : 0;
25999
+ } else clip.str = "", clip.width = 0;
25970
26000
  if (linesLayout.push({
25971
26001
  str: clip.str,
25972
26002
  width: clip.width
@@ -26192,6 +26222,7 @@
26192
26222
  BaseRender = __decorate$1v([injectable()], BaseRender);
26193
26223
 
26194
26224
  function drawSegments(path, segPath, percent, clipRangeByDimension, params) {
26225
+ if (!segPath) return;
26195
26226
  const {
26196
26227
  offsetX = 0,
26197
26228
  offsetY = 0,
@@ -26294,6 +26325,7 @@
26294
26325
  }
26295
26326
  drawSegmentItem(context, cache, fill, stroke, fillOpacity, strokeOpacity, attribute, defaultAttribute, clipRange, clipRangeByDimension, offsetX, offsetY, line, fillCb, strokeCb) {
26296
26327
  var _a;
26328
+ if (!cache) return;
26297
26329
  context.beginPath();
26298
26330
  const z = null !== (_a = this.z) && void 0 !== _a ? _a : 0;
26299
26331
  drawSegments(context.camera ? context : context.nativeContext, cache, clipRange, clipRangeByDimension, {
@@ -26318,7 +26350,7 @@
26318
26350
  lineWidth = lineAttribute.lineWidth,
26319
26351
  visible = lineAttribute.visible
26320
26352
  } = line.attribute,
26321
- fVisible = fillVisible(opacity, fillOpacity),
26353
+ fVisible = fillVisible(opacity, fillOpacity, fill),
26322
26354
  sVisible = strokeVisible(opacity, strokeOpacity),
26323
26355
  doFill = runFill(fill),
26324
26356
  doStroke = runStroke(stroke, lineWidth);
@@ -26499,12 +26531,13 @@
26499
26531
  opacity = areaAttribute.opacity,
26500
26532
  visible = areaAttribute.visible,
26501
26533
  z = areaAttribute.z,
26534
+ background: background,
26502
26535
  stroke = area.attribute.stroke,
26503
26536
  lineWidth = areaAttribute.lineWidth,
26504
26537
  strokeOpacity = areaAttribute.strokeOpacity
26505
26538
  } = area.attribute,
26506
- fVisible = fillVisible(opacity, fillOpacity),
26507
- doFill = runFill(fill),
26539
+ fVisible = fillVisible(opacity, fillOpacity, fill),
26540
+ doFill = runFill(fill, background),
26508
26541
  doStroke = runStroke(stroke, lineWidth),
26509
26542
  sVisible = strokeVisible(opacity, strokeOpacity);
26510
26543
  if (!area.valid || !visible) return;
@@ -26605,6 +26638,7 @@
26605
26638
  drawPathProxy(area, context, x, y, drawContext, params) || this.drawShape(area, context, x, y, drawContext, params), context.highPerformanceRestore();
26606
26639
  }
26607
26640
  drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, fillCb, strokeCb) {
26641
+ if (!cache) return;
26608
26642
  context.beginPath();
26609
26643
  drawAreaSegments(context.camera ? context : context.nativeContext, cache, clipRange, {
26610
26644
  offsetX: offsetX,
@@ -26673,11 +26707,11 @@
26673
26707
  y: originY = pathAttribute.y
26674
26708
  } = path.attribute,
26675
26709
  z = null !== (_a = this.z) && void 0 !== _a ? _a : 0,
26676
- fVisible = fillVisible(opacity, fillOpacity),
26710
+ fVisible = fillVisible(opacity, fillOpacity, fill),
26677
26711
  sVisible = strokeVisible(opacity, strokeOpacity),
26678
- doFill = runFill(fill),
26712
+ doFill = runFill(fill, background),
26679
26713
  doStroke = runStroke(stroke, lineWidth);
26680
- if (path.valid && visible && (doFill || doStroke || background) && (fVisible || sVisible || fillCb || strokeCb || background)) {
26714
+ if (path.valid && visible && (doFill || doStroke) && (fVisible || sVisible || fillCb || strokeCb || background)) {
26681
26715
  if (context.beginPath(), path.pathShape) renderCommandList(path.pathShape.commandList, context, x, y, 1, 1, z);else {
26682
26716
  const path2D = null !== (_b = path.attribute.path) && void 0 !== _b ? _b : pathAttribute.path;
26683
26717
  renderCommandList(path2D.commandList, context, x, y, 1, 1, z);
@@ -26799,12 +26833,12 @@
26799
26833
  x: originX = rectAttribute.x,
26800
26834
  y: originY = rectAttribute.y
26801
26835
  } = rect.attribute,
26802
- fVisible = rectFillVisible(opacity, fillOpacity, width, height),
26836
+ fVisible = rectFillVisible(opacity, fillOpacity, width, height, fill),
26803
26837
  sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height),
26804
- doFill = runFill(fill),
26838
+ doFill = runFill(fill, background),
26805
26839
  doStroke = runStroke(stroke, lineWidth);
26806
26840
  if (!rect.valid || !visible) return;
26807
- if (!(doFill || doStroke || background)) return;
26841
+ if (!doFill && !doStroke) return;
26808
26842
  if (!(fVisible || sVisible || fillCb || strokeCb || background)) return;
26809
26843
  0 === cornerRadius || isArray$3(cornerRadius) && cornerRadius.every(num => 0 === num) ? (context.beginPath(), context.rect(x, y, width, height)) : (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius)), this._rectRenderContribitions || (this._rectRenderContribitions = this.rectRenderContribitions.getContributions() || [], this._rectRenderContribitions.sort((a, b) => b.order - a.order));
26810
26844
  const doFillOrStroke = {
@@ -26874,12 +26908,12 @@
26874
26908
  scaleX = symbolAttribute.scaleX,
26875
26909
  scaleY = symbolAttribute.scaleY
26876
26910
  } = symbol.attribute,
26877
- fVisible = fillVisible(opacity, fillOpacity),
26911
+ fVisible = fillVisible(opacity, fillOpacity, fill),
26878
26912
  sVisible = strokeVisible(opacity, strokeOpacity),
26879
- doFill = runFill(fill),
26913
+ doFill = runFill(fill, background),
26880
26914
  doStroke = runStroke(stroke, lineWidth);
26881
26915
  if (!symbol.valid || !visible) return;
26882
- if (!(doFill || doStroke || background)) return;
26916
+ if (!doFill && !doStroke) return;
26883
26917
  if (!(fVisible || sVisible || fillCb || strokeCb || background)) return;
26884
26918
  const parsedPath = symbol.getParsedPath();
26885
26919
  if (!parsedPath) return;
@@ -26957,7 +26991,7 @@
26957
26991
  y: originY = textAttribute.y
26958
26992
  } = text.attribute,
26959
26993
  lineHeight = null !== (_a = text.attribute.lineHeight) && void 0 !== _a ? _a : fontSize,
26960
- fVisible = fillVisible(opacity, fillOpacity),
26994
+ fVisible = fillVisible(opacity, fillOpacity, fill),
26961
26995
  sVisible = strokeVisible(opacity, strokeOpacity),
26962
26996
  doFill = runFill(fill),
26963
26997
  doStroke = runStroke(stroke, lineWidth);
@@ -27170,11 +27204,11 @@
27170
27204
  x: originX = polygonAttribute.x,
27171
27205
  y: originY = polygonAttribute.y
27172
27206
  } = polygon.attribute,
27173
- fVisible = fillVisible(opacity, fillOpacity),
27207
+ fVisible = fillVisible(opacity, fillOpacity, fill),
27174
27208
  sVisible = strokeVisible(opacity, strokeOpacity),
27175
- doFill = runFill(fill),
27209
+ doFill = runFill(fill, background),
27176
27210
  doStroke = runStroke(stroke, lineWidth);
27177
- polygon.valid && visible && (doFill || doStroke || background) && (fVisible || sVisible || fillCb || strokeCb || background) && (context.beginPath(), cornerRadius <= 0 || isArray$3(cornerRadius) && cornerRadius.every(num => 0 === num) ? drawPolygon(context.camera ? context : context.nativeContext, points, x, y) : drawRoundedPolygon(context.camera ? context : context.nativeContext, points, x, y, cornerRadius), context.closePath(), this._polygonRenderContribitions || (this._polygonRenderContribitions = this.polygonRenderContribitions.getContributions() || [], this._polygonRenderContribitions.sort((a, b) => b.order - a.order)), this._polygonRenderContribitions.forEach(c => {
27211
+ polygon.valid && visible && (doFill || doStroke) && (fVisible || sVisible || fillCb || strokeCb || background) && (context.beginPath(), cornerRadius <= 0 || isArray$3(cornerRadius) && cornerRadius.every(num => 0 === num) ? drawPolygon(context.camera ? context : context.nativeContext, points, x, y) : drawRoundedPolygon(context.camera ? context : context.nativeContext, points, x, y, cornerRadius), context.closePath(), this._polygonRenderContribitions || (this._polygonRenderContribitions = this.polygonRenderContribitions.getContributions() || [], this._polygonRenderContribitions.sort((a, b) => b.order - a.order)), this._polygonRenderContribitions.forEach(c => {
27178
27212
  c.time === BaseRenderContributionTime.beforeFillStroke && c.drawShape(polygon, context, x, y, doFill, doStroke, fVisible, sVisible, polygonAttribute, drawContext, fillCb, strokeCb);
27179
27213
  }), context.setShadowStyle && context.setShadowStyle(polygon, polygon.attribute, polygonAttribute), doFill && (fillCb ? fillCb(context, polygon.attribute, polygonAttribute) : fillOpacity && (context.setCommonStyle(polygon, polygon.attribute, originX - x, originY - y, polygonAttribute), context.fill())), doStroke && (strokeCb ? strokeCb(context, polygon.attribute, polygonAttribute) : strokeOpacity && (context.setStrokeStyle(polygon, polygon.attribute, originX - x, originY - y, polygonAttribute), context.stroke())), this._polygonRenderContribitions.forEach(c => {
27180
27214
  c.time === BaseRenderContributionTime.afterFillStroke && c.drawShape(polygon, context, x, y, doFill, doStroke, fVisible, sVisible, polygonAttribute, drawContext, fillCb, strokeCb);
@@ -27233,7 +27267,7 @@
27233
27267
  repeatY = imageAttribute.repeatY,
27234
27268
  image: url
27235
27269
  } = image.attribute,
27236
- fVisible = fillVisible(opacity, fillOpacity),
27270
+ fVisible = fillVisible(opacity, fillOpacity, fill),
27237
27271
  doFill = runFill(fill);
27238
27272
  if (image.valid && visible && doFill && (fVisible || fillCb)) {
27239
27273
  if (this._imageRenderContribitions || (this._imageRenderContribitions = this.imageRenderContribitions.getContributions() || []), this._imageRenderContribitions.forEach(c => {
@@ -32352,13 +32386,13 @@
32352
32386
  lineWidth = groupAttribute.lineWidth,
32353
32387
  visible = groupAttribute.visible
32354
32388
  } = group.attribute,
32355
- fVisible = rectFillVisible(opacity, fillOpacity, width, height),
32389
+ fVisible = rectFillVisible(opacity, fillOpacity, width, height, fill),
32356
32390
  sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height),
32357
- doFill = runFill(fill),
32391
+ doFill = runFill(fill, background),
32358
32392
  doStroke = runStroke(stroke, lineWidth);
32359
32393
  if (!group.valid || !visible) return;
32360
32394
  if (!clip) {
32361
- if (!(doFill || doStroke || background)) return;
32395
+ if (!doFill && !doStroke) return;
32362
32396
  if (!(fVisible || sVisible || fillCb || strokeCb || background)) return;
32363
32397
  }
32364
32398
  if (path && path.length && drawContext.drawContribution) {
@@ -32440,7 +32474,7 @@
32440
32474
  lineWidth = lineAttribute.lineWidth,
32441
32475
  visible = lineAttribute.visible
32442
32476
  } = line.attribute,
32443
- fVisible = fillVisible(opacity, fillOpacity),
32477
+ fVisible = fillVisible(opacity, fillOpacity, fill),
32444
32478
  sVisible = strokeVisible(opacity, strokeOpacity),
32445
32479
  doFill = runFill(fill),
32446
32480
  doStroke = runStroke(stroke, lineWidth);
@@ -32490,7 +32524,7 @@
32490
32524
  opacity = areaAttribute.opacity,
32491
32525
  visible = areaAttribute.visible
32492
32526
  } = area.attribute,
32493
- fVisible = fillVisible(opacity, fillOpacity),
32527
+ fVisible = fillVisible(opacity, fillOpacity, fill),
32494
32528
  doFill = runFill(fill);
32495
32529
  if (!area.valid || !visible) return;
32496
32530
  if (!doFill) return;
@@ -32680,7 +32714,7 @@
32680
32714
  visible = rectAttribute.visible
32681
32715
  } = rect.attribute,
32682
32716
  z = null !== (_a = this.z) && void 0 !== _a ? _a : 0,
32683
- fVisible = rectFillVisible(opacity, fillOpacity, width, height),
32717
+ fVisible = rectFillVisible(opacity, fillOpacity, width, height, fill),
32684
32718
  sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height),
32685
32719
  doFill = runFill(fill),
32686
32720
  doStroke = runStroke(stroke, lineWidth);
@@ -32808,7 +32842,7 @@
32808
32842
  visible = richtextAttribute.visible
32809
32843
  } = richtext.attribute;
32810
32844
  if (!richtext.valid || !visible) return;
32811
- if (!fillVisible(opacity, fillOpacity)) return;
32845
+ if (!fillVisible(opacity, fillOpacity, !0)) return;
32812
32846
  context.translate(x, y);
32813
32847
  richtext.getFrameCache().draw(context, this.drawIcon);
32814
32848
  }
@@ -32968,13 +33002,13 @@
32968
33002
  strokeOpacity = arcAttribute.strokeOpacity,
32969
33003
  visible = arcAttribute.visible
32970
33004
  } = arc.attribute,
32971
- fVisible = fillVisible(opacity, fillOpacity),
33005
+ fVisible = fillVisible(opacity, fillOpacity, fill),
32972
33006
  sVisible = strokeVisible(opacity, strokeOpacity),
32973
- doFill = runFill(fill),
33007
+ doFill = runFill(fill, background),
32974
33008
  doStroke = runStroke(stroke, lineWidth),
32975
33009
  z = null !== (_a = this.z) && void 0 !== _a ? _a : 0;
32976
33010
  if (!arc.valid || !visible) return;
32977
- if (!(doFill || doStroke || background)) return;
33011
+ if (!doFill && !doStroke) return;
32978
33012
  if (!(fVisible || sVisible || fillCb || strokeCb || background)) return;
32979
33013
  const {
32980
33014
  outerRadius = arcAttribute.outerRadius,
@@ -33061,7 +33095,7 @@
33061
33095
  face = [!0, !0, !0, !0, !0, !0]
33062
33096
  } = pyramid3d.attribute,
33063
33097
  z = null !== (_a = this.z) && void 0 !== _a ? _a : 0,
33064
- fVisible = fillVisible(opacity, fillOpacity),
33098
+ fVisible = fillVisible(opacity, fillOpacity, fill),
33065
33099
  sVisible = strokeVisible(opacity, strokeOpacity),
33066
33100
  doFill = runFill(fill),
33067
33101
  doStroke = runStroke(stroke, lineWidth);
@@ -35067,6 +35101,11 @@
35067
35101
  lineWidth: 2,
35068
35102
  fontSize: THEME_CONSTANTS.LABEL_FONT_SIZE
35069
35103
  }
35104
+ },
35105
+ point: {
35106
+ style: {
35107
+ symbolType: 'circle'
35108
+ }
35070
35109
  }
35071
35110
  };
35072
35111
 
@@ -35262,6 +35301,11 @@
35262
35301
  stroke: 'white',
35263
35302
  fontSize: THEME_CONSTANTS.LABEL_FONT_SIZE
35264
35303
  }
35304
+ },
35305
+ point: {
35306
+ style: {
35307
+ symbolType: 'circle'
35308
+ }
35265
35309
  }
35266
35310
  };
35267
35311
 
@@ -35353,6 +35397,11 @@
35353
35397
  stroke: 'white',
35354
35398
  fontSize: THEME_CONSTANTS.LABEL_FONT_SIZE
35355
35399
  }
35400
+ },
35401
+ point: {
35402
+ style: {
35403
+ symbolType: 'circle'
35404
+ }
35356
35405
  }
35357
35406
  };
35358
35407
 
@@ -40526,7 +40575,8 @@
40526
40575
  maxWidth: maxWidth,
40527
40576
  padding = 4,
40528
40577
  visible: visible,
40529
- state: state
40578
+ state: state,
40579
+ formatMethod: formatMethod
40530
40580
  } = this.attribute,
40531
40581
  parsedPadding = normalizePadding$1(padding),
40532
40582
  group = this.createOrUpdateChild("tag-content", {
@@ -40558,7 +40608,7 @@
40558
40608
  }
40559
40609
  tagWidth += symbolPlaceWidth, textX += symbolPlaceWidth;
40560
40610
  const textAttrs = Object.assign(Object.assign({
40561
- text: text,
40611
+ text: formatMethod ? formatMethod(text) : text,
40562
40612
  visible: isValid(text) && !1 !== visible,
40563
40613
  lineHeight: null == textStyle ? void 0 : textStyle.fontSize
40564
40614
  }, textStyle), {
@@ -43506,13 +43556,14 @@
43506
43556
  previewCallbackX: previewCallbackX,
43507
43557
  previewCallbackY: previewCallbackY,
43508
43558
  previewCallbackX1: previewCallbackX1,
43509
- previewCallbackY1: previewCallbackY1
43559
+ previewCallbackY1: previewCallbackY1,
43560
+ updateStateCallback: updateStateCallback
43510
43561
  } = this.attribute,
43511
43562
  {
43512
43563
  width: width,
43513
43564
  height: height
43514
43565
  } = size;
43515
- start && (this.state.start = start), end && (this.state.end = end), this._isHorizontal = "top" === orient || "bottom" === orient, this._layoutCache.max = this._isHorizontal ? width : height, this._layoutCache.attPos = this._isHorizontal ? "x" : "y", this._layoutCache.attSize = this._isHorizontal ? "width" : "height", this._activeCache.startPos = position, this._activeCache.lastPos = position, this._showText = "auto" !== showDetail && showDetail, previewData && (this._previewData = previewData), isFunction(previewCallbackX) && (this._previewCallbackX = previewCallbackX), isFunction(previewCallbackY) && (this._previewCallbackY = previewCallbackY), isFunction(previewCallbackX1) && (this._previewCallbackX1 = previewCallbackX1), isFunction(previewCallbackY1) && (this._previewCallbackY1 = previewCallbackY1);
43566
+ start && (this.state.start = start), end && (this.state.end = end), this._isHorizontal = "top" === orient || "bottom" === orient, this._layoutCache.max = this._isHorizontal ? width : height, this._layoutCache.attPos = this._isHorizontal ? "x" : "y", this._layoutCache.attSize = this._isHorizontal ? "width" : "height", this._activeCache.startPos = position, this._activeCache.lastPos = position, this._showText = "auto" !== showDetail && showDetail, previewData && (this._previewData = previewData), isFunction(previewCallbackX) && (this._previewCallbackX = previewCallbackX), isFunction(previewCallbackY) && (this._previewCallbackY = previewCallbackY), isFunction(previewCallbackX1) && (this._previewCallbackX1 = previewCallbackX1), isFunction(previewCallbackY1) && (this._previewCallbackY1 = previewCallbackY1), isFunction(updateStateCallback) && (this._updateStateCallback = updateStateCallback);
43516
43567
  }
43517
43568
  bindEvents() {
43518
43569
  const {
@@ -43942,10 +43993,10 @@
43942
43993
  start: startAttr,
43943
43994
  end: endAttr
43944
43995
  } = this.attribute;
43945
- isValid(start) && isValid(end) && (start !== this.state.start || end !== this.state.end) && (this.state.start = start, this.state.end = end, startAttr === this.state.start && endAttr === this.state.end || this.setAttributes({
43996
+ isValid(start) && isValid(end) && (start !== this.state.start || end !== this.state.end) && (this.state.start = start, this.state.end = end, startAttr === this.state.start && endAttr === this.state.end || (this.setAttributes({
43946
43997
  start: start,
43947
43998
  end: end
43948
- }));
43999
+ }), this._updateStateCallback && this._updateStateCallback(start, end)));
43949
44000
  }
43950
44001
  setPreviewData(data) {
43951
44002
  this._previewData = data;
@@ -44986,7 +45037,7 @@
44986
45037
  const innerGroupBounds = innerGroup.AABBBounds,
44987
45038
  innerGroupWidth = innerGroupBounds.width(),
44988
45039
  innerGroupHeight = innerGroupBounds.height(),
44989
- itemGroupWidth = this._itemWidthByUser || innerGroupWidth + parsedPadding[1] + parsedPadding[3],
45040
+ itemGroupWidth = isValid(this.attribute.item.width) ? this.attribute.item.width : innerGroupWidth + parsedPadding[1] + parsedPadding[3],
44990
45041
  itemGroupHeight = this._itemHeightByUser || innerGroupHeight + parsedPadding[0] + parsedPadding[2];
44991
45042
  return itemGroup.attribute.width = itemGroupWidth, itemGroup.attribute.height = itemGroupHeight, innerGroup.translateTo(-innerGroupBounds.x1 + parsedPadding[3], -innerGroupBounds.y1 + parsedPadding[0]), itemGroup;
44992
45043
  }
@@ -51514,6 +51565,8 @@
51514
51565
  (function (ChartEvent) {
51515
51566
  ChartEvent["initialized"] = "initialized";
51516
51567
  ChartEvent["rendered"] = "rendered";
51568
+ ChartEvent["renderFinished"] = "renderFinished";
51569
+ ChartEvent["animationFinished"] = "animationFinished";
51517
51570
  ChartEvent["regionSeriesDataFilterOver"] = "regionSeriesDataFilterOver";
51518
51571
  ChartEvent["afterInitData"] = "afterInitData";
51519
51572
  ChartEvent["afterInitEvent"] = "afterInitEvent";
@@ -53164,19 +53217,33 @@
53164
53217
  return true;
53165
53218
  };
53166
53219
  const getDimensionData = (value, axis, coordinate, getDimensionField) => {
53220
+ const scale = axis.getScale();
53221
+ const isDiscreteAxis = isDiscrete(scale.type);
53167
53222
  const data = [];
53168
53223
  const regions = axis.getRegions();
53169
53224
  for (const region of regions) {
53170
53225
  const seriesList = region.getSeries();
53171
53226
  for (const series of seriesList) {
53172
53227
  if (series.coordinate === coordinate) {
53173
- const dimensionField = getDimensionField(series);
53228
+ const dimensionField = array(getDimensionField(series));
53174
53229
  const viewData = series.getViewData()?.latestData;
53175
53230
  if (dimensionField && viewData) {
53176
- data.push({
53177
- series,
53178
- datum: viewData.filter((datum) => datum[dimensionField]?.toString() === value?.toString())
53179
- });
53231
+ if (isDiscreteAxis) {
53232
+ data.push({
53233
+ series,
53234
+ datum: viewData.filter((datum) => datum[dimensionField[0]]?.toString() === value?.toString())
53235
+ });
53236
+ }
53237
+ else {
53238
+ data.push({
53239
+ series,
53240
+ datum: viewData.filter((datum) => datum[dimensionField[0]]?.toString() === value?.toString() ||
53241
+ (isValid(datum[dimensionField[0]]) &&
53242
+ isValid(datum[dimensionField[1]]) &&
53243
+ value >= datum[dimensionField[0]] &&
53244
+ value < datum[dimensionField[1]]))
53245
+ });
53246
+ }
53180
53247
  }
53181
53248
  }
53182
53249
  }
@@ -53269,8 +53336,10 @@
53269
53336
  }
53270
53337
  return null;
53271
53338
  };
53272
- const XAxisGetDimensionField = (series) => series.fieldX[0];
53273
- const YAxisGetDimensionField = (series) => series.fieldY[0];
53339
+ const discreteXAxisGetDimensionField = (series) => series.fieldX[0];
53340
+ const discreteYAxisGetDimensionField = (series) => series.fieldY[0];
53341
+ const continuousXAxisGetDimensionField = (series) => [series.fieldX[0], series.fieldX2];
53342
+ const continuousYAxisGetDimensionField = (series) => [series.fieldY[0], series.fieldY2];
53274
53343
  const getCartesianDimensionInfo = (chart, pos) => {
53275
53344
  if (!chart) {
53276
53345
  return null;
@@ -53285,13 +53354,15 @@
53285
53354
  const targetAxisInfo = [];
53286
53355
  if (xAxisList) {
53287
53356
  xAxisList.forEach(axis => {
53288
- const info = getDiscreteAxisDimensionInfo(axis, x, 'x', XAxisGetDimensionField);
53357
+ const isDiscreteAxis = isDiscrete(axis.getScale().type);
53358
+ const info = getDimensionInfoByPosition(axis, x, 'x', isDiscreteAxis ? discreteXAxisGetDimensionField : continuousXAxisGetDimensionField);
53289
53359
  info && targetAxisInfo.push(info);
53290
53360
  });
53291
53361
  }
53292
53362
  if (yAxisList) {
53293
53363
  yAxisList.forEach(axis => {
53294
- const info = getDiscreteAxisDimensionInfo(axis, y, 'y', YAxisGetDimensionField);
53364
+ const isDiscreteAxis = isDiscrete(axis.getScale().type);
53365
+ const info = getDimensionInfoByPosition(axis, y, 'y', isDiscreteAxis ? discreteYAxisGetDimensionField : continuousYAxisGetDimensionField);
53295
53366
  info && targetAxisInfo.push(info);
53296
53367
  });
53297
53368
  }
@@ -53300,20 +53371,17 @@
53300
53371
  }
53301
53372
  return targetAxisInfo;
53302
53373
  };
53303
- const getDiscreteAxisDimensionInfo = (axis, posValue, posKey, getDimensionField) => {
53374
+ const getDimensionInfoByPosition = (axis, posValue, posKey, getDimensionField) => {
53304
53375
  const scale = axis.getScale();
53305
53376
  const scalePos = posValue - axis.getLayoutStartPoint()[posKey];
53306
53377
  if ((scalePos - scale.range()[0]) * (scalePos - scale.range()[1]) > 0) {
53307
53378
  return null;
53308
53379
  }
53309
53380
  const value = scale.invert(scalePos);
53310
- return getDimensionInfoInAxis(axis, value, getDimensionField);
53381
+ return getDimensionInfoByValue(axis, value, getDimensionField);
53311
53382
  };
53312
- const getDimensionInfoInAxis = (axis, value, getDimensionField) => {
53383
+ const getDimensionInfoByValue = (axis, value, getDimensionField) => {
53313
53384
  const scale = axis.getScale();
53314
- if (!scale || !isDiscrete(scale.type)) {
53315
- return null;
53316
- }
53317
53385
  if (isNil(value)) {
53318
53386
  return null;
53319
53387
  }
@@ -53322,7 +53390,7 @@
53322
53390
  if (index < 0) {
53323
53391
  index = undefined;
53324
53392
  }
53325
- const data = getDimensionData(value, axis, 'cartesian', getDimensionField ?? (isXAxis(axis.orient) ? XAxisGetDimensionField : YAxisGetDimensionField));
53393
+ const data = getDimensionData(value, axis, 'cartesian', getDimensionField ?? (isXAxis(axis.orient) ? discreteXAxisGetDimensionField : discreteYAxisGetDimensionField));
53326
53394
  return { index, value, axis, data };
53327
53395
  };
53328
53396
 
@@ -53461,10 +53529,10 @@
53461
53529
  this._chart = this._eventDispatcher.globalInstance.getChart?.();
53462
53530
  }
53463
53531
  register(eType, handler) {
53464
- throw new Error('Method not implemented.');
53532
+ (this._chart?.getOption().onError ?? error$1)('Method not implemented.');
53465
53533
  }
53466
53534
  unregister() {
53467
- throw new Error('Method not implemented.');
53535
+ (this._chart?.getOption().onError ?? error$1)('Method not implemented.');
53468
53536
  }
53469
53537
  getTargetDimensionInfo(x, y) {
53470
53538
  const cartesianInfo = getCartesianDimensionInfo(this._chart, { x, y }) ?? [];
@@ -53491,7 +53559,7 @@
53491
53559
  });
53492
53560
  const dimensionInfo = [];
53493
53561
  axis.forEach(a => {
53494
- const info = getDimensionInfoInAxis(a, v);
53562
+ const info = getDimensionInfoByValue(a, v);
53495
53563
  if (info) {
53496
53564
  dimensionInfo.push(info);
53497
53565
  }
@@ -54097,7 +54165,7 @@
54097
54165
  });
54098
54166
  return viewData;
54099
54167
  }
54100
- function dataToDataView(data, dataSet, sourceDataViews = []) {
54168
+ function dataToDataView(data, dataSet, sourceDataViews = [], ctx = {}) {
54101
54169
  if (data instanceof DataView) {
54102
54170
  return data;
54103
54171
  }
@@ -54116,7 +54184,8 @@
54116
54184
  if (typeof fromDataId === 'string') {
54117
54185
  const fromDataView = sourceDataViews.find(dv => dv.name === fromDataId);
54118
54186
  if (!fromDataView) {
54119
- throw new Error(`no data matches fromDataId ${fromDataId}`);
54187
+ (ctx.onError ?? error$1)(`no data matches fromDataId ${fromDataId}`);
54188
+ return null;
54120
54189
  }
54121
54190
  dataView.parse([fromDataView], {
54122
54191
  type: 'dataview'
@@ -54128,7 +54197,8 @@
54128
54197
  else if (typeof fromDataIndex === 'number') {
54129
54198
  const fromDataView = sourceDataViews[fromDataIndex];
54130
54199
  if (!fromDataView) {
54131
- throw new Error(`no data matches fromDataIndex ${fromDataIndex}`);
54200
+ (ctx.onError ?? error$1)(`no data matches fromDataIndex ${fromDataIndex}`);
54201
+ return null;
54132
54202
  }
54133
54203
  dataView.parse([fromDataView], {
54134
54204
  type: 'dataview'
@@ -54146,7 +54216,7 @@
54146
54216
  }
54147
54217
  else {
54148
54218
  dataView.parse([]);
54149
- error$1('values should be array');
54219
+ warn('values should be array');
54150
54220
  }
54151
54221
  if (transforms && transforms.length) {
54152
54222
  transforms.forEach((transform) => {
@@ -54283,6 +54353,12 @@
54283
54353
  if (this._view) {
54284
54354
  return;
54285
54355
  }
54356
+ const logger = new Logger(this._option.logLevel ?? LoggerLevel.Error);
54357
+ if (this._option.onError) {
54358
+ logger.addErrorHandler((...args) => {
54359
+ this._option.onError(...args);
54360
+ });
54361
+ }
54286
54362
  this._view = new View({
54287
54363
  width: this._width,
54288
54364
  height: this._height,
@@ -54302,7 +54378,8 @@
54302
54378
  doLayout: () => {
54303
54379
  this._compileChart?.onLayout(this._view);
54304
54380
  },
54305
- logLevel: Logger.getInstance().level()
54381
+ logger: logger,
54382
+ logLevel: logger.level()
54306
54383
  });
54307
54384
  this._setCanvasStyle();
54308
54385
  const interactive = this._option.interactive;
@@ -54556,7 +54633,7 @@
54556
54633
  });
54557
54634
  });
54558
54635
  }
54559
- async function getCanvasDataURL(c) {
54636
+ async function getCanvasDataURL(c, ctx) {
54560
54637
  if (!c) {
54561
54638
  return '';
54562
54639
  }
@@ -54565,8 +54642,8 @@
54565
54642
  return OffscreenCanvasToDataURL(c);
54566
54643
  }
54567
54644
  }
54568
- catch (error) {
54569
- console.error('getCanvasDataURL', error);
54645
+ catch (_error) {
54646
+ (ctx?.onError ?? error$1)(`getCanvasDataURL error : ${_error.toString()}`);
54570
54647
  }
54571
54648
  return c.toDataURL();
54572
54649
  }
@@ -54627,15 +54704,20 @@
54627
54704
  _autoSize = true;
54628
54705
  _option = {
54629
54706
  mode: exports.RenderModeEnum['desktop-browser'],
54630
- animation: true
54707
+ animation: true,
54708
+ onError: (msg) => {
54709
+ throw new Error(msg);
54710
+ }
54631
54711
  };
54632
54712
  _curSize = { width: 0, height: 0 };
54633
54713
  _observer = null;
54634
54714
  _currentThemeName;
54635
54715
  _currentTheme;
54716
+ _onError;
54636
54717
  _context = {};
54637
54718
  constructor(spec, options) {
54638
54719
  this._option = merge$2(this._option, options);
54720
+ this._onError = this._option.onError;
54639
54721
  const { dom, renderCanvas, mode, stage, poptip, ...restOptions } = this._option;
54640
54722
  if (dom) {
54641
54723
  this._container = isString(dom) ? document?.getElementById(dom) : dom;
@@ -54647,13 +54729,14 @@
54647
54729
  this._stage = stage;
54648
54730
  }
54649
54731
  if (mode !== 'node' && !this._container && !this._canvas && !this._stage) {
54650
- error$1('please specify container or renderCanvas!');
54732
+ this._option.onError('please specify container or renderCanvas!');
54651
54733
  return;
54652
54734
  }
54653
54735
  this._viewBox = this._option.viewBox;
54654
54736
  this._currentThemeName = ThemeManager.getCurrentThemeName();
54655
54737
  this._setSpec(spec);
54656
54738
  this._updateCurrentTheme();
54739
+ const specBackground = typeof spec.background === 'string' ? spec.background : null;
54657
54740
  this._compiler = new Compiler({
54658
54741
  dom: this._container ?? 'none',
54659
54742
  canvas: renderCanvas
@@ -54662,7 +54745,8 @@
54662
54745
  stage,
54663
54746
  pluginList: poptip !== false ? ['poptipForText'] : [],
54664
54747
  ...restOptions,
54665
- background: spec.background || this._currentTheme.background || this._option.background
54748
+ background: specBackground || this._currentTheme.background || this._option.background,
54749
+ onError: this._onError
54666
54750
  });
54667
54751
  this._eventDispatcher = new EventDispatcher(this, this._compiler);
54668
54752
  this._event = new Event$1(this._eventDispatcher, mode);
@@ -54677,6 +54761,7 @@
54677
54761
  height: spec.height || 0
54678
54762
  };
54679
54763
  this._bindResizeEvent();
54764
+ this._bindVGrammarViewEvent();
54680
54765
  this._event.emit(ChartEvent.initialized, {});
54681
54766
  InstanceManager.registerInstance(this);
54682
54767
  }
@@ -54695,13 +54780,15 @@
54695
54780
  const dataViewArr = [];
54696
54781
  for (let i = 0; i < specData.length; i++) {
54697
54782
  const curSpecData = specData[i];
54698
- dataViewArr.push(dataToDataView(curSpecData, this._dataSet, dataViewArr));
54783
+ dataViewArr.push(dataToDataView(curSpecData, this._dataSet, dataViewArr, {
54784
+ onError: this._option.onError
54785
+ }));
54699
54786
  }
54700
54787
  this._spec.data = dataViewArr;
54701
54788
  }
54702
54789
  _initChart(spec) {
54703
54790
  if (!this._compiler) {
54704
- error$1('compiler is not initialized');
54791
+ this._option.onError('compiler is not initialized');
54705
54792
  return;
54706
54793
  }
54707
54794
  this._initData();
@@ -54719,10 +54806,11 @@
54719
54806
  viewBox: this._viewBox,
54720
54807
  animation: this._option.animation,
54721
54808
  getTheme: () => this._currentTheme,
54722
- layout: this._option.layout
54809
+ layout: this._option.layout,
54810
+ onError: this._onError
54723
54811
  });
54724
54812
  if (!chart) {
54725
- error$1('init chart fail');
54813
+ this._option.onError('init chart fail');
54726
54814
  return;
54727
54815
  }
54728
54816
  this._chart = chart;
@@ -54735,6 +54823,17 @@
54735
54823
  this._dataSet = null;
54736
54824
  }
54737
54825
  }
54826
+ _bindVGrammarViewEvent() {
54827
+ if (!this._compiler || this._compiler.isReleased) {
54828
+ return;
54829
+ }
54830
+ this._compiler.getVGrammarView().addEventListener(HOOK_EVENT.ALL_ANIMATION_END, () => {
54831
+ this._event.emit(ChartEvent.animationFinished, {});
54832
+ });
54833
+ this._compiler.getVGrammarView().addEventListener(HOOK_EVENT.AFTER_VRENDER_NEXT_RENDER, () => {
54834
+ this._event.emit(ChartEvent.renderFinished, {});
54835
+ });
54836
+ }
54738
54837
  _bindResizeEvent() {
54739
54838
  if (this._autoSize) {
54740
54839
  if (this._container) {
@@ -54786,7 +54885,21 @@
54786
54885
  if (!isValid(result)) {
54787
54886
  return this;
54788
54887
  }
54789
- if (result.reMake) {
54888
+ this._reCompile(result);
54889
+ await this.renderAsync(morphConfig);
54890
+ return this;
54891
+ }
54892
+ updateCustomConfigAndRerenderSync(modifyConfig, morphConfig) {
54893
+ const result = modifyConfig();
54894
+ if (!isValid(result)) {
54895
+ return this;
54896
+ }
54897
+ this._reCompile(result);
54898
+ this.renderSync(morphConfig);
54899
+ return this;
54900
+ }
54901
+ _reCompile(updateResult) {
54902
+ if (updateResult.reMake) {
54790
54903
  this._releaseData();
54791
54904
  this._initDataSet();
54792
54905
  this._chart.release();
@@ -54794,13 +54907,11 @@
54794
54907
  this._compiler?.releaseGrammar();
54795
54908
  }
54796
54909
  else {
54797
- if (result.reCompile) {
54910
+ if (updateResult.reCompile) {
54798
54911
  this.getComponents().forEach(c => c.clear());
54799
54912
  this._compiler?.compile({ chart: this._chart, vChart: this }, {});
54800
54913
  }
54801
54914
  }
54802
- await this.renderAsync(morphConfig);
54803
- return this;
54804
54915
  }
54805
54916
  renderSync(morphConfig) {
54806
54917
  if (!this._chart) {
@@ -54959,6 +55070,25 @@
54959
55070
  }, morphConfig);
54960
55071
  return this;
54961
55072
  }
55073
+ updateSpecSync(spec, forceMerge = false, morphConfig) {
55074
+ if (!spec) {
55075
+ return this;
55076
+ }
55077
+ if (isString(spec)) {
55078
+ spec = JSON.parse(spec);
55079
+ }
55080
+ if (forceMerge) {
55081
+ spec = merge$2({}, this._spec, spec);
55082
+ }
55083
+ this.updateCustomConfigAndRerenderSync(() => {
55084
+ spec = specTransform(spec);
55085
+ this._spec = spec;
55086
+ this._updateCurrentTheme();
55087
+ this._compiler?.getVGrammarView()?.updateLayoutTag();
55088
+ return this._chart.updateSpec(spec, morphConfig);
55089
+ }, morphConfig);
55090
+ return this;
55091
+ }
54962
55092
  async resize(width, height) {
54963
55093
  if (!this._chart || !this._compiler) {
54964
55094
  return this;
@@ -55036,6 +55166,18 @@
55036
55166
  });
55037
55167
  return this;
55038
55168
  }
55169
+ setCurrentThemeSync(name) {
55170
+ if (!ThemeManager.themeExist(name)) {
55171
+ return this;
55172
+ }
55173
+ this.updateCustomConfigAndRerenderSync(() => {
55174
+ this._currentThemeName = name;
55175
+ this._updateCurrentTheme();
55176
+ this._chart?.setCurrentTheme(this._currentTheme, true);
55177
+ return { change: true, reMake: false };
55178
+ });
55179
+ return this;
55180
+ }
55039
55181
  _getTooltipComponent() {
55040
55182
  const tooltip = this._chart?.getAllComponents().find(c => c.type === ComponentTypeEnum.tooltip);
55041
55183
  return tooltip;
@@ -55117,15 +55259,17 @@
55117
55259
  if (this._chart && stage) {
55118
55260
  stage.render();
55119
55261
  const canvas = this._chart.getCanvas();
55120
- const url = await getCanvasDataURL(canvas);
55262
+ const url = await getCanvasDataURL(canvas, {
55263
+ onError: this._onError
55264
+ });
55121
55265
  return url;
55122
55266
  }
55123
- console.error(new ReferenceError(`render is not defined`));
55267
+ this._option.onError(new ReferenceError(`render is not defined`));
55124
55268
  return null;
55125
55269
  }
55126
55270
  async exportImg(name) {
55127
55271
  if (!isTrueBrowser(this._option.mode)) {
55128
- console.error(new TypeError(`non-browser environment can not export img`));
55272
+ this._option.onError(new TypeError(`non-browser environment can not export img`));
55129
55273
  return;
55130
55274
  }
55131
55275
  const dataURL = await this.getDataURL();
@@ -55133,12 +55277,12 @@
55133
55277
  URLToImage(name, dataURL);
55134
55278
  }
55135
55279
  else {
55136
- console.error(new ReferenceError(`render is not defined`));
55280
+ this._option.onError(new ReferenceError(`render is not defined`));
55137
55281
  }
55138
55282
  }
55139
55283
  getImageBuffer() {
55140
55284
  if (this._option.mode !== 'node') {
55141
- console.error(new TypeError('getImageBuffer() now only support node environment.'));
55285
+ this._option.onError(new TypeError('getImageBuffer() now only support node environment.'));
55142
55286
  return;
55143
55287
  }
55144
55288
  const stage = this.getStage();
@@ -55147,7 +55291,7 @@
55147
55291
  const buffer = stage.window.getImageBuffer();
55148
55292
  return buffer;
55149
55293
  }
55150
- console.error(new ReferenceError(`render is not defined`));
55294
+ this._option.onError(new ReferenceError(`render is not defined`));
55151
55295
  return null;
55152
55296
  }
55153
55297
  setLayout(layout) {
@@ -55560,14 +55704,6 @@
55560
55704
  layoutPaddingBottom = 0;
55561
55705
  layoutOffsetX = 0;
55562
55706
  layoutOffsetY = 0;
55563
- _attributeTag = true;
55564
- getAttributeTag() {
55565
- return this._attributeTag;
55566
- }
55567
- setAttributeTag(tag) {
55568
- this._attributeTag = tag;
55569
- return this._attributeTag;
55570
- }
55571
55707
  layoutLevel = LayoutLevel.Region;
55572
55708
  layoutZIndex = 0;
55573
55709
  chartLayoutRect;
@@ -56674,6 +56810,10 @@
56674
56810
  _bottomCurrent = 0;
56675
56811
  _chartLayoutRect;
56676
56812
  _chartViewBox;
56813
+ _onError;
56814
+ constructor(_spec, ctx) {
56815
+ this._onError = ctx?.onError;
56816
+ }
56677
56817
  layoutItems(_chart, items, chartLayoutRect, chartViewBox) {
56678
56818
  this._chartLayoutRect = chartLayoutRect;
56679
56819
  this._chartViewBox = chartViewBox;
@@ -56934,7 +57074,7 @@
56934
57074
  filterRegionsWithID(regions, id) {
56935
57075
  const target = regions.find(x => x.id === id);
56936
57076
  if (!target) {
56937
- throw Error('can not find target region item, invalid id');
57077
+ (this._onError ?? error$1)('can not find target region item, invalid id');
56938
57078
  }
56939
57079
  return target;
56940
57080
  }
@@ -58028,7 +58168,7 @@
58028
58168
  VChart.useMark([ComponentMark, GroupMark, ImageMark]);
58029
58169
  Factory.registerRegion('region', Region);
58030
58170
  Factory.registerLayout('base', Layout);
58031
- const version = "1.1.2";
58171
+ const version = "1.2.0-beta.2";
58032
58172
  Logger.getInstance(LoggerLevel.Error);
58033
58173
 
58034
58174
  var SeriesMarkNameEnum;
@@ -58460,7 +58600,7 @@
58460
58600
  }
58461
58601
  stack(stackCache) {
58462
58602
  if (stackCache.values.length > 0) {
58463
- let positiveStart = Number.EPSILON;
58603
+ let positiveStart = 0;
58464
58604
  let negativeStart = 0;
58465
58605
  let sign = 1;
58466
58606
  let value = 0;
@@ -58481,8 +58621,8 @@
58481
58621
  value = v[STACK_FIELD_END];
58482
58622
  const denominator = value >= 0 ? positiveStart : negativeStart;
58483
58623
  sign = value >= 0 ? 1 : -1;
58484
- v[STACK_FIELD_START_PERCENT] = Math.min(1, v[STACK_FIELD_START] / denominator) * sign;
58485
- v[STACK_FIELD_END_PERCENT] = Math.min(1, v[STACK_FIELD_END] / denominator) * sign;
58624
+ v[STACK_FIELD_START_PERCENT] = denominator === 0 ? 0 : Math.min(1, v[STACK_FIELD_START] / denominator) * sign;
58625
+ v[STACK_FIELD_END_PERCENT] = denominator === 0 ? 0 : Math.min(1, v[STACK_FIELD_END] / denominator) * sign;
58486
58626
  });
58487
58627
  }
58488
58628
  for (const key in stackCache.nodes) {
@@ -58517,6 +58657,9 @@
58517
58657
  this.transformSpec(s);
58518
58658
  this._spec = s;
58519
58659
  }
58660
+ getOption() {
58661
+ return this._option;
58662
+ }
58520
58663
  _theme;
58521
58664
  _regions = [];
58522
58665
  _series = [];
@@ -58571,6 +58714,7 @@
58571
58714
  padding = { top: 0, left: 0, right: 0, bottom: 0 };
58572
58715
  _paddingSpec;
58573
58716
  _canvasRect;
58717
+ _backgroundMark;
58574
58718
  constructor(spec, option) {
58575
58719
  super(option);
58576
58720
  this._theme = option.getTheme();
@@ -58584,7 +58728,8 @@
58584
58728
  getChartLayoutRect: () => this._layoutRect,
58585
58729
  getChartViewRect: () => this._viewRect,
58586
58730
  getChart: () => this,
58587
- globalScale: this._globalScale
58731
+ globalScale: this._globalScale,
58732
+ onError: this._option.onError
58588
58733
  };
58589
58734
  this._stack = new Stack(this);
58590
58735
  this._spec = spec;
@@ -58592,6 +58737,7 @@
58592
58737
  created() {
58593
58738
  this.transformSpec(this._spec);
58594
58739
  this.createGlobalScale();
58740
+ this.createBackground(this._spec.background);
58595
58741
  this.createLayout();
58596
58742
  this.createRegion(this._spec.region);
58597
58743
  this.createSeries(this._spec.series);
@@ -58628,6 +58774,28 @@
58628
58774
  this._updateLayoutRect(viewBox);
58629
58775
  this.setLayoutTag(true);
58630
58776
  }
58777
+ createBackground(bg) {
58778
+ if (!bg) {
58779
+ return;
58780
+ }
58781
+ if (typeof bg !== 'object') {
58782
+ return;
58783
+ }
58784
+ this._backgroundMark = Factory.createMark(MarkTypeEnum.group, 'chart-background', {
58785
+ model: this,
58786
+ map: this._option.map,
58787
+ getCompiler: this.getCompiler,
58788
+ globalScale: this._globalScale
58789
+ });
58790
+ this._backgroundMark.created();
58791
+ this._backgroundMark.setStyle(convertBackgroundSpec(bg));
58792
+ this._backgroundMark.setStyle({
58793
+ x: () => this._viewBox.x1,
58794
+ y: () => this._viewBox.y1,
58795
+ width: () => this._viewBox.x2 - this._viewBox.x1,
58796
+ height: () => this._viewBox.y2 - this._viewBox.y1
58797
+ });
58798
+ }
58631
58799
  createRegion(regionSpec) {
58632
58800
  if (!regionSpec) {
58633
58801
  return;
@@ -58653,7 +58821,9 @@
58653
58821
  spec.data = this.getSeriesData(spec.dataId, spec.dataIndex);
58654
58822
  }
58655
58823
  else {
58656
- spec.data = dataToDataView(spec.data, this._dataSet, this._spec.data);
58824
+ spec.data = dataToDataView(spec.data, this._dataSet, this._spec.data, {
58825
+ onError: this._option.onError
58826
+ });
58657
58827
  }
58658
58828
  if (this._option.animation === false) {
58659
58829
  spec.animation = false;
@@ -58772,7 +58942,9 @@
58772
58942
  if (this._spec.zField || (this._spec.series && this._spec.series.some((s) => s.zField))) {
58773
58943
  use3dLayout = true;
58774
58944
  }
58775
- const layout = new (Factory.getLayout(this._spec.layout?.type ?? (use3dLayout ? 'layout3d' : 'base')))(this._spec.layout);
58945
+ const layout = new (Factory.getLayout(this._spec.layout?.type ?? (use3dLayout ? 'layout3d' : 'base')))(this._spec.layout, {
58946
+ onError: this._option.onError
58947
+ });
58776
58948
  this._layoutFunc = layout.layoutItems.bind(layout);
58777
58949
  }
58778
58950
  }
@@ -58990,7 +59162,8 @@
58990
59162
  }
58991
59163
  getSeriesData(id, index) {
58992
59164
  if (!this._spec.data) {
58993
- throw new Error('no data in spec!');
59165
+ this._option.onError('no data in spec!');
59166
+ return null;
58994
59167
  }
58995
59168
  if (typeof id === 'string') {
58996
59169
  const metchData = this._spec.data.filter((data) => {
@@ -58999,13 +59172,15 @@
58999
59172
  if (metchData[0]) {
59000
59173
  return metchData[0];
59001
59174
  }
59002
- throw new Error(`no data matches dataId ${id}!`);
59175
+ this._option.onError(`no data matches dataId ${id}!`);
59176
+ return null;
59003
59177
  }
59004
59178
  if (typeof index === 'number') {
59005
59179
  if (this._spec.data[index]) {
59006
59180
  return this._spec.data[index];
59007
59181
  }
59008
- throw new Error(`no data matches dataIndex ${index}!`);
59182
+ this._option.onError(`no data matches dataIndex ${index}!`);
59183
+ return null;
59009
59184
  }
59010
59185
  return this._spec.data[0];
59011
59186
  }
@@ -59195,7 +59370,8 @@
59195
59370
  large: spec.large,
59196
59371
  largeThreshold: spec.largeThreshold,
59197
59372
  progressiveStep: spec.progressiveStep,
59198
- progressiveThreshold: spec.progressiveThreshold
59373
+ progressiveThreshold: spec.progressiveThreshold,
59374
+ background: spec.seriesBackground
59199
59375
  };
59200
59376
  return series;
59201
59377
  }
@@ -59255,6 +59431,7 @@
59255
59431
  });
59256
59432
  }
59257
59433
  compile() {
59434
+ this.compileBackground();
59258
59435
  this.compileLayout();
59259
59436
  this.compileRegions();
59260
59437
  this.compileSeries();
@@ -59275,6 +59452,21 @@
59275
59452
  const { width, height } = this.getCanvasRect();
59276
59453
  this.getCompiler().setSize(width, height);
59277
59454
  }
59455
+ compileBackground() {
59456
+ if (!this._backgroundMark) {
59457
+ return;
59458
+ }
59459
+ this._backgroundMark.compile();
59460
+ this._backgroundMark
59461
+ .getProduct()
59462
+ ?.configure({
59463
+ context: {
59464
+ model: this
59465
+ }
59466
+ })
59467
+ .layout(() => {
59468
+ });
59469
+ }
59278
59470
  compileRegions() {
59279
59471
  this._option.performanceHook?.beforeRegionCompile?.();
59280
59472
  this.getAllRegions().forEach(r => {
@@ -59319,7 +59511,6 @@
59319
59511
  }
59320
59512
  if (model && mark.isUpdated) {
59321
59513
  model.bindSceneNode?.(sceneRoot.elements[0]);
59322
- model.setAttributeTag(true);
59323
59514
  return;
59324
59515
  }
59325
59516
  if (mark.markType === 'group') {
@@ -61063,7 +61254,7 @@
61063
61254
  if (isFunction(dataKey)) {
61064
61255
  return dataKey(datum, index);
61065
61256
  }
61066
- throw new Error(`invalid dataKey: ${dataKey}`);
61257
+ this._option.onError(`invalid dataKey: ${dataKey}`);
61067
61258
  }
61068
61259
  _addDataIndexAndKey() {
61069
61260
  if (this._rawData?.dataSet) {
@@ -63941,13 +64132,14 @@
63941
64132
  }
63942
64133
  return lineMark;
63943
64134
  }
63944
- initSymbolMark(progressive) {
64135
+ initSymbolMark(progressive, isSeriesMark) {
63945
64136
  this._symbolMark = this._createMark(lineLikeSeriesMarkMap.point, {
63946
64137
  morph: shouldDoMorph(this._spec.animation, this._spec.morph, userAnimationConfig('point', this._spec)),
63947
64138
  defaultMorphElementKey: this.getDimensionField()[0],
63948
64139
  groupKey: this._seriesField,
63949
64140
  label: merge$2({ animation: this._spec.animation }, this._spec.label),
63950
- progressive
64141
+ progressive,
64142
+ isSeriesMark: !!isSeriesMark
63951
64143
  });
63952
64144
  return this._symbolMark;
63953
64145
  }
@@ -64094,8 +64286,9 @@
64094
64286
  large: this._spec.large,
64095
64287
  largeThreshold: this._spec.largeThreshold
64096
64288
  };
64097
- this.initLineMark(progressive);
64098
- this.initSymbolMark(progressive);
64289
+ const seriesMark = this._spec.seriesMark ?? 'line';
64290
+ this.initLineMark(progressive, seriesMark === 'line');
64291
+ this.initSymbolMark(progressive, seriesMark === 'point');
64099
64292
  }
64100
64293
  initMarkStyle() {
64101
64294
  this.initLineMarkStyle(this._direction);
@@ -64110,8 +64303,11 @@
64110
64303
  }
64111
64304
  }
64112
64305
  getSeriesStyle(datum) {
64306
+ const isLineAsSeriesMark = this._spec.seriesMark !== 'point';
64113
64307
  return (attribute) => {
64114
- attribute === 'fill' && (attribute = 'stroke');
64308
+ if (isLineAsSeriesMark) {
64309
+ attribute === 'fill' && (attribute = 'stroke');
64310
+ }
64115
64311
  return this._seriesMark?.getAttribute(attribute, datum) ?? null;
64116
64312
  };
64117
64313
  }
@@ -64549,14 +64745,15 @@
64549
64745
  largeThreshold: this._spec.largeThreshold
64550
64746
  };
64551
64747
  const isAreaVisible = this._spec.area?.visible !== false && this._spec.area?.style?.visible !== false;
64748
+ const seriesMark = this._spec.seriesMark ?? 'area';
64552
64749
  this._areaMark = this._createMark(AreaSeries.mark.area, {
64553
64750
  groupKey: this._seriesField,
64554
64751
  defaultMorphElementKey: this.getDimensionField()[0],
64555
64752
  progressive,
64556
- isSeriesMark: isAreaVisible
64753
+ isSeriesMark: isAreaVisible && seriesMark === 'area'
64557
64754
  });
64558
- this.initLineMark(progressive, !isAreaVisible);
64559
- this.initSymbolMark(progressive);
64755
+ this.initLineMark(progressive, seriesMark === 'line' || (seriesMark === 'area' && !isAreaVisible));
64756
+ this.initSymbolMark(progressive, seriesMark === 'point');
64560
64757
  }
64561
64758
  initMarkStyle() {
64562
64759
  const userCurveType = this.getSpec().area?.style?.curveType ?? this.getSpec().line?.style?.curveType;
@@ -65010,13 +65207,16 @@
65010
65207
  longitudeToData(lon) {
65011
65208
  }
65012
65209
  dataToPositionX(data) {
65013
- throw new Error('Method not implemented.');
65210
+ this._option.onError('Method not implemented.');
65211
+ return 0;
65014
65212
  }
65015
65213
  dataToPositionY(data) {
65016
- throw new Error('Method not implemented.');
65214
+ this._option.onError('Method not implemented.');
65215
+ return 0;
65017
65216
  }
65018
65217
  dataToPositionZ(data) {
65019
- throw new Error('Method not implemented.');
65218
+ this._option.onError('Method not implemented.');
65219
+ return 0;
65020
65220
  }
65021
65221
  release() {
65022
65222
  super.release();
@@ -65131,10 +65331,10 @@
65131
65331
  this._valueField = this._spec.valueField;
65132
65332
  this._spec.nameProperty && (this._nameProperty = this._spec.nameProperty);
65133
65333
  if (!this.map) {
65134
- throw new Error(`map type '${this.map}' is not specified !`);
65334
+ this._option.onError(`map type '${this.map}' is not specified !`);
65135
65335
  }
65136
65336
  if (!geoSourceMap.get(this.map)) {
65137
- throw new Error(`'${this.map}' data is not registered !`);
65337
+ this._option.onError(`'${this.map}' data is not registered !`);
65138
65338
  }
65139
65339
  }
65140
65340
  initData() {
@@ -65144,7 +65344,7 @@
65144
65344
  registerDataSetInstanceTransform(this._dataSet, 'lookup', lookup);
65145
65345
  const features = geoSourceMap.get(this.map);
65146
65346
  if (!features) {
65147
- throw Error('no valid map data found!');
65347
+ this._option.onError('no valid map data found!');
65148
65348
  }
65149
65349
  const mapData = new DataView(this._dataSet);
65150
65350
  mapData
@@ -65350,10 +65550,12 @@
65350
65550
  return '';
65351
65551
  }
65352
65552
  dataToPositionX(data) {
65353
- throw new Error('Method not implemented.');
65553
+ this._option.onError('Method not implemented.');
65554
+ return 0;
65354
65555
  }
65355
65556
  dataToPositionY(data) {
65356
- throw new Error('Method not implemented.');
65557
+ this._option.onError('Method not implemented.');
65558
+ return 0;
65357
65559
  }
65358
65560
  viewDataUpdate(d) {
65359
65561
  super.viewDataUpdate(d);
@@ -66900,10 +67102,12 @@
66900
67102
  }
66901
67103
  if (isArray$3(spec)) {
66902
67104
  if (isNil(field)) {
66903
- throw new Error(`${key}Field is required.`);
67105
+ this._option.onError(`${key}Field is required.`);
67106
+ return spec;
66904
67107
  }
66905
67108
  if (spec.length > 2) {
66906
- throw new Error(`${key} length is invalid, specify up to 2 ${key}s.`);
67109
+ this._option.onError(`${key} length is invalid, specify up to 2 ${key}s.`);
67110
+ return spec;
66907
67111
  }
66908
67112
  const scaleName = `${PREFIX}_series_scatter_${this.id}_scale_${key}`;
66909
67113
  this._option.globalScale.registerModelScale({
@@ -66924,7 +67128,8 @@
66924
67128
  }
66925
67129
  if (isObject$f(spec)) {
66926
67130
  if (isNil(field)) {
66927
- throw new Error(`${key}Field is required.`);
67131
+ this._option.onError(`${key}Field is required.`);
67132
+ return spec;
66928
67133
  }
66929
67134
  const scaleName = `${PREFIX}_series_scatter_${this.id}_scale_${key}`;
66930
67135
  const visualSpec = {
@@ -66945,7 +67150,8 @@
66945
67150
  field
66946
67151
  };
66947
67152
  }
66948
- throw new Error(`${key} attribute is invalid.`);
67153
+ this._option.onError(`${key} attribute is invalid.`);
67154
+ return spec;
66949
67155
  }
66950
67156
  getSizeAttribute(field, sizeSpec) {
66951
67157
  if (isNil(sizeSpec)) {
@@ -67257,9 +67463,10 @@
67257
67463
  largeThreshold: this._spec.largeThreshold
67258
67464
  };
67259
67465
  const isAreaVisible = this._spec.area?.visible !== false && this._spec.area?.style?.visible !== false;
67260
- this.initAreaMark(progressive, isAreaVisible);
67261
- this.initLineMark(progressive, !isAreaVisible);
67262
- this.initSymbolMark(progressive);
67466
+ const seriesMark = this._spec.seriesMark ?? 'area';
67467
+ this.initAreaMark(progressive, isAreaVisible && seriesMark === 'area');
67468
+ this.initLineMark(progressive, seriesMark === 'line' || (seriesMark === 'area' && !isAreaVisible));
67469
+ this.initSymbolMark(progressive, seriesMark === 'point');
67263
67470
  }
67264
67471
  initMarkStyle() {
67265
67472
  this.initAreaMarkStyle();
@@ -70778,6 +70985,16 @@
70778
70985
  }
70779
70986
  setValueFieldToPercent() {
70780
70987
  }
70988
+ updateSpec(spec) {
70989
+ const originalSpec = this._originalSpec;
70990
+ const result = super.updateSpec(spec);
70991
+ if (!isEqual$1(originalSpec, spec)) {
70992
+ result.reMake = true;
70993
+ result.reCompile = true;
70994
+ return result;
70995
+ }
70996
+ return result;
70997
+ }
70781
70998
  }
70782
70999
 
70783
71000
  class WordCloudSeries extends BaseWordCloudSeries {
@@ -73793,6 +74010,29 @@
73793
74010
  else {
73794
74011
  data = data[0];
73795
74012
  }
74013
+ if (op.sourceField !== 'source' || op.targetField !== 'target') {
74014
+ for (const key in data) {
74015
+ if (key === 'links') {
74016
+ const updatedData = [];
74017
+ data[key].forEach((datum) => {
74018
+ const updatedDatum = {};
74019
+ for (const key in datum) {
74020
+ if (key === op.sourceField) {
74021
+ updatedDatum.source = datum[op.sourceField];
74022
+ }
74023
+ else if (key === op.targetField) {
74024
+ updatedDatum.target = datum[op.targetField];
74025
+ }
74026
+ else {
74027
+ updatedDatum[key] = datum[key];
74028
+ }
74029
+ }
74030
+ updatedData.push(updatedDatum);
74031
+ });
74032
+ data[key] = updatedData;
74033
+ }
74034
+ }
74035
+ }
73796
74036
  const layout = new SankeyLayout(op);
73797
74037
  const result = [];
73798
74038
  result.push(layout.layout(data, view));
@@ -73972,13 +74212,15 @@
73972
74212
  y1: this._viewBox.y2
73973
74213
  };
73974
74214
  },
74215
+ sourceField: this._spec.sourceField,
74216
+ targetField: this._spec.targetField,
73975
74217
  direction: this._spec.direction,
73976
- nodeAlign: this._spec.nodeAlign,
73977
- nodeGap: this._spec.nodeGap,
73978
- nodeWidth: this._spec.nodeWidth,
74218
+ nodeAlign: this._spec.nodeAlign ?? 'justify',
74219
+ nodeGap: this._spec.nodeGap ?? 8,
74220
+ nodeWidth: this._spec.nodeWidth ?? 10,
73979
74221
  linkWidth: this._spec.linkWidth,
73980
74222
  minStepWidth: this._spec.minStepWidth,
73981
- minNodeHeight: this._spec.minNodeHeight,
74223
+ minNodeHeight: this._spec.minNodeHeight ?? 4,
73982
74224
  minLinkHeight: this._spec.minLinkHeight,
73983
74225
  iterations: this._spec.iterations,
73984
74226
  nodeKey: this._spec.nodeKey,
@@ -75756,7 +75998,8 @@
75756
75998
  invalidType: spec.invalidType || 'break',
75757
75999
  point: spec.point,
75758
76000
  line: spec.line,
75759
- area: spec.area
76001
+ area: spec.area,
76002
+ seriesMark: spec.seriesMark ?? 'area'
75760
76003
  };
75761
76004
  }
75762
76005
  transformSpec(spec) {
@@ -76293,7 +76536,8 @@
76293
76536
  ...super._getDefaultSeriesSpec(spec),
76294
76537
  invalidType: spec.invalidType || 'break',
76295
76538
  point: spec.point,
76296
- line: spec.line
76539
+ line: spec.line,
76540
+ seriesMark: spec.seriesMark ?? 'line'
76297
76541
  };
76298
76542
  }
76299
76543
  transformSpec(spec) {
@@ -76587,7 +76831,8 @@
76587
76831
  percent: spec.percent,
76588
76832
  area: merge$2({
76589
76833
  visible: false
76590
- }, spec.area)
76834
+ }, spec.area),
76835
+ seriesMark: spec.seriesMark ?? 'area'
76591
76836
  };
76592
76837
  }
76593
76838
  transformSpec(spec) {
@@ -76984,9 +77229,13 @@
76984
77229
  }
76985
77230
  }
76986
77231
  else {
76987
- spec.data = dataToDataView(spec.data, this._dataSet, this._spec.data);
77232
+ spec.data = dataToDataView(spec.data, this._dataSet, this._spec.data, {
77233
+ onError: this._option.onError
77234
+ });
76988
77235
  if (spec.type === SeriesTypeEnum.link) {
76989
- spec.dataDot = dataToDataView(this._spec.series[spec.dotSeriesIndex].data, this._dataSet, this._spec.data);
77236
+ spec.dataDot = dataToDataView(this._spec.series[spec.dotSeriesIndex].data, this._dataSet, this._spec.data, {
77237
+ onError: this._option.onError
77238
+ });
76990
77239
  }
76991
77240
  }
76992
77241
  if (spec.type === SeriesTypeEnum.link) {
@@ -80457,7 +80706,8 @@
80457
80706
  inverse
80458
80707
  }, options);
80459
80708
  }
80460
- throw `Component ${componentName} not found`;
80709
+ options.onError(`Component ${componentName} not found`);
80710
+ return null;
80461
80711
  }
80462
80712
  static createComponent(spec, options) {
80463
80713
  if (!this.type.startsWith(CartesianAxis.type)) {
@@ -81480,7 +81730,8 @@
81480
81730
  if (C) {
81481
81731
  return new C(spec, options);
81482
81732
  }
81483
- throw `Component ${componentName} not found`;
81733
+ options.onError(`Component ${componentName} not found`);
81734
+ return null;
81484
81735
  }
81485
81736
  static createComponent(spec, options) {
81486
81737
  if (!this.type.startsWith(PolarAxis.type)) {
@@ -82008,7 +82259,7 @@
82008
82259
  selectedData.forEach(s => {
82009
82260
  selectedFilter[s] = true;
82010
82261
  });
82011
- const datumField = field();
82262
+ const datumField = field() ?? DEFAULT_DATA_SERIES_FIELD;
82012
82263
  if (isValid(datumField)) {
82013
82264
  data = data.filter(d => selectedFilter[d[datumField]] === true);
82014
82265
  }
@@ -82717,7 +82968,6 @@
82717
82968
  }
82718
82969
  updateDatum(datum) {
82719
82970
  this._activeDatum = datum;
82720
- this.setAttributeTag(true);
82721
82971
  this._displayData.updateData();
82722
82972
  const attrs = this._getIndicatorAttrs();
82723
82973
  this._createOrUpdateIndicatorComponent(attrs);
@@ -82976,9 +83226,6 @@
82976
83226
  projection;
82977
83227
  constructor(projectionSpec) {
82978
83228
  this.projection = projection(projectionSpec.type)();
82979
- if (this.projection === null) {
82980
- throw Error('unsupported projection type!');
82981
- }
82982
83229
  }
82983
83230
  fit(start, size, features) {
82984
83231
  const fitData = { type: 'FeatureCollection', features };
@@ -83146,6 +83393,10 @@
83146
83393
  }
83147
83394
  initProjection() {
83148
83395
  this._projection = new Projection(this._projectionSpec);
83396
+ if (this._projection.projection === null) {
83397
+ this._option.onError('unsupported projection type!');
83398
+ return;
83399
+ }
83149
83400
  }
83150
83401
  coordinateHelper() {
83151
83402
  const helper = {
@@ -85213,7 +85464,8 @@
85213
85464
  }
85214
85465
  }
85215
85466
  }
85216
- throw new Error('need at least one series');
85467
+ this._option.onError('need at least one series');
85468
+ return null;
85217
85469
  }
85218
85470
  clear() {
85219
85471
  if (this._markerComponent) {
@@ -87549,6 +87801,9 @@
87549
87801
  else if (targetDimensionInfo.length > 1) {
87550
87802
  const dimensionAxisInfo = targetDimensionInfo.filter(info => {
87551
87803
  const axis = info.axis;
87804
+ if (!isDiscrete(axis.getScale().type)) {
87805
+ return false;
87806
+ }
87552
87807
  let firstSeries;
87553
87808
  for (const region of axis?.getRegions() ?? []) {
87554
87809
  for (const series of region.getSeries()) {
@@ -87561,7 +87816,7 @@
87561
87816
  break;
87562
87817
  }
87563
87818
  }
87564
- if (isValid(firstSeries) && firstSeries.getDimensionField() === firstSeries.fieldY) {
87819
+ if (isValid(firstSeries) && firstSeries.getDimensionField()[0] === firstSeries.fieldY[0]) {
87565
87820
  return axis.orient === 'left' || axis.orient === 'right';
87566
87821
  }
87567
87822
  return axis.orient === 'bottom' || axis.orient === 'top';
@@ -88286,7 +88541,8 @@
88286
88541
  _rowElements;
88287
88542
  _gridInfo;
88288
88543
  _elementMap = new Map();
88289
- constructor(gridInfo) {
88544
+ _onError;
88545
+ constructor(gridInfo, ctx) {
88290
88546
  this.standardizationSpec(gridInfo);
88291
88547
  this._gridInfo = gridInfo;
88292
88548
  this._col = gridInfo.col;
@@ -88295,6 +88551,7 @@
88295
88551
  this._rowSize = new Array(this._row).fill(null);
88296
88552
  this._colElements = new Array(this._col).fill([]);
88297
88553
  this._rowElements = new Array(this._row).fill([]);
88554
+ this._onError = ctx?.onError;
88298
88555
  this.initUserSetting();
88299
88556
  }
88300
88557
  standardizationSpec(gridInfo) {