From 190f05d2849ab7ad66421d4a9b1c455f09b9d44a Mon Sep 17 00:00:00 2001 From: roby Date: Fri, 29 Jul 2016 11:24:11 -0700 Subject: [PATCH] DM-7001: Gator related bugs and region bug - Toolbar icon not showing up - If only one point that is no coverage image (or one table with many records but has the same ra,dec values) - In laptop screen size, the toolbar is not fully visible, scrolling from left to right only move the background but not the expanded panel. - Readout is sometimes off the screen - Expanded then return to normal: zoom is not adjusted correctly --- src/firefly/js/api/ApiExpandedView.jsx | 12 ++++++++++-- src/firefly/js/api/ApiHighlevelBuild.js | 1 + src/firefly/js/ui/PopupPanel.jsx | 6 ++++-- src/firefly/js/visualize/iv/ExpandedTools.jsx | 4 ++-- .../js/visualize/reducer/HandlePlotCreation.js | 4 ++-- src/firefly/js/visualize/reducer/PlotView.js | 7 ++++--- src/firefly/js/visualize/saga/CoverageWatcher.js | 14 ++++++++++++-- 7 files changed, 35 insertions(+), 13 deletions(-) diff --git a/src/firefly/js/api/ApiExpandedView.jsx b/src/firefly/js/api/ApiExpandedView.jsx index cede36fc3d..9134b54eaa 100644 --- a/src/firefly/js/api/ApiExpandedView.jsx +++ b/src/firefly/js/api/ApiExpandedView.jsx @@ -60,12 +60,20 @@ export class ApiExpandedView extends Component { const view = expanded === LO_VIEW.tables ? tables : expanded === LO_VIEW.xyPlots ? xyPlots : images; - return expanded !== LO_VIEW.none && - ( + if (expanded === LO_VIEW.none) { + document.body.style.overflow= this.saveOverflow; + return false; + } + else { + this.saveOverflow= document.body.style.overflow; + document.body.style.overflow= 'hidden'; + return (
{view}
); + + } } } diff --git a/src/firefly/js/api/ApiHighlevelBuild.js b/src/firefly/js/api/ApiHighlevelBuild.js index 72f166880a..028ae67f0b 100644 --- a/src/firefly/js/api/ApiHighlevelBuild.js +++ b/src/firefly/js/api/ApiHighlevelBuild.js @@ -319,6 +319,7 @@ function initCoverage(llApi, targetDiv,options= {}) { const {dispatchAddSaga}= llApi.action; const {renderDOM,debug}= llApi.util; const {watchImageMetaData,watchCoverage}= llApi.util.image; + highlevelImageInit(llApi); renderDOM(targetDiv, MultiImageViewer, diff --git a/src/firefly/js/ui/PopupPanel.jsx b/src/firefly/js/ui/PopupPanel.jsx index 1d6eb5e21d..c0494a3c68 100644 --- a/src/firefly/js/ui/PopupPanel.jsx +++ b/src/firefly/js/ui/PopupPanel.jsx @@ -46,8 +46,10 @@ export var PopupPanel= React.createClass( var e= ReactDOM.findDOMNode(this); var activeLayoutType = this.props.layoutPosition; - var r= getPopupPosition(e,activeLayoutType); - this.setState({activeLayoutType, posX:r.left, posY:r.top }); + setTimeout( () => { + var r= getPopupPosition(e,activeLayoutType); + this.setState({activeLayoutType, posX:r.left, posY:r.top }); + },10); }, diff --git a/src/firefly/js/visualize/iv/ExpandedTools.jsx b/src/firefly/js/visualize/iv/ExpandedTools.jsx index 394e79cd93..709f75cc73 100644 --- a/src/firefly/js/visualize/iv/ExpandedTools.jsx +++ b/src/firefly/js/visualize/iv/ExpandedTools.jsx @@ -131,10 +131,10 @@ export function ExpandedTools({visRoot,closeFunc}) { } return (
-
+
{closeFunc && }
- +
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])); +}