cargo-arc
Generates a collapsible arc diagram of your Cargo workspace as SVG.
You get a tree of your crates and their modules, connected by arcs
that trace use dependencies between them.
Installation
Requires a stable Rust toolchain.
Quick Start
# In any Cargo workspace:
Open the generated SVG in a browser.
What You See
Your workspace shows up as a tree — crates with their modules nested inside. Arcs between nodes show where dependencies exist.
- Boxes — crates and modules, nested by hierarchy
- Arcs — dependencies between any two nodes
- Collapse a node to fold its children — individual dependencies merge into summary arcs
- Select a node or arc to highlight its relationships
- Cycles — circular dependencies are detected and highlighted
Features
- Cross-crate module dependencies — traces
usedependencies across the whole workspace at module level - Feature filtering — show only crates involved in a specific Cargo feature
- Interactive SVG — collapse, expand, and select directly in the browser
- External dependencies — visualize which external crates your modules depend on
- Volatility report — identifies frequently-changed modules based on git history
Feature Filtering
Show only the dependency subgraph for a specific Cargo feature:
# Show crates involved in the "web" feature (includes default deps)
# Exclude default deps — show ONLY the "web" feature graph
External Dependencies
Show which external crates your modules depend on:
# Direct external dependencies only
# Include transitive external dependencies
External dependencies appear as separate nodes in the graph. The sidebar distinguishes direct from transitive dependencies with distinct styling.
Expand Level
Start with deeper modules pre-collapsed to keep large workspaces readable:
# Show only crates (everything collapsed)
# Show crates and their direct modules
Nodes beyond the given depth start collapsed. Click to expand interactively.
Volatility Report
Analyze which modules changed most frequently over the last months:
Useful for identifying hotspots before refactoring. The analysis period
and thresholds are configurable (--volatility-months, --volatility-low,
--volatility-high).
Similar Projects
- cargo tree — built-in textual dependency tree (crate-level)
- cargo-modules — module tree and dependency visualization
- cargo-depgraph — crate-level dependency graph as DOT with color-coded dependency kinds
- cargo-coupling — coupling analysis based on Khononov's framework
References
The arc diagram layout is inspired by Martin Wattenberg's Arc Diagrams: Visualizing Structure in Strings (IEEE InfoVis 2002).
Development
See docs/ARCHITECTURE.md for project structure and architecture decision records.
Requires Just as task runner.
License
MIT OR Apache-2.0