fix:dag优化

This commit is contained in:
shijing 2025-04-03 09:26:53 +08:00
parent 125e82d310
commit 315494d99e
1 changed files with 8 additions and 7 deletions

View File

@ -58,7 +58,7 @@ export default {
let that = this;
that.$nextTick(() => {
if(that.g!==null){
that.updataGraph();
that.updateGraph();
}else{
that.g = new dagreD3.graphlib.Graph().setGraph({
rankdir: that.rankdir,
@ -104,7 +104,6 @@ export default {
let mySvgWdith =document.getElementsByClassName("output")[0].getBoundingClientRect().width+150 ;
document.getElementById('mySvg').setAttribute("height", mySvgHeight);
document.getElementById('mySvg').setAttribute("width", mySvgWdith);
svg.selectAll("g.node").on("click", function(event, d) {
//
const node = d3.select(this);
@ -125,15 +124,17 @@ export default {
});
//
function onNodeClick(nodeData) {
console.log("Node clicked:", nodeData);
this.$emit("nodeClick", nodeData);
let batch = "";
that.nodes.forEach((item) => {
if (item.id === nodeData){
batch = item.label;
}
})
that.$emit("nodeClick", batch);
//
}
}
})
},
updataGraph(){
},
//
updateGraph() {