From e26d07a0ed2aeb38067df64ceeceb3511386d774 Mon Sep 17 00:00:00 2001 From: Wey Gu Date: Thu, 13 Jun 2024 10:45:36 +0800 Subject: [PATCH] fix: better normlization of node size render --- ngql/magic.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ngql/magic.py b/ngql/magic.py index 2ff56ac..a907064 100644 --- a/ngql/magic.py +++ b/ngql/magic.py @@ -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 }"