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
2 changes: 1 addition & 1 deletion packages/vchart/src/component/base/base-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type { Datum, ILayoutRect } from '../../typings';
import type { IComponentSpec } from './interface';
import { LayoutModel } from '../../model/layout-model';
import { BaseComponentSpecTransformer } from './base-component-transformer';
import type { IModelRenderOption, IModelSpecInfo } from '../../model/interface';
import type { IModelSpecInfo } from '../../model/interface';

export class BaseComponent<T extends IComponentSpec = IComponentSpec> extends LayoutModel<T> implements IComponent {
static transformerConstructor = BaseComponentSpecTransformer;
Expand Down
13 changes: 5 additions & 8 deletions packages/vchart/src/component/custom-mark/custom-mark.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
import { BaseComponent } from '../base/base-component';
import { ComponentTypeEnum } from '../interface/type';
// eslint-disable-next-line no-duplicate-imports
import type { IRegion } from '../../region/interface';
import type { IModelRenderOption } from '../../model/interface';
import { LayoutLevel, LayoutZIndex } from '../../constant/layout';
import { PREFIX } from '../../constant/base';
import type { EnableMarkType, ICustomMarkGroupSpec, ICustomMarkSpec, ILayoutRect } from '../../typings';
import { MarkTypeEnum, type IGroupMark, type IMark } from '../../mark/interface';
import { IComponentMark, 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';
import type { IGraphic } from '@visactor/vrender-core';
import { animationConfig, userAnimationConfig } from '../../animation/utils';
import type { IModelMarkAttributeContext } from '../../compile/mark/interface';

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

getVRenderComponents() {
const comps: any[] = [];
const checkFunc = (m: IMark) => {
const checkFunc = (m: IComponentMark) => {
if (m && m.type === MarkTypeEnum.group) {
m.getMarks().forEach(child => {
checkFunc(child as IMark);
checkFunc(child as IComponentMark);
});
} else if (m.type === MarkTypeEnum.component) {
const comp = m?.getProduct()?.getGroupGraphicItem();
const comp = m?.getComponent();

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

this.getMarks().forEach(m => {
checkFunc(m);
checkFunc(m as IComponentMark);
});

return comps;
Expand Down
4 changes: 2 additions & 2 deletions packages/vchart/src/series/treemap/treemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ export class TreemapSeries extends CartesianSeries<any> {
});
[this._labelMark, this._nonLeafLabelMark].forEach(m => {
if (m && m.getComponent()) {
m.getComponent().getProduct().getGroupGraphicItem().enableAnimation();
m.getComponent().getProduct().enableAnimation();
}
});
// 在所有动画执行之后关闭动画
Expand All @@ -492,7 +492,7 @@ export class TreemapSeries extends CartesianSeries<any> {
});
[this._labelMark, this._nonLeafLabelMark].forEach(m => {
if (m && m.getComponent()) {
m.getComponent().getProduct().getGroupGraphicItem().disableAnimation();
m.getComponent().getProduct().disableAnimation();
}
});
}
Expand Down
Loading