Update app.py
Browse files
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],
|
| 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,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 |
-
|
| 179 |
-
#
|
| 180 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
)
|