From ec0e990f98c2e7ff271c756c048fd06d4213faaa Mon Sep 17 00:00:00 2001 From: furkanmtorun Date: Thu, 8 Jun 2023 17:02:24 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20Change=20defaults=20for=20clusterin?= =?UTF-8?q?g=20plot=20slider?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- omiclearn/utils/ui_components.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/omiclearn/utils/ui_components.py b/omiclearn/utils/ui_components.py index 2ae652a..3328149 100644 --- a/omiclearn/utils/ui_components.py +++ b/omiclearn/utils/ui_components.py @@ -588,16 +588,23 @@ def _generate_eda_section(state): ) if state.eda_method == "Hierarchical clustering": + default_slider_end_point = ( + round(len(state.proteins) / 10) + if len(state.proteins) > 499 + else round(len(state.proteins) / 3) + ) state["data_range"] = st.slider( "Data range to be visualized", 0, len(state.proteins), - (0, round(len(state.proteins) / 2)), - step=3, + (0, default_slider_end_point), + step=1 if len(state.proteins) < 100 else 10, help="In large datasets, it is not possible to visaulize all the features.", ) - if state.eda_method != "None": + if (state.eda_method != "None") and ( + st.button("Perform EDA", key="perform_eda") + ): with st.spinner(f"Performing {state.eda_method}.."): p = perform_EDA(state) st.plotly_chart(p, use_container_width=True)