Skip to content

Commit b3cabe0

Browse files
authored
Merge pull request #3551 from VisActor/fix/extensiom-mark-update-when-has-name
fix: fix update of extensionMark when mark has `name`, fix #3547
2 parents 9b57f26 + f42a9e2 commit b3cabe0

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-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: fix update of extensionMark when mark has `name`, fix #3547\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: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@ import { PREFIX } from '../../constant/base';
88
import type { EnableMarkType, ICustomMarkGroupSpec, ICustomMarkSpec, ILayoutRect } from '../../typings';
99
import type { IGroupMark } from '../../mark/group';
1010
import type { IMark } from '../../mark/interface';
11-
import type { LooseFunction } from '@visactor/vutils';
1211
// eslint-disable-next-line no-duplicate-imports
1312
import { Bounds, isEqual, isNil, isValid, isValidNumber } from '@visactor/vutils';
1413
import { Factory } from '../../core/factory';
1514
import type { IGraphic } from '@visactor/vrender-core';
16-
import { HOOK_EVENT } from '@visactor/vgrammar-core';
1715
import { animationConfig, userAnimationConfig } from '../../animation/utils';
1816
import type { IModelMarkAttributeContext } from '../../compile/mark/interface';
1917

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,9 @@ export abstract class BaseSeries<T extends ISeriesSpec> extends BaseModel<T> imp
758758

759759
protected _updateExtensionMarkSpec() {
760760
this._spec.extensionMark?.forEach((spec, i) => {
761-
const mark = this._marks.getMarkWithInfo({ name: `${this._getExtensionMarkNamePrefix()}_${i}` });
761+
const mark = this._marks.getMarkWithInfo({
762+
name: isValid(spec.name) ? `${spec.name}` : `${this._getExtensionMarkNamePrefix()}_${i}`
763+
});
762764
if (!mark) {
763765
return;
764766
}
@@ -1030,7 +1032,9 @@ export abstract class BaseSeries<T extends ISeriesSpec> extends BaseModel<T> imp
10301032
if (
10311033
newMarks.length !== prevMarks.length ||
10321034
prevMarks.some((prev, index) => {
1033-
return prev.type !== newMarks[index].type || prev.id !== newMarks[index].id;
1035+
return (
1036+
prev.type !== newMarks[index].type || prev.id !== newMarks[index].id || prev.name !== newMarks[index].name
1037+
);
10341038
})
10351039
) {
10361040
compareResult.reMake = true;

0 commit comments

Comments
 (0)