Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -177,14 +177,14 @@ if st.session_state.df is not None:
|
|
| 177 |
fig = px.box(st.session_state.df, x="job_title", y="salary_in_usd",
|
| 178 |
title="Salary Distribution by Job Title")
|
| 179 |
|
| 180 |
-
# Insert visualization after "4.
|
| 181 |
-
insert_section = "4.
|
| 182 |
if insert_section in result:
|
| 183 |
parts = result.split(insert_section)
|
| 184 |
-
st.markdown(parts[0]) # Show content before section
|
| 185 |
-
|
| 186 |
-
|
| 187 |
# Insert the visualization here
|
|
|
|
| 188 |
st.plotly_chart(fig, use_container_width=True)
|
| 189 |
|
| 190 |
# Continue with the rest of the report
|
|
@@ -196,7 +196,7 @@ if st.session_state.df is not None:
|
|
| 196 |
else:
|
| 197 |
st.markdown(result)
|
| 198 |
|
| 199 |
-
# Tab 2:
|
| 200 |
with tab2:
|
| 201 |
st.subheader("π Comprehensive Data Visualizations")
|
| 202 |
|
|
@@ -223,6 +223,12 @@ if st.session_state.df is not None:
|
|
| 223 |
title="Salary Distribution by Company Size")
|
| 224 |
st.plotly_chart(fig4)
|
| 225 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 226 |
temp_dir.cleanup()
|
| 227 |
else:
|
| 228 |
st.info("Please load a dataset to proceed.")
|
|
|
|
| 177 |
fig = px.box(st.session_state.df, x="job_title", y="salary_in_usd",
|
| 178 |
title="Salary Distribution by Job Title")
|
| 179 |
|
| 180 |
+
# Insert visualization after "4. Influence of Company Size" for better flow
|
| 181 |
+
insert_section = "4. Influence of Company Size"
|
| 182 |
if insert_section in result:
|
| 183 |
parts = result.split(insert_section)
|
| 184 |
+
st.markdown(parts[0]) # Show content before the section
|
| 185 |
+
|
|
|
|
| 186 |
# Insert the visualization here
|
| 187 |
+
st.markdown(f"## {insert_section}{parts[1].split('5.')[0]}")
|
| 188 |
st.plotly_chart(fig, use_container_width=True)
|
| 189 |
|
| 190 |
# Continue with the rest of the report
|
|
|
|
| 196 |
else:
|
| 197 |
st.markdown(result)
|
| 198 |
|
| 199 |
+
# Tab 2: Full Data Visualization
|
| 200 |
with tab2:
|
| 201 |
st.subheader("π Comprehensive Data Visualizations")
|
| 202 |
|
|
|
|
| 223 |
title="Salary Distribution by Company Size")
|
| 224 |
st.plotly_chart(fig4)
|
| 225 |
|
| 226 |
+
# Salary by Region (if available)
|
| 227 |
+
if "region" in st.session_state.df.columns:
|
| 228 |
+
fig5 = px.box(st.session_state.df, x="region", y="salary_in_usd",
|
| 229 |
+
title="Salary Distribution by Region")
|
| 230 |
+
st.plotly_chart(fig5)
|
| 231 |
+
|
| 232 |
temp_dir.cleanup()
|
| 233 |
else:
|
| 234 |
st.info("Please load a dataset to proceed.")
|