GMARTINEZMILLA commited on
Commit
681ee74
·
1 Parent(s): 06e133e

feat: updated app script

Browse files
Files changed (1) hide show
  1. app.py +6 -11
app.py CHANGED
@@ -16,17 +16,11 @@ st.set_page_config(page_title="DeepInsightz", page_icon=":bar_chart:", layout="w
16
  # Navigation menu
17
  with st.sidebar:
18
  st.sidebar.title("DeepInsightz")
19
-
20
- # Theme toggle for light/dark mode
21
- theme_toggle = st.sidebar.selectbox('Select Theme', ['Light', 'Dark'])
22
-
23
- # Existing tool selection
24
  page = st.sidebar.selectbox("Select the tool you want to use", ["Summary", "Customer Analysis", "Articles Recommendations"])
25
 
26
-
27
  # Custom CSS for dynamic theme styling
28
- # Define light and dark theme specific colors and styles
29
- if theme_toggle == 'Dark':
30
  background_color = "#282828"
31
  text_color = "white"
32
  metric_box_color = "#4f4f4f"
@@ -123,10 +117,11 @@ def create_donut_chart(values, labels, color_scheme, title):
123
  )
124
  return fig
125
 
126
- if theme_toggle == 'Dark':
127
- donut_color_scheme = ['#155F7A', '#29b5e8'] # Example colors for dark mode
 
128
  else:
129
- donut_color_scheme = ['#007BFF', '#66b5ff'] # Example colors for light mode
130
 
131
  # Function to create radar chart with square root transformation
132
  def radar_chart(categories, values, amounts, title):
 
16
  # Navigation menu
17
  with st.sidebar:
18
  st.sidebar.title("DeepInsightz")
 
 
 
 
 
19
  page = st.sidebar.selectbox("Select the tool you want to use", ["Summary", "Customer Analysis", "Articles Recommendations"])
20
 
 
21
  # Custom CSS for dynamic theme styling
22
+ # Streamlit detects light and dark mode automatically via the user's settings in Hugging Face Spaces
23
+ if st.get_option("theme.base") == "dark":
24
  background_color = "#282828"
25
  text_color = "white"
26
  metric_box_color = "#4f4f4f"
 
117
  )
118
  return fig
119
 
120
+ # Donut chart with color scheme based on theme
121
+ if st.get_option("theme.base") == "dark":
122
+ donut_color_scheme = ['#155F7A', '#29b5e8'] # Dark mode colors
123
  else:
124
+ donut_color_scheme = ['#007BFF', '#66b5ff'] # Light mode colors
125
 
126
  # Function to create radar chart with square root transformation
127
  def radar_chart(categories, values, amounts, title):