@visactor/vrender-components 0.22.7-alpha.0 → 0.22.7-alpha.2

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 (80) hide show
  1. package/cjs/index.d.ts +1 -1
  2. package/cjs/index.js +1 -1
  3. package/cjs/index.js.map +1 -1
  4. package/cjs/marker/animate/animate.d.ts +3 -3
  5. package/cjs/marker/animate/animate.js.map +1 -1
  6. package/cjs/marker/animate/clip-in.d.ts +1 -1
  7. package/cjs/marker/animate/clip-in.js +6 -3
  8. package/cjs/marker/animate/clip-in.js.map +1 -1
  9. package/cjs/marker/animate/fade-in.d.ts +3 -3
  10. package/cjs/marker/animate/fade-in.js +10 -4
  11. package/cjs/marker/animate/fade-in.js.map +1 -1
  12. package/cjs/marker/animate/fade-out.d.ts +3 -3
  13. package/cjs/marker/animate/fade-out.js +10 -4
  14. package/cjs/marker/animate/fade-out.js.map +1 -1
  15. package/cjs/marker/arc-area.d.ts +8 -5
  16. package/cjs/marker/arc-area.js +18 -39
  17. package/cjs/marker/arc-area.js.map +1 -1
  18. package/cjs/marker/arc-line.d.ts +6 -4
  19. package/cjs/marker/arc-line.js +12 -9
  20. package/cjs/marker/arc-line.js.map +1 -1
  21. package/cjs/marker/area.d.ts +6 -4
  22. package/cjs/marker/area.js +14 -32
  23. package/cjs/marker/area.js.map +1 -1
  24. package/cjs/marker/base.d.ts +2 -3
  25. package/cjs/marker/base.js.map +1 -1
  26. package/cjs/marker/common-line.d.ts +11 -7
  27. package/cjs/marker/common-line.js +11 -31
  28. package/cjs/marker/common-line.js.map +1 -1
  29. package/cjs/marker/config.d.ts +2 -0
  30. package/cjs/marker/config.js +2 -0
  31. package/cjs/marker/config.js.map +1 -1
  32. package/cjs/marker/line.d.ts +6 -4
  33. package/cjs/marker/line.js +10 -4
  34. package/cjs/marker/line.js.map +1 -1
  35. package/cjs/marker/mixin/label.d.ts +16 -0
  36. package/cjs/marker/mixin/label.js +57 -0
  37. package/cjs/marker/mixin/label.js.map +1 -0
  38. package/cjs/marker/type.d.ts +19 -16
  39. package/cjs/marker/type.js.map +1 -1
  40. package/dist/index.es.js +126 -109
  41. package/es/index.d.ts +1 -1
  42. package/es/index.js +1 -1
  43. package/es/index.js.map +1 -1
  44. package/es/marker/animate/animate.d.ts +3 -3
  45. package/es/marker/animate/animate.js.map +1 -1
  46. package/es/marker/animate/clip-in.d.ts +1 -1
  47. package/es/marker/animate/clip-in.js +6 -2
  48. package/es/marker/animate/clip-in.js.map +1 -1
  49. package/es/marker/animate/fade-in.d.ts +3 -3
  50. package/es/marker/animate/fade-in.js +11 -3
  51. package/es/marker/animate/fade-in.js.map +1 -1
  52. package/es/marker/animate/fade-out.d.ts +3 -3
  53. package/es/marker/animate/fade-out.js +11 -3
  54. package/es/marker/animate/fade-out.js.map +1 -1
  55. package/es/marker/arc-area.d.ts +8 -5
  56. package/es/marker/arc-area.js +19 -41
  57. package/es/marker/arc-area.js.map +1 -1
  58. package/es/marker/arc-line.d.ts +6 -4
  59. package/es/marker/arc-line.js +12 -9
  60. package/es/marker/arc-line.js.map +1 -1
  61. package/es/marker/area.d.ts +6 -4
  62. package/es/marker/area.js +15 -34
  63. package/es/marker/area.js.map +1 -1
  64. package/es/marker/base.d.ts +2 -3
  65. package/es/marker/base.js.map +1 -1
  66. package/es/marker/common-line.d.ts +11 -7
  67. package/es/marker/common-line.js +14 -34
  68. package/es/marker/common-line.js.map +1 -1
  69. package/es/marker/config.d.ts +2 -0
  70. package/es/marker/config.js +2 -0
  71. package/es/marker/config.js.map +1 -1
  72. package/es/marker/line.d.ts +6 -4
  73. package/es/marker/line.js +10 -4
  74. package/es/marker/line.js.map +1 -1
  75. package/es/marker/mixin/label.d.ts +16 -0
  76. package/es/marker/mixin/label.js +45 -0
  77. package/es/marker/mixin/label.js.map +1 -0
  78. package/es/marker/type.d.ts +19 -16
  79. package/es/marker/type.js.map +1 -1
  80. package/package.json +3 -3
package/dist/index.es.js CHANGED
@@ -4162,7 +4162,7 @@ class FederatedEvent {
4162
4162
  }
