Spaces:
Sleeping
Sleeping
sedrick-keh-tri
commited on
Commit
·
939b4b0
1
Parent(s):
278d3ee
support db
Browse files
app.py
CHANGED
|
@@ -219,7 +219,14 @@ with gr.Blocks(title="VLA Foundry Database Viewer", css=css) as demo:
|
|
| 219 |
def update_table(table_name, search, col_filter, sort_col, sort_ord):
|
| 220 |
filtered_df = get_filtered_data(table_name, search, col_filter, sort_col, sort_ord)
|
| 221 |
info = get_table_info(table_name)
|
| 222 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 223 |
|
| 224 |
# Update columns when table changes
|
| 225 |
table_selector.change(
|
|
|
|
| 219 |
def update_table(table_name, search, col_filter, sort_col, sort_ord):
|
| 220 |
filtered_df = get_filtered_data(table_name, search, col_filter, sort_col, sort_ord)
|
| 221 |
info = get_table_info(table_name)
|
| 222 |
+
|
| 223 |
+
# Build column widths for the current table
|
| 224 |
+
col_width_list = []
|
| 225 |
+
if not filtered_df.empty:
|
| 226 |
+
for col in filtered_df.columns:
|
| 227 |
+
col_width_list.append(column_widths.get(col, 300))
|
| 228 |
+
|
| 229 |
+
return gr.update(value=filtered_df, column_widths=col_width_list if col_width_list else None), info
|
| 230 |
|
| 231 |
# Update columns when table changes
|
| 232 |
table_selector.change(
|