vashu2425 commited on
Commit
35319a4
·
verified ·
1 Parent(s): 4589c40

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +35 -14
app.py CHANGED
@@ -146,17 +146,34 @@ def apply_custom_css():
146
  font-weight: 600;
147
  text-align: center;
148
  }
149
- /* Try to force change
150
- div[class^="st-emotion-cache"] {
151
- background-color: #111827 !important;
152
- }*/
153
-
154
  div[data-testid="stBottomBlockContainer"] {
155
  background-color: #111827 !important;
156
- }
157
 
 
 
 
 
 
 
 
 
 
 
 
 
158
 
 
159
 
 
 
 
 
 
 
160
  .sidebar-section {
161
  background: rgba(31, 41, 55, 0.4);
162
  border-radius: 8px;
@@ -1171,22 +1188,22 @@ def display_distribution_tab():
1171
  with col2:
1172
  if chart_type != "Distribution Plot":
1173
  column_type = "Numerical" if chart_type in ["Histogram", "Box Plot", "Violin Plot"] else "Categorical"
1174
- columns_to_show = df.select_dtypes(include=['number']).columns.tolist() if column_type == "Numerical" else df.select_dtypes(include=['object', 'category']).columns.tolist()
1175
 
1176
  selected_columns = st.multiselect(
1177
  f"Select {column_type} Columns to Visualize",
1178
  options=columns_to_show,
1179
- default=columns_to_show[:min(3, len(columns_to_show))],
1180
  key="column_select"
1181
  )
1182
  else:
1183
- num_cols = df.select_dtypes(include=['number']).columns.tolist()
1184
  selected_columns = st.multiselect(
1185
  "Select Numerical Columns",
1186
  options=num_cols,
1187
- default=num_cols[:min(3, len(num_cols))],
1188
  key="column_select"
1189
- )
1190
  st.markdown('</div>', unsafe_allow_html=True)
1191
 
1192
  # Display selected charts
@@ -1564,13 +1581,17 @@ def display_relationships_tab():
1564
  # Scatter plot matrix
1565
  st.subheader("Scatter Plot Matrix")
1566
 
1567
- # Let user choose columns
 
 
 
1568
  selected_cols = st.multiselect(
1569
  "Select columns for scatter plot matrix (max 5 recommended)",
1570
  options=num_cols,
1571
- default=num_cols[:min(4, len(num_cols))]
1572
  )
1573
-
 
1574
  if selected_cols:
1575
  if len(selected_cols) > 5:
1576
  st.warning("More than 5 columns may make the plot hard to read.")
 
146
  font-weight: 600;
147
  text-align: center;
148
  }
149
+
150
+
151
+ /*
 
 
152
  div[data-testid="stBottomBlockContainer"] {
153
  background-color: #111827 !important;
154
+ }
155
 
156
+ div[data-testid="stChatInput"]{
157
+ background-color: #111827 !important;
158
+ } */
159
+
160
+ /* Override the bottom chat input container */
161
+ div.stChatFloatingInputContainer {
162
+ background-color: #111827 !important;
163
+ }
164
+
165
+ /* Override the inner chat input box */
166
+ div.stChatInputContainer {
167
+ background-color: #111827 !important;
168
 
169
+ }
170
 
171
+ /* Optional: Override text area background */
172
+ textarea {
173
+ background-color: #111827 !important;
174
+ color: white !important;
175
+ }
176
+
177
  .sidebar-section {
178
  background: rgba(31, 41, 55, 0.4);
179
  border-radius: 8px;
 
1188
  with col2:
1189
  if chart_type != "Distribution Plot":
1190
  column_type = "Numerical" if chart_type in ["Histogram", "Box Plot", "Violin Plot"] else "Categorical"
1191
+ columns_to_show = list(df.select_dtypes(include=['number']).columns) if column_type == "Numerical" else list(df.select_dtypes(include=['object', 'category']).columns)
1192
 
1193
  selected_columns = st.multiselect(
1194
  f"Select {column_type} Columns to Visualize",
1195
  options=columns_to_show,
1196
+ default=list(columns_to_show[:min(3, len(columns_to_show))]), # Convert to list ✅
1197
  key="column_select"
1198
  )
1199
  else:
1200
+ num_cols = list(df.select_dtypes(include=['number']).columns) # Convert to list ✅
1201
  selected_columns = st.multiselect(
1202
  "Select Numerical Columns",
1203
  options=num_cols,
1204
+ default=list(num_cols[:min(3, len(num_cols))]), # Convert to list ✅
1205
  key="column_select"
1206
+ )
1207
  st.markdown('</div>', unsafe_allow_html=True)
1208
 
1209
  # Display selected charts
 
1581
  # Scatter plot matrix
1582
  st.subheader("Scatter Plot Matrix")
1583
 
1584
+ # Convert num_cols to a list before using it in multiselect
1585
+ num_cols = list(df.select_dtypes(include=['number']).columns)
1586
+
1587
+ # Ensure default selection is also a list
1588
  selected_cols = st.multiselect(
1589
  "Select columns for scatter plot matrix (max 5 recommended)",
1590
  options=num_cols,
1591
+ default=list(num_cols[:min(4, len(num_cols))]) # Convert to list ✅
1592
  )
1593
+
1594
+
1595
  if selected_cols:
1596
  if len(selected_cols) > 5:
1597
  st.warning("More than 5 columns may make the plot hard to read.")