+
diff --git a/src/firefly/js/visualize/reducer/HandlePlotCreation.js b/src/firefly/js/visualize/reducer/HandlePlotCreation.js
index 00b8b23db5..dca0d1e527 100644
--- a/src/firefly/js/visualize/reducer/HandlePlotCreation.js
+++ b/src/firefly/js/visualize/reducer/HandlePlotCreation.js
@@ -102,7 +102,7 @@ function addPlot(state,action, replace, setActive) {
if (!info) return pv;
const {plotAry, overlayPlotViews}= info;
if (setActive) activePlotId= pv.plotId;
- return PlotView.replacePlots(pv,plotAry,overlayPlotViews,replace);
+ return PlotView.replacePlots(pv,plotAry,overlayPlotViews, state.expandedMode, replace);
});
}
else {// used for single plot update
@@ -111,7 +111,7 @@ function addPlot(state,action, replace, setActive) {
plotViewAry= plotViewAry.map( (pv) => { // map has side effect of setting active plotId
if (pv.plotId!==plotId ) return pv;
if (setActive) activePlotId= plotId;
- return PlotView.replacePlots(pv,plotAry,overlayPlotViews, replace);
+ return PlotView.replacePlots(pv,plotAry,overlayPlotViews, state.expandedMode, replace);
});
}
return clone(state, {plotViewAry,activePlotId});
diff --git a/src/firefly/js/visualize/reducer/PlotView.js b/src/firefly/js/visualize/reducer/PlotView.js
index edcab7c873..f36cb2d31f 100644
--- a/src/firefly/js/visualize/reducer/PlotView.js
+++ b/src/firefly/js/visualize/reducer/PlotView.js
@@ -23,6 +23,7 @@ import {DEFAULT_THUMBNAIL_SIZE} from '../WebPlotRequest.js';
import SimpleMemCache from '../../util/SimpleMemCache.js';
import {CCUtil, CysConverter} from './../CsysConverter.js';
import {defMenuItemKeys} from '../MenuItemKeys.js';
+import {ExpandType} from '../ImagePlotCntlr.js';
// export const DATASET_INFO_CONVERTER = 'DATASET_INFO_CONVERTER';
@@ -185,12 +186,12 @@ export function changePrimePlot(pv, nextIdx) {
*
* @param pv
* @param plotAry
- * @param expanded
* @param overlayPlotViews
+ * @param expandedMode
* @param keepPrimeIdx
* @return {Object|*}
*/
-function replacePlots(pv, plotAry, overlayPlotViews=null,keepPrimeIdx=false) {
+function replacePlots(pv, plotAry, overlayPlotViews, expandedMode, keepPrimeIdx=false) {
pv= Object.assign({},pv);
pv.plotViewCtx= Object.assign({},pv.plotViewCtx);
@@ -228,7 +229,7 @@ function replacePlots(pv, plotAry, overlayPlotViews=null,keepPrimeIdx=false) {
pv.plotViewCtx.containsMultiImageFits= pv.plots.every( (p) => p.plotState.isMultiImageFile());
pv.plotViewCtx.containsMultipleCubes= pv.plots.every( (p) => p.plotState.getCubeCnt()>1);
pv.plotViewCtx.rotateNorthLock= pv.plots[pv.primeIdx].plotState.getRotateType()===RotateType.NORTH; // todo, study this more, understand why
- pv.plotViewCtx.lastCollapsedZoomLevel= pv.plots[pv.primeIdx].zoomFactor;
+ if (expandedMode===ExpandType.COLLAPSE) pv.plotViewCtx.lastCollapsedZoomLevel= pv.plots[pv.primeIdx].zoomFactor;
pv= initScrollCenterPoint(pv);
diff --git a/src/firefly/js/visualize/saga/CoverageWatcher.js b/src/firefly/js/visualize/saga/CoverageWatcher.js
index dcf050650b..684a192391 100644
--- a/src/firefly/js/visualize/saga/CoverageWatcher.js
+++ b/src/firefly/js/visualize/saga/CoverageWatcher.js
@@ -248,7 +248,7 @@ function updateCoverageWithData(table, options, tbl_id, allRowsTable, decimatedT
function computeSize(options, decimatedTables,allRowsTable) {
const ary= options.multiCoverage ? values(decimatedTables) : [allRowsTable];
- const testAry= ary
+ var testAry= ary
.filter( (t) => t && t!=='WORKING')
.map( (t) => {
var ptAry= [];
@@ -264,9 +264,19 @@ function computeSize(options, decimatedTables,allRowsTable) {
}
return flattenDeep(ptAry);
} );
- return computeCentralPointAndRadius(flattenDeep(testAry));
+ testAry= flattenDeep(testAry);
+ if (isOnePoint(testAry)) {
+ return {centralPoint:testAry[0], maxRadius: .05};
+ }
+ else {
+ return computeCentralPointAndRadius(testAry);
+ }
}
+function isOnePoint(wpList) {
+ if (isEmpty(wpList)) return false;
+ return !wpList.some( (wp) => !pointEquals(wp,wpList[0]));
+}