From 1c7e1cefeca352765dba6b772c6b45a20440b8c2 Mon Sep 17 00:00:00 2001 From: Antonio Ereiz Date: Mon, 27 Oct 2025 19:14:19 +0100 Subject: [PATCH] revert viewBox back on DependencyGraph and add allowFullscreen prop to EntityRelationsGraph Signed-off-by: Antonio Ereiz --- .changeset/real-trains-visit.md | 6 ++++++ .../src/components/DependencyGraph/DependencyGraph.tsx | 2 +- plugins/catalog-graph/report.api.md | 1 + .../EntityRelationsGraph/EntityRelationsGraph.tsx | 3 +++ 4 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 .changeset/real-trains-visit.md diff --git a/.changeset/real-trains-visit.md b/.changeset/real-trains-visit.md new file mode 100644 index 0000000000..ea62189631 --- /dev/null +++ b/.changeset/real-trains-visit.md @@ -0,0 +1,6 @@ +--- +'@backstage/core-components': patch +'@backstage/plugin-catalog-graph': patch +--- + +Reverted back viewbox to old values. Also, added fullScreen prop to EntityCatalogGraphCard diff --git a/packages/core-components/src/components/DependencyGraph/DependencyGraph.tsx b/packages/core-components/src/components/DependencyGraph/DependencyGraph.tsx index 4b99402c3a..db22a2951b 100644 --- a/packages/core-components/src/components/DependencyGraph/DependencyGraph.tsx +++ b/packages/core-components/src/components/DependencyGraph/DependencyGraph.tsx @@ -533,7 +533,7 @@ export function DependencyGraph( 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; diff --git a/plugins/catalog-graph/report.api.md b/plugins/catalog-graph/report.api.md index b7621d05ef..23c131659a 100644 --- a/plugins/catalog-graph/report.api.md +++ b/plugins/catalog-graph/report.api.md @@ -182,6 +182,7 @@ export type EntityRelationsGraphProps = { renderEdge?: DependencyGraphTypes.RenderEdgeFunction; curve?: 'curveStepBefore' | 'curveMonotoneX'; showArrowHeads?: boolean; + allowFullscreen?: boolean; }; // @public diff --git a/plugins/catalog-graph/src/components/EntityRelationsGraph/EntityRelationsGraph.tsx b/plugins/catalog-graph/src/components/EntityRelationsGraph/EntityRelationsGraph.tsx index e71f928c15..b1443e8292 100644 --- a/plugins/catalog-graph/src/components/EntityRelationsGraph/EntityRelationsGraph.tsx +++ b/plugins/catalog-graph/src/components/EntityRelationsGraph/EntityRelationsGraph.tsx @@ -92,6 +92,7 @@ export type EntityRelationsGraphProps = { renderEdge?: DependencyGraphTypes.RenderEdgeFunction; 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} /> )}