Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/fix layout bug and missing card #190

Merged
merged 7 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions Project/frontend/src/components/App/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ import {
} from '@mui/material';

import logo from '../../assets/team-logo.png';
import Graph from '../Graph/index_visjs';
import Graph from '../Graph_page/GraphVisualization';
import UploadPage from '../UploadPage';
import LandingPage from '../LandingPage';

import Navbar from '../Navbar/Navbar';
import './index.css';

const theme = createTheme({
Expand All @@ -46,9 +46,7 @@ function App() {
px={2}
py={1}
>
<NavLink to="/">
<img src={logo} alt="Logo" className="logo" />
</NavLink>
<Navbar />
<Typography variant="h6">Graph Masters</Typography>
<NavLink to="/" style={{ textDecoration: 'none' }}>
<Typography variant="h6" sx={{ color: 'white' }}>
Expand Down
127 changes: 0 additions & 127 deletions Project/frontend/src/components/Graph/index.css

This file was deleted.

18 changes: 17 additions & 1 deletion Project/frontend/src/components/Graph/index_visjs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
} from '@mui/material';
import FloatingControlCard from './FloatingControlCard.jsx';
import * as d3 from 'd3';
import PersistentDrawerControls from './PersistentDrawerControls';

type ITopicColourMap = Record<string, string>;

Expand Down Expand Up @@ -146,6 +147,7 @@ const VisGraph: React.FC<{
setIsStabilizing(false);
setStabilizationComplete(true);
isStabilizingRef.current = false;
// network.fit();
});

network.on('stabilized', function () {
Expand All @@ -155,6 +157,7 @@ const VisGraph: React.FC<{
setStabilizationComplete(true);
isStabilizingRef.current = false;
}
network.fit();
});

return () => {
Expand Down Expand Up @@ -584,7 +587,20 @@ const GraphVisualization: React.FC = () => {
<Legend topicColorMap={topicColorMap} />
</Box>
</Stack>
<FloatingControlCard
{/* <FloatingControlCard
layout={layout}
setLayout={setLayout}
physicsOptions={physicsOptions}
handlePhysicsChange={handlePhysicsChange}
restartStabilization={() => setStabilizationComplete(false)}
sx={{
position: 'absolute',
top: '10px',
right: '10px',
zIndex: 1000,
}}
/> */}
<PersistentDrawerControls
layout={layout}
setLayout={setLayout}
physicsOptions={physicsOptions}
Expand Down
19 changes: 19 additions & 0 deletions Project/frontend/src/components/Graph_page/ErrorScreen.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from 'react';
import { Box, Typography } from '@mui/material';

const ErrorScreen: React.FC = () => {
return (
<Box
sx={{
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
height: '100vh',
}}
>
<Typography variant="h6">Sorry, an error has occurred!</Typography>
</Box>
);
};

export default ErrorScreen;
Loading