@visactor/vchart 1.13.6 → 1.13.7

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 (38) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.es.js +115 -92
  3. package/build/index.js +127 -91
  4. package/build/index.min.js +1 -1
  5. package/build/tsconfig.tsbuildinfo +1 -1
  6. package/cjs/component/label/interface.d.ts +7 -3
  7. package/cjs/component/label/interface.js.map +1 -1
  8. package/cjs/component/label/label.js +6 -1
  9. package/cjs/component/label/label.js.map +1 -1
  10. package/cjs/component/label/total-label.d.ts +1 -1
  11. package/cjs/component/label/total-label.js +22 -11
  12. package/cjs/component/label/total-label.js.map +1 -1
  13. package/cjs/core/index.d.ts +1 -1
  14. package/cjs/core/index.js +3 -2
  15. package/cjs/core/index.js.map +1 -1
  16. package/cjs/core/interface.js +1 -2
  17. package/cjs/core/vchart.js +6 -2
  18. package/cjs/core/vchart.js.map +1 -1
  19. package/cjs/index.d.ts +3 -0
  20. package/cjs/index.js +7 -6
  21. package/cjs/index.js.map +1 -1
  22. package/esm/component/label/interface.d.ts +7 -3
  23. package/esm/component/label/interface.js.map +1 -1
  24. package/esm/component/label/label.js +6 -1
  25. package/esm/component/label/label.js.map +1 -1
  26. package/esm/component/label/total-label.d.ts +1 -1
  27. package/esm/component/label/total-label.js +23 -12
  28. package/esm/component/label/total-label.js.map +1 -1
  29. package/esm/core/index.d.ts +1 -1
  30. package/esm/core/index.js +3 -2
  31. package/esm/core/index.js.map +1 -1
  32. package/esm/core/interface.js +1 -2
  33. package/esm/core/vchart.js +7 -3
  34. package/esm/core/vchart.js.map +1 -1
  35. package/esm/index.d.ts +3 -0
  36. package/esm/index.js +6 -0
  37. package/esm/index.js.map +1 -1
  38. package/package.json +13 -13
package/build/index.js CHANGED
@@ -28446,7 +28446,6 @@
28446
28446
  function makeUpCanvas$4(domref, canvasIdLists, canvasMap, freeCanvasIdx, freeCanvasList, pixelRatio) {
28447
28447
  const dpr = null != pixelRatio ? pixelRatio : tt.getSystemInfoSync().pixelRatio;
28448
28448
  canvasIdLists.forEach((id, i) => {
28449
- if (canvasMap.has(id)) return;
28450
28449
  const ctx = tt.createCanvasContext(id),
28451
28450
  canvas = new CanvasWrapDisableWH(ctx.canvas || {}, ctx, dpr, domref.width, domref.height, id);
28452
28451
  ctx.canvas = canvas, canvasMap.set(id, canvas), i >= freeCanvasIdx && freeCanvasList.push(canvas);
@@ -29780,12 +29779,12 @@
29780
29779
  step((generator = generator.apply(thisArg, _arguments || [])).next());
29781
29780
  });
29782
29781
  };
