Spaces:
Running
Running
michal
commited on
Commit
·
0a2697b
1
Parent(s):
4ffd60b
Udate
Browse files- app.py +8 -14
- src/structures/pes_structure.py +2 -5
app.py
CHANGED
@@ -68,20 +68,14 @@ with main:
|
|
68 |
value=ORDER_LIST,
|
69 |
)
|
70 |
# Dataframe component to display the leaderboard data
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
# )
|
80 |
-
data_component = gr.HTML(value=PES_ACCS.to_html())
|
81 |
-
columns_selector.change(
|
82 |
-
filter_columns,
|
83 |
-
inputs=columns_selector,
|
84 |
-
outputs=data_component
|
85 |
)
|
86 |
def update_dataframe(selected_columns):
|
87 |
return filter_columns(selected_columns)
|
|
|
68 |
value=ORDER_LIST,
|
69 |
)
|
70 |
# Dataframe component to display the leaderboard data
|
71 |
+
data_component = gr.components.Dataframe(
|
72 |
+
value=PES_ACCS,
|
73 |
+
headers=COLUMN_HEADERS,
|
74 |
+
type="pandas",
|
75 |
+
datatype=DATA_TYPES,
|
76 |
+
interactive=False,
|
77 |
+
visible=True,
|
78 |
+
# column_widths=[400] + [250] * (len(COLUMN_HEADERS) - 1)
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
)
|
80 |
def update_dataframe(selected_columns):
|
81 |
return filter_columns(selected_columns)
|
src/structures/pes_structure.py
CHANGED
@@ -38,11 +38,8 @@ def filter_data(selected_columns, search_query):
|
|
38 |
|
39 |
def filter_columns(column_choices):
|
40 |
selected_columns = [col for col in ORDER_LIST if col in column_choices]
|
41 |
-
|
42 |
-
|
43 |
-
)
|
44 |
-
# Convert to HTML
|
45 |
-
return styled_df.to_html()
|
46 |
|
47 |
|
48 |
def load_json_data(file_path, order_list):
|
|
|
38 |
|
39 |
def filter_columns(column_choices):
|
40 |
selected_columns = [col for col in ORDER_LIST if col in column_choices]
|
41 |
+
filtered_df = PES_ACCS[selected_columns]
|
42 |
+
return filtered_df.style.highlight_max(color=highlight_color, subset=filtered_df.columns[1:]).format(precision=2)
|
|
|
|
|
|
|
43 |
|
44 |
|
45 |
def load_json_data(file_path, order_list):
|