Skip to content

Commit

Permalink
each repository has own color in the graph
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-facko committed May 22, 2024
1 parent 4dda184 commit 6654266
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions metamanager/PPpackage/metamanager/create_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ async def create_graph(


def graph_to_dot(graph: MultiDiGraph) -> Dot:
manager_to_color = dict[str, int]()
manager_to_color = dict[Repository, int]()

for package, data in get_graph_items(graph):
repository_identifier = data["repository"].get_identifier()
repository = data["repository"]

if repository_identifier not in manager_to_color:
manager_to_color[repository_identifier] = len(manager_to_color) + 1
if repository not in manager_to_color:
manager_to_color[repository] = len(manager_to_color) + 1

graph_presentation: MultiDiGraph = convert_node_labels_to_integers(
graph, label_attribute="package"
Expand All @@ -105,7 +105,7 @@ def graph_to_dot(graph: MultiDiGraph) -> Dot:
data.clear()

data["label"] = f'"{package}"'
data["fillcolor"] = manager_to_color[repository.get_identifier()]
data["fillcolor"] = manager_to_color[repository]

graph_presentation.graph.update(
{
Expand Down

0 comments on commit 6654266

Please sign in to comment.