-
Notifications
You must be signed in to change notification settings - Fork 18
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 #121 from jembi/JMPI-702-implementing-jempi-dashboard
Jmpi 702 implementing jempi dashboard
- Loading branch information
Showing
20 changed files
with
594 additions
and
19 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
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
165 changes: 165 additions & 0 deletions
165
JeMPI_Apps/JeMPI_UI/src/components/dashboard/Dashboard.tsx
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,165 @@ | ||
import { | ||
Box, | ||
Container, | ||
Grid, | ||
Stack, | ||
Tab, | ||
Tabs, | ||
Typography | ||
} from '@mui/material' | ||
import CountWidget from './widgets/CountWidgetWidget' | ||
import { | ||
Layers, | ||
NotificationAdd, | ||
NotificationsOff, | ||
Person | ||
} from '@mui/icons-material' | ||
import { pink } from '@mui/material/colors' | ||
import MandU from './widgets/MandUWidget' | ||
import BetaFscore from './widgets/BetaFscoreWidget' | ||
import ConfusionMatrix from './widgets/ConfusionMatrixWidget' | ||
import { useState } from 'react' | ||
|
||
interface TabPanelProps { | ||
children?: React.ReactNode | ||
index: number | ||
value: number | ||
} | ||
|
||
const CustomTabPanel = (props: TabPanelProps) => { | ||
const { children, value, index, ...other } = props | ||
return ( | ||
<Box | ||
component={'div'} | ||
role="tabpanel" | ||
hidden={value !== index} | ||
id={`dashboard-tabpanel-${index}`} | ||
aria-labelledby={`dashboard-tab-${index}`} | ||
{...other} | ||
> | ||
{value === index && children} | ||
</Box> | ||
) | ||
} | ||
|
||
const tabProps = (index: number) => { | ||
return { | ||
id: `dashboard-tab-${index}`, | ||
'aria-controls': `dashboard-tabpanel-${index}` | ||
} | ||
} | ||
|
||
const Dashboard = () => { | ||
const [currentTabIndex, setCurrentTabIndex] = useState(0) | ||
const handleChangeTab = (event: React.SyntheticEvent, newValue: number) => { | ||
setCurrentTabIndex(newValue) | ||
} | ||
return ( | ||
<Container maxWidth={false}> | ||
<Stack | ||
padding={{ | ||
lg: '0rem 1rem 1rem 1rem', | ||
xs: '1rem 0rem 0rem 0rem', | ||
backgroundColor: '#fff', | ||
borderRadius: '1rem' | ||
}} | ||
> | ||
<Tabs | ||
value={currentTabIndex} | ||
onChange={handleChangeTab} | ||
sx={{ | ||
paddingY: { lg: '2rem', xs: ' 0.5rem' } | ||
}} | ||
aria-label="dashboard tabs" | ||
variant="scrollable" | ||
scrollButtons | ||
allowScrollButtonsMobile | ||
> | ||
<Tab | ||
label={<Typography variant="h5">Confusion Matrix</Typography>} | ||
{...tabProps(0)} | ||
/> | ||
<Tab | ||
label={<Typography variant="h5">M & U Values</Typography>} | ||
{...tabProps(1)} | ||
/> | ||
</Tabs> | ||
<CustomTabPanel value={currentTabIndex} index={0}> | ||
<Grid container spacing={{ xs: 2, md: 5 }}> | ||
<Grid item xs={12} lg={6}> | ||
<Grid container spacing={2}> | ||
<Grid item xs={12}> | ||
<Box component="fieldset"> | ||
<legend>Records</legend> | ||
<Grid container spacing={2}> | ||
<Grid item xs={12} lg={6}> | ||
<CountWidget | ||
label="Golden Record" | ||
value={10000} | ||
icon={<Person sx={{ fontSize: '3.5rem' }} />} | ||
iconBackgroundColor={'#FFD700'} | ||
/> | ||
</Grid> | ||
<Grid item xs={12} lg={6}> | ||
<CountWidget | ||
label="Interactions " | ||
value={20000} | ||
icon={<Layers sx={{ fontSize: '3.5rem' }} />} | ||
iconBackgroundColor={'primary.main'} | ||
/> | ||
</Grid> | ||
</Grid> | ||
</Box> | ||
</Grid> | ||
|
||
<Grid item xs={12}> | ||
<Box component="fieldset"> | ||
<legend> Notifications </legend> | ||
<Grid container spacing={2}> | ||
<Grid item xs={12} lg={6}> | ||
<CountWidget | ||
label="New/Open" | ||
value={10000} | ||
icon={<NotificationAdd sx={{ fontSize: '3.5rem' }} />} | ||
iconBackgroundColor={'#76ff03'} | ||
/> | ||
</Grid> | ||
<Grid item xs={12} lg={6}> | ||
<CountWidget | ||
label="Closed" | ||
value={20000} | ||
icon={ | ||
<NotificationsOff sx={{ fontSize: '3.5rem' }} /> | ||
} | ||
iconBackgroundColor={pink[600]} | ||
/> | ||
</Grid> | ||
</Grid> | ||
</Box> | ||
</Grid> | ||
<Grid item xs={12}> | ||
<BetaFscore /> | ||
</Grid> | ||
</Grid> | ||
</Grid> | ||
<Grid item xs={12} lg={6}> | ||
<Box component="fieldset" minHeight={'550px'}> | ||
<legend>Confusion Matrix</legend> | ||
<ConfusionMatrix /> | ||
</Box> | ||
</Grid> | ||
</Grid> | ||
</CustomTabPanel> | ||
<CustomTabPanel value={currentTabIndex} index={1}> | ||
<Grid container sx={{ minHeight: { lg: '450px' } }}> | ||
<Grid item xs={6}> | ||
<MandU /> | ||
</Grid> | ||
</Grid> | ||
</CustomTabPanel> | ||
</Stack> | ||
</Container> | ||
) | ||
} | ||
|
||
export default Dashboard |
31 changes: 31 additions & 0 deletions
31
JeMPI_Apps/JeMPI_UI/src/components/dashboard/widgets/BetaFscoreWidget.tsx
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,31 @@ | ||
import { Box, Grid } from '@mui/material' | ||
import CountWidget from './CountWidgetWidget' | ||
|
||
function BetaFscoreWidget() { | ||
return ( | ||
<Box component={'fieldset'}> | ||
<legend>Beta F-scores</legend> | ||
<Grid container spacing={2} columns={16}> | ||
<Grid item lg={6} xs={16}> | ||
<CountWidget | ||
label="Weighs precision higher than recall" | ||
value={75} | ||
secondValue={75} | ||
/> | ||
</Grid> | ||
<Grid item lg={4} xs={16}> | ||
<CountWidget label="Neutral" value={75} secondValue={75} /> | ||
</Grid> | ||
<Grid item lg={6} xs={16}> | ||
<CountWidget | ||
label="Weighs recall higher than precision" | ||
value={75} | ||
secondValue={75} | ||
/> | ||
</Grid> | ||
</Grid> | ||
</Box> | ||
) | ||
} | ||
|
||
export default BetaFscoreWidget |
Oops, something went wrong.