make graph fill only visiable space on the page

Signed-off-by: Maximilian Vorbrodt <maximilian.vorbrodt@hotmail.com>
This commit is contained in:
Maximilian Vorbrodt
2022-11-14 15:16:35 +01:00
parent 4bc0ed33ca
commit d4368d1f94
2 changed files with 4 additions and 2 deletions
@@ -223,6 +223,7 @@ export function DependencyGraph<NodeData, EdgeData>(
const maxWidth = Math.max(graphWidth, containerWidth);
const maxHeight = Math.max(graphHeight, containerHeight);
const minHeight = Math.min(graphHeight, containerHeight);
const containerRef = React.useMemo(
() =>
@@ -393,7 +394,8 @@ export function DependencyGraph<NodeData, EdgeData>(
<svg
ref={containerRef}
{...svgProps}
width="100%"
width='100%'
height={minHeight}
viewBox={`0 0 ${maxWidth} ${maxHeight}`}
>
<defs>
@@ -44,7 +44,7 @@ import useAsync from 'react-use/lib/useAsync';
const useStyles = makeStyles((theme: BackstageTheme) => ({
graph: {
flex: 1,
minHeight: 0,
minHeight: '100%',
},
graphWrapper: {
position: 'relative',