@visactor/vrender-components 0.21.14 → 0.22.0-vstory.10

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 (104) hide show
  1. package/cjs/axis/type.js.map +1 -1
  2. package/cjs/axis/util.js +2 -1
  3. package/cjs/brush/type.js +1 -2
  4. package/cjs/core/base.d.ts +1 -0
  5. package/cjs/core/base.js +3 -3
  6. package/cjs/core/base.js.map +1 -1
  7. package/cjs/core/type.js.map +1 -1
  8. package/cjs/index.d.ts +3 -1
  9. package/cjs/index.js +3 -2
  10. package/cjs/index.js.map +1 -1
  11. package/cjs/interface.d.ts +2 -1
  12. package/cjs/interface.js.map +1 -1
  13. package/cjs/label/base.js +4 -7
  14. package/cjs/label/base.js.map +1 -1
  15. package/cjs/label/type.d.ts +3 -3
  16. package/cjs/label/type.js.map +1 -1
  17. package/cjs/label-item/index.d.ts +2 -0
  18. package/cjs/label-item/index.js +21 -0
  19. package/cjs/label-item/index.js.map +1 -0
  20. package/cjs/label-item/label-item.d.ts +29 -0
  21. package/cjs/label-item/label-item.js +265 -0
  22. package/cjs/label-item/label-item.js.map +1 -0
  23. package/cjs/label-item/register.d.ts +1 -0
  24. package/cjs/label-item/register.js +15 -0
  25. package/cjs/label-item/register.js.map +1 -0
  26. package/cjs/label-item/type.d.ts +31 -0
  27. package/cjs/label-item/type.js +6 -0
  28. package/cjs/label-item/type.js.map +1 -0
  29. package/cjs/legend/discrete/type.js.map +1 -1
  30. package/cjs/marker/area.js +14 -5
  31. package/cjs/marker/area.js.map +1 -1
  32. package/cjs/marker/type.js.map +1 -1
  33. package/cjs/poptip/poptip.d.ts +14 -2
  34. package/cjs/poptip/poptip.js +137 -51
  35. package/cjs/poptip/poptip.js.map +1 -1
  36. package/cjs/poptip/type.d.ts +6 -0
  37. package/cjs/poptip/type.js.map +1 -1
  38. package/cjs/title/title.js +40 -40
  39. package/cjs/title/title.js.map +1 -1
  40. package/cjs/weather/index.d.ts +1 -0
  41. package/cjs/weather/index.js +21 -0
  42. package/cjs/weather/index.js.map +1 -0
  43. package/cjs/weather/register.d.ts +1 -0
  44. package/cjs/weather/register.js +14 -0
  45. package/cjs/weather/register.js.map +1 -0
  46. package/cjs/weather/type.d.ts +24 -0
  47. package/cjs/weather/type.js +6 -0
  48. package/cjs/weather/type.js.map +1 -0
  49. package/cjs/weather/weather-box.d.ts +13 -0
  50. package/cjs/weather/weather-box.js +129 -0
  51. package/cjs/weather/weather-box.js.map +1 -0
  52. package/dist/index.es.js +6009 -4982
  53. package/es/axis/type.js.map +1 -1
  54. package/es/axis/util.js +2 -1
  55. package/es/brush/type.js +1 -2
  56. package/es/core/base.d.ts +1 -0
  57. package/es/core/base.js +4 -3
  58. package/es/core/base.js.map +1 -1
  59. package/es/core/type.js.map +1 -1
  60. package/es/index.d.ts +3 -1
  61. package/es/index.js +5 -1
  62. package/es/index.js.map +1 -1
  63. package/es/interface.d.ts +2 -1
  64. package/es/interface.js.map +1 -1
  65. package/es/label/base.js +4 -7
  66. package/es/label/base.js.map +1 -1
  67. package/es/label/type.d.ts +3 -3
  68. package/es/label/type.js.map +1 -1
  69. package/es/label-item/index.d.ts +2 -0
  70. package/es/label-item/index.js +4 -0
  71. package/es/label-item/index.js.map +1 -0
  72. package/es/label-item/label-item.d.ts +29 -0
  73. package/es/label-item/label-item.js +263 -0
  74. package/es/label-item/label-item.js.map +1 -0
  75. package/es/label-item/register.d.ts +1 -0
  76. package/es/label-item/register.js +6 -0
  77. package/es/label-item/register.js.map +1 -0
  78. package/es/label-item/type.d.ts +31 -0
  79. package/es/label-item/type.js +2 -0
  80. package/es/label-item/type.js.map +1 -0
  81. package/es/legend/discrete/type.js.map +1 -1
  82. package/es/marker/area.js +14 -5
  83. package/es/marker/area.js.map +1 -1
  84. package/es/marker/type.js.map +1 -1
  85. package/es/poptip/poptip.d.ts +14 -2
  86. package/es/poptip/poptip.js +136 -49
  87. package/es/poptip/poptip.js.map +1 -1
  88. package/es/poptip/type.d.ts +6 -0
  89. package/es/poptip/type.js.map +1 -1
  90. package/es/title/title.js +38 -37
  91. package/es/title/title.js.map +1 -1
  92. package/es/weather/index.d.ts +1 -0
  93. package/es/weather/index.js +2 -0
  94. package/es/weather/index.js.map +1 -0
  95. package/es/weather/register.d.ts +1 -0
  96. package/es/weather/register.js +6 -0
  97. package/es/weather/register.js.map +1 -0
  98. package/es/weather/type.d.ts +24 -0
  99. package/es/weather/type.js +2 -0
  100. package/es/weather/type.js.map +1 -0
  101. package/es/weather/weather-box.d.ts +13 -0
  102. package/es/weather/weather-box.js +127 -0
  103. package/es/weather/weather-box.js.map +1 -0
  104. package/package.json +8 -8
@@ -14,18 +14,29 @@ Object.defineProperty(exports, "__esModule", {
14
14
  value: !0
15
15
  }), exports.PopTip = void 0;
16
16
 
17
- const vutils_1 = require("@visactor/vutils"), base_1 = require("../core/base"), register_1 = require("./register"), _tBounds = new vutils_1.AABBBounds;
17
+ const vrender_core_1 = require("@visactor/vrender-core"), vutils_1 = require("@visactor/vutils"), base_1 = require("../core/base"), register_1 = require("./register"), _tBounds = new vutils_1.AABBBounds;
18
18
 
19
19
  (0, register_1.loadPoptipComponent)();
20
20
 
