Merge pull request #31529 from SonilPro/fix-dependency-graph-viewbox

Fix dependency graph viewbox
This commit is contained in:
Ben Lambert
2025-11-18 09:58:43 +01:00
committed by GitHub
4 changed files with 12 additions and 1 deletions
+7
View File
@@ -0,0 +1,7 @@
---
'@backstage/core-components': patch
'@backstage/plugin-catalog-graph': patch
---
- Revert `viewbox` back to old values.
- Added `fullScreen` prop to `EntityCatalogGraphCard`
@@ -533,7 +533,7 @@ export function DependencyGraph<NodeData, EdgeData>(
height={graphHeight}
y={maxHeight / 2 - graphHeight / 2}
x={maxWidth / 2 - graphWidth / 2}
viewBox={`-25 -25 ${graphWidth + 50} ${graphHeight + 50}`}
viewBox={`0 0 ${graphWidth} ${graphHeight}`}
>
{graphEdges.map(e => {
const edge = graph.current.edge(e) as GraphEdge<EdgeData>;
+1
View File
@@ -197,6 +197,7 @@ export type EntityRelationsGraphProps = {
renderEdge?: DependencyGraphTypes.RenderEdgeFunction<EntityEdge>;
curve?: 'curveStepBefore' | 'curveMonotoneX';
showArrowHeads?: boolean;
allowFullscreen?: boolean;
};
// @public
@@ -92,6 +92,7 @@ export type EntityRelationsGraphProps = {
renderEdge?: DependencyGraphTypes.RenderEdgeFunction<EntityEdge>;
curve?: 'curveStepBefore' | 'curveMonotoneX';
showArrowHeads?: boolean;
allowFullscreen?: boolean;
};
/**
@@ -118,6 +119,7 @@ export const EntityRelationsGraph = (props: EntityRelationsGraphProps) => {
renderEdge,
curve,
showArrowHeads,
allowFullscreen,
} = props;
const theme = useTheme();
@@ -169,6 +171,7 @@ export const EntityRelationsGraph = (props: EntityRelationsGraphProps) => {
zoom={zoom}
curve={curve}
showArrowHeads={showArrowHeads}
allowFullscreen={allowFullscreen}
/>
)}
</div>