4163
4163
  _composedDetailPath(params) {
4164
4164
  if (params && params.graphic) {
4165
- const g = params.graphic;
4165
+ const g = this.pickParams.graphic;
4166
4166
  if (g.stage) {
4167
4167
  const path = g.stage.eventSystem.manager.propagationPath(g);
4168
4168
  this.detailPath.push(path), this._composedDetailPath(params.params);
@@ -23998,21 +23998,30 @@ function commonLineClipIn(line, label, duration, delay, easing) {
23998
23998
  .to({ clipRange: 1 }, stepDuration, easing);
23999
23999
  });
24000
24000
  graphicFadeIn(line.endSymbol, delay + startSymbolDuration + lineDuration, endSymbolDuration, easing);
24001
- graphicFadeIn(label.getTextShape(), delay + startSymbolDuration + lineDuration + endSymbolDuration, labelDuration, easing);
24002
- graphicFadeIn(label.getBgRect(), delay + startSymbolDuration + lineDuration + endSymbolDuration, labelDuration, easing);
24001
+ array(label).forEach(labelNode => {
24002
+ const delayTime = delay + startSymbolDuration + lineDuration + endSymbolDuration;
24003
+ graphicFadeIn(labelNode.getTextShape(), delayTime, labelDuration, easing);
24004
+ graphicFadeIn(labelNode.getBgRect(), delayTime, labelDuration, easing);
24005
+ });
24003
24006
  }
24004
24007
 
24005
24008
  function commonLineFadeIn(line, label, duration, delay, easing) {
24006
24009
  segmentFadeIn(line, delay, duration, easing);
24007
- tagFadeIn(label, delay, duration, easing);
24010
+ array(label).forEach(labelNode => {
24011
+ tagFadeIn(labelNode, delay, duration, easing);
24012
+ });
24008
24013
  }
24009
24014
  function areaFadeIn(area, label, duration, delay, easing) {
24010
24015
  graphicFadeIn(area, delay, duration, easing);
24011
- tagFadeIn(label, delay, duration, easing);
24016
+ array(label).forEach(labelNode => {
24017
+ tagFadeIn(labelNode, delay, duration, easing);
24018
+ });
24012
24019
  }
24013
24020
  function arcAreaFadeIn(area, label, duration, delay, easing) {
24014
24021
  graphicFadeIn(area, delay, duration, easing);
24015
- tagFadeIn(label, delay, duration, easing);
24022
+ array(label).forEach(labelNode => {
24023
+ tagFadeIn(labelNode, delay, duration, easing);
24024
+ });
24016
24025
  }
24017
24026
  function pointFadeIn(itemLine, decorativeLine, item, duration, delay, easing) {
24018
24027
  var _a;
@@ -24028,15 +24037,21 @@ function pointFadeIn(itemLine, decorativeLine, item, duration, delay, easing) {
24028
24037
 
24029
24038
  function commonLineFadeOut(line, label, duration, delay, easing) {
24030
24039
  segmentFadeOut(line, delay, duration, easing);
24031
- tagFadeOut(label, delay, duration, easing);
24040
+ array(label).forEach(labelNode => {
24041
+ tagFadeOut(labelNode, delay, duration, easing);
24042
+ });
24032
24043
  }
24033
24044
  function areaFadeOut(area, label, duration, delay, easing) {
24034
24045
  graphicFadeOut(area, delay, duration, easing);
24035
- tagFadeOut(label, delay, duration, easing);
24046
+ array(label).forEach(labelNode => {
24047
+ tagFadeOut(labelNode, delay, duration, easing);
24048
+ });
24036
24049
  }
24037
24050
  function arcAreaFadeOut(area, label, duration, delay, easing) {
24038
24051
  graphicFadeOut(area, delay, duration, easing);
24039
- tagFadeOut(label, delay, duration, easing);
24052
+ array(label).forEach(labelNode => {
24053
+ tagFadeOut(labelNode, delay, duration, easing);
24054
+ });
24040
24055
  }
24041
24056
  function pointFadeOut(itemLine, decorativeLine, item, duration, delay, easing) {
24042
24057
  var _a;
@@ -24190,6 +24205,48 @@ const DefaultExitMarkerAnimation = {
24190
24205
  delay: 0
24191
24206
  };
24192
24207
 
24208
+ class MarkLabelMixin {
24209
+ getLabel() {
24210
+ return this._label;
24211
+ }
24212
+ _addMarkLabels(container, labelName, defaultLabelAttrs) {
24213
+ const { label, state } = this.attribute;
24214
+ const labelStates = array(state === null || state === void 0 ? void 0 : state.label);
24215
+ const labelBackgroundStates = array(state === null || state === void 0 ? void 0 : state.labelBackground);
24216
+ const labelShapes = array(label).map((labelAttrs, index) => {
24217
+ var _a, _b;
24218
+ const finalLabelAttrs = merge({}, defaultLabelAttrs, labelAttrs);
24219
+ const markLabel = new Tag(Object.assign(Object.assign({}, finalLabelAttrs), { state: {
24220
+ panel: merge({}, DEFAULT_STATES$2, (_a = labelBackgroundStates[index]) !== null && _a !== void 0 ? _a : last(labelBackgroundStates)),
24221
+ text: merge({}, DEFAULT_STATES$2, (_b = labelStates[index]) !== null && _b !== void 0 ? _b : last(labelStates))
24222
+ } }));
24223
+ markLabel.name = labelName;
24224
+ container.add(markLabel);
24225
+ this.setLabelPos(markLabel, finalLabelAttrs);
24226
+ return markLabel;
24227
+ });
24228
+ this._label = array(labelShapes).length === 1 ? labelShapes[0] : labelShapes;
24229
+ }
24230
+ _updateMarkLabels(defaultLabelAttrs) {
24231
+ const { label, state } = this.attribute;
24232
+ const labelShapes = array(this._label);
24233
+ const labelStates = array(state === null || state === void 0 ? void 0 : state.label);
24234
+ const labelBackgroundStates = array(state === null || state === void 0 ? void 0 : state.labelBackground);
24235
+ if (labelShapes.length) {
24236
+ const labels = array(label);
24237
+ labelShapes.forEach((labelItem, index) => {
24238
+ var _a, _b;
24239
+ const finalLabelAttrs = merge({}, defaultLabelAttrs, labels[index]);
24240
+ labelItem.setAttributes(Object.assign(Object.assign({ dx: 0, dy: 0 }, finalLabelAttrs), { state: {
24241
+ panel: merge({}, DEFAULT_STATES$2, (_a = labelBackgroundStates[index]) !== null && _a !== void 0 ? _a : last(labelBackgroundStates)),
24242
+ text: merge({}, DEFAULT_STATES$2, (_b = labelStates[index]) !== null && _b !== void 0 ? _b : last(labelStates))
24243
+ } }));
24244
+ this.setLabelPos(labelItem, finalLabelAttrs);
24245
+ });
24246
+ }
24247
+ }
24248
+ }
24249
+
24193
24250
  class MarkCommonLine extends Marker {
24194
24251
  constructor() {
24195
24252
  super(...arguments);
@@ -24200,20 +24257,17 @@ class MarkCommonLine extends Marker {
24200
24257
  getLine() {
24201
24258
  return this._line;
24202
24259
  }
24203
- getLabel() {
24204
- return this._label;
24205
- }
24206
- setLabelPos() {
24207
- const { label = {}, limitRect } = this.attribute;
24208
- const { position, confine, autoRotate } = label;
24209
- const labelPoint = this.getPointAttrByPosition(position);
24260
+ setLabelPos(labelNode, labelAttrs) {
24261
+ const { limitRect } = this.attribute;
24262
+ const { position, confine, autoRotate } = labelAttrs;
24263
+ const labelPoint = this.getPointAttrByPosition(position, labelAttrs);
24210
24264
  const labelAngle = position.toString().toLocaleLowerCase().includes('start')
24211
24265
  ? this._line.getStartAngle() || 0
24212
24266
  : this._line.getEndAngle() || 0;
24213
- this._label.setAttributes(Object.assign(Object.assign({}, labelPoint.position), { angle: autoRotate ? this.getRotateByAngle(labelPoint.angle) : 0, textStyle: Object.assign(Object.assign({}, this.getTextStyle(position, labelAngle, autoRotate)), label.textStyle) }));
24267
+ labelNode.setAttributes(Object.assign(Object.assign({}, labelPoint.position), { angle: autoRotate ? this.getRotateByAngle(labelPoint.angle, labelAttrs) : 0, textStyle: Object.assign(Object.assign({}, this.getTextStyle(position, labelAngle, autoRotate)), labelAttrs.textStyle) }));
24214
24268
  if (limitRect && confine) {
24215
24269
  const { x, y, width, height } = limitRect;
24216
- limitShapeInBounds(this._label, {
24270
+ limitShapeInBounds(labelNode, {
24217
24271
  x1: x,
24218
24272
  y1: y,
24219
24273
  x2: x + width,
@@ -24222,32 +24276,18 @@ class MarkCommonLine extends Marker {
24222
24276
  }
24223
24277
  }
24224
24278
  initMarker(container) {
24225
- const { label, state } = this.attribute;
24226
24279
  const line = this.createSegment();
24227
24280
  line.name = 'mark-common-line-line';
24228
24281
  this._line = line;
24229
24282
  container.add(line);
24230
- const markLabel = new Tag(Object.assign(Object.assign({}, label), { state: {
24231
- panel: merge({}, DEFAULT_STATES$2, state === null || state === void 0 ? void 0 : state.labelBackground),
24232
- text: merge({}, DEFAULT_STATES$2, state === null || state === void 0 ? void 0 : state.label)
24233
- } }));
24234
- markLabel.name = 'mark-common-line-label';
24235
- this._label = markLabel;
24236
- container.add(markLabel);
24237
- this.setLabelPos();
24283
+ this.addMarkLineLabels(container);
24238
24284
  }
24239
24285
  updateMarker() {
24240
- const { label, state } = this.attribute;
24241
24286
  this.setLineAttributes();
24242
- if (this._label) {
24243
- this._label.setAttributes(Object.assign(Object.assign({ dx: 0, dy: 0 }, label), { state: {
24244
- panel: merge({}, DEFAULT_STATES$2, state === null || state === void 0 ? void 0 : state.labelBackground),
24245
- text: merge({}, DEFAULT_STATES$2, state === null || state === void 0 ? void 0 : state.label)
24246
- } }));
24247
- this.setLabelPos();
24248
- }
24287
+ this.updateMarkLineLabels();
24249
24288
  }
24250
24289
  }
24290
+ mixin(MarkCommonLine, MarkLabelMixin);
24251
24291
 
24252
24292
  const FUZZY_EQUAL_DELTA = 0.001;
24253
24293
  const DEFAULT_MARK_LINE_THEME = {
@@ -24436,6 +24476,7 @@ const DEFAULT_MARK_ARC_LINE_THEME = {
24436
24476
  lineWidth: 0
24437
24477
  },
24438
24478
  label: {
24479
+ autoRotate: true,
24439
24480
  position: IMarkCommonArcLabelPosition.arcOuterMiddle,
24440
24481
  refX: 0,
24441
24482
  refY: 0,
@@ -24490,6 +24531,7 @@ const DEFAULT_MARK_AREA_THEME = {
24490
24531
  const DEFAULT_MARK_ARC_AREA_THEME = {
24491
24532
  interactive: true,
24492
24533
  label: {
24534
+ autoRotate: true,
24493
24535
  position: IMarkCommonArcLabelPosition.arcOuterMiddle,
24494
24536
  textStyle: {
24495
24537
  fill: '#fff',
@@ -24748,10 +24790,9 @@ class MarkLine extends MarkCommonLine {
24748
24790
  super((options === null || options === void 0 ? void 0 : options.skipDefault) ? attributes : merge({}, MarkLine.defaultAttributes, attributes));
24749
24791
  this.name = 'markLine';
24750
24792
  }
24751
- getPointAttrByPosition(position) {
24793
+ getPointAttrByPosition(position, labelAttrs) {
24752
24794
  var _a;
24753
- const { label = {} } = this.attribute;
24754
- const { refX = 0, refY = 0 } = label;
24795
+ const { refX = 0, refY = 0 } = labelAttrs;
24755
24796
  const points = this._line.getMainSegmentPoints();
24756
24797
  const lineEndAngle = (_a = this._line.getEndAngle()) !== null && _a !== void 0 ? _a : 0;
24757
24798
  const labelAngle = isPostiveXAxis(lineEndAngle) ? lineEndAngle : lineEndAngle;
@@ -24783,10 +24824,10 @@ class MarkLine extends MarkCommonLine {
24783
24824
  angle: labelAngle
24784
24825
  };
24785
24826
  }
24786
- getRotateByAngle(angle) {
24827
+ getRotateByAngle(angle, labelAttrs) {
24787
24828
  var _a;
24788
24829
  const itemAngle = isPostiveXAxis(angle) ? angle : angle - Math.PI;
24789
- return itemAngle + ((_a = this.attribute.label.refAngle) !== null && _a !== void 0 ? _a : 0);
24830
+ return itemAngle + ((_a = labelAttrs.refAngle) !== null && _a !== void 0 ? _a : 0);
24790
24831
  }
24791
24832
  getTextStyle(position, labelAngle, autoRotate) {
24792
24833
  if (fuzzyEqualNumber(Math.abs(labelAngle), Math.PI / 2, FUZZY_EQUAL_DELTA) ||
@@ -24857,6 +24898,12 @@ class MarkLine extends MarkCommonLine {
24857
24898
  });
24858
24899
  return validFlag;
24859
24900
  }
24901
+ addMarkLineLabels(container) {
24902
+ this._addMarkLabels(container, 'mark-common-line-label', MarkLine.defaultAttributes.label);
24903
+ }
24904
+ updateMarkLineLabels() {
24905
+ this._updateMarkLabels(MarkLine.defaultAttributes.label);
24906
+ }
24860
24907
  }
24861
24908
  MarkLine.defaultAttributes = DEFAULT_MARK_LINE_THEME;
24862
24909
 
@@ -24873,9 +24920,6 @@ class MarkArea extends Marker {
24873
24920
  getArea() {
24874
24921
  return this._area;
24875
24922
  }
24876
- getLabel() {
24877
- return this._label;
24878
- }
24879
24923
  constructor(attributes, options) {
24880
24924
  super((options === null || options === void 0 ? void 0 : options.skipDefault) ? attributes : merge({}, MarkArea.defaultAttributes, attributes));
24881
24925
  this.name = 'markArea';
@@ -24902,16 +24946,15 @@ class MarkArea extends Marker {
24902
24946
  }
24903
24947
  return result;
24904
24948
  }
24905
- setLabelPos() {
24949
+ setLabelPos(labelNode, labelAttrs) {
24906
24950
  var _a;
24907
- if (this._label && this._area) {
24908
- const { label = {} } = this.attribute;
24909
- const labelPosition = (_a = label.position) !== null && _a !== void 0 ? _a : 'middle';
24951
+ if (this._area) {
24952
+ const labelPosition = (_a = labelAttrs.position) !== null && _a !== void 0 ? _a : 'middle';
24910
24953
  const labelPoint = this.getPointAttrByPosition(labelPosition);
24911
- this._label.setAttributes(Object.assign(Object.assign({}, labelPoint), { textStyle: Object.assign(Object.assign({}, DEFAULT_CARTESIAN_MARK_AREA_TEXT_STYLE_MAP[labelPosition]), label.textStyle) }));
24912
- if (this.attribute.limitRect && label.confine) {
24954
+ labelNode.setAttributes(Object.assign(Object.assign({}, labelPoint), { textStyle: Object.assign(Object.assign({}, DEFAULT_CARTESIAN_MARK_AREA_TEXT_STYLE_MAP[labelPosition]), labelAttrs.textStyle) }));
24955
+ if (this.attribute.limitRect && labelAttrs.confine) {
24913
24956
  const { x, y, width, height } = this.attribute.limitRect;
24914
- limitShapeInBounds(this._label, {
24957
+ limitShapeInBounds(labelNode, {
24915
24958
  x1: x,
24916
24959
  y1: y,
24917
24960
  x2: x + width,
@@ -24921,34 +24964,21 @@ class MarkArea extends Marker {
24921
24964
  }
24922
24965
  }
24923
24966
  initMarker(container) {
24924
- const { points, label, areaStyle, state } = this.attribute;
24967
+ const { points, areaStyle, state } = this.attribute;
24925
24968
  const area = graphicCreator.polygon(Object.assign({ points: points }, areaStyle));
24926
24969
  area.states = merge({}, DEFAULT_STATES$2, state === null || state === void 0 ? void 0 : state.area);
24927
24970
  area.name = 'mark-area-polygon';
24928
24971
  this._area = area;
24929
24972
  container.add(area);
24930
- const markLabel = new Tag(Object.assign(Object.assign({}, label), { state: {
24931
- panel: merge({}, DEFAULT_STATES$2, state === null || state === void 0 ? void 0 : state.labelBackground),
24932
- text: merge({}, DEFAULT_STATES$2, state === null || state === void 0 ? void 0 : state.label)
24933
- } }));
24934
- markLabel.name = 'mark-area-label';
24935
- this._label = markLabel;
24936
- container.add(markLabel);
24937
- this.setLabelPos();
24973
+ this._addMarkLabels(container, 'mark-area-label', MarkArea.defaultAttributes.label);
24938
24974
  }
24939
24975
  updateMarker() {
24940
- const { points, label, areaStyle, state } = this.attribute;
24976
+ const { points, areaStyle, state } = this.attribute;
24941
24977
  if (this._area) {
24942
24978
  this._area.setAttributes(Object.assign({ points: points }, areaStyle));
24943
24979
  this._area.states = merge({}, DEFAULT_STATES$2, state === null || state === void 0 ? void 0 : state.area);
24944
24980
  }
24945
- if (this._label) {
24946
- this._label.setAttributes(Object.assign(Object.assign({ dx: 0, dy: 0 }, label), { state: {
24947
- panel: merge({}, DEFAULT_STATES$2, state === null || state === void 0 ? void 0 : state.labelBackground),
24948
- text: merge({}, DEFAULT_STATES$2, state === null || state === void 0 ? void 0 : state.label)
24949
- } }));
24950
- }
24951
- this.setLabelPos();
24981
+ this._updateMarkLabels(MarkArea.defaultAttributes.label);
24952
24982
  }
24953
24983
  isValidPoints() {
24954
24984
  const { points } = this.attribute;
@@ -24966,6 +24996,7 @@ class MarkArea extends Marker {
24966
24996
  }
24967
24997
  }
24968
24998
  MarkArea.defaultAttributes = DEFAULT_MARK_AREA_THEME;
24999
+ mixin(MarkArea, MarkLabelMixin);
24969
25000
 
24970
25001
  loadMarkArcLineComponent();
24971
25002
  function registerMarkArcLineAnimate() {
@@ -24978,14 +25009,12 @@ class MarkArcLine extends MarkCommonLine {
24978
25009
  }
24979
25010
  }
24980
25011
  constructor(attributes, options) {
24981
- super((options === null || options === void 0 ? void 0 : options.skipDefault)
24982
- ? attributes
24983
- : merge({}, MarkArcLine.defaultAttributes, attributes, { label: { autoRotate: true } }));
25012
+ super((options === null || options === void 0 ? void 0 : options.skipDefault) ? attributes : merge({}, MarkArcLine.defaultAttributes, attributes));
24984
25013
  this.name = 'markArcLine';
24985
25014
  }
24986
- getPointAttrByPosition(direction) {
24987
- const { center, radius, startAngle, endAngle, label } = this.attribute;
24988
- const { refX = 0, refY = 0 } = label;
25015
+ getPointAttrByPosition(direction, labelAttrs) {
25016
+ const { center, radius, startAngle, endAngle } = this.attribute;
25017
+ const { refX = 0, refY = 0 } = labelAttrs;
24989
25018
  let angle;
24990
25019
  switch (direction) {
24991
25020
  case IMarkCommonArcLabelPosition.arcInnerStart:
@@ -25017,9 +25046,9 @@ class MarkArcLine extends MarkCommonLine {
25017
25046
  getTextStyle(position) {
25018
25047
  return DEFAULT_POLAR_MARKER_TEXT_STYLE_MAP[position];
25019
25048
  }
25020
- getRotateByAngle(angle) {
25049
+ getRotateByAngle(angle, labelAttrs) {
25021
25050
  var _a;
25022
- return angle - Math.PI / 2 + ((_a = this.attribute.label.refAngle) !== null && _a !== void 0 ? _a : 0);
25051
+ return angle - Math.PI / 2 + ((_a = labelAttrs.refAngle) !== null && _a !== void 0 ? _a : 0);
25023
25052
  }
25024
25053
  createSegment() {
25025
25054
  const { center, radius, startAngle, endAngle, startSymbol, endSymbol, lineStyle, state } = this
@@ -25062,6 +25091,12 @@ class MarkArcLine extends MarkCommonLine {
25062
25091
  isValidPoints() {
25063
25092
  return true;
25064
25093
  }
25094
+ addMarkLineLabels(container) {
25095
+ this._addMarkLabels(container, 'mark-common-line-label', MarkArcLine.defaultAttributes.label);
25096
+ }
25097
+ updateMarkLineLabels() {
25098
+ this._updateMarkLabels(MarkArcLine.defaultAttributes.label);
25099
+ }
25065
25100
  }
25066
25101
  MarkArcLine.defaultAttributes = DEFAULT_MARK_ARC_LINE_THEME;
25067
25102
 
@@ -25078,20 +25113,15 @@ class MarkArcArea extends Marker {
25078
25113
  getArea() {
25079
25114
  return this._area;
25080
25115
  }
25081
- getLabel() {
25082
- return this._label;
25083
- }
25084
25116
  constructor(attributes, options) {
25085
- super((options === null || options === void 0 ? void 0 : options.skipDefault)
25086
- ? attributes
25087
- : merge({}, MarkArcArea.defaultAttributes, attributes, { label: { autoRotate: true } }));
25117
+ super((options === null || options === void 0 ? void 0 : options.skipDefault) ? attributes : merge({}, MarkArcArea.defaultAttributes, attributes));
25088
25118
  this.name = 'markArcArea';
25089
25119
  this.defaultUpdateAnimation = DefaultUpdateMarkAreaAnimation;
25090
25120
  this.defaultExitAnimation = DefaultExitMarkerAnimation;
25091
25121
  }
25092
- getPointAttrByPosition(position) {
25093
- const { center, innerRadius, outerRadius, startAngle, endAngle, label } = this.attribute;
25094
- const { refX = 0, refY = 0 } = label;
25122
+ getPointAttrByPosition(position, labelAttrs) {
25123
+ const { center, innerRadius, outerRadius, startAngle, endAngle } = this.attribute;
25124
+ const { refX = 0, refY = 0 } = labelAttrs;
25095
25125
  let radius;
25096
25126
  let angle;
25097
25127
  switch (position) {
@@ -25135,16 +25165,15 @@ class MarkArcArea extends Marker {
25135
25165
  angle
25136
25166
  };
25137
25167
  }
25138
- setLabelPos() {
25168
+ setLabelPos(labelNode, labelAttrs) {
25139
25169
  var _a;
25140
- if (this._label && this._area) {
25141
- const { label = {} } = this.attribute;
25142
- const { position: labelPosition = 'arcInnerMiddle', autoRotate } = label;
25143
- const labelAttr = this.getPointAttrByPosition(labelPosition);
25144
- this._label.setAttributes(Object.assign(Object.assign({}, labelAttr.position), { angle: autoRotate ? labelAttr.angle - Math.PI / 2 + ((_a = label.refAngle) !== null && _a !== void 0 ? _a : 0) : 0, textStyle: Object.assign(Object.assign({}, DEFAULT_POLAR_MARKER_TEXT_STYLE_MAP[labelPosition]), label.textStyle) }));
25145
- if (this.attribute.limitRect && label.confine) {
25170
+ if (this._area) {
25171
+ const { position: labelPosition = 'arcInnerMiddle', autoRotate } = labelAttrs;
25172
+ const labelAttr = this.getPointAttrByPosition(labelPosition, labelAttrs);
25173
+ labelNode.setAttributes(Object.assign(Object.assign({}, labelAttr.position), { angle: autoRotate ? labelAttr.angle - Math.PI / 2 + ((_a = labelAttrs.refAngle) !== null && _a !== void 0 ? _a : 0) : 0, textStyle: Object.assign(Object.assign({}, DEFAULT_POLAR_MARKER_TEXT_STYLE_MAP[labelPosition]), labelAttrs.textStyle) }));
25174
+ if (this.attribute.limitRect && labelAttrs.confine) {
25146
25175
  const { x, y, width, height } = this.attribute.limitRect;
25147
- limitShapeInBounds(this._label, {
25176
+ limitShapeInBounds(labelNode, {
25148
25177
  x1: x,
25149
25178
  y1: y,
25150
25179
  x2: x + width,
@@ -25154,7 +25183,7 @@ class MarkArcArea extends Marker {
25154
25183
  }
25155
25184
  }
25156
25185
  initMarker(container) {
25157
- const { center, innerRadius, outerRadius, startAngle, endAngle, areaStyle, label, state } = this
25186
+ const { center, innerRadius, outerRadius, startAngle, endAngle, areaStyle, state } = this
25158
25187
  .attribute;
25159
25188
  const area = graphicCreator.arc(Object.assign({ x: center.x, y: center.y, innerRadius,
25160
25189
  outerRadius,
@@ -25164,14 +25193,7 @@ class MarkArcArea extends Marker {
25164
25193
  area.name = 'polar-mark-area-area';
25165
25194
  this._area = area;
25166
25195
  container.add(area);
25167
- const markLabel = new Tag(Object.assign(Object.assign({}, label), { state: {
25168
- panel: merge({}, DEFAULT_STATES$2, state === null || state === void 0 ? void 0 : state.labelBackground),
25169
- text: merge({}, DEFAULT_STATES$2, state === null || state === void 0 ? void 0 : state.label)
25170
- } }));
25171
- markLabel.name = 'mark-area-label';
25172
- this._label = markLabel;
25173
- container.add(markLabel);
25174
- this.setLabelPos();
25196
+ this._addMarkLabels(container, 'mark-area-label', MarkArcArea.defaultAttributes.label);
25175
25197
  }
25176
25198
  updateMarker() {
25177
25199
  const { center, innerRadius, outerRadius, startAngle, endAngle, areaStyle, label, state } = this
@@ -25183,19 +25205,14 @@ class MarkArcArea extends Marker {
25183
25205
  endAngle }, areaStyle));
25184
25206
  this._area.states = merge({}, DEFAULT_STATES$2, state === null || state === void 0 ? void 0 : state.area);
25185
25207
  }
25186
- if (this._label) {
25187
- this._label.setAttributes(Object.assign(Object.assign({ dx: 0, dy: 0 }, label), { state: {
25188
- panel: merge({}, DEFAULT_STATES$2, state === null || state === void 0 ? void 0 : state.labelBackground),
25189
- text: merge({}, DEFAULT_STATES$2, state === null || state === void 0 ? void 0 : state.label)
25190
- } }));
25191
- this.setLabelPos();
25192
- }
25208
+ this._updateMarkLabels(MarkArcArea.defaultAttributes.label);
25193
25209
  }
25194
25210
  isValidPoints() {
25195
25211
  return true;
25196
25212
  }
25197
25213
  }
25198
25214
  MarkArcArea.defaultAttributes = DEFAULT_MARK_ARC_AREA_THEME;
25215
+ mixin(MarkArcArea, MarkLabelMixin);
25199
25216
 
25200
25217
  loadMarkPointComponent();
25201
25218
  function registerMarkPointAnimate() {
@@ -31500,6 +31517,6 @@ StoryLabelItem.defaultAttributes = {
31500
31517
  theme: 'default'
31501
31518
  };
31502
31519
 
31503
- const version = "0.22.7-alpha.0";
31520
+ const version = "0.22.7-alpha.2";
31504
31521
 
31505
31522
  export { AXIS_ELEMENT_NAME, AbstractComponent, ArcInfo, ArcLabel, ArcSegment, AxisStateValue, BasePlayer, Brush, CheckBox, CircleAxis, CircleAxisGrid, CircleCrosshair, ColorContinuousLegend, ContinuousPlayer, DEFAULT_ITEM_SPACE_COL, DEFAULT_ITEM_SPACE_ROW, DEFAULT_LABEL_SPACE, DEFAULT_PAGER_SPACE, DEFAULT_SHAPE_SIZE, DEFAULT_SHAPE_SPACE, DEFAULT_STATES$1 as DEFAULT_STATES, DEFAULT_TITLE_SPACE, DEFAULT_VALUE_SPACE, DataLabel, DataZoom, DataZoomActiveTag, DirectionEnum, DiscreteLegend, DiscretePlayer, EmptyTip, GroupTransition, IMarkAreaLabelPosition, IMarkCommonArcLabelPosition, IMarkLineLabelPosition, IMarkPointItemPosition, IOperateType, Indicator, LEGEND_ELEMENT_NAME, LabelBase, LegendEvent, LegendStateValue, LineAxis, LineAxisGrid, LineCrosshair, LineLabel, LinkPath, MarkArcArea, MarkArcLine, MarkArea, MarkLine, MarkPoint, Pager, PlayerEventEnum, PolygonCrosshair, PolygonSectorCrosshair, PopTip, Radio, RectCrosshair, RectLabel, SLIDER_ELEMENT_NAME, ScrollBar, SectorCrosshair, Segment, SizeContinuousLegend, Slider, StoryLabelItem, Switch, SymbolLabel, Tag, Timeline, Title, Tooltip, TopZIndex, VTag, WeatherBox, alignTextInLine, angle, angleLabelOrientAttribute, angleTo, cartesianTicks, clampRadian, computeOffsetForlimit, continuousTicks, contrastAccessibilityChecker, convertDomainToTickData, createTextGraphicByType, deltaXYToAngle, fuzzyEqualNumber, getAxisBreakSymbolAttrs, getCircleLabelPosition, getCirclePoints, getCircleVerticalVector, getElMap, getHorizontalPath, getMarksByName, getNoneGroupMarksByName, getPolarAngleLabelPosition, getPolygonPath, getSizeHandlerPath, getTextAlignAttrOfVerticalDir, getTextType, getVerticalCoord, getVerticalPath, hasOverlap, htmlAttributeTransform, initTextMeasure, isInRange, isPostiveXAxis, isRichText, isVisible, labelSmartInvert, length, limitShapeInBounds, linearDiscreteTicks, loadPoptip, loadScrollbar, measureTextSize, normalize, polarAngleAxisDiscreteTicks, polarTicks, reactAttributeTransform, registerArcDataLabel, registerLineDataLabel, registerMarkArcAreaAnimate, registerMarkArcLineAnimate, registerMarkAreaAnimate, registerMarkLineAnimate, registerMarkPointAnimate, registerRectDataLabel, registerSymbolDataLabel, removeRepeatPoint, richTextAttributeTransform, scale, scrollbarModule, setPoptipTheme, smartInvertStrategy, tan2AngleToAngle, textIntersect, ticks, traverseGroup, version };
package/es/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const version = "0.22.7-alpha.0";
1
+ export declare const version = "0.22.7-alpha.2";
2
2
  export * from './core/base';
3
3
  export * from './core/type';
4
4
  export * from './scrollbar';
package/es/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export const version = "0.22.7-alpha.0";
1
+ export const version = "0.22.7-alpha.2";
2
2
 
3
3
  export * from "./core/base";
4
4
 
package/es/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,OAAO,GAAG,gBAAgB,CAAC;AAExC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.22.7-alpha.0\";\n\nexport * from './core/base';\nexport * from './core/type';\nexport * from './scrollbar';\nexport * from './tag';\nexport * from './poptip';\nexport * from './crosshair';\nexport * from './label';\nexport * from './axis';\nexport * from './axis/grid';\nexport * from './segment';\nexport * from './data-zoom';\nexport * from './marker';\nexport * from './pager';\nexport * from './legend';\nexport * from './title';\nexport * from './indicator';\nexport * from './slider';\nexport * from './link-path';\nexport * from './player';\nexport * from './brush';\nexport * from './tooltip';\nexport * from './timeline';\nexport * from './interface';\nexport * from './jsx';\nexport * from './checkbox';\nexport * from './radio';\nexport * from './empty-tip';\nexport * from './weather';\nexport * from './util';\nexport * from './switch';\nexport * from './label-item';\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,OAAO,GAAG,gBAAgB,CAAC;AAExC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.22.7-alpha.2\";\n\nexport * from './core/base';\nexport * from './core/type';\nexport * from './scrollbar';\nexport * from './tag';\nexport * from './poptip';\nexport * from './crosshair';\nexport * from './label';\nexport * from './axis';\nexport * from './axis/grid';\nexport * from './segment';\nexport * from './data-zoom';\nexport * from './marker';\nexport * from './pager';\nexport * from './legend';\nexport * from './title';\nexport * from './indicator';\nexport * from './slider';\nexport * from './link-path';\nexport * from './player';\nexport * from './brush';\nexport * from './tooltip';\nexport * from './timeline';\nexport * from './interface';\nexport * from './jsx';\nexport * from './checkbox';\nexport * from './radio';\nexport * from './empty-tip';\nexport * from './weather';\nexport * from './util';\nexport * from './switch';\nexport * from './label-item';\n"]}
@@ -3,9 +3,9 @@ import type { ILine, IPolygon } from '@visactor/vrender-core';
3
3
  import type { ArcSegment, Segment } from '../../segment';
4
4
  import type { Tag } from '../../tag';
5
5
  import type { CommonMarkAreaAnimationType, MarkCommonLineAnimationType, MarkPointAnimationType, MarkerAnimationState, MarkerExitAnimation, MarkerUpdateAnimation } from '../type';
6
- export declare function markCommonLineAnimate(line: Segment | ArcSegment, label: Tag, animationconfig: any, state: MarkerAnimationState): void;
7
- export declare function markAreaAnimate(area: IPolygon, label: Tag, animationconfig: any, state: MarkerAnimationState): void;
8
- export declare function markArcAreaAnimate(area: IArc, label: Tag, animationconfig: any, state: MarkerAnimationState): void;
6
+ export declare function markCommonLineAnimate(line: Segment | ArcSegment, label: Tag | Tag[], animationconfig: any, state: MarkerAnimationState): void;
7
+ export declare function markAreaAnimate(area: IPolygon, label: Tag | Tag[], animationconfig: any, state: MarkerAnimationState): void;
8
+ export declare function markArcAreaAnimate(area: IArc, label: Tag | Tag[], animationconfig: any, state: MarkerAnimationState): void;
9
9
  export declare function markPointAnimate(lines: [Segment, ILine], item: Tag | IRichText | ISymbol | IImage, animationconfig: any, state: MarkerAnimationState): void;
10
10
  export declare const DefaultUpdateMarkLineAnimation: MarkerUpdateAnimation<MarkCommonLineAnimationType>;
11
11
  export declare const DefaultUpdateMarkAreaAnimation: MarkerUpdateAnimation<CommonMarkAreaAnimationType>;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/marker/animate/animate.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1F,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,MAAM,UAAU,qBAAqB,CACnC,IAA0B,EAC1B,KAAU,EACV,eAAoB,EACpB,KAA2B;IAE3B,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC;IAChD,IAAI,K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c,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;SACtE;KACF;SAAM,IAAI,KAAK,KAAK,MAAM,EAAE;QAC3B,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;QACzC,YAAY,CAAC,QAAQ,EAAE,cAAc,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;KACvE;AACH,CAAC;AAED,MAAM,CAAC,MAAM,8BAA8B,GAAuD;IAChG,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,GAAG;IACb,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,CAAC;CACF,CAAC;AAET,MAAM,CAAC,MAAM,8BAA8B,GAAuD;IAChG,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,GAAG;IACb,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,CAAC;CACF,CAAC;AAET,MAAM,CAAC,MAAM,+BAA+B,GAAkD;IAC5F,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,GAAG;IACb,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,CAAC;CACF,CAAC;AAET,MAAM,CAAC,MAAM,0BAA0B,GAAwB;IAC7D,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE,GAAG;IACb,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,CAAC;CACT,CAAC","file":"animate.js","sourcesContent":["import type { IRichText, ISymbol, IImage, IArc } from '@visactor/vrender-core';\n// eslint-disable-next-line no-duplicate-imports\nimport type { ILine, IPolygon } from '@visactor/vrender-core';\nimport type { ArcSegment, Segment } from '../../segment';\nimport type { Tag } from '../../tag';\nimport type {\n CommonMarkAreaAnimationType,\n MarkCommonLineAnimationType,\n MarkPointAnimationType,\n MarkerAnimationState,\n MarkerExitAnimation,\n MarkerUpdateAnimation\n} from '../type';\nimport { commonLineClipIn } from './clip-in';\nimport { areaFadeIn, commonLineFadeIn, arcAreaFadeIn, pointFadeIn } from './fade-in';\nimport { areaFadeOut, commonLineFadeOut, arcAreaFadeOut, pointFadeOut } from './fade-out';\nimport { pointCallIn } from './call-in';\n\nexport function markCommonLineAnimate(\n line: Segment | ArcSegment,\n label: Tag,\n animationconfig: any,\n state: MarkerAnimationState\n) {\n const { enter, update, exit } = animationconfig;\n if (state === 'enter') {\n const { type, duration, delay, easing } = enter;\n if (type === 'clipIn') {\n commonLineClipIn(line, label, duration, delay, easing);\n } else if (type === 'fadeIn') {\n commonLineFadeIn(line, label, duration, delay, easing);\n }\n } else if (state === 'update') {\n const { type, duration, delay, easing } = update;\n if (type === 'clipIn') {\n commonLineClipIn(line, label, duration, delay, easing);\n } else if (type === 'fadeIn') {\n commonLineFadeIn(line, label, duration, delay, easing);\n }\n } else if (state === 'exit') {\n const { duration, delay, easing } = exit;\n commonLineFadeOut(line, label, duration, delay, easing);\n }\n}\n\nexport function markAreaAnimate(area: IPolygon, label: Tag, animationconfig: any, state: MarkerAnimationState) {\n const { enter, update, exit } = animationconfig;\n if (state === 'enter') {\n const { type, duration, delay, easing } = enter;\n if (type === 'fadeIn') {\n areaFadeIn(area, label, duration, delay, easing);\n }\n } else if (state === 'update') {\n const { type, duration, delay, easing } = update;\n if (type === 'fadeIn') {\n areaFadeIn(area, label, duration, delay, easing);\n }\n } else if (state === 'exit') {\n const { duration, delay, easing } = exit;\n areaFadeOut(area, label, duration, delay, easing);\n }\n}\n\nexport function markArcAreaAnimate(area: IArc, label: Tag, animationconfig: any, state: MarkerAnimationState) {\n const { enter, update, exit } = animationconfig;\n if (state === 'enter') {\n const { type, duration, delay, easing } = enter;\n if (type === 'fadeIn') {\n arcAreaFadeIn(area, label, duration, delay, easing);\n }\n } else if (state === 'update') {\n const { type, duration, delay, easing } = update;\n if (type === 'fadeIn') {\n arcAreaFadeIn(area, label, duration, delay, easing);\n }\n } else if (state === 'exit') {\n const { duration, delay, easing } = exit;\n arcAreaFadeOut(area, label, duration, delay, easing);\n }\n}\n\nexport function markPointAnimate(\n lines: [Segment, ILine],\n item: Tag | IRichText | ISymbol | IImage,\n animationconfig: any,\n state: MarkerAnimationState\n) {\n const [itemLine, decorativeLine] = lines;\n const { enter, update, exit } = animationconfig;\n if (state === 'enter') {\n const { type, duration, delay, easing } = enter;\n if (type === 'fadeIn') {\n pointFadeIn(itemLine, decorativeLine, item, duration, delay, easing);\n } else if (type === 'callIn') {\n pointCallIn(itemLine, decorativeLine, item, duration, delay, easing);\n }\n } else if (state === 'update') {\n const { type, duration, delay, easing } = update;\n if (type === 'fadeIn') {\n pointFadeIn(itemLine, decorativeLine, item, duration, delay, easing);\n } else if (type === 'callIn') {\n pointCallIn(itemLine, decorativeLine, item, duration, delay, easing);\n }\n } else if (state === 'exit') {\n const { duration, delay, easing } = exit;\n pointFadeOut(itemLine, decorativeLine, item, duration, delay, easing);\n }\n}\n\nexport const DefaultUpdateMarkLineAnimation: MarkerUpdateAnimation<MarkCommonLineAnimationType> = {\n type: 'clipIn',\n duration: 500,\n easing: 'linear',\n delay: 0\n} as any;\n\nexport const DefaultUpdateMarkAreaAnimation: MarkerUpdateAnimation<CommonMarkAreaAnimationType> = {\n type: 'fadeIn',\n duration: 500,\n easing: 'linear',\n delay: 0\n} as any;\n\nexport const DefaultUpdateMarkPointAnimation: MarkerUpdateAnimation<MarkPointAnimationType> = {\n type: 'callIn',\n duration: 500,\n easing: 'linear',\n delay: 0\n} as any;\n\nexport const DefaultExitMarkerAnimation: MarkerExitAnimation = {\n type: 'fadeOut',\n duration: 500,\n easing: 'linear',\n delay: 0\n};\n"]}
1
+ {"version":3,"sources":["../src/marker/animate/animate.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,cAAc,EAAE,YAA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AM,EAAE,GAAG,MAAM,CAAC;QACjD,IAAI,IAAI,KAAK,QAAQ,EAAE;YACrB,WAAW,CAAC,QAAQ,EAAE,cAAc,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;SACtE;aAAM,IAAI,IAAI,KAAK,QAAQ,EAAE;YAC5B,WAAW,CAAC,QAAQ,EAAE,cAAc,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;SACtE;KACF;SAAM,IAAI,KAAK,KAAK,MAAM,EAAE;QAC3B,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;QACzC,YAAY,CAAC,QAAQ,EAAE,cAAc,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;KACvE;AACH,CAAC;AAED,MAAM,CAAC,MAAM,8BAA8B,GAAuD;IAChG,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,GAAG;IACb,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,CAAC;CACF,CAAC;AAET,MAAM,CAAC,MAAM,8BAA8B,GAAuD;IAChG,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,GAAG;IACb,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,CAAC;CACF,CAAC;AAET,MAAM,CAAC,MAAM,+BAA+B,GAAkD;IAC5F,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,GAAG;IACb,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,CAAC;CACF,CAAC;AAET,MAAM,CAAC,MAAM,0BAA0B,GAAwB;IAC7D,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE,GAAG;IACb,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,CAAC;CACT,CAAC","file":"animate.js","sourcesContent":["import type { IRichText, ISymbol, IImage, IArc } from '@visactor/vrender-core';\n// eslint-disable-next-line no-duplicate-imports\nimport type { ILine, IPolygon } from '@visactor/vrender-core';\nimport type { ArcSegment, Segment } from '../../segment';\nimport type { Tag } from '../../tag';\nimport type {\n CommonMarkAreaAnimationType,\n MarkCommonLineAnimationType,\n MarkPointAnimationType,\n MarkerAnimationState,\n MarkerExitAnimation,\n MarkerUpdateAnimation\n} from '../type';\nimport { commonLineClipIn } from './clip-in';\nimport { areaFadeIn, commonLineFadeIn, arcAreaFadeIn, pointFadeIn } from './fade-in';\nimport { areaFadeOut, commonLineFadeOut, arcAreaFadeOut, pointFadeOut } from './fade-out';\nimport { pointCallIn } from './call-in';\n\nexport function markCommonLineAnimate(\n line: Segment | ArcSegment,\n label: Tag | Tag[],\n animationconfig: any,\n state: MarkerAnimationState\n) {\n const { enter, update, exit } = animationconfig;\n if (state === 'enter') {\n const { type, duration, delay, easing } = enter;\n if (type === 'clipIn') {\n commonLineClipIn(line, label, duration, delay, easing);\n } else if (type === 'fadeIn') {\n commonLineFadeIn(line, label, duration, delay, easing);\n }\n } else if (state === 'update') {\n const { type, duration, delay, easing } = update;\n if (type === 'clipIn') {\n commonLineClipIn(line, label, duration, delay, easing);\n } else if (type === 'fadeIn') {\n commonLineFadeIn(line, label, duration, delay, easing);\n }\n } else if (state === 'exit') {\n const { duration, delay, easing } = exit;\n commonLineFadeOut(line, label, duration, delay, easing);\n }\n}\n\nexport function markAreaAnimate(area: IPolygon, label: Tag | Tag[], animationconfig: any, state: MarkerAnimationState) {\n const { enter, update, exit } = animationconfig;\n if (state === 'enter') {\n const { type, duration, delay, easing } = enter;\n if (type === 'fadeIn') {\n areaFadeIn(area, label, duration, delay, easing);\n }\n } else if (state === 'update') {\n const { type, duration, delay, easing } = update;\n if (type === 'fadeIn') {\n areaFadeIn(area, label, duration, delay, easing);\n }\n } else if (state === 'exit') {\n const { duration, delay, easing } = exit;\n areaFadeOut(area, label, duration, delay, easing);\n }\n}\n\nexport function markArcAreaAnimate(area: IArc, label: Tag | Tag[], animationconfig: any, state: MarkerAnimationState) {\n const { enter, update, exit } = animationconfig;\n if (state === 'enter') {\n const { type, duration, delay, easing } = enter;\n if (type === 'fadeIn') {\n arcAreaFadeIn(area, label, duration, delay, easing);\n }\n } else if (state === 'update') {\n const { type, duration, delay, easing } = update;\n if (type === 'fadeIn') {\n arcAreaFadeIn(area, label, duration, delay, easing);\n }\n } else if (state === 'exit') {\n const { duration, delay, easing } = exit;\n arcAreaFadeOut(area, label, duration, delay, easing);\n }\n}\n\nexport function markPointAnimate(\n lines: [Segment, ILine],\n item: Tag | IRichText | ISymbol | IImage,\n animationconfig: any,\n state: MarkerAnimationState\n) {\n const [itemLine, decorativeLine] = lines;\n const { enter, update, exit } = animationconfig;\n if (state === 'enter') {\n const { type, duration, delay, easing } = enter;\n if (type === 'fadeIn') {\n pointFadeIn(itemLine, decorativeLine, item, duration, delay, easing);\n } else if (type === 'callIn') {\n pointCallIn(itemLine, decorativeLine, item, duration, delay, easing);\n }\n } else if (state === 'update') {\n const { type, duration, delay, easing } = update;\n if (type === 'fadeIn') {\n pointFadeIn(itemLine, decorativeLine, item, duration, delay, easing);\n } else if (type === 'callIn') {\n pointCallIn(itemLine, decorativeLine, item, duration, delay, easing);\n }\n } else if (state === 'exit') {\n const { duration, delay, easing } = exit;\n pointFadeOut(itemLine, decorativeLine, item, duration, delay, easing);\n }\n}\n\nexport const DefaultUpdateMarkLineAnimation: MarkerUpdateAnimation<MarkCommonLineAnimationType> = {\n type: 'clipIn',\n duration: 500,\n easing: 'linear',\n delay: 0\n} as any;\n\nexport const DefaultUpdateMarkAreaAnimation: MarkerUpdateAnimation<CommonMarkAreaAnimationType> = {\n type: 'fadeIn',\n duration: 500,\n easing: 'linear',\n delay: 0\n} as any;\n\nexport const DefaultUpdateMarkPointAnimation: MarkerUpdateAnimation<MarkPointAnimationType> = {\n type: 'callIn',\n duration: 500,\n easing: 'linear',\n delay: 0\n} as any;\n\nexport const DefaultExitMarkerAnimation: MarkerExitAnimation = {\n type: 'fadeOut',\n duration: 500,\n easing: 'linear',\n delay: 0\n};\n"]}
@@ -1,4 +1,4 @@
1
1
  import type { EasingType } from '@visactor/vrender-core';
2
2
  import type { ArcSegment, Segment } from '../../segment';
3
3
  import type { Tag } from '../../tag';
4
- export declare function commonLineClipIn(line: Segment | ArcSegment, label: Tag, duration: number, delay: number, easing: EasingType): void;
4
+ export declare function commonLineClipIn(line: Segment | ArcSegment, label: Tag | Tag[], duration: number, delay: number, easing: EasingType): void;
@@ -1,5 +1,7 @@
1
1
  import { graphicFadeIn } from "./common";
2
2
 
3
+ import { array } from "@visactor/vutils";
4
+
3
5
  export function commonLineClipIn(line, label, duration, delay, easing) {
4
6
  const startSymbolDuration = .1 * duration, lineDuration = .7 * duration, endSymbolDuration = .1 * duration, labelDuration = .1 * duration;
5
7
  graphicFadeIn(line.startSymbol, delay, startSymbolDuration, easing), line.lines.forEach((line => line.setAttribute("clipRange", 0))),
@@ -9,7 +11,9 @@ export function commonLineClipIn(line, label, duration, delay, easing) {
9
11
  clipRange: 1
10
12
  }, stepDuration, easing);
11
13
  })), graphicFadeIn(line.endSymbol, delay + startSymbolDuration + lineDuration, endSymbolDuration, easing),
12
- graphicFadeIn(label.getTextShape(), delay + startSymbolDuration + lineDuration + endSymbolDuration, labelDuration, easing),
13
- graphicFadeIn(label.getBgRect(), delay + startSymbolDuration + lineDuration + endSymbolDuration, labelDuration, easing);
14
+ array(label).forEach((labelNode => {
15
+ const delayTime = delay + startSymbolDuration + lineDuration + endSymbolDuration;
16
+ graphicFadeIn(labelNode.getTextShape(), delayTime, labelDuration, easing), graphicFadeIn(labelNode.getBgRect(), delayTime, labelDuration, easing);
17
+ }));
14
18
  }
15
19
  //# sourceMappingURL=clip-in.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/marker/animate/clip-in.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,UAAU,gBAAgB,CAC9B,IAA0B,EAC1B,KAAU,EACV,QAAgB,EAChB,KAAa,E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ment, Segment } from '../../segment';\nimport type { Tag } from '../../tag';\nimport { graphicFadeIn } from './common';\n\nexport function commonLineClipIn(\n line: Segment | ArcSegment,\n label: Tag,\n duration: number,\n delay: number,\n easing: EasingType\n) {\n const startSymbolDuration = 0.1 * duration;\n const lineDuration = 0.7 * duration;\n const endSymbolDuration = 0.1 * duration;\n const labelDuration = 0.1 * duration;\n\n // start symbol\n graphicFadeIn(line.startSymbol, delay, startSymbolDuration, easing);\n\n // line\n line.lines.forEach(line => line.setAttribute('clipRange', 0));\n line.lines.forEach((l, index) => {\n const stepDuration = lineDuration / line.lines.length;\n l.animate()\n .wait(delay + startSymbolDuration + index * stepDuration)\n .to({ clipRange: 1 }, stepDuration, easing);\n });\n\n // end symbol\n graphicFadeIn(line.endSymbol, delay + startSymbolDuration + lineDuration, endSymbolDuration, easing);\n\n // text\n graphicFadeIn(\n label.getTextShape(),\n delay + startSymbolDuration + lineDuration + endSymbolDuration,\n labelDuration,\n easing\n );\n\n // text background\n graphicFadeIn(\n label.getBgRect(),\n delay + startSymbolDuration + lineDuration + endSymbolDuration,\n labelDuration,\n easing\n );\n}\n"]}
1
+ {"version":3,"sources":["../src/marker/animate/clip-in.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,MAAM,UAAU,gBAAgB,CAC9B,IAA0B,EAC1B,KAAkB,EAClB,QAAgB,EAChB,KAAa,EACb,MAAkB;IAElB,MAAM,mBAAmB,GAAG,GAAG,GAAG,QAAQ,CAAC;IAC3C,MAAM,YAAY,GAAG,GAAG,GAAG,QAAQ,CAAC;IACpC,MAAM,iBAAiB,GAAG,GAAG,GAAG,QAAQ,CAAC;IACzC,MAAM,aAAa,GAAG,GAAG,GAAG,QAAQ,CAAC;IAGrC,aAAa,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,mBAAmB,EAAE,MAAM,CAAC,CAAC;IAGpE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC;IAC9D,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE;QAC9B,MAAM,YAAY,GAAG,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;QACtD,CAAC,CAAC,OAAO,EAAE;aACR,IAAI,CAAC,KAAK,GAAG,mBAAmB,GAAG,KAAK,GAAG,YAAY,CAAC;aACxD,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;IAGH,aAAa,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,GAAG,mBAAmB,GAAG,YAAY,EAAE,iBAAiB,EAAE,MAAM,CAAC,CAAC;IAGrG,KAAK,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE;QAC/B,MAAM,SAAS,GAAG,KAAK,GAAG,mBAAmB,GAAG,YAAY,GAAG,iBAAiB,CAAC;QAEjF,aAAa,CAAC,SAAS,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC;QAG1E,aAAa,CAAC,SAAS,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC;IACzE,CAAC,CAAC,CAAC;AACL,CAAC","file":"clip-in.js","sourcesContent":["import type { EasingType } from '@visactor/vrender-core';\nimport type { ArcSegment, Segment } from '../../segment';\nimport type { Tag } from '../../tag';\nimport { graphicFadeIn } from './common';\nimport { array } from '@visactor/vutils';\n\nexport function commonLineClipIn(\n line: Segment | ArcSegment,\n label: Tag | Tag[],\n duration: number,\n delay: number,\n easing: EasingType\n) {\n const startSymbolDuration = 0.1 * duration;\n const lineDuration = 0.7 * duration;\n const endSymbolDuration = 0.1 * duration;\n const labelDuration = 0.1 * duration;\n\n // start symbol\n graphicFadeIn(line.startSymbol, delay, startSymbolDuration, easing);\n\n // line\n line.lines.forEach(line => line.setAttribute('clipRange', 0));\n line.lines.forEach((l, index) => {\n const stepDuration = lineDuration / line.lines.length;\n l.animate()\n .wait(delay + startSymbolDuration + index * stepDuration)\n .to({ clipRange: 1 }, stepDuration, easing);\n });\n\n // end symbol\n graphicFadeIn(line.endSymbol, delay + startSymbolDuration + lineDuration, endSymbolDuration, easing);\n\n // label\n array(label).forEach(labelNode => {\n const delayTime = delay + startSymbolDuration + lineDuration + endSymbolDuration;\n // text\n graphicFadeIn(labelNode.getTextShape(), delayTime, labelDuration, easing);\n\n // text background\n graphicFadeIn(labelNode.getBgRect(), delayTime, labelDuration, easing);\n });\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  import type { EasingType, IArc, IImage, ILine, IPolygon, IRichText, ISymbol } from '@visactor/vrender-core';
2
2
  import type { ArcSegment, Segment } from '../../segment';
3
3
  import type { Tag } from '../../tag';
4
- export declare function commonLineFadeIn(line: Segment | ArcSegment, label: Tag, duration: number, delay: number, easing: EasingType): void;
5
- export declare function areaFadeIn(area: IPolygon, label: Tag, duration: number, delay: number, easing: EasingType): void;
6
- export declare function arcAreaFadeIn(area: IArc, label: Tag, duration: number, delay: number, easing: EasingType): void;
4
+ export declare function commonLineFadeIn(line: Segment | ArcSegment, label: Tag | Tag[], duration: number, delay: number, easing: EasingType): void;
5
+ export declare function areaFadeIn(area: IPolygon, label: Tag | Tag[], duration: number, delay: number, easing: EasingType): void;
6
+ export declare function arcAreaFadeIn(area: IArc, label: Tag | Tag[], duration: number, delay: number, easing: EasingType): void;
7
7
  export declare function pointFadeIn(itemLine: Segment, decorativeLine: ILine, item: Tag | IRichText | ISymbol | IImage, duration: number, delay: number, easing: EasingType): void;
@@ -1,15 +1,23 @@
1
1
  import { graphicFadeIn, segmentFadeIn, tagFadeIn } from "./common";
2
2
 
3
+ import { array } from "@visactor/vutils";
4
+
3
5
  export function commonLineFadeIn(line, label, duration, delay, easing) {
4
- segmentFadeIn(line, delay, duration, easing), tagFadeIn(label, delay, duration, easing);
6
+ segmentFadeIn(line, delay, duration, easing), array(label).forEach((labelNode => {
7
+ tagFadeIn(labelNode, delay, duration, easing);
8
+ }));
5
9
  }
6
10
 
7
11
  export function areaFadeIn(area, label, duration, delay, easing) {
8
- graphicFadeIn(area, delay, duration, easing), tagFadeIn(label, delay, duration, easing);
12
+ graphicFadeIn(area, delay, duration, easing), array(label).forEach((labelNode => {
13
+ tagFadeIn(labelNode, delay, duration, easing);
14
+ }));
9
15
  }
10
16
 
11
17
  export function arcAreaFadeIn(area, label, duration, delay, easing) {
12
- graphicFadeIn(area, delay, duration, easing), tagFadeIn(label, delay, duration, easing);
18
+ graphicFadeIn(area, delay, duration, easing), array(label).forEach((labelNode => {
19
+ tagFadeIn(labelNode, delay, duration, easing);
20
+ }));
13
21
  }
14
22
 
15
23
  export function pointFadeIn(itemLine, decorativeLine, item, duration, delay, easing) {