fix: allow for nodes without any edges (e.g. new player)
This commit is contained in:
parent
c04a1e03f2
commit
e88eb02ef1
@ -116,6 +116,7 @@ def graph_json(
|
||||
status_code=status.HTTP_404_NOT_FOUND, detail="no entries found"
|
||||
)
|
||||
G = nx.DiGraph()
|
||||
G.add_nodes_from([n["id"] for n in nodes])
|
||||
G.add_weighted_edges_from([(e["source"], e["target"], e["size"]) for e in edges])
|
||||
in_degrees = G.in_degree(weight="weight")
|
||||
nodes = [
|
||||
|
Loading…
x
Reference in New Issue
Block a user