Skip to content

Commit 7472b71

Browse files
authored
Merge pull request #4318 from VisActor/fix/extension-mark-update
Fix/extension mark update
2 parents 105f803 + 95088d8 commit 7472b71

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"comment": "fix: extensionMark can remove animation\n\n",
5+
"type": "none",
6+
"packageName": "@visactor/vchart"
7+
}
8+
],
9+
"packageName": "@visactor/vchart",
10+
"email": "[email protected]"
11+
}

packages/vchart/src/component/custom-mark/custom-mark.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import { ComponentTypeEnum } from '../interface/type';
44
import { LayoutLevel, LayoutZIndex } from '../../constant/layout';
55
import { PREFIX } from '../../constant/base';
66
import type { EnableMarkType, ICustomMarkGroupSpec, ICustomMarkSpec, ILayoutRect } from '../../typings';
7-
import { IComponentMark, MarkTypeEnum, type IGroupMark } from '../../mark/interface';
7+
import type { IComponentMark } from '../../mark/interface';
8+
import { MarkTypeEnum, type IGroupMark } from '../../mark/interface';
89
// eslint-disable-next-line no-duplicate-imports
910
import { Bounds, isEqual, isNil, isValid, isValidNumber } from '@visactor/vutils';
1011
import { Factory } from '../../core/factory';
@@ -111,11 +112,12 @@ export class CustomMark extends BaseComponent<ICustomMarkSpec<EnableMarkType>> {
111112

112113
if (isValid(spec.dataId) || isValidNumber(spec.dataIndex)) {
113114
const dataview = this.getChart().getSeriesData(spec.dataId, spec.dataIndex);
115+
114116
if (dataview) {
117+
mark.setDataView(dataview);
115118
dataview.target.addListener('change', () => {
116119
mark.getData().updateData();
117120
});
118-
mark.setDataView(dataview);
119121
}
120122
}
121123
}

packages/vchart/src/series/base/base-series.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ export abstract class BaseSeries<T extends ISeriesSpec> extends BaseModel<T> imp
725725
mark.setUserId(spec.id);
726726
}
727727

728-
if (options.hasAnimation) {
728+
if (options.hasAnimation && spec.animation !== false) {
729729
// 自定义图元默认不添加动画
730730
const config = animationConfig({}, userAnimationConfig(spec.type, spec as any, this._markAttributeContext));
731731
mark.setAnimationConfig(config);
@@ -736,7 +736,9 @@ export abstract class BaseSeries<T extends ISeriesSpec> extends BaseModel<T> imp
736736
spec.children?.forEach((s, i) => {
737737
this._createExtensionMark(s as any, mark, namePrefix, i, options);
738738
});
739-
} else if (!parentMark && (!isNil(spec.dataId) || !isNil(spec.dataIndex))) {
739+
}
740+
741+
if (!isNil(spec.dataId) || !isNil(spec.dataIndex)) {
740742
const dataView = this._option.getSeriesData(spec.dataId, spec.dataIndex);
741743

742744
if (dataView === this._rawData) {

0 commit comments

Comments
 (0)