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:
- 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?
- can such a file also trigger the "fit view" on loading?
Regards
Bogdan
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
dots/src/scripts/fs-utils.ts
Line 238 in 2361c50
collapse: Trueand only the builtin example file loading sets it toFalsein 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:
collapsed = Falseargument on loading that file?Regards
Bogdan