Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add defaults for mutation heatmap and line chart checkboxes #4680

Merged
merged 1 commit into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions src/config/IAppConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,10 @@ export interface IServerConfig {
skin_patient_view_structural_variant_table_columns_show_on_init: string;
comparison_categorical_na_values: string;
oncoprint_clinical_tracks_config_json: string;
oncoprint_clustered_default: boolean;
enable_cross_study_expression: string;
studyview_max_samples_selected: number;
study_download_url: string;
vaf_sequential_mode_default: boolean;
vaf_log_scale_default: boolean;
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import { Mutation } from 'cbioportal-ts-api-client';
import ReactDOM from 'react-dom';
import PatientViewUrlWrapper from '../../PatientViewUrlWrapper';
import { getVariantAlleleFrequency } from 'shared/lib/MutationUtils';
import { getServerConfig } from 'config/config';

export interface IMutationOncoprintProps {
store: PatientViewPageStore;
Expand Down Expand Up @@ -84,11 +85,15 @@ export default class MutationOncoprint extends React.Component<
});
}

private get clustered() {
private get clustered(): boolean {
const urlValue = this.props.urlWrapper.query.genomicEvolutionSettings
.clusterHeatmap;
return !urlValue || urlValue === 'true'; // default true
if (urlValue) {
return urlValue === 'true';
}
return getServerConfig().oncoprint_clustered_default;
}

private set clustered(o: boolean) {
this.props.urlWrapper.updateURL(currentParams => {
currentParams.genomicEvolutionSettings.clusterHeatmap = o.toString();
Expand Down
8 changes: 6 additions & 2 deletions src/pages/patientView/timeline/VAFChartWrapperStore.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
import { action, computed, observable, makeObservable } from 'mobx';
import { getServerConfig } from 'config/config';

export default class VAFChartWrapperStore {
@observable groupByOption: string | null = null;

@observable _showSequentialMode: boolean | undefined = undefined;
@observable _showSequentialMode: boolean = getServerConfig()
.vaf_sequential_mode_default;

@computed
get showSequentialMode() {
return this.isOnlySequentialModePossible || this._showSequentialMode;
}

@observable onlyShowSelectedInVAFChart: boolean | undefined = undefined;

@observable vafChartLogScale: boolean | undefined = undefined;
@observable vafChartLogScale: boolean = getServerConfig()
.vaf_log_scale_default;

@observable vafChartYAxisToDataRange: boolean | undefined = undefined;

Expand Down