@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,366 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="edge-component" :style="{
|
|
3
|
+
pointerEvents: 'all',
|
|
4
|
+
cursor: 'pointer'
|
|
5
|
+
}" @click.stop="handleClick($event)">
|
|
6
|
+
<svg class="edge-svg" :viewBox="svgViewBox" :width="containerWidth" :height="containerHeight">
|
|
7
|
+
<!-- 引入线条样式标记组件 -->
|
|
8
|
+
<LineStyleMarker :shape-key="shapeKey" />
|
|
9
|
+
|
|
10
|
+
<polyline :points="linePoints" :stroke="edgeColor" :stroke-width="strokeWidth" :stroke-dasharray="strokeDashArray"
|
|
11
|
+
fill="none" @click.stop="handleClick($event)" :marker-start="getMarkerStart()" :marker-end="getMarkerEnd()" />
|
|
12
|
+
|
|
13
|
+
<!-- 选中状态显示端点黑色圆圈 -->
|
|
14
|
+
<g v-if="props.isSelected">
|
|
15
|
+
<!-- 起点圆圈 -->
|
|
16
|
+
<circle v-if="waypoints.length > 0"
|
|
17
|
+
:cx="waypoints[0].x - bounds.minX + padding"
|
|
18
|
+
:cy="waypoints[0].y - bounds.minY + padding"
|
|
19
|
+
r="4"
|
|
20
|
+
fill="#000000"
|
|
21
|
+
stroke="#FFFFFF"
|
|
22
|
+
stroke-width="1" />
|
|
23
|
+
|
|
24
|
+
<!-- 终点圆圈 -->
|
|
25
|
+
<circle v-if="waypoints.length > 1"
|
|
26
|
+
:cx="waypoints[waypoints.length - 1].x - bounds.minX + padding"
|
|
27
|
+
:cy="waypoints[waypoints.length - 1].y - bounds.minY + padding"
|
|
28
|
+
r="4"
|
|
29
|
+
fill="#000000"
|
|
30
|
+
stroke="#FFFFFF"
|
|
31
|
+
stroke-width="1" />
|
|
32
|
+
</g>
|
|
33
|
+
|
|
34
|
+
<!-- 线条上方显示描述 -->
|
|
35
|
+
<!-- 当lineName有值且符合特定shapeKey时,显示keywords和lineName -->
|
|
36
|
+
<text v-if="lineName && lineName !== '' && EDGES_WITH_KEYWORDS.includes(shapeKey)"
|
|
37
|
+
:x="textPosition.x" :y="textPosition.y"
|
|
38
|
+
text-anchor="middle" dominant-baseline="middle"
|
|
39
|
+
font-family="思源黑体" font-size="12" fill="#5E5E5E" style="pointer-events: none;">
|
|
40
|
+
{{ keywords }}{{ lineName }}
|
|
41
|
+
</text>
|
|
42
|
+
<!-- 当lineName有值但不符合特定shapeKey时,单独显示lineName -->
|
|
43
|
+
<text v-else-if="lineName && lineName !== ''"
|
|
44
|
+
:x="textPosition.x" :y="textPosition.y"
|
|
45
|
+
text-anchor="middle" dominant-baseline="middle"
|
|
46
|
+
font-family="思源黑体" font-size="12" fill="#5E5E5E" style="pointer-events: none;">
|
|
47
|
+
{{ lineName }}
|
|
48
|
+
</text>
|
|
49
|
+
<!-- 当lineName无值但符合特定shapeKey时,单独显示keywords -->
|
|
50
|
+
<text v-else-if="EDGES_WITH_KEYWORDS.includes(shapeKey)"
|
|
51
|
+
:x="textPosition.x" :y="textPosition.y"
|
|
52
|
+
text-anchor="middle" dominant-baseline="middle"
|
|
53
|
+
font-family="思源黑体" font-size="12" fill="#5E5E5E" style="pointer-events: none;">
|
|
54
|
+
{{ keywords }}
|
|
55
|
+
</text>
|
|
56
|
+
</svg>
|
|
57
|
+
</div>
|
|
58
|
+
</template>
|
|
59
|
+
|
|
60
|
+
<script setup lang="ts">
|
|
61
|
+
import { computed } from 'vue'
|
|
62
|
+
import type { Shape, Waypoint } from '../../types'
|
|
63
|
+
import LineStyleMarker from '../LineStyle/LineStyleMarker.vue'
|
|
64
|
+
import { DASHED_EDGE_SHAPES, EDGES_WITH_KEYWORDS, EDGES_WITH_ARROWHEADS, DIAMOND_MARKER_SHAPES, SPECIAL_END_POINT_SHAPES, EDGE_TYPE } from '../../constants/edgeShapeKeys'
|
|
65
|
+
|
|
66
|
+
// Props
|
|
67
|
+
interface Props {
|
|
68
|
+
shape: Shape
|
|
69
|
+
isSelected?: boolean
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
73
|
+
isSelected: false
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
// Events
|
|
77
|
+
const emit = defineEmits<{
|
|
78
|
+
'edge-click': [shape: Shape, event: MouseEvent]
|
|
79
|
+
}>()
|
|
80
|
+
|
|
81
|
+
// 解析waypoints
|
|
82
|
+
const waypoints = computed(() => {
|
|
83
|
+
if (!props.shape.waypointId) return []
|
|
84
|
+
|
|
85
|
+
if (typeof props.shape.waypointId === 'string') {
|
|
86
|
+
try {
|
|
87
|
+
return JSON.parse(props.shape.waypointId) as Waypoint[]
|
|
88
|
+
} catch (error) {
|
|
89
|
+
console.error('解析waypointId失败:', error)
|
|
90
|
+
return []
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (Array.isArray(props.shape.waypointId)) {
|
|
95
|
+
return props.shape.waypointId as Waypoint[]
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return []
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
// 计算边界框
|
|
102
|
+
const bounds = computed(() => {
|
|
103
|
+
if (waypoints.value.length === 0) {
|
|
104
|
+
return { minX: 0, minY: 0, maxX: 100, maxY: 100 }
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const xs = waypoints.value.map(wp => wp.x)
|
|
108
|
+
const ys = waypoints.value.map(wp => wp.y)
|
|
109
|
+
|
|
110
|
+
return {
|
|
111
|
+
minX: Math.min(...xs),
|
|
112
|
+
maxX: Math.max(...xs),
|
|
113
|
+
minY: Math.min(...ys),
|
|
114
|
+
maxY: Math.max(...ys)
|
|
115
|
+
}
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
// 计算SVG相关属性
|
|
119
|
+
const padding = 10
|
|
120
|
+
const containerWidth = computed(() => {
|
|
121
|
+
const width = bounds.value.maxX - bounds.value.minX + padding * 2
|
|
122
|
+
// 如果宽度太小,设置最小宽度
|
|
123
|
+
return Math.max(width, 20)
|
|
124
|
+
})
|
|
125
|
+
const containerHeight = computed(() => bounds.value.maxY - bounds.value.minY + padding * 2)
|
|
126
|
+
const svgViewBox = computed(() =>
|
|
127
|
+
`0 0 ${containerWidth.value} ${containerHeight.value}`
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
// 计算polyline点(相对坐标)
|
|
131
|
+
const linePoints = computed(() => {
|
|
132
|
+
if (waypoints.value.length === 0) return '0,0 100,100'
|
|
133
|
+
|
|
134
|
+
// 创建新数组以避免修改原始数据
|
|
135
|
+
const adjustedWaypoints = [...waypoints.value];
|
|
136
|
+
|
|
137
|
+
// 调整起点位置避免线条穿过菱形
|
|
138
|
+
if (DIAMOND_MARKER_SHAPES.includes(shapeKey.value) && adjustedWaypoints.length >= 2) {
|
|
139
|
+
const startPoint = adjustedWaypoints[0];
|
|
140
|
+
const nextPoint = adjustedWaypoints[1];
|
|
141
|
+
|
|
142
|
+
// 计算方向向量
|
|
143
|
+
const dx = nextPoint.x - startPoint.x;
|
|
144
|
+
const dy = nextPoint.y - startPoint.y;
|
|
145
|
+
const length = Math.sqrt(dx * dx + dy * dy);
|
|
146
|
+
|
|
147
|
+
if (length > 0) {
|
|
148
|
+
// 计算缩短距离,基于菱形的实际高度(6)和宽度(12)
|
|
149
|
+
// 使用6*2作为缩短距离,确保菱形紧贴元素边缘
|
|
150
|
+
const shortenDistance = 18;
|
|
151
|
+
const ratio = shortenDistance / length;
|
|
152
|
+
|
|
153
|
+
// 调整起点位置
|
|
154
|
+
adjustedWaypoints[0] = {
|
|
155
|
+
...startPoint,
|
|
156
|
+
x: startPoint.x + dx * ratio,
|
|
157
|
+
y: startPoint.y + dy * ratio
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// 需要特殊终点处理的边类型,避免线条穿过箭头
|
|
163
|
+
if (SPECIAL_END_POINT_SHAPES.includes(shapeKey.value) && adjustedWaypoints.length >= 2) {
|
|
164
|
+
const endPoint = adjustedWaypoints[adjustedWaypoints.length - 1];
|
|
165
|
+
const prevPoint = adjustedWaypoints[adjustedWaypoints.length - 2];
|
|
166
|
+
|
|
167
|
+
// 计算方向向量(从终点指向倒数第二点,即反向向量)
|
|
168
|
+
const dx = prevPoint.x - endPoint.x;
|
|
169
|
+
const dy = prevPoint.y - endPoint.y;
|
|
170
|
+
const length = Math.sqrt(dx * dx + dy * dy);
|
|
171
|
+
|
|
172
|
+
if (length > 0) {
|
|
173
|
+
// 计算缩短距离
|
|
174
|
+
const shortenDistance = 14;
|
|
175
|
+
const ratio = shortenDistance / length;
|
|
176
|
+
|
|
177
|
+
// 调整终点位置,向相反方向移动
|
|
178
|
+
adjustedWaypoints[adjustedWaypoints.length - 1] = {
|
|
179
|
+
...endPoint,
|
|
180
|
+
x: endPoint.x + dx * ratio,
|
|
181
|
+
y: endPoint.y + dy * ratio
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
return adjustedWaypoints
|
|
187
|
+
.map(wp => `${wp.x - bounds.value.minX + padding},${wp.y - bounds.value.minY + padding}`)
|
|
188
|
+
.join(' ')
|
|
189
|
+
})
|
|
190
|
+
|
|
191
|
+
// 获取shapeKey
|
|
192
|
+
const shapeKey = computed(() => props.shape.shapeKey || '')
|
|
193
|
+
// 获取名称
|
|
194
|
+
const keywords = computed(() => props.shape.keywords || '')
|
|
195
|
+
|
|
196
|
+
//获取线的名称
|
|
197
|
+
const lineName = computed(()=>props.shape.modelName || '')
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
// 样式相关
|
|
201
|
+
const edgeColor = computed(() => {
|
|
202
|
+
// 选中状态保持黑色
|
|
203
|
+
if (props.isSelected) {
|
|
204
|
+
return '#000000'
|
|
205
|
+
}
|
|
206
|
+
// 可以根据不同的形状类型返回不同的颜色
|
|
207
|
+
return '#5E5E5E'
|
|
208
|
+
})
|
|
209
|
+
const strokeWidth = computed(() => {
|
|
210
|
+
// 选中状态线条加粗
|
|
211
|
+
if (props.isSelected) {
|
|
212
|
+
return 2
|
|
213
|
+
}
|
|
214
|
+
return props.shape.style?.borderWidth || 1.5
|
|
215
|
+
})
|
|
216
|
+
const strokeDashArray = computed(() => {
|
|
217
|
+
if (DASHED_EDGE_SHAPES.includes(shapeKey.value)) {
|
|
218
|
+
return '12,11'; // 虚线样式
|
|
219
|
+
}
|
|
220
|
+
})
|
|
221
|
+
|
|
222
|
+
// 计算文本位置
|
|
223
|
+
const textPosition = computed(() => {
|
|
224
|
+
if (!waypoints.value || waypoints.value.length === 0) {
|
|
225
|
+
// 当没有路径点时,返回一个默认位置
|
|
226
|
+
return { x: 120, y: 40 };
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
if (waypoints.value.length === 1) {
|
|
230
|
+
// 当只有一个路径点时,使用默认的向上偏移
|
|
231
|
+
return {
|
|
232
|
+
x: waypoints.value[0].x - bounds.value.minX + padding,
|
|
233
|
+
y: waypoints.value[0].y - bounds.value.minY + padding - 10
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// 计算线条中点和方向
|
|
238
|
+
let midPoint, normalVector;
|
|
239
|
+
|
|
240
|
+
if (waypoints.value.length > 2) {
|
|
241
|
+
// 对于多段线,找到中间线段
|
|
242
|
+
const segmentIndex = Math.floor((waypoints.value.length - 1) / 2);
|
|
243
|
+
const p1 = waypoints.value[segmentIndex];
|
|
244
|
+
const p2 = waypoints.value[segmentIndex + 1];
|
|
245
|
+
|
|
246
|
+
// 计算中间线段的中点
|
|
247
|
+
midPoint = {
|
|
248
|
+
x: (p1.x + p2.x) / 2,
|
|
249
|
+
y: (p1.y + p2.y) / 2
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
// 计算线段的方向向量
|
|
253
|
+
const dx = p2.x - p1.x;
|
|
254
|
+
const dy = p2.y - p1.y;
|
|
255
|
+
|
|
256
|
+
// 计算线段长度
|
|
257
|
+
const length = Math.sqrt(dx * dx + dy * dy);
|
|
258
|
+
|
|
259
|
+
// 计算单位法线向量(向左旋转90度)
|
|
260
|
+
if (length > 0) {
|
|
261
|
+
normalVector = {
|
|
262
|
+
x: -dy / length,
|
|
263
|
+
y: dx / length
|
|
264
|
+
};
|
|
265
|
+
} else {
|
|
266
|
+
// 避免除以零,使用默认向上的向量
|
|
267
|
+
normalVector = { x: 0, y: -1 };
|
|
268
|
+
}
|
|
269
|
+
} else {
|
|
270
|
+
// 对于两段线,使用两个端点
|
|
271
|
+
const p1 = waypoints.value[0];
|
|
272
|
+
const p2 = waypoints.value[1];
|
|
273
|
+
|
|
274
|
+
// 计算中点
|
|
275
|
+
midPoint = {
|
|
276
|
+
x: (p1.x + p2.x) / 2,
|
|
277
|
+
y: (p1.y + p2.y) / 2
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
// 计算方向向量
|
|
281
|
+
const dx = p2.x - p1.x;
|
|
282
|
+
const dy = p2.y - p1.y;
|
|
283
|
+
|
|
284
|
+
// 计算长度
|
|
285
|
+
const length = Math.sqrt(dx * dx + dy * dy);
|
|
286
|
+
|
|
287
|
+
// 计算单位法线向量
|
|
288
|
+
if (length > 0) {
|
|
289
|
+
normalVector = {
|
|
290
|
+
x: -dy / length,
|
|
291
|
+
y: dx / length
|
|
292
|
+
};
|
|
293
|
+
} else {
|
|
294
|
+
normalVector = { x: 0, y: -1 };
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// 计算文本位置:中点加上法线方向的偏移(在线条正上方10px)
|
|
299
|
+
const offsetDistance = 10;
|
|
300
|
+
const adjustedX = midPoint.x + normalVector.x * offsetDistance;
|
|
301
|
+
const adjustedY = midPoint.y + normalVector.y * offsetDistance;
|
|
302
|
+
|
|
303
|
+
// 转换为相对坐标
|
|
304
|
+
return {
|
|
305
|
+
x: adjustedX - bounds.value.minX + padding,
|
|
306
|
+
y: adjustedY - bounds.value.minY + padding
|
|
307
|
+
};
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
// 获取起点标记
|
|
311
|
+
const getMarkerStart = () => {
|
|
312
|
+
// 菱形标记
|
|
313
|
+
if (DIAMOND_MARKER_SHAPES.includes(shapeKey.value)) {
|
|
314
|
+
return `url(#diamond-${shapeKey.value})`;
|
|
315
|
+
}
|
|
316
|
+
return ''
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
// 获取终点标记
|
|
320
|
+
const getMarkerEnd = () => {
|
|
321
|
+
// 空心箭头
|
|
322
|
+
if (EDGES_WITH_ARROWHEADS.includes(shapeKey.value)) {
|
|
323
|
+
return `url(#arrowhead-${shapeKey.value})`;
|
|
324
|
+
}
|
|
325
|
+
// 终点有空心三角形箭头(泛化关系)
|
|
326
|
+
else if (SPECIAL_END_POINT_SHAPES.includes(shapeKey.value)) {
|
|
327
|
+
return `url(#diamond-${shapeKey.value})`;
|
|
328
|
+
}
|
|
329
|
+
return ''
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
// 事件处理
|
|
333
|
+
const handleClick = (event: MouseEvent) => {
|
|
334
|
+
console.log('Edge组件内部捕获到点击事件:', props.shape.id, props.shape.shapeType);
|
|
335
|
+
// 确保shapeType为edge
|
|
336
|
+
const shapeWithCorrectType = {
|
|
337
|
+
...props.shape,
|
|
338
|
+
shapeType: 'edge' as const
|
|
339
|
+
};
|
|
340
|
+
emit('edge-click', shapeWithCorrectType, event)
|
|
341
|
+
}
|
|
342
|
+
</script>
|
|
343
|
+
|
|
344
|
+
<style scoped>
|
|
345
|
+
.edge-component {
|
|
346
|
+
position: absolute;
|
|
347
|
+
pointer-events: all;
|
|
348
|
+
cursor: pointer;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
.edge-svg {
|
|
352
|
+
width: 100%;
|
|
353
|
+
height: 100%;
|
|
354
|
+
overflow: visible;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
.edge-svg polyline {
|
|
358
|
+
pointer-events: all;
|
|
359
|
+
stroke-linecap: round;
|
|
360
|
+
stroke-linejoin: round;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
.edge-svg circle {
|
|
364
|
+
pointer-events: none;
|
|
365
|
+
}
|
|
366
|
+
</style>>
|