@visactor/vrender-components 1.1.0-alpha.20 → 1.1.0-alpha.21

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.
package/dist/index.es.js CHANGED
@@ -6138,10 +6138,18 @@ class Graphic extends Node {
6138
6138
  setAttributesAndPreventAnimate(params, forceUpdateTag = !1, context, ignorePriority) {
6139
6139
  if (!params) return;
6140
6140
  const keys = Object.keys(params);
6141
- this.captureTransientFromAttrsBeforePreventAnimate(params, keys, context), this.visitTrackedAnimates(animate => {
6141
+ this.captureTransientFromAttrsBeforePreventAnimate(params, keys, context), this.syncFinalAttributesFromUpdateContext(context), this.visitTrackedAnimates(animate => {
6142
6142
  (animate.priority !== 1 / 0 || ignorePriority) && animate.preventAttrs(keys);
6143
6143
  }), this.applyTransientAttributes(params, forceUpdateTag, context);
6144
6144
  }
6145
+ syncFinalAttributesFromUpdateContext(context) {
6146
+ var _a;
6147
+ const updateType = null == context ? void 0 : context.type;
6148
+ if (updateType === AttributeUpdateType.STATE || null != updateType && updateType >= AttributeUpdateType.ANIMATE_BIND && updateType <= AttributeUpdateType.ANIMATE_END) return;
6149
+ const finalAttrs = null === (_a = this.context) || void 0 === _a ? void 0 : _a.finalAttrs,
6150
+ setFinalAttributes = this.setFinalAttributes;
6151
+ finalAttrs && "function" == typeof setFinalAttributes && setFinalAttributes.call(this, finalAttrs);
6152
+ }
6145
6153
  captureTransientFromAttrsBeforePreventAnimate(params, keys, context) {
6146
6154
  var _a, _b;
6147
6155
  const graphicContext = this.context,
@@ -20955,7 +20963,7 @@ class AnimateExecutor {
20955
20963
  AnimateExecutor.builtInAnimateMap[name] = animate;
20956
20964
  }
20957
20965
  constructor(target) {
20958
- this._animates = [], this._startCallbacks = [], this._endCallbacks = [], this._started = !1, this._activeCount = 0, this._target = target;
20966
+ this._animates = [], this._startCallbacks = [], this._endCallbacks = [], this._started = !1, this._activeCount = 0, this._activeConfigList = null, this._target = target;
20959
20967
  }
20960
20968
  get started() {
20961
20969
  return this._started;
@@ -21064,7 +21072,15 @@ class AnimateExecutor {
21064
21072
  return parsedParams;
21065
21073
  }
21066
21074
  execute(params) {
21067
- Array.isArray(params) ? params.forEach(param => this._execute(param)) : this._execute(params);
21075
+ if (Array.isArray(params)) {
21076
+ const prevConfigList = this._activeConfigList;
21077
+ this._activeConfigList = params;
21078
+ try {
21079
+ params.forEach(param => this._execute(param));
21080
+ } finally {
21081
+ this._activeConfigList = prevConfigList;
21082
+ }
21083
+ } else this._execute(params);
21068
21084
  }
21069
21085
  _execute(params) {
21070
21086
  if (params.selfOnly) return this._executeItem(params, this._target, 0, 1);
@@ -21090,6 +21106,7 @@ class AnimateExecutor {
21090
21106
  }
21091
21107
  executeTypeConfigItem(params, graphic, index, count) {
21092
21108
  var _a, _b, _c, _d, _e, _f, _g, _h;
21109
+ this.syncFinalAttrsFromContext(graphic);
21093
21110
  const {
21094
21111
  type = "fromTo",
21095
21112
  channel: channel,
@@ -21120,7 +21137,7 @@ class AnimateExecutor {
21120
21137
  props = params.to,
21121
21138
  from = params.from;
21122
21139
  const commitAttrOutChannel = this.shouldCommitAttrOutChannel(type);
21123
- props || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic, commitAttrOutChannel)), props = parsedFromProps.props), from || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic, commitAttrOutChannel)), from = parsedFromProps.from), parsedFromProps.attrOutChannel && graphic.setAttributes(parsedFromProps.attrOutChannel), this._handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic);
21140
+ props || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic, commitAttrOutChannel, this.getAttrOutChannelExcludedKeys(graphic))), props = parsedFromProps.props), from || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic, commitAttrOutChannel, this.getAttrOutChannelExcludedKeys(graphic))), from = parsedFromProps.from), parsedFromProps.attrOutChannel && graphic.setAttributes(parsedFromProps.attrOutChannel), this._handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic);
21124
21141
  let totalDelay = 0;
