@visactor/vchart-extension 2.1.4 → 2.1.5-alpha.1
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/build/index.js +251 -51
- package/build/index.min.js +1 -1
- package/cjs/charts/3d/arc-3d.js +1 -1
- package/cjs/charts/3d/enum.js +1 -1
- package/cjs/charts/3d/graphic-creator.js +1 -1
- package/cjs/charts/3d/interface.js +1 -1
- package/cjs/charts/3d/layout.js +1 -1
- package/cjs/charts/3d/plugin.js +1 -1
- package/cjs/charts/3d/pyramid-3d.js +1 -1
- package/cjs/charts/3d/rect-3d.js +1 -1
- package/cjs/charts/3d/util.js +1 -1
- package/cjs/charts/axis-3d/band-axis.js +2 -1
- package/cjs/charts/axis-3d/log-axis.js +1 -2
- package/cjs/charts/bar-3d/chart.js +1 -2
- package/cjs/charts/candlestick/candlestick-transformer.js +1 -1
- package/cjs/charts/candlestick/candlestick.js +1 -1
- package/cjs/charts/candlestick/index.js +1 -1
- package/cjs/charts/candlestick/interface.js +1 -1
- package/cjs/charts/candlestick/util.js +1 -1
- package/cjs/charts/combination-candlestick/combination-candlestick-transformer.js +1 -1
- package/cjs/charts/combination-candlestick/combination-candlestick.js +1 -1
- package/cjs/charts/combination-candlestick/constant.js +1 -1
- package/cjs/charts/combination-candlestick/index.js +1 -1
- package/cjs/charts/combination-candlestick/interface.js +1 -1
- package/cjs/charts/conversion-funnel/arrow-data-transform.js +1 -1
- package/cjs/charts/conversion-funnel/constants.js +1 -1
- package/cjs/charts/conversion-funnel/conversion-funnel-transformer.js +1 -1
- package/cjs/charts/conversion-funnel/conversion-funnel.js +1 -2
- package/cjs/charts/conversion-funnel/index.js +1 -1
- package/cjs/charts/conversion-funnel/interface.js +1 -1
- package/cjs/charts/conversion-funnel/util.js +1 -1
- package/cjs/charts/histogram-3d/chart.js +1 -1
- package/cjs/charts/histogram-3d/index.js +1 -1
- package/cjs/charts/histogram-3d/interface.js +1 -1
- package/cjs/charts/image-cloud/image-cloud-transformer.js +1 -1
- package/cjs/charts/image-cloud/image-cloud.js +1 -1
- package/cjs/charts/image-cloud/index.js +1 -1
- package/cjs/charts/image-cloud/interface.js +1 -1
- package/cjs/components/bar-link/bar-link.js +1 -1
- package/cjs/components/bar-link/constant.js +1 -1
- package/cjs/components/bar-link/index.js +1 -1
- package/cjs/components/bar-link/type.js +1 -1
- package/cjs/components/bar-link/util.js +1 -1
- package/cjs/components/bar-regression-line/index.js +1 -1
- package/cjs/components/bar-regression-line/type.js +1 -1
- package/cjs/components/extension-mark-sync-state/extension-mark-sync-state.js +1 -1
- package/cjs/components/extension-mark-sync-state/index.js +1 -1
- package/cjs/components/extension-mark-sync-state/type.js +1 -1
- package/cjs/components/histogram-regression-line/index.js +1 -1
- package/cjs/components/histogram-regression-line/type.js +2 -1
- package/cjs/components/map-label/index.js +1 -1
- package/cjs/components/map-label/layout.js +1 -1
- package/cjs/components/map-label/map-label-transformer.js +2 -1
- package/cjs/components/map-label/map-label.js +1 -1
- package/cjs/components/map-label/theme.js +1 -1
- package/cjs/components/map-label/type.js +1 -1
- package/cjs/components/regression-line/index.js +1 -1
- package/cjs/components/regression-line/regression-line.js +1 -1
- package/cjs/components/regression-line/type.js +1 -1
- package/cjs/components/scatter-regression-line/index.js +1 -1
- package/cjs/components/scatter-regression-line/type.js +1 -1
- package/cjs/components/series-break/constant.js +1 -1
- package/cjs/components/series-break/index.js +1 -1
- package/cjs/components/series-break/series-break.js +1 -1
- package/cjs/components/series-break/type.js +1 -1
- package/cjs/components/series-break/util.js +1 -1
- package/cjs/components/series-label/constant.js +1 -1
- package/cjs/components/series-label/index.js +1 -1
- package/cjs/components/series-label/series-label.js +1 -1
- package/cjs/components/series-label/type.js +1 -1
- package/cjs/components/series-label/util.js +1 -1
- package/esm/charts/3d/arc-3d.js +1 -1
- package/esm/charts/3d/enum.js +1 -1
- package/esm/charts/3d/graphic-creator.js +1 -1
- package/esm/charts/3d/interface.js +1 -1
- package/esm/charts/3d/layout.js +1 -1
- package/esm/charts/3d/plugin.js +1 -1
- package/esm/charts/3d/pyramid-3d.js +1 -1
- package/esm/charts/3d/rect-3d.js +1 -1
- package/esm/charts/3d/util.js +1 -1
- package/esm/charts/axis-3d/band-axis.js +2 -1
- package/esm/charts/axis-3d/log-axis.js +1 -2
- package/esm/charts/bar-3d/chart.js +1 -2
- package/esm/charts/candlestick/candlestick-transformer.js +1 -1
- package/esm/charts/candlestick/candlestick.js +1 -1
- package/esm/charts/candlestick/index.js +1 -1
- package/esm/charts/candlestick/interface.js +1 -1
- package/esm/charts/candlestick/util.js +1 -1
- package/esm/charts/combination-candlestick/combination-candlestick-transformer.js +1 -1
- package/esm/charts/combination-candlestick/combination-candlestick.js +1 -1
- package/esm/charts/combination-candlestick/constant.js +1 -1
- package/esm/charts/combination-candlestick/index.js +1 -1
- package/esm/charts/combination-candlestick/interface.js +1 -1
- package/esm/charts/conversion-funnel/arrow-data-transform.js +1 -1
- package/esm/charts/conversion-funnel/constants.js +1 -1
- package/esm/charts/conversion-funnel/conversion-funnel-transformer.js +1 -1
- package/esm/charts/conversion-funnel/conversion-funnel.js +1 -2
- package/esm/charts/conversion-funnel/index.js +1 -1
- package/esm/charts/conversion-funnel/interface.js +1 -1
- package/esm/charts/conversion-funnel/util.js +1 -1
- package/esm/charts/histogram-3d/chart.js +1 -1
- package/esm/charts/histogram-3d/index.js +1 -1
- package/esm/charts/histogram-3d/interface.js +1 -1
- package/esm/charts/image-cloud/image-cloud-transformer.js +1 -1
- package/esm/charts/image-cloud/image-cloud.js +1 -1
- package/esm/charts/image-cloud/index.js +1 -1
- package/esm/charts/image-cloud/interface.js +1 -1
- package/esm/components/bar-link/bar-link.js +1 -1
- package/esm/components/bar-link/constant.js +1 -1
- package/esm/components/bar-link/index.js +1 -1
- package/esm/components/bar-link/type.js +1 -1
- package/esm/components/bar-link/util.js +1 -1
- package/esm/components/bar-regression-line/index.js +1 -1
- package/esm/components/bar-regression-line/type.js +1 -1
- package/esm/components/extension-mark-sync-state/extension-mark-sync-state.js +1 -1
- package/esm/components/extension-mark-sync-state/index.js +1 -1
- package/esm/components/extension-mark-sync-state/type.js +1 -1
- package/esm/components/histogram-regression-line/index.js +1 -1
- package/esm/components/histogram-regression-line/type.js +2 -1
- package/esm/components/map-label/index.js +1 -1
- package/esm/components/map-label/layout.js +1 -1
- package/esm/components/map-label/map-label-transformer.js +2 -1
- package/esm/components/map-label/map-label.js +1 -1
- package/esm/components/map-label/theme.js +1 -1
- package/esm/components/map-label/type.js +1 -1
- package/esm/components/regression-line/index.js +1 -1
- package/esm/components/regression-line/regression-line.js +1 -1
- package/esm/components/regression-line/type.js +1 -1
- package/esm/components/scatter-regression-line/index.js +1 -1
- package/esm/components/scatter-regression-line/type.js +1 -1
- package/esm/components/series-break/constant.js +1 -1
- package/esm/components/series-break/index.js +1 -1
- package/esm/components/series-break/series-break.js +1 -1
- package/esm/components/series-break/type.js +1 -1
- package/esm/components/series-break/util.js +1 -1
- package/esm/components/series-label/constant.js +1 -1
- package/esm/components/series-label/index.js +1 -1
- package/esm/components/series-label/series-label.js +1 -1
- package/esm/components/series-label/type.js +1 -1
- package/esm/components/series-label/util.js +1 -1
- package/package.json +8 -8
package/build/index.js
CHANGED
|
@@ -2914,7 +2914,7 @@
|
|
|
2914
2914
|
constructor() {
|
|
2915
2915
|
super(), this._uid = Generator.GenAutoIncrementId(), this._firstChild = null, this._lastChild = null, this.parent = null, this._count = 1;
|
|
2916
2916
|
}
|
|
2917
|
-
onParentSharedStateTreeChanged(_stage, _layer) {}
|
|
2917
|
+
onParentSharedStateTreeChanged(_stage, _layer, _inheritedSharedStateScope) {}
|
|
2918
2918
|
forEachChildren(cb, reverse = !1) {
|
|
2919
2919
|
if (reverse) {
|
|
2920
2920
|
let child = this._lastChild,
|
|
@@ -6451,18 +6451,21 @@
|
|
|
6451
6451
|
}
|
|
6452
6452
|
}
|
|
6453
6453
|
|
|
6454
|
-
function
|
|
6454
|
+
function getScaledStrokeWithMatrix(matrix, width, dpr) {
|
|
6455
6455
|
let strokeWidth = width;
|
|
6456
6456
|
const {
|
|
6457
6457
|
a: a,
|
|
6458
6458
|
b: b,
|
|
6459
6459
|
c: c,
|
|
6460
6460
|
d: d
|
|
6461
|
-
} =
|
|
6461
|
+
} = matrix,
|
|
6462
6462
|
scaleX = Math.sign(a) * Math.sqrt(a * a + b * b),
|
|
6463
6463
|
scaleY = Math.sign(d) * Math.sqrt(c * c + d * d);
|
|
6464
6464
|
return scaleX + scaleY === 0 ? 0 : (strokeWidth = strokeWidth / Math.abs(scaleX + scaleY) * 2 * dpr, strokeWidth);
|
|
6465
6465
|
}
|
|
6466
|
+
function getScaledStroke(context, width, dpr) {
|
|
6467
|
+
return getScaledStrokeWithMatrix(context.currentMatrix, width, dpr);
|
|
6468
|
+
}
|
|
6466
6469
|
function createColor(context, c, params, offsetX = 0, offsetY = 0) {
|
|
6467
6470
|
var _a, _b, _c, _d;
|
|
6468
6471
|
if (!c || !0 === c) return "black";
|
|
@@ -7164,7 +7167,7 @@
|
|
|
7164
7167
|
}
|
|
7165
7168
|
class StateTransitionOrchestrator {
|
|
7166
7169
|
analyzeTransition(targetAttrs, hasAnimation, options = {}) {
|
|
7167
|
-
var _a, _b;
|
|
7170
|
+
var _a, _b, _c, _d;
|
|
7168
7171
|
const plan = {
|
|
7169
7172
|
targetAttrs: Object.assign({}, targetAttrs),
|
|
7170
7173
|
animateAttrs: {},
|
|
@@ -7173,10 +7176,17 @@
|
|
|
7173
7176
|
if (!hasAnimation) return plan;
|
|
7174
7177
|
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)),
|
|
7175
7178
|
isClear = !0 === options.isClear,
|
|
7176
|
-
|
|
7179
|
+
getDefaultAttribute = options.getDefaultAttribute,
|
|
7180
|
+
readDefaultAttribute = getDefaultAttribute,
|
|
7181
|
+
readStateTransitionDefaultAttribute = null !== (_c = options.getStateTransitionDefaultAttribute) && void 0 !== _c ? _c : getDefaultAttribute,
|
|
7177
7182
|
shouldSkipDefaultAttribute = options.shouldSkipDefaultAttribute,
|
|
7178
|
-
|
|
7179
|
-
|
|
7183
|
+
stateTransitionTargetAttrs = null !== (_d = options.stateTransitionTargetAttrs) && void 0 !== _d ? _d : targetAttrs,
|
|
7184
|
+
assignTransitionAttr = (key, value, isRemovedStateAttr = !1) => {
|
|
7185
|
+
if (noWorkAnimateAttr[key]) plan.noAnimateAttrs[key] = value;else if (isRemovedStateAttr && void 0 === value) {
|
|
7186
|
+
const defaultValue = null == readStateTransitionDefaultAttribute ? void 0 : readStateTransitionDefaultAttribute(key, stateTransitionTargetAttrs);
|
|
7187
|
+
if (void 0 === defaultValue && (null == shouldSkipDefaultAttribute ? void 0 : shouldSkipDefaultAttribute(key, stateTransitionTargetAttrs))) return;
|
|
7188
|
+
plan.animateAttrs[key] = defaultValue;
|
|
7189
|
+
} else if (isClear && void 0 === value) {
|
|
7180
7190
|
if (null == shouldSkipDefaultAttribute ? void 0 : shouldSkipDefaultAttribute(key, targetAttrs)) return;
|
|
7181
7191
|
plan.animateAttrs[key] = readDefaultAttribute(key);
|
|
7182
7192
|
} else plan.animateAttrs[key] = value;
|
|
@@ -7188,7 +7198,7 @@
|
|
|
7188
7198
|
const extraAnimateAttrs = options.extraAnimateAttrs;
|
|
7189
7199
|
if (extraAnimateAttrs) for (const key in extraAnimateAttrs) {
|
|
7190
7200
|
const hasTargetAttr = Object.prototype.hasOwnProperty.call(targetAttrs, key);
|
|
7191
|
-
!Object.prototype.hasOwnProperty.call(extraAnimateAttrs, key) || hasTargetAttr && void 0 !== targetAttrs[key] || assignTransitionAttr(key, extraAnimateAttrs[key]);
|
|
7201
|
+
!Object.prototype.hasOwnProperty.call(extraAnimateAttrs, key) || hasTargetAttr && void 0 !== targetAttrs[key] || assignTransitionAttr(key, extraAnimateAttrs[key], !0);
|
|
7192
7202
|
}
|
|
7193
7203
|
return plan;
|
|
7194
7204
|
}
|
|
@@ -7220,9 +7230,11 @@
|
|
|
7220
7230
|
noWorkAnimateAttr: graphic.getNoWorkAnimateAttr(),
|
|
7221
7231
|
isClear: !0,
|
|
7222
7232
|
getDefaultAttribute: graphic.getDefaultAttribute.bind(graphic),
|
|
7233
|
+
getStateTransitionDefaultAttribute: options.getStateTransitionDefaultAttribute,
|
|
7223
7234
|
shouldSkipDefaultAttribute: null !== (_a = options.shouldSkipDefaultAttribute) && void 0 !== _a ? _a : graphic.shouldSkipStateTransitionDefaultAttribute.bind(graphic),
|
|
7224
7235
|
animateConfig: options.animateConfig,
|
|
7225
|
-
extraAnimateAttrs: options.extraAnimateAttrs
|
|
7236
|
+
extraAnimateAttrs: options.extraAnimateAttrs,
|
|
7237
|
+
stateTransitionTargetAttrs: options.stateTransitionTargetAttrs
|
|
7226
7238
|
});
|
|
7227
7239
|
return this.applyTransition(graphic, plan, hasAnimation, options);
|
|
7228
7240
|
}
|
|
@@ -7415,14 +7427,17 @@
|
|
|
7415
7427
|
}
|
|
7416
7428
|
return null === (_a = this.stage) || void 0 === _a ? void 0 : _a.rootSharedStateScope;
|
|
7417
7429
|
}
|
|
7418
|
-
|
|
7430
|
+
syncSharedStateScopeBinding(nextScope, markDirty = !0) {
|
|
7419
7431
|
var _a;
|
|
7420
|
-
const nextScope = this.resolveBoundSharedStateScope();
|
|
7421
7432
|
return this.boundSharedStateScope === nextScope ? (this.syncSharedStateActiveRegistrations(), !1) : (this.boundSharedStateScope = nextScope, this.boundSharedStateRevision = void 0, this.compiledStateDefinitions = void 0, this.compiledStateDefinitionsCacheKey = void 0, this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0, this.syncSharedStateActiveRegistrations(), markDirty && (null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) && this.markSharedStateDirty(), !0);
|
|
7422
7433
|
}
|
|
7423
|
-
|
|
7434
|
+
syncSharedStateScopeBindingFromTree(markDirty = !0, inheritedSharedStateScope) {
|
|
7435
|
+
const nextScope = void 0 === inheritedSharedStateScope ? this.resolveBoundSharedStateScope() : null != inheritedSharedStateScope ? inheritedSharedStateScope : void 0;
|
|
7436
|
+
return this.syncSharedStateScopeBinding(nextScope, markDirty);
|
|
7437
|
+
}
|
|
7438
|
+
syncSharedStateScopeBindingOnTreeChange(markDirty = !0, inheritedSharedStateScope) {
|
|
7424
7439
|
var _a, _b;
|
|
7425
|
-
return !!((null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) || this.boundSharedStateScope || (null === (_b = this.registeredActiveScopes) || void 0 === _b ? void 0 : _b.size) || this.sharedStateDirty) && this.syncSharedStateScopeBindingFromTree(markDirty);
|
|
7440
|
+
return !!((null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) || this.boundSharedStateScope || (null === (_b = this.registeredActiveScopes) || void 0 === _b ? void 0 : _b.size) || this.sharedStateDirty) && this.syncSharedStateScopeBindingFromTree(markDirty, inheritedSharedStateScope);
|
|
7426
7441
|
}
|
|
7427
7442
|
syncSharedStateActiveRegistrations() {
|
|
7428
7443
|
var _a;
|
|
@@ -7430,6 +7445,7 @@
|
|
|
7430
7445
|
if (!(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) || !this.boundSharedStateScope) return (null == previousScopes ? void 0 : previousScopes.size) && (previousScopes.forEach(scope => {
|
|
7431
7446
|
scope.subtreeActiveDescendants.delete(this);
|
|
7432
7447
|
}), previousScopes.clear()), void (this.registeredActiveScopes = void 0);
|
|
7448
|
+
if ((null == previousScopes ? void 0 : previousScopes.size) && this.isSharedStateScopeChainRegistered(previousScopes)) return;
|
|
7433
7449
|
const nextScopes = new Set(collectSharedStateScopeChain(this.boundSharedStateScope));
|
|
7434
7450
|
null == previousScopes || previousScopes.forEach(scope => {
|
|
7435
7451
|
nextScopes.has(scope) || scope.subtreeActiveDescendants.delete(this);
|
|
@@ -7437,6 +7453,15 @@
|
|
|
7437
7453
|
scope.subtreeActiveDescendants.add(this);
|
|
7438
7454
|
}), this.registeredActiveScopes = nextScopes;
|
|
7439
7455
|
}
|
|
7456
|
+
isSharedStateScopeChainRegistered(previousScopes) {
|
|
7457
|
+
let scope = this.boundSharedStateScope,
|
|
7458
|
+
scopeCount = 0;
|
|
7459
|
+
for (; scope;) {
|
|
7460
|
+
if (!previousScopes.has(scope)) return !1;
|
|
7461
|
+
scopeCount += 1, scope = scope.parentScope;
|
|
7462
|
+
}
|
|
7463
|
+
return scopeCount === previousScopes.size;
|
|
7464
|
+
}
|
|
7440
7465
|
clearSharedStateActiveRegistrations() {
|
|
7441
7466
|
const previousScopes = this.registeredActiveScopes;
|
|
7442
7467
|
previousScopes && (previousScopes.forEach(scope => {
|
|
@@ -7446,8 +7471,8 @@
|
|
|
7446
7471
|
markSharedStateDirty() {
|
|
7447
7472
|
this.sharedStateDirty = !0, enqueueGraphicSharedStateRefresh(this.stage, this), scheduleStageSharedStateRefresh(this.stage);
|
|
7448
7473
|
}
|
|
7449
|
-
onParentSharedStateTreeChanged(stage, layer) {
|
|
7450
|
-
this.stage === stage && this.layer === layer ? this.syncSharedStateScopeBindingOnTreeChange() : this.setStage(stage, layer);
|
|
7474
|
+
onParentSharedStateTreeChanged(stage, layer, inheritedSharedStateScope) {
|
|
7475
|
+
this.stage === stage && this.layer === layer ? this.syncSharedStateScopeBindingOnTreeChange(!0, inheritedSharedStateScope) : this.setStage(stage, layer, inheritedSharedStateScope);
|
|
7451
7476
|
}
|
|
7452
7477
|
refreshSharedStateBeforeRender() {
|
|
7453
7478
|
var _a;
|
|
@@ -7497,21 +7522,20 @@
|
|
|
7497
7522
|
}), snapshot) : snapshot;
|
|
7498
7523
|
}
|
|
7499
7524
|
buildRemovedStateAnimationAttrs(targetStateAttrs, previousResolvedStatePatch) {
|
|
7500
|
-
|
|
7501
|
-
if (!previousResolvedStatePatch) return extraAttrs;
|
|
7525
|
+
if (!previousResolvedStatePatch) return;
|
|
7502
7526
|
const snapshot = this.buildStaticAttributeSnapshot(),
|
|
7503
|
-
|
|
7527
|
+
extraAttrs = {};
|
|
7504
7528
|
return Object.keys(previousResolvedStatePatch).forEach(key => {
|
|
7505
7529
|
const hasTargetAttr = Object.prototype.hasOwnProperty.call(targetStateAttrs, key);
|
|
7506
7530
|
if (hasTargetAttr && void 0 !== targetStateAttrs[key]) return;
|
|
7507
7531
|
const assignFallbackAttr = value => {
|
|
7508
|
-
|
|
7532
|
+
extraAttrs[key] = void 0 === value ? value : cloneAttributeValue(value);
|
|
7509
7533
|
};
|
|
7510
|
-
|
|
7511
|
-
|
|
7512
|
-
|
|
7513
|
-
|
|
7514
|
-
}
|
|
7534
|
+
hasTargetAttr ? assignFallbackAttr(targetStateAttrs[key]) : Object.prototype.hasOwnProperty.call(snapshot, key) ? assignFallbackAttr(snapshot[key]) : assignFallbackAttr(void 0);
|
|
7535
|
+
}), {
|
|
7536
|
+
extraAttrs: extraAttrs,
|
|
7537
|
+
stateTransitionTargetAttrs: snapshot
|
|
7538
|
+
};
|
|
7515
7539
|
}
|
|
7516
7540
|
syncObjectToSnapshot(target, snapshot, excludedKeys) {
|
|
7517
7541
|
const delta = new Map();
|
|
@@ -8098,6 +8122,10 @@
|
|
|
8098
8122
|
var _a;
|
|
8099
8123
|
return null === (_a = this.states) || void 0 === _a ? void 0 : _a[stateName];
|
|
8100
8124
|
}
|
|
8125
|
+
setStateDefinitionsWithCompiled(definitions, compiledDefinitions) {
|
|
8126
|
+
var _a;
|
|
8127
|
+
this.states = definitions, this.localStateDefinitionsSource !== definitions && (this.localStateDefinitionsSource = definitions, this.localStateDefinitionsVersion = (null !== (_a = this.localStateDefinitionsVersion) && void 0 !== _a ? _a : 0) + 1), this.compiledStateDefinitions = compiledDefinitions, this.compiledStateDefinitionsCacheKey = `local:${this.localStateDefinitionsVersion}`;
|
|
8128
|
+
}
|
|
8101
8129
|
getStateResolveBaseAttrs() {
|
|
8102
8130
|
var _a;
|
|
8103
8131
|
return null !== (_a = this.baseAttributes) && void 0 !== _a ? _a : this.attribute;
|
|
@@ -8227,29 +8255,37 @@
|
|
|
8227
8255
|
resolvedStateAttrs: resolvedStateAttrs
|
|
8228
8256
|
} = this.resolveGraphicStateTransition(states, !0),
|
|
8229
8257
|
patchChanged = !this.sameStatePatches(previousResolvedStatePatch, resolvedStateAttrs);
|
|
8230
|
-
patchChanged
|
|
8258
|
+
if ((!patchChanged || this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !1)) && (this.currentStates = transition.states, this.effectiveStates = [...effectiveStates], this.resolvedStatePatch = resolvedStateAttrs, this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), patchChanged)) if (hasAnimation && animateSameStatePatchChange) {
|
|
8259
|
+
this._syncFinalAttributeFromStaticTruth();
|
|
8260
|
+
const removedStateAnimationAttrs = this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch);
|
|
8261
|
+
this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, null == removedStateAnimationAttrs ? void 0 : removedStateAnimationAttrs.extraAttrs, null == removedStateAnimationAttrs ? void 0 : removedStateAnimationAttrs.stateTransitionTargetAttrs);
|
|
8262
|
+
} else this.stopStateAnimates(), this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
|
|
8231
8263
|
type: AttributeUpdateType.STATE
|
|
8232
8264
|
}) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, this.resolvedStatePatch, {
|
|
8233
8265
|
type: AttributeUpdateType.STATE
|
|
8234
|
-
}), this.emitStateUpdateEvent()
|
|
8266
|
+
}), this.emitStateUpdateEvent();
|
|
8235
8267
|
}
|
|
8236
8268
|
resolveStateAnimateConfig(animateConfig) {
|
|
8237
8269
|
var _a, _b, _c;
|
|
8238
8270
|
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;
|
|
8239
8271
|
}
|
|
8240
|
-
applyStateAttrs(attrs, stateNames, hasAnimation, isClear, animateConfig, extraAnimateAttrs) {
|
|
8272
|
+
applyStateAttrs(attrs, stateNames, hasAnimation, isClear, animateConfig, extraAnimateAttrs, stateTransitionTargetAttrs) {
|
|
8241
8273
|
const resolvedAnimateConfig = hasAnimation ? this.resolveStateAnimateConfig(animateConfig) : void 0,
|
|
8242
8274
|
transitionOptions = resolvedAnimateConfig ? {
|
|
8243
8275
|
animateConfig: resolvedAnimateConfig,
|
|
8244
8276
|
extraAnimateAttrs: extraAnimateAttrs,
|
|
8245
|
-
|
|
8277
|
+
getStateTransitionDefaultAttribute: this.getStateTransitionDefaultAttribute.bind(this),
|
|
8278
|
+
shouldSkipDefaultAttribute: this.shouldSkipStateTransitionDefaultAttribute.bind(this),
|
|
8279
|
+
stateTransitionTargetAttrs: stateTransitionTargetAttrs
|
|
8246
8280
|
} : void 0;
|
|
8247
8281
|
if (isClear) return void this.getStateTransitionOrchestrator().applyClearTransition(this, attrs, hasAnimation, transitionOptions);
|
|
8248
8282
|
const plan = this.getStateTransitionOrchestrator().analyzeTransition(attrs, hasAnimation, {
|
|
8249
8283
|
noWorkAnimateAttr: this.getNoWorkAnimateAttr(),
|
|
8250
8284
|
animateConfig: resolvedAnimateConfig,
|
|
8251
8285
|
extraAnimateAttrs: extraAnimateAttrs,
|
|
8252
|
-
|
|
8286
|
+
getStateTransitionDefaultAttribute: this.getStateTransitionDefaultAttribute.bind(this),
|
|
8287
|
+
shouldSkipDefaultAttribute: this.shouldSkipStateTransitionDefaultAttribute.bind(this),
|
|
8288
|
+
stateTransitionTargetAttrs: stateTransitionTargetAttrs
|
|
8253
8289
|
});
|
|
8254
8290
|
this.getStateTransitionOrchestrator().applyTransition(this, plan, hasAnimation, transitionOptions);
|
|
8255
8291
|
}
|
|
@@ -8276,11 +8312,15 @@
|
|
|
8276
8312
|
transition = this.resolveClearStatesTransition();
|
|
8277
8313
|
if (!transition.changed && 0 === previousStates.length) return this.currentStates = [], this.effectiveStates = [], this.resolvedStatePatch = void 0, this.sharedStateDirty = !1, void this.clearSharedStateActiveRegistrations();
|
|
8278
8314
|
const resolvedStateAttrs = hasAnimation || this.hasCustomEvent("beforeStateUpdate") ? cloneAttributeValue(null !== (_b = this.baseAttributes) && void 0 !== _b ? _b : {}) : null !== (_c = this.baseAttributes) && void 0 !== _c ? _c : {};
|
|
8279
|
-
transition.changed
|
|
8315
|
+
if (!transition.changed || this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !0)) if (this.currentStates = transition.states, this.effectiveStates = [], this.resolvedStatePatch = void 0, this.sharedStateDirty = !1, this.clearSharedStateActiveRegistrations(), hasAnimation) {
|
|
8316
|
+
this._syncFinalAttributeFromStaticTruth();
|
|
8317
|
+
const removedStateAnimationAttrs = this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch);
|
|
8318
|
+
this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !0, void 0, null == removedStateAnimationAttrs ? void 0 : removedStateAnimationAttrs.extraAttrs, null == removedStateAnimationAttrs ? void 0 : removedStateAnimationAttrs.stateTransitionTargetAttrs);
|
|
8319
|
+
} else this.stopStateAnimates(), this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
|
|
8280
8320
|
type: AttributeUpdateType.STATE
|
|
8281
8321
|
}) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, void 0, {
|
|
8282
8322
|
type: AttributeUpdateType.STATE
|
|
8283
|
-
}), this.emitStateUpdateEvent()
|
|
8323
|
+
}), this.emitStateUpdateEvent();
|
|
8284
8324
|
}
|
|
8285
8325
|
removeState(stateName, hasAnimation) {
|
|
8286
8326
|
const transition = this.resolveRemoveStateTransition(stateName);
|
|
@@ -8321,11 +8361,15 @@
|
|
|
8321
8361
|
effectiveStates: effectiveStates,
|
|
8322
8362
|
resolvedStateAttrs: resolvedStateAttrs
|
|
8323
8363
|
} = this.resolveGraphicStateTransition(states);
|
|
8324
|
-
|
|
8364
|
+
if ((transition.changed || !this.sameStateNames(previousStates, transition.states)) && this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !1)) if (this.currentStates = transition.states, this.effectiveStates = [...effectiveStates], this.resolvedStatePatch = resolvedStateAttrs, this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), hasAnimation) {
|
|
8365
|
+
this._syncFinalAttributeFromStaticTruth();
|
|
8366
|
+
const removedStateAnimationAttrs = this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch);
|
|
8367
|
+
this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, null == removedStateAnimationAttrs ? void 0 : removedStateAnimationAttrs.extraAttrs, null == removedStateAnimationAttrs ? void 0 : removedStateAnimationAttrs.stateTransitionTargetAttrs);
|
|
8368
|
+
} else this.stopStateAnimates(), this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
|
|
8325
8369
|
type: AttributeUpdateType.STATE
|
|
8326
8370
|
}) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, this.resolvedStatePatch, {
|
|
8327
8371
|
type: AttributeUpdateType.STATE
|
|
8328
|
-
}), this.emitStateUpdateEvent()
|
|
8372
|
+
}), this.emitStateUpdateEvent();
|
|
8329
8373
|
}
|
|
8330
8374
|
invalidateResolver() {
|
|
8331
8375
|
var _a, _b;
|
|
@@ -8445,12 +8489,12 @@
|
|
|
8445
8489
|
this._globalTransMatrix.translate(scrollX, scrollY);
|
|
8446
8490
|
}
|
|
8447
8491
|
}
|
|
8448
|
-
setStage(stage, layer) {
|
|
8492
|
+
setStage(stage, layer, inheritedSharedStateScope) {
|
|
8449
8493
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
8450
8494
|
const graphicService = null !== (_c = null !== (_a = null == stage ? void 0 : stage.graphicService) && void 0 !== _a ? _a : null === (_b = this.stage) || void 0 === _b ? void 0 : _b.graphicService) && void 0 !== _c ? _c : application.graphicService,
|
|
8451
8495
|
previousStage = this.stage;
|
|
8452
8496
|
if (this.stage !== stage || this.layer !== layer) {
|
|
8453
|
-
if (this.stage = stage, this.layer = layer, ((null === (_d = this.currentStates) || void 0 === _d ? void 0 : _d.length) || this.boundSharedStateScope || (null === (_e = this.registeredActiveScopes) || void 0 === _e ? void 0 : _e.size) || this.sharedStateDirty) && this.syncSharedStateScopeBindingOnTreeChange(!0), this.setStageToShadowRoot(stage, layer), this.mayHaveTrackedAnimates() && this.hasAnyTrackedAnimate()) {
|
|
8497
|
+
if (this.stage = stage, this.layer = layer, ((null === (_d = this.currentStates) || void 0 === _d ? void 0 : _d.length) || this.boundSharedStateScope || (null === (_e = this.registeredActiveScopes) || void 0 === _e ? void 0 : _e.size) || this.sharedStateDirty) && this.syncSharedStateScopeBindingOnTreeChange(!0, inheritedSharedStateScope), this.setStageToShadowRoot(stage, layer), this.mayHaveTrackedAnimates() && this.hasAnyTrackedAnimate()) {
|
|
8454
8498
|
const previousTimeline = null === (_f = null == previousStage ? void 0 : previousStage.getTimeline) || void 0 === _f ? void 0 : _f.call(previousStage),
|
|
8455
8499
|
nextTimeline = null === (_g = null == stage ? void 0 : stage.getTimeline) || void 0 === _g ? void 0 : _g.call(stage),
|
|
8456
8500
|
detachedStageAnimates = [];
|
|
@@ -8467,7 +8511,7 @@
|
|
|
8467
8511
|
}
|
|
8468
8512
|
return this._onSetStage && this._onSetStage(this, stage, layer), void (null === (_h = null == graphicService ? void 0 : graphicService.onSetStage) || void 0 === _h || _h.call(graphicService, this, stage));
|
|
8469
8513
|
}
|
|
8470
|
-
((null === (_j = this.currentStates) || void 0 === _j ? void 0 : _j.length) || this.boundSharedStateScope || (null === (_k = this.registeredActiveScopes) || void 0 === _k ? void 0 : _k.size) || this.sharedStateDirty) && this.syncSharedStateScopeBindingOnTreeChange(!0);
|
|
8514
|
+
((null === (_j = this.currentStates) || void 0 === _j ? void 0 : _j.length) || this.boundSharedStateScope || (null === (_k = this.registeredActiveScopes) || void 0 === _k ? void 0 : _k.size) || this.sharedStateDirty) && this.syncSharedStateScopeBindingOnTreeChange(!0, inheritedSharedStateScope);
|
|
8471
8515
|
}
|
|
8472
8516
|
detachStageForRelease() {
|
|
8473
8517
|
var _a, _b, _c;
|
|
@@ -8889,13 +8933,13 @@
|
|
|
8889
8933
|
child.setStage(null, null);
|
|
8890
8934
|
}), this.addUpdateBoundTag();
|
|
8891
8935
|
}
|
|
8892
|
-
setStage(stage, layer) {
|
|
8936
|
+
setStage(stage, layer, inheritedSharedStateScope) {
|
|
8893
8937
|
var _a, _b, _c, _d, _e, _f;
|
|
8894
8938
|
const graphicService = null !== (_c = null !== (_a = null == stage ? void 0 : stage.graphicService) && void 0 !== _a ? _a : null === (_b = this.stage) || void 0 === _b ? void 0 : _b.graphicService) && void 0 !== _c ? _c : application.graphicService,
|
|
8895
8939
|
needsSharedStateTreeSync = this.hasSharedStateDefinitions() || this.sharedStateScope || (null === (_d = this.currentStates) || void 0 === _d ? void 0 : _d.length) || this.boundSharedStateScope || (null === (_e = this.registeredActiveScopes) || void 0 === _e ? void 0 : _e.size) || this.sharedStateDirty;
|
|
8896
|
-
if (this.stage !== stage) return this.stage = stage, this.layer = layer, needsSharedStateTreeSync && (this.ensureSharedStateScopeBound(), this.syncSharedStateScopeBindingOnTreeChange(!0)), this.setStageToShadowRoot(stage, layer), this._onSetStage && this._onSetStage(this, stage, layer), null === (_f = null == graphicService ? void 0 : graphicService.onSetStage) || void 0 === _f || _f.call(graphicService, this, stage), void this.notifyChildrenSharedStateTreeChanged();
|
|
8940
|
+
if (this.stage !== stage) return this.stage = stage, this.layer = layer, needsSharedStateTreeSync && (this.ensureSharedStateScopeBound(), this.syncSharedStateScopeBindingOnTreeChange(!0, inheritedSharedStateScope)), this.setStageToShadowRoot(stage, layer), this._onSetStage && this._onSetStage(this, stage, layer), null === (_f = null == graphicService ? void 0 : graphicService.onSetStage) || void 0 === _f || _f.call(graphicService, this, stage), void this.notifyChildrenSharedStateTreeChanged(inheritedSharedStateScope);
|
|
8897
8941
|
const layerChanged = this.layer !== layer;
|
|
8898
|
-
layerChanged && (this.layer = layer), needsSharedStateTreeSync ? (this.ensureSharedStateScopeBound(), this.syncSharedStateScopeBindingOnTreeChange(!0), this.notifyChildrenSharedStateTreeChanged()) : layerChanged && this.notifyChildrenSharedStateTreeChanged();
|
|
8942
|
+
layerChanged && (this.layer = layer), needsSharedStateTreeSync ? (this.ensureSharedStateScopeBound(), this.syncSharedStateScopeBindingOnTreeChange(!0, inheritedSharedStateScope), this.notifyChildrenSharedStateTreeChanged(inheritedSharedStateScope)) : layerChanged && this.notifyChildrenSharedStateTreeChanged(inheritedSharedStateScope);
|
|
8899
8943
|
}
|
|
8900
8944
|
addUpdatePositionTag() {
|
|
8901
8945
|
super.addUpdatePositionTag(), this.forEachChildren(g => {
|
|
@@ -8954,17 +8998,26 @@
|
|
|
8954
8998
|
hasSharedStateDefinitions() {
|
|
8955
8999
|
return !!this._sharedStateDefinitions && Object.keys(this._sharedStateDefinitions).length > 0;
|
|
8956
9000
|
}
|
|
8957
|
-
|
|
9001
|
+
resolveChildSharedStateScope(inheritedSharedStateScope) {
|
|
9002
|
+
var _a;
|
|
9003
|
+
return this.sharedStateScope ? this.sharedStateScope : void 0 !== inheritedSharedStateScope ? inheritedSharedStateScope : null !== (_a = this.resolveBoundSharedStateScope()) && void 0 !== _a ? _a : null;
|
|
9004
|
+
}
|
|
9005
|
+
notifyChildrenSharedStateTreeChanged(inheritedSharedStateScope) {
|
|
9006
|
+
const childSharedStateScope = this.resolveChildSharedStateScope(inheritedSharedStateScope);
|
|
8958
9007
|
this.forEachChildren(item => {
|
|
8959
|
-
this.
|
|
9008
|
+
this.setStageToChild(item, childSharedStateScope);
|
|
8960
9009
|
});
|
|
8961
9010
|
}
|
|
8962
|
-
|
|
8963
|
-
child
|
|
9011
|
+
setStageToChild(child, inheritedSharedStateScope) {
|
|
9012
|
+
const graphic = child;
|
|
9013
|
+
"function" != typeof graphic.setStage || child.onParentSharedStateTreeChanged !== Graphic.prototype.onParentSharedStateTreeChanged && child.onParentSharedStateTreeChanged !== Group.prototype.onParentSharedStateTreeChanged || graphic.stage === this.stage && graphic.layer === this.layer ? child.onParentSharedStateTreeChanged(this.stage, this.layer, inheritedSharedStateScope) : graphic.setStage(this.stage, this.layer, inheritedSharedStateScope);
|
|
9014
|
+
}
|
|
9015
|
+
syncChildSharedStateTreeBinding(child, inheritedSharedStateScope) {
|
|
9016
|
+
void 0 === inheritedSharedStateScope && (inheritedSharedStateScope = this.resolveChildSharedStateScope()), this.setStageToChild(child, inheritedSharedStateScope);
|
|
8964
9017
|
}
|
|
8965
|
-
onParentSharedStateTreeChanged(stage, layer) {
|
|
9018
|
+
onParentSharedStateTreeChanged(stage, layer, inheritedSharedStateScope) {
|
|
8966
9019
|
var _a;
|
|
8967
|
-
this.stage === stage && this.layer === layer ? (this.ensureSharedStateScopeBound(), this.syncSharedStateScopeBindingOnTreeChange(!!(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length)), this.notifyChildrenSharedStateTreeChanged()) : this.setStage(stage, layer);
|
|
9020
|
+
this.stage === stage && this.layer === layer ? (this.ensureSharedStateScopeBound(), this.syncSharedStateScopeBindingOnTreeChange(!!(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length), inheritedSharedStateScope), this.notifyChildrenSharedStateTreeChanged(inheritedSharedStateScope)) : this.setStage(stage, layer, inheritedSharedStateScope);
|
|
8968
9021
|
}
|
|
8969
9022
|
}
|
|
8970
9023
|
Group.NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR;
|
|
@@ -10316,7 +10369,7 @@
|
|
|
10316
10369
|
}
|
|
10317
10370
|
|
|
10318
10371
|
var _a;
|
|
10319
|
-
const factoryRegistryKey = Symbol.for("@visactor/vchart/factory-registry@2.1.
|
|
10372
|
+
const factoryRegistryKey = Symbol.for("@visactor/vchart/factory-registry@2.1.5"),
|
|
10320
10373
|
globalFactoryRegistry = globalThis;
|
|
10321
10374
|
const factoryRegistry = null !== (_a = globalFactoryRegistry[factoryRegistryKey]) && void 0 !== _a ? _a : globalFactoryRegistry[factoryRegistryKey] = {
|
|
10322
10375
|
charts: {},
|
|
@@ -10843,7 +10896,132 @@
|
|
|
10843
10896
|
cap: 1
|
|
10844
10897
|
}, NOWORK_ANIMATE_ATTR);
|
|
10845
10898
|
|
|
10846
|
-
|
|
10899
|
+
function getPolygonWinding(points) {
|
|
10900
|
+
let signedArea = 0;
|
|
10901
|
+
for (let i = 0; i < points.length; i++) {
|
|
10902
|
+
const current = points[i],
|
|
10903
|
+
next = points[(i + 1) % points.length];
|
|
10904
|
+
signedArea += current.x * next.y - next.x * current.y;
|
|
10905
|
+
}
|
|
10906
|
+
return signedArea > 0 ? 1 : -1;
|
|
10907
|
+
}
|
|
10908
|
+
function offsetPolygonPoints(points, distance, closePath = !0) {
|
|
10909
|
+
var _a;
|
|
10910
|
+
const n = null !== (_a = null == points ? void 0 : points.length) && void 0 !== _a ? _a : 0;
|
|
10911
|
+
if (n < 2 || closePath && n < 3 || !distance) return points;
|
|
10912
|
+
const sign = getPolygonWinding(points),
|
|
10913
|
+
edgeCount = closePath ? n : n - 1,
|
|
10914
|
+
lines = [];
|
|
10915
|
+
for (let i = 0; i < edgeCount; i++) {
|
|
10916
|
+
const cur = points[i],
|
|
10917
|
+
next = points[(i + 1) % n],
|
|
10918
|
+
dx = next.x - cur.x,
|
|
10919
|
+
dy = next.y - cur.y,
|
|
10920
|
+
len = Math.sqrt(dx * dx + dy * dy);
|
|
10921
|
+
if (!len) {
|
|
10922
|
+
lines.push(null);
|
|
10923
|
+
continue;
|
|
10924
|
+
}
|
|
10925
|
+
const offsetX = sign * dy * distance / len,
|
|
10926
|
+
offsetY = -sign * dx * distance / len;
|
|
10927
|
+
lines.push({
|
|
10928
|
+
x: cur.x + offsetX,
|
|
10929
|
+
y: cur.y + offsetY,
|
|
10930
|
+
dx: dx,
|
|
10931
|
+
dy: dy,
|
|
10932
|
+
len: len,
|
|
10933
|
+
offsetX: offsetX,
|
|
10934
|
+
offsetY: offsetY
|
|
10935
|
+
});
|
|
10936
|
+
}
|
|
10937
|
+
const prevLines = new Array(n);
|
|
10938
|
+
let prevLine = null;
|
|
10939
|
+
if (closePath) for (let i = edgeCount - 1; i >= 0; i--) if (lines[i]) {
|
|
10940
|
+
prevLine = lines[i];
|
|
10941
|
+
break;
|
|
10942
|
+
}
|
|
10943
|
+
for (let i = 0; i < n; i++) prevLines[i] = prevLine, i < edgeCount && lines[i] && (prevLine = lines[i]);
|
|
10944
|
+
const nextLines = new Array(n);
|
|
10945
|
+
let nextLine = null;
|
|
10946
|
+
if (closePath) for (let count = 0; count < edgeCount; count++) {
|
|
10947
|
+
const line = lines[(n - 1 + count) % edgeCount];
|
|
10948
|
+
if (line) {
|
|
10949
|
+
nextLine = line;
|
|
10950
|
+
break;
|
|
10951
|
+
}
|
|
10952
|
+
}
|
|
10953
|
+
for (let i = n - 1; i >= 0; i--) i < edgeCount && lines[i] && (nextLine = lines[i]), nextLines[i] = nextLine;
|
|
10954
|
+
const offsetPointByLine = (point, line) => ({
|
|
10955
|
+
x: point.x + line.offsetX,
|
|
10956
|
+
y: point.y + line.offsetY
|
|
10957
|
+
}),
|
|
10958
|
+
result = [];
|
|
10959
|
+
for (let i = 0; i < n; i++) {
|
|
10960
|
+
const prev = prevLines[i],
|
|
10961
|
+
cur = nextLines[i],
|
|
10962
|
+
line = prev || cur;
|
|
10963
|
+
if (!line) {
|
|
10964
|
+
result.push(points[i]);
|
|
10965
|
+
continue;
|
|
10966
|
+
}
|
|
10967
|
+
if (!prev || !cur) {
|
|
10968
|
+
result.push(offsetPointByLine(points[i], line));
|
|
10969
|
+
continue;
|
|
10970
|
+
}
|
|
10971
|
+
const denominator = prev.dx * cur.dy - prev.dy * cur.dx;
|
|
10972
|
+
if (Math.abs(denominator) <= 1e-12 * prev.len * cur.len) {
|
|
10973
|
+
result.push(offsetPointByLine(points[i], cur));
|
|
10974
|
+
continue;
|
|
10975
|
+
}
|
|
10976
|
+
const t = ((cur.x - prev.x) * cur.dy - (cur.y - prev.y) * cur.dx) / denominator,
|
|
10977
|
+
point = {
|
|
10978
|
+
x: prev.x + prev.dx * t,
|
|
10979
|
+
y: prev.y + prev.dy * t
|
|
10980
|
+
};
|
|
10981
|
+
result.push(Number.isFinite(point.x) && Number.isFinite(point.y) ? point : offsetPointByLine(points[i], cur));
|
|
10982
|
+
}
|
|
10983
|
+
return result;
|
|
10984
|
+
}
|
|
10985
|
+
|
|
10986
|
+
const getBoundsScaleMatrix = polygon => {
|
|
10987
|
+
var _a;
|
|
10988
|
+
const globalMatrix = polygon.globalTransMatrix,
|
|
10989
|
+
viewBoxMatrix = null === (_a = polygon.stage) || void 0 === _a ? void 0 : _a.window.getViewBoxTransform();
|
|
10990
|
+
return viewBoxMatrix ? {
|
|
10991
|
+
a: viewBoxMatrix.a * globalMatrix.a + viewBoxMatrix.c * globalMatrix.b,
|
|
10992
|
+
b: viewBoxMatrix.b * globalMatrix.a + viewBoxMatrix.d * globalMatrix.b,
|
|
10993
|
+
c: viewBoxMatrix.a * globalMatrix.c + viewBoxMatrix.c * globalMatrix.d,
|
|
10994
|
+
d: viewBoxMatrix.b * globalMatrix.c + viewBoxMatrix.d * globalMatrix.d
|
|
10995
|
+
} : globalMatrix;
|
|
10996
|
+
};
|
|
10997
|
+
const getPolygonBoundsScale = polygon => getScaledStrokeWithMatrix(getBoundsScaleMatrix(polygon), 1, 1);
|
|
10998
|
+
const updateBoundsOfPolygonOuterBorder = (attribute, polygonTheme, aabbBounds, polygon) => {
|
|
10999
|
+
const {
|
|
11000
|
+
outerBorder: outerBorder,
|
|
11001
|
+
points = polygonTheme.points,
|
|
11002
|
+
closePath = polygonTheme.closePath,
|
|
11003
|
+
shadowBlur = polygonTheme.shadowBlur,
|
|
11004
|
+
keepStrokeScale = polygonTheme.keepStrokeScale
|
|
11005
|
+
} = attribute;
|
|
11006
|
+
if (outerBorder && !1 !== outerBorder.visible) {
|
|
11007
|
+
const defaultOuterBorder = polygonTheme.outerBorder,
|
|
11008
|
+
{
|
|
11009
|
+
distance = defaultOuterBorder.distance,
|
|
11010
|
+
lineWidth = defaultOuterBorder.lineWidth,
|
|
11011
|
+
lineJoin = defaultOuterBorder.lineJoin,
|
|
11012
|
+
strokeBoundsBuffer = defaultOuterBorder.strokeBoundsBuffer
|
|
11013
|
+
} = outerBorder,
|
|
11014
|
+
boundsScale = getPolygonBoundsScale(polygon);
|
|
11015
|
+
let scaledDistance = distance;
|
|
11016
|
+
keepStrokeScale || (scaledDistance *= boundsScale), offsetPolygonPoints(points, scaledDistance, closePath).forEach(point => {
|
|
11017
|
+
aabbBounds.add(point.x, point.y);
|
|
11018
|
+
});
|
|
11019
|
+
boundStroke(aabbBounds, (shadowBlur * boundsScale + lineWidth * (keepStrokeScale ? 1 : boundsScale)) / 2, "miter" === lineJoin, strokeBoundsBuffer);
|
|
11020
|
+
}
|
|
11021
|
+
return aabbBounds;
|
|
11022
|
+
};
|
|
11023
|
+
|
|
11024
|
+
const POLYGON_UPDATE_TAG_KEY = ["points", "cornerRadius", "outerBorder", "keepStrokeScale", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
10847
11025
|
class Polygon extends Graphic {
|
|
10848
11026
|
constructor(params) {
|
|
10849
11027
|
super(params), this.type = "polygon", this.numberType = POLYGON_NUMBER_TYPE;
|
|
@@ -10860,6 +11038,16 @@
|
|
|
10860
11038
|
getGraphicTheme() {
|
|
10861
11039
|
return getTheme(this).polygon;
|
|
10862
11040
|
}
|
|
11041
|
+
tryUpdateAABBBounds() {
|
|
11042
|
+
const {
|
|
11043
|
+
outerBorder: outerBorder
|
|
11044
|
+
} = this.attribute;
|
|
11045
|
+
if (outerBorder && !1 !== outerBorder.visible) {
|
|
11046
|
+
const boundsScale = getPolygonBoundsScale(this);
|
|
11047
|
+
boundsScale !== this._outerBorderBoundsScale && (this._outerBorderBoundsScale = boundsScale, this.addUpdateBoundTag());
|
|
11048
|
+
} else this._outerBorderBoundsScale = void 0;
|
|
11049
|
+
return super.tryUpdateAABBBounds();
|
|
11050
|
+
}
|
|
10863
11051
|
updateAABBBounds(attribute, polygonTheme, aabbBounds) {
|
|
10864
11052
|
this.updatePathProxyAABBBounds(aabbBounds) || this.updatePolygonAABBBoundsImprecise(attribute, polygonTheme, aabbBounds), application.graphicService.updateTempAABBBounds(aabbBounds), this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
|
|
10865
11053
|
const {
|
|
@@ -10873,7 +11061,7 @@
|
|
|
10873
11061
|
} = attribute;
|
|
10874
11062
|
return points.forEach(p => {
|
|
10875
11063
|
aabbBounds.add(p.x, p.y);
|
|
10876
|
-
}), aabbBounds;
|
|
11064
|
+
}), updateBoundsOfPolygonOuterBorder(attribute, polygonTheme, aabbBounds, this), aabbBounds;
|
|
10877
11065
|
}
|
|
10878
11066
|
_interpolate(key, ratio, lastStepVal, nextStepVal, nextAttributes) {
|
|
10879
11067
|
"points" === key && (nextAttributes.points = pointsInterpolation(lastStepVal, nextStepVal, ratio));
|
|
@@ -13118,7 +13306,8 @@
|
|
|
13118
13306
|
const DrawContribution = Symbol.for("DrawContribution");
|
|
13119
13307
|
|
|
13120
13308
|
const DrawItemInterceptor = Symbol.for("DrawItemInterceptor");
|
|
13121
|
-
const
|
|
13309
|
+
const INTERACTIVE_POST_MATRIX = "_interactivePostMatrix",
|
|
13310
|
+
tempDirtyBounds = new vutils.AABBBounds(),
|
|
13122
13311
|
tempBackupDirtyBounds = new vutils.AABBBounds();
|
|
13123
13312
|
class ShadowRootDrawItemInterceptorContribution {
|
|
13124
13313
|
constructor() {
|
|
@@ -13182,12 +13371,23 @@
|
|
|
13182
13371
|
beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
13183
13372
|
return !this.processing && (graphic.baseGraphic ? this.beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) : this.beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params));
|
|
13184
13373
|
}
|
|
13374
|
+
resolveInteractivePostMatrix(graphic, interactiveGraphic) {
|
|
13375
|
+
const parent = graphic.parent;
|
|
13376
|
+
if (!parent) return graphic.attribute.postMatrix;
|
|
13377
|
+
let matrix = interactiveGraphic[INTERACTIVE_POST_MATRIX];
|
|
13378
|
+
matrix || (matrix = new vutils.Matrix(), interactiveGraphic[INTERACTIVE_POST_MATRIX] = matrix);
|
|
13379
|
+
const ancestorMatrix = parent.globalTransMatrix;
|
|
13380
|
+
matrix.setValue(ancestorMatrix.a, ancestorMatrix.b, ancestorMatrix.c, ancestorMatrix.d, ancestorMatrix.e, ancestorMatrix.f);
|
|
13381
|
+
const ownPostMatrix = graphic.attribute.postMatrix;
|
|
13382
|
+
return ownPostMatrix && matrix.multiply(ownPostMatrix.a, ownPostMatrix.b, ownPostMatrix.c, ownPostMatrix.d, ownPostMatrix.e, ownPostMatrix.f), matrix;
|
|
13383
|
+
}
|
|
13185
13384
|
beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params) {
|
|
13186
13385
|
let interactiveGraphic = graphic.interactiveGraphic;
|
|
13187
13386
|
if (graphic.attribute.globalZIndex) {
|
|
13188
13387
|
interactiveGraphic || (interactiveGraphic = graphic.clone(), graphic.interactiveGraphic = interactiveGraphic, interactiveGraphic.baseGraphic = graphic), interactiveGraphic.setAttributes({
|
|
13189
13388
|
globalZIndex: 0,
|
|
13190
|
-
zIndex: graphic.attribute.globalZIndex
|
|
13389
|
+
zIndex: graphic.attribute.globalZIndex,
|
|
13390
|
+
postMatrix: this.resolveInteractivePostMatrix(graphic, interactiveGraphic)
|
|
13191
13391
|
}, !1, {
|
|
13192
13392
|
skipUpdateCallback: !0
|
|
13193
13393
|
}), drawContext.stage.tryInitInteractiveLayer();
|
|
@@ -22782,7 +22982,7 @@
|
|
|
22782
22982
|
release(forceReleaseVRenderComponents = !0) {
|
|
22783
22983
|
forceReleaseVRenderComponents && [...this._components, ...this._regions, ...this._series].forEach(m => {
|
|
22784
22984
|
m.beforeRelease();
|
|
22785
|
-
}), super.release(), this.clear(), [...this._components, ...this._regions, ...this._series].forEach(m => {
|
|
22985
|
+
}), this._event.release(), super.release(), this.clear(), [...this._components, ...this._regions, ...this._series].forEach(m => {
|
|
22786
22986
|
m.release();
|
|
22787
22987
|
}), this._components = this._regions = this._series = [], this._spec = {}, this._dataSet = this._globalScale = this._layoutFunc = null, this._layoutTag = !1, this._idMap.clear();
|
|
22788
22988
|
}
|