Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

WV-3581 - Improved Charting Error Messages (#6081)

christof-wittreich63b09ec51ce7
diff --git a/web/js/components/charting/chart-component.js b/web/js/components/charting/chart-component.js
index 1a15f0f46..4917420f7 100644
--- a/web/js/components/charting/chart-component.js
+++ b/web/js/components/charting/chart-component.js
@@ -18,7 +18,7 @@ function ChartComponent (props) {
numRangeDays,
isTruncated,
title,
- STEP_NUM,
+ numPoints,
} = liveData;
// Arbitrary array of colors to use
@@ -250,11 +250,11 @@ function ChartComponent (props) {
</b>
have been reduced from
<b>
- {` ${numRangeDays} days `}
+ {` ${numRangeDays} `}
</b>
to
<b>
- {` ${STEP_NUM} days`}
+ {` ${numPoints}`}
</b>
.
</i>
diff --git a/web/js/components/sidebar/charting-mode-options.js b/web/js/components/sidebar/charting-mode-options.js
index 9fe2076fa..27b5bcbf7 100644
--- a/web/js/components/sidebar/charting-mode-options.js
+++ b/web/js/components/sidebar/charting-mode-options.js
@@ -41,7 +41,7 @@ const sources = {};
let init = false;
const STEP_NUM = 31;
const SERVER_ERROR_MESSAGE = 'An error has occurred while requesting the charting data. Please try again in a few minutes.';
-const NO_DATA_ERROR_MESSAGE = 'No data was found for this request. Please check the layer, date(s) & location to process & try again.';
+const NO_DATA_ERROR_MESSAGE = 'No data was found for this request. Please check the layer, date(s) & location.';
function ChartingModeOptions(props) {
const {
@@ -411,6 +411,7 @@ function ChartingModeOptions(props) {
if (timeSpanSelection === 'range') {
const rechartsData = formatGIBSDataForRecharts(dataToRender);
const numRangeDays = Math.floor((Date.parse(initialEndDate) - Date.parse(initialStartDate)) / 86400000);
+ const numPoints = STEP_NUM - (data?.body?.errors?.error_count > 0 ? data.body.errors.error_count : 0);
displayChart({
title: dataToRender.title,
subtitle: dataToRender.subtitle,
@@ -420,7 +421,7 @@ function ChartingModeOptions(props) {
endDate: secondaryDate,
numRangeDays,
isTruncated: numRangeDays > STEP_NUM,
- STEP_NUM,
+ numPoints,
});
updateChartRequestStatus(false);
} else {