Skip to content

Commit

Permalink
change countries back
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescw committed Jul 23, 2021
1 parent b79c6ef commit 3fc8890
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
14 changes: 7 additions & 7 deletions transmonee_dashboard/src/transmonee_dashboard/pages/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ def geocode_address(address):
"Bulgaria",
"Croatia",
"Cyprus",
"Czech Republic",
"Czechia",
"Denmark",
"Estonia",
"Finland",
Expand All @@ -390,21 +390,21 @@ def geocode_address(address):
"Ireland",
"Italy",
"Kazakhstan",
"Kosovo (UN SC resolution 1244)",
"Kosovo",
"Kyrgyzstan",
"Latvia",
"Liechtenstein",
"Lithuania",
"Luxembourg",
"Malta",
"Moldova",
"Republic of Moldova",
"Monaco",
"Netherlands",
"North Macedonia",
"Norway",
"Poland",
"Portugal",
"Republic of Montenegro",
"Montenegro",
"Romania",
"Russian Federation",
"San Marino",
Expand Down Expand Up @@ -434,7 +434,7 @@ def geocode_address(address):
"Greece",
"Kazakhstan",
"Kyrgyzstan",
"Kosovo (UN SC resolution 1244)",
"Kosovo",
"Montenegro",
"North Macedonia",
"Republic of Moldova",
Expand All @@ -458,7 +458,7 @@ def geocode_address(address):
"Albania",
"Bosnia and Herzegovina",
"Croatia",
"Kosovo (UN SC resolution 1244)",
"Kosovo",
"North Macedonia",
"Montenegro",
"Serbia",
Expand Down Expand Up @@ -601,7 +601,7 @@ def geocode_address(address):
"value": [
"Albania",
"Bosnia and Herzegovina",
"Kosovo (UN SC resolution 1244)",
"Kosovo",
"North Macedonia",
"Montenegro",
"Serbia",
Expand Down
18 changes: 7 additions & 11 deletions transmonee_dashboard/src/transmonee_dashboard/pages/base_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,33 +377,29 @@ def get_base_layout(**kwargs):
@app.callback(
Output("collapse-years", "is_open"),
Output("collapse-countries", "is_open"),
Output("collapse-engagements", "is_open"),
[
Input("collapse-years-button", "n_clicks"),
Input("collapse-countries-button", "n_clicks"),
Input("collapse-engagements-button", "n_clicks"),
],
[
State("collapse-years-button", "is_open"),
State("collapse-countries-button", "is_open"),
State("collapse-engagements-button", "is_open"),
],
)
def toggle_collapse(n1, n2, n3, is_open1, is_open2, is_open3):
def toggle_collapse(n1, n2, is_open1, is_open2):
ctx = dash.callback_context

if not ctx.triggered:
return False, False, False
return False, False
else:
button_id = ctx.triggered[0]["prop_id"].split(".")[0]

if button_id == "collapse-years-button" and n1:
return not is_open1, False, False
return not is_open1, False
elif button_id == "collapse-countries-button" and n2:
return False, not is_open2, False
elif button_id == "collapse-engagements-button" and n3:
return False, False, not is_open3
return False, False, False
return False, not is_open2

return False, False


@app.callback(
Expand Down Expand Up @@ -463,7 +459,7 @@ def apply_filters(theme, years_slider, country_selector, programme_toggle, indic
# if all countries are all selectred then stop
break

country_text = f"{len(list(countries_selected))} Selected"
country_text = f"{len(countries_selected)} Selected"

selected_years = years[slice(*years_slider)]

Expand Down

0 comments on commit 3fc8890

Please sign in to comment.