Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

✨ Feature - Clinical Analysis #2467

Merged
merged 72 commits into from
Apr 26, 2019
Merged
Show file tree
Hide file tree
Changes from 65 commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
d7b68e3
✨ PRTL-2415 Add cdave to analysis, restyle
anncatton Jan 25, 2019
f8c7871
cleanup
anncatton Jan 25, 2019
0c06fb3
create clinical analysis selection
anncatton Jan 25, 2019
85aa276
initial commit
anncatton Jan 29, 2019
b86cda1
More typing, styling. Mock default viz config
anncatton Jan 30, 2019
5b83026
Select set and config. Remove disabling on launch inputs
anncatton Jan 30, 2019
a4a23cf
moaarr typing fixes
anncatton Jan 31, 2019
5e739e5
tslint errors
anncatton Jan 31, 2019
8cdf7b3
show icons on analysis result tabs
anncatton Feb 1, 2019
cc19c0b
initial commit, clinical analysis result
anncatton Feb 1, 2019
19239fa
more layout
anncatton Feb 5, 2019
ee08f09
moaarr layout
anncatton Feb 5, 2019
024fd75
display set case total in result
anncatton Feb 5, 2019
0aec39f
styling and icons
anncatton Feb 6, 2019
8257f2b
more styling for variable cards
anncatton Feb 6, 2019
f6bef56
Add introspective type query
anncatton Feb 11, 2019
466ac7c
rename control panel component
anncatton Feb 11, 2019
2ba67d8
correct import
anncatton Feb 11, 2019
4afa995
Add and remove variables from current analysis
anncatton Feb 11, 2019
d889fd6
Add box plot icon. Use bar chart icon instead of histogram
anncatton Feb 13, 2019
0b833b4
add clinical blacklist to constants
anncatton Feb 13, 2019
191eb7f
begin update variable actions
anncatton Feb 13, 2019
fbfee6f
Add plot types by category. Filter variables by blacklist
anncatton Feb 13, 2019
f98564e
revert formatting
anncatton Feb 13, 2019
66d2980
allow optional params in humanify func
anncatton Feb 13, 2019
0f848b0
styling updates
anncatton Feb 13, 2019
ba6aa50
PRTL-2418 update cdave analysis (#2470)
anncatton Feb 19, 2019
21f30f2
deletion
anncatton Feb 19, 2019
999bca3
disabled cdave demo button for now
anncatton Feb 19, 2019
fccd009
demo button comment
anncatton Feb 19, 2019
a9cada3
Update collapse icon. Copy input consistent with edit input behaviour
anncatton Feb 19, 2019
057f69a
disable demo button on cdave launch
anncatton Feb 19, 2019
4c984e0
add minWidth for cdave tab
anncatton Feb 19, 2019
9f8ca74
update input value if component updates
anncatton Feb 21, 2019
493ce0c
fix conflicts
anncatton Feb 27, 2019
1a293c0
remove unused icons
anncatton Feb 27, 2019
6e6ce56
hide cdave analyses in results when flag is false
anncatton Feb 27, 2019
12cdc4e
✨ PRTL-2443 categorical histogram (#2472)
anncatton Mar 4, 2019
040e980
Prtl 2468 tooltip (#2474)
samrichca Mar 4, 2019
77335be
Prtl 2469 display missing key values (#2473)
anncatton Mar 11, 2019
cac64de
switch introspective to ExploreCases type (#2475)
anncatton Mar 12, 2019
3fda452
Prtl 2445 categorical survival (#2479)
samrichca Mar 14, 2019
2395063
✨ PRTL-2464 continuous histogram (#2478)
anncatton Mar 14, 2019
4308935
Investigate sizing issue (#2483)
anncatton Mar 15, 2019
43dcca9
Prtl 2483 overall survival (#2482)
samrichca Mar 18, 2019
41af9c6
💄 PRTL-2404 display survival x-axis in years (#2484)
anncatton Mar 19, 2019
872d290
Prtl 2482 calculate missing from hits (#2485)
anncatton Mar 19, 2019
cada682
Merge branch 'develop' into feature/PRTL-2417-cdave-results-layout
anncatton Mar 19, 2019
2595bc5
revert formatting
anncatton Mar 19, 2019
ed25894
Merge branch 'feature/PRTL-2417-cdave-results-layout' of https://gith…
anncatton Mar 19, 2019
c401034
💄 Put tooltip on fieldname, remove question mark icon (#2488)
anncatton Mar 19, 2019
5906982
add check for typo fix in index, change no data row names (#2490)
anncatton Mar 20, 2019
1302bbd
set order for control panel nodes (#2491)
anncatton Mar 20, 2019
2b4210d
change survival plot tooltip from 'days' to 'years' (#2500)
samrichca Apr 4, 2019
1ed65ea
PRTL-2508 refactor analysis data fetch (#2495)
anncatton Apr 5, 2019
5fdd33e
✨PRTL-2451 switch cdave cohort (#2499)
anncatton Apr 9, 2019
e2ef94a
Prtl 2484 categorical curves (#2486)
samrichca Apr 9, 2019
4b56d04
Prtl 2494 facet toggles (#2503)
samrichca Apr 10, 2019
3d8ed16
PRTL-2475 add case set actions to card (#2502)
anncatton Apr 11, 2019
56f4a5f
PRTL-2517 remove unnecessary layout breaking scrollbars
Apr 15, 2019
d21fccd
Merge pull request #2510 from NCI-GDC/bugfix/PRTL-2517-scrollbars
justincorrigible Apr 15, 2019
e54fb7c
Prtl 2452 search (#2506)
samrichca Apr 15, 2019
22e2543
✨PRTL-2521 export to tsv on clinical analysis (#2515)
anncatton Apr 18, 2019
22fb780
✨ PRTL-2514 enable demo clinical analysis (#2514)
anncatton Apr 18, 2019
2f8712f
[PRTL-2503] Print/download Clinical Analysis plots (#2517)
samrichca Apr 22, 2019
c1f4044
PRTL-2435 add eslint autosave config (wip)
Apr 24, 2019
fa4264b
PRTL 2501 milestone feedback (#2513)
samrichca Apr 24, 2019
7829238
PRTL-2435 add more eslint rules
Apr 24, 2019
de7ea9a
PRTL-2435 improve import, brace and parens handling
Apr 25, 2019
0f4e801
Prtl 2533 refresh survival on cohort change (#2520)
samrichca Apr 25, 2019
1d3b336
Merge branch 'develop' into feature/PRTL-2417-cdave-results-layout
samrichca Apr 25, 2019
64baec4
PRTL 2417 fix capitalization of leftIcon (#2524)
samrichca Apr 26, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6,798 changes: 3,406 additions & 3,392 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
"react-relay-network-layer": "2.0.1",
"react-router-dom": "4.2.2",
"react-sizeme": "2.3.4",
"react-toggle": "4.0.2",
"recompose": "0.30.0",
"redux": "3.6.0",
"redux-actions": "1.2.2",
Expand Down
68 changes: 33 additions & 35 deletions src/packages/@ncigdc/components/Aggregations/TermAggregation.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type TProps = {
showingMore: boolean,
};

const ToggleMoreLink = styled.div({
export const ToggleMoreLink = styled.div({
marginLeft: 'auto',
color: ({ theme }) => theme.greyScale7,
fontSize: '1.2rem',
Expand Down Expand Up @@ -67,37 +67,35 @@ const TermAggregation = (props: TProps) => {
[];
return (
<Container style={props.style} className="test-term-aggregation">
{!props.collapsed &&
props.showingValueSearch && (
<Row>
<Input
getNode={node => {
input = node;
{!props.collapsed && props.showingValueSearch && (
<Row>
<Input
getNode={node => {
input = node;
}}
style={{ borderRadius: '4px', marginBottom: '6px' }}
onChange={() => props.setFilter(input.value)}
placeholder={'Search...'}
aria-label="Search..."
autoFocus
/>
{input && input.value && (
<CloseIcon
style={{
position: 'absolute',
right: 0,
padding: '10px',
transition: 'all 0.3s ease',
outline: 0,
}}
onClick={() => {
props.setFilter('');
input.value = '';
}}
style={{ borderRadius: '4px', marginBottom: '6px' }}
onChange={() => props.setFilter(input.value)}
placeholder={'Search...'}
aria-label="Search..."
autoFocus
/>
{input &&
input.value && (
<CloseIcon
style={{
position: 'absolute',
right: 0,
padding: '10px',
transition: 'all 0.3s ease',
outline: 0,
}}
onClick={() => {
props.setFilter('');
input.value = '';
}}
/>
)}
</Row>
)}
)}
</Row>
)}
{!props.collapsed && (
<Column>
{_.orderBy(filteredBuckets, 'doc_count', 'desc')
Expand Down Expand Up @@ -140,17 +138,17 @@ const TermAggregation = (props: TProps) => {
})}
id={`input-${props.title}-${bucket.name.replace(
/\s/g,
'-',
'-'
)}`}
name={`input-${props.title}-${bucket.name.replace(
/\s/g,
'-',
'-'
)}`}
/>
<OverflowTooltippedLabel
htmlFor={`input-${props.title}-${bucket.name.replace(
/\s/g,
'-',
'-'
)}`}
style={{
marginLeft: '0.3rem',
Expand Down Expand Up @@ -202,10 +200,10 @@ const enhance = compose(
b =>
b.key !== '_missing' &&
(b.key || '').length &&
b.key.toLowerCase().includes(filter.toLowerCase()),
b.key.toLowerCase().includes(filter.toLowerCase())
),
})),
pure,
pure
);

export default enhance(TermAggregation);
30 changes: 22 additions & 8 deletions src/packages/@ncigdc/components/Charts/BarChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@
import React from 'react';
import * as d3 from 'd3';
import ReactFauxDOM from 'react-faux-dom';
import { compose, withState, pure } from 'recompose';
import {
compose,
withState,
pure,
withProps,
withPropsOnChange,
} from 'recompose';

// Custom
import { withTheme } from '@ncigdc/theme';
Expand All @@ -26,6 +32,7 @@ const BarChart = ({
}) => {
const el = ReactFauxDOM.createElement('div');
el.style.width = '100%';

el.setAttribute('class', 'test-bar-chart');
const innerPadding = 0.3;
const outerPadding = 0.3;
Expand Down Expand Up @@ -83,13 +90,12 @@ const BarChart = ({
.axisLeft(y)
.ticks(Math.min(4, maxY))
.tickSize(-chartWidth)
.tickSizeOuter(0),
.tickSizeOuter(0)
);

yG.selectAll('path').style('stroke', 'none');
yG.selectAll('line').style('stroke', yAxisStyle.stroke);
yG
.selectAll('text')
yG.selectAll('text')
.style('fontSize', yAxisStyle.fontSize)
.style('fill', yAxisStyle.textFill);

Expand All @@ -110,8 +116,7 @@ const BarChart = ({
.attr('transform', `translate(0, ${height})`)
.call(d3.axisBottom(x));

xG
.selectAll('text')
xG.selectAll('text')
.style('text-anchor', 'end')
.style('fontSize', xAxisStyle.fontSize)
.style('fontWeight', xAxisStyle.fontWeight)
Expand All @@ -124,6 +129,15 @@ const BarChart = ({

xG.selectAll('line').style('stroke', xAxisStyle.stroke);

xG.selectAll('.tick')
.data(data)
.on('mouseenter', d => {
setTooltip(d.tooltip);
})
.on('mouseleave', () => {
setTooltip();
});

const barGs = svg
.selectAll('g.chart')
.data(data)
Expand Down Expand Up @@ -165,6 +179,6 @@ export default compose(
withTheme,
withTooltip,
withState('chart', 'setState', <span />),
withSize(),
pure,
withSize({ refreshRate: 16 }),
pure
)(BarChart);
87 changes: 43 additions & 44 deletions src/packages/@ncigdc/components/DownloadTableToTsvButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,47 @@ const getSingleHeader = (headThs: Array<NodeList>) =>
headThs[0],
(acc, th) =>
th.rowSpan === 2 ? [...acc, th] : [...acc, ...map(headThs[1], t => t)],
[],
[]
);

const DownloadTableToTsvButton = compose(
withTooltip,
)(
export const downloadToTSV = ({ selector, filename }) => {
const tableEl = document.querySelector(selector);
const headTrs = tableEl.querySelector('thead').querySelectorAll('tr');
const headThs = map(headTrs, h => h.querySelectorAll('th'));
const thEls =
headThs.length === 2
? getSingleHeader(headThs)
: tableEl.querySelectorAll('th');
const thText = map(thEls, el => el.innerText).map(t =>
t.replace(/\s+/g, ' ')
);
const trs = tableEl.querySelector('tbody').querySelectorAll('tr');
const tdText = map(trs, t => {
const tds = t.querySelectorAll('td');
return reduce(
tds,
(acc, td) => {
const markedForTsv = td.querySelector('.for-tsv-export');
const exportText = markedForTsv ? markedForTsv.innerText : td.innerText;
const joinedText = exportText
.trim()
.split(/\s*\n\s*/)
.join(',')
.replace(/[\s\u00A0]+/g, ' ');
const colspan = td.getAttribute('colspan');
const fittedToColspan = colspan
? [joinedText, ...Array(colspan - 1)]
: [joinedText];
return [...acc, ...fittedToColspan];
},
[]
);
});
saveFile(mapStringArrayToTsvString(thText, tdText), 'TSV', filename);
track('download-table', { type: 'tsv', filename, selector });
};

const DownloadTableToTsvButton = compose(withTooltip)(
({
filename,
selector,
Expand All @@ -39,50 +74,14 @@ const DownloadTableToTsvButton = compose(
leftIcon={leftIcon}
style={{ ...visualizingButton, ...style }}
onMouseEnter={() =>
displayTooltip && setTooltip(<span>Export current view</span>)}
displayTooltip && setTooltip(<span>Export current view</span>)
}
onMouseLeave={() => displayTooltip && setTooltip('')}
onClick={() => {
const tableEl = document.querySelector(selector);
const headTrs = tableEl.querySelector('thead').querySelectorAll('tr');
const headThs = map(headTrs, h => h.querySelectorAll('th'));
const thEls =
headThs.length === 2
? getSingleHeader(headThs)
: tableEl.querySelectorAll('th');
const thText = map(thEls, el => el.innerText).map(t =>
t.replace(/\s+/g, ' '),
);
const trs = tableEl.querySelector('tbody').querySelectorAll('tr');
const tdText = map(trs, t => {
const tds = t.querySelectorAll('td');
return reduce(
tds,
(acc, td) => {
const markedForTsv = td.querySelector('.for-tsv-export');
const exportText = markedForTsv
? markedForTsv.innerText
: td.innerText;
const joinedText = exportText
.trim()
.split(/\s*\n\s*/)
.join(',')
.replace(/[\s\u00A0]+/g, ' ');
const colspan = td.getAttribute('colspan');
const fittedToColspan = colspan
? [joinedText, ...Array(colspan - 1)]
: [joinedText];
return [...acc, ...fittedToColspan];
},
[],
);
});
saveFile(mapStringArrayToTsvString(thText, tdText), 'TSV', filename);
track('download-table', { type: 'tsv', filename, selector });
}}
onClick={() => downloadToTSV({ selector, filename })}
>
TSV
</Button>
),
)
);
export default DownloadTableToTsvButton;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ const DownloadVisualizationButton = ({
disabled={disabled}
leftIcon={!noText && <Download />}
style={visualizingButton}
type="button"
>
{noText ? (
<span>
Expand Down
44 changes: 23 additions & 21 deletions src/packages/@ncigdc/components/EntityPageHorizontalTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const EntityPageHorizontalTable = ({
tableId,
idKey,
dividerStyle,
tableContainerStyle = {},
...props
}) => (
<Column
Expand All @@ -44,28 +45,29 @@ const EntityPageHorizontalTable = ({
flexWrap: 'wrap',
overflow: 'auto',
...style,
...tableContainerStyle,
}}
>
{(title || rightComponent) && (
<h1
style={{
color: theme.greyScale7,
width: '100%',
fontSize: '2rem',
lineHeight: '1.4em',
fontWeight: 'normal',
marginTop: 0,
marginBottom: 0,
padding: '1rem',
backgroundColor: '#fff',
display: 'flex',
justifyContent: 'space-between',
...titleStyle,
}}
>
{title || <span />} {rightComponent}
</h1>
)}
<h1
style={{
color: theme.greyScale7,
width: '100%',
fontSize: '2rem',
lineHeight: '1.4em',
fontWeight: 'normal',
marginTop: 0,
marginBottom: 0,
padding: '1rem',
backgroundColor: '#fff',
display: 'flex',
justifyContent: 'space-between',
...titleStyle,
}}
>
{title || <span />} {rightComponent}
</h1>
)}
{!!data.length && (
<Table
id={tableId}
Expand Down Expand Up @@ -95,7 +97,7 @@ const EntityPageHorizontalTable = ({
>
{s}
</Th>
)),
))
)}
body={
<tbody>
Expand Down Expand Up @@ -126,7 +128,7 @@ const EntityPageHorizontalTable = ({
)}
{v}
</Td>
)),
))
)}
</Tr>
))}
Expand Down
3 changes: 2 additions & 1 deletion src/packages/@ncigdc/components/Explore/GenesTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,9 @@ export default compose(
<SurvivalPlotWrapper
{...survivalData}
onReset={() => setSelectedSurvivalData({})}
plotType="mutation"
height={240}
survivalPlotloading={loading}
survivalPlotLoading={loading}
/>
</Column>
</Row>
Expand Down
Loading