Recording domain-specific metadata on graphs, nodes, edges...

At my workplace, have a script that scans our package configuration files and emits a "dot" graph that represents the relationships between source code repositories and the packages that are built from those sources.

For example, a set of packages is built from the source code in a repo, and those packages have build-time and run-time dependencies on other packages. Instead of having multiple scripts that generate different types of graphs, we postprocess one *.dot file that contains all node and edge types with gvpr to extract specific visualizations.

Currently, we identify the different types by using/abusing the color attribute. For example, a build-dependency is "blue", a run-time dependency is "green", and a virtual package dependency is "red". This seems a bit hacky. So my question is whether there is a more conventional way or a best practice for representing domain or application specific metadata on graph elements.

One alternative I'm considering is to use the python networkx library (as we're a python shop) and writing the filters in python instead of gvpr, emitting '*.dot' files at the back end just for output.

You are not limited to the

You are not limited to the attributes used by the Graphviz layout programs in creating your graph files. You can attach any name/value pair you want. So, nothing keeps you from having

  abc [type=node_dependency]

and using that in your gvpr scripts.

Thanks. This is a big help.

Thanks. This is a big help. I've used graphviz for years, and never realized you could use custom attribute names.

Recent comments