Update src/streamlit_app.py
Browse files- src/streamlit_app.py +38 -46
src/streamlit_app.py
CHANGED
|
@@ -179,17 +179,9 @@ def create_bar_chart(df, view_type):
|
|
| 179 |
xaxis_title_text="Model",
|
| 180 |
yaxis_title_text="Score (Lower is better)",
|
| 181 |
title_text="",
|
| 182 |
-
font=dict(size=15, color="black"),
|
| 183 |
xaxis_tickangle=-45,
|
| 184 |
bargap=0.2, # Increase gap for slimmer bars
|
| 185 |
height=500, # Set the height of the plot
|
| 186 |
-
margin=dict(
|
| 187 |
-
l=0, # Left
|
| 188 |
-
r=0, # Right
|
| 189 |
-
b=0, # Bottom
|
| 190 |
-
t=5, # Top
|
| 191 |
-
pad=0 # Padding
|
| 192 |
-
),
|
| 193 |
)
|
| 194 |
|
| 195 |
# Remove the color legend from the chart.
|
|
@@ -222,48 +214,48 @@ def create_bar_chart(df, view_type):
|
|
| 222 |
# )
|
| 223 |
|
| 224 |
elif view_type == "Per Embodiment":
|
| 225 |
-
embodiment_cols = [col for col in df.columns if col.startswith('Embodiment-')]
|
| 226 |
fig = go.Figure()
|
| 227 |
-
for col in embodiment_cols:
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
fig.update_layout(
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
)
|
| 245 |
|
| 246 |
else: # Per Category
|
| 247 |
-
category_cols = [col for col in df.columns if col.startswith('Category-')]
|
| 248 |
fig = go.Figure()
|
| 249 |
-
for col in category_cols:
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
fig.update_layout(
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
)
|
| 267 |
|
| 268 |
# Common styling
|
| 269 |
fig.update_layout(
|
|
|
|
| 179 |
xaxis_title_text="Model",
|
| 180 |
yaxis_title_text="Score (Lower is better)",
|
| 181 |
title_text="",
|
|
|
|
| 182 |
xaxis_tickangle=-45,
|
| 183 |
bargap=0.2, # Increase gap for slimmer bars
|
| 184 |
height=500, # Set the height of the plot
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 185 |
)
|
| 186 |
|
| 187 |
# Remove the color legend from the chart.
|
|
|
|
| 214 |
# )
|
| 215 |
|
| 216 |
elif view_type == "Per Embodiment":
|
| 217 |
+
# embodiment_cols = [col for col in df.columns if col.startswith('Embodiment-')]
|
| 218 |
fig = go.Figure()
|
| 219 |
+
# for col in embodiment_cols:
|
| 220 |
+
# fig.add_trace(go.Bar(
|
| 221 |
+
# name=col.replace('Embodiment-', ''),
|
| 222 |
+
# x=df['Model'],
|
| 223 |
+
# y=df[col],
|
| 224 |
+
# orientation='v',
|
| 225 |
+
# marker_color=px.colors.qualitative.Plotly,
|
| 226 |
+
# text=df[col].round(1),
|
| 227 |
+
# textposition='outside',
|
| 228 |
+
# ))
|
| 229 |
+
# fig.update_layout(
|
| 230 |
+
# title="Model Performance - Per Embodiment",
|
| 231 |
+
# xaxis_title="Model",
|
| 232 |
+
# yaxis_title="Score",
|
| 233 |
+
# yaxis_range=[0, 100],
|
| 234 |
+
# barmode='group',
|
| 235 |
+
# height=500,
|
| 236 |
+
# )
|
| 237 |
|
| 238 |
else: # Per Category
|
| 239 |
+
# category_cols = [col for col in df.columns if col.startswith('Category-')]
|
| 240 |
fig = go.Figure()
|
| 241 |
+
# for col in category_cols:
|
| 242 |
+
# fig.add_trace(go.Bar(
|
| 243 |
+
# name=col.replace('Category-', ''),
|
| 244 |
+
# x=df['Model'],
|
| 245 |
+
# y=df[col],
|
| 246 |
+
# orientation='v',
|
| 247 |
+
# marker_color=px.colors.qualitative.Plotly,
|
| 248 |
+
# text=df[col].round(1),
|
| 249 |
+
# textposition='outside',
|
| 250 |
+
# ))
|
| 251 |
+
# fig.update_layout(
|
| 252 |
+
# title="Model Performance - Per Category",
|
| 253 |
+
# xaxis_title="Model",
|
| 254 |
+
# yaxis_title="Score",
|
| 255 |
+
# yaxis_range=[0, 100],
|
| 256 |
+
# barmode='group',
|
| 257 |
+
# height=500,
|
| 258 |
+
# )
|
| 259 |
|
| 260 |
# Common styling
|
| 261 |
fig.update_layout(
|