Skip to content

Commit

Permalink
Fix the tsne plot option dropdown menu label issue (#360)
Browse files Browse the repository at this point in the history
Co-authored-by: Károly Erdős <[email protected]>
  • Loading branch information
lingyun1010 and ke4 authored Oct 25, 2023
1 parent 503153a commit 878e0b8
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,19 +104,27 @@ class TSnePlotViewRoute extends React.Component {
}
}
plotTypeDropdown={plotTypeDropdown}
selectedPlotOptionLabel={this.state.selectedPlotOptionLabel}
selectedPlotOptionLabel={search.plotOption ?
search.plotType ?
Object.keys(_find(plotTypeDropdown,
(plot) => plot.plotType.toLowerCase() === search.plotType).plotOptions[0])[0] + `: ` + search.plotOption
:
Object.keys(_find(plotTypeDropdown,
(plot) => plot.plotType.toLowerCase() === this.state.selectedPlotType).plotOptions[0])[0] + `: ` + search.plotOption
:
this.state.selectedPlotOptionLabel}
onChangePlotTypes={
(plotOption) => {
this.setState({
selectedPlotType: plotOption.value,
selectedPlotOption: defaultPlotMethodAndParameterisation[plotOption.value],
selectedPlotOption: Object.values(defaultPlotMethodAndParameterisation[plotOption.value])[0],
selectedPlotOptionLabel: Object.keys(defaultPlotMethodAndParameterisation[plotOption.value])[0]
+ ": " + Object.values(defaultPlotMethodAndParameterisation[plotOption.value])[0],
})

const query = new URLSearchParams(history.location.search)
query.set(`plotType`, plotOption.value)
query.set(`plotOption`, defaultPlotMethodAndParameterisation[plotOption.value])
query.set(`plotOption`, Object.values(defaultPlotMethodAndParameterisation[plotOption.value])[0])
resetHighlightClusters(query)
updateUrlWithParams(query)
}
Expand Down

0 comments on commit 878e0b8

Please sign in to comment.