@visactor/vchart 2.1.5-alpha.0 → 2.1.5
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/es5/index.js +1 -1
- package/build/index.es.js +63 -6
- package/build/index.js +105 -100
- package/build/index.min.js +2 -2
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/chart/base/base-chart.js +1 -1
- package/cjs/chart/base/base-chart.js.map +1 -1
- package/cjs/component/legend/discrete/interface.d.ts +9 -1
- package/cjs/component/legend/discrete/interface.js.map +1 -1
- package/cjs/component/legend/discrete/util.js +12 -2
- package/cjs/component/legend/discrete/util.js.map +1 -1
- package/cjs/component/marker/interface.d.ts +1 -1
- package/cjs/component/marker/interface.js.map +1 -1
- package/cjs/component/marker/mark-point/base-mark-point.d.ts +5 -0
- package/cjs/component/marker/mark-point/base-mark-point.js +30 -2
- package/cjs/component/marker/mark-point/base-mark-point.js.map +1 -1
- package/cjs/core/expression-function.js +1 -1
- package/cjs/core/factory-registry.js +1 -1
- package/cjs/core/factory-registry.js.map +1 -1
- package/cjs/core/index.d.ts +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/index.js.map +1 -1
- package/cjs/core/vchart.js +1 -6
- package/cjs/core/vchart.js.map +1 -1
- package/cjs/data/data-view-utils.js +1 -1
- package/esm/chart/base/base-chart.js +1 -1
- package/esm/chart/base/base-chart.js.map +1 -1
- package/esm/component/legend/discrete/interface.d.ts +9 -1
- package/esm/component/legend/discrete/interface.js.map +1 -1
- package/esm/component/legend/discrete/util.js +11 -2
- package/esm/component/legend/discrete/util.js.map +1 -1
- package/esm/component/marker/interface.d.ts +1 -1
- package/esm/component/marker/interface.js.map +1 -1
- package/esm/component/marker/mark-point/base-mark-point.d.ts +5 -0
- package/esm/component/marker/mark-point/base-mark-point.js +34 -2
- package/esm/component/marker/mark-point/base-mark-point.js.map +1 -1
- package/esm/core/expression-function.js +1 -1
- package/esm/core/factory-registry.js +1 -1
- package/esm/core/factory-registry.js.map +1 -1
- package/esm/core/index.d.ts +1 -1
- package/esm/core/index.js +1 -1
- package/esm/core/index.js.map +1 -1
- package/esm/core/vchart.js +1 -6
- package/esm/core/vchart.js.map +1 -1
- package/esm/data/data-view-utils.js +1 -1
- package/package.json +9 -9
package/build/index.es.js
CHANGED
|
@@ -19700,7 +19700,6 @@ class VChart {
|
|
|
19700
19700
|
}
|
|
19701
19701
|
_reCompile(updateResult, morphConfig) {
|
|
19702
19702
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
19703
|
-
const shouldRestoreUserEvents = updateResult.reMake && !!this._chart;
|
|
19704
19703
|
if (updateResult.reMake) {
|
|
19705
19704
|
this._releaseData();
|
|
19706
19705
|
this._initDataSet();
|
|
@@ -19720,9 +19719,6 @@ class VChart {
|
|
|
19720
19719
|
if (updateResult.reMake) {
|
|
19721
19720
|
const cacheGrammarForMorph = this.isAnimationEnable() && (morphConfig === null || morphConfig === void 0 ? void 0 : morphConfig.morph) !== false;
|
|
19722
19721
|
(_c = this._compiler) === null || _c === void 0 ? void 0 : _c.releaseGrammar(!cacheGrammarForMorph);
|
|
19723
|
-
if (shouldRestoreUserEvents) {
|
|
19724
|
-
this._userEvents.forEach(e => { var _a; return (_a = this._event) === null || _a === void 0 ? void 0 : _a.on(e.eType, e.query, e.handler); });
|
|
19725
|
-
}
|
|
19726
19722
|
}
|
|
19727
19723
|
else if (updateResult.reCompile) {
|
|
19728
19724
|
(_d = this._compiler) === null || _d === void 0 ? void 0 : _d.clear({ chart: this._chart, vChart: this });
|
|
@@ -20812,7 +20808,7 @@ const lookup = (data, opt) => {
|
|
|
20812
20808
|
});
|
|
20813
20809
|
};
|
|
20814
20810
|
|
|
20815
|
-
const version = "2.1.
|
|
20811
|
+
const version = "2.1.5";
|
|
20816
20812
|
|
|
20817
20813
|
const addVChartProperty = (data, op) => {
|
|
20818
20814
|
const context = op.beforeCall();
|
|
@@ -30044,6 +30040,7 @@ class BaseChart extends CompilableBase {
|
|
|
30044
30040
|
m.beforeRelease();
|
|
30045
30041
|
});
|
|
30046
30042
|
}
|
|
30043
|
+
this._event.release();
|
|
30047
30044
|
super.release();
|
|
30048
30045
|
this.clear();
|
|
30049
30046
|
[...this._components, ...this._regions, ...this._series].forEach(m => {
|
|
@@ -55077,7 +55074,9 @@ function getLegendAttributes(spec, rect, layoutOrient) {
|
|
|
55077
55074
|
pager = cloneDeep(pager);
|
|
55078
55075
|
background = cloneDeep(background);
|
|
55079
55076
|
const attrs = restSpec;
|
|
55080
|
-
|
|
55077
|
+
const pagerLayout = pager.layout;
|
|
55078
|
+
const pagerPosition = pager.position;
|
|
55079
|
+
if (isFunction$1(attrs.maxRow) || isFunction$1(attrs.maxCol) || isFunction$1(pagerLayout) || isFunction$1(pagerPosition)) {
|
|
55081
55080
|
const resolvedOrient = isValidOrient(layoutOrient) ? layoutOrient : isValidOrient(orient) ? orient : 'left';
|
|
55082
55081
|
if (isFunction$1(attrs.maxRow)) {
|
|
55083
55082
|
attrs.maxRow = attrs.maxRow({ rect, orient: resolvedOrient, id });
|
|
@@ -55085,6 +55084,20 @@ function getLegendAttributes(spec, rect, layoutOrient) {
|
|
|
55085
55084
|
if (isFunction$1(attrs.maxCol)) {
|
|
55086
55085
|
attrs.maxCol = attrs.maxCol({ rect, orient: resolvedOrient, id });
|
|
55087
55086
|
}
|
|
55087
|
+
const isArrowPager = pager.type !== 'scrollbar';
|
|
55088
|
+
const pagerContext = {
|
|
55089
|
+
rect,
|
|
55090
|
+
orient: resolvedOrient,
|
|
55091
|
+
id,
|
|
55092
|
+
maxRow: attrs.maxRow,
|
|
55093
|
+
maxCol: attrs.maxCol
|
|
55094
|
+
};
|
|
55095
|
+
if (isArrowPager && isFunction$1(pagerLayout)) {
|
|
55096
|
+
pager.layout = pagerLayout(pagerContext);
|
|
55097
|
+
}
|
|
55098
|
+
if (isArrowPager && isFunction$1(pagerPosition)) {
|
|
55099
|
+
pager.position = pagerPosition(pagerContext);
|
|
55100
|
+
}
|
|
55088
55101
|
}
|
|
55089
55102
|
if (title.visible) {
|
|
55090
55103
|
attrs.title = transformLegendTitleAttributes(title);
|
|
@@ -63771,6 +63784,50 @@ class BaseMarkPoint extends BaseMarker {
|
|
|
63771
63784
|
super(...arguments);
|
|
63772
63785
|
this.specKey = 'markPoint';
|
|
63773
63786
|
this.layoutZIndex = LayoutZIndex.MarkPoint;
|
|
63787
|
+
this._handleDimensionHover = (params) => {
|
|
63788
|
+
var _a, _b;
|
|
63789
|
+
const targetSymbol = this._getTargetSymbolGraphic();
|
|
63790
|
+
if (!targetSymbol) {
|
|
63791
|
+
return;
|
|
63792
|
+
}
|
|
63793
|
+
switch (params.action) {
|
|
63794
|
+
case 'enter': {
|
|
63795
|
+
targetSymbol.removeState(STATE_VALUE_ENUM.STATE_DIMENSION_HOVER);
|
|
63796
|
+
targetSymbol.removeState(STATE_VALUE_ENUM.STATE_DIMENSION_HOVER_REVERSE);
|
|
63797
|
+
if (this._isDimensionHoverTarget(params)) {
|
|
63798
|
+
targetSymbol.addState(STATE_VALUE_ENUM.STATE_DIMENSION_HOVER, true);
|
|
63799
|
+
}
|
|
63800
|
+
else if ((_b = (_a = this._spec.targetSymbol) === null || _a === void 0 ? void 0 : _a.state) === null || _b === void 0 ? void 0 : _b.dimension_hover_reverse) {
|
|
63801
|
+
targetSymbol.addState(STATE_VALUE_ENUM.STATE_DIMENSION_HOVER_REVERSE, true);
|
|
63802
|
+
}
|
|
63803
|
+
break;
|
|
63804
|
+
}
|
|
63805
|
+
case 'leave':
|
|
63806
|
+
targetSymbol.removeState(STATE_VALUE_ENUM.STATE_DIMENSION_HOVER);
|
|
63807
|
+
targetSymbol.removeState(STATE_VALUE_ENUM.STATE_DIMENSION_HOVER_REVERSE);
|
|
63808
|
+
break;
|
|
63809
|
+
}
|
|
63810
|
+
};
|
|
63811
|
+
}
|
|
63812
|
+
initEvent() {
|
|
63813
|
+
var _a;
|
|
63814
|
+
super.initEvent();
|
|
63815
|
+
const targetSymbolState = (_a = this._spec.targetSymbol) === null || _a === void 0 ? void 0 : _a.state;
|
|
63816
|
+
if (this.coordinateType === 'cartesian' &&
|
|
63817
|
+
((targetSymbolState === null || targetSymbolState === void 0 ? void 0 : targetSymbolState.dimension_hover) || (targetSymbolState === null || targetSymbolState === void 0 ? void 0 : targetSymbolState.dimension_hover_reverse))) {
|
|
63818
|
+
this.event.on(DimensionEventEnum.dimensionHover, this._handleDimensionHover);
|
|
63819
|
+
}
|
|
63820
|
+
}
|
|
63821
|
+
_getTargetSymbolGraphic() {
|
|
63822
|
+
var _a;
|
|
63823
|
+
return (_a = this._markerComponent) === null || _a === void 0 ? void 0 : _a.find(node => node.name === 'mark-point-targetItem', true);
|
|
63824
|
+
}
|
|
63825
|
+
_isDimensionHoverTarget(params) {
|
|
63826
|
+
var _a, _b, _c, _d;
|
|
63827
|
+
const latestData = (_a = this._markerData) === null || _a === void 0 ? void 0 : _a.latestData;
|
|
63828
|
+
const markerData = (_c = (_b = latestData === null || latestData === void 0 ? void 0 : latestData[0]) === null || _b === void 0 ? void 0 : _b.latestData) !== null && _c !== void 0 ? _c : latestData;
|
|
63829
|
+
const markerXValues = array((_d = markerData === null || markerData === void 0 ? void 0 : markerData[0]) === null || _d === void 0 ? void 0 : _d.x).filter(isValid$1);
|
|
63830
|
+
return markerXValues.some(value => params.dimensionInfo.some(dimension => dimension.value === value));
|
|
63774
63831
|
}
|
|
63775
63832
|
static _getMarkerCoordinateType(markerSpec) {
|
|
63776
63833
|
const { doPolarProcess, doGeoProcess } = getMarkPointProcessInfo(markerSpec);
|
package/build/index.js
CHANGED
|
@@ -9105,7 +9105,7 @@
|
|
|
9105
9105
|
constructor() {
|
|
9106
9106
|
super(), this._uid = Generator.GenAutoIncrementId(), this._firstChild = null, this._lastChild = null, this.parent = null, this._count = 1;
|
|
9107
9107
|
}
|
|
9108
|
-
onParentSharedStateTreeChanged(_stage, _layer
|
|
9108
|
+
onParentSharedStateTreeChanged(_stage, _layer) {}
|
|
9109
9109
|
forEachChildren(cb, reverse = !1) {
|
|
9110
9110
|
if (reverse) {
|
|
9111
9111
|
let child = this._lastChild,
|
|
@@ -14719,17 +14719,14 @@
|
|
|
14719
14719
|
}
|
|
14720
14720
|
return null === (_a = this.stage) || void 0 === _a ? void 0 : _a.rootSharedStateScope;
|
|
14721
14721
|
}
|
|
14722
|
-
|
|
14722
|
+
syncSharedStateScopeBindingFromTree(markDirty = !0) {
|
|
14723
14723
|
var _a;
|
|
14724
|
+
const nextScope = this.resolveBoundSharedStateScope();
|
|
14724
14725
|
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);
|
|
14725
14726
|
}
|
|
14726
|
-
|
|
14727
|
-
const nextScope = void 0 === inheritedSharedStateScope ? this.resolveBoundSharedStateScope() : null != inheritedSharedStateScope ? inheritedSharedStateScope : void 0;
|
|
14728
|
-
return this.syncSharedStateScopeBinding(nextScope, markDirty);
|
|
14729
|
-
}
|
|
14730
|
-
syncSharedStateScopeBindingOnTreeChange(markDirty = !0, inheritedSharedStateScope) {
|
|
14727
|
+
syncSharedStateScopeBindingOnTreeChange(markDirty = !0) {
|
|
14731
14728
|
var _a, _b;
|
|
14732
|
-
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
|
|
14729
|
+
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);
|
|
14733
14730
|
}
|
|
14734
14731
|
syncSharedStateActiveRegistrations() {
|
|
14735
14732
|
var _a;
|
|
@@ -14737,7 +14734,6 @@
|
|
|
14737
14734
|
if (!(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) || !this.boundSharedStateScope) return (null == previousScopes ? void 0 : previousScopes.size) && (previousScopes.forEach(scope => {
|
|
14738
14735
|
scope.subtreeActiveDescendants.delete(this);
|
|
14739
14736
|
}), previousScopes.clear()), void (this.registeredActiveScopes = void 0);
|
|
14740
|
-
if ((null == previousScopes ? void 0 : previousScopes.size) && this.isSharedStateScopeChainRegistered(previousScopes)) return;
|
|
14741
14737
|
const nextScopes = new Set(collectSharedStateScopeChain(this.boundSharedStateScope));
|
|
14742
14738
|
null == previousScopes || previousScopes.forEach(scope => {
|
|
14743
14739
|
nextScopes.has(scope) || scope.subtreeActiveDescendants.delete(this);
|
|
@@ -14745,15 +14741,6 @@
|
|
|
14745
14741
|
scope.subtreeActiveDescendants.add(this);
|
|
14746
14742
|
}), this.registeredActiveScopes = nextScopes;
|
|
14747
14743
|
}
|
|
14748
|
-
isSharedStateScopeChainRegistered(previousScopes) {
|
|
14749
|
-
let scope = this.boundSharedStateScope,
|
|
14750
|
-
scopeCount = 0;
|
|
14751
|
-
for (; scope;) {
|
|
14752
|
-
if (!previousScopes.has(scope)) return !1;
|
|
14753
|
-
scopeCount += 1, scope = scope.parentScope;
|
|
14754
|
-
}
|
|
14755
|
-
return scopeCount === previousScopes.size;
|
|
14756
|
-
}
|
|
14757
14744
|
clearSharedStateActiveRegistrations() {
|
|
14758
14745
|
const previousScopes = this.registeredActiveScopes;
|
|
14759
14746
|
previousScopes && (previousScopes.forEach(scope => {
|
|
@@ -14763,8 +14750,8 @@
|
|
|
14763
14750
|
markSharedStateDirty() {
|
|
14764
14751
|
this.sharedStateDirty = !0, enqueueGraphicSharedStateRefresh(this.stage, this), scheduleStageSharedStateRefresh(this.stage);
|
|
14765
14752
|
}
|
|
14766
|
-
onParentSharedStateTreeChanged(stage, layer
|
|
14767
|
-
this.stage === stage && this.layer === layer ? this.syncSharedStateScopeBindingOnTreeChange(
|
|
14753
|
+
onParentSharedStateTreeChanged(stage, layer) {
|
|
14754
|
+
this.stage === stage && this.layer === layer ? this.syncSharedStateScopeBindingOnTreeChange() : this.setStage(stage, layer);
|
|
14768
14755
|
}
|
|
14769
14756
|
refreshSharedStateBeforeRender() {
|
|
14770
14757
|
var _a;
|
|
@@ -15415,10 +15402,6 @@
|
|
|
15415
15402
|
var _a;
|
|
15416
15403
|
return null === (_a = this.states) || void 0 === _a ? void 0 : _a[stateName];
|
|
15417
15404
|
}
|
|
15418
|
-
setStateDefinitionsWithCompiled(definitions, compiledDefinitions) {
|
|
15419
|
-
var _a;
|
|
15420
|
-
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}`;
|
|
15421
|
-
}
|
|
15422
15405
|
getStateResolveBaseAttrs() {
|
|
15423
15406
|
var _a;
|
|
15424
15407
|
return null !== (_a = this.baseAttributes) && void 0 !== _a ? _a : this.attribute;
|
|
@@ -15766,12 +15749,12 @@
|
|
|
15766
15749
|
this._globalTransMatrix.translate(scrollX, scrollY);
|
|
15767
15750
|
}
|
|
15768
15751
|
}
|
|
15769
|
-
setStage(stage, layer
|
|
15752
|
+
setStage(stage, layer) {
|
|
15770
15753
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
15771
15754
|
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,
|
|
15772
15755
|
previousStage = this.stage;
|
|
15773
15756
|
if (this.stage !== stage || this.layer !== layer) {
|
|
15774
|
-
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
|
|
15757
|
+
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()) {
|
|
15775
15758
|
const previousTimeline = null === (_f = null == previousStage ? void 0 : previousStage.getTimeline) || void 0 === _f ? void 0 : _f.call(previousStage),
|
|
15776
15759
|
nextTimeline = null === (_g = null == stage ? void 0 : stage.getTimeline) || void 0 === _g ? void 0 : _g.call(stage),
|
|
15777
15760
|
detachedStageAnimates = [];
|
|
@@ -15788,7 +15771,7 @@
|
|
|
15788
15771
|
}
|
|
15789
15772
|
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));
|
|
15790
15773
|
}
|
|
15791
|
-
((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
|
|
15774
|
+
((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);
|
|
15792
15775
|
}
|
|
15793
15776
|
detachStageForRelease() {
|
|
15794
15777
|
var _a, _b, _c;
|
|
@@ -16729,13 +16712,13 @@
|
|
|
16729
16712
|
child.setStage(null, null);
|
|
16730
16713
|
}), this.addUpdateBoundTag();
|
|
16731
16714
|
}
|
|
16732
|
-
setStage(stage, layer
|
|
16715
|
+
setStage(stage, layer) {
|
|
16733
16716
|
var _a, _b, _c, _d, _e, _f;
|
|
16734
16717
|
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,
|
|
16735
16718
|
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;
|
|
16736
|
-
if (this.stage !== stage) return this.stage = stage, this.layer = layer, needsSharedStateTreeSync && (this.ensureSharedStateScopeBound(), this.syncSharedStateScopeBindingOnTreeChange(!0
|
|
16719
|
+
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();
|
|
16737
16720
|
const layerChanged = this.layer !== layer;
|
|
16738
|
-
layerChanged && (this.layer = layer), needsSharedStateTreeSync ? (this.ensureSharedStateScopeBound(), this.syncSharedStateScopeBindingOnTreeChange(!0
|
|
16721
|
+
layerChanged && (this.layer = layer), needsSharedStateTreeSync ? (this.ensureSharedStateScopeBound(), this.syncSharedStateScopeBindingOnTreeChange(!0), this.notifyChildrenSharedStateTreeChanged()) : layerChanged && this.notifyChildrenSharedStateTreeChanged();
|
|
16739
16722
|
}
|
|
16740
16723
|
addUpdatePositionTag() {
|
|
16741
16724
|
super.addUpdatePositionTag(), this.forEachChildren(g => {
|
|
@@ -16794,26 +16777,17 @@
|
|
|
16794
16777
|
hasSharedStateDefinitions() {
|
|
16795
16778
|
return !!this._sharedStateDefinitions && Object.keys(this._sharedStateDefinitions).length > 0;
|
|
16796
16779
|
}
|
|
16797
|
-
|
|
16798
|
-
var _a;
|
|
16799
|
-
return this.sharedStateScope ? this.sharedStateScope : void 0 !== inheritedSharedStateScope ? inheritedSharedStateScope : null !== (_a = this.resolveBoundSharedStateScope()) && void 0 !== _a ? _a : null;
|
|
16800
|
-
}
|
|
16801
|
-
notifyChildrenSharedStateTreeChanged(inheritedSharedStateScope) {
|
|
16802
|
-
const childSharedStateScope = this.resolveChildSharedStateScope(inheritedSharedStateScope);
|
|
16780
|
+
notifyChildrenSharedStateTreeChanged() {
|
|
16803
16781
|
this.forEachChildren(item => {
|
|
16804
|
-
this.
|
|
16782
|
+
this.syncChildSharedStateTreeBinding(item);
|
|
16805
16783
|
});
|
|
16806
16784
|
}
|
|
16807
|
-
|
|
16808
|
-
|
|
16809
|
-
"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);
|
|
16785
|
+
syncChildSharedStateTreeBinding(child) {
|
|
16786
|
+
child.onParentSharedStateTreeChanged(this.stage, this.layer);
|
|
16810
16787
|
}
|
|
16811
|
-
|
|
16812
|
-
void 0 === inheritedSharedStateScope && (inheritedSharedStateScope = this.resolveChildSharedStateScope()), this.setStageToChild(child, inheritedSharedStateScope);
|
|
16813
|
-
}
|
|
16814
|
-
onParentSharedStateTreeChanged(stage, layer, inheritedSharedStateScope) {
|
|
16788
|
+
onParentSharedStateTreeChanged(stage, layer) {
|
|
16815
16789
|
var _a;
|
|
16816
|
-
this.stage === stage && this.layer === layer ? (this.ensureSharedStateScopeBound(), this.syncSharedStateScopeBindingOnTreeChange(!!(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length)
|
|
16790
|
+
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);
|
|
16817
16791
|
}
|
|
16818
16792
|
};
|
|
16819
16793
|
Group$1.NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR;
|
|
@@ -17353,14 +17327,13 @@
|
|
|
17353
17327
|
}) : fillStyle, setTextStyle(ctx, character);
|
|
17354
17328
|
}
|
|
17355
17329
|
function applyStrokeStyle(ctx, character) {
|
|
17356
|
-
var _a, _b;
|
|
17357
17330
|
const strokeStyle = character && character.stroke || defaultFormatting.stroke;
|
|
17358
17331
|
if (!strokeStyle) return void (ctx.globalAlpha = 0);
|
|
17359
17332
|
const {
|
|
17360
17333
|
strokeOpacity = 1,
|
|
17361
17334
|
opacity = 1
|
|
17362
17335
|
} = character;
|
|
17363
|
-
ctx.globalAlpha = strokeOpacity * opacity, ctx.lineWidth = character && "number" == typeof character.lineWidth ? character.lineWidth : 1, ctx.
|
|
17336
|
+
ctx.globalAlpha = strokeOpacity * opacity, ctx.lineWidth = character && "number" == typeof character.lineWidth ? character.lineWidth : 1, ctx.strokeStyle = strokeStyle, setTextStyle(ctx, character);
|
|
17364
17337
|
}
|
|
17365
17338
|
function getStrByWithCanvas(desc, width, character, guessIndex, needTestLetter) {
|
|
17366
17339
|
if (desc.length <= 1) return 0;
|
|
@@ -18180,8 +18153,8 @@
|
|
|
18180
18153
|
clone() {
|
|
18181
18154
|
return new RichText(Object.assign({}, this.attribute));
|
|
18182
18155
|
}
|
|
18183
|
-
setStage(stage, layer
|
|
18184
|
-
super.setStage(stage, layer
|
|
18156
|
+
setStage(stage, layer) {
|
|
18157
|
+
super.setStage(stage, layer);
|
|
18185
18158
|
this.getFrameCache().icons.forEach(icon => {
|
|
18186
18159
|
icon.setStage(stage, layer);
|
|
18187
18160
|
});
|
|
@@ -33442,7 +33415,7 @@
|
|
|
33442
33415
|
runtimePluginInstallers: {},
|
|
33443
33416
|
formatter: undefined
|
|
33444
33417
|
});
|
|
33445
|
-
const factoryRegistryVersion = "2.1.
|
|
33418
|
+
const factoryRegistryVersion = "2.1.5";
|
|
33446
33419
|
const factoryRegistryKey = Symbol.for(`@visactor/vchart/factory-registry@${factoryRegistryVersion}`);
|
|
33447
33420
|
const globalFactoryRegistry = globalThis;
|
|
33448
33421
|
const factoryRegistry = (_a = globalFactoryRegistry[factoryRegistryKey]) !== null && _a !== void 0 ? _a : (globalFactoryRegistry[factoryRegistryKey] = createFactoryRegistry());
|
|
@@ -48117,7 +48090,6 @@
|
|
|
48117
48090
|
}
|
|
48118
48091
|
_reCompile(updateResult, morphConfig) {
|
|
48119
48092
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
48120
|
-
const shouldRestoreUserEvents = updateResult.reMake && !!this._chart;
|
|
48121
48093
|
if (updateResult.reMake) {
|
|
48122
48094
|
this._releaseData();
|
|
48123
48095
|
this._initDataSet();
|
|
@@ -48137,9 +48109,6 @@
|
|
|
48137
48109
|
if (updateResult.reMake) {
|
|
48138
48110
|
const cacheGrammarForMorph = this.isAnimationEnable() && (morphConfig === null || morphConfig === void 0 ? void 0 : morphConfig.morph) !== false;
|
|
48139
48111
|
(_c = this._compiler) === null || _c === void 0 ? void 0 : _c.releaseGrammar(!cacheGrammarForMorph);
|
|
48140
|
-
if (shouldRestoreUserEvents) {
|
|
48141
|
-
this._userEvents.forEach(e => { var _a; return (_a = this._event) === null || _a === void 0 ? void 0 : _a.on(e.eType, e.query, e.handler); });
|
|
48142
|
-
}
|
|
48143
48112
|
}
|
|
48144
48113
|
else if (updateResult.reCompile) {
|
|
48145
48114
|
(_d = this._compiler) === null || _d === void 0 ? void 0 : _d.clear({ chart: this._chart, vChart: this });
|
|
@@ -49455,7 +49424,7 @@
|
|
|
49455
49424
|
});
|
|
49456
49425
|
};
|
|
49457
49426
|
|
|
49458
|
-
const version = "2.1.
|
|
49427
|
+
const version = "2.1.5";
|
|
49459
49428
|
|
|
49460
49429
|
const addVChartProperty = (data, op) => {
|
|
49461
49430
|
const context = op.beforeCall();
|
|
@@ -62854,6 +62823,7 @@
|
|
|
62854
62823
|
m.beforeRelease();
|
|
62855
62824
|
});
|
|
62856
62825
|
}
|
|
62826
|
+
this._event.release();
|
|
62857
62827
|
super.release();
|
|
62858
62828
|
this.clear();
|
|
62859
62829
|
[...this._components, ...this._regions, ...this._series].forEach(m => {
|
|
@@ -70395,7 +70365,7 @@
|
|
|
70395
70365
|
loadDiscreteLegendComponent();
|
|
70396
70366
|
let DiscreteLegend$1 = class DiscreteLegend extends LegendBase {
|
|
70397
70367
|
constructor(attributes, options) {
|
|
70398
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, DiscreteLegend.defaultAttributes, attributes)), this.name = "discreteLegend", this._itemsContainer = null, this._itemHeightByUser = void 0, this._itemHeight = 0, this._itemMaxWidth = 0, this._contentMaxHeight = 0, this.
|
|
70368
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, DiscreteLegend.defaultAttributes, attributes)), this.name = "discreteLegend", this._itemsContainer = null, this._itemHeightByUser = void 0, this._itemHeight = 0, this._itemMaxWidth = 0, this._contentMaxHeight = 0, this._onHover = e => {
|
|
70399
70369
|
const target = e.target;
|
|
70400
70370
|
if (target && target.name && target.name.startsWith(LEGEND_ELEMENT_NAME.item)) {
|
|
70401
70371
|
const legendItem = target.delegate;
|
|
@@ -70443,7 +70413,7 @@
|
|
|
70443
70413
|
};
|
|
70444
70414
|
}
|
|
70445
70415
|
render() {
|
|
70446
|
-
|
|
70416
|
+
super.render(), this._lastActiveItem = null;
|
|
70447
70417
|
}
|
|
70448
70418
|
setSelected(selectedData) {
|
|
70449
70419
|
var _a;
|
|
@@ -70623,7 +70593,7 @@
|
|
|
70623
70593
|
}), this._appendDataToShape(itemGroup, LEGEND_ELEMENT_NAME.item, item, itemGroup)) : (itemGroup = graphicCreator.group(Object.assign({
|
|
70624
70594
|
x: 0,
|
|
70625
70595
|
y: 0
|
|
70626
|
-
}, backgroundStyle.style)), this._appendDataToShape(itemGroup, LEGEND_ELEMENT_NAME.item, item, itemGroup, backgroundStyle.state
|
|
70596
|
+
}, backgroundStyle.style)), this._appendDataToShape(itemGroup, LEGEND_ELEMENT_NAME.item, item, itemGroup, backgroundStyle.state)), itemGroup.id = `${null != id ? id : label}-${index}`, itemGroup.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected);
|
|
70627
70597
|
const innerGroup = graphicCreator.group({
|
|
70628
70598
|
x: 0,
|
|
70629
70599
|
y: 0,
|
|
@@ -70646,7 +70616,7 @@
|
|
|
70646
70616
|
Object.keys(shapeStyle.state || {}).forEach(key => {
|
|
70647
70617
|
const color = shapeStyle.state[key].fill || shapeStyle.state[key].stroke;
|
|
70648
70618
|
shape.fill && isNil$1(shapeStyle.state[key].fill) && color && (shapeStyle.state[key].fill = color), shape.stroke && isNil$1(shapeStyle.state[key].stroke) && color && (shapeStyle.state[key].stroke = color);
|
|
70649
|
-
}), this._appendDataToShape(itemShape, LEGEND_ELEMENT_NAME.itemShape, item, itemGroup, shapeStyle.state
|
|
70619
|
+
}), this._appendDataToShape(itemShape, LEGEND_ELEMENT_NAME.itemShape, item, itemGroup, shapeStyle.state), itemShape.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected), innerGroup.add(itemShape);
|
|
70650
70620
|
}
|
|
70651
70621
|
let focusSpace = 0;
|
|
70652
70622
|
if (focus) {
|
|
@@ -70673,7 +70643,7 @@
|
|
|
70673
70643
|
_originText: labelAttr.formatMethod ? label : void 0
|
|
70674
70644
|
}),
|
|
70675
70645
|
labelShape = createTextGraphicByType(labelAttributes);
|
|
70676
|
-
this._appendDataToShape(labelShape, LEGEND_ELEMENT_NAME.itemLabel, item, itemGroup, labelStyle.state
|
|
70646
|
+
this._appendDataToShape(labelShape, LEGEND_ELEMENT_NAME.itemLabel, item, itemGroup, labelStyle.state), labelShape.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected), innerGroup.add(labelShape);
|
|
70677
70647
|
const labelSpace = get$1(labelAttr, "space", DEFAULT_LABEL_SPACE);
|
|
70678
70648
|
if (isValid$1(value)) {
|
|
70679
70649
|
const valueSpace = get$1(valueAttr, "space", focus ? DEFAULT_VALUE_SPACE : 0),
|
|
@@ -70689,7 +70659,7 @@
|
|
|
70689
70659
|
_originText: valueAttr.formatMethod ? value : void 0
|
|
70690
70660
|
}),
|
|
70691
70661
|
valueShape = createTextGraphicByType(valueAttributes);
|
|
70692
|
-
if (this._appendDataToShape(valueShape, LEGEND_ELEMENT_NAME.itemValue, item, itemGroup, valueStyle.state
|
|
70662
|
+
if (this._appendDataToShape(valueShape, LEGEND_ELEMENT_NAME.itemValue, item, itemGroup, valueStyle.state), valueShape.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected), this._itemWidthByUser) {
|
|
70693
70663
|
const layoutWidth = this._itemWidthByUser - parsedPadding[1] - parsedPadding[3] - shapeSize - shapeSpace - labelSpace - focusSpace - valueSpace;
|
|
70694
70664
|
this._autoEllipsis(autoEllipsisStrategy, layoutWidth, labelShape, valueShape), valueAttr.alignRight ? valueShape.setAttributes({
|
|
70695
70665
|
textAlign: "right",
|
|
@@ -70765,7 +70735,6 @@
|
|
|
70765
70735
|
}));
|
|
70766
70736
|
}
|
|
70767
70737
|
_updatePositionOfPager(renderStartY, compWidth, compHeight) {
|
|
70768
|
-
var _a;
|
|
70769
70738
|
const {
|
|
70770
70739
|
pager: pager
|
|
70771
70740
|
} = this.attribute,
|
|
@@ -70773,24 +70742,18 @@
|
|
|
70773
70742
|
totalPage: totalPage,
|
|
70774
70743
|
isHorizontal: isHorizontal
|
|
70775
70744
|
} = this._itemContext,
|
|
70776
|
-
position = pager && pager.position || "middle"
|
|
70777
|
-
hugContent = !(!pager || !pager.hugContent),
|
|
70778
|
-
pagerSpace = null !== (_a = pager && pager.space) && void 0 !== _a ? _a : DEFAULT_PAGER_SPACE;
|
|
70745
|
+
position = pager && pager.position || "middle";
|
|
70779
70746
|
if (this._pagerComponent.setTotal(totalPage), isHorizontal) {
|
|
70780
70747
|
let y;
|
|
70781
|
-
y = "start" === position ? renderStartY : "end" === position ? renderStartY + compHeight - this._pagerComponent.AABBBounds.height() / 2 : renderStartY + compHeight / 2 - this._pagerComponent.AABBBounds.height() / 2
|
|
70782
|
-
|
|
70783
|
-
hugContent && (x = Math.max(0, Math.min(this._itemsContainer.AABBBounds.width() + pagerSpace, x))), this._pagerComponent.setAttributes({
|
|
70784
|
-
x: x,
|
|
70748
|
+
y = "start" === position ? renderStartY : "end" === position ? renderStartY + compHeight - this._pagerComponent.AABBBounds.height() / 2 : renderStartY + compHeight / 2 - this._pagerComponent.AABBBounds.height() / 2, this._pagerComponent.setAttributes({
|
|
70749
|
+
x: compWidth - this._pagerComponent.AABBBounds.width(),
|
|
70785
70750
|
y: y
|
|
70786
70751
|
});
|
|
70787
70752
|
} else {
|
|
70788
70753
|
let x;
|
|
70789
|
-
x = "start" === position ? 0 : "end" === position ? compWidth - this._pagerComponent.AABBBounds.width() : (compWidth - this._pagerComponent.AABBBounds.width()) / 2
|
|
70790
|
-
let y = compHeight - this._pagerComponent.AABBBounds.height();
|
|
70791
|
-
hugContent && (y = Math.max(0, Math.min(renderStartY + this._itemsContainer.AABBBounds.height() + pagerSpace, y))), this._pagerComponent.setAttributes({
|
|
70754
|
+
x = "start" === position ? 0 : "end" === position ? compWidth - this._pagerComponent.AABBBounds.width() : (compWidth - this._pagerComponent.AABBBounds.width()) / 2, this._pagerComponent.setAttributes({
|
|
70792
70755
|
x: x,
|
|
70793
|
-
y:
|
|
70756
|
+
y: compHeight - this._pagerComponent.AABBBounds.height()
|
|
70794
70757
|
});
|
|
70795
70758
|
}
|
|
70796
70759
|
}
|
|
@@ -70945,15 +70908,11 @@
|
|
|
70945
70908
|
this._itemContext.totalPage = total, this._updatePositionOfPager(renderStartY, compWidth, compHeight);
|
|
70946
70909
|
}
|
|
70947
70910
|
defaultCurrent > 1 && (isHorizontal ? itemsContainer.setAttribute("y", -(defaultCurrent - 1) * (compHeight + spaceRow)) : itemsContainer.setAttribute("x", -(defaultCurrent - 1) * (compWidth + spaceCol)));
|
|
70948
|
-
const hugContent = !!pager.hugContent;
|
|
70949
|
-
let clipWidth = isHorizontal ? contentWidth : compWidth,
|
|
70950
|
-
clipHeight = isHorizontal ? compHeight : contentHeight;
|
|
70951
|
-
hugContent && (isHorizontal ? clipWidth = Math.max(0, Math.min(clipWidth, itemsContainer.AABBBounds.width())) : clipHeight = Math.max(0, Math.min(clipHeight, itemsContainer.AABBBounds.height())));
|
|
70952
70911
|
const clipGroup = graphicCreator.group({
|
|
70953
70912
|
x: 0,
|
|
70954
70913
|
y: renderStartY,
|
|
70955
|
-
width:
|
|
70956
|
-
height:
|
|
70914
|
+
width: isHorizontal ? contentWidth : compWidth,
|
|
70915
|
+
height: isHorizontal ? compHeight : contentHeight,
|
|
70957
70916
|
clip: !0,
|
|
70958
70917
|
pickable: !1
|
|
70959
70918
|
});
|
|
@@ -71119,17 +71078,8 @@
|
|
|
71119
71078
|
item.hasState(LegendStateValue.selected) && selectedData.push(item.data);
|
|
71120
71079
|
}), selectedData;
|
|
71121
71080
|
}
|
|
71122
|
-
_appendDataToShape(shape, name, data, delegateShape, states
|
|
71123
|
-
|
|
71124
|
-
const source = null != states ? states : DEFAULT_STATES,
|
|
71125
|
-
cached = this._stateDefinitionsCache.get(source);
|
|
71126
|
-
if (cached) return shape.states = cached.definitions, void shape.setStateDefinitionsWithCompiled(cached.definitions, cached.compiledDefinitions);
|
|
71127
|
-
const definitions = states ? merge$1({}, DEFAULT_STATES, states) : DEFAULT_STATES,
|
|
71128
|
-
entry = {
|
|
71129
|
-
definitions: definitions,
|
|
71130
|
-
compiledDefinitions: new StateDefinitionCompiler().compile(definitions)
|
|
71131
|
-
};
|
|
71132
|
-
this._stateDefinitionsCache.set(source, entry), shape.states = entry.definitions, shape.setStateDefinitionsWithCompiled(entry.definitions, entry.compiledDefinitions);
|
|
71081
|
+
_appendDataToShape(shape, name, data, delegateShape, states = {}) {
|
|
71082
|
+
shape.name = name, shape.data = data, shape.delegate = delegateShape, shape.states = merge$1({}, DEFAULT_STATES, states);
|
|
71133
71083
|
}
|
|
71134
71084
|
_dispatchLegendEvent(eventName, legendItem, event) {
|
|
71135
71085
|
const currentSelectedItems = this._getSelectedLegends();
|
|
@@ -71146,17 +71096,12 @@
|
|
|
71146
71096
|
}
|
|
71147
71097
|
_handleStyle(config, item, isSelected, index, items) {
|
|
71148
71098
|
const newConfig = {};
|
|
71149
|
-
|
|
71150
|
-
|
|
71151
|
-
|
|
71152
|
-
newConfig.reuseStateDefinitions = !hasStateFunction, hasStateFunction ? (newConfig.state = {}, stateKeys.forEach(key => {
|
|
71153
|
-
config.state[key] && (newConfig.state[key] = isFunction$1(config.state[key]) ? config.state[key](item, isSelected, index, items) : config.state[key]);
|
|
71154
|
-
})) : newConfig.state = config.state;
|
|
71155
|
-
}
|
|
71156
|
-
return newConfig;
|
|
71099
|
+
return config.style && (isFunction$1(config.style) ? newConfig.style = config.style(item, isSelected, index, items) : newConfig.style = config.style), config.state && (newConfig.state = {}, Object.keys(config.state).forEach(key => {
|
|
71100
|
+
config.state[key] && (isFunction$1(config.state[key]) ? newConfig.state[key] = config.state[key](item, isSelected, index, items) : newConfig.state[key] = config.state[key]);
|
|
71101
|
+
})), newConfig;
|
|
71157
71102
|
}
|
|
71158
71103
|
release() {
|
|
71159
|
-
|
|
71104
|
+
super.release(), this.removeAllEventListeners();
|
|
71160
71105
|
}
|
|
71161
71106
|
};
|
|
71162
71107
|
DiscreteLegend$1.defaultAttributes = {
|
|
@@ -96978,7 +96923,9 @@
|
|
|
96978
96923
|
pager = cloneDeep(pager);
|
|
96979
96924
|
background = cloneDeep(background);
|
|
96980
96925
|
const attrs = restSpec;
|
|
96981
|
-
|
|
96926
|
+
const pagerLayout = pager.layout;
|
|
96927
|
+
const pagerPosition = pager.position;
|
|
96928
|
+
if (isFunction$1(attrs.maxRow) || isFunction$1(attrs.maxCol) || isFunction$1(pagerLayout) || isFunction$1(pagerPosition)) {
|
|
96982
96929
|
const resolvedOrient = isValidOrient(layoutOrient) ? layoutOrient : isValidOrient(orient) ? orient : 'left';
|
|
96983
96930
|
if (isFunction$1(attrs.maxRow)) {
|
|
96984
96931
|
attrs.maxRow = attrs.maxRow({ rect, orient: resolvedOrient, id });
|
|
@@ -96986,6 +96933,20 @@
|
|
|
96986
96933
|
if (isFunction$1(attrs.maxCol)) {
|
|
96987
96934
|
attrs.maxCol = attrs.maxCol({ rect, orient: resolvedOrient, id });
|
|
96988
96935
|
}
|
|
96936
|
+
const isArrowPager = pager.type !== 'scrollbar';
|
|
96937
|
+
const pagerContext = {
|
|
96938
|
+
rect,
|
|
96939
|
+
orient: resolvedOrient,
|
|
96940
|
+
id,
|
|
96941
|
+
maxRow: attrs.maxRow,
|
|
96942
|
+
maxCol: attrs.maxCol
|
|
96943
|
+
};
|
|
96944
|
+
if (isArrowPager && isFunction$1(pagerLayout)) {
|
|
96945
|
+
pager.layout = pagerLayout(pagerContext);
|
|
96946
|
+
}
|
|
96947
|
+
if (isArrowPager && isFunction$1(pagerPosition)) {
|
|
96948
|
+
pager.position = pagerPosition(pagerContext);
|
|
96949
|
+
}
|
|
96989
96950
|
}
|
|
96990
96951
|
if (title.visible) {
|
|
96991
96952
|
attrs.title = transformLegendTitleAttributes(title);
|
|
@@ -105672,6 +105633,50 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
105672
105633
|
super(...arguments);
|
|
105673
105634
|
this.specKey = 'markPoint';
|
|
105674
105635
|
this.layoutZIndex = exports.LayoutZIndex.MarkPoint;
|
|
105636
|
+
this._handleDimensionHover = (params) => {
|
|
105637
|
+
var _a, _b;
|
|
105638
|
+
const targetSymbol = this._getTargetSymbolGraphic();
|
|
105639
|
+
if (!targetSymbol) {
|
|
105640
|
+
return;
|
|
105641
|
+
}
|
|
105642
|
+
switch (params.action) {
|
|
105643
|
+
case 'enter': {
|
|
105644
|
+
targetSymbol.removeState(exports.STATE_VALUE_ENUM.STATE_DIMENSION_HOVER);
|
|
105645
|
+
targetSymbol.removeState(exports.STATE_VALUE_ENUM.STATE_DIMENSION_HOVER_REVERSE);
|
|
105646
|
+
if (this._isDimensionHoverTarget(params)) {
|
|
105647
|
+
targetSymbol.addState(exports.STATE_VALUE_ENUM.STATE_DIMENSION_HOVER, true);
|
|
105648
|
+
}
|
|
105649
|
+
else if ((_b = (_a = this._spec.targetSymbol) === null || _a === void 0 ? void 0 : _a.state) === null || _b === void 0 ? void 0 : _b.dimension_hover_reverse) {
|
|
105650
|
+
targetSymbol.addState(exports.STATE_VALUE_ENUM.STATE_DIMENSION_HOVER_REVERSE, true);
|
|
105651
|
+
}
|
|
105652
|
+
break;
|
|
105653
|
+
}
|
|
105654
|
+
case 'leave':
|
|
105655
|
+
targetSymbol.removeState(exports.STATE_VALUE_ENUM.STATE_DIMENSION_HOVER);
|
|
105656
|
+
targetSymbol.removeState(exports.STATE_VALUE_ENUM.STATE_DIMENSION_HOVER_REVERSE);
|
|
105657
|
+
break;
|
|
105658
|
+
}
|
|
105659
|
+
};
|
|
105660
|
+
}
|
|
105661
|
+
initEvent() {
|
|
105662
|
+
var _a;
|
|
105663
|
+
super.initEvent();
|
|
105664
|
+
const targetSymbolState = (_a = this._spec.targetSymbol) === null || _a === void 0 ? void 0 : _a.state;
|
|
105665
|
+
if (this.coordinateType === 'cartesian' &&
|
|
105666
|
+
((targetSymbolState === null || targetSymbolState === void 0 ? void 0 : targetSymbolState.dimension_hover) || (targetSymbolState === null || targetSymbolState === void 0 ? void 0 : targetSymbolState.dimension_hover_reverse))) {
|
|
105667
|
+
this.event.on(exports.DimensionEventEnum.dimensionHover, this._handleDimensionHover);
|
|
105668
|
+
}
|
|
105669
|
+
}
|
|
105670
|
+
_getTargetSymbolGraphic() {
|
|
105671
|
+
var _a;
|
|
105672
|
+
return (_a = this._markerComponent) === null || _a === void 0 ? void 0 : _a.find(node => node.name === 'mark-point-targetItem', true);
|
|
105673
|
+
}
|
|
105674
|
+
_isDimensionHoverTarget(params) {
|
|
105675
|
+
var _a, _b, _c, _d;
|
|
105676
|
+
const latestData = (_a = this._markerData) === null || _a === void 0 ? void 0 : _a.latestData;
|
|
105677
|
+
const markerData = (_c = (_b = latestData === null || latestData === void 0 ? void 0 : latestData[0]) === null || _b === void 0 ? void 0 : _b.latestData) !== null && _c !== void 0 ? _c : latestData;
|
|
105678
|
+
const markerXValues = array((_d = markerData === null || markerData === void 0 ? void 0 : markerData[0]) === null || _d === void 0 ? void 0 : _d.x).filter(isValid$1);
|
|
105679
|
+
return markerXValues.some(value => params.dimensionInfo.some(dimension => dimension.value === value));
|
|
105675
105680
|
}
|
|
105676
105681
|
static _getMarkerCoordinateType(markerSpec) {
|
|
105677
105682
|
const { doPolarProcess, doGeoProcess } = getMarkPointProcessInfo(markerSpec);
|