@mx-sose-front/mx-sose-graph 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (337) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +343 -0
  3. package/dist/index.d.ts +3937 -0
  4. package/dist/index.esm.js +74367 -0
  5. package/dist/index.esm.js.map +1 -0
  6. package/dist/index.umd.js +38 -0
  7. package/dist/index.umd.js.map +1 -0
  8. package/dist/style.css +1 -0
  9. package/package.json +70 -0
  10. package/src/components/ContextMenu.vue +475 -0
  11. package/src/components/Diagram/StrategicTaxonomyDiagram.vue +141 -0
  12. package/src/components/Edge/Edge.vue +366 -0
  13. package/src/components/InteractionLayer.vue +2033 -0
  14. package/src/components/Label.vue +0 -0
  15. package/src/components/LineStyle/ConnectionLine.vue +126 -0
  16. package/src/components/LineStyle/LineStyleMarker.vue +87 -0
  17. package/src/components/Pin/Pin.vue +220 -0
  18. package/src/components/Pin/Port.vue +172 -0
  19. package/src/components/Shape/Action.vue +121 -0
  20. package/src/components/Shape/ActivityAction.vue +155 -0
  21. package/src/components/Shape/Block.vue +306 -0
  22. package/src/components/Shape/ConceptualRole.vue +266 -0
  23. package/src/components/Shape/Diagram.vue +220 -0
  24. package/src/components/Shape/DividingLine.vue +594 -0
  25. package/src/components/Shape/DogEar.vue +224 -0
  26. package/src/components/Shape/Package.vue +340 -0
  27. package/src/constants/edgeShapeKeys.ts +81 -0
  28. package/src/constants/index.ts +440 -0
  29. package/src/index.ts +28 -0
  30. package/src/render/shape-registry.ts +17 -0
  31. package/src/render/shape-renderer.ts +103 -0
  32. package/src/statics/icons/childIcons/relations@3x.png +0 -0
  33. package/src/statics/icons/childIcons/role@3x.png +0 -0
  34. package/src/statics/icons/childIcons//344/270/232/345/212/241/344/277/241/345/217/267@3x.png +0 -0
  35. package/src/statics/icons/childIcons//344/270/232/345/212/241/344/277/241/346/201/257@3x.png +0 -0
  36. package/src/statics/icons/childIcons//344/270/232/345/212/241/344/277/241/346/201/257/345/233/276@3x.png +0 -0
  37. package/src/statics/icons/childIcons//344/270/232/345/212/241/345/206/205/351/203/250/346/265/201/347/250/213/345/233/276@3x.png +0 -0
  38. package/src/statics/icons/childIcons//344/270/232/345/212/241/345/206/205/351/203/250/350/277/236/351/200/232/345/233/276@3x.png +0 -0
  39. package/src/statics/icons/childIcons//344/270/232/345/212/241/345/212/250/344/275/234@3x.png +0 -0
  40. package/src/statics/icons/childIcons//344/270/232/345/212/241/345/217/202/346/225/260@3x.png +0 -0
  41. package/src/statics/icons/childIcons//344/270/232/345/212/241/345/217/202/346/225/260/345/233/276@3x.png +0 -0
  42. package/src/statics/icons/childIcons//344/270/232/345/212/241/345/257/271/350/261/241/346/265/201@3x.png +0 -0
  43. package/src/statics/icons/childIcons//344/270/232/345/212/241/346/211/247/350/241/214/350/200/205@3x.png +0 -0
  44. package/src/statics/icons/childIcons//344/270/232/345/212/241/346/216/245/345/217/243@3x.png +0 -0
  45. package/src/statics/icons/childIcons//344/270/232/345/212/241/346/216/247/345/210/266/346/265/201@3x.png +0 -0
  46. package/src/statics/icons/childIcons//344/270/232/345/212/241/346/246/202/345/277/265/345/233/276@3x.png +0 -0
  47. package/src/statics/icons/childIcons//344/270/232/345/212/241/346/246/202/345/277/265/350/241/250@3x.png +0 -0
  48. package/src/statics/icons/childIcons//344/270/232/345/212/241/346/264/273/345/212/250@3x.png +0 -0
  49. package/src/statics/icons/childIcons//344/270/232/345/212/241/346/264/273/345/212/250/344/270/216/350/203/275/345/212/233/346/230/240/345/260/204/347/237/251/351/230/265@3x.png +0 -0
  50. package/src/statics/icons/childIcons//344/270/232/345/212/241/346/264/273/345/212/250/345/212/250/344/275/234@3x.png +0 -0
  51. package/src/statics/icons/childIcons//344/270/232/345/212/241/346/264/273/345/212/250/346/265/201/347/250/213/345/233/276@3x.png +0 -0
  52. package/src/statics/icons/childIcons//344/270/232/345/212/241/346/264/273/345/212/250/347/273/223/346/236/204/345/233/276@3x.png +0 -0
  53. package/src/statics/icons/childIcons//344/270/232/345/212/241/346/265/201/347/250/213/345/233/276@3x.png +0 -0
  54. package/src/statics/icons/childIcons//344/270/232/345/212/241/347/212/266/346/200/201/345/233/276@3x.png +0 -0
  55. package/src/statics/icons/childIcons//344/270/232/345/212/241/347/253/257/345/217/243@3x.png +0 -0
  56. package/src/statics/icons/childIcons//344/270/232/345/212/241/347/272/246/346/235/237@3x.png +0 -0
  57. package/src/statics/icons/childIcons//344/270/232/345/212/241/347/272/246/346/235/237/345/233/276@3x.png +0 -0
  58. package/src/statics/icons/childIcons//344/270/232/345/212/241/347/272/246/346/235/237/345/256/232/344/271/211/345/233/276@3x.png +0 -0
  59. package/src/statics/icons/childIcons//344/270/232/345/212/241/347/272/246/346/235/237/350/241/250@3x.png +0 -0
  60. package/src/statics/icons/childIcons//344/270/232/345/212/241/347/273/223/346/236/204@3x.png +0 -0
  61. package/src/statics/icons/childIcons//344/270/232/345/212/241/350/207/252/347/224/261/345/210/206/347/261/273/345/233/276@3x.png +0 -0
  62. package/src/statics/icons/childIcons//344/270/232/345/212/241/350/247/222/350/211/262@3x.png +0 -0
  63. package/src/statics/icons/childIcons//344/270/232/345/212/241/350/277/236/346/216/245/345/231/250@3x.png +0 -0
  64. package/src/statics/icons/childIcons//344/270/232/345/212/241/350/277/236/351/200/232/345/233/276@3x.png +0 -0
  65. package/src/statics/icons/childIcons//344/270/232/345/212/241/350/277/236/351/200/232/350/241/250@3x.png +0 -0
  66. package/src/statics/icons/childIcons//344/270/232/345/212/241/351/253/230/347/272/247/346/246/202/345/277/265/345/233/276@3x.png +0 -0
  67. package/src/statics/icons/childIcons//344/272/272/345/221/230@3x.png +0 -0
  68. package/src/statics/icons/childIcons//344/272/272/345/221/230/345/206/205/351/203/250/346/265/201/347/250/213/345/233/276@3x.png +0 -0
  69. package/src/statics/icons/childIcons//344/272/272/345/221/230/345/206/205/351/203/250/350/277/236/351/200/232/345/233/276@3x.png +0 -0
  70. package/src/statics/icons/childIcons//344/272/272/345/221/230/345/217/202/346/225/260/345/233/276@3x.png +0 -0
  71. package/src/statics/icons/childIcons//344/272/272/345/221/230/346/246/202/345/277/265/345/233/276@3x.png +0 -0
  72. package/src/statics/icons/childIcons//344/272/272/345/221/230/346/246/202/345/277/265/350/241/250@3x.png +0 -0
  73. package/src/statics/icons/childIcons//344/272/272/345/221/230/346/265/201/347/250/213/345/233/276@3x.png +0 -0
  74. package/src/statics/icons/childIcons//344/272/272/345/221/230/347/212/266/346/200/201/345/233/276@3x.png +0 -0
  75. package/src/statics/icons/childIcons//344/272/272/345/221/230/347/272/246/346/235/237/345/233/276@3x-2.png +0 -0
  76. package/src/statics/icons/childIcons//344/272/272/345/221/230/347/272/246/346/235/237/345/233/276@3x.png +0 -0
  77. package/src/statics/icons/childIcons//344/272/272/345/221/230/347/273/223/346/236/204/345/233/276@3x.png +0 -0
  78. package/src/statics/icons/childIcons//344/272/272/345/221/230/350/277/236/351/200/232/345/233/276@3x.png +0 -0
  79. package/src/statics/icons/childIcons//344/272/272/345/221/230/350/277/236/351/200/232/350/241/250@3x.png +0 -0
  80. package/src/statics/icons/childIcons//344/273/267/345/200/274/346/265/201@3x.png +0 -0
  81. package/src/statics/icons/childIcons//344/273/273/346/204/217/345/205/263/347/263/273@3x.png +0 -0
  82. package/src/statics/icons/childIcons//344/273/273/346/204/217/350/277/236/346/216/245/345/231/250@3x.png +0 -0
  83. package/src/statics/icons/childIcons//344/274/201/344/270/232/344/275/277/345/221/275@3x.png +0 -0
  84. package/src/statics/icons/childIcons//344/274/201/344/270/232/345/205/250/347/224/237/345/221/275/345/221/250/346/234/237@3x.png +0 -0
  85. package/src/statics/icons/childIcons//344/274/201/344/270/232/346/204/277/346/231/257@3x.png +0 -0
  86. package/src/statics/icons/childIcons//344/274/201/344/270/232/347/233/256/346/240/207@3x.png +0 -0
  87. package/src/statics/icons/childIcons//344/275/215/347/275/256@3x.png +0 -0
  88. package/src/statics/icons/childIcons//344/275/223/347/263/273/346/236/266/346/236/204@3x.png +0 -0
  89. package/src/statics/icons/childIcons//344/276/235/350/265/226@3x.png +0 -0
  90. package/src/statics/icons/childIcons//344/277/235/346/212/244@3x.png +0 -0
  91. package/src/statics/icons/childIcons//344/277/241/346/201/257/346/250/241/345/236/213@3x.png +0 -0
  92. package/src/statics/icons/childIcons//345/210/233/351/200/240@3x.png +0 -0
  93. package/src/statics/icons/childIcons//345/212/237/350/203/275@3x.png +0 -0
  94. package/src/statics/icons/childIcons//345/212/237/350/203/275/344/270/216/344/270/232/345/212/241/346/264/273/345/212/250/346/230/240/345/260/204/347/237/251/351/230/265@3x.png +0 -0
  95. package/src/statics/icons/childIcons//345/212/237/350/203/275/345/212/250/344/275/234@3x.png +0 -0
  96. package/src/statics/icons/childIcons//345/212/237/350/203/275/345/257/271/350/261/241/346/265/201@3x.png +0 -0
  97. package/src/statics/icons/childIcons//345/212/237/350/203/275/346/216/247/345/210/266/346/265/201@3x.png +0 -0
  98. package/src/statics/icons/childIcons//345/217/214/345/220/221/345/205/263/350/201/224@3x.png +0 -0
  99. package/src/statics/icons/childIcons//345/217/227/345/210/260/345/275/261/345/223/215@3x.png +0 -0
  100. package/src/statics/icons/childIcons//345/234/260/347/220/206/346/224/277/346/262/273/350/214/203/345/233/264/347/261/273/345/236/213@3x.png +0 -0
  101. package/src/statics/icons/childIcons//345/241/253/345/206/231/350/201/214/344/275/215/347/224/263/350/257/267@3x.png +0 -0
  102. package/src/statics/icons/childIcons//345/256/211/345/205/250/345/206/205/351/203/250/346/265/201/347/250/213/345/233/276@3x.png +0 -0
  103. package/src/statics/icons/childIcons//345/256/211/345/205/250/346/216/247/345/210/266@3x.png +0 -0
  104. package/src/statics/icons/childIcons//345/256/211/345/205/250/346/246/202/345/277/265/345/233/276@3x.png +0 -0
  105. package/src/statics/icons/childIcons//345/256/211/345/205/250/346/246/202/345/277/265/350/241/250@3x.png +0 -0
  106. package/src/statics/icons/childIcons//345/256/211/345/205/250/346/265/201/347/250/213@3x.png +0 -0
  107. package/src/statics/icons/childIcons//345/256/211/345/205/250/346/265/201/347/250/213/345/212/250/344/275/234@3x.png +0 -0
  108. package/src/statics/icons/childIcons//345/256/211/345/205/250/346/265/201/347/250/213/345/233/276@3x.png +0 -0
  109. package/src/statics/icons/childIcons//345/256/211/345/205/250/347/272/246/346/235/237@3x.png +0 -0
  110. package/src/statics/icons/childIcons//345/256/211/345/205/250/347/272/246/346/235/237/345/233/276@3x.png +0 -0
  111. package/src/statics/icons/childIcons//345/256/211/345/205/250/347/272/246/346/235/237/345/256/232/344/271/211/345/233/276@3x.png +0 -0
  112. package/src/statics/icons/childIcons//345/256/211/345/205/250/347/273/223/346/236/204/345/233/276@3x.png +0 -0
  113. package/src/statics/icons/childIcons//345/256/211/345/205/250/350/277/236/351/200/232/345/233/276@3x.png +0 -0
  114. package/src/statics/icons/childIcons//345/256/211/345/205/250/350/277/236/351/200/232/350/241/250@3x.png +0 -0
  115. package/src/statics/icons/childIcons//345/256/211/345/205/250/351/232/224/347/246/273@3x.png +0 -0
  116. package/src/statics/icons/childIcons//345/256/211/345/205/250/351/243/216/351/231/251@3x.png +0 -0
  117. package/src/statics/icons/childIcons//345/256/232/345/220/221/345/205/263/347/263/273@3x.png +0 -0
  118. package/src/statics/icons/childIcons//345/256/232/345/220/221/345/205/263/350/201/224@3x.png +0 -0
  119. package/src/statics/icons/childIcons//345/256/232/345/220/221/347/273/204/346/210/220@3x.png +0 -0
  120. package/src/statics/icons/childIcons//345/256/232/345/220/221/350/201/232/345/220/210@3x.png +0 -0
  121. package/src/statics/icons/childIcons//345/256/236/351/231/205/344/272/272/345/221/230@3x.png +0 -0
  122. package/src/statics/icons/childIcons//345/256/236/351/231/205/344/274/201/344/270/232/351/230/266/346/256/265@3x.png +0 -0
  123. package/src/statics/icons/childIcons//345/256/236/351/231/205/344/275/215/347/275/256@3x.png +0 -0
  124. package/src/statics/icons/childIcons//345/256/236/351/231/205/345/261/236/346/200/247/350/256/276/347/275/256@3x.png +0 -0
  125. package/src/statics/icons/childIcons//345/256/236/351/231/205/346/210/230/347/225/245/351/230/266/346/256/265/347/224/230/347/211/271/345/233/276@3x.png +0 -0
  126. package/src/statics/icons/childIcons//345/256/236/351/231/205/346/214/201/347/273/255/344/273/273/345/212/241@3x.png +0 -0
  127. package/src/statics/icons/childIcons//345/256/236/351/231/205/346/234/215/345/212/241@3x.png +0 -0
  128. package/src/statics/icons/childIcons//345/256/236/351/231/205/346/235/241/344/273/266@3x.png +0 -0
  129. package/src/statics/icons/childIcons//345/256/236/351/231/205/347/216/257/345/242/203@3x.png +0 -0
  130. package/src/statics/icons/childIcons//345/256/236/351/231/205/347/273/204/347/273/207@3x.png +0 -0
  131. package/src/statics/icons/childIcons//345/256/236/351/231/205/350/201/214/344/275/215@3x.png +0 -0
  132. package/src/statics/icons/childIcons//345/256/236/351/231/205/350/201/214/350/264/243@3x.png +0 -0
  133. package/src/statics/icons/childIcons//345/256/236/351/231/205/350/264/243/344/273/273@3x.png +0 -0
  134. package/src/statics/icons/childIcons//345/256/236/351/231/205/350/265/204/346/272/220@3x.png +0 -0
  135. package/src/statics/icons/childIcons//345/256/236/351/231/205/350/265/204/346/272/220/344/270/216/345/256/236/351/231/205/351/241/271/347/233/256/345/257/271/345/272/224/345/205/263/347/263/273/347/237/251/351/230/265@3x.png +0 -0
  136. package/src/statics/icons/childIcons//345/256/236/351/231/205/350/265/204/346/272/220/346/246/202/345/277/265/347/237/251/351/230/265@3x.png +0 -0
  137. package/src/statics/icons/childIcons//345/256/236/351/231/205/350/265/204/346/272/220/347/273/223/346/236/204/345/233/276@3x.png +0 -0
  138. package/src/statics/icons/childIcons//345/256/236/351/231/205/350/265/204/346/272/220/350/277/236/351/200/232/345/233/276@3x.png +0 -0
  139. package/src/statics/icons/childIcons//345/256/236/351/231/205/351/241/271/347/233/256@3x.png +0 -0
  140. package/src/statics/icons/childIcons//345/256/236/351/231/205/351/241/271/347/233/256/344/270/216/350/203/275/345/212/233/347/232/204/346/230/240/345/260/204/347/237/251/351/230/265@3x.png +0 -0
  141. package/src/statics/icons/childIcons//345/256/236/351/231/205/351/241/271/347/233/256/351/207/214/347/250/213/347/242/221@3x.png +0 -0
  142. package/src/statics/icons/childIcons//345/256/236/351/231/205/351/241/271/347/233/256/351/207/214/347/250/213/347/242/221/346/261/207/346/200/273/350/241/250@3x.png +0 -0
  143. package/src/statics/icons/childIcons//345/256/236/351/231/205/351/243/216/351/231/251@3x.png +0 -0
  144. package/src/statics/icons/childIcons//345/261/225/347/244/272@3x.png +0 -0
  145. package/src/statics/icons/childIcons//345/267/262/347/237/245/350/265/204/346/272/220@3x.png +0 -0
  146. package/src/statics/icons/childIcons//345/274/200/345/261/225/345/267/245/344/275/234/350/203/275/345/212/233@3x.png +0 -0
  147. package/src/statics/icons/childIcons//345/274/225/347/224/250/345/261/236/346/200/247@3x.png +0 -0
  148. package/src/statics/icons/childIcons//345/275/261/345/223/215@3x-2.png +0 -0
  149. package/src/statics/icons/childIcons//345/275/261/345/223/215@3x.png +0 -0
  150. package/src/statics/icons/childIcons//346/204/277/346/231/257/345/256/243/350/250/200@3x.png +0 -0
  151. package/src/statics/icons/childIcons//346/210/230/347/225/245@3x.png +0 -0
  152. package/src/statics/icons/childIcons//346/210/230/347/225/245/344/277/241/346/201/257@3x.png +0 -0
  153. package/src/statics/icons/childIcons//346/210/230/347/225/245/344/277/241/346/201/257/345/233/276@3x-2.png +0 -0
  154. package/src/statics/icons/childIcons//346/210/230/347/225/245/344/277/241/346/201/257/345/233/276@3x.png +0 -0
  155. package/src/statics/icons/childIcons//346/210/230/347/225/245/345/217/202/346/225/260/345/233/276@3x.png +0 -0
  156. package/src/statics/icons/childIcons//346/210/230/347/225/245/345/256/236/351/231/205/346/210/230/347/225/245/351/230/266/346/256/265/345/210/206/347/261/273/350/241/250@3x.png +0 -0
  157. package/src/statics/icons/childIcons//346/210/230/347/225/245/345/256/236/351/231/205/351/203/250/347/275/262/345/233/276@3x.png +0 -0
  158. package/src/statics/icons/childIcons//346/210/230/347/225/245/346/246/202/345/277/265/345/233/276@3x.png +0 -0
  159. package/src/statics/icons/childIcons//346/210/230/347/225/245/346/265/201/347/250/213/345/233/276@3x-2.png +0 -0
  160. package/src/statics/icons/childIcons//346/210/230/347/225/245/346/265/201/347/250/213/345/233/276@3x.png +0 -0
  161. package/src/statics/icons/childIcons//346/210/230/347/225/245/347/212/266/346/200/201/345/233/276@3x.png +0 -0
  162. package/src/statics/icons/childIcons//346/210/230/347/225/245/347/272/246/346/235/237@3x.png +0 -0
  163. package/src/statics/icons/childIcons//346/210/230/347/225/245/347/272/246/346/235/237/345/233/276@3x.png +0 -0
  164. package/src/statics/icons/childIcons//346/210/230/347/225/245/347/272/246/346/235/237/345/256/232/344/271/211/345/233/276@3x.png +0 -0
  165. package/src/statics/icons/childIcons//346/210/230/347/225/245/347/273/223/346/236/204/345/233/276@3x.png +0 -0
  166. package/src/statics/icons/childIcons//346/210/230/347/225/245/350/277/236/351/200/232/345/233/276@3x-2.png +0 -0
  167. package/src/statics/icons/childIcons//346/210/230/347/225/245/350/277/236/351/200/232/345/233/276@3x.png +0 -0
  168. package/src/statics/icons/childIcons//346/210/230/347/225/245/350/277/236/351/200/232/347/237/251/351/230/265@3x-2.png +0 -0
  169. package/src/statics/icons/childIcons//346/210/230/347/225/245/350/277/236/351/200/232/347/237/251/351/230/265@3x.png +0 -0
  170. package/src/statics/icons/childIcons//346/210/230/347/225/245/351/230/266/346/256/265@3x.png +0 -0
  171. package/src/statics/icons/childIcons//346/211/247/350/241/214@3x.png +0 -0
  172. package/src/statics/icons/childIcons//346/211/247/350/241/214/350/200/205/345/206/205/351/203/250/350/277/236/351/200/232/345/233/276@3x.png +0 -0
  173. package/src/statics/icons/childIcons//346/211/247/350/241/214/350/200/205/346/246/202/345/277/265/345/233/276@3x.png +0 -0
  174. package/src/statics/icons/childIcons//346/211/247/350/241/214/350/200/205/347/273/223/346/236/204/345/233/276@3x-2.png +0 -0
  175. package/src/statics/icons/childIcons//346/211/247/350/241/214/350/200/205/347/273/223/346/236/204/345/233/276@3x.png +0 -0
  176. package/src/statics/icons/childIcons//346/211/247/350/241/214/350/200/205/350/277/236/351/200/232/345/233/276@3x.png +0 -0
  177. package/src/statics/icons/childIcons//346/211/277/346/213/205/351/243/216/351/231/251@3x.png +0 -0
  178. package/src/statics/icons/childIcons//346/212/200/346/234/257@3x.png +0 -0
  179. package/src/statics/icons/childIcons//346/213/245/346/234/211/346/265/201/347/250/213@3x.png +0 -0
  180. package/src/statics/icons/childIcons//346/217/220/344/276/233/346/235/203/351/231/220@3x.png +0 -0
  181. package/src/statics/icons/childIcons//346/227/266/346/234/272@3x.png +0 -0
  182. package/src/statics/icons/childIcons//346/234/215/345/212/241@3x.png +0 -0
  183. package/src/statics/icons/childIcons//346/234/215/345/212/241/344/270/216/344/270/232/345/212/241/346/264/273/345/212/250/346/230/240/345/260/204/347/237/251/351/230/265@3x.png +0 -0
  184. package/src/statics/icons/childIcons//346/234/215/345/212/241/344/270/216/346/234/215/345/212/241/345/220/210/345/220/214/346/230/240/345/260/204/347/237/251/351/230/265@3x.png +0 -0
  185. package/src/statics/icons/childIcons//346/234/215/345/212/241/344/270/216/350/203/275/345/212/233/346/230/240/345/260/204/347/237/251/351/230/265@3x.png +0 -0
  186. package/src/statics/icons/childIcons//346/234/215/345/212/241/344/277/241/345/217/267@3x.png +0 -0
  187. package/src/statics/icons/childIcons//346/234/215/345/212/241/345/206/205/351/203/250/346/265/201/347/250/213/345/233/276@3x.png +0 -0
  188. package/src/statics/icons/childIcons//346/234/215/345/212/241/345/206/205/351/203/250/350/277/236/351/200/232/345/233/276@3x.png +0 -0
  189. package/src/statics/icons/childIcons//346/234/215/345/212/241/345/212/237/350/203/275@3x.png +0 -0
  190. package/src/statics/icons/childIcons//346/234/215/345/212/241/345/212/237/350/203/275/345/212/250/344/275/234@3x.png +0 -0
  191. package/src/statics/icons/childIcons//346/234/215/345/212/241/345/212/250/344/275/234@3x.png +0 -0
  192. package/src/statics/icons/childIcons//346/234/215/345/212/241/345/217/202/346/225/260@3x.png +0 -0
  193. package/src/statics/icons/childIcons//346/234/215/345/212/241/345/217/202/346/225/260/345/233/276@3x.png +0 -0
  194. package/src/statics/icons/childIcons//346/234/215/345/212/241/345/257/271/350/261/241/346/265/201@3x.png +0 -0
  195. package/src/statics/icons/childIcons//346/234/215/345/212/241/346/216/245/345/217/243@3x.png +0 -0
  196. package/src/statics/icons/childIcons//346/234/215/345/212/241/346/216/247/345/210/266/346/265/201@3x.png +0 -0
  197. package/src/statics/icons/childIcons//346/234/215/345/212/241/346/246/202/345/277/265/345/233/276@3x.png +0 -0
  198. package/src/statics/icons/childIcons//346/234/215/345/212/241/346/246/202/345/277/265/350/241/250@3x.png +0 -0
  199. package/src/statics/icons/childIcons//346/234/215/345/212/241/346/265/201/347/250/213/345/233/276@3x.png +0 -0
  200. package/src/statics/icons/childIcons//346/234/215/345/212/241/347/212/266/346/200/201/345/233/276@3x.png +0 -0
  201. package/src/statics/icons/childIcons//346/234/215/345/212/241/347/253/257/345/217/243@3x.png +0 -0
  202. package/src/statics/icons/childIcons//346/234/215/345/212/241/347/272/246/346/235/237/345/233/276@3x.png +0 -0
  203. package/src/statics/icons/childIcons//346/234/215/345/212/241/347/272/246/346/235/237/345/256/232/344/271/211/345/233/276@3x.png +0 -0
  204. package/src/statics/icons/childIcons//346/234/215/345/212/241/347/273/223/346/236/204@3x.png +0 -0
  205. package/src/statics/icons/childIcons//346/234/215/345/212/241/347/273/223/346/236/204/345/233/276@3x.png +0 -0
  206. package/src/statics/icons/childIcons//346/234/215/345/212/241/350/247/222/350/211/262@3x.png +0 -0
  207. package/src/statics/icons/childIcons//346/234/215/345/212/241/350/267/257/347/272/277/345/233/276@3x.png +0 -0
  208. package/src/statics/icons/childIcons//346/234/215/345/212/241/350/277/236/346/216/245/345/231/250@3x.png +0 -0
  209. package/src/statics/icons/childIcons//346/234/215/345/212/241/350/277/236/351/200/232/345/233/276@3x.png +0 -0
  210. package/src/statics/icons/childIcons//346/234/215/345/212/241/350/277/236/351/200/232/350/241/250@3x-2.png +0 -0
  211. package/src/statics/icons/childIcons//346/234/215/345/212/241/350/277/236/351/200/232/350/241/250@3x.png +0 -0
  212. package/src/statics/icons/childIcons//346/235/203/351/231/220@3x.png +0 -0
  213. package/src/statics/icons/childIcons//346/235/241/344/273/266@3x.png +0 -0
  214. package/src/statics/icons/childIcons//346/240/207/345/207/206/344/270/232/345/212/241/346/264/273/345/212/250@3x.png +0 -0
  215. package/src/statics/icons/childIcons//346/240/207/345/207/206/346/246/202/345/277/265/345/233/276@3x.png +0 -0
  216. package/src/statics/icons/childIcons//346/240/207/345/207/206/346/246/202/345/277/265/350/241/250@3x.png +0 -0
  217. package/src/statics/icons/childIcons//346/240/207/345/207/206/347/273/223/346/236/204/345/233/276@3x.png +0 -0
  218. package/src/statics/icons/childIcons//346/240/207/345/207/206/350/267/257/347/272/277/345/233/276@3x.png +0 -0
  219. package/src/statics/icons/childIcons//346/240/207/345/207/206/350/277/275/346/272/257/345/233/276@3x.png +0 -0
  220. package/src/statics/icons/childIcons//346/246/202/345/277/265/350/247/222/350/211/262@3x.png +0 -0
  221. package/src/statics/icons/childIcons//346/263/233/345/214/226@3x.png +0 -0
  222. package/src/statics/icons/childIcons//347/212/266/345/206/265@3x.png +0 -0
  223. package/src/statics/icons/childIcons//347/216/257/345/242/203@3x.png +0 -0
  224. package/src/statics/icons/childIcons//347/233/270/346/257/224@3x (1).png +0 -0
  225. package/src/statics/icons/childIcons//347/263/273/347/273/237@3x.png +0 -0
  226. package/src/statics/icons/childIcons//347/273/204/346/210/220@3x.png +0 -0
  227. package/src/statics/icons/childIcons//347/273/204/347/273/207@3x.png +0 -0
  228. package/src/statics/icons/childIcons//347/273/204/347/273/207/351/230/266/346/256/265@3x.png +0 -0
  229. package/src/statics/icons/childIcons//347/273/221/345/256/232/350/277/236/346/216/245/345/231/250@3x.png +0 -0
  230. package/src/statics/icons/childIcons//347/274/223/350/247/243@3x.png +0 -0
  231. package/src/statics/icons/childIcons//350/201/214/344/275/215@3x.png +0 -0
  232. package/src/statics/icons/childIcons//350/201/232/345/220/210@3x.png +0 -0
  233. package/src/statics/icons/childIcons//350/203/275/345/212/233@3x.png +0 -0
  234. package/src/statics/icons/childIcons//350/203/275/345/212/233/350/201/214/350/264/243@3x.png +0 -0
  235. package/src/statics/icons/childIcons//350/203/275/345/212/233/351/205/215/347/275/256@3x.png +0 -0
  236. package/src/statics/icons/childIcons//350/203/275/345/244/237/350/203/234/344/273/273@3x.png +0 -0
  237. package/src/statics/icons/childIcons//350/207/252/347/204/266/350/265/204/346/272/220@3x.png +0 -0
  238. package/src/statics/icons/childIcons//350/246/201/346/261/202@3x.png +0 -0
  239. package/src/statics/icons/childIcons//350/256/276/347/275/256/347/261/273/345/236/213.png +0 -0
  240. package/src/statics/icons/childIcons//350/264/237/350/264/243@3x.png +0 -0
  241. package/src/statics/icons/childIcons//350/264/243/344/273/273@3x.png +0 -0
  242. package/src/statics/icons/childIcons//350/265/204/344/272/247/351/243/216/351/231/251/346/230/240/345/260/204/347/237/251/351/230/265@3x.png +0 -0
  243. package/src/statics/icons/childIcons//350/265/204/346/272/220/344/270/216/344/270/232/345/212/241/346/264/273/345/212/250/346/230/240/345/260/204/347/237/251/351/230/265@3x.png +0 -0
  244. package/src/statics/icons/childIcons//350/265/204/346/272/220/344/270/216/350/203/275/345/212/233/346/230/240/345/260/204/347/237/251/351/230/265@3x.png +0 -0
  245. package/src/statics/icons/childIcons//350/265/204/346/272/220/344/277/241/345/217/267@3x.png +0 -0
  246. package/src/statics/icons/childIcons//350/265/204/346/272/220/344/277/241/346/201/257@3x.png +0 -0
  247. package/src/statics/icons/childIcons//350/265/204/346/272/220/344/277/241/346/201/257/345/233/276@3x.png +0 -0
  248. package/src/statics/icons/childIcons//350/265/204/346/272/220/345/206/205/351/203/250/346/265/201/347/250/213/345/233/276@3x.png +0 -0
  249. package/src/statics/icons/childIcons//350/265/204/346/272/220/345/206/205/351/203/250/350/277/236/351/200/232/345/233/276@3x.png +0 -0
  250. package/src/statics/icons/childIcons//350/265/204/346/272/220/345/212/250/344/275/234@3x.png +0 -0
  251. package/src/statics/icons/childIcons//350/265/204/346/272/220/345/217/202/346/225/260@3x.png +0 -0
  252. package/src/statics/icons/childIcons//350/265/204/346/272/220/345/217/202/346/225/260/345/233/276@3x.png +0 -0
  253. package/src/statics/icons/childIcons//350/265/204/346/272/220/345/267/245/344/273/266@3x.png +0 -0
  254. package/src/statics/icons/childIcons//350/265/204/346/272/220/346/216/245/345/217/243@3x.png +0 -0
  255. package/src/statics/icons/childIcons//350/265/204/346/272/220/346/234/215/345/212/241@3x.png +0 -0
  256. package/src/statics/icons/childIcons//350/265/204/346/272/220/346/236/266/346/236/204@3x.png +0 -0
  257. package/src/statics/icons/childIcons//350/265/204/346/272/220/346/246/202/345/277/265/345/233/276@3x.png +0 -0
  258. package/src/statics/icons/childIcons//350/265/204/346/272/220/346/246/202/345/277/265/350/241/250@3x.png +0 -0
  259. package/src/statics/icons/childIcons//350/265/204/346/272/220/346/264/273/345/212/250/346/265/201/347/250/213/345/233/276@3x.png +0 -0
  260. package/src/statics/icons/childIcons//350/265/204/346/272/220/346/264/273/345/212/250/347/273/223/346/236/204/345/233/276@3x.png +0 -0
  261. package/src/statics/icons/childIcons//350/265/204/346/272/220/346/265/201/347/250/213/345/233/276@3x.png +0 -0
  262. package/src/statics/icons/childIcons//350/265/204/346/272/220/347/212/266/346/200/201/345/233/276@3x.png +0 -0
  263. package/src/statics/icons/childIcons//350/265/204/346/272/220/347/253/257/345/217/243@3x.png +0 -0
  264. package/src/statics/icons/childIcons//350/265/204/346/272/220/347/272/246/346/235/237@3x.png +0 -0
  265. package/src/statics/icons/childIcons//350/265/204/346/272/220/347/273/223/346/236/204@3x.png +0 -0
  266. package/src/statics/icons/childIcons//350/265/204/346/272/220/347/273/223/346/236/204/345/233/276@3x.png +0 -0
  267. package/src/statics/icons/childIcons//350/265/204/346/272/220/347/274/223/350/247/243/346/216/252/346/226/275@3x.png +0 -0
  268. package/src/statics/icons/childIcons//350/265/204/346/272/220/350/247/222/350/211/262@3x.png +0 -0
  269. package/src/statics/icons/childIcons//350/265/204/346/272/220/350/277/236/346/216/245/345/231/250@3x.png +0 -0
  270. package/src/statics/icons/childIcons//350/265/204/346/272/220/350/277/236/351/200/232/345/233/276@3x.png +0 -0
  271. package/src/statics/icons/childIcons//350/265/204/346/272/220/350/277/236/351/200/232/350/241/250@3x.png +0 -0
  272. package/src/statics/icons/childIcons//350/275/257/344/273/266@3x.png +0 -0
  273. package/src/statics/icons/childIcons//350/276/223/345/205/245/346/240/223@3x.png +0 -0
  274. package/src/statics/icons/childIcons//350/276/223/345/207/272/346/240/223@3x.png +0 -0
  275. package/src/statics/icons/childIcons//350/276/276/345/210/260@3x.png +0 -0
  276. package/src/statics/icons/childIcons//350/277/236/346/216/245/345/231/250@3x.png +0 -0
  277. package/src/statics/icons/childIcons//350/277/236/347/272/277@3x.png +0 -0
  278. package/src/statics/icons/childIcons//351/207/214/347/250/213/347/242/221/344/276/235/350/265/226@3x.png +0 -0
  279. package/src/statics/icons/childIcons//351/230/266/346/256/265@3x.png +0 -0
  280. package/src/statics/icons/childIcons//351/234/200/346/261/202/346/235/203/351/231/220@3x.png +0 -0
  281. package/src/statics/icons/childIcons//351/241/266/347/272/247/344/270/232/345/212/241/346/246/202/345/277/265/345/233/276@3x.png +0 -0
  282. package/src/statics/icons/childIcons//351/241/271/347/233/256@3x.png +0 -0
  283. package/src/statics/icons/childIcons//351/241/271/347/233/256/344/270/273/351/242/230@3x.png +0 -0
  284. package/src/statics/icons/childIcons//351/241/271/347/233/256/345/206/205/351/203/250/346/265/201/347/250/213/345/233/276@3x.png +0 -0
  285. package/src/statics/icons/childIcons//351/241/271/347/233/256/346/246/202/345/277/265/345/233/276@3x.png +0 -0
  286. package/src/statics/icons/childIcons//351/241/271/347/233/256/346/246/202/345/277/265/350/241/250@3x.png +0 -0
  287. package/src/statics/icons/childIcons//351/241/271/347/233/256/346/264/273/345/212/250@3x.png +0 -0
  288. package/src/statics/icons/childIcons//351/241/271/347/233/256/346/264/273/345/212/250/344/270/216/350/203/275/345/212/233/347/232/204/346/230/240/345/260/204/347/237/251/351/230/265@3x.png +0 -0
  289. package/src/statics/icons/childIcons//351/241/271/347/233/256/346/264/273/345/212/250/345/212/250/344/275/234@3x.png +0 -0
  290. package/src/statics/icons/childIcons//351/241/271/347/233/256/346/265/201/347/250/213/345/233/276@3x.png +0 -0
  291. package/src/statics/icons/childIcons//351/241/271/347/233/256/347/273/223/346/236/204/345/233/276@3x.png +0 -0
  292. package/src/statics/icons/childIcons//351/241/271/347/233/256/350/247/222/350/211/262@3x.png +0 -0
  293. package/src/statics/icons/childIcons//351/241/271/347/233/256/350/267/257/347/272/277/345/233/276@3x.png +0 -0
  294. package/src/statics/icons/childIcons//351/241/271/347/233/256/350/277/236/351/200/232/345/233/276@3x.png +0 -0
  295. package/src/statics/icons/childIcons//351/241/271/347/233/256/351/207/214/347/250/213/347/242/221@3x.png +0 -0
  296. package/src/statics/icons/childIcons//351/241/271/347/233/256/351/207/214/347/250/213/347/242/221/350/247/222/350/211/262@3x.png +0 -0
  297. package/src/statics/icons/childIcons//351/241/272/345/272/217@3x-2.png +0 -0
  298. package/src/statics/icons/childIcons//351/241/272/345/272/217@3x.png +0 -0
  299. package/src/statics/icons/childIcons//351/243/216/351/231/251@3x.png +0 -0
  300. package/src/statics/icons/childIcons//351/243/216/351/231/251/344/270/216/345/256/211/345/205/250/346/216/247/345/210/266/346/230/240/345/260/204/347/237/251/351/230/265@3x.png +0 -0
  301. package/src/statics/icons/childIcons//351/253/230/347/272/247/344/270/232/345/212/241/346/246/202/345/277/265@3x.png +0 -0
  302. package/src/statics/icons/createMenu/config.png +0 -0
  303. package/src/statics/icons/createMenu/contact.png +0 -0
  304. package/src/statics/icons/createMenu/copy.png +0 -0
  305. package/src/statics/icons/createMenu/delete.png +0 -0
  306. package/src/statics/icons/createMenu/diagram.png +0 -0
  307. package/src/statics/icons/createMenu/element.png +0 -0
  308. package/src/statics/icons/createMenu/locateChart.png +0 -0
  309. package/src/statics/icons/createMenu/paste.png +0 -0
  310. package/src/statics/icons/createMenu/rename.png +0 -0
  311. package/src/statics/icons/createMenu/scissors.png +0 -0
  312. package/src/store/eventBus.ts +38 -0
  313. package/src/store/graphStore.ts +782 -0
  314. package/src/store/index.ts +8 -0
  315. package/src/style/index.css +1 -0
  316. package/src/style/tailwind.css +33 -0
  317. package/src/types/index.ts +200 -0
  318. package/src/utils/autoExpandParent.ts +94 -0
  319. package/src/utils/colorUtils.ts +137 -0
  320. package/src/utils/compartment.ts +534 -0
  321. package/src/utils/containers.ts +910 -0
  322. package/src/utils/diagram.ts +403 -0
  323. package/src/utils/dom.ts +21 -0
  324. package/src/utils/drag.ts +224 -0
  325. package/src/utils/edgeUtils.ts +787 -0
  326. package/src/utils/geom.ts +177 -0
  327. package/src/utils/graphDragService.ts +329 -0
  328. package/src/utils/highlightUtils.ts +162 -0
  329. package/src/utils/hittest.ts +135 -0
  330. package/src/utils/iconLoader.ts +105 -0
  331. package/src/utils/index.ts +20 -0
  332. package/src/utils/packgeMap.ts +1 -0
  333. package/src/utils/pinUtils.ts +484 -0
  334. package/src/utils/policy.ts +212 -0
  335. package/src/utils/zorder.ts +39 -0
  336. package/src/view/graph.vue +419 -0
  337. package/src/vite-env.d.ts +33 -0
@@ -0,0 +1,121 @@
1
+
2
+ <template>
3
+ <div class="capability-shape" :style="shapeStyle" @click="onClick">
4
+ <svg :width="vbW" :height="vbH" :viewBox="`0 0 ${vbW} ${vbH}`" class="capability-svg">
5
+ <!-- 定义渐变(放在defs中) -->
6
+ <defs>
7
+ <!-- 水平线性渐变(从左到右) -->
8
+ <linearGradient :id="`horizontalGradient-${shape.id}`" x1="0%" y1="0%" x2="100%" y2="0%">
9
+ <!-- 渐变起点(左侧较深)、中间过渡点和终点(右侧较浅) -->
10
+ <stop offset="0%" :stop-color="gradientLeftColor" />
11
+ <stop offset="75%" :stop-color="gradientMiddleColor" />
12
+ <stop offset="100%" :stop-color="gradientRightColor" />
13
+ </linearGradient>
14
+ </defs>
15
+
16
+ <!-- 背景矩形 - 使用线性渐变 -->
17
+ <rect
18
+ x="0"
19
+ y="0"
20
+ width="100%"
21
+ height="100%"
22
+ :fill="isGhost ? 'transparent' : `url(#horizontalGradient-${shape.id})`"
23
+ :stroke="strokeColor"
24
+ :stroke-width="strokeWidth"
25
+ rx="25"
26
+ />
27
+ </svg>
28
+ </div>
29
+ </template>
30
+
31
+ <script setup lang="ts">
32
+ import { computed, type CSSProperties } from 'vue'
33
+ import type { Shape } from '../../types'
34
+ import { getIcon } from "../../utils/iconLoader";
35
+ // 引入颜色处理工具函数
36
+ import { adjustColorLightness } from '../../utils/colorUtils'
37
+
38
+ // Props
39
+ interface Props {
40
+ shape: Shape
41
+ }
42
+ const emit = defineEmits<{
43
+ (e: 'shape-click', shape: Shape, event: MouseEvent): void
44
+ (e: 'keywords-click', shape: Shape, event: MouseEvent): void
45
+ (e: 'name-click', shape: Shape, event: MouseEvent): void
46
+ }>()
47
+ const props = defineProps<Props>()
48
+
49
+ // 交互层在拖拽/缩放时会给 shape.meta.isGhost = true
50
+ const isGhost = computed(() => (props.shape as any).meta?.isGhost)
51
+
52
+ // 轮廓颜色(边框颜色)
53
+ const strokeColor = computed(() =>
54
+ props.shape.style?.borderColor ?? '#8a6d3b'
55
+ )
56
+
57
+ // 轮廓线宽
58
+ const strokeWidth = computed(() =>
59
+ isGhost.value ? 4 : (props.shape.style?.borderWidth ?? 0.5)
60
+ )
61
+
62
+ // 基础颜色(带默认值)
63
+ const baseColor = computed(() =>
64
+ props.shape.keywordsStyle?.backgroundColor || '#9CCC65'
65
+ )
66
+
67
+ // 左侧渐变颜色-初始值
68
+ const gradientLeftColor = computed(() => {
69
+ return baseColor.value
70
+ })
71
+
72
+ // 中间过渡颜色(浅)
73
+ const gradientMiddleColor = computed(() => {
74
+ return adjustColorLightness(baseColor.value, 20)
75
+ })
76
+
77
+ // 右侧渐变颜色(较浅)
78
+ const gradientRightColor = computed(() => {
79
+ // 提高明度50%,使颜色更浅
80
+ return adjustColorLightness(baseColor.value, 28)
81
+ })
82
+
83
+ // 根据 shape 的 bounds 生成样式
84
+ const shapeStyle = computed<CSSProperties>(() => {
85
+ const { bounds,style } = props.shape
86
+ return {
87
+ width: `${bounds.width || 100}px`,
88
+ height: `${bounds.height || 40}px`,
89
+ zIndex: (style?.zIndex as number) ?? 0,
90
+ }
91
+ })
92
+
93
+ const onClick = (e: MouseEvent) => {
94
+ emit('shape-click', props.shape, e)
95
+ }
96
+
97
+ const vbW = computed(() => props.shape.bounds.width || 100)
98
+ const vbH = computed(() => props.shape.bounds.height || 40)
99
+
100
+ // 获取 keywordsBounds 和 nameBounds
101
+ const keywordsBounds = computed(() => props.shape.keywordsBounds || {})
102
+ const nameBounds = computed(() => props.shape.nameBounds || {})
103
+
104
+ // 获取 keywordsStyle 和 nameStyle
105
+ const keywordsStyle = computed(() => props.shape.keywordsStyle || {})
106
+ const nameStyle = computed(() => props.shape.nameStyle || {})
107
+ const showIcon = computed(() => props.shape.showIcon || false)
108
+ </script>
109
+
110
+ <style scoped>
111
+ .capability-shape {
112
+ display: flex;
113
+ align-items: center;
114
+ justify-content: center;
115
+ overflow: hidden;
116
+ }
117
+
118
+ .capability-svg {
119
+ display: block;
120
+ }
121
+ </style>
@@ -0,0 +1,155 @@
1
+ <template>
2
+ <div class="capability-shape" :style="shapeStyle" @click="onClick">
3
+ <svg :width="vbW" :height="vbH" :viewBox="`0 0 ${vbW} ${vbH}`" class="capability-svg">
4
+ <!-- 定义渐变(放在defs中) -->
5
+ <defs>
6
+ <!-- 水平线性渐变(从左到右) -->
7
+ <linearGradient :id="`horizontalGradient-${shape.id}`" x1="0%" y1="0%" x2="100%" y2="0%">
8
+ <!-- 渐变起点(左侧较深)、中间过渡点和终点(右侧较浅) -->
9
+ <stop offset="0%" :stop-color="gradientLeftColor" />
10
+ <stop offset="75%" :stop-color="gradientMiddleColor" />
11
+ <stop offset="100%" :stop-color="gradientRightColor" />
12
+ </linearGradient>
13
+ </defs>
14
+
15
+ <!-- 背景矩形 - 使用线性渐变,边框全部在外部方向 -->
16
+ <rect
17
+ :x="strokeWidth / 2"
18
+ :y="strokeWidth / 2"
19
+ :width="vbW - strokeWidth"
20
+ :height="vbH - strokeWidth"
21
+ :fill="isGhost ? 'transparent' : `url(#horizontalGradient-${shape.id})`"
22
+ :stroke="strokeColor"
23
+ :stroke-width="strokeWidth"
24
+ stroke-alignment="outer"
25
+ rx="25"
26
+ />
27
+ <g v-if="!isGhost">
28
+ <!-- 文本内容 -->
29
+ <text :x="keywordsBounds.x || 5" :y="keywordsBounds.y || 20" text-anchor="start"
30
+ :font-family="keywordsStyle.fontFamily || '思源黑体'"
31
+ :font-size="keywordsStyle.fontSize || keywordsBounds.height || 8"
32
+ :font-weight="keywordsStyle.fontWeight || 'normal'" :fill="keywordsStyle.color || '#000000'">
33
+ {{ shape.keywords }}
34
+ </text>
35
+
36
+ <text :x="nameBounds.x || '50%'" :y="nameBounds.y || 45" text-anchor="middle"
37
+ :font-family="nameStyle.fontFamily || '思源黑体'" :font-size="nameStyle.fontSize || nameBounds.height || 12"
38
+ :font-weight="nameStyle.fontWeight || 'bold'" :fill="nameStyle.color || '#000000'" style="cursor: pointer;">
39
+ {{ shape.name }}
40
+ </text>
41
+
42
+ <!-- 图标图片 -->
43
+ <image v-if="showIcon" :x="vbW - 30" y="5" width="20" height="20" :href="getIcon('childIcons', shape.icon || '')" />
44
+ </g>
45
+ </svg>
46
+ </div>
47
+ </template>
48
+
49
+ <script setup lang="ts">
50
+ import { computed, watch, nextTick, type CSSProperties } from 'vue'
51
+ import type { Shape } from '../../types'
52
+ import { getIcon } from "../../utils/iconLoader";
53
+ // 引入颜色处理工具函数
54
+ import { adjustColorLightness } from '../../utils/colorUtils'
55
+ // 引入graphStore来更新shapes中的bounds值
56
+ import { useGraphStore } from '../../store/graphStore'
57
+
58
+ // Props
59
+ interface Props {
60
+ shape: Shape
61
+ }
62
+ const emit = defineEmits<{
63
+ (e: 'shape-click', shape: Shape, event: MouseEvent): void
64
+ (e: 'keywords-click', shape: Shape, event: MouseEvent): void
65
+ (e: 'name-click', shape: Shape, event: MouseEvent): void
66
+ }>()
67
+ const props = defineProps<Props>()
68
+
69
+ // 获取graphStore实例
70
+ const graphStore = useGraphStore()
71
+
72
+ // 交互层在拖拽/缩放时会给 shape.meta.isGhost = true
73
+ const isGhost = computed(() => (props.shape as any).meta?.isGhost)
74
+
75
+ // 轮廓颜色(边框颜色)
76
+ const strokeColor = computed(() =>
77
+ props.shape.style?.borderColor ?? '#8a6d3b'
78
+ )
79
+
80
+ // 轮廓线宽
81
+ const strokeWidth = computed(() =>
82
+ isGhost.value ? 4 : (props.shape.style?.borderWidth ?? 0.5)
83
+ )
84
+
85
+ // 基础颜色(带默认值)
86
+ const baseColor = computed(() =>
87
+ props.shape.keywordsStyle?.backgroundColor || '#9CCC65'
88
+ )
89
+
90
+ // 左侧渐变颜色-初始值
91
+ const gradientLeftColor = computed(() => {
92
+ return baseColor.value
93
+ })
94
+
95
+ // 中间过渡颜色(浅)
96
+ const gradientMiddleColor = computed(() => {
97
+ return adjustColorLightness(baseColor.value, 20)
98
+ })
99
+
100
+ // 右侧渐变颜色(较浅)
101
+ const gradientRightColor = computed(() => {
102
+ // 提高明度50%,使颜色更浅
103
+ return adjustColorLightness(baseColor.value, 28)
104
+ })
105
+
106
+ // 根据 shape 的 bounds 生成样式
107
+ const shapeStyle = computed<CSSProperties>(() => {
108
+ const { bounds,style } = props.shape
109
+ return {
110
+ width: `${bounds.width || 100}px`,
111
+ height: `${bounds.height || 40}px`,
112
+ zIndex: (style?.zIndex as number) ?? 0,
113
+ }
114
+ })
115
+
116
+ const onClick = (e: MouseEvent) => {
117
+ emit('shape-click', props.shape, e)
118
+ }
119
+
120
+ const vbW = computed(() => props.shape.bounds.width || 100)
121
+ const vbH = computed(() => props.shape.bounds.height || 40)
122
+
123
+ // 获取 keywordsBounds 和 nameBounds
124
+ const keywordsBounds = computed(() => props.shape.keywordsBounds || {})
125
+ const nameBounds = computed(() => props.shape.nameBounds || {})
126
+
127
+ // 获取 keywordsStyle 和 nameStyle
128
+ const keywordsStyle = computed(() => props.shape.keywordsStyle || {})
129
+ const nameStyle = computed(() => props.shape.nameStyle || {})
130
+ const showIcon = computed(() => props.shape.showIcon || false)
131
+
132
+ // 监听name变化时重新选择图元
133
+ watch(() => props.shape.name, () => {
134
+ // 只有当当前图元被选中时,才执行清空选择并重新选择的操作
135
+ if (graphStore.selectedShape?.id === props.shape.id) {
136
+ graphStore.clearSelection();
137
+ nextTick(() => {
138
+ graphStore.selectShape(props.shape);
139
+ });
140
+ }
141
+ });
142
+ </script>
143
+
144
+ <style scoped>
145
+ .capability-shape {
146
+ display: flex;
147
+ align-items: center;
148
+ justify-content: center;
149
+ overflow: hidden;
150
+ }
151
+
152
+ .capability-svg {
153
+ display: block;
154
+ }
155
+ </style>
@@ -0,0 +1,306 @@
1
+ <template>
2
+ <div class="capability-shape" :style="shapeStyle" @click="onClick">
3
+ <svg :width="vbW" :height="vbH" :viewBox="`0 0 ${vbW} ${vbH}`" class="capability-svg">
4
+ <!-- 定义渐变(放在defs中) -->
5
+ <defs>
6
+ <!-- 水平线性渐变(从左到右) -->
7
+ <linearGradient :id="`horizontalGradient-${shape.id}`" x1="0%" y1="0%" x2="100%" y2="0%">
8
+ <!-- 渐变起点(左侧较深)、中间过渡点和终点(右侧较浅) -->
9
+ <stop offset="0%" :stop-color="gradientLeftColor" />
10
+ <stop offset="75%" :stop-color="gradientMiddleColor" />
11
+ <stop offset="100%" :stop-color="gradientRightColor" />
12
+ </linearGradient>
13
+ </defs>
14
+
15
+ <!-- 背景矩形 - 使用线性渐变,边框全部在外部方向 -->
16
+ <rect :x="strokeWidth / 2" :y="strokeWidth / 2" :width="vbW - strokeWidth" :height="vbH - strokeWidth"
17
+ :fill="isGhost ? 'transparent' : `url(#horizontalGradient-${shape.id})`" :stroke="strokeColor"
18
+ :stroke-width="strokeWidth" stroke-alignment="outer" rx="2" />
19
+ <g v-if="!isGhost">
20
+ <!-- 文本内容 -->
21
+ <text :x="keywordsBounds.x || 5" :y="keywordsBounds.y || 20" text-anchor="start"
22
+ :font-family="keywordsStyle.fontFamily || '思源黑体'"
23
+ :font-size="keywordsStyle.fontSize || keywordsBounds.height || 8"
24
+ :font-weight="keywordsStyle.fontWeight || 'normal'" :fill="keywordsStyle.color || '#000000'">
25
+ {{ shape.keywords }}
26
+ </text>
27
+ <text :x="nameBounds.x || '50%'" :y="nameBounds.y || 45" text-anchor="middle"
28
+ :font-family="nameStyle.fontFamily || '思源黑体'" :font-size="nameStyle.fontSize || nameBounds.height || 12"
29
+ :font-weight="nameStyle.fontWeight || 'bold'" :fill="nameStyle.color || '#000000'" style="cursor: pointer;">
30
+ {{ shape.name }}
31
+ </text>
32
+ <line v-if="shape.comparents?.length && shape.comparents[0]?.comparentShapes?.length" :x1="strokeWidth"
33
+ :x2="vbW - strokeWidth" :y1="(nameBounds.y || 45) + 20" :y2="(nameBounds.y || 45) + 20" stroke="#767a7d"
34
+ stroke-width="1" />
35
+ <!-- 图标图片 -->
36
+ <image v-if="showIcon" :x="vbW - 30" y="5" width="20" height="20"
37
+ :href="getIcon('childIcons', shape.icon || '')" />
38
+ </g>
39
+ </svg>
40
+ </div>
41
+ </template>
42
+
43
+ <script setup lang="ts">
44
+ import { computed, nextTick, watch, onMounted, ref, onUnmounted, type CSSProperties } from 'vue'
45
+ import type { Shape } from '../../types'
46
+ import { getIcon } from "../../utils/iconLoader";
47
+ // 引入颜色处理工具函数
48
+ import { adjustColorLightness } from '../../utils/colorUtils'
49
+ // 引入graphStore来更新shapes中的bounds值
50
+ import { useGraphStore } from '../../store/graphStore'
51
+ // 引入lodash的防抖函数
52
+ import { debounce } from 'lodash';
53
+ // 引入事件总线来监听缩放状态
54
+ import { eventBus } from '../../store/eventBus';
55
+
56
+ // Props
57
+ interface Props {
58
+ shape: Shape
59
+ }
60
+ const emit = defineEmits<{
61
+ (e: 'shape-click', shape: Shape, event: MouseEvent): void
62
+ (e: 'keywords-click', shape: Shape, event: MouseEvent): void
63
+ (e: 'name-click', shape: Shape, event: MouseEvent): void
64
+ }>()
65
+ const props = defineProps<Props>()
66
+
67
+ // 获取graphStore实例
68
+ const graphStore = useGraphStore()
69
+
70
+ // 交互层在拖拽/缩放时会给 shape.meta.isGhost = true
71
+ const isGhost = computed(() => (props.shape as any).meta?.isGhost)
72
+ // 跟踪缩放状态
73
+ const isResizing = ref(false);
74
+
75
+ // 定义事件处理函数
76
+ const handleResizeStart = () => {
77
+ isResizing.value = true;
78
+ };
79
+
80
+ const handleResizeEnd = (target: any) => {
81
+ isResizing.value = false;
82
+ // 缩放结束后更新图元大小
83
+ nextTick(() => {
84
+ updateShapeBounds();
85
+ });
86
+ };
87
+
88
+ // 组件挂载时绑定事件监听
89
+ onMounted(() => {
90
+ // 监听缩放开始事件
91
+ eventBus.on('resize-start', handleResizeStart);
92
+ // 监听缩放结束事件
93
+ eventBus.on('resize-end', handleResizeEnd);
94
+
95
+ // 组件挂载时更新一次宽度
96
+ updateShapeBounds();
97
+ });
98
+
99
+ // 组件卸载时清理事件监听
100
+ onUnmounted(() => {
101
+ eventBus.off('resize-start', handleResizeStart);
102
+ eventBus.off('resize-end', handleResizeEnd);
103
+ });
104
+
105
+ // 轮廓颜色(边框颜色)
106
+ const strokeColor = computed(() =>
107
+ props.shape.style?.borderColor ?? '#8a6d3b'
108
+ )
109
+
110
+ // 轮廓线宽
111
+ const strokeWidth = computed(() =>
112
+ isGhost.value ? 4 : (props.shape.style?.borderWidth ?? 0.5)
113
+ )
114
+
115
+ // 基础颜色(带默认值)
116
+ const baseColor = computed(() =>
117
+ props.shape.keywordsStyle?.backgroundColor || '#9CCC65'
118
+ )
119
+
120
+ // 左侧渐变颜色-初始值
121
+ const gradientLeftColor = computed(() => {
122
+ return baseColor.value
123
+ })
124
+
125
+ // 中间过渡颜色(浅)
126
+ const gradientMiddleColor = computed(() => {
127
+ return adjustColorLightness(baseColor.value, 20)
128
+ })
129
+
130
+ // 右侧渐变颜色(较浅)
131
+ const gradientRightColor = computed(() => {
132
+ // 提高明度50%,使颜色更浅
133
+ return adjustColorLightness(baseColor.value, 28)
134
+ })
135
+
136
+ // 获取 keywordsBounds 和 nameBounds
137
+ const keywordsBounds = computed(() => props.shape.keywordsBounds || {})
138
+ const nameBounds = computed(() => props.shape.nameBounds || {})
139
+
140
+ // 获取 keywordsStyle 和 nameStyle
141
+ const keywordsStyle = computed(() => props.shape.keywordsStyle || {})
142
+ const nameStyle = computed(() => props.shape.nameStyle || {})
143
+ const showIcon = computed(() => props.shape.showIcon || false)
144
+
145
+ // 计算文本内容的估计宽度(基于字符数和字体大小)
146
+ const estimatedTextWidth = computed(() => {
147
+ // 获取字体大小
148
+ const fontSize = nameStyle.value.fontSize || nameBounds.value.height || 12;
149
+ // 假设每个字符的平均宽度是字体大小的1倍
150
+ const charWidth = fontSize * 1;
151
+
152
+ // 计算名称文本的宽度
153
+ const nameTextWidth = (props.shape.name?.length || 0) * charWidth;
154
+ // 计算关键词文本的宽度
155
+ const keywordsTextWidth = (props.shape.keywords?.length || 0) * charWidth;
156
+
157
+ // 返回较大的宽度,并添加一些边距(左右各10px)
158
+ const maxTextWidth = Math.max(nameTextWidth, keywordsTextWidth);
159
+ return maxTextWidth + 60; // 左右各10px边距
160
+ });
161
+
162
+ // 根据 shape 的 bounds 生成样式
163
+ const shapeStyle = computed<CSSProperties>(() => {
164
+ const { bounds, style } = props.shape;
165
+
166
+ // 直接使用bounds宽度,不做任何限制
167
+ let width = bounds.width || 100;
168
+
169
+ // 只在非缩放状态下应用最小宽度保护,确保文本可见
170
+ // 缩放过程中完全不限制宽度,允许自由放大和缩小
171
+ if (!isResizing.value) {
172
+ width = Math.max(estimatedTextWidth.value, width);
173
+ }
174
+
175
+ // 最小高度限制为70px
176
+ const minHeight = 70;
177
+ const height = Math.max(bounds.height || 40, minHeight);
178
+
179
+ return {
180
+ width: `${width}px`,
181
+ height: `${height}px`,
182
+ zIndex: (style?.zIndex as number) ?? 0,
183
+ }
184
+ });
185
+
186
+ // 更新图元的bounds宽度和高度
187
+ const updateShapeBounds = async () => {
188
+ await nextTick();
189
+
190
+ const requiredWidth = estimatedTextWidth.value;
191
+ const currentWidth = props.shape.bounds.width || 100;
192
+ // 最小高度限制为70px
193
+ const minHeight = 70;
194
+ const currentHeight = props.shape.bounds.height || 40;
195
+ const requiredHeight = Math.max(currentHeight, minHeight);
196
+
197
+ // 检查是否需要更新宽度或高度
198
+ if (requiredWidth > currentWidth || requiredHeight > currentHeight) {
199
+ graphStore.updateShape(props.shape.id, {
200
+ bounds: {
201
+ ...props.shape.bounds,
202
+ width: Math.max(requiredWidth, currentWidth),
203
+ height: requiredHeight
204
+ }
205
+ });
206
+ }
207
+ }
208
+
209
+ // 创建防抖版本的updateShapeBounds函数,在必要时使用
210
+ const debouncedUpdateShapeBounds = debounce(updateShapeBounds, 100);
211
+
212
+ const onClick = (e: MouseEvent) => {
213
+ emit('shape-click', props.shape, e)
214
+ }
215
+
216
+
217
+
218
+ // 监听name变化时更新宽度并重新选择图元(文本变化时立即调整)
219
+ watch(() => props.shape.name, () => {
220
+ updateShapeBounds();
221
+ // 只有当当前图元被选中时,才执行清空选择并重新选择的操作
222
+ if (graphStore.selectedShape?.id === props.shape.id) {
223
+ graphStore.clearSelection();
224
+ nextTick(() => {
225
+ graphStore.selectShape(props.shape);
226
+ });
227
+ }
228
+ });
229
+
230
+ // 监听keywords变化时更新宽度(文本变化时立即调整)
231
+ watch(() => props.shape.keywords, () => {
232
+ updateShapeBounds();
233
+ });
234
+
235
+ // 监听字体样式变化时更新宽度(样式变化时立即调整)
236
+ watch(() => [nameStyle.value.fontSize, nameBounds.value.height, keywordsStyle.value.fontSize], () => {
237
+ updateShapeBounds();
238
+ }, { deep: true });
239
+
240
+ // 监听bounds变化,但只在非缩放状态下响应
241
+ watch(() => props.shape.bounds.width, (newWidth) => {
242
+ if (newWidth !== undefined && !isResizing.value) {
243
+ // 只有在非缩放状态下才更新,避免缩放过程中改变图元大小
244
+ updateShapeBounds();
245
+ }
246
+ });
247
+
248
+ const vbW = computed(() => props.shape.bounds.width || 100)
249
+ const vbH = computed(() => props.shape.bounds.height || 40)
250
+ // ================== 监听 bounds 宽高变化 ==================
251
+
252
+ // 原始宽高(150 x 70)
253
+ const DEFAULT_WIDTH = 150
254
+ const DEFAULT_HEIGHT = 70
255
+
256
+ // 记录上一次的宽高,用来做去重判断
257
+ const lastBounds = ref({
258
+ width: props.shape.bounds.width ?? DEFAULT_WIDTH,
259
+ height: props.shape.bounds.height ?? DEFAULT_HEIGHT,
260
+ })
261
+
262
+ /**
263
+ * 当当前 shape 的宽高发生变化时,要执行的逻辑
264
+ */
265
+
266
+ // 同时监听 bounds.width 和 bounds.height
267
+ watch(
268
+ () => [props.shape.bounds.width, props.shape.bounds.height],
269
+ ([newW, newH]) => {
270
+ if (isGhost.value) return
271
+ // 宽高兜底到默认值(150 x 70)
272
+ const width = newW ?? DEFAULT_WIDTH
273
+ const height = newH ?? DEFAULT_HEIGHT
274
+
275
+ // 如果和上一次一致,直接返回,避免重复触发
276
+ if (
277
+ width == lastBounds.value.width &&
278
+ height == lastBounds.value.height
279
+ ) {
280
+ return
281
+ }
282
+ // 更新“上一次”的记录
283
+ lastBounds.value = { width, height }
284
+ // 只有当宽高不再是原始 150 x 70 时才认为“真的变化”,再去调用其他方法
285
+ if (
286
+ width !== DEFAULT_WIDTH || height !== DEFAULT_HEIGHT
287
+
288
+ ){
289
+ graphStore.expandParentAndEmitSizeUpdateByChild(props.shape)
290
+ }
291
+ }
292
+ )
293
+ </script>
294
+
295
+ <style scoped>
296
+ .capability-shape {
297
+ display: flex;
298
+ align-items: center;
299
+ justify-content: center;
300
+ overflow: hidden;
301
+ }
302
+
303
+ .capability-svg {
304
+ display: block;
305
+ }
306
+ </style>