Spaces:
Build error
Build error
Upload app.py
Browse files4 unmodified lines5678910111222 unmodified lines353637383940419 unmodified lines515253545556575859606162636465666 unmodified lines737475767778794 unmodified linesst.set_page_config(page_title="IL Crop Rotation Explorer", layout="wide")st.title("🌾 Illinois Crop Rotation and Land Use Explorer")st.markdown("Explore dominant crops and land use characteristics across Illinois fields from 2010–2020. This dashboard is for expert exploration and pattern recognition.")# Load data@st.cache_data22 unmodified lines).properties(width=800,height=400,title='Crop Coverage Over Time (Filtered)')# ---- Scatter Plot: Crop Coverage vs Rotation Diversity ----9 unmodified linestitle='Crop Coverage vs. Rotation Diversity Over Time')# ---- Layout ----st.altair_chart(area_chart, use_container_width=True)st.altair_chart(scatter, use_container_width=True)# ---- Discussion Section ----st.subheader("🧾 How to Use This Dashboard")st.markdown("""This dashboard allows experts to explore Illinois crop history and land use trends. Use the sidebar to filter by crop types and general land use categories. The **area chart** shows total crop coverage over time, while the **heatmap** reveals which crops dominate in specific land use contexts.Hover over visual elements for exact values. This tool is helpful for identifying mono-cropping trends, rotation diversity gaps, and conservation opportunities.""")# ---- Contextual Dataset Ideas ----6 unmodified lines# ---- Large File Note ----st.subheader("🗂️ Hosting Considerations")st.markdown("""This dataset does **not exceed GitHub’s file size limit**, and can be hosted directly within this HuggingFace Space. No hosting revision needed at this time.""")4 unmodified lines5678910111222 unmodified lines353637383940419 unmodified lines51525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596976 unmodified lines1041051061071081091104 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_data22 unmodified lines).properties(width=800,height=400,title='Crop Coverage Over Time')# ---- Scatter Plot: Crop Coverage vs Rotation Diversity ----9 unmodified linestitle='Crop Coverage vs. Rotation Diversity Over Time')# -- Prepare continuous corn data --df['cc_years'] = df['CCCount'].str.extract(r'(\d+):').astype(float)# -- Bar chart: Frequency of Continuous Corn Planting --cc_bar = alt.Chart(df).mark_bar().encode(x=alt.X('cc_years:O', title='Years of Continuous Corn (2015–2020)'),y=alt.Y('count():Q', title='Number of Fields'),tooltip=['cc_years', 'count()']).properties(width=350,height=400,title='Continuous Corn Frequency')# -- 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)col1, col2 = st.columns(2)with col1:st.altair_chart(cc_bar, use_container_width=True)with col2:st.altair_chart(rotation_box, use_container_width=True)# ---- Discussion Section ----st.subheader("🧾 How to Use This Dashboard")st.markdown("""This dashboard allows the ability to explore Illinois crop history and land use trends. Use the sidebar to filter by crop types and general land use categories. The **area chart** shows total crop coverage over time, while the scatter plot visualizes how crop coverage relates to rotation diversity across years.Hover over visual elements for exact values. This tool is helpful for identifying mono-cropping trends, rotation diversity gaps, and conservation opportunities particularly with water usage.""")# ---- Contextual Dataset Ideas ----6 unmodified lines# ---- Large File Note ----st.subheader("🗂️ Hosting Considerations")st.markdown("""This dataset does **not exceed GitHub’s file size limit**, and can be hosted directly within this HuggingFace Space.""")
app.py+37-6