TimWindecker commited on
Commit
9c61038
·
verified ·
1 Parent(s): f58bb80

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +16 -27
src/streamlit_app.py CHANGED
@@ -211,24 +211,24 @@ def create_bar_chart(df, view_type):
211
 
212
  return fig
213
 
214
- # Serve only the chart as JSON if parameter "only_chart" is set
215
- # E.g. https://huggingface.co/spaces/leggedrobotics/navitrace_leaderboard/?only_chart=total_score
216
- params = st.query_params
217
- if "only_chart" in params and params["only_chart"] in ["total_score", "per_embodiment", "per_category"]:
218
- if params["only_chart"] == "total_score":
219
- view_type = "Total Score"
220
- elif params["only_chart"] == "per_embodiment":
221
- view_type = "Per Embodiment"
222
- elif params["only_chart"] == "per_category":
223
- view_type = "Per Category"
224
 
225
- # Create chart
226
- df = load_sample_data()
227
- fig = create_bar_chart(df, view_type)
228
 
229
- # Only output JSON
230
- st.write(fig.to_json())
231
- st.stop()
232
 
233
  # Main content
234
  st.title("NaviTrace Leaderboard")
@@ -286,17 +286,6 @@ st.plotly_chart(fig, use_container_width=True, config={
286
  with st.expander("View Detailed Scores"):
287
  st.dataframe(df.style.background_gradient(cmap='Purples', subset=df.columns[1:]), use_container_width=True)
288
 
289
- # Export chart HTML for embedding
290
- with st.expander("Embed Chart in Your Website"):
291
- html_str = fig.to_html(include_plotlyjs='cdn')
292
- st.code(html_str, language='html')
293
- st.download_button(
294
- label="Download HTML",
295
- data=html_str,
296
- file_name="navitrace_chart.html",
297
- mime="text/html"
298
- )
299
-
300
  with st.expander("How to Test Your Model", expanded=True):
301
  # Step 1
302
  st.markdown("""
 
211
 
212
  return fig
213
 
214
+ # TODO remove # Serve only the chart as JSON if parameter "only_chart" is set
215
+ # # E.g. https://huggingface.co/spaces/leggedrobotics/navitrace_leaderboard/?only_chart=total_score
216
+ # params = st.query_params
217
+ # if "only_chart" in params and params["only_chart"] in ["total_score", "per_embodiment", "per_category"]:
218
+ # if params["only_chart"] == "total_score":
219
+ # view_type = "Total Score"
220
+ # elif params["only_chart"] == "per_embodiment":
221
+ # view_type = "Per Embodiment"
222
+ # elif params["only_chart"] == "per_category":
223
+ # view_type = "Per Category"
224
 
225
+ # # Create chart
226
+ # df = load_sample_data()
227
+ # fig = create_bar_chart(df, view_type)
228
 
229
+ # # Only output JSON
230
+ # st.write(fig.to_json())
231
+ # st.stop()
232
 
233
  # Main content
234
  st.title("NaviTrace Leaderboard")
 
286
  with st.expander("View Detailed Scores"):
287
  st.dataframe(df.style.background_gradient(cmap='Purples', subset=df.columns[1:]), use_container_width=True)
288
 
 
 
 
 
 
 
 
 
 
 
 
289
  with st.expander("How to Test Your Model", expanded=True):
290
  # Step 1
291
  st.markdown("""