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

Implement Pipelines page layout #203

Merged
merged 9 commits into from
Dec 1, 2023
32 changes: 32 additions & 0 deletions frontend/components/Banner.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import React from 'react'
import { Grid, Typography } from '@mui/material'
import useStyles from '../styles/pages/banner'
const Banner = () => {
const classes = useStyles()

return (
<Grid className={classes.banner}>
<Grid
container
direction="row"
justifyContent="space-between"
alignItems="flex-start"
className={classes.container}
>
<Grid item xs={12} className={classes.titleWrapper}>
<Typography variant="h1" className={classes.title}>
PZ Server Pipelines
</Typography>
<Typography variant="body1" display="block">
<p>
Pipelines to create customized science-driven PZ-related data
products.
</p>
</Typography>
</Grid>
</Grid>
</Grid>
)
}

export default Banner
44 changes: 44 additions & 0 deletions frontend/components/SpeczCatalogs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import * as React from 'react'
import Box from '@mui/material/Box'
import Card from '@mui/material/Card'
import CardContent from '@mui/material/CardContent'
import CardMedia from '@mui/material/CardMedia'
import Typography from '@mui/material/Typography'
import Link from '../components/Link'
import { useTheme } from '@mui/system'

function SpeczCatalogs() {
const theme = useTheme()

return (
<Link href="/specz_catalogs">
<Card
sx={{
display: 'flex',
backgroundColor:
theme.palette.mode === 'light' ? theme.palette.grey[100] : '',
boxShadow: 4
}}
>
<CardMedia
component="img"
sx={{ width: 350 }}
image="../interfaces/milkyway.jpg"
alt="Spec-z Catalogs"
/>
<Box>
<CardContent m={2} sx={{ maxWidth: 500 }}>
<Typography variant="h5">Combine Spec-z Catalogs</Typography>
<Typography variant="body1" color="text.secondary">
Creates a single spec-z sample from the multiple spatial
cross-matching (all-to-all) of a list of pre-registered individual
Spec-z Catalogs.
</Typography>
</CardContent>
</Box>
</Card>
</Link>
)
}

export default SpeczCatalogs
85 changes: 85 additions & 0 deletions frontend/components/SpeczData.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import { DataGrid } from '@mui/x-data-grid'
import moment from 'moment'
import PropTypes from 'prop-types'

const columns = [
{
field: 'display_name',
headerName: 'Name',
sortable: true,
flex: 1
},
{
field: 'uploaded_by',
headerName: 'Uploaded By',
flex: 1,
sortable: false
},
{
field: 'created_at',
headerName: 'Created at',
sortable: true,
width: 200,
valueFormatter: params => {
if (!params.value) {
return ''
}
return moment(params.value).format('YYYY-MM-DD')
}
}
]

function DataTable({ rows }) {
return (
<div style={{ height: 300, width: '100%' }}>
<DataGrid
rows={rows}
columns={columns}
// getRowId={row => row.id}
pageSizeOptions={[5, 10]}
checkboxSelection
/>
</div>
)
}

DataTable.propTypes = {
rows: PropTypes.arrayOf(PropTypes.object).isRequired
}

const rows = [
{
id: 1,
display_name: 'Jandson 1',
uploaded_by: 'User1',
created_at: '2023-01-01'
},
{
id: 2,
display_name: 'Jandson 2',
uploaded_by: 'User2',
created_at: '2023-02-15'
},
{
id: 3,
display_name: 'Jandson 3',
uploaded_by: 'User3',
created_at: '2023-03-22'
},
{
id: 4,
display_name: 'Jandson V',
uploaded_by: 'User1',
created_at: '2023-04-10'
},
{
id: 5,
display_name: 'Jandson Try',
uploaded_by: 'User2',
created_at: '2023-05-05'
}
]

export default function App() {
return <DataTable rows={rows} />
}
44 changes: 44 additions & 0 deletions frontend/components/TrainingSetMaker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import * as React from 'react'
import Box from '@mui/material/Box'
import Card from '@mui/material/Card'
import CardContent from '@mui/material/CardContent'
import CardMedia from '@mui/material/CardMedia'
import Typography from '@mui/material/Typography'
import Link from '../components/Link'
import { useTheme } from '@mui/system'

function TrainingSetMaker() {
const theme = useTheme()

return (
<Link href="/training_set_maker">
<Card
sx={{
display: 'flex',
flexDirection: 'row-reverse',
backgroundColor:
theme.palette.mode === 'light' ? theme.palette.grey[100] : '',
boxShadow: 4
}}
>
<CardMedia
component="img"
sx={{ width: 350 }}
image="../interfaces/lsst_summit.jpg"
alt="Training Set Maker"
/>
<Box>
<CardContent m={2} sx={{ maxWidth: 500 }}>
<Typography variant="h5">Training Set Maker</Typography>
<Typography variant="body1" color="text.secondary">
Creates a training set from the spatial cross-matching of a given
Spec-z Catalog and the LSST Objects Catalogs.
</Typography>
</CardContent>
</Box>
</Card>
</Link>
)
}

