This commit is contained in:
Paul Gauthier 2023-05-25 06:39:40 -07:00
parent 407e47b6ed
commit da8a85fea6

View file

@ -210,11 +210,13 @@ if __name__ == "__main__":
edges = defaultdict(int) edges = defaultdict(int)
for ident in idents: for ident in idents:
for refs in references[ident]:
defs = defines[ident] defs = defines[ident]
if len(defs) != 1: if len(defs) > 1:
dump(ident, len(defs), defs)
continue continue
defs = list(defs)[0]
for refs in references[ident]:
for defs in defines[ident]:
if refs == defs: if refs == defs:
continue continue
edges[(refs, defs)] += 1 edges[(refs, defs)] += 1
@ -228,7 +230,7 @@ if __name__ == "__main__":
b = random.randint(0, 255) b = random.randint(0, 255)
color = f"#{r:02x}{g:02x}{b:02x}80" color = f"#{r:02x}{g:02x}{b:02x}80"
weight = weight * 10 / max_w weight = weight * 10 / max_w
weight = max(weight, 1) # weight = max(weight, 1)
dot.edge(refs, defs, penwidth=str(weight), color=color) dot.edge(refs, defs, penwidth=str(weight), color=color)
# print(f"{refs} -{weight}-> {defs}") # print(f"{refs} -{weight}-> {defs}")