This commit is contained in:
parent
ad15ffc3c8
commit
327909395e
1 changed files with 21 additions and 7 deletions
|
|
@ -89,6 +89,7 @@ pub fn generate_mermaid_with_status(
|
||||||
// Track nodes we've already added to avoid duplicates
|
// Track nodes we've already added to avoid duplicates
|
||||||
let mut added_nodes = HashSet::new();
|
let mut added_nodes = HashSet::new();
|
||||||
let mut added_refs = HashSet::new();
|
let mut added_refs = HashSet::new();
|
||||||
|
let mut added_edges = HashSet::new();
|
||||||
|
|
||||||
// Map to track which refs are outputs (to highlight them)
|
// Map to track which refs are outputs (to highlight them)
|
||||||
let mut is_output_ref = HashSet::new();
|
let mut is_output_ref = HashSet::new();
|
||||||
|
|
@ -152,12 +153,21 @@ pub fn generate_mermaid_with_status(
|
||||||
added_refs.insert(ref_node_id.clone());
|
added_refs.insert(ref_node_id.clone());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add the edge from input to job
|
// Add the edge from input to job (avoid duplicates)
|
||||||
if input.dep_type == 1 { // MATERIALIZE = 1
|
let edge_key = if input.dep_type == 1 { // MATERIALIZE = 1
|
||||||
mermaid.push_str(&format!(" {} --> {}\n", ref_node_id, job_node_id));
|
format!("{}-->{}", ref_node_id, job_node_id)
|
||||||
} else {
|
} else {
|
||||||
// Dashed line for query dependencies
|
format!("{}-.->{}", ref_node_id, job_node_id)
|
||||||
mermaid.push_str(&format!(" {} -.-> {}\n", ref_node_id, job_node_id));
|
};
|
||||||
|
|
||||||
|
if !added_edges.contains(&edge_key) {
|
||||||
|
if input.dep_type == 1 { // MATERIALIZE = 1
|
||||||
|
mermaid.push_str(&format!(" {} --> {}\n", ref_node_id, job_node_id));
|
||||||
|
} else {
|
||||||
|
// Dashed line for query dependencies
|
||||||
|
mermaid.push_str(&format!(" {} -.-> {}\n", ref_node_id, job_node_id));
|
||||||
|
}
|
||||||
|
added_edges.insert(edge_key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -184,8 +194,12 @@ pub fn generate_mermaid_with_status(
|
||||||
added_refs.insert(ref_node_id.clone());
|
added_refs.insert(ref_node_id.clone());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add the edge from job to output
|
// Add the edge from job to output (avoid duplicates)
|
||||||
mermaid.push_str(&format!(" {} --> {}\n", job_node_id, ref_node_id));
|
let edge_key = format!("{}-->{}", job_node_id, ref_node_id);
|
||||||
|
if !added_edges.contains(&edge_key) {
|
||||||
|
mermaid.push_str(&format!(" {} --> {}\n", job_node_id, ref_node_id));
|
||||||
|
added_edges.insert(edge_key);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue