import { IBaseGraphProps, BaseThemeConfig, MindMapLayoutConfig } from "../BaseGraph/types"; export interface MiniMapThemeConfig extends BaseThemeConfig, MindMapLayoutConfig { /** * @description 折叠按钮形状 * @default 'rect' */ collapseButtonShape?: 'rect' | 'circle'; } export type LayoutType = 'compactBox' | 'mindmap'; export type NodeConfig = { /** * @description 节点默认宽度,当节点数据中未配置宽度时,使用全局默认宽度,不配置则使用对应节点类型内置的宽度 */ width?: number | 'auto'; /** * @description 节点高度,当节点数据中未配置宽度时,使用全局默认宽度,不配置则使用对应节点类型内置的宽度 */ height?: number; /** * @description 最小宽度限制 */ minWidth?: number; /** * @description 最大宽度限制 */ maxWidth?: number; }; export interface MindMapGraphProps extends Omit { /** * @description 布局方式 * @default 'mindmap' */ layoutType?: LayoutType; /** * @description 主题配置 */ theme?: MiniMapThemeConfig; /** * @description 树结构数据源 */ root?: TopicNodeType; /** * @description tooltip 显示策略 * @default 'ellipsis' */ showTooltip?: 'always' | 'ellipsis' | false; } export type DisplayLevel = 'link'; export type TopicChildNodeType = NodeConfig & { id: string; type: 'topic-child'; label: string; level?: DisplayLevel; ellipsis?: 'multiLine'; }; export type TopicBranchNodeType = Omit & { type: 'topic-branch'; collapsed?: boolean; childCount?: number; children?: Array; }; export type TopicNodeType = Omit & { type: 'topic'; }; export type InnerNodeType = TopicNodeType | TopicBranchNodeType | TopicChildNodeType;