Skip to content

Commit 92ad74f

Browse files
Update local_forecasts.js
1 parent 1ce09e9 commit 92ad74f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

local_forecasts.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ function sitesArrayToGeoJSON(sites, param = "no2") {
644644
location_name: site.location || "Unknown Location",
645645
time_zone: site.timezone,
646646
forecasted_value: value,
647-
aqi_value: aqi,
647+
aqi_value: parseInt(aqi),
648648
aqi_color: aqiLevel.color,
649649
status: "active",
650650
observation_source: "NASA",
@@ -808,7 +808,7 @@ function readCompressedJsonAndAddBanners(fileUrl, selectedSpecies) {
808808
const siteData = {
809809
location_name: site.location,
810810
observation_source: "NASA",
811-
forecasted_value: forecasted_value,
811+
forecasted_value: parseInt(forecasted_value),
812812
status: "active",
813813
latitude: site.lat,
814814
longitude: site.lon,
@@ -1325,8 +1325,8 @@ function readApiBaker(options = {}) {
13251325

13261326

13271327
if (plot.displayAQI) {
1328-
const currentAqi = currentValue;
1329-
const nextAqi = nextValue;
1328+
const currentAqi = parseInt(currentValue);
1329+
const nextAqi = parseInt(nextValue);
13301330

13311331

13321332
let nextLabel = "Next hour";
@@ -1394,10 +1394,10 @@ function readApiBaker(options = {}) {
13941394
.filter(({ dt }) => dt && dt.startsWith(today))
13951395
.map(({ val }) => typeof val === "number" ? val : NaN)
13961396
.filter(val => !isNaN(val));
1397-
const dailyAvg = todayVals.length ? (todayVals.reduce((a, b) => a + b, 0) / todayVals.length) : 'N/A';
1398-
const currentVal = currentIdx !== -1 ? values[currentIdx] : 'N/A';
1399-
const prevVal = prevIdx !== -1 ? values[prevIdx] : 'N/A';
1400-
const nextVal = nextIdx !== -1 ? values[nextIdx] : 'N/A';
1397+
const dailyAvg = todayVals.length ? parseInt((todayVals.reduce((a, b) => a + b, 0) / todayVals.length)) : 'N/A';
1398+
const currentVal = parseInt(currentIdx) !== -1 ? values[currentIdx] : 'N/A';
1399+
const prevVal = parseInt(prevIdx) !== -1 ? values[prevIdx] : 'N/A';
1400+
const nextVal = parseInt(nextIdx) !== -1 ? values[nextIdx] : 'N/A';
14011401
const change = getChange(currentVal, dailyAvg);
14021402
const prevChange = getChange(prevVal, dailyAvg);
14031403
const nextChange = getChange(nextVal, dailyAvg);

0 commit comments

Comments
 (0)