@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,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>
|