@visactor/vchart 1.1.0 → 1.1.1-beta.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 (53) hide show
  1. package/build/index.js +264 -132
  2. package/build/index.min.js +1 -1
  3. package/cjs/chart/map/map.js +2 -1
  4. package/cjs/chart/map/map.js.map +1 -1
  5. package/cjs/compile/compiler.js +2 -1
  6. package/cjs/compile/compiler.js.map +1 -1
  7. package/cjs/component/indicator/indicator.d.ts +1 -0
  8. package/cjs/component/indicator/indicator.js +7 -3
  9. package/cjs/component/indicator/indicator.js.map +1 -1
  10. package/cjs/core/index.d.ts +1 -1
  11. package/cjs/core/index.js +1 -1
  12. package/cjs/core/index.js.map +1 -1
  13. package/cjs/core/vchart.d.ts +2 -1
  14. package/cjs/core/vchart.js +3 -0
  15. package/cjs/core/vchart.js.map +1 -1
  16. package/cjs/data/transforms/map.js +2 -2
  17. package/cjs/data/transforms/map.js.map +1 -1
  18. package/cjs/mark/base/base-mark.d.ts +1 -0
  19. package/cjs/mark/base/base-mark.js +8 -2
  20. package/cjs/mark/base/base-mark.js.map +1 -1
  21. package/cjs/mark/interface/common.d.ts +2 -0
  22. package/cjs/mark/interface/common.js.map +1 -1
  23. package/cjs/series/map/interface.d.ts +2 -2
  24. package/cjs/series/map/interface.js.map +1 -1
  25. package/cjs/series/map/map.d.ts +2 -2
  26. package/cjs/series/map/map.js +12 -17
  27. package/cjs/series/map/map.js.map +1 -1
  28. package/esm/chart/map/map.js +2 -1
  29. package/esm/chart/map/map.js.map +1 -1
  30. package/esm/compile/compiler.js +3 -2
  31. package/esm/compile/compiler.js.map +1 -1
  32. package/esm/component/indicator/indicator.d.ts +1 -0
  33. package/esm/component/indicator/indicator.js +7 -3
  34. package/esm/component/indicator/indicator.js.map +1 -1
  35. package/esm/core/index.d.ts +1 -1
  36. package/esm/core/index.js +1 -1
  37. package/esm/core/index.js.map +1 -1
  38. package/esm/core/vchart.d.ts +2 -1
  39. package/esm/core/vchart.js +4 -1
  40. package/esm/core/vchart.js.map +1 -1
  41. package/esm/data/transforms/map.js +4 -2
  42. package/esm/data/transforms/map.js.map +1 -1
  43. package/esm/mark/base/base-mark.d.ts +1 -0
  44. package/esm/mark/base/base-mark.js +8 -2
  45. package/esm/mark/base/base-mark.js.map +1 -1
  46. package/esm/mark/interface/common.d.ts +2 -0
  47. package/esm/mark/interface/common.js.map +1 -1
  48. package/esm/series/map/interface.d.ts +2 -2
  49. package/esm/series/map/interface.js.map +1 -1
  50. package/esm/series/map/map.d.ts +2 -2
  51. package/esm/series/map/map.js +13 -18
  52. package/esm/series/map/map.js.map +1 -1
  53. package/package.json +10 -10
package/build/index.js CHANGED
@@ -8617,9 +8617,9 @@
8617
8617
  return new OrdinalScale().domain(this._domain).range(this._ordinalRange).unknown(this._unknown);
8618
8618
  }
8619
8619
  scale(d) {
8620
- const special = this._getSpecifiedValue(d);
8621
- if (!isNil(special)) return special;
8622
- const key = `${d}`;
8620
+ const key = `${d}`,
8621
+ special = this._getSpecifiedValue(key);
8622
+ if (void 0 !== special) return special;
8623
8623
  let i = this._index.get(key);
8624
8624
  if (!i) {
8625
8625
  if (this._unknown !== implicit) return this._unknown;
@@ -9078,12 +9078,33 @@
9078
9078
  } else z = ticks$1(i, j, Math.min(j - i, count)).map(this._pows);
9079
9079
  return r ? z.reverse() : z;
9080
9080
  }
9081
+ forceTicks() {
9082
+ let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
9083
+ const d = this.calculateVisibleDomain(this._range);
9084
+ return forceTicks(d[0], d[d.length - 1], count);
9085
+ }
9086
+ stepTicks(step) {
9087
+ const d = this.calculateVisibleDomain(this._range);
9088
+ return stepTicks(d[0], d[d.length - 1], step);
9089
+ }
9081
9090
  nice() {
9082
9091
  return this.domain(nice(this.domain(), {
9083
9092
  floor: x => this._pows(Math.floor(this._logs(x))),
9084
9093
  ceil: x => this._pows(Math.ceil(this._logs(x)))
9085
9094
  }));
9086
9095
  }
9096
+ niceMin() {
9097
+ const maxD = this._domain[this._domain.length - 1];
9098
+ this.nice();
9099
+ const niceDomain = cloneDeep(this._domain);
9100
+ return this._domain && (niceDomain[niceDomain.length - 1] = maxD, this.domain(niceDomain)), this;
9101
+ }
9102
+ niceMax() {
9103
+ const minD = this._domain[0];
9104
+ this.nice();
9105
+ const niceDomain = cloneDeep(this._domain);
9106
+ return this._domain && (niceDomain[0] = minD, this.domain(niceDomain)), this;
9107
+ }
9087
9108
  }
9088
9109
 
9089
9110
  class PointScale extends BandScale {
@@ -25603,7 +25624,18 @@
25603
25624
  Array.isArray(text) ? graphic.updateMultilineAABBBounds(text) : graphic.updateSingallineAABBBounds(text);
25604
25625
  const tb1 = this.tempAABBBounds1,
25605
25626
  tb2 = this.tempAABBBounds2;
25606
- return tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), transformBoundsWithMatrix(aabbBounds, aabbBounds, graphic.transMatrix), aabbBounds;
25627
+ tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2);
25628
+ const {
25629
+ scaleX = textTheme.scaleX,
25630
+ scaleY = textTheme.scaleY,
25631
+ shadowBlur = textTheme.shadowBlur,
25632
+ strokeBoundsBuffer = textTheme.strokeBoundsBuffer
25633
+ } = attribute;
25634
+ if (shadowBlur) {
25635
+ const shadowBlurHalfWidth = shadowBlur / Math.abs(scaleX + scaleY);
25636
+ boundStroke(tb1, shadowBlurHalfWidth, !0, strokeBoundsBuffer), aabbBounds.union(tb1);
25637
+ }
25638
+ return this.combindShadowAABBBounds(aabbBounds, graphic), transformBoundsWithMatrix(aabbBounds, aabbBounds, graphic.transMatrix), aabbBounds;
25607
25639
  }
