Skip to content

Commit

Permalink
updates and default city search to on
Browse files Browse the repository at this point in the history
  • Loading branch information
TBrost committed Nov 15, 2023
1 parent 81dd90e commit 6385250
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 36 deletions.
9 changes: 5 additions & 4 deletions Welcome.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@ def password_entered():
return True

def welcome_page():
st.markdown("# Main page 🎈")
st.sidebar.markdown("# Main page 🎈")
st.markdown("# Main page ")
st.sidebar.markdown("# Main page")
st.header("Welcome to the BYU-I Idaho Grains App")
st.write('UNDER CONSTRUCTION - I\'m currently working on fixing a few formatting issues so the data and charts are gunna get funky for the next few days.')
#st.write('UNDER CONSTRUCTION - I\'m currently working on fixing a few formatting issues so the data and charts are gunna get funky for the next few days.')
st.subheader('Instructions')
st.write('In this application we have infomation about selling crops in Idaho. Each tab to your left will have different tools to help you evaulate \nwhen and where to sell. Each page will allow you to choose a location as well as specify a crop. You will then be presented with historical data for each week of the year in both a table and a chart to help you analyze time based trends.')

st.subheader('Disclaimer')
st.write('While all attempts have been made to verify and correctly manipulate and display the included data, it is not 100% accurate. Human error and variation within file formats can lead to errors within the data itself as such the tables and visuals in this application are meant for educational purposes only any actions taken in the real world as a result of infomation contained in this application is made at the discresion of the user and the consequences of such actions are the users own responsibilty.')

page_names_to_funcs = {
"Main Page": welcome_page,
Expand Down
7 changes: 0 additions & 7 deletions basis_prices.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
from datetime import date
def basis_page():
st.title("Basis Prices")
#st.write("Below is the cash price for wheat in different strands in different parts of the state. Select the region and strand you are interested in and the table and the chart will adjust to your input. This data is separated into rows by week of the year. In many areas and strands there is no information recorded, but for every week there should be an aggregate value for referance")


# GitHub repository information
owner = "tbrost" # Replace with your GitHub username or organization name
Expand Down Expand Up @@ -106,8 +104,3 @@ def convert_df(df):
reshaped_df = summary_df.T
st.dataframe(reshaped_df)
st.plotly_chart(fig2)
#def link_to_github():
# href = '<a href="https://github.com/Lusk27/app_display/tree/main/Data" target="_blank">Link to GitHub</a>'
# return href

#st.markdown(link_to_github(), unsafe_allow_html=True)
23 changes: 6 additions & 17 deletions cash_prices.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
from datetime import date
def cash_page():
st.title("Cash Prices")
#st.write("Below is the cash price for wheat in different strands in different parts of the state. Select the region and strand you are interested in and the table and the chart will adjust to your input. This data is separated into rows by week of the year. In many areas and strands there is no information recorded, but for every week there should be an aggregate value for referance")


# GitHub repository information
owner = "tbrost" # Replace with your GitHub username or organization name
Expand All @@ -26,7 +24,8 @@ def cash_page():


#st.download_button("Download Data", df)
on = st.toggle('Filter by City')
st.header("Filters")
on = st.toggle('Filter by City', value=True)

CITY = st.selectbox(
'Select a City (only works if switch above is active)',
Expand Down Expand Up @@ -72,6 +71,8 @@ def cash_page():
df_pivot['Standard Deviation'] = df_pivot.std(axis=1)

df_pivot = df_pivot.reset_index(names=['Attribute', 'week of year', 'Location'])
st.header("Data")
st.write("All values in un-adjusted US dollars.")
st.dataframe(df_pivot)

if not on:
Expand All @@ -91,6 +92,7 @@ def convert_df(df):
file_name=filename,
mime='text/csv',
)

# Allow users to select summary columns for the line chart
selected_columns = st.multiselect(
'Select summary columns for the line chart',
Expand Down Expand Up @@ -124,17 +126,4 @@ def convert_df(df):
# Transpose (T) the DataFrame and reset the index
reshaped_df = summary_df.T
st.dataframe(reshaped_df)
st.plotly_chart(fig2)

#selected_columns2 = st.selectbox(
# 'Select summary columns for the line chart',
# [2016, 2017, 2018, 2019, 2020,2021,2022, 2023, 2024],7
#)
#fig2 = px.line(df_pivot, x='week of year', y=selected_columns2, title='Value over selected year year:')
#st.plotly_chart(fig2)

#def link_to_github():
# href = '<a href="https://github.com/Lusk27/app_display/tree/main/Data" target="_blank">Link to GitHub</a>'
# return href

#st.markdown(link_to_github(), unsafe_allow_html=True)
st.plotly_chart(fig2)
8 changes: 0 additions & 8 deletions futures_prices.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
from datetime import date
def futures_page():
st.title("Future Prices")
#st.write("Below is the cash price for wheat in different strands in different parts of the state. Select the region and strand you are interested in and the table and the chart will adjust to your input. This data is separated into rows by week of the year. In many areas and strands there is no information recorded, but for every week there should be an aggregate value for referance")


# GitHub repository information
owner = "tbrost" # Replace with your GitHub username or organization name
Expand Down Expand Up @@ -105,9 +103,3 @@ def convert_df(df):
reshaped_df = summary_df.T
st.dataframe(reshaped_df)
st.plotly_chart(fig2)

#def link_to_github():
# href = '<a href="https://github.com/Lusk27/app_display/tree/main/Data" target="_blank">Link to GitHub</a>'
# return href

#st.markdown(link_to_github(), unsafe_allow_html=True)
12 changes: 12 additions & 0 deletions rsconnect-python/ag-econ-app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"https://shiny.byui.edu": {
"server_url": "https://shiny.byui.edu",
"filename": "C:\\RData\\BYUI\\ag-econ-app",
"app_url": "https://shiny.byui.edu/content/b43e00f9-362f-474b-a5ee-ead4dda0ecc6/",
"app_id": "b43e00f9-362f-474b-a5ee-ead4dda0ecc6",
"app_guid": "b43e00f9-362f-474b-a5ee-ead4dda0ecc6",
"title": "ag-econ-app",
"app_mode": "python-streamlit",
"app_store_version": 1
}
}

0 comments on commit 6385250

Please sign in to comment.