forked from intrig-unicamp/paths-viewer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from williamquintas/development
v1.0.0
- Loading branch information
Showing
39 changed files
with
9,820 additions
and
28,042 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
REACT_APP_GOOGLE_API_KEY = "string" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { Box } from "@mui/material"; | ||
import { FunctionComponent, useState } from "react"; | ||
import { Navigate, Route, Routes } from "react-router-dom"; | ||
import FilesSelectionPage from "../../pages/FilesSelection/FilesSelection"; | ||
import MapViewerPage from "../../pages/MapViewer/MapViewer"; | ||
import Footer from "../Footer/Footer"; | ||
import Header from "../Header/Header"; | ||
|
||
export interface ICoordinatesData { | ||
date?: string; | ||
time?: string; | ||
id?: string; | ||
line?: string; | ||
latitude?: string; | ||
longitude?: string; | ||
speed?: string; | ||
} | ||
export interface IFile { | ||
filename: string; | ||
color: string; | ||
data?: ICoordinatesData[]; | ||
} | ||
|
||
const App: FunctionComponent = () => { | ||
const [files, setFiles] = useState<IFile[]>([]); | ||
|
||
return ( | ||
<Box | ||
sx={{ | ||
display: "flex", | ||
flexDirection: "column", | ||
minHeight: "100vh", | ||
}} | ||
> | ||
<Header /> | ||
<Routes> | ||
<Route | ||
path="/" | ||
element={<FilesSelectionPage files={files} setFiles={setFiles} />} | ||
/> | ||
<Route path="/map" element={<MapViewerPage files={files} />} /> | ||
<Route path="*" element={<Navigate to="/" />} /> | ||
</Routes> | ||
<Footer /> | ||
</Box> | ||
); | ||
}; | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.color-picker { | ||
margin-left: 8px; | ||
} | ||
|
||
.color-picker div { | ||
display: flex !important; | ||
} | ||
|
||
label#color-picker-label { | ||
padding-left: 10px; | ||
} | ||
|
||
.color-circle { | ||
width: 12px; | ||
height: 12px; | ||
border-radius: 6px; | ||
margin-right: 8px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import { | ||
FormControl, | ||
InputLabel, | ||
MenuItem, | ||
Select, | ||
SelectChangeEvent, | ||
} from "@mui/material"; | ||
import { FunctionComponent } from "react"; | ||
import "./ColorPicker.css"; | ||
|
||
export const Colors = { | ||
Gray: "#212529", | ||
Red: "#c92a2a", | ||
Pink: "#a61e4d", | ||
Grape: "#862e9c", | ||
Violet: "#5f3dc4", | ||
Indigo: "#364fc7", | ||
Blue: "#1864ab", | ||
Cyan: "#0b7285", | ||
Teal: "#087f5b", | ||
Green: "#2b8a3e", | ||
Lime: "#5c940d", | ||
Yellow: "#e67700", | ||
Orange: "#d9480f", | ||
}; | ||
|
||
interface ColorPickerProps { | ||
selectedColor: string; | ||
onChangeColor: (evt: SelectChangeEvent) => void; | ||
} | ||
|
||
const ColorPicker: FunctionComponent<ColorPickerProps> = ({ | ||
selectedColor, | ||
onChangeColor, | ||
}) => { | ||
return ( | ||
<FormControl sx={{ m: 1, minWidth: 120 }}> | ||
<InputLabel id="color-picker-label">Color</InputLabel> | ||
<Select | ||
size="small" | ||
labelId="color-picker-label" | ||
className="color-picker" | ||
label="Color" | ||
value={selectedColor} | ||
onChange={onChangeColor} | ||
> | ||
{Object.keys(Colors).map((color) => ( | ||
<MenuItem | ||
key={color} | ||
value={Colors[color]} | ||
sx={{ | ||
color: Colors[color], | ||
}} | ||
> | ||
<div | ||
className="color-circle" | ||
style={{ | ||
backgroundColor: Colors[color], | ||
}} | ||
></div> | ||
{color} | ||
</MenuItem> | ||
))} | ||
</Select> | ||
</FormControl> | ||
); | ||
}; | ||
export default ColorPicker; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { Circle, ExpandLess, ExpandMore } from "@mui/icons-material"; | ||
import { | ||
Collapse, | ||
Container, | ||
List, | ||
ListItemButton, | ||
ListItemIcon, | ||
ListItemText, | ||
} from "@mui/material"; | ||
import { Fragment, FunctionComponent, useState } from "react"; | ||
import { IFile } from "../App/App"; | ||
|
||
interface CoordinatesListProps { | ||
file: IFile; | ||
} | ||
const CoordinatesList: FunctionComponent<CoordinatesListProps> = ({ file }) => { | ||
const [open, setOpen] = useState<boolean>(false); | ||
const { filename, data, color } = file; | ||
|
||
return ( | ||
<Fragment> | ||
<ListItemButton | ||
onClick={() => { | ||
setOpen(!open); | ||
}} | ||
sx={{ backgroundColor: "#f1f3f5" }} | ||
> | ||
<ListItemIcon sx={{ minWidth: 0, mr: 2, color }}> | ||
<Circle fontSize="small" /> | ||
</ListItemIcon> | ||
<ListItemText primary={filename} /> | ||
{open ? <ExpandLess /> : <ExpandMore />} | ||
</ListItemButton> | ||
<Collapse in={open} timeout="auto" unmountOnExit> | ||
<Container sx={{ maxHeight: 200, overflow: "auto" }}> | ||
<List component="div" disablePadding> | ||
{data?.map((row, index) => ( | ||
<ListItemText | ||
key={`coordinate-${index}`} | ||
primary={`${row.latitude}, ${row.longitude}`} | ||
/> | ||
))} | ||
</List> | ||
</Container> | ||
</Collapse> | ||
</Fragment> | ||
); | ||
}; | ||
|
||
export default CoordinatesList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
input { | ||
display: none; | ||
} |
Oops, something went wrong.