SamoXXX commited on
Commit
ace7ad6
·
verified ·
1 Parent(s): d044d82

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -6,6 +6,7 @@ import plotly.graph_objects as go
6
  import plotly.express as px
7
  from st_social_media_links import SocialMediaIcons
8
  from streamlit_javascript import st_javascript
 
9
 
10
 
11
  AVERAGE_COLUMN_NAME = "Average"
@@ -66,7 +67,6 @@ function checkBackgroundColor() {
66
  var isWhite = backgroundColor === 'rgb(255, 255, 255)' || backgroundColor === '#FFFFFF';
67
  return isWhite;
68
  }
69
-
70
  var isWhiteBackground = checkBackgroundColor();
71
  Streamlit.setComponentValue('background_color', isWhiteBackground);
72
  </script>
@@ -135,7 +135,11 @@ return_value = st_javascript("""function darkMode(i){return (window.matchMedia &
135
  print("IS dark mode? return_value: ", return_value)
136
 
137
  ### Retrieve the background color information in Streamlit
138
- # if st.query_params.get('background_color') == 'true':
 
 
 
 
139
  if not return_value:
140
  links_color = black_color
141
  else:
@@ -207,10 +211,9 @@ with tab1:
207
  # Kolorki do wyboru:
208
  # colors = px.colors.sample_colorscale("viridis", len(selected_models)+1)
209
  colors = px.colors.qualitative.G10[:len(selected_models)]
 
210
  fig_bars = go.Figure()
211
  for model, color in zip(selected_models, colors):
212
- # Set y-axis range from 0 to 5
213
-
214
  values = selected_data[selected_data['Model'] == model][categories].values.flatten().tolist()
215
  fig_bars.add_trace(go.Bar(
216
  x=categories,
 
6
  import plotly.express as px
7
  from st_social_media_links import SocialMediaIcons
8
  from streamlit_javascript import st_javascript
9
+ from st_theme import st_theme
10
 
11
 
12
  AVERAGE_COLUMN_NAME = "Average"
 
67
  var isWhite = backgroundColor === 'rgb(255, 255, 255)' || backgroundColor === '#FFFFFF';
68
  return isWhite;
69
  }
 
70
  var isWhiteBackground = checkBackgroundColor();
71
  Streamlit.setComponentValue('background_color', isWhiteBackground);
72
  </script>
 
135
  print("IS dark mode? return_value: ", return_value)
136
 
137
  ### Retrieve the background color information in Streamlit
138
+ print("background_color: ", st.query_params.get('background_color'))
139
+
140
+ print("st-theme: ", st_theme().get('backgroundColor'))
141
+
142
+
143
  if not return_value:
144
  links_color = black_color
145
  else:
 
211
  # Kolorki do wyboru:
212
  # colors = px.colors.sample_colorscale("viridis", len(selected_models)+1)
213
  colors = px.colors.qualitative.G10[:len(selected_models)]
214
+
215
  fig_bars = go.Figure()
216
  for model, color in zip(selected_models, colors):
 
 
217
  values = selected_data[selected_data['Model'] == model][categories].values.flatten().tolist()
218
  fig_bars.add_trace(go.Bar(
219
  x=categories,