Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -105,34 +105,34 @@ with st.sidebar:
|
|
| 105 |
uploaded_file = "Intervention.csv"
|
| 106 |
|
| 107 |
# --- Visualizations of the whole data ---
|
| 108 |
-
|
| 109 |
st.write("Overall Data Visualizations")
|
| 110 |
|
| 111 |
if tabs == 'Chat':
|
| 112 |
col1, col2 = st.columns([1, 1]) # Equal width columns
|
| 113 |
|
| 114 |
with col1: # Visualizations on the left
|
| 115 |
-
fig_gender_full = px.histogram(
|
| 116 |
fig_gender_full.update_layout(height=350, width=350)
|
| 117 |
st.plotly_chart(fig_gender_full)
|
| 118 |
|
| 119 |
-
fig_youth_full = px.histogram(
|
| 120 |
fig_youth_full.update_layout(height=350, width=300)
|
| 121 |
st.plotly_chart(fig_youth_full)
|
| 122 |
|
| 123 |
-
fig_company_full = px.histogram(
|
| 124 |
fig_company_full.update_layout(height=300, width=300)
|
| 125 |
st.plotly_chart(fig_company_full)
|
| 126 |
|
| 127 |
-
fig_category_full = px.histogram(
|
| 128 |
fig_category_full.update_layout(height=300, width=200)
|
| 129 |
st.plotly_chart(fig_category_full)
|
| 130 |
|
| 131 |
-
fig_intervention_full = px.histogram(
|
| 132 |
fig_intervention_full.update_layout(height=300, width=300)
|
| 133 |
st.plotly_chart(fig_intervention_full)
|
| 134 |
|
| 135 |
-
fig_pie_category = px.pie(
|
| 136 |
fig_pie_category.update_layout(height=400, width=500)
|
| 137 |
st.plotly_chart(fig_pie_category)
|
| 138 |
|
|
|
|
| 105 |
uploaded_file = "Intervention.csv"
|
| 106 |
|
| 107 |
# --- Visualizations of the whole data ---
|
| 108 |
+
df = pd.read_csv(uploaded_file) # Load the full data *once*
|
| 109 |
st.write("Overall Data Visualizations")
|
| 110 |
|
| 111 |
if tabs == 'Chat':
|
| 112 |
col1, col2 = st.columns([1, 1]) # Equal width columns
|
| 113 |
|
| 114 |
with col1: # Visualizations on the left
|
| 115 |
+
fig_gender_full = px.histogram(df, x="Gender", title="Overall Gender Distribution")
|
| 116 |
fig_gender_full.update_layout(height=350, width=350)
|
| 117 |
st.plotly_chart(fig_gender_full)
|
| 118 |
|
| 119 |
+
fig_youth_full = px.histogram(df, x="Youth", title="Overall Youth Participation")
|
| 120 |
fig_youth_full.update_layout(height=350, width=300)
|
| 121 |
st.plotly_chart(fig_youth_full)
|
| 122 |
|
| 123 |
+
fig_company_full = px.histogram(df, y="Company Name", title="Overall Company Distribution")
|
| 124 |
fig_company_full.update_layout(height=300, width=300)
|
| 125 |
st.plotly_chart(fig_company_full)
|
| 126 |
|
| 127 |
+
fig_category_full = px.histogram(df, y="Intervention_Category", title="Overall Intervention Category Distribution")
|
| 128 |
fig_category_full.update_layout(height=300, width=200)
|
| 129 |
st.plotly_chart(fig_category_full)
|
| 130 |
|
| 131 |
+
fig_intervention_full = px.histogram(df, y="Intervention", title="Overall Intervention Type Distribution")
|
| 132 |
fig_intervention_full.update_layout(height=300, width=300)
|
| 133 |
st.plotly_chart(fig_intervention_full)
|
| 134 |
|
| 135 |
+
fig_pie_category = px.pie(df, names='Intervention_Category', title='Overall Intervention Category Pie Chart')
|
| 136 |
fig_pie_category.update_layout(height=400, width=500)
|
| 137 |
st.plotly_chart(fig_pie_category)
|
| 138 |
|