forked from uc-cdis/commons-frontend-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
spike(PortDemo): Began porting team projects UI
- Loading branch information
1 parent
6627534
commit 700ec78
Showing
52 changed files
with
2,750 additions
and
3 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
141 changes: 141 additions & 0 deletions
141
src/pages/AnalysisApps/SharedUtils/AccessibilityUtils/AccessibilityStyles/Accessibility.less
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,141 @@ | ||
/* App-specific styles */ | ||
|
||
@import "AccessibilityGWAS.less"; | ||
@import "AccessibilityTeams.less"; | ||
|
||
/* Global styles */ | ||
|
||
:root { | ||
--focus-outline-color: #007bff; /* Bright Blue */ | ||
} | ||
|
||
.screen-reader-only { | ||
position: absolute; | ||
width: 1px; | ||
height: 1px; | ||
margin: -1px; | ||
padding: 0; | ||
overflow: hidden; | ||
clip: rect(0, 0, 0, 0); | ||
white-space: nowrap; | ||
border: 0; | ||
} | ||
|
||
/* Rules for all VADC Apps */ | ||
|
||
.analysis-app-wrapper { | ||
.ant-modal-content button:focus { | ||
outline: 1px dashed var(--focus-outline-color); | ||
outline-offset: 1px; | ||
} | ||
|
||
.ant-btn-default { | ||
color: #194C90; | ||
border-color: #194C90; | ||
} | ||
|
||
.ant-btn-primary:not([disabled]) { | ||
background: #194C90; | ||
border-color: #194C90; | ||
} | ||
|
||
.ant-btn-secondary { | ||
color: #194C90; | ||
border-color: #194C90; | ||
} | ||
|
||
.ant-btn-default:hover, | ||
.ant-btn-default:focus { | ||
color: #2466AC; | ||
border-color: #2466AC; | ||
} | ||
|
||
.ant-btn-primary:not([disabled]):hover, | ||
.ant-btn-primary:not([disabled]):focus { | ||
background: #2466AC; | ||
border-color: #2466AC; | ||
} | ||
|
||
.back-link { | ||
color: #215c9e; | ||
} | ||
|
||
.back-link:hover, | ||
.back-link:focus { | ||
color: #2E77B8; | ||
} | ||
|
||
.ant-pagination-item-active { | ||
color: #194C90; | ||
border-color: #194C90; | ||
} | ||
|
||
.ant-pagination-item-active a { | ||
color: #194C90; | ||
} | ||
|
||
.ant-pagination-item-active:hover, | ||
.ant-pagination-item-active:focus { | ||
color: #2466AC; | ||
border-color: #2466AC; | ||
} | ||
|
||
.ant-pagination-item-active:hover a, | ||
.ant-pagination-item-active:focus a { | ||
color: #2466AC; | ||
} | ||
|
||
.ant-pagination-item:hover, | ||
.ant-pagination-item:focus { | ||
border-color: #2466AC; | ||
} | ||
|
||
.ant-pagination-item:hover a, | ||
.ant-pagination-item:focus a { | ||
color: #2466AC; | ||
} | ||
|
||
.ant-pagination-next:hover .ant-pagination-item-link, | ||
.ant-pagination-next:focus .ant-pagination-item-link { | ||
color: #2466AC; | ||
border-color: #2466AC; | ||
} | ||
|
||
.ant-pagination-jump-next:hover .ant-pagination-item-link-icon, | ||
.ant-pagination-jump-next:focus .ant-pagination-item-link-icon { | ||
color: #2466AC; | ||
border-color: #2466AC; | ||
} | ||
|
||
.ant-pagination-prev:hover .ant-pagination-item-link, | ||
.ant-pagination-prev:focus .ant-pagination-item-link { | ||
color: #2466AC; | ||
border-color: #2466AC; | ||
} | ||
|
||
.ant-pagination-jump-prev:hover .ant-pagination-item-link-icon, | ||
.ant-pagination-jump-prev:focus .ant-pagination-item-link-icon { | ||
color: #2466AC; | ||
border-color: #2466AC; | ||
} | ||
|
||
.ant-select-focused:not([disabled]).ant-select .ant-select-selector { | ||
border-color: #2466AC; | ||
} | ||
|
||
.ant-pagination-options:hover .ant-select:not([disabled]) .ant-select-selector { | ||
border-color: #2466AC; | ||
} | ||
|
||
.ant-card-meta-description { | ||
color: #333333; | ||
} | ||
|
||
.ant-card-actions .anticon { | ||
color: #333333; | ||
} | ||
|
||
.ant-card-actions .anticon:hover { | ||
color: #2466AC; | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
...es/AnalysisApps/SharedUtils/AccessibilityUtils/AccessibilityStyles/AccessibilityGWAS.less
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,43 @@ | ||
/* GWAS App */ | ||
|
||
.gwas-modal { | ||
.ant-btn-primary:not([disabled]) { | ||
background: #194C90; | ||
border-color: #194C90; | ||
} | ||
|
||
.ant-btn-primary:not([disabled]):hover, | ||
.ant-btn-primary:not([disabled]):focus { | ||
background: #2466AC; | ||
border-color: #2466AC; | ||
} | ||
|
||
.ant-btn-default { | ||
color: #194C90; | ||
border-color: #194C90; | ||
} | ||
|
||
.ant-btn-default:hover, | ||
.ant-btn-default:focus { | ||
color: #2466AC; | ||
border-color: #2466AC; | ||
} | ||
} | ||
|
||
.GWASApp { | ||
.GWASUI-navBtn:not([disabled]) { | ||
background: #194C90; | ||
border-color: #194C90; | ||
} | ||
|
||
.GWASUI-navBtn:not([disabled]):hover, | ||
.GWASUI-navBtn:not([disabled]):focus { | ||
background: #2466AC; | ||
border-color: #2466AC; | ||
} | ||
|
||
.euler-diagram-controls .ant-btn-primary:not([disabled]):focus { | ||
background: #194C90; | ||
border-color: #194C90; | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...s/AnalysisApps/SharedUtils/AccessibilityUtils/AccessibilityStyles/AccessibilityTeams.less
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,14 @@ | ||
/* Rules for Teams selection in VADC */ | ||
|
||
.team-project-modal { | ||
.ant-btn-primary:not([disabled]) { | ||
background: #194C90; | ||
border-color: #194C90; | ||
} | ||
|
||
.ant-btn-primary:not([disabled]):hover, | ||
.ant-btn-primary:not([disabled]):focus { | ||
background: #2466AC; | ||
border-color: #2466AC; | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/pages/AnalysisApps/SharedUtils/AccessibilityUtils/IsEnterOrSpace.ts
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,8 @@ | ||
const isEnterOrSpace = (event) => | ||
event.key === 'Enter' || | ||
event.key === ' ' || | ||
event.key === 'Spacebar' || | ||
event.keycode === '32' || | ||
event.keycode === '13'; | ||
|
||
export default isEnterOrSpace; |
4 changes: 4 additions & 0 deletions
4
src/pages/AnalysisApps/SharedUtils/DataViz/Histogram/Histogram.css
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,4 @@ | ||
.histogram-tooltip { | ||
padding: 12px 5px 1px 5px; | ||
background-color: #fafafb; | ||
} |
111 changes: 111 additions & 0 deletions
111
src/pages/AnalysisApps/SharedUtils/DataViz/Histogram/Histogram.jsx
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,111 @@ | ||
/* | ||
import React from 'react'; | ||
import { | ||
BarChart, | ||
Bar, | ||
XAxis, | ||
YAxis, | ||
CartesianGrid, | ||
Tooltip, | ||
Label, | ||
} from 'recharts'; | ||
import PropTypes from 'prop-types'; | ||
import './Histogram.css'; | ||
const formatNumber = (number) => (Math.round(number * 10) / 10).toLocaleString(); | ||
const CustomTooltip = ({ active, payload, label }) => { | ||
if (active && payload && payload.length) { | ||
return ( | ||
<div className='histogram-tooltip'> | ||
<p> | ||
{`Number of persons: ${formatNumber( | ||
payload[0].value, | ||
)}, for values starting at: ${formatNumber(label)}`} | ||
</p> | ||
</div> | ||
); | ||
} | ||
return null; | ||
}; | ||
CustomTooltip.propTypes = { | ||
active: PropTypes.any, | ||
payload: PropTypes.any, | ||
label: PropTypes.number, | ||
}; | ||
CustomTooltip.defaultProps = { | ||
active: null, | ||
payload: null, | ||
label: null, | ||
}; | ||
// TODO - improve tickGap - e.g. the minTickGap={50} below needs to be dynamically calculated | ||
const Histogram = ({ | ||
data, | ||
xAxisDataKey, | ||
barDataKey, | ||
chartWidth, | ||
chartHeight, | ||
barColor, | ||
xAxisLegend, | ||
yAxisLegend, | ||
useAnimation, | ||
}) => { | ||
const defaultAnimationTime = 400; | ||
return ( | ||
<div data-testid='histogram'> | ||
<BarChart | ||
width={chartWidth} | ||
height={chartHeight} | ||
data={data} | ||
margin={{ top: 20, bottom: 65, right: 60 }} | ||
> | ||
<XAxis | ||
dataKey={xAxisDataKey} | ||
minTickGap={50} | ||
tickFormatter={(tick) => formatNumber(tick)} | ||
> | ||
<Label | ||
value={xAxisLegend || xAxisDataKey} | ||
position='bottom' | ||
offset={20} | ||
/> | ||
</XAxis> | ||
<YAxis> | ||
<Label value={yAxisLegend || barDataKey} position='top' offset={10} /> | ||
</YAxis> | ||
<Tooltip content={<CustomTooltip />} /> | ||
<CartesianGrid strokeDasharray='3 3' /> | ||
<Bar dataKey={barDataKey} fill={barColor} animationDuration={useAnimation ? defaultAnimationTime : 0} /> | ||
</BarChart> | ||
</div> | ||
); | ||
}; | ||
Histogram.propTypes = { | ||
data: PropTypes.array.isRequired, | ||
xAxisDataKey: PropTypes.string.isRequired, | ||
barDataKey: PropTypes.string.isRequired, | ||
chartWidth: PropTypes.number, | ||
chartHeight: PropTypes.number, | ||
barColor: PropTypes.string, | ||
xAxisLegend: PropTypes.string, | ||
yAxisLegend: PropTypes.string, | ||
useAnimation: PropTypes.bool, | ||
}; | ||
Histogram.defaultProps = { | ||
chartWidth: 600, | ||
chartHeight: 350, | ||
barColor: '#8884d8', | ||
xAxisLegend: null, | ||
yAxisLegend: null, | ||
useAnimation: true, | ||
}; | ||
export default Histogram; | ||
*/ |
Oops, something went wrong.