Skip to content

Commit e9cfde3

Browse files
committed
fix: customMark getVRenderComponent return error
1 parent 18d4240 commit e9cfde3

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import type { Datum, ILayoutRect } from '../../typings';
1212
import type { IComponentSpec } from './interface';
1313
import { LayoutModel } from '../../model/layout-model';
1414
import { BaseComponentSpecTransformer } from './base-component-transformer';
15-
import type { IModelRenderOption, IModelSpecInfo } from '../../model/interface';
15+
import type { IModelSpecInfo } from '../../model/interface';
1616

1717
export class BaseComponent<T extends IComponentSpec = IComponentSpec> extends LayoutModel<T> implements IComponent {
1818
static transformerConstructor = BaseComponentSpecTransformer;

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
import { BaseComponent } from '../base/base-component';
22
import { ComponentTypeEnum } from '../interface/type';
33
// eslint-disable-next-line no-duplicate-imports
4-
import type { IRegion } from '../../region/interface';
5-
import type { IModelRenderOption } from '../../model/interface';
64
import { LayoutLevel, LayoutZIndex } from '../../constant/layout';
75
import { PREFIX } from '../../constant/base';
86
import type { EnableMarkType, ICustomMarkGroupSpec, ICustomMarkSpec, ILayoutRect } from '../../typings';
9-
import { MarkTypeEnum, type IGroupMark, type IMark } from '../../mark/interface';
7+
import { IComponentMark, MarkTypeEnum, type IGroupMark } from '../../mark/interface';
108
// eslint-disable-next-line no-duplicate-imports
119
import { Bounds, isEqual, isNil, isValid, isValidNumber } from '@visactor/vutils';
1210
import { Factory } from '../../core/factory';
13-
import type { IGraphic } from '@visactor/vrender-core';
1411
import { animationConfig, userAnimationConfig } from '../../animation/utils';
1512
import type { IModelMarkAttributeContext } from '../../compile/mark/interface';
1613

@@ -195,13 +192,13 @@ export class CustomMark extends BaseComponent<ICustomMarkSpec<EnableMarkType>> {
195192

196193
getVRenderComponents() {
197194
const comps: any[] = [];
198-
const checkFunc = (m: IMark) => {
195+
const checkFunc = (m: IComponentMark) => {
199196
if (m && m.type === MarkTypeEnum.group) {
200197
m.getMarks().forEach(child => {
201-
checkFunc(child as IMark);
198+
checkFunc(child as IComponentMark);
202199
});
203200
} else if (m.type === MarkTypeEnum.component) {
204-
const comp = m?.getProduct();
201+
const comp = m?.getComponent();
205202

206203
if (comp) {
207204
comps.push(comp);
@@ -210,7 +207,7 @@ export class CustomMark extends BaseComponent<ICustomMarkSpec<EnableMarkType>> {
210207
};
211208

212209
this.getMarks().forEach(m => {
213-
checkFunc(m);
210+
checkFunc(m as IComponentMark);
214211
});
215212

216213
return comps;

0 commit comments

Comments
 (0)