Skip to content

Commit

Permalink
add default behavior when axisMode is not in URL
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryan Lai committed Dec 1, 2022
1 parent 0d5746a commit e9d6696
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/pages/groupComparison/GroupComparisonMutationsTabPlot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ export default class GroupComparisonMutationsTabPlot extends React.Component<
mutations: Mutation[],
group: string
) {
return this.props.urlWrapper.query.axisMode === AxisScale.PERCENT
? (countUniqueMutations(mutations) /
this.props.store.groupToProfiledSamples.result![group]
.length) *
100
: countUniqueMutations(mutations);
return this.props.urlWrapper.query.axisMode === AxisScale.COUNT
? countUniqueMutations(mutations)
: (countUniqueMutations(mutations) /
this.props.store.groupToProfiledSamples.result![group]
.length) *
100
}

@action.bound
Expand Down Expand Up @@ -133,7 +133,11 @@ export default class GroupComparisonMutationsTabPlot extends React.Component<
plotLollipopTooltipCountInfo={
plotLollipopTooltipCountInfo
}
axisMode={this.props.urlWrapper.query.axisMode}
axisMode={
this.props.urlWrapper.query.axisMode
? this.props.urlWrapper.query.axisMode
: AxisScale.PERCENT
}
onScaleToggle={this.onScaleToggle}
plotYAxisLabelFormatter={plotYAxisLabelFormatter}
/>
Expand Down

0 comments on commit e9d6696

Please sign in to comment.