#cargo #cargo-metadata #graphviz #graph #metadata #options #transitive

app cargo-depgraph

Creates dependency graphs for cargo projects using cargo metadata and graphviz

13 stable releases

1.4.0 Nov 23, 2022
1.3.1 Oct 31, 2022
1.3.0 Sep 22, 2022
1.2.5 Jun 23, 2022
0.1.0 Jul 9, 2020

#42 in Cargo plugins

Download history 53/week @ 2022-11-27 25/week @ 2022-12-04 34/week @ 2022-12-11 45/week @ 2022-12-18 11/week @ 2022-12-25 35/week @ 2023-01-01 30/week @ 2023-01-08 23/week @ 2023-01-15 39/week @ 2023-01-22 49/week @ 2023-01-29 50/week @ 2023-02-05 66/week @ 2023-02-12 43/week @ 2023-02-19 18/week @ 2023-02-26 16/week @ 2023-03-05 24/week @ 2023-03-12

117 downloads per month

GPL-3.0-or-later

35KB
727 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

~4.5MB
~90K SLoC