Update app.py
Browse files
app.py
CHANGED
|
@@ -89,32 +89,6 @@ st.markdown(
|
|
| 89 |
border-radius: 5px;
|
| 90 |
padding: 10px;
|
| 91 |
}
|
| 92 |
-
/* Tooltip styling */
|
| 93 |
-
.tooltip {
|
| 94 |
-
position: relative;
|
| 95 |
-
display: inline-block;
|
| 96 |
-
cursor: pointer;
|
| 97 |
-
}
|
| 98 |
-
.tooltip .tooltiptext {
|
| 99 |
-
visibility: hidden;
|
| 100 |
-
opacity: 0;
|
| 101 |
-
width: 300px;
|
| 102 |
-
background-color: #001A6E;
|
| 103 |
-
color: #fff;
|
| 104 |
-
text-align: center;
|
| 105 |
-
border-radius: 5px;
|
| 106 |
-
padding: 5px;
|
| 107 |
-
position: absolute;
|
| 108 |
-
z-index: 1;
|
| 109 |
-
bottom: 125%; /* Position the tooltip above */
|
| 110 |
-
left: 50%;
|
| 111 |
-
margin-left: -150px;
|
| 112 |
-
transition: opacity 0.3s;
|
| 113 |
-
}
|
| 114 |
-
.tooltip:hover .tooltiptext {
|
| 115 |
-
visibility: visible;
|
| 116 |
-
opacity: 1;
|
| 117 |
-
}
|
| 118 |
</style>
|
| 119 |
""",
|
| 120 |
unsafe_allow_html=True,
|
|
@@ -222,7 +196,7 @@ with col2:
|
|
| 222 |
name="Tangent Line"
|
| 223 |
))
|
| 224 |
|
| 225 |
-
# Update layout to include
|
| 226 |
fig.update_layout(
|
| 227 |
xaxis=dict(
|
| 228 |
title="x-axis",
|
|
@@ -240,12 +214,19 @@ with col2:
|
|
| 240 |
zerolinewidth=2,
|
| 241 |
showgrid=True,
|
| 242 |
gridcolor="lightgray",
|
| 243 |
-
range=[
|
| 244 |
color="white"
|
| 245 |
),
|
| 246 |
plot_bgcolor="black",
|
| 247 |
paper_bgcolor="black",
|
| 248 |
font=dict(color="white"),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 249 |
width=800,
|
| 250 |
height=400,
|
| 251 |
showlegend=True
|
|
|
|
| 89 |
border-radius: 5px;
|
| 90 |
padding: 10px;
|
| 91 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
</style>
|
| 93 |
""",
|
| 94 |
unsafe_allow_html=True,
|
|
|
|
| 196 |
name="Tangent Line"
|
| 197 |
))
|
| 198 |
|
| 199 |
+
# Update layout to include white axis, hide negative y-axis, and adjust legend position
|
| 200 |
fig.update_layout(
|
| 201 |
xaxis=dict(
|
| 202 |
title="x-axis",
|
|
|
|
| 214 |
zerolinewidth=2,
|
| 215 |
showgrid=True,
|
| 216 |
gridcolor="lightgray",
|
| 217 |
+
range=[0, max(y_plot) + 10], # Limit to non-negative y-axis
|
| 218 |
color="white"
|
| 219 |
),
|
| 220 |
plot_bgcolor="black",
|
| 221 |
paper_bgcolor="black",
|
| 222 |
font=dict(color="white"),
|
| 223 |
+
legend=dict(
|
| 224 |
+
x=0.7, # Adjust legend to the left
|
| 225 |
+
y=1.0,
|
| 226 |
+
bgcolor="black",
|
| 227 |
+
bordercolor="#001A6E",
|
| 228 |
+
borderwidth=2
|
| 229 |
+
),
|
| 230 |
width=800,
|
| 231 |
height=400,
|
| 232 |
showlegend=True
|