NuclearDispersionSystem/ant-design-vue-jeecg/node_modules/@antv/g2/esm/geometry/element/index.d.ts

124 lines
3.8 KiB
TypeScript
Raw Normal View History

2023-09-14 14:47:11 +08:00
import Base from '../../base';
import { BBox, IGroup, IShape } from '../../dependents';
import { AnimateOption, Datum, ShapeFactory, ShapeInfo } from '../../interface';
import Geometry from '../base';
/** Element 构造函数传入参数类型 */
interface ElementCfg {
/** 用于创建各种 shape 的工厂对象 */
shapeFactory: ShapeFactory;
/** shape 容器 */
container: IGroup;
/** 虚拟 group用户可以不传入 */
offscreenGroup?: IGroup;
/** 是否可见 */
visible?: boolean;
}
/**
* Element
* G2 线线Element / Shape Shape
*/
export default class Element extends Base {
/** 用于创建各种 shape 的工厂对象 */
shapeFactory: ShapeFactory;
/** shape 容器 */
container: IGroup;
/** 最后创建的图形对象 */
shape: IShape | IGroup;
/** shape 的动画配置 */
animate: AnimateOption | boolean;
/** element 对应的 Geometry 实例 */
geometry: Geometry;
/** 保存 shape 对应的 label */
labelShape: IGroup[];
/** 绘制的 shape 类型 */
private shapeType;
/** shape 绘制需要的数据 */
private model;
/** 原始数据 */
private data;
private states;
private statesStyle;
private offscreenGroup;
constructor(cfg: ElementCfg);
/**
*
* @param model
* @param isUpdate
*/
draw(model: ShapeInfo, isUpdate?: boolean): void;
/**
*
* @param model
*/
update(model: ShapeInfo): void;
/**
* element
*/
destroy(): void;
/**
* element
* @param visible
*/
changeVisible(visible: boolean): void;
/**
* Element
*
* Element
* 1. active
* 2. selected
* 3. inactive
*
*
*
* [[Theme]] `geometry.state()`
*
* ```ts
* // 激活 active 状态
* setState('active', true);
* ```
*
* @param stateName
* @param stateStatus
*/
setState(stateName: string, stateStatus: boolean): void;
/**
*
*/
clearStates(): void;
/**
* Element `stateName`
* @param stateName
* @returns true false
*/
hasState(stateName: string): boolean;
/**
* Element
* @returns Element
*/
getStates(): string[];
/**
* Element
* @returns
*/
getData(): Datum;
/**
* Element
* @returns
*/
getModel(): ShapeInfo;
/**
* Element bbox线
* @returns
*/
getBBox(): BBox;
private getStatesStyle;
private getStateStyle;
private getAnimateCfg;
private drawShape;
private getOffscreenGroup;
private setShapeInfo;
private syncShapeStyle;
private getShapeType;
}
export {};