Skip to content

Commit

Permalink
Add defaults for mutation heatmap and line chart checkboxes
Browse files Browse the repository at this point in the history
  • Loading branch information
Bas Leenknegt authored and dippindots committed Aug 8, 2023
1 parent c54d4bd commit 6ae51d3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
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

0 comments on commit 6ae51d3

Please sign in to comment.