Skip to content

Commit

Permalink
fix: Ignore hierarchy elements that are not in the graph when displaying
Browse files Browse the repository at this point in the history
  • Loading branch information
aborgna-q committed Jul 11, 2023
1 parent bc221b8 commit ac1891c
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/dot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,17 +336,20 @@ where
dot.push_str(&node_str);

// Connect the parent to any existing children
forest.children(n).for_each(|child| {
dot.push_str(&{
let from_node = n;
let to_node = child;
format!(
"{} -> {} [style = \"dashed\"] \n",
hier_node_id(from_node),
hier_node_id(to_node),
)
forest
.children(n)
.filter(|c| self.graph.contains_node(c))
.for_each(|child| {
dot.push_str(&{
let from_node = n;
let to_node = child;
format!(
"{} -> {} [style = \"dashed\"] \n",
hier_node_id(from_node),
hier_node_id(to_node),
)
});
});
});
}
}
}
Expand Down

0 comments on commit ac1891c

Please sign in to comment.