Skip to content

Commit 68cec09

Browse files
authored
Merge pull request #473 from Caltech-IPAC/IRSA-737-pixelValueBug
IRSA-737:IRSA Viewer multi-extension pixel value bug
2 parents 4e56f28 + 6361b4e commit 68cec09

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ const column3 = {
7474
};
7575
const column3_r2 = {width: 80, paddingRight: 1, textAlign: 'right', color: 'DarkGray', display: 'inline-block'};
7676

77-
const column4 = {width: 88, paddingLeft:4, display: 'inline-block', textOverflow: 'ellipsis', overflow:'hidden'};
77+
const column4 = {width: 105, paddingLeft:4, display: 'inline-block', textOverflow: 'ellipsis', overflow:'hidden'};
7878
const column5 = {
7979
width: 74,
8080
paddingRight: 1,
@@ -199,7 +199,10 @@ export function getFluxInfo(sndReadout){
199199

200200
for (let i = 0; i < fluxObj.length; i++) {
201201
if (!isNaN(fluxObj[i].value )) {
202-
fluxValue = (fluxObj[i].value < 1000) ? `${myFormat(fluxObj[i].value, fluxObj[i].precision)}` : fluxObj[i].value.toExponential(6).replace('e+', 'E');
202+
//IRSA-737
203+
const min = Number('0.'+'0'.repeat(fluxObj[i].precision-1)+'1');
204+
fluxValue = (Math.abs(fluxObj[i].value) < 1000 &&Math.abs(fluxObj[i].value)>min ) ? `${myFormat(fluxObj[i].value, fluxObj[i].precision)}` : fluxObj[i].value.toExponential(6).replace('e+', 'E');
205+
203206
if (fluxObj[i].unit && !isNaN(fluxObj[i].value)) fluxValue+= ` ${fluxObj[i].unit}`;
204207
fluxValueArrays.push(fluxValue);
205208
}
@@ -215,6 +218,7 @@ export function getFluxInfo(sndReadout){
215218
return {fluxLabels:fluxLabelArrays, 'fluxValues':fluxValueArrays};
216219

217220
}
221+
218222
/**
219223
* Get the mouse readouts from the standard readout and convert to the values based on the toCoordinaeName
220224
* @param readoutItems

0 commit comments

Comments
 (0)