Skip to content

Commit 83bd553

Browse files
committed
DM-9272: Clean up IRSA Time series viewer to prepare RC
1 parent f87095b commit 83bd553

File tree

7 files changed

+204
-150
lines changed

7 files changed

+204
-150
lines changed

src/firefly/html/css/global.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686

8787
.button.std {
8888
height: 23px;
89+
white-space: nowrap;
8990
}
9091

9192
.button.hl {
@@ -339,3 +340,12 @@
339340
color: blue;
340341
text-decoration: none;
341342
}
343+
344+
/*------------------- reusable layout styles >---------------------*/
345+
.abs_full {
346+
position: absolute;
347+
top: 0;
348+
bottom: 0;
349+
left: 0;
350+
right: 0;
351+
}

src/firefly/js/templates/lightcurve/LCPanels.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,25 @@
3232

3333
.Resizer.disabled {
3434
cursor: auto;
35+
}
36+
37+
.phaseFolded {
38+
display: inline-flex;
39+
width: 100%;
40+
height: 100%;
41+
}
42+
43+
.phaseFolded__options {
44+
background-color: #dcdcdc;
45+
border-radius: 7px;
46+
border: 1px solid #cccccc;
47+
margin-right: 2px;
48+
padding: 10px;
49+
}
50+
51+
.settingBox {
52+
background-color: #dcdcdc;
53+
border: 1px solid #cccccc;
54+
margin-bottom: 3px;
55+
padding: 5px 10px;
3556
}

src/firefly/js/templates/lightcurve/LcPeriod.jsx

Lines changed: 27 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ import {RangeSlider} from '../../ui/RangeSlider.jsx';
1313
import {FieldGroup} from '../../ui/FieldGroup.jsx';
1414
import {ValidationField} from '../../ui/ValidationField.jsx';
1515
import {showInfoPopup} from '../../ui/PopupUtil.jsx';
16-
import {createContentWrapper} from '../../ui/panel/DockLayoutPanel.jsx';
16+
import {SplitContent} from '../../ui/panel/DockLayoutPanel.jsx';
1717
import Validate from '../../util/Validate.js';
1818
import {dispatchActiveTableChanged} from '../../tables/TablesCntlr.js';
1919
import FieldGroupUtils from '../../fieldGroup/FieldGroupUtils';
2020
import FieldGroupCntlr, {dispatchValueChange, dispatchMultiValueChange} from '../../fieldGroup/FieldGroupCntlr.js';
2121
import {getActiveTableId, getColumnIdx} from '../../tables/TableUtil.js';
2222
import {LC, updateLayoutDisplay, getValidValueFrom, getFullRawTable} from './LcManager.js';
2323
import {doPFCalculate, getPhase} from './LcPhaseTable.js';
24-
import {LcPeriodogram, startPeriodogramPopup, cancelPeriodogram, popupId} from './LcPeriodogram.jsx';
24+
import {LcPeriodogram, cancelPeriodogram, popupId} from './LcPeriodogram.jsx';
2525
import {LO_VIEW, getLayouInfo} from '../../core/LayoutCntlr.js';
2626
import {isDialogVisible} from '../../core/ComponentCntlr.js';
2727
import {updateSet} from '../../util/WebUtil.js';
@@ -241,51 +241,35 @@ const PeriodStandardView = (props) => {
241241
const aroundButton = {margin: space};
242242

243243
return (
244-
<div style={{display: 'flex', flexDirection: 'column', flexGrow: 1, position: 'relative'}}>
244+
<FieldGroup groupKey={pfinderkey} style={{display: 'flex', flexDirection: 'column', position: 'relative', flexGrow: 1, minHeight: 500}}
245+
reducerFunc={LcPFReducer(initState)} keepState={true}>
245246
<div style={{flexGrow: 1, position: 'relative'}}>
246-
<div style={{position: 'absolute', top: 0, right: 0, bottom: 0, left: 0}}>
247-
<FieldGroup groupKey={pfinderkey}
248-
reducerFunc={LcPFReducer(initState)} keepState={true}>
249-
<SplitPane split='horizontal' minSize={100} defaultSize={'90%'}>
250-
<SplitPane split='horizontal' minSize={100} defaultSize={'50%'}>
251-
<SplitPane split='vertical' minSize={20} defaultSize={PanelResizableStyle.width} allowResize={false}>
252-
{createContentWrapper(<LcPFOptionsBox/>)}
253-
{createContentWrapper(<PhaseFoldingChart />)}
254-
</SplitPane>
255-
{createContentWrapper(
256-
<SplitPane split='horizontal' minSize={10} defaultSize={30}>
257-
{displayMode===LC.PERGRAM_PAGE ?
258-
<div style={aroundButton}>
259-
<button type='button'
260-
className='button std hl'
261-
onClick={startPeriodogramPopup(LC.FG_PERIODOGRAM_FINDER)}>Change Periodogram
262-
</button>
263-
</div> : <div></div>}
264-
<LcPeriodogram displayMode={displayMode} />
265-
</SplitPane>)}
266-
</SplitPane>
267-
<div style={{width: '100%', position: 'absolute',
268-
height: 20, marginTop: 5, marginBottom: 5,
269-
display: 'flex', justifyContent: 'flex-end'}}>
270-
<div style={aroundButton}>
271-
<button type='button' className='button std hl' onClick={()=>cancelStandard()}>
272-
Cancel
273-
</button>
247+
<SplitPane split='horizontal' primary='second' maxSize={-100} minSize={100} defaultSize={400}>
248+
<SplitContent>
249+
<div className='phaseFolded'>
250+
<div className='phaseFolded__options'>
251+
<LcPFOptionsBox/>
274252
</div>
275-
<CompleteButton
276-
style={aroundButton}
277-
groupKey={[pfinderkey]}
278-
onSuccess={setPFTableSuccess()}
279-
onFail={setPFTableFail()}
280-
text={acceptPeriodTxt}
281-
includeUnmounted={true}
282-
/>
253+
<PhaseFoldingChart/>
283254
</div>
284-
</SplitPane>
285-
</FieldGroup>
255+
</SplitContent>
256+
<LcPeriodogram displayMode={displayMode}/>
257+
</SplitPane>
258+
</div>
259+
<div style={{flexGrow: 0, display: 'inline-flex', justifyContent: 'flex-end', height: 40}}>
260+
<div style={{margin: 5}}>
261+
<button type='button' className='button std hl' onClick={()=>cancelStandard()}>Cancel</button>
286262
</div>
263+
<CompleteButton
264+
style={aroundButton}
265+
groupKey={[pfinderkey]}
266+
onSuccess={setPFTableSuccess()}
267+
onFail={setPFTableFail()}
268+
text={acceptPeriodTxt}
269+
includeUnmounted={true}
270+
/>
287271
</div>
288-
</div>
272+
</FieldGroup>
289273
);
290274
};
291275

@@ -311,6 +295,7 @@ PeriodExpandedView.propTypes = {
311295
displayMode: PropTypes.string
312296
};
313297

298+
314299
/**
315300
* @summary 2D xyplot component on phase folding
316301
*/

src/firefly/js/templates/lightcurve/LcPeriodogram.jsx

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import React, {Component, PropTypes} from 'react';
66
import sCompare from 'react-addons-shallow-compare';
77
import { get, set, has} from 'lodash';
88
import SplitPane from 'react-split-pane';
9-
import {createContentWrapper} from '../../ui/panel/DockLayoutPanel.jsx';
9+
import {SplitContent} from '../../ui/panel/DockLayoutPanel.jsx';
1010
import {LC, getValidValueFrom, updateLayoutDisplay} from './LcManager.js';
1111
import {getTypeData} from './LcPeriod.jsx';
1212
import FieldGroupUtils from '../../fieldGroup/FieldGroupUtils';
@@ -120,12 +120,15 @@ export function LcPeriodogram(props) {
120120
const {displayMode, groupKey=pgfinderkey, expanded} = props;
121121
const resultProps = {expanded, groupKey};
122122

123-
return (
124-
<div style={{height: '100%', width: '100%', position: 'absolute'}}>
125-
{(displayMode&&displayMode==='period') ? <PeriodogramButton groupKey={groupKey} />
126-
: <PeriodogramResult {...resultProps} />}
127-
</div>
128-
);
123+
if (displayMode&&displayMode==='period') {
124+
return (
125+
<SplitContent>
126+
<PeriodogramButton groupKey={groupKey}/>
127+
</SplitContent>
128+
);
129+
} else {
130+
return <PeriodogramResult {...resultProps} />;
131+
}
129132
}
130133

131134

@@ -162,6 +165,14 @@ PeriodogramButton.propTypes = {
162165
groupKey: PropTypes.string.isRequired
163166
};
164167

168+
function ChangePeriodogram() {
169+
return (
170+
<button type='button' className='button std hl'
171+
onClick={startPeriodogramPopup(LC.FG_PERIODOGRAM_FINDER)}>Change Periodogram
172+
</button>
173+
);
174+
}
175+
165176
export const popupId = 'periodogramPopup';
166177

167178
/**
@@ -587,15 +598,20 @@ const PeriodogramResult = ({expanded}) => {
587598
closeable={true}
588599
expandedMode={expanded===LO_VIEW.xyPlots}/>);
589600

601+
602+
590603

591604
if (!expanded || expanded === LO_VIEW.none) {
592605

593-
resultLayout = (<SplitPane split='vertical' minSize={20} defaultSize={'50%'}>
594-
{createContentWrapper(tables)}
595-
{createContentWrapper(xyPlot)}
606+
resultLayout = (<SplitPane split='vertical' maxSize={-20} minSize={20} defaultSize={565}>
607+
<SplitContent>
608+
<div style={{margin: '0 0 5px 6px'}}><ChangePeriodogram/></div>
609+
<div style={{height: 'calc(100% - 28px'}}>{tables}</div>
610+
</SplitContent>
611+
<SplitContent>{xyPlot}</SplitContent>
596612
</SplitPane>);
597613
} else {
598-
resultLayout = (<div style={{ flex: 'auto', display: 'flex', flexFlow: 'column', overflow: 'hidden', height: '100%'}}>
614+
resultLayout = (<div style={{flexGrow: 1}}>
599615
{expanded === LO_VIEW.tables ? tables : xyPlot}
600616
</div>);
601617
}

0 commit comments

Comments
 (0)