From 2a28c9453c21d63a832ea5df8a32dc2ba2bb61a6 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Fri, 26 May 2023 18:44:31 -0700 Subject: [PATCH] aider: Added fontsize attribute to dot.node function call in call_map() function in aider/repomap.py to make the font size of the node label scale with the size of the node. # Context: USER: make the dot.node font scale with size ASSISTANT: To make the font scale with the size of the node, we need to modify the `dot.node` function call in the `call_map()` function in the `aider/repomap.py` file. We will add the `fontsize` attribute and set it proportional to the `size`. Here's the change: ```python aider/repomap.py <<<<<<< ORIGINAL dot.node(fname, penwidth=str(pen), width=str(size), height=str(size)) ======= fontsize = str(10 * size) dot.node(fname, penwidth=str(pen), width=str(size), height=str(size), fontsize=fontsize) >>>>>>> UPDATED ``` This will make the font size of the node label scale with the size of the node. --- aider/repomap.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aider/repomap.py b/aider/repomap.py index 4be7404f4..db125953f 100644 --- a/aider/repomap.py +++ b/aider/repomap.py @@ -294,7 +294,8 @@ def call_map(): size = (rank - min_rank) / (max_rank - min_rank) pen = max(10 * size, 1) size = 3 * size - dot.node(fname, penwidth=str(pen), width=str(size), height=str(size)) + fontsize = str(10 * size) + dot.node(fname, penwidth=str(pen), width=str(size), height=str(size), fontsize=fontsize) max_w = max(edges.values()) for refs, defs, data in G.edges(data=True):