25608
25640
  updatePathAABBBounds(attribute, pathTheme, aabbBounds, graphic) {
25609
25641
  this.updatePathProxyAABBBounds(aabbBounds, graphic) || this.updatePathAABBBoundsImprecise(attribute, pathTheme, aabbBounds, graphic);
@@ -26587,21 +26619,21 @@
26587
26619
  x: originX = 0,
26588
26620
  x: originY = 0
26589
26621
  } = attribute;
26590
- if (!1 !== fill && (fillCb ? fillCb(context, attribute, defaultAttribute) : fillOpacity && (context.setCommonStyle(area, attribute, originX - offsetX, originY - offsetY, defaultAttribute), context.fill())), !1 !== stroke) if (strokeCb) strokeCb(context, attribute, defaultAttribute);else {
26622
+ if (!1 !== fill && (fillCb ? fillCb(context, attribute, defaultAttribute) : fillOpacity && (context.setCommonStyle(area, attribute, originX - offsetX, originY - offsetY, defaultAttribute), context.fill())), this._areaRenderContribitions || (this._areaRenderContribitions = this.areaRenderContribitions.getContributions() || []), this._areaRenderContribitions.forEach(c => {
26623
+ c.time === BaseRenderContributionTime.afterFillStroke && c.drawShape(area, context, offsetX, offsetY, !!fillOpacity, !1, fill, !1, defaultAttribute, drawContext, fillCb, null, {
26624
+ attribute: attribute
26625
+ });
26626
+ }), !1 !== stroke) if (strokeCb) strokeCb(context, attribute, defaultAttribute);else {
26591
26627
  const {
26592
26628
  stroke: stroke
26593
26629
  } = attribute;
26594
- isArray$3(stroke) && stroke[0] && !1 === stroke[1] && (context.beginPath(), drawSegments(context.camera ? context : context.nativeContext, cache.top, clipRange, "auto", {
26630
+ isArray$3(stroke) && (stroke[0] || stroke[2]) && !1 === stroke[1] && (context.beginPath(), drawSegments(context.camera ? context : context.nativeContext, stroke[0] ? cache.top : cache.bottom, clipRange, "auto", {
26595
26631
  offsetX: offsetX,
26596
26632
  offsetY: offsetY,
26597
26633
  offsetZ: offsetZ
26598
26634
  })), context.setStrokeStyle(area, attribute, originX - offsetX, originY - offsetY, defaultAttribute), context.stroke();
26599
26635
  }
26600
- return this._areaRenderContribitions || (this._areaRenderContribitions = this.areaRenderContribitions.getContributions() || []), this._areaRenderContribitions.forEach(c => {
26601
- c.time === BaseRenderContributionTime.afterFillStroke && c.drawShape(area, context, offsetX, offsetY, !!fillOpacity, !1, fill, !1, defaultAttribute, drawContext, fillCb, null, {
26602
- attribute: attribute
26603
- });
26604
- }), !1;
26636
+ return !1;
26605
26637
  }
26606
26638
  };
26607
26639
  DefaultCanvasAreaRender = __decorate$1t([injectable(), __param$L(0, inject(ContributionProvider)), __param$L(0, named(AreaRenderContribution)), __metadata$_("design:paramtypes", [Object])], DefaultCanvasAreaRender);
@@ -34661,7 +34693,7 @@
34661
34693
  return this.viewBox.height();
34662
34694
  }
34663
34695
  }
34664
- })), params.autoRender && this.enableAutoRender(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), this.hooks.beforeRender.tap("constructor", this.beforeRender), this.hooks.afterRender.tap("constructor", this.afterRender), this._beforeRender = params.beforeRender, this._afterRender = params.afterRender, this.ticker = params.ticker || defaultTicker, !1 !== params.interactiveLayer && this.initInteractiveLayer();
34696
+ })), params.autoRender && this.enableAutoRender(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), this.hooks.beforeRender.tap("constructor", this.beforeRender), this.hooks.afterRender.tap("constructor", this.afterRender), this._beforeRender = params.beforeRender, this._afterRender = params.afterRender, this.ticker = params.ticker || defaultTicker, this.supportInteractiveLayer = !1 !== params.interactiveLayer;
34665
34697
  }
