Skip to content
Snippets Groups Projects
Commit 5f2469d9 authored by Saket Agrahari's avatar Saket Agrahari
Browse files

COMP-201: Funding Source UI

parent fa0a57d4
No related branches found
No related tags found
1 merge request!33COMP-201: Funding Source UI
This diff is collapsed.
...@@ -11,12 +11,13 @@ import PolicySidebar from "./PolicySidebar"; ...@@ -11,12 +11,13 @@ import PolicySidebar from "./PolicySidebar";
interface inputProps { interface inputProps {
title: string, title: string,
description?: string,
filter: ReactElement, filter: ReactElement,
children: ReactElement, children: ReactElement,
category: Sections category: Sections
} }
function DataPage({ title, filter, children, category }: inputProps): ReactElement { function DataPage({ title,description, filter, children, category }: inputProps): ReactElement {
return ( return (
<> <>
{category === Sections.Organisation && <OrganizationSidebar />} {category === Sections.Organisation && <OrganizationSidebar />}
...@@ -33,6 +34,9 @@ function DataPage({ title, filter, children, category }: inputProps): ReactEleme ...@@ -33,6 +34,9 @@ function DataPage({ title, filter, children, category }: inputProps): ReactEleme
<Row> <Row>
<h3 className="m-4">{title}</h3> <h3 className="m-4">{title}</h3>
</Row> </Row>
<Row>
<p className="p-md-4">{description}</p>
</Row>
<Row> <Row>
{filter} {filter}
</Row> </Row>
......
@import 'scss/fonts'; @import 'scss/fonts';
@import 'scss/base/text'; @import 'scss/base/text';
@import 'scss/layout/components'; @import 'scss/layout/components';
@import 'scss/pages/FundingSources';
.external-page-nav-bar { .external-page-nav-bar {
background-color: #003753; background-color: #003753;
......
...@@ -8,7 +8,6 @@ import { createFundingSourceDataset, getYearsAndNrens, loadDataWithFilterSelecti ...@@ -8,7 +8,6 @@ import { createFundingSourceDataset, getYearsAndNrens, loadDataWithFilterSelecti
import DataPage from '../components/DataPage'; import DataPage from '../components/DataPage';
import Filter from "../components/graphing/Filter" import Filter from "../components/graphing/Filter"
import { Sections } from '../helpers/constants'; import { Sections } from '../helpers/constants';
import ColorPill from '../components/ColorPill';
import ColorBadge from '../components/ColorBadge'; import ColorBadge from '../components/ColorBadge';
ChartJS.defaults.font.size = 16; ChartJS.defaults.font.size = 16;
...@@ -100,6 +99,32 @@ export const chartOptions = { ...@@ -100,6 +99,32 @@ export const chartOptions = {
indexAxis: "y" as const indexAxis: "y" as const
}; };
function FundingSourceLegend() {
return (
<Container className="border rounded-3 border-1 funding-chart-Legend">
<Row fluid className="justify-content-center "
style={{paddingLeft:'7vw'}}>
<Col className="d-flex align-items-center">
<ColorBadge key={0} index={0}/>
<span className='bold-14pt'>Client Institutions</span></Col>
<Col className="d-flex align-items-center" >
<ColorBadge key={1} index={1}/>
<span className='bold-14pt'>Commercial</span></Col>
<Col className="d-flex align-items-center" >
<ColorBadge key={2} index={2}/>
<span className='bold-14pt'>European Funding</span></Col>
<Col className="d-flex align-items-center" >
<ColorBadge key={3} index={3}/>
<span className='bold-14pt'>Gov/Public Bodies</span></Col>
<Col className="d-flex align-items-center" >
<ColorBadge key={4} index={4}/>
<span className='bold-14pt'>Other</span></Col>
</Row>
</Container>
);
}
interface inputProps { interface inputProps {
filterSelection: FilterSelection filterSelection: FilterSelection
setFilterSelection: React.Dispatch<React.SetStateAction<FilterSelection>> setFilterSelection: React.Dispatch<React.SetStateAction<FilterSelection>>
...@@ -145,35 +170,20 @@ function FundingSourcePage({ filterSelection, setFilterSelection }: inputProps) ...@@ -145,35 +170,20 @@ function FundingSourcePage({ filterSelection, setFilterSelection }: inputProps)
// set a minimum height of 20rem, additional years need some more space // set a minimum height of 20rem, additional years need some more space
const height = Math.max(numNrens * heightPerBar + (numYears * 2 * heightPerBar), 20); const height = Math.max(numNrens * heightPerBar + (numYears * 2 * heightPerBar), 20);
return ( return (
<DataPage title="Funding Source" category={Sections.Organisation} filter={filterNode}> <DataPage title="Income Source Of NRENs per Year"
description='The graph shows the percentage share of their income that individual NRENs derived from different sources.
On hovering over the graphs will give income share in that year. This can be used to compare selecting multiple years to see how the
share has changed between the years.'
category={Sections.Organisation} filter={filterNode}>
<div> <div>
<Container className=" border rounded-3 border-1 funding-chart-Legend" <FundingSourceLegend/>
style={{ marginTop: '20px', marginBottom: '20px', padding: '10px'}}>
<Row fluid className="justify-content-center">
<Col className="d-flex align-items-center">
<ColorBadge key={0} index={0}/>
<span className='bold-caps-16pt'>CLIENT INSTITUTIONS</span></Col>
<Col className="d-flex align-items-center" >
<ColorBadge key={1} index={1}/>
<span className='bold-caps-16pt'>COMMERCIAL</span></Col>
<Col className="d-flex align-items-center" >
<ColorBadge key={2} index={2}/>
<span className='bold-caps-16pt'>EUROPEAN FUNDING</span></Col>
<Col className="d-flex align-items-center" >
<ColorBadge key={3} index={3}/>
<span className='bold-caps-16pt'>GOV/PUBLIC BODIES</span></Col>
<Col className="d-flex align-items-center" >
<ColorBadge key={4} index={4}/>
<span className='bold-caps-16pt dark-teal'>OTHER</span></Col>
</Row>
</Container>
<div className="chart-container" style={{ 'height': `${height}rem` }}> <div className="chart-container" style={{ 'height': `${height}rem` }}>
<Bar <Bar
data={fundingSourceDataset} data={fundingSourceDataset}
options={chartOptions} options={chartOptions}
/> />
</div> </div>
<FundingSourceLegend/>
</div> </div>
</DataPage> </DataPage>
); );
......
...@@ -47,4 +47,10 @@ ...@@ -47,4 +47,10 @@
.geant-header { .geant-header {
@extend .bold-caps-20pt; @extend .bold-caps-20pt;
color: $dark-teal; color: $dark-teal;
}
.bold-14pt {
font-family: "Open Sans", sans-serif;
font-size: 14pt;
font-weight: bold;
} }
\ No newline at end of file
.funding-chart-Legend{
margin-top: 2vw;
margin-bottom: 2vw;
padding: 1vw;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment