@visactor/vrender-components 0.16.14-alpha.5 → 0.16.14-alpha.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 (75) hide show
  1. package/cjs/axis/base.js +22 -11
  2. package/cjs/axis/base.js.map +1 -1
  3. package/cjs/axis/line.js +1 -1
  4. package/cjs/axis/line.js.map +1 -1
  5. package/cjs/axis/type.d.ts +6 -3
  6. package/cjs/axis/type.js.map +1 -1
  7. package/cjs/brush/index.js +1 -2
  8. package/cjs/checkbox/index.js +2 -1
  9. package/cjs/index.d.ts +1 -1
  10. package/cjs/index.js +1 -1
  11. package/cjs/index.js.map +1 -1
  12. package/cjs/indicator/indicator.js +50 -6
  13. package/cjs/indicator/indicator.js.map +1 -1
  14. package/cjs/indicator/type.d.ts +5 -2
  15. package/cjs/indicator/type.js.map +1 -1
  16. package/cjs/label/arc.d.ts +4 -3
  17. package/cjs/label/arc.js.map +1 -1
  18. package/cjs/label/base.d.ts +11 -11
  19. package/cjs/label/base.js +23 -5
  20. package/cjs/label/base.js.map +1 -1
  21. package/cjs/label/type.d.ts +8 -4
  22. package/cjs/label/type.js.map +1 -1
  23. package/cjs/marker/point.d.ts +1 -1
  24. package/cjs/marker/type.js.map +1 -1
  25. package/cjs/tag/tag.js +90 -40
  26. package/cjs/tag/tag.js.map +1 -1
  27. package/cjs/tag/type.d.ts +4 -3
  28. package/cjs/tag/type.js.map +1 -1
  29. package/cjs/title/title.js +111 -47
  30. package/cjs/title/title.js.map +1 -1
  31. package/cjs/title/type.d.ts +10 -5
  32. package/cjs/title/type.js.map +1 -1
  33. package/cjs/tooltip/tooltip.js +26 -1
  34. package/cjs/tooltip/tooltip.js.map +1 -1
  35. package/cjs/tooltip/type.d.ts +3 -1
  36. package/cjs/tooltip/type.js.map +1 -1
  37. package/dist/index.js +252 -145
  38. package/dist/index.min.js +1 -1
  39. package/es/axis/base.js +23 -11
  40. package/es/axis/base.js.map +1 -1
  41. package/es/axis/line.js +1 -1
  42. package/es/axis/line.js.map +1 -1
  43. package/es/axis/type.d.ts +6 -3
  44. package/es/axis/type.js.map +1 -1
  45. package/es/brush/index.js +1 -2
  46. package/es/checkbox/index.js +2 -1
  47. package/es/index.d.ts +1 -1
  48. package/es/index.js +1 -1
  49. package/es/index.js.map +1 -1
  50. package/es/indicator/indicator.js +50 -6
  51. package/es/indicator/indicator.js.map +1 -1
  52. package/es/indicator/type.d.ts +5 -2
  53. package/es/indicator/type.js.map +1 -1
  54. package/es/label/arc.d.ts +4 -3
  55. package/es/label/arc.js.map +1 -1
  56. package/es/label/base.d.ts +11 -11
  57. package/es/label/base.js +23 -5
  58. package/es/label/base.js.map +1 -1
  59. package/es/label/type.d.ts +8 -4
  60. package/es/label/type.js.map +1 -1
  61. package/es/marker/point.d.ts +1 -1
  62. package/es/marker/type.js.map +1 -1
  63. package/es/tag/tag.js +88 -38
  64. package/es/tag/tag.js.map +1 -1
  65. package/es/tag/type.d.ts +4 -3
  66. package/es/tag/type.js.map +1 -1
  67. package/es/title/title.js +111 -45
  68. package/es/title/title.js.map +1 -1
  69. package/es/title/type.d.ts +10 -5
  70. package/es/title/type.js.map +1 -1
  71. package/es/tooltip/tooltip.js +26 -1
  72. package/es/tooltip/tooltip.js.map +1 -1
  73. package/es/tooltip/type.d.ts +3 -1
  74. package/es/tooltip/type.js.map +1 -1
  75. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -11406,6 +11406,13 @@
11406
11406
  builtinSymbols.forEach(function (symbol) {
11407
11407
  builtinSymbolsMap[symbol.type] = symbol;
11408
11408
  });
11409
+ var builtInSymbolStrMap = {
11410
+ arrowLeft: "M 0.25 -0.5 L -0.25 0 l 0.5 0.5",
11411
+ arrowRight: "M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5",
11412
+ rect: "M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z",
11413
+ rectRound: "M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",
11414
+ roundLine: "M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z"
11415
+ };
11409
11416
 
11410
11417
  var SYMBOL_UPDATE_TAG_KEY = ["symbolType", "size"].concat(_toConsumableArray(GRAPHIC_UPDATE_TAG_KEY));