21
+ const tlStr = "M -0.5 -0.5, L -0.5 0.5, L 0.5 -0.5, Z", blStr = "M -0.5 -0.5, L -0.5 0.5, L 0.5 0.5, Z", trStr = "M -0.5 -0.5, L 0.5 -0.5, L 0.5 0.5, Z", brStr = "M 0.5 -0.5, L 0.5 0.5, L -0.5 0.5, Z", conciseSymbolMap = {
22
+ tl: tlStr,
23
+ tr: trStr,
24
+ bl: blStr,
25
+ br: brStr,
26
+ lt: tlStr,
27
+ lb: blStr,
28
+ rt: trStr,
29
+ rb: brStr
30
+ };
31
+
21
32
  class PopTip extends base_1.AbstractComponent {
22
33
  constructor(attributes, options) {
23
34
  super((null == options ? void 0 : options.skipDefault) ? attributes : (0, vutils_1.merge)({}, PopTip.defaultAttributes, attributes)),
24
35
  this.name = "poptip", this.positionList = [ "top", "tl", "tr", "bottom", "bl", "br", "left", "lt", "lb", "right", "rt", "rb" ];
25
36
  }
26
37
  render() {
27
- var _a, _b, _c, _d, _e, _f, _g, _h;
28
- const {titleStyle: titleStyle = {}, position: position, contentStyle: contentStyle = {}, panel: panel = {}, space: space = 4, minWidth: minWidth = 0, maxWidth: maxWidth = 1 / 0, padding: padding = 4, maxWidthPercent: maxWidthPercent, visible: visible, state: state, dx: dx = 0, dy: dy = 0} = this.attribute;
38
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
39
+ const {titleStyle: titleStyle = {}, position: position, contentStyle: contentStyle = {}, panel: panel, logoSymbol: logoSymbol, logoText: logoText, logoTextStyle: logoTextStyle = {}, triangleMode: triangleMode = "default", space: space = 4, minWidth: minWidth = 0, maxWidth: maxWidth = 1 / 0, padding: padding = 4, maxWidthPercent: maxWidthPercent, visible: visible, state: state, dx: dx = 0, dy: dy = 0} = this.attribute;
29
40
  let {title: title = "", content: content = ""} = this.attribute;
30
41
  title = this.attribute.titleFormatMethod ? this.attribute.titleFormatMethod(title) : title,
31
42
  content = this.attribute.contentFormatMethod ? this.attribute.contentFormatMethod(content) : content;
@@ -33,7 +44,9 @@ class PopTip extends base_1.AbstractComponent {
33
44
  x: 0,
34
45
  y: 0,
35
46
  zIndex: 1
36
- }, "group"), maxLineWidth = maxWidth - parsedPadding[1] - parsedPadding[3], titleVisible = (0,
47
+ }, "group");
48
+ this.group = group;
49
+ const maxLineWidth = maxWidth - parsedPadding[1] - parsedPadding[3], titleVisible = (0,
37
50
  vutils_1.isValid)(title) && !1 !== visible, titleAttrs = Object.assign(Object.assign({
38
51
  text: (0, vutils_1.isArray)(title) ? title : [ title ],
39
52
  visible: titleVisible,
@@ -62,11 +75,22 @@ class PopTip extends base_1.AbstractComponent {
62
75
  }), contentShape = group.createOrUpdateChild("poptip-content", contentAttrs, "text");
63
76
  (0, vutils_1.isEmpty)(null == state ? void 0 : state.content) || (contentShape.states = state.content);
64
77
  const contentBounds = contentShape.AABBBounds, contentHeight = contentBounds.height(), contentWidth = contentBounds.width();
65
- contentVisible && (height += contentHeight);
78
+ contentVisible && (height += contentHeight), this.titleShape = titleShape, this.contentShape = contentShape;
66
79
  let popTipWidth = (0, vutils_1.max)(titleWidth + parsedPadding[1] + parsedPadding[3], contentWidth + parsedPadding[1] + parsedPadding[3]);
67
80
  popTipWidth > maxWidth ? popTipWidth = maxWidth : popTipWidth < minWidth && (popTipWidth = minWidth);
68
81
  let poptipHeight = parsedPadding[0] + parsedPadding[2] + height;
69
- const {visible: bgVisible} = panel, backgroundStyle = __rest(panel, [ "visible" ]), symbolSize = null !== (_a = backgroundStyle.size) && void 0 !== _a ? _a : 12, spaceSize = (0,
82
+ const {visible: bgVisible, square: square} = panel, backgroundStyle = __rest(panel, [ "visible", "square" ]);
83
+ if (square) {
84
+ const maxWH = (0, vutils_1.max)(popTipWidth, poptipHeight);
85
+ popTipWidth = maxWH;
86
+ const deltaH = maxWH - poptipHeight;
87
+ poptipHeight = maxWH, titleShape.setAttributes({
88
+ dy: deltaH / 2
89
+ }), contentShape.setAttributes({
90
+ dy: deltaH / 2
91
+ });
92
+ }
93
+ const symbolSize = null !== (_a = backgroundStyle.size) && void 0 !== _a ? _a : 12, spaceSize = (0,
70
94
  vutils_1.isArray)(symbolSize) ? [ symbolSize[0] + (null !== (_b = backgroundStyle.space) && void 0 !== _b ? _b : 0), symbolSize[1] + (null !== (_c = backgroundStyle.space) && void 0 !== _c ? _c : 0) ] : symbolSize + (null !== (_d = backgroundStyle.space) && void 0 !== _d ? _d : 0), lineWidth = null !== (_e = backgroundStyle.lineWidth) && void 0 !== _e ? _e : 1, range = this.stage ? [ null !== (_f = this.stage.viewWidth) && void 0 !== _f ? _f : this.stage.width, null !== (_g = this.stage.viewHeight) && void 0 !== _g ? _g : this.stage.height ] : void 0;
71
95
  if (range) {
72
96
  const b = this.AABBBounds, leftWidth = null !== (_h = this.attribute.x) && void 0 !== _h ? _h : b.x1, rightWidth = range[0] - b.x1;
@@ -83,38 +107,75 @@ class PopTip extends base_1.AbstractComponent {
83
107
  const layout = "auto" === position;
84
108
  let maxBBoxI, maxBBoxSize = -1 / 0;
85
109
  for (let i = 0; i < this.positionList.length + 1; i++) {
86
- const p = layout ? this.positionList[i === this.positionList.length ? maxBBoxI : i] : position, {angle: angle, offset: offset, rectOffset: rectOffset} = this.getAngleAndOffset(p, popTipWidth, poptipHeight, (0,
87
- vutils_1.isArray)(spaceSize) ? spaceSize : [ spaceSize, spaceSize - lineWidth ]);
110
+ const p = layout ? this.positionList[i === this.positionList.length ? maxBBoxI : i] : position;
111
+ let symbolType = "arrow2Left", offsetX = ((0, vutils_1.isArray)(symbolSize) ? symbolSize[0] : symbolSize) / 4, offsetY = 0;
112
+ "top" === p || "bottom" === p || "left" === p || "right" === p ? symbolType = "arrow2Left" : "concise" === triangleMode && (symbolType = conciseSymbolMap[p],
113
+ offsetX = [ "tl", "bl", "rt", "rb" ].includes(position) ? ((0, vutils_1.isArray)(symbolSize) ? symbolSize[0] : symbolSize) / 2 : -((0,
114
+ vutils_1.isArray)(symbolSize) ? symbolSize[0] : symbolSize) / 2, offsetY = [ "tl", "tr", "lb", "rb" ].includes(position) ? -((0,
115
+ vutils_1.isArray)(symbolSize) ? symbolSize[1] : symbolSize) / 2 : ((0, vutils_1.isArray)(symbolSize) ? symbolSize[1] : symbolSize) / 2);
116
+ const {angle: angle, offset: offset} = this.getAngleAndOffset(p, popTipWidth, poptipHeight, (0,
117
+ vutils_1.isArray)(spaceSize) ? spaceSize : [ spaceSize, spaceSize - lineWidth ], symbolType);
88
118
  if ((0, vutils_1.isBoolean)(bgVisible)) {
89
- const offsetX = ((0, vutils_1.isArray)(symbolSize) ? symbolSize[0] : symbolSize) / 4, bgSymbol = group.createOrUpdateChild("poptip-symbol-panel", Object.assign(Object.assign({}, backgroundStyle), {
119
+ const bgSymbol = group.createOrUpdateChild("poptip-symbol-panel", Object.assign(Object.assign({}, backgroundStyle), {
90
120
  visible: bgVisible && (contentVisible || titleVisible),
91
121
  x: offsetX,
92
- y: 0,
122
+ y: offsetY,
93
123
  strokeBoundsBuffer: -1,
94
124
  boundsPadding: -2,
95
125
  anchor: [ 0, 0 ],
96
- symbolType: "arrow2Left",
126
+ symbolType: symbolType,
97
127
  angle: angle,
98
128
  dx: offset[0],
99
- dy: offset[1],
129
+ dy: offset[1] - (null !== (_j = backgroundStyle.space) && void 0 !== _j ? _j : 0),
100
130
  size: symbolSize,
101
- zIndex: -9
131
+ zIndex: 9
102
132
  }), "symbol");
103
- (0, vutils_1.isEmpty)(null == state ? void 0 : state.panel) || (bgSymbol.states = state.panel);
104
- const bgRect = group.createOrUpdateChild("poptip-rect-panel", Object.assign(Object.assign({}, backgroundStyle), {
133
+ let bgRect;
134
+ (0, vutils_1.isEmpty)(null == state ? void 0 : state.panel) || (bgSymbol.states = state.panel),
135
+ bgRect = panel.panelSymbolType ? group.createOrUpdateChild("poptip-rect-panel", Object.assign(Object.assign({}, backgroundStyle), {
136
+ visible: bgVisible && (contentVisible || titleVisible),
137
+ x: 0,
138
+ y: 0,
139
+ symbolType: "rect",
140
+ size: [ popTipWidth, poptipHeight ],
141
+ zIndex: -8
142
+ }), "symbol") : group.createOrUpdateChild("poptip-rect-panel", Object.assign(Object.assign({}, backgroundStyle), {
105
143
  visible: bgVisible && (contentVisible || titleVisible),
106
144
  x: 0,
107
145
  y: 0,
108
146
  width: popTipWidth,
109
147
  height: poptipHeight,
110
148
  zIndex: -8
111
- }), "rect");
112
- (0, vutils_1.isEmpty)(null == state ? void 0 : state.panel) || (bgRect.states = state.panel);
149
+ }), "rect"), (0, vutils_1.isEmpty)(null == state ? void 0 : state.panel) || (bgRect.states = state.panel);
113
150
  }
114
151
  if (group.setAttributes({
115
152
  x: -offset[0] + dx,
116
- y: -offset[1] + dy
117
- }), !layout || !range) break;
153
+ y: -offset[1] + dy,
154
+ anchor: [ offsetX, offsetY ]
155
+ }), logoSymbol) {
156
+ const {size: size = 12} = logoSymbol, sizeArray = (0, vutils_1.isArray)(size) ? size : [ size, size ];
157
+ "auto" === sizeArray[1] && (sizeArray[1] = poptipHeight), "auto" === sizeArray[0] && (sizeArray[0] = poptipHeight);
158
+ const sizeW = sizeArray[0];
159
+ group.createOrUpdateChild("poptip-logo", Object.assign(Object.assign({}, logoSymbol), {
160
+ x: 0,
161
+ y: poptipHeight / 2,
162
+ visible: bgVisible && (contentVisible || titleVisible),
163
+ zIndex: 10,
164
+ size: sizeArray
165
+ }), "symbol"), group.setAttributes({
166
+ x: -offset[0] + dx + sizeW / 2,
167
+ y: -offset[1] + dy
168
+ }), logoText && group.createOrUpdateChild("poptip-logo-text", Object.assign(Object.assign({}, logoTextStyle), {
169
+ x: 0,
170
+ y: poptipHeight / 2,
171
+ visible: bgVisible && (contentVisible || titleVisible),
172
+ text: logoText,
173
+ textAlign: "center",
174
+ textBaseline: "middle",
175
+ zIndex: 10
176
+ }), "text");
177
+ }
178
+ if (!layout || !range) break;
118
179
  {
119
180
  _tBounds.setValue(0, 0, popTipWidth, poptipHeight).transformWithMatrix(group.globalTransMatrix);
120
181
  const b = _tBounds, stageBounds = (new vutils_1.Bounds).setValue(0, 0, range[0], range[1]);
@@ -126,94 +187,118 @@ class PopTip extends base_1.AbstractComponent {
126
187
  }
127
188
  }
128
189
  }
129
- getAngleAndOffset(position, width, height, size) {
130
- const sizeH = size[1] / 2;
190
+ getAngleAndOffset(position, width, height, size, symbolType) {
191
+ const sizeH = "arrow2Left" === symbolType ? size[1] / 2 : size[1];
131
192
  switch (position) {
132
193
  case "tl":
133
194
  return {
134
- angle: vutils_1.pi / 2 * 3,
135
- offset: [ width / 4, height + sizeH ],
136
- rectOffset: [ -width / 4, -height - size[1] ]
195
+ angle: "arrow2Left" === symbolType ? vutils_1.pi / 2 * 3 : 0,
196
+ offset: "arrow2Left" === symbolType ? [ width / 4, height + sizeH ] : [ 0, height + sizeH ]
137
197
  };
138
198
 
139
199
  case "top":
140
200
  return {
141
201
  angle: vutils_1.pi / 2 * 3,
142
- offset: [ width / 2, height + sizeH ],
143
- rectOffset: [ 0, -height - size[1] ]
202
+ offset: [ width / 2, height + sizeH ]
144
203
  };
145
204
 
146
205
  case "tr":
147
206
  return {
148
- angle: vutils_1.pi / 2 * 3,
149
- offset: [ width / 4 * 3, height + sizeH ],
150
- rectOffset: [ width / 4 * 3, -height - size[1] ]
207
+ angle: "arrow2Left" === symbolType ? vutils_1.pi / 2 * 3 : 0,
208
+ offset: "arrow2Left" === symbolType ? [ width / 4 * 3, height + sizeH ] : [ width, height + sizeH ]
151
209
  };
152
210
 
153
211
  case "rt":
154
212
  return {
155
213
  angle: 0,
156
- offset: [ -sizeH, height / 5 ],
157
- rectOffset: [ width / 4 * 3, -height - size[1] ]
214
+ offset: "arrow2Left" === symbolType ? [ -sizeH, height / 5 ] : [ -sizeH, 0 ]
158
215
  };
159
216
 
160
217
  case "right":
161
218
  return {
162
219
  angle: 0,
163
- offset: [ -sizeH, height / 2 ],
164
- rectOffset: [ width / 4 * 3, -height - size[1] ]
220
+ offset: [ -sizeH, height / 2 ]
165
221
  };
166
222
 
167
223
  case "rb":
168
224
  return {
169
225
  angle: 0,
170
- offset: [ -sizeH, height / 5 * 4 ],
171
- rectOffset: [ width / 4 * 3, -height - size[1] ]
226
+ offset: "arrow2Left" === symbolType ? [ -sizeH, height / 5 * 4 ] : [ -sizeH, height ]
172
227
  };
173
228
 
174
229
  case "bl":
175
230
  return {
176
- angle: vutils_1.pi / 2,
177
- offset: [ width / 4, -sizeH ],
178
- rectOffset: [ -width / 4, -height - size[1] ]
231
+ angle: "arrow2Left" === symbolType ? vutils_1.pi / 2 : 0,
232
+ offset: "arrow2Left" === symbolType ? [ width / 4, -sizeH ] : [ 0, -sizeH ]
179
233
  };
180
234
 
181
235
  case "bottom":
182
236
  return {
183
237
  angle: vutils_1.pi / 2,
184
- offset: [ width / 2, -sizeH ],
185
- rectOffset: [ 0, -height - size[1] ]
238
+ offset: [ width / 2, -sizeH ]
186
239
  };
187
240
 
188
241
  case "br":
189
242
  return {
190
- angle: vutils_1.pi / 2,
191
- offset: [ width / 4 * 3, -sizeH ],
192
- rectOffset: [ width / 4 * 3, -height - size[1] ]
243
+ angle: "arrow2Left" === symbolType ? vutils_1.pi / 2 : 0,
244
+ offset: "arrow2Left" === symbolType ? [ width / 4 * 3, -sizeH ] : [ width, -sizeH ]
193
245
  };
194
246
 
195
247
  case "lt":
196
248
  return {
197
- angle: vutils_1.pi,
198
- offset: [ width + sizeH, height / 5 ],
199
- rectOffset: [ -width / 4, -height - size[1] ]
249
+ angle: "arrow2Left" === symbolType ? vutils_1.pi : 0,
250
+ offset: "arrow2Left" === symbolType ? [ width + sizeH, height / 5 ] : [ width + sizeH, 0 ]
200
251
  };
201
252
 
202
253
  case "left":
203
254
  return {
204
255
  angle: vutils_1.pi,
205
- offset: [ width + sizeH, height / 2 ],
206
- rectOffset: [ 0, -height - size[1] ]
256
+ offset: [ width + sizeH, height / 2 ]
207
257
  };
208
258
 
209
259
  case "lb":
210
260
  return {
211
- angle: vutils_1.pi,
212
- offset: [ width + sizeH, height / 5 * 4 ],
213
- rectOffset: [ width / 4 * 3, -height - size[1] ]
261
+ angle: "arrow2Left" === symbolType ? vutils_1.pi : 0,
262
+ offset: "arrow2Left" === symbolType ? [ width + sizeH, height / 5 * 4 ] : [ width + sizeH, height ]
214
263
  };
215
264
  }
216
265
  }
266
+ appearAnimate(animateConfig) {
267
+ const {duration: duration = 1e3, easing: easing = "quadOut"} = animateConfig;
268
+ if (this.setAttributes({
269
+ scaleX: 0,
270
+ scaleY: 0
271
+ }), this.animate().to({
272
+ scaleX: 1,
273
+ scaleY: 1
274
+ }, duration / 3 * 2, easing), this.titleShape && this.titleShape.animate().play(new vrender_core_1.InputText({
275
+ text: ""
276
+ }, {
277
+ text: this.titleShape.attribute.text
278
+ }, duration, easing)), this.contentShape && this.contentShape.animate().play(new vrender_core_1.InputText({
279
+ text: ""
280
+ }, {
281
+ text: this.contentShape.attribute.text
282
+ }, duration, easing)), animateConfig.wave) {
283
+ const dur = duration / 6;
284
+ this.group.animate().to({
285
+ angle: animateConfig.wave
286
+ }, dur, easing).to({
287
+ angle: -animateConfig.wave
288
+ }, 2 * dur, easing).to({
289
+ angle: animateConfig.wave
290
+ }, 2 * dur, easing).to({
291
+ angle: 0
292
+ }, dur, easing);
293
+ }
294
+ }
295
+ disappearAnimate(animateConfig) {
296
+ const {duration: duration = 1e3, easing: easing = "quadOut"} = animateConfig;
297
+ this.animate().to({
298
+ scaleX: 0,
299
+ scaleY: 0
300
+ }, duration, easing);
301
+ }
217
302
  }
218
303
 
219
304
  exports.PopTip = PopTip, PopTip.defaultAttributes = {
@@ -233,6 +318,7 @@ exports.PopTip = PopTip, PopTip.defaultAttributes = {
233
318
  textAlign: "left",
234
319
  textBaseline: "top"
235
320
  },
321
+ panel: {},
236
322
  maxWidthPercent: .8,
237
323
  space: 8,
238
324
  padding: 10
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/poptip/poptip.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAaA,6CAa0B;AAC1B,uCAAiD;AAGjD,yCAAiD;AAEjD,MAAM,QAAQ,GAAG,IAAI,mBAAU,EAAE,CAAC;AAElC,IAAA,8BAAmB,GAAE,CAAC;AACtB,MAAa,MAAO,SAAQ,wBAA6C;IAyBvE,YAAY,UAA4B,EAAE,OAA0B;QAClE,KAAK,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,EAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAA,cAAK,EAAC,EAAE,EAAE,MAAM,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC;QAzB7F,SAAI,GAAG,QAAQ,CAAC;QA6OhB,iBAAY,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,IAA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AU,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACzG,KAAK,MAAM;gBACT,OAAO,EAAE,KAAK,EAAE,WAAE,EAAE,MAAM,EAAE,CAAC,KAAK,GAAG,KAAK,EAAE,MAAM,GAAG,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAChG,KAAK,IAAI;gBACP,OAAO;oBACL,KAAK,EAAE,WAAE;oBACT,MAAM,EAAE,CAAC,KAAK,GAAG,KAAK,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;oBACzC,UAAU,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;iBACjD,CAAC;SACL;IACH,CAAC;;AA9RH,wBA+RC;AA5RQ,wBAAiB,GAA8B;IACpD,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,IAAI;IACb,KAAK,EAAE,IAAI;IACX,OAAO,EAAE,IAAI;IACb,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE;QACZ,IAAI,EAAE,MAAM;QACZ,SAAS,EAAE,MAAM;QACjB,YAAY,EAAE,KAAK;KACpB;IACD,YAAY,EAAE;QACZ,QAAQ,EAAE,EAAE;QACZ,IAAI,EAAE,MAAM;QACZ,SAAS,EAAE,MAAM;QACjB,YAAY,EAAE,KAAK;KACpB;IACD,eAAe,EAAE,GAAG;IACpB,KAAK,EAAE,CAAC;IACR,OAAO,EAAE,EAAE;CACZ,CAAC","file":"poptip.js","sourcesContent":["/**\n * @description PopTip组件\n */\nimport type {\n IGroup,\n IRect,\n ISymbol,\n ISymbolGraphicAttribute,\n IText,\n ITextGraphicAttribute,\n TextAlignType,\n TextBaselineType\n} from '@visactor/vrender-core';\nimport {\n AABBBounds,\n Bounds,\n getRectIntersect,\n isArray,\n isBoolean,\n isEmpty,\n isValid,\n max,\n merge,\n normalizePadding,\n pi,\n rectInsideAnotherRect\n} from '@visactor/vutils';\nimport { AbstractComponent } from '../core/base';\nimport type { BackgroundAttributes, ComponentOptions } from '../interface';\nimport type { PopTipAttributes } from './type';\nimport { loadPoptipComponent } from './register';\n\nconst _tBounds = new AABBBounds();\n\nloadPoptipComponent();\nexport class PopTip extends AbstractComponent<Required<PopTipAttributes>> {\n name = 'poptip';\n\n static defaultAttributes: Partial<PopTipAttributes> = {\n position: 'rt',\n visible: true,\n title: null,\n content: null,\n titleStyle: {\n fontSize: 12,\n fill: '#000',\n textAlign: 'left',\n textBaseline: 'top'\n },\n contentStyle: {\n fontSize: 12,\n fill: '#000',\n textAlign: 'left',\n textBaseline: 'top'\n },\n maxWidthPercent: 0.8,\n space: 8,\n padding: 10\n };\n\n constructor(attributes: PopTipAttributes, options?: ComponentOptions) {\n super(options?.skipDefault ? attributes : merge({}, PopTip.defaultAttributes, attributes));\n }\n\n protected render() {\n const {\n titleStyle = {} as ITextGraphicAttribute,\n position,\n contentStyle = {} as ITextGraphicAttribute,\n panel = {} as BackgroundAttributes & ISymbolGraphicAttribute & { space?: number },\n space = 4,\n minWidth = 0,\n maxWidth = Infinity,\n padding = 4,\n maxWidthPercent,\n visible,\n state,\n dx = 0,\n dy = 0\n } = this.attribute as PopTipAttributes;\n\n let { title = '', content = '' } = this.attribute as PopTipAttributes;\n\n title = this.attribute.titleFormatMethod ? this.attribute.titleFormatMethod(title) : title;\n content = this.attribute.contentFormatMethod ? this.attribute.contentFormatMethod(content) : content;\n\n const parsedPadding = normalizePadding(padding);\n\n const group = this.createOrUpdateChild('poptip-content', { x: 0, y: 0, zIndex: 1 }, 'group') as IGroup;\n\n const maxLineWidth = maxWidth - parsedPadding[1] - parsedPadding[3];\n\n const titleVisible = isValid(title) && visible !== false;\n const titleAttrs = {\n text: isArray(title) ? title : ([title] as any),\n visible: titleVisible,\n wrap: true,\n ...titleStyle,\n x: parsedPadding[3],\n y: parsedPadding[0],\n maxLineWidth,\n textAlign: 'left' as TextAlignType,\n textBaseline: 'top' as TextBaselineType\n };\n\n const titleShape = group.createOrUpdateChild('poptip-title', titleAttrs, 'text') as IText;\n if (!isEmpty(state?.title)) {\n titleShape.states = state.title;\n }\n\n const titleBounds = titleShape.AABBBounds;\n const titleHeight = titleBounds.height();\n const titleWidth = titleBounds.width();\n let height = titleHeight + space;\n if (!titleVisible) {\n height = 0;\n }\n\n const contentVisible = isValid(content) && visible !== false;\n const contentAttrs = {\n text: isArray(content) ? content : ([content] as any),\n visible: contentVisible,\n wrap: true,\n ...contentStyle,\n x: parsedPadding[3],\n y: parsedPadding[0] + height,\n maxLineWidth,\n textAlign: 'left' as TextAlignType,\n textBaseline: 'top' as TextBaselineType\n };\n\n const contentShape = group.createOrUpdateChild('poptip-content', contentAttrs, 'text') as IText;\n if (!isEmpty(state?.content)) {\n contentShape.states = state.content;\n }\n\n const contentBounds = contentShape.AABBBounds;\n const contentHeight = contentBounds.height();\n const contentWidth = contentBounds.width();\n\n if (contentVisible) {\n height += contentHeight;\n }\n\n // 计算整个popTip的宽高\n let popTipWidth = max(\n titleWidth + parsedPadding[1] + parsedPadding[3],\n contentWidth + parsedPadding[1] + parsedPadding[3]\n );\n if (popTipWidth > maxWidth) {\n popTipWidth = maxWidth;\n } else if (popTipWidth < minWidth) {\n popTipWidth = minWidth;\n }\n let poptipHeight = parsedPadding[0] + parsedPadding[2] + height;\n\n // 绘制背景层\n const { visible: bgVisible, ...backgroundStyle } = panel;\n const symbolSize = backgroundStyle.size ?? 12;\n const spaceSize: number | [number, number] = isArray(symbolSize)\n ? [symbolSize[0] + (backgroundStyle.space ?? 0), symbolSize[1] + (backgroundStyle.space ?? 0)]\n : (symbolSize as number) + (backgroundStyle.space ?? 0);\n const lineWidth = backgroundStyle.lineWidth ?? 1;\n const range: [number, number] | undefined = (this as any).stage\n ? [\n (this as any).stage.viewWidth ?? (this as any).stage.width,\n (this as any).stage.viewHeight ?? (this as any).stage.height\n ]\n : undefined;\n\n if (range) {\n // 尝试进行换行\n const b = (this as any).AABBBounds;\n const leftWidth = this.attribute.x ?? b.x1;\n const rightWidth = range[0] - b.x1;\n let maxSpace = Math.max(leftWidth, rightWidth);\n // 减一些buffer,buffer不能超过maxSpace的20%\n const buf = (isArray(symbolSize) ? symbolSize[0] : 12) + 3;\n maxSpace = Math.min(maxSpace - buf, maxSpace * maxWidthPercent);\n // 需要进行换行\n if (maxSpace < popTipWidth) {\n popTipWidth = maxSpace;\n const buf = parsedPadding[1] + parsedPadding[3];\n titleShape.setAttribute('maxLineWidth', maxSpace - buf);\n contentShape.setAttribute('maxLineWidth', maxSpace - buf);\n poptipHeight = parsedPadding[0] + parsedPadding[2];\n if (titleVisible) {\n poptipHeight += titleShape.AABBBounds.height() + space;\n }\n poptipHeight += contentShape.AABBBounds.height();\n }\n }\n\n const layout = position === 'auto';\n // 最多循环this.positionList次\n let maxBBoxI: number;\n let maxBBoxSize: number = -Infinity;\n for (let i = 0; i < this.positionList.length + 1; i++) {\n const p = layout ? this.positionList[i === this.positionList.length ? maxBBoxI : i] : position;\n const { angle, offset, rectOffset } = this.getAngleAndOffset(\n p,\n popTipWidth,\n poptipHeight,\n isArray(spaceSize) ? (spaceSize as [number, number]) : [spaceSize, spaceSize - lineWidth]\n );\n if (isBoolean(bgVisible)) {\n const offsetX = (isArray(symbolSize) ? symbolSize[0] : symbolSize) / 4;\n const bgSymbol = group.createOrUpdateChild(\n 'poptip-symbol-panel',\n {\n ...backgroundStyle,\n visible: bgVisible && (contentVisible || titleVisible),\n x: offsetX,\n y: 0,\n strokeBoundsBuffer: -1,\n boundsPadding: -2,\n anchor: [0, 0],\n symbolType: 'arrow2Left',\n angle: angle,\n dx: offset[0],\n dy: offset[1],\n size: symbolSize,\n zIndex: -9\n },\n 'symbol'\n ) as ISymbol;\n if (!isEmpty(state?.panel)) {\n bgSymbol.states = state.panel;\n }\n\n const bgRect = group.createOrUpdateChild(\n 'poptip-rect-panel',\n {\n ...backgroundStyle,\n visible: bgVisible && (contentVisible || titleVisible),\n x: 0,\n y: 0,\n width: popTipWidth,\n height: poptipHeight,\n zIndex: -8\n },\n 'rect'\n ) as IRect;\n if (!isEmpty(state?.panel)) {\n bgRect.states = state.panel;\n }\n }\n\n group.setAttributes({\n x: -offset[0] + dx,\n y: -offset[1] + dy\n });\n\n if (layout && range) {\n _tBounds.setValue(0, 0, popTipWidth, poptipHeight).transformWithMatrix(group.globalTransMatrix);\n const b = _tBounds;\n const stageBounds = new Bounds().setValue(0, 0, range[0], range[1]);\n if (rectInsideAnotherRect(b, stageBounds, false)) {\n break;\n } else {\n const bbox = getRectIntersect(b, stageBounds, false);\n const size = (bbox.x2 - bbox.x1) * (bbox.y2 - bbox.y1);\n if (size > maxBBoxSize) {\n maxBBoxSize = size;\n maxBBoxI = i;\n }\n }\n } else {\n break;\n }\n }\n }\n\n positionList = ['top', 'tl', 'tr', 'bottom', 'bl', 'br', 'left', 'lt', 'lb', 'right', 'rt', 'rb'];\n\n getAngleAndOffset(\n position: string,\n width: number,\n height: number,\n size: [number, number]\n ): { angle: number; offset: [number, number]; rectOffset: [number, number] } {\n // const sizeW = size[0];\n const sizeH = size[1] / 2;\n switch (position) {\n case 'tl':\n return {\n angle: (pi / 2) * 3,\n offset: [width / 4, height + sizeH],\n rectOffset: [-width / 4, -height - size[1]]\n };\n case 'top':\n return { angle: (pi / 2) * 3, offset: [width / 2, height + sizeH], rectOffset: [0, -height - size[1]] };\n case 'tr':\n return {\n angle: (pi / 2) * 3,\n offset: [(width / 4) * 3, height + sizeH],\n rectOffset: [(width / 4) * 3, -height - size[1]]\n };\n case 'rt':\n return { angle: 0, offset: [-sizeH, height / 5], rectOffset: [(width / 4) * 3, -height - size[1]] };\n case 'right':\n return { angle: 0, offset: [-sizeH, height / 2], rectOffset: [(width / 4) * 3, -height - size[1]] };\n case 'rb':\n return { angle: 0, offset: [-sizeH, (height / 5) * 4], rectOffset: [(width / 4) * 3, -height - size[1]] };\n case 'bl':\n return { angle: pi / 2, offset: [width / 4, -sizeH], rectOffset: [-width / 4, -height - size[1]] };\n case 'bottom':\n return { angle: pi / 2, offset: [width / 2, -sizeH], rectOffset: [0, -height - size[1]] };\n case 'br':\n return { angle: pi / 2, offset: [(width / 4) * 3, -sizeH], rectOffset: [(width / 4) * 3, -height - size[1]] };\n case 'lt':\n return { angle: pi, offset: [width + sizeH, height / 5], rectOffset: [-width / 4, -height - size[1]] };\n case 'left':\n return { angle: pi, offset: [width + sizeH, height / 2], rectOffset: [0, -height - size[1]] };\n case 'lb':\n return {\n angle: pi,\n offset: [width + sizeH, (height / 5) * 4],\n rectOffset: [(width / 4) * 3, -height - size[1]]\n };\n }\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/poptip/poptip.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAGA,yDAWgC;AAChC,6CAa0B;AAC1B,uCAAiD;AAGjD,yCAAiD;AAEjD,MAAM,QAAQ,GAAG,IAAI,mBAAU,EAAE,CAAC;AAElC,IAAA,8BAAmB,GAAE,CAAC;AAEtB,MAAM,KAAK,GAAG,wCAAwC,CAAC;AACvD,MAAM,KAAK,GAAG,uCAAuC,CAAC;AACtD,MAAM,KAAK,GAAG,uCAAuC,CAAC;AACtD,MAAM,KAAK,GAAG,sCAAsC,CAAC;AAErD,MAAM,gBAAgB,GAAG;IACvB,EAAE,EAAE,KAAK;IACT,EAAE,EAAE,KAAK;IACT,EAAE,EAAE,KAAK;IACT,EAAE,EAAE,KAAK;IACT,EAAE,EAAE,KAAK;IACT,EAAE,EAAE,KAAK;IACT,EAAE,EAAE,KAAK;IACT,EAAE,EAAE,KAAK;CACV,CAAC;AACF,MAAa,MAAO,SAAQ,wBAA6C;IA8BvE,YAAY,UAA4B,EAAE,OAA0B;QAClE,KAAK,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WA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,EAAE,EAAE;QACZ,IAAI,EAAE,MAAM;QACZ,SAAS,EAAE,MAAM;QACjB,YAAY,EAAE,KAAK;KACpB;IACD,YAAY,EAAE;QACZ,QAAQ,EAAE,EAAE;QACZ,IAAI,EAAE,MAAM;QACZ,SAAS,EAAE,MAAM;QACjB,YAAY,EAAE,KAAK;KACpB;IACD,KAAK,EAAE,EAAS;IAChB,eAAe,EAAE,GAAG;IACpB,KAAK,EAAE,CAAC;IACR,OAAO,EAAE,EAAE;CACZ,CAAC","file":"poptip.js","sourcesContent":["/**\n * @description PopTip组件\n */\nimport {\n InputText,\n type IGraphic,\n type IGroup,\n type IRect,\n type ISymbol,\n type ISymbolGraphicAttribute,\n type IText,\n type ITextGraphicAttribute,\n type TextAlignType,\n type TextBaselineType\n} from '@visactor/vrender-core';\nimport {\n AABBBounds,\n Bounds,\n getRectIntersect,\n isArray,\n isBoolean,\n isEmpty,\n isValid,\n max,\n merge,\n normalizePadding,\n pi,\n rectInsideAnotherRect\n} from '@visactor/vutils';\nimport { AbstractComponent } from '../core/base';\nimport type { BackgroundAttributes, ComponentOptions } from '../interface';\nimport type { PopTipAttributes } from './type';\nimport { loadPoptipComponent } from './register';\n\nconst _tBounds = new AABBBounds();\n\nloadPoptipComponent();\n\nconst tlStr = 'M -0.5 -0.5, L -0.5 0.5, L 0.5 -0.5, Z';\nconst blStr = 'M -0.5 -0.5, L -0.5 0.5, L 0.5 0.5, Z';\nconst trStr = 'M -0.5 -0.5, L 0.5 -0.5, L 0.5 0.5, Z';\nconst brStr = 'M 0.5 -0.5, L 0.5 0.5, L -0.5 0.5, Z';\n\nconst conciseSymbolMap = {\n tl: tlStr,\n tr: trStr,\n bl: blStr,\n br: brStr,\n lt: tlStr,\n lb: blStr,\n rt: trStr,\n rb: brStr\n};\nexport class PopTip extends AbstractComponent<Required<PopTipAttributes>> {\n name = 'poptip';\n\n static defaultAttributes: Partial<PopTipAttributes> = {\n position: 'rt',\n visible: true,\n title: null,\n content: null,\n titleStyle: {\n fontSize: 12,\n fill: '#000',\n textAlign: 'left',\n textBaseline: 'top'\n },\n contentStyle: {\n fontSize: 12,\n fill: '#000',\n textAlign: 'left',\n textBaseline: 'top'\n },\n panel: {} as any,\n maxWidthPercent: 0.8,\n space: 8,\n padding: 10\n };\n\n titleShape?: IText;\n contentShape?: IText;\n group?: IGroup;\n\n constructor(attributes: PopTipAttributes, options?: ComponentOptions) {\n super(options?.skipDefault ? attributes : merge({}, PopTip.defaultAttributes, attributes));\n }\n\n protected render() {\n const {\n titleStyle = {} as ITextGraphicAttribute,\n position,\n contentStyle = {} as ITextGraphicAttribute,\n panel,\n logoSymbol,\n logoText,\n logoTextStyle = {} as ITextGraphicAttribute,\n triangleMode = 'default',\n space = 4,\n minWidth = 0,\n maxWidth = Infinity,\n padding = 4,\n maxWidthPercent,\n visible,\n state,\n dx = 0,\n dy = 0\n } = this.attribute as PopTipAttributes;\n\n let { title = '', content = '' } = this.attribute as PopTipAttributes;\n\n title = this.attribute.titleFormatMethod ? this.attribute.titleFormatMethod(title) : title;\n content = this.attribute.contentFormatMethod ? this.attribute.contentFormatMethod(content) : content;\n\n const parsedPadding = normalizePadding(padding);\n\n const group = this.createOrUpdateChild('poptip-content', { x: 0, y: 0, zIndex: 1 }, 'group') as IGroup;\n this.group = group;\n\n const maxLineWidth = maxWidth - parsedPadding[1] - parsedPadding[3];\n\n const titleVisible = isValid(title) && visible !== false;\n const titleAttrs = {\n text: isArray(title) ? title : ([title] as any),\n visible: titleVisible,\n wrap: true,\n ...titleStyle,\n x: parsedPadding[3],\n y: parsedPadding[0],\n maxLineWidth,\n textAlign: 'left' as TextAlignType,\n textBaseline: 'top' as TextBaselineType\n };\n\n const titleShape = group.createOrUpdateChild('poptip-title', titleAttrs, 'text') as IText;\n if (!isEmpty(state?.title)) {\n titleShape.states = state.title;\n }\n\n const titleBounds = titleShape.AABBBounds;\n const titleHeight = titleBounds.height();\n const titleWidth = titleBounds.width();\n let height = titleHeight + space;\n if (!titleVisible) {\n height = 0;\n }\n\n const contentVisible = isValid(content) && visible !== false;\n const contentAttrs = {\n text: isArray(content) ? content : ([content] as any),\n visible: contentVisible,\n wrap: true,\n ...contentStyle,\n x: parsedPadding[3],\n y: parsedPadding[0] + height,\n maxLineWidth,\n textAlign: 'left' as TextAlignType,\n textBaseline: 'top' as TextBaselineType\n };\n\n const contentShape = group.createOrUpdateChild('poptip-content', contentAttrs, 'text') as IText;\n if (!isEmpty(state?.content)) {\n contentShape.states = state.content;\n }\n\n const contentBounds = contentShape.AABBBounds;\n const contentHeight = contentBounds.height();\n const contentWidth = contentBounds.width();\n\n if (contentVisible) {\n height += contentHeight;\n }\n\n this.titleShape = titleShape;\n this.contentShape = contentShape;\n\n // 计算整个popTip的宽高\n let popTipWidth = max(\n titleWidth + parsedPadding[1] + parsedPadding[3],\n contentWidth + parsedPadding[1] + parsedPadding[3]\n );\n if (popTipWidth > maxWidth) {\n popTipWidth = maxWidth;\n } else if (popTipWidth < minWidth) {\n popTipWidth = minWidth;\n }\n let poptipHeight = parsedPadding[0] + parsedPadding[2] + height;\n\n // 绘制背景层\n const { visible: bgVisible, square, ...backgroundStyle } = panel;\n // 如果是正方形,取宽高的最大值,同时文字也需要居中\n if (square) {\n const maxWH = max(popTipWidth, poptipHeight);\n popTipWidth = maxWH;\n const deltaH = maxWH - poptipHeight;\n poptipHeight = maxWH;\n titleShape.setAttributes({ dy: deltaH / 2 });\n contentShape.setAttributes({ dy: deltaH / 2 });\n }\n const symbolSize = backgroundStyle.size ?? 12;\n const spaceSize: number | [number, number] = isArray(symbolSize)\n ? [symbolSize[0] + (backgroundStyle.space ?? 0), symbolSize[1] + (backgroundStyle.space ?? 0)]\n : (symbolSize as number) + (backgroundStyle.space ?? 0);\n const lineWidth = backgroundStyle.lineWidth ?? 1;\n const range: [number, number] | undefined = (this as any).stage\n ? [\n (this as any).stage.viewWidth ?? (this as any).stage.width,\n (this as any).stage.viewHeight ?? (this as any).stage.height\n ]\n : undefined;\n\n if (range) {\n // 尝试进行换行\n const b = (this as any).AABBBounds;\n const leftWidth = this.attribute.x ?? b.x1;\n const rightWidth = range[0] - b.x1;\n let maxSpace = Math.max(leftWidth, rightWidth);\n // 减一些buffer,buffer不能超过maxSpace的20%\n const buf = (isArray(symbolSize) ? symbolSize[0] : 12) + 3;\n maxSpace = Math.min(maxSpace - buf, maxSpace * maxWidthPercent);\n // 需要进行换行\n if (maxSpace < popTipWidth) {\n popTipWidth = maxSpace;\n const buf = parsedPadding[1] + parsedPadding[3];\n titleShape.setAttribute('maxLineWidth', maxSpace - buf);\n contentShape.setAttribute('maxLineWidth', maxSpace - buf);\n poptipHeight = parsedPadding[0] + parsedPadding[2];\n if (titleVisible) {\n poptipHeight += titleShape.AABBBounds.height() + space;\n }\n poptipHeight += contentShape.AABBBounds.height();\n }\n }\n\n const layout = position === 'auto';\n // 最多循环this.positionList次\n let maxBBoxI: number;\n let maxBBoxSize: number = -Infinity;\n\n for (let i = 0; i < this.positionList.length + 1; i++) {\n const p = layout ? this.positionList[i === this.positionList.length ? maxBBoxI : i] : position;\n let symbolType = 'arrow2Left';\n let offsetX = (isArray(symbolSize) ? symbolSize[0] : symbolSize) / 4;\n let offsetY = 0;\n if (p === 'top' || p === 'bottom' || p === 'left' || p === 'right') {\n symbolType = 'arrow2Left';\n } else if (triangleMode === 'concise') {\n symbolType = (conciseSymbolMap as any)[p];\n offsetX = ['tl', 'bl', 'rt', 'rb'].includes(position)\n ? (isArray(symbolSize) ? symbolSize[0] : symbolSize) / 2\n : -(isArray(symbolSize) ? symbolSize[0] : symbolSize) / 2;\n offsetY = ['tl', 'tr', 'lb', 'rb'].includes(position)\n ? -(isArray(symbolSize) ? symbolSize[1] : symbolSize) / 2\n : (isArray(symbolSize) ? symbolSize[1] : symbolSize) / 2;\n }\n\n const { angle, offset } = this.getAngleAndOffset(\n p,\n popTipWidth,\n poptipHeight,\n isArray(spaceSize) ? (spaceSize as [number, number]) : [spaceSize, spaceSize - lineWidth],\n symbolType\n );\n if (isBoolean(bgVisible)) {\n const bgSymbol = group.createOrUpdateChild(\n 'poptip-symbol-panel',\n {\n ...backgroundStyle,\n visible: bgVisible && (contentVisible || titleVisible),\n x: offsetX,\n y: offsetY,\n strokeBoundsBuffer: -1,\n boundsPadding: -2,\n anchor: [0, 0],\n symbolType,\n angle: angle,\n dx: offset[0],\n // 标签和背景同时移动\n dy: offset[1] - (backgroundStyle.space ?? 0),\n size: symbolSize,\n zIndex: 9\n },\n 'symbol'\n ) as ISymbol;\n if (!isEmpty(state?.panel)) {\n bgSymbol.states = state.panel;\n }\n\n let bgRect: IGraphic;\n if (panel.panelSymbolType) {\n bgRect = group.createOrUpdateChild(\n 'poptip-rect-panel',\n {\n ...backgroundStyle,\n visible: bgVisible && (contentVisible || titleVisible),\n x: 0,\n y: 0,\n symbolType: 'rect',\n size: [popTipWidth, poptipHeight],\n zIndex: -8\n },\n 'symbol'\n ) as ISymbol;\n } else {\n bgRect = group.createOrUpdateChild(\n 'poptip-rect-panel',\n {\n ...backgroundStyle,\n visible: bgVisible && (contentVisible || titleVisible),\n x: 0,\n y: 0,\n width: popTipWidth,\n height: poptipHeight,\n zIndex: -8\n },\n 'rect'\n ) as IRect;\n }\n if (!isEmpty(state?.panel)) {\n bgRect.states = state.panel;\n }\n }\n\n group.setAttributes({\n x: -offset[0] + dx,\n y: -offset[1] + dy,\n anchor: [offsetX, offsetY]\n });\n\n // 添加logo和logo内的text\n if (logoSymbol) {\n const { size = 12 } = logoSymbol;\n const sizeArray = isArray(size) ? (size as [number | string, number | string]) : [size, size];\n if (sizeArray[1] === 'auto') {\n sizeArray[1] = poptipHeight;\n }\n if (sizeArray[0] === 'auto') {\n sizeArray[0] = poptipHeight;\n }\n const sizeW = sizeArray[0] as number;\n group.createOrUpdateChild(\n 'poptip-logo',\n {\n ...logoSymbol,\n x: 0,\n y: poptipHeight / 2,\n visible: bgVisible && (contentVisible || titleVisible),\n zIndex: 10,\n size: sizeArray as [number, number]\n },\n 'symbol'\n );\n group.setAttributes({\n x: -offset[0] + dx + sizeW / 2,\n y: -offset[1] + dy\n });\n if (logoText) {\n group.createOrUpdateChild(\n 'poptip-logo-text',\n {\n ...logoTextStyle,\n x: 0,\n y: poptipHeight / 2,\n visible: bgVisible && (contentVisible || titleVisible),\n text: logoText,\n textAlign: 'center',\n textBaseline: 'middle',\n zIndex: 10\n },\n 'text'\n );\n }\n }\n\n if (layout && range) {\n _tBounds.setValue(0, 0, popTipWidth, poptipHeight).transformWithMatrix(group.globalTransMatrix);\n const b = _tBounds;\n const stageBounds = new Bounds().setValue(0, 0, range[0], range[1]);\n if (rectInsideAnotherRect(b, stageBounds, false)) {\n break;\n } else {\n const bbox = getRectIntersect(b, stageBounds, false);\n const size = (bbox.x2 - bbox.x1) * (bbox.y2 - bbox.y1);\n if (size > maxBBoxSize) {\n maxBBoxSize = size;\n maxBBoxI = i;\n }\n }\n } else {\n break;\n }\n }\n }\n\n positionList = ['top', 'tl', 'tr', 'bottom', 'bl', 'br', 'left', 'lt', 'lb', 'right', 'rt', 'rb'];\n\n getAngleAndOffset(\n position: string,\n width: number,\n height: number,\n size: [number, number],\n symbolType: 'arrow2Left' | string\n ): { angle: number; offset: [number, number] } {\n // const sizeW = size[0];\n const sizeH = symbolType === 'arrow2Left' ? size[1] / 2 : size[1];\n switch (position) {\n case 'tl':\n return {\n angle: symbolType === 'arrow2Left' ? (pi / 2) * 3 : 0,\n offset: symbolType === 'arrow2Left' ? [width / 4, height + sizeH] : [0, height + sizeH]\n };\n case 'top':\n return { angle: (pi / 2) * 3, offset: [width / 2, height + sizeH] };\n case 'tr':\n return {\n angle: symbolType === 'arrow2Left' ? (pi / 2) * 3 : 0,\n offset: symbolType === 'arrow2Left' ? [(width / 4) * 3, height + sizeH] : [width, height + sizeH]\n };\n case 'rt':\n return {\n angle: 0,\n offset: symbolType === 'arrow2Left' ? [-sizeH, height / 5] : [-sizeH, 0]\n };\n case 'right':\n return { angle: 0, offset: [-sizeH, height / 2] };\n case 'rb':\n return {\n angle: 0,\n offset: symbolType === 'arrow2Left' ? [-sizeH, (height / 5) * 4] : [-sizeH, height]\n };\n case 'bl':\n return {\n angle: symbolType === 'arrow2Left' ? pi / 2 : 0,\n offset: symbolType === 'arrow2Left' ? [width / 4, -sizeH] : [0, -sizeH]\n };\n case 'bottom':\n return { angle: pi / 2, offset: [width / 2, -sizeH] };\n case 'br':\n return {\n angle: symbolType === 'arrow2Left' ? pi / 2 : 0,\n offset: symbolType === 'arrow2Left' ? [(width / 4) * 3, -sizeH] : [width, -sizeH]\n };\n case 'lt':\n return {\n angle: symbolType === 'arrow2Left' ? pi : 0,\n offset: symbolType === 'arrow2Left' ? [width + sizeH, height / 5] : [width + sizeH, 0]\n };\n case 'left':\n return { angle: pi, offset: [width + sizeH, height / 2] };\n case 'lb':\n return {\n angle: symbolType === 'arrow2Left' ? pi : 0,\n offset: symbolType === 'arrow2Left' ? [width + sizeH, (height / 5) * 4] : [width + sizeH, height]\n };\n }\n }\n\n appearAnimate(animateConfig: { duration?: number; easing?: string; wave?: number }) {\n // 基准时间,line[0, 500], point[100, 600] 100 onebyone, pointNormal[600, 1000] 90+90 onebyone, activeLine[500, 700]\n // line和activeLine的clipRange\n const { duration = 1000, easing = 'quadOut' } = animateConfig;\n this.setAttributes({ scaleX: 0, scaleY: 0 });\n this.animate().to({ scaleX: 1, scaleY: 1 }, (duration / 3) * 2, easing as any);\n this.titleShape &&\n this.titleShape\n .animate()\n .play(new InputText({ text: '' }, { text: this.titleShape.attribute.text as string }, duration, easing as any));\n this.contentShape &&\n this.contentShape\n .animate()\n .play(\n new InputText({ text: '' }, { text: this.contentShape.attribute.text as string }, duration, easing as any)\n );\n\n // 摇摆\n if (animateConfig.wave) {\n const dur = duration / 6;\n this.group\n .animate()\n .to({ angle: animateConfig.wave }, dur, easing as any)\n .to({ angle: -animateConfig.wave }, dur * 2, easing as any)\n .to({ angle: animateConfig.wave }, dur * 2, easing as any)\n .to({ angle: 0 }, dur, easing as any);\n }\n }\n\n disappearAnimate(animateConfig: { duration?: number; easing?: string }) {\n // 基准时间,line[0, 500], point[100, 600] 100 onebyone, pointNormal[600, 1000] 90+90 onebyone, activeLine[500, 700]\n // line和activeLine的clipRange\n const { duration = 1000, easing = 'quadOut' } = animateConfig;\n this.animate().to({ scaleX: 0, scaleY: 0 }, duration, easing as any);\n }\n}\n"]}
@@ -18,7 +18,13 @@ export type PopTipAttributes = {
18
18
  padding?: Padding;
19
19
  panel?: BackgroundAttributes & ISymbolGraphicAttribute & {
20
20
  space?: number;
21
+ square?: boolean;
22
+ panelSymbolType?: string;
21
23
  };
24
+ triangleMode?: 'default' | 'concise';
25
+ logoSymbol?: ISymbolGraphicAttribute;
26
+ logoText?: string | string[] | number | number[];
27
+ logoTextStyle?: Partial<ITextGraphicAttribute>;
22
28
  minWidth?: number;
23
29
  maxWidth?: number;
24
30
  maxWidthPercent?: number;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/poptip/type.ts"],"names":[],"mappings":"","file":"type.js","sourcesContent":["import type {\n IGraphic,\n IGroupGraphicAttribute,\n IRectGraphicAttribute,\n ISymbolGraphicAttribute,\n ITextGraphicAttribute\n} from '@visactor/vrender-core';\nimport type { Padding, State } from '../core/type';\nimport type { BackgroundAttributes } from '../interface';\n\ntype StateStyle = {\n /**\n * title 文本的状态配置\n */\n title?: State<Partial<ITextGraphicAttribute>>;\n /**\n * content 文本的状态配置\n */\n content?: State<Partial<ITextGraphicAttribute>>;\n /**\n * panel 背景的状态配置ß\n */\n panel?: State<Partial<IRectGraphicAttribute>>;\n};\n\nexport type PopTipAttributes = {\n /**\n * 弹出框的方位,有 12 个方位可供选择\n */\n position?: 'auto' | 'top' | 'tl' | 'tr' | 'bottom' | 'bl' | 'br' | 'left' | 'lt' | 'lb' | 'right' | 'rt' | 'rb';\n /**\n * 标题内容,如果需要进行换行,则使用数组形式,如 ['abc', '123']\n */\n title?: string | string[] | number | number[];\n /**\n * 标题样式\n */\n titleStyle?: Partial<ITextGraphicAttribute>;\n /**\n * 标题的格式化方法\n */\n titleFormatMethod?: (t: string | string[] | number | number[]) => string | string[] | number | number[];\n /**\n * 内容文本,如果需要进行换行,则使用数组形式,如 ['abc', '123']\n */\n content?: string | string[] | number | number[];\n /**\n * 内容文本样式\n */\n contentStyle?: Partial<ITextGraphicAttribute>;\n /**\n * 内容的格式化方法\n */\n contentFormatMethod?: (t: string | string[] | number | number[]) => string | string[] | number | number[];\n /**\n * 标题与内容的间距\n */\n space?: number;\n /**\n * 内部边距\n */\n padding?: Padding;\n /**\n * 标签的背景面板配置, TODO: 支持symbol形状\n */\n panel?: BackgroundAttributes & ISymbolGraphicAttribute & { space?: number };\n\n /**\n * 最小宽度,像素值\n * @default 30\n */\n minWidth?: number;\n /**\n * 最大宽度,像素值。当文字超过最大宽度时,会自动省略。\n */\n maxWidth?: number;\n\n /**\n * 最大宽度比例\n */\n maxWidthPercent?: number;\n /**\n * 是否展示\n */\n visible?: boolean;\n /**\n * 自定义的展示逻辑\n */\n visibleFunc?: (graphic: IGraphic) => boolean;\n state?: StateStyle;\n dx?: number;\n dy?: number;\n} & Omit<IGroupGraphicAttribute, 'background'>;\n\nexport type PoptipShapeAttributes = {\n /**\n * 是否展示 shape\n */\n visible: boolean;\n} & Partial<ISymbolGraphicAttribute>;\n"]}
1
+ {"version":3,"sources":["../src/poptip/type.ts"],"names":[],"mappings":"","file":"type.js","sourcesContent":["import type {\n IGraphic,\n IGroupGraphicAttribute,\n IRectGraphicAttribute,\n ISymbolGraphicAttribute,\n ITextGraphicAttribute\n} from '@visactor/vrender-core';\nimport type { Padding, State } from '../core/type';\nimport type { BackgroundAttributes } from '../interface';\n\ntype StateStyle = {\n /**\n * title 文本的状态配置\n */\n title?: State<Partial<ITextGraphicAttribute>>;\n /**\n * content 文本的状态配置\n */\n content?: State<Partial<ITextGraphicAttribute>>;\n /**\n * panel 背景的状态配置ß\n */\n panel?: State<Partial<IRectGraphicAttribute>>;\n};\n\nexport type PopTipAttributes = {\n /** 位置,参考arco design */\n position?: 'auto' | 'top' | 'tl' | 'tr' | 'bottom' | 'bl' | 'br' | 'left' | 'lt' | 'lb' | 'right' | 'rt' | 'rb';\n /**\n * 标题内容,如果需要进行换行,则使用数组形式,如 ['abc', '123']\n */\n title?: string | string[] | number | number[];\n /** 标题样式 */\n titleStyle?: Partial<ITextGraphicAttribute>;\n titleFormatMethod?: (t: string | string[] | number | number[]) => string | string[] | number | number[];\n /**\n * 内容文本,如果需要进行换行,则使用数组形式,如 ['abc', '123']\n */\n content?: string | string[] | number | number[];\n /** 内容文本样式 */\n contentStyle?: Partial<ITextGraphicAttribute>;\n contentFormatMethod?: (t: string | string[] | number | number[]) => string | string[] | number | number[];\n /**\n * 标题与内容的间距\n */\n space?: number;\n /**\n * 内部边距\n */\n padding?: Padding;\n /**\n * 标签的背景面板配置, TODO: 支持symbol形状\n * space: 与位置之间的距离\n * square: 是否是正方形\n */\n panel?: BackgroundAttributes &\n ISymbolGraphicAttribute & { space?: number; square?: boolean; panelSymbolType?: string };\n\n // 标签三角的模式,默认是default,即默认的三角形状,concise是紧凑型三角形状显得更简洁\n // @since 0.22.0\n triangleMode?: 'default' | 'concise';\n\n // 放置在poptip前方的logo区域\n logoSymbol?: ISymbolGraphicAttribute;\n // logo内的text\n logoText?: string | string[] | number | number[];\n // logo内的text样式\n logoTextStyle?: Partial<ITextGraphicAttribute>;\n\n /**\n * 最小宽度,像素值\n * @default 30\n */\n minWidth?: number;\n /**\n * 最大宽度,像素值。当文字超过最大宽度时,会自动省略。\n */\n maxWidth?: number;\n\n // 最大宽度比例\n maxWidthPercent?: number;\n\n visible?: boolean;\n visibleFunc?: (graphic: IGraphic) => boolean;\n state?: StateStyle;\n dx?: number;\n dy?: number;\n} & Omit<IGroupGraphicAttribute, 'background'>;\n\nexport type PoptipShapeAttributes = {\n /**\n * 是否展示 shape\n */\n visible: boolean;\n} & Partial<ISymbolGraphicAttribute>;\n"]}
@@ -14,21 +14,21 @@ class Title extends base_1.AbstractComponent {
14
14
  this.name = "title";
15
15
  }
16
16
  render() {
17
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
17
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
18
18
  const {textType: textType, text: text, subtextType: subtextType, textStyle: textStyle = {}, subtext: subtext, subtextStyle: subtextStyle = {}, width: width, height: height, minWidth: minWidth, maxWidth: maxWidth, minHeight: minHeight, maxHeight: maxHeight, align: align, verticalAlign: verticalAlign, padding: padding = 0} = this.attribute, parsedPadding = (0,
19
19
  vutils_1.normalizePadding)(padding), group = this.createOrUpdateChild("title-container", {
20
20
  x: parsedPadding[3],
21
21
  y: parsedPadding[0],
22
22
  zIndex: 1
23
- }, "group"), fixedMainTitleHeight = null !== (_a = textStyle.height) && void 0 !== _a ? _a : height;
23
+ }, "group");
24
24
  if (!1 !== this.attribute.visible && !1 !== textStyle.visible) {
25
- const {width: mainTitleWidth, maxHeight: mainTitleMaxHeight, maxWidth: mainTitleMaxWidth, x: x = 0, y: y = 0, ellipsis: ellipsis = !0, wordBreak: wordBreak = "break-word", maxWidth: maxWidth, lineClamp: lineClamp} = textStyle;
25
+ const {width: mainTitleWidth, height: mainTitleHeight, maxHeight: mainTitleMaxHeight, maxWidth: mainTitleMaxWidth, x: x = 0, y: y = 0, ellipsis: ellipsis = !0, wordBreak: wordBreak = "break-word", maxWidth: maxWidth, lineClamp: lineClamp} = textStyle;
26
26
  if ("rich" === textType || (0, vutils_1.isValid)(textStyle.character)) {
27
27
  const attr = Object.assign({
28
28
  x: x,
29
29
  y: y,
30
- width: null !== (_b = null != mainTitleWidth ? mainTitleWidth : width) && void 0 !== _b ? _b : 0,
31
- height: null != fixedMainTitleHeight ? fixedMainTitleHeight : 0,
30
+ width: null !== (_a = null != mainTitleWidth ? mainTitleWidth : width) && void 0 !== _a ? _a : 0,
31
+ height: null !== (_b = null != mainTitleHeight ? mainTitleHeight : height) && void 0 !== _b ? _b : 0,
32
32
  ellipsis: null == ellipsis || ellipsis,
33
33
  wordBreak: null != wordBreak ? wordBreak : "break-word",
34
34
  maxHeight: null != mainTitleMaxHeight ? mainTitleMaxHeight : maxHeight,
@@ -44,7 +44,7 @@ class Title extends base_1.AbstractComponent {
44
44
  x: x,
45
45
  y: y,
46
46
  width: null !== (_d = null != mainTitleWidth ? mainTitleWidth : width) && void 0 !== _d ? _d : 0,
47
- height: null != fixedMainTitleHeight ? fixedMainTitleHeight : 0,
47
+ height: null !== (_e = null != mainTitleHeight ? mainTitleHeight : height) && void 0 !== _e ? _e : 0,
48
48
  ellipsis: ellipsis,
49
49
  wordBreak: wordBreak,
50
50
  maxHeight: null != mainTitleMaxHeight ? mainTitleMaxHeight : maxHeight,
@@ -56,17 +56,17 @@ class Title extends base_1.AbstractComponent {
56
56
  text: (0, vutils_1.isArray)(text) ? text : [ text ],
57
57
  whiteSpace: "normal"
58
58
  }, textStyle), {
59
- maxLineWidth: null !== (_f = null !== (_e = textStyle.maxLineWidth) && void 0 !== _e ? _e : mainTitleWidth) && void 0 !== _f ? _f : width,
60
- heightLimit: null !== (_g = textStyle.height) && void 0 !== _g ? _g : maxHeight,
59
+ maxLineWidth: null !== (_g = null !== (_f = textStyle.maxLineWidth) && void 0 !== _f ? _f : mainTitleWidth) && void 0 !== _g ? _g : width,
60
+ heightLimit: null != mainTitleHeight ? mainTitleHeight : maxHeight,
61
61
  lineClamp: lineClamp,
62
62
  ellipsis: ellipsis,
63
63
  x: x,
64
64
  y: y
65
65
  }), "text"));
66
66
  }
67
- const mainTextBoundsHeight = this._mainTitle ? this._mainTitle.AABBBounds.height() : 0, mainTextBoundsWidth = this._mainTitle ? this._mainTitle.AABBBounds.width() : 0;
67
+ const maintextHeight = this._mainTitle ? this._mainTitle.AABBBounds.height() : 0, maintextWidth = this._mainTitle ? this._mainTitle.AABBBounds.width() : 0;
68
68
  if (!1 !== this.attribute.visible && !1 !== subtextStyle.visible) {
69
- const {width: subTitleWidth, height: subTitleHeight, maxWidth: subTitleMaxWidth, maxHeight: subTitleMaxHeight, x: x = 0, y: y = 0, ellipsis: ellipsis = !0, wordBreak: wordBreak = "break-word", lineClamp: lineClamp} = subtextStyle, maxSubTextHeight = Math.max(Number.MIN_VALUE, maxHeight - mainTextBoundsHeight);
69
+ const {width: subTitleWidth, height: subTitleHeight, maxWidth: subTitleMaxWidth, maxHeight: subTitleMaxHeight, x: x = 0, y: y = 0, ellipsis: ellipsis = !0, wordBreak: wordBreak = "break-word", lineClamp: lineClamp} = subtextStyle, maxSubTextHeight = Math.max(Number.MIN_VALUE, maxHeight - maintextHeight);
70
70
  if ("rich" === subtextType || (0, vutils_1.isValid)(subtextStyle.character)) {
71
71
  const attr = Object.assign({
72
72
  x: x,
@@ -105,45 +105,45 @@ class Title extends base_1.AbstractComponent {
105
105
  lineClamp: lineClamp,
106
106
  ellipsis: ellipsis,
107
107
  x: 0,
108
- y: mainTextBoundsHeight
108
+ y: maintextHeight
109
109
  }), "text"));
110
110
  }
111
- const subTextBoundsHeight = this._subTitle ? this._subTitle.AABBBounds.height() : 0, subTextBoundsWidth = this._subTitle ? this._subTitle.AABBBounds.width() : 0;
112
- let totalWidth = Math.max(mainTextBoundsWidth, subTextBoundsWidth), totalHeight = mainTextBoundsHeight + (null !== (_q = subtextStyle.height) && void 0 !== _q ? _q : subTextBoundsHeight);
113
- if ((0, vutils_1.isValid)(width) && (totalWidth = width), (0, vutils_1.isValid)(height) && (totalHeight = height),
114
- (0, vutils_1.isValid)(minWidth) && totalWidth < minWidth && (totalWidth = minWidth),
115
- (0, vutils_1.isValid)(maxWidth) && totalWidth > maxWidth && (totalWidth = maxWidth),
116
- (0, vutils_1.isValid)(minHeight) && totalHeight < minHeight && (totalHeight = minHeight),
117
- (0, vutils_1.isValid)(maxHeight) && totalHeight > maxHeight && (totalHeight = maxHeight),
118
- group.attribute.width = totalWidth, group.attribute.height = totalHeight, group.attribute.boundsPadding = parsedPadding,
111
+ const subtextHeight = this._subTitle ? this._subTitle.AABBBounds.height() : 0, subtextWidth = this._subTitle ? this._subTitle.AABBBounds.width() : 0;
112
+ let titleWidth = Math.max(maintextWidth, subtextWidth), titleHeight = maintextHeight + (null !== (_q = subtextStyle.height) && void 0 !== _q ? _q : subtextHeight);
113
+ if ((0, vutils_1.isValid)(width) && (titleWidth = width), (0, vutils_1.isValid)(height) && (titleHeight = height),
114
+ (0, vutils_1.isValid)(minWidth) && titleWidth < minWidth && (titleWidth = minWidth),
115
+ (0, vutils_1.isValid)(maxWidth) && titleWidth > maxWidth && (titleWidth = maxWidth),
116
+ (0, vutils_1.isValid)(minHeight) && titleHeight < minHeight && (titleHeight = minHeight),
117
+ (0, vutils_1.isValid)(maxHeight) && titleHeight > maxHeight && (titleHeight = maxHeight),
118
+ group.attribute.width = titleWidth, group.attribute.height = titleHeight, group.attribute.boundsPadding = parsedPadding,
119
119
  this._mainTitle) {
120
120
  if ((0, vutils_1.isValid)(align) || (0, vutils_1.isValid)(textStyle.align)) {
121
- const mainTitleAlign = textStyle.align ? textStyle.align : align, mainTitleWidth = null !== (_r = textStyle.width) && void 0 !== _r ? _r : totalWidth;
122
- "center" === mainTitleAlign ? (this._mainTitle.setAttribute("x", mainTitleWidth / 2),
123
- this._mainTitle.setAttribute("textAlign", "center")) : "right" === mainTitleAlign ? (this._mainTitle.setAttribute("x", mainTitleWidth),
124
- this._mainTitle.setAttribute("textAlign", "right")) : (this._mainTitle.setAttribute("x", 0),
125
- this._mainTitle.setAttribute("textAlign", "left"));
121
+ const mainTitleAlign = textStyle.align ? textStyle.align : align, mainTitleWidth = null !== (_r = textStyle.width) && void 0 !== _r ? _r : maintextWidth;
122
+ "left" === mainTitleAlign ? (this._mainTitle.setAttribute("x", 0), this._mainTitle.setAttribute("textAlign", "left")) : "center" === mainTitleAlign ? (this._mainTitle.setAttribute("x", mainTitleWidth / 2),
123
+ this._mainTitle.setAttribute("textAlign", "center")) : "right" === mainTitleAlign && (this._mainTitle.setAttribute("x", mainTitleWidth),
124
+ this._mainTitle.setAttribute("textAlign", "right"));
125
+ }
126
+ if ((0, vutils_1.isValid)(verticalAlign) || (0, vutils_1.isValid)(textStyle.verticalAlign)) {
127
+ const mainTitleVerticalAlign = textStyle.verticalAlign ? textStyle.verticalAlign : verticalAlign, mainTitleHeight = textStyle.height ? textStyle.height : titleHeight;
128
+ "top" === mainTitleVerticalAlign ? (this._mainTitle.setAttribute("y", 0), this._mainTitle.setAttribute("textBaseline", "top")) : "middle" === mainTitleVerticalAlign ? (this._mainTitle.setAttribute("y", mainTitleHeight / 2),
129
+ this._mainTitle.setAttribute("textBaseline", "middle")) : "bottom" === mainTitleVerticalAlign && (this._mainTitle.setAttribute("y", mainTitleHeight),
130
+ this._mainTitle.setAttribute("textBaseline", "bottom"));
126
131
  }
127
- const mainTitleVerticalAlign = textStyle.verticalAlign ? textStyle.verticalAlign : verticalAlign, mainTitleHeight = null != fixedMainTitleHeight ? fixedMainTitleHeight : this._mainTitle.AABBBounds.empty() ? 0 : this._mainTitle.AABBBounds.height();
128
- "middle" === mainTitleVerticalAlign ? (this._mainTitle.setAttribute("y", mainTitleHeight / 2),
129
- this._mainTitle.setAttribute("textBaseline", "middle")) : "bottom" === mainTitleVerticalAlign ? (this._mainTitle.setAttribute("y", mainTitleHeight),
130
- this._mainTitle.setAttribute("textBaseline", "bottom")) : (this._mainTitle.setAttribute("y", 0),
131
- this._mainTitle.setAttribute("textBaseline", "top"));
132
132
  }
133
133
  if (this._subTitle) {
134
134
  if ((0, vutils_1.isValid)(align) || (0, vutils_1.isValid)(subtextStyle.align)) {
135
- const subTitleAlign = subtextStyle.align ? subtextStyle.align : align, subTitleWidth = null !== (_t = null !== (_s = subtextStyle.width) && void 0 !== _s ? _s : textStyle.width) && void 0 !== _t ? _t : totalWidth;
136
- "center" === subTitleAlign ? (this._subTitle.setAttribute("x", subTitleWidth / 2),
137
- this._subTitle.setAttribute("textAlign", "center")) : "right" === subTitleAlign ? (this._subTitle.setAttribute("x", subTitleWidth),
138
- this._subTitle.setAttribute("textAlign", "right")) : (this._subTitle.setAttribute("x", 0),
139
- this._subTitle.setAttribute("textAlign", "left"));
135
+ const subTitleAlign = subtextStyle.align ? subtextStyle.align : align, subTitleWidth = null !== (_s = subtextStyle.width) && void 0 !== _s ? _s : subtextWidth;
136
+ "left" === subTitleAlign ? (this._subTitle.setAttribute("x", 0), this._subTitle.setAttribute("textAlign", "left")) : "center" === subTitleAlign ? (this._subTitle.setAttribute("x", subTitleWidth / 2),
137
+ this._subTitle.setAttribute("textAlign", "center")) : "right" === subTitleAlign && (this._subTitle.setAttribute("x", subTitleWidth),
138
+ this._subTitle.setAttribute("textAlign", "right"));
139
+ }
140
+ if ((0, vutils_1.isValid)(verticalAlign) || (0, vutils_1.isValid)(textStyle.verticalAlign)) {
141
+ const subTitleVerticalAlign = subtextStyle.verticalAlign ? subtextStyle.verticalAlign : verticalAlign, subTitleYStart = maintextHeight, subTitleHeight = null !== (_t = subtextStyle.height) && void 0 !== _t ? _t : 0;
142
+ "top" === subTitleVerticalAlign ? (this._subTitle.setAttribute("y", subTitleYStart),
143
+ this._subTitle.setAttribute("textBaseline", "top")) : "middle" === subTitleVerticalAlign ? (this._subTitle.setAttribute("y", subTitleYStart + subTitleHeight / 2),
144
+ this._subTitle.setAttribute("textBaseline", "middle")) : "bottom" === subTitleVerticalAlign && (this._subTitle.setAttribute("y", subTitleYStart + subTitleHeight),
145
+ this._subTitle.setAttribute("textBaseline", "bottom"));
140
146
  }
141
- const subTitleVerticalAlign = subtextStyle.verticalAlign ? subtextStyle.verticalAlign : verticalAlign, subTitleYStart = this._mainTitle ? (0,
142
- vutils_1.isValid)(fixedMainTitleHeight) ? this._mainTitle.AABBBounds.y1 + Math.max(this._mainTitle.AABBBounds.empty() ? 0 : this._mainTitle.AABBBounds.height(), fixedMainTitleHeight) : this._mainTitle.AABBBounds.y2 : 0, subTitleHeight = null !== (_v = null !== (_u = subtextStyle.height) && void 0 !== _u ? _u : height) && void 0 !== _v ? _v : this._subTitle.AABBBounds.empty() ? 0 : this._subTitle.AABBBounds.height();
143
- "middle" === subTitleVerticalAlign ? (this._subTitle.setAttribute("y", subTitleYStart + subTitleHeight / 2),
144
- this._subTitle.setAttribute("textBaseline", "middle")) : "bottom" === subTitleVerticalAlign ? (this._subTitle.setAttribute("y", subTitleYStart + subTitleHeight),
145
- this._subTitle.setAttribute("textBaseline", "bottom")) : (this._subTitle.setAttribute("y", subTitleYStart),
146
- this._subTitle.setAttribute("textBaseline", "top"));
147
147
  }
148
148
  }
149
149
  }