Skip to content

How to visualize your dependency structure

Mike Gerasimenko edited this page Sep 18, 2023 · 1 revision

It is sometimes helpful to see the graphical visualization of how tool is understanding the dependency structure of a project.

In order to help with this, several command line options are available.

With --dot option you can get Graphviz output that you can convert to an SVG or a PNG file.

An alternative is a Mermaid-based solution that is triggered with the --dependency-graph flag. It is creating a webpage that consists of two components:

  • Import of MermaidJS via a CDN
  • Locally executed JS code that contains embedded Mermaid source

This webpage is then packaged into a base64 URL and opened in your browser (on macOS).

This solution has some important pros and cons I would like to highlight. This type of visualization is using a web browser and an external JavaScript library. If you have concerns about using JS code served from a public CDN, I would suggest using a Graphviz solution instead.

Clone this wiki locally