#cargo #cargo-metadata #graphviz #metadata #graphs

app cargo-depgraph

Creates dependency graphs for cargo projects using cargo metadata and graphviz

10 stable releases

Uses new Rust 2021

1.2.5 Jun 23, 2022
1.2.4 Apr 15, 2022
1.2.3 Jan 28, 2022
1.2.2 Jul 27, 2020
0.1.0 Jul 9, 2020

#35 in Cargo plugins

Download history 51/week @ 2022-03-15 40/week @ 2022-03-22 13/week @ 2022-03-29 22/week @ 2022-04-05 70/week @ 2022-04-12 18/week @ 2022-04-19 55/week @ 2022-04-26 83/week @ 2022-05-03 171/week @ 2022-05-10 59/week @ 2022-05-17 68/week @ 2022-05-24 91/week @ 2022-05-31 45/week @ 2022-06-07 19/week @ 2022-06-14 70/week @ 2022-06-21 30/week @ 2022-06-28

174 downloads per month

GPL-3.0-or-later

34KB
710 lines

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 the AUR package cargo-depgraph.

Usage

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

cargo-depgraph's dependency graph

  • --all-deps --dedup-transitive-deps

cargo-depgraph's dependency graph with transitive dependency edges de-duplicated

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

Dependencies

~4MB
~81K SLoC