11411
11418
  var _Symbol = /*#__PURE__*/function (_Graphic) {
@@ -11439,12 +11446,13 @@
11439
11446
  }, {
11440
11447
  key: "doUpdateParsedPath",
11441
11448
  value: function doUpdateParsedPath() {
11442
- var symbolTheme = getTheme(this).symbol,
11443
- _this$attribute$symbo = this.attribute.symbolType,
11444
- symbolType = _this$attribute$symbo === void 0 ? symbolTheme.symbolType : _this$attribute$symbo;
11445
- var path = builtinSymbolsMap[symbolType];
11449
+ var symbolTheme = getTheme(this).symbol;
11450
+ var _this$attribute$symbo = this.attribute.symbolType,
11451
+ symbolType = _this$attribute$symbo === void 0 ? symbolTheme.symbolType : _this$attribute$symbo,
11452
+ path = builtinSymbolsMap[symbolType];
11446
11453
  if (path) return this._parsedPath = path, path;
11447
11454
  if (path = _Symbol.userSymbolMap[symbolType], path) return this._parsedPath = path, path;
11455
+ symbolType = builtInSymbolStrMap[symbolType] || symbolType;
11448
11456
  if (!0 === isSvg(symbolType)) {
11449
11457
  var parser = new XMLParser(),
11450
11458
  _parser$parse = parser.parse(symbolType),
@@ -20974,8 +20982,8 @@
20974
20982
  this.name = 'tag';
20975
20983
  }
20976
20984
  render() {
20977
- var _a;
20978
- const { text = '', textStyle = {}, shape = {}, panel = {}, space = 4, minWidth, maxWidth, padding = 4, visible, state } = this.attribute;
20985
+ var _a, _b, _c;
20986
+ const { text = '', textStyle = {}, shape = {}, panel = {}, space = 4, minWidth, maxWidth, padding = 4, visible, state, type = 'text' } = this.attribute;
20979
20987
  const parsedPadding = vutils.normalizePadding(padding);
20980
20988
  const group = this.createOrUpdateChild('tag-content', { x: 0, y: 0, zIndex: 1 }, 'group');
20981
20989
  let symbol;
@@ -20997,75 +21005,100 @@
20997
21005
  }
20998
21006
  tagWidth += symbolPlaceWidth;
20999
21007
  textX += symbolPlaceWidth;
21000
- const textAttrs = Object.assign(Object.assign({ text, visible: vutils.isValid(text) && visible !== false, lineHeight: textStyle === null || textStyle === void 0 ? void 0 : textStyle.fontSize }, textStyle), { x: textX, y: 0 });
21001
- if (vutils.isNil(textAttrs.lineHeight)) {
21002
- textAttrs.lineHeight = textAttrs.fontSize;
21003
- }
21004
- const textShape = group.createOrUpdateChild('tag-text', textAttrs, 'text');
21005
- if (!vutils.isEmpty(state === null || state === void 0 ? void 0 : state.text)) {
21006
- textShape.states = state.text;
21007
- }
21008
- const textBounds = measureTextSize(textAttrs.text, textStyle);
21009
- const textWidth = textBounds.width;
21010
- const textHeight = textBounds.height;
21011
- tagWidth += textWidth;
21012
- const size = (_a = shape.size) !== null && _a !== void 0 ? _a : 10;
21013
- const maxSize = vutils.isNumber(size) ? size : Math.max(size[0], size[1]);
21014
- tagHeight += Math.max(textHeight, (shape === null || shape === void 0 ? void 0 : shape.visible) ? maxSize : 0);
21015
- const { textAlign, textBaseline } = textStyle;
21016
- if (vutils.isValid(minWidth) || vutils.isValid(maxWidth)) {
21017
- if (vutils.isValid(minWidth) && tagWidth < minWidth) {
21018
- tagWidth = minWidth;
21019
- }
21020
- if (vutils.isValid(maxWidth) && tagWidth > maxWidth) {
21021
- tagWidth = maxWidth;
21022
- textShape.setAttribute('maxLineWidth', maxWidth - parsedPadding[1] - parsedPadding[2]);
21023
- }
21024
- }
21025
- let x = 0;
21026
- let y = 0;
21027
- if (textAlign === 'center') {
21028
- x -= tagWidth / 2;
21029
- if (symbol) {
21030
- symbol.setAttribute('x', (symbol.attribute.x || 0) - textWidth / 2);
21008
+ let textShape;
21009
+ if (type === 'rich') {
21010
+ const richTextAttrs = Object.assign(Object.assign({ textConfig: text, visible: vutils.isValid(text) && visible !== false }, textStyle), { x: textX, y: 0, width: (_a = textStyle.width) !== null && _a !== void 0 ? _a : 0, height: (_b = textStyle.height) !== null && _b !== void 0 ? _b : 0 });
21011
+ textShape = group.createOrUpdateChild('tag-text', richTextAttrs, 'richtext');
21012
+ const { visible: bgVisible } = panel, backgroundStyle = __rest(panel, ["visible"]);
21013
+ if (visible && vutils.isBoolean(bgVisible)) {
21014
+ const bgRect = this.createOrUpdateChild('tag-panel', Object.assign(Object.assign({}, backgroundStyle), { visible: bgVisible && !!text, x: textShape.AABBBounds.x1, y: textShape.AABBBounds.y1, width: textShape.AABBBounds.width(), height: textShape.AABBBounds.height() }), 'rect');
21015
+ if (!vutils.isEmpty(state === null || state === void 0 ? void 0 : state.panel)) {
21016
+ bgRect.states = state.panel;
21017
+ }
21031
21018
  }
21032
- group.setAttribute('x', -symbolPlaceWidth / 2);
21033
21019
  }
21034
- else if (textAlign === 'right' || textAlign === 'end') {
21035
- x -= tagWidth;
21036
- if (symbol) {
21037
- symbol.setAttribute('x', (symbol.attribute.x || 0) - textWidth);
21020
+ else if (type === 'html') {
21021
+ const richTextAttrs = Object.assign(Object.assign({ textConfig: [], visible: vutils.isValid(text) && visible !== false, html: Object.assign({ dom: text, container: '', width: 30, height: 30, style: {} }, textStyle) }, textStyle), { x: textX, y: 0 });
21022
+ textShape = group.createOrUpdateChild('tag-text', richTextAttrs, 'richtext');
21023
+ const { visible: bgVisible } = panel, backgroundStyle = __rest(panel, ["visible"]);
21024
+ if (visible && vutils.isBoolean(bgVisible)) {
21025
+ const bgRect = this.createOrUpdateChild('tag-panel', Object.assign(Object.assign({}, backgroundStyle), { visible: bgVisible && !!text, x: textShape.AABBBounds.x1, y: textShape.AABBBounds.y1, width: textShape.AABBBounds.width(), height: textShape.AABBBounds.height() }), 'rect');
21026
+ if (!vutils.isEmpty(state === null || state === void 0 ? void 0 : state.panel)) {
21027
+ bgRect.states = state.panel;
21028
+ }
21038
21029
  }
21039
- group.setAttribute('x', -parsedPadding[1] - symbolPlaceWidth);
21040
21030
  }
21041
- else if (textAlign === 'left' || textAlign === 'start') {
21042
- group.setAttribute('x', parsedPadding[3]);
21043
- }
21044
- if (textBaseline === 'middle') {
21045
- y -= tagHeight / 2;
21046
- if (symbol) {
21047
- symbol.setAttribute('y', 0);
21031
+ else {
21032
+ const textAttrs = Object.assign(Object.assign({ text: text, visible: vutils.isValid(text) && visible !== false, lineHeight: textStyle === null || textStyle === void 0 ? void 0 : textStyle.fontSize }, textStyle), { x: textX, y: 0 });
21033
+ if (vutils.isNil(textAttrs.lineHeight)) {
21034
+ textAttrs.lineHeight = textStyle.fontSize;
21035
+ }
21036
+ textShape = group.createOrUpdateChild('tag-text', textAttrs, 'text');
21037
+ if (!vutils.isEmpty(state === null || state === void 0 ? void 0 : state.text)) {
21038
+ textShape.states = state.text;
21039
+ }
21040
+ const textBounds = measureTextSize(textAttrs.text, textStyle);
21041
+ const textWidth = textBounds.width;
21042
+ const textHeight = textBounds.height;
21043
+ tagWidth += textWidth;
21044
+ const size = (_c = shape.size) !== null && _c !== void 0 ? _c : 10;
21045
+ const maxSize = vutils.isNumber(size) ? size : Math.max(size[0], size[1]);
21046
+ tagHeight += Math.max(textHeight, (shape === null || shape === void 0 ? void 0 : shape.visible) ? maxSize : 0);
21047
+ const { textAlign, textBaseline } = textStyle;
21048
+ if (vutils.isValid(minWidth) || vutils.isValid(maxWidth)) {
21049
+ if (vutils.isValid(minWidth) && tagWidth < minWidth) {
21050
+ tagWidth = minWidth;
21051
+ }
21052
+ if (vutils.isValid(maxWidth) && tagWidth > maxWidth) {
21053
+ tagWidth = maxWidth;
21054
+ textShape.setAttribute('maxLineWidth', maxWidth - parsedPadding[1] - parsedPadding[2]);
21055
+ }
21048
21056
  }
21049
- }
21050
- else if (textBaseline === 'bottom') {
21051
- y -= tagHeight;
21052
- if (symbol) {
21053
- symbol.setAttribute('y', -textHeight / 2);
21057
+ let x = 0;
21058
+ let y = 0;
21059
+ if (textAlign === 'center') {
21060
+ x -= tagWidth / 2;
21061
+ if (symbol) {
21062
+ symbol.setAttribute('x', (symbol.attribute.x || 0) - textWidth / 2);
21063
+ }
21064
+ group.setAttribute('x', -symbolPlaceWidth / 2);
21054
21065
  }
21055
- group.setAttribute('y', -parsedPadding[2]);
21056
- }
21057
- else if (textBaseline === 'top') {
21058
- group.setAttribute('y', parsedPadding[0]);
21059
- if (symbol) {
21060
- symbol.setAttribute('y', textHeight / 2);
21066
+ else if (textAlign === 'right' || textAlign === 'end') {
21067
+ x -= tagWidth;
21068
+ if (symbol) {
21069
+ symbol.setAttribute('x', (symbol.attribute.x || 0) - textWidth);
21070
+ }
21071
+ group.setAttribute('x', -parsedPadding[1] - symbolPlaceWidth);
21061
21072
  }
21062
- }
21063
- const { visible: bgVisible } = panel, backgroundStyle = __rest(panel, ["visible"]);
21064
- if (visible && vutils.isBoolean(bgVisible)) {
21065
- const bgRect = this.createOrUpdateChild('tag-panel', Object.assign(Object.assign({}, backgroundStyle), { visible: bgVisible && !!text, x,
21066
- y, width: tagWidth, height: tagHeight }), 'rect');
21067
- if (!vutils.isEmpty(state === null || state === void 0 ? void 0 : state.panel)) {
21068
- bgRect.states = state.panel;
21073
+ else if (textAlign === 'left' || textAlign === 'start') {
21074
+ group.setAttribute('x', parsedPadding[3]);
21075
+ }
21076
+ if (textBaseline === 'middle') {
21077
+ y -= tagHeight / 2;
21078
+ if (symbol) {
21079
+ symbol.setAttribute('y', 0);
21080
+ }
21081
+ }
21082
+ else if (textBaseline === 'bottom') {
21083
+ y -= tagHeight;
21084
+ if (symbol) {
21085
+ symbol.setAttribute('y', -textHeight / 2);
21086
+ }
21087
+ group.setAttribute('y', -parsedPadding[2]);
21088
+ }
21089
+ else if (textBaseline === 'top') {
21090
+ group.setAttribute('y', parsedPadding[0]);
21091
+ if (symbol) {
21092
+ symbol.setAttribute('y', textHeight / 2);
21093
+ }
21094
+ }
21095
+ const { visible: bgVisible } = panel, backgroundStyle = __rest(panel, ["visible"]);
21096
+ if (visible && vutils.isBoolean(bgVisible)) {
21097
+ const bgRect = this.createOrUpdateChild('tag-panel', Object.assign(Object.assign({}, backgroundStyle), { visible: bgVisible && !!text, x,
21098
+ y, width: tagWidth, height: tagHeight }), 'rect');
21099
+ if (!vutils.isEmpty(state === null || state === void 0 ? void 0 : state.panel)) {
21100
+ bgRect.states = state.panel;
21101
+ }
21069
21102
  }
21070
21103
  }
21071
21104
  }
@@ -22277,6 +22310,24 @@
22277
22310
  target.states = state;
22278
22311
  }
22279
22312
  _createLabelText(attributes) {
22313
+ var _a, _b;
22314
+ if (attributes.type === 'rich') {
22315
+ attributes.textConfig = attributes.text;
22316
+ attributes.width = (_a = attributes.width) !== null && _a !== void 0 ? _a : 0;
22317
+ attributes.height = (_b = attributes.height) !== null && _b !== void 0 ? _b : 0;
22318
+ const text = createRichText(attributes);
22319
+ this._bindEvent(text);
22320
+ this._setStatesOfText(text);
22321
+ return text;
22322
+ }
22323
+ else if (attributes.type === 'html') {
22324
+ attributes.textConfig = [];
22325
+ attributes.html = Object.assign({ dom: attributes.text, container: '', width: 30, height: 30, style: {} }, attributes);
22326
+ const text = createRichText(attributes);
22327
+ this._bindEvent(text);
22328
+ this._setStatesOfText(text);
22329
+ return text;
22330
+ }
22280
22331
  const text = createText(attributes);
22281
22332
  this._bindEvent(text);
22282
22333
  this._setStatesOfText(text);
@@ -22503,7 +22554,7 @@
22503
22554
  const prevTextMap = this._graphicToText || new Map();
22504
22555
  const texts = [];
22505
22556
  labels.forEach((text, index) => {
22506
- var _a, _b, _c, _d, _e, _f, _g;
22557
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
22507
22558
  const labelLine = this._labelLine(text);
22508
22559
  const relatedGraphic = this.getRelatedGrphic(text.attribute);
22509
22560
  const textId = text.attribute.id;
@@ -22546,11 +22597,11 @@
22546
22597
  }), duration, easing);
22547
22598
  }
22548
22599
  if (animationConfig.increaseEffect !== false &&
22549
- prevText.attribute.text !== text.attribute.text &&
22550
- vutils.isValidNumber(Number(prevText.attribute.text) * Number(text.attribute.text))) {
22600
+ ((_h = prevText.attribute) === null || _h === void 0 ? void 0 : _h.text) !== ((_j = text.attribute) === null || _j === void 0 ? void 0 : _j.text) &&
22601
+ vutils.isValidNumber(Number((_k = prevText.attribute) === null || _k === void 0 ? void 0 : _k.text) * Number((_l = text.attribute) === null || _l === void 0 ? void 0 : _l.text))) {
22551
22602
  prevText
22552
22603
  .animate()
22553
- .play(new IncreaseCount({ text: prevText.attribute.text }, { text: text.attribute.text }, duration, easing));
22604
+ .play(new IncreaseCount({ text: (_m = prevText.attribute) === null || _m === void 0 ? void 0 : _m.text }, { text: (_o = text.attribute) === null || _o === void 0 ? void 0 : _o.text }, duration, easing));
22554
22605
  }
22555
22606
  }
22556
22607
  });
@@ -24222,12 +24273,26 @@
24222
24273
  let textAlign = 'center';
24223
24274
  let textBaseline = 'middle';
24224
24275
  data.forEach((item, index) => {
24225
- var _a, _b;
24276
+ var _a, _b, _c, _d;
24226
24277
  const labelStyle = this._getLabelAttribute(item, index, data, layer);
24227
- const text = createText(labelStyle);
24278
+ let text;
24279
+ if ((labelStyle === null || labelStyle === void 0 ? void 0 : labelStyle.type) === 'rich') {
24280
+ labelStyle.textConfig = labelStyle.text;
24281
+ labelStyle.width = (_a = labelStyle.width) !== null && _a !== void 0 ? _a : 0;
24282
+ labelStyle.height = (_b = labelStyle.height) !== null && _b !== void 0 ? _b : 0;
24283
+ text = createRichText(labelStyle);
24284
+ }
24285
+ else if ((labelStyle === null || labelStyle === void 0 ? void 0 : labelStyle.type) === 'html') {
24286
+ labelStyle.textConfig = [];
24287
+ labelStyle.html = Object.assign({ dom: labelStyle.text, container: '', width: 30, height: 30, style: {} }, labelStyle);
24288
+ text = createRichText(labelStyle);
24289
+ }
24290
+ else {
24291
+ text = createText(labelStyle);
24292
+ }
24228
24293
  text.name = exports.AXIS_ELEMENT_NAME.label;
24229
24294
  text.id = this._getNodeId(`layer${layer}-label-${item.id}`);
24230
- if (vutils.isEmpty((_a = this.attribute.label) === null || _a === void 0 ? void 0 : _a.state)) {
24295
+ if (vutils.isEmpty((_c = this.attribute.label) === null || _c === void 0 ? void 0 : _c.state)) {
24231
24296
  text.states = DEFAULT_STATES$2;
24232
24297
  }
24233
24298
  else {
@@ -24240,7 +24305,7 @@
24240
24305
  text.states = labelState;
24241
24306
  }
24242
24307
  labelGroup.add(text);
24243
- const angle = (_b = labelStyle.angle) !== null && _b !== void 0 ? _b : 0;
24308
+ const angle = (_d = labelStyle.angle) !== null && _d !== void 0 ? _d : 0;
24244
24309
  maxTextWidth = Math.max(maxTextWidth, text.AABBBounds.width());
24245
24310
  maxTextHeight = Math.max(maxTextHeight, text.AABBBounds.height());
24246
24311
  if (angle) {
@@ -24389,7 +24454,7 @@
24389
24454
  }
24390
24455
  _getLabelAttribute(tickDatum, index, tickData, layer) {
24391
24456
  var _a, _b, _c, _d, _e, _f;
24392
- const _g = this.attribute.label, { space = 4, inside = false, formatMethod } = _g, tagAttributes = __rest(_g, ["space", "inside", "formatMethod"]);
24457
+ const _g = this.attribute.label, { space = 4, inside = false, formatMethod, type = 'text', text } = _g, tagAttributes = __rest(_g, ["space", "inside", "formatMethod", "type", "text"]);
24393
24458
  let offset = space;
24394
24459
  let tickLength = 0;
24395
24460
  if (((_a = this.attribute.tick) === null || _a === void 0 ? void 0 : _a.visible) && ((_b = this.attribute.tick) === null || _b === void 0 ? void 0 : _b.inside) === inside) {
@@ -24410,7 +24475,9 @@
24410
24475
  }
24411
24476
  const point = this.getVerticalCoord(tickDatum.point, offset, inside);
24412
24477
  const vector = this.getVerticalVector(offset, inside, point);
24413
- const text = formatMethod ? formatMethod(`${tickDatum.label}`, tickDatum, index, tickData, layer) : tickDatum.label;
24478
+ const textContent = formatMethod
24479
+ ? formatMethod(`${tickDatum.label}`, tickDatum, index, tickData, layer)
24480
+ : tickDatum.label;
24414
24481
  let { style: textStyle } = tagAttributes;
24415
24482
  textStyle = vutils.isFunction(textStyle)
24416
24483
  ? vutils.merge({}, DEFAULT_AXIS_THEME.label.style, textStyle(tickDatum, index, tickData, layer))
@@ -24425,7 +24492,7 @@
24425
24492
  layer
24426
24493
  });
24427
24494
  }
24428
- return Object.assign(Object.assign(Object.assign({}, this.getLabelPosition(point, vector, text, textStyle)), { text, lineHeight: textStyle === null || textStyle === void 0 ? void 0 : textStyle.fontSize }), textStyle);
24495
+ return Object.assign(Object.assign(Object.assign({}, this.getLabelPosition(point, vector, textContent, textStyle)), { text: text !== null && text !== void 0 ? text : textContent, lineHeight: textStyle === null || textStyle === void 0 ? void 0 : textStyle.fontSize, type }), textStyle);
24429
24496
  }
24430
24497
  getLabelPosition(point, vector, text, style) {
24431
24498
  return point;
@@ -25163,7 +25230,7 @@
25163
25230
  let titleSpacing = 0;
25164
25231
  const axisLineWidth = (line === null || line === void 0 ? void 0 : line.visible) ? (_b = line.style.lineWidth) !== null && _b !== void 0 ? _b : 1 : 0;
25165
25232
  const tickLength = (tick === null || tick === void 0 ? void 0 : tick.visible) ? (_c = tick.length) !== null && _c !== void 0 ? _c : 4 : 0;
25166
- if (title === null || title === void 0 ? void 0 : title.visible) {
25233
+ if ((title === null || title === void 0 ? void 0 : title.visible) && typeof title.text === 'string') {
25167
25234
  titleHeight = measureTextSize(title.text, title.textStyle).height;
25168
25235
  const padding = vutils.normalizePadding(title.padding);
25169
25236
  titleSpacing = title.space + padding[0] + padding[2];
@@ -29371,19 +29438,27 @@
29371
29438
  this.name = 'title';
29372
29439
  }
29373
29440
  render() {
29374
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37;
29375
- const { text, textStyle, subtext, subtextStyle, width, height, minWidth, maxWidth, minHeight, maxHeight, align, verticalAlign, padding = 0 } = this.attribute;
29441
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69;
29442
+ const { textType, text, subtextType, textStyle, subtext, subtextStyle, width, height, minWidth, maxWidth, minHeight, maxHeight, align, verticalAlign, padding = 0 } = this.attribute;
29376
29443
  const parsedPadding = vutils.normalizePadding(padding);
29377
29444
  const group = this.createOrUpdateChild('title-container', { x: parsedPadding[3], y: parsedPadding[0], zIndex: 1 }, 'group');
29378
29445
  if (((_a = this.attribute) === null || _a === void 0 ? void 0 : _a.visible) !== false && (textStyle === null || textStyle === void 0 ? void 0 : textStyle.visible) !== false) {
29379
- if (textStyle && vutils.isValid(textStyle === null || textStyle === void 0 ? void 0 : textStyle.character)) {
29446
+ if (textType === 'rich') {
29447
+ const attr = Object.assign({ x: (_b = textStyle.x) !== null && _b !== void 0 ? _b : 0, y: (_c = textStyle.y) !== null && _c !== void 0 ? _c : 0, width: (_e = (_d = textStyle.width) !== null && _d !== void 0 ? _d : width) !== null && _e !== void 0 ? _e : 0, height: (_g = (_f = textStyle.height) !== null && _f !== void 0 ? _f : height) !== null && _g !== void 0 ? _g : 0, ellipsis: (_h = textStyle.ellipsis) !== null && _h !== void 0 ? _h : true, wordBreak: (_j = textStyle.wordBreak) !== null && _j !== void 0 ? _j : 'break-word', maxHeight: textStyle.maxHeight, maxWidth: textStyle.maxWidth, textConfig: text }, textStyle);
29448
+ this._mainTitle = group.createOrUpdateChild('mainTitle', attr, 'richtext');
29449
+ }
29450
+ else if (textType === 'html') {
29451
+ const attr = Object.assign({ html: Object.assign({ dom: text, container: '', width: 30, height: 30, style: '' }, textStyle), x: (_k = textStyle.x) !== null && _k !== void 0 ? _k : 0, y: (_l = textStyle.y) !== null && _l !== void 0 ? _l : 0, width: (_o = (_m = textStyle.width) !== null && _m !== void 0 ? _m : width) !== null && _o !== void 0 ? _o : 0, height: (_q = (_p = textStyle.height) !== null && _p !== void 0 ? _p : height) !== null && _q !== void 0 ? _q : 0, ellipsis: (_r = textStyle.ellipsis) !== null && _r !== void 0 ? _r : true, wordBreak: (_s = textStyle.wordBreak) !== null && _s !== void 0 ? _s : 'break-word', maxHeight: textStyle.maxHeight, maxWidth: textStyle.maxWidth, textConfig: [] }, textStyle);
29452
+ this._mainTitle = group.createOrUpdateChild('mainTitle', attr, 'richtext');
29453
+ }
29454
+ else if (textStyle && vutils.isValid(textStyle === null || textStyle === void 0 ? void 0 : textStyle.character)) {
29380
29455
  const attr = {
29381
- x: (_b = textStyle.x) !== null && _b !== void 0 ? _b : 0,
29382
- y: (_c = textStyle.y) !== null && _c !== void 0 ? _c : 0,
29383
- width: (_e = (_d = textStyle.width) !== null && _d !== void 0 ? _d : width) !== null && _e !== void 0 ? _e : 0,
29384
- height: (_g = (_f = textStyle.height) !== null && _f !== void 0 ? _f : height) !== null && _g !== void 0 ? _g : 0,
29385
- ellipsis: (_h = textStyle.ellipsis) !== null && _h !== void 0 ? _h : true,
29386
- wordBreak: (_j = textStyle.wordBreak) !== null && _j !== void 0 ? _j : 'break-word',
29456
+ x: (_t = textStyle.x) !== null && _t !== void 0 ? _t : 0,
29457
+ y: (_u = textStyle.y) !== null && _u !== void 0 ? _u : 0,
29458
+ width: (_w = (_v = textStyle.width) !== null && _v !== void 0 ? _v : width) !== null && _w !== void 0 ? _w : 0,
29459
+ height: (_y = (_x = textStyle.height) !== null && _x !== void 0 ? _x : height) !== null && _y !== void 0 ? _y : 0,
29460
+ ellipsis: (_z = textStyle.ellipsis) !== null && _z !== void 0 ? _z : true,
29461
+ wordBreak: (_0 = textStyle.wordBreak) !== null && _0 !== void 0 ? _0 : 'break-word',
29387
29462
  maxHeight: textStyle.maxHeight,
29388
29463
  maxWidth: textStyle.maxWidth,
29389
29464
  textConfig: textStyle.character
@@ -29391,20 +29466,28 @@
29391
29466
  this._mainTitle = group.createOrUpdateChild('mainTitle', attr, 'richtext');
29392
29467
  }
29393
29468
  else if (vutils.isValid(text)) {
29394
- this._mainTitle = group.createOrUpdateChild('mainTitle', Object.assign(Object.assign({ text: [text] }, textStyle), { maxLineWidth: (_k = textStyle === null || textStyle === void 0 ? void 0 : textStyle.maxLineWidth) !== null && _k !== void 0 ? _k : width, heightLimit: textStyle === null || textStyle === void 0 ? void 0 : textStyle.heightLimit, lineClamp: textStyle === null || textStyle === void 0 ? void 0 : textStyle.lineClamp, ellipsis: (_l = textStyle === null || textStyle === void 0 ? void 0 : textStyle.ellipsis) !== null && _l !== void 0 ? _l : true, x: 0, y: 0 }), 'wrapText');
29469
+ this._mainTitle = group.createOrUpdateChild('mainTitle', Object.assign(Object.assign({ text: [text] }, textStyle), { maxLineWidth: (_1 = textStyle === null || textStyle === void 0 ? void 0 : textStyle.maxLineWidth) !== null && _1 !== void 0 ? _1 : width, heightLimit: textStyle === null || textStyle === void 0 ? void 0 : textStyle.heightLimit, lineClamp: textStyle === null || textStyle === void 0 ? void 0 : textStyle.lineClamp, ellipsis: (_2 = textStyle === null || textStyle === void 0 ? void 0 : textStyle.ellipsis) !== null && _2 !== void 0 ? _2 : true, x: 0, y: 0 }), 'wrapText');
29395
29470
  }
29396
29471
  }
29397
- const maintextHeight = this._mainTitle ? (_m = this._mainTitle) === null || _m === void 0 ? void 0 : _m.AABBBounds.height() : 0;
29398
- const maintextWidth = this._mainTitle ? (_o = this._mainTitle) === null || _o === void 0 ? void 0 : _o.AABBBounds.width() : 0;
29399
- if (((_p = this.attribute) === null || _p === void 0 ? void 0 : _p.visible) !== false && (subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.visible) !== false) {
29400
- if (subtextStyle && vutils.isValid(subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.character)) {
29472
+ const maintextHeight = this._mainTitle ? (_3 = this._mainTitle) === null || _3 === void 0 ? void 0 : _3.AABBBounds.height() : 0;
29473
+ const maintextWidth = this._mainTitle ? (_4 = this._mainTitle) === null || _4 === void 0 ? void 0 : _4.AABBBounds.width() : 0;
29474
+ if (((_5 = this.attribute) === null || _5 === void 0 ? void 0 : _5.visible) !== false && (subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.visible) !== false) {
29475
+ if (subtextType === 'rich') {
29476
+ const attr = Object.assign({ x: (_6 = subtextStyle.x) !== null && _6 !== void 0 ? _6 : 0, y: (_7 = subtextStyle.y) !== null && _7 !== void 0 ? _7 : 0, width: (_9 = (_8 = subtextStyle.width) !== null && _8 !== void 0 ? _8 : width) !== null && _9 !== void 0 ? _9 : 0, height: (_11 = (_10 = subtextStyle.height) !== null && _10 !== void 0 ? _10 : height) !== null && _11 !== void 0 ? _11 : 0, ellipsis: (_12 = subtextStyle.ellipsis) !== null && _12 !== void 0 ? _12 : true, wordBreak: (_13 = subtextStyle.wordBreak) !== null && _13 !== void 0 ? _13 : 'break-word', maxHeight: subtextStyle.maxHeight, maxWidth: subtextStyle.maxWidth, textConfig: subtext }, subtextStyle);
29477
+ this._subTitle = group.createOrUpdateChild('subTitle', attr, 'richtext');
29478
+ }
29479
+ else if (textType === 'html') {
29480
+ const attr = Object.assign({ html: Object.assign({ dom: subtext, container: '', width: 30, height: 30, style: {} }, subtextStyle), x: (_14 = subtextStyle.x) !== null && _14 !== void 0 ? _14 : 0, y: (_15 = subtextStyle.y) !== null && _15 !== void 0 ? _15 : 0, width: (_17 = (_16 = subtextStyle.width) !== null && _16 !== void 0 ? _16 : width) !== null && _17 !== void 0 ? _17 : 0, height: (_19 = (_18 = subtextStyle.height) !== null && _18 !== void 0 ? _18 : height) !== null && _19 !== void 0 ? _19 : 0, ellipsis: (_20 = subtextStyle.ellipsis) !== null && _20 !== void 0 ? _20 : true, wordBreak: (_21 = subtextStyle.wordBreak) !== null && _21 !== void 0 ? _21 : 'break-word', maxHeight: subtextStyle.maxHeight, maxWidth: subtextStyle.maxWidth, textConfig: [] }, subtextStyle);
29481
+ this._subTitle = group.createOrUpdateChild('subTitle', attr, 'richtext');
29482
+ }
29483
+ else if (subtextStyle && vutils.isValid(subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.character)) {
29401
29484
  const attr = {
29402
- x: (_q = subtextStyle.x) !== null && _q !== void 0 ? _q : 0,
29403
- y: (_r = subtextStyle.y) !== null && _r !== void 0 ? _r : maintextHeight,
29404
- width: (_t = (_s = subtextStyle.width) !== null && _s !== void 0 ? _s : width) !== null && _t !== void 0 ? _t : 0,
29405
- height: (_v = (_u = subtextStyle.height) !== null && _u !== void 0 ? _u : height) !== null && _v !== void 0 ? _v : 0,
29406
- ellipsis: (_w = subtextStyle.ellipsis) !== null && _w !== void 0 ? _w : true,
29407
- wordBreak: (_x = subtextStyle.wordBreak) !== null && _x !== void 0 ? _x : 'break-word',
29485
+ x: (_22 = subtextStyle.x) !== null && _22 !== void 0 ? _22 : 0,
29486
+ y: (_23 = subtextStyle.y) !== null && _23 !== void 0 ? _23 : maintextHeight,
29487
+ width: (_25 = (_24 = subtextStyle.width) !== null && _24 !== void 0 ? _24 : width) !== null && _25 !== void 0 ? _25 : 0,
29488
+ height: (_27 = (_26 = subtextStyle.height) !== null && _26 !== void 0 ? _26 : height) !== null && _27 !== void 0 ? _27 : 0,
29489
+ ellipsis: (_28 = subtextStyle.ellipsis) !== null && _28 !== void 0 ? _28 : true,
29490
+ wordBreak: (_29 = subtextStyle.wordBreak) !== null && _29 !== void 0 ? _29 : 'break-word',
29408
29491
  maxHeight: subtextStyle.maxHeight,
29409
29492
  maxWidth: subtextStyle.maxWidth,
29410
29493
  textConfig: subtextStyle.character
@@ -29412,17 +29495,17 @@
29412
29495
  this._subTitle = group.createOrUpdateChild('subTitle', attr, 'richtext');
29413
29496
  }
29414
29497
  else if (vutils.isValid(subtext)) {
29415
- this._subTitle = group.createOrUpdateChild('subTitle', Object.assign(Object.assign({ text: [subtext] }, subtextStyle), { maxLineWidth: (_y = subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.maxLineWidth) !== null && _y !== void 0 ? _y : width, heightLimit: subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.heightLimit, lineClamp: subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.lineClamp, ellipsis: (_z = subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.ellipsis) !== null && _z !== void 0 ? _z : true, x: 0, y: maintextHeight }), 'wrapText');
29498
+ this._subTitle = group.createOrUpdateChild('subTitle', Object.assign(Object.assign({ text: [subtext] }, subtextStyle), { maxLineWidth: (_30 = subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.maxLineWidth) !== null && _30 !== void 0 ? _30 : width, heightLimit: subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.heightLimit, lineClamp: subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.lineClamp, ellipsis: (_31 = subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.ellipsis) !== null && _31 !== void 0 ? _31 : true, x: 0, y: maintextHeight }), 'wrapText');
29416
29499
  }
29417
29500
  }
29418
- const subtextHeight = this._subTitle ? (_0 = this._subTitle) === null || _0 === void 0 ? void 0 : _0.AABBBounds.height() : 0;
29419
- const subtextWidth = this._subTitle ? (_1 = this._subTitle) === null || _1 === void 0 ? void 0 : _1.AABBBounds.width() : 0;
29501
+ const subtextHeight = this._subTitle ? (_32 = this._subTitle) === null || _32 === void 0 ? void 0 : _32.AABBBounds.height() : 0;
29502
+ const subtextWidth = this._subTitle ? (_33 = this._subTitle) === null || _33 === void 0 ? void 0 : _33.AABBBounds.width() : 0;
29420
29503
  let titleWidth = Math.max(maintextWidth, subtextWidth);
29421
- let titleHeight = maintextHeight + ((_2 = subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.height) !== null && _2 !== void 0 ? _2 : subtextHeight);
29504
+ let titleHeight = maintextHeight + ((_34 = subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.height) !== null && _34 !== void 0 ? _34 : subtextHeight);
29422
29505
  if (vutils.isValid(width)) {
29423
29506
  titleWidth = width;
29424
- (_3 = this._mainTitle) === null || _3 === void 0 ? void 0 : _3.setAttribute('maxLineWidth', width);
29425
- (_4 = this._subTitle) === null || _4 === void 0 ? void 0 : _4.setAttribute('maxLineWidth', width);
29507
+ (_35 = this._mainTitle) === null || _35 === void 0 ? void 0 : _35.setAttribute('maxLineWidth', width);
29508
+ (_36 = this._subTitle) === null || _36 === void 0 ? void 0 : _36.setAttribute('maxLineWidth', width);
29426
29509
  }
29427
29510
  if (vutils.isValid(height)) {
29428
29511
  titleHeight = height;
@@ -29431,10 +29514,10 @@
29431
29514
  titleWidth = minWidth;
29432
29515
  }
29433
29516
  if (vutils.isValid(maxWidth)) {
29434
- (_5 = this._mainTitle) === null || _5 === void 0 ? void 0 : _5.setAttribute('maxLineWidth', maxWidth);
29435
- (_6 = this._subTitle) === null || _6 === void 0 ? void 0 : _6.setAttribute('maxLineWidth', maxWidth);
29436
- (_7 = this._mainTitle) === null || _7 === void 0 ? void 0 : _7.setAttribute('maxWidth', maxWidth);
29437
- (_8 = this._subTitle) === null || _8 === void 0 ? void 0 : _8.setAttribute('maxWidth', maxWidth);
29517
+ (_37 = this._mainTitle) === null || _37 === void 0 ? void 0 : _37.setAttribute('maxLineWidth', maxWidth);
29518
+ (_38 = this._subTitle) === null || _38 === void 0 ? void 0 : _38.setAttribute('maxLineWidth', maxWidth);
29519
+ (_39 = this._mainTitle) === null || _39 === void 0 ? void 0 : _39.setAttribute('maxWidth', maxWidth);
29520
+ (_40 = this._subTitle) === null || _40 === void 0 ? void 0 : _40.setAttribute('maxWidth', maxWidth);
29438
29521
  if (titleWidth > maxWidth) {
29439
29522
  titleWidth = maxWidth;
29440
29523
  }
@@ -29443,8 +29526,8 @@
29443
29526
  titleHeight = minHeight;
29444
29527
  }
29445
29528
  if (vutils.isValid(maxHeight)) {
29446
- (_9 = this._mainTitle) === null || _9 === void 0 ? void 0 : _9.setAttribute('maxHeight', maxHeight);
29447
- (_10 = this._subTitle) === null || _10 === void 0 ? void 0 : _10.setAttribute('maxHeight', maxHeight - maintextHeight);
29529
+ (_41 = this._mainTitle) === null || _41 === void 0 ? void 0 : _41.setAttribute('maxHeight', maxHeight);
29530
+ (_42 = this._subTitle) === null || _42 === void 0 ? void 0 : _42.setAttribute('maxHeight', maxHeight - maintextHeight);
29448
29531
  if (titleHeight > maxHeight) {
29449
29532
  titleHeight = maxHeight;
29450
29533
  }
@@ -29454,67 +29537,67 @@
29454
29537
  group.attribute.boundsPadding = parsedPadding;
29455
29538
  if (vutils.isValid(align) || vutils.isValid(textStyle === null || textStyle === void 0 ? void 0 : textStyle.align)) {
29456
29539
  const mainTitleAlign = (textStyle === null || textStyle === void 0 ? void 0 : textStyle.align) ? textStyle === null || textStyle === void 0 ? void 0 : textStyle.align : align;
29457
- const mainTitleWidth = (_11 = textStyle === null || textStyle === void 0 ? void 0 : textStyle.width) !== null && _11 !== void 0 ? _11 : maintextWidth;
29540
+ const mainTitleWidth = (_43 = textStyle === null || textStyle === void 0 ? void 0 : textStyle.width) !== null && _43 !== void 0 ? _43 : maintextWidth;
29458
29541
  if (mainTitleAlign === 'left') {
29459
- (_12 = this._mainTitle) === null || _12 === void 0 ? void 0 : _12.setAttribute('x', 0);
29460
- (_13 = this._mainTitle) === null || _13 === void 0 ? void 0 : _13.setAttribute('textAlign', 'left');
29542
+ (_44 = this._mainTitle) === null || _44 === void 0 ? void 0 : _44.setAttribute('x', 0);
29543
+ (_45 = this._mainTitle) === null || _45 === void 0 ? void 0 : _45.setAttribute('textAlign', 'left');
29461
29544
  }
29462
29545
  else if (mainTitleAlign === 'center') {
29463
- (_14 = this._mainTitle) === null || _14 === void 0 ? void 0 : _14.setAttribute('x', mainTitleWidth / 2);
29464
- (_15 = this._mainTitle) === null || _15 === void 0 ? void 0 : _15.setAttribute('textAlign', 'center');
29546
+ (_46 = this._mainTitle) === null || _46 === void 0 ? void 0 : _46.setAttribute('x', mainTitleWidth / 2);
29547
+ (_47 = this._mainTitle) === null || _47 === void 0 ? void 0 : _47.setAttribute('textAlign', 'center');
29465
29548
  }
29466
29549
  else if (mainTitleAlign === 'right') {
29467
- (_16 = this._mainTitle) === null || _16 === void 0 ? void 0 : _16.setAttribute('x', mainTitleWidth);
29468
- (_17 = this._mainTitle) === null || _17 === void 0 ? void 0 : _17.setAttribute('textAlign', 'right');
29550
+ (_48 = this._mainTitle) === null || _48 === void 0 ? void 0 : _48.setAttribute('x', mainTitleWidth);
29551
+ (_49 = this._mainTitle) === null || _49 === void 0 ? void 0 : _49.setAttribute('textAlign', 'right');
29469
29552
  }
29470
29553
  }
29471
29554
  if (vutils.isValid(verticalAlign) || vutils.isValid(textStyle === null || textStyle === void 0 ? void 0 : textStyle.verticalAlign)) {
29472
29555
  const mainTitleVerticalAlign = (textStyle === null || textStyle === void 0 ? void 0 : textStyle.verticalAlign) ? textStyle === null || textStyle === void 0 ? void 0 : textStyle.verticalAlign : verticalAlign;
29473
29556
  const mainTitleHeight = (textStyle === null || textStyle === void 0 ? void 0 : textStyle.height) ? textStyle === null || textStyle === void 0 ? void 0 : textStyle.height : titleHeight;
29474
29557
  if (mainTitleVerticalAlign === 'top') {
29475
- (_18 = this._mainTitle) === null || _18 === void 0 ? void 0 : _18.setAttribute('y', 0);
29476
- (_19 = this._mainTitle) === null || _19 === void 0 ? void 0 : _19.setAttribute('textBaseline', 'top');
29558
+ (_50 = this._mainTitle) === null || _50 === void 0 ? void 0 : _50.setAttribute('y', 0);
29559
+ (_51 = this._mainTitle) === null || _51 === void 0 ? void 0 : _51.setAttribute('textBaseline', 'top');
29477
29560
  }
29478
29561
  else if (mainTitleVerticalAlign === 'middle') {
29479
- (_20 = this._mainTitle) === null || _20 === void 0 ? void 0 : _20.setAttribute('y', mainTitleHeight / 2);
29480
- (_21 = this._mainTitle) === null || _21 === void 0 ? void 0 : _21.setAttribute('textBaseline', 'middle');
29562
+ (_52 = this._mainTitle) === null || _52 === void 0 ? void 0 : _52.setAttribute('y', mainTitleHeight / 2);
29563
+ (_53 = this._mainTitle) === null || _53 === void 0 ? void 0 : _53.setAttribute('textBaseline', 'middle');
29481
29564
  }
29482
29565
  else if (mainTitleVerticalAlign === 'bottom') {
29483
- (_22 = this._mainTitle) === null || _22 === void 0 ? void 0 : _22.setAttribute('y', mainTitleHeight);
29484
- (_23 = this._mainTitle) === null || _23 === void 0 ? void 0 : _23.setAttribute('textBaseline', 'bottom');
29566
+ (_54 = this._mainTitle) === null || _54 === void 0 ? void 0 : _54.setAttribute('y', mainTitleHeight);
29567
+ (_55 = this._mainTitle) === null || _55 === void 0 ? void 0 : _55.setAttribute('textBaseline', 'bottom');
29485
29568
  }
29486
29569
  }
29487
29570
  if (vutils.isValid(align) || vutils.isValid(subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.align)) {
29488
29571
  const subTitleAlign = (subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.align) ? subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.align : align;
29489
- const subTitleWidth = (_24 = subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.width) !== null && _24 !== void 0 ? _24 : subtextWidth;
29572
+ const subTitleWidth = (_56 = subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.width) !== null && _56 !== void 0 ? _56 : subtextWidth;
29490
29573
  if (subTitleAlign === 'left') {
29491
- (_25 = this._subTitle) === null || _25 === void 0 ? void 0 : _25.setAttribute('x', 0);
29492
- (_26 = this._subTitle) === null || _26 === void 0 ? void 0 : _26.setAttribute('textAlign', 'left');
29574
+ (_57 = this._subTitle) === null || _57 === void 0 ? void 0 : _57.setAttribute('x', 0);
29575
+ (_58 = this._subTitle) === null || _58 === void 0 ? void 0 : _58.setAttribute('textAlign', 'left');
29493
29576
  }
29494
29577
  else if (subTitleAlign === 'center') {
29495
- (_27 = this._subTitle) === null || _27 === void 0 ? void 0 : _27.setAttribute('x', subTitleWidth / 2);
29496
- (_28 = this._subTitle) === null || _28 === void 0 ? void 0 : _28.setAttribute('textAlign', 'center');
29578
+ (_59 = this._subTitle) === null || _59 === void 0 ? void 0 : _59.setAttribute('x', subTitleWidth / 2);
29579
+ (_60 = this._subTitle) === null || _60 === void 0 ? void 0 : _60.setAttribute('textAlign', 'center');
29497
29580
  }
29498
29581
  else if (subTitleAlign === 'right') {
29499
- (_29 = this._subTitle) === null || _29 === void 0 ? void 0 : _29.setAttribute('x', subTitleWidth);
29500
- (_30 = this._subTitle) === null || _30 === void 0 ? void 0 : _30.setAttribute('textAlign', 'right');
29582
+ (_61 = this._subTitle) === null || _61 === void 0 ? void 0 : _61.setAttribute('x', subTitleWidth);
29583
+ (_62 = this._subTitle) === null || _62 === void 0 ? void 0 : _62.setAttribute('textAlign', 'right');
29501
29584
  }
29502
29585
  }
29503
29586
  if (vutils.isValid(verticalAlign) || vutils.isValid(textStyle === null || textStyle === void 0 ? void 0 : textStyle.verticalAlign)) {
29504
29587
  const subTitleVerticalAlign = (subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.verticalAlign) ? subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.verticalAlign : verticalAlign;
29505
29588
  const subTitleYStart = maintextHeight;
29506
- const subTitleHeight = (_31 = subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.height) !== null && _31 !== void 0 ? _31 : 0;
29589
+ const subTitleHeight = (_63 = subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.height) !== null && _63 !== void 0 ? _63 : 0;
29507
29590
  if (subTitleVerticalAlign === 'top') {
29508
- (_32 = this._subTitle) === null || _32 === void 0 ? void 0 : _32.setAttribute('y', subTitleYStart);
29509
- (_33 = this._subTitle) === null || _33 === void 0 ? void 0 : _33.setAttribute('textBaseline', 'top');
29591
+ (_64 = this._subTitle) === null || _64 === void 0 ? void 0 : _64.setAttribute('y', subTitleYStart);
29592
+ (_65 = this._subTitle) === null || _65 === void 0 ? void 0 : _65.setAttribute('textBaseline', 'top');
29510
29593
  }
29511
29594
  else if (subTitleVerticalAlign === 'middle') {
29512
- (_34 = this._subTitle) === null || _34 === void 0 ? void 0 : _34.setAttribute('y', subTitleYStart + subTitleHeight / 2);
29513
- (_35 = this._subTitle) === null || _35 === void 0 ? void 0 : _35.setAttribute('textBaseline', 'middle');
29595
+ (_66 = this._subTitle) === null || _66 === void 0 ? void 0 : _66.setAttribute('y', subTitleYStart + subTitleHeight / 2);
29596
+ (_67 = this._subTitle) === null || _67 === void 0 ? void 0 : _67.setAttribute('textBaseline', 'middle');
29514
29597
  }
29515
29598
  else if (subTitleVerticalAlign === 'bottom') {
29516
- (_36 = this._subTitle) === null || _36 === void 0 ? void 0 : _36.setAttribute('y', subTitleYStart + subTitleHeight);
29517
- (_37 = this._subTitle) === null || _37 === void 0 ? void 0 : _37.setAttribute('textBaseline', 'bottom');
29599
+ (_68 = this._subTitle) === null || _68 === void 0 ? void 0 : _68.setAttribute('y', subTitleYStart + subTitleHeight);
29600
+ (_69 = this._subTitle) === null || _69 === void 0 ? void 0 : _69.setAttribute('textBaseline', 'bottom');
29518
29601
  }
29519
29602
  }
29520
29603
  }
@@ -29569,7 +29652,7 @@
29569
29652
  this.name = 'indicator';
29570
29653
  }
29571
29654
  render() {
29572
- var _a;
29655
+ var _a, _b, _c;
29573
29656
  const { visible, title, content, size, limitRatio = Infinity } = this.attribute;
29574
29657
  const limit = Math.min(size.width, size.height) * limitRatio;
29575
29658
  const group = this.createOrUpdateChild('indicator-container', { x: 0, y: 0, zIndex: 1 }, 'group');
@@ -29580,7 +29663,15 @@
29580
29663
  if (vutils.isValid(title)) {
29581
29664
  if (title.visible !== false) {
29582
29665
  const titleStyle = vutils.merge({}, vutils.get(DEFAULT_INDICATOR_THEME, 'title.style'), title.style);
29583
- this._title = group.createOrUpdateChild('indicator-title', Object.assign(Object.assign({}, titleStyle), { lineHeight: vutils.isValid(titleStyle.lineHeight) ? titleStyle.lineHeight : titleStyle.fontSize, visible: title.visible, x: 0, y: 0 }), 'text');
29666
+ if (titleStyle.type === 'rich') {
29667
+ this._title = group.createOrUpdateChild('indicator-title', Object.assign(Object.assign({ textConfig: titleStyle.text }, titleStyle), { visible: title.visible, x: 0, y: 0, width: (_a = titleStyle.width) !== null && _a !== void 0 ? _a : 0, height: (_b = titleStyle.height) !== null && _b !== void 0 ? _b : 0 }), 'richtext');
29668
+ }
29669
+ else if (titleStyle.type === 'html') {
29670
+ this._title = group.createOrUpdateChild('indicator-title', Object.assign(Object.assign({ textConfig: [], html: Object.assign({ dom: titleStyle.text, container: '', width: 30, height: 30, style: {} }, titleStyle) }, titleStyle), { visible: title.visible, x: 0, y: 0 }), 'richtext');
29671
+ }
29672
+ else {
29673
+ this._title = group.createOrUpdateChild('indicator-title', Object.assign(Object.assign({}, titleStyle), { lineHeight: vutils.isValid(titleStyle.lineHeight) ? titleStyle.lineHeight : titleStyle.fontSize, visible: title.visible, x: 0, y: 0 }), 'text');
29674
+ }
29584
29675
  if (title.autoFit && vutils.isValidNumber(limit)) {
29585
29676
  this._setAutoFit(limit, this._title, title);
29586
29677
  }
@@ -29601,9 +29692,19 @@
29601
29692
  const contentComponents = [];
29602
29693
  let lastContentHeight = 0;
29603
29694
  contents.forEach((contentItem, i) => {
29695
+ var _a, _b;
29604
29696
  if (contentItem.visible !== false) {
29605
29697
  const contentStyle = vutils.merge({}, vutils.get(DEFAULT_INDICATOR_THEME, 'content.style'), contentItem.style);
29606
- const contentComponent = group.createOrUpdateChild('indicator-content-' + i, Object.assign(Object.assign({}, contentStyle), { lineHeight: vutils.isValid(contentStyle.lineHeight) ? contentStyle.lineHeight : contentStyle.fontSize, visible: contentItem.visible, x: 0, y: titleHeight + titleSpace + lastContentHeight }), 'text');
29698
+ let contentComponent;
29699
+ if (contentStyle.type === 'rich') {
29700
+ contentComponent = group.createOrUpdateChild('indicator-content-' + i, Object.assign(Object.assign({ textConfig: contentStyle.text }, contentStyle), { visible: title.visible, x: 0, y: titleHeight + titleSpace + lastContentHeight, width: (_a = contentStyle.width) !== null && _a !== void 0 ? _a : 0, height: (_b = contentStyle.height) !== null && _b !== void 0 ? _b : 0 }), 'richtext');
29701
+ }
29702
+ else if (contentStyle.type === 'html') {
29703
+ contentComponent = group.createOrUpdateChild('indicator-content-' + i, Object.assign(Object.assign({ textConfig: [], html: Object.assign({ dom: contentStyle.text, container: '', width: 30, height: 30, style: {} }, contentStyle) }, contentStyle), { visible: title.visible, x: 0, y: titleHeight + titleSpace + lastContentHeight }), 'richtext');
29704
+ }
29705
+ else {
29706
+ contentComponent = group.createOrUpdateChild('indicator-content-' + i, Object.assign(Object.assign({}, contentStyle), { lineHeight: vutils.isValid(contentStyle.lineHeight) ? contentStyle.lineHeight : contentStyle.fontSize, visible: contentItem.visible, x: 0, y: titleHeight + titleSpace + lastContentHeight }), 'text');
29707
+ }
29607
29708
  if (contentItem.autoFit && vutils.isValidNumber(limit)) {
29608
29709
  this._setAutoFit(limit, contentComponent, contentItem);
29609
29710
  }
@@ -29621,7 +29722,7 @@
29621
29722
  });
29622
29723
  this._content = contentComponents;
29623
29724
  }
29624
- const totalHeight = (_a = group === null || group === void 0 ? void 0 : group.AABBBounds.height()) !== null && _a !== void 0 ? _a : 0;
29725
+ const totalHeight = (_c = group === null || group === void 0 ? void 0 : group.AABBBounds.height()) !== null && _c !== void 0 ? _c : 0;
29625
29726
  group.setAttribute('y', size.height / 2 - totalHeight / 2);
29626
29727
  group.setAttribute('x', size.width / 2);
29627
29728
  }
@@ -30980,7 +31081,13 @@
30980
31081
  this._tooltipTitleSymbol = this._tooltipTitleContainer.createOrUpdateChild(`${TOOLTIP_TITLE_NAME}-${TOOLTIP_SHAPE_NAME_SUFFIX}`, vutils.merge({ symbolType: 'circle' }, titleAttr.shape, {
30981
31082
  visible: isVisible(titleAttr) && isVisible(titleAttr.shape)
30982
31083
  }), 'symbol');
30983
- if (titleAttr.value.multiLine) {
31084
+ if (titleAttr.value.type === 'rich') {
31085
+ this._tooltipTitle = this._tooltipTitleContainer.createOrUpdateChild(`${TOOLTIP_TITLE_NAME}-${TOOLTIP_VALUE_NAME_SUFFIX}`, Object.assign({ visible: isVisible(titleAttr) && isVisible(titleAttr.value), width: titleAttr.value.width, height: titleAttr.value.height, wordBreak: titleAttr.value.wordBreak, textAlign: titleAttr.value.textAlign, textBaseline: titleAttr.value.textBaseline, singleLine: false, textConfig: titleAttr.value.text }, titleAttr.value), 'richtext');
31086
+ }
31087
+ else if (titleAttr.value.type === 'html') {
31088
+ this._tooltipTitle = this._tooltipTitleContainer.createOrUpdateChild(`${TOOLTIP_TITLE_NAME}-${TOOLTIP_VALUE_NAME_SUFFIX}`, Object.assign({ html: Object.assign({ dom: titleAttr.value.text, container: '', width: 30, height: 30, style: {} }, titleAttr.value), visible: isVisible(titleAttr) && isVisible(titleAttr.value), width: titleAttr.value.width, height: titleAttr.value.height, wordBreak: titleAttr.value.wordBreak, textAlign: titleAttr.value.textAlign, textBaseline: titleAttr.value.textBaseline, singleLine: false, textConfig: [] }, titleAttr.value), 'richtext');
31089
+ }
31090
+ else if (titleAttr.value.multiLine) {
30984
31091
  this._tooltipTitle = this._tooltipTitleContainer.createOrUpdateChild(`${TOOLTIP_TITLE_NAME}-${TOOLTIP_VALUE_NAME_SUFFIX}`, Object.assign({ visible: isVisible(titleAttr) && isVisible(titleAttr.value) }, getRichTextAttribute(titleAttr.value)), 'richtext');
30985
31092
  }
30986
31093
  else {
@@ -31408,7 +31515,7 @@
31408
31515
  }
31409
31516
  };
31410
31517
 
31411
- const version = "0.16.14-alpha.5";
31518
+ const version = "0.16.14-alpha.7";
31412
31519
 
31413
31520
  exports.AbstractComponent = AbstractComponent;
31414
31521
  exports.ArcInfo = ArcInfo;