@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,39 @@
|
|
|
1
|
+
// utils/zorder.ts
|
|
2
|
+
import type { Shape } from '../types'
|
|
3
|
+
// 统一规范某个 diagram 内所有图元的 zIndex(绘制层级)。
|
|
4
|
+
export function normalizeZOrder(
|
|
5
|
+
shapes: Shape[],
|
|
6
|
+
diagramId: string | null,
|
|
7
|
+
updateShape: (id: string, patch: Partial<Shape>) => void,
|
|
8
|
+
baseZ = 1,
|
|
9
|
+
step = 1
|
|
10
|
+
) {
|
|
11
|
+
const nodes = shapes.filter(s => (s.diagramId ?? null) === (diagramId ?? s.diagramId))
|
|
12
|
+
const byId = new Map(nodes.map(n => [n.id, n]))
|
|
13
|
+
|
|
14
|
+
const isDiagram = (s?: Shape) => s?.shapeType?.toLowerCase?.() === 'diagram'
|
|
15
|
+
const getZ = (s?: Shape) => Number((s?.style as any)?.zIndex ?? 0)
|
|
16
|
+
|
|
17
|
+
const depthCache = new Map<string, number>()
|
|
18
|
+
const depthOf = (n: Shape): number => {
|
|
19
|
+
if (depthCache.has(n.id)) return depthCache.get(n.id)!
|
|
20
|
+
let d = 1
|
|
21
|
+
let cur: Shape | undefined = n
|
|
22
|
+
while (cur?.parenShapeId) {
|
|
23
|
+
const p = byId.get(cur.parenShapeId)
|
|
24
|
+
if (!p) break
|
|
25
|
+
if (isDiagram(p)) break
|
|
26
|
+
d += 1
|
|
27
|
+
cur = p
|
|
28
|
+
}
|
|
29
|
+
depthCache.set(n.id, d)
|
|
30
|
+
return d
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
for (const n of nodes) {
|
|
34
|
+
const wantZ = baseZ + depthOf(n) * step
|
|
35
|
+
if (getZ(n) !== wantZ) {
|
|
36
|
+
updateShape(n.id, { style: { ...(n.style ?? {}), zIndex: wantZ } as any })
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="graph-view">
|
|
3
|
+
<!-- 画布内容区域 -->
|
|
4
|
+
<div class="diagram-content" ref="diagramContentRef" @wheel="handleWheel">
|
|
5
|
+
<div class="shapes-container" v-if="shapes.length > 0">
|
|
6
|
+
<component v-for="shape in shapes" :key="shape.id" :is="getShapeComponent(shape)" :shape="shape"
|
|
7
|
+
:style="getShapeStyle(shape)" @name-click="handleNameClick" @shape-click="handleShapeClick"
|
|
8
|
+
@edge-click="handleEdgeClick"
|
|
9
|
+
:is-selected="graphStore.selectedShape?.id === shape.id && shape.shapeType === 'edge'" ref="shapeComponents"
|
|
10
|
+
class="shape-element" :data-shape-id="shape.id"
|
|
11
|
+
@compartment-metrics="(m: any, shape: any) => onCompartmentMetrics(m, shape)" />
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<!-- 交互层 - 整合了连接层逻辑 -->
|
|
15
|
+
<InteractionLayer v-if="diagramBounds" ref="interactionLayerRef" :connect-shape-data="connectShapeData"
|
|
16
|
+
:diagram-bounds="diagramBounds" :style="{
|
|
17
|
+
width: `${(diagramBounds?.width ?? 0) - 10}px`,
|
|
18
|
+
height: `${(diagramBounds?.height ?? 0) - 10}px`,
|
|
19
|
+
left: `${diagramBounds.x}px`,
|
|
20
|
+
top: `${diagramBounds.y}px`
|
|
21
|
+
}" :resShape="resShape" :edgeCheck="edgeCheck" @property-panel="handlePropertyPanel"
|
|
22
|
+
:actionButtonShapeDataId="actionButtonShapeId" @edit-name="handleEditName"
|
|
23
|
+
@update-shape="handleUpdateConnectShape" @diagramDoubleClick="handleDiagramDoubleClick"
|
|
24
|
+
@connect-end="handleConnectEnd" @action-button-click="handleActionButtonClick"
|
|
25
|
+
@model-type-property-id-button-click="handleModelTypePropertyIdButtonClick" :lines="props.lines"
|
|
26
|
+
:packages="props.packages" :diagram="props.diagram" :tagged-value-labels="props.taggedValueLabels"
|
|
27
|
+
@action-button-add="handleActionButtonAdd" />
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script setup lang="ts">
|
|
33
|
+
import { ref, onMounted, computed, watch, nextTick, onUnmounted } from 'vue'
|
|
34
|
+
import normalizeWheel from 'normalize-wheel-es'
|
|
35
|
+
import InteractionLayer from '../components/InteractionLayer.vue'
|
|
36
|
+
import type { Shape } from '../types'
|
|
37
|
+
import { useGraphStore } from '../store/graphStore'
|
|
38
|
+
// 导入组件
|
|
39
|
+
import StrategicTaxonomyDiagram from '../components/Diagram/StrategicTaxonomyDiagram.vue'
|
|
40
|
+
import ConceptualRole from '../components/Shape/ConceptualRole.vue'
|
|
41
|
+
import Block from '../components/Shape/Block.vue'
|
|
42
|
+
import DogEar from '../components/Shape/DogEar.vue'
|
|
43
|
+
import Action from '../components/Shape/Action.vue'
|
|
44
|
+
import Package from '../components/Shape/Package.vue'
|
|
45
|
+
import DividingLine from '../components/Shape/DividingLine.vue'
|
|
46
|
+
import Edge from '../components/Edge/Edge.vue'
|
|
47
|
+
import Diagram from '../components/Shape/Diagram.vue'
|
|
48
|
+
import ActivityAction from '../components/Shape/ActivityAction.vue'
|
|
49
|
+
import Pin from '../components/Pin/Pin.vue'
|
|
50
|
+
import Port from '../components/Pin/Port.vue'
|
|
51
|
+
import { registerShapes } from "../render/shape-registry";
|
|
52
|
+
import { getShapeComponent, getShapeStyle } from "../render/shape-renderer";
|
|
53
|
+
import { ShapeConfig } from '../utils/diagram'
|
|
54
|
+
import { setCompartmentZones, buildZones, setTaggedValueLabelsCache, setPackageTypesCache } from '../utils/compartment'
|
|
55
|
+
import { eventBus } from "../store";
|
|
56
|
+
|
|
57
|
+
registerShapes({
|
|
58
|
+
StrategicTaxonomyDiagram,
|
|
59
|
+
ConceptualRole,
|
|
60
|
+
Block,
|
|
61
|
+
DogEar,
|
|
62
|
+
DividingLine,
|
|
63
|
+
Package,
|
|
64
|
+
Edge,
|
|
65
|
+
Action,
|
|
66
|
+
ActivityAction,
|
|
67
|
+
Diagram,
|
|
68
|
+
Pin,
|
|
69
|
+
Port
|
|
70
|
+
})
|
|
71
|
+
const interactionLayerRef = ref<InstanceType<typeof InteractionLayer> | null>(null)
|
|
72
|
+
const props = defineProps<{
|
|
73
|
+
addShapeData: Shape,
|
|
74
|
+
connectShapeData: Shape,
|
|
75
|
+
lines: String[],
|
|
76
|
+
packages: string[],
|
|
77
|
+
diagram: String[],
|
|
78
|
+
taggedValueLabels: string[],
|
|
79
|
+
actionButtonShapeId?: string,
|
|
80
|
+
classMetaTypes: string[],
|
|
81
|
+
edgeCheck: boolean,
|
|
82
|
+
pins: string[],
|
|
83
|
+
referentialAttributeModel: string[],
|
|
84
|
+
ports: string[],
|
|
85
|
+
}>()
|
|
86
|
+
|
|
87
|
+
const emit = defineEmits<{
|
|
88
|
+
(e: 'shapes-property', value: { selectedShape: Shape, showPropertyPanel: boolean }): void
|
|
89
|
+
(e: 'shapes-edit-name', value: { shape: Shape, newName: string }): void
|
|
90
|
+
(e: 'connect-end', value: { sourceId: string, targetId: string, sourcePoint: { x: number, y: number }, targetPoint: { x: number, y: number }, waypoints: Array<{ x: number, y: number }> }): void
|
|
91
|
+
(e: 'action-button-click', value: string, shape: Shape): void
|
|
92
|
+
(e: 'diagramDoubleClick', data: any): void
|
|
93
|
+
(e: 'model-type-property-id-button-click', value: string, shape: Shape): void
|
|
94
|
+
(e: 'action-button-add', shape: Shape): void
|
|
95
|
+
(e: 'scale-changed', scale: number): void
|
|
96
|
+
}>()
|
|
97
|
+
|
|
98
|
+
const graphStore = useGraphStore()
|
|
99
|
+
const diagramContentRef = ref<HTMLElement | null>(null)
|
|
100
|
+
const shapeComponents = ref<any[]>([]) // 用于获取子组件实例
|
|
101
|
+
const resShape = ref<Shape>({} as Shape) // 用于存储通过 ref 获取的 shape 数据
|
|
102
|
+
|
|
103
|
+
// 计算属性:获取当前画布的缩放比例
|
|
104
|
+
const currentScale = computed(() => graphStore.getScale())
|
|
105
|
+
|
|
106
|
+
// 响应式数据
|
|
107
|
+
const shapes = computed(() =>
|
|
108
|
+
(graphStore.visibleShapes || []).filter(s => {
|
|
109
|
+
// 外部拖拽创建中的形状应该被隐藏,只显示 ghost
|
|
110
|
+
if (graphStore.externalCreatingId && s.id === graphStore.externalCreatingId) {
|
|
111
|
+
return false
|
|
112
|
+
}
|
|
113
|
+
return (s?.shapeType !== 'shape' && s?.shapeType !== 'pin') // 非 shape:一律渲染
|
|
114
|
+
|| s?.inert !== false // 仅当是 shape 才检查;inert===false 才被过滤掉
|
|
115
|
+
})
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
// 将隔间组件从 DOM 量测得到的头/内容高度写回 shape.meta,
|
|
119
|
+
const onCompartmentMetrics = (
|
|
120
|
+
m: { headerH: number; contentH: number },
|
|
121
|
+
shape: Shape
|
|
122
|
+
) => {
|
|
123
|
+
// 就地挂 meta(避免触发重渲染)
|
|
124
|
+
shape.meta = { ...(shape.meta || {}), headerH: m.headerH, contentH: m.contentH }
|
|
125
|
+
// 计算 zones 并注册
|
|
126
|
+
// 计算最新的分区,并注册到全局(供 hover 命中 / 落点钳制 / 扩父等逻辑读取)
|
|
127
|
+
const z = buildZones(shape, m)
|
|
128
|
+
setCompartmentZones(shape.id, z)
|
|
129
|
+
}
|
|
130
|
+
// 获取StrategicTaxonomyDiagram的bounds
|
|
131
|
+
const diagramBounds = computed(() => {
|
|
132
|
+
const diagram = shapes.value.find(s => s.shapeType === ShapeConfig.SHAPE_TYPE)
|
|
133
|
+
return diagram?.bounds || null
|
|
134
|
+
})
|
|
135
|
+
|
|
136
|
+
// 初始化数据
|
|
137
|
+
const initShapes = () => {
|
|
138
|
+
graphStore.setTitle('战略图谱')
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const handlePropertyPanel = (payload: boolean) => {
|
|
142
|
+
if (graphStore.selectedShape) {
|
|
143
|
+
emit('shapes-property', { selectedShape: graphStore.selectedShape, showPropertyPanel: payload })
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// 处理名称点击事件
|
|
148
|
+
const handleNameClick = (shape: Shape, event: MouseEvent) => {
|
|
149
|
+
graphStore.selectShape(shape)
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// 处理图形点击事件
|
|
153
|
+
const handleShapeClick = (shape: Shape, event: MouseEvent) => {
|
|
154
|
+
graphStore.selectShape(shape)
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// 处理编辑名称事件
|
|
158
|
+
const handleEditName = (shape: Shape, newName: string) => {
|
|
159
|
+
emit('shapes-edit-name', { shape, newName })
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// 处理连接点位置更新
|
|
163
|
+
const handleUpdateConnectShape = (updatedShape: Shape) => {
|
|
164
|
+
// 这里可以添加更新 connectShapeData 的逻辑
|
|
165
|
+
// 由于 connectShapeData 是 props,可能需要通过 emit 通知父组件更新
|
|
166
|
+
console.log('连接点位置更新:', updatedShape)
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// 处理连接结束事件
|
|
170
|
+
const handleConnectEnd = (connectionData: { sourceId: string; targetId: string; sourcePoint: { x: number; y: number }; targetPoint: { x: number; y: number }; waypoints: Array<{ x: number; y: number }> }) => {
|
|
171
|
+
// 将连接数据传递给父组件
|
|
172
|
+
emit('connect-end', connectionData);
|
|
173
|
+
console.log('连接结束事件已传递给父组件:', connectionData);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// 处理双击图表事件
|
|
177
|
+
const handleDiagramDoubleClick = (data: any) => {
|
|
178
|
+
emit('diagramDoubleClick', data);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
const handleActionButtonClick = (value: any, shape: Shape) => {
|
|
182
|
+
emit('action-button-click', value, shape);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
const handleModelTypePropertyIdButtonClick = (value: any, shape: Shape) => {
|
|
186
|
+
emit('model-type-property-id-button-click', value, shape);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// 处理线条点击事件并转发给交互层
|
|
190
|
+
const handleEdgeClick = (shape: Shape, event: MouseEvent) => {
|
|
191
|
+
// 阻止事件冒泡,避免触发InteractionLayer的背景点击
|
|
192
|
+
event.stopPropagation();
|
|
193
|
+
event.preventDefault();
|
|
194
|
+
|
|
195
|
+
// 直接打印线条数据,确保事件被正确捕获
|
|
196
|
+
console.log('Graph层捕获到线条点击事件,线条数据:', shape, 'shapeType:', shape.shapeType);
|
|
197
|
+
|
|
198
|
+
// 确保shapeType为edge
|
|
199
|
+
const edgeShape = {
|
|
200
|
+
...shape,
|
|
201
|
+
shapeType: 'edge' as const
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
// 先直接选中线条
|
|
205
|
+
graphStore.clearSelection();
|
|
206
|
+
graphStore.selectShape(edgeShape);
|
|
207
|
+
|
|
208
|
+
// 转发事件给InteractionLayer组件
|
|
209
|
+
if (interactionLayerRef.value?.handleEdgeClick) {
|
|
210
|
+
console.log('转发线条点击事件到InteractionLayer');
|
|
211
|
+
interactionLayerRef.value.handleEdgeClick(edgeShape, event);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
const handleActionButtonAdd = (shape: Shape) => {
|
|
215
|
+
emit('action-button-add', shape);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// 处理鼠标滚轮事件,实现缩放功能
|
|
219
|
+
const handleWheel = (event: WheelEvent) => {
|
|
220
|
+
// 只有按住Ctrl键时才执行缩放
|
|
221
|
+
if (!event.ctrlKey && !event.metaKey) {
|
|
222
|
+
// 不按住Ctrl键时,允许默认的滚轮行为(滚动)
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// 阻止默认行为,避免页面缩放
|
|
227
|
+
event.preventDefault();
|
|
228
|
+
|
|
229
|
+
// 使用normalize-wheel-es标准化滚轮事件
|
|
230
|
+
const normalized = normalizeWheel(event);
|
|
231
|
+
|
|
232
|
+
// 计算缩放比例增量
|
|
233
|
+
const zoomFactor = 0.01;
|
|
234
|
+
const delta = normalized.pixelY > 0 ? -zoomFactor : zoomFactor;
|
|
235
|
+
|
|
236
|
+
// 获取当前缩放比例并计算新的缩放比例
|
|
237
|
+
// getScale默认使用activeDiagramId
|
|
238
|
+
const currentScale = graphStore.getScale();
|
|
239
|
+
const newScale = currentScale + delta;
|
|
240
|
+
|
|
241
|
+
// 设置新的缩放比例,默认使用activeDiagramId
|
|
242
|
+
graphStore.setScale(newScale);
|
|
243
|
+
|
|
244
|
+
// 通知父组件缩放变化
|
|
245
|
+
emit('scale-changed', newScale);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
const updateShapes = (shapes: Shape[]) => {
|
|
249
|
+
shapes.sort((a, b) => {
|
|
250
|
+
if (a.shapeType === 'diagram') return -1
|
|
251
|
+
if (b.shapeType === 'diagram') return 1
|
|
252
|
+
return 0
|
|
253
|
+
})
|
|
254
|
+
graphStore.updateShapes(shapes)
|
|
255
|
+
|
|
256
|
+
// 在图形批量更新后(通常是从后端加载数据),初始化所有连线的端点
|
|
257
|
+
// 确保连线不会横跨图元,而是从合适的位置连接
|
|
258
|
+
nextTick(() => {
|
|
259
|
+
graphStore.initializeAllEdgeEndpoints()
|
|
260
|
+
})
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
const updateShape = (shapeId: string, updates: Partial<Shape>, id: 'id' | 'modelId' = 'id') => {
|
|
264
|
+
graphStore.updateShape(shapeId, updates, id)
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
watch(() => props.addShapeData, async (newVal, oldVal) => {
|
|
268
|
+
if (!newVal || Object.keys(newVal).length === 0) return
|
|
269
|
+
sweepShapesWithInert()
|
|
270
|
+
await graphStore.clearSelection()
|
|
271
|
+
graphStore.addShape(newVal)
|
|
272
|
+
graphStore.selectShape(newVal)
|
|
273
|
+
eventBus.emit('addShape:ok')
|
|
274
|
+
// graphStore.addShape(newVal)
|
|
275
|
+
// resShape.value = newVal
|
|
276
|
+
},)
|
|
277
|
+
function sweepShapesWithInert() {
|
|
278
|
+
const arr = graphStore.shapes as any[]
|
|
279
|
+
let removed = 0
|
|
280
|
+
for (let i = arr.length - 1; i >= 0; i--) {
|
|
281
|
+
if ('inert' in arr[i]) {
|
|
282
|
+
arr.splice(i, 1) // 直接删,避免 removeShape 的事件/副作用导致回填
|
|
283
|
+
removed++
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
if (removed > 0) {
|
|
287
|
+
graphStore.clearSelection?.()
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
//拖动过程中
|
|
291
|
+
const continueExternalCreateDrag = (payload: { clientX: number; clientY: number }) => {
|
|
292
|
+
interactionLayerRef.value?.continueExternalCreateDrag(payload)
|
|
293
|
+
}
|
|
294
|
+
// 转发外部拖拽的“结束”事件到交互层。
|
|
295
|
+
const finishExternalCreateDrag = (payload: { clientX: number; clientY: number }) => {
|
|
296
|
+
interactionLayerRef.value?.finishExternalCreateDrag(payload)
|
|
297
|
+
}
|
|
298
|
+
// 监听shapes变化,确保InteractionLayer位置正确
|
|
299
|
+
watch(shapes, () => {
|
|
300
|
+
nextTick(() => {
|
|
301
|
+
// 可以在这里添加额外的位置调整逻辑
|
|
302
|
+
})
|
|
303
|
+
}, { deep: true })
|
|
304
|
+
|
|
305
|
+
watch(() => props.actionButtonShapeId, (newVal) => {
|
|
306
|
+
console.log('newVal', newVal);
|
|
307
|
+
})
|
|
308
|
+
// 监听 taggedValueLabels,立即同步到 graphStore
|
|
309
|
+
watch(
|
|
310
|
+
() => props.taggedValueLabels,
|
|
311
|
+
(val) => {
|
|
312
|
+
graphStore.taggedValueLabels = val ?? []
|
|
313
|
+
setTaggedValueLabelsCache(graphStore.taggedValueLabels)
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
immediate: true, // 组件挂载时先执行一次
|
|
317
|
+
}
|
|
318
|
+
)
|
|
319
|
+
|
|
320
|
+
// 监听 packages,同步到 graphStore.setPackageTypes
|
|
321
|
+
watch(
|
|
322
|
+
() => props.packages,
|
|
323
|
+
(val) => {
|
|
324
|
+
graphStore.packagesTypes = val ?? []
|
|
325
|
+
setPackageTypesCache(graphStore.packagesTypes)
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
immediate: true,
|
|
329
|
+
}
|
|
330
|
+
)
|
|
331
|
+
//监听classMetaTypes,同步到graphStore.classMetaTypes
|
|
332
|
+
watch(
|
|
333
|
+
() => props.classMetaTypes,
|
|
334
|
+
(val) => {
|
|
335
|
+
graphStore.classMetaTypes = val ?? []
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
immediate: true,
|
|
339
|
+
}
|
|
340
|
+
)
|
|
341
|
+
// 把 referentialAttributeModel + pins 合并后存进 store
|
|
342
|
+
watch(
|
|
343
|
+
() => [props.referentialAttributeModel, props.pins,props.ports],
|
|
344
|
+
([referentialAttributeModel, pins]) => {
|
|
345
|
+
const refArr = referentialAttributeModel ?? []
|
|
346
|
+
const pinArr = pins ?? []
|
|
347
|
+
const portArr = props.ports ?? []
|
|
348
|
+
graphStore.pinsTypes = pinArr
|
|
349
|
+
graphStore.portsTypes = portArr
|
|
350
|
+
graphStore.ownerRequiredShapeKeys = [...refArr, ...pinArr,...portArr]
|
|
351
|
+
},
|
|
352
|
+
{ immediate: true }
|
|
353
|
+
)
|
|
354
|
+
onMounted(() => {
|
|
355
|
+
initShapes()
|
|
356
|
+
document.addEventListener('keydown', (e) => {
|
|
357
|
+
if (e.key === 'Escape') {
|
|
358
|
+
graphStore.clearSelection()
|
|
359
|
+
graphStore.selectedIds = []
|
|
360
|
+
}
|
|
361
|
+
});
|
|
362
|
+
|
|
363
|
+
})
|
|
364
|
+
|
|
365
|
+
onUnmounted(() => {
|
|
366
|
+
document.removeEventListener('keydown', (e) => {
|
|
367
|
+
if (e.key === 'Escape') {
|
|
368
|
+
graphStore.clearSelection()
|
|
369
|
+
graphStore.selectedIds = []
|
|
370
|
+
}
|
|
371
|
+
});
|
|
372
|
+
})
|
|
373
|
+
|
|
374
|
+
defineExpose({
|
|
375
|
+
getBoundingClientRect: () => interactionLayerRef.value?.getBoundingClientRect(),
|
|
376
|
+
updateShapes,
|
|
377
|
+
updateShape,
|
|
378
|
+
continueExternalCreateDrag,
|
|
379
|
+
finishExternalCreateDrag,
|
|
380
|
+
})
|
|
381
|
+
</script>
|
|
382
|
+
|
|
383
|
+
<style scoped>
|
|
384
|
+
.graph-view {
|
|
385
|
+
width: 100%;
|
|
386
|
+
height: 100%;
|
|
387
|
+
background-color: #fff;
|
|
388
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
389
|
+
position: relative;
|
|
390
|
+
overflow: hidden;
|
|
391
|
+
user-select: none;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
.diagram-content {
|
|
395
|
+
position: absolute;
|
|
396
|
+
top: 10px;
|
|
397
|
+
left: 10px;
|
|
398
|
+
right: 0;
|
|
399
|
+
bottom: 0;
|
|
400
|
+
overflow: auto;
|
|
401
|
+
/* 防止Firefox中的默认缩放行为 */
|
|
402
|
+
touch-action: none;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
.shapes-container {
|
|
406
|
+
position: relative;
|
|
407
|
+
width: 100%;
|
|
408
|
+
height: 100%;
|
|
409
|
+
min-height: 600px;
|
|
410
|
+
/* 应用缩放变换 */
|
|
411
|
+
transform-origin: 0 0;
|
|
412
|
+
transform: scale(v-bind('currentScale'));
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
/* 所有 shape 组件都使用绝对定位 */
|
|
416
|
+
.shapes-container>* {
|
|
417
|
+
position: absolute;
|
|
418
|
+
}
|
|
419
|
+
</style>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// / <reference types="vite/client" />
|
|
2
|
+
|
|
3
|
+
interface ImportMetaEnv {
|
|
4
|
+
readonly VITE_API_BASE_URL: string
|
|
5
|
+
readonly VITE_APP_ENV: string
|
|
6
|
+
readonly VITE_APP_TITLE: string
|
|
7
|
+
readonly DEV: boolean
|
|
8
|
+
readonly PROD: boolean
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface ImportMeta {
|
|
12
|
+
readonly env: ImportMetaEnv
|
|
13
|
+
glob: (pattern: string, options?: { eager?: boolean; import?: string }) => Record<string, any>
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare module '*.vue' {
|
|
17
|
+
import type { DefineComponent } from 'vue'
|
|
18
|
+
const component: DefineComponent<Record<string, never>, Record<string, never>, unknown>
|
|
19
|
+
export default component
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
declare global {
|
|
23
|
+
interface Window {
|
|
24
|
+
electronAPI?: {
|
|
25
|
+
getAppVersion: () => Promise<string>
|
|
26
|
+
sendMessage: (msg: string) => void
|
|
27
|
+
onMessage: (cb: (msg: string) => void) => void
|
|
28
|
+
selectFile: () => Promise<string | undefined>;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
declare module 'lodash'
|