-
Notifications
You must be signed in to change notification settings - Fork 9
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
TPI Frontend #3862
Merged
Merged
TPI Frontend #3862
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
06be346
TPI status work
dgboss 491f327
Mockup changes
dgboss 5be177b
TPI HFI infographic
dgboss fd5eee0
Remove message
dgboss 46555c0
Minor fixes
dgboss 5bacf07
Fix unit test
dgboss ab9d851
Whitespace
dgboss d7a6965
Remove unused imports
dgboss 81844f4
Temp bump nats consumer mem
dgboss f36cb61
Reduce nats mem to 2GB
dgboss 4e651ee
Fire Center Advisory Report (#3850)
brettedw 7eac11e
Update renovatebot/github-action action to v40.2.6 (#3859)
renovate[bot] 1344dc4
Update .gitignore and env example keys (#3856)
conbrad cf50337
ASA Radio Buttons (#3861)
brettedw 6a27e6b
TPI HFI infographic
dgboss 5797062
Fire Center Advisory Report (#3850)
brettedw bb1b3de
TPI HFI infographic
dgboss bbf19e9
Fire Center Advisory Report (#3850)
brettedw f306c46
Fix bad merge
conbrad 518bb41
Merge branch 'main' into task/tpi-front-end/2190B
conbrad 82cbb29
Remove duplication
conbrad af7bc88
Sync up with backend changes
conbrad 5ed6210
Sync up with backend 2
conbrad d2b2de6
Simplify response type
conbrad 618ca60
Bump nats deploy resources for jobs
conbrad b920342
Fix db lookup
conbrad 12641d2
Add back fuel type summary, add tests
conbrad c013a41
More tests
conbrad d328405
Just use width
conbrad File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 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 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 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 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 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 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,39 @@ | ||
import React from 'react' | ||
import { Box, Grid, Typography } from '@mui/material' | ||
|
||
const FLAG_COLOUR = '#CCCCCC' | ||
|
||
interface ElevationFlagProps { | ||
testId?: string | ||
percent: number | ||
} | ||
|
||
const ElevationFlag = ({ percent, testId }: ElevationFlagProps) => { | ||
return ( | ||
<Grid item sx={{ display: 'flex', alignItems: 'center', flexGrow: 1, justifyContent: 'flex-start' }} xs={12}> | ||
<Box | ||
sx={{ | ||
backgroundColor: FLAG_COLOUR, | ||
clipPath: 'polygon(0 50%, 10% 0, 100% 0, 100% 100%, 10% 100%)', | ||
height: '32px', | ||
padding: '1px', | ||
width: '65%' | ||
}}> | ||
<Box | ||
sx={{ | ||
alignItems: 'center', | ||
backgroundImage: `linear-gradient(to right, ${FLAG_COLOUR} ${percent}%, #FFFFFFFF ${percent}%)`, | ||
clipPath: 'polygon(0 50%, 10% 0, 100% 0, 100% 100%, 10% 100%)', | ||
display: 'flex', | ||
height: '30px', | ||
justifyContent: 'center', | ||
}} | ||
> | ||
<Typography sx={{ fontSize: '0.75em' }} data-testid={testId}>{percent}%</Typography> | ||
</Box> | ||
</Box> | ||
</Grid> | ||
) | ||
} | ||
|
||
export default React.memo(ElevationFlag) |
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,16 @@ | ||
import React from 'react' | ||
import { Grid, Typography } from '@mui/material' | ||
|
||
interface ElevationLabelProps { | ||
label: string | ||
} | ||
|
||
const ElevationLabel = ({ label }: ElevationLabelProps) => { | ||
return ( | ||
<Grid item sx={{ alignItems: 'center', display: 'flex', height: '25%', justifyContent: 'flex-end' }} xs={12}> | ||
<Typography sx={{ fontSize: '0.75em' }}>{label}</Typography> | ||
</Grid> | ||
) | ||
} | ||
|
||
export default React.memo(ElevationLabel) |
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,71 @@ | ||
import React from 'react' | ||
import { useTheme } from '@mui/material/styles' | ||
import Grid from '@mui/material/Unstable_Grid2' | ||
import Typography from '@mui/material/Typography' | ||
import ElevationFlag from 'features/fba/components/viz/ElevationFlag' | ||
import ElevationLabel from 'features/fba/components/viz/ElevationLabel' | ||
import TPIMountain from 'features/fba/components/viz/TPIMountain' | ||
import { Box } from '@mui/material' | ||
|
||
enum ElevationOption { | ||
BOTTOM = 'Valley Bottom', | ||
MID = 'Mid Slope', | ||
Upper = 'Upper Slope' | ||
} | ||
|
||
interface ElevationStatusProps { | ||
bottom: number | ||
mid: number | ||
upper: number | ||
} | ||
|
||
const ElevationStatus = ({ bottom, mid, upper }: ElevationStatusProps) => { | ||
const theme = useTheme() | ||
return ( | ||
<Box sx={{ paddingBottom: theme.spacing(2), paddingTop: theme.spacing(2) }} data-testid="elevation-status"> | ||
<Grid container sx={{ minHeight: theme.spacing(19) }} xs={12}> | ||
<Grid container sx={{ paddingRight: theme.spacing(2) }} xs={4}> | ||
<Grid sx={{ alignItems: 'center', display: 'flex', height: '25%', justifyContent: 'flex-end' }} xs={12}> | ||
<Typography | ||
sx={{ | ||
fontSize: '0.75em', | ||
textAlign: 'right', | ||
fontWeight: 'bold', | ||
maxWidth: '75%' | ||
}} | ||
> | ||
Topographic Position: | ||
</Typography> | ||
</Grid> | ||
<ElevationLabel label={ElevationOption.Upper} /> | ||
<ElevationLabel label={ElevationOption.MID} /> | ||
<ElevationLabel label={ElevationOption.BOTTOM} /> | ||
</Grid> | ||
<Grid container sx={{ alignItems: 'flex-end', display: 'flex' }} xs={4} data-testid='tpi-mountain'> | ||
<Grid sx={{ display: 'flex', alignItems: 'flex-end', height: '80%', justifyContent: 'center' }} xs={12}> | ||
<TPIMountain /> | ||
</Grid> | ||
</Grid> | ||
<Grid container sx={{ paddingLeft: theme.spacing(2) }} xs={4}> | ||
<Grid sx={{ alignItems: 'center', display: 'flex', height: '25%', justifyContent: 'flex-start' }} xs={12}> | ||
<Typography | ||
sx={{ | ||
fontSize: '0.75em', | ||
textAlign: 'left', | ||
fontWeight: 'bold', | ||
maxWidth: '75%' | ||
}} | ||
> | ||
Proportion of Advisory Area: | ||
</Typography> | ||
</Grid> | ||
<ElevationFlag percent={upper} testId='upper-slope' /> | ||
<ElevationFlag percent={mid} testId='mid-slope' /> | ||
<ElevationFlag percent={bottom} testId='valley-bottom' /> | ||
</Grid> | ||
</Grid> | ||
</Box> | ||
) | ||
} | ||
|
||
export default ElevationStatus |
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is pixel_size needed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it's expected to compute the area in the TPI endpoint