Skip to content

Commit 456f33e

Browse files
authored
Merge pull request #317 from Caltech-IPAC/DM-9164-add-lc-help-links
DM-9164 add help links id and anchors to LC viewer
2 parents 86dbe30 + a9aa5ed commit 456f33e

File tree

10 files changed

+69
-31
lines changed

10 files changed

+69
-31
lines changed

src/firefly/js/charts/dataTypes/XYColsCDT.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,12 @@ export function getDefaultXYPlotOptions(tbl_id) {
141141
* @param {string} params.chartId - if no chart id is specified table id is used as chart id
142142
* @param {XYPlotParams} params.xyPlotParams - XY plot options (column names, etc.)
143143
* @param {string} params.tblId - table id
144+
* @param {string} params.help_id - help id
144145
* @param {Function} [params.dispatcher=flux.process] - only for special dispatching uses such as remote
145146
*/
146-
export function loadXYPlot({chartId, xyPlotParams, tblId, dispatcher=flux.process}) {
147+
export function loadXYPlot({chartId, xyPlotParams, help_id, tblId, dispatcher=flux.process}) {
147148
//SCATTER
148-
dispatchChartAdd({chartId, chartType: SCATTER, groupId: tblId,
149+
dispatchChartAdd({chartId, chartType: SCATTER, help_id, groupId: tblId,
149150
chartDataElements: [
150151
{
151152
type: DT_XYCOLS,

src/firefly/js/tables/ui/TablesContainer.jsx

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,14 @@ export class TablesContainer extends Component {
3737
}
3838

3939
nextState(props) {
40-
var {mode, tbl_group, closeable} = props;
40+
var {mode, tbl_group, closeable, tableOptions} = props;
4141
const expandedMode = props.expandedMode || getExpandedMode() === LO_VIEW.tables;
4242
if (expandedMode && mode !== 'standard') {
4343
tbl_group = TblUtil.getTblExpandedInfo().tbl_group;
4444
}
4545
const {tables, layout, active} = TblUtil.getTableGroup(tbl_group) || {};
46-
return {closeable, tbl_group, expandedMode, tables, layout, active};
46+
47+
return {closeable, tbl_group, expandedMode, tables, tableOptions, layout, active};
4748
}
4849

4950
storeUpdate() {
@@ -53,11 +54,11 @@ export class TablesContainer extends Component {
5354
}
5455

5556
render() {
56-
const {closeable, tbl_group, expandedMode, tables, layout, active} = this.state;
57+
const {closeable, tbl_group, expandedMode, tables, tableOptions, layout, active} = this.state;
5758
if (expandedMode) {
58-
return <ExpandedView {...{active, tables, layout, expandedMode, closeable, tbl_group}} />;
59+
return <ExpandedView {...{active, tables, tableOptions, layout, expandedMode, closeable, tbl_group}} />;
5960
} else {
60-
return isEmpty(tables) ? <div></div> : <StandardView {...{active, tables, expandedMode, tbl_group}} />;
61+
return isEmpty(tables) ? <div></div> : <StandardView {...{active, tables, tableOptions, expandedMode, tbl_group}} />;
6162
}
6263
}
6364
}
@@ -99,7 +100,7 @@ function ExpandedView(props) {
99100

100101
function StandardView(props) {
101102
// eslint-disable-next-line
102-
const {tables, expandedMode, active, tbl_group} = props;
103+
const {tables, tableOptions, expandedMode, active, tbl_group} = props;
103104

104105
var activeIdx = Object.keys(tables).findIndex( (tbl_ui_id) => get(tables,[tbl_ui_id,'tbl_id']) === active);
105106
activeIdx = activeIdx === -1 ? 0 : activeIdx;
@@ -109,30 +110,33 @@ function StandardView(props) {
109110
};
110111
const keys = Object.keys(tables);
111112
if (keys.length === 1) {
112-
return <SingleTable table={get(tables, [keys[0]])} expandedMode={expandedMode}/>;
113+
return <SingleTable table={get(tables, [keys[0]])} expandedMode={expandedMode} tableOptions={tableOptions}/>;
113114
} else {
114115
return (
115116
<Tabs defaultSelected={activeIdx} onTabSelect={onTabSelect} resizable={true}>
116-
{tablesAsTab(tables, expandedMode)}
117+
{tablesAsTab(tables, tableOptions, expandedMode)}
117118
</Tabs>
118119
);
119120
}
120121
}
121122

122123
// eslint-disable-next-line
123-
function SingleTable({table, expandedMode}) {
124+
function SingleTable({table, tableOptions, expandedMode}) {
124125
var {tbl_id, title, removable, tbl_ui_id, options={}} = table;
125126

127+
options = Object.assign({}, options, tableOptions);
128+
126129
return (
127130
<TablePanel key={tbl_id} border={true} {...{title, removable, tbl_id, tbl_ui_id, ...options, expandedMode}} />
128131
);
129132
}
130133

131-
function tablesAsTab(tables, expandedMode) {
134+
function tablesAsTab(tables, tableOptions, expandedMode) {
132135

133136
return tables &&
134137
Object.keys(tables).map( (key) => {
135138
var {tbl_id, title, removable, tbl_ui_id, options={}} = tables[key];
139+
options = Object.assign({}, options, tableOptions);
136140
const onTabRemove = () => {
137141
dispatchTableRemove(tbl_id);
138142
};

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ function InlineRightToolbarWrapper({visRoot,pv,dlAry}){
154154
showExpand={true}
155155
showToolbarButton={tb}
156156
showDelete ={false}
157+
help_id={'main1TSV.images'}
157158
/>
158159
</div>
159160
);

src/firefly/js/templates/lightcurve/LcManager.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ function updateRawTableChart(timeCName, fluxCName) {
188188

189189
if (timeCName && fluxCName) {
190190
const xyPlotParams = {x: {columnOrExpr: timeCName}, y: {columnOrExpr: fluxCName, options: 'grid,flip'}};
191-
loadXYPlot({chartId: LC.RAW_TABLE, tblId: LC.RAW_TABLE, xyPlotParams});
191+
loadXYPlot({chartId: LC.RAW_TABLE, tblId: LC.RAW_TABLE, xyPlotParams, help_id: 'main1TSV.plot'});
192192
}
193193
}
194194

@@ -203,7 +203,7 @@ function updatePhaseTableChart(flux) {
203203
x: {columnOrExpr: LC.PHASE_CNAME, options: 'grid'},
204204
y: {columnOrExpr: flux, options: 'grid,flip'}
205205
};
206-
loadXYPlot({chartId: LC.PHASE_FOLDED, tblId: LC.PHASE_FOLDED, xyPlotParams});
206+
loadXYPlot({chartId: LC.PHASE_FOLDED, tblId: LC.PHASE_FOLDED, xyPlotParams, help_id: 'main1TSV.plot'});
207207
}
208208
}
209209

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {get, set, pick, debounce, defer} from 'lodash';
99
import SplitPane from 'react-split-pane';
1010
import {flux} from '../../Firefly.js';
1111
import CompleteButton from '../../ui/CompleteButton.jsx';
12+
import HelpIcon from '../../ui/HelpIcon.jsx';
1213
import {RangeSlider} from '../../ui/RangeSlider.jsx';
1314
import {FieldGroup} from '../../ui/FieldGroup.jsx';
1415
import {ValidationField} from '../../ui/ValidationField.jsx';
@@ -234,6 +235,9 @@ const PeriodStandardView = (props) => {
234235
</SplitPane>
235236
</div>
236237
<div style={{flexGrow: 0, display: 'inline-flex', justifyContent: 'flex-end', height: 40}}>
238+
<div style={{marginTop:7, marginRight:10}}>
239+
<HelpIcon helpId={'findpTSV.acceptp'}/>
240+
</div>
237241
<div style={{margin: 5}}>
238242
<button type='button' className='button std hl' onClick={()=>cancelStandard()}>Cancel</button>
239243
</div>
@@ -606,6 +610,9 @@ function LcPFOptions({fields, lastPeriod, periodList=[]}) {
606610
var pSize = panelSpace/2 - 5;
607611

608612
return (<div style={{width: PanelResizableStyle.width - offset}}>
613+
<div style={{display:'flex', flexDirection:'row-reverse', justifyContent:'space-between'}}>
614+
<HelpIcon helpId={'findpTSV.settings'}/>
615+
</div>
609616
<br/>
610617
{ReadOnlyText({label: get(defValues, [fKeyDef.time.fkey, 'label']),
611618
labelWidth: get(defValues, [fKeyDef.time.fkey, 'labelWidth']),

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

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {TablesContainer} from '../../tables/ui/TablesContainer.jsx';
1919
import {ChartsContainer} from '../../charts/ui/ChartsContainer.jsx';
2020
import CompleteButton from '../../ui/CompleteButton.jsx';
2121
import {loadXYPlot} from '../../charts/dataTypes/XYColsCDT.js';
22+
import {dispatchChartAdd} from '../../charts/ChartsCntlr.js';
2223
import {LO_VIEW, getLayouInfo} from '../../core/LayoutCntlr.js';
2324
import {dispatchShowDialog, dispatchHideDialog, isDialogVisible} from '../../core/ComponentCntlr.js';
2425
import DialogRootContainer from '../../ui/DialogRootContainer.jsx';
@@ -156,6 +157,9 @@ function PeriodogramButton(props) {
156157
<button type='button' style={{maxWidth: '50%'}}
157158
className='button std'
158159
onClick={startPeriodogramPopup(groupKey)}>Find Periodogram</button>
160+
<div style={{marginLeft:10}}>
161+
<HelpIcon helpId={'findpTSV.pgram'}/>
162+
</div>
159163
</div>
160164
);
161165
}
@@ -187,7 +191,7 @@ export var startPeriodogramPopup = (groupKey) => {
187191
var popup = (
188192
<PopupPanel title={'Periodogram'}>
189193
<PeriodogramOptionsBox groupKey={groupKey} />
190-
<div style={{display: 'flex', margin: '30px 10px 10px 10px'}} >
194+
<div style={{display: 'flex', margin: '30px 10px 10px 10px', justifyContent:'space-between'}} >
191195
<div style={aroundButton}>
192196
<button type='button' className='button std hl'
193197
onClick={cancelPeriodogram(groupKey, popupId)}>Cancel
@@ -200,6 +204,9 @@ export var startPeriodogramPopup = (groupKey) => {
200204
onFail={periodogramFail(popupId, true)}
201205
text={'Periodogram Calculation'} />
202206
</div>
207+
<div style={{marginTop:17}}>
208+
<HelpIcon helpId={'findpTSV.pgramresults'}/>
209+
</div>
203210
</div>
204211
</PopupPanel>);
205212

@@ -268,7 +275,7 @@ class PeriodogramOptionsBox extends Component {
268275
</button>
269276
<br/>
270277
<div style={{marginTop: 10}}>
271-
{'Leave the fields blank to use default values.'} <HelpIcon helpId={'periodogram.options'}/>
278+
{'Leave the fields blank to use default values.'}
272279
</div>
273280
</InputGroup>
274281
</FieldGroup>
@@ -528,9 +535,11 @@ function periodogramSuccess(popupId, hideDropDown = false) {
528535
dispatchTableSearch(tReq2, {removable: true, tbl_group: LC.PERIODOGRAM_GROUP});
529536
const xyPlotParams = {
530537
x: {columnOrExpr: LC.PEAK_CNAME, options: 'grid'},
531-
y: {columnOrExpr: LC.POWER_CNAME, options: 'grid'}
538+
y: {columnOrExpr: LC.POWER_CNAME, options: 'grid'},
539+
plotStyle: 'linepoints'
540+
532541
};
533-
loadXYPlot({chartId: LC.PEAK_TABLE, tblId: LC.PEAK_TABLE, xyPlotParams});
542+
loadXYPlot({chartId: LC.PEAK_TABLE, tblId: LC.PEAK_TABLE, xyPlotParams, help_id: 'findpTSV.pgramresults'});
534543
}
535544

536545
var tReq = makeTblRequest('LightCurveProcessor', LC.PERIODOGRAM_TABLE, {
@@ -554,9 +563,16 @@ function periodogramSuccess(popupId, hideDropDown = false) {
554563
const xyPlotParams = {
555564
userSetBoundaries: {yMin: 0},
556565
x: {columnOrExpr: LC.PERIOD_CNAME, options: 'grid,log'},
557-
y: {columnOrExpr: LC.POWER_CNAME, options: 'grid'}
566+
y: {columnOrExpr: LC.POWER_CNAME, options: 'grid'},
567+
plotStyle: 'linepoints'
558568
};
559-
loadXYPlot({chartId: LC.PERIODOGRAM_TABLE, tblId: LC.PERIODOGRAM_TABLE, markAsDefault: true, xyPlotParams});
569+
loadXYPlot({
570+
chartId: LC.PERIODOGRAM_TABLE,
571+
tblId: LC.PERIODOGRAM_TABLE,
572+
markAsDefault: true,
573+
xyPlotParams,
574+
help_id: 'findpTSV.pgramresults'
575+
});
560576
}
561577

562578
dispatchActiveTableChanged(LC.PERIODOGRAM_TABLE, LC.PERIODOGRAM_GROUP);
@@ -593,7 +609,8 @@ const PeriodogramResult = ({expanded}) => {
593609
mode='both'
594610
tbl_group={LC.PERIODOGRAM_GROUP}
595611
closeable={true}
596-
expandedMode={expanded===LO_VIEW.tables}/>);
612+
expandedMode={expanded===LO_VIEW.tables}
613+
tableOptions={{help_id:'findpTSV.pgramresults'}}/>);
597614
const xyPlot = (<ChartsContainer key='res-charts'
598615
closeable={true}
599616
expandedMode={expanded===LO_VIEW.xyPlots}/>);

src/firefly/js/templates/lightcurve/LcPhaseTable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export function uploadPhaseTable(tbl, flux) {
4040
x: {columnOrExpr: LC.PHASE_CNAME, options: 'grid'},
4141
y: {columnOrExpr: flux, options: 'grid,flip'}
4242
};
43-
loadXYPlot({chartId: tbl_id, tblId: tbl_id, xyPlotParams});
43+
loadXYPlot({chartId: tbl_id, tblId: tbl_id, xyPlotParams, help_id: 'main1TSV.plot'});
4444
});
4545

4646

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

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {LcImageToolbar} from './LcImageToolbar.jsx';
2020
import {DownloadButton, DownloadOptionPanel} from '../../ui/DownloadDialog.jsx';
2121
import {showInfoPopup} from '../../ui/PopupUtil.jsx';
2222
import CompleteButton from '../../ui/CompleteButton.jsx';
23+
import {HelpIcon} from '../../ui/HelpIcon.jsx';
2324
import {getTblById, doFetchTable, isTblDataAvail, MAX_ROW} from '../../tables/TableUtil.js';
2425
import {dispatchMultiValueChange, dispatchRestoreDefaults} from '../../fieldGroup/FieldGroupCntlr.js';
2526
import {logError} from '../../util/WebUtil.js';
@@ -77,14 +78,16 @@ export class LcResult extends Component {
7778
}
7879
if (showXyPlots) {
7980
content.xyPlot = (<ChartsContainer key='res-charts'
80-
closeable={true}
81-
expandedMode={expanded===LO_VIEW.xyPlots}/>);
81+
closeable={true}
82+
expandedMode={expanded===LO_VIEW.xyPlots}
83+
/>);
8284
}
8385
if (showTables) {
8486
content.tables = (<TablesContainer key='res-tables'
85-
mode='both'
86-
closeable={true}
87-
expandedMode={expanded===LO_VIEW.tables}/>);
87+
mode='both'
88+
closeable={true}
89+
expandedMode={expanded===LO_VIEW.tables}
90+
tableOptions={{help_id:'main1TSV.table'}}/>);
8891
}
8992

9093
content.settingBox = (<SettingBox generalEntries={generalEntries} missionEntries={missionEntries}
@@ -194,7 +197,7 @@ class SettingBox extends Component {
194197

195198
const groupKey = getViewerGroupKey(missionEntries);
196199
return (
197-
<div style={{position: 'relative', display: 'inline-flex'}}>
200+
<div style={{position: 'relative', display: 'inline-flex', justifyContent: 'space-between', width: '100%'}}>
198201
<div style={{alignSelf: 'flex-end'}}>
199202
<MissionOptions {...{missionEntries, generalEntries}}/>
200203
</div>
@@ -208,6 +211,9 @@ class SettingBox extends Component {
208211
text={'Period Finding'}
209212
/>
210213
</div>
214+
<div style={{display: 'flex', flexDirection: 'row-reverse'}}>
215+
<HelpIcon helpId={'main1TSV.settings'}/>
216+
</div>
211217
</div>
212218
);
213219
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ export function UploadPanel(props) {
175175
<FormPanel
176176
groupKey={vFileKey}
177177
onSubmit={(request) => onSearchSubmit(request)}
178-
onCancel={dispatchHideDropDown}>
178+
onCancel={dispatchHideDropDown}
179+
help_id={'loadingTSV'}>
179180
<FieldGroup groupKey={vFileKey} validatorFunc={null} keepState={true}>
180181
<FileUpload
181182
wrapperStyle = {wrapperStyle}

src/firefly/js/visualize/ui/VisInlineToolbarView.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {ToolbarButton} from '../../ui/ToolbarButton.jsx';
99
import {LayerButton} from './VisToolbarView.jsx';
1010
import {VisToolbar,showTools} from './VisToolbar.jsx';
1111
import {LayoutType, PopupPanel} from '../../ui/PopupPanel.jsx'
12+
import {HelpIcon} from '../../ui/HelpIcon.jsx';
1213
import {LO_MODE, LO_VIEW, dispatchSetLayoutMode} from '../../core/LayoutCntlr.js';
1314
import DialogRootContainer from '../../ui/DialogRootContainer.jsx';
1415
import {dispatchShowDialog,dispatchHideDialog} from '../../core/ComponentCntlr.js';
@@ -69,7 +70,7 @@ export class VisInlineToolbarView extends Component {
6970
// showToolsClick() {showTools();}
7071

7172
render() {
72-
const {pv, dlAry, showLayer, showExpand, showDelete, showToolbarButton}= this.props;
73+
const {pv, dlAry, showLayer, showExpand, showDelete, showToolbarButton, help_id}= this.props;
7374

7475
return (
7576
<div style={rS}>
@@ -81,7 +82,7 @@ export class VisInlineToolbarView extends Component {
8182
horizontal={true}
8283
visible={showToolbarButton && showExpand}
8384
onClick={showTools}/>
84-
85+
{help_id && <div style={{marginRight: 20}}><HelpIcon helpId={help_id}/></div>}
8586
<ToolbarButton icon={OUTLINE_EXPAND}
8687
tip='Expand this panel to take up a larger area'
8788
horizontal={true}

0 commit comments

Comments
 (0)