123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212 |
- import { Node } from "@antv/x6";
- import { BorderSize, StructureType, TopicBorderType, TopicType } from "@/enum";
- import { topicData } from "@/config/data";
- export interface CompoundedComponent {
- name: string;
- icon: string;
- node: Node.Metadata;
- }
- export interface LaneItem {
- width: number;
- name: string;
- }
- export interface StageItem {
- height: number;
- name: string;
- }
- export interface cellStyle {
- opacity: number;
- text: {
- fontFamily: string;
- color: string;
- fontSize: number;
- lineHeight: number;
- textAlign: "left" | "center" | "right";
- textVAlign: "top" | "middle" | "bottom";
- bold: boolean;
- italic: boolean;
- textDecoration: "underline" | "line-through" | "none";
- };
- fill: {
- fillType: "color" | "gradient" | "image";
- color1: string;
- color2: string;
- gradientType: "linear" | "radial";
- gradientValue: number;
- objectFit: ImageFillType;
- imageUrl: string;
- };
- stroke: {
- type: "solid" | "dashed" | "dotted" | "dashdot";
- color: string;
- width: number;
- };
- }
- export interface HierarchyResult {
- id: string;
- x: number;
- y: number;
- data: TopicItem;
- width: number;
- height: number;
- children: HierarchyResult[];
- totalHeight: number;
- totalWidth: number;
- direction?: string;
- }
- export type TopicItem = {
- /**
- * 主键
- */
- id: string;
- /**
- * 主题内容
- */
- label: string;
- /**
- * 宽
- */
- width: number;
- /**
- * 高
- */
- height: number;
- /**
- * 主题类型 main:中心主题 branch:分支主题 sub:子主题
- */
- type: TopicType;
- /**
- * 是否固定宽度
- */
- fixedWidth: boolean;
- /**
- * 扩展模块
- */
- extraModules?: {
- type: "image" | "code";
- data:
- | {
- code: string;
- language: string;
- }
- | {
- imageUrl: string;
- width: number;
- height: number;
- };
- };
- /**
- * 图标
- */
- icons?: string[];
- /**
- * 标签
- */
- tags?: { name: string; color: string }[];
- /**
- * 备注
- */
- remark?: string;
- /**
- * 链接
- */
- href?: {
- title: string;
- value: string;
- };
- /**
- * 父级节点
- */
- parentId?: string;
- /**
- * 位置x
- */
- x?: number;
- /**
- * 位置y
- */
- y?: number;
- /**
- * 子节点
- */
- children?: TopicItem[];
- /**
- * 连线
- */
- edge?: {
- color: string;
- width: number;
- };
- /**
- * 折叠子节点
- */
- collapsed?: boolean;
- /**
- * 边框圆角
- */
- borderSize: BorderSize;
- /**
- * 关联线
- */
- links?: any[];
- /**
- * 主题链接
- */
- linkTopicId?: string;
- /**
- * 外框
- */
- border?: {
- line: {
- width: number;
- style: "solid" | "dashed";
- color: string;
- };
- fill: string;
- type: TopicBorderType;
- label: string;
- };
- /**
- * 概要
- */
- isSummary?: boolean;
- summarySource?: string;
- summary?: {
- topic: TopicItem;
- range: [];
- border: {
- line: {
- width: number;
- color: string;
- };
- type: TopicBorderType;
- };
- };
- } & cellStyle;
- export interface MindMapProjectInfo {
- name: string;
- desc: string;
- version: string;
- author: string;
- theme: string;
- structure: StructureType;
- pageSetting: {
- backgroundType: "color" | "image";
- backgroundColor: string;
- backgroundImage: string;
- branchY: number;
- branchX: number;
- subTopicY: number;
- subTopicX: number;
- alignSameTopic: boolean;
- showWatermark: boolean;
- watermarkText: string;
- };
- topics: any[];
- }
|