-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated screenshots + fixed null checks
- Loading branch information
1 parent
5bb2513
commit b72ac9a
Showing
45 changed files
with
663 additions
and
41 deletions.
There are no files selected for viewing
Binary file modified
BIN
+431 Bytes
(100%)
...does_not_show_ascn_columns_study_with_no_ascn_data_element_chrome_1600x1000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+896 Bytes
(100%)
..._where_some_samples_have_ascn_data_and_some_do_not_element_chrome_1600x1000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-392 Bytes
(100%)
...7_with_alk_and_sos1_-_sos1_should_be_not_sequenced_element_chrome_1600x1000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-78 Bytes
(100%)
...sclc_tcga_broad_2016_for_query_egfr:_mut=t790m_amp_element_chrome_1600x1000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-80 Bytes
(100%)
...d_2016_with_cdkn2a_mdm2_and_merged_track_mdm4_tp53_element_chrome_1600x1000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-76 Bytes
(100%)
..._tab_-_nsclc_tcga_broad_2016_with_overlapping_tp53_element_chrome_1600x1000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-79 Bytes
(100%)
...nce/download_tab_-_nsclc_tcga_broad_2016_with_tp53_element_chrome_1600x1000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-126 Bytes
(100%)
...eference/excluding_unprofiled_samples_mutation_tab_element_chrome_1600x1000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-46 Bytes
(100%)
...s/reference/excluding_unprofiled_samples_mutex_tab_element_chrome_1600x1000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+324 Bytes
(100%)
...on_page_methylation_enrichments_tab_several_groups_element_chrome_1600x1000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+225 Bytes
(100%)
...rison_page_microbiome_signature_tab_several_groups_element_chrome_1600x1000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+245 Bytes
(100%)
...omparison_page_microbiome_signature_tab_two_groups_element_chrome_1600x1000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+206 Bytes
(100%)
...omparison_page_mrna_enrichments_tab_several_groups_element_chrome_1600x1000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+239 Bytes
(100%)
...up_comparison_page_mrna_enrichments_tab_two_groups_element_chrome_1600x1000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+341 Bytes
(100%)
...arison_page_protein_enrichments_tab_several_groups_element_chrome_1600x1000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+341 Bytes
(100%)
...comparison_page_protein_enrichments_tab_two_groups_element_chrome_1600x1000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3.75 KB
(94%)
...7_with_alk_and_sos1_-_sos1_should_be_not_sequenced_element_chrome_1600x1000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+16 Bytes
(100%)
...shots/reference/no_session_comparison_tab_clinical_element_chrome_1600x1000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-97 Bytes
(100%)
...mote/screenshots/reference/no_session_mutation_tab_element_chrome_1600x1000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-38 Bytes
(100%)
.../remote/screenshots/reference/no_session_mutex_tab_element_chrome_1600x1000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+213 Bytes
(100%)
...reenshots/reference/patient_view_lgg_ucsf_2014_p04_element_chrome_1600x1000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-175 Bytes
(100%)
...with_0_mutations_msk_impact_2017_p-0000053-t01-im3_element_chrome_1600x1000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+183 Bytes
(100%)
...ge_heatmap_with_two_mutations_selected_from_before_element_chrome_1600x1000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+182 Bytes
(100%)
...shots/reference/pvge_hover_a_mutation_with_heatmap_element_chrome_1600x1000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+180 Bytes
(100%)
...ts/reference/pvge_hover_a_mutation_with_line_chart_element_chrome_1600x1000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+208 Bytes
(100%)
...nshots/reference/pvge_initial_view_with_line_chart_element_chrome_1600x1000.png
Oops, something went wrong.
Binary file modified
BIN
+182 Bytes
(100%)
.../reference/pvge_one_mutation_selected_with_heatmap_element_chrome_1600x1000.png
Oops, something went wrong.
Binary file modified
BIN
+185 Bytes
(100%)
...ference/pvge_one_mutation_selected_with_line_chart_element_chrome_1600x1000.png
Oops, something went wrong.
Binary file modified
BIN
+180 Bytes
(100%)
...st/remote/screenshots/reference/pvge_show_timeline_element_chrome_1600x1000.png
Oops, something went wrong.
Binary file modified
BIN
-115 Bytes
(100%)
...eenshots/reference/session_comparison_tab_clinical_element_chrome_1600x1000.png
Oops, something went wrong.
Binary file modified
BIN
-97 Bytes
(100%)
.../remote/screenshots/reference/session_mutation_tab_element_chrome_1600x1000.png
Oops, something went wrong.
Binary file modified
BIN
-38 Bytes
(100%)
...est/remote/screenshots/reference/session_mutex_tab_element_chrome_1600x1000.png
Oops, something went wrong.
Binary file modified
BIN
-34 Bytes
(100%)
..._adding_charts,_each_chart_should_get_proper_data._element_chrome_1600x1000.png
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,276 @@ | ||
import * as React from 'react'; | ||
import * as _ from 'lodash'; | ||
import { Checkbox } from 'react-bootstrap'; | ||
import { observer } from 'mobx-react'; | ||
import { action, computed, makeObservable, observable } from 'mobx'; | ||
import { remoteData, getTextWidth } from 'cbioportal-frontend-commons'; | ||
import { IColumnVisibilityDef } from 'shared/components/columnVisibilityControls/ColumnVisibilityControls'; | ||
import { MSKTab, MSKTabs } from 'shared/components/MSKTabs/MSKTabs'; | ||
import CustomDropdown from 'shared/components/oncoprint/controls/CustomDropdown'; | ||
import AddChartByType from '../../studyView/addChartButton/addChartByType/AddChartByType'; | ||
import { ChartDataCountSet } from '../../studyView/StudyViewUtils'; | ||
|
||
export interface IAddColumnsProps { | ||
className?: string; | ||
columnVisibility?: IColumnVisibilityDef[]; | ||
onColumnEnabled?: (columnId: string) => void; | ||
onColumnDisabled?: (columnId: string) => void; | ||
onColumnToggled?: ( | ||
columnId: string, | ||
columnVisibility?: IColumnVisibilityDef[] | ||
) => void; | ||
clinicalAttributeIdToAvailableSampleCount?: { [id: string]: number }; | ||
sampleCount?: number; | ||
} | ||
|
||
enum Tab { | ||
MUTATIONS = 'Mutations', | ||
CLINICAL = 'Clinical', | ||
} | ||
|
||
// Copied these constants from oncoprint/AddTracks.tsx | ||
// since importing them results in errors during testing | ||
// due to a separate import in that file. | ||
const MIN_DROPDOWN_WIDTH = 400; | ||
const CONTAINER_PADDING_WIDTH = 20; | ||
const TAB_PADDING_WIDTH = 14; | ||
const COUNT_PADDING_WIDTH = 17; | ||
@observer | ||
export default class AddColumns extends React.Component<IAddColumnsProps, {}> { | ||
@observable tabId: Tab = Tab.MUTATIONS; | ||
|
||
constructor(props: IAddColumnsProps) { | ||
super(props); | ||
makeObservable(this); | ||
} | ||
|
||
@action.bound | ||
private updateTabId(newId: Tab) { | ||
this.tabId = newId; | ||
} | ||
|
||
@computed get clinicalAttributeIdsToNames() { | ||
const clinicalAttributes = this.props.columnVisibility!.filter( | ||
col => col.clinicalAttributeId !== undefined | ||
); | ||
|
||
let map: { [id: string]: string } = {}; | ||
for (let attribute of clinicalAttributes) { | ||
map[attribute.clinicalAttributeId!] = attribute.name; | ||
} | ||
|
||
return map; | ||
} | ||
|
||
@action.bound | ||
private addAll(ids: string[]) { | ||
if (this.props.onColumnEnabled && ids) { | ||
for (let id of ids) { | ||
this.props.onColumnEnabled(id); | ||
} | ||
} | ||
} | ||
|
||
@action.bound | ||
private clearAll(ids: string[]) { | ||
if (this.props.onColumnDisabled && ids) { | ||
for (let id of ids) { | ||
this.props.onColumnDisabled(id); | ||
} | ||
} | ||
} | ||
|
||
@action.bound | ||
private toggle(id: string) { | ||
if (this.props.onColumnToggled && id) { | ||
this.props.onColumnToggled(id, this.props.columnVisibility); | ||
} | ||
} | ||
|
||
readonly emptyPromise = remoteData({ | ||
invoke: () => | ||
new Promise<ChartDataCountSet>(() => { | ||
return; | ||
}), | ||
}); | ||
|
||
readonly clinicalAttributeIdToAvailableFrequencyPromise = remoteData({ | ||
invoke: () => | ||
Promise.resolve( | ||
_.mapValues( | ||
this.props.clinicalAttributeIdToAvailableSampleCount, | ||
count => (100 * count) / this.props.sampleCount! | ||
) | ||
), | ||
}); | ||
|
||
@computed get mutationsOptions() { | ||
return this.props.columnVisibility | ||
?.filter(col => col.clinicalAttributeId === undefined) | ||
.map(col => ({ | ||
label: col.name, | ||
key: col.id, | ||
selected: col.visible, | ||
})); | ||
} | ||
|
||
@computed get mutationsTabContent() { | ||
return ( | ||
<div> | ||
{this.mutationsOptions && ( | ||
<AddChartByType | ||
options={this.mutationsOptions} | ||
freqPromise={this.emptyPromise} | ||
onAddAll={this.addAll} | ||
onClearAll={this.clearAll} | ||
onToggleOption={this.toggle} | ||
optionsGivenInSortedOrder={true} | ||
width={this.dropdownWidth} | ||
excludeFrequency={true} | ||
/> | ||
)} | ||
</div> | ||
); | ||
} | ||
|
||
@computed get clinicalOptions() { | ||
return this.props.columnVisibility | ||
?.filter(col => col.clinicalAttributeId !== undefined) | ||
.map(col => ({ | ||
label: col.name, | ||
key: col.clinicalAttributeId!, | ||
selected: col.visible, | ||
})); | ||
} | ||
|
||
@computed get clinicalTabContent() { | ||
return ( | ||
<div> | ||
{this.props.columnVisibility && this.clinicalOptions && ( | ||
<AddChartByType | ||
options={this.clinicalOptions} | ||
freqPromise={ | ||
this.clinicalAttributeIdToAvailableFrequencyPromise | ||
} | ||
onAddAll={clinicalAttributeIds => | ||
this.addAll( | ||
clinicalAttributeIds.map( | ||
id => this.clinicalAttributeIdsToNames![id] | ||
) | ||
) | ||
} | ||
onClearAll={clinicalAttributeIds => | ||
this.clearAll( | ||
clinicalAttributeIds.map( | ||
id => this.clinicalAttributeIdsToNames![id] | ||
) | ||
) | ||
} | ||
onToggleOption={clinicalAttributeId => | ||
this.toggle( | ||
this.clinicalAttributeIdsToNames![ | ||
clinicalAttributeId | ||
] | ||
) | ||
} | ||
optionsGivenInSortedOrder={false} | ||
width={this.dropdownWidth} | ||
/> | ||
)} | ||
</div> | ||
); | ||
} | ||
|
||
@computed get mutationsTabText() { | ||
return ( | ||
<div> | ||
{Tab.MUTATIONS} | ||
<span style={{ paddingLeft: 5 }}> | ||
<span className="oncoprintDropdownCount"> | ||
{this.mutationsOptions?.length} | ||
</span> | ||
</span> | ||
</div> | ||
); | ||
} | ||
|
||
@computed get clinicalTabText() { | ||
return ( | ||
<div> | ||
{Tab.CLINICAL} | ||
<span style={{ paddingLeft: 5 }}> | ||
<span className="oncoprintDropdownCount"> | ||
{this.clinicalOptions?.length} | ||
</span> | ||
</span> | ||
</div> | ||
); | ||
} | ||
|
||
private getTextPixel(text: string | undefined, fontSize: string) { | ||
// This is a very specified function to calculate the text length in Add Tracks dropdown | ||
const FRONT_FAMILY = 'Helvetica Neue'; | ||
return Math.floor( | ||
getTextWidth(text ? text : '', FRONT_FAMILY, fontSize) | ||
); | ||
} | ||
|
||
@computed get dropdownWidth() { | ||
let width = 2 * CONTAINER_PADDING_WIDTH; | ||
const HEADER_FONT_SIZE = '14px'; | ||
const COUNT_FONT_SIZE = '11px'; | ||
|
||
const textWidth = | ||
this.getTextPixel(Tab.CLINICAL, HEADER_FONT_SIZE) + | ||
TAB_PADDING_WIDTH; | ||
const countTextWidth = | ||
this.getTextPixel( | ||
this.clinicalOptions?.length.toString(), | ||
COUNT_FONT_SIZE | ||
) + COUNT_PADDING_WIDTH; | ||
width += textWidth + countTextWidth; | ||
|
||
return Math.max(width, MIN_DROPDOWN_WIDTH); | ||
} | ||
|
||
render() { | ||
return ( | ||
<CustomDropdown | ||
bsStyle="default" | ||
title="Columns" | ||
id="addColumnsDropdown" | ||
className={this.props.className} | ||
styles={{ minWidth: MIN_DROPDOWN_WIDTH, width: 'auto' }} | ||
> | ||
<div | ||
style={{ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
}} | ||
> | ||
<MSKTabs | ||
activeTabId={this.tabId} | ||
onTabClick={this.updateTabId} | ||
unmountOnHide={false} | ||
className="mainTabs mutationsTabAddColumnsDropdown" | ||
> | ||
<MSKTab | ||
key={0} | ||
id={Tab.MUTATIONS} | ||
linkText={this.mutationsTabText} | ||
> | ||
{this.mutationsTabContent} | ||
</MSKTab> | ||
<MSKTab | ||
key={1} | ||
id={Tab.CLINICAL} | ||
linkText={this.clinicalTabText} | ||
> | ||
{this.clinicalTabContent} | ||
</MSKTab> | ||
</MSKTabs> | ||
</div> | ||
</CustomDropdown> | ||
); | ||
} | ||
} |
Oops, something went wrong.