Skip to content

Commit

Permalink
fix: better normlization of node size render
Browse files Browse the repository at this point in the history
  • Loading branch information
wey-gu committed Jun 13, 2024
1 parent 27a4fd1 commit e26d07a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ngql/magic.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,9 +514,8 @@ def ng_draw(self, line, cell=None, local_ns={}):

# Update node sizes based on PageRank scores
for node_id, score in pagerank_scores.items():
g.get_node(node_id)["size"] = (
10 + score * 130
) # Normalized size for visibility
normalized_size = 10 + score * 90 # Reduced multiplier for smaller size normalization
g.get_node(node_id)["size"] = min(normalized_size, 80)
except Exception as e:
fancy_print(
f"[WARN]: failed to calculate PageRank, left graph node unsized. Reason:\n { e }"
Expand Down

0 comments on commit e26d07a

Please sign in to comment.