@visactor/vchart 1.10.1-alpha.0 → 1.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.js +300 -269
  3. package/build/index.min.js +1 -1
  4. package/build/tsconfig.tsbuildinfo +1 -1
  5. package/cjs/chart/base/base-chart-transformer.js +1 -1
  6. package/cjs/chart/base/base-chart-transformer.js.map +1 -1
  7. package/cjs/chart/polar/polar-transformer.js.map +1 -1
  8. package/cjs/chart/sequence/sequence-transformer.js.map +1 -1
  9. package/cjs/chart/stack.js +2 -1
  10. package/cjs/compile/compiler.js +3 -3
  11. package/cjs/compile/compiler.js.map +1 -1
  12. package/cjs/compile/grammar-item.js +1 -2
  13. package/cjs/component/data-zoom/data-filter-base-component.d.ts +2 -1
  14. package/cjs/component/data-zoom/data-filter-base-component.js +4 -3
  15. package/cjs/component/data-zoom/data-filter-base-component.js.map +1 -1
  16. package/cjs/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
  17. package/cjs/component/data-zoom/data-zoom/interface.d.ts +1 -1
  18. package/cjs/component/data-zoom/data-zoom/interface.js.map +1 -1
  19. package/cjs/component/data-zoom/index.d.ts +1 -0
  20. package/cjs/component/data-zoom/index.js +2 -1
  21. package/cjs/component/data-zoom/index.js.map +1 -1
  22. package/cjs/component/data-zoom/interface.d.ts +4 -0
  23. package/cjs/component/data-zoom/interface.js +5 -1
  24. package/cjs/component/data-zoom/interface.js.map +1 -1
  25. package/cjs/component/data-zoom/scroll-bar/interface.d.ts +1 -1
  26. package/cjs/component/data-zoom/scroll-bar/interface.js.map +1 -1
  27. package/cjs/component/data-zoom/scroll-bar/scroll-bar.js.map +1 -1
  28. package/cjs/core/index.d.ts +1 -1
  29. package/cjs/core/index.js +1 -1
  30. package/cjs/core/index.js.map +1 -1
  31. package/cjs/core/interface.d.ts +1 -1
  32. package/cjs/core/interface.js.map +1 -1
  33. package/cjs/core/vchart.d.ts +1 -1
  34. package/cjs/core/vchart.js +4 -4
  35. package/cjs/core/vchart.js.map +1 -1
  36. package/cjs/event/event-dispatcher.js +26 -31
  37. package/cjs/event/event-dispatcher.js.map +1 -1
  38. package/cjs/index-lark.js +2 -2
  39. package/cjs/index-lark.js.map +1 -1
  40. package/cjs/index-wx-simple.js +2 -2
  41. package/cjs/index-wx-simple.js.map +1 -1
  42. package/cjs/interaction/config.js +1 -1
  43. package/cjs/interaction/dimension-trigger.js +1 -1
  44. package/cjs/interaction/index.js +1 -1
  45. package/cjs/interaction/interaction.js +1 -1
  46. package/cjs/layout/base-layout.js +1 -1
  47. package/cjs/layout/index.js +1 -1
  48. package/cjs/layout/interface.js +1 -1
  49. package/cjs/layout/layout-item.js +1 -1
  50. package/cjs/plugin/chart/index.d.ts +1 -0
  51. package/cjs/plugin/chart/index.js +2 -1
  52. package/cjs/plugin/chart/index.js.map +1 -1
  53. package/cjs/region/region.js.map +1 -1
  54. package/cjs/series/area/area.d.ts +1 -0
  55. package/cjs/series/area/area.js +5 -2
  56. package/cjs/series/area/area.js.map +1 -1
  57. package/cjs/series/base/base-series.d.ts +1 -1
  58. package/cjs/series/base/base-series.js +3 -1
  59. package/cjs/series/base/base-series.js.map +1 -1
  60. package/cjs/series/cartesian/cartesian.d.ts +1 -1
  61. package/cjs/series/cartesian/cartesian.js +4 -5
  62. package/cjs/series/cartesian/cartesian.js.map +1 -1
  63. package/cjs/series/funnel/funnel.js +4 -3
  64. package/cjs/series/funnel/funnel.js.map +1 -1
  65. package/cjs/series/interface/series.d.ts +1 -1
  66. package/cjs/series/interface/series.js.map +1 -1
  67. package/cjs/series/mixin/line-mixin.d.ts +1 -0
  68. package/cjs/series/mixin/line-mixin.js +13 -9
  69. package/cjs/series/mixin/line-mixin.js.map +1 -1
  70. package/cjs/series/pie/3d/pie-3d.js +2 -2
  71. package/cjs/series/pie/3d/pie-3d.js.map +1 -1
  72. package/cjs/series/pie/pie-transformer.d.ts +1 -0
  73. package/cjs/series/pie/pie-transformer.js +6 -0
  74. package/cjs/series/pie/pie-transformer.js.map +1 -1
  75. package/cjs/series/pie/pie.d.ts +1 -2
  76. package/cjs/series/pie/pie.js +8 -19
  77. package/cjs/series/pie/pie.js.map +1 -1
  78. package/cjs/series/polar/polar.d.ts +1 -1
  79. package/cjs/series/polar/polar.js +5 -3
  80. package/cjs/series/polar/polar.js.map +1 -1
  81. package/cjs/series/radar/radar.js +1 -1
  82. package/cjs/series/radar/radar.js.map +1 -1
  83. package/cjs/series/range-area/range-area.d.ts +4 -2
  84. package/cjs/series/range-area/range-area.js +20 -23
  85. package/cjs/series/range-area/range-area.js.map +1 -1
  86. package/cjs/series/scatter/scatter.js +3 -3
  87. package/cjs/series/scatter/scatter.js.map +1 -1
  88. package/cjs/vchart-all.js +2 -2
  89. package/cjs/vchart-all.js.map +1 -1
  90. package/esm/chart/base/base-chart-transformer.js +2 -2
  91. package/esm/chart/base/base-chart-transformer.js.map +1 -1
  92. package/esm/chart/polar/polar-transformer.js.map +1 -1
  93. package/esm/chart/sequence/sequence-transformer.js.map +1 -1
  94. package/esm/chart/stack.js +2 -1
  95. package/esm/compile/compiler.js +3 -3
  96. package/esm/compile/compiler.js.map +1 -1
  97. package/esm/compile/grammar-item.js +1 -2
  98. package/esm/component/data-zoom/data-filter-base-component.d.ts +2 -1
  99. package/esm/component/data-zoom/data-filter-base-component.js +4 -3
  100. package/esm/component/data-zoom/data-filter-base-component.js.map +1 -1
  101. package/esm/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
  102. package/esm/component/data-zoom/data-zoom/interface.d.ts +1 -1
  103. package/esm/component/data-zoom/data-zoom/interface.js.map +1 -1
  104. package/esm/component/data-zoom/index.d.ts +1 -0
  105. package/esm/component/data-zoom/index.js +2 -0
  106. package/esm/component/data-zoom/index.js.map +1 -1
  107. package/esm/component/data-zoom/interface.d.ts +4 -0
  108. package/esm/component/data-zoom/interface.js +5 -1
  109. package/esm/component/data-zoom/interface.js.map +1 -1
  110. package/esm/component/data-zoom/scroll-bar/interface.d.ts +1 -1
  111. package/esm/component/data-zoom/scroll-bar/interface.js.map +1 -1
  112. package/esm/component/data-zoom/scroll-bar/scroll-bar.js.map +1 -1
  113. package/esm/core/index.d.ts +1 -1
  114. package/esm/core/index.js +1 -1
  115. package/esm/core/index.js.map +1 -1
  116. package/esm/core/interface.d.ts +1 -1
  117. package/esm/core/interface.js.map +1 -1
  118. package/esm/core/vchart.d.ts +1 -1
  119. package/esm/core/vchart.js +4 -4
  120. package/esm/core/vchart.js.map +1 -1
  121. package/esm/event/event-dispatcher.js +24 -29
  122. package/esm/event/event-dispatcher.js.map +1 -1
  123. package/esm/index-lark.js +1 -3
  124. package/esm/index-lark.js.map +1 -1
  125. package/esm/index-wx-simple.js +1 -3
  126. package/esm/index-wx-simple.js.map +1 -1
  127. package/esm/interaction/config.js +1 -1
  128. package/esm/interaction/dimension-trigger.js +1 -1
  129. package/esm/interaction/index.js +1 -1
  130. package/esm/interaction/interaction.js +1 -1
  131. package/esm/layout/base-layout.js +1 -1
  132. package/esm/layout/index.js +1 -1
  133. package/esm/layout/interface.js +1 -1
  134. package/esm/layout/layout-item.js +1 -1
  135. package/esm/plugin/chart/index.d.ts +1 -0
  136. package/esm/plugin/chart/index.js +2 -0
  137. package/esm/plugin/chart/index.js.map +1 -1
  138. package/esm/region/region.js.map +1 -1
  139. package/esm/series/area/area.d.ts +1 -0
  140. package/esm/series/area/area.js +5 -2
  141. package/esm/series/area/area.js.map +1 -1
  142. package/esm/series/base/base-series.d.ts +1 -1
  143. package/esm/series/base/base-series.js +3 -1
  144. package/esm/series/base/base-series.js.map +1 -1
  145. package/esm/series/cartesian/cartesian.d.ts +1 -1
  146. package/esm/series/cartesian/cartesian.js +3 -3
  147. package/esm/series/cartesian/cartesian.js.map +1 -1
  148. package/esm/series/funnel/funnel.js +4 -3
  149. package/esm/series/funnel/funnel.js.map +1 -1
  150. package/esm/series/interface/series.d.ts +1 -1
  151. package/esm/series/interface/series.js.map +1 -1
  152. package/esm/series/mixin/line-mixin.d.ts +1 -0
  153. package/esm/series/mixin/line-mixin.js +13 -9
  154. package/esm/series/mixin/line-mixin.js.map +1 -1
  155. package/esm/series/pie/3d/pie-3d.js +2 -2
  156. package/esm/series/pie/3d/pie-3d.js.map +1 -1
  157. package/esm/series/pie/pie-transformer.d.ts +1 -0
  158. package/esm/series/pie/pie-transformer.js +7 -1
  159. package/esm/series/pie/pie-transformer.js.map +1 -1
  160. package/esm/series/pie/pie.d.ts +1 -2
  161. package/esm/series/pie/pie.js +8 -19
  162. package/esm/series/pie/pie.js.map +1 -1
  163. package/esm/series/polar/polar.d.ts +1 -1
  164. package/esm/series/polar/polar.js +4 -2
  165. package/esm/series/polar/polar.js.map +1 -1
  166. package/esm/series/radar/radar.js +1 -1
  167. package/esm/series/radar/radar.js.map +1 -1
  168. package/esm/series/range-area/range-area.d.ts +4 -2
  169. package/esm/series/range-area/range-area.js +20 -24
  170. package/esm/series/range-area/range-area.js.map +1 -1
  171. package/esm/series/scatter/scatter.js +3 -3
  172. package/esm/series/scatter/scatter.js.map +1 -1
  173. package/esm/vchart-all.js +1 -3
  174. package/esm/vchart-all.js.map +1 -1
  175. package/package.json +3 -4
  176. package/cjs/component/data-zoom/constant.d.ts +0 -4
  177. package/cjs/component/data-zoom/constant.js +0 -10
  178. package/cjs/component/data-zoom/constant.js.map +0 -1
  179. package/esm/component/data-zoom/constant.d.ts +0 -4
  180. package/esm/component/data-zoom/constant.js +0 -6
  181. package/esm/component/data-zoom/constant.js.map +0 -1
