Skip to content

Commit

Permalink
Merge pull request #75 from unicef-drp/ecdi-fix
Browse files Browse the repository at this point in the history
Update transmonee.py
  • Loading branch information
Amy-Reidy authored Jul 16, 2024
2 parents e9d72e1 + 15c61b0 commit 00726ec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dash_service/pages/transmonee.py
Original file line number Diff line number Diff line change
Expand Up @@ -3141,10 +3141,10 @@ def aio_area_figure(

if base_indicator == 'PP_SG_NHR_STATUS':
data.sort_values("OBS_VALUE", ascending=True, inplace=True)
status_mapping = {0: "No status", 1: "B status", 2: "A status"}
status_mapping = {0: "No status", 1: "Status B", 2: "Status A"}
# Map the OBS_VALUE to the corresponding status
data['Status'] = data['OBS_VALUE'].map(status_mapping)
graph_info = "A status: compliant with Paris Principles, B status: not fully compliant with Paris Principles."
graph_info = "Status A: compliant with Paris Principles, Status B: parially compliant with Paris Principles."

# rename figure_type 'map': 'choropleth' (plotly express)
if fig_type == "map":
Expand All @@ -3153,7 +3153,7 @@ def aio_area_figure(
fig_type = "choropleth_mapbox"
if "YES_NO" in data.UNIT_MEASURE.values or base_indicator == 'PP_SG_NHR_STATUS':
options["color"] = "Status"
options["color_discrete_map"] = {"Yes": "#1CABE2", "No": "#fcba03", "A status": "#3e7c49", "B status": "#e5ae4c", "No status": "#861c3f"}
options["color_discrete_map"] = {"Yes": "#1CABE2", "No": "#fcba03", "Status A": "#3e7c49", "Status B": "#e5ae4c", "No status": "#861c3f"}
else:
options["color"] = "OBS_VALUE"
options["color_continuous_scale"] = map_colour
Expand Down

0 comments on commit 00726ec

Please sign in to comment.