@visactor/vrender-components 0.21.2-vstory.1 → 0.21.2-vstory.3

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 (58) hide show
  1. package/cjs/brush/brush.js +1 -2
  2. package/cjs/brush/type.js +2 -1
  3. package/cjs/index.d.ts +2 -1
  4. package/cjs/index.js +3 -2
  5. package/cjs/index.js.map +1 -1
  6. package/cjs/label/base.js +10 -1
  7. package/cjs/label/base.js.map +1 -1
  8. package/cjs/label/overlap/shiftY.js +1 -1
  9. package/cjs/label/overlap/shiftY.js.map +1 -1
  10. package/cjs/label/type.d.ts +1 -1
  11. package/cjs/label/type.js.map +1 -1
  12. package/cjs/label-item/index.d.ts +2 -0
  13. package/cjs/label-item/index.js +21 -0
  14. package/cjs/label-item/index.js.map +1 -0
  15. package/cjs/label-item/label-item.d.ts +29 -0
  16. package/cjs/label-item/label-item.js +265 -0
  17. package/cjs/label-item/label-item.js.map +1 -0
  18. package/cjs/label-item/register.d.ts +1 -0
  19. package/cjs/label-item/register.js +15 -0
  20. package/cjs/label-item/register.js.map +1 -0
  21. package/cjs/label-item/type.d.ts +31 -0
  22. package/cjs/label-item/type.js +6 -0
  23. package/cjs/label-item/type.js.map +1 -0
  24. package/cjs/poptip/poptip.d.ts +14 -2
  25. package/cjs/poptip/poptip.js +137 -51
  26. package/cjs/poptip/poptip.js.map +1 -1
  27. package/cjs/poptip/type.d.ts +6 -0
  28. package/cjs/poptip/type.js.map +1 -1
  29. package/dist/index.es.js +444 -71
  30. package/es/brush/brush.js +1 -2
  31. package/es/brush/type.js +2 -1
  32. package/es/index.d.ts +2 -1
  33. package/es/index.js +3 -1
  34. package/es/index.js.map +1 -1
  35. package/es/label/base.js +10 -1
  36. package/es/label/base.js.map +1 -1
  37. package/es/label/overlap/shiftY.js +1 -1
  38. package/es/label/overlap/shiftY.js.map +1 -1
  39. package/es/label/type.d.ts +1 -1
  40. package/es/label/type.js.map +1 -1
  41. package/es/label-item/index.d.ts +2 -0
  42. package/es/label-item/index.js +4 -0
  43. package/es/label-item/index.js.map +1 -0
  44. package/es/label-item/label-item.d.ts +29 -0
  45. package/es/label-item/label-item.js +263 -0
  46. package/es/label-item/label-item.js.map +1 -0
  47. package/es/label-item/register.d.ts +1 -0
  48. package/es/label-item/register.js +6 -0
  49. package/es/label-item/register.js.map +1 -0
  50. package/es/label-item/type.d.ts +31 -0
  51. package/es/label-item/type.js +2 -0
  52. package/es/label-item/type.js.map +1 -0
  53. package/es/poptip/poptip.d.ts +14 -2
  54. package/es/poptip/poptip.js +136 -49
  55. package/es/poptip/poptip.js.map +1 -1
  56. package/es/poptip/type.d.ts +6 -0
  57. package/es/poptip/type.js.map +1 -1
  58. package/package.json +5 -5
package/dist/index.es.js CHANGED
@@ -2311,7 +2311,8 @@ const DefaultGroupAttribute = Object.assign(Object.assign({}, DefaultAttribute),
2311
2311
  justifyContent: "flex-start",
2312
2312
  alignItems: "flex-start",
2313
2313
  alignContent: "flex-start",
2314
- baseOpacity: 1
2314
+ baseOpacity: 1,
2315
+ cornerType: "round"
2315
2316
  });
2316
2317
  const DefaultGlyphAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
2317
2318
  path: "",
@@ -2348,7 +2349,8 @@ const DefaultRectAttribute = Object.assign(Object.assign({}, DefaultAttribute),
2348
2349
  x1: 0,
2349
2350
  y1: 0,
2350
2351
  strokeBoundsBuffer: 0,
2351
- cornerRadius: 0
2352
+ cornerRadius: 0,
2353
+ cornerType: "round"
2352
2354
  });
