Skip to content

Enable expansion and view fit of nodes when uploading SBOM #3

Description

@bmihaila-bd

Hi

The SBOM viewer is a very nice tool to demo and debug generated SBOMs. As there is no auto-layout of nodes we have gone so far as to understand that you allow for saving the positions in a "dots": {...} entry inside the original SBOM file on saving and upon loading the viewer will use those. To skip manual layouting each time for a new SBOM we have implemented an external layout algorithm that populates those coordinates into the SBOM before uploading them to the viewer. It seems though that the viewer does not expand the nodes by default and neither it does fit the view. Those two things happen for the "load example sbom" button from the UI.
The viewer code shows that this function

export async function importSpdxJsonLd(
is set default to collapse: True and only the builtin example file loading sets it to False in https://github.com/condots/dots/blob/main/src/scripts/app-utils.ts#L266 .

The above means that even though we have added layout coordinates to the SBOM file we upload via "dots: {...}", the graph still only shows all node on top of each other on load till the node is double clicked. Furthermore due to the missing "fit view" the stacked nodes land somewhere outside the visible viewport on load and need to be searched manually or recentered by clicking the "fit view" button.

Note that this is not a duplicate of #2 as we are providing a layout in the file.

The asks are hence:

  1. can the code be changed to check for the "dots: {}" coordinates in an SBOM file and then automatically set the collapsed = False argument on loading that file?
  2. can such a file also trigger the "fit view" on loading?

Regards
Bogdan

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions