@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.
- package/LICENSE +21 -0
- package/README.md +343 -0
- package/dist/index.d.ts +3937 -0
- package/dist/index.esm.js +74367 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.umd.js +38 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/style.css +1 -0
- package/package.json +70 -0
- package/src/components/ContextMenu.vue +475 -0
- package/src/components/Diagram/StrategicTaxonomyDiagram.vue +141 -0
- package/src/components/Edge/Edge.vue +366 -0
- package/src/components/InteractionLayer.vue +2033 -0
- package/src/components/Label.vue +0 -0
- package/src/components/LineStyle/ConnectionLine.vue +126 -0
- package/src/components/LineStyle/LineStyleMarker.vue +87 -0
- package/src/components/Pin/Pin.vue +220 -0
- package/src/components/Pin/Port.vue +172 -0
- package/src/components/Shape/Action.vue +121 -0
- package/src/components/Shape/ActivityAction.vue +155 -0
- package/src/components/Shape/Block.vue +306 -0
- package/src/components/Shape/ConceptualRole.vue +266 -0
- package/src/components/Shape/Diagram.vue +220 -0
- package/src/components/Shape/DividingLine.vue +594 -0
- package/src/components/Shape/DogEar.vue +224 -0
- package/src/components/Shape/Package.vue +340 -0
- package/src/constants/edgeShapeKeys.ts +81 -0
- package/src/constants/index.ts +440 -0
- package/src/index.ts +28 -0
- package/src/render/shape-registry.ts +17 -0
- package/src/render/shape-renderer.ts +103 -0
- package/src/statics/icons/childIcons/relations@3x.png +0 -0
- package/src/statics/icons/childIcons/role@3x.png +0 -0
- package/src/statics/icons/childIcons//344/270/232/345/212/241/344/277/241/345/217/267@3x.png +0 -0
- package/src/statics/icons/childIcons//344/270/232/345/212/241/344/277/241/346/201/257@3x.png +0 -0
- package/src/statics/icons/childIcons//344/270/232/345/212/241/344/277/241/346/201/257/345/233/276@3x.png +0 -0
- 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
- 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
- package/src/statics/icons/childIcons//344/270/232/345/212/241/345/212/250/344/275/234@3x.png +0 -0
- package/src/statics/icons/childIcons//344/270/232/345/212/241/345/217/202/346/225/260@3x.png +0 -0
- package/src/statics/icons/childIcons//344/270/232/345/212/241/345/217/202/346/225/260/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons//344/270/232/345/212/241/345/257/271/350/261/241/346/265/201@3x.png +0 -0
- package/src/statics/icons/childIcons//344/270/232/345/212/241/346/211/247/350/241/214/350/200/205@3x.png +0 -0
- package/src/statics/icons/childIcons//344/270/232/345/212/241/346/216/245/345/217/243@3x.png +0 -0
- package/src/statics/icons/childIcons//344/270/232/345/212/241/346/216/247/345/210/266/346/265/201@3x.png +0 -0
- package/src/statics/icons/childIcons//344/270/232/345/212/241/346/246/202/345/277/265/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons//344/270/232/345/212/241/346/246/202/345/277/265/350/241/250@3x.png +0 -0
- package/src/statics/icons/childIcons//344/270/232/345/212/241/346/264/273/345/212/250@3x.png +0 -0
- 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
- 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
- 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
- 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
- package/src/statics/icons/childIcons//344/270/232/345/212/241/346/265/201/347/250/213/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons//344/270/232/345/212/241/347/212/266/346/200/201/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons//344/270/232/345/212/241/347/253/257/345/217/243@3x.png +0 -0
- package/src/statics/icons/childIcons//344/270/232/345/212/241/347/272/246/346/235/237@3x.png +0 -0
- package/src/statics/icons/childIcons//344/270/232/345/212/241/347/272/246/346/235/237/345/233/276@3x.png +0 -0
- 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
- package/src/statics/icons/childIcons//344/270/232/345/212/241/347/272/246/346/235/237/350/241/250@3x.png +0 -0
- package/src/statics/icons/childIcons//344/270/232/345/212/241/347/273/223/346/236/204@3x.png +0 -0
- 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
- package/src/statics/icons/childIcons//344/270/232/345/212/241/350/247/222/350/211/262@3x.png +0 -0
- package/src/statics/icons/childIcons//344/270/232/345/212/241/350/277/236/346/216/245/345/231/250@3x.png +0 -0
- package/src/statics/icons/childIcons//344/270/232/345/212/241/350/277/236/351/200/232/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons//344/270/232/345/212/241/350/277/236/351/200/232/350/241/250@3x.png +0 -0
- 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
- package/src/statics/icons/childIcons//344/272/272/345/221/230@3x.png +0 -0
- 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
- 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
- package/src/statics/icons/childIcons//344/272/272/345/221/230/345/217/202/346/225/260/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons//344/272/272/345/221/230/346/246/202/345/277/265/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons//344/272/272/345/221/230/346/246/202/345/277/265/350/241/250@3x.png +0 -0
- package/src/statics/icons/childIcons//344/272/272/345/221/230/346/265/201/347/250/213/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons//344/272/272/345/221/230/347/212/266/346/200/201/345/233/276@3x.png +0 -0
- 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
- package/src/statics/icons/childIcons//344/272/272/345/221/230/347/272/246/346/235/237/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons//344/272/272/345/221/230/347/273/223/346/236/204/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons//344/272/272/345/221/230/350/277/236/351/200/232/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons//344/272/272/345/221/230/350/277/236/351/200/232/350/241/250@3x.png +0 -0
- package/src/statics/icons/childIcons//344/273/267/345/200/274/346/265/201@3x.png +0 -0
- package/src/statics/icons/childIcons//344/273/273/346/204/217/345/205/263/347/263/273@3x.png +0 -0
- package/src/statics/icons/childIcons//344/273/273/346/204/217/350/277/236/346/216/245/345/231/250@3x.png +0 -0
- package/src/statics/icons/childIcons//344/274/201/344/270/232/344/275/277/345/221/275@3x.png +0 -0
- 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
- package/src/statics/icons/childIcons//344/274/201/344/270/232/346/204/277/346/231/257@3x.png +0 -0
- package/src/statics/icons/childIcons//344/274/201/344/270/232/347/233/256/346/240/207@3x.png +0 -0
- package/src/statics/icons/childIcons//344/275/215/347/275/256@3x.png +0 -0
- package/src/statics/icons/childIcons//344/275/223/347/263/273/346/236/266/346/236/204@3x.png +0 -0
- package/src/statics/icons/childIcons//344/276/235/350/265/226@3x.png +0 -0
- package/src/statics/icons/childIcons//344/277/235/346/212/244@3x.png +0 -0
- package/src/statics/icons/childIcons//344/277/241/346/201/257/346/250/241/345/236/213@3x.png +0 -0
- package/src/statics/icons/childIcons//345/210/233/351/200/240@3x.png +0 -0
- package/src/statics/icons/childIcons//345/212/237/350/203/275@3x.png +0 -0
- 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
- package/src/statics/icons/childIcons//345/212/237/350/203/275/345/212/250/344/275/234@3x.png +0 -0
- package/src/statics/icons/childIcons//345/212/237/350/203/275/345/257/271/350/261/241/346/265/201@3x.png +0 -0
- package/src/statics/icons/childIcons//345/212/237/350/203/275/346/216/247/345/210/266/346/265/201@3x.png +0 -0
- package/src/statics/icons/childIcons//345/217/214/345/220/221/345/205/263/350/201/224@3x.png +0 -0
- package/src/statics/icons/childIcons//345/217/227/345/210/260/345/275/261/345/223/215@3x.png +0 -0
- 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
- 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
- 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
- package/src/statics/icons/childIcons//345/256/211/345/205/250/346/216/247/345/210/266@3x.png +0 -0
- package/src/statics/icons/childIcons//345/256/211/345/205/250/346/246/202/345/277/265/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons//345/256/211/345/205/250/346/246/202/345/277/265/350/241/250@3x.png +0 -0
- package/src/statics/icons/childIcons//345/256/211/345/205/250/346/265/201/347/250/213@3x.png +0 -0
- 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
- package/src/statics/icons/childIcons//345/256/211/345/205/250/346/265/201/347/250/213/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons//345/256/211/345/205/250/347/272/246/346/235/237@3x.png +0 -0
- package/src/statics/icons/childIcons//345/256/211/345/205/250/347/272/246/346/235/237/345/233/276@3x.png +0 -0
- 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
- package/src/statics/icons/childIcons//345/256/211/345/205/250/347/273/223/346/236/204/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons//345/256/211/345/205/250/350/277/236/351/200/232/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons//345/256/211/345/205/250/350/277/236/351/200/232/350/241/250@3x.png +0 -0
- package/src/statics/icons/childIcons//345/256/211/345/205/250/351/232/224/347/246/273@3x.png +0 -0
- package/src/statics/icons/childIcons//345/256/211/345/205/250/351/243/216/351/231/251@3x.png +0 -0
- package/src/statics/icons/childIcons//345/256/232/345/220/221/345/205/263/347/263/273@3x.png +0 -0
- package/src/statics/icons/childIcons//345/256/232/345/220/221/345/205/263/350/201/224@3x.png +0 -0
- package/src/statics/icons/childIcons//345/256/232/345/220/221/347/273/204/346/210/220@3x.png +0 -0
- package/src/statics/icons/childIcons//345/256/232/345/220/221/350/201/232/345/220/210@3x.png +0 -0
- package/src/statics/icons/childIcons//345/256/236/351/231/205/344/272/272/345/221/230@3x.png +0 -0
- 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
- package/src/statics/icons/childIcons//345/256/236/351/231/205/344/275/215/347/275/256@3x.png +0 -0
- 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
- 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
- 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
- package/src/statics/icons/childIcons//345/256/236/351/231/205/346/234/215/345/212/241@3x.png +0 -0
- package/src/statics/icons/childIcons//345/256/236/351/231/205/346/235/241/344/273/266@3x.png +0 -0
- package/src/statics/icons/childIcons//345/256/236/351/231/205/347/216/257/345/242/203@3x.png +0 -0
- package/src/statics/icons/childIcons//345/256/236/351/231/205/347/273/204/347/273/207@3x.png +0 -0
- package/src/statics/icons/childIcons//345/256/236/351/231/205/350/201/214/344/275/215@3x.png +0 -0
- package/src/statics/icons/childIcons//345/256/236/351/231/205/350/201/214/350/264/243@3x.png +0 -0
- package/src/statics/icons/childIcons//345/256/236/351/231/205/350/264/243/344/273/273@3x.png +0 -0
- package/src/statics/icons/childIcons//345/256/236/351/231/205/350/265/204/346/272/220@3x.png +0 -0
- 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
- 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
- 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
- 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
- package/src/statics/icons/childIcons//345/256/236/351/231/205/351/241/271/347/233/256@3x.png +0 -0
- 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
- 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
- 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
- package/src/statics/icons/childIcons//345/256/236/351/231/205/351/243/216/351/231/251@3x.png +0 -0
- package/src/statics/icons/childIcons//345/261/225/347/244/272@3x.png +0 -0
- package/src/statics/icons/childIcons//345/267/262/347/237/245/350/265/204/346/272/220@3x.png +0 -0
- 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
- package/src/statics/icons/childIcons//345/274/225/347/224/250/345/261/236/346/200/247@3x.png +0 -0
- package/src/statics/icons/childIcons//345/275/261/345/223/215@3x-2.png +0 -0
- package/src/statics/icons/childIcons//345/275/261/345/223/215@3x.png +0 -0
- package/src/statics/icons/childIcons//346/204/277/346/231/257/345/256/243/350/250/200@3x.png +0 -0
- package/src/statics/icons/childIcons//346/210/230/347/225/245@3x.png +0 -0
- package/src/statics/icons/childIcons//346/210/230/347/225/245/344/277/241/346/201/257@3x.png +0 -0
- 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
- package/src/statics/icons/childIcons//346/210/230/347/225/245/344/277/241/346/201/257/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons//346/210/230/347/225/245/345/217/202/346/225/260/345/233/276@3x.png +0 -0
- 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
- 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
- package/src/statics/icons/childIcons//346/210/230/347/225/245/346/246/202/345/277/265/345/233/276@3x.png +0 -0
- 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
- package/src/statics/icons/childIcons//346/210/230/347/225/245/346/265/201/347/250/213/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons//346/210/230/347/225/245/347/212/266/346/200/201/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons//346/210/230/347/225/245/347/272/246/346/235/237@3x.png +0 -0
- package/src/statics/icons/childIcons//346/210/230/347/225/245/347/272/246/346/235/237/345/233/276@3x.png +0 -0
- 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
- package/src/statics/icons/childIcons//346/210/230/347/225/245/347/273/223/346/236/204/345/233/276@3x.png +0 -0
- 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
- package/src/statics/icons/childIcons//346/210/230/347/225/245/350/277/236/351/200/232/345/233/276@3x.png +0 -0
- 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
- 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
- package/src/statics/icons/childIcons//346/210/230/347/225/245/351/230/266/346/256/265@3x.png +0 -0
- package/src/statics/icons/childIcons//346/211/247/350/241/214@3x.png +0 -0
- 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
- 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
- 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
- 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
- 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
- package/src/statics/icons/childIcons//346/211/277/346/213/205/351/243/216/351/231/251@3x.png +0 -0
- package/src/statics/icons/childIcons//346/212/200/346/234/257@3x.png +0 -0
- package/src/statics/icons/childIcons//346/213/245/346/234/211/346/265/201/347/250/213@3x.png +0 -0
- package/src/statics/icons/childIcons//346/217/220/344/276/233/346/235/203/351/231/220@3x.png +0 -0
- package/src/statics/icons/childIcons//346/227/266/346/234/272@3x.png +0 -0
- package/src/statics/icons/childIcons//346/234/215/345/212/241@3x.png +0 -0
- 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
- 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
- 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
- package/src/statics/icons/childIcons//346/234/215/345/212/241/344/277/241/345/217/267@3x.png +0 -0
- 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
- 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
- package/src/statics/icons/childIcons//346/234/215/345/212/241/345/212/237/350/203/275@3x.png +0 -0
- 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
- package/src/statics/icons/childIcons//346/234/215/345/212/241/345/212/250/344/275/234@3x.png +0 -0
- package/src/statics/icons/childIcons//346/234/215/345/212/241/345/217/202/346/225/260@3x.png +0 -0
- package/src/statics/icons/childIcons//346/234/215/345/212/241/345/217/202/346/225/260/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons//346/234/215/345/212/241/345/257/271/350/261/241/346/265/201@3x.png +0 -0
- package/src/statics/icons/childIcons//346/234/215/345/212/241/346/216/245/345/217/243@3x.png +0 -0
- package/src/statics/icons/childIcons//346/234/215/345/212/241/346/216/247/345/210/266/346/265/201@3x.png +0 -0
- package/src/statics/icons/childIcons//346/234/215/345/212/241/346/246/202/345/277/265/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons//346/234/215/345/212/241/346/246/202/345/277/265/350/241/250@3x.png +0 -0
- package/src/statics/icons/childIcons//346/234/215/345/212/241/346/265/201/347/250/213/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons//346/234/215/345/212/241/347/212/266/346/200/201/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons//346/234/215/345/212/241/347/253/257/345/217/243@3x.png +0 -0
- package/src/statics/icons/childIcons//346/234/215/345/212/241/347/272/246/346/235/237/345/233/276@3x.png +0 -0
- 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
- package/src/statics/icons/childIcons//346/234/215/345/212/241/347/273/223/346/236/204@3x.png +0 -0
- package/src/statics/icons/childIcons//346/234/215/345/212/241/347/273/223/346/236/204/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons//346/234/215/345/212/241/350/247/222/350/211/262@3x.png +0 -0
- package/src/statics/icons/childIcons//346/234/215/345/212/241/350/267/257/347/272/277/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons//346/234/215/345/212/241/350/277/236/346/216/245/345/231/250@3x.png +0 -0
- package/src/statics/icons/childIcons//346/234/215/345/212/241/350/277/236/351/200/232/345/233/276@3x.png +0 -0
- 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
- package/src/statics/icons/childIcons//346/234/215/345/212/241/350/277/236/351/200/232/350/241/250@3x.png +0 -0
- package/src/statics/icons/childIcons//346/235/203/351/231/220@3x.png +0 -0
- package/src/statics/icons/childIcons//346/235/241/344/273/266@3x.png +0 -0
- 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
- package/src/statics/icons/childIcons//346/240/207/345/207/206/346/246/202/345/277/265/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons//346/240/207/345/207/206/346/246/202/345/277/265/350/241/250@3x.png +0 -0
- package/src/statics/icons/childIcons//346/240/207/345/207/206/347/273/223/346/236/204/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons//346/240/207/345/207/206/350/267/257/347/272/277/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons//346/240/207/345/207/206/350/277/275/346/272/257/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons//346/246/202/345/277/265/350/247/222/350/211/262@3x.png +0 -0
- package/src/statics/icons/childIcons//346/263/233/345/214/226@3x.png +0 -0
- package/src/statics/icons/childIcons//347/212/266/345/206/265@3x.png +0 -0
- package/src/statics/icons/childIcons//347/216/257/345/242/203@3x.png +0 -0
- package/src/statics/icons/childIcons//347/233/270/346/257/224@3x (1).png +0 -0
- package/src/statics/icons/childIcons//347/263/273/347/273/237@3x.png +0 -0
- package/src/statics/icons/childIcons//347/273/204/346/210/220@3x.png +0 -0
- package/src/statics/icons/childIcons//347/273/204/347/273/207@3x.png +0 -0
- package/src/statics/icons/childIcons//347/273/204/347/273/207/351/230/266/346/256/265@3x.png +0 -0
- package/src/statics/icons/childIcons//347/273/221/345/256/232/350/277/236/346/216/245/345/231/250@3x.png +0 -0
- package/src/statics/icons/childIcons//347/274/223/350/247/243@3x.png +0 -0
- package/src/statics/icons/childIcons//350/201/214/344/275/215@3x.png +0 -0
- package/src/statics/icons/childIcons//350/201/232/345/220/210@3x.png +0 -0
- package/src/statics/icons/childIcons//350/203/275/345/212/233@3x.png +0 -0
- package/src/statics/icons/childIcons//350/203/275/345/212/233/350/201/214/350/264/243@3x.png +0 -0
- package/src/statics/icons/childIcons//350/203/275/345/212/233/351/205/215/347/275/256@3x.png +0 -0
- package/src/statics/icons/childIcons//350/203/275/345/244/237/350/203/234/344/273/273@3x.png +0 -0
- package/src/statics/icons/childIcons//350/207/252/347/204/266/350/265/204/346/272/220@3x.png +0 -0
- package/src/statics/icons/childIcons//350/246/201/346/261/202@3x.png +0 -0
- package/src/statics/icons/childIcons//350/256/276/347/275/256/347/261/273/345/236/213.png +0 -0
- package/src/statics/icons/childIcons//350/264/237/350/264/243@3x.png +0 -0
- package/src/statics/icons/childIcons//350/264/243/344/273/273@3x.png +0 -0
- 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
- 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
- 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
- package/src/statics/icons/childIcons//350/265/204/346/272/220/344/277/241/345/217/267@3x.png +0 -0
- package/src/statics/icons/childIcons//350/265/204/346/272/220/344/277/241/346/201/257@3x.png +0 -0
- package/src/statics/icons/childIcons//350/265/204/346/272/220/344/277/241/346/201/257/345/233/276@3x.png +0 -0
- 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
- 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
- package/src/statics/icons/childIcons//350/265/204/346/272/220/345/212/250/344/275/234@3x.png +0 -0
- package/src/statics/icons/childIcons//350/265/204/346/272/220/345/217/202/346/225/260@3x.png +0 -0
- package/src/statics/icons/childIcons//350/265/204/346/272/220/345/217/202/346/225/260/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons//350/265/204/346/272/220/345/267/245/344/273/266@3x.png +0 -0
- package/src/statics/icons/childIcons//350/265/204/346/272/220/346/216/245/345/217/243@3x.png +0 -0
- package/src/statics/icons/childIcons//350/265/204/346/272/220/346/234/215/345/212/241@3x.png +0 -0
- package/src/statics/icons/childIcons//350/265/204/346/272/220/346/236/266/346/236/204@3x.png +0 -0
- package/src/statics/icons/childIcons//350/265/204/346/272/220/346/246/202/345/277/265/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons//350/265/204/346/272/220/346/246/202/345/277/265/350/241/250@3x.png +0 -0
- 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
- 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
- package/src/statics/icons/childIcons//350/265/204/346/272/220/346/265/201/347/250/213/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons//350/265/204/346/272/220/347/212/266/346/200/201/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons//350/265/204/346/272/220/347/253/257/345/217/243@3x.png +0 -0
- package/src/statics/icons/childIcons//350/265/204/346/272/220/347/272/246/346/235/237@3x.png +0 -0
- package/src/statics/icons/childIcons//350/265/204/346/272/220/347/273/223/346/236/204@3x.png +0 -0
- package/src/statics/icons/childIcons//350/265/204/346/272/220/347/273/223/346/236/204/345/233/276@3x.png +0 -0
- 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
- package/src/statics/icons/childIcons//350/265/204/346/272/220/350/247/222/350/211/262@3x.png +0 -0
- package/src/statics/icons/childIcons//350/265/204/346/272/220/350/277/236/346/216/245/345/231/250@3x.png +0 -0
- package/src/statics/icons/childIcons//350/265/204/346/272/220/350/277/236/351/200/232/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons//350/265/204/346/272/220/350/277/236/351/200/232/350/241/250@3x.png +0 -0
- package/src/statics/icons/childIcons//350/275/257/344/273/266@3x.png +0 -0
- package/src/statics/icons/childIcons//350/276/223/345/205/245/346/240/223@3x.png +0 -0
- package/src/statics/icons/childIcons//350/276/223/345/207/272/346/240/223@3x.png +0 -0
- package/src/statics/icons/childIcons//350/276/276/345/210/260@3x.png +0 -0
- package/src/statics/icons/childIcons//350/277/236/346/216/245/345/231/250@3x.png +0 -0
- package/src/statics/icons/childIcons//350/277/236/347/272/277@3x.png +0 -0
- package/src/statics/icons/childIcons//351/207/214/347/250/213/347/242/221/344/276/235/350/265/226@3x.png +0 -0
- package/src/statics/icons/childIcons//351/230/266/346/256/265@3x.png +0 -0
- package/src/statics/icons/childIcons//351/234/200/346/261/202/346/235/203/351/231/220@3x.png +0 -0
- 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
- package/src/statics/icons/childIcons//351/241/271/347/233/256@3x.png +0 -0
- package/src/statics/icons/childIcons//351/241/271/347/233/256/344/270/273/351/242/230@3x.png +0 -0
- 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
- package/src/statics/icons/childIcons//351/241/271/347/233/256/346/246/202/345/277/265/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons//351/241/271/347/233/256/346/246/202/345/277/265/350/241/250@3x.png +0 -0
- package/src/statics/icons/childIcons//351/241/271/347/233/256/346/264/273/345/212/250@3x.png +0 -0
- 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
- 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
- package/src/statics/icons/childIcons//351/241/271/347/233/256/346/265/201/347/250/213/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons//351/241/271/347/233/256/347/273/223/346/236/204/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons//351/241/271/347/233/256/350/247/222/350/211/262@3x.png +0 -0
- package/src/statics/icons/childIcons//351/241/271/347/233/256/350/267/257/347/272/277/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons//351/241/271/347/233/256/350/277/236/351/200/232/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons//351/241/271/347/233/256/351/207/214/347/250/213/347/242/221@3x.png +0 -0
- 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
- package/src/statics/icons/childIcons//351/241/272/345/272/217@3x-2.png +0 -0
- package/src/statics/icons/childIcons//351/241/272/345/272/217@3x.png +0 -0
- package/src/statics/icons/childIcons//351/243/216/351/231/251@3x.png +0 -0
- 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
- 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
- package/src/statics/icons/createMenu/config.png +0 -0
- package/src/statics/icons/createMenu/contact.png +0 -0
- package/src/statics/icons/createMenu/copy.png +0 -0
- package/src/statics/icons/createMenu/delete.png +0 -0
- package/src/statics/icons/createMenu/diagram.png +0 -0
- package/src/statics/icons/createMenu/element.png +0 -0
- package/src/statics/icons/createMenu/locateChart.png +0 -0
- package/src/statics/icons/createMenu/paste.png +0 -0
- package/src/statics/icons/createMenu/rename.png +0 -0
- package/src/statics/icons/createMenu/scissors.png +0 -0
- package/src/store/eventBus.ts +38 -0
- package/src/store/graphStore.ts +782 -0
- package/src/store/index.ts +8 -0
- package/src/style/index.css +1 -0
- package/src/style/tailwind.css +33 -0
- package/src/types/index.ts +200 -0
- package/src/utils/autoExpandParent.ts +94 -0
- package/src/utils/colorUtils.ts +137 -0
- package/src/utils/compartment.ts +534 -0
- package/src/utils/containers.ts +910 -0
- package/src/utils/diagram.ts +403 -0
- package/src/utils/dom.ts +21 -0
- package/src/utils/drag.ts +224 -0
- package/src/utils/edgeUtils.ts +787 -0
- package/src/utils/geom.ts +177 -0
- package/src/utils/graphDragService.ts +329 -0
- package/src/utils/highlightUtils.ts +162 -0
- package/src/utils/hittest.ts +135 -0
- package/src/utils/iconLoader.ts +105 -0
- package/src/utils/index.ts +20 -0
- package/src/utils/packgeMap.ts +1 -0
- package/src/utils/pinUtils.ts +484 -0
- package/src/utils/policy.ts +212 -0
- package/src/utils/zorder.ts +39 -0
- package/src/view/graph.vue +419 -0
- package/src/vite-env.d.ts +33 -0
|
@@ -0,0 +1,224 @@
|
|
|
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
|
+
<!-- 定义渐变 -->
|
|
5
|
+
<defs>
|
|
6
|
+
<!-- 水平线性渐变 -->
|
|
7
|
+
<linearGradient :id="`horizontalGradient-${shape.id}`" x1="0%" y1="0%" x2="100%" y2="0%">
|
|
8
|
+
<stop offset="0%" :stop-color="gradientLeftColor" />
|
|
9
|
+
<stop offset="100%" :stop-color="gradientRightColor" />
|
|
10
|
+
</linearGradient>
|
|
11
|
+
|
|
12
|
+
<!-- 折叠角的渐变(稍暗一些,增强折叠感) -->
|
|
13
|
+
<linearGradient :id="`foldGradient-${shape.id}`" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
14
|
+
<stop offset="0%" :stop-color="foldColor1" />
|
|
15
|
+
<stop offset="100%" :stop-color="foldColor2" />
|
|
16
|
+
</linearGradient>
|
|
17
|
+
</defs>
|
|
18
|
+
|
|
19
|
+
<!-- 带右上角折叠效果的形状 - 使用path绘制 -->
|
|
20
|
+
<path
|
|
21
|
+
:d="shapePath"
|
|
22
|
+
:fill="isGhost ? 'transparent' : `url(#horizontalGradient-${shape.id})`"
|
|
23
|
+
:stroke="strokeColor"
|
|
24
|
+
:stroke-width="strokeWidth"
|
|
25
|
+
/>
|
|
26
|
+
|
|
27
|
+
<!-- 折叠部分的阴影效果 -->
|
|
28
|
+
<path
|
|
29
|
+
v-if="!isGhost"
|
|
30
|
+
:d="foldPath"
|
|
31
|
+
fill="url(#foldGradient-${shape.id})"
|
|
32
|
+
:stroke="strokeColor"
|
|
33
|
+
:stroke-width="strokeWidth / 2"
|
|
34
|
+
/>
|
|
35
|
+
|
|
36
|
+
<g v-if="!isGhost">
|
|
37
|
+
<!-- 文本内容 - 下移contentOffset -->
|
|
38
|
+
<text :x="keywordsBounds.x || 5" :y="(keywordsBounds.y || 20) + contentOffset" text-anchor="start"
|
|
39
|
+
:font-family="keywordsStyle.fontFamily || '思源黑体'"
|
|
40
|
+
:font-size="keywordsStyle.fontSize || keywordsBounds.height || 8"
|
|
41
|
+
:font-weight="keywordsStyle.fontWeight || 'normal'" :fill="keywordsStyle.color || '#000000'">
|
|
42
|
+
{{ shape.keywords }}
|
|
43
|
+
</text>
|
|
44
|
+
|
|
45
|
+
<text :x="nameBounds.x || '50%'" :y="(nameBounds.y || 45) + contentOffset" text-anchor="middle"
|
|
46
|
+
:font-family="nameStyle.fontFamily || '思源黑体'" :font-size="nameStyle.fontSize || nameBounds.height || 12"
|
|
47
|
+
:font-weight="nameStyle.fontWeight || 'bold'" :fill="nameStyle.color || '#000000'" style="cursor: pointer;">
|
|
48
|
+
{{ shape.name }}
|
|
49
|
+
</text>
|
|
50
|
+
|
|
51
|
+
<!-- 图标图片 - 下移contentOffset并调整水平位置 -->
|
|
52
|
+
<image v-if="showIcon" :x="vbW - 30" :y="5 + contentOffset" width="20" height="20" :href="getIcon('childIcons', shape.icon || '')" />
|
|
53
|
+
</g>
|
|
54
|
+
</svg>
|
|
55
|
+
</div>
|
|
56
|
+
</template>
|
|
57
|
+
|
|
58
|
+
<script setup lang="ts">
|
|
59
|
+
import { computed, watch, nextTick, type CSSProperties } from 'vue'
|
|
60
|
+
import type { Shape } from '../../types'
|
|
61
|
+
import { getIcon } from "../../utils/iconLoader";
|
|
62
|
+
// 引入graphStore来更新shapes中的bounds值
|
|
63
|
+
import { useGraphStore } from '../../store/graphStore'
|
|
64
|
+
|
|
65
|
+
// Props
|
|
66
|
+
interface Props {
|
|
67
|
+
shape: Shape
|
|
68
|
+
}
|
|
69
|
+
const emit = defineEmits<{
|
|
70
|
+
(e: 'shape-click', shape: Shape, event: MouseEvent): void
|
|
71
|
+
(e: 'keywords-click', shape: Shape, event: MouseEvent): void
|
|
72
|
+
(e: 'name-click', shape: Shape, event: MouseEvent): void
|
|
73
|
+
}>()
|
|
74
|
+
const props = defineProps<Props>()
|
|
75
|
+
|
|
76
|
+
// 获取graphStore实例
|
|
77
|
+
const graphStore = useGraphStore()
|
|
78
|
+
|
|
79
|
+
// 交互层在拖拽/缩放时会给 shape.meta.isGhost = true
|
|
80
|
+
const isGhost = computed(() => (props.shape as any).meta?.isGhost)
|
|
81
|
+
|
|
82
|
+
// 轮廓颜色(边框颜色)
|
|
83
|
+
const strokeColor = computed(() =>
|
|
84
|
+
props.shape.style?.borderColor ?? '#8a6d3b'
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
// 轮廓线宽
|
|
88
|
+
const strokeWidth = computed(() =>
|
|
89
|
+
isGhost.value ? 4 : (props.shape.style?.borderWidth ?? 0.5)
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
// 填充色
|
|
93
|
+
const fillColor = computed(() =>
|
|
94
|
+
isGhost.value ? 'transparent' : (props.shape.keywordsStyle?.backgroundColor || '#9CCC65')
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
// 渐变颜色
|
|
98
|
+
const gradientLeftColor = computed(() =>
|
|
99
|
+
props.shape.keywordsStyle?.gradientLeftColor || '#9CCC65'
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
const gradientRightColor = computed(() =>
|
|
103
|
+
props.shape.keywordsStyle?.gradientRightColor || '#7CB342'
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
// 折叠角的颜色(稍暗一些,增强立体感)
|
|
107
|
+
const foldColor1 = computed(() => {
|
|
108
|
+
// 从主色生成稍暗的颜色用于折叠角
|
|
109
|
+
const color = gradientRightColor.value || '#7CB342';
|
|
110
|
+
return shadeColor(color, -20); // 调暗20%
|
|
111
|
+
})
|
|
112
|
+
|
|
113
|
+
const foldColor2 = computed(() => {
|
|
114
|
+
// 从主色生成更暗的颜色用于折叠角
|
|
115
|
+
const color = gradientRightColor.value || '#7CB342';
|
|
116
|
+
return shadeColor(color, -40); // 调暗40%
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
// 辅助函数:调整颜色明暗度
|
|
120
|
+
function shadeColor(color: string, percent: number) {
|
|
121
|
+
let R = parseInt(color.substring(1, 3), 16);
|
|
122
|
+
let G = parseInt(color.substring(3, 5), 16);
|
|
123
|
+
let B = parseInt(color.substring(5, 7), 16);
|
|
124
|
+
|
|
125
|
+
R = Math.floor(R * (100 + percent) / 100);
|
|
126
|
+
G = Math.floor(G * (100 + percent) / 100);
|
|
127
|
+
B = Math.floor(B * (100 + percent) / 100);
|
|
128
|
+
|
|
129
|
+
R = (R < 255) ? R : 255;
|
|
130
|
+
G = (G < 255) ? G : 255;
|
|
131
|
+
B = (B < 255) ? B : 255;
|
|
132
|
+
|
|
133
|
+
R = Math.round(R);
|
|
134
|
+
G = Math.round(G);
|
|
135
|
+
B = Math.round(B);
|
|
136
|
+
|
|
137
|
+
const RR = ((R.toString(16).length === 1) ? "0" + R.toString(16) : R.toString(16));
|
|
138
|
+
const GG = ((G.toString(16).length === 1) ? "0" + G.toString(16) : G.toString(16));
|
|
139
|
+
const BB = ((B.toString(16).length === 1) ? "0" + B.toString(16) : B.toString(16));
|
|
140
|
+
|
|
141
|
+
return `#${RR}${GG}${BB}`;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// 折叠角的大小,占宽度的15%
|
|
145
|
+
const foldSize = computed(() => Math.max(10, (props.shape.bounds.width || 100) * 0.15));
|
|
146
|
+
|
|
147
|
+
// 内容偏移量,让内容区低于折叠角
|
|
148
|
+
const contentOffset = computed(() => foldSize.value * 0.7); // 折叠角大小的70%作为偏移量
|
|
149
|
+
|
|
150
|
+
// 计算带折叠角的路径
|
|
151
|
+
const shapePath = computed(() => {
|
|
152
|
+
const w = props.shape.bounds.width || 100;
|
|
153
|
+
const h = props.shape.bounds.height || 40;
|
|
154
|
+
const fs = foldSize.value;
|
|
155
|
+
|
|
156
|
+
// SVG路径命令:M=移动到,L=直线到,Z=闭合路径
|
|
157
|
+
return `M0,0
|
|
158
|
+
L${w - fs},0
|
|
159
|
+
L${w},${fs}
|
|
160
|
+
L${w},${h}
|
|
161
|
+
L0,${h}
|
|
162
|
+
Z`;
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
// 折叠部分的路径(用于阴影效果)
|
|
166
|
+
const foldPath = computed(() => {
|
|
167
|
+
const w = props.shape.bounds.width || 100;
|
|
168
|
+
const fs = foldSize.value;
|
|
169
|
+
|
|
170
|
+
return `M${w - fs},0
|
|
171
|
+
L${w},${fs}
|
|
172
|
+
L${w - fs},${fs}
|
|
173
|
+
Z`;
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
// 根据 shape 的 bounds 生成样式
|
|
177
|
+
const shapeStyle = computed<CSSProperties>(() => {
|
|
178
|
+
const { bounds } = props.shape;
|
|
179
|
+
return {
|
|
180
|
+
width: `${bounds.width || 100}px`,
|
|
181
|
+
height: `${bounds.height || 40}px`
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
const onClick = (e: MouseEvent) => {
|
|
186
|
+
emit('shape-click', props.shape, e)
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
const vbW = computed(() => props.shape.bounds.width || 100);
|
|
190
|
+
const vbH = computed(() => props.shape.bounds.height || 40);
|
|
191
|
+
|
|
192
|
+
// 获取 keywordsBounds 和 nameBounds
|
|
193
|
+
const keywordsBounds = computed(() => props.shape.keywordsBounds || {});
|
|
194
|
+
const nameBounds = computed(() => props.shape.nameBounds || {});
|
|
195
|
+
|
|
196
|
+
// 获取 keywordsStyle 和 nameStyle
|
|
197
|
+
const keywordsStyle = computed(() => props.shape.keywordsStyle || {})
|
|
198
|
+
const nameStyle = computed(() => props.shape.nameStyle || {})
|
|
199
|
+
const showIcon = computed(() => props.shape.showIcon || false);
|
|
200
|
+
|
|
201
|
+
// 监听name变化时重新选择图元
|
|
202
|
+
watch(() => props.shape.name, () => {
|
|
203
|
+
// 只有当当前图元被选中时,才执行清空选择并重新选择的操作
|
|
204
|
+
if (graphStore.selectedShape?.id === props.shape.id) {
|
|
205
|
+
graphStore.clearSelection();
|
|
206
|
+
nextTick(() => {
|
|
207
|
+
graphStore.selectShape(props.shape);
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
</script>
|
|
212
|
+
|
|
213
|
+
<style scoped>
|
|
214
|
+
.capability-shape {
|
|
215
|
+
display: flex;
|
|
216
|
+
align-items: center;
|
|
217
|
+
justify-content: center;
|
|
218
|
+
overflow: hidden;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.capability-svg {
|
|
222
|
+
display: block;
|
|
223
|
+
}
|
|
224
|
+
</style>
|
|
@@ -0,0 +1,340 @@
|
|
|
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
|
+
<!-- 渐变/阴影定义 -->
|
|
5
|
+
<defs>
|
|
6
|
+
<!-- 主渐变 -->
|
|
7
|
+
<linearGradient :id="`mainGradient-${shape.id}`" x1="0%" y1="0%" x2="100%" y2="0%">
|
|
8
|
+
<stop offset="0%" :stop-color="gradientLeftColor" />
|
|
9
|
+
<stop offset="75%" :stop-color="gradientMiddleColor" />
|
|
10
|
+
<stop offset="100%" :stop-color="gradientRightColor" />
|
|
11
|
+
</linearGradient>
|
|
12
|
+
<!-- 盖子渐变(略深) -->
|
|
13
|
+
<linearGradient :id="`topGradient-${shape.id}`" x1="0%" y1="0%" x2="100%" y2="0%">
|
|
14
|
+
<stop offset="0%" :stop-color="topGradientLeftColor" />
|
|
15
|
+
<stop offset="75%" :stop-color="topGradientMiddleColor" />
|
|
16
|
+
<stop offset="100%" :stop-color="topGradientRightColor" />
|
|
17
|
+
</linearGradient>
|
|
18
|
+
|
|
19
|
+
<!-- 柔和投影,与Block组件保持一致 -->
|
|
20
|
+
<filter :id="`softShadow-${shape.id}`" x="-10%" y="-10%" width="120%" height="120%">
|
|
21
|
+
<feDropShadow dx="2" dy="2" stdDeviation="1" flood-color="#000000" flood-opacity="0.2" />
|
|
22
|
+
</filter>
|
|
23
|
+
</defs>
|
|
24
|
+
|
|
25
|
+
<!-- 阴影:放在最底层(预览态也给阴影可选,默认给实物态) -->
|
|
26
|
+
<g v-if="!isGhost" :filter="`url(#softShadow-${shape.id})`">
|
|
27
|
+
<path
|
|
28
|
+
:d="`M${strokeWidth / 2},${strokeWidth / 2} H${topPartWidthInt - strokeWidth / 2} V${topPartHeightInt - strokeWidth / 2} H${vbW - strokeWidth / 2} V${vbH - strokeWidth / 2} H${strokeWidth / 2} Z`"
|
|
29
|
+
fill="#000" opacity="0.0" /> <!-- 仅作为载体,透明填充让投影生效 -->
|
|
30
|
+
</g>
|
|
31
|
+
|
|
32
|
+
<!-- 主体形状:无描边,只负责填充 -->
|
|
33
|
+
<path :d="`M0,${topPartHeightInt} H${vbW} V${vbH} H0 Z`"
|
|
34
|
+
:fill="isGhost ? 'transparent' : `url(#mainGradient-${shape.id})`"></path>
|
|
35
|
+
|
|
36
|
+
<!-- 盖子:无描边,只负责填充 -->
|
|
37
|
+
<path :d="`M0,0 H${topPartWidthInt} V${topPartHeightInt} H0 Z`"
|
|
38
|
+
:fill="isGhost ? 'transparent' : `url(#topGradient-${shape.id})`"></path>
|
|
39
|
+
|
|
40
|
+
<!-- 轮廓路径:优化描边渲染,确保所有边框宽度一致 -->
|
|
41
|
+
<path
|
|
42
|
+
:d="`M${strokeWidth / 2},${strokeWidth / 2} H${topPartWidthInt - strokeWidth / 2} V${topPartHeightInt - strokeWidth / 2} H${vbW - strokeWidth / 2} V${vbH - strokeWidth / 2} H${strokeWidth / 2} Z`"
|
|
43
|
+
fill="none" :stroke="strokeColor" :stroke-width="strokeWidth" stroke-linejoin="round" rx="2"></path>
|
|
44
|
+
|
|
45
|
+
<!-- 分隔线已移除,通过盖子和主体的描边自然形成 -->
|
|
46
|
+
|
|
47
|
+
<!-- 文本/图标:预览态不渲染 -->
|
|
48
|
+
<g v-if="!isGhost">
|
|
49
|
+
<text :x="keywordsBounds.x || 5" :y="(keywordsBounds.y || 20) + topPartHeightInt" text-anchor="start"
|
|
50
|
+
:font-family="keywordsStyle.fontFamily || '思源黑体'"
|
|
51
|
+
:font-size="keywordsStyle.fontSize || keywordsBounds.height || 8"
|
|
52
|
+
:font-weight="keywordsStyle.fontWeight || 'normal'" :fill="keywordsStyle.color || '#000000'">
|
|
53
|
+
{{ shape.keywords }}
|
|
54
|
+
</text>
|
|
55
|
+
|
|
56
|
+
<text :x="nameBounds.x || '50%'" :y="((nameBounds.y || 45) - topPartHeight) + topPartHeightInt"
|
|
57
|
+
text-anchor="middle" :font-family="nameStyle.fontFamily || '思源黑体'"
|
|
58
|
+
:font-size="nameStyle.fontSize || nameBounds.height || 12" :font-weight="nameStyle.fontWeight || 'bold'"
|
|
59
|
+
:fill="nameStyle.color || '#000000'" style="cursor: pointer;">
|
|
60
|
+
{{ shape.name }}
|
|
61
|
+
</text>
|
|
62
|
+
|
|
63
|
+
<image v-if="showIcon" :x="vbW - 30" :y="23" width="20" height="20"
|
|
64
|
+
:href="getIcon('childIcons', shape.icon || '')" />
|
|
65
|
+
</g>
|
|
66
|
+
</svg>
|
|
67
|
+
</div>
|
|
68
|
+
</template>
|
|
69
|
+
|
|
70
|
+
<script setup lang="ts">
|
|
71
|
+
import { computed, nextTick, watch, onMounted, ref, onUnmounted, type CSSProperties } from 'vue'
|
|
72
|
+
import type { Shape } from '../../types'
|
|
73
|
+
import { getIcon } from "../../utils/iconLoader";
|
|
74
|
+
// 引入颜色处理工具函数
|
|
75
|
+
import { adjustColorLightness } from '../../utils/colorUtils'
|
|
76
|
+
// 引入graphStore来更新shapes中的bounds值
|
|
77
|
+
import { useGraphStore } from '../../store/graphStore'
|
|
78
|
+
// 引入事件总线来监听缩放状态
|
|
79
|
+
import { eventBus } from '../../store/eventBus';
|
|
80
|
+
|
|
81
|
+
interface Props { shape: Shape }
|
|
82
|
+
const emit = defineEmits<{
|
|
83
|
+
(e: 'shape-click', shape: Shape, event: MouseEvent): void
|
|
84
|
+
(e: 'keywords-click', shape: Shape, event: MouseEvent): void
|
|
85
|
+
(e: 'name-click', shape: Shape, event: MouseEvent): void
|
|
86
|
+
}>()
|
|
87
|
+
const props = defineProps<Props>()
|
|
88
|
+
|
|
89
|
+
// 获取graphStore实例
|
|
90
|
+
const graphStore = useGraphStore()
|
|
91
|
+
|
|
92
|
+
// 预览态(交互层会写 meta.isGhost)
|
|
93
|
+
const isGhost = computed(() => (props.shape as any).meta?.isGhost)
|
|
94
|
+
//跟踪name是否被修改过
|
|
95
|
+
const nameDirty = ref(false)
|
|
96
|
+
// 统一线宽:拖拽预览 4,其它从props中获取或使用默认值0.5(与Block组件保持一致)
|
|
97
|
+
const strokeWidth = computed(() =>
|
|
98
|
+
isGhost.value ? 4 : (props.shape.style?.borderWidth ?? 0.5)
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
// 颜色
|
|
102
|
+
// 轮廓颜色(边框颜色)
|
|
103
|
+
const strokeColor = computed(() =>
|
|
104
|
+
props.shape.style?.borderColor ?? '#8a6d3b'
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
// 基础颜色(带默认值)
|
|
108
|
+
const baseColor = computed(() =>
|
|
109
|
+
props.shape.keywordsStyle?.backgroundColor || '#C7D7FF'
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
// 渐变色
|
|
113
|
+
// 主体渐变颜色
|
|
114
|
+
const gradientLeftColor = computed(() => {
|
|
115
|
+
return baseColor.value
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
const gradientMiddleColor = computed(() => {
|
|
119
|
+
return adjustColorLightness(baseColor.value, 14)
|
|
120
|
+
})
|
|
121
|
+
|
|
122
|
+
const gradientRightColor = computed(() => {
|
|
123
|
+
return adjustColorLightness(baseColor.value, 22)
|
|
124
|
+
})
|
|
125
|
+
|
|
126
|
+
// 盖子渐变颜色
|
|
127
|
+
const topGradientLeftColor = computed(() => {
|
|
128
|
+
return adjustColorLightness(baseColor.value, -8)
|
|
129
|
+
})
|
|
130
|
+
|
|
131
|
+
const topGradientMiddleColor = computed(() => {
|
|
132
|
+
return adjustColorLightness(baseColor.value, 4)
|
|
133
|
+
})
|
|
134
|
+
|
|
135
|
+
const topGradientRightColor = computed(() => {
|
|
136
|
+
return adjustColorLightness(baseColor.value, 10)
|
|
137
|
+
})
|
|
138
|
+
|
|
139
|
+
// 文本与图标
|
|
140
|
+
const keywordsBounds = computed(() => props.shape.keywordsBounds || {})
|
|
141
|
+
const nameBounds = computed(() => props.shape.nameBounds || {})
|
|
142
|
+
const keywordsStyle = computed(() => props.shape.keywordsStyle || {})
|
|
143
|
+
const nameStyle = computed(() => props.shape.nameStyle || {})
|
|
144
|
+
const showIcon = computed(() => props.shape.showIcon || false)
|
|
145
|
+
const iconYPosition = computed(() => (keywordsBounds.value.y || 20) + topPartHeightInt.value - 8)
|
|
146
|
+
|
|
147
|
+
// 盖子高度固定为18像素,确保图形大小变化时盖子高度不变
|
|
148
|
+
const topPartHeight = computed(() => {
|
|
149
|
+
return 18 // 固定高度值
|
|
150
|
+
})
|
|
151
|
+
const topPartHeightInt = computed(() => topPartHeight.value)
|
|
152
|
+
|
|
153
|
+
// 计算基于文本内容的最小宽度
|
|
154
|
+
const textBasedMinWidth = computed(() => {
|
|
155
|
+
// 获取字体大小
|
|
156
|
+
const nameFontSize = nameStyle.value.fontSize || nameBounds.value.height || 12;
|
|
157
|
+
const keywordsFontSize = keywordsStyle.value.fontSize || keywordsBounds.value.height || 8;
|
|
158
|
+
// 假设每个字符的平均宽度是字体大小的1倍
|
|
159
|
+
const nameCharWidth = nameFontSize * 1;
|
|
160
|
+
const keywordsCharWidth = keywordsFontSize * 1;
|
|
161
|
+
|
|
162
|
+
// 计算名称文本的宽度
|
|
163
|
+
const nameTextWidth = (props.shape.name?.length || 0) * nameCharWidth;
|
|
164
|
+
// 计算关键词文本的宽度
|
|
165
|
+
const keywordsTextWidth = (props.shape.keywords?.length || 0) * keywordsCharWidth;
|
|
166
|
+
|
|
167
|
+
// 返回较大的宽度,并添加一些边距
|
|
168
|
+
const maxTextWidth = Math.max(nameTextWidth, keywordsTextWidth);
|
|
169
|
+
return maxTextWidth + 60; // 左右各10px边距
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
// 计算基于盖子宽度的最小宽度
|
|
173
|
+
const topPartMinWidth = computed(() => {
|
|
174
|
+
// 使用当前bounds宽度的40%作为盖子宽度的参考
|
|
175
|
+
const currentWidth = props.shape.bounds?.width || 240;
|
|
176
|
+
const topWidth = Math.round(currentWidth * 0.4);
|
|
177
|
+
return topWidth + 40;
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
// 最终的最小宽度
|
|
181
|
+
const estimatedTextWidth = computed(() => {
|
|
182
|
+
return Math.max(textBasedMinWidth.value, topPartMinWidth.value);
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
// 尺寸 - 确保宽度和高度独立计算,不会相互影响
|
|
186
|
+
const vbW = computed(() => Math.round(Math.max(estimatedTextWidth.value, props.shape.bounds.width || 240)))
|
|
187
|
+
const vbH = computed(() => Math.round(props.shape.bounds.height || 120))
|
|
188
|
+
|
|
189
|
+
// 盖子宽度计算 - 使用vbW而不是反向依赖
|
|
190
|
+
const topPartWidth = computed(() => Math.round(vbW.value * 0.4)) // 增加横条长度,从0.26调整为0.4
|
|
191
|
+
const topPartWidthInt = computed(() => topPartWidth.value)
|
|
192
|
+
|
|
193
|
+
// 更新图元的bounds宽度
|
|
194
|
+
const updateShapeBounds = async () => {
|
|
195
|
+
await nextTick();
|
|
196
|
+
|
|
197
|
+
const requiredWidth = estimatedTextWidth.value;
|
|
198
|
+
const currentWidth = props.shape.bounds?.width || 240;
|
|
199
|
+
const originalHeight = props.shape.bounds?.height || 120;
|
|
200
|
+
|
|
201
|
+
// 只有当文本所需宽度大于当前宽度时才更新
|
|
202
|
+
if (requiredWidth > currentWidth) {
|
|
203
|
+
graphStore.updateShape(props.shape.id, {
|
|
204
|
+
bounds: {
|
|
205
|
+
...props.shape.bounds,
|
|
206
|
+
width: requiredWidth,
|
|
207
|
+
// 明确保留原始高度,确保不会等比例缩放
|
|
208
|
+
height: originalHeight
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
// 监听name变化时更新宽度并重新选择图元
|
|
215
|
+
watch(() => props.shape.name, () => {
|
|
216
|
+
updateShapeBounds();
|
|
217
|
+
// 只有当当前图元被选中时,才执行清空选择并重新选择的操作
|
|
218
|
+
if (graphStore.selectedShape?.id === props.shape.id) {
|
|
219
|
+
graphStore.clearSelection();
|
|
220
|
+
nextTick(() => {
|
|
221
|
+
graphStore.selectShape(props.shape);
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
// 监听keywords变化时更新宽度
|
|
226
|
+
watch(() => props.shape.keywords, () => {
|
|
227
|
+
updateShapeBounds();
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
// 监听字体样式变化时更新宽度
|
|
231
|
+
watch(() => [nameStyle.value.fontSize, nameBounds.value.height, keywordsStyle.value.fontSize], () => {
|
|
232
|
+
updateShapeBounds();
|
|
233
|
+
}, { deep: true });
|
|
234
|
+
|
|
235
|
+
// 监听bounds变化(如缩放操作后),确保宽度始终满足文本显示需求
|
|
236
|
+
watch(() => props.shape.bounds?.width, (newWidth) => {
|
|
237
|
+
if (newWidth !== undefined) {
|
|
238
|
+
updateShapeBounds();
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
// 卡片容器样式(保留你的 zIndex)
|
|
243
|
+
const shapeStyle = computed<CSSProperties>(() => {
|
|
244
|
+
const { bounds, style } = props.shape
|
|
245
|
+
// 直接使用props中的bounds,确保宽度和高度完全独立
|
|
246
|
+
const width = Math.max(estimatedTextWidth.value, props.shape.bounds?.width || 240);
|
|
247
|
+
const height = props.shape.bounds?.height || 120;
|
|
248
|
+
|
|
249
|
+
return {
|
|
250
|
+
width: `${width}px`,
|
|
251
|
+
height: `${height}px`,
|
|
252
|
+
zIndex: (style?.zIndex as number) ?? 0,
|
|
253
|
+
}
|
|
254
|
+
})
|
|
255
|
+
|
|
256
|
+
const onClick = (e: MouseEvent) => emit('shape-click', props.shape, e)
|
|
257
|
+
// 跟踪缩放状态
|
|
258
|
+
const isResizing = ref(false);
|
|
259
|
+
|
|
260
|
+
// 定义事件处理函数
|
|
261
|
+
const handleResizeStart = () => {
|
|
262
|
+
isResizing.value = true;
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
const handleResizeEnd = () => {
|
|
266
|
+
isResizing.value = false;
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
// 组件挂载时绑定事件监听
|
|
270
|
+
onMounted(() => {
|
|
271
|
+
updateShapeBounds();
|
|
272
|
+
|
|
273
|
+
// 监听缩放开始和结束事件
|
|
274
|
+
eventBus.on('resize-start', handleResizeStart);
|
|
275
|
+
eventBus.on('resize-end', handleResizeEnd);
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
// 组件卸载时清理事件监听
|
|
279
|
+
onUnmounted(() => {
|
|
280
|
+
eventBus.off('resize-start', handleResizeStart);
|
|
281
|
+
eventBus.off('resize-end', handleResizeEnd);
|
|
282
|
+
});
|
|
283
|
+
// ================== 监听 bounds 宽高变化 ==================
|
|
284
|
+
|
|
285
|
+
// 原始宽高(150 x 85)
|
|
286
|
+
const DEFAULT_WIDTH = 150
|
|
287
|
+
const DEFAULT_HEIGHT = 85
|
|
288
|
+
|
|
289
|
+
// 记录上一次的宽高,用来做去重判断
|
|
290
|
+
const lastBounds = ref({
|
|
291
|
+
width: props.shape.bounds.width ?? DEFAULT_WIDTH,
|
|
292
|
+
height: props.shape.bounds.height ?? DEFAULT_HEIGHT,
|
|
293
|
+
})
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* 当当前 shape 的宽高发生变化时,要执行的逻辑
|
|
297
|
+
*/
|
|
298
|
+
|
|
299
|
+
// 同时监听 bounds.width 和 bounds.height
|
|
300
|
+
watch(
|
|
301
|
+
() => [props.shape.bounds.width, props.shape.bounds.height],
|
|
302
|
+
([newW, newH]) => {
|
|
303
|
+
if (isGhost.value) return
|
|
304
|
+
// 宽高兜底到默认值(150 x 85)
|
|
305
|
+
const width = newW ?? DEFAULT_WIDTH
|
|
306
|
+
const height = newH ?? DEFAULT_HEIGHT
|
|
307
|
+
|
|
308
|
+
// 如果和上一次一致,直接返回,避免重复触发
|
|
309
|
+
if (
|
|
310
|
+
width == lastBounds.value.width &&
|
|
311
|
+
height == lastBounds.value.height
|
|
312
|
+
) {
|
|
313
|
+
return
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// 更新“上一次”的记录
|
|
317
|
+
lastBounds.value = { width, height }
|
|
318
|
+
|
|
319
|
+
// 只有当宽高不再是原始 150 x 85 时才认为“真的变化”,再去调用其他方法
|
|
320
|
+
if (
|
|
321
|
+
width !== DEFAULT_WIDTH || height !== DEFAULT_HEIGHT
|
|
322
|
+
) {
|
|
323
|
+
graphStore.expandParentAndEmitSizeUpdateByChild(props.shape)
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
)
|
|
327
|
+
</script>
|
|
328
|
+
|
|
329
|
+
<style scoped>
|
|
330
|
+
.capability-shape {
|
|
331
|
+
display: flex;
|
|
332
|
+
align-items: center;
|
|
333
|
+
justify-content: center;
|
|
334
|
+
overflow: hidden;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
.capability-svg {
|
|
338
|
+
display: block;
|
|
339
|
+
}
|
|
340
|
+
</style>
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 边类型常量定义
|
|
3
|
+
* 集中管理所有组件中用到的边类型shapeKey集合,便于统一维护和修改
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// 特定边类型常量定义
|
|
7
|
+
export const EDGE_TYPE = {
|
|
8
|
+
/** 定向聚合:带菱形起点和空心箭头终点 */
|
|
9
|
+
DIRECTED_AGGREGATION: 'DirectedAggregation',
|
|
10
|
+
/** 聚合:带菱形起点 */
|
|
11
|
+
AGGREGATION: 'Aggregation',
|
|
12
|
+
/** 定向组成:带实心菱形起点和空心箭头终点 */
|
|
13
|
+
DIRECTED_COMPOSITION: 'DirectedComposition',
|
|
14
|
+
/** 组成:带实心菱形起点 */
|
|
15
|
+
COMPOSITION: 'Composition',
|
|
16
|
+
/** 泛化:带空心三角形箭头 */
|
|
17
|
+
GENERALIZATION: 'Generalization',
|
|
18
|
+
/** 默认关联 */
|
|
19
|
+
ASSOCIATION: 'Association',
|
|
20
|
+
/** 定向关联:带空心箭头终点的实线 */
|
|
21
|
+
DIRECTED_ASSOCIATION: 'DirectedAssociation'
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* 虚线样式的边类型集合
|
|
26
|
+
* 适用于需要使用虚线显示的边,如流程、依赖关系等
|
|
27
|
+
*/
|
|
28
|
+
export const DASHED_EDGE_SHAPES = [
|
|
29
|
+
'Phases',
|
|
30
|
+
'Sequence',
|
|
31
|
+
'Dependency',
|
|
32
|
+
'Creates',
|
|
33
|
+
'ComparesTo',
|
|
34
|
+
'ImpactedBy',
|
|
35
|
+
'Desires',
|
|
36
|
+
'Achieves',
|
|
37
|
+
'Implements',
|
|
38
|
+
'IsCapableToperform',
|
|
39
|
+
'ArbitraryConnector',
|
|
40
|
+
'OperationalControlFlow',
|
|
41
|
+
'FunctionControlFlow',
|
|
42
|
+
'ServiceControlFlow',
|
|
43
|
+
'IsCapableToPerform',
|
|
44
|
+
'Exhibits'
|
|
45
|
+
];
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* 需要显示keywords和lineName的边类型集合
|
|
49
|
+
* 与DASHED_EDGE_SHAPES保持一致,便于统一管理
|
|
50
|
+
*/
|
|
51
|
+
export const EDGES_WITH_KEYWORDS = DASHED_EDGE_SHAPES;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* 带箭头的边类型集合
|
|
55
|
+
* 包含所有虚线边类型和具有方向性的聚合/组成关系,以及定向关联
|
|
56
|
+
*/
|
|
57
|
+
export const EDGES_WITH_ARROWHEADS = [
|
|
58
|
+
...DASHED_EDGE_SHAPES,
|
|
59
|
+
EDGE_TYPE.DIRECTED_AGGREGATION,
|
|
60
|
+
EDGE_TYPE.DIRECTED_COMPOSITION,
|
|
61
|
+
EDGE_TYPE.DIRECTED_ASSOCIATION
|
|
62
|
+
];
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* 带菱形起点标记的边类型集合
|
|
66
|
+
* 适用于聚合和组成关系类型的边
|
|
67
|
+
*/
|
|
68
|
+
export const DIAMOND_MARKER_SHAPES = [
|
|
69
|
+
EDGE_TYPE.DIRECTED_AGGREGATION,
|
|
70
|
+
EDGE_TYPE.AGGREGATION,
|
|
71
|
+
EDGE_TYPE.DIRECTED_COMPOSITION,
|
|
72
|
+
EDGE_TYPE.COMPOSITION
|
|
73
|
+
];
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* 需要特殊终点处理的边类型集合
|
|
77
|
+
* 如泛化关系等需要特殊调整终点位置的类型
|
|
78
|
+
*/
|
|
79
|
+
export const SPECIAL_END_POINT_SHAPES = [
|
|
80
|
+
EDGE_TYPE.GENERALIZATION
|
|
81
|
+
];
|