Codegen’s graph visualization capabilities allow you to pair our sophisticated language server with best-in-class graph visualization tools to understand parts of your codebase like never before.

We leverage powerful libraries like NetworkX and D3.js to build and render graphs, enabling you to create visualizations that range from intricate details to large-scale structures. This combination of our advanced language analysis and industry-standard visualization tools opens up virtually limitless possibilities for exploring and understanding your codebase.

How to

1

Write a codemod that collects the data you want to visualize. This could involve using Codegen’s API to iterate through symbols, files, or other elements of your codebase.

2

Initialize a NetworkX graph and create nodes with the data you’ve collected. You can do this with code like G = nx.DiGraph() and then add nodes and edges as needed.

3

Visualize your graph by passing it to the codebase.visualize() function. This will display your graph in the Codegen IDE.

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