Dmitry Beresnev
commited on
Commit
·
f4f4e51
1
Parent(s):
60a1d18
fix UI
Browse files- app/main.py +177 -18
app/main.py
CHANGED
|
@@ -53,10 +53,39 @@ st.markdown("""
|
|
| 53 |
}
|
| 54 |
|
| 55 |
/* Text colors */
|
| 56 |
-
p, span, div, h1, h2, h3, h4, h5, h6 {
|
| 57 |
color: var(--text-primary) !important;
|
| 58 |
}
|
| 59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
/* Metric card styling */
|
| 61 |
[data-testid="metric-container"] {
|
| 62 |
background: linear-gradient(135deg, #1f2937 0%, #111827 100%) !important;
|
|
@@ -97,21 +126,26 @@ st.markdown("""
|
|
| 97 |
}
|
| 98 |
|
| 99 |
/* Button styling */
|
| 100 |
-
|
| 101 |
background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%) !important;
|
| 102 |
-
color: #
|
| 103 |
border: none !important;
|
| 104 |
border-radius: 8px !important;
|
| 105 |
-
padding: 0.
|
| 106 |
-
font-weight:
|
| 107 |
transition: all 0.3s ease !important;
|
|
|
|
| 108 |
}
|
| 109 |
|
| 110 |
-
|
| 111 |
-
box-shadow: 0
|
| 112 |
transform: translateY(-2px) !important;
|
| 113 |
}
|
| 114 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 115 |
/* Input fields */
|
| 116 |
[data-testid="stTextInput"] input,
|
| 117 |
[data-testid="stSlider"] input {
|
|
@@ -185,6 +219,46 @@ st.markdown("""
|
|
| 185 |
border-radius: 6px !important;
|
| 186 |
}
|
| 187 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 188 |
/* Scrollbar */
|
| 189 |
::-webkit-scrollbar {
|
| 190 |
width: 8px;
|
|
@@ -203,6 +277,12 @@ st.markdown("""
|
|
| 203 |
::-webkit-scrollbar-thumb:hover {
|
| 204 |
background: var(--primary-color);
|
| 205 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 206 |
</style>
|
| 207 |
""", unsafe_allow_html=True)
|
| 208 |
|
|
@@ -365,7 +445,7 @@ if st.button("📊 Load Dashboard", key="load_btn", use_container_width=True):
|
|
| 365 |
x=income_chart_data['period_ending'],
|
| 366 |
y=income_chart_data['total_revenue'],
|
| 367 |
name="Total Revenue",
|
| 368 |
-
marker=dict(color='#0066ff'),
|
| 369 |
yaxis='y1'
|
| 370 |
))
|
| 371 |
|
|
@@ -373,7 +453,7 @@ if st.button("📊 Load Dashboard", key="load_btn", use_container_width=True):
|
|
| 373 |
x=income_chart_data['period_ending'],
|
| 374 |
y=income_chart_data['net_income'],
|
| 375 |
name="Net Income",
|
| 376 |
-
marker=dict(color='#00d084'),
|
| 377 |
yaxis='y1'
|
| 378 |
))
|
| 379 |
|
|
@@ -385,7 +465,33 @@ if st.button("📊 Load Dashboard", key="load_btn", use_container_width=True):
|
|
| 385 |
template="plotly_dark",
|
| 386 |
height=400,
|
| 387 |
barmode='group',
|
| 388 |
-
margin=dict(l=0, r=0, t=40, b=0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 389 |
)
|
| 390 |
|
| 391 |
st.plotly_chart(fig_financial, use_container_width=True)
|
|
@@ -400,7 +506,7 @@ if st.button("📊 Load Dashboard", key="load_btn", use_container_width=True):
|
|
| 400 |
fig_price.add_trace(go.Scatter(
|
| 401 |
x=df.index, y=df["close"],
|
| 402 |
name="Close Price",
|
| 403 |
-
line=dict(color="#0066ff", width=2)
|
| 404 |
))
|
| 405 |
fig_price.add_trace(go.Scatter(
|
| 406 |
x=df.index, y=df["SMA"],
|
|
@@ -420,7 +526,33 @@ if st.button("📊 Load Dashboard", key="load_btn", use_container_width=True):
|
|
| 420 |
hovermode="x unified",
|
| 421 |
template="plotly_dark",
|
| 422 |
height=500,
|
| 423 |
-
margin=dict(l=0, r=0, t=40, b=0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 424 |
)
|
| 425 |
|
| 426 |
st.plotly_chart(fig_price, use_container_width=True)
|
|
@@ -432,14 +564,15 @@ if st.button("📊 Load Dashboard", key="load_btn", use_container_width=True):
|
|
| 432 |
fig_rsi.add_trace(go.Scatter(
|
| 433 |
x=df.index, y=df["RSI"],
|
| 434 |
name="RSI",
|
| 435 |
-
line=dict(color="#ff3838", width=2),
|
| 436 |
fill="tozeroy",
|
| 437 |
-
fillcolor="rgba(255, 56, 56, 0.
|
| 438 |
))
|
| 439 |
|
| 440 |
# Add overbought/oversold lines
|
| 441 |
-
fig_rsi.add_hline(y=70, line_dash="dash", line_color="rgba(255, 165, 0, 0.
|
| 442 |
-
fig_rsi.add_hline(y=30, line_dash="dash", line_color="rgba(0, 208, 132, 0.
|
|
|
|
| 443 |
|
| 444 |
fig_rsi.update_layout(
|
| 445 |
title=f"{symbol} - Relative Strength Index (RSI)",
|
|
@@ -448,8 +581,34 @@ if st.button("📊 Load Dashboard", key="load_btn", use_container_width=True):
|
|
| 448 |
hovermode="x unified",
|
| 449 |
template="plotly_dark",
|
| 450 |
height=500,
|
| 451 |
-
|
| 452 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 453 |
)
|
| 454 |
|
| 455 |
st.plotly_chart(fig_rsi, use_container_width=True)
|
|
|
|
| 53 |
}
|
| 54 |
|
| 55 |
/* Text colors */
|
| 56 |
+
p, span, div, h1, h2, h3, h4, h5, h6, label, li, a {
|
| 57 |
color: var(--text-primary) !important;
|
| 58 |
}
|
| 59 |
|
| 60 |
+
/* Headings */
|
| 61 |
+
h1, h2, h3 {
|
| 62 |
+
color: var(--text-primary) !important;
|
| 63 |
+
font-weight: 700 !important;
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
/* Links */
|
| 67 |
+
a {
|
| 68 |
+
color: var(--primary-color) !important;
|
| 69 |
+
text-decoration: none !important;
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
a:hover {
|
| 73 |
+
color: var(--secondary-color) !important;
|
| 74 |
+
text-decoration: underline !important;
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
/* Labels and text inputs */
|
| 78 |
+
label {
|
| 79 |
+
color: var(--text-primary) !important;
|
| 80 |
+
font-weight: 500 !important;
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
/* Paragraph text */
|
| 84 |
+
p {
|
| 85 |
+
color: var(--text-primary) !important;
|
| 86 |
+
line-height: 1.6 !important;
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
/* Metric card styling */
|
| 90 |
[data-testid="metric-container"] {
|
| 91 |
background: linear-gradient(135deg, #1f2937 0%, #111827 100%) !important;
|
|
|
|
| 126 |
}
|
| 127 |
|
| 128 |
/* Button styling */
|
| 129 |
+
.stButton > button {
|
| 130 |
background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%) !important;
|
| 131 |
+
color: #ffffff !important;
|
| 132 |
border: none !important;
|
| 133 |
border-radius: 8px !important;
|
| 134 |
+
padding: 0.75rem 2rem !important;
|
| 135 |
+
font-weight: 700 !important;
|
| 136 |
transition: all 0.3s ease !important;
|
| 137 |
+
box-shadow: 0 4px 6px rgba(0, 102, 255, 0.2) !important;
|
| 138 |
}
|
| 139 |
|
| 140 |
+
.stButton > button:hover {
|
| 141 |
+
box-shadow: 0 8px 16px rgba(0, 102, 255, 0.4) !important;
|
| 142 |
transform: translateY(-2px) !important;
|
| 143 |
}
|
| 144 |
|
| 145 |
+
.stButton > button:active {
|
| 146 |
+
transform: translateY(0) !important;
|
| 147 |
+
}
|
| 148 |
+
|
| 149 |
/* Input fields */
|
| 150 |
[data-testid="stTextInput"] input,
|
| 151 |
[data-testid="stSlider"] input {
|
|
|
|
| 219 |
border-radius: 6px !important;
|
| 220 |
}
|
| 221 |
|
| 222 |
+
/* Metric text styling */
|
| 223 |
+
[data-testid="metric-container"] p {
|
| 224 |
+
color: var(--text-primary) !important;
|
| 225 |
+
}
|
| 226 |
+
|
| 227 |
+
[data-testid="metric-container"] [data-testid="stMetricValue"] {
|
| 228 |
+
color: var(--primary-color) !important;
|
| 229 |
+
font-weight: 700 !important;
|
| 230 |
+
}
|
| 231 |
+
|
| 232 |
+
/* Slider label color */
|
| 233 |
+
[data-testid="stSlider"] label {
|
| 234 |
+
color: var(--text-primary) !important;
|
| 235 |
+
}
|
| 236 |
+
|
| 237 |
+
/* Text input label */
|
| 238 |
+
[data-testid="stTextInput"] label {
|
| 239 |
+
color: var(--text-primary) !important;
|
| 240 |
+
}
|
| 241 |
+
|
| 242 |
+
/* Write and markdown text */
|
| 243 |
+
[data-testid="stMarkdownContainer"] p {
|
| 244 |
+
color: var(--text-primary) !important;
|
| 245 |
+
}
|
| 246 |
+
|
| 247 |
+
[data-testid="stMarkdownContainer"] strong {
|
| 248 |
+
color: var(--primary-color) !important;
|
| 249 |
+
font-weight: 600 !important;
|
| 250 |
+
}
|
| 251 |
+
|
| 252 |
+
/* Spinner text */
|
| 253 |
+
[data-testid="stSpinner"] {
|
| 254 |
+
color: var(--primary-color) !important;
|
| 255 |
+
}
|
| 256 |
+
|
| 257 |
+
/* Column separators */
|
| 258 |
+
hr {
|
| 259 |
+
border-color: var(--border-color) !important;
|
| 260 |
+
}
|
| 261 |
+
|
| 262 |
/* Scrollbar */
|
| 263 |
::-webkit-scrollbar {
|
| 264 |
width: 8px;
|
|
|
|
| 277 |
::-webkit-scrollbar-thumb:hover {
|
| 278 |
background: var(--primary-color);
|
| 279 |
}
|
| 280 |
+
|
| 281 |
+
/* Selection highlighting */
|
| 282 |
+
::selection {
|
| 283 |
+
background-color: var(--primary-color);
|
| 284 |
+
color: #fff;
|
| 285 |
+
}
|
| 286 |
</style>
|
| 287 |
""", unsafe_allow_html=True)
|
| 288 |
|
|
|
|
| 445 |
x=income_chart_data['period_ending'],
|
| 446 |
y=income_chart_data['total_revenue'],
|
| 447 |
name="Total Revenue",
|
| 448 |
+
marker=dict(color='#0066ff', opacity=0.9),
|
| 449 |
yaxis='y1'
|
| 450 |
))
|
| 451 |
|
|
|
|
| 453 |
x=income_chart_data['period_ending'],
|
| 454 |
y=income_chart_data['net_income'],
|
| 455 |
name="Net Income",
|
| 456 |
+
marker=dict(color='#00d084', opacity=0.9),
|
| 457 |
yaxis='y1'
|
| 458 |
))
|
| 459 |
|
|
|
|
| 465 |
template="plotly_dark",
|
| 466 |
height=400,
|
| 467 |
barmode='group',
|
| 468 |
+
margin=dict(l=0, r=0, t=40, b=0),
|
| 469 |
+
plot_bgcolor="#0d1117",
|
| 470 |
+
paper_bgcolor="#0e1117",
|
| 471 |
+
font=dict(color="#e6edf3", size=12, family="Arial, sans-serif"),
|
| 472 |
+
xaxis=dict(
|
| 473 |
+
gridcolor="#30363d",
|
| 474 |
+
showgrid=True,
|
| 475 |
+
zeroline=False,
|
| 476 |
+
color="#8b949e"
|
| 477 |
+
),
|
| 478 |
+
yaxis=dict(
|
| 479 |
+
gridcolor="#30363d",
|
| 480 |
+
showgrid=True,
|
| 481 |
+
zeroline=False,
|
| 482 |
+
color="#8b949e"
|
| 483 |
+
),
|
| 484 |
+
legend=dict(
|
| 485 |
+
bgcolor="rgba(13, 17, 23, 0.8)",
|
| 486 |
+
bordercolor="#30363d",
|
| 487 |
+
borderwidth=1,
|
| 488 |
+
font=dict(color="#e6edf3")
|
| 489 |
+
),
|
| 490 |
+
hoverlabel=dict(
|
| 491 |
+
bgcolor="#0d1117",
|
| 492 |
+
bordercolor="#30363d",
|
| 493 |
+
font=dict(color="#e6edf3")
|
| 494 |
+
)
|
| 495 |
)
|
| 496 |
|
| 497 |
st.plotly_chart(fig_financial, use_container_width=True)
|
|
|
|
| 506 |
fig_price.add_trace(go.Scatter(
|
| 507 |
x=df.index, y=df["close"],
|
| 508 |
name="Close Price",
|
| 509 |
+
line=dict(color="#0066ff", width=2.5)
|
| 510 |
))
|
| 511 |
fig_price.add_trace(go.Scatter(
|
| 512 |
x=df.index, y=df["SMA"],
|
|
|
|
| 526 |
hovermode="x unified",
|
| 527 |
template="plotly_dark",
|
| 528 |
height=500,
|
| 529 |
+
margin=dict(l=0, r=0, t=40, b=0),
|
| 530 |
+
plot_bgcolor="#0d1117",
|
| 531 |
+
paper_bgcolor="#0e1117",
|
| 532 |
+
font=dict(color="#e6edf3", size=12, family="Arial, sans-serif"),
|
| 533 |
+
xaxis=dict(
|
| 534 |
+
gridcolor="#30363d",
|
| 535 |
+
showgrid=True,
|
| 536 |
+
zeroline=False,
|
| 537 |
+
color="#8b949e"
|
| 538 |
+
),
|
| 539 |
+
yaxis=dict(
|
| 540 |
+
gridcolor="#30363d",
|
| 541 |
+
showgrid=True,
|
| 542 |
+
zeroline=False,
|
| 543 |
+
color="#8b949e"
|
| 544 |
+
),
|
| 545 |
+
legend=dict(
|
| 546 |
+
bgcolor="rgba(13, 17, 23, 0.8)",
|
| 547 |
+
bordercolor="#30363d",
|
| 548 |
+
borderwidth=1,
|
| 549 |
+
font=dict(color="#e6edf3")
|
| 550 |
+
),
|
| 551 |
+
hoverlabel=dict(
|
| 552 |
+
bgcolor="#0d1117",
|
| 553 |
+
bordercolor="#30363d",
|
| 554 |
+
font=dict(color="#e6edf3")
|
| 555 |
+
)
|
| 556 |
)
|
| 557 |
|
| 558 |
st.plotly_chart(fig_price, use_container_width=True)
|
|
|
|
| 564 |
fig_rsi.add_trace(go.Scatter(
|
| 565 |
x=df.index, y=df["RSI"],
|
| 566 |
name="RSI",
|
| 567 |
+
line=dict(color="#ff3838", width=2.5),
|
| 568 |
fill="tozeroy",
|
| 569 |
+
fillcolor="rgba(255, 56, 56, 0.15)"
|
| 570 |
))
|
| 571 |
|
| 572 |
# Add overbought/oversold lines
|
| 573 |
+
fig_rsi.add_hline(y=70, line_dash="dash", line_color="rgba(255, 165, 0, 0.6)", annotation_text="Overbought (70)")
|
| 574 |
+
fig_rsi.add_hline(y=30, line_dash="dash", line_color="rgba(0, 208, 132, 0.6)", annotation_text="Oversold (30)")
|
| 575 |
+
fig_rsi.add_hline(y=50, line_dash="dot", line_color="rgba(139, 148, 158, 0.3)")
|
| 576 |
|
| 577 |
fig_rsi.update_layout(
|
| 578 |
title=f"{symbol} - Relative Strength Index (RSI)",
|
|
|
|
| 581 |
hovermode="x unified",
|
| 582 |
template="plotly_dark",
|
| 583 |
height=500,
|
| 584 |
+
margin=dict(l=0, r=0, t=40, b=0),
|
| 585 |
+
plot_bgcolor="#0d1117",
|
| 586 |
+
paper_bgcolor="#0e1117",
|
| 587 |
+
font=dict(color="#e6edf3", size=12, family="Arial, sans-serif"),
|
| 588 |
+
xaxis=dict(
|
| 589 |
+
gridcolor="#30363d",
|
| 590 |
+
showgrid=True,
|
| 591 |
+
zeroline=False,
|
| 592 |
+
color="#8b949e"
|
| 593 |
+
),
|
| 594 |
+
yaxis=dict(
|
| 595 |
+
range=[0, 100],
|
| 596 |
+
gridcolor="#30363d",
|
| 597 |
+
showgrid=True,
|
| 598 |
+
zeroline=False,
|
| 599 |
+
color="#8b949e"
|
| 600 |
+
),
|
| 601 |
+
legend=dict(
|
| 602 |
+
bgcolor="rgba(13, 17, 23, 0.8)",
|
| 603 |
+
bordercolor="#30363d",
|
| 604 |
+
borderwidth=1,
|
| 605 |
+
font=dict(color="#e6edf3")
|
| 606 |
+
),
|
| 607 |
+
hoverlabel=dict(
|
| 608 |
+
bgcolor="#0d1117",
|
| 609 |
+
bordercolor="#30363d",
|
| 610 |
+
font=dict(color="#e6edf3")
|
| 611 |
+
)
|
| 612 |
)
|
| 613 |
|
| 614 |
st.plotly_chart(fig_rsi, use_container_width=True)
|