Skip to content

Commit

Permalink
Fix hover by adding a prefix to the node IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohamed El Mouctar HAIDARA committed Jan 10, 2019
1 parent 0209269 commit 761fc4f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ansibleplaybookgrapher/grapher.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def make_graph(self, include_role_tasks=False, tags=None, skip_tags=None):

play_name = self.template(play_name, play_vars)

play_id = clean_id("play_" + play_name)
play_id = "play_" + clean_id(play_name)

self.graph_representation.add_node(play_id)

Expand Down Expand Up @@ -143,14 +143,14 @@ def make_graph(self, include_role_tasks=False, tags=None, skip_tags=None):

with self.graph.subgraph(name=role_name, node_attr={}) as role_subgraph:
current_counter = role_counter + nb_pre_tasks
role_id = clean_id("role_" + role_name + role_not_tagged)
role_id = "role_" + clean_id(role_name + role_not_tagged)
role_subgraph.node(role_name, id=role_id)

when = "".join(role.when)
play_to_node_label = str(current_counter) if len(when) == 0 else str(
current_counter) + " [when: " + when + "]"

edge_id = clean_id("edge_" + play_id + role_id + role_not_tagged)
edge_id = "edge_" + clean_id(play_id + role_id + role_not_tagged)

role_subgraph.edge(play_name, role_name, label=play_to_node_label, color=color, fontcolor=color,
id=edge_id)
Expand Down

0 comments on commit 761fc4f

Please sign in to comment.