package/build/index.js CHANGED
@@ -54099,6 +54099,36 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
54099
54099
  this._viewListeners = new Map();
54100
54100
  this._windowListeners = new Map();
54101
54101
  this._canvasListeners = new Map();
54102
+ this._onDelegate = (listenerParams) => {
54103
+ var _a;
54104
+ const chart = this.globalInstance.getChart();
54105
+ const model = (isValid$3(listenerParams.modelId) && (chart === null || chart === void 0 ? void 0 : chart.getModelById(listenerParams.modelId))) || undefined;
54106
+ const mark = (isValid$3(listenerParams.markId) && (chart === null || chart === void 0 ? void 0 : chart.getMarkById(listenerParams.markId))) || null;
54107
+ const itemMap = new Map();
54108
+ let targetMark = (_a = listenerParams.item) === null || _a === void 0 ? void 0 : _a.mark;
54109
+ if (targetMark && isValid$3(targetMark.id())) {
54110
+ itemMap.set(targetMark.id(), listenerParams.item);
54111
+ }
54112
+ while (targetMark === null || targetMark === void 0 ? void 0 : targetMark.elements) {
54113
+ const id = targetMark.id();
54114
+ if (isValid$3(id) && !itemMap.has(id)) {
54115
+ itemMap.set(id, targetMark.elements[0]);
54116
+ }
54117
+ targetMark = targetMark.group;
54118
+ }
54119
+ const params = {
54120
+ event: listenerParams.event,
54121
+ item: listenerParams.item,
54122
+ datum: listenerParams.datum,
54123
+ source: listenerParams.source,
54124
+ itemMap,
54125
+ chart,
54126
+ model,
54127
+ mark: mark !== null && mark !== void 0 ? mark : undefined,
54128
+ node: get$1(listenerParams.event, 'target')
54129
+ };
54130
+ this.dispatch(listenerParams.type, params);
54131
+ };
54102
54132
  this.globalInstance = vchart;
54103
54133
  this._compiler = compiler;
54104
54134
  }
@@ -54113,9 +54143,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
54113
54143
  const bubble = bubbles.get(eType);
54114
54144
  bubble.addHandler(handler, (_c = handler.filter) === null || _c === void 0 ? void 0 : _c.level);
54115
54145
  if (this._isValidEvent(eType) && !listeners.has(eType)) {
54116
- const callback = this._onDelegate.bind(this);
54117
- this._compiler.addEventListener((_d = handler.filter) === null || _d === void 0 ? void 0 : _d.source, eType, callback);
54118
- listeners.set(eType, callback);
54146
+ this._compiler.addEventListener((_d = handler.filter) === null || _d === void 0 ? void 0 : _d.source, eType, this._onDelegate);
54147
+ listeners.set(eType, this._onDelegate);
54119
54148
  }
54120
54149
  return this;
54121
54150
  }
@@ -54246,36 +54275,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
54246
54275
  }
54247
54276
  return Object.assign({}, params);
54248
54277
  }
54249
- _onDelegate(listenerParams) {
54250
- var _a;
54251
- const chart = this.globalInstance.getChart();
54252
- const model = (isValid$3(listenerParams.modelId) && (chart === null || chart === void 0 ? void 0 : chart.getModelById(listenerParams.modelId))) || undefined;
54253
- const mark = (isValid$3(listenerParams.markId) && (chart === null || chart === void 0 ? void 0 : chart.getMarkById(listenerParams.markId))) || null;
54254
- const itemMap = new Map();
54255
- let targetMark = (_a = listenerParams.item) === null || _a === void 0 ? void 0 : _a.mark;
54256
- if (targetMark && isValid$3(targetMark.id())) {
54257
- itemMap.set(targetMark.id(), listenerParams.item);
54258
- }
54259
- while (targetMark === null || targetMark === void 0 ? void 0 : targetMark.elements) {
54260
- const id = targetMark.id();
54261
- if (isValid$3(id) && !itemMap.has(id)) {
54262
- itemMap.set(id, targetMark.elements[0]);
54263
- }
54264
- targetMark = targetMark.group;
54265
- }
54266
- const params = {
54267
- event: listenerParams.event,
54268
- item: listenerParams.item,
54269
- datum: listenerParams.datum,
54270
- source: listenerParams.source,
54271
- itemMap,
54272
- chart,
54273
- model,
54274
- mark: mark !== null && mark !== void 0 ? mark : undefined,
54275
- node: get$1(listenerParams.event, 'target')
54276
- };
54277
- this.dispatch(listenerParams.type, params);
54278
- }
54279
54278
  _invoke(handlers, type, params) {
54280
54279
  const result = handlers.map(handler => {
54281
54280
  var _a, _b, _c;
@@ -54895,7 +54894,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
54895
54894
  }
54896
54895
  }
54897
54896
  removeEventListener(source, type, callback) {
54898
- var _a, _b, _c, _d;
54897
+ var _a, _b, _c, _d, _e;
54899
54898
  if (this._option.interactive === false) {
54900
54899
  return;
54901
54900
  }
@@ -54911,9 +54910,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
54911
54910
  this._windowListeners.delete(callback);
54912
54911
  }
54913
54912
  else if (source === exports.Event_Source_Type.canvas) {
54914
- const canvasObject = this._getGlobalThis();
54915
- const wrappedCallback = (_d = this._canvasListeners.get(callback)) === null || _d === void 0 ? void 0 : _d.callback;
54916
- wrappedCallback && (canvasObject === null || canvasObject === void 0 ? void 0 : canvasObject.removeEventListener(type, wrappedCallback));
54913
+ const canvasObject = (_d = this.getStage()) === null || _d === void 0 ? void 0 : _d.window;
54914
+ const wrappedCallback = (_e = this._canvasListeners.get(callback)) === null || _e === void 0 ? void 0 : _e.callback;
54915
+ canvasObject && wrappedCallback && (canvasObject === null || canvasObject === void 0 ? void 0 : canvasObject.removeEventListener(type, wrappedCallback));
54917
54916
  this._canvasListeners.delete(callback);
54918
54917
  }
54919
54918
  }
@@ -59206,9 +59205,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
59206
59205
  this._chartPluginApply('releaseAll');
59207
59206
  this._chartPlugin = null;
59208
59207
  this._chartSpecTransformer = null;
59209
- (_b = this._chart) === null || _b === void 0 ? void 0 : _b.release();
59210
- (_c = this._compiler) === null || _c === void 0 ? void 0 : _c.release();
59211
- (_d = this._eventDispatcher) === null || _d === void 0 ? void 0 : _d.release();
59208
+ (_b = this._eventDispatcher) === null || _b === void 0 ? void 0 : _b.release();
59209
+ (_c = this._chart) === null || _c === void 0 ? void 0 : _c.release();
59210
+ (_d = this._compiler) === null || _d === void 0 ? void 0 : _d.release();
59212
59211
  this._unBindResizeEvent();
59213
59212
  this._releaseData();
59214
59213
  this._onError = null;
@@ -59791,7 +59790,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
59791
59790
  var _a, _b, _c;
59792
59791
  (_c = (_b = (_a = this._compiler) === null || _a === void 0 ? void 0 : _a.getVGrammarView()) === null || _b === void 0 ? void 0 : _b.animate) === null || _c === void 0 ? void 0 : _c.resume();
59793
59792
  }
59794
- convertDatumToPosition(datum, dataLinkInfo = {}, isRelativeToCanvas = false) {
59793
+ convertDatumToPosition(datum, dataLinkInfo = {}, isRelativeToCanvas = false, checkInViewData) {
59795
59794
  var _a;
59796
59795
  if (!this._chart) {
59797
59796
  return null;
@@ -59815,10 +59814,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
59815
59814
  const seriesLayoutStartPoint = series.getRegion().getLayoutStartPoint();
59816
59815
  let point;
59817
59816
  if (handledDatum) {
59818
- point = series.dataToPosition(handledDatum, true);
59817
+ point = series.dataToPosition(handledDatum, checkInViewData);
59819
59818
  }
59820
59819
  else {
59821
- point = series.dataToPosition(datum, true);
59820
+ point = series.dataToPosition(datum, checkInViewData);
59822
59821
  }
59823
59822
  if (!point) {
59824
59823
  return null;
@@ -60326,6 +60325,128 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
60326
60325
  registerChartPlugin(MediaQuery);
60327
60326
  };
60328
60327
 
60328
+ const bracketReg = /\{([^}]+)\}/;
60329
+ const bracketGReg = /\{([^}]+)\}/g;
60330
+ const semicolonReg = /:/;
60331
+ class FormatterPlugin extends BasePlugin {
60332
+ constructor() {
60333
+ super(FormatterPlugin.type);
60334
+ this.type = 'formatterPlugin';
60335
+ this._timeModeFormat = {
60336
+ utc: TimeUtil.getInstance().timeUTCFormat,
60337
+ local: TimeUtil.getInstance().timeFormat
60338
+ };
60339
+ this._formatter = this._format;
60340
+ this._timeFormatter = this._timeModeFormat.local;
60341
+ this._numericFormatter = NumberUtil.getInstance().format;
60342
+ this._numericSpecifier = NumberUtil.getInstance().formatter;
60343
+ this._numericFormatterCache = new Map();
60344
+ this._isNumericFormatterCache = new Map();
60345
+ }
60346
+ onInit(service, chartSpec) {
60347
+ var _a;
60348
+ const { globalInstance } = service;
60349
+ if (!globalInstance) {
60350
+ return;
60351
+ }
60352
+ this._spec = (_a = chartSpec === null || chartSpec === void 0 ? void 0 : chartSpec[FormatterPlugin.specKey]) !== null && _a !== void 0 ? _a : {};
60353
+ const { timeMode, customFormatter, numericFormatter, timeFormatter } = this._spec;
60354
+ if (isFunction$1(customFormatter)) {
60355
+ this._formatter = customFormatter;
60356
+ }
60357
+ else {
60358
+ this._formatter = this._format.bind(this);
60359
+ if (isFunction$1(timeFormatter)) {
60360
+ this._timeFormatter = timeFormatter;
60361
+ }
60362
+ else if (timeMode && this._timeModeFormat[timeMode]) {
60363
+ this._timeFormatter = this._timeModeFormat[timeMode];
60364
+ }
60365
+ if (numericFormatter) {
60366
+ this._numericFormatter = numericFormatter;
60367
+ this._numericSpecifier = null;
60368
+ this._numericFormatterCache = null;
60369
+ }
60370
+ }
60371
+ Factory.registerFormatter(this._formatter);
60372
+ }
60373
+ _format(text, datum, formatter) {
60374
+ if (isArray$3(text)) {
60375
+ return text.map((t, i) => {
60376
+ const f = isArray$3(formatter) ? formatter[i] : formatter;
60377
+ return f ? this._formatSingleLine(t, datum, f) : t;
60378
+ });
60379
+ }
60380
+ if (isArray$3(formatter)) {
60381
+ return formatter.map(f => this._formatSingleLine(text, datum, f));
60382
+ }
60383
+ return this._formatSingleLine(text, datum, formatter);
60384
+ }
60385
+ _formatSingleLine(text, datum, formatter) {
60386
+ let isTemplate;
60387
+ if (this._isNumericFormatterCache) {
60388
+ if (this._isNumericFormatterCache.get(formatter)) {
60389
+ isTemplate = this._isNumericFormatterCache.get(formatter);
60390
+ }
60391
+ else {
60392
+ isTemplate = bracketReg.test(formatter);
60393
+ this._isNumericFormatterCache.set(formatter, isTemplate);
60394
+ }
60395
+ }
60396
+ if (isTemplate) {
60397
+ const result = formatter.replace(bracketGReg, (match, key) => {
60398
+ const hasFormatter = semicolonReg.test(key);
60399
+ if (!hasFormatter) {
60400
+ const value = datum[key.trim()];
60401
+ return typeof value !== 'undefined' ? value : match;
60402
+ }
60403
+ const parts = key.split(':');
60404
+ const value = datum[parts.shift()];
60405
+ const valueFormatter = parts.join(':');
60406
+ return this._formatSingleText(value, valueFormatter);
60407
+ });
60408
+ return result;
60409
+ }
60410
+ return this._formatSingleText(text, formatter);
60411
+ }
60412
+ _formatSingleText(text, formatter) {
60413
+ const isNumeric = numberSpecifierReg.test(formatter);
60414
+ if (isNumeric && this._numericFormatter) {
60415
+ let numericFormat;
60416
+ if (this._numericFormatterCache && this._numericSpecifier) {
60417
+ if (this._numericFormatterCache.get(formatter)) {
60418
+ numericFormat = this._numericFormatterCache.get(formatter);
60419
+ }
60420
+ else {
60421
+ numericFormat = this._numericSpecifier(formatter);
60422
+ this._numericFormatterCache.set(formatter, numericFormat);
60423
+ }
60424
+ return numericFormat(Number(text));
60425
+ }
60426
+ return this._numericFormatter(formatter, Number(text));
60427
+ }
60428
+ else if (formatter.includes('%') && this._timeFormatter) {
60429
+ return this._timeFormatter(formatter, text);
60430
+ }
60431
+ return text;
60432
+ }
60433
+ release() {
60434
+ super.release();
60435
+ this._format = null;
60436
+ this._timeFormatter = null;
60437
+ this._numericFormatter = null;
60438
+ this._numericSpecifier = null;
60439
+ this._numericFormatterCache = null;
60440
+ this._isNumericFormatterCache = null;
60441
+ }
60442
+ }
60443
+ FormatterPlugin.pluginType = 'chart';
60444
+ FormatterPlugin.specKey = 'formatter';
60445
+ FormatterPlugin.type = 'formatterPlugin';
60446
+ const registerFormatPlugin = () => {
60447
+ registerChartPlugin(FormatterPlugin);
60448
+ };
60449
+
60329
60450
  function isValidAlignDomain(domain) {
60330
60451
  return domain.length === 2 && isValidNumber$1(domain[0]) && isValidNumber$1(domain[1]) && domain[1] >= domain[0];
60331
60452
  }
@@ -64065,7 +64186,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
64065
64186
  registerComponentPlugin(CanvasTooltipHandler);
64066
64187
  };
64067
64188
 
64068
- const version = "1.10.1-alpha.0";
64189
+ const version = "1.10.1";
64069
64190
 
64070
64191
  const addVChartProperty = (data, op) => {
64071
64192
  const context = op.beforeCall();
@@ -64708,7 +64829,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
64708
64829
  this._data = null;
64709
64830
  this.layoutZIndex = 0;
64710
64831
  this._invalidType = 'break';
64711
- this._getInvalidDefined = (datum) => couldBeValidNumber(datum[this.getStackValueField()]);
64712
64832
  this._region = options.region;
64713
64833
  this._dataSet = options.dataSet;
64714
64834
  ((_a = this._spec) === null || _a === void 0 ? void 0 : _a.name) && (this.name = this._spec.name);
@@ -65586,6 +65706,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
65586
65706
  _getInvalidConnectType() {
65587
65707
  return this._invalidType === 'zero' ? 'zero' : this._invalidType === 'link' ? 'connect' : 'none';
65588
65708
  }
65709
+ _getInvalidDefined(datum) {
65710
+ return couldBeValidNumber(datum[this.getStackValueField()]);
65711
+ }
65589
65712
  _getRelatedComponentSpecInfo(specKey) {
65590
65713
  var _a;
65591
65714
  const specIndex = this.getSpecIndex();
@@ -65679,20 +65802,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
65679
65802
  this._setPositionYEncoder = (encoder) => {
65680
65803
  this._positionYEncoder = encoder.bind(this);
65681
65804
  };
65682
- this._getInvalidDefined = (datum) => {
65683
- var _a, _b;
65684
- if ((_a = this._xAxisHelper) === null || _a === void 0 ? void 0 : _a.isContinuous) {
65685
- if (!couldBeValidNumber(datum[this._specXField[0]])) {
65686
- return false;
65687
- }
65688
- }
65689
- if ((_b = this._yAxisHelper) === null || _b === void 0 ? void 0 : _b.isContinuous) {
65690
- if (!couldBeValidNumber(datum[this._specYField[0]])) {
65691
- return false;
65692
- }
65693
- }
65694
- return true;
65695
- };
65696
65805
  }
65697
65806
  _buildScaleConfig() {
65698
65807
  this._scaleConfig = {
@@ -66079,6 +66188,19 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
66079
66188
  (_c = this._data) === null || _c === void 0 ? void 0 : _c.updateData(true);
66080
66189
  }
66081
66190
  }
66191
+ _getInvalidDefined(datum) {
66192
+ if (this._xAxisHelper && this._xAxisHelper.isContinuous) {
66193
+ if (!couldBeValidNumber(datum[this._specXField[0]])) {
66194
+ return false;
66195
+ }
66196
+ }
66197
+ if (this._yAxisHelper && this._yAxisHelper.isContinuous) {
66198
+ if (!couldBeValidNumber(datum[this._specYField[0]])) {
66199
+ return false;
66200
+ }
66201
+ }
66202
+ return true;
66203
+ }
66082
66204
  reInit(spec) {
66083
66205
  if (this._positionXEncoder) {
66084
66206
  this._positionXEncoder = null;
@@ -66153,7 +66275,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
66153
66275
  }, 'normal', exports.AttributeLevel.Series);
66154
66276
  if (this._invalidType !== 'zero') {
66155
66277
  this.setMarkStyle(lineMark, {
66156
- defined: this._getInvalidDefined,
66278
+ defined: this._getInvalidDefined.bind(this),
66157
66279
  connectedType: this._getInvalidConnectType()
66158
66280
  }, 'normal', exports.AttributeLevel.Series);
66159
66281
  }
@@ -66277,7 +66399,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
66277
66399
  }, 'normal', exports.AttributeLevel.Series);
66278
66400
  if (this._invalidType !== 'zero') {
66279
66401
  this.setMarkStyle(symbolMark, {
66280
- visible: this._getInvalidDefined
66402
+ visible: this._getInvalidDefined.bind(this)
66281
66403
  }, 'normal', exports.AttributeLevel.Series);
66282
66404
  }
66283
66405
  this.event.on(exports.ChartEvent.viewDataStatisticsUpdate, { filter: param => param.model === this }, () => {
@@ -66323,7 +66445,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
66323
66445
  });
66324
66446
  if (this._invalidType !== 'zero') {
66325
66447
  this.setMarkStyle(labelMark, {
66326
- visible: this._getInvalidDefined
66448
+ visible: this._getInvalidDefined.bind(this)
66327
66449
  }, 'normal', exports.AttributeLevel.Series);
66328
66450
  }
