Spaces:
Build error
Build error
Upload app.py
Browse files5 unmodified lines67891011127 unmodified lines2021222324252639 unmodified lines66676869707172737475767778798081825 unmodified linesst.set_page_config(page_title="IL Crop Rotation Explorer", layout="wide")st.title("🌾 Illinois Crop Rotation and Land Use Exploration")st.markdown("Explore dominant crops and land use characteristics across Illinois fields from 2010–2020. This dashboard is for exploration and pattern recognition.")# Load data@st.cache_data7 unmodified linesgenlu_options = sorted(df['GenLU'].dropna().unique())selected_crops = st.sidebar.multiselect("Filter by Crop", crop_options, default=crop_options[:5])selected_genlu = st.sidebar.multiselect("Filter by General Land Use", genlu_options, default=genlu_options)filtered = df[df['crop_name'].isin(selected_crops) & df['GenLU'].isin(selected_genlu)]39 unmodified lines)# -- Boxplot: Rotation Diversity by Land Use --rotation_box = alt.Chart(df).mark_boxplot().encode(x=alt.X('GenLU:N', title='General Land Use'),y=alt.Y('rotation_diversity:Q', title='Rotation Diversity'),color='GenLU:N').properties(width=350,height=400,title='Rotation Diversity by Land Use')# ---- Layout ----st.altair_chart(area_chart, use_container_width=True)st.altair_chart(scatter, use_container_width=True)5 unmodified lines67891011127 unmodified lines2021222324252639 unmodified lines66676869707172737475767778798081825 unmodified linesst.set_page_config(page_title="IL Crop Rotation Explorer", layout="wide")st.title("🌾 Illinois Crop Rotation and Land Use Exploration")st.markdown("Explore dominant crops and land use characteristics across Illinois fields from 2010–2020. This dashboard is for exploration and pattern recognition. Dashboard created by Sara Kiel.")# Load data@st.cache_data7 unmodified linesgenlu_options = sorted(df['GenLU'].dropna().unique())selected_crops = st.sidebar.multiselect("Filter by Crop", crop_options, default=crop_options[:5])selected_genlu = st.sidebar.multiselect("Filter by General Land Use", genlu_options, default=genlu_options[:5])filtered = df[df['crop_name'].isin(selected_crops) & df['GenLU'].isin(selected_genlu)]39 unmodified lines)# -- Boxplot: Rotation Diversity by Land Use --rotation_box = alt.Chart(filtered).mark_boxplot().encode(x=alt.X('GenLU:N', title='General Land Use'),y=alt.Y('rotation_diversity:Q', title='Rotation Diversity'),color='GenLU:N',tooltip=['GenLU', 'rotation_diversity']).properties(title='Rotation Diversity by Land Use (Filtered)',width=800,height=400)# ---- Layout ----st.altair_chart(area_chart, use_container_width=True)st.altair_chart(scatter, use_container_width=True)
app.py+8-8