aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/frontend/src/graph
diff options
context:
space:
mode:
Diffstat (limited to 'subprojects/frontend/src/graph')
-rw-r--r--subprojects/frontend/src/graph/GraphArea.tsx12
-rw-r--r--subprojects/frontend/src/graph/GraphPane.tsx10
2 files changed, 10 insertions, 12 deletions
diff --git a/subprojects/frontend/src/graph/GraphArea.tsx b/subprojects/frontend/src/graph/GraphArea.tsx
index f8f40d22..d5801b9a 100644
--- a/subprojects/frontend/src/graph/GraphArea.tsx
+++ b/subprojects/frontend/src/graph/GraphArea.tsx
@@ -9,25 +9,17 @@ import { useTheme } from '@mui/material/styles';
9import { observer } from 'mobx-react-lite'; 9import { observer } from 'mobx-react-lite';
10import { useResizeDetector } from 'react-resize-detector'; 10import { useResizeDetector } from 'react-resize-detector';
11 11
12import Loading from '../Loading';
13import { useRootStore } from '../RootStoreProvider';
14
15import DotGraphVisualizer from './DotGraphVisualizer'; 12import DotGraphVisualizer from './DotGraphVisualizer';
13import type GraphStore from './GraphStore';
16import VisibilityPanel from './VisibilityPanel'; 14import VisibilityPanel from './VisibilityPanel';
17import ZoomCanvas from './ZoomCanvas'; 15import ZoomCanvas from './ZoomCanvas';
18 16
19function GraphArea(): JSX.Element { 17function GraphArea({ graph }: { graph: GraphStore }): JSX.Element {
20 const { editorStore } = useRootStore();
21 const { breakpoints } = useTheme(); 18 const { breakpoints } = useTheme();
22 const { ref, width, height } = useResizeDetector({ 19 const { ref, width, height } = useResizeDetector({
23 refreshMode: 'debounce', 20 refreshMode: 'debounce',
24 }); 21 });
25 22
26 if (editorStore === undefined) {
27 return <Loading />;
28 }
29
30 const { graph } = editorStore;
31 const breakpoint = breakpoints.values.sm; 23 const breakpoint = breakpoints.values.sm;
32 const dialog = 24 const dialog =
33 width === undefined || 25 width === undefined ||
diff --git a/subprojects/frontend/src/graph/GraphPane.tsx b/subprojects/frontend/src/graph/GraphPane.tsx
index c2ef8927..67dbfcbd 100644
--- a/subprojects/frontend/src/graph/GraphPane.tsx
+++ b/subprojects/frontend/src/graph/GraphPane.tsx
@@ -9,9 +9,15 @@ import { Suspense, lazy } from 'react';
9 9
10import Loading from '../Loading'; 10import Loading from '../Loading';
11 11
12import type GraphStore from './GraphStore';
13
12const GraphArea = lazy(() => import('./GraphArea')); 14const GraphArea = lazy(() => import('./GraphArea'));
13 15
14export default function GraphPane(): JSX.Element { 16export default function GraphPane({
17 graph,
18}: {
19 graph: GraphStore;
20}): JSX.Element {
15 return ( 21 return (
16 <Stack 22 <Stack
17 direction="column" 23 direction="column"
@@ -21,7 +27,7 @@ export default function GraphPane(): JSX.Element {
21 justifyContent="center" 27 justifyContent="center"
22 > 28 >
23 <Suspense fallback={<Loading />}> 29 <Suspense fallback={<Loading />}>
24 <GraphArea /> 30 <GraphArea graph={graph} />
25 </Suspense> 31 </Suspense>
26 </Stack> 32 </Stack>
27 ); 33 );