diff --git a/src/__test__/redux/reducers/componentConfig/__snapshots__/updateConfig.test.js.snap b/src/__test__/redux/reducers/componentConfig/__snapshots__/updateConfig.test.js.snap index 7e51f74018..388284d07d 100644 --- a/src/__test__/redux/reducers/componentConfig/__snapshots__/updateConfig.test.js.snap +++ b/src/__test__/redux/reducers/componentConfig/__snapshots__/updateConfig.test.js.snap @@ -16,8 +16,8 @@ exports[`updateConfig Checking if empty update doesnt change anything 1`] = ` "offset": 0, "titleFontSize": 13, "xAxisRotateLabels": false, - "xAxisText": "Umap 1", - "yAxisText": "Umap 2", + "xAxisText": null, + "yAxisText": null, }, "axesRanges": { "xAxisAuto": true, diff --git a/src/components/plots/ContinuousEmbeddingPlot.jsx b/src/components/plots/ContinuousEmbeddingPlot.jsx index e0f603b1d9..cf130519e1 100644 --- a/src/components/plots/ContinuousEmbeddingPlot.jsx +++ b/src/components/plots/ContinuousEmbeddingPlot.jsx @@ -103,7 +103,8 @@ const ContinuousEmbeddingPlot = (props) => { || loading || !cellSets.accessible || embeddingLoading - || Object.keys(plotSpec).length === 0) { + || Object.keys(plotSpec).length === 0 + || !plotData?.length) { return (
diff --git a/src/components/plots/MultiViewGrid.jsx b/src/components/plots/MultiViewGrid.jsx index 044c821a88..b4faf6a65d 100644 --- a/src/components/plots/MultiViewGrid.jsx +++ b/src/components/plots/MultiViewGrid.jsx @@ -94,7 +94,7 @@ const MultiViewGrid = (props) => { dispatch(updatePlotConfig(firstPlotUuid, { shownGene: highestDispersionGene, title: { text: highestDispersionGene } })); } - }, [plotConfigs]); + }, [plotConfigs, highestDispersionGene]); useEffect(() => { // initial set up if there are no plots diff --git a/src/components/plots/PlotContainer.jsx b/src/components/plots/PlotContainer.jsx index 8bf41b4cc8..81a722607a 100644 --- a/src/components/plots/PlotContainer.jsx +++ b/src/components/plots/PlotContainer.jsx @@ -37,6 +37,7 @@ const PlotContainer = (props) => { const [isResetDisabled, setIsResetDisabled] = useState(true); const [tileDirection, setTileDirection] = useState(DEFAULT_ORIENTATION); + const { config } = useSelector((state) => state.componentConfig[plotUuid] || {}); const debounceSave = useCallback( _.debounce(() => dispatch(savePlotConfig(experimentId, plotUuid)), saveDebounceTime), [plotUuid], diff --git a/src/components/plots/styling/AxesWithRangesDesign.jsx b/src/components/plots/styling/AxesWithRangesDesign.jsx index 7773ff9d35..319f2a4bde 100644 --- a/src/components/plots/styling/AxesWithRangesDesign.jsx +++ b/src/components/plots/styling/AxesWithRangesDesign.jsx @@ -12,7 +12,6 @@ const AxesWithRangesDesign = (props) => { const { config, onUpdate, } = props; - const hideXRange = typeof config.axesRanges.xAxisAuto === 'undefined'; const hideYRange = typeof config.axesRanges.yAxisAuto === 'undefined'; diff --git a/src/pages/experiments/[experimentId]/plots-and-tables/embedding-continuous/index.jsx b/src/pages/experiments/[experimentId]/plots-and-tables/embedding-continuous/index.jsx index 90ef4626b6..0db3245b02 100644 --- a/src/pages/experiments/[experimentId]/plots-and-tables/embedding-continuous/index.jsx +++ b/src/pages/experiments/[experimentId]/plots-and-tables/embedding-continuous/index.jsx @@ -147,7 +147,7 @@ const ContinuousEmbeddingPage = ({ experimentId }) => { extraControlPanels={renderExtraPanels()} defaultActiveKey='view-multiple-plots' onPlotReset={() => dispatch( - updatePlotConfig(multiViewUuid, { nrows: 1, ncols: 1, plotUuids: [] }), + updatePlotConfig(multiViewUuid, { nrows: 1, ncols: 1, plotUuids: [`${plotUuid}-0`] }), )} onUpdate={updateAll ? updateAllWithChanges : updatePlotWithChanges} > diff --git a/src/pages/experiments/[experimentId]/plots-and-tables/violin/index.jsx b/src/pages/experiments/[experimentId]/plots-and-tables/violin/index.jsx index 74385b18b3..b03aa57435 100644 --- a/src/pages/experiments/[experimentId]/plots-and-tables/violin/index.jsx +++ b/src/pages/experiments/[experimentId]/plots-and-tables/violin/index.jsx @@ -58,7 +58,7 @@ const ViolinIndex = ({ experimentId }) => { }, []); const resetMultiView = () => { - updateMultiViewWithChanges({ nrows: 1, ncols: 1, plotUuids: [] }); + updateMultiViewWithChanges({ nrows: 1, ncols: 1, plotUuids: [`${plotUuid}-0`] }); }; const plotStylingConfig = [ diff --git a/src/redux/reducers/componentConfig/initialState.js b/src/redux/reducers/componentConfig/initialState.js index 5020b6ee4a..0b6a047079 100644 --- a/src/redux/reducers/componentConfig/initialState.js +++ b/src/redux/reducers/componentConfig/initialState.js @@ -25,8 +25,8 @@ const embeddingCategoricalInitialConfig = { }, axes: { ...axesBaseState, - xAxisText: 'Umap 1', - yAxisText: 'Umap 2', + xAxisText: null, + yAxisText: null, defaultValues: ['x', 'y'], offset: 0, }, @@ -57,8 +57,8 @@ const embeddingContinuousInitialConfig = { }, axes: { ...axesBaseState, - xAxisText: 'Umap 1', - yAxisText: 'Umap 2', + xAxisText: null, + yAxisText: null, defaultValues: ['x', 'y'], offset: 10, }, @@ -297,8 +297,8 @@ const trajectoryAnalysisInitialConfig = { }, axes: { ...axesBaseState, - xAxisText: 'Umap 1', - yAxisText: 'Umap 2', + xAxisText: null, + yAxisText: null, defaultValues: ['x', 'y'], }, axesRanges: axesRangesBaseState, @@ -339,8 +339,8 @@ const embeddingPreviewBySampleInitialConfig = { }, axes: { ...axesBaseState, - xAxisText: '', - yAxisText: '', + xAxisText: null, + yAxisText: null, defaultValues: ['x', 'y'], offset: 10, }, @@ -373,8 +373,8 @@ const embeddingPreviewByCellSetsInitialConfig = { }, axes: { ...axesBaseState, - xAxisText: '', - yAxisText: '', + xAxisText: null, + yAxisText: null, defaultValues: ['x', 'y'], offset: 10, }, @@ -405,8 +405,8 @@ const embeddingPreviewMitochondrialContentInitialConfig = { }, axes: { ...axesBaseState, - xAxisText: '', - yAxisText: '', + xAxisText: null, + yAxisText: null, defaultValues: ['x', 'y'], offset: 10, }, @@ -435,8 +435,8 @@ const embeddingPreviewDoubletScoreInitialConfig = { }, axes: { ...axesBaseState, - xAxisText: '', - yAxisText: '', + xAxisText: null, + yAxisText: null, defaultValues: ['x', 'y'], offset: 10, }, @@ -463,8 +463,8 @@ const embeddingPreviewNumOfGenesInitialConfig = { }, axes: { ...axesBaseState, - xAxisText: '', - yAxisText: '', + xAxisText: null, + yAxisText: null, defaultValues: ['x', 'y'], offset: 10, }, @@ -490,8 +490,8 @@ const embeddingPreviewNumOfUmisInitialConfig = { }, axes: { ...axesBaseState, - xAxisText: '', - yAxisText: '', + xAxisText: null, + yAxisText: null, defaultValues: ['x', 'y'], offset: 10, },