Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "fix: extensionMark can remove animation\n\n",
"type": "none",
"packageName": "@visactor/vchart"
}
],
"packageName": "@visactor/vchart",
"email": "dingling112@gmail.com"
}
6 changes: 4 additions & 2 deletions packages/vchart/src/component/custom-mark/custom-mark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { ComponentTypeEnum } from '../interface/type';
import { LayoutLevel, LayoutZIndex } from '../../constant/layout';
import { PREFIX } from '../../constant/base';
import type { EnableMarkType, ICustomMarkGroupSpec, ICustomMarkSpec, ILayoutRect } from '../../typings';
import { IComponentMark, MarkTypeEnum, type IGroupMark } from '../../mark/interface';
import type { IComponentMark } from '../../mark/interface';
import { MarkTypeEnum, type IGroupMark } from '../../mark/interface';
// eslint-disable-next-line no-duplicate-imports
import { Bounds, isEqual, isNil, isValid, isValidNumber } from '@visactor/vutils';
import { Factory } from '../../core/factory';
Expand Down Expand Up @@ -111,11 +112,12 @@ export class CustomMark extends BaseComponent<ICustomMarkSpec<EnableMarkType>> {

if (isValid(spec.dataId) || isValidNumber(spec.dataIndex)) {
const dataview = this.getChart().getSeriesData(spec.dataId, spec.dataIndex);

if (dataview) {
mark.setDataView(dataview);
dataview.target.addListener('change', () => {
mark.getData().updateData();
});
mark.setDataView(dataview);
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions packages/vchart/src/series/base/base-series.ts
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ export abstract class BaseSeries<T extends ISeriesSpec> extends BaseModel<T> imp
mark.setUserId(spec.id);
}

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

if (!isNil(spec.dataId) || !isNil(spec.dataIndex)) {
const dataView = this._option.getSeriesData(spec.dataId, spec.dataIndex);

if (dataView === this._rawData) {
Expand Down
Loading