Skip to content

Commit aef0110

Browse files
authored
Merge pull request #42 from Local-Connectivity-Lab/issue28
Adding visibility Button #28
2 parents af913de + 2eda983 commit aef0110

File tree

4 files changed

+35
-4
lines changed

4 files changed

+35
-4
lines changed

.env

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
PUBLIC_URL=.
1+
PUBLIC_URL=.
2+
PORT=3002

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@
2121
npm-debug.log*
2222
yarn-debug.log*
2323
yarn-error.log*
24+
.vscode/launch.json

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@
3939
"web-vitals": "^2.1.2"
4040
},
4141
"scripts": {
42-
"start": "PORT=3002 react-scripts start",
42+
"start": "react-scripts start",
4343
"build": "react-scripts build",
4444
"test": "react-scripts test",
4545
"eject": "react-scripts eject",
46-
"format": "prettier --write --config ./prettierrc.json 'src/**/*.{ts,tsx}'",
47-
"format-check": "prettier --check --config ./prettierrc.json 'src/**/*.{ts,tsx}'"
46+
"format": "prettier --write --config ./prettierrc.json src/**/*.{ts,tsx}",
47+
"format-check": "prettier --check --config ./prettierrc.json src/**/*.{ts,tsx}"
4848
},
4949
"eslintConfig": {
5050
"extends": [

src/vis/Vis.tsx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import IconButton from '@mui/material/IconButton';
1414
import Container from '@mui/material/Container';
1515
import MenuIcon from '@mui/icons-material/Menu';
1616
import ChevronLeftIcon from '@mui/icons-material/ChevronLeft';
17+
import Visibility from '@mui/icons-material/Visibility';
1718
import { homeListItems } from '../ListItems';
1819
import MapSelectionRadio, { MapType } from './MapSelectionRadio';
1920
import DisplaySelection from './DisplaySelection';
@@ -25,6 +26,7 @@ import LineChart from './LineChart';
2526
import axios from 'axios';
2627
import { API_URL } from '../utils/config';
2728
import { UNITS, MAP_TYPE_CONVERT } from './MeasurementMap';
29+
import { solveDisplayOptions } from './DisplaySelection';
2830

2931
// import { setOptions } from 'leaflet';
3032

@@ -317,7 +319,9 @@ export default function Vis() {
317319
</Card>
318320
</Fade>
319321
</Box>
322+
320323
<Box
324+
// new box
321325
component='main'
322326
sx={{
323327
backgroundColor: 'transparent',
@@ -331,6 +335,31 @@ export default function Vis() {
331335
: 0),
332336
zIndex: '4',
333337
}}
338+
>
339+
<IconButton
340+
onClick={() => {
341+
setDisplayOptions(
342+
solveDisplayOptions(displayOptions, 'displayGraph', true),
343+
);
344+
}}
345+
>
346+
<Visibility></Visibility>
347+
</IconButton>
348+
</Box>
349+
<Box
350+
component='main'
351+
sx={{
352+
backgroundColor: 'transparent',
353+
overflow: 'none',
354+
position: 'absolute',
355+
right: '8px',
356+
bottom:
357+
20 +
358+
(displayValue(displayOptions, 'displayGraph')
359+
? chartHeight + 10
360+
: +50),
361+
zIndex: '5',
362+
}}
334363
>
335364
<Fade
336365
mountOnEnter

0 commit comments

Comments
 (0)