pipdeptree icon indicating copy to clipboard operation
pipdeptree copied to clipboard

Use filled node with different color for graph output

Open zufuliu opened this issue 6 years ago • 1 comments

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)

zufuliu avatar May 12 '18 00:05 zufuliu

It would also be interesting to have an option to colour outdated packages.

mantognini avatar Jun 18 '18 13:06 mantognini

Seems there hasn't been any push for this for 3 years, so closing for now.

gaborbernat avatar Sep 06 '22 07:09 gaborbernat