make graph fill only visiable space on the page
Signed-off-by: Maximilian Vorbrodt <maximilian.vorbrodt@hotmail.com>
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user