Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +7 -7
src/streamlit_app.py
CHANGED
|
@@ -229,7 +229,7 @@ if st.button("Results"):
|
|
| 229 |
# Tree map
|
| 230 |
st.subheader("Tree map", divider = "violet")
|
| 231 |
fig_treemap = px.treemap(df, path=[px.Constant("all"), 'category', 'label', 'text'], values='score', color='category')
|
| 232 |
-
fig_treemap.update_layout(margin=dict(t=50, l=25, r=25, b=25), paper_bgcolor='#
|
| 233 |
st.plotly_chart(fig_treemap)
|
| 234 |
|
| 235 |
# Pie and Bar charts
|
|
@@ -242,8 +242,8 @@ if st.button("Results"):
|
|
| 242 |
fig_pie = px.pie(grouped_counts, values='count', names='category', hover_data=['count'], labels={'count': 'count'}, title='Percentage of predicted categories')
|
| 243 |
fig_pie.update_traces(textposition='inside', textinfo='percent+label')
|
| 244 |
fig_pie.update_layout(
|
| 245 |
-
paper_bgcolor='#
|
| 246 |
-
plot_bgcolor='#
|
| 247 |
)
|
| 248 |
st.plotly_chart(fig_pie)
|
| 249 |
|
|
@@ -254,8 +254,8 @@ if st.button("Results"):
|
|
| 254 |
st.subheader("Bar chart", divider = "violet")
|
| 255 |
fig_bar = px.bar(grouped_counts, x="count", y="category", color="category", text_auto=True, title='Occurrences of predicted categories')
|
| 256 |
fig_bar.update_layout( # Changed from fig_pie to fig_bar
|
| 257 |
-
paper_bgcolor='#
|
| 258 |
-
plot_bgcolor='#
|
| 259 |
)
|
| 260 |
st.plotly_chart(fig_bar)
|
| 261 |
|
|
@@ -268,8 +268,8 @@ if st.button("Results"):
|
|
| 268 |
st.dataframe(repeating_entities, use_container_width=True)
|
| 269 |
fig_repeating_bar = px.bar(repeating_entities, x='Entity', y='Count', color='Entity')
|
| 270 |
fig_repeating_bar.update_layout(xaxis={'categoryorder': 'total descending'},
|
| 271 |
-
paper_bgcolor='#
|
| 272 |
-
plot_bgcolor='#
|
| 273 |
st.plotly_chart(fig_repeating_bar)
|
| 274 |
else:
|
| 275 |
st.warning("No entities were found that occur more than once.")
|
|
|
|
| 229 |
# Tree map
|
| 230 |
st.subheader("Tree map", divider = "violet")
|
| 231 |
fig_treemap = px.treemap(df, path=[px.Constant("all"), 'category', 'label', 'text'], values='score', color='category')
|
| 232 |
+
fig_treemap.update_layout(margin=dict(t=50, l=25, r=25, b=25), paper_bgcolor='#E8F5E9', plot_bgcolor='#E8F5E9')
|
| 233 |
st.plotly_chart(fig_treemap)
|
| 234 |
|
| 235 |
# Pie and Bar charts
|
|
|
|
| 242 |
fig_pie = px.pie(grouped_counts, values='count', names='category', hover_data=['count'], labels={'count': 'count'}, title='Percentage of predicted categories')
|
| 243 |
fig_pie.update_traces(textposition='inside', textinfo='percent+label')
|
| 244 |
fig_pie.update_layout(
|
| 245 |
+
paper_bgcolor='#E8F5E9',
|
| 246 |
+
plot_bgcolor='#E8F5E9'
|
| 247 |
)
|
| 248 |
st.plotly_chart(fig_pie)
|
| 249 |
|
|
|
|
| 254 |
st.subheader("Bar chart", divider = "violet")
|
| 255 |
fig_bar = px.bar(grouped_counts, x="count", y="category", color="category", text_auto=True, title='Occurrences of predicted categories')
|
| 256 |
fig_bar.update_layout( # Changed from fig_pie to fig_bar
|
| 257 |
+
paper_bgcolor='#E8F5E9',
|
| 258 |
+
plot_bgcolor='#E8F5E9'
|
| 259 |
)
|
| 260 |
st.plotly_chart(fig_bar)
|
| 261 |
|
|
|
|
| 268 |
st.dataframe(repeating_entities, use_container_width=True)
|
| 269 |
fig_repeating_bar = px.bar(repeating_entities, x='Entity', y='Count', color='Entity')
|
| 270 |
fig_repeating_bar.update_layout(xaxis={'categoryorder': 'total descending'},
|
| 271 |
+
paper_bgcolor='#E8F5E9',
|
| 272 |
+
plot_bgcolor='#E8F5E9')
|
| 273 |
st.plotly_chart(fig_repeating_bar)
|
| 274 |
else:
|
| 275 |
st.warning("No entities were found that occur more than once.")
|