data.ts 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. import { BorderSize, ImageFillType, StructureType, TopicType } from "@/enum"
  2. import { MindMapProjectInfo } from "@/types";
  3. // 通用连接桩
  4. export const ports = {
  5. groups: {
  6. top: {
  7. position: 'top',
  8. attrs: {
  9. circle: {
  10. r: 4,
  11. magnet: true,
  12. stroke: '#5F95FF',
  13. strokeWidth: 1,
  14. fill: '#fff',
  15. style: {
  16. visibility: 'hidden',
  17. },
  18. },
  19. },
  20. },
  21. right: {
  22. position: 'right',
  23. attrs: {
  24. circle: {
  25. r: 4,
  26. magnet: true,
  27. stroke: '#5F95FF',
  28. strokeWidth: 1,
  29. fill: '#fff',
  30. style: {
  31. visibility: 'hidden',
  32. },
  33. },
  34. },
  35. },
  36. bottom: {
  37. position: 'bottom',
  38. attrs: {
  39. circle: {
  40. r: 4,
  41. magnet: true,
  42. stroke: '#5F95FF',
  43. strokeWidth: 1,
  44. fill: '#fff',
  45. style: {
  46. visibility: 'hidden',
  47. },
  48. },
  49. },
  50. },
  51. left: {
  52. position: 'left',
  53. attrs: {
  54. circle: {
  55. r: 4,
  56. magnet: true,
  57. stroke: '#5F95FF',
  58. strokeWidth: 1,
  59. fill: '#fff',
  60. style: {
  61. visibility: 'hidden',
  62. },
  63. },
  64. },
  65. },
  66. },
  67. items: [
  68. {
  69. group: 'top',
  70. args: {
  71. dy: 2,
  72. },
  73. },
  74. {
  75. group: 'right',
  76. args: {
  77. dx: -2,
  78. },
  79. },
  80. {
  81. group: 'bottom',
  82. args: {
  83. dy: -2,
  84. },
  85. },
  86. {
  87. group: 'left',
  88. args: {
  89. dx: 2,
  90. },
  91. },
  92. ],
  93. }
  94. // 通用数据
  95. export const defaultData = {
  96. opacity: 100,
  97. text: {
  98. fontFamily: "微软雅黑",
  99. color: "#000000",
  100. fontSize: 14,
  101. lineHeight: 1.25,
  102. textAlign: "center",
  103. textVAlign: "middle",
  104. bold: false,
  105. italic: false,
  106. underline: false,
  107. strikethrough: false,
  108. },
  109. fill: {
  110. fillType: "color",
  111. color1: "#FFFFFF",
  112. color2: "#eeeeee",
  113. gradientType: "linear",
  114. gradientValue: 0,
  115. objectFit: ImageFillType.Fill,
  116. imageUrl: "",
  117. },
  118. stroke: {
  119. type: "solid",
  120. color: "#323232",
  121. width: 1,
  122. },
  123. lock: false,
  124. };
  125. // 脑图默认主题数据
  126. export const topicData = {
  127. ...defaultData,
  128. type: TopicType.main,
  129. borderSize: BorderSize.medium,
  130. fixedWidth: false,
  131. collapsed: false,
  132. linkTopicId: undefined,
  133. edge: {
  134. color: "#323232",
  135. width: 3,
  136. },
  137. children: [],
  138. extraModules: undefined,
  139. links: [],
  140. summary: undefined,
  141. isSummary: false
  142. }
  143. // 初始化项目
  144. export const defaultProject: MindMapProjectInfo = {
  145. name: "新建脑图",
  146. desc: "",
  147. version: "",
  148. author: "",
  149. structure: StructureType.right,
  150. pageSetting: {
  151. backgroundType: "color",
  152. backgroundColor: "#ffffff",
  153. backgroundImage: "",
  154. branchY: 30,
  155. branchX: 44,
  156. subTopicY: 16,
  157. subTopicX: 20,
  158. alignSameTopic: false,
  159. showWatermark: false,
  160. watermarkText: "",
  161. },
  162. // 主题
  163. theme: "default",
  164. topics: [],
  165. };