export default TrainingSetMaker
84 changes: 84 additions & 0 deletions frontend/components/TsmData.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
import { DataGrid } from '@mui/x-data-grid'
import moment from 'moment'
import PropTypes from 'prop-types'

const columns = [
{
field: 'display_name',
headerName: 'Name',
sortable: true,
flex: 1
},
{
field: 'uploaded_by',
headerName: 'Uploaded By',
flex: 1,
sortable: false
},
{
field: 'created_at',
headerName: 'Created at',
sortable: true,
width: 200,
valueFormatter: params => {
if (!params.value) {
return ''
}
return moment(params.value).format('YYYY-MM-DD')
}
}
]

function DataTable({ rows }) {
return (
<div style={{ height: 300, width: '100%' }}>
<DataGrid
rows={rows}
columns={columns}
// getRowId={row => row.id}
pageSizeOptions={[5, 10]}
/>
</div>
)
}

DataTable.propTypes = {
rows: PropTypes.arrayOf(PropTypes.object).isRequired
}

const rows = [
{
id: 1,
display_name: 'Jandson 1',
uploaded_by: 'User1',
created_at: '2023-01-01'
},
{
id: 2,
display_name: 'Jandson 2',
uploaded_by: 'User2',
created_at: '2023-02-15'
},
{
id: 3,
display_name: 'Jandson 3',
uploaded_by: 'User3',
created_at: '2023-03-22'
},
{
id: 4,
display_name: 'Jandson V',
uploaded_by: 'User1',
created_at: '2023-04-10'
},
{
id: 5,
display_name: 'Jandson Try',
uploaded_by: 'User2',
created_at: '2023-05-05'
}
]

export default function App() {
return <DataTable rows={rows} />
}
2 changes: 1 addition & 1 deletion frontend/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function Index() {
path: '/pz_pipelines',
background: '/interfaces/gamma-ray-burst.jpg',
description:
'Lorem ipsum dolor sit amet, consectetur adipiscing elit dolor sit amet.'
'Pipelines to create customized science-driven PZ-related data products.'
}
]

Expand Down
34 changes: 24 additions & 10 deletions frontend/pages/pz_pipelines.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,29 @@
import { Typography } from '@mui/material'
import * as React from 'react'
import useStyles from '../styles/pages/pz_pipelines'

export default function PZPipelines() {
const classes = useStyles()
import React from 'react'
import { Grid, Typography } from '@mui/material'
import SpeczCatalogs from '../components/SpeczCatalogs'
import TrainingSetMaker from '../components/TrainingSetMaker'

function PZPipelines() {
return (
<div className={classes.container}>
<Typography variant="h5" className={classes.message}>
Coming Soon...
<Grid container direction="column" alignItems="center">
<Typography
variant="h4"
align="center"
color="textPrimary"
mb={10}
mt={-12}
>
Photo-z Server Pipelines
</Typography>
</div>

<Grid item mb={5}>
<SpeczCatalogs />
</Grid>
<Grid item>
<TrainingSetMaker />
</Grid>
</Grid>
)
}

export default PZPipelines
12 changes: 12 additions & 0 deletions frontend/pages/specz_catalogs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react'
import { Typography } from '@mui/material'

function SpeczCatalogs() {
return (
<div style={{ textAlign: 'center' }}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Como estamos usando material ui, ao inves de criar uma div com style pode usar o Box com sx no final é a mesma coisa, mas vc vai estar usando a sintaxe do material ui
caso precisemos alterar alguma coisa no futuro todos os componentes vão estar uniformes

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I made the suggested changes.
I put 'div' because it is a temporary screen, as I am already developing the main screen. Thank you for the tips.

<Typography variant="h4">Coming soon...</Typography>
</div>
)
}

export default SpeczCatalogs
12 changes: 12 additions & 0 deletions frontend/pages/training_set_maker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react'
import { Typography } from '@mui/material'

function TrainingSetMaker() {
return (
<div style={{ textAlign: 'center' }}>
<Typography variant="h4">Coming soon...</Typography>
</div>
)
}

export default TrainingSetMaker
Binary file added frontend/public/interfaces/banner_lsst_summit.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/public/interfaces/lsst_summit.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/public/interfaces/milkyway.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/public/interfaces/noirlab.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading