/// import type { ChartActionButtons } from './ChartActionButtons'; import type { DashboardChart } from './DashboardChart'; export interface ChartConfig { /** * 类型 */ type: string; /** * 图表名称 */ title?: string; /** * 图表的图片配置组件 */ configPanelHeader?: React.ElementType; /** * 图表属性配置组件 */ configPanelContent?: React.ElementType; /** * 图表渲染组件 */ render?: React.ElementType; /** * 图表预览组件 */ preview?: React.ElementType; /** * 图表默认属性配置 */ defaultConfig?: Partial; supportedFieldsMetrics: { xFileds: number | 'more'; metrics: number | 'more'; }[]; layouts?: ChartMetricLayout[]; /** * 图表支持的操作按钮 */ actionButtons?: ChartActionButtons; } export interface ChartMetricLayout { /** * 布局名称 */ name: string; /** * 布局应用后 需要渲染的布局组件 */ render: React.ElementType; } export interface ChartMetricLayoutType { [name: string]: { /** * 布局选择列表中 布局显示的预览效果图 */ presetImage: React.ElementType; /** * 布局选择列表中 布局显示是否有边框 */ presetBorder?: boolean; /** * 布局选择列表中 布局显示的背景色 */ presetBackground: string; /** * 布局应用后 需要显示的背景图 */ presetBackgroundImg?: React.ElementType; /** * 布局应用后 指标图背景色 */ backgroundColor?: string; /** * 是否不显示图标渲染组件自带标题 */ hideDefaultTitle?: boolean; }; }