21125
21142
  oneByOneDelay && (totalDelay = oneByOneDelay * (count - index - 1));
21126
21143
  const delayAfterValue = isFunction(delayAfter) ? delayAfter(null === (_h = null === (_g = graphic.context) || void 0 === _g ? void 0 : _g.data) || void 0 === _h ? void 0 : _h[0], graphic, {}) : delayAfter;
@@ -21142,6 +21159,7 @@ class AnimateExecutor {
21142
21159
  }
21143
21160
  executeTimelineItem(params, graphic, index, count) {
21144
21161
  var _a, _b, _c, _d;
21162
+ this.syncFinalAttrsFromContext(graphic);
21145
21163
  const {
21146
21164
  timeSlices: timeSlices,
21147
21165
  startTime = 0,
@@ -21184,7 +21202,7 @@ class AnimateExecutor {
21184
21202
  props = effect.to,
21185
21203
  from = effect.from;
21186
21204
  const commitAttrOutChannel = this.shouldCommitAttrOutChannel(type);
21187
- props || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic, commitAttrOutChannel)), props = parsedFromProps.props), from || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic, commitAttrOutChannel)), from = parsedFromProps.from), parsedFromProps.attrOutChannel && graphic.setAttributes(parsedFromProps.attrOutChannel);
21205
+ props || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic, commitAttrOutChannel, this.getAttrOutChannelExcludedKeys(graphic))), props = parsedFromProps.props), from || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic, commitAttrOutChannel, this.getAttrOutChannelExcludedKeys(graphic))), from = parsedFromProps.from), parsedFromProps.attrOutChannel && graphic.setAttributes(parsedFromProps.attrOutChannel);
21188
21206
  const custom = null !== (_a = effect.custom) && void 0 !== _a ? _a : AnimateExecutor.builtInAnimateMap[type],
21189
21207
  customType = effect.custom ? effect.customType : getCustomType(custom);
21190
21208
  this._handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic);
@@ -21205,7 +21223,7 @@ class AnimateExecutor {
21205
21223
  const customAnimate = new CustomAnimateConstructor(from, props, duration, easing, customParams);
21206
21224
  animate.play(customAnimate);
21207
21225
  }
21208
- createPropsFromChannel(channel, graphic, includeAttrOutChannel = !0) {
21226
+ createPropsFromChannel(channel, graphic, includeAttrOutChannel = !0, excludedAttrOutKeys) {
21209
21227
  var _a;
21210
21228
  const props = {};
21211
21229
  let from = null;
@@ -21226,7 +21244,7 @@ class AnimateExecutor {
21226
21244
  }), diffAttrs && attrOutChannel) for (const key in diffAttrs) {
21227
21245
  const value = diffAttrs[key];
21228
21246
  if (void 0 === value) continue;
21229
- props.hasOwnProperty(key) || !!(null == from ? void 0 : from.hasOwnProperty(key)) || (attrOutChannel[key] = value, hasAttrs = !0);
21247
+ props.hasOwnProperty(key) || !!(null == from ? void 0 : from.hasOwnProperty(key)) || (null == excludedAttrOutKeys ? void 0 : excludedAttrOutKeys[key]) || (attrOutChannel[key] = value, hasAttrs = !0);
21230
21248
  }
