This commit is contained in:
2025-08-11 02:49:41 +01:00
parent 4ca7e8ab61
commit 647111e9d3
3 changed files with 111 additions and 47 deletions

View File

@@ -30,6 +30,13 @@ def create_method_controls():
"""Create controls for dimension reduction and clustering methods"""
st.sidebar.header("🎛️ Visualization Controls")
# 3D visualization toggle
enable_3d = st.sidebar.checkbox(
"Enable 3D Visualization",
value=False,
help="Switch between 2D and 3D visualization. 3D uses 3 components instead of 2."
)
# Dimension reduction method
method = st.sidebar.selectbox(
"Dimension Reduction Method",
@@ -45,7 +52,7 @@ def create_method_controls():
help="Apply clustering to identify groups. HDBSCAN and OPTICS can find variable density clusters."
)
return method, clustering_method
return method, clustering_method, enable_3d
def create_clustering_controls(clustering_method):
@@ -196,7 +203,7 @@ def display_performance_warnings(filtered_df, method, clustering_method):
def get_all_ui_parameters(valid_df):
"""Get all UI parameters in a single function call"""
# Method selection
method, clustering_method = create_method_controls()
method, clustering_method, enable_3d = create_method_controls()
# Clustering parameters
n_clusters = create_clustering_controls(clustering_method)
@@ -219,6 +226,7 @@ def get_all_ui_parameters(valid_df):
return {
'method': method,
'clustering_method': clustering_method,
'enable_3d': enable_3d,
'n_clusters': n_clusters,
'spread_factor': spread_factor,
'perplexity_factor': perplexity_factor,