123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- import { BorderSize, ImageFillType, StructureType, TopicType } from "@/enum"
- import { MindMapProjectInfo } from "@/types";
- // 通用连接桩
- export const ports = {
- groups: {
- top: {
- position: 'top',
- attrs: {
- circle: {
- r: 4,
- magnet: true,
- stroke: '#5F95FF',
- strokeWidth: 1,
- fill: '#fff',
- style: {
- visibility: 'hidden',
- },
- },
- },
- },
- right: {
- position: 'right',
- attrs: {
- circle: {
- r: 4,
- magnet: true,
- stroke: '#5F95FF',
- strokeWidth: 1,
- fill: '#fff',
- style: {
- visibility: 'hidden',
- },
- },
- },
- },
- bottom: {
- position: 'bottom',
- attrs: {
- circle: {
- r: 4,
- magnet: true,
- stroke: '#5F95FF',
- strokeWidth: 1,
- fill: '#fff',
- style: {
- visibility: 'hidden',
- },
- },
- },
- },
- left: {
- position: 'left',
- attrs: {
- circle: {
- r: 4,
- magnet: true,
- stroke: '#5F95FF',
- strokeWidth: 1,
- fill: '#fff',
- style: {
- visibility: 'hidden',
- },
- },
- },
- },
- },
- items: [
- {
- group: 'top',
- args: {
- dy: 2,
- },
- },
- {
- group: 'right',
- args: {
- dx: -2,
- },
- },
- {
- group: 'bottom',
- args: {
- dy: -2,
- },
- },
- {
- group: 'left',
- args: {
- dx: 2,
- },
- },
- ],
- }
- // 通用数据
- export const defaultData = {
- opacity: 100,
- text: {
- fontFamily: "微软雅黑",
- color: "#000000",
- fontSize: 14,
- lineHeight: 1.25,
- textAlign: "center",
- textVAlign: "middle",
- bold: false,
- italic: false,
- underline: false,
- strikethrough: false,
- },
- fill: {
- fillType: "color",
- color1: "#FFFFFF",
- color2: "#eeeeee",
- gradientType: "linear",
- gradientValue: 0,
- objectFit: ImageFillType.Fill,
- imageUrl: "",
- },
- stroke: {
- type: "solid",
- color: "#323232",
- width: 1,
- },
- lock: false,
- };
- // 脑图默认主题数据
- export const topicData = {
- ...defaultData,
- type: TopicType.main,
- borderSize: BorderSize.medium,
- fixedWidth: false,
- collapsed: false,
- linkTopicId: undefined,
- edge: {
- color: "#323232",
- width: 3,
- },
- children: [],
- extraModules: undefined,
- links: [],
- summary: undefined,
- isSummary: false
- }
- // 初始化项目
- export const defaultProject: MindMapProjectInfo = {
- name: "新建脑图",
- desc: "",
- version: "",
- author: "",
- structure: StructureType.right,
- pageSetting: {
- backgroundType: "color",
- backgroundColor: "#ffffff",
- backgroundImage: "",
- branchY: 30,
- branchX: 44,
- subTopicY: 16,
- subTopicX: 20,
- alignSameTopic: false,
- showWatermark: false,
- watermarkText: "",
- },
- // 主题
- theme: "default",
- topics: [],
- };
|