pipdeptree
pipdeptree copied to clipboard
Use filled node with different color for graph output
Use filled node with different color for graph output, make it's clean for top level package and it's dependencies.
Changes in dump_graphviz(tree, output_format='dot')
:
dependencies = set()
for deps in tree.values():
for dep in deps:
dependencies.add(dep.project_name)
graph = Digraph(format=output_format)
for package, deps in tree.items():
project_name = package.project_name
label = '{0}\n{1}'.format(project_name, package.version)
attrs = {'style': 'filled'}
attrs['color'] = 'lightblue' if project_name in dependencies else 'green'
graph.node(project_name, label=label, **attrs)
It would also be interesting to have an option to colour outdated packages.
Seems there hasn't been any push for this for 3 years, so closing for now.