Skip to content

Commit 87bd411

Browse files
committed
- fix FireflyHeatmap's mappings disapeared after component remounted
1 parent b696702 commit 87bd411

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/firefly/js/charts/dataTypes/FireflyHeatmap.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ import BrowserInfo from '../../util/BrowserInfo.js';
1919
*/
2020
export function getTraceTSEntries({traceTS, chartId, traceNum}) {
2121
const {mappings} = traceTS;
22+
23+
if (!mappings) return {};
24+
2225
const {fireflyData, fireflyLayout} = getChartData(chartId) || {};
2326
// server call parameters
2427
const xbins = get(fireflyData, `${traceNum}.nbins.x`);

src/firefly/js/tables/TableUtil.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -642,13 +642,10 @@ export function getAsyncTableSourceUrl(tbl_ui_id) {
642642

643643
function makeTableSourceUrl(columns, request) {
644644
const tableRequest = Object.assign(cloneDeep(request), {startIdx: 0,pageSize : MAX_ROW});
645-
const visiCols = columns.filter( (col) => {
646-
return get(col, 'visibility', 'show') === 'show';
647-
}).map( (col) => {
648-
return col.name;
649-
} );
645+
const visiCols = columns.filter( (col) => get(col, 'visibility', 'show') === 'show')
646+
.map( (col) => col.name);
650647
if (visiCols.length !== columns.length) {
651-
tableRequest['inclCols'] = visiCols.toString();
648+
tableRequest['inclCols'] = visiCols.map( (c) => c.includes('"') ? c : '"' + c + '"'); // add quotes to cname unless it's already quoted.
652649
}
653650
Reflect.deleteProperty(tableRequest, 'tbl_id');
654651
const params = omitBy({

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ function periodogramSuccess(popupId, hideDropDown = false) {
523523
peaks: get(request, [pKeyDef.peaks.fkey]),
524524
table_name: LC.PEAK_TABLE,
525525
sortInfo: sortInfoString('SDE', false) // sort peak table by column SDE, descending
526-
}, {tbl_id: LC.PEAK_TABLE, pageSize: parseInt(peak), inclCols : '"PEAK", "PERIOD", "POWER", "SDE"'}); // period and power are reserved words in sql.. put them in quotes
526+
}, {tbl_id: LC.PEAK_TABLE, pageSize: parseInt(peak), inclCols : '"Peak", "Period", "Power", "SDE"'}); // period and power are reserved words in sql.. put them in quotes
527527

528528
var tReq = makeTblRequest('LightCurveProcessor', LC.PERIODOGRAM_TABLE, {
529529
original_table: srcFile,
@@ -538,7 +538,7 @@ function periodogramSuccess(popupId, hideDropDown = false) {
538538
table_name: LC.PERIODOGRAM_TABLE
539539
/* Should we do the same for Power column in Periodogram? */
540540
/*sortInfo: sortInfoString('Power', false)*/
541-
}, {tbl_id: LC.PERIODOGRAM_TABLE, inclCols : '"PERIOD", "POWER"'});
541+
}, {tbl_id: LC.PERIODOGRAM_TABLE, inclCols : '"Period", "Power"'});
542542

543543

544544
if (tReq !== null) {

src/firefly/js/ui/TestQueriesPanel.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ function renderPeriodogram(fields) {
167167
//'peaks' : 50
168168
//'result_table': 'http://web.ipac.caltech.edu/staff/ejoliet/demo/vo-nexsci-result-sample.xml'
169169
},
170-
{inclCols : 'Power,Period'});
170+
{inclCols : '"Power","Period"'});
171171
} else if (opt === 1) {
172172
tReq = makeTblRequest('PhaseFoldedProcessor', 'Phase folded', {
173173
'period_days': ds,
@@ -189,7 +189,7 @@ function renderPeriodogram(fields) {
189189
//'alg': 'ls', //There are three algorithms: ls (Lomb-Scargle), bls (Box-fitting Least Squares), and plav (Plavchan 2008). The default algorithm is Lomb-Scargle.
190190
'peaks' : 57
191191
//'result_table': 'http://web.ipac.caltech.edu/staff/ejoliet/demo/vo-nexsci-result-sample.xml'
192-
}, {inclCols : 'Peak, Period, Power, SDE'});
192+
}, {inclCols : '"Peak", "Period", "Power", "SDE"'});
193193
}
194194

195195
console.log(ds);

0 commit comments

Comments
 (0)