app-visualizer: horizontal tree vis + layout fix

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2025-11-04 00:15:03 +01:00
parent 9f939a6a4c
commit e81b3f0fa2
2 changed files with 13 additions and 4 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-app-visualizer': patch
---
Improve tree visualizer to use a horizontal layout and fill the content space.
@@ -153,18 +153,22 @@ export function TreeVisualizer({ tree }: { tree: AppTree }) {
const graphData = useMemo(() => resolveGraphData(tree), [tree]);
return (
<Box height="100%" flex="1 1 100%" flexDirection="column" overflow="hidden">
<Box
flex="1 1 0"
display="flex"
justifyContent="stretch"
alignItems="stretch"
overflow="hidden"
>
<DependencyGraph
fit="contain"
style={{ height: '100%', width: '100%' }}
{...graphData}
nodeMargin={10}
rankMargin={50}
paddingX={50}
renderNode={Node}
align={DependencyGraphTypes.Alignment.DOWN_RIGHT}
ranker={DependencyGraphTypes.Ranker.TIGHT_TREE}
direction={DependencyGraphTypes.Direction.TOP_BOTTOM}
direction={DependencyGraphTypes.Direction.LEFT_RIGHT}
/>
</Box>
);