aboutsummaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorTyler <tyler@tylerhoang.xyz>2026-04-03 19:09:33 -0700
committerTyler <tyler@tylerhoang.xyz>2026-04-03 19:09:33 -0700
commitad40fbe3095b2f837b015b3208c0828bd0f47d2b (patch)
tree4a5ff99ca706e79dd4fb64fb6dcd4c85f910c620 /components
parent632ed9487fd6fe50d3b7a5a0c20bb1ae41ad2be2 (diff)
Make valuation models collapsibleHEADmaster
Diffstat (limited to 'components')
-rw-r--r--components/valuation.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/components/valuation.py b/components/valuation.py
index 031c424..0095f41 100644
--- a/components/valuation.py
+++ b/components/valuation.py
@@ -1049,26 +1049,28 @@ def _render_models(ticker: str):
st.caption(ctx["summary"])
_render_model_availability(ctx)
- sections = []
+ sections: list[tuple[str, callable]] = []
if ctx["is_financial"] and ctx["pb_available"]:
- sections.append(_render_price_to_book_model)
+ sections.append(("Price / Book", _render_price_to_book_model))
if ctx["dcf_available"]:
- sections.append(_render_dcf_model)
+ sections.append(("Discounted Cash Flow", _render_dcf_model))
if ctx["ev_available"]:
- sections.append(_render_ev_ebitda_model)
+ sections.append(("EV / EBITDA", _render_ev_ebitda_model))
if ctx["ev_revenue_available"] and not ctx["is_financial"]:
- sections.append(_render_ev_revenue_model)
- if ctx["pb_available"] and _render_price_to_book_model not in sections:
- sections.append(_render_price_to_book_model)
+ sections.append(("EV / Revenue", _render_ev_revenue_model))
+ section_renderers = {renderer for _, renderer in sections}
+ if ctx["pb_available"] and _render_price_to_book_model not in section_renderers:
+ sections.append(("Price / Book", _render_price_to_book_model))
if not sections:
st.info("No valuation model is currently applicable for this company.")
st.caption("Use comps, ratios, earnings history, and analyst targets instead.")
else:
- for i, render_section in enumerate(sections):
+ for i, (label, render_section) in enumerate(sections):
if i > 0:
st.divider()
- render_section(ctx)
+ with st.expander(label, expanded=(i == 0)):
+ render_section(ctx)
unavailable = []
if not ctx["dcf_available"]: