apskhem / cratesinquire

crates.io insight and explorer.
https://cratesinquire.info
Apache License 2.0
8 stars 1 forks source link

Dependency tree is misleading about the total number of crates #3

Closed dtolnay closed 2 years ago

dtolnay commented 2 years ago

The following looks like an enormous dependency graph, but in reality it's just repeating the same few dependencies many times (winapi, serde, syn, quote, proc-macro2, ...). For example I count 9 different copies of proc-macro2 1.0 in this graph. In reality Cargo would only build that dependency a single time, and it would be nice if the view would capture that.

In particular it looks like this view is associating dependency specs (^0.1 vs ^0.1.3 etc) with nodes, whereas it would make more sense to me to associate them with edges. Multiple crates can depend on the same dependency with different specifications, and there should only be one node for the dependency for every semver-compatible group of those specifications.


Screenshot from 2021-12-13 10-25-47

apskhem commented 2 years ago

I implemented a new look of dependency chart in a form of a directed graph. It will be very messy if the crate has a large dependency. I tried my best to visualize the dependency distance by the scale of color.

screencapture-localhost-3000-crates-cargo-tally-2022-01-01-01_40_06