66329
66451
  this.event.on(exports.ChartEvent.viewDataStatisticsUpdate, { filter: param => param.model === this }, () => {
@@ -66343,27 +66465,35 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
66343
66465
  });
66344
66466
  }
66345
66467
  encodeDefined(mark, attr) {
66346
- var _a, _b, _c, _d, _e, _f;
66468
+ var _a, _b, _c, _d;
66347
66469
  if (!mark) {
66348
66470
  return;
66349
66471
  }
66350
- const statistics = (_b = (_a = this.getViewDataStatistics()) === null || _a === void 0 ? void 0 : _a.latestData) === null || _b === void 0 ? void 0 : _b[this.getStackValueField()];
66351
- if (this._invalidType === 'zero' || (statistics && (statistics === null || statistics === void 0 ? void 0 : statistics.allValid))) {
66352
- if (((_d = (_c = mark.stateStyle.normal) === null || _c === void 0 ? void 0 : _c[attr]) === null || _d === void 0 ? void 0 : _d.style) === true) {
66472
+ const allValid = this._isFieldAllValid();
66473
+ if (this._invalidType === 'zero' || allValid) {
66474
+ if (((_b = (_a = mark.stateStyle.normal) === null || _a === void 0 ? void 0 : _a[attr]) === null || _b === void 0 ? void 0 : _b.style) === true) {
66353
66475
  return;
66354
66476
  }
66355
66477
  this.setMarkStyle(mark, { [attr]: true }, 'normal', exports.AttributeLevel.Series);
66356
66478
  }
66357
66479
  else {
66358
- if (((_f = (_e = mark.stateStyle.normal) === null || _e === void 0 ? void 0 : _e[attr]) === null || _f === void 0 ? void 0 : _f.style) !== true) {
66480
+ if (((_d = (_c = mark.stateStyle.normal) === null || _c === void 0 ? void 0 : _c[attr]) === null || _d === void 0 ? void 0 : _d.style) !== true) {
66359
66481
  return;
66360
66482
  }
66361
- this.setMarkStyle(mark, { [attr]: this._getInvalidDefined }, 'normal', exports.AttributeLevel.Series);
66483
+ this.setMarkStyle(mark, { [attr]: this._getInvalidDefined.bind(this) }, 'normal', exports.AttributeLevel.Series);
66362
66484
  }
66363
66485
  if (mark.getProduct()) {
66364
66486
  mark.compileEncode();
66365
66487
  }
66366
66488
  }
66489
+ _isFieldAllValid() {
66490
+ const viewStatistics = this.getViewDataStatistics();
66491
+ const field = this.getStackValueField();
66492
+ if (viewStatistics && viewStatistics.latestData && field) {
66493
+ return viewStatistics.latestData[field] && viewStatistics.latestData[field].allValid;
66494
+ }
66495
+ return false;
66496
+ }
66367
66497
  }
66368
66498
 
66369
66499
  class BaseLineMark extends BaseMark {
@@ -67929,7 +68059,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
67929
68059
  if (!chartSpec.region || chartSpec.region.length === 0) {
67930
68060
  chartSpec.region = [{}];
67931
68061
  }
67932
- if (!has$1(chartSpec, 'tooltip')) {
68062
+ if (chartSpec.tooltip === undefined) {
67933
68063
  chartSpec.tooltip = {};
67934
68064
  }
67935
68065
  if (isValid$3(chartSpec.stackInverse)) {
@@ -68417,6 +68547,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
68417
68547
  this.initSymbolMark(progressive, seriesMark === 'point');
68418
68548
  }
68419
68549
  initMarkStyle() {
68550
+ this.initAreaMarkStyle();
68551
+ this.initSymbolMarkStyle();
68552
+ }
68553
+ initAreaMarkStyle() {
68420
68554
  var _a, _b, _c, _d, _e;
68421
68555
  const userCurveType = ((_c = (_b = (_a = this.getSpec().area) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.curveType) !== null && _c !== void 0 ? _c : (_e = (_d = this.getSpec().line) === null || _d === void 0 ? void 0 : _d.style) === null || _e === void 0 ? void 0 : _e.curveType);
68422
68556
  const curveType = userCurveType === DEFAULT_SMOOTH_INTERPOLATE
@@ -68455,7 +68589,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
68455
68589
  }, 'normal', exports.AttributeLevel.Series);
68456
68590
  if (this._invalidType !== 'zero') {
68457
68591
  this.setMarkStyle(areaMark, {
68458
- defined: this._getInvalidDefined,
68592
+ defined: this._getInvalidDefined.bind(this),
68459
68593
  connectedType: this._getInvalidConnectType()
68460
68594
  }, 'normal', exports.AttributeLevel.Series);
68461
68595
  }
@@ -68470,8 +68604,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
68470
68604
  }
68471
68605
  });
68472
68606
  }
68473
- this.initLineMarkStyle(this._direction, userCurveType);
68474
- this.initSymbolMarkStyle();
68475
68607
  }
68476
68608
  initAnimation() {
68477
68609
  var _a, _b, _c, _d;
@@ -69614,7 +69746,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
69614
69746
  }
69615
69747
  if (this._invalidType !== 'zero') {
69616
69748
  this.setMarkStyle(symbolMark, {
69617
- visible: this._getInvalidDefined
69749
+ visible: this._getInvalidDefined.bind(this)
69618
69750
  });
69619
69751
  }
69620
69752
  this.setMarkStyle(symbolMark, {
@@ -69648,7 +69780,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
69648
69780
  this.setMarkStyle(this._symbolMark, { visible: true }, 'normal', exports.AttributeLevel.Series);
69649
69781
  }
69650
69782
  else {
69651
- this.setMarkStyle(this._symbolMark, { visible: this._getInvalidDefined }, 'normal', exports.AttributeLevel.Series);
69783
+ this.setMarkStyle(this._symbolMark, { visible: this._getInvalidDefined.bind(this) }, 'normal', exports.AttributeLevel.Series);
69652
69784
  }
69653
69785
  }
69654
69786
  initLabelMarkStyle(labelMark) {
@@ -69665,7 +69797,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
69665
69797
  }, STATE_VALUE_ENUM.STATE_NORMAL, exports.AttributeLevel.Series);
69666
69798
  if (this._invalidType !== 'zero') {
69667
69799
  this.setMarkStyle(labelMark, {
69668
- visible: this._getInvalidDefined
69800
+ visible: this._getInvalidDefined.bind(this)
69669
69801
  }, STATE_VALUE_ENUM.STATE_NORMAL, exports.AttributeLevel.Series);
69670
69802
  }
69671
69803
  }
@@ -72896,28 +73028,25 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
72896
73028
  this.type = exports.SeriesTypeEnum.rangeArea;
72897
73029
  }
72898
73030
  initMark() {
72899
- var _a, _b;
73031
+ var _a;
73032
+ const { customShape, stateSort } = (_a = this._spec.area) !== null && _a !== void 0 ? _a : {};
72900
73033
  this._areaMark = this._createMark(RangeAreaSeries.mark.area, {
72901
73034
  defaultMorphElementKey: this.getDimensionField()[0],
72902
73035
  groupKey: this._seriesField,
72903
73036
  isSeriesMark: true,
72904
- customShape: (_a = this._spec.area) === null || _a === void 0 ? void 0 : _a.customShape,
72905
- stateSort: (_b = this._spec.area) === null || _b === void 0 ? void 0 : _b.stateSort
73037
+ customShape,
73038
+ stateSort
72906
73039
  });
72907
73040
  }
