update data to match newly normalized data from both apis

This commit is contained in:
Justin Cooper 2025-08-20 17:23:45 -05:00
parent 9a3075da9c
commit 5d42842851

View file

@ -39,10 +39,23 @@ export default {
keyToLabel: function(key) { keyToLabel: function(key) {
// Handle special cases first // Handle special cases first
const specialCases = { const specialCases = {
'european_aqi': 'European AQI', 'aqi': 'AQI',
'us_aqi': 'US AQI', 'category_key': 'Category Key',
'category_label': 'Category',
'category_color': 'Category Color',
'category_min': 'Category Min',
'category_max': 'Category Max',
'health_description': 'Health Description',
'health_recommendation': 'Health Recommendation',
'health_sensitive_groups': 'Sensitive Groups',
'primary_pollutant': 'Primary Pollutant',
'pm2_5': 'PM2.5',
'pm10': 'PM10', 'pm10': 'PM10',
'pm2_5': 'PM2.5' 'o3': 'Ozone (O3)',
'no2': 'Nitrogen Dioxide (NO2)',
'so2': 'Sulfur Dioxide (SO2)',
'co': 'Carbon Monoxide (CO)',
'reporting_area': 'Reporting Area'
} }
if (specialCases[key]) { if (specialCases[key]) {
@ -144,129 +157,125 @@ export default {
helpField.setValue(current) helpField.setValue(current)
}, },
// a placeholder for the incoming preview data from live open-meteo requests // a placeholder for the incoming preview data from live air quality requests
currentAirQualityByLocation: {}, currentAirQualityByLocation: {},
CURRENT_PROPS: [ CURRENT_PROPS: [
'european_aqi', 'aqi',
'us_aqi', 'category_key',
'pm10', 'category_label',
'category_color',
'category_min',
'category_max',
'health_description',
'health_recommendation',
'health_sensitive_groups',
'pm2_5', 'pm2_5',
'carbon_monoxide', 'pm10',
'nitrogen_dioxide', 'o3',
'sulphur_dioxide', 'no2',
'ozone', 'so2',
'aerosol_optical_depth', 'co',
'dust', 'primary_pollutant',
'uv_index', 'reporting_area',
'uv_index_clear_sky', 'state',
'ammonia', 'latitude',
'alder_pollen', 'longitude'
'birch_pollen',
'grass_pollen',
'mugwort_pollen',
'olive_pollen',
'ragweed_pollen'
], ],
DAILY_PROPS: [ DAILY_PROPS: [
'european_aqi', 'aqi',
'us_aqi', 'category_key',
'pm10', 'category_label',
'pm2_5', 'category_color',
'carbon_monoxide', 'category_min',
'nitrogen_dioxide', 'category_max',
'sulphur_dioxide', 'health_description',
'ozone', 'health_recommendation',
'aerosol_optical_depth', 'health_sensitive_groups',
'dust', 'primary_pollutant'
'uv_index',
'uv_index_clear_sky',
'ammonia',
'alder_pollen',
'birch_pollen',
'grass_pollen',
'mugwort_pollen',
'olive_pollen',
'ragweed_pollen'
], ],
HELP_TEXT_BY_PROP: { HELP_TEXT_BY_PROP: {
european_aqi: { aqi: {
example: "25", example: "75",
description: "European Air Quality Index. Ranges from 0-20 (good), 20-40 (fair), 40-60 (moderate), 60-80 (poor), 80-100 (very poor) and exceeds 100 for extremely poor conditions." description: "Air Quality Index value. Ranges from 0-50 (good), 51-100 (moderate), 101-150 (unhealthy for sensitive groups), 151-200 (unhealthy), 201-300 (very unhealthy) and 301-500 (hazardous)."
}, },
us_aqi: { category_key: {
example: "45", example: "moderate",
description: "United States Air Quality Index. Ranges from 0-50 (good), 51-100 (moderate), 101-150 (unhealthy for sensitive groups), 151-200 (unhealthy), 201-300 (very unhealthy) and 301-500 (hazardous)." description: "Category key for the air quality level (e.g., good, moderate, unhealthy_sensitive, unhealthy, very_unhealthy, hazardous)."
}, },
pm10: { category_label: {
example: "15.2", example: "Moderate",
description: "Particulate matter with diameter smaller than 10 µm (PM10) close to surface (10 meter above ground), measured in μg/m³." description: "Human-readable category label for the air quality level."
},
category_color: {
example: "#ffff00",
description: "Hex color code representing the air quality category for visual display."
},
category_min: {
example: "51",
description: "Minimum AQI value for this air quality category."
},
category_max: {
example: "100",
description: "Maximum AQI value for this air quality category."
},
health_description: {
example: "Air quality is acceptable...",
description: "General health description for the current air quality conditions."
},
health_recommendation: {
example: "Unusually sensitive people should consider...",
description: "Health recommendations for the current air quality conditions."
},
health_sensitive_groups: {
example: "Children, Older adults",
description: "Groups of people who are more sensitive to the current air quality conditions."
},
primary_pollutant: {
example: "pm2_5",
description: "The primary pollutant contributing to the air quality index (e.g., pm2_5, pm10, o3, no2, so2, co)."
}, },
pm2_5: { pm2_5: {
example: "8.7", example: "15.2",
description: "Particulate matter with diameter smaller than 2.5 µm (PM2.5) close to surface (10 meter above ground), measured in μg/m³." description: "Fine particulate matter with diameter smaller than 2.5 micrometers, measured in μg/m³. Major health concern for respiratory and cardiovascular systems."
}, },
carbon_monoxide: { pm10: {
example: "245.8", example: "23.1",
description: "Carbon monoxide (CO) concentration close to surface (10 meter above ground), measured in μg/m³." description: "Particulate matter with diameter smaller than 10 micrometers, measured in μg/m³. Can cause respiratory irritation and reduced lung function."
}, },
nitrogen_dioxide: { o3: {
example: "45.0",
description: "Ground-level ozone concentration, measured in μg/m³. Can cause breathing problems, especially during physical activity outdoors."
},
no2: {
example: "12.4", example: "12.4",
description: "Nitrogen dioxide (NO2) concentration close to surface (10 meter above ground), measured in μg/m³." description: "Nitrogen dioxide concentration, measured in μg/m³. Can aggravate respiratory diseases and reduce lung function."
}, },
sulphur_dioxide: { so2: {
example: "3.1", example: "3.1",
description: "Sulphur dioxide (SO2) concentration close to surface (10 meter above ground), measured in μg/m³." description: "Sulfur dioxide concentration, measured in μg/m³. Can cause respiratory symptoms and worsen asthma and heart disease."
}, },
ozone: { co: {
example: "98.5", example: "0.8",
description: "Ozone (O3) concentration close to surface (10 meter above ground), measured in μg/m³." description: "Carbon monoxide concentration, measured in ppm. Reduces oxygen delivery to organs and tissues."
}, },
aerosol_optical_depth: { reporting_area: {
example: "0.15", example: "Boston",
description: "Aerosol optical depth at 550 nm of the entire atmosphere to indicate haze. Dimensionless value." description: "The geographic area or city where this air quality data was measured."
}, },
dust: { state: {
example: "2.3", example: "MA",
description: "Saharan dust particles close to surface level (10 meter above ground), measured in μg/m³." description: "The state or region abbreviation where this air quality measurement was taken."
}, },
uv_index: { latitude: {
example: "6", example: "42.3601",
description: "UV index considering clouds. See ECMWF UV Index recommendation for more information." description: "Latitude coordinate of the monitoring station location."
}, },
uv_index_clear_sky: { longitude: {
example: "8", example: "-71.0589",
description: "UV index for clear sky conditions (no clouds). See ECMWF UV Index recommendation for more information." description: "Longitude coordinate of the monitoring station location."
},
ammonia: {
example: "1.8",
description: "Ammonia (NH3) concentration close to surface (10 meter above ground), measured in μg/m³. Only available for Europe."
},
alder_pollen: {
example: "12",
description: "Alder pollen concentration, measured in grains/m³. Only available in Europe during pollen season with 4 days forecast."
},
birch_pollen: {
example: "45",
description: "Birch pollen concentration, measured in grains/m³. Only available in Europe during pollen season with 4 days forecast."
},
grass_pollen: {
example: "78",
description: "Grass pollen concentration, measured in grains/m³. Only available in Europe during pollen season with 4 days forecast."
},
mugwort_pollen: {
example: "5",
description: "Mugwort pollen concentration, measured in grains/m³. Only available in Europe during pollen season with 4 days forecast."
},
olive_pollen: {
example: "23",
description: "Olive pollen concentration, measured in grains/m³. Only available in Europe during pollen season with 4 days forecast."
},
ragweed_pollen: {
example: "8",
description: "Ragweed pollen concentration, measured in grains/m³. Only available in Europe during pollen season with 4 days forecast."
} }
} }
} }