bluenevus commited on
Commit
2c76d0c
·
1 Parent(s): ae57769

Update app.py via AI Editor

Browse files
Files changed (1) hide show
  1. app.py +12 -13
app.py CHANGED
@@ -52,8 +52,7 @@ INDEX_IDS = {
52
  "Health": 10,
53
  "Environmental": 5,
54
  "Pollen": 30,
55
- "Mosquito": 59,
56
- "Pest": 61
57
  }
58
 
59
  def get_location_key(lat, lon):
@@ -296,22 +295,22 @@ def create_environmental_indices_card(indices_dict):
296
  "Health": "Health API",
297
  "Environmental": "Environmental API",
298
  "Pollen": "Pollen",
299
- "Pest": "Pest",
300
- "Mosquito": "Mosquito"
301
  }
302
- for key in ["Health", "Environmental", "Pollen", "Pest", "Mosquito"]:
303
  data = indices_dict.get(key)
304
  display_name = index_display_names[key]
305
  if data and isinstance(data, list) and len(data) > 0:
306
  d = data[0]
307
- items.append(
308
- html.Div([
309
- html.H6(display_name, style={"marginBottom": "0.25rem", "fontWeight": "bold"}),
310
- html.P(f"Category: {d.get('Category', 'N/A')}", style={"marginBottom": "0.25rem"}),
311
- html.P(f"Value: {d.get('Value', 'N/A')}", style={"marginBottom": "0.25rem"}),
312
- html.P(f"Text: {d.get('Text', 'N/A')}", style={"marginBottom": "0.75rem"})
313
- ])
314
- )
 
315
  else:
316
  items.append(
317
  html.Div([
 
52
  "Health": 10,
53
  "Environmental": 5,
54
  "Pollen": 30,
55
+ "AirQuality": 65
 
56
  }
57
 
58
  def get_location_key(lat, lon):
 
295
  "Health": "Health API",
296
  "Environmental": "Environmental API",
297
  "Pollen": "Pollen",
298
+ "AirQuality": "International Air Quality"
 
299
  }
300
+ for key in ["Health", "Environmental", "Pollen", "AirQuality"]:
301
  data = indices_dict.get(key)
302
  display_name = index_display_names[key]
303
  if data and isinstance(data, list) and len(data) > 0:
304
  d = data[0]
305
+ entry = [
306
+ html.H6(display_name, style={"marginBottom": "0.25rem", "fontWeight": "bold"}),
307
+ html.P(f"Category: {d.get('Category', 'N/A')}", style={"marginBottom": "0.25rem"}),
308
+ html.P(f"Value: {d.get('Value', 'N/A')}", style={"marginBottom": "0.25rem"})
309
+ ]
310
+ t = d.get("Text", None)
311
+ if t and t != "N/A":
312
+ entry.append(html.P(f"Text: {t}", style={"marginBottom": "0.75rem"}))
313
+ items.append(html.Div(entry))
314
  else:
315
  items.append(
316
  html.Div([