@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
|
File without changes
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!-- 连线SVG组件,用于动态渲染不同样式的连线 -->
|
|
3
|
+
<svg v-if="showLine" class="connection-line" :style="svgStyle">
|
|
4
|
+
<!-- 引入线条样式标记组件 -->
|
|
5
|
+
<LineStyleMarker :shape-key="shapeKey" />
|
|
6
|
+
|
|
7
|
+
<!-- 渲染polyline并根据shapeKey应用不同的样式和标记 -->
|
|
8
|
+
<polyline :points="points" :fill="lineStyle.fill" :stroke="lineStyle.stroke"
|
|
9
|
+
:stroke-width="String(lineStyle.strokeWidth)" :stroke-linecap="lineStyle.strokeLinecap"
|
|
10
|
+
:stroke-linejoin="lineStyle.strokeLinejoin" :stroke-dasharray="lineStyle.strokeDasharray"
|
|
11
|
+
:marker-start="getMarkerStart()" :marker-end="getMarkerEnd()" />
|
|
12
|
+
</svg>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script setup lang="ts">
|
|
16
|
+
import { computed } from 'vue';
|
|
17
|
+
import LineStyleMarker from './LineStyleMarker.vue';
|
|
18
|
+
import type { CSSProperties } from 'vue';
|
|
19
|
+
import { DASHED_EDGE_SHAPES, EDGES_WITH_ARROWHEADS, DIAMOND_MARKER_SHAPES, EDGE_TYPE } from '../../constants/edgeShapeKeys';
|
|
20
|
+
|
|
21
|
+
type StrokeLinecap = 'inherit' | 'round' | 'butt' | 'square'
|
|
22
|
+
type StrokeLinejoin = 'inherit' | 'round' | 'miter' | 'bevel'
|
|
23
|
+
export interface LineStyle {
|
|
24
|
+
stroke: string
|
|
25
|
+
strokeWidth: number | string
|
|
26
|
+
strokeLinecap: StrokeLinecap
|
|
27
|
+
strokeLinejoin: StrokeLinejoin
|
|
28
|
+
strokeDasharray?: string
|
|
29
|
+
fill?: string
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
interface Props {
|
|
33
|
+
showLine: boolean;
|
|
34
|
+
points: string;
|
|
35
|
+
shapeKey?: string;
|
|
36
|
+
style?: CSSProperties & Partial<LineStyle>
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
interface Point {
|
|
40
|
+
x: number;
|
|
41
|
+
y: number;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const props = defineProps<Props>();
|
|
45
|
+
|
|
46
|
+
// 默认的线条样式
|
|
47
|
+
const defaultLineStyle: LineStyle = {
|
|
48
|
+
fill: 'none',
|
|
49
|
+
stroke: '#5E5E5E',
|
|
50
|
+
strokeWidth: '1.5',
|
|
51
|
+
strokeLinecap: 'round',
|
|
52
|
+
strokeLinejoin: 'round',
|
|
53
|
+
strokeDasharray: ''
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
// 解析点字符串为坐标数组
|
|
57
|
+
const parsedPoints = computed((): Point[] => {
|
|
58
|
+
if (!props.points) return [];
|
|
59
|
+
|
|
60
|
+
return props.points.split(' ').map(pointStr => {
|
|
61
|
+
const [x, y] = pointStr.split(',').map(Number);
|
|
62
|
+
return { x, y };
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
// 根据shapeKey计算线条样式
|
|
67
|
+
const shapeKey = computed(() => props.shapeKey || 'Association');
|
|
68
|
+
|
|
69
|
+
// 直接使用解析后的点,线条缩短已在Edge.vue中处理
|
|
70
|
+
const points = computed(() => {
|
|
71
|
+
return parsedPoints.value.map(p => `${p.x},${p.y}`).join(' ');
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
// 计算最终的线条样式
|
|
75
|
+
const lineStyle = computed<LineStyle>(() => {
|
|
76
|
+
let style = { ...defaultLineStyle };
|
|
77
|
+
|
|
78
|
+
// 根据shapeKey设置虚线样式
|
|
79
|
+
if (DASHED_EDGE_SHAPES.includes(shapeKey.value)) {
|
|
80
|
+
style.strokeDasharray = '12,11'; // 虚线样式
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// 合并用户自定义样式
|
|
84
|
+
if (props.style) {
|
|
85
|
+
style = {
|
|
86
|
+
...style,
|
|
87
|
+
...props.style
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return style;
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
// SVG容器样式
|
|
95
|
+
const svgStyle = computed(() => props.style || {});
|
|
96
|
+
|
|
97
|
+
// 获取起点标记
|
|
98
|
+
const getMarkerStart = () => {
|
|
99
|
+
// 其他类型起点菱形
|
|
100
|
+
if (DIAMOND_MARKER_SHAPES.includes(shapeKey.value)) {
|
|
101
|
+
return `url(#diamond-${shapeKey.value})`;
|
|
102
|
+
}
|
|
103
|
+
return '';
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
// 获取终点标记
|
|
107
|
+
const getMarkerEnd = () => {
|
|
108
|
+
// 终点箭头
|
|
109
|
+
if (EDGES_WITH_ARROWHEADS.includes(shapeKey.value)) {
|
|
110
|
+
return `url(#arrowhead-${shapeKey.value})`;
|
|
111
|
+
}
|
|
112
|
+
// 空心三角形箭头
|
|
113
|
+
else if (shapeKey.value === 'Generalization') {
|
|
114
|
+
return `url(#diamond-${shapeKey.value})`;
|
|
115
|
+
}
|
|
116
|
+
return '';
|
|
117
|
+
};
|
|
118
|
+
</script>
|
|
119
|
+
|
|
120
|
+
<style scoped>
|
|
121
|
+
.connection-line {
|
|
122
|
+
position: absolute;
|
|
123
|
+
pointer-events: none;
|
|
124
|
+
z-index: 10;
|
|
125
|
+
}
|
|
126
|
+
</style>
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!-- 根据不同的shapeKey动态渲染对应的SVG标记定义 -->
|
|
3
|
+
<template v-if="shapeKey">
|
|
4
|
+
<defs>
|
|
5
|
+
<!-- 定向聚合 - 起点菱形,终点空心箭头 -->
|
|
6
|
+
<template v-if="shapeKey === EDGE_TYPE.DIRECTED_AGGREGATION">
|
|
7
|
+
<!-- 终点箭头标记 -->
|
|
8
|
+
<marker :id="`arrowhead-${shapeKey}`" markerWidth="7" markerHeight="6" refX="7" refY="3" orient="auto">
|
|
9
|
+
<path d="M0 0 L7 3 L0 6" fill="none" stroke="#5E5E5E" stroke-width="1" stroke-linejoin="round" />
|
|
10
|
+
</marker>
|
|
11
|
+
<!-- 起点菱形标记 -->
|
|
12
|
+
<marker :id="`diamond-${shapeKey}`" markerWidth="12" markerHeight="6" refX="11.8" refY="3" orient="auto"
|
|
13
|
+
markerUnits="strokeWidth">
|
|
14
|
+
<polygon points="6 0, 12 3, 6 6, 0 3" fill="none" stroke="#5E5E5E" stroke-width="1" />
|
|
15
|
+
</marker>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<!-- 聚合(只有起点菱形,终点无箭头) -->
|
|
19
|
+
<template v-else-if="shapeKey === EDGE_TYPE.AGGREGATION">
|
|
20
|
+
<marker :id="`diamond-${shapeKey}`" markerWidth="12" markerHeight="6" refX="11.8" refY="3" orient="auto"
|
|
21
|
+
markerUnits="strokeWidth">
|
|
22
|
+
<polygon points="6 0, 12 3, 6 6, 0 3" fill="none" stroke="#5E5E5E" stroke-width="1" />
|
|
23
|
+
</marker>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<!-- 泛化 - 空心三角形箭头 -->
|
|
27
|
+
<template v-else-if="shapeKey === EDGE_TYPE.GENERALIZATION">
|
|
28
|
+
<marker :id="`diamond-${shapeKey}`" markerWidth="10" markerHeight="7" refX="" refY="3.5" orient="auto">
|
|
29
|
+
<path d="M0 0 L10 3.5 L0 7 Z" fill="none" stroke="#5E5E5E" stroke-width="1" />
|
|
30
|
+
</marker>
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<!-- 定向组成 - 起点实心菱形 终端箭头 -->
|
|
34
|
+
<template v-else-if="shapeKey === EDGE_TYPE.DIRECTED_COMPOSITION">
|
|
35
|
+
<!-- 箭头 -->
|
|
36
|
+
<marker :id="`arrowhead-${shapeKey}`" markerWidth="7" markerHeight="6" refX="7" refY="3" orient="auto">
|
|
37
|
+
<path d="M0 0 L7 3 L0 6" fill="none" stroke="#5E5E5E" stroke-width="1" stroke-linejoin="round" />
|
|
38
|
+
</marker>
|
|
39
|
+
<!-- 菱形 -->
|
|
40
|
+
<marker :id="`diamond-${shapeKey}`" markerWidth="12" markerHeight="6" refX="11.8" refY="3" orient="auto"
|
|
41
|
+
markerUnits="strokeWidth">
|
|
42
|
+
<polygon points="6 0, 12 3, 6 6, 0 3" fill="#5E5E5E" stroke="#5E5E5E" stroke-width="1" />
|
|
43
|
+
</marker>
|
|
44
|
+
</template>
|
|
45
|
+
|
|
46
|
+
<!-- 组成 - 实心菱形 -->
|
|
47
|
+
<template v-else-if="shapeKey === EDGE_TYPE.COMPOSITION">
|
|
48
|
+
<marker :id="`diamond-${shapeKey}`" markerWidth="12" markerHeight="6" refX="11.8" refY="3" orient="auto"
|
|
49
|
+
markerUnits="strokeWidth">
|
|
50
|
+
<polygon points="6 0, 12 3, 6 6, 0 3" fill="#5E5E5E" stroke="#5E5E5E" stroke-width="1" />
|
|
51
|
+
</marker>
|
|
52
|
+
</template>
|
|
53
|
+
|
|
54
|
+
<!-- 定向关联 - 带空心箭头终点的实线 -->
|
|
55
|
+
<template v-else-if="shapeKey === EDGE_TYPE.DIRECTED_ASSOCIATION">
|
|
56
|
+
<!-- 终点箭头标记 -->
|
|
57
|
+
<marker :id="`arrowhead-${shapeKey}`" markerWidth="7" markerHeight="6" refX="7" refY="3" orient="auto">
|
|
58
|
+
<path d="M0 0 L7 3 L0 6" fill="none" stroke="#5E5E5E" stroke-width="1" stroke-linejoin="round" />
|
|
59
|
+
</marker>
|
|
60
|
+
</template>
|
|
61
|
+
|
|
62
|
+
<!-- 虚线边类型 - 带终端箭头 -->
|
|
63
|
+
<template v-else-if="DASHED_EDGE_SHAPES.includes(shapeKey)">
|
|
64
|
+
<!-- 终点箭头标记 -->
|
|
65
|
+
<marker :id="`arrowhead-${shapeKey}`" markerWidth="7" markerHeight="6" refX="7" refY="3" orient="auto">
|
|
66
|
+
<path d="M0 0 L7 3 L0 6" fill="none" stroke="#5E5E5E" stroke-width="1" stroke-linejoin="round" />
|
|
67
|
+
</marker>
|
|
68
|
+
</template>
|
|
69
|
+
</defs>
|
|
70
|
+
</template>
|
|
71
|
+
</template>
|
|
72
|
+
|
|
73
|
+
<script setup lang="ts">
|
|
74
|
+
import { computed } from 'vue';
|
|
75
|
+
import { DASHED_EDGE_SHAPES, EDGE_TYPE } from '../../constants/edgeShapeKeys';
|
|
76
|
+
|
|
77
|
+
interface Props {
|
|
78
|
+
shapeKey?: string;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const props = defineProps<Props>();
|
|
82
|
+
|
|
83
|
+
// 计算当前需要显示的标记类型
|
|
84
|
+
const shapeKey = computed(() => props.shapeKey || EDGE_TYPE.ASSOCIATION);
|
|
85
|
+
</script>
|
|
86
|
+
|
|
87
|
+
<style scoped></style>
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="output-pin-shape" :style="shapeStyle" @click="onClick">
|
|
3
|
+
<svg :width="vbW" :height="vbH" :viewBox="`0 0 ${vbW} ${vbH}`" class="output-pin-svg">
|
|
4
|
+
<!-- 定义渐变(放在defs中) -->
|
|
5
|
+
<defs>
|
|
6
|
+
<!-- 水平线性渐变(从左到右) -->
|
|
7
|
+
<linearGradient :id="`outputPinGradient-${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="0"
|
|
18
|
+
y="0"
|
|
19
|
+
:width="vbW"
|
|
20
|
+
:height="vbH"
|
|
21
|
+
:fill="isGhost ? 'transparent' : `url(#outputPinGradient-${shape.id})`"
|
|
22
|
+
:stroke="strokeColor"
|
|
23
|
+
:stroke-width="strokeWidth"
|
|
24
|
+
:rx="borderRadius"
|
|
25
|
+
/>
|
|
26
|
+
|
|
27
|
+
<g v-if="!isGhost">
|
|
28
|
+
<!-- 箭头:根据 shape.direction 旋转,细线风格 -->
|
|
29
|
+
<g :transform="arrowTransform" aria-hidden="true">
|
|
30
|
+
<path
|
|
31
|
+
:d="arrowPathD"
|
|
32
|
+
fill="none"
|
|
33
|
+
stroke="#4a4a4a"
|
|
34
|
+
stroke-width="0.8"
|
|
35
|
+
stroke-linejoin="round"
|
|
36
|
+
stroke-linecap="round"
|
|
37
|
+
vector-effect="non-scaling-stroke"
|
|
38
|
+
opacity="0.95"
|
|
39
|
+
/>
|
|
40
|
+
</g>
|
|
41
|
+
|
|
42
|
+
<!-- 名称:优先使用传入的 nameBounds;否则按 direction 自动定位到上/下/左/右 -->
|
|
43
|
+
<text
|
|
44
|
+
v-if="showName && shape.name"
|
|
45
|
+
:x="namePos.x"
|
|
46
|
+
:y="namePos.y"
|
|
47
|
+
:text-anchor="namePos.anchor"
|
|
48
|
+
:dominant-baseline="namePos.baseline"
|
|
49
|
+
:font-family="nameStyle.fontFamily || '思源黑体'"
|
|
50
|
+
:font-size="nameFontSize"
|
|
51
|
+
:font-weight="nameStyle.fontWeight || 'normal'"
|
|
52
|
+
:fill="nameStyle.color || '#000000'"
|
|
53
|
+
>
|
|
54
|
+
{{ shape.name }}
|
|
55
|
+
</text>
|
|
56
|
+
</g>
|
|
57
|
+
</svg>
|
|
58
|
+
</div>
|
|
59
|
+
</template>
|
|
60
|
+
|
|
61
|
+
<script setup lang="ts">
|
|
62
|
+
import { computed, type CSSProperties } from 'vue'
|
|
63
|
+
import type { Shape } from '../../types'
|
|
64
|
+
// 引入颜色处理工具函数
|
|
65
|
+
import { adjustColorLightness } from '../../utils/colorUtils'
|
|
66
|
+
|
|
67
|
+
// Props
|
|
68
|
+
interface Props {
|
|
69
|
+
shape: Shape
|
|
70
|
+
}
|
|
71
|
+
const emit = defineEmits<{
|
|
72
|
+
(e: 'shape-click', shape: Shape, event: MouseEvent): void
|
|
73
|
+
(e: 'keywords-click', shape: Shape, event: MouseEvent): void
|
|
74
|
+
(e: 'name-click', shape: Shape, event: MouseEvent): void
|
|
75
|
+
}>()
|
|
76
|
+
const props = defineProps<Props>()
|
|
77
|
+
|
|
78
|
+
// 交互层在拖拽/缩放时会给 shape.meta.isGhost = true
|
|
79
|
+
const isGhost = computed(() => (props.shape as any).meta?.isGhost)
|
|
80
|
+
|
|
81
|
+
// 轮廓颜色(边框颜色)
|
|
82
|
+
const strokeColor = computed(() =>
|
|
83
|
+
props.shape.style?.borderColor ?? '#8a6d3b'
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
// 轮廓线宽
|
|
87
|
+
const strokeWidth = computed(() =>
|
|
88
|
+
isGhost.value ? 4 : (props.shape.style?.borderWidth ?? 0.5)
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
// 圆角半径
|
|
93
|
+
const borderRadius = computed(() =>
|
|
94
|
+
props.shape.style?.borderRadius ?? 2
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
// 基础颜色(带默认值,使用浅色)
|
|
98
|
+
const baseColor = computed(() =>
|
|
99
|
+
props.shape.keywordsStyle?.backgroundColor || props.shape.style?.backgroundColor || '#E8F5E9'
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
// 左侧渐变颜色-初始值
|
|
103
|
+
const gradientLeftColor = computed(() => {
|
|
104
|
+
return baseColor.value
|
|
105
|
+
})
|
|
106
|
+
|
|
107
|
+
// 中间过渡颜色(浅)
|
|
108
|
+
const gradientMiddleColor = computed(() => {
|
|
109
|
+
return adjustColorLightness(baseColor.value, 15)
|
|
110
|
+
})
|
|
111
|
+
|
|
112
|
+
// 右侧渐变颜色(较浅)
|
|
113
|
+
const gradientRightColor = computed(() => {
|
|
114
|
+
// 提高明度,使颜色更浅
|
|
115
|
+
return adjustColorLightness(baseColor.value, 25)
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
// 获取 nameBounds 和 nameStyle
|
|
119
|
+
const nameBoundsProp = computed(() => props.shape.nameBounds || undefined)
|
|
120
|
+
const nameStyle = computed(() => props.shape.nameStyle || {})
|
|
121
|
+
const showName = computed(() => props.shape.showName !== false)
|
|
122
|
+
|
|
123
|
+
// 根据 shape 的 bounds 生成样式
|
|
124
|
+
const shapeStyle = computed<CSSProperties>(() => {
|
|
125
|
+
const { bounds, style } = props.shape
|
|
126
|
+
return {
|
|
127
|
+
width: `${bounds.width || 100}px`,
|
|
128
|
+
height: `${bounds.height || 40}px`,
|
|
129
|
+
zIndex: (style?.zIndex as number) ?? 0,
|
|
130
|
+
}
|
|
131
|
+
})
|
|
132
|
+
|
|
133
|
+
const onClick = (e: MouseEvent) => {
|
|
134
|
+
emit('shape-click', props.shape, e)
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
const vbW = computed(() => props.shape.bounds.width || 100)
|
|
138
|
+
const vbH = computed(() => props.shape.bounds.height || 40)
|
|
139
|
+
|
|
140
|
+
// 名称字号
|
|
141
|
+
const nameFontSize = computed(() => {
|
|
142
|
+
const nb: any = nameBoundsProp.value || {}
|
|
143
|
+
return nameStyle.value.fontSize || nb.height || 10
|
|
144
|
+
})
|
|
145
|
+
|
|
146
|
+
// 名称位置:优先 nameBounds,否则按 direction 自动计算
|
|
147
|
+
const namePos = computed(() => {
|
|
148
|
+
const nb: any = nameBoundsProp.value
|
|
149
|
+
if (nb && (nb.x != null) && (nb.y != null)) {
|
|
150
|
+
return {
|
|
151
|
+
x: nb.x,
|
|
152
|
+
y: nb.y,
|
|
153
|
+
anchor: (nameStyle.value.textAnchor as any) || 'middle',
|
|
154
|
+
baseline: (nameStyle.value.dominantBaseline as any) || 'auto',
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
const pad = 4
|
|
158
|
+
const dir = (props.shape.direction as any) || 'right'
|
|
159
|
+
const W = vbW.value
|
|
160
|
+
const H = vbH.value
|
|
161
|
+
const fs = Number(nameFontSize.value) || 10
|
|
162
|
+
// 默认:水平文字,不旋转
|
|
163
|
+
if (dir === 'up') {
|
|
164
|
+
return { x: W / 2, y: pad + fs, anchor: 'middle', baseline: 'alphabetic' }
|
|
165
|
+
}
|
|
166
|
+
if (dir === 'down') {
|
|
167
|
+
return { x: W / 2, y: H - pad, anchor: 'middle', baseline: 'alphabetic' }
|
|
168
|
+
}
|
|
169
|
+
if (dir === 'left') {
|
|
170
|
+
return { x: pad, y: H / 2, anchor: 'start', baseline: 'middle' }
|
|
171
|
+
}
|
|
172
|
+
// right
|
|
173
|
+
return { x: W - pad, y: H / 2, anchor: 'end', baseline: 'middle' }
|
|
174
|
+
})
|
|
175
|
+
|
|
176
|
+
// 细线箭头路径(默认朝上):竖直主干 + 两条箭头边
|
|
177
|
+
const arrowPathD = computed(() => {
|
|
178
|
+
const W = vbW.value
|
|
179
|
+
const H = vbH.value
|
|
180
|
+
const cx = W / 2
|
|
181
|
+
const topY = H * 0.18
|
|
182
|
+
const bottomY = H * 0.82
|
|
183
|
+
const headH = Math.max(4, H * 0.14)
|
|
184
|
+
const headW = Math.max(6, W * 0.28)
|
|
185
|
+
|
|
186
|
+
const leftHeadX = cx - headW / 2
|
|
187
|
+
const rightHeadX = cx + headW / 2
|
|
188
|
+
|
|
189
|
+
// M 主干底 -> 主干顶; 顶点分叉到左右
|
|
190
|
+
return `M ${cx},${bottomY} L ${cx},${topY} M ${cx},${topY} L ${leftHeadX},${topY + headH} M ${cx},${topY} L ${rightHeadX},${topY + headH}`
|
|
191
|
+
})
|
|
192
|
+
|
|
193
|
+
// 旋转以匹配 direction: up/right/down/left(默认 right)
|
|
194
|
+
const arrowTransform = computed(() => {
|
|
195
|
+
const dir = (props.shape.direction as any) || 'right'
|
|
196
|
+
const W = vbW.value
|
|
197
|
+
const H = vbH.value
|
|
198
|
+
const cx = W / 2
|
|
199
|
+
const cy = H / 2
|
|
200
|
+
const angleMap: Record<string, number> = { up: 0, right: 90, down: 180, left: -90 }
|
|
201
|
+
const angle = angleMap[dir] ?? 0
|
|
202
|
+
return `rotate(${angle} ${cx} ${cy})`
|
|
203
|
+
})
|
|
204
|
+
</script>
|
|
205
|
+
|
|
206
|
+
<style scoped>
|
|
207
|
+
.output-pin-shape {
|
|
208
|
+
display: flex;
|
|
209
|
+
align-items: center;
|
|
210
|
+
justify-content: center;
|
|
211
|
+
/* 允许名称绘制到 Pin 外部 */
|
|
212
|
+
overflow: visible;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.output-pin-svg {
|
|
216
|
+
display: block;
|
|
217
|
+
overflow: visible; /* 允许 svg 内容溢出显示(用于上下左右外侧的名称) */
|
|
218
|
+
}
|
|
219
|
+
</style>
|
|
220
|
+
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="port-shape" :style="shapeStyle" @click="onClick">
|
|
3
|
+
<svg :width="vbW" :height="vbH" :viewBox="`0 0 ${vbW} ${vbH}`" class="port-svg">
|
|
4
|
+
<!-- 定义渐变(放在defs中) -->
|
|
5
|
+
<defs>
|
|
6
|
+
<!-- 水平线性渐变(从左到右) -->
|
|
7
|
+
<linearGradient :id="`portGradient-${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="0"
|
|
18
|
+
y="0"
|
|
19
|
+
:width="vbW"
|
|
20
|
+
:height="vbH"
|
|
21
|
+
:fill="isGhost ? 'transparent' : `url(#portGradient-${shape.id})`"
|
|
22
|
+
:stroke="strokeColor"
|
|
23
|
+
:stroke-width="strokeWidth"
|
|
24
|
+
:rx="borderRadius"
|
|
25
|
+
/>
|
|
26
|
+
|
|
27
|
+
<g v-if="!isGhost">
|
|
28
|
+
<!-- 名称:优先使用传入的 nameBounds;否则按 direction 自动定位到上/下/左/右 -->
|
|
29
|
+
<text
|
|
30
|
+
v-if="showName && shape.name"
|
|
31
|
+
:x="namePos.x"
|
|
32
|
+
:y="namePos.y"
|
|
33
|
+
:text-anchor="namePos.anchor"
|
|
34
|
+
:dominant-baseline="namePos.baseline"
|
|
35
|
+
:font-family="nameStyle.fontFamily || '思源黑体'"
|
|
36
|
+
:font-size="nameFontSize"
|
|
37
|
+
:font-weight="nameStyle.fontWeight || 'normal'"
|
|
38
|
+
:fill="nameStyle.color || '#000000'"
|
|
39
|
+
>
|
|
40
|
+
{{ shape.name }}
|
|
41
|
+
</text>
|
|
42
|
+
</g>
|
|
43
|
+
</svg>
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
46
|
+
|
|
47
|
+
<script setup lang="ts">
|
|
48
|
+
import { computed, type CSSProperties } from 'vue'
|
|
49
|
+
import type { Shape } from '../../types'
|
|
50
|
+
// 引入颜色处理工具函数
|
|
51
|
+
import { adjustColorLightness } from '../../utils/colorUtils'
|
|
52
|
+
|
|
53
|
+
// Props
|
|
54
|
+
interface Props {
|
|
55
|
+
shape: Shape
|
|
56
|
+
}
|
|
57
|
+
const emit = defineEmits<{
|
|
58
|
+
(e: 'shape-click', shape: Shape, event: MouseEvent): void
|
|
59
|
+
(e: 'name-click', shape: Shape, event: MouseEvent): void
|
|
60
|
+
}>()
|
|
61
|
+
const props = defineProps<Props>()
|
|
62
|
+
|
|
63
|
+
// 交互层在拖拽/缩放时会给 shape.meta.isGhost = true
|
|
64
|
+
const isGhost = computed(() => (props.shape as any).meta?.isGhost)
|
|
65
|
+
|
|
66
|
+
// 轮廓颜色(边框颜色)- 默认黑色
|
|
67
|
+
const strokeColor = computed(() =>
|
|
68
|
+
props.shape.style?.borderColor ?? '#000000'
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
// 轮廓线宽
|
|
72
|
+
const strokeWidth = computed(() =>
|
|
73
|
+
isGhost.value ? 4 : (props.shape.style?.borderWidth ?? 1)
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
// 圆角半径
|
|
77
|
+
const borderRadius = computed(() =>
|
|
78
|
+
props.shape.style?.borderRadius ?? 0
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
// 是否为 OperationalPort
|
|
82
|
+
const isOperationalPort = computed(() => props.shape.shapeKey === 'OperationalPort')
|
|
83
|
+
|
|
84
|
+
// 基础颜色(可被样式覆盖;OperationalPort 默认淡紫色)
|
|
85
|
+
const baseColor = computed(() => {
|
|
86
|
+
const explicit = props.shape.keywordsStyle?.backgroundColor || props.shape.style?.backgroundColor
|
|
87
|
+
if (explicit) return explicit
|
|
88
|
+
return isOperationalPort.value ? '#D9D2FF' : '#FFFFFF' // OperationalPort 用淡紫色
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
// 左侧渐变颜色-初始值
|
|
92
|
+
const gradientLeftColor = computed(() => baseColor.value)
|
|
93
|
+
|
|
94
|
+
// 中间过渡颜色(更柔和的渐变)
|
|
95
|
+
const gradientMiddleColor = computed(() => adjustColorLightness(baseColor.value, 8))
|
|
96
|
+
|
|
97
|
+
// 右侧渐变颜色(较浅)
|
|
98
|
+
const gradientRightColor = computed(() => adjustColorLightness(baseColor.value, 14))
|
|
99
|
+
|
|
100
|
+
// 获取 nameBounds 和 nameStyle
|
|
101
|
+
const nameBoundsProp = computed(() => props.shape.nameBounds || undefined)
|
|
102
|
+
const nameStyle = computed(() => props.shape.nameStyle || {})
|
|
103
|
+
const showName = computed(() => props.shape.showName !== false)
|
|
104
|
+
|
|
105
|
+
// 根据 shape 的 bounds 生成样式
|
|
106
|
+
const shapeStyle = computed<CSSProperties>(() => {
|
|
107
|
+
const { bounds, style } = props.shape
|
|
108
|
+
return {
|
|
109
|
+
width: `${bounds?.width || 20}px`,
|
|
110
|
+
height: `${bounds?.height || 20}px`,
|
|
111
|
+
zIndex: (style?.zIndex as number) ?? 0,
|
|
112
|
+
}
|
|
113
|
+
})
|
|
114
|
+
|
|
115
|
+
const onClick = (e: MouseEvent) => {
|
|
116
|
+
emit('shape-click', props.shape, e)
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const vbW = computed(() => props.shape.bounds?.width || 20)
|
|
120
|
+
const vbH = computed(() => props.shape.bounds?.height || 20)
|
|
121
|
+
|
|
122
|
+
// 名称字号
|
|
123
|
+
const nameFontSize = computed(() => {
|
|
124
|
+
const nb: any = nameBoundsProp.value || {}
|
|
125
|
+
return nameStyle.value.fontSize || nb.height || 10
|
|
126
|
+
})
|
|
127
|
+
|
|
128
|
+
// 名称位置:优先 nameBounds,否则按 direction 自动计算
|
|
129
|
+
const namePos = computed(() => {
|
|
130
|
+
const nb: any = nameBoundsProp.value
|
|
131
|
+
if (nb && (nb.x != null) && (nb.y != null)) {
|
|
132
|
+
return {
|
|
133
|
+
x: nb.x,
|
|
134
|
+
y: nb.y,
|
|
135
|
+
anchor: (nameStyle.value.textAnchor as any) || 'middle',
|
|
136
|
+
baseline: (nameStyle.value.dominantBaseline as any) || 'auto',
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
const pad = 4
|
|
140
|
+
const dir = (props.shape.direction as any) || 'right'
|
|
141
|
+
const W = vbW.value
|
|
142
|
+
const H = vbH.value
|
|
143
|
+
const fs = Number(nameFontSize.value) || 10
|
|
144
|
+
// 默认:水平文字,不旋转
|
|
145
|
+
if (dir === 'up') {
|
|
146
|
+
return { x: W / 2, y: -pad, anchor: 'middle', baseline: 'alphabetic' } // 向上偏移
|
|
147
|
+
}
|
|
148
|
+
if (dir === 'down') {
|
|
149
|
+
return { x: W / 2, y: H + fs + pad, anchor: 'middle', baseline: 'alphabetic' } // 向下偏移
|
|
150
|
+
}
|
|
151
|
+
if (dir === 'left') {
|
|
152
|
+
return { x: -pad, y: H / 2, anchor: 'end', baseline: 'middle' } // 向左偏移
|
|
153
|
+
}
|
|
154
|
+
// right
|
|
155
|
+
return { x: W + pad, y: H / 2, anchor: 'start', baseline: 'middle' } // 向右偏移
|
|
156
|
+
})
|
|
157
|
+
</script>
|
|
158
|
+
|
|
159
|
+
<style scoped>
|
|
160
|
+
.port-shape {
|
|
161
|
+
display: flex;
|
|
162
|
+
align-items: center;
|
|
163
|
+
justify-content: center;
|
|
164
|
+
/* 允许名称绘制到 Port 外部 */
|
|
165
|
+
overflow: visible;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.port-svg {
|
|
169
|
+
display: block;
|
|
170
|
+
overflow: visible; /* 允许 svg 内容溢出显示(用于上下左右外侧的名称) */
|
|
171
|
+
}
|
|
172
|
+
</style>
|