Skip to content

Commit f8906a3

Browse files
author
Bryan Lai
committed
add info icon and make changes to cohort selector
1 parent 603d933 commit f8906a3

File tree

2 files changed

+26
-10
lines changed

2 files changed

+26
-10
lines changed

src/pages/patientView/PatientViewPlotsTabWrapper.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ export const PatientViewPlotsTabWrapper: React.FunctionComponent<{
1919
const cohortSelector = () => (
2020
<CohortSelector
2121
study={store.studies.result![0].name}
22-
cancerType={
23-
store.patientViewPlotsStore.highlightedCancerTypes.result![0]
22+
cancerTypes={
23+
store.patientViewPlotsStore.highlightedCancerTypes.result
2424
}
25-
cancerTypeDetailed={
25+
cancerTypesDetailed={
2626
store.patientViewPlotsStore.highlightedDetailedCancerTypes
27-
.result![0]
27+
.result
2828
}
2929
cohortSelection={store.patientViewPlotsStore.cohortSelection}
3030
handleCohortChange={store.patientViewPlotsStore.handleCohortChange}

src/shared/components/plots/CohortSelector.tsx

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ import { observer } from 'mobx-react';
22
import * as React from 'react';
33
import { computed } from 'mobx';
44
import ReactSelect from 'react-select1';
5+
import InfoIcon from '../InfoIcon';
56

67
export interface ICohortSelector {
78
study: string;
8-
cancerType: string;
9-
cancerTypeDetailed: string;
9+
cancerTypes: string[];
10+
cancerTypesDetailed: string[];
1011
cohortSelection: CohortOptions;
1112
handleCohortChange: (cohort: {
1213
value: CohortOptions;
@@ -36,11 +37,13 @@ export default class CohortSelector extends React.Component<
3637
},
3738
{
3839
value: CohortOptions.CancerType,
39-
label: `Samples with: ${this.props.cancerType}`,
40+
label: `Samples with: ${this.props.cancerTypes.join(', ')}`,
4041
},
4142
{
4243
value: CohortOptions.CancerTypeDetailed,
43-
label: `Samples with: ${this.props.cancerTypeDetailed}`,
44+
label: `Samples with: ${this.props.cancerTypesDetailed.join(
45+
', '
46+
)}`,
4447
},
4548
];
4649
}
@@ -49,15 +52,28 @@ export default class CohortSelector extends React.Component<
4952
return (
5053
<div style={{ marginBottom: 10 }}>
5154
<div className="form-group">
52-
<label>Relevant Cohort</label>
53-
<div className="cohort-select-div">
55+
<label>Reference Cohort</label>
56+
<div
57+
className="cohort-select-div"
58+
style={{ display: 'flex', alignItems: 'center' }}
59+
>
5460
<ReactSelect
5561
name="cohort-select"
5662
value={this.props.cohortSelection}
5763
onChange={this.props.handleCohortChange}
5864
options={this.cohortOptions}
5965
clearable={false}
6066
/>
67+
<InfoIcon
68+
tooltip={
69+
<span>
70+
Set of patients/samples displayed alongside
71+
the current patient/sample for context
72+
</span>
73+
}
74+
tooltipPlacement="right"
75+
style={{ marginLeft: 7 }}
76+
/>
6177
</div>
6278
</div>
6379
</div>

0 commit comments

Comments
 (0)