Skip to content

Commit c93d546

Browse files
committed
Add ability to select report frequency in Balance Sheet tab
1 parent 6d6eb46 commit c93d546

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ streamlit-extras
44
pandas
55
yfinance
66
plotly
7+
streamlit-pills

src/ui/layout.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import plotly.graph_objects as go
22
import streamlit as st
3+
from streamlit_pills import pills
34

45
from .raw_content import homepage_content, footer_content, not_found_ticker_content
56
from .styling import apply_text_color, apply_tag_style
@@ -169,11 +170,20 @@ def render_overview(financial_data, *kwargs):
169170
)
170171

171172

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+
173182
balance_sheet = financial_data.get_balance_sheet(
174-
st.session_state["ticker"], frequency=frequency
183+
st.session_state["ticker"], frequency=frequency_mapping[frequency]
175184
)
176185

186+
# Render Metrics
177187
with st.container():
178188
col1, col2, col3 = st.columns(3)
179189

@@ -284,6 +294,8 @@ def render_balance_sheet(financial_data, financial_calculations, frequency="year
284294
delta=f"{current_ratio_diff:.3} ({current_ratio_change:.2f}%)",
285295
)
286296

297+
# Render Charts
298+
287299

288300
def render_income_stmt(financial_data, *kwargs):
289301
income_stmt = financial_data.get_income_statement(

0 commit comments

Comments
 (0)