From c1d4d5e651cfdbce2e8986e719ab6bcf7661f643 Mon Sep 17 00:00:00 2001 From: Bryan Lai Date: Mon, 5 Dec 2022 16:06:59 -0500 Subject: [PATCH 1/2] fix issue where axis mode is defaulted to count --- .../groupComparison/GroupComparisonMutationsTabPlot.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/groupComparison/GroupComparisonMutationsTabPlot.tsx b/src/pages/groupComparison/GroupComparisonMutationsTabPlot.tsx index 5790d52abb3..2785f4a6fe2 100644 --- a/src/pages/groupComparison/GroupComparisonMutationsTabPlot.tsx +++ b/src/pages/groupComparison/GroupComparisonMutationsTabPlot.tsx @@ -124,7 +124,10 @@ export default class GroupComparisonMutationsTabPlot extends React.Component< plotLollipopTooltipCountInfo={ plotLollipopTooltipCountInfo } - axisMode={this.props.store.userSelectedAxisMode} + axisMode={ + this.props.store.userSelectedAxisMode || + AxisScale.PERCENT + } onScaleToggle={this.props.onScaleToggle} plotYAxisLabelFormatter={plotYAxisLabelFormatter} /> From 42152d2d5dffbf7ec7c51e784448936fb6811cbf Mon Sep 17 00:00:00 2001 From: Bryan Lai Date: Mon, 5 Dec 2022 16:24:03 -0500 Subject: [PATCH 2/2] renamed getter to axisMode and moved default here --- .../groupComparison/GroupComparisonMutationsTabPlot.tsx | 7 ++----- src/pages/groupComparison/GroupComparisonStore.ts | 6 +++--- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/pages/groupComparison/GroupComparisonMutationsTabPlot.tsx b/src/pages/groupComparison/GroupComparisonMutationsTabPlot.tsx index 2785f4a6fe2..ea7d63cd84e 100644 --- a/src/pages/groupComparison/GroupComparisonMutationsTabPlot.tsx +++ b/src/pages/groupComparison/GroupComparisonMutationsTabPlot.tsx @@ -77,7 +77,7 @@ export default class GroupComparisonMutationsTabPlot extends React.Component< mutations: Mutation[], group: string ) { - return this.props.store.userSelectedAxisMode === AxisScale.COUNT + return this.props.store.axisMode === AxisScale.COUNT ? countUniqueMutations(mutations) : (countUniqueMutations(mutations) / this.props.store.groupToProfiledSamples.result![group] @@ -124,10 +124,7 @@ export default class GroupComparisonMutationsTabPlot extends React.Component< plotLollipopTooltipCountInfo={ plotLollipopTooltipCountInfo } - axisMode={ - this.props.store.userSelectedAxisMode || - AxisScale.PERCENT - } + axisMode={this.props.store.axisMode} onScaleToggle={this.props.onScaleToggle} plotYAxisLabelFormatter={plotYAxisLabelFormatter} /> diff --git a/src/pages/groupComparison/GroupComparisonStore.ts b/src/pages/groupComparison/GroupComparisonStore.ts index 79ac483aa38..a2bf661794e 100644 --- a/src/pages/groupComparison/GroupComparisonStore.ts +++ b/src/pages/groupComparison/GroupComparisonStore.ts @@ -39,7 +39,7 @@ import { } from 'shared/api/session-service/sessionServiceModels'; import ComplexKeySet from 'shared/lib/complexKeyDataStructures/ComplexKeySet'; import { REQUEST_ARG_ENUM } from 'shared/constants'; -import { DataFilter } from 'react-mutation-mapper'; +import { AxisScale, DataFilter } from 'react-mutation-mapper'; import { getAllGenes } from 'shared/lib/StoreUtils'; import { CoverageInformation, @@ -458,8 +458,8 @@ export default class GroupComparisonStore extends ComparisonStore { return this.urlWrapper.query.selectedGene; } - @computed get userSelectedAxisMode() { - return this.urlWrapper.query.axisMode; + @computed get axisMode() { + return this.urlWrapper.query.axisMode || AxisScale.PERCENT; } @computed get activeMutationMapperGene() {