From bf2aca3c06f5c247b74ec248816f368801e13f18 Mon Sep 17 00:00:00 2001 From: cwang2016 Date: Mon, 29 Jun 2020 13:52:46 -0700 Subject: [PATCH 1/2] FIREFLY-362-LowerLimits fix the text shown in the tooltip of upward pointing arrows for lower limit on Y axis values in scatter plots --- src/firefly/js/charts/dataTypes/FireflyGenericData.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/firefly/js/charts/dataTypes/FireflyGenericData.js b/src/firefly/js/charts/dataTypes/FireflyGenericData.js index 26aa2ce11e..f32c6cc3a0 100644 --- a/src/firefly/js/charts/dataTypes/FireflyGenericData.js +++ b/src/firefly/js/charts/dataTypes/FireflyGenericData.js @@ -1,7 +1,7 @@ /* * License information at https://github.com/Caltech-IPAC/firefly/blob/master/License.txt */ -import {get, isArray, isUndefined, uniqueId} from 'lodash'; +import {get, isArray, isUndefined, uniqueId, isNull} from 'lodash'; import {getTblById, getColumns, getColumn, doFetchTable, stripColumnNameQuotes} from '../../tables/TableUtil.js'; import {cloneRequest, MAX_ROW} from '../../tables/TableRequestUtil.js'; import {dispatchChartUpdate, dispatchError, getChartData, getTraceSymbol, hasUpperLimits, hasLowerLimits} from '../ChartsCntlr.js'; @@ -346,7 +346,14 @@ function addScatterChanges({changes, chartId, traceNum, tablesource, tableModel} const xerr = hasXErrors ? formatError(xval, xErr[idx], xErrLow[idx], xErrHigh[idx]) : ''; const yerr = hasYErrors ? formatError(yval, yErr[idx], yErrLow[idx], yErrHigh[idx]) : ''; const cval = isArray(colors) ? `
${cTipLabel} = ${parseFloat(colors[idx])} ` : ''; - const ul = annotations[idx] ? '
Upper Limit ' : ''; + let ul = ''; + if (annotations[idx]) { + if (!isNull(changes[`fireflyData.${traceNum}.yMax`][idx])) { + ul = '
Upper Limit '; + } else if (!isNull(changes[`fireflyData.${traceNum}.yMin`][idx])) { + ul = '
Lower Limit '; + } + } return ` ${xTipLabel} = ${parseFloat(xval)}${xerr} ${xUnit}
` + ` ${yTipLabel} = ${parseFloat(yval)}${yerr} ${yUnit} ${ul} ${cval}
`; }); From 5f0aa85d1239b198939faa5b4d2c098436da0fab Mon Sep 17 00:00:00 2001 From: cwang2016 Date: Mon, 29 Jun 2020 15:15:45 -0700 Subject: [PATCH 2/2] FIREFLY-362-LowerLimits use isNil instead of isNull to check list content in FireflyGenericData. --- src/firefly/js/charts/dataTypes/FireflyGenericData.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/firefly/js/charts/dataTypes/FireflyGenericData.js b/src/firefly/js/charts/dataTypes/FireflyGenericData.js index f32c6cc3a0..48acc49932 100644 --- a/src/firefly/js/charts/dataTypes/FireflyGenericData.js +++ b/src/firefly/js/charts/dataTypes/FireflyGenericData.js @@ -1,7 +1,7 @@ /* * License information at https://github.com/Caltech-IPAC/firefly/blob/master/License.txt */ -import {get, isArray, isUndefined, uniqueId, isNull} from 'lodash'; +import {get, isArray, isUndefined, uniqueId, isNil} from 'lodash'; import {getTblById, getColumns, getColumn, doFetchTable, stripColumnNameQuotes} from '../../tables/TableUtil.js'; import {cloneRequest, MAX_ROW} from '../../tables/TableRequestUtil.js'; import {dispatchChartUpdate, dispatchError, getChartData, getTraceSymbol, hasUpperLimits, hasLowerLimits} from '../ChartsCntlr.js'; @@ -348,9 +348,9 @@ function addScatterChanges({changes, chartId, traceNum, tablesource, tableModel} const cval = isArray(colors) ? `
${cTipLabel} = ${parseFloat(colors[idx])} ` : ''; let ul = ''; if (annotations[idx]) { - if (!isNull(changes[`fireflyData.${traceNum}.yMax`][idx])) { + if (!isNil(changes[`fireflyData.${traceNum}.yMax`][idx])) { ul = '
Upper Limit '; - } else if (!isNull(changes[`fireflyData.${traceNum}.yMin`][idx])) { + } else if (!isNil(changes[`fireflyData.${traceNum}.yMin`][idx])) { ul = '
Lower Limit '; } }