21231
21249
  return {
21232
21250
  from: from,
@@ -21238,8 +21256,78 @@ class AnimateExecutor {
21238
21256
  var _a, _b;
21239
21257
  return void 0 === value ? defaultValue : "function" == typeof value && graphic ? value(null === (_b = null === (_a = graphic.context) || void 0 === _a ? void 0 : _a.data) || void 0 === _b ? void 0 : _b[0], graphic, {}) : value;
21240
21258
  }
21259
+ getAttrOutChannelExcludedKeys(graphic) {
21260
+ var _a;
21261
+ const configList = this._activeConfigList,
21262
+ diffAttrs = null === (_a = graphic.context) || void 0 === _a ? void 0 : _a.diffAttrs;
21263
+ if (!configList || configList.length <= 1 || !diffAttrs) return null;
21264
+ let excludedKeys = null;
21265
+ for (let i = 0; i < configList.length; i++) excludedKeys = this.collectAnimatedDiffKeys(configList[i], graphic, diffAttrs, excludedKeys);
21266
+ return excludedKeys;
21267
+ }
21268
+ collectAnimatedDiffKeys(config, graphic, diffAttrs, keys) {
21269
+ if ("timeSlices" in config) {
21270
+ const slices = Array.isArray(config.timeSlices) ? config.timeSlices : [config.timeSlices];
21271
+ for (let i = 0; i < slices.length; i++) {
21272
+ const effects = Array.isArray(slices[i].effects) ? slices[i].effects : [slices[i].effects];
21273
+ for (let j = 0; j < effects.length; j++) keys = this.collectAnimatedDiffKeysFromEffect(effects[j], graphic, diffAttrs, keys);
21274
+ }
21275
+ return keys;
21276
+ }
21277
+ return this.collectAnimatedDiffKeysFromEffect(config, graphic, diffAttrs, keys);
21278
+ }
21279
+ collectAnimatedDiffKeysFromEffect(effect, graphic, diffAttrs, keys) {
21280
+ var _a;
21281
+ if ("update" === (null !== (_a = effect.type) && void 0 !== _a ? _a : "fromTo")) {
21282
+ const options = this.resolveValue(effect.options, graphic, void 0),
21283
+ excludeChannels = null == options ? void 0 : options.excludeChannels;
21284
+ for (const key in diffAttrs) Object.prototype.hasOwnProperty.call(diffAttrs, key) && void 0 !== diffAttrs[key] && !this.includesChannel(excludeChannels, key) && (null != keys || (keys = {}), keys[key] = !0);
21285
+ return keys;
21286
+ }
21287
+ return keys = this.collectExplicitAnimatedKeys(effect.to, diffAttrs, keys), keys = this.collectExplicitAnimatedKeys(effect.from, diffAttrs, keys), this.collectChannelAnimatedKeys(effect.channel, diffAttrs, keys);
21288
+ }
21289
+ collectExplicitAnimatedKeys(attrs, diffAttrs, keys) {
21290
+ if (!attrs) return keys;
21291
+ for (const key in attrs) Object.prototype.hasOwnProperty.call(attrs, key) && Object.prototype.hasOwnProperty.call(diffAttrs, key) && void 0 !== diffAttrs[key] && (null != keys || (keys = {}), keys[key] = !0);
21292
+ return keys;
21293
+ }
21294
+ collectChannelAnimatedKeys(channel, diffAttrs, keys) {
21295
+ if (!channel) return keys;
21296
+ if (Array.isArray(channel)) {
21297
+ for (let i = 0; i < channel.length; i++) {
21298
+ const key = channel[i];
21299
+ Object.prototype.hasOwnProperty.call(diffAttrs, key) && void 0 !== diffAttrs[key] && (null != keys || (keys = {}), keys[key] = !0);
21300
+ }
21301
+ return keys;
21302
+ }
21303
+ for (const key in channel) if (Object.prototype.hasOwnProperty.call(channel, key) && Object.prototype.hasOwnProperty.call(diffAttrs, key) && void 0 !== diffAttrs[key]) {
21304
+ const config = channel[key];
21305
+ void 0 === config.to && void 0 === config.from || (null != keys || (keys = {}), keys[key] = !0);
21306
+ }
21307
+ return keys;
21308
+ }
21309
+ includesChannel(channels, key) {
21310
+ if (!(null == channels ? void 0 : channels.length)) return !1;
21311
+ for (let i = 0; i < channels.length; i++) if (channels[i] === key) return !0;
21312
+ return !1;
21313
+ }
21314
+ syncFinalAttrsFromContext(graphic) {
21315
+ var _a;
21316
+ const finalAttrs = null === (_a = graphic.context) || void 0 === _a ? void 0 : _a.finalAttrs,
21317
+ setFinalAttributes = graphic.setFinalAttributes;
21318
+ finalAttrs && "function" == typeof setFinalAttributes && setFinalAttributes.call(graphic, finalAttrs);
21319
+ }
21241
21320
  executeItem(params, graphic, index = 0, count = 1) {
21242
- return Array.isArray(params) ? params.map(param => this._executeItem(param, graphic, index, count)).filter(Boolean) : [this._executeItem(params, graphic, index, count)].filter(Boolean);
21321
+ if (Array.isArray(params)) {
21322
+ const prevConfigList = this._activeConfigList;
21323
+ this._activeConfigList = params;
21324
+ try {
21325
+ return params.map(param => this._executeItem(param, graphic, index, count)).filter(Boolean);
21326
+ } finally {
21327
+ this._activeConfigList = prevConfigList;
21328
+ }
21329
+ }
21330
+ return [this._executeItem(params, graphic, index, count)].filter(Boolean);
21243
21331
  }
21244
21332
  _executeItem(params, graphic, index = 0, count = 1) {
21245
21333
  if (!graphic) return null;
@@ -21533,9 +21621,7 @@ class AnimateExtension {
21533
21621
  return this.initAnimateExecutor(), this._animateExecutor.execute(config), this;
21534
21622
  }
21535
21623
  executeAnimations(configs) {
21536
- return this.initAnimateExecutor(), configs.forEach(config => {
21537
- this._animateExecutor.execute(config);
21538
- }), this;
21624
+ return this.initAnimateExecutor(), this._animateExecutor.execute(configs), this;
21539
21625
  }
21540
21626
  getFinalAttribute() {
21541
21627
  return this.finalAttribute;
@@ -24444,8 +24530,9 @@ class LabelBase extends AnimateComponent {
24444
24530
  }, attrs, new CustomPath2D());
24445
24531
  };
24446
24532
  }
