Use codebase.visualize(G) to view graphs in the Codegen IDE

Customize Nodes

color

Supports colors specified by name or hexadecimal code

G.add_node(node, color = '#FF5733')

text

Add text to be displayed when clicked on

G.add_node(node, text = f"There are {len(node.imports)}")

code

Add code to be displayed when clicked on

Codegen shows source code by default. Use this to override.

G.add_node(node, code = file.source)

Customize Edges

color

Supports colors specified by name or hexadecimal code

G.add_node(node1, node2, color = '#FF5733')

text

Add text to be displayed when clicked on

G.add_node(node1, node2, text = f"There are {len(node.imports)}")

code

Add text to de displayed when clicked on

G.add_node(node1, node2, code = imp.source)

By mastering these customization techniques, you’ll be able to create graphs that not only look great but also effectively communicate complex relationships within your codebase.