TimWindecker commited on
Commit
377ea60
·
verified ·
1 Parent(s): bff85a2

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. 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
- fig.add_trace(go.Bar(
229
- name=col.replace('Embodiment-', ''),
230
- x=df['Model'],
231
- y=df[col],
232
- orientation='v',
233
- marker_color=px.colors.qualitative.Plotly,
234
- text=df[col].round(1),
235
- textposition='outside',
236
- ))
237
- fig.update_layout(
238
- title="Model Performance - Per Embodiment",
239
- xaxis_title="Model",
240
- yaxis_title="Score",
241
- yaxis_range=[0, 100],
242
- barmode='group',
243
- height=500,
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
- fig.add_trace(go.Bar(
251
- name=col.replace('Category-', ''),
252
- x=df['Model'],
253
- y=df[col],
254
- orientation='v',
255
- marker_color=px.colors.qualitative.Plotly,
256
- text=df[col].round(1),
257
- textposition='outside',
258
- ))
259
- fig.update_layout(
260
- title="Model Performance - Per Category",
261
- xaxis_title="Model",
262
- yaxis_title="Score",
263
- yaxis_range=[0, 100],
264
- barmode='group',
265
- height=500,
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(