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 2, 2022
1 parent 0d5746a commit b58c35b
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/pages/groupComparison/GroupComparisonMutationsTabPlot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ function plotYAxisLabelFormatter(symbol: string, groupName: string) {
}
}
return `${symbol} ${label}`;
// return `${symbol} ${groupName}`;
}

function plotLollipopTooltipCountInfo(
Expand Down Expand Up @@ -79,12 +78,12 @@ export default class GroupComparisonMutationsTabPlot extends React.Component<
mutations: Mutation[],
group: string
) {
return this.props.urlWrapper.query.axisMode === AxisScale.PERCENT
? (countUniqueMutations(mutations) /
return this.props.urlWrapper.query.axisMode === AxisScale.COUNT
? countUniqueMutations(mutations)
: (countUniqueMutations(mutations) /
this.props.store.groupToProfiledSamples.result![group]
.length) *
100
: countUniqueMutations(mutations);
100;
}

@action.bound
Expand Down Expand Up @@ -133,7 +132,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 b58c35b

Please sign in to comment.