@visactor/vgrammar-core
Version:
VGrammar is a visual grammar library
74 lines (73 loc) • 3.2 kB
TypeScript
import type { IBounds } from '@visactor/vutils';
import { DiffState } from './enums';
import type { BaseEncodeSpec, BaseSingleEncodeSpec, IElement, IMark, MarkElementItem, MarkFunctionType, MarkKeySpec, MarkType } from '../types';
import type { IGraphic, IGraphicAttribute } from '@visactor/vrender-core';
export declare class Element implements IElement {
mark: IMark;
key: string;
groupKey?: string;
data: any[];
states: string[];
diffState: DiffState;
isReserved: boolean;
runtimeStatesEncoder: BaseEncodeSpec;
protected graphicItem: IGraphic;
items: MarkElementItem[];
constructor(mark: IMark);
initGraphicItem(attributes?: any): void;
updateGraphicItem(): void;
getGraphicItem(): IGraphic<Partial<IGraphicAttribute>>;
removeGraphicItem(): void;
resetGraphicItem(): void;
getBounds(): IBounds;
getStates(): string[];
updateData(groupKey: string | null, data: any[], key: MarkKeySpec): MarkElementItem[];
state(markState: MarkFunctionType<string | string[]>, parameters?: any): void;
encodeGraphic(attrs?: any): void;
private _setCustomizedShape;
encodeItems(items: MarkElementItem[], encoders: BaseEncodeSpec, isReentered?: boolean, parameters?: any): void;
protected coordinateTransformEncode(items: MarkElementItem[]): void;
hasStateAnimation(): boolean;
clearStates(hasAnimation?: boolean): void;
private _updateRuntimeStates;
hasState(state: string): boolean;
updateStates(states: Record<string, boolean | BaseSingleEncodeSpec>): boolean;
addState(state: string | string[], attrs?: BaseSingleEncodeSpec): boolean;
removeState(state: string | string[]): boolean;
protected getStateAttrs: (stateName: string, nextStates: string[]) => any;
useStates(states: string[], hasAnimation?: boolean): boolean;
protected diffAttributes(graphicAttributes: {
[channel: string]: any;
}): {};
transformElementItems(items: MarkElementItem[], markType: MarkType, computePoints?: boolean): Record<string, any>;
protected applyGraphicAttributes(graphicAttributes: any): void;
getGraphicAttribute(channel: string, prev?: boolean): any;
setGraphicAttribute(channel: string, value: any, final?: boolean): void;
setGraphicAttributes(attributes: {
[channel: string]: any;
}, final?: boolean): void;
getFinalGraphicAttributes(): any;
protected setFinalGraphicAttributes(attributes: {
[channel: string]: any;
}): void;
getPrevGraphicAttributes(): any;
protected setPrevGraphicAttributes(attributes: {
[channel: string]: any;
}): void;
getNextGraphicAttributes(): any;
getFinalAnimationAttribute(channel: string): any;
getFinalAnimationAttributes(): any;
protected setNextGraphicAttributes(attributes: {
[channel: string]: any;
}): void;
clearChangedGraphicAttributes(): void;
clearGraphicAttributes(): void;
remove(): void;
release(): void;
getItemAttribute(channel?: string): any;
setItemAttributes(attributes: {
[channel: string]: any;
} | any[]): void;
getItem(): MarkElementItem | MarkElementItem[];
getDatum(): any;
}