29783
- function makeUpCanvas$1(domref, canvasIdLists, canvasMap, freeCanvasIdx, freeCanvasList, component) {
29782
+ function makeUpCanvas$1(domref, canvasIdLists, canvasMap, freeCanvasIdx, freeCanvasList, component, forceUpdate) {
29784
29783
  return __awaiter$2(this, void 0, void 0, function* () {
29785
29784
  const dpr = wx.getSystemInfoSync().pixelRatio;
29786
29785
  for (let i = 0; i < canvasIdLists.length; i++) {
29787
29786
  const id = canvasIdLists[i];
29788
- canvasMap.has(id) || (yield new Promise(resolve => {
29787
+ !forceUpdate && canvasMap.has(id) || (yield new Promise(resolve => {
29789
29788
  let data = wx.createSelectorQuery();
29790
29789
  component && (data = data.in(component)), data.select(`#${id}`).fields({
29791
29790
  node: !0,
@@ -29812,7 +29811,7 @@
29812
29811
  this.applyStyles = !0;
29813
29812
  }
29814
29813
  configure(service, params) {
29815
- if (service.env === this.type) return service.setActiveEnvContribution(this), makeUpCanvas$1(params.domref, params.canvasIdLists, this.canvasMap, params.freeCanvasIdx, this.freeCanvasList, params.component).then(() => {});
29814
+ if (service.env === this.type) return service.setActiveEnvContribution(this), makeUpCanvas$1(params.domref, params.canvasIdLists, this.canvasMap, params.freeCanvasIdx, this.freeCanvasList, params.component, params.forceUpdate).then(() => {});
29816
29815
  }
29817
29816
  loadImage(url) {
29818
29817
  return Promise.resolve({
@@ -30115,7 +30114,7 @@
30115
30114
  const dpr = tt.getSystemInfoSync().pixelRatio;
30116
30115
  for (let i = 0; i < canvasIdLists.length; i++) {
30117
30116
  const id = canvasIdLists[i];
30118
- canvasMap.has(id) || (yield new Promise(resolve => {
30117
+ yield new Promise(resolve => {
30119
30118
  let data = tt.createSelectorQuery();
30120
30119
  component && (data = data.in(component)), data.select(`#${id}`).node().exec(res => {
30121
30120
  const canvas = res[0].node,
@@ -30123,7 +30122,7 @@
30123
30122
  height = canvas.height;
30124
30123
  canvas.width = width * dpr, canvas.height = height * dpr, canvasMap.set(id, canvas), i >= freeCanvasIdx && freeCanvasList.push(canvas), resolve(null);
30125
30124
  });
30126
- }));
30125
+ });
30127
30126
  }
30128
30127
  });
30129
30128
  }
@@ -31219,11 +31218,15 @@
31219
31218
  _registerText.__loaded = !1;
31220
31219
  const registerText = _registerText;
31221
31220
 
31221
+ function pseudoRandom(n) {
31222
+ let seed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
31223
+ let hash = 3735928559 ^ seed;
31224
+ return hash = (2654435769 ^ hash) + (hash << 6) + (hash >> 2), hash = 3432918353 * (hash ^ n), hash = hash << 15 | hash >>> 17, hash ^= hash << 25, hash += hash << 9, hash ^= hash >> 4, hash ^= hash << 18, hash |= 1, (hash >>> 0) % 2147483647 / 2147483647;
31225
+ }
31222
31226
  function randomOpacity(ctx, row, column, rowCount, columnCount, ratio, graphic) {
31223
31227
  let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
31224
31228
  let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
31225
- graphic.dynamicTextureCache || (graphic.dynamicTextureCache = new Array(rowCount * columnCount).fill(0).map(item => 2 * Math.random() * Math.PI));
31226
- const targetRandomValue = graphic.dynamicTextureCache[row * columnCount + column],
31229
+ const targetRandomValue = 2 * pseudoRandom(row * columnCount + column) * Math.PI,
31227
31230
  _r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI + targetRandomValue) + 1) / 2;
31228
31231
  return Math.min(1, Math.max(0, _r));
31229
31232
  }
@@ -31383,15 +31386,10 @@
31383
31386
  function particleEffect(ctx, row, column, rowCount, columnCount, ratio, graphic) {
31384
31387
  let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
31385
31388
  let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
31386
- graphic.dynamicTextureCache || (graphic.dynamicTextureCache = {
31387
- phases: new Array(rowCount * columnCount).fill(0).map(() => 2 * Math.random() * Math.PI),
31388
- speeds: new Array(rowCount * columnCount).fill(0).map(() => .5 + .5 * Math.random()),
31389
- directions: new Array(rowCount * columnCount).fill(0).map(() => 2 * Math.random() * Math.PI)
31390
- });
31391
31389
  const index = row * columnCount + column,
31392
- phase = graphic.dynamicTextureCache.phases[index],
31393
- speed = graphic.dynamicTextureCache.speeds[index],
31394
- direction = graphic.dynamicTextureCache.directions[index],
31390
+ phase = 2 * pseudoRandom(index, 0) * Math.PI,
31391
+ speed = .5 * pseudoRandom(index, 1) + .5,
31392
+ direction = 2 * pseudoRandom(index, 2) * Math.PI,
31395
31393
  centerRow = rowCount / 2,
31396
31394
  centerCol = columnCount / 2,
31397
31395
  distance = Math.sqrt(Math.pow((row - centerRow) / centerRow, 2) + Math.pow((column - centerCol) / centerCol, 2)),
@@ -32186,7 +32184,7 @@
32186
32184
  y: maxSize / 2
32187
32185
  }), "symbol"), isEmpty(null == state ? void 0 : state.shape) || (symbol.states = state.shape), shapeVisible && (symbolPlaceWidth = maxSize + space);
32188
32186
  }
32189
- let textShape;
32187
+ let textShape, textWidth, textHeight;
32190
32188
  tagWidth += symbolPlaceWidth, textX += symbolPlaceWidth;
32191
32189
  if (isRichText({
32192
32190
  text: text
@@ -32199,7 +32197,7 @@
32199
32197
  x: textX,
32200
32198
  y: 0
32201
32199
  });
32202
- textShape = group.createOrUpdateChild("tag-text", richTextAttrs, "richtext"), tagWidth += textShape.AABBBounds.width(), tagHeight += textShape.AABBBounds.height(), tagX += textShape.AABBBounds.x1, tagY += textShape.AABBBounds.y1;
32200
+ isNil$1(richTextAttrs.lineHeight) && (richTextAttrs.lineHeight = textStyle.fontSize), textShape = group.createOrUpdateChild("tag-text", richTextAttrs, "richtext"), textWidth = textShape.AABBBounds.width(), textHeight = textShape.AABBBounds.height();
32203
32201
  } else {
32204
32202
  const textAttrs = Object.assign(Object.assign({
32205
32203
  text: isObject$2(text) && "type" in text && "text" === text.type ? text.text : text,
@@ -32209,66 +32207,67 @@
32209
32207
  x: textX,
32210
32208
  y: 0
32211
32209
  });
32212
- isNil$1(textAttrs.lineHeight) && (textAttrs.lineHeight = textStyle.fontSize), textShape = group.createOrUpdateChild("tag-text", textAttrs, "text"), isEmpty(null == state ? void 0 : state.text) || (textShape.states = state.text);
32213
- const textBounds = measureTextSize(textAttrs.text, textStyle, null === (_b = null === (_a = this.stage) || void 0 === _a ? void 0 : _a.getTheme()) || void 0 === _b ? void 0 : _b.text),
32214
- textWidth = textBounds.width,
32215
- textHeight = textBounds.height;
32216
- tagWidth += textWidth;
32217
- const size = null !== (_c = shape.size) && void 0 !== _c ? _c : 10,
32218
- maxSize = isNumber$1(size) ? size : Math.max(size[0], size[1]);
32219
- tagHeight += Math.max(textHeight, shape.visible ? maxSize : 0);
32220
- const {
32221
- textAlign: textAlign,
32222
- textBaseline: textBaseline
32223
- } = textStyle;
32224
- (isValid$1(minWidth) || isValid$1(maxWidth)) && (isValid$1(minWidth) && tagWidth < minWidth && (tagWidth = minWidth), isValid$1(maxWidth) && tagWidth > maxWidth && (tagWidth = maxWidth, textShape.setAttribute("maxLineWidth", maxWidth - parsedPadding[1] - parsedPadding[2]))), tagX = 0, tagY = 0;
32225
- let flag = 0;
32226
- "left" === textAlign || "start" === textAlign ? flag = 1 : "right" === textAlign || "end" === textAlign ? flag = -1 : "center" === textAlign && (flag = 0), flag ? flag < 0 ? (tagX -= tagWidth, symbol && symbol.setAttribute("x", (symbol.attribute.x || 0) - textWidth), group.setAttribute("x", -parsedPadding[1] - symbolPlaceWidth)) : flag > 0 && group.setAttribute("x", parsedPadding[3]) : (tagX -= tagWidth / 2, symbol && symbol.setAttribute("x", (symbol.attribute.x || 0) - textWidth / 2), group.setAttribute("x", -symbolPlaceWidth / 2));
32227
- const shouldRight = "right" === containerTextAlign || "end" === containerTextAlign,
32228
- shouldLeft = "left" === containerTextAlign || "start" === containerTextAlign;
32229
- if ((containerTextAlign ? "center" === containerTextAlign : textAlwaysCenter) && flag) {
32230
- const containerWidth = tagWidth - parsedPadding[1] - parsedPadding[3],
32231
- tsWidth = textWidth + symbolPlaceWidth,
32232
- textX = 1 === flag ? (containerWidth - tsWidth) / 2 + symbolPlaceWidth + textWidth / 2 : parsedPadding[0] + symbolPlaceWidth - (tagWidth / 2 + tsWidth / 2 - symbolPlaceWidth) + textWidth / 2;
32233
- if (textShape.setAttributes({
32210
+ isNil$1(textAttrs.lineHeight) && (textAttrs.lineHeight = textStyle.fontSize), textShape = group.createOrUpdateChild("tag-text", textAttrs, "text");
32211
+ const textBounds = measureTextSize(textAttrs.text, textStyle, null === (_b = null === (_a = this.stage) || void 0 === _a ? void 0 : _a.getTheme()) || void 0 === _b ? void 0 : _b.text);
32212
+ textWidth = textBounds.width, textHeight = textBounds.height;
32213
+ }
32214
+ tagWidth += textWidth;
32215
+ const size = null !== (_c = shape.size) && void 0 !== _c ? _c : 10,
32216
+ maxSize = isNumber$1(size) ? size : Math.max(size[0], size[1]);
32217
+ tagHeight += Math.max(textHeight, shape.visible ? maxSize : 0);
32218
+ const {
32219
+ textAlign: textAlign,
32220
+ textBaseline: textBaseline
32221
+ } = textStyle;
32222
+ (isValid$1(minWidth) || isValid$1(maxWidth)) && (isValid$1(minWidth) && tagWidth < minWidth && (tagWidth = minWidth), isValid$1(maxWidth) && tagWidth > maxWidth && (tagWidth = maxWidth, textShape.setAttribute("maxLineWidth", maxWidth - parsedPadding[1] - parsedPadding[2]))), tagX = 0, tagY = 0;
32223
+ let flag = 0;
32224
+ "left" === textAlign || "start" === textAlign ? flag = 1 : "right" === textAlign || "end" === textAlign ? flag = -1 : "center" === textAlign && (flag = 0), flag ? flag < 0 ? (tagX -= tagWidth, symbol && symbol.setAttribute("x", (symbol.attribute.x || 0) - textWidth), group.setAttribute("x", -parsedPadding[1] - symbolPlaceWidth)) : flag > 0 && group.setAttribute("x", parsedPadding[3]) : (tagX -= tagWidth / 2, symbol && symbol.setAttribute("x", (symbol.attribute.x || 0) - textWidth / 2), group.setAttribute("x", -symbolPlaceWidth / 2));
32225
+ const shouldRight = "right" === containerTextAlign || "end" === containerTextAlign,
32226
+ shouldLeft = "left" === containerTextAlign || "start" === containerTextAlign,
32227
+ updateTextAttrs = (textX, textAlign) => {
32228
+ "richtext" === textShape.type ? textShape.setAttributes({
32234
32229
  x: textX,
32235
- textAlign: "center"
32236
- }), symbol) {
32237
- const symbolX = textX - textWidth / 2 - symbolPlaceWidth + maxSize / 2;
32238
- symbol.setAttributes({
32239
- x: symbolX
32240
- });
32241
- }
32242
- }
32243
- if (shouldLeft && 1 !== flag) {
32244
- const containerWidth = tagWidth - parsedPadding[1] - parsedPadding[3],
32245
- offset = 0 === flag ? -containerWidth / 2 + symbolPlaceWidth / 2 : -tagWidth + parsedPadding[3] + parsedPadding[1] + symbolPlaceWidth,
32246
- textX = offset + symbolPlaceWidth;
32247
- if (textShape.setAttributes({
32230
+ textAlign: textAlign,
32231
+ textConfig: array(textShape.attribute.textConfig).map(t => Object.assign(Object.assign({}, t), {
32232
+ textAlign: textAlign
32233
+ }))
32234
+ }) : textShape.setAttributes({
32248
32235
  x: textX,
32249
- textAlign: "left"
32250
- }), symbol) {
32251
- const symbolX = offset + maxSize / 2;
32252
- symbol.setAttributes({
32253
- x: symbolX
32254
- });
32255
- }
32236
+ textAlign: textAlign
32237
+ });
32238
+ };
32239
+ if ((containerTextAlign ? "center" === containerTextAlign : textAlwaysCenter) && flag) {
32240
+ const containerWidth = tagWidth - parsedPadding[1] - parsedPadding[3],
32241
+ tsWidth = textWidth + symbolPlaceWidth,
32242
+ textX = 1 === flag ? (containerWidth - tsWidth) / 2 + symbolPlaceWidth + textWidth / 2 : parsedPadding[0] + symbolPlaceWidth - (tagWidth / 2 + tsWidth / 2 - symbolPlaceWidth) + textWidth / 2;
32243
+ if (updateTextAttrs(textX, "center"), symbol) {
32244
+ const symbolX = textX - textWidth / 2 - symbolPlaceWidth + maxSize / 2;
32245
+ symbol.setAttributes({
32246
+ x: symbolX
32247
+ });
32256
32248
  }
32257
- if (shouldRight && -1 !== flag) {
32258
- const containerWidth = tagWidth - parsedPadding[1] - parsedPadding[3],
32259
- textX = 0 === flag ? containerWidth / 2 + symbolPlaceWidth / 2 : containerWidth;
32260
- if (textShape.setAttributes({
32261
- x: textX,
32262
- textAlign: "right"
32263
- }), symbol) {
32264
- const symbolX = textX - textWidth - symbolPlaceWidth + maxSize / 2;
32265
- symbol.setAttributes({
32266
- x: symbolX
32267
- });
32268
- }
32249
+ }
32250
+ if (shouldLeft && 1 !== flag) {
32251
+ const containerWidth = tagWidth - parsedPadding[1] - parsedPadding[3],
32252
+ offset = 0 === flag ? -containerWidth / 2 + symbolPlaceWidth / 2 : -tagWidth + parsedPadding[3] + parsedPadding[1] + symbolPlaceWidth;
32253
+ if (updateTextAttrs(offset + symbolPlaceWidth, "left"), symbol) {
32254
+ const symbolX = offset + maxSize / 2;
32255
+ symbol.setAttributes({
32256
+ x: symbolX
32257
+ });
32258
+ }
32259
+ }
32260
+ if (shouldRight && -1 !== flag) {
32261
+ const containerWidth = tagWidth - parsedPadding[1] - parsedPadding[3],
32262
+ textX = 0 === flag ? containerWidth / 2 + symbolPlaceWidth / 2 : containerWidth;
32263
+ if (updateTextAttrs(textX, "right"), symbol) {
32264
+ const symbolX = textX - textWidth - symbolPlaceWidth + maxSize / 2;
32265
+ symbol.setAttributes({
32266
+ x: symbolX
32267
+ });
32269
32268
  }
32270
- "middle" === textBaseline ? (tagY -= tagHeight / 2, symbol && symbol.setAttribute("y", 0)) : "bottom" === textBaseline ? (tagY -= tagHeight, symbol && symbol.setAttribute("y", -textHeight / 2), group.setAttribute("y", -parsedPadding[2])) : "top" === textBaseline && (group.setAttribute("y", parsedPadding[0]), symbol && symbol.setAttribute("y", textHeight / 2));
32271
32269
  }
32270
+ "middle" === textBaseline ? (tagY -= tagHeight / 2, symbol && symbol.setAttribute("y", 0)) : "bottom" === textBaseline ? (tagY -= tagHeight, symbol && symbol.setAttribute("y", -textHeight / 2), group.setAttribute("y", -parsedPadding[2])) : "top" === textBaseline && (group.setAttribute("y", parsedPadding[0]), symbol && symbol.setAttribute("y", textHeight / 2)), isEmpty(null == state ? void 0 : state.text) || (textShape.states = state.text);
32272
32271
  const {
32273
32272
  visible: bgVisible
32274
32273
  } = panel,
@@ -36419,10 +36418,16 @@
36419
36418
  y1: y1,
36420
36419
  y2: y2
36421
36420
  } = range,
36422
- _x1 = clamp$1(x1, 0, $.width),
36423
- _x2 = clamp$1(x2, 0, $.width),
36424
- _y1 = clamp$1(y1, 0, $.height),
36425
- _y2 = clamp$1(y2, 0, $.height);
36421
+ {
36422
+ top = 0,
36423
+ left = 0,
36424
+ right = 0,
36425
+ bottom = 0
36426
+ } = $.padding,
36427
+ _x1 = clamp$1(x1, -left, $.width + right),
36428
+ _x2 = clamp$1(x2, -left, $.width + right),
36429
+ _y1 = clamp$1(y1, -top, $.height + bottom),
36430
+ _y2 = clamp$1(y2, -top, $.height + bottom);
36426
36431
  return {
36427
36432
  x1: $.x(_x1),
36428
36433
  x2: $.x(_x2),
@@ -62467,7 +62472,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
62467
62472
  return userUpdateOptions
62468
62473
  ? Object.assign(Object.assign({}, res), userUpdateOptions) : res;
62469
62474
  };
62470
- this._option = merge$1(this._option, { animation: spec.animation !== false }, options);
62475
+ this._option = Object.assign(Object.assign(Object.assign({}, this._option), { animation: spec.animation !== false }), options);
62476
+ if (options === null || options === void 0 ? void 0 : options.optimize) {
62477
+ this._option.optimize = Object.assign(Object.assign({}, this._option.optimize), options.optimize);
62478
+ }
62471
62479
  this._onError = (_a = this._option) === null || _a === void 0 ? void 0 : _a.onError;
62472
62480
  const _j = this._option, { dom, renderCanvas, mode, stage, poptip } = _j, restOptions = __rest$e(_j, ["dom", "renderCanvas", "mode", "stage", "poptip"]);
62473
62481
  const isTrueBrowseEnv = isTrueBrowser(mode);
@@ -63219,7 +63227,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
63219
63227
  if (!fontFamily) {
63220
63228
  return;
63221
63229
  }
63222
- (_a = this.getStage()) === null || _a === void 0 ? void 0 : _a.setTheme({ text: { fontFamily } });
63230
+ (_a = this.getStage()) === null || _a === void 0 ? void 0 : _a.setTheme({
63231
+ text: { fontFamily },
63232
+ richtext: { fontFamily }
63233
+ });
63223
63234
  }
63224
63235
  _getTooltipComponent() {
63225
63236
  var _a;
@@ -63608,7 +63619,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
63608
63619
  };
63609
63620
  registerVChartCore();
63610
63621
 
63611
- const version = "1.13.6";
63622
+ const version = "1.13.7";
63612
63623
 
63613
63624
  const addVChartProperty = (data, op) => {
63614
63625
  const context = op.beforeCall();
@@ -99477,7 +99488,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
99477
99488
  : textAttribute(labelInfos[params.labelIndex], datum, labelSpec.formatMethod, labelSpec.formatter);
99478
99489
  }
99479
99490
  })
99480
- .size(() => labelInfos[0].series.getRegion().getLayoutRect());
99491
+ .size(() => {
99492
+ var _a;
99493
+ return Object.assign({ padding: (_a = labelInfos[0].labelSpec.overlap) === null || _a === void 0 ? void 0 : _a.padding }, labelInfos[0].series.getRegion().getLayoutRect());
99494
+ });
99481
99495
  }
99482
99496
  compileMarks() {
99483
99497
  this.getMarks().forEach(m => {
@@ -99614,11 +99628,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
99614
99628
  .labelStyle(() => {
99615
99629
  var _a, _b;
99616
99630
  if (this._baseMark) {
99617
- const { offset, animation, overlap } = this._spec;
99631
+ const { offset, animation, overlap, position = 'top' } = this._spec;
99618
99632
  const interactive = this._interactiveConfig(this._spec);
99619
99633
  return mergeSpec({
99620
99634
  textStyle: { pickable: this._spec.interactive === true },
99621
- position: totalLabelPosition(series, this._baseMark.type),
99635
+ position: totalLabelPosition(series, this._baseMark.type, position),
99622
99636
  x: 0,
99623
99637
  y: 0
99624
99638
  }, (_b = (_a = series.getTotalLabelComponentStyle) === null || _a === void 0 ? void 0 : _a.call(series, {
@@ -99627,7 +99641,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
99627
99641
  })) !== null && _b !== void 0 ? _b : {}, Object.assign({ offset,
99628
99642
  animation,
99629
99643
  overlap, dataFilter: (data) => {
99630
- return data.filter((d) => d.data[STACK_FIELD_TOTAL_TOP]);
99644
+ return data.filter((d) => position === 'bottom' ? d.data[STACK_FIELD_TOTAL_BOTTOM] : d.data[STACK_FIELD_TOTAL_TOP]);
99631
99645
  } }, interactive));
99632
99646
  }
99633
99647
  })
@@ -99639,7 +99653,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
99639
99653
  labelSpec: series.getSpec().totalLabel
99640
99654
  }, datum, this._spec.formatMethod);
99641
99655
  })
99642
- .size(() => this._regions[0].getLayoutRect());
99656
+ .size(() => {
99657
+ var _a;
99658
+ return Object.assign({ padding: (_a = this._spec.overlap) === null || _a === void 0 ? void 0 : _a.padding }, this._regions[0].getLayoutRect());
99659
+ });
99643
99660
  });
99644
99661
  }
99645
99662
  compileMarks() {
@@ -99664,24 +99681,30 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
99664
99681
  }
99665
99682
  TotalLabel.type = ComponentTypeEnum.totalLabel;
99666
99683
  TotalLabel.specKey = 'totalLabel';
99667
- function totalLabelPosition(series, type) {
99684
+ function totalLabelPosition(series, type, position = 'top') {
99668
99685
  var _a, _b;
99669
- let position;
99686
+ let finalPosition;
99670
99687
  const { direction } = series;
99671
99688
  const isInverse = direction === 'horizontal'
99672
99689
  ? (_a = series.getXAxisHelper()) === null || _a === void 0 ? void 0 : _a.isInverse()
99673
99690
  : (_b = series.getYAxisHelper()) === null || _b === void 0 ? void 0 : _b.isInverse();
99674
- const positionMap = { vertical: ['top', 'bottom'], horizontal: ['right', 'left'] };
99691
+ let positionMap;
99692
+ if (position === 'bottom') {
99693
+ positionMap = { vertical: ['bottom', 'top'], horizontal: ['left', 'right'] };
99694
+ }
99695
+ else {
99696
+ positionMap = { vertical: ['top', 'bottom'], horizontal: ['right', 'left'] };
99697
+ }
99675
99698
  const index = isInverse ? 1 : 0;
99676
99699
  switch (type) {
99677
99700
  case 'rect':
99678
99701
  case 'symbol':
99679
- position = positionMap[direction][index];
99702
+ finalPosition = positionMap[direction][index];
99680
99703
  break;
99681
99704
  default:
99682
- position = 'top';
99705
+ finalPosition = 'top';
99683
99706
  }
99684
- return position;
99707
+ return finalPosition;
99685
99708
  }
99686
99709
  const registerTotalLabel = () => {
99687
99710
  registerLabel$1();
@@ -103703,6 +103726,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
103703
103726
  exports.CircularProgressChart = CircularProgressChart;
103704
103727
  exports.CircularProgressSeries = CircularProgressSeries;
103705
103728
  exports.CommonChart = CommonChart;
103729
+ exports.CommonChartSpecTransformer = CommonChartSpecTransformer;
103706
103730
  exports.ComponentMark = ComponentMark;
103707
103731
  exports.ComposedEventMapper = ComposedEventMapper;
103708
103732
  exports.ContinuousLegend = ContinuousLegend;
@@ -103859,18 +103883,22 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
103859
103883
  exports.defaultThemeName = defaultThemeName;
103860
103884
  exports.diagonalCenterToEdge = diagonalCenterToEdge;
103861
103885
  exports.diagonalTopLeftToBottomRight = diagonalTopLeftToBottomRight;
103886
+ exports.functionTransform = functionTransform;
103862
103887
  exports.getActualColor = getActualColor;
103863
103888
  exports.getCartesianDimensionInfo = getCartesianDimensionInfo;
103864
103889
  exports.getColorSchemeBySeries = getColorSchemeBySeries;
103865
103890
  exports.getDataScheme = getDataScheme;
103891
+ exports.getFieldAlias = getFieldAlias;
103866
103892
  exports.getMergedTheme = getMergedTheme;
103867
103893
  exports.getPolarDimensionInfo = getPolarDimensionInfo;
103894
+ exports.getRegionStackGroup = getRegionStackGroup;
103868
103895
  exports.getTheme = getTheme;
103869
103896
  exports.hasThemeMerged = hasThemeMerged;
103870
103897
  exports.isColorKey = isColorKey;
103871
103898
  exports.isProgressiveDataColorScheme = isProgressiveDataColorScheme;
103872
103899
  exports.isTokenKey = isTokenKey;
103873
103900
  exports.lightTheme = lightTheme;
103901
+ exports.mergeFields = mergeFields;
103874
103902
  exports.particleEffect = particleEffect;
103875
103903
  exports.pulseWave = pulseWave;
103876
103904
  exports.queryColorFromColorScheme = queryColorFromColorScheme;
@@ -104027,7 +104055,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
104027
104055
  exports.rowEdgeToCenter = rowEdgeToCenter;
104028
104056
  exports.rowTopToBottom = rowTopToBottom;
104029
104057
  exports.snakeWave = snakeWave;
104058
+ exports.sortStackValueGroup = sortStackValueGroup;
104059
+ exports.specTransform = specTransform;
104030
104060
  exports.spiralEffect = spiralEffect;
104061
+ exports.stack = stack;
104062
+ exports.stackGroup = stackGroup;
104063
+ exports.stackMosaic = stackMosaic;
104064
+ exports.stackMosaicTotal = stackMosaicTotal;
104065
+ exports.stackOffsetSilhouette = stackOffsetSilhouette;
104066
+ exports.stackTotal = stackTotal;
104031
104067
  exports.themeExist = themeExist;
104032
104068
  exports.themes = themes;
104033
104069
  exports.token = token;