72908
73041
  initMarkStyle() {
72909
- var _a, _b, _c, _d, _e;
72910
- const userCurveType = (_c = (_b = (_a = this.getSpec().area) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.curveType) !== null && _c !== void 0 ? _c : (_e = (_d = this.getSpec().line) === null || _d === void 0 ? void 0 : _d.style) === null || _e === void 0 ? void 0 : _e.curveType;
72911
- const curveType = userCurveType === DEFAULT_SMOOTH_INTERPOLATE
72912
- ? this._direction === "horizontal"
72913
- ? 'monotoneY'
72914
- : 'monotoneX'
72915
- : userCurveType;
73042
+ this.initAreaMarkStyle();
73043
+ }
73044
+ initAreaMarkStyle() {
72916
73045
  const areaMark = this._areaMark;
72917
73046
  if (areaMark) {
73047
+ super.initAreaMarkStyle();
72918
73048
  if (this._direction === "horizontal") {
72919
73049
  this.setMarkStyle(this._areaMark, {
72920
- x: this.dataToPositionX.bind(this),
72921
73050
  x1: (datum) => {
72922
73051
  if (!this._xAxisHelper) {
72923
73052
  return Number.NaN;
@@ -72926,14 +73055,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
72926
73055
  return dataToPosition(this.getDatumPositionValues(datum, this._spec.xField[1]), {
72927
73056
  bandPosition: this._bandPosition
72928
73057
  });
72929
- },
72930
- y: this.dataToPositionY.bind(this),
72931
- orient: this._direction
73058
+ }
72932
73059
  }, 'normal', exports.AttributeLevel.Series);
72933
73060
  }
72934
73061
  else {
72935
73062
  this.setMarkStyle(this._areaMark, {
72936
- x: this.dataToPositionX.bind(this),
72937
73063
  y1: (datum) => {
72938
73064
  if (!this._yAxisHelper) {
72939
73065
  return Number.NaN;
@@ -72942,32 +73068,34 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
72942
73068
  return dataToPosition(this.getDatumPositionValues(datum, this._spec.yField[1]), {
72943
73069
  bandPosition: this._bandPosition
72944
73070
  });
72945
- },
72946
- y: this.dataToPositionY.bind(this)
72947
- }, 'normal', exports.AttributeLevel.Series);
72948
- }
72949
- this.setMarkStyle(areaMark, {
72950
- fill: this.getColorAttribute(),
72951
- stroke: false
72952
- }, 'normal', exports.AttributeLevel.Series);
72953
- if (this._invalidType !== 'zero') {
72954
- this.setMarkStyle(areaMark, {
72955
- defined: this._getInvalidDefined,
72956
- connectedType: this._getInvalidConnectType()
73071
+ }
72957
73072
  }, 'normal', exports.AttributeLevel.Series);
72958
73073
  }
72959
- this.setMarkStyle(areaMark, {
72960
- curveType
72961
- }, 'normal', exports.AttributeLevel.Built_In);
73074
+ this.setMarkStyle(areaMark, { stroke: false }, 'normal', exports.AttributeLevel.Series);
72962
73075
  }
72963
73076
  }
72964
73077
  initTooltip() {
72965
73078
  this._tooltipHelper = new RangeAreaSeriesTooltipHelper(this);
72966
73079
  this._areaMark && this._tooltipHelper.activeTriggerSet.dimension.add(this._areaMark);
72967
73080
  }
72968
- viewDataStatisticsUpdate(d) {
72969
- super.viewDataStatisticsUpdate(d);
72970
- this.encodeDefined(this._areaMark, 'defined');
73081
+ _isFieldAllValid() {
73082
+ const viewStatistics = this.getViewDataStatistics();
73083
+ const fields = this.fieldY;
73084
+ if (viewStatistics && viewStatistics.latestData && fields.length) {
73085
+ return fields.every(field => viewStatistics.latestData[field] && viewStatistics.latestData[field].allValid);
73086
+ }
73087
+ return false;
73088
+ }
73089
+ _getInvalidDefined(datum) {
73090
+ if (!super._getInvalidDefined(datum)) {
73091
+ return false;
73092
+ }
73093
+ if (this._yAxisHelper && this._yAxisHelper.isContinuous) {
73094
+ if (!couldBeValidNumber(datum[this._specYField[1]])) {
73095
+ return false;
73096
+ }
73097
+ }
73098
+ return true;
72971
73099
  }
72972
73100
  }
72973
73101
  RangeAreaSeries.type = exports.SeriesTypeEnum.rangeArea;
@@ -72986,19 +73114,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
72986
73114
  this._angleField = [];
72987
73115
  this._radiusField = [];
72988
73116
  this._sortDataByAxis = false;
72989
- this._getInvalidDefined = (datum) => {
72990
- if (this.angleAxisHelper.isContinuous) {
72991
- if (!couldBeValidNumber(datum[this._angleField[0]])) {
72992
- return false;
72993
- }
72994
- }
72995
- if (this.radiusAxisHelper.isContinuous) {
72996
- if (!couldBeValidNumber(datum[this._radiusField[0]])) {
72997
- return false;
72998
- }
72999
- }
73000
- return true;
73001
- };
73002
73117
  }
73003
73118
  get outerRadius() {
73004
73119
  return this._outerRadius;
@@ -73167,6 +73282,19 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
73167
73282
  sortDataInAxisHelper(this.angleAxisHelper, this._angleField[0], this.getViewData().latestData);
73168
73283
  }
73169
73284
  }
73285
+ _getInvalidDefined(datum) {
73286
+ if (this.angleAxisHelper.isContinuous) {
73287
+ if (!couldBeValidNumber(datum[this._angleField[0]])) {
73288
+ return false;
73289
+ }
73290
+ }
73291
+ if (this.radiusAxisHelper.isContinuous) {
73292
+ if (!couldBeValidNumber(datum[this._radiusField[0]])) {
73293
+ return false;
73294
+ }
73295
+ }
73296
+ return true;
73297
+ }
73170
73298
  }
73171
73299
 
73172
73300
  function transformInvalidValue(value) {
@@ -73451,9 +73579,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
73451
73579
  if (position === 'inside') {
73452
73580
  return mergeSpec({}, this._theme.innerLabel, label);
73453
73581
  }
73454
- else {
73455
- return mergeSpec({}, this._theme.outerLabel, label);
73456
- }
73582
+ return mergeSpec({}, this._theme.outerLabel, label);
73457
73583
  };
73458
73584
  if (isArray$3(newSpec.label)) {
73459
73585
  newSpec.label = newSpec.label.map(label => getMergedLabelSpec(label.position, label));
@@ -73464,6 +73590,18 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
73464
73590
  }
73465
73591
  return { spec: newSpec, theme };
73466
73592
  }
73593
+ _getDefaultSpecFromChart(chartSpec) {
73594
+ var _a;
73595
+ const spec = (_a = super._getDefaultSpecFromChart(chartSpec)) !== null && _a !== void 0 ? _a : {};
73596
+ const { centerX, centerY } = chartSpec;
73597
+ if (isValid$3(centerX)) {
73598
+ spec.centerX = centerX;
73599
+ }
73600
+ if (isValid$3(centerY)) {
73601
+ spec.centerY = centerY;
73602
+ }
73603
+ return Object.keys(spec).length > 0 ? spec : undefined;
73604
+ }
73467
73605
  }
73468
73606
 
73469
73607
  class BasePieSeries extends PolarSeries {
@@ -73489,21 +73627,20 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
73489
73627
  return { x: center.x + delta.x, y: center.y + delta.y };
73490
73628
  };
73491
73629
  }
