Skip to content

made changes following changes #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 37 additions & 18 deletions main_app.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,36 @@
# main_app.py

import streamlit as st
import pandas as pd
import plotly.express as px
from app_modules.styles_app import apply_styles
from app_modules.tabs_app import (
render_tab1_project_proposal,
render_tab2_bird_flu,
render_tab3_egg_stocks,
render_tab4_dashboard
render_tab3_egg_stocks
)

def render_combined_dashboard():
st.subheader("📊 Combined Dashboard")

# Example CPI and Egg Prices Data
cpi_data = pd.DataFrame({
"Month": pd.date_range(start="2020-01-01", periods=12, freq="M"),
"CPI": [250, 252, 255, 258, 260, 262, 265, 268, 270, 273, 275, 278],
"Egg Prices": [1.5, 1.6, 1.7, 1.8, 2.0, 2.1, 2.3, 2.5, 2.6, 2.8, 3.0, 3.2]
})

# Create Scatter Plot
fig = px.scatter(
cpi_data,
x="CPI",
y="Egg Prices",
title="CPI vs Egg Prices",
labels={"CPI": "Consumer Price Index", "Egg Prices": "Egg Prices ($)"},
template="plotly_white"
)
st.plotly_chart(fig)

def main():
apply_styles()
st.title("🐔 Chicken Economics: Unpacking Bird Flu, Egg Prices & Market Signals")
Expand All @@ -17,25 +39,22 @@ def main():
st.write("Fred Lee")
st.write("Angel Ragas")

# Define tabs
tab1, tab2, tab3, tab4 = st.tabs([
"📘 Project Proposal",
"🦠 Bird Flu Data",
"🥚 Egg Prices & Stocks",
"📊 Combined Dashboard"
])
# Sidebar for Tabs
st.sidebar.markdown("<h2 style='font-size:20px;'>Navigation</h2>", unsafe_allow_html=True)
tab = st.sidebar.radio(
"Select a Tab:",
["📘 Project Proposal", "🦠 Bird Flu Data", "🥚 Egg Prices & Stocks", "📊 Combined Dashboard"]
)

with tab1:
# Render Tabs
if tab == "📘 Project Proposal":
render_tab1_project_proposal()

with tab2:
elif tab == "🦠 Bird Flu Data":
render_tab2_bird_flu()

with tab3:
elif tab == "🥚 Egg Prices & Stocks":
render_tab3_egg_stocks()

with tab4:
render_tab4_dashboard()
elif tab == "📊 Combined Dashboard":
render_combined_dashboard()

if __name__ == "__main__":
main()
main()