diff --git a/app/src/main/javascript/bundles/experiment-page/src/TSnePlotViewRoute.js b/app/src/main/javascript/bundles/experiment-page/src/TSnePlotViewRoute.js index 21f982fa1..9d0b4803e 100644 --- a/app/src/main/javascript/bundles/experiment-page/src/TSnePlotViewRoute.js +++ b/app/src/main/javascript/bundles/experiment-page/src/TSnePlotViewRoute.js @@ -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) }