73492
- get center() {
73630
+ getCenter() {
73493
73631
  var _a, _b, _c, _d;
73632
+ const { width, height } = this._region.getLayoutRect();
73494
73633
  return {
73495
- x: (_b = (_a = this._spec) === null || _a === void 0 ? void 0 : _a.centerX) !== null && _b !== void 0 ? _b : this._region.getLayoutRect().width / 2,
73496
- y: (_d = (_c = this._spec) === null || _c === void 0 ? void 0 : _c.centerY) !== null && _d !== void 0 ? _d : this._region.getLayoutRect().height / 2
73634
+ x: (_b = (_a = this._spec) === null || _a === void 0 ? void 0 : _a.centerX) !== null && _b !== void 0 ? _b : width / 2,
73635
+ y: (_d = (_c = this._spec) === null || _c === void 0 ? void 0 : _c.centerY) !== null && _d !== void 0 ? _d : height / 2
73497
73636
  };
73498
73637
  }
73499
73638
  _buildMarkAttributeContext() {
73500
73639
  super._buildMarkAttributeContext();
73501
- this._markAttributeContext.getCenter = () => {
73502
- return {
73503
- x: () => { var _a, _b; return (_b = (_a = this._center) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : this._region.getLayoutRect().width / 2; },
73504
- y: () => { var _a, _b; return (_b = (_a = this._center) === null || _a === void 0 ? void 0 : _a.y) !== null && _b !== void 0 ? _b : this._region.getLayoutRect().height / 2; }
73505
- };
73506
- };
73640
+ this._markAttributeContext.getCenter = () => ({
73641
+ x: () => this.getCenter().x,
73642
+ y: () => this.getCenter().y
73643
+ });
73507
73644
  this._markAttributeContext.startAngleScale = (datum) => this.startAngleScale(datum);
73508
73645
  this._markAttributeContext.endAngleScale = (datum) => this.endAngleScale(datum);
73509
73646
  }
@@ -73576,8 +73713,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
73576
73713
  const pieMark = this._pieMark;
73577
73714
  if (pieMark) {
73578
73715
  this.setMarkStyle(pieMark, {
73579
- x: () => { var _a, _b; return (_b = (_a = this._center) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : this._region.getLayoutRect().width / 2; },
73580
- y: () => { var _a, _b; return (_b = (_a = this._center) === null || _a === void 0 ? void 0 : _a.y) !== null && _b !== void 0 ? _b : this._region.getLayoutRect().height / 2; },
73716
+ x: () => this.getCenter().x,
73717
+ y: () => this.getCenter().y,
73581
73718
  fill: this.getColorAttribute(),
73582
73719
  outerRadius: isSpecValueWithScale(this._outerRadius)
73583
73720
  ? this._outerRadius
@@ -73857,10 +73994,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
73857
73994
  textMark.setSupport3d(true);
73858
73995
  params3d.beta = this._angle3d;
73859
73996
  params3d.anchor3d = (datum) => {
73860
- var _a, _b, _c, _d;
73997
+ const { x, y } = this.getCenter();
73861
73998
  const anchor = [
73862
- (_b = (_a = this._center) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : this._region.getLayoutRect().width / 2,
73863
- (_d = (_c = this._center) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : this._region.getLayoutRect().height / 2
73999
+ x,
74000
+ y
73864
74001
  ];
73865
74002
  return anchor;
73866
74003
  };
@@ -74373,7 +74510,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
74373
74510
  }, 'normal', exports.AttributeLevel.Series);
74374
74511
  if (this._invalidType !== 'zero') {
74375
74512
  this.setMarkStyle(areaMark, {
74376
- defined: this._getInvalidDefined,
74513
+ defined: this._getInvalidDefined.bind(this),
74377
74514
  connectedType: this._getInvalidConnectType()
74378
74515
  }, 'normal', exports.AttributeLevel.Series);
74379
74516
  }
@@ -78607,7 +78744,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
78607
78744
  y: (datum) => this._computeOuterLabelPosition(datum).y,
78608
78745
  textAlign: (datum) => this._computeOuterLabelPosition(datum).align,
78609
78746
  textBaseline: (datum) => this._computeOuterLabelPosition(datum).textBaseline,
78610
- limit: (datum) => this._computeOuterLabelLimit(datum)
78747
+ maxLineWidth: (datum) => this._computeOuterLabelLimit(datum)
78611
78748
  }, 'normal', exports.AttributeLevel.Series);
78612
78749
  }
78613
78750
  const outerLabelLineMark = this._funnelOuterLabelMark.line;
@@ -78975,10 +79112,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
78975
79112
  return type === 'text' && ((_a = attribute.data) === null || _a === void 0 ? void 0 : _a[categoryField]) === datum[categoryField];
78976
79113
  }, true)) === null || _c === void 0 ? void 0 : _c.AABBBounds;
78977
79114
  const funnelLabelWidth = funnelLabelBounds ? funnelLabelBounds.x2 - funnelLabelBounds.x1 : 0;
78978
- return (this.getLayoutRect().width / 2 -
78979
- Math.max(shapeMiddleWidth / 2, funnelLabelWidth / 2) -
78980
- FUNNEL_LABEL_LINE_LENGTH -
78981
- ((_e = (_d = this._spec.outerLabel) === null || _d === void 0 ? void 0 : _d.spaceWidth) !== null && _e !== void 0 ? _e : FUNNEL_LABEL_SPACE_WIDTH) * 2);
79115
+ const outerLineSpace = this._funnelOuterLabelMark.line ? FUNNEL_LABEL_LINE_LENGTH : 0;
79116
+ let space = this.getLayoutRect().width - Math.max(shapeMiddleWidth, funnelLabelWidth);
79117
+ if (this._funnelAlign === 'center') {
79118
+ space /= 2;
79119
+ }
79120
+ return space - outerLineSpace - ((_e = (_d = this._spec.outerLabel) === null || _d === void 0 ? void 0 : _d.spaceWidth) !== null && _e !== void 0 ? _e : FUNNEL_LABEL_SPACE_WIDTH);
78982
79121
  }
78983
79122
  _computeOuterLabelLinePosition(datum) {
78984
79123
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
@@ -90612,9 +90751,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90612
90751
  _handleChange(start, end, updateComponent) {
90613
90752
  var _a, _b;
90614
90753
  const zoomLock = (_b = (_a = this._spec) === null || _a === void 0 ? void 0 : _a.zoomLock) !== null && _b !== void 0 ? _b : false;
90615
- if (zoomLock) {
90754
+ if (zoomLock || (end - start !== this._spanCache && (end - start < this._minSpan || end - start > this._maxSpan))) {
90616
90755
  this._shouldChange = false;
90617
90756
  }
90757
+ else {
90758
+ this._shouldChange = true;
90759
+ }
90760
+ this._spanCache = end - start;
90618
90761
  }
90619
90762
  _isReverse() {
90620
90763
  const axis = this._relatedAxisComponent;
@@ -90704,7 +90847,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90704
90847
  axisScale.minBandwidth('auto');
90705
90848
  }
90706
90849
  this._updateRangeFactor(tag);
90707
- (_b = (_a = this._component) === null || _a === void 0 ? void 0 : _a.setStartAndEnd) === null || _b === void 0 ? void 0 : _b.call(_a, this._start, this._end);
90850
+ if (this._auto) {
90851
+ (_b = (_a = this._component) === null || _a === void 0 ? void 0 : _a.setStartAndEnd) === null || _b === void 0 ? void 0 : _b.call(_a, this._start, this._end);
90852
+ }
90708
90853
  axis.effect.scaleUpdate();
90709
90854
  }
90710
90855
  else {
@@ -91066,7 +91211,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91066
91211
  this._end = end;
91067
91212
  this._minSpan = (_a = this._spec.minSpan) !== null && _a !== void 0 ? _a : 0;
91068
91213
  this._maxSpan = (_b = this._spec.maxSpan) !== null && _b !== void 0 ? _b : 1;
91069
- if (isContinuous(this._stateScale.type) && this._stateScale.domain[0] !== this._stateScale.domain[1]) {
91214
+ if (isContinuous(this._stateScale.type) && this._stateScale.domain()[0] !== this._stateScale.domain()[1]) {
91070
91215
  if (this._spec.minValueSpan) {
91071
91216
  this._minSpan = this._spec.minValueSpan / (this._stateScale.domain()[1] - this._stateScale.domain()[0]);
91072
91217
  }
@@ -91862,6 +92007,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91862
92007
  Factory.registerComponent(ScrollBar.type, ScrollBar);
91863
92008
  };
91864
92009
 
92010
+ var IFilterMode;
92011
+ (function (IFilterMode) {
92012
+ IFilterMode["filter"] = "filter";
92013
+ IFilterMode["axis"] = "axis";
92014
+ })(IFilterMode || (IFilterMode = {}));
92015
+
91865
92016
  const indicatorMapper = (data, op) => {
91866
92017
  const { datum, title, content } = op;
91867
92018
  const mappedData = [];
@@ -96144,128 +96295,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
96144
96295
  loadPoptip();
96145
96296
  };
96146
96297
 
96147
- const bracketReg = /\{([^}]+)\}/;
96148
- const bracketGReg = /\{([^}]+)\}/g;
96149
- const semicolonReg = /:/;
96150
- class FormatterPlugin extends BasePlugin {
96151
- constructor() {
96152
- super(FormatterPlugin.type);
96153
- this.type = 'formatterPlugin';
96154
- this._timeModeFormat = {
96155
- utc: TimeUtil.getInstance().timeUTCFormat,
96156
- local: TimeUtil.getInstance().timeFormat
96157
- };
96158
- this._formatter = this._format;
96159
- this._timeFormatter = this._timeModeFormat.local;
96160
- this._numericFormatter = NumberUtil.getInstance().format;
96161
- this._numericSpecifier = NumberUtil.getInstance().formatter;
96162
- this._numericFormatterCache = new Map();
96163
- this._isNumericFormatterCache = new Map();
96164
- }
96165
- onInit(service, chartSpec) {
96166
- var _a;
96167
- const { globalInstance } = service;
96168
- if (!globalInstance) {
96169
- return;
96170
- }
96171
- this._spec = (_a = chartSpec === null || chartSpec === void 0 ? void 0 : chartSpec[FormatterPlugin.specKey]) !== null && _a !== void 0 ? _a : {};
96172
- const { timeMode, customFormatter, numericFormatter, timeFormatter } = this._spec;
96173
- if (isFunction$1(customFormatter)) {
96174
- this._formatter = customFormatter;
96175
- }
96176
- else {
96177
- this._formatter = this._format.bind(this);
96178
- if (isFunction$1(timeFormatter)) {
96179
- this._timeFormatter = timeFormatter;
96180
- }
96181
- else if (timeMode && this._timeModeFormat[timeMode]) {
96182
- this._timeFormatter = this._timeModeFormat[timeMode];
96183
- }
96184
- if (numericFormatter) {
96185
- this._numericFormatter = numericFormatter;
96186
- this._numericSpecifier = null;
96187
- this._numericFormatterCache = null;
96188
- }
96189
- }
96190
- Factory.registerFormatter(this._formatter);
96191
- }
96192
- _format(text, datum, formatter) {
96193
- if (isArray$3(text)) {
96194
- return text.map((t, i) => {
96195
- const f = isArray$3(formatter) ? formatter[i] : formatter;
96196
- return f ? this._formatSingleLine(t, datum, f) : t;
96197
- });
96198
- }
96199
- if (isArray$3(formatter)) {
96200
- return formatter.map(f => this._formatSingleLine(text, datum, f));
96201
- }
96202
- return this._formatSingleLine(text, datum, formatter);
96203
- }
96204
- _formatSingleLine(text, datum, formatter) {
96205
- let isTemplate;
96206
- if (this._isNumericFormatterCache) {
96207
- if (this._isNumericFormatterCache.get(formatter)) {
96208
- isTemplate = this._isNumericFormatterCache.get(formatter);
96209
- }
96210
- else {
96211
- isTemplate = bracketReg.test(formatter);
96212
- this._isNumericFormatterCache.set(formatter, isTemplate);
96213
- }
96214
- }
96215
- if (isTemplate) {
96216
- const result = formatter.replace(bracketGReg, (match, key) => {
96217
- const hasFormatter = semicolonReg.test(key);
96218
- if (!hasFormatter) {
96219
- const value = datum[key.trim()];
96220
- return typeof value !== 'undefined' ? value : match;
96221
- }
96222
- const parts = key.split(':');
96223
- const value = datum[parts.shift()];
96224
- const valueFormatter = parts.join(':');
96225
- return this._formatSingleText(value, valueFormatter);
96226
- });
96227
- return result;
96228
- }
96229
- return this._formatSingleText(text, formatter);
96230
- }
96231
- _formatSingleText(text, formatter) {
96232
- const isNumeric = numberSpecifierReg.test(formatter);
96233
- if (isNumeric && this._numericFormatter) {
96234
- let numericFormat;
96235
- if (this._numericFormatterCache && this._numericSpecifier) {
96236
- if (this._numericFormatterCache.get(formatter)) {
96237
- numericFormat = this._numericFormatterCache.get(formatter);
96238
- }
96239
- else {
96240
- numericFormat = this._numericSpecifier(formatter);
96241
- this._numericFormatterCache.set(formatter, numericFormat);
96242
- }
96243
- return numericFormat(Number(text));
96244
- }
96245
- return this._numericFormatter(formatter, Number(text));
96246
- }
96247
- else if (formatter.includes('%') && this._timeFormatter) {
96248
- return this._timeFormatter(formatter, text);
96249
- }
96250
- return text;
96251
- }
96252
- release() {
96253
- super.release();
96254
- this._format = null;
96255
- this._timeFormatter = null;
96256
- this._numericFormatter = null;
96257
- this._numericSpecifier = null;
96258
- this._numericFormatterCache = null;
96259
- this._isNumericFormatterCache = null;
96260
- }
96261
- }
96262
- FormatterPlugin.pluginType = 'chart';
96263
- FormatterPlugin.specKey = 'formatter';
96264
- FormatterPlugin.type = 'formatterPlugin';
96265
- const registerFormatPlugin = () => {
96266
- registerChartPlugin(FormatterPlugin);
96267
- };
96268
-
96269
96298
  VChart.useRegisters([
96270
96299
  registerLineChart,
96271
96300
  registerAreaChart,
@@ -96817,6 +96846,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
96817
96846
  exports.DotSeries = DotSeries;
96818
96847
  exports.Event = Event$1;
96819
96848
  exports.Factory = Factory;
96849
+ exports.FormatterPlugin = FormatterPlugin;
96820
96850
  exports.Funnel3dChart = Funnel3dChart;
96821
96851
  exports.Funnel3dSeries = Funnel3dSeries;
96822
96852
  exports.FunnelChart = FunnelChart;
@@ -96972,6 +97002,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
96972
97002
  exports.registerDiscreteLegend = registerDiscreteLegend;
96973
97003
  exports.registerDomTooltipHandler = registerDomTooltipHandler;
96974
97004
  exports.registerDotSeries = registerDotSeries;
97005
+ exports.registerFormatPlugin = registerFormatPlugin;
96975
97006
  exports.registerFunnel3dChart = registerFunnel3dChart;
96976
97007
  exports.registerFunnel3dSeries = registerFunnel3dSeries;
96977
97008
  exports.registerFunnelChart = registerFunnelChart;