All Projects → m-cat → Cargo Deps

m-cat / Cargo Deps

Licence: bsd-3-clause
Cargo subcommand for building dependency graphs of Rust projects

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Cargo Deps

Ngd
View the dependencies tree of you Angular application
Stars: ✭ 570 (+239.29%)
Mutual labels:  dependencies, graph
Madge
Create graphs from your CommonJS, AMD or ES6 module dependencies
Stars: ✭ 5,635 (+3254.17%)
Mutual labels:  dependencies, graph
crates
crates is an extension aims to help people to manage their dependencies for rust (crates.io & TOML).
Stars: ✭ 156 (-7.14%)
Mutual labels:  cargo, dependencies
Cargo Contribute
Cargo subcommand for contributing to your dependencies
Stars: ✭ 56 (-66.67%)
Mutual labels:  dependencies, cargo
Awesome Graph Attack Papers
Adversarial attacks and defenses on Graph Neural Networks.
Stars: ✭ 162 (-3.57%)
Mutual labels:  graph
Eslint Plugin Boundaries
Eslint plugin checking architecture boundaries between elements
Stars: ✭ 157 (-6.55%)
Mutual labels:  dependencies
Forceatlas2
Fastest Gephi's ForceAtlas2 graph layout algorithm implemented for Python and NetworkX
Stars: ✭ 154 (-8.33%)
Mutual labels:  graph
Graphembedding
Implementation and experiments of graph embedding algorithms.
Stars: ✭ 2,461 (+1364.88%)
Mutual labels:  graph
Protodep
Collect necessary .proto files (Protocol Buffers IDL) and manage dependencies
Stars: ✭ 167 (-0.6%)
Mutual labels:  dependencies
Diagram Maker
A library to display an interactive editor for any graph-like data.
Stars: ✭ 2,086 (+1141.67%)
Mutual labels:  graph
Neo4j 3d Force Graph
Experiments with Neo4j & 3d-force-graph https://github.com/vasturiano/3d-force-graph
Stars: ✭ 159 (-5.36%)
Mutual labels:  graph
Boost graph cookbook 1
Boost.Graph Cookbook 1: Basics
Stars: ✭ 157 (-6.55%)
Mutual labels:  graph
Alga Paper
A minimalistic, elegant and powerful approach to working with graphs in a functional programming language
Stars: ✭ 163 (-2.98%)
Mutual labels:  graph
Idea Gradle Dependencies Formatter
Gradle dependencies formatter for IntelliJ IDEA
Stars: ✭ 156 (-7.14%)
Mutual labels:  dependencies
Patches
Patches is a visual programming editor for building WebVR and WebGL experiences.
Stars: ✭ 164 (-2.38%)
Mutual labels:  graph
Cross
“Zero setup” cross compilation and “cross testing” of Rust crates
Stars: ✭ 2,461 (+1364.88%)
Mutual labels:  cargo
Gocenter
The Github README for JFrog Go-center. Use this for reporting issues
Stars: ✭ 161 (-4.17%)
Mutual labels:  dependencies
Semantic Rs
🚀 Automatic crate publishing done right
Stars: ✭ 162 (-3.57%)
Mutual labels:  cargo
Baklavajs
Graph / node editor in the browser using VueJS
Stars: ✭ 157 (-6.55%)
Mutual labels:  graph
Clippy Check
📎 GitHub Action for PR annotations with clippy warnings
Stars: ✭ 159 (-5.36%)
Mutual labels:  cargo

cargo-deps

Build Status crates.io Documentation unsafe forbidden Downloads Issues LoC Coverage Status License: MIT

Note: This crate is not actively worked on. Consider using one of the crates mentioned in Alternatives.

Table of Contents **Table of Contents**

About

Cargo subcommand for building dependency graphs of Rust projects.

This project is an improvement on the unmaintained and buggy cargo-graph.

Example:

safe_app dependencies

Installing

cargo-deps can be installed with cargo install:

cargo install cargo-deps

Instructions

First, make sure you have graphviz installed.

Next, just cd into the Rust project directory you want to graph and run:

cargo deps | dot -Tpng > graph.png

That's it! graph.png will contain the graph (you can change its name, of course!)

Note that > may not work if the output file already exists, in which case you can try >|.

Dependency Kinds

The default behavior is to exclude optional, dev, and build dependencies. To see all dependencies, pass --all-deps:

cargo deps --all-deps | dot -Tpng > graph.png

Dependencies are colored depending on their kind:

  • Black: regular dependency
  • Purple: build dependency
  • Blue: dev dependency
  • Red: optional dependency

A dependency can be of more than one kind. In such cases, it is colored with the following priority:

Regular -> Build -> Dev -> Optional

For example, if a dependency is both a build and a dev dependency, then it will be colored as a build dependency. If, however, you pass the --dev-deps option instead of --all-deps, the dependency will be colored as a dev dependency (as the build-dependency graph will not be shown).

Filtering

Some Rust projects have really big dependency trees and maybe you just want to display certain dependencies, like the ones in the same workspace. Fortunately, cargo-deps provides the --filter option for this use case. Unfortunately, you have to explicitly list all the dependencies you want to keep, and cargo-deps doesn't detect workspaces just yet.

Excluding

It can be useful to exclude certain crates from the final graph. This can be achieved with the --exclude flag taking the undesired crates as arguments.

Depth

In order to constrain the size of graphs and make them cleaner, it is possible to limit the output to dependencies within a certain depth using the --depth option.

Filtering transitive edges

For large dependency graphs, the --no-transitive-deps option can be used to filter out edges that are "covered" by a transitive dependency, which can make visual parsing a little easier by omitting some redundant edges. For example, if crate A depends directly on crate B and C, and crate B depends directly on crate C, this option would omit the edge from A to C. To illustrate, compare the default dependency graph for Tokei, generated by cargo deps, to the graph with transitive edges removed, generated by cargo deps --no-transitive-deps.

Subgraphs

You can visually group a set of dependencies by using the --subgraph command.

Examples

Tokei -- graph

This was generated using the command:

cargo deps -I --all-deps --no-regular-deps | dot -Tpng > tokei.png

SAFE Client Libs -- graph

This was generated using the following whopper of a command to display only MaidSafe dependencies:

cargo deps --all-deps --include-orphans --subgraph safe_app safe_app_jni safe_authenticator safe_authenticator_jni safe_core --subgraph-name "SAFE Client Libs" --filter accumulator config_file_handler crust ffi_utils fake_clock lru_time_cache maidsafe_utilities parsec resource_proof routing rust_sodium safe_app safe_app_jni safe_authenticator safe_authenticator_jni safe_bindgen safe_core safe_crypto safe_vault secure_serialisation self_encryption system_uri tokio_utp --manifest-path safe_app/Cargo.toml | dot -Tpng -Nfontname=Iosevka -Gfontname=Iosevka > safe-client-libs.png

More info

Run cargo deps -h to see all available options.

Alternatives

While cargo-deps should work for most use cases, it has an outdated architecture and the creator is not working on active development. Some alternatives to consider are:

  • cargo-depgraph: Has more features than cargo-deps.
  • cargo-tree: Displays dependencies in a textual format. As of Rust 1.44 is included in cargo as a subcommand.

License

cargo-deps is released under the terms of the MIT license. See the LICENSE-MIT file for the details.

Dependencies

cargo-deps dependencies

Changelog

Changelog

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].