mathiassandnes Claude Opus 4.6 commited on
Commit
0853bfb
·
1 Parent(s): 218538a

Fix grade chart needing double-click to display

Browse files

Remove fixed y-axis range and override hovermode to "closest" for
categorical bar charts — template's "x unified" hovermode caused
Plotly to initialize with a bad viewport on categorical axes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -693,7 +693,7 @@ elif selected_view == "Design":
693
  text=[f"{v:.1f}%" for v in grades_df["Percentage"]],
694
  textposition="outside",
695
  ))
696
- fig_grades.update_layout(title="Return Grade Distribution", yaxis_title="% of Returns", yaxis=dict(range=[0, 105]))
697
  st.plotly_chart(fig_grades, use_container_width=True)
698
 
699
  st.info(f"**Design insight:** At {st.session_state.design_damage_rate}% damage rate with repairability score "
@@ -846,7 +846,7 @@ elif selected_view == "Logistics":
846
  text=[f"{v:.0f}%" for v in grades_df["Percentage"]],
847
  textposition="outside",
848
  ))
849
- fig_grades.update_layout(title="Return Grade Distribution", yaxis_title="% of Returns")
850
  st.plotly_chart(fig_grades, use_container_width=True)
851
 
852
  with grade_col2:
 
693
  text=[f"{v:.1f}%" for v in grades_df["Percentage"]],
694
  textposition="outside",
695
  ))
696
+ fig_grades.update_layout(title="Return Grade Distribution", yaxis_title="% of Returns", hovermode="closest")
697
  st.plotly_chart(fig_grades, use_container_width=True)
698
 
699
  st.info(f"**Design insight:** At {st.session_state.design_damage_rate}% damage rate with repairability score "
 
846
  text=[f"{v:.0f}%" for v in grades_df["Percentage"]],
847
  textposition="outside",
848
  ))
849
+ fig_grades.update_layout(title="Return Grade Distribution", yaxis_title="% of Returns", hovermode="closest")
850
  st.plotly_chart(fig_grades, use_container_width=True)
851
 
852
  with grade_col2: