Skip to content

Commit

Permalink
Merge pull request #968 from biomage-org/bug-fixes-2024
Browse files Browse the repository at this point in the history
embedding bugfix
  • Loading branch information
StefanBabukov authored Jan 4, 2024
2 parents 1a3082b + ecf54fa commit 59da4ae
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion src/components/plots/ContinuousEmbeddingPlot.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ const ContinuousEmbeddingPlot = (props) => {
|| loading
|| !cellSets.accessible
|| embeddingLoading
|| Object.keys(plotSpec).length === 0) {
|| Object.keys(plotSpec).length === 0
|| !plotData?.length) {
return (
<center>
<Loader experimentId={experimentId} />
Expand Down
2 changes: 1 addition & 1 deletion src/components/plots/MultiViewGrid.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/components/plots/PlotContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
1 change: 0 additions & 1 deletion src/components/plots/styling/AxesWithRangesDesign.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
36 changes: 18 additions & 18 deletions src/redux/reducers/componentConfig/initialState.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ const embeddingCategoricalInitialConfig = {
},
axes: {
...axesBaseState,
xAxisText: 'Umap 1',
yAxisText: 'Umap 2',
xAxisText: null,
yAxisText: null,
defaultValues: ['x', 'y'],
offset: 0,
},
Expand Down Expand Up @@ -57,8 +57,8 @@ const embeddingContinuousInitialConfig = {
},
axes: {
...axesBaseState,
xAxisText: 'Umap 1',
yAxisText: 'Umap 2',
xAxisText: null,
yAxisText: null,
defaultValues: ['x', 'y'],
offset: 10,
},
Expand Down Expand Up @@ -297,8 +297,8 @@ const trajectoryAnalysisInitialConfig = {
},
axes: {
...axesBaseState,
xAxisText: 'Umap 1',
yAxisText: 'Umap 2',
xAxisText: null,
yAxisText: null,
defaultValues: ['x', 'y'],
},
axesRanges: axesRangesBaseState,
Expand Down Expand Up @@ -339,8 +339,8 @@ const embeddingPreviewBySampleInitialConfig = {
},
axes: {
...axesBaseState,
xAxisText: '',
yAxisText: '',
xAxisText: null,
yAxisText: null,
defaultValues: ['x', 'y'],
offset: 10,
},
Expand Down Expand Up @@ -373,8 +373,8 @@ const embeddingPreviewByCellSetsInitialConfig = {
},
axes: {
...axesBaseState,
xAxisText: '',
yAxisText: '',
xAxisText: null,
yAxisText: null,
defaultValues: ['x', 'y'],
offset: 10,
},
Expand Down Expand Up @@ -405,8 +405,8 @@ const embeddingPreviewMitochondrialContentInitialConfig = {
},
axes: {
...axesBaseState,
xAxisText: '',
yAxisText: '',
xAxisText: null,
yAxisText: null,
defaultValues: ['x', 'y'],
offset: 10,
},
Expand Down Expand Up @@ -435,8 +435,8 @@ const embeddingPreviewDoubletScoreInitialConfig = {
},
axes: {
...axesBaseState,
xAxisText: '',
yAxisText: '',
xAxisText: null,
yAxisText: null,
defaultValues: ['x', 'y'],
offset: 10,
},
Expand All @@ -463,8 +463,8 @@ const embeddingPreviewNumOfGenesInitialConfig = {
},
axes: {
...axesBaseState,
xAxisText: '',
yAxisText: '',
xAxisText: null,
yAxisText: null,
defaultValues: ['x', 'y'],
offset: 10,
},
Expand All @@ -490,8 +490,8 @@ const embeddingPreviewNumOfUmisInitialConfig = {
},
axes: {
...axesBaseState,
xAxisText: '',
yAxisText: '',
xAxisText: null,
yAxisText: null,
defaultValues: ['x', 'y'],
offset: 10,
},
Expand Down

0 comments on commit 59da4ae

Please sign in to comment.