Skip to content

Commit

Permalink
Plots with all null values now display a No Data Found message
Browse files Browse the repository at this point in the history
  • Loading branch information
mollybsmith-noaa committed Aug 20, 2024
1 parent e4a56e8 commit 32c1224
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3150,6 +3150,11 @@ const queryDBTimeSeries = function (
// wait for the future to finish - sort of like 'back to the future' ;)
dFuture.wait();

// if we have only null values, return a no data found
if (!(d.x.some((el) => el !== null) && d.y.some((el) => el !== null))) {
error = matsTypes.Messages.NO_DATA_FOUND;
}

return {
data: d,
error,
Expand Down Expand Up @@ -3283,6 +3288,11 @@ const queryDBSpecialtyCurve = function (
// wait for the future to finish - sort of like 'back to the future' ;)
dFuture.wait();

// if we have only null values, return a no data found
if (!(d.x.some((el) => el !== null) && d.y.some((el) => el !== null))) {
error = matsTypes.Messages.NO_DATA_FOUND;
}

return {
data: d,
error,
Expand Down Expand Up @@ -3372,6 +3382,11 @@ const queryDBReliability = function (pool, statement, appParams, kernel) {
// wait for the future to finish - sort of like 'back to the future' ;)
dFuture.wait();

// if we have only null values, return a no data found
if (!(d.x.some((el) => el !== null) && d.y.some((el) => el !== null))) {
error = matsTypes.Messages.NO_DATA_FOUND;
}

return {
data: d,
error,
Expand Down Expand Up @@ -3460,6 +3475,11 @@ const queryDBPerformanceDiagram = function (pool, statement, appParams) {
// wait for the future to finish - sort of like 'back to the future' ;)
dFuture.wait();

// if we have only null values, return a no data found
if (!(d.x.some((el) => el !== null) && d.y.some((el) => el !== null))) {
error = matsTypes.Messages.NO_DATA_FOUND;
}

return {
data: d,
error,
Expand Down Expand Up @@ -3573,6 +3593,11 @@ const queryDBSimpleScatter = function (
// wait for the future to finish - sort of like 'back to the future' ;)
dFuture.wait();

// if we have only null values, return a no data found
if (!(d.x.some((el) => el !== null) && d.y.some((el) => el !== null))) {
error = matsTypes.Messages.NO_DATA_FOUND;
}

return {
data: d,
error,
Expand Down Expand Up @@ -4109,6 +4134,11 @@ const queryDBContour = function (pool, statement, appParams, statisticStr) {
// wait for the future to finish - sort of like 'back to the future' ;)
dFuture.wait();

// if we have only null values, return a no data found
if (!d.z.some((el) => el !== null)) {
error = matsTypes.Messages.NO_DATA_FOUND;
}

return {
data: d,
error,
Expand Down
1 change: 1 addition & 0 deletions meteor_packages/mats-common/public/MATSReleaseNotes.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ <h4>All apps v5.3.3</h4>
<p>* Fixed broken CSV export.</p>
<p>* Added the ability to select color range to scalar maps.</p>
<p>* Surface app now gets realtime/retro model status out of metadata.</p>
<p>* Plots with all null values now display a No Data Found message.</p>
<p>* The axis merge button no longer does anything if there is only one curve.</p>
<p>* Linted MATScommon.</p>
</div>
Expand Down

0 comments on commit 32c1224

Please sign in to comment.