Skip to content

Commit

Permalink
Frontend - 3D View, Data view and bugs (#392)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas-Nan authored Jul 13, 2024
2 parents 3d29d11 + 4b6dae1 commit 0ea60a5
Show file tree
Hide file tree
Showing 23 changed files with 833 additions and 460 deletions.
72 changes: 71 additions & 1 deletion frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,17 @@
"proj4leaflet": "^1.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-leaflet": "^4.2.1"
"react-leaflet": "^4.2.1",
"three": "^0.166.1",
"uuid": "^10.0.0"
},
"devDependencies": {
"@types/leaflet": "^1.9.12",
"@types/node": "^20.12.12",
"@types/react": "^18.2.66",
"@types/react-dom": "^18.2.22",
"@types/three": "^0.166.0",
"@types/uuid": "^10.0.0",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"@vitejs/plugin-react": "^4.2.1",
Expand Down
44 changes: 21 additions & 23 deletions frontend/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
position: fixed;
top: 0;
left: 0;
width: 100%;
width: 100%;
height: 100%;
overflow: hidden;
}
Expand All @@ -12,30 +12,35 @@
overflow: hidden;
height: 100%;
position: relative;
padding: 0.6rem;
}

.multi-map {
position: relative;
width: 50%;
transition: width 0.5s;
padding-top: 10px;
padding-left: 0px;
padding-bottom: 10px;
transition: width 0.5s;
}

.multimap-container {
height: 100%;
width: 100%;
max-width: 100%;
display: flex;
flex-direction: column;
padding-right: 10px;
position: relative;
}

.data-view {
width: 50%;
position: relative;
transition: width 0.5s;
transition: width 0.5s;
overflow: hidden;
box-sizing: border-box;
padding-top: 10px;
padding-bottom: 10px;
padding-right:10px;
}

.hidden {
width: 0;
width: 0;
overflow: hidden;
padding: 0px;
}
Expand All @@ -44,21 +49,14 @@
width: 100%;
}

.multimap-container {
display: flex;
flex-direction: column;
position: relative;
height: 100%;
}

.toggle-button {
.toggle-data-view-button {
position: absolute;
z-index: 5;
top: 13px;
right: 0px;
align-self: end;
top: 7px;
right: 0px;
align-self: end;
padding: 0;
padding-top:3px;
padding-top: 3px;
align-items: center;
justify-content: center;
min-width: 2rem;
Expand All @@ -82,4 +80,4 @@
.toggle-button:focus {
color: black;
border-color: black;
}
}
33 changes: 20 additions & 13 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@ import { TabsContext } from "./contexts/TabsContext";
import MainMenu from "./components/MainMenu/MainMenu";
import ErrorAlert from "./components/Alerts/ErrorAlert";

import Tooltip from '@mui/material/Tooltip';
import Tooltip from "@mui/material/Tooltip";
import { CaretDoubleLeft, CaretDoubleRight } from "@phosphor-icons/react";

import { MapContext } from "./contexts/MapContext";

function App() {

const { currentMapCache } = useContext(MapContext);

const { currentTabsCache } = useContext(TabsContext);
Expand All @@ -27,7 +26,9 @@ function App() {
const toggleDataView = () => {
setDataViewVisible((prevVisible) => !prevVisible);
const { mapInstance } = currentMapCache;
setTimeout(function(){ mapInstance?.invalidateSize()}, 400);
setTimeout(function () {
mapInstance?.invalidateSize();
}, 400);
};

return (
Expand All @@ -37,24 +38,30 @@ function App() {
) : (
<Fragment>
<div className="content-container">
<div className={`multi-map ${!dataViewVisible ? "full-width" : ""}`}>
<div className="multimap-container">

<Tooltip title={dataViewVisible ? "Hide Data View" : "Show Data View"} arrow>
<button onClick={toggleDataView} className="toggle-button">
<div
className={`multi-map ${!dataViewVisible ? "full-width" : ""}`}
>
<div className="multimap-container">
<Tooltip
title={dataViewVisible ? "Hide Data View" : "Show Data View"}
arrow
>
<button
onClick={toggleDataView}
className="toggle-data-view-button"
>
{dataViewVisible ? (
<CaretDoubleRight/>
<CaretDoubleRight />
) : (
<CaretDoubleLeft />
)}
</button>
</Tooltip>

<MultiMap />
</div>
<MultiMap />
</div>
</div>
<div className={`data-view ${!dataViewVisible ? "hidden" : ""}`}>
<DataView />
<DataView />
</div>
</div>
</Fragment>
Expand Down
58 changes: 0 additions & 58 deletions frontend/src/components/DataView/DataPanel.css

This file was deleted.

Loading

0 comments on commit 0ea60a5

Please sign in to comment.