From 327ae0c46e6a436485442371a309df015c36557d Mon Sep 17 00:00:00 2001 From: Herbert Wolverson Date: Wed, 15 Jan 2025 09:48:18 -0600 Subject: [PATCH] DOT graph creation fixed and shows weights. --- src/rust/uisp_integration/src/strategies/full/tree_walk.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rust/uisp_integration/src/strategies/full/tree_walk.rs b/src/rust/uisp_integration/src/strategies/full/tree_walk.rs index c11309bd..6f18431f 100644 --- a/src/rust/uisp_integration/src/strategies/full/tree_walk.rs +++ b/src/rust/uisp_integration/src/strategies/full/tree_walk.rs @@ -23,7 +23,7 @@ pub fn walk_tree_for_routing( let mut visited = std::collections::HashSet::new(); let current_node = root_idx; let mut natural_weights: Vec = Vec::new(); - let mut dot_graph = "digraph G {\n graph [ ranksep=2.0 overlap=false ]".to_string(); + let mut dot_graph = "digraph G {\n graph [ ranksep=2.0 overlap=false ]\n".to_string(); walk_node(current_node, 10, sites, &mut visited, overrides, &mut dot_graph, &mut natural_weights); dot_graph.push_str("}\n"); { @@ -73,7 +73,7 @@ fn walk_node( let to = sites[idx].name.clone(); if sites[idx].site_type != UispSiteType::Client && sites[i].site_type != UispSiteType::Client { - dot_graph.push_str(&format!("\"{}\" [label=\"{}\"];\n", to, to)); + dot_graph.push_str(&format!("\"{}\" -> \"{}\" [label=\"{}\"] \n", from, to, weight)); natural_weights.push(RouteOverride { from_site: from.clone(), to_site: to.clone(),