Skip to content

Commit 49df438

Browse files
authored
DM-7001: Merge pull request #127 from Caltech-IPAC/dm-7001-gator-related-bugs
DM-7001: Gator related bugs and region bug
2 parents 2b4bcd2 + 190f05d commit 49df438

File tree

7 files changed

+35
-13
lines changed

7 files changed

+35
-13
lines changed

src/firefly/js/api/ApiExpandedView.jsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,20 @@ export class ApiExpandedView extends Component {
6060
const view = expanded === LO_VIEW.tables ? tables
6161
: expanded === LO_VIEW.xyPlots ? xyPlots
6262
: images;
63-
return expanded !== LO_VIEW.none &&
64-
(
63+
if (expanded === LO_VIEW.none) {
64+
document.body.style.overflow= this.saveOverflow;
65+
return false;
66+
}
67+
else {
68+
this.saveOverflow= document.body.style.overflow;
69+
document.body.style.overflow= 'hidden';
70+
return (
6571
<div className='api-expanded rootStyle'>
6672
{view}
6773
</div>
6874
);
75+
76+
}
6977
}
7078
}
7179

src/firefly/js/api/ApiHighlevelBuild.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ function initCoverage(llApi, targetDiv,options= {}) {
319319
const {dispatchAddSaga}= llApi.action;
320320
const {renderDOM,debug}= llApi.util;
321321
const {watchImageMetaData,watchCoverage}= llApi.util.image;
322+
highlevelImageInit(llApi);
322323

323324

324325
renderDOM(targetDiv, MultiImageViewer,

src/firefly/js/ui/PopupPanel.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@ export var PopupPanel= React.createClass(
4646
var e= ReactDOM.findDOMNode(this);
4747

4848
var activeLayoutType = this.props.layoutPosition;
49-
var r= getPopupPosition(e,activeLayoutType);
50-
this.setState({activeLayoutType, posX:r.left, posY:r.top });
49+
setTimeout( () => {
50+
var r= getPopupPosition(e,activeLayoutType);
51+
this.setState({activeLayoutType, posX:r.left, posY:r.top });
52+
},10);
5153

5254
},
5355

src/firefly/js/visualize/iv/ExpandedTools.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@ export function ExpandedTools({visRoot,closeFunc}) {
131131
}
132132
return (
133133
<div>
134-
<div style={{display: 'flex', paddingBottom: 2, borderBottom: '1px solid rgba(0,0,0,.2)' }}>
134+
<div style={{display: 'flex', flexWrap:'wrap',paddingBottom: 2, borderBottom: '1px solid rgba(0,0,0,.2)' }}>
135135
{closeFunc && <CloseButton style={closeButtonStyle} onClick={closeFunc}/>}
136136
<div style={{'flex': '1 1 auto'}}>
137-
<VisToolbar/>
137+
<VisToolbar messageUnder={Boolean(closeFunc)}/>
138138
</div>
139139
</div>
140140
<div style={{width:'100%', height:70, marginTop: 7}} className='disable-select'>

src/firefly/js/visualize/reducer/HandlePlotCreation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function addPlot(state,action, replace, setActive) {
102102
if (!info) return pv;
103103
const {plotAry, overlayPlotViews}= info;
104104
if (setActive) activePlotId= pv.plotId;
105-
return PlotView.replacePlots(pv,plotAry,overlayPlotViews,replace);
105+
return PlotView.replacePlots(pv,plotAry,overlayPlotViews, state.expandedMode, replace);
106106
});
107107
}
108108
else {// used for single plot update
@@ -111,7 +111,7 @@ function addPlot(state,action, replace, setActive) {
111111
plotViewAry= plotViewAry.map( (pv) => { // map has side effect of setting active plotId
112112
if (pv.plotId!==plotId ) return pv;
113113
if (setActive) activePlotId= plotId;
114-
return PlotView.replacePlots(pv,plotAry,overlayPlotViews, replace);
114+
return PlotView.replacePlots(pv,plotAry,overlayPlotViews, state.expandedMode, replace);
115115
});
116116
}
117117
return clone(state, {plotViewAry,activePlotId});

src/firefly/js/visualize/reducer/PlotView.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {DEFAULT_THUMBNAIL_SIZE} from '../WebPlotRequest.js';
2323
import SimpleMemCache from '../../util/SimpleMemCache.js';
2424
import {CCUtil, CysConverter} from './../CsysConverter.js';
2525
import {defMenuItemKeys} from '../MenuItemKeys.js';
26+
import {ExpandType} from '../ImagePlotCntlr.js';
2627

2728
// export const DATASET_INFO_CONVERTER = 'DATASET_INFO_CONVERTER';
2829

@@ -185,12 +186,12 @@ export function changePrimePlot(pv, nextIdx) {
185186
*
186187
* @param pv
187188
* @param plotAry
188-
* @param expanded
189189
* @param overlayPlotViews
190+
* @param expandedMode
190191
* @param keepPrimeIdx
191192
* @return {Object|*}
192193
*/
193-
function replacePlots(pv, plotAry, overlayPlotViews=null,keepPrimeIdx=false) {
194+
function replacePlots(pv, plotAry, overlayPlotViews, expandedMode, keepPrimeIdx=false) {
194195

195196
pv= Object.assign({},pv);
196197
pv.plotViewCtx= Object.assign({},pv.plotViewCtx);
@@ -228,7 +229,7 @@ function replacePlots(pv, plotAry, overlayPlotViews=null,keepPrimeIdx=false) {
228229
pv.plotViewCtx.containsMultiImageFits= pv.plots.every( (p) => p.plotState.isMultiImageFile());
229230
pv.plotViewCtx.containsMultipleCubes= pv.plots.every( (p) => p.plotState.getCubeCnt()>1);
230231
pv.plotViewCtx.rotateNorthLock= pv.plots[pv.primeIdx].plotState.getRotateType()===RotateType.NORTH; // todo, study this more, understand why
231-
pv.plotViewCtx.lastCollapsedZoomLevel= pv.plots[pv.primeIdx].zoomFactor;
232+
if (expandedMode===ExpandType.COLLAPSE) pv.plotViewCtx.lastCollapsedZoomLevel= pv.plots[pv.primeIdx].zoomFactor;
232233

233234
pv= initScrollCenterPoint(pv);
234235

src/firefly/js/visualize/saga/CoverageWatcher.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ function updateCoverageWithData(table, options, tbl_id, allRowsTable, decimatedT
248248

249249
function computeSize(options, decimatedTables,allRowsTable) {
250250
const ary= options.multiCoverage ? values(decimatedTables) : [allRowsTable];
251-
const testAry= ary
251+
var testAry= ary
252252
.filter( (t) => t && t!=='WORKING')
253253
.map( (t) => {
254254
var ptAry= [];
@@ -264,9 +264,19 @@ function computeSize(options, decimatedTables,allRowsTable) {
264264
}
265265
return flattenDeep(ptAry);
266266
} );
267-
return computeCentralPointAndRadius(flattenDeep(testAry));
267+
testAry= flattenDeep(testAry);
268+
if (isOnePoint(testAry)) {
269+
return {centralPoint:testAry[0], maxRadius: .05};
270+
}
271+
else {
272+
return computeCentralPointAndRadius(testAry);
273+
}
268274
}
269275

276+
function isOnePoint(wpList) {
277+
if (isEmpty(wpList)) return false;
278+
return !wpList.some( (wp) => !pointEquals(wp,wpList[0]));
279+
}
270280

271281

272282

0 commit comments

Comments
 (0)