https://github.com/jplatte/cargo-depgraph
Creates graphviz dependency graphs for Rust projects that use Cargo
https://github.com/jplatte/cargo-depgraph
cargo-plugin rust
Last synced: about 1 year ago
JSON representation
Creates graphviz dependency graphs for Rust projects that use Cargo
- Host: GitHub
- URL: https://github.com/jplatte/cargo-depgraph
- Owner: jplatte
- License: gpl-3.0
- Created: 2021-01-27T16:38:33.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-06-13T19:05:22.000Z (about 2 years ago)
- Last Synced: 2025-05-01T09:53:54.266Z (about 1 year ago)
- Topics: cargo-plugin, rust
- Language: Rust
- Homepage:
- Size: 1.66 MB
- Stars: 177
- Watchers: 2
- Forks: 10
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# cargo-depgraph
Creates dependency graphs for cargo projects using `cargo metadata` and graphviz.
## Installation
`cargo install cargo-depgraph`
If you are using Arch Linux, you can alternatively install via `pacman -S cargo-depgraph`.
## Usage
*Note: This assumes you have [Graphviz](https://graphviz.org/) installed. There are also online
tools that can generate graphics from the textual graphviz graphs `cargo depgraph` generates, if
the command-line graphviz tools like `dot` aren't your thing.*
`cargo depgraph [options] | dot -Tpng > graph.png`
The full list of options can be seen by running
`cargo depgraph --help`
Commonly useful options:
* `--all-deps`

* `--all-deps --dedup-transitive-deps`

## Output explanation
* square node = root / workspace member
* grey background = target-specific dependency
* dotted lines = optional dependency (could be removed by disabling a cargo feature)
* dashed lines = transitively optional dependency (could be removed by removing one of the dotted
edges)
* line colors = dependency kinds w.r.t. root / workspace members
* black = normal
* blue = dev-dependency
* green = build-dependency
* light turquoise = build-dependency of a dev-dependency
* dark green = both normal and build-dependency
* violet = both dev-dependency and build-dependency
* … not seen in the wild yet, but theoretically possible:
* dark turquoise = both normal and build-dependency of a dev-dependency
* pastel blue = both dev-dependency and build-dependency of a dev-dependency
* red = you broke it