Skip to content

Commit 64cb63b

Browse files
authored
Merge pull request #992 from Caltech-IPAC/FIREFLY-362-LowerLimits
FIREFLY-362-LowerLimits fix the text shown in the tooltip of upward pointing arrows for lower limit on Y axis values in scatter plots
2 parents f04f5d5 + 5f0aa85 commit 64cb63b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/firefly/js/charts/dataTypes/FireflyGenericData.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* License information at https://github.com/Caltech-IPAC/firefly/blob/master/License.txt
33
*/
4-
import {get, isArray, isUndefined, uniqueId} from 'lodash';
4+
import {get, isArray, isUndefined, uniqueId, isNil} from 'lodash';
55
import {getTblById, getColumns, getColumn, doFetchTable, stripColumnNameQuotes} from '../../tables/TableUtil.js';
66
import {cloneRequest, MAX_ROW} from '../../tables/TableRequestUtil.js';
77
import {dispatchChartUpdate, dispatchError, getChartData, getTraceSymbol, hasUpperLimits, hasLowerLimits} from '../ChartsCntlr.js';
@@ -346,7 +346,14 @@ function addScatterChanges({changes, chartId, traceNum, tablesource, tableModel}
346346
const xerr = hasXErrors ? formatError(xval, xErr[idx], xErrLow[idx], xErrHigh[idx]) : '';
347347
const yerr = hasYErrors ? formatError(yval, yErr[idx], yErrLow[idx], yErrHigh[idx]) : '';
348348
const cval = isArray(colors) ? `<br> ${cTipLabel} = ${parseFloat(colors[idx])} ` : '';
349-
const ul = annotations[idx] ? '<br> Upper Limit ' : '';
349+
let ul = '';
350+
if (annotations[idx]) {
351+
if (!isNil(changes[`fireflyData.${traceNum}.yMax`][idx])) {
352+
ul = '<br> Upper Limit ';
353+
} else if (!isNil(changes[`fireflyData.${traceNum}.yMin`][idx])) {
354+
ul = '<br> Lower Limit ';
355+
}
356+
}
350357
return `<span> ${xTipLabel} = ${parseFloat(xval)}${xerr} ${xUnit} <br>` +
351358
` ${yTipLabel} = ${parseFloat(yval)}${yerr} ${yUnit} ${ul} ${cval}</span>`;
352359
});

0 commit comments

Comments
 (0)