From e257799f778c2ba2c206c226575968c7ea1f0ba5 Mon Sep 17 00:00:00 2001 From: Philipp Horstenkamp Date: Thu, 16 Nov 2023 17:26:02 +0100 Subject: [PATCH] Fixed initial layout of homepage. (#388) --- .../ui/pages/home.py | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/aki_prj23_transparenzregister/ui/pages/home.py b/src/aki_prj23_transparenzregister/ui/pages/home.py index e2a65ce..1200f74 100644 --- a/src/aki_prj23_transparenzregister/ui/pages/home.py +++ b/src/aki_prj23_transparenzregister/ui/pages/home.py @@ -182,6 +182,7 @@ def layout() -> list[html]: "closeness", id="dropdown_table_metric", className="dropdown_style", + persistence=True, ), ], ), @@ -256,6 +257,7 @@ def layout() -> list[html]: "None", id="dropdown", className="dropdown_style", + persistence=True, ), ], ), @@ -268,24 +270,21 @@ def layout() -> list[html]: ), dcc.Dropdown( [ - "Spring (2d)", - "Spring (3d)", + "Spring", # "Bipartite", - "Circular (2d)", - "Circular (3d)", - "Kamada Kawai (2d)", - "Kamada Kawai (3d)", + "Circular", + "Kamada Kawai", # "Planar", - "Random (2d)", - "Random (3d)", - "Shell (2d)", + "Random", + "Shell (only 2D)", # "Spectral", - "Spiral (2d)", + "Spiral (only 2D)", # "Multipartite" ], - "Spring (3d)", + "Spring", id="dropdown_layout", className="dropdown_style", + persistence=True, placeholder="Select a graph layout", ), ], @@ -303,6 +302,7 @@ def layout() -> list[html]: 1, value=1, id="slider", + persistence=True, ), ], ), @@ -319,6 +319,7 @@ def layout() -> list[html]: daq.BooleanSwitch( id="switch_edge_annotation", on=False, + persistence=True, ) ], ), @@ -374,8 +375,6 @@ def update_graph_data( Input("slider", "value"), Input("dropdown_table_metric", "value"), ], - prevent_initial_call=True, - allow_duplicate=True, ) def update_figure( # noqa: PLR0913 selected_metric: str,