colcon_gephi
Colcon plugin to generate a rich dependency graph for packages in a ROS 2 workspace. Resulting graph is intended for viewing in Gephi, but should be usable in other graph viewing tools like GraphViz or Graphia, although these have not been verified.
Below is an example graph of the workspace for the ros2 rolling repos.
For details on what the graph actually is showing, see Example Graph.
Features
Currently supports exporting in:
- DOT (default, for Graphviz and other generic graph tools)
- GML (human-readable text format, supported by many graph libraries)
- GEXF (ideal for Gephi, preserves complex attributes)
Unlike colcon graph, this extension preserves extra package metadata (e.g., maintainers, repository info, build type)
as node attributes. This makes it easier to analyze dependency relationships visually in Gephi.
- Generates a graph file from your ROS 2 workspace using the same package descriptors as
colcon graph. - Automatically includes the following as node attributes:
- Package path
- Build type
- Maintainers
- Version
- Git repository name and remote URL (if applicable)
- Lines of Code (LOC) stats (see Optional Dependencies)
- Includes edges for build, run, and test dependencies between packages in the workspace.
- Produces output ready to open in Gephi — no manual attribute editing required.
Install from PyPI
python3 -m pip install colcon_gephi
Usage
cd ros2_rolling/
colcon gephi_graph
The generated .dot file will have the name of the directory the command was run in. So in this case,
it is ros2_rolling.dot.
To change the file format, pass the --format flag.
colcon gephi_graph --format gml
Optional Dependencies
This package optionally depends on cloc to LOC-related node attributes.
If cloc is not found on the system, a warning is printed, and the LOC-related attributes are not added.
Gephi Tips
Gephi can be quite complex to use. It is recommended to read a few tutorials on usage.
Node Size Based on Attribute
For whatever reason, when networkx exports a graph, the resulting (by default) .dot file will not respect data types.
Everything will be a string. This means that you cannot do things like change the size of nodes based on attributes like
lines_of_code by default. You need to make a new column, and copy the data over to this new column with the
appropriate data type.
Example Graph
The graph generated at the top of this README was laid out by following this video. Larger nodes are nodes with more "in-degree" edges (i.e. edges pointing into them), which gives a visual representation of how many packages depend on them. Finally, the colors are based on the package build_type (i.e. ros.ament_cmake, ros.ament_python, etc).
Metadata
Release files for colcon-gephi 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| colcon_gephi-0.1.0.tar.gz | 9.5 kB | Without provenance | Details for colcon_gephi-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| colcon_gephi-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for colcon_gephi-0.1.0-py3-none-any.whl |
Total release size: 19.7 kB
Release files / colcon_gephi-0.1.0.tar.gz
| Download URL | colcon_gephi-0.1.0.tar.gz |
|---|---|
| Size | 9.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b8fd934e46489d59872eba4aa4a0b56310e2074a2632f36ddceb2481567b3285
|
|
BLAKE2b-256 checksum How to use checksums |
fd3044359f2535e7e6fd496c165d25c1b91d8ba756fc45043faf70d62cb88fa9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Release files / colcon_gephi-0.1.0-py3-none-any.whl
| Download URL | colcon_gephi-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7c95e4218d98fabc16247ad1b1ede5a2960e7d71ca23bdea0fbc4e7694e1af4a
|
|
BLAKE2b-256 checksum How to use checksums |
9a67efdba73d3f6285e404073aed0ec753d71f52d322c535c3cf5b2d0fe064bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Security for colcon-gephi 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.