34666
34698
  get3dOptions(options) {
34667
34699
  const {
@@ -34797,8 +34829,8 @@
34797
34829
  removeLayer(ILayerId) {
34798
34830
  return this.removeChild(this.findChildByUid(ILayerId));
34799
34831
  }
34800
- initInteractiveLayer() {
34801
- this.interactiveLayer = this.createLayer(), this.interactiveLayer.name = "_builtin_interactive";
34832
+ tryInitInteractiveLayer() {
34833
+ this.supportInteractiveLayer && !this.interactiveLayer && (this.interactiveLayer = this.createLayer(), this.interactiveLayer.name = "_builtin_interactive");
34802
34834
  }
34803
34835
  clearViewBox(color) {
34804
34836
  this.window.clearViewBox(this._viewBox, color);
@@ -36050,7 +36082,7 @@
36050
36082
  }(LayoutState || (LayoutState = {}));
36051
36083
  var HOOK_EVENT;
36052
36084
  !function (HOOK_EVENT) {
36053
- HOOK_EVENT.BEFORE_PARSE_VIEW = "beforeParseView", HOOK_EVENT.AFTER_PARSE_VIEW = "afterParseView", HOOK_EVENT.BEFORE_TRANSFORM = "beforeTransform", HOOK_EVENT.AFTER_TRANSFORM = "afterTransform", HOOK_EVENT.BEFORE_CREATE_VRENDER_STAGE = "beforeCreateVRenderStage", HOOK_EVENT.AFTER_CREATE_VRENDER_STAGE = "afterCreateVRenderStage", HOOK_EVENT.BEFORE_CREATE_VRENDER_LAYER = "beforeCreateVRenderLayer", HOOK_EVENT.AFTER_CREATE_VRENDER_LAYER = "afterCreateVRenderLayer", HOOK_EVENT.BEFORE_VRENDER_DRAW = "beforeVRenderDraw", HOOK_EVENT.AFTER_VRENDER_DRAW = "afterVRenderDraw", HOOK_EVENT.BEFORE_MARK_JOIN = "beforeMarkJoin", HOOK_EVENT.AFTER_MARK_JOIN = "afterMarkJoin", HOOK_EVENT.BEFORE_MARK_UPDATE = "beforeMarkUpdate", HOOK_EVENT.AFTER_MARK_UPDATE = "afterMarkUpdate", HOOK_EVENT.BEFORE_MARK_STATE = "beforeMarkState", HOOK_EVENT.AFTER_MARK_STATE = "afterMarkState", HOOK_EVENT.BEFORE_MARK_ENCODE = "beforeMarkEncode", HOOK_EVENT.AFTER_MARK_ENCODE = "afterMarkEncode", HOOK_EVENT.BEFORE_DO_LAYOUT = "beforeDoLayout", HOOK_EVENT.AFTER_DO_LAYOUT = "afterDoLayout", HOOK_EVENT.BEFORE_MARK_LAYOUT_END = "beforeMarkLayoutEnd", HOOK_EVENT.AFTER_MARK_LAYOUT_END = "afterMarkLayoutEnd", HOOK_EVENT.BEFORE_DO_RENDER = "beforeDoRender", HOOK_EVENT.AFTER_DO_RENDER = "afterDoRender", HOOK_EVENT.BEFORE_MARK_RENDER_END = "beforeMarkRenderEnd", HOOK_EVENT.AFTER_MARK_RENDER_END = "afterMarkRenderEnd", HOOK_EVENT.BEFORE_CREATE_VRENDER_MARK = "beforeCreateVRenderMark", HOOK_EVENT.AFTER_CREATE_VRENDER_MARK = "afterCreateVRenderMark", HOOK_EVENT.BEFORE_ADD_VRENDER_MARK = "beforeAddVRenderMark", HOOK_EVENT.AFTER_ADD_VRENDER_MARK = "afterAddVRenderMark", HOOK_EVENT.AFTER_VRENDER_NEXT_RENDER = "afterVRenderNextRender", HOOK_EVENT.BEFORE_ELEMENT_UPDATE_DATA = "beforeElementUpdateData", HOOK_EVENT.AFTER_ELEMENT_UPDATE_DATA = "afterElementUpdateData", HOOK_EVENT.BEFORE_ELEMENT_STATE = "beforeElementState", HOOK_EVENT.AFTER_ELEMENT_STATE = "afterElementState", HOOK_EVENT.BEFORE_ELEMENT_ENCODE = "beforeElementEncode", HOOK_EVENT.AFTER_ELEMENT_ENCODE = "afterElementEncode", HOOK_EVENT.ANIMATION_START = "animationStart", HOOK_EVENT.ANIMATION_END = "animationEnd", HOOK_EVENT.ELEMENT_ANIMATION_START = "elementAnimationStart", HOOK_EVENT.ELEMENT_ANIMATION_END = "elementAnimationEnd";
36085
+ HOOK_EVENT.BEFORE_PARSE_VIEW = "beforeParseView", HOOK_EVENT.AFTER_PARSE_VIEW = "afterParseView", HOOK_EVENT.BEFORE_TRANSFORM = "beforeTransform", HOOK_EVENT.AFTER_TRANSFORM = "afterTransform", HOOK_EVENT.BEFORE_CREATE_VRENDER_STAGE = "beforeCreateVRenderStage", HOOK_EVENT.AFTER_CREATE_VRENDER_STAGE = "afterCreateVRenderStage", HOOK_EVENT.BEFORE_CREATE_VRENDER_LAYER = "beforeCreateVRenderLayer", HOOK_EVENT.AFTER_CREATE_VRENDER_LAYER = "afterCreateVRenderLayer", HOOK_EVENT.BEFORE_VRENDER_DRAW = "beforeVRenderDraw", HOOK_EVENT.AFTER_VRENDER_DRAW = "afterVRenderDraw", HOOK_EVENT.BEFORE_MARK_JOIN = "beforeMarkJoin", HOOK_EVENT.AFTER_MARK_JOIN = "afterMarkJoin", HOOK_EVENT.BEFORE_MARK_UPDATE = "beforeMarkUpdate", HOOK_EVENT.AFTER_MARK_UPDATE = "afterMarkUpdate", HOOK_EVENT.BEFORE_MARK_STATE = "beforeMarkState", HOOK_EVENT.AFTER_MARK_STATE = "afterMarkState", HOOK_EVENT.BEFORE_MARK_ENCODE = "beforeMarkEncode", HOOK_EVENT.AFTER_MARK_ENCODE = "afterMarkEncode", HOOK_EVENT.BEFORE_DO_LAYOUT = "beforeDoLayout", HOOK_EVENT.AFTER_DO_LAYOUT = "afterDoLayout", HOOK_EVENT.BEFORE_MARK_LAYOUT_END = "beforeMarkLayoutEnd", HOOK_EVENT.AFTER_MARK_LAYOUT_END = "afterMarkLayoutEnd", HOOK_EVENT.BEFORE_DO_RENDER = "beforeDoRender", HOOK_EVENT.AFTER_DO_RENDER = "afterDoRender", HOOK_EVENT.BEFORE_MARK_RENDER_END = "beforeMarkRenderEnd", HOOK_EVENT.AFTER_MARK_RENDER_END = "afterMarkRenderEnd", HOOK_EVENT.BEFORE_CREATE_VRENDER_MARK = "beforeCreateVRenderMark", HOOK_EVENT.AFTER_CREATE_VRENDER_MARK = "afterCreateVRenderMark", HOOK_EVENT.BEFORE_ADD_VRENDER_MARK = "beforeAddVRenderMark", HOOK_EVENT.AFTER_ADD_VRENDER_MARK = "afterAddVRenderMark", HOOK_EVENT.AFTER_VRENDER_NEXT_RENDER = "afterVRenderNextRender", HOOK_EVENT.BEFORE_ELEMENT_UPDATE_DATA = "beforeElementUpdateData", HOOK_EVENT.AFTER_ELEMENT_UPDATE_DATA = "afterElementUpdateData", HOOK_EVENT.BEFORE_ELEMENT_STATE = "beforeElementState", HOOK_EVENT.AFTER_ELEMENT_STATE = "afterElementState", HOOK_EVENT.BEFORE_ELEMENT_ENCODE = "beforeElementEncode", HOOK_EVENT.AFTER_ELEMENT_ENCODE = "afterElementEncode", HOOK_EVENT.ANIMATION_START = "animationStart", HOOK_EVENT.ANIMATION_END = "animationEnd", HOOK_EVENT.ELEMENT_ANIMATION_START = "elementAnimationStart", HOOK_EVENT.ELEMENT_ANIMATION_END = "elementAnimationEnd", HOOK_EVENT.ALL_ANIMATION_START = "allAnimationStart", HOOK_EVENT.ALL_ANIMATION_END = "allAnimationEnd";
36054
36086
  }(HOOK_EVENT || (HOOK_EVENT = {}));
36055
36087
  var GrammarTypeEnum;
36056
36088
  !function (GrammarTypeEnum) {
@@ -38886,6 +38918,12 @@
38886
38918
  recordEnd() {
38887
38919
  return this;
38888
38920
  }
38921
+ isAnimating() {
38922
+ let isAnimating = !1;
38923
+ return this.animators.forEach(animators => {
38924
+ isAnimating = isAnimating || animators.some(animator => animator.isAnimating);
38925
+ }), isAnimating;
38926
+ }
38889
38927
  isElementAnimating(element) {
38890
38928
  var _a;
38891
38929
  const stateAnimationCounts = null === (_a = this.elementRecorder.get(element)) || void 0 === _a ? void 0 : _a.count;
@@ -38943,7 +38981,7 @@
38943
38981
  },
38944
38982
  mergedParameters = Object.assign({
38945
38983
  [DefaultAnimationParameters]: animationParameters
38946
- }, animationParameters),
38984
+ }, parameters),
38947
38985
  animationUnit = this.getAnimationUnit(config.timeline, element, index, animatedElements.length, parameters);
38948
38986
  animators.push(this.animateElement(config, animationUnit, element, animationParameters, mergedParameters));
38949
38987
  })), animators;
