import type { IAnimateOption, IActiveOption } from '@antv/l7'; import { ScaleConfig } from './common'; export type Callback = (data: Record) => T | T[]; /** 颜色色板 */ export type ColorsAttr = string | string[]; export type StyleAttribute = { field?: string | string[]; value?: T | T[] | Callback; }; export type ColorStyleAttribute = { field?: string | string[]; value?: string | string[] | Callback; scale?: ScaleConfig; }; export type SizeStyleAttribute = { field?: string; value?: number | number[] | Callback; scale?: ScaleConfig; }; export type ShapeStyleAttribute = { field?: string | string[]; value?: T | T[] | Callback; scale?: ScaleConfig; }; export type RotateStyleAttribute = { field?: string; value?: number | number[] | Callback; }; /** 图形交互反馈 */ export type StateAttribute = { active?: boolean | IActiveOption; select?: boolean | IActiveOption; }; /** 颜色 */ export type ColorAttr = string | Callback | ColorStyleAttribute; /** 大小 */ export type SizeAttr = number | number[] | Callback | SizeStyleAttribute; /** 旋转 */ export type RotateAttr = number | Callback | RotateStyleAttribute; /** 图形形状 */ export type ShapeAttr = T | Callback | ShapeStyleAttribute; /** 图形动画 */ export type AnimateAttr = boolean | Partial; /** 纹理贴图 */ export type TextureAttr = string; /** 数据过滤 */ export type FilterAttr = { field?: string | string[]; value: Callback; }; /** 聚合方法 */ export type AggregationMethod = 'count' | 'max' | 'min' | 'sum' | 'mean'; /** 网格聚合 */ export type GridAggregation = { /** * 聚合类型 */ type?: 'grid' | 'hexagon'; /** * 聚合字段 */ field: string; /** * 网格半径 */ radius?: number; /** * 聚合方法 */ method?: AggregationMethod; };