|
1 | 1 | import plotly.graph_objects as go
|
2 | 2 | import streamlit as st
|
| 3 | +from streamlit_pills import pills |
3 | 4 |
|
4 | 5 | from .raw_content import homepage_content, footer_content, not_found_ticker_content
|
5 | 6 | from .styling import apply_text_color, apply_tag_style
|
@@ -169,11 +170,20 @@ def render_overview(financial_data, *kwargs):
|
169 | 170 | )
|
170 | 171 |
|
171 | 172 |
|
172 |
| -def render_balance_sheet(financial_data, financial_calculations, frequency="yearly"): |
| 173 | +frequency_mapping = { |
| 174 | + "Annual": "yearly", |
| 175 | + "Quarterly": "quarterly", |
| 176 | +} |
| 177 | + |
| 178 | + |
| 179 | +def render_balance_sheet(financial_data, financial_calculations): |
| 180 | + frequency = pills("Select report frequency:", ["Annual", "Quarterly"]) |
| 181 | + |
173 | 182 | balance_sheet = financial_data.get_balance_sheet(
|
174 |
| - st.session_state["ticker"], frequency=frequency |
| 183 | + st.session_state["ticker"], frequency=frequency_mapping[frequency] |
175 | 184 | )
|
176 | 185 |
|
| 186 | + # Render Metrics |
177 | 187 | with st.container():
|
178 | 188 | col1, col2, col3 = st.columns(3)
|
179 | 189 |
|
@@ -284,6 +294,8 @@ def render_balance_sheet(financial_data, financial_calculations, frequency="year
|
284 | 294 | delta=f"{current_ratio_diff:.3} ({current_ratio_change:.2f}%)",
|
285 | 295 | )
|
286 | 296 |
|
| 297 | + # Render Charts |
| 298 | + |
287 | 299 |
|
288 | 300 | def render_income_stmt(financial_data, *kwargs):
|
289 | 301 | income_stmt = financial_data.get_income_statement(
|
|
0 commit comments