2353
2355
  Object.assign(Object.assign({}, DefaultAttribute), {
2354
2356
  width: 0,
@@ -2356,7 +2358,8 @@ Object.assign(Object.assign({}, DefaultAttribute), {
2356
2358
  x1: 0,
2357
2359
  y1: 0,
2358
2360
  cornerRadius: 0,
2359
- length: 0
2361
+ length: 0,
2362
+ cornerType: "round"
2360
2363
  });
2361
2364
  const DefaultSymbolAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
2362
2365
  symbolType: "circle",
@@ -2392,7 +2395,8 @@ const DefaultImageAttribute = Object.assign(Object.assign({
2392
2395
  height: 0
2393
2396
  }, DefaultAttribute), {
2394
2397
  fill: !0,
2395
- cornerRadius: 0
2398
+ cornerRadius: 0,
2399
+ cornerType: "round"
2396
2400
  });
2397
2401
  const DefaultRichTextIconAttribute = Object.assign(Object.assign({}, DefaultImageAttribute), {
2398
2402
  backgroundShowMode: "never",
@@ -4241,6 +4245,13 @@ class Easing {
4241
4245
  Easing[name] = func;
4242
4246
  }
4243
4247
  }
4248
+ function flicker(t, n) {
4249
+ const step = 1 / n;
4250
+ let flag = 1;
4251
+ for (; t > step;) t -= step, flag *= -1;
4252
+ const v = flag * t / step;
4253
+ return v > 0 ? v : 1 + v;
4254
+ }
4244
4255
  Easing.quadIn = Easing.getPowIn(2), Easing.quadOut = Easing.getPowOut(2), Easing.quadInOut = Easing.getPowInOut(2), Easing.cubicIn = Easing.getPowIn(3), Easing.cubicOut = Easing.getPowOut(3), Easing.cubicInOut = Easing.getPowInOut(3), Easing.quartIn = Easing.getPowIn(4), Easing.quartOut = Easing.getPowOut(4), Easing.quartInOut = Easing.getPowInOut(4), Easing.quintIn = Easing.getPowIn(5), Easing.quintOut = Easing.getPowOut(5), Easing.quintInOut = Easing.getPowInOut(5), Easing.backIn = Easing.getBackIn(1.7), Easing.backOut = Easing.getBackOut(1.7), Easing.backInOut = Easing.getBackInOut(1.7), Easing.elasticIn = Easing.getElasticIn(1, .3), Easing.elasticOut = Easing.getElasticOut(1, .3), Easing.elasticInOut = Easing.getElasticInOut(1, .3 * 1.5), Easing.easeInOutQuad = t => (t /= .5) < 1 ? .5 * Math.pow(t, 2) : -.5 * ((t -= 2) * t - 2), Easing.easeOutElastic = x => {
4245
4256
  const c4 = 2 * Math.PI / 3;
4246
4257
  return 0 === x ? 0 : 1 === x ? 1 : Math.pow(2, -10 * x) * Math.sin((10 * x - .75) * c4) + 1;
@@ -4248,6 +4259,8 @@ Easing.quadIn = Easing.getPowIn(2), Easing.quadOut = Easing.getPowOut(2), Easing
4248
4259
  const c5 = 2 * Math.PI / 4.5;
4249
4260
  return 0 === x ? 0 : 1 === x ? 1 : x < .5 ? -Math.pow(2, 20 * x - 10) * Math.sin((20 * x - 11.125) * c5) / 2 : Math.pow(2, -20 * x + 10) * Math.sin((20 * x - 11.125) * c5) / 2 + 1;
4250
4261
  };
4262
+ for (let i = 0; i < 10; i++) Easing[`flicker${i}`] = t => flicker(t, i);
4263
+ for (let i = 2; i < 10; i++) Easing[`aIn${i}`] = t => i * t * t + (1 - i) * t;
4251
4264
 
4252
4265
  class DefaultTimeline {
4253
4266
  constructor() {
@@ -4781,6 +4794,37 @@ var Direction;
4781
4794
  !function (Direction) {
4782
4795
  Direction[Direction.LEFT_TO_RIGHT = 0] = "LEFT_TO_RIGHT", Direction[Direction.RIGHT_TO_LEFT = 1] = "RIGHT_TO_LEFT", Direction[Direction.TOP_TO_BOTTOM = 2] = "TOP_TO_BOTTOM", Direction[Direction.BOTTOM_TO_TOP = 3] = "BOTTOM_TO_TOP", Direction[Direction.STROKE = 4] = "STROKE";
4783
4796
  }(Direction || (Direction = {}));
4797
+ class InputText extends ACustomAnimate {
4798
+ constructor() {
4799
+ super(...arguments), this.fromText = "", this.toText = "";
4800
+ }
4801
+ getEndProps() {
4802
+ return !1 === this.valid ? {} : {
4803
+ text: this.to
4804
+ };
4805
+ }
4806
+ onBind() {
4807
+ var _a, _b, _c;
4808
+ this.fromText = null !== (_b = null === (_a = this.from) || void 0 === _a ? void 0 : _a.text) && void 0 !== _b ? _b : "", this.toText = (null === (_c = this.to) || void 0 === _c ? void 0 : _c.text) || "", (!this.toText || isArray(this.toText) && 0 === this.toText.length) && (this.valid = !1), isArray(this.toText) && (this.toText = this.toText.map(item => (item || "").toString()));
4809
+ }
4810
+ onEnd() {
4811
+ this.target.detachShadow();
4812
+ }
4813
+ onUpdate(end, ratio, out) {
4814
+ if (!1 === this.valid) return;
4815
+ const fromCount = this.fromText.length,
4816
+ toTextIsArray = isArray(this.toText),
4817
+ toCount = toTextIsArray ? this.toText.reduce((c, t) => c + (t || "").length, 0) : this.toText.length,
4818
+ count = Math.ceil(fromCount + (toCount - fromCount) * ratio);
4819
+ if (toTextIsArray) {
4820
+ out.text = [];
4821
+ let len = 0;
4822
+ this.toText.forEach(t => {
4823
+ len + t.length > count ? (out.text.push(t.substr(0, count - len)), len = count) : (out.text.push(t), len += t.length);
4824
+ });
4825
+ } else out.text = this.toText.substr(0, count);
4826
+ }
4827
+ }
4784
4828
 
4785
4829
  const normalizeRectAttributes = attribute => {
4786
4830
  if (!attribute) return {
@@ -5630,6 +5674,20 @@ class Graphic extends Node {
5630
5674
  });
5631
5675
  return color && (nextAttributes[key] = color), !0;
5632
5676
  }
5677
+ if (Array.isArray(nextStepVal) && nextStepVal.length === lastStepVal.length) {
5678
+ const nextList = [];
5679
+ let valid = !0;
5680
+ for (let i = 0; i < nextStepVal.length; i++) {
5681
+ const v = lastStepVal[i],
5682
+ val = v + (nextStepVal[i] - v) * ratio;
5683
+ if (!Number.isFinite(val)) {
5684
+ valid = !1;
5685
+ break;
5686
+ }
5687
+ nextList.push(val);
5688
+ }
5689
+ valid && (nextAttributes[key] = nextList);
5690
+ }
5633
5691
  return !1;
5634
5692
  }
5635
5693
  _interpolate(key, ratio, lastStepVal, nextStepVal, nextAttributes) {}
@@ -10268,7 +10326,7 @@ class DefaultGroupBackgroundRenderContribution extends DefaultBaseBackgroundRend
10268
10326
  const defaultGroupBackgroundRenderContribution = new DefaultGroupBackgroundRenderContribution();
10269
10327
 
10270
10328
  const halfPi = pi / 2;
10271
- function createRectPath(path, x, y, width, height, rectCornerRadius, edgeCb) {
10329
+ function createRectPath(path, x, y, width, height, rectCornerRadius, roundCorner, edgeCb) {
10272
10330
  let cornerRadius;
10273
10331
  if (width < 0 && (x += width, width = -width), height < 0 && (y += height, height = -height), isNumber(rectCornerRadius, !0)) cornerRadius = [rectCornerRadius = abs(rectCornerRadius), rectCornerRadius, rectCornerRadius, rectCornerRadius];else if (Array.isArray(rectCornerRadius)) {
10274
10332
  const cornerRadiusArr = rectCornerRadius;
@@ -10300,27 +10358,29 @@ function createRectPath(path, x, y, width, height, rectCornerRadius, edgeCb) {
10300
10358
  rightBottomPoint2 = [rightBottom[0], rightBottom[1] - _cornerRadius[2]],
10301
10359
  leftBottomPoint1 = [leftBottom[0] + _cornerRadius[3], leftBottom[1]],
10302
10360
  leftBottomPoint2 = [leftBottom[0], leftBottom[1] - _cornerRadius[3]];
10303
- if (path.moveTo(leftTopPoint1[0], leftTopPoint1[1]), edgeCb && edgeCb[0] ? edgeCb[0](leftTopPoint1[0], leftTopPoint1[1], rightTopPoint1[0], rightTopPoint1[1]) : path.lineTo(rightTopPoint1[0], rightTopPoint1[1]), !arrayEqual(rightTopPoint1, rightTopPoint2)) {
10304
- edgeCb && edgeCb[0] && path.moveTo(rightTopPoint1[0], rightTopPoint1[1]);
10305
- const centerX = rightTopPoint1[0],
10306
- centerY = rightTopPoint1[1] + _cornerRadius[1];
10307
- path.arc(centerX, centerY, _cornerRadius[1], -halfPi, 0, !1);
10308
- }
10309
- if (edgeCb && edgeCb[1] ? edgeCb[1](rightTopPoint2[0], rightTopPoint2[1], rightBottomPoint2[0], rightBottomPoint2[1]) : path.lineTo(rightBottomPoint2[0], rightBottomPoint2[1]), !arrayEqual(rightBottomPoint1, rightBottomPoint2)) {
10310
- const centerX = rightBottomPoint2[0] - _cornerRadius[2],
10311
- centerY = rightBottomPoint2[1];
10312
- edgeCb && edgeCb[1] && path.moveTo(rightBottomPoint2[0], rightBottomPoint2[1]), path.arc(centerX, centerY, _cornerRadius[2], 0, halfPi, !1);
10313
- }
10314
- if (edgeCb && edgeCb[2] ? edgeCb[2](rightBottomPoint1[0], rightBottomPoint1[1], leftBottomPoint1[0], leftBottomPoint1[1]) : path.lineTo(leftBottomPoint1[0], leftBottomPoint1[1]), !arrayEqual(leftBottomPoint1, leftBottomPoint2)) {
10315
- const centerX = leftBottomPoint1[0],
10316
- centerY = leftBottomPoint1[1] - _cornerRadius[3];
10317
- edgeCb && edgeCb[2] && path.moveTo(leftBottomPoint1[0], leftBottomPoint1[1]), path.arc(centerX, centerY, _cornerRadius[3], halfPi, pi, !1);
10318
- }
10319
- if (edgeCb && edgeCb[3] ? edgeCb[3](leftBottomPoint2[0], leftBottomPoint2[1], leftTopPoint2[0], leftTopPoint2[1]) : path.lineTo(leftTopPoint2[0], leftTopPoint2[1]), !arrayEqual(leftTopPoint1, leftTopPoint2)) {
10320
- const centerX = leftTopPoint1[0],
10321
- centerY = leftTopPoint1[1] + _cornerRadius[0];
10322
- edgeCb && edgeCb[3] && path.moveTo(leftTopPoint2[0], leftTopPoint2[1]), path.arc(centerX, centerY, _cornerRadius[0], pi, pi + halfPi, !1);
10323
- }
10361
+ if (path.moveTo(leftTopPoint1[0], leftTopPoint1[1]), roundCorner) {
10362
+ if (edgeCb && edgeCb[0] ? edgeCb[0](leftTopPoint1[0], leftTopPoint1[1], rightTopPoint1[0], rightTopPoint1[1]) : path.lineTo(rightTopPoint1[0], rightTopPoint1[1]), !arrayEqual(rightTopPoint1, rightTopPoint2)) {
10363
+ edgeCb && edgeCb[0] && path.moveTo(rightTopPoint1[0], rightTopPoint1[1]);
10364
+ const centerX = rightTopPoint1[0],
10365
+ centerY = rightTopPoint1[1] + _cornerRadius[1];
10366
+ path.arc(centerX, centerY, _cornerRadius[1], -halfPi, 0, !1);
10367
+ }
10368
+ if (edgeCb && edgeCb[1] ? edgeCb[1](rightTopPoint2[0], rightTopPoint2[1], rightBottomPoint2[0], rightBottomPoint2[1]) : path.lineTo(rightBottomPoint2[0], rightBottomPoint2[1]), !arrayEqual(rightBottomPoint1, rightBottomPoint2)) {
10369
+ const centerX = rightBottomPoint2[0] - _cornerRadius[2],
10370
+ centerY = rightBottomPoint2[1];
10371
+ edgeCb && edgeCb[1] && path.moveTo(rightBottomPoint2[0], rightBottomPoint2[1]), path.arc(centerX, centerY, _cornerRadius[2], 0, halfPi, !1);
10372
+ }
10373
+ if (edgeCb && edgeCb[2] ? edgeCb[2](rightBottomPoint1[0], rightBottomPoint1[1], leftBottomPoint1[0], leftBottomPoint1[1]) : path.lineTo(leftBottomPoint1[0], leftBottomPoint1[1]), !arrayEqual(leftBottomPoint1, leftBottomPoint2)) {
10374
+ const centerX = leftBottomPoint1[0],
10375
+ centerY = leftBottomPoint1[1] - _cornerRadius[3];
10376
+ edgeCb && edgeCb[2] && path.moveTo(leftBottomPoint1[0], leftBottomPoint1[1]), path.arc(centerX, centerY, _cornerRadius[3], halfPi, pi, !1);
10377
+ }
10378
+ if (edgeCb && edgeCb[3] ? edgeCb[3](leftBottomPoint2[0], leftBottomPoint2[1], leftTopPoint2[0], leftTopPoint2[1]) : path.lineTo(leftTopPoint2[0], leftTopPoint2[1]), !arrayEqual(leftTopPoint1, leftTopPoint2)) {
10379
+ const centerX = leftTopPoint1[0],
10380
+ centerY = leftTopPoint1[1] + _cornerRadius[0];
10381
+ edgeCb && edgeCb[3] && path.moveTo(leftTopPoint2[0], leftTopPoint2[1]), path.arc(centerX, centerY, _cornerRadius[0], pi, pi + halfPi, !1);
10382
+ }
10383
+ } else edgeCb && edgeCb[0] ? edgeCb[0](leftTopPoint1[0], leftTopPoint1[1], rightTopPoint1[0], rightTopPoint1[1]) : path.lineTo(rightTopPoint1[0], rightTopPoint1[1]), edgeCb && edgeCb[1] ? edgeCb[1](rightTopPoint1[0], rightTopPoint1[1], rightBottomPoint1[0], rightBottomPoint1[1]) : path.lineTo(rightBottomPoint1[0], rightBottomPoint1[1]), edgeCb && edgeCb[2] ? edgeCb[2](rightBottomPoint1[0], rightBottomPoint1[1], leftBottomPoint1[0], leftBottomPoint1[1]) : path.lineTo(leftBottomPoint1[0], leftBottomPoint1[1]), edgeCb && edgeCb[2] ? edgeCb[2](leftBottomPoint1[0], leftBottomPoint1[1], leftTopPoint1[0], leftTopPoint1[1]) : path.lineTo(leftTopPoint1[0], leftTopPoint1[1]);
10324
10384
  return !edgeCb && path.closePath(), path;
10325
10385
  }
10326
10386
 
@@ -10345,6 +10405,7 @@ class DefaultRectRenderContribution {
10345
10405
  if (!doOuterBorder && !doInnerBorder) return;
10346
10406
  const {
10347
10407
  cornerRadius = rectAttribute.cornerRadius,
10408
+ cornerType = rectAttribute.cornerType,
10348
10409
  opacity = rectAttribute.opacity,
10349
10410
  x: originX = rectAttribute.x,
10350
10411
  y: originY = rectAttribute.y,
@@ -10369,7 +10430,7 @@ class DefaultRectRenderContribution {
10369
10430
  nextX = x + sign * d,
10370
10431
  nextY = y + sign * d,
10371
10432
  dw = 2 * d;
10372
- if (0 === cornerRadius || isArray(cornerRadius) && cornerRadius.every(num => 0 === num) ? (context.beginPath(), context.rect(nextX, nextY, width - sign * dw, height - sign * dw)) : (context.beginPath(), createRectPath(context, nextX, nextY, width - sign * dw, height - sign * dw, cornerRadius)), context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute), strokeCb) strokeCb(context, borderStyle, rectAttribute[key]);else if (doStroke) {
10433
+ if (0 === cornerRadius || isArray(cornerRadius) && cornerRadius.every(num => 0 === num) ? (context.beginPath(), context.rect(nextX, nextY, width - sign * dw, height - sign * dw)) : (context.beginPath(), createRectPath(context, nextX, nextY, width - sign * dw, height - sign * dw, cornerRadius, "round" === cornerType)), context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute), strokeCb) strokeCb(context, borderStyle, rectAttribute[key]);else if (doStroke) {
10373
10434
  const lastOpacity = rectAttribute[key].opacity;
10374
10435
  rectAttribute[key].opacity = opacity, context.setStrokeStyle(rect, borderStyle, (originX - x) / scaleX, (originY - y) / scaleY, rectAttribute[key]), rectAttribute[key].opacity = lastOpacity, context.stroke();
10375
10436
  }
@@ -10400,7 +10461,8 @@ let SplitRectAfterRenderContribution = class {
10400
10461
  x: originX = groupAttribute.x,
10401
10462
  y: originY = groupAttribute.y,
10402
10463
  stroke = groupAttribute.stroke,
10403
- cornerRadius = groupAttribute.cornerRadius
10464
+ cornerRadius = groupAttribute.cornerRadius,
10465
+ cornerType = groupAttribute.cornerType
10404
10466
  } = rect.attribute;
10405
10467
  let {
10406
10468
  width: width,
@@ -10410,7 +10472,7 @@ let SplitRectAfterRenderContribution = class {
10410
10472
  if (context.setStrokeStyle(rect, rect.attribute, x, y, groupAttribute), !(0 === cornerRadius || isArray(cornerRadius) && cornerRadius.every(num => 0 === num))) {
10411
10473
  let lastStroke,
10412
10474
  lastStrokeI = 0;
10413
- return createRectPath(context, x, y, width, height, cornerRadius, new Array(4).fill(0).map((_, i) => (x1, y1, x2, y2) => {
10475
+ return createRectPath(context, x, y, width, height, cornerRadius, "round" === cornerType, new Array(4).fill(0).map((_, i) => (x1, y1, x2, y2) => {
10414
10476
  stroke[i] && (lastStrokeI === i - 1 && stroke[i] === lastStroke || (context.setStrokeStyle(rect, Object.assign(Object.assign({}, rect.attribute), {
10415
10477
  stroke: stroke[i]
10416
10478
  }), x, y, groupAttribute), context.beginPath(), context.moveTo(x1, y1), lastStroke = stroke[i]), lastStrokeI = i, context.lineTo(x2, y2), context.stroke(), 3 === i && context.beginPath());
@@ -10469,7 +10531,7 @@ class DefaultImageBackgroundRenderContribution extends DefaultBaseBackgroundRend
10469
10531
  width: width,
10470
10532
  height: height
10471
10533
  } = getActualPosition(graphic);
10472
- cornerRadius ? createRectPath(context, x - expandX, y - expandY, width + 2 * expandX, height + 2 * expandY, cornerRadius) : context.rect(x - expandX, y - expandY, width + 2 * expandX, height + 2 * expandY), context.globalAlpha = 1, fill && (context.fillStyle = fill, context.fill()), stroke && lineWidth > 0 && (context.lineWidth = lineWidth, context.strokeStyle = stroke, context.stroke());
10534
+ cornerRadius ? createRectPath(context, x - expandX, y - expandY, width + 2 * expandX, height + 2 * expandY, cornerRadius, !0) : context.rect(x - expandX, y - expandY, width + 2 * expandX, height + 2 * expandY), context.globalAlpha = 1, fill && (context.fillStyle = fill, context.fill()), stroke && lineWidth > 0 && (context.lineWidth = lineWidth, context.strokeStyle = stroke, context.stroke());
10473
10535
  } else {
10474
10536
  context.beginPath();
10475
10537
  const b = graphic.AABBBounds;
@@ -11574,6 +11636,7 @@ let DefaultCanvasRectRender = class extends BaseRender {
11574
11636
  background: background,
11575
11637
  stroke = rectAttribute.stroke,
11576
11638
  cornerRadius = rectAttribute.cornerRadius,
11639
+ cornerType = rectAttribute.cornerType,
11577
11640
  opacity = rectAttribute.opacity,
11578
11641
  fillOpacity = rectAttribute.fillOpacity,
11579
11642
  lineWidth = rectAttribute.lineWidth,
@@ -11597,7 +11660,7 @@ let DefaultCanvasRectRender = class extends BaseRender {
11597
11660
  if (!rect.valid || !visible) return;
11598
11661
  if (!doFill && !doStroke) return;
11599
11662
  if (!(fVisible || sVisible || fillCb || strokeCb || background)) return;
11600
- 0 === cornerRadius || isArray(cornerRadius) && cornerRadius.every(num => 0 === num) ? (context.beginPath(), context.rect(x, y, width, height)) : (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius));
11663
+ 0 === cornerRadius || isArray(cornerRadius) && cornerRadius.every(num => 0 === num) ? (context.beginPath(), context.rect(x, y, width, height)) : (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius, "round" === cornerType));
11601
11664
  const doFillOrStroke = {
11602
11665
  doFill: doFill,
11603
11666
  doStroke: doStroke
@@ -11775,7 +11838,7 @@ class DefaultTextBackgroundRenderContribution extends DefaultBaseBackgroundRende
11775
11838
  const {
11776
11839
  backgroundCornerRadius: backgroundCornerRadius
11777
11840
  } = graphic.attribute;
11778
- context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = background, backgroundCornerRadius ? (createRectPath(context, b.x1, b.y1, b.width(), b.height(), backgroundCornerRadius), context.fill()) : context.fillRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore();
11841
+ context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = background, backgroundCornerRadius ? (createRectPath(context, b.x1, b.y1, b.width(), b.height(), backgroundCornerRadius, !0), context.fill()) : context.fillRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore();
11779
11842
  }
11780
11843
  shouldReCalBounds && boundsAllocate.free(b), restore();
11781
11844
  }
@@ -12076,6 +12139,7 @@ let DefaultCanvasGroupRender = class {
12076
12139
  lineWidth = groupAttribute.lineWidth,
12077
12140
  visible = groupAttribute.visible,
12078
12141
  fillStrokeOrder = groupAttribute.fillStrokeOrder,
12142
+ cornerType = groupAttribute.cornerType,
12079
12143
  x: originX = groupAttribute.x,
12080
12144
  y: originY = groupAttribute.y
12081
12145
  } = group.attribute,
@@ -12095,7 +12159,7 @@ let DefaultCanvasGroupRender = class {
12095
12159
  context.disableFill = !0, context.disableStroke = !0, context.disableBeginPath = !0, path.forEach(g => {
12096
12160
  drawContext.drawContribution.getRenderContribution(g).draw(g, drawContext.renderService, drawContext, params);
12097
12161
  }), context.disableFill = disableFill, context.disableStroke = disableStroke, context.disableBeginPath = disableBeginPath;
12098
- } else 0 === cornerRadius || isArray(cornerRadius) && cornerRadius.every(num => 0 === num) ? (context.beginPath(), context.rect(x, y, width, height)) : (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius));
12162
+ } else 0 === cornerRadius || isArray(cornerRadius) && cornerRadius.every(num => 0 === num) ? (context.beginPath(), context.rect(x, y, width, height)) : (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius, "round" === cornerType));
12099
12163
  this._groupRenderContribitions || (this._groupRenderContribitions = this.groupRenderContribitions.getContributions() || [], this._groupRenderContribitions.push(defaultGroupBackgroundRenderContribution));
12100
12164
  const doFillOrStroke = {
12101
12165
  doFill: doFill,
@@ -12177,6 +12241,7 @@ let DefaultCanvasImageRender = class extends BaseRender {
12177
12241
  y: originY = imageAttribute.y,
12178
12242
  cornerRadius = imageAttribute.cornerRadius,
12179
12243
  fillStrokeOrder = imageAttribute.fillStrokeOrder,
12244
+ cornerType = imageAttribute.cornerType,
12180
12245
  image: url
12181
12246
  } = image.attribute,
12182
12247
  data = this.valid(image, imageAttribute, fillCb);
@@ -12194,7 +12259,7 @@ let DefaultCanvasImageRender = class extends BaseRender {
12194
12259
  const res = image.resources.get(url);
12195
12260
  if ("success" !== res.state) return;
12196
12261
  let needRestore = !1;
12197
- 0 === cornerRadius || isArray(cornerRadius) && cornerRadius.every(num => 0 === num) || (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius), context.save(), context.clip(), needRestore = !0), context.setCommonStyle(image, image.attribute, x, y, imageAttribute);
12262
+ 0 === cornerRadius || isArray(cornerRadius) && cornerRadius.every(num => 0 === num) || (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius, "round" === cornerType), context.save(), context.clip(), needRestore = !0), context.setCommonStyle(image, image.attribute, x, y, imageAttribute);
12198
12263
  let repeat = 0;
12199
12264
  if ("repeat" === repeatX && (repeat |= 1), "repeat" === repeatY && (repeat |= 2), repeat) {
12200
12265
  const pattern = context.createPattern(res.data, repeatStr[repeat]);
@@ -12315,10 +12380,7 @@ class ShadowRootDrawItemInterceptorContribution {
12315
12380
  const {
12316
12381
  context: context
12317
12382
  } = drawContext;
12318
- context.highPerformanceSave();
12319
- const t1 = graphic.parent.globalTransMatrix,
12320
- t2 = graphic.stage.window.getViewBoxTransform().clone().multiply(t1.a, t1.b, t1.c, t1.d, t1.e, t1.f);
12321
- if (graphic.parent && context.setTransformFromMatrix(t2, !0), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds) {
12383
+ if (context.highPerformanceSave(), context.transformFromMatrix(graphic.transMatrix, !0), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds) {
12322
12384
  tempDirtyBounds.copy(drawContribution.dirtyBounds), tempBackupDirtyBounds.copy(drawContribution.backupDirtyBounds);
12323
12385
  const m = graphic.globalTransMatrix.getInverse();
12324
12386
  drawContribution.dirtyBounds.copy(drawContribution.backupDirtyBounds).transformWithMatrix(m), drawContribution.backupDirtyBounds.copy(drawContribution.dirtyBounds);
@@ -13472,7 +13534,7 @@ let DefaultCanvasRichTextRender = class extends BaseRender {
13472
13534
  if (margin && (x += icon._marginArray[3], y += icon._marginArray[0]), icon._hovered) {
13473
13535
  const expandX = (backgroundWidth - width) / 2,
13474
13536
  expandY = (backgroundHeight - height) / 2;
13475
- 0 === backgroundRadius ? (context.beginPath(), context.rect(x - expandX, y - expandY, backgroundWidth, backgroundHeight)) : (context.beginPath(), createRectPath(context, x - expandX, y - expandY, backgroundWidth, backgroundHeight, backgroundRadius)), backgroundFill && (context.globalAlpha = backgroundFillOpacity, context.fillStyle = backgroundFill, context.fill()), backgroundStroke && (context.globalAlpha = backgroundStrokeOpacity, context.strokeStyle = backgroundStroke, context.stroke());
13537
+ 0 === backgroundRadius ? (context.beginPath(), context.rect(x - expandX, y - expandY, backgroundWidth, backgroundHeight)) : (context.beginPath(), createRectPath(context, x - expandX, y - expandY, backgroundWidth, backgroundHeight, backgroundRadius, !0)), backgroundFill && (context.globalAlpha = backgroundFillOpacity, context.fillStyle = backgroundFill, context.fill()), backgroundStroke && (context.globalAlpha = backgroundStrokeOpacity, context.strokeStyle = backgroundStroke, context.stroke());
13476
13538
  }
13477
13539
  const res = url && (null === (_a = null == icon ? void 0 : icon.resources) || void 0 === _a ? void 0 : _a.get(url));
13478
13540
  res && "success" === res.state && (context.globalAlpha = opacity, context.drawImage(res.data, x, y, width, height));
@@ -15854,6 +15916,20 @@ function setPoptipTheme(defaultPoptipTheme) {
15854
15916
 
15855
15917
  const _tBounds = new AABBBounds();
15856
15918
  loadPoptipComponent();
15919
+ const tlStr = 'M -0.5 -0.5, L -0.5 0.5, L 0.5 -0.5, Z';
15920
+ const blStr = 'M -0.5 -0.5, L -0.5 0.5, L 0.5 0.5, Z';
15921
+ const trStr = 'M -0.5 -0.5, L 0.5 -0.5, L 0.5 0.5, Z';
15922
+ const brStr = 'M 0.5 -0.5, L 0.5 0.5, L -0.5 0.5, Z';
15923
+ const conciseSymbolMap = {
15924
+ tl: tlStr,
15925
+ tr: trStr,
15926
+ bl: blStr,
15927
+ br: brStr,
15928
+ lt: tlStr,
15929
+ lb: blStr,
15930
+ rt: trStr,
15931
+ rb: brStr
15932
+ };
15857
15933
  class PopTip extends AbstractComponent {
15858
15934
  constructor(attributes, options) {
15859
15935
  super((options === null || options === void 0 ? void 0 : options.skipDefault) ? attributes : merge({}, PopTip.defaultAttributes, attributes));
@@ -15861,13 +15937,14 @@ class PopTip extends AbstractComponent {
15861
15937
  this.positionList = ['top', 'tl', 'tr', 'bottom', 'bl', 'br', 'left', 'lt', 'lb', 'right', 'rt', 'rb'];
15862
15938
  }
15863
15939
  render() {
15864
- var _a, _b, _c, _d, _e, _f, _g, _h;
15865
- const { titleStyle = {}, position, contentStyle = {}, panel = {}, space = 4, minWidth = 0, maxWidth = Infinity, padding = 4, maxWidthPercent, visible, state, dx = 0, dy = 0 } = this.attribute;
15940
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
15941
+ const { titleStyle = {}, position, contentStyle = {}, panel, logoSymbol, logoText, logoTextStyle = {}, triangleMode = 'default', space = 4, minWidth = 0, maxWidth = Infinity, padding = 4, maxWidthPercent, visible, state, dx = 0, dy = 0 } = this.attribute;
15866
15942
  let { title = '', content = '' } = this.attribute;
15867
15943
  title = this.attribute.titleFormatMethod ? this.attribute.titleFormatMethod(title) : title;
15868
15944
  content = this.attribute.contentFormatMethod ? this.attribute.contentFormatMethod(content) : content;
15869
15945
  const parsedPadding = normalizePadding(padding);
15870
15946
  const group = this.createOrUpdateChild('poptip-content', { x: 0, y: 0, zIndex: 1 }, 'group');
15947
+ this.group = group;
15871
15948
  const maxLineWidth = maxWidth - parsedPadding[1] - parsedPadding[3];
15872
15949
  const titleVisible = isValid(title) && visible !== false;
15873
15950
  const titleAttrs = Object.assign(Object.assign({ text: isArray(title) ? title : [title], visible: titleVisible, wrap: true }, titleStyle), { x: parsedPadding[3], y: parsedPadding[0], maxLineWidth, textAlign: 'left', textBaseline: 'top' });
@@ -15894,6 +15971,8 @@ class PopTip extends AbstractComponent {
15894
15971
  if (contentVisible) {
15895
15972
  height += contentHeight;
15896
15973
  }
15974
+ this.titleShape = titleShape;
15975
+ this.contentShape = contentShape;
15897
15976
  let popTipWidth = max(titleWidth + parsedPadding[1] + parsedPadding[3], contentWidth + parsedPadding[1] + parsedPadding[3]);
15898
15977
  if (popTipWidth > maxWidth) {
15899
15978
  popTipWidth = maxWidth;
@@ -15902,7 +15981,15 @@ class PopTip extends AbstractComponent {
15902
15981
  popTipWidth = minWidth;
15903
15982
  }
15904
15983
  let poptipHeight = parsedPadding[0] + parsedPadding[2] + height;
15905
- const { visible: bgVisible } = panel, backgroundStyle = __rest(panel, ["visible"]);
15984
+ const { visible: bgVisible, square } = panel, backgroundStyle = __rest(panel, ["visible", "square"]);
15985
+ if (square) {
15986
+ const maxWH = max(popTipWidth, poptipHeight);
15987
+ popTipWidth = maxWH;
15988
+ const deltaH = maxWH - poptipHeight;
15989
+ poptipHeight = maxWH;
15990
+ titleShape.setAttributes({ dy: deltaH / 2 });
15991
+ contentShape.setAttributes({ dy: deltaH / 2 });
15992
+ }
15906
15993
  const symbolSize = (_a = backgroundStyle.size) !== null && _a !== void 0 ? _a : 12;
15907
15994
  const spaceSize = isArray(symbolSize)
15908
15995
  ? [symbolSize[0] + ((_b = backgroundStyle.space) !== null && _b !== void 0 ? _b : 0), symbolSize[1] + ((_c = backgroundStyle.space) !== null && _c !== void 0 ? _c : 0)]
@@ -15938,22 +16025,62 @@ class PopTip extends AbstractComponent {
15938
16025
  let maxBBoxSize = -Infinity;
15939
16026
  for (let i = 0; i < this.positionList.length + 1; i++) {
15940
16027
  const p = layout ? this.positionList[i === this.positionList.length ? maxBBoxI : i] : position;
15941
- const { angle, offset, rectOffset } = this.getAngleAndOffset(p, popTipWidth, poptipHeight, isArray(spaceSize) ? spaceSize : [spaceSize, spaceSize - lineWidth]);
16028
+ let symbolType = 'arrow2Left';
16029
+ let offsetX = (isArray(symbolSize) ? symbolSize[0] : symbolSize) / 4;
16030
+ let offsetY = 0;
16031
+ if (p === 'top' || p === 'bottom' || p === 'left' || p === 'right') {
16032
+ symbolType = 'arrow2Left';
16033
+ }
16034
+ else if (triangleMode === 'concise') {
16035
+ symbolType = conciseSymbolMap[p];
16036
+ offsetX = ['tl', 'bl', 'rt', 'rb'].includes(position)
16037
+ ? (isArray(symbolSize) ? symbolSize[0] : symbolSize) / 2
16038
+ : -(isArray(symbolSize) ? symbolSize[0] : symbolSize) / 2;
16039
+ offsetY = ['tl', 'tr', 'lb', 'rb'].includes(position)
16040
+ ? -(isArray(symbolSize) ? symbolSize[1] : symbolSize) / 2
16041
+ : (isArray(symbolSize) ? symbolSize[1] : symbolSize) / 2;
16042
+ }
16043
+ const { angle, offset } = this.getAngleAndOffset(p, popTipWidth, poptipHeight, isArray(spaceSize) ? spaceSize : [spaceSize, spaceSize - lineWidth], symbolType);
15942
16044
  if (isBoolean(bgVisible)) {
15943
- const offsetX = (isArray(symbolSize) ? symbolSize[0] : symbolSize) / 4;
15944
- const bgSymbol = group.createOrUpdateChild('poptip-symbol-panel', Object.assign(Object.assign({}, backgroundStyle), { visible: bgVisible && (contentVisible || titleVisible), x: offsetX, y: 0, strokeBoundsBuffer: -1, boundsPadding: -2, anchor: [0, 0], symbolType: 'arrow2Left', angle: angle, dx: offset[0], dy: offset[1], size: symbolSize, zIndex: -9 }), 'symbol');
16045
+ const bgSymbol = group.createOrUpdateChild('poptip-symbol-panel', Object.assign(Object.assign({}, backgroundStyle), { visible: bgVisible && (contentVisible || titleVisible), x: offsetX, y: offsetY, strokeBoundsBuffer: -1, boundsPadding: -2, anchor: [0, 0], symbolType, angle: angle, dx: offset[0], dy: offset[1] - ((_j = backgroundStyle.space) !== null && _j !== void 0 ? _j : 0), size: symbolSize, zIndex: 9 }), 'symbol');
15945
16046
  if (!isEmpty(state === null || state === void 0 ? void 0 : state.panel)) {
15946
16047
  bgSymbol.states = state.panel;
15947
16048
  }
15948
- const bgRect = group.createOrUpdateChild('poptip-rect-panel', Object.assign(Object.assign({}, backgroundStyle), { visible: bgVisible && (contentVisible || titleVisible), x: 0, y: 0, width: popTipWidth, height: poptipHeight, zIndex: -8 }), 'rect');
16049
+ let bgRect;
16050
+ if (panel.panelSymbolType) {
16051
+ bgRect = group.createOrUpdateChild('poptip-rect-panel', Object.assign(Object.assign({}, backgroundStyle), { visible: bgVisible && (contentVisible || titleVisible), x: 0, y: 0, symbolType: 'rect', size: [popTipWidth, poptipHeight], zIndex: -8 }), 'symbol');
16052
+ }
16053
+ else {
16054
+ bgRect = group.createOrUpdateChild('poptip-rect-panel', Object.assign(Object.assign({}, backgroundStyle), { visible: bgVisible && (contentVisible || titleVisible), x: 0, y: 0, width: popTipWidth, height: poptipHeight, zIndex: -8 }), 'rect');
16055
+ }
15949
16056
  if (!isEmpty(state === null || state === void 0 ? void 0 : state.panel)) {
15950
16057
  bgRect.states = state.panel;
15951
16058
  }
15952
16059
  }
15953
16060
  group.setAttributes({
15954
16061
  x: -offset[0] + dx,
15955
- y: -offset[1] + dy
16062
+ y: -offset[1] + dy,
16063
+ anchor: [offsetX, offsetY]
15956
16064
  });
16065
+ if (logoSymbol) {
16066
+ const { size = 12 } = logoSymbol;
16067
+ const sizeArray = isArray(size) ? size : [size, size];
16068
+ if (sizeArray[1] === 'auto') {
16069
+ sizeArray[1] = poptipHeight;
16070
+ }
16071
+ if (sizeArray[0] === 'auto') {
16072
+ sizeArray[0] = poptipHeight;
16073
+ }
16074
+ const sizeW = sizeArray[0];
16075
+ group.createOrUpdateChild('poptip-logo', Object.assign(Object.assign({}, logoSymbol), { x: 0, y: poptipHeight / 2, visible: bgVisible && (contentVisible || titleVisible), zIndex: 10, size: sizeArray }), 'symbol');
16076
+ group.setAttributes({
16077
+ x: -offset[0] + dx + sizeW / 2,
16078
+ y: -offset[1] + dy
16079
+ });
16080
+ if (logoText) {
16081
+ group.createOrUpdateChild('poptip-logo-text', Object.assign(Object.assign({}, logoTextStyle), { x: 0, y: poptipHeight / 2, visible: bgVisible && (contentVisible || titleVisible), text: logoText, textAlign: 'center', textBaseline: 'middle', zIndex: 10 }), 'text');
16082
+ }
16083
+ }
15957
16084
  if (layout && range) {
15958
16085
  _tBounds.setValue(0, 0, popTipWidth, poptipHeight).transformWithMatrix(group.globalTransMatrix);
15959
16086
  const b = _tBounds;
@@ -15975,47 +16102,85 @@ class PopTip extends AbstractComponent {
15975
16102
  }
15976
16103
  }
15977
16104
  }
15978
- getAngleAndOffset(position, width, height, size) {
15979
- const sizeH = size[1] / 2;
16105
+ getAngleAndOffset(position, width, height, size, symbolType) {
16106
+ const sizeH = symbolType === 'arrow2Left' ? size[1] / 2 : size[1];
15980
16107
  switch (position) {
15981
16108
  case 'tl':
15982
16109
  return {
15983
- angle: (pi / 2) * 3,
15984
- offset: [width / 4, height + sizeH],
15985
- rectOffset: [-width / 4, -height - size[1]]
16110
+ angle: symbolType === 'arrow2Left' ? (pi / 2) * 3 : 0,
16111
+ offset: symbolType === 'arrow2Left' ? [width / 4, height + sizeH] : [0, height + sizeH]
15986
16112
  };
15987
16113
  case 'top':
15988
- return { angle: (pi / 2) * 3, offset: [width / 2, height + sizeH], rectOffset: [0, -height - size[1]] };
16114
+ return { angle: (pi / 2) * 3, offset: [width / 2, height + sizeH] };
15989
16115
  case 'tr':
15990
16116
  return {
15991
- angle: (pi / 2) * 3,
15992
- offset: [(width / 4) * 3, height + sizeH],
15993
- rectOffset: [(width / 4) * 3, -height - size[1]]
16117
+ angle: symbolType === 'arrow2Left' ? (pi / 2) * 3 : 0,
16118
+ offset: symbolType === 'arrow2Left' ? [(width / 4) * 3, height + sizeH] : [width, height + sizeH]
15994
16119
  };
15995
16120
  case 'rt':
15996
- return { angle: 0, offset: [-sizeH, height / 5], rectOffset: [(width / 4) * 3, -height - size[1]] };
16121
+ return {
16122
+ angle: 0,
16123
+ offset: symbolType === 'arrow2Left' ? [-sizeH, height / 5] : [-sizeH, 0]
16124
+ };
15997
16125
  case 'right':
15998
- return { angle: 0, offset: [-sizeH, height / 2], rectOffset: [(width / 4) * 3, -height - size[1]] };
16126
+ return { angle: 0, offset: [-sizeH, height / 2] };
15999
16127
  case 'rb':
16000
- return { angle: 0, offset: [-sizeH, (height / 5) * 4], rectOffset: [(width / 4) * 3, -height - size[1]] };
16128
+ return {
16129
+ angle: 0,
16130
+ offset: symbolType === 'arrow2Left' ? [-sizeH, (height / 5) * 4] : [-sizeH, height]
16131
+ };
16001
16132
  case 'bl':
16002
- return { angle: pi / 2, offset: [width / 4, -sizeH], rectOffset: [-width / 4, -height - size[1]] };
16133
+ return {
16134
+ angle: symbolType === 'arrow2Left' ? pi / 2 : 0,
16135
+ offset: symbolType === 'arrow2Left' ? [width / 4, -sizeH] : [0, -sizeH]
16136
+ };
16003
16137
  case 'bottom':
16004
- return { angle: pi / 2, offset: [width / 2, -sizeH], rectOffset: [0, -height - size[1]] };
16138
+ return { angle: pi / 2, offset: [width / 2, -sizeH] };
16005
16139
  case 'br':
16006
- return { angle: pi / 2, offset: [(width / 4) * 3, -sizeH], rectOffset: [(width / 4) * 3, -height - size[1]] };
16140
+ return {
16141
+ angle: symbolType === 'arrow2Left' ? pi / 2 : 0,
16142
+ offset: symbolType === 'arrow2Left' ? [(width / 4) * 3, -sizeH] : [width, -sizeH]
16143
+ };
16007
16144
  case 'lt':
16008
- return { angle: pi, offset: [width + sizeH, height / 5], rectOffset: [-width / 4, -height - size[1]] };
16145
+ return {
16146
+ angle: symbolType === 'arrow2Left' ? pi : 0,
16147
+ offset: symbolType === 'arrow2Left' ? [width + sizeH, height / 5] : [width + sizeH, 0]
16148
+ };
16009
16149
  case 'left':
16010
- return { angle: pi, offset: [width + sizeH, height / 2], rectOffset: [0, -height - size[1]] };
16150
+ return { angle: pi, offset: [width + sizeH, height / 2] };
16011
16151
  case 'lb':
16012
16152
  return {
16013
- angle: pi,
16014
- offset: [width + sizeH, (height / 5) * 4],
16015
- rectOffset: [(width / 4) * 3, -height - size[1]]
16153
+ angle: symbolType === 'arrow2Left' ? pi : 0,
16154
+ offset: symbolType === 'arrow2Left' ? [width + sizeH, (height / 5) * 4] : [width + sizeH, height]
16016
16155
  };
16017
16156
  }
16018
16157
  }
16158
+ appearAnimate(animateConfig) {
16159
+ const { duration = 1000, easing = 'quadOut' } = animateConfig;
16160
+ this.setAttributes({ scaleX: 0, scaleY: 0 });
16161
+ this.animate().to({ scaleX: 1, scaleY: 1 }, (duration / 3) * 2, easing);
16162
+ this.titleShape &&
16163
+ this.titleShape
16164
+ .animate()
16165
+ .play(new InputText({ text: '' }, { text: this.titleShape.attribute.text }, duration, easing));
16166
+ this.contentShape &&
16167
+ this.contentShape
16168
+ .animate()
16169
+ .play(new InputText({ text: '' }, { text: this.contentShape.attribute.text }, duration, easing));
16170
+ if (animateConfig.wave) {
16171
+ const dur = duration / 6;
16172
+ this.group
16173
+ .animate()
16174
+ .to({ angle: animateConfig.wave }, dur, easing)
16175
+ .to({ angle: -animateConfig.wave }, dur * 2, easing)
16176
+ .to({ angle: animateConfig.wave }, dur * 2, easing)
16177
+ .to({ angle: 0 }, dur, easing);
16178
+ }
16179
+ }
16180
+ disappearAnimate(animateConfig) {
16181
+ const { duration = 1000, easing = 'quadOut' } = animateConfig;
16182
+ this.animate().to({ scaleX: 0, scaleY: 0 }, duration, easing);
16183
+ }
16019
16184
  }
16020
16185
  PopTip.defaultAttributes = {
16021
16186
  position: 'rt',
@@ -16034,6 +16199,7 @@ PopTip.defaultAttributes = {
16034
16199
  textAlign: 'left',
16035
16200
  textBaseline: 'top'
16036
16201
  },
16202
+ panel: {},
16037
16203
  maxWidthPercent: 0.8,
16038
16204
  space: 8,
16039
16205
  padding: 10
@@ -17062,7 +17228,7 @@ function shiftY(texts, option) {
17062
17228
  if (globalShiftY.enable !== false) {
17063
17229
  const { maxIterations = 10, maxError = 0.1, padding = 1, maxAttempts = 1000, deltaYTolerance = Number.MAX_VALUE } = globalShiftY;
17064
17230
  for (let iter = 0; iter < maxIterations; iter++) {
17065
- texts.sort((a, b) => getY1(a) - getY1(b));
17231
+ texts.sort((a, b) => getY1Initial(a) - getY1Initial(b));
17066
17232
  let error = 0;
17067
17233
  for (let i = 0; i < n - 1; i++) {
17068
17234
  const curText = texts[i];
@@ -17618,7 +17784,7 @@ class LabelBase extends AbstractComponent {
17618
17784
  }
17619
17785
  return this.getRootNode().find(node => node.name === baseMarkGroupName, true);
17620
17786
  }
17621
- getGraphicBounds(graphic, point = {}) {
17787
+ getGraphicBounds(graphic, point = {}, position) {
17622
17788
  if (graphic) {
17623
17789
  if (graphic.attribute.visible !== false) {
17624
17790
  return graphic.AABBBounds;
@@ -17626,6 +17792,15 @@ class LabelBase extends AbstractComponent {
17626
17792
  const { x, y } = graphic.attribute;
17627
17793
  return { x1: x, x2: x, y1: y, y2: y };
17628
17794
  }
17795
+ if (point && position && position === 'inside-middle') {
17796
+ const { x, y, x1 = x, y1 = y } = point;
17797
+ return {
17798
+ x1: (x + x1) / 2,
17799
+ x2: (x + x1) / 2,
17800
+ y1: (y + y1) / 2,
17801
+ y2: (y + y1) / 2
17802
+ };
17803
+ }
17629
17804
  const { x, y } = point;
17630
17805
  return { x1: x, x2: x, y1: y, y2: y };
17631
17806
  }
@@ -30519,6 +30694,204 @@ WeatherBox.defaultAttributes = {
30519
30694
  snowRainBottomPadding: 0
30520
30695
  };
30521
30696
 
30522
- const version = "0.21.2-vstory.1";
30697
+ class StoryLabelItem extends AbstractComponent {
30698
+ constructor(attributes, options) {
30699
+ super((options === null || options === void 0 ? void 0 : options.skipDefault) ? attributes : merge({}, StoryLabelItem.defaultAttributes, attributes));
30700
+ }
30701
+ render() {
30702
+ const { contentOffsetX, contentOffsetY, lineStyle, symbolStartStyle, symbolEndStyle, symbolStartOuterStyle, titleTop: titleTopText, titleBottom: titleBottomText, titleTopStyle, titleBottomStyle, titleSpace, titleTopPanelStyle, titleBottomPanelStyle, theme } = this.attribute;
30703
+ const group = this.createOrUpdateChild('label-item-container', { x: 0, y: 0, zIndex: 1 }, 'group');
30704
+ const symbolStart = group.createOrUpdateChild('label-item-symbol-start', Object.assign({ x: 0, y: 0 }, symbolStartStyle), 'symbol');
30705
+ const symbolEnd = group.createOrUpdateChild('label-item-symbol-end', Object.assign({ x: contentOffsetX, y: contentOffsetY }, symbolEndStyle), 'symbol');
30706
+ const symbolStartOut = group.createOrUpdateChild('label-item-symbol-start-out', Object.assign({ x: 0, y: 0 }, symbolStartOuterStyle), 'symbol');
30707
+ const spaceW = titleSpace[0];
30708
+ const spaceH = titleSpace[1];
30709
+ const titleTopGroup = group.createOrUpdateChild('label-item-title-top-group', { x: contentOffsetX, y: contentOffsetY, clip: true }, 'group');
30710
+ const titleTop = titleTopGroup.createOrUpdateChild('label-item-title-top', Object.assign(Object.assign({ x: spaceW, y: -spaceH, text: titleTopText }, titleTopStyle), { textBaseline: 'bottom', textAlign: 'left', zIndex: 10 }), 'text');
30711
+ const titleTopBounds = titleTop.AABBBounds;
30712
+ if (contentOffsetX > 0) {
30713
+ titleTopGroup.setAttributes({ x: contentOffsetX - titleTopBounds.width() - spaceW * 2 });
30714
+ }
30715
+ titleTopGroup.setAttributes({
30716
+ width: titleTopBounds.width() + spaceW * 2,
30717
+ height: -titleTopBounds.height() - spaceH * 2
30718
+ });
30719
+ const titleTopPanel = titleTopGroup.createOrUpdateChild('label-item-title-top-panel', Object.assign(Object.assign({}, titleTopPanelStyle), { x: titleTopPanelStyle.padding.left, y: (titleTopGroup.attribute.height > 0 ? 0 : titleTopGroup.attribute.height) + titleTopPanelStyle.padding.top, width: titleTopGroup.attribute.width - titleTopPanelStyle.padding.left - titleTopPanelStyle.padding.right, height: (titleTopGroup.attribute.height > 0 ? 1 : -1) * titleTopGroup.attribute.height -
30720
+ titleTopPanelStyle.padding.bottom -
30721
+ titleTopPanelStyle.padding.top, scaleCenter: [titleTopGroup.attribute.width / 2, titleTopGroup.attribute.height / 2] }), 'rect');
30722
+ this._titleTopPanel = titleTopPanel;
30723
+ const titleBottomGroup = group.createOrUpdateChild('label-item-title-bottom-group', { x: contentOffsetX, y: contentOffsetY, clip: true }, 'group');
30724
+ const titleBottom = titleBottomGroup.createOrUpdateChild('label-item-title-bottom', Object.assign(Object.assign({ x: spaceW, y: spaceH, text: titleBottomText }, titleBottomStyle), { textBaseline: 'top', textAlign: 'left', zIndex: 10 }), 'text');
30725
+ const titleBottomBounds = titleBottom.AABBBounds;
30726
+ if (contentOffsetX > 0) {
30727
+ titleBottomGroup.setAttributes({ x: contentOffsetX - titleBottomBounds.width() - spaceW * 2 });
30728
+ }
30729
+ titleBottomGroup.setAttributes({
30730
+ width: titleBottomBounds.width() + spaceW * 2,
30731
+ height: titleTopBounds.height() + spaceH * 2
30732
+ });
30733
+ const titleBottomPanel = titleBottomGroup.createOrUpdateChild('label-item-title-bottom-panel', Object.assign(Object.assign({}, titleBottomPanelStyle), { x: titleBottomPanelStyle.padding.left, y: (titleBottomGroup.attribute.height > 0 ? 0 : titleBottomGroup.attribute.height) +
30734
+ titleBottomPanelStyle.padding.top, width: titleBottomGroup.attribute.width - titleBottomPanelStyle.padding.left - titleBottomPanelStyle.padding.right, height: (titleBottomGroup.attribute.height > 0 ? 1 : -1) * titleBottomGroup.attribute.height -
30735
+ titleBottomPanelStyle.padding.bottom -
30736
+ titleBottomPanelStyle.padding.top, scaleCenter: [titleBottomGroup.attribute.width / 2, titleBottomGroup.attribute.height / 2] }), 'rect');
30737
+ this._titleBottomPanel = titleBottomPanel;
30738
+ const maxTextWidth = Math.max(titleTop.AABBBounds.width(), titleBottom.AABBBounds.width()) + spaceW * 2;
30739
+ const points = [
30740
+ { x: 0, y: 0 },
30741
+ contentOffsetX > 0
30742
+ ? { x: contentOffsetX - maxTextWidth, y: contentOffsetY }
30743
+ : { x: contentOffsetX + maxTextWidth, y: contentOffsetY },
30744
+ { x: contentOffsetX, y: contentOffsetY }
30745
+ ];
30746
+ if (theme === 'simple') {
30747
+ points.pop();
30748
+ const p = points[1];
30749
+ symbolEnd.setAttributes(p);
30750
+ }
30751
+ const line = group.createOrUpdateChild('label-item-line', Object.assign(Object.assign({ x: 0, y: 0 }, lineStyle), { points }), 'line');
30752
+ this._symbolEnd = symbolEnd;
30753
+ this._symbolStart = symbolStart;
30754
+ this._symbolStartOuter = symbolStartOut;
30755
+ this._titleTop = titleTop;
30756
+ this._titleBottom = titleBottom;
30757
+ this._line = line;
30758
+ }
30759
+ appearAnimate(animateConfig) {
30760
+ const { duration = 1000, easing = 'quadOut', symbolStartOuterType = 'scale', titleType = 'typewriter', titlePanelType = 'scale' } = animateConfig;
30761
+ const symbolTime = duration / 10;
30762
+ this._symbolStart.setAttributes({ scaleX: 0, scaleY: 0 });
30763
+ this._symbolStart.animate().to({ scaleX: 1, scaleY: 1 }, symbolTime * 5, easing);
30764
+ let symbolStartOuterFrom;
30765
+ let symbolStartOuterTo;
30766
+ if (symbolStartOuterType === 'scale') {
30767
+ symbolStartOuterFrom = { scaleX: 0, scaleY: 0 };
30768
+ symbolStartOuterTo = { scaleX: 1, scaleY: 1 };
30769
+ }
30770
+ else {
30771
+ symbolStartOuterFrom = { clipRange: 0 };
30772
+ symbolStartOuterTo = { clipRange: 1 };
30773
+ }
30774
+ this._symbolStartOuter.setAttributes(symbolStartOuterFrom);
30775
+ this._symbolStartOuter.animate().to(symbolStartOuterTo, symbolTime * 5, easing);
30776
+ this._symbolEnd.setAttributes({ scaleX: 0, scaleY: 0 });
30777
+ this._symbolEnd
30778
+ .animate()
30779
+ .wait(symbolTime * 8)
30780
+ .to({ scaleX: 1, scaleY: 1 }, symbolTime * 2, easing);
30781
+ this._line.setAttributes({ clipRange: 0 });
30782
+ this._line.animate().to({ clipRange: 1 }, symbolTime * 9, easing);
30783
+ if (titleType === 'typewriter') {
30784
+ const titleTopText = this._titleTop.attribute.text;
30785
+ this._titleTop.setAttributes({ text: '' });
30786
+ this._titleTop
30787
+ .animate()
30788
+ .wait(symbolTime * 5)
30789
+ .play(new InputText({ text: '' }, { text: titleTopText }, symbolTime * 4, 'linear'));
30790
+ const titleBottomText = this._titleBottom.attribute.text;
30791
+ this._titleBottom.setAttributes({ text: '' });
30792
+ this._titleBottom
30793
+ .animate()
30794
+ .wait(symbolTime * 5)
30795
+ .play(new InputText({ text: '' }, { text: titleBottomText }, symbolTime * 4, 'linear'));
30796
+ }
30797
+ else {
30798
+ this._titleTop.setAttributes({ dy: this._titleTop.AABBBounds.height() + 10 });
30799
+ this._titleTop
30800
+ .animate()
30801
+ .wait(symbolTime * 5)
30802
+ .to({ dy: 0 }, symbolTime * 4, 'linear');
30803
+ this._titleBottom.setAttributes({ dy: -(10 + this._titleBottom.AABBBounds.height()) });
30804
+ this._titleBottom
30805
+ .animate()
30806
+ .wait(symbolTime * 5)
30807
+ .to({ dy: 0 }, symbolTime * 4, 'linear');
30808
+ }
30809
+ if (titlePanelType === 'scale') {
30810
+ [this._titleTopPanel, this._titleBottomPanel].forEach(panel => {
30811
+ const scaleX = panel.attribute.scaleX;
30812
+ panel.setAttributes({ scaleX: 0 });
30813
+ panel.animate().to({ scaleX }, duration, 'circInOut');
30814
+ });
30815
+ }
30816
+ else if (titlePanelType === 'stroke') {
30817
+ [this._titleTopPanel, this._titleBottomPanel].forEach(panel => {
30818
+ const b = panel.AABBBounds;
30819
+ const totalLen = (b.width() + b.height()) * 2;
30820
+ panel.setAttributes({ lineDash: [0, totalLen * 10] });
30821
+ panel.animate().to({ lineDash: [totalLen, totalLen * 10] }, duration, 'quadOut');
30822
+ });
30823
+ }
30824
+ }
30825
+ disappearAnimate(animateConfig) {
30826
+ if (animateConfig.mode === 'scale') {
30827
+ const { duration = 1000, easing = 'quadOut' } = animateConfig;
30828
+ this.animate().to({ scaleX: 0, scaleY: 0 }, duration, easing);
30829
+ }
30830
+ else {
30831
+ const { duration = 1000, easing = 'quadOut' } = animateConfig;
30832
+ this._line.animate().to({ clipRange: 0 }, duration, easing);
30833
+ this._symbolStart
30834
+ .animate()
30835
+ .wait(duration / 2)
30836
+ .to({ scaleX: 0, scaleY: 0 }, duration / 2, easing);
30837
+ this._symbolEnd.animate().to({ scaleX: 0, scaleY: 0 }, duration, easing);
30838
+ this._titleTop.animate().to({ dy: this._titleTop.AABBBounds.height() + 10 }, duration / 2, easing);
30839
+ this._titleBottom
30840
+ .animate()
30841
+ .to({ dy: -(10 + this._titleBottom.AABBBounds.height()) }, duration / 2, easing);
30842
+ this._symbolStartOuter
30843
+ .animate()
30844
+ .wait(duration / 2)
30845
+ .to({ clipRange: 0 }, duration / 2, easing);
30846
+ this._titleTopPanel.animate().to({ scaleX: 0 }, duration, 'circInOut');
30847
+ this._titleBottomPanel.animate().to({ scaleX: 0 }, duration, 'circInOut');
30848
+ }
30849
+ }
30850
+ }
30851
+ StoryLabelItem.defaultAttributes = {
30852
+ contentOffsetX: 100,
30853
+ contentOffsetY: -60,
30854
+ titleTopStyle: {
30855
+ fontSize: 12,
30856
+ fill: 'white'
30857
+ },
30858
+ titleBottomStyle: {
30859
+ fontSize: 12,
30860
+ fill: 'white'
30861
+ },
30862
+ lineStyle: {
30863
+ stroke: 'white',
30864
+ lineWidth: 1
30865
+ },
30866
+ symbolStartStyle: {
30867
+ symbolType: 'circle',
30868
+ size: 3,
30869
+ fill: 'white'
30870
+ },
30871
+ symbolEndStyle: {
30872
+ symbolType: 'circle',
30873
+ size: 3,
30874
+ fill: 'white'
30875
+ },
30876
+ symbolStartOuterStyle: {
30877
+ symbolType: 'M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0',
30878
+ size: 8,
30879
+ stroke: 'white'
30880
+ },
30881
+ titleSpace: [2, 2],
30882
+ titleTopPanelStyle: {
30883
+ visible: false,
30884
+ padding: { left: 0, right: 0, bottom: 2, top: 2 },
30885
+ cornerRadius: 3
30886
+ },
30887
+ titleBottomPanelStyle: {
30888
+ visible: false,
30889
+ padding: { left: 0, right: 0, bottom: 2, top: 2 },
30890
+ cornerRadius: 3
30891
+ },
30892
+ theme: 'default'
30893
+ };
30894
+
30895
+ const version = "0.21.2-vstory.3";
30523
30896
 
30524
- export { AXIS_ELEMENT_NAME, AbstractComponent, ArcInfo, ArcLabel, ArcSegment, AxisStateValue, BasePlayer, Brush, CheckBox, CircleAxis, CircleAxisGrid, CircleCrosshair, ColorContinuousLegend, ContinuousPlayer, DEFAULT_ITEM_SPACE_COL, DEFAULT_ITEM_SPACE_ROW, DEFAULT_LABEL_SPACE, DEFAULT_PAGER_SPACE, DEFAULT_SHAPE_SIZE, DEFAULT_SHAPE_SPACE, DEFAULT_STATES$1 as DEFAULT_STATES, DEFAULT_TITLE_SPACE, DEFAULT_VALUE_SPACE, DataLabel, DataZoom, DataZoomActiveTag, DirectionEnum, DiscreteLegend, DiscretePlayer, EmptyTip, GroupTransition, IMarkAreaLabelPosition, IMarkCommonArcLabelPosition, IMarkLineLabelPosition, IMarkPointItemPosition, IOperateType, Indicator, LEGEND_ELEMENT_NAME, LabelBase, LegendEvent, LegendStateValue, LineAxis, LineAxisGrid, LineCrosshair, LineLabel, LinkPath, MarkArcArea, MarkArcLine, MarkArea, MarkLine, MarkPoint, Pager, PlayerEventEnum, PolygonCrosshair, PopTip, Radio, RectCrosshair, RectLabel, SLIDER_ELEMENT_NAME, ScrollBar, SectorCrosshair, Segment, SizeContinuousLegend, Slider, SymbolLabel, Tag, Timeline, Title, Tooltip, TopZIndex, VTag, WeatherBox, alignTextInLine, angle, angleLabelOrientAttribute, angleTo, cartesianTicks, clampRadian, computeOffsetForlimit, continuousTicks, contrastAccessibilityChecker, convertDomainToTickData, createTextGraphicByType, deltaXYToAngle, fuzzyEqualNumber, getAxisBreakSymbolAttrs, getCircleLabelPosition, getCirclePoints, getCircleVerticalVector, getElMap, getHorizontalPath, getMarksByName, getNoneGroupMarksByName, getPolarAngleLabelPosition, getPolygonPath, getSizeHandlerPath, getTextAlignAttrOfVerticalDir, getTextType, getVerticalCoord, getVerticalPath, hasOverlap, htmlAttributeTransform, initTextMeasure, isInRange, isPostiveXAxis, isRichText, isVisible, labelSmartInvert, length, limitShapeInBounds, linearDiscreteTicks, loadPoptip, loadScrollbar, measureTextSize, normalize, polarAngleAxisDiscreteTicks, polarTicks, reactAttributeTransform, registerArcDataLabel, registerLineDataLabel, registerMarkArcAreaAnimate, registerMarkArcLineAnimate, registerMarkAreaAnimate, registerMarkLineAnimate, registerMarkPointAnimate, registerRectDataLabel, registerSymbolDataLabel, removeRepeatPoint, richTextAttributeTransform, scale, scrollbarModule, setPoptipTheme, smartInvertStrategy, tan2AngleToAngle, textIntersect, ticks, traverseGroup, version };
30897
+ export { AXIS_ELEMENT_NAME, AbstractComponent, ArcInfo, ArcLabel, ArcSegment, AxisStateValue, BasePlayer, Brush, CheckBox, CircleAxis, CircleAxisGrid, CircleCrosshair, ColorContinuousLegend, ContinuousPlayer, DEFAULT_ITEM_SPACE_COL, DEFAULT_ITEM_SPACE_ROW, DEFAULT_LABEL_SPACE, DEFAULT_PAGER_SPACE, DEFAULT_SHAPE_SIZE, DEFAULT_SHAPE_SPACE, DEFAULT_STATES$1 as DEFAULT_STATES, DEFAULT_TITLE_SPACE, DEFAULT_VALUE_SPACE, DataLabel, DataZoom, DataZoomActiveTag, DirectionEnum, DiscreteLegend, DiscretePlayer, EmptyTip, GroupTransition, IMarkAreaLabelPosition, IMarkCommonArcLabelPosition, IMarkLineLabelPosition, IMarkPointItemPosition, IOperateType, Indicator, LEGEND_ELEMENT_NAME, LabelBase, LegendEvent, LegendStateValue, LineAxis, LineAxisGrid, LineCrosshair, LineLabel, LinkPath, MarkArcArea, MarkArcLine, MarkArea, MarkLine, MarkPoint, Pager, PlayerEventEnum, PolygonCrosshair, PopTip, Radio, RectCrosshair, RectLabel, SLIDER_ELEMENT_NAME, ScrollBar, SectorCrosshair, Segment, SizeContinuousLegend, Slider, StoryLabelItem, SymbolLabel, Tag, Timeline, Title, Tooltip, TopZIndex, VTag, WeatherBox, alignTextInLine, angle, angleLabelOrientAttribute, angleTo, cartesianTicks, clampRadian, computeOffsetForlimit, continuousTicks, contrastAccessibilityChecker, convertDomainToTickData, createTextGraphicByType, deltaXYToAngle, fuzzyEqualNumber, getAxisBreakSymbolAttrs, getCircleLabelPosition, getCirclePoints, getCircleVerticalVector, getElMap, getHorizontalPath, getMarksByName, getNoneGroupMarksByName, getPolarAngleLabelPosition, getPolygonPath, getSizeHandlerPath, getTextAlignAttrOfVerticalDir, getTextType, getVerticalCoord, getVerticalPath, hasOverlap, htmlAttributeTransform, initTextMeasure, isInRange, isPostiveXAxis, isRichText, isVisible, labelSmartInvert, length, limitShapeInBounds, linearDiscreteTicks, loadPoptip, loadScrollbar, measureTextSize, normalize, polarAngleAxisDiscreteTicks, polarTicks, reactAttributeTransform, registerArcDataLabel, registerLineDataLabel, registerMarkArcAreaAnimate, registerMarkArcLineAnimate, registerMarkAreaAnimate, registerMarkLineAnimate, registerMarkPointAnimate, registerRectDataLabel, registerSymbolDataLabel, removeRepeatPoint, richTextAttributeTransform, scale, scrollbarModule, setPoptipTheme, smartInvertStrategy, tan2AngleToAngle, textIntersect, ticks, traverseGroup, version };