24447
- if (baseMark && baseMark.getAttributes(true).fill) {
24448
- lineGraphic.setAttribute('stroke', baseMark.getAttributes(true).fill);
24533
+ const baseMarkAttrs = baseMark && this.getGraphicFinalLayoutAttributes(baseMark);
24534
+ if (baseMarkAttrs === null || baseMarkAttrs === void 0 ? void 0 : baseMarkAttrs.fill) {
24535
+ lineGraphic.setAttribute('stroke', baseMarkAttrs.fill);
24449
24536
  }
24450
24537
  if (this.attribute.line && !isEmpty(this.attribute.line.style)) {
24451
24538
  lineGraphic.setAttributes(this.attribute.line.style);
@@ -24548,7 +24635,7 @@ class LabelBase extends AnimateComponent {
24548
24635
  if (this._enableAnimation !== false) {
24549
24636
  this._baseMarks.forEach(mark => {
24550
24637
  markAttributeList.push(cloneAttributeSnapshot(mark.attribute));
24551
- mark.initAttributes(mark.getAttributes(true));
24638
+ mark.initAttributes(this.getGraphicFinalLayoutAttributes(mark));
24552
24639
  });
24553
24640
  }
24554
24641
  const { overlap, smartInvert, dataFilter, customLayoutFunc, customOverlapFunc } = this.attribute;
@@ -24717,6 +24804,14 @@ class LabelBase extends AnimateComponent {
24717
24804
  getRelatedGraphic(item) {
24718
24805
  return this._idToGraphic.get(item.id);
24719
24806
  }
24807
+ getGraphicFinalLayoutAttributes(graphic) {
24808
+ var _a, _b;
24809
+ return ((_b = (_a = graphic.context) === null || _a === void 0 ? void 0 : _a.finalAttrs) !== null && _b !== void 0 ? _b : graphic.getAttributes(true));
24810
+ }
24811
+ hasGraphicContextFinalLayoutAttributes(graphic) {
24812
+ var _a;
24813
+ return !!((_a = graphic === null || graphic === void 0 ? void 0 : graphic.context) === null || _a === void 0 ? void 0 : _a.finalAttrs);
24814
+ }
24720
24815
  _initText(data = []) {
24721
24816
  const { textStyle = {} } = this.attribute;
24722
24817
  const labels = [];
@@ -24726,7 +24821,7 @@ class LabelBase extends AnimateComponent {
24726
24821
  if (!baseMark) {
24727
24822
  continue;
24728
24823
  }
24729
- const graphicAttribute = baseMark.getAttributes(true);
24824
+ const graphicAttribute = this.getGraphicFinalLayoutAttributes(baseMark);
24730
24825
  const labelAttribute = Object.assign(Object.assign({ fill: this._isCollectionBase
24731
24826
  ? isArray(graphicAttribute.stroke)
24732
24827
  ? graphicAttribute.stroke.find(entry => !!entry && entry !== true)
@@ -24978,9 +25073,9 @@ class LabelBase extends AnimateComponent {
24978
25073
  var _a;
24979
25074
  if (graphic) {
24980
25075
  if (graphic.attribute.visible !== false) {
24981
- if ((_a = graphic.context) === null || _a === void 0 ? void 0 : _a.animationState) {
25076
+ if (((_a = graphic.context) === null || _a === void 0 ? void 0 : _a.animationState) || this.hasGraphicContextFinalLayoutAttributes(graphic)) {
24982
25077
  const clonedGraphic = graphic.clone();
24983
- Object.assign(clonedGraphic.attribute, graphic.getAttributes(true));
25078
+ Object.assign(clonedGraphic.attribute, this.getGraphicFinalLayoutAttributes(graphic));
24984
25079
  return clonedGraphic.AABBBounds;
24985
25080
  }
24986
25081
  return graphic.AABBBounds;
@@ -25169,8 +25264,9 @@ class LabelBase extends AnimateComponent {
25169
25264
  continue;
25170
25265
  }
25171
25266
  const baseMark = this.getRelatedGraphic(label.attribute);
25172
- let backgroundColor = baseMark.getAttributes(true).fill;
25173
- const backgroundOpacity = baseMark.getAttributes(true).fillOpacity;
25267
+ const baseMarkAttrs = this.getGraphicFinalLayoutAttributes(baseMark);
25268
+ let backgroundColor = baseMarkAttrs.fill;
25269
+ const backgroundOpacity = baseMarkAttrs.fillOpacity;
25174
25270
  let foregroundColor = label.attribute.fill;
25175
25271
  if (isObject(backgroundColor) && backgroundColor.gradient) {
25176
25272
  const firstStopColor = (_g = (_f = backgroundColor.stops) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.color;
@@ -25511,15 +25607,16 @@ class ArcLabel extends LabelBase {
25511
25607
  this._arcRight.clear();
25512
25608
  this._ellipsisWidth = ellipsisWidth;
25513
25609
  let maxRadius = 0;
25514
- currentMarks.forEach(currentMarks => {
25515
- if (currentMarks.attribute.outerRadius > maxRadius) {
25516
- maxRadius = currentMarks.attribute.outerRadius;
25610
+ currentMarks.forEach(currentMark => {
25611
+ const graphicAttribute = this.getGraphicFinalLayoutAttributes(currentMark);
25612
+ if (graphicAttribute.outerRadius > maxRadius) {
25613
+ maxRadius = graphicAttribute.outerRadius;
25517
25614
  }
25518
25615
  });
25519
25616
  data.forEach((d, index) => {
25520
25617
  var _a, _b;
25521
25618
  const currentMark = this._idToGraphic.get(d.id);
25522
- const graphicAttribute = currentMark.getAttributes(true);
25619
+ const graphicAttribute = this.getGraphicFinalLayoutAttributes(currentMark);
25523
25620
  const center = { x: (_a = graphicAttribute === null || graphicAttribute === void 0 ? void 0 : graphicAttribute.x) !== null && _a !== void 0 ? _a : 0, y: (_b = graphicAttribute === null || graphicAttribute === void 0 ? void 0 : graphicAttribute.y) !== null && _b !== void 0 ? _b : 0 };
25524
25621
  if (!isNil(data[index]) && !isNil(textBoundsArray[index])) {
25525
25622
  const item = data[index] ? data[index] : null;
@@ -25704,8 +25801,9 @@ class ArcLabel extends LabelBase {
25704
25801
  };
25705
25802
  let maxRadius = 0;
25706
25803
  currentMarks.forEach((currentMark) => {
25707
- if (currentMark.getAttributes(true).outerRadius > maxRadius) {
25708
- maxRadius = currentMark.getAttributes(true).outerRadius;
25804
+ const graphicAttribute = this.getGraphicFinalLayoutAttributes(currentMark);
25805
+ if (graphicAttribute.outerRadius > maxRadius) {
25806
+ maxRadius = graphicAttribute.outerRadius;
25709
25807
  }
25710
25808
  });
25711
25809
  const radiusRatio = this.computeLayoutOuterRadius(maxRadius, attribute.width, attribute.height);
@@ -25938,8 +26036,9 @@ class ArcLabel extends LabelBase {
25938
26036
  const labelConfig = attribute;
25939
26037
  let maxRadius = 0;
25940
26038
  currentMarks.forEach((currentMark) => {
25941
- if (currentMark.getAttributes(true).outerRadius > maxRadius) {
25942
- maxRadius = currentMark.getAttributes(true).outerRadius;
26039
+ const graphicAttribute = this.getGraphicFinalLayoutAttributes(currentMark);
26040
+ if (graphicAttribute.outerRadius > maxRadius) {
26041
+ maxRadius = graphicAttribute.outerRadius;
25943
26042
  }
25944
26043
  });
25945
26044
  const radiusRatio = this.computeLayoutOuterRadius(maxRadius, attribute.width, attribute.height);
@@ -25981,8 +26080,9 @@ class ArcLabel extends LabelBase {
25981
26080
  const plotRect = { width: center.x * 2, height: center.y * 2 };
25982
26081
  let maxRadius = 0;
25983
26082
  currentMarks.forEach((currentMark) => {
25984
- if (currentMark.getAttributes(true).outerRadius > maxRadius) {
25985
- maxRadius = currentMark.getAttributes(true).outerRadius;
26083
+ const graphicAttribute = this.getGraphicFinalLayoutAttributes(currentMark);
26084
+ if (graphicAttribute.outerRadius > maxRadius) {
26085
+ maxRadius = graphicAttribute.outerRadius;
25986
26086
  }
25987
26087
  });
25988
26088
  const radiusRatio = this.computeLayoutOuterRadius(maxRadius, attribute.width, attribute.height);
@@ -26053,8 +26153,9 @@ class ArcLabel extends LabelBase {
26053
26153
  const line1MinLength = labelConfig.line.line1MinLength;
26054
26154
  let maxRadius = 0;
26055
26155
  currentMarks.forEach((currentMark) => {
26056
- if (currentMark.getAttributes(true).outerRadius > maxRadius) {
26057
- maxRadius = currentMark.getAttributes(true).outerRadius;
26156
+ const graphicAttribute = this.getGraphicFinalLayoutAttributes(currentMark);
26157
+ if (graphicAttribute.outerRadius > maxRadius) {
26158
+ maxRadius = graphicAttribute.outerRadius;
26058
26159
  }
26059
26160
  });
26060
26161
  const radiusRatio = this.computeLayoutOuterRadius(maxRadius, attribute.width, attribute.height);
@@ -26142,7 +26243,7 @@ class ArcLabel extends LabelBase {
26142
26243
  });
26143
26244
  }
26144
26245
  if (baseMark.type === 'arc3d' && baseMark) {
26145
- const { beta, x, y } = baseMark.getAttributes(true);
26246
+ const { beta, x, y } = this.getGraphicFinalLayoutAttributes(baseMark);
26146
26247
  lineGraphic.setAttributes({
26147
26248
  beta,
26148
26249
  anchor3d: [x, y]
@@ -36768,6 +36869,6 @@ TableSeriesNumber.defaultAttributes = {
36768
36869
  select: true
36769
36870
  };
36770
36871
 
36771
- const version = "1.1.0-alpha.20";
36872
+ const version = "1.1.0-alpha.21";
36772
36873
 
36773
36874
  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, IDataZoomEvent, IDataZoomInteractiveEvent, 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, SeriesNumberCellStateValue, SeriesNumberEvent, SizeContinuousLegend, Slider, StoryLabelItem, Switch, SymbolLabel, TableSeriesNumber, 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, installPoptipToApp, installScrollbarToApp, 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, setPoptipTheme, smartInvertStrategy, tan2AngleToAngle, textIntersect, ticks, traverseGroup, version };
package/es/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const version = "1.1.0-alpha.20";
1
+ export declare const version = "1.1.0-alpha.21";
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 = "1.1.0-alpha.20";
1
+ export const version = "1.1.0-alpha.21";
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;AAC7B,cAAc,uBAAuB,CAAC","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"1.1.0-alpha.20\";\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';\nexport * from './table-series-number';\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;AAC7B,cAAc,uBAAuB,CAAC","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"1.1.0-alpha.21\";\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';\nexport * from './table-series-number';\n"]}
package/es/label/arc.js CHANGED
@@ -97,11 +97,12 @@ export class ArcLabel extends LabelBase {
97
97
  layoutArcLabels(position, attribute, currentMarks, data, textBoundsArray, ellipsisWidth) {
98
98
  this._arcLeft.clear(), this._arcRight.clear(), this._ellipsisWidth = ellipsisWidth;
99
99
  let maxRadius = 0;
100
- currentMarks.forEach((currentMarks => {
101
- currentMarks.attribute.outerRadius > maxRadius && (maxRadius = currentMarks.attribute.outerRadius);
100
+ currentMarks.forEach((currentMark => {
101
+ const graphicAttribute = this.getGraphicFinalLayoutAttributes(currentMark);
102
+ graphicAttribute.outerRadius > maxRadius && (maxRadius = graphicAttribute.outerRadius);
102
103
  })), data.forEach(((d, index) => {
103
104
  var _a, _b;
104
- const currentMark = this._idToGraphic.get(d.id), graphicAttribute = currentMark.getAttributes(!0), center = {
105
+ const currentMark = this._idToGraphic.get(d.id), graphicAttribute = this.getGraphicFinalLayoutAttributes(currentMark), center = {
105
106
  x: null !== (_a = null == graphicAttribute ? void 0 : graphicAttribute.x) && void 0 !== _a ? _a : 0,
106
107
  y: null !== (_b = null == graphicAttribute ? void 0 : graphicAttribute.y) && void 0 !== _b ? _b : 0
107
108
  };
@@ -212,7 +213,8 @@ export class ArcLabel extends LabelBase {
212
213
  this.attribute.height;
213
214
  let maxRadius = 0;
214
215
  currentMarks.forEach((currentMark => {
215
- currentMark.getAttributes(!0).outerRadius > maxRadius && (maxRadius = currentMark.getAttributes(!0).outerRadius);
216
+ const graphicAttribute = this.getGraphicFinalLayoutAttributes(currentMark);
217
+ graphicAttribute.outerRadius > maxRadius && (maxRadius = graphicAttribute.outerRadius);
216
218
  }));
217
219
  const radiusRatio = this.computeLayoutOuterRadius(maxRadius, attribute.width, attribute.height), line1MinLength = attribute.line.line1MinLength, labelLayoutAlign = null === (_a = attribute.layout) || void 0 === _a ? void 0 : _a.align, spaceWidth = attribute.spaceWidth, {labelPosition: labelPosition, quadrant: quadrant, pointB: pointB} = arc;
218
220
  isValidNumber(pointB.x * pointB.y) || (arc.pointC = {
@@ -343,7 +345,8 @@ export class ArcLabel extends LabelBase {
343
345
  const labelConfig = attribute;
344
346
  let maxRadius = 0;
345
347
  currentMarks.forEach((currentMark => {
346
- currentMark.getAttributes(!0).outerRadius > maxRadius && (maxRadius = currentMark.getAttributes(!0).outerRadius);
348
+ const graphicAttribute = this.getGraphicFinalLayoutAttributes(currentMark);
349
+ graphicAttribute.outerRadius > maxRadius && (maxRadius = graphicAttribute.outerRadius);
347
350
  }));
348
351
  const radiusRatio = this.computeLayoutOuterRadius(maxRadius, attribute.width, attribute.height), line1MinLength = labelConfig.line.line1MinLength;
349
352
  if ("none" === labelConfig.layout.strategy) arc.pointB = {
@@ -370,7 +373,8 @@ export class ArcLabel extends LabelBase {
370
373
  };
371
374
  let maxRadius = 0;
372
375
  currentMarks.forEach((currentMark => {
373
- currentMark.getAttributes(!0).outerRadius > maxRadius && (maxRadius = currentMark.getAttributes(!0).outerRadius);
376
+ const graphicAttribute = this.getGraphicFinalLayoutAttributes(currentMark);
377
+ graphicAttribute.outerRadius > maxRadius && (maxRadius = graphicAttribute.outerRadius);
374
378
  }));
375
379
  const radiusRatio = this.computeLayoutOuterRadius(maxRadius, attribute.width, attribute.height), line1MinLength = attribute.line.line1MinLength, {width: width, height: height} = plotRect, radius = this.computeRadius(radiusRatio, attribute.width, attribute.height), r = this._computeLayoutRadius(height / 2, attribute, currentMarks), cx = Math.abs(arc.center.x - width / 2), cy = arc.center.y - height / 2;
376
380
  let a, b, c;
@@ -391,7 +395,8 @@ export class ArcLabel extends LabelBase {
391
395
  const labelConfig = attribute, layoutArcGap = labelConfig.layoutArcGap, line1MinLength = labelConfig.line.line1MinLength;
392
396
  let maxRadius = 0;
393
397
  currentMarks.forEach((currentMark => {
394
- currentMark.getAttributes(!0).outerRadius > maxRadius && (maxRadius = currentMark.getAttributes(!0).outerRadius);
398
+ const graphicAttribute = this.getGraphicFinalLayoutAttributes(currentMark);
399
+ graphicAttribute.outerRadius > maxRadius && (maxRadius = graphicAttribute.outerRadius);
395
400
  }));
396
401
  const radiusRatio = this.computeLayoutOuterRadius(maxRadius, attribute.width, attribute.height), outerR = this.computeRadius(radiusRatio, attribute.width, attribute.height) + line1MinLength, a = outerR - layoutArcGap;
397
402
  return Math.max((a ** 2 + halfYLength ** 2) / (2 * a), outerR);
@@ -449,7 +454,7 @@ export class ArcLabel extends LabelBase {
449
454
  }), line.smooth && lineGraphic.setAttributes({
450
455
  curveType: "basis"
451
456
  }), "arc3d" === baseMark.type && baseMark)) {
452
- const {beta: beta, x: x, y: y} = baseMark.getAttributes(!0);
457
+ const {beta: beta, x: x, y: y} = this.getGraphicFinalLayoutAttributes(baseMark);
453
458
  lineGraphic.setAttributes({
454
459
  beta: beta,
455
460
  anchor3d: [ x, y ]