@@ -39655,7 +39693,7 @@
39655
39693
  if (this.renderContext = this.parseRenderContext(data, parameters), this.init(stage, parameters), this.renderContext.progressive) this.differ.reset(), this.elementMap.clear(), this.evaluateProgressive();else {
39656
39694
  const transformData = this.evaluateTransformSync(this._getTransformsBeforeJoin(), null != data ? data : DefaultMarkData, parameters);
39657
39695
  let inputData = transformData;
39658
- transformData.progressive && (this.renderContext.parameters = parameters, this.renderContext.beforeTransformProgressive = transformData.progressive, inputData = transformData.progressive.output()), this.emit(HOOK_EVENT.BEFORE_MARK_JOIN), this.evaluateJoin(inputData), this.emit(HOOK_EVENT.AFTER_MARK_JOIN), this.emit(HOOK_EVENT.BEFORE_MARK_STATE), this.evaluateState(this.elements, this.spec.state, parameters), this.emit(HOOK_EVENT.AFTER_MARK_STATE), this.emit(HOOK_EVENT.BEFORE_MARK_ENCODE), this.evaluateEncode(this.elements, this._getEncoders(), parameters), this.emit(HOOK_EVENT.AFTER_MARK_ENCODE);
39696
+ (null == transformData ? void 0 : transformData.progressive) && (this.renderContext.parameters = parameters, this.renderContext.beforeTransformProgressive = transformData.progressive, inputData = transformData.progressive.output()), this.emit(HOOK_EVENT.BEFORE_MARK_JOIN), this.evaluateJoin(inputData), this.emit(HOOK_EVENT.AFTER_MARK_JOIN), this.emit(HOOK_EVENT.BEFORE_MARK_STATE), this.evaluateState(this.elements, this.spec.state, parameters), this.emit(HOOK_EVENT.AFTER_MARK_STATE), this.emit(HOOK_EVENT.BEFORE_MARK_ENCODE), this.evaluateEncode(this.elements, this._getEncoders(), parameters), this.emit(HOOK_EVENT.AFTER_MARK_ENCODE);
39659
39697
  }
39660
39698
  return this.emit(HOOK_EVENT.BEFORE_MARK_UPDATE), this.update(this.spec), this.emit(HOOK_EVENT.AFTER_MARK_UPDATE), this;
39661
39699
  }
@@ -40870,7 +40908,7 @@
40870
40908
  }, poptip), {
40871
40909
  x: matrix.e,
40872
40910
  y: matrix.f
40873
- }));
40911
+ })), drawContext.stage.tryInitInteractiveLayer();
40874
40912
  const interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
40875
40913
  interactiveLayer && interactiveLayer.add(this.poptipComponent);
