|
1 | 1 | /* |
2 | 2 | * License information at https://github.com/Caltech-IPAC/firefly/blob/master/License.txt |
3 | 3 | */ |
4 | | -import {get, isArray, isUndefined, uniqueId} from 'lodash'; |
| 4 | +import {get, isArray, isUndefined, uniqueId, isNil} from 'lodash'; |
5 | 5 | import {getTblById, getColumns, getColumn, doFetchTable, stripColumnNameQuotes} from '../../tables/TableUtil.js'; |
6 | 6 | import {cloneRequest, MAX_ROW} from '../../tables/TableRequestUtil.js'; |
7 | 7 | import {dispatchChartUpdate, dispatchError, getChartData, getTraceSymbol, hasUpperLimits, hasLowerLimits} from '../ChartsCntlr.js'; |
@@ -346,7 +346,14 @@ function addScatterChanges({changes, chartId, traceNum, tablesource, tableModel} |
346 | 346 | const xerr = hasXErrors ? formatError(xval, xErr[idx], xErrLow[idx], xErrHigh[idx]) : ''; |
347 | 347 | const yerr = hasYErrors ? formatError(yval, yErr[idx], yErrLow[idx], yErrHigh[idx]) : ''; |
348 | 348 | 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 | + } |
350 | 357 | return `<span> ${xTipLabel} = ${parseFloat(xval)}${xerr} ${xUnit} <br>` + |
351 | 358 | ` ${yTipLabel} = ${parseFloat(yval)}${yerr} ${yUnit} ${ul} ${cval}</span>`; |
352 | 359 | }); |
|
0 commit comments