@visactor/vrender-components 1.1.0-alpha.1 → 1.1.0-alpha.11
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/cjs/animation/axis-animate.js +7 -3
- package/cjs/animation/axis-animate.js.map +1 -1
- package/cjs/animation/static-truth.d.ts +2 -0
- package/cjs/animation/static-truth.js +25 -0
- package/cjs/animation/static-truth.js.map +1 -0
- package/cjs/axis/animate/group-transition.d.ts +2 -2
- package/cjs/axis/animate/group-transition.js +7 -3
- package/cjs/axis/animate/group-transition.js.map +1 -1
- package/cjs/axis/base.js +21 -25
- package/cjs/axis/base.js.map +1 -1
- package/cjs/brush/brush.js +1 -2
- package/cjs/checkbox/index.js +2 -1
- package/cjs/crosshair/polygon.js +1 -2
- package/cjs/crosshair/sector.js +2 -1
- package/cjs/empty-tip/type.js +1 -2
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/indicator/config.js +2 -1
- package/cjs/label/arc.js +1 -1
- package/cjs/label/base.js +4 -2
- package/cjs/label/base.js.map +1 -1
- package/cjs/legend/discrete/discrete.js +13 -7
- package/cjs/legend/discrete/discrete.js.map +1 -1
- package/cjs/marker/animate/call-in.js +6 -2
- package/cjs/marker/animate/call-in.js.map +1 -1
- package/cjs/marker/animate/clip-in.js +6 -2
- package/cjs/marker/animate/clip-in.js.map +1 -1
- package/cjs/marker/animate/common.js +14 -5
- package/cjs/marker/animate/common.js.map +1 -1
- package/cjs/timeline/timeline.js +35 -12
- package/cjs/timeline/timeline.js.map +1 -1
- package/dist/index.es.js +198 -50
- package/es/animation/axis-animate.js +8 -3
- package/es/animation/axis-animate.js.map +1 -1
- package/es/animation/static-truth.d.ts +2 -0
- package/es/animation/static-truth.js +18 -0
- package/es/animation/static-truth.js.map +1 -0
- package/es/axis/animate/group-transition.d.ts +2 -2
- package/es/axis/animate/group-transition.js +7 -2
- package/es/axis/animate/group-transition.js.map +1 -1
- package/es/axis/base.js +22 -24
- package/es/axis/base.js.map +1 -1
- package/es/brush/brush.js +1 -2
- package/es/checkbox/index.js +2 -1
- package/es/crosshair/polygon.js +1 -2
- package/es/crosshair/sector.js +2 -1
- package/es/empty-tip/type.js +1 -2
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/indicator/config.js +2 -1
- package/es/label/arc.js +1 -1
- package/es/label/base.js +5 -1
- package/es/label/base.js.map +1 -1
- package/es/legend/discrete/discrete.js +14 -6
- package/es/legend/discrete/discrete.js.map +1 -1
- package/es/marker/animate/call-in.js +7 -2
- package/es/marker/animate/call-in.js.map +1 -1
- package/es/marker/animate/clip-in.js +7 -2
- package/es/marker/animate/clip-in.js.map +1 -1
- package/es/marker/animate/common.js +10 -2
- package/es/marker/animate/common.js.map +1 -1
- package/es/timeline/timeline.js +36 -11
- package/es/timeline/timeline.js.map +1 -1
- package/package.json +4 -4
package/dist/index.es.js
CHANGED
|
@@ -5240,11 +5240,23 @@ class StateTransitionOrchestrator {
|
|
|
5240
5240
|
if (!hasAnimation) return plan;
|
|
5241
5241
|
const noWorkAnimateAttr = Object.assign(Object.assign({}, null !== (_a = options.noWorkAnimateAttr) && void 0 !== _a ? _a : {}), normalizeNoAnimateAttrConfig(null === (_b = options.animateConfig) || void 0 === _b ? void 0 : _b.noAnimateAttrs)),
|
|
5242
5242
|
isClear = !0 === options.isClear,
|
|
5243
|
-
getDefaultAttribute = options.getDefaultAttribute
|
|
5243
|
+
getDefaultAttribute = options.getDefaultAttribute,
|
|
5244
|
+
shouldSkipDefaultAttribute = options.shouldSkipDefaultAttribute,
|
|
5245
|
+
assignTransitionAttr = (key, value) => {
|
|
5246
|
+
if (noWorkAnimateAttr[key]) return plan.jumpAttrs[key] = value, void (plan.noAnimateAttrs[key] = value);
|
|
5247
|
+
if (isClear && void 0 === value) {
|
|
5248
|
+
if (null == shouldSkipDefaultAttribute ? void 0 : shouldSkipDefaultAttribute(key, targetAttrs)) return;
|
|
5249
|
+
plan.animateAttrs[key] = getDefaultAttribute ? getDefaultAttribute(key) : value;
|
|
5250
|
+
} else plan.animateAttrs[key] = value;
|
|
5251
|
+
};
|
|
5244
5252
|
for (const key in targetAttrs) {
|
|
5245
5253
|
if (!Object.prototype.hasOwnProperty.call(targetAttrs, key)) continue;
|
|
5246
|
-
|
|
5247
|
-
|
|
5254
|
+
assignTransitionAttr(key, targetAttrs[key]);
|
|
5255
|
+
}
|
|
5256
|
+
const extraAnimateAttrs = options.extraAnimateAttrs;
|
|
5257
|
+
if (extraAnimateAttrs) for (const key in extraAnimateAttrs) {
|
|
5258
|
+
const hasTargetAttr = Object.prototype.hasOwnProperty.call(targetAttrs, key);
|
|
5259
|
+
!Object.prototype.hasOwnProperty.call(extraAnimateAttrs, key) || hasTargetAttr && void 0 !== targetAttrs[key] || assignTransitionAttr(key, extraAnimateAttrs[key]);
|
|
5248
5260
|
}
|
|
5249
5261
|
return plan;
|
|
5250
5262
|
}
|
|
@@ -5271,12 +5283,14 @@ class StateTransitionOrchestrator {
|
|
|
5271
5283
|
}), plan;
|
|
5272
5284
|
}
|
|
5273
5285
|
applyClearTransition(graphic, targetAttrs, hasAnimation, stateNames, options = {}) {
|
|
5274
|
-
var _a, _b;
|
|
5286
|
+
var _a, _b, _c, _d;
|
|
5275
5287
|
const plan = this.analyzeTransition({}, targetAttrs, stateNames, hasAnimation, {
|
|
5276
5288
|
noWorkAnimateAttr: null === (_a = graphic.getNoWorkAnimateAttr) || void 0 === _a ? void 0 : _a.call(graphic),
|
|
5277
5289
|
isClear: !0,
|
|
5278
5290
|
getDefaultAttribute: null === (_b = graphic.getDefaultAttribute) || void 0 === _b ? void 0 : _b.bind(graphic),
|
|
5279
|
-
|
|
5291
|
+
shouldSkipDefaultAttribute: null !== (_c = options.shouldSkipDefaultAttribute) && void 0 !== _c ? _c : null === (_d = graphic.shouldSkipStateTransitionDefaultAttribute) || void 0 === _d ? void 0 : _d.bind(graphic),
|
|
5292
|
+
animateConfig: options.animateConfig,
|
|
5293
|
+
extraAnimateAttrs: options.extraAnimateAttrs
|
|
5280
5294
|
});
|
|
5281
5295
|
return this.applyTransition(graphic, plan, hasAnimation, options);
|
|
5282
5296
|
}
|
|
@@ -5544,11 +5558,13 @@ class Graphic extends Node {
|
|
|
5544
5558
|
stateProxyModeKey: this.stateProxy ? "legacy-all" : "none"
|
|
5545
5559
|
};
|
|
5546
5560
|
}
|
|
5547
|
-
const sharedCompiledDefinitions = boundScope.effectiveCompiledDefinitions
|
|
5561
|
+
const sharedCompiledDefinitions = boundScope.effectiveCompiledDefinitions,
|
|
5562
|
+
sharedStateProxyModeKey = this.stateProxy ? "shared-missing-only" : "none",
|
|
5563
|
+
sharedStateProxyEligibility = this.stateProxy ? stateName => !sharedCompiledDefinitions.has(stateName) : void 0;
|
|
5548
5564
|
if (!hasStates) return this.localFallbackCompiledDefinitions = void 0, {
|
|
5549
5565
|
compiledDefinitions: sharedCompiledDefinitions,
|
|
5550
|
-
stateProxyModeKey:
|
|
5551
|
-
stateProxyEligibility:
|
|
5566
|
+
stateProxyModeKey: sharedStateProxyModeKey,
|
|
5567
|
+
stateProxyEligibility: sharedStateProxyEligibility
|
|
5552
5568
|
};
|
|
5553
5569
|
const localStates = this.states,
|
|
5554
5570
|
missingLocalStateDefinitions = {},
|
|
@@ -5557,8 +5573,8 @@ class Graphic extends Node {
|
|
|
5557
5573
|
sharedCompiledDefinitions.has(stateName) || (missingLocalStateDefinitions[stateName] = localStates[stateName], missingStateNames.push(stateName));
|
|
5558
5574
|
}), !missingStateNames.length) return this.localFallbackCompiledDefinitions = void 0, {
|
|
5559
5575
|
compiledDefinitions: sharedCompiledDefinitions,
|
|
5560
|
-
stateProxyModeKey:
|
|
5561
|
-
stateProxyEligibility:
|
|
5576
|
+
stateProxyModeKey: sharedStateProxyModeKey,
|
|
5577
|
+
stateProxyEligibility: sharedStateProxyEligibility
|
|
5562
5578
|
};
|
|
5563
5579
|
const localStatesVersion = this.getLocalStatesVersion(),
|
|
5564
5580
|
stateProxyModeKey = this.stateProxy ? `missing:${missingStateNames.sort().join("|")}` : "none",
|
|
@@ -5566,7 +5582,7 @@ class Graphic extends Node {
|
|
|
5566
5582
|
return this.localFallbackCompiledDefinitions && this.compiledStateDefinitionsCacheKey === cacheKey || (this.localFallbackCompiledDefinitions = new StateDefinitionCompiler().compile(Object.assign(Object.assign({}, boundScope.effectiveSourceDefinitions), missingLocalStateDefinitions)), this.compiledStateDefinitionsCacheKey = cacheKey), {
|
|
5567
5583
|
compiledDefinitions: this.localFallbackCompiledDefinitions,
|
|
5568
5584
|
stateProxyModeKey: stateProxyModeKey,
|
|
5569
|
-
stateProxyEligibility:
|
|
5585
|
+
stateProxyEligibility: sharedStateProxyEligibility
|
|
5570
5586
|
};
|
|
5571
5587
|
}
|
|
5572
5588
|
recomputeCurrentStatePatch() {
|
|
@@ -5590,6 +5606,23 @@ class Graphic extends Node {
|
|
|
5590
5606
|
"deep" === this.stateMergeMode && isPlainObjectValue(previousValue) && isPlainObjectValue(nextValue) ? snapshot[key] = deepMergeAttributeValue(previousValue, nextValue) : snapshot[key] = cloneAttributeValue(nextValue);
|
|
5591
5607
|
}), snapshot) : snapshot;
|
|
5592
5608
|
}
|
|
5609
|
+
buildRemovedStateAnimationAttrs(targetStateAttrs, previousResolvedStatePatch) {
|
|
5610
|
+
const extraAttrs = {};
|
|
5611
|
+
if (!previousResolvedStatePatch) return extraAttrs;
|
|
5612
|
+
const snapshot = this.buildStaticAttributeSnapshot(),
|
|
5613
|
+
staticTargetAttrs = snapshot;
|
|
5614
|
+
return Object.keys(previousResolvedStatePatch).forEach(key => {
|
|
5615
|
+
const hasTargetAttr = Object.prototype.hasOwnProperty.call(targetStateAttrs, key);
|
|
5616
|
+
if (hasTargetAttr && void 0 !== targetStateAttrs[key]) return;
|
|
5617
|
+
const assignFallbackAttr = value => {
|
|
5618
|
+
void 0 === value && this.shouldSkipStateTransitionDefaultAttribute(key, staticTargetAttrs) || (extraAttrs[key] = void 0 === value ? value : cloneAttributeValue(value));
|
|
5619
|
+
};
|
|
5620
|
+
if (hasTargetAttr) assignFallbackAttr(this.getStateTransitionDefaultAttribute(key, staticTargetAttrs));else if (Object.prototype.hasOwnProperty.call(snapshot, key)) {
|
|
5621
|
+
const snapshotValue = snapshot[key];
|
|
5622
|
+
assignFallbackAttr(void 0 === snapshotValue ? this.getStateTransitionDefaultAttribute(key, staticTargetAttrs) : snapshotValue);
|
|
5623
|
+
} else assignFallbackAttr(this.getStateTransitionDefaultAttribute(key, staticTargetAttrs));
|
|
5624
|
+
}), extraAttrs;
|
|
5625
|
+
}
|
|
5593
5626
|
syncObjectToSnapshot(target, snapshot) {
|
|
5594
5627
|
const delta = new Map();
|
|
5595
5628
|
return new Set([...Object.keys(target), ...Object.keys(snapshot)]).forEach(key => {
|
|
@@ -6011,21 +6044,31 @@ class Graphic extends Node {
|
|
|
6011
6044
|
var _a, _b, _c;
|
|
6012
6045
|
return null !== (_c = null !== (_a = null != animateConfig ? animateConfig : this.stateAnimateConfig) && void 0 !== _a ? _a : null === (_b = this.context) || void 0 === _b ? void 0 : _b.stateAnimateConfig) && void 0 !== _c ? _c : DefaultStateAnimateConfig;
|
|
6013
6046
|
}
|
|
6014
|
-
applyStateAttrs(attrs, stateNames, hasAnimation, isClear, animateConfig) {
|
|
6047
|
+
applyStateAttrs(attrs, stateNames, hasAnimation, isClear, animateConfig, extraAnimateAttrs) {
|
|
6015
6048
|
const resolvedAnimateConfig = hasAnimation ? this.resolveStateAnimateConfig(animateConfig) : void 0,
|
|
6016
6049
|
transitionOptions = resolvedAnimateConfig ? {
|
|
6017
|
-
animateConfig: resolvedAnimateConfig
|
|
6050
|
+
animateConfig: resolvedAnimateConfig,
|
|
6051
|
+
extraAnimateAttrs: extraAnimateAttrs,
|
|
6052
|
+
shouldSkipDefaultAttribute: this.shouldSkipStateTransitionDefaultAttribute.bind(this)
|
|
6018
6053
|
} : void 0;
|
|
6019
6054
|
if (isClear) return void this.getStateTransitionOrchestrator().applyClearTransition(this, attrs, hasAnimation, stateNames, transitionOptions);
|
|
6020
6055
|
const plan = this.getStateTransitionOrchestrator().analyzeTransition({}, attrs, stateNames, hasAnimation, {
|
|
6021
6056
|
noWorkAnimateAttr: this.getNoWorkAnimateAttr(),
|
|
6022
|
-
animateConfig: resolvedAnimateConfig
|
|
6057
|
+
animateConfig: resolvedAnimateConfig,
|
|
6058
|
+
extraAnimateAttrs: extraAnimateAttrs,
|
|
6059
|
+
shouldSkipDefaultAttribute: this.shouldSkipStateTransitionDefaultAttribute.bind(this)
|
|
6023
6060
|
});
|
|
6024
6061
|
this.getStateTransitionOrchestrator().applyTransition(this, plan, hasAnimation, transitionOptions);
|
|
6025
6062
|
}
|
|
6026
6063
|
updateNormalAttrs(stateAttrs) {
|
|
6027
6064
|
this._deprecatedNormalAttrsView = cloneAttributeValue(this.baseAttributes);
|
|
6028
6065
|
}
|
|
6066
|
+
getStateTransitionDefaultAttribute(key, targetAttrs) {
|
|
6067
|
+
return this.getDefaultAttribute(key);
|
|
6068
|
+
}
|
|
6069
|
+
shouldSkipStateTransitionDefaultAttribute(_key, _targetAttrs) {
|
|
6070
|
+
return !1;
|
|
6071
|
+
}
|
|
6029
6072
|
stopStateAnimates(type = "end") {
|
|
6030
6073
|
const stopAnimationState = this.stopAnimationState;
|
|
6031
6074
|
if ("function" == typeof stopAnimationState) return void stopAnimationState.call(this, "state", type);
|
|
@@ -6042,13 +6085,14 @@ class Graphic extends Node {
|
|
|
6042
6085
|
clearStates(hasAnimation) {
|
|
6043
6086
|
var _a, _b, _c;
|
|
6044
6087
|
const previousStates = this.currentStates ? this.currentStates.slice() : [],
|
|
6088
|
+
previousResolvedStatePatch = this.resolvedStatePatch ? cloneAttributeValue(this.resolvedStatePatch) : void 0,
|
|
6045
6089
|
transition = this.createStateModel().clearStates();
|
|
6046
6090
|
if (!transition.changed && 0 === previousStates.length) return this.currentStates = [], this.effectiveStates = [], this.resolvedStatePatch = void 0, this.sharedStateDirty = !1, void this.clearSharedStateActiveRegistrations();
|
|
6047
6091
|
const resolvedStateAttrs = cloneAttributeValue(null !== (_a = this.baseAttributes) && void 0 !== _a ? _a : {});
|
|
6048
6092
|
transition.changed && !this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !0) || (this.currentStates = transition.states, this.effectiveStates = [], this.resolvedStatePatch = void 0, this.sharedStateDirty = !1, this.clearSharedStateActiveRegistrations(), null === (_b = getStageStatePerfMonitor(this.stage)) || void 0 === _b || _b.incrementCounter("stateCommits"), null === (_c = getStageStatePerfMonitor(this.stage)) || void 0 === _c || _c.recordEvent("state-commit", {
|
|
6049
6093
|
graphicId: this._uid,
|
|
6050
6094
|
targetStates: []
|
|
6051
|
-
}), hasAnimation ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !0)) : (this.stopStateAnimates(), this._restoreAttributeFromStaticTruth({
|
|
6095
|
+
}), hasAnimation ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !0, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(), this._restoreAttributeFromStaticTruth({
|
|
6052
6096
|
type: AttributeUpdateType.STATE
|
|
6053
6097
|
}), this._emitCustomEvent("afterStateUpdate", {
|
|
6054
6098
|
type: AttributeUpdateType.STATE
|
|
@@ -6070,6 +6114,7 @@ class Graphic extends Node {
|
|
|
6070
6114
|
var _a, _b, _c, _d, _e;
|
|
6071
6115
|
if (!states.length) return void this.clearStates(hasAnimation);
|
|
6072
6116
|
const previousStates = this.currentStates ? this.currentStates.slice() : [],
|
|
6117
|
+
previousResolvedStatePatch = this.resolvedStatePatch ? cloneAttributeValue(this.resolvedStatePatch) : void 0,
|
|
6073
6118
|
stateResolveBaseAttrs = null !== (_a = this.baseAttributes) && void 0 !== _a ? _a : this.attribute,
|
|
6074
6119
|
stateModel = this.createStateModel();
|
|
6075
6120
|
null === (_b = this.stateEngine) || void 0 === _b || _b.setResolveContext(this, stateResolveBaseAttrs);
|
|
@@ -6080,7 +6125,7 @@ class Graphic extends Node {
|
|
|
6080
6125
|
this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !1) && (this.currentStates = transition.states, this.effectiveStates = [...effectiveStates], this.resolvedStatePatch = Object.assign({}, resolvedStateAttrs), this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), null === (_d = getStageStatePerfMonitor(this.stage)) || void 0 === _d || _d.incrementCounter("stateCommits"), null === (_e = getStageStatePerfMonitor(this.stage)) || void 0 === _e || _e.recordEvent("state-commit", {
|
|
6081
6126
|
graphicId: this._uid,
|
|
6082
6127
|
targetStates: [...transition.states]
|
|
6083
|
-
}), hasAnimation ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation)) : (this.stopStateAnimates(), this._restoreAttributeFromStaticTruth({
|
|
6128
|
+
}), hasAnimation ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(), this._restoreAttributeFromStaticTruth({
|
|
6084
6129
|
type: AttributeUpdateType.STATE
|
|
6085
6130
|
}), this._emitCustomEvent("afterStateUpdate", {
|
|
6086
6131
|
type: AttributeUpdateType.STATE
|
|
@@ -7499,6 +7544,52 @@ class Rect extends Graphic {
|
|
|
7499
7544
|
needUpdateTag(key) {
|
|
7500
7545
|
return super.needUpdateTag(key, RECT_UPDATE_TAG_KEY);
|
|
7501
7546
|
}
|
|
7547
|
+
shouldSkipStateTransitionDefaultAttribute(key, targetAttrs) {
|
|
7548
|
+
var _a;
|
|
7549
|
+
const attrs = null !== (_a = null != targetAttrs ? targetAttrs : this.baseAttributes) && void 0 !== _a ? _a : this.attribute,
|
|
7550
|
+
hasValue = attrKey => null != attrs[attrKey],
|
|
7551
|
+
isNilValue = attrKey => null == attrs[attrKey];
|
|
7552
|
+
switch (key) {
|
|
7553
|
+
case "width":
|
|
7554
|
+
return isNilValue("width") && hasValue("x") && hasValue("x1");
|
|
7555
|
+
case "height":
|
|
7556
|
+
return isNilValue("height") && hasValue("y") && hasValue("y1");
|
|
7557
|
+
case "x1":
|
|
7558
|
+
return isNilValue("x1") && hasValue("x") && hasValue("width");
|
|
7559
|
+
case "y1":
|
|
7560
|
+
return isNilValue("y1") && hasValue("y") && hasValue("height");
|
|
7561
|
+
default:
|
|
7562
|
+
return !1;
|
|
7563
|
+
}
|
|
7564
|
+
}
|
|
7565
|
+
getStateTransitionDefaultAttribute(key, targetAttrs) {
|
|
7566
|
+
var _a;
|
|
7567
|
+
const attrs = null !== (_a = null != targetAttrs ? targetAttrs : this.baseAttributes) && void 0 !== _a ? _a : this.attribute,
|
|
7568
|
+
getNumber = attrKey => {
|
|
7569
|
+
const value = attrs[attrKey];
|
|
7570
|
+
return "number" == typeof value && Number.isFinite(value) ? value : void 0;
|
|
7571
|
+
},
|
|
7572
|
+
x = getNumber("x"),
|
|
7573
|
+
y = getNumber("y"),
|
|
7574
|
+
x1 = getNumber("x1"),
|
|
7575
|
+
y1 = getNumber("y1"),
|
|
7576
|
+
width = getNumber("width"),
|
|
7577
|
+
height = getNumber("height");
|
|
7578
|
+
switch (key) {
|
|
7579
|
+
case "width":
|
|
7580
|
+
if (null == width && null != x && null != x1) return x1 - x;
|
|
7581
|
+
break;
|
|
7582
|
+
case "height":
|
|
7583
|
+
if (null == height && null != y && null != y1) return y1 - y;
|
|
7584
|
+
break;
|
|
7585
|
+
case "x1":
|
|
7586
|
+
if (null == x1 && null != x && null != width) return x + width;
|
|
7587
|
+
break;
|
|
7588
|
+
case "y1":
|
|
7589
|
+
if (null == y1 && null != y && null != height) return y + height;
|
|
7590
|
+
}
|
|
7591
|
+
return super.getStateTransitionDefaultAttribute(key, targetAttrs);
|
|
7592
|
+
}
|
|
7502
7593
|
toCustomPath() {
|
|
7503
7594
|
let path = super.toCustomPath();
|
|
7504
7595
|
if (path) return path;
|
|
@@ -18239,6 +18330,26 @@ class AnimateComponent extends AbstractComponent {
|
|
|
18239
18330
|
}
|
|
18240
18331
|
}
|
|
18241
18332
|
|
|
18333
|
+
function commitUpdateAnimationTarget(graphic, targetAttrs, startAttrs) {
|
|
18334
|
+
var _a, _b, _c, _d;
|
|
18335
|
+
if (!graphic || !targetAttrs) {
|
|
18336
|
+
return;
|
|
18337
|
+
}
|
|
18338
|
+
const committedTargetAttrs = cloneDeep(targetAttrs);
|
|
18339
|
+
const transientStartAttrs = cloneDeep(startAttrs !== null && startAttrs !== void 0 ? startAttrs : graphic.attribute);
|
|
18340
|
+
graphic.setAttributes(committedTargetAttrs);
|
|
18341
|
+
const baseAttributes = graphic.baseAttributes;
|
|
18342
|
+
if (baseAttributes && typeof baseAttributes === 'object') {
|
|
18343
|
+
Object.keys(committedTargetAttrs).forEach(key => {
|
|
18344
|
+
baseAttributes[key] = cloneDeep(committedTargetAttrs[key]);
|
|
18345
|
+
});
|
|
18346
|
+
}
|
|
18347
|
+
(_b = (_a = graphic).setFinalAttributes) === null || _b === void 0 ? void 0 : _b.call(_a, committedTargetAttrs);
|
|
18348
|
+
(_d = (_c = graphic).setAttributesAndPreventAnimate) === null || _d === void 0 ? void 0 : _d.call(_c, transientStartAttrs, false, {
|
|
18349
|
+
type: AttributeUpdateType.ANIMATE_BIND
|
|
18350
|
+
});
|
|
18351
|
+
}
|
|
18352
|
+
|
|
18242
18353
|
const DefaultAxisAnimation = {
|
|
18243
18354
|
type: 'default',
|
|
18244
18355
|
duration: 300,
|
|
@@ -18640,11 +18751,10 @@ class AxisBase extends AnimateComponent {
|
|
|
18640
18751
|
var _a;
|
|
18641
18752
|
if (el.type !== 'group' && el.id) {
|
|
18642
18753
|
const oldEl = prevInnerView[el.id];
|
|
18643
|
-
el.setFinalAttributes(el.attribute);
|
|
18644
18754
|
if (oldEl) {
|
|
18645
18755
|
oldEl.release();
|
|
18646
|
-
const oldAttrs = oldEl.attribute;
|
|
18647
|
-
const finalAttrs = el.
|
|
18756
|
+
const oldAttrs = cloneDeep(oldEl.attribute);
|
|
18757
|
+
const finalAttrs = cloneDeep(el.attribute);
|
|
18648
18758
|
const diffAttrs = diff(oldAttrs, finalAttrs);
|
|
18649
18759
|
let hasDiff = Object.keys(diffAttrs).length > 0;
|
|
18650
18760
|
if ('opacity' in oldAttrs && finalAttrs.opacity !== oldAttrs.opacity) {
|
|
@@ -18655,10 +18765,9 @@ class AxisBase extends AnimateComponent {
|
|
|
18655
18765
|
this._newElementAttrMap[el.id] = {
|
|
18656
18766
|
state: 'update',
|
|
18657
18767
|
node: el,
|
|
18658
|
-
attrs:
|
|
18768
|
+
attrs: finalAttrs
|
|
18659
18769
|
};
|
|
18660
|
-
|
|
18661
|
-
el.setAttributes(oldAttrs);
|
|
18770
|
+
commitUpdateAnimationTarget(el, finalAttrs, oldAttrs);
|
|
18662
18771
|
el.applyAnimationState(['update'], [
|
|
18663
18772
|
{
|
|
18664
18773
|
name: 'update',
|
|
@@ -19385,6 +19494,16 @@ function commonInterpolateUpdate(key, from, to, ratio, step, target) {
|
|
|
19385
19494
|
return !1;
|
|
19386
19495
|
}
|
|
19387
19496
|
|
|
19497
|
+
function applyAnimationTransientAttributes(target, attributes, type = AttributeUpdateType.ANIMATE_UPDATE) {
|
|
19498
|
+
var _a;
|
|
19499
|
+
if (!attributes) return;
|
|
19500
|
+
const context = {
|
|
19501
|
+
type: type
|
|
19502
|
+
},
|
|
19503
|
+
transientTarget = target;
|
|
19504
|
+
"function" != typeof transientTarget.applyTransientAttributes ? "function" != typeof transientTarget.setAttributesAndPreventAnimate ? (transientTarget.attribute || (transientTarget.attribute = {}), Object.assign(transientTarget.attribute, attributes), null === (_a = transientTarget.onAttributeUpdate) || void 0 === _a || _a.call(transientTarget, context)) : transientTarget.setAttributesAndPreventAnimate(attributes, !1, context) : transientTarget.applyTransientAttributes(attributes, !1, context);
|
|
19505
|
+
}
|
|
19506
|
+
|
|
19388
19507
|
function noop() {}
|
|
19389
19508
|
class Step {
|
|
19390
19509
|
constructor(type, props, duration, easing) {
|
|
@@ -19510,7 +19629,7 @@ class WaitStep extends Step {
|
|
|
19510
19629
|
onStart() {
|
|
19511
19630
|
super.onStart();
|
|
19512
19631
|
const fromProps = this.getFromProps();
|
|
19513
|
-
this.target.
|
|
19632
|
+
applyAnimationTransientAttributes(this.target, fromProps, AttributeUpdateType.ANIMATE_START);
|
|
19514
19633
|
}
|
|
19515
19634
|
update(end, ratio, out) {
|
|
19516
19635
|
this.onStart();
|
|
@@ -19686,7 +19805,7 @@ class Animate {
|
|
|
19686
19805
|
this.target = target;
|
|
19687
19806
|
const trackerTarget = this.target;
|
|
19688
19807
|
return "function" == typeof trackerTarget.trackAnimate ? trackerTarget.trackAnimate(this) : (this.target.animates || (this.target.animates = new Map()), this.target.animates.set(this.id, this)), this.onRemove(() => {
|
|
19689
|
-
this.stop(), "function"
|
|
19808
|
+
this.stop(), this.__skipRestoreStaticAttributeOnRemove || "function" != typeof trackerTarget.restoreStaticAttribute || trackerTarget.restoreStaticAttribute(), "function" == typeof trackerTarget.untrackAnimate ? trackerTarget.untrackAnimate(this.id) : this.target.animates.delete(this.id);
|
|
19690
19809
|
}), this.target.onAnimateBind && !this.slience && this.target.onAnimateBind(this), this.target.animationAttribute || (this.target.animationAttribute = {}), this;
|
|
19691
19810
|
}
|
|
19692
19811
|
to(props, duration = 300, easing = "linear") {
|
|
@@ -19822,7 +19941,7 @@ class Animate {
|
|
|
19822
19941
|
if (nextTime >= this._startTime + this._totalDuration) {
|
|
19823
19942
|
null === (_a = this._lastStep) || void 0 === _a || _a.onUpdate(!0, 1, {}), null === (_b = this._lastStep) || void 0 === _b || _b.onEnd(), this.onEnd(), this.status = AnimateStatus.END;
|
|
19824
19943
|
const trackerTarget = this.target;
|
|
19825
|
-
return
|
|
19944
|
+
return "function" == typeof (null == trackerTarget ? void 0 : trackerTarget.restoreStaticAttribute) && trackerTarget.restoreStaticAttribute(), void (this.__skipRestoreStaticAttributeOnRemove = !0);
|
|
19826
19945
|
}
|
|
19827
19946
|
this.status = AnimateStatus.RUNNING, this.currentTime <= this._startTime && this.onStart(), this.currentTime = nextTime;
|
|
19828
19947
|
let cycleTime = nextTime - this._startTime,
|
|
@@ -19833,7 +19952,7 @@ class Animate {
|
|
|
19833
19952
|
const currentLoop = Math.floor((nextTime - this._startTime) / this._duration);
|
|
19834
19953
|
newLoop = currentLoop > this._currentLoop, this._currentLoop = currentLoop, bounceTime = this._bounce && currentLoop % 2 == 1, bounceTime && (cycleTime = this._duration - cycleTime);
|
|
19835
19954
|
}
|
|
19836
|
-
newLoop && !bounceTime && this.target
|
|
19955
|
+
newLoop && !bounceTime && applyAnimationTransientAttributes(this.target, this._startProps, AttributeUpdateType.ANIMATE_START);
|
|
19837
19956
|
let targetStep = null;
|
|
19838
19957
|
if (this._lastStep === this._firstStep) targetStep = this._firstStep;else {
|
|
19839
19958
|
let currentStep = this._firstStep;
|
|
@@ -20068,6 +20187,9 @@ class AnimationTransitionRegistry {
|
|
|
20068
20187
|
})), this.registerTransition("state", "*", () => ({
|
|
20069
20188
|
allowTransition: !0,
|
|
20070
20189
|
stopOriginalTransition: !1
|
|
20190
|
+
})), this.registerTransition("state", "state", () => ({
|
|
20191
|
+
allowTransition: !0,
|
|
20192
|
+
stopOriginalTransition: !0
|
|
20071
20193
|
})), this.registerTransition("state", "disappear", () => ({
|
|
20072
20194
|
allowTransition: !0,
|
|
20073
20195
|
stopOriginalTransition: !0
|
|
@@ -20347,7 +20469,8 @@ class AnimateExecutor {
|
|
|
20347
20469
|
void 0 !== config.to && ("function" == typeof config.to ? props[key] = config.to(null === (_b = null === (_a = graphic.context) || void 0 === _a ? void 0 : _a.data) || void 0 === _b ? void 0 : _b[0], graphic, {}) : props[key] = config.to), void 0 !== config.from && (from || (from = {}), "function" == typeof config.from ? from[key] = config.from(null === (_d = null === (_c = graphic.context) || void 0 === _c ? void 0 : _c.data) || void 0 === _d ? void 0 : _d[0], graphic, {}) : from[key] = config.from);
|
|
20348
20470
|
}), diffAttrs) for (const key in diffAttrs) {
|
|
20349
20471
|
const value = diffAttrs[key];
|
|
20350
|
-
void 0
|
|
20472
|
+
if (void 0 === value) continue;
|
|
20473
|
+
props.hasOwnProperty(key) || !!(null == from ? void 0 : from.hasOwnProperty(key)) || (attrOutChannel[key] = value, hasAttrs = !0);
|
|
20351
20474
|
}
|
|
20352
20475
|
return {
|
|
20353
20476
|
from: from,
|
|
@@ -20372,7 +20495,7 @@ class AnimateExecutor {
|
|
|
20372
20495
|
stop(type, callEnd = !0) {
|
|
20373
20496
|
for (; this._animates.length > 0;) {
|
|
20374
20497
|
const animate = this._animates.pop();
|
|
20375
|
-
!1 === callEnd && (animate.status = AnimateStatus.END), null == animate || animate.stop(type);
|
|
20498
|
+
!1 === callEnd && (animate.status = AnimateStatus.END, animate.__skipRestoreStaticAttributeOnRemove = !0), null == animate || animate.stop(type);
|
|
20376
20499
|
}
|
|
20377
20500
|
this._animates = [], this._activeCount = 0, this._started && (this._started = !1, callEnd && this.onEnd());
|
|
20378
20501
|
}
|
|
@@ -20805,7 +20928,9 @@ class IncreaseCount extends ACustomAnimate {
|
|
|
20805
20928
|
const parts = formattedNumber.toString().split(".");
|
|
20806
20929
|
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","), formattedWithBasicFormat = parts.join(".");
|
|
20807
20930
|
} else formattedWithBasicFormat = formattedNumber;
|
|
20808
|
-
formattedText = this.formatTemplate ? this.formatTemplate.replace("{{var}}", formattedWithBasicFormat.toString()) : formattedWithBasicFormat, this.target
|
|
20931
|
+
formattedText = this.formatTemplate ? this.formatTemplate.replace("{{var}}", formattedWithBasicFormat.toString()) : formattedWithBasicFormat, applyAnimationTransientAttributes(this.target, {
|
|
20932
|
+
text: formattedText
|
|
20933
|
+
});
|
|
20809
20934
|
}
|
|
20810
20935
|
}
|
|
20811
20936
|
|
|
@@ -20825,7 +20950,7 @@ class AxisEnter extends AComponentAnimate {
|
|
|
20825
20950
|
const point = getTickCoord(oldValue);
|
|
20826
20951
|
const newX = this.target.attribute.x;
|
|
20827
20952
|
const newY = this.target.attribute.y;
|
|
20828
|
-
this.target
|
|
20953
|
+
commitUpdateAnimationTarget(this.target, { x: newX, y: newY }, { x: point.x, y: point.y });
|
|
20829
20954
|
animator.animate(this.target, {
|
|
20830
20955
|
type: 'to',
|
|
20831
20956
|
to: { x: newX, y: newY },
|
|
@@ -20848,7 +20973,8 @@ class AxisUpdate extends AComponentAnimate {
|
|
|
20848
20973
|
this._animator = animator;
|
|
20849
20974
|
const duration = this.duration;
|
|
20850
20975
|
const easing = this.easing;
|
|
20851
|
-
const {
|
|
20976
|
+
const { diffAttrs } = this.params;
|
|
20977
|
+
commitUpdateAnimationTarget(this.target, Object.assign({}, diffAttrs));
|
|
20852
20978
|
animator.animate(this.target, {
|
|
20853
20979
|
type: 'to',
|
|
20854
20980
|
to: Object.assign({}, diffAttrs),
|
|
@@ -21895,6 +22021,7 @@ class GroupTransition extends ACustomAnimate {
|
|
|
21895
22021
|
this.mode = AnimateMode.NORMAL;
|
|
21896
22022
|
}
|
|
21897
22023
|
onBind() {
|
|
22024
|
+
this._started = false;
|
|
21898
22025
|
const currentInnerView = this.target.getInnerView();
|
|
21899
22026
|
const prevInnerView = this.target.getPrevInnerView();
|
|
21900
22027
|
if (!prevInnerView) {
|
|
@@ -21913,7 +22040,7 @@ class GroupTransition extends ACustomAnimate {
|
|
|
21913
22040
|
node: el,
|
|
21914
22041
|
attrs: Object.assign(Object.assign({}, newProps), { opacity: (_a = newProps.opacity) !== null && _a !== void 0 ? _a : 1, fillOpacity: (_b = newProps.fillOpacity) !== null && _b !== void 0 ? _b : 1, strokeOpacity: (_c = newProps.strokeOpacity) !== null && _c !== void 0 ? _c : 1 })
|
|
21915
22042
|
};
|
|
21916
|
-
el.
|
|
22043
|
+
commitUpdateAnimationTarget(el, this._newElementAttrMap[el.id].attrs, cloneDeep(oldEl.attribute));
|
|
21917
22044
|
}
|
|
21918
22045
|
}
|
|
21919
22046
|
else {
|
|
@@ -21927,7 +22054,7 @@ class GroupTransition extends ACustomAnimate {
|
|
|
21927
22054
|
node: el,
|
|
21928
22055
|
attrs: finalOpacityAttrs
|
|
21929
22056
|
};
|
|
21930
|
-
el
|
|
22057
|
+
commitUpdateAnimationTarget(el, finalOpacityAttrs, {
|
|
21931
22058
|
opacity: 0,
|
|
21932
22059
|
fillOpacity: 0,
|
|
21933
22060
|
strokeOpacity: 0
|
|
@@ -21937,6 +22064,10 @@ class GroupTransition extends ACustomAnimate {
|
|
|
21937
22064
|
});
|
|
21938
22065
|
}
|
|
21939
22066
|
onStart() {
|
|
22067
|
+
if (this._started) {
|
|
22068
|
+
return;
|
|
22069
|
+
}
|
|
22070
|
+
this._started = true;
|
|
21940
22071
|
let duration = this.duration;
|
|
21941
22072
|
let easing = this.easing;
|
|
21942
22073
|
this._newElementAttrMap &&
|
|
@@ -24052,6 +24183,8 @@ class LabelBase extends AnimateComponent {
|
|
|
24052
24183
|
_runUpdateAnimation(prevLabel, currentLabel) {
|
|
24053
24184
|
const { text: prevText, labelLine: prevLabelLine } = prevLabel;
|
|
24054
24185
|
const { text: curText, labelLine: curLabelLine } = currentLabel;
|
|
24186
|
+
commitUpdateAnimationTarget(prevText, curText === null || curText === void 0 ? void 0 : curText.attribute);
|
|
24187
|
+
commitUpdateAnimationTarget(prevLabelLine, curLabelLine === null || curLabelLine === void 0 ? void 0 : curLabelLine.attribute);
|
|
24055
24188
|
prevText.applyAnimationState(['update'], [
|
|
24056
24189
|
{
|
|
24057
24190
|
name: 'update',
|
|
@@ -24083,7 +24216,7 @@ class LabelBase extends AnimateComponent {
|
|
|
24083
24216
|
this.runEnterAnimation(text, labelLine);
|
|
24084
24217
|
}
|
|
24085
24218
|
_updateLabel(prevLabel, currentLabel) {
|
|
24086
|
-
const {
|
|
24219
|
+
const { labelLine: prevLabelLine } = prevLabel;
|
|
24087
24220
|
const { text: curText, labelLine: curLabelLine } = currentLabel;
|
|
24088
24221
|
if (this._enableAnimation === false || this._animationConfig.update === false) {
|
|
24089
24222
|
prevLabel.text.setAttributes(curText.attribute);
|
|
@@ -26979,7 +27112,10 @@ function graphicFadeIn(graphic, delay, duration, easing) {
|
|
|
26979
27112
|
(_a = graphic === null || graphic === void 0 ? void 0 : graphic.animates) === null || _a === void 0 ? void 0 : _a.forEach(a => a.stop('end'));
|
|
26980
27113
|
const fillOpacityConfig = (_c = (_b = graphic.attribute) === null || _b === void 0 ? void 0 : _b.fillOpacity) !== null && _c !== void 0 ? _c : 1;
|
|
26981
27114
|
const strokeOpacityConfig = (_e = (_d = graphic.attribute) === null || _d === void 0 ? void 0 : _d.strokeOpacity) !== null && _e !== void 0 ? _e : 1;
|
|
26982
|
-
graphic
|
|
27115
|
+
commitUpdateAnimationTarget(graphic, {
|
|
27116
|
+
fillOpacity: fillOpacityConfig,
|
|
27117
|
+
strokeOpacity: strokeOpacityConfig
|
|
27118
|
+
}, {
|
|
26983
27119
|
fillOpacity: 0,
|
|
26984
27120
|
strokeOpacity: 0
|
|
26985
27121
|
});
|
|
@@ -27009,7 +27145,10 @@ function graphicFadeOut(graphic, delay, duration, easing) {
|
|
|
27009
27145
|
if (!graphic) {
|
|
27010
27146
|
return;
|
|
27011
27147
|
}
|
|
27012
|
-
graphic
|
|
27148
|
+
commitUpdateAnimationTarget(graphic, {
|
|
27149
|
+
fillOpacity: 0,
|
|
27150
|
+
strokeOpacity: 0
|
|
27151
|
+
}, {
|
|
27013
27152
|
fillOpacity: (_b = (_a = graphic.attribute) === null || _a === void 0 ? void 0 : _a.fillOpacity) !== null && _b !== void 0 ? _b : 1,
|
|
27014
27153
|
strokeOpacity: (_d = (_c = graphic.attribute) === null || _c === void 0 ? void 0 : _c.strokeOpacity) !== null && _d !== void 0 ? _d : 1
|
|
27015
27154
|
});
|
|
@@ -27038,7 +27177,7 @@ function commonLineClipIn(line, label, duration, delay, easing) {
|
|
|
27038
27177
|
const endSymbolDuration = 0.1 * duration;
|
|
27039
27178
|
const labelDuration = 0.1 * duration;
|
|
27040
27179
|
graphicFadeIn(line.startSymbol, delay, startSymbolDuration, easing);
|
|
27041
|
-
line.lines.forEach(line => line
|
|
27180
|
+
line.lines.forEach(line => commitUpdateAnimationTarget(line, { clipRange: 1 }, { clipRange: 0 }));
|
|
27042
27181
|
line.lines.forEach((l, index) => {
|
|
27043
27182
|
const stepDuration = lineDuration / line.lines.length;
|
|
27044
27183
|
l.animate()
|
|
@@ -27121,7 +27260,7 @@ function pointCallIn(itemLine, decorativeLine, item, duration, delay, easing) {
|
|
|
27121
27260
|
const endSymbolDuration = 0.1 * duration;
|
|
27122
27261
|
const labelDuration = 0.1 * duration;
|
|
27123
27262
|
graphicFadeIn(itemLine.startSymbol, delay, startSymbolDuration, easing);
|
|
27124
|
-
itemLine.lines.forEach(line => line
|
|
27263
|
+
itemLine.lines.forEach(line => commitUpdateAnimationTarget(line, { clipRange: 1 }, { clipRange: 0 }));
|
|
27125
27264
|
itemLine.lines.forEach((l, index) => {
|
|
27126
27265
|
const stepDuration = lineDuration / itemLine.lines.length;
|
|
27127
27266
|
l.animate()
|
|
@@ -29620,9 +29759,9 @@ class DiscreteLegend extends LegendBase {
|
|
|
29620
29759
|
}
|
|
29621
29760
|
if (!this._itemContext.isScrollbar) {
|
|
29622
29761
|
if (animation) {
|
|
29623
|
-
|
|
29624
|
-
|
|
29625
|
-
|
|
29762
|
+
const attrs = { [channel]: -(newPage - 1) * pageSize };
|
|
29763
|
+
commitUpdateAnimationTarget(this._itemsContainer, attrs);
|
|
29764
|
+
this._itemsContainer.animate().to(attrs, animationDuration, animationEasing);
|
|
29626
29765
|
}
|
|
29627
29766
|
else {
|
|
29628
29767
|
this._itemsContainer.setAttribute(channel, -(newPage - 1) * pageSize);
|
|
@@ -29640,7 +29779,9 @@ class DiscreteLegend extends LegendBase {
|
|
|
29640
29779
|
const startOffset = containerSize * start;
|
|
29641
29780
|
this.updateScrollMask();
|
|
29642
29781
|
if (animation) {
|
|
29643
|
-
|
|
29782
|
+
const attrs = { [channel]: -startOffset };
|
|
29783
|
+
commitUpdateAnimationTarget(this._itemsContainer, attrs);
|
|
29784
|
+
this._itemsContainer.animate().to(attrs, animationDuration, animationEasing);
|
|
29644
29785
|
}
|
|
29645
29786
|
else {
|
|
29646
29787
|
this._itemsContainer.setAttribute(channel, -startOffset);
|
|
@@ -33593,6 +33734,7 @@ class Timeline extends AbstractComponent {
|
|
|
33593
33734
|
setActive(symbolGroup, activeSymbolStyle);
|
|
33594
33735
|
}
|
|
33595
33736
|
appearAnimate(animateConfig) {
|
|
33737
|
+
var _a;
|
|
33596
33738
|
const { duration = 1000, easing = 'quadOut' } = animateConfig;
|
|
33597
33739
|
const { activeLabelStyle, activeSymbolStyle } = this.attribute;
|
|
33598
33740
|
const percent = duration / 1000;
|
|
@@ -33603,30 +33745,33 @@ class Timeline extends AbstractComponent {
|
|
|
33603
33745
|
const symbolDelay = percent * 100;
|
|
33604
33746
|
const symbolNormalDelay = percent * 600;
|
|
33605
33747
|
if (this._line) {
|
|
33606
|
-
this._line
|
|
33748
|
+
commitUpdateAnimationTarget(this._line, { clipRange: 1 }, { clipRange: 0 });
|
|
33607
33749
|
this._line.animate().to({ clipRange: 1 }, lineDuration, easing);
|
|
33608
33750
|
}
|
|
33609
33751
|
if (this._activeLine) {
|
|
33610
|
-
this._activeLine.
|
|
33752
|
+
const opacity = (_a = this._activeLine.attribute.opacity) !== null && _a !== void 0 ? _a : 1;
|
|
33753
|
+
commitUpdateAnimationTarget(this._activeLine, { opacity }, { opacity: 0 });
|
|
33611
33754
|
this._activeLine
|
|
33612
33755
|
.animate()
|
|
33613
33756
|
.wait(500)
|
|
33614
|
-
.to({ opacity
|
|
33757
|
+
.to({ opacity }, activeLineDuration, easing);
|
|
33615
33758
|
}
|
|
33616
33759
|
if (this._symbolGroup) {
|
|
33617
33760
|
const size = this._symbolGroup.count - 1;
|
|
33618
33761
|
const delay = percent * (size === 1 ? 0 : (500 - 100) / (size - 1));
|
|
33619
33762
|
const delayNormal = percent * (size === 1 ? 0 : (400 - 160) / (size - 1));
|
|
33620
33763
|
this._symbolGroup.forEachChildren((symbol, i) => {
|
|
33764
|
+
var _a;
|
|
33621
33765
|
const originAttrs = {};
|
|
33622
33766
|
Object.keys(activeSymbolStyle).forEach(k => {
|
|
33623
33767
|
originAttrs[k] = symbol.attribute[k];
|
|
33624
33768
|
});
|
|
33625
|
-
symbol.
|
|
33769
|
+
const opacity = (_a = symbol.attribute.opacity) !== null && _a !== void 0 ? _a : 1;
|
|
33770
|
+
commitUpdateAnimationTarget(symbol, { opacity }, { opacity: 0 });
|
|
33626
33771
|
symbol
|
|
33627
33772
|
.animate()
|
|
33628
33773
|
.wait(symbolDelay + delay * i)
|
|
33629
|
-
.to({ opacity
|
|
33774
|
+
.to({ opacity }, perSymbolDuration, easing);
|
|
33630
33775
|
symbol
|
|
33631
33776
|
.animate()
|
|
33632
33777
|
.wait(symbolNormalDelay + delayNormal * i)
|
|
@@ -33639,15 +33784,17 @@ class Timeline extends AbstractComponent {
|
|
|
33639
33784
|
const delay = percent * (size === 1 ? 0 : (500 - 100) / (size - 1));
|
|
33640
33785
|
const delayNormal = percent * (size === 1 ? 0 : (400 - 160) / (size - 1));
|
|
33641
33786
|
this._labelGroup.forEachChildren((label, i) => {
|
|
33787
|
+
var _a;
|
|
33642
33788
|
const originAttrs = {};
|
|
33643
33789
|
Object.keys(activeLabelStyle).forEach(k => {
|
|
33644
33790
|
originAttrs[k] = label.attribute[k];
|
|
33645
33791
|
});
|
|
33646
|
-
label.
|
|
33792
|
+
const opacity = (_a = label.attribute.opacity) !== null && _a !== void 0 ? _a : 1;
|
|
33793
|
+
commitUpdateAnimationTarget(label, { opacity }, { opacity: 0 });
|
|
33647
33794
|
label
|
|
33648
33795
|
.animate()
|
|
33649
33796
|
.wait(symbolDelay + delay * i)
|
|
33650
|
-
.to({ opacity
|
|
33797
|
+
.to({ opacity }, perSymbolDuration, easing);
|
|
33651
33798
|
label
|
|
33652
33799
|
.animate()
|
|
33653
33800
|
.wait(symbolNormalDelay + delayNormal * i)
|
|
@@ -33687,6 +33834,7 @@ class Timeline extends AbstractComponent {
|
|
|
33687
33834
|
const nextClipRange = flag > 0 ? this._timesPercent[i] || 1 : this._timesPercent[i - 1] || 0;
|
|
33688
33835
|
if (animation) {
|
|
33689
33836
|
const { duration = 1000, easing = 'quadOut' } = animateConfig;
|
|
33837
|
+
commitUpdateAnimationTarget(this, { clipRange: nextClipRange }, { clipRange });
|
|
33690
33838
|
this.animate().to({ clipRange: nextClipRange }, duration, easing);
|
|
33691
33839
|
}
|
|
33692
33840
|
else {
|
|
@@ -35533,6 +35681,6 @@ TableSeriesNumber.defaultAttributes = {
|
|
|
35533
35681
|
select: true
|
|
35534
35682
|
};
|
|
35535
35683
|
|
|
35536
|
-
const version = "1.1.0-alpha.
|
|
35684
|
+
const version = "1.1.0-alpha.11";
|
|
35537
35685
|
|
|
35538
35686
|
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 };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { AComponentAnimate, AnimateExecutor, createComponentAnimator } from "@visactor/vrender-animate";
|
|
2
2
|
|
|
3
|
+
import { commitUpdateAnimationTarget } from "./static-truth";
|
|
4
|
+
|
|
3
5
|
export class AxisEnter extends AComponentAnimate {
|
|
4
6
|
onBind() {
|
|
5
7
|
var _a;
|
|
@@ -11,7 +13,10 @@ export class AxisEnter extends AComponentAnimate {
|
|
|
11
13
|
if (lastScale && getTickCoord && currData) {
|
|
12
14
|
ratio = .7;
|
|
13
15
|
const point = getTickCoord(lastScale.scale(currData.rawValue)), newX = this.target.attribute.x, newY = this.target.attribute.y;
|
|
14
|
-
this.target
|
|
16
|
+
commitUpdateAnimationTarget(this.target, {
|
|
17
|
+
x: newX,
|
|
18
|
+
y: newY
|
|
19
|
+
}, {
|
|
15
20
|
x: point.x,
|
|
16
21
|
y: point.y
|
|
17
22
|
}), animator.animate(this.target, {
|
|
@@ -37,8 +42,8 @@ export class AxisUpdate extends AComponentAnimate {
|
|
|
37
42
|
onBind() {
|
|
38
43
|
const animator = createComponentAnimator(this.target);
|
|
39
44
|
this._animator = animator;
|
|
40
|
-
const duration = this.duration, easing = this.easing, {
|
|
41
|
-
animator.animate(this.target, {
|
|
45
|
+
const duration = this.duration, easing = this.easing, {diffAttrs: diffAttrs} = this.params;
|
|
46
|
+
commitUpdateAnimationTarget(this.target, Object.assign({}, diffAttrs)), animator.animate(this.target, {
|
|
42
47
|
type: "to",
|
|
43
48
|
to: Object.assign({}, diffAttrs),
|
|
44
49
|
duration: duration,
|