Skip to content

Commit

Permalink
pop rank to prop
Browse files Browse the repository at this point in the history
  • Loading branch information
wey-gu committed Mar 15, 2024
1 parent 1970cd3 commit e4dc6b6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions nebula3/data/ResultSet.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,9 @@ def dict_for_vis(self):
"src":"player100",
"dst":"player101",
"name":"follow",
"rank":0,
"props":{
"degree":"95"
"degree":"95",
"rank":"0"
}
}
],
Expand Down Expand Up @@ -346,6 +346,12 @@ def add_to_nodes_or_edges(nodes_dict, edges_dict, item):
)
nodes = list(nodes_dict.values())
edges = list(edges_dict.values())
# move rank to props, omit rank 0
for edge in edges:
if "rank" in edge:
rank = edge.pop("rank")
if rank != 0:
edge["props"]["rank"] = rank

return {
"nodes": nodes,
Expand Down

0 comments on commit e4dc6b6

Please sign in to comment.