Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

13,106 changes: 13,104 additions & 2 deletions transmonee_dashboard/src/transmonee_dashboard/assets/main.css

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions transmonee_dashboard/src/transmonee_dashboard/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
child_poverty,
child_rights,
child_participation,
home,
overview,
resources,
country_profiles,
Expand All @@ -28,7 +27,7 @@
# string corresponding to path of the route (will be prefixed with Dash's
# 'routes_pathname_prefix' and 'layout' is a Dash Component.
urls = (
("data-explorer-test-page", child_education.get_layout),
("", child_health.get_layout),
("overview", overview.get_layout),
("child-education", child_education.get_layout),
("child-protection", child_protection.get_layout),
Expand Down
13 changes: 10 additions & 3 deletions transmonee_dashboard/src/transmonee_dashboard/pages/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@
"Participation and Civil Rights": [
"Birth registration and identity",
"Information, Internet and Protection of privacy",
"Education, Leisure, and Culture",
"Leisure and Culture",
],
}

Expand Down Expand Up @@ -798,7 +798,7 @@ def get_filtered_dataset(
# check if the indicator has special config, update the keys from the config
if indicator_config and not only_dtype(indicator_config):
# TODO: need to confirm that a TOTAL is always available when a config is available for the indicator
card_keys = indicator_config[breakdown]
card_keys = indicator_config[breakdown].copy()
if (
dimensions
): # if we are sending cards related filters, update the keys with the set values
Expand Down Expand Up @@ -839,7 +839,14 @@ def get_filtered_dataset(
# convert to numeric and round
data["OBS_VALUE"] = pd.to_numeric(data.OBS_VALUE, errors="coerce")
data.dropna(subset=["OBS_VALUE"], inplace=True)
data = data.round({"OBS_VALUE": 2})
# round based on indicator unit: index takes 3 decimals
ind_unit = data.UNIT_MEASURE.iloc[0].value
data = data.round({"OBS_VALUE": 3 if ind_unit == "IDX" else 1})
# round to whole number if values greater than one (and not index)
if ind_unit != "IDX":
data.loc[data.OBS_VALUE > 1, "OBS_VALUE"] = data[
data.OBS_VALUE > 1
].OBS_VALUE.round()
# converting TIME_PERIOD to numeric: we should get integers by default
data["TIME_PERIOD"] = pd.to_numeric(data.TIME_PERIOD)

Expand Down
Loading