trohith89 commited on
Commit
e67e9a0
Β·
verified Β·
1 Parent(s): e3dd1ba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -7
app.py CHANGED
@@ -149,20 +149,20 @@ with col2:
149
  zerolinewidth=2,
150
  showgrid=True,
151
  gridcolor="lightgray",
152
- range=[0, max(y_plot) + 10], # Show non-negative y-axis only
153
  color="white"
154
  ),
155
  plot_bgcolor="black",
156
  paper_bgcolor="black",
157
  font=dict(color="white"),
158
  legend=dict(
159
- x=0.6, # Legend slightly left for border visibility
160
  y=1.0,
161
  bgcolor="black",
162
  bordercolor="#001A6E",
163
  borderwidth=2
164
  ),
165
- margin=dict(l=10, r=80, t=10, b=10), # Expand right border
166
  width=800,
167
  height=400,
168
  showlegend=True
@@ -173,8 +173,25 @@ with col2:
173
  except Exception as e:
174
  st.error(f"⚠️ Error in visualization: {str(e)}")
175
 
176
- # Display iteration and current point info
177
  col5, col6, col7 = st.columns(3)
178
- col5.info(f"πŸ§‘β€πŸ’» Iteration: {st.session_state.iteration}")
179
- # col6.success(f"βœ… Current x: {st.session_state.x:.4f}")
180
- col7.warning(f"πŸ“ Current Point: ({st.session_state.x:.4f}, {st.session_state.y_vals[-1]:.4f})")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
149
  zerolinewidth=2,
150
  showgrid=True,
151
  gridcolor="lightgray",
152
+ range=[0, max(y_plot) + 10],
153
  color="white"
154
  ),
155
  plot_bgcolor="black",
156
  paper_bgcolor="black",
157
  font=dict(color="white"),
158
  legend=dict(
159
+ x=0.6,
160
  y=1.0,
161
  bgcolor="black",
162
  bordercolor="#001A6E",
163
  borderwidth=2
164
  ),
165
+ margin=dict(l=10, r=80, t=10, b=10),
166
  width=800,
167
  height=400,
168
  showlegend=True
 
173
  except Exception as e:
174
  st.error(f"⚠️ Error in visualization: {str(e)}")
175
 
 
176
  col5, col6, col7 = st.columns(3)
177
+
178
+ # Custom HTML/CSS for iteration and current point display with pink background and black borders
179
+ col5.markdown(
180
+ f"""
181
+ <div style="background-color:#FFB6C1; border: 2px solid black; border-radius: 8px; padding: 10px; text-align: center;">
182
+ <span style="color:black; font-weight: bold;">πŸ§‘β€πŸ’» Iteration:</span> <br>
183
+ <span style="color:black;">{st.session_state.iteration}</span>
184
+ </div>
185
+ """,
186
+ unsafe_allow_html=True,
187
+ )
188
+
189
+ col7.markdown(
190
+ f"""
191
+ <div style="background-color:#FFB6C1; border: 2px solid black; border-radius: 8px; padding: 10px; text-align: center;">
192
+ <span style="color:black; font-weight: bold;">πŸ“ Current Point:</span> <br>
193
+ <span style="color:black;">({st.session_state.x:.4f}, {st.session_state.y_vals[-1]:.4f})</span>
194
+ </div>
195
+ """,
196
+ unsafe_allow_html=True,
197
+ )