diff --git a/website/dashmap/layouts/tab_mobility/main_mobility.py b/website/dashmap/layouts/tab_mobility/main_mobility.py index 8786078..98d22b6 100644 --- a/website/dashmap/layouts/tab_mobility/main_mobility.py +++ b/website/dashmap/layouts/tab_mobility/main_mobility.py @@ -22,8 +22,9 @@ def init_tab_mobility() -> object: html.P( """ Geographic mobility is the measure of how populations and goods move over time. - Population mobility has a large impact on many sociological factors in a society and has implications ranging - from impacts on local economic growth to housing markets and demand for regional services. + Population mobility has a large impact on many sociological factors in a society and has + implications ranging from impacts on local economic growth to housing markets and demand + for regional services. """, className="card-text" ), diff --git a/website/dashmap/layouts/tab_mobility/mobility.py b/website/dashmap/layouts/tab_mobility/mobility.py index bc7a8e1..826ce9f 100644 --- a/website/dashmap/layouts/tab_mobility/mobility.py +++ b/website/dashmap/layouts/tab_mobility/mobility.py @@ -23,25 +23,10 @@ def init_mobility_accordion(): group_n=2 ) - accord_3 = init_accordion_element( - title="Coming Soon!", - graph_id='id_tram_accordion', - tab_n=4, - group_n=3 - ) - - accord_4 = init_accordion_element( - title="Coming Soon!", - graph_id='id_bikes_accordion', - tab_n=4, - group_n=4 - ) - mobility_accordion = [ accord_1, accord_2, - accord_3, - accord_4 + ] return assemble_accordion(mobility_accordion) diff --git a/website/dashmap/map_callbacks.py b/website/dashmap/map_callbacks.py index 0640777..382f17b 100644 --- a/website/dashmap/map_callbacks.py +++ b/website/dashmap/map_callbacks.py @@ -254,11 +254,11 @@ def toggle_accordion(n1, n2, is_open1, is_open2): # Tab Mobility Section Accordion CallBacks @dash_app.callback( - [Output(f"tab-4-collapse-{i}", "is_open") for i in range(1, 5)], - [Input(f"tab-4-group-{i}-toggle", "n_clicks") for i in range(1, 5)], - [State(f"tab-4-collapse-{i}", "is_open") for i in range(1, 5)], + [Output(f"tab-4-collapse-{i}", "is_open") for i in range(1, 3)], + [Input(f"tab-4-group-{i}-toggle", "n_clicks") for i in range(1, 3)], + [State(f"tab-4-collapse-{i}", "is_open") for i in range(1, 3)], ) - def toggle_accordion(n1, n2, n3, n4, is_open1, is_open2, is_open3, is_open4): + def toggle_accordion(n1, n2, is_open1, is_open2): """ Toggle accordion collapse & expand. --- @@ -273,20 +273,16 @@ def toggle_accordion(n1, n2, n3, n4, is_open1, is_open2, is_open3, is_open4): ctx = dash.callback_context if not ctx.triggered: - return False, False, False, False + return False, False else: button_id = ctx.triggered[0]["prop_id"].split(".")[0] if button_id == "tab-4-group-1-toggle" and n1: - return not is_open1, False, False, False + return not is_open1, False elif button_id == "tab-4-group-2-toggle" and n2: - return False, not is_open2, False, False - elif button_id == "tab-4-group-3-toggle" and n3: - return False, False, not is_open3, False - elif button_id == "tab-4-group-4-toggle" and n4: - return False, False, False, not is_open4 + return False, not is_open2 - return False, False, False, False + return False, False # Tab Environment Section Accordion CallBacks @dash_app.callback(