Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -112,41 +112,42 @@ df = pd.read_csv(uploaded_file)
|
|
| 112 |
if tabs == 'Chat':
|
| 113 |
st.write("Overall Data Visualizations") # Title above the visualizations
|
| 114 |
|
| 115 |
-
col1, col2 = st.columns([
|
| 116 |
|
| 117 |
-
with col1: # Visualizations on the left
|
| 118 |
-
|
|
|
|
| 119 |
with row1_col1:
|
| 120 |
fig_gender = px.histogram(df, x="Gender", title="Gender Distribution")
|
| 121 |
-
fig_gender.update_layout(height=
|
| 122 |
st.plotly_chart(fig_gender)
|
| 123 |
with row1_col2:
|
| 124 |
fig_youth = px.histogram(df, x="Youth", title="Youth Participation")
|
| 125 |
-
fig_youth.update_layout(height=
|
| 126 |
st.plotly_chart(fig_youth)
|
| 127 |
|
| 128 |
row2_col1, row2_col2 = st.columns([1, 1])
|
| 129 |
with row2_col1:
|
| 130 |
fig_company = px.histogram(df, y="Company Name", title="Company Distribution")
|
| 131 |
-
fig_company.update_layout(height=
|
| 132 |
st.plotly_chart(fig_company)
|
| 133 |
with row2_col2:
|
| 134 |
fig_category = px.histogram(df, y="Intervention_Category", title="Intervention Category Distribution")
|
| 135 |
-
fig_category.update_layout(height=
|
| 136 |
st.plotly_chart(fig_category)
|
| 137 |
-
|
| 138 |
row3_col1, row3_col2 = st.columns([1, 1])
|
| 139 |
with row3_col1:
|
| 140 |
fig_intervention = px.histogram(df, y="Intervention", title="Intervention Type Distribution")
|
| 141 |
-
fig_intervention.update_layout(height=
|
| 142 |
st.plotly_chart(fig_intervention)
|
| 143 |
with row3_col2:
|
| 144 |
fig_pie_category = px.pie(df, names='Intervention_Category', title='Intervention Category Pie Chart')
|
| 145 |
-
fig_pie_category.update_layout(height=400, width=
|
| 146 |
st.plotly_chart(fig_pie_category)
|
| 147 |
|
| 148 |
|
| 149 |
-
with col2: # Chat on the right
|
| 150 |
st.subheader("Chat with AI")
|
| 151 |
st.write("Get visualizations and analysis from our Gemini powered agent")
|
| 152 |
|
|
|
|
| 112 |
if tabs == 'Chat':
|
| 113 |
st.write("Overall Data Visualizations") # Title above the visualizations
|
| 114 |
|
| 115 |
+
col1, col2 = st.columns([1, 1]) # Half and half split
|
| 116 |
|
| 117 |
+
with col1: # Visualizations on the left
|
| 118 |
+
st.set_option('deprecation.showPyplotGlobalUse', False) # Suppress warning
|
| 119 |
+
row1_col1, row1_col2 = st.columns([1, 1]) # 2 visualizations per row
|
| 120 |
with row1_col1:
|
| 121 |
fig_gender = px.histogram(df, x="Gender", title="Gender Distribution")
|
| 122 |
+
fig_gender.update_layout(height=400, width=None) # Responsive width
|
| 123 |
st.plotly_chart(fig_gender)
|
| 124 |
with row1_col2:
|
| 125 |
fig_youth = px.histogram(df, x="Youth", title="Youth Participation")
|
| 126 |
+
fig_youth.update_layout(height=400, width=None) # Responsive width
|
| 127 |
st.plotly_chart(fig_youth)
|
| 128 |
|
| 129 |
row2_col1, row2_col2 = st.columns([1, 1])
|
| 130 |
with row2_col1:
|
| 131 |
fig_company = px.histogram(df, y="Company Name", title="Company Distribution")
|
| 132 |
+
fig_company.update_layout(height=400, width=None) # Responsive width
|
| 133 |
st.plotly_chart(fig_company)
|
| 134 |
with row2_col2:
|
| 135 |
fig_category = px.histogram(df, y="Intervention_Category", title="Intervention Category Distribution")
|
| 136 |
+
fig_category.update_layout(height=400, width=None) # Responsive width
|
| 137 |
st.plotly_chart(fig_category)
|
| 138 |
+
|
| 139 |
row3_col1, row3_col2 = st.columns([1, 1])
|
| 140 |
with row3_col1:
|
| 141 |
fig_intervention = px.histogram(df, y="Intervention", title="Intervention Type Distribution")
|
| 142 |
+
fig_intervention.update_layout(height=400, width=None) # Responsive width
|
| 143 |
st.plotly_chart(fig_intervention)
|
| 144 |
with row3_col2:
|
| 145 |
fig_pie_category = px.pie(df, names='Intervention_Category', title='Intervention Category Pie Chart')
|
| 146 |
+
fig_pie_category.update_layout(height=400, width=None) # Responsive width
|
| 147 |
st.plotly_chart(fig_pie_category)
|
| 148 |
|
| 149 |
|
| 150 |
+
with col2: # Chat on the right
|
| 151 |
st.subheader("Chat with AI")
|
| 152 |
st.write("Get visualizations and analysis from our Gemini powered agent")
|
| 153 |
|