40876
40914
  } else 2 === graphic._showPoptip && (graphic._showPoptip = 0, this.poptipComponent && this.poptipComponent.setAttributes({
@@ -41327,6 +41365,24 @@
41327
41365
  function defaultLabelPosition(type) {
41328
41366
  return "rect" === type ? DefaultRectPositions : DefaultPositions;
41329
41367
  }
41368
+ function clampText(text, width, height) {
41369
+ const {
41370
+ x1: x1,
41371
+ x2: x2,
41372
+ y1: y1,
41373
+ y2: y2
41374
+ } = text.AABBBounds,
41375
+ minX = Math.min(x1, x2),
41376
+ maxX = Math.max(x1, x2),
41377
+ minY = Math.min(y1, y2),
41378
+ maxY = Math.max(y1, y2);
41379
+ let dx = 0,
41380
+ dy = 0;
41381
+ return minX < 0 && maxX - minX <= width ? dx = -minX : maxX > width && minX - (maxX - width) >= 0 && (dx = width - maxX), minY < 0 && maxY - minY <= height ? dy = -minY : maxY > height && minY - (maxY - height) >= 0 && (dy = height - maxY), {
41382
+ dx: dx,
41383
+ dy: dy
41384
+ };
41385
+ }
41330
41386
 
41331
41387
  const fadeIn = function () {
41332
41388
  let textAttribute = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -41405,9 +41461,17 @@
41405
41461
  this._bmpTool = bmpTool;
41406
41462
  }
41407
41463
  render() {
41408
- const currentBaseMarks = this._checkMarks(),
41409
- labels = this.layout(currentBaseMarks);
41410
- this._smartInvert(labels), this._renderLabels(labels);
41464
+ this._prepare();
41465
+ const {
41466
+ overlap: overlap,
41467
+ smartInvert: smartInvert,
41468
+ dataFilter: dataFilter,
41469
+ customLayoutFunc: customLayoutFunc,
41470
+ customOverlapFunc: customOverlapFunc
41471
+ } = this.attribute;
41472
+ let labels,
41473
+ data = this.attribute.data;
41474
+ isFunction(dataFilter) && (data = dataFilter(data)), isFunction(customLayoutFunc) ? labels = customLayoutFunc(data, d => this._idToGraphic.get(d.id)) : (labels = this.layout(data), isFunction(customOverlapFunc) ? labels = customOverlapFunc(labels, d => this._idToGraphic.get(d.id)) : !1 !== overlap && (labels = this._overlapping(labels))), !1 !== smartInvert && this._smartInvert(labels), this._renderLabels(labels);
41411
41475
  }
41412
41476
  _bindEvent(target) {
41413
41477
  if (!target) return;
@@ -41426,52 +41490,53 @@
41426
41490
  const text = createText(attributes);
41427
41491
  return this._bindEvent(text), this._setStates(text), text;
41428
41492
  }
41429
- _checkMarks() {
41493
+ _prepare() {
41430
41494
  var _a;
41431
41495
  const baseMarks = this.getBaseMarks(),
41432
41496
  currentBaseMarks = [];
41433
- return baseMarks.forEach(mark => {
41497
+ if (baseMarks.forEach(mark => {
41434
41498
  "willRelease" !== mark.releaseStatus && currentBaseMarks.push(mark);
41435
- }), this._prevRelationMap = new Map(this._relationMap), null === (_a = this._relationMap) || void 0 === _a || _a.clear(), currentBaseMarks;
41436
- }
41437
- layout(currentMarks) {
41499
+ }), null === (_a = this._idToGraphic) || void 0 === _a || _a.clear(), this._baseMarks = currentBaseMarks, !currentBaseMarks || 0 === currentBaseMarks.length) return;
41438
41500
  const {
41439
- textStyle: textStyle,
41440
- position: position,
41441
- offset: offset
41442
- } = this.attribute;
41443
- let {
41444
41501
  data: data
41445
41502
  } = this.attribute;
41446
- if (isFunction(data) && (data = data({})), !data || 0 === data.length) return [];
41447
- let labels = [];
41448
- isFunction(this.attribute.sort) && currentMarks && currentMarks.length && (currentMarks = currentMarks.sort(this.attribute.sort)), this._relationMap || (this._relationMap = new Map());
41503
+ if (data && 0 !== data.length) {
41504
+ this._idToGraphic || (this._idToGraphic = new Map());
41505
+ for (let i = 0; i < currentBaseMarks.length; i++) {
41506
+ const textData = data[i],
41507
+ baseMark = currentBaseMarks[i];
41508
+ textData && baseMark && (isValid(textData.id) || (textData.id = `vrender-component-${this.name}-${i}`), this._idToGraphic.set(textData.id, baseMark));
41509
+ }
41510
+ }
41511
+ }
41512
+ layout() {
41513
+ let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
41514
+ const {
41515
+ textStyle = {},
41516
+ position: position,
41517
+ offset: offset
41518
+ } = this.attribute,
41519
+ labels = [];
41449
41520
  for (let i = 0; i < data.length; i++) {
41450
41521
  const textData = data[i],
41451
- baseMark = null == currentMarks ? void 0 : currentMarks[i],
41452
- labelAttribute = Object.assign(Object.assign(Object.assign({}, textStyle), textData), {
41453
- _relatedIndex: i
41454
- });
41455
- if (this._relationMap.set(i, baseMark), textData) {
41456
- const text = createText(labelAttribute);
41457
- text.update();
41458
- const textBounds = this.getGraphicBounds(text),
41459
- graphicBounds = this.getGraphicBounds(baseMark, {
41460
- x: textData.x,
41461
- y: textData.y
41462
- }),
41463
- textAttributes = this.labeling(textBounds, graphicBounds, isFunction(position) ? position(textData) : position, offset);
41464
- if (!textAttributes) continue;
41465
- labelAttribute.x = textAttributes.x, labelAttribute.y = textAttributes.y, labels.push(labelAttribute);
41466
- }
41522
+ baseMark = this._idToGraphic.get(textData.id),
41523
+ labelAttribute = Object.assign(Object.assign({}, textStyle), textData),
41524
+ text = this._createLabelText(labelAttribute),
41525
+ textBounds = this.getGraphicBounds(text),
41526
+ graphicBounds = this.getGraphicBounds(baseMark, {
41527
+ x: textData.x,
41528
+ y: textData.y
41529
+ }),
41530
+ textLocation = this.labeling(textBounds, graphicBounds, isFunction(position) ? position(textData) : position, offset);
41531
+ textLocation && (labelAttribute.x = textLocation.x, labelAttribute.y = textLocation.y, text.setAttributes(textLocation), labels.push(text));
41467
41532
  }
41468
- return this._baseMarks = currentMarks, !1 !== this.attribute.overlap && (labels = this.overlapping(labels, this.attribute.overlap)), labels;
41533
+ return labels;
41469
41534
  }
41470
- overlapping(labels) {
41471
- let option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
41472
- var _a, _b, _c, _d, _e;
41535
+ _overlapping(labels) {
41536
+ var _a, _b, _c, _d;
41473
41537
  if (0 === labels.length) return [];
41474
- const result = [],
41538
+ const option = this.attribute.overlap,
41539
+ result = [],
41475
41540
  baseMarkGroup = this.getBaseMarkGroup(),
41476
41541
  size = null !== (_a = option.size) && void 0 !== _a ? _a : {
41477
41542
  width: null !== (_b = null == baseMarkGroup ? void 0 : baseMarkGroup.AABBBounds.width()) && void 0 !== _b ? _b : 0,
@@ -41492,27 +41557,45 @@
41492
41557
  }));
41493
41558
  for (let i = 0; i < labels.length; i++) {
41494
41559
  if (!1 === labels[i].visible) continue;
41495
- const text = createText(labels[i]),
41496
- baseMark = null === (_e = this._baseMarks) || void 0 === _e ? void 0 : _e[i];
41560
+ const text = labels[i],
41561
+ baseMark = this._idToGraphic.get(text.attribute.id);
41497
41562
  if (text.update(), canPlace(bmpTool, bitmap, text.AABBBounds, clampForce)) {
41498
41563
  if (!checkBounds) {
41499
- bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, !0)), result.push(Object.assign({}, text.attribute));
41564
+ bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, !0)), result.push(text);
41500
41565
  continue;
41501
41566
  }
41502
41567
  if (checkBounds && (null == baseMark ? void 0 : baseMark.AABBBounds) && canPlaceInside(text.AABBBounds, null == baseMark ? void 0 : baseMark.AABBBounds)) {
41503
- bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, !0)), result.push(Object.assign({}, text.attribute));
41568
+ bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, !0)), result.push(text);
41569
+ continue;
41570
+ }
41571
+ }
41572
+ if (clampForce) {
41573
+ const {
41574
+ dx = 0,
41575
+ dy = 0
41576
+ } = clampText(text, bmpTool.width, bmpTool.height);
41577
+ if ((0 !== dx || 0 !== dy) && canPlace(bmpTool, bitmap, {
41578
+ x1: text.AABBBounds.x1 + dx,
41579
+ x2: text.AABBBounds.x2 + dx,
41580
+ y1: text.AABBBounds.y1 + dy,
41581
+ y2: text.AABBBounds.y2 + dy
41582
+ })) {
41583
+ text.setAttributes({
41584
+ x: text.attribute.x + dx,
41585
+ y: text.attribute.y + dy
41586
+ }), result.push(text);
41504
41587
  continue;
41505
41588
  }
41506
41589
  }
41507
41590
  let hasPlace = !1;
41508
41591
  for (let j = 0; j < strategy.length; j++) if (hasPlace = place$2(bmpTool, bitmap, strategy[j], this.attribute, text, this.getGraphicBounds(baseMark, labels[i]), this.labeling), !1 !== hasPlace) {
41509
- result.push(Object.assign(Object.assign({}, text.attribute), {
41592
+ text.setAttributes({
41510
41593
  x: hasPlace.x,
41511
41594
  y: hasPlace.y
41512
- }));
41595
+ }), result.push(text);
41513
41596
  break;
41514
41597
  }
41515
- !hasPlace && !hideOnHit && result.push(Object.assign({}, text.attribute));
41598
+ !hasPlace && !hideOnHit && result.push(text);
41516
41599
  }
41517
41600
  return isFunction(this.onAfterLabelOverlap) && this.onAfterLabelOverlap(bitmap), result;
41518
41601
  }
@@ -41544,17 +41627,16 @@
41544
41627
  easing = null !== (_d = animationConfig.easing) && void 0 !== _d ? _d : DefaultLabelAnimation.easing,
41545
41628
  delay = null !== (_e = animationConfig.delay) && void 0 !== _e ? _e : 0,
41546
41629
  currentTextMap = new Map(),
41547
- prevTextMap = this._textMap || new Map(),
41630
+ prevTextMap = this._graphicToText || new Map(),
41548
41631
  texts = [];
41549
- labels.forEach((label, index) => {
41550
- const text = this._createLabelText(label),
41551
- relatedGraphic = this._relationMap.get(label._relatedIndex),
41632
+ labels.forEach((text, index) => {
41633
+ const relatedGraphic = this._idToGraphic.get(text.attribute.id),
41552
41634
  state = (null == prevTextMap ? void 0 : prevTextMap.get(relatedGraphic)) ? "update" : "enter";
41553
41635
  if ("enter" === state) if (texts.push(text), currentTextMap.set(relatedGraphic, text), !disableAnimation && relatedGraphic) {
41554
41636
  const {
41555
41637
  from: from,
41556
41638
  to: to
41557
- } = getAnimationAttributes(label, "fadeIn");
41639
+ } = getAnimationAttributes(text.attribute, "fadeIn");
41558
41640
  this.add(text), relatedGraphic.onAnimateBind = () => {
41559
41641
  text.setAttributes(from);
41560
41642
  const listener = this._afterRelatedGraphicAttributeUpdate(text, texts, index, relatedGraphic, {
@@ -41579,7 +41661,7 @@
41579
41661
  disableAnimation ? this.removeChild(label) : null == label || label.animate().to(getAnimationAttributes(label.attribute, "fadeOut").to, duration, easing).onEnd(() => {
41580
41662
  this.removeChild(label);
41581
41663
  });
41582
- }), this._textMap = currentTextMap;
41664
+ }), this._graphicToText = currentTextMap;
41583
41665
  }
41584
41666
  _afterRelatedGraphicAttributeUpdate(text, texts, index, relatedGraphic, _ref) {
41585
41667
  let {
@@ -41622,21 +41704,32 @@
41622
41704
  return listener;
41623
41705
  }
41624
41706
  _smartInvert(labels) {
41625
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
41626
- if (!1 !== this.attribute.smartInvert) for (let i = 0; i < labels.length; i++) {
41627
- const label = null == labels ? void 0 : labels[i];
41707
+ const option = this.attribute.smartInvert || {},
41708
+ {
41709
+ textType: textType,
41710
+ contrastRatiosThreshold: contrastRatiosThreshold,
41711
+ alternativeColors: alternativeColors
41712
+ } = option;
41713
+ for (let i = 0; i < labels.length; i++) {
41714
+ const label = labels[i];
41628
41715
  if (!label) continue;
41629
- const isInside = canPlaceInside(createText(label).AABBBounds, null === (_a = this._relationMap.get(label._relatedIndex)) || void 0 === _a ? void 0 : _a.AABBBounds);
41630
- if (label.stroke && label.lineWidth > 0) label.fill = labelSmartInvert(label.fill, label.stroke, null === (_b = this.attribute.smartInvert) || void 0 === _b ? void 0 : _b.textType, null === (_c = this.attribute.smartInvert) || void 0 === _c ? void 0 : _c.contrastRatiosThreshold, null === (_d = this.attribute.smartInvert) || void 0 === _d ? void 0 : _d.alternativeColors);else if (isInside) {
41631
- const backgroundColor = this._relationMap.get(label._relatedIndex).attribute.fill,
41632
- foregroundColor = label.fill;
41633
- label.fill = labelSmartInvert(foregroundColor, backgroundColor, null === (_e = this.attribute.smartInvert) || void 0 === _e ? void 0 : _e.textType, null === (_f = this.attribute.smartInvert) || void 0 === _f ? void 0 : _f.contrastRatiosThreshold, null === (_g = this.attribute.smartInvert) || void 0 === _g ? void 0 : _g.alternativeColors);
41634
- } else if (label.lineWidth > 0) {
41635
- const baseMark = this._relationMap.get(label._relatedIndex);
41636
- label.stroke = baseMark.attribute.fill;
41637
- const backgroundColor = label.stroke,
41638
- foregroundColor = label.fill;
41639
- label.fill = labelSmartInvert(foregroundColor, backgroundColor, null === (_h = this.attribute.smartInvert) || void 0 === _h ? void 0 : _h.textType, null === (_j = this.attribute.smartInvert) || void 0 === _j ? void 0 : _j.contrastRatiosThreshold, null === (_k = this.attribute.smartInvert) || void 0 === _k ? void 0 : _k.alternativeColors);
41716
+ const baseMark = this._idToGraphic.get(label.attribute.id),
41717
+ isInside = canPlaceInside(label.AABBBounds, null == baseMark ? void 0 : baseMark.AABBBounds);
41718
+ if (label.attribute.stroke && label.attribute.lineWidth > 0) label.setAttributes({
41719
+ fill: labelSmartInvert(label.attribute.fill, label.attribute.stroke, textType, contrastRatiosThreshold, alternativeColors)
41720
+ });else if (isInside) {
41721
+ const backgroundColor = baseMark.attribute.fill,
41722
+ foregroundColor = label.attribute.fill;
41723
+ label.setAttributes({
41724
+ fill: labelSmartInvert(foregroundColor, backgroundColor, textType, contrastRatiosThreshold, alternativeColors)
41725
+ });
41726
+ } else if (label.attribute.lineWidth > 0) {
41727
+ const backgroundColor = label.attribute.stroke,
41728
+ foregroundColor = label.attribute.fill;
41729
+ label.setAttributes({
41730
+ stroke: baseMark.attribute.fill,
41731
+ fill: labelSmartInvert(foregroundColor, backgroundColor, textType, contrastRatiosThreshold, alternativeColors)
41732
+ });
41640
41733
  }
41641
41734
  }
41642
41735
  }
@@ -50541,56 +50634,68 @@
50541
50634
 
50542
50635
  class ViewAnimate {
50543
50636
  constructor(view) {
50544
- this.view = view;
50637
+ this._animations = [], this._onAnimationStart = event => {
50638
+ 0 === this._animations.length && this._view.emit(HOOK_EVENT.ALL_ANIMATION_START, {}), this._animations = this._animations.concat({
50639
+ config: event.animationConfig,
50640
+ mark: event.mark
50641
+ });
50642
+ }, this._onAnimationEnd = event => {
50643
+ this._animations = this._animations.filter(animation => animation.config !== event.animationConfig || animation.mark !== event.mark), 0 === this._animations.length && this._view.emit(HOOK_EVENT.ALL_ANIMATION_END, {});
50644
+ }, this._view = view, this._view.addEventListener(HOOK_EVENT.ANIMATION_START, this._onAnimationStart), this._view.addEventListener(HOOK_EVENT.ANIMATION_END, this._onAnimationEnd);
50545
50645
  }
50546
50646
  stop() {
50547
- return this.view.traverseMarkTree(mark => {
50548
- var _a;
50549
- null === (_a = mark.animate) || void 0 === _a || _a.stop();
50647
+ return this._view.traverseMarkTree(mark => {
50648
+ var _a, _b;
50649
+ null === (_b = null === (_a = mark.animate) || void 0 === _a ? void 0 : _a.stop) || void 0 === _b || _b.call(_a);
50550
50650
  }), this;
50551
50651
  }
50552
50652
  pause() {
50553
- return this.view.traverseMarkTree(mark => {
50554
- var _a;
50555
- null === (_a = mark.animate) || void 0 === _a || _a.pause();
50653
+ return this._view.traverseMarkTree(mark => {
50654
+ var _a, _b;
50655
+ null === (_b = null === (_a = mark.animate) || void 0 === _a ? void 0 : _a.pause) || void 0 === _b || _b.call(_a);
50556
50656
  }), this;
50557
50657
  }
50558
50658
  resume() {
50559
- return this.view.traverseMarkTree(mark => {
50560
- var _a;
50561
- null === (_a = mark.animate) || void 0 === _a || _a.resume();
50659
+ return this._view.traverseMarkTree(mark => {
50660
+ var _a, _b;
50661
+ null === (_b = null === (_a = mark.animate) || void 0 === _a ? void 0 : _a.resume) || void 0 === _b || _b.call(_a);
50562
50662
  }), this;
50563
50663
  }
50564
50664
  enable() {
50565
- return this.view.traverseMarkTree(mark => {
50566
- var _a;
50567
- null === (_a = mark.animate) || void 0 === _a || _a.enable();
50665
+ return this._view.traverseMarkTree(mark => {
50666
+ var _a, _b;
50667
+ null === (_b = null === (_a = mark.animate) || void 0 === _a ? void 0 : _a.enable) || void 0 === _b || _b.call(_a);
50568
50668
  }), this;
50569
50669
  }
50570
50670
  disable() {
50571
- return this.view.traverseMarkTree(mark => {
50572
- var _a;
50573
- null === (_a = mark.animate) || void 0 === _a || _a.disable();
50671
+ return this._view.traverseMarkTree(mark => {
50672
+ var _a, _b;
50673
+ null === (_b = null === (_a = mark.animate) || void 0 === _a ? void 0 : _a.disable) || void 0 === _b || _b.call(_a);
50574
50674
  }), this;
50575
50675
  }
50576
50676
  enableAnimationState(state) {
50577
- return this.view.traverseMarkTree(mark => {
50578
- var _a;
50579
- null === (_a = mark.animate) || void 0 === _a || _a.enableAnimationState(state);
50677
+ return this._view.traverseMarkTree(mark => {
50678
+ var _a, _b;
50679
+ null === (_b = null === (_a = mark.animate) || void 0 === _a ? void 0 : _a.enableAnimationState) || void 0 === _b || _b.call(_a, state);
50580
50680
  }), this;
50581
50681
  }
50582
50682
  disableAnimationState(state) {
50583
- return this.view.traverseMarkTree(mark => {
50584
- var _a;
50585
- null === (_a = mark.animate) || void 0 === _a || _a.disableAnimationState(state);
50683
+ return this._view.traverseMarkTree(mark => {
50684
+ var _a, _b;
50685
+ null === (_b = null === (_a = mark.animate) || void 0 === _a ? void 0 : _a.disableAnimationState) || void 0 === _b || _b.call(_a, state);
50586
50686
  }), this;
50587
50687
  }
50688
+ isAnimating() {
50689
+ return 0 !== this._animations.length;
50690
+ }
50588
50691
  animate() {
50589
- return this.view.traverseMarkTree(mark => {
50692
+ return this._view.traverseMarkTree(mark => {
50590
50693
  mark.isUpdated && mark.animate && mark.animate.animate(), mark.cleanExitElements(), mark.isUpdated = !1;
50591
50694
  }, null, !0), this;
50592
50695
  }
50593
- release() {}
50696
+ release() {
50697
+ this._view.removeEventListener(HOOK_EVENT.ALL_ANIMATION_START, this._onAnimationStart), this._view.removeEventListener(HOOK_EVENT.ALL_ANIMATION_END, this._onAnimationEnd);
50698
+ }
50594
50699
  }
50595
50700
 
50596
50701
  class Interval extends Mark {
@@ -54255,7 +54360,8 @@
54255
54360
  },
54256
54361
  doLayout: () => {
54257
54362
  this._compileChart?.onLayout(this._view);
54258
- }
54363
+ },
54364
+ logLevel: Logger.getInstance().level()
54259
54365
  });
54260
54366
  this._setCanvasStyle();
54261
54367
  const interactive = this._option.interactive;
@@ -54556,6 +54662,9 @@
54556
54662
  static hideTooltip(excludeId = []) {
54557
54663
  InstanceManager.forEach(instance => instance?.hideTooltip?.(), excludeId);
54558
54664
  }
54665
+ static getLogger() {
54666
+ return Logger.getInstance();
54667
+ }
54559
54668
  static InstanceManager = InstanceManager;
54560
54669
  static ThemeManager = ThemeManager;
54561
54670
  static globalConfig = {
@@ -57694,6 +57803,11 @@
57694
57803
  });
57695
57804
  });
57696
57805
  }
57806
+ setPostProcess(key, postProcessFunc, state = 'normal') {
57807
+ if (this.stateStyle[state]?.[key]) {
57808
+ this.stateStyle[state][key].postProcess = postProcessFunc;
57809
+ }
57810
+ }
57697
57811
  getAttribute(key, datum, state = 'normal', opt) {
57698
57812
  return this._computeAttribute(key, datum, state, opt);
57699
57813
  }
@@ -57749,12 +57863,16 @@
57749
57863
  return style;
57750
57864
  }
57751
57865
  _computeAttribute(key, datum, state, opt) {
57752
- let baseValue;
57866
+ let stateStyle;
57753
57867
  if (!this.stateStyle[state]?.[key]) {
57754
- baseValue = this._computeStateAttribute(this.stateStyle.normal[key], key, datum, state, opt);
57868
+ stateStyle = this.stateStyle.normal[key];
57755
57869
  }
57756
57870
  else {
57757
- baseValue = this._computeStateAttribute(this.stateStyle[state][key], key, datum, state, opt);
57871
+ stateStyle = this.stateStyle[state][key];
57872
+ }
57873
+ let baseValue = this._computeStateAttribute(stateStyle, key, datum, state, opt);
57874
+ if (isFunction(stateStyle?.postProcess)) {
57875
+ baseValue = stateStyle.postProcess(baseValue, datum, this._attributeContext, opt, this.getDataView());
57758
57876
  }
57759
57877
  if (key in this._computeExChannel) {
57760
57878
  return this._computeExChannel[key](key, datum, state, opt, baseValue);
@@ -57970,7 +58088,7 @@
57970
58088
  VChart.useMark([ComponentMark, GroupMark, ImageMark]);
57971
58089
  Factory.registerRegion('region', Region);
57972
58090
  Factory.registerLayout('base', Layout);
57973
- const version = "1.1.0";
58091
+ const version = "1.1.1-beta.1";
57974
58092
  Logger.getInstance(LoggerLevel.Error);
57975
58093
 
57976
58094
  var SeriesMarkNameEnum;
@@ -65011,7 +65129,8 @@
65011
65129
 
65012
65130
  const map = (data, opt) => {
65013
65131
  if (data.features) {
65014
- data.features.forEach((f) => {
65132
+ data.features.forEach((f, index) => {
65133
+ f[DEFAULT_DATA_INDEX] = index;
65015
65134
  if (opt.nameMap) {
65016
65135
  f.name = opt.nameMap[f.properties?.[opt.nameProperty]];
65017
65136
  }
@@ -65125,6 +65244,7 @@
65125
65244
  });
65126
65245
  if (this._spec.label?.visible) {
65127
65246
  this._labelMark = this._createMark(MapSeries.mark.label, {
65247
+ parent: this.getRegion().getGroupMark(),
65128
65248
  skipBeforeLayouted: true,
65129
65249
  dataView: this._mapViewData.getDataView(),
65130
65250
  dataProductId: this._mapViewData.getProductId()
@@ -65139,10 +65259,16 @@
65139
65259
  if (isValid(datum[this._seriesField ?? DEFAULT_DATA_SERIES_FIELD])) {
65140
65260
  return (this._option.globalScale.getScale('color') ?? this.getDefaultColorScale()).scale(datum[this._seriesField ?? DEFAULT_DATA_SERIES_FIELD]);
65141
65261
  }
65142
- return this._theme?.defaultFillColor;
65262
+ return this._spec?.defaultFillColor;
65143
65263
  },
65144
65264
  path: this.getPath.bind(this)
65145
65265
  }, 'normal', AttributeLevel.Series);
65266
+ pathMark.setPostProcess('fill', result => {
65267
+ if (!isValid(result)) {
65268
+ return this._spec.defaultFillColor;
65269
+ }
65270
+ return result;
65271
+ });
65146
65272
  this.setMarkStyle(pathMark, {
65147
65273
  smoothScale: true
65148
65274
  }, 'normal', AttributeLevel.Built_In);
@@ -65155,9 +65281,7 @@
65155
65281
  text: (datum) => {
65156
65282
  return this._getDatumName(datum);
65157
65283
  },
65158
- x: (datum) => {
65159
- return this.dataToPosition(datum)?.x;
65160
- },
65284
+ x: (datum) => this.dataToPosition(datum)?.x,
65161
65285
  y: (datum) => this.dataToPosition(datum)?.y
65162
65286
  });
65163
65287
  }
@@ -65172,12 +65296,12 @@
65172
65296
  this._tooltipHelper = new MapSeriesTooltipHelper(this);
65173
65297
  }
65174
65298
  getPath(datum) {
65175
- const area = this._areaCache.get(datum?.properties?.[this._nameProperty]);
65299
+ const area = this._areaCache.get(datum[DEFAULT_DATA_INDEX]);
65176
65300
  if (area) {
65177
65301
  return area.shape;
65178
65302
  }
65179
65303
  const shape = this._coordinateHelper?.shape(datum);
65180
- this._areaCache.set(datum?.properties?.[this._nameProperty], {
65304
+ this._areaCache.set(datum[DEFAULT_DATA_INDEX], {
65181
65305
  shape
65182
65306
  });
65183
65307
  return shape;
@@ -65221,10 +65345,7 @@
65221
65345
  }
65222
65346
  const elements = vGrammarMark.elements;
65223
65347
  if (mark.type === MarkTypeEnum.path) {
65224
- elements.forEach((el) => {
65225
- const graphicItem = el.getGraphicItem();
65226
- graphicItem.scale(scale, scale, scaleCenter);
65227
- });
65348
+ vGrammarMark.group.getGroupGraphicItem().scale(scale, scale, scaleCenter);
65228
65349
  }
65229
65350
  else {
65230
65351
  elements.forEach((el) => {
@@ -65250,10 +65371,7 @@
65250
65371
  }
65251
65372
  const elements = vGrammarMark.elements;
65252
65373
  if (mark.type === MarkTypeEnum.path) {
65253
- elements.forEach((el) => {
65254
- const graphicItem = el.getGraphicItem();
65255
- graphicItem.translate(delta[0], delta[1]);
65256
- });
65374
+ vGrammarMark.group.getGroupGraphicItem().translate(delta[0], delta[1]);
65257
65375
  }
65258
65376
  else {
65259
65377
  elements.forEach((el, i) => {
@@ -65280,7 +65398,16 @@
65280
65398
  return [Number.NaN, Number.NaN];
65281
65399
  }
65282
65400
  _getDatumName(datum) {
65283
- return datum[this.nameField] ?? datum.properties?.[this.nameField] ?? '';
65401
+ if (datum[this.nameField]) {
65402
+ return datum[this.nameField];
65403
+ }
65404
+ if (datum.properties?.[this._nameProperty]) {
65405
+ if (this._spec.nameMap) {
65406
+ return this._spec.nameMap[datum.properties[this._nameProperty]] ?? '';
65407
+ }
65408
+ return datum.properties[this._nameProperty] ?? '';
65409
+ }
65410
+ return '';
65284
65411
  }
65285
65412
  dataToPositionX(data) {
65286
65413
  throw new Error('Method not implemented.');
@@ -65294,7 +65421,7 @@
65294
65421
  this._mapViewData?.updateData();
65295
65422
  }
65296
65423
  _getDataIdKey() {
65297
- return (datum) => datum?.properties?.[this._nameProperty];
65424
+ return DEFAULT_DATA_INDEX;
65298
65425
  }
65299
65426
  }
65300
65427
 
@@ -76251,7 +76378,8 @@
76251
76378
  map: spec.map,
76252
76379
  nameProperty: spec.nameProperty,
76253
76380
  nameMap: spec.nameMap,
76254
- area: spec.area
76381
+ area: spec.area,
76382
+ defaultFillColor: spec.defaultFillColor
76255
76383
  };
76256
76384
  return series;
76257
76385
  }
@@ -82562,6 +82690,7 @@
82562
82690
  };
82563
82691
 
82564
82692
  class Indicator extends BaseComponent {
82693
+ static speckey = 'indicator';
82565
82694
  static type = ComponentTypeEnum.indicator;
82566
82695
  type = ComponentTypeEnum.indicator;
82567
82696
  name = ComponentTypeEnum.indicator;
@@ -82582,7 +82711,7 @@
82582
82711
  const indicatorSpec = spec.indicator || options.defaultSpec;
82583
82712
  const indicators = array(indicatorSpec)
82584
82713
  .filter(s => s && s.visible !== false)
82585
- .map(s => new Indicator(s, options));
82714
+ .map((s, index) => new Indicator(s, { ...options, specIndex: index, specKey: Indicator.speckey }));
82586
82715
  return indicators;
82587
82716
  }
82588
82717
  created() {
@@ -82732,9 +82861,12 @@
82732
82861
  return eachSeries(this._regions, s => model === s) || this._regions.includes(model);
82733
82862
  }
82734
82863
  clear() {
82735
- super.clear();
82736
- this._indicatorComponent = null;
82864
+ if (this._indicatorComponent) {
82865
+ this._container.removeChild(this._indicatorComponent);
82866
+ this._indicatorComponent = null;
82867
+ }
82737
82868
  this._cacheAttrs = null;
82869
+ super.clear();
82738
82870
  }
82739
82871
  }
82740
82872