Skip to content

Visualisation Limitations #530

Open
Open
@zeb33n

Description

@zeb33n

/sig cli

What would you like to be added:

A command to dump the .spdx DAG as a dotlang .dot file for easy visualization with graphviz.

Why is this needed:

The current .spdx visualization command outline is limited by the cli environment the result is rendered in. It is unable to appropriately display the DAG when a node has 2 or more parents. Consider the following example:

SPDXVersion: SPDX-2.2
SPDXID: Document
DocumentName: Document


##### Package: glib

PackageName: glib
SPDXID: glib


##### Package: gnome

PackageName: gnome
SPDXID: gnome

##### Package: python

PackageName: python
SPDXID: python

##### Package: sqlite

PackageName: sqlite
SPDXID: sqlite

Relationship: glib CONTAINS python
Relationship: gnome CONTAINS python
Relationship: python CONTAINS sqlite

This file creates a graph that looks something like this

Image

However when visualized with document outline the output is like this.

               _                               
 ___ _ __   __| |_  __                         
/ __| '_ \ / _` \ \/ /                         
\__ \ |_) | (_| |>  <                          
|___/ .__/ \__,_/_/\_\                         
    |_|                                        

 📂 SPDX Document SPDX                         
  │                                            
  │ 📦 DESCRIBES 2 Packages                    
  │                                            
  ├ glib                                       
  │  │ 🔗 1 Relationships                      
  │  └ CONTAINS PACKAGE python                 
  │  │  │ 🔗 1 Relationships                   
  │  │  └ CONTAINS PACKAGE sqlite              
  │  │                                         
  │                                            
  ├ gnome                                      
  │  │ 🔗 1 Relationships                      
  │  └ CONTAINS PACKAGE python                 
  │                                            
  └ 📄 DESCRIBES 0 Files                       

This is missleading.

  • Python appears twice in the graph even though there is only one package with that name.
  • In the gnome branch of the graph sqlite does not appear despite being a direct descendant of python.

Outputting the graph as a dot file will allow for the use of third party tools such as graph-viz to provide a more accurate visualization. Dot is also used for representing graphs in a variety of other applications. I'm sure other uses of this feature can be found.

Metadata

Metadata

Assignees

Labels

kind/featureCategorizes issue or PR as related to a new feature.sig/cliCategorizes an issue or PR as relevant to SIG CLI.sig/releaseCategorizes an issue or PR as relevant to SIG Release.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions