Spaces:
Running
Running
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +6 -8
src/streamlit_app.py
CHANGED
|
@@ -41,11 +41,12 @@ with st.sidebar:
|
|
| 41 |
st.write("Use the following code to embed the DataHarvest web app on your website. Feel free to adjust the width and height values to fit your page.")
|
| 42 |
code = '''
|
| 43 |
<iframe
|
| 44 |
-
src="https://aiecosystem-
|
| 45 |
frameborder="0"
|
| 46 |
width="850"
|
| 47 |
height="450"
|
| 48 |
></iframe>
|
|
|
|
| 49 |
|
| 50 |
'''
|
| 51 |
st.code(code, language="html")
|
|
@@ -154,7 +155,7 @@ if st.button("Results"):
|
|
| 154 |
# Tree map
|
| 155 |
st.subheader("Tree map", divider = "violet")
|
| 156 |
fig_treemap = px.treemap(df, path=[px.Constant("all"), 'category', 'label', 'text'], values='score', color='category')
|
| 157 |
-
fig_treemap.update_layout(margin=dict(t=50, l=25, r=25, b=25)
|
| 158 |
st.plotly_chart(fig_treemap)
|
| 159 |
|
| 160 |
# Pie and Bar charts
|
|
@@ -167,8 +168,7 @@ if st.button("Results"):
|
|
| 167 |
fig_pie = px.pie(grouped_counts, values='count', names='category', hover_data=['count'], labels={'count': 'count'}, title='Percentage of predicted categories')
|
| 168 |
fig_pie.update_traces(textposition='inside', textinfo='percent+label')
|
| 169 |
fig_pie.update_layout(
|
| 170 |
-
|
| 171 |
-
plot_bgcolor='#E8F5E9'
|
| 172 |
)
|
| 173 |
st.plotly_chart(fig_pie)
|
| 174 |
|
|
@@ -179,8 +179,7 @@ if st.button("Results"):
|
|
| 179 |
st.subheader("Bar chart", divider = "violet")
|
| 180 |
fig_bar = px.bar(grouped_counts, x="count", y="category", color="category", text_auto=True, title='Occurrences of predicted categories')
|
| 181 |
fig_bar.update_layout( # Changed from fig_pie to fig_bar
|
| 182 |
-
|
| 183 |
-
plot_bgcolor='#E8F5E9'
|
| 184 |
)
|
| 185 |
st.plotly_chart(fig_bar)
|
| 186 |
|
|
@@ -193,8 +192,7 @@ if st.button("Results"):
|
|
| 193 |
st.dataframe(repeating_entities, use_container_width=True)
|
| 194 |
fig_repeating_bar = px.bar(repeating_entities, x='Entity', y='Count', color='Entity')
|
| 195 |
fig_repeating_bar.update_layout(xaxis={'categoryorder': 'total descending'},
|
| 196 |
-
|
| 197 |
-
plot_bgcolor='#E8F5E9')
|
| 198 |
st.plotly_chart(fig_repeating_bar)
|
| 199 |
else:
|
| 200 |
st.warning("No entities were found that occur more than once.")
|
|
|
|
| 41 |
st.write("Use the following code to embed the DataHarvest web app on your website. Feel free to adjust the width and height values to fit your page.")
|
| 42 |
code = '''
|
| 43 |
<iframe
|
| 44 |
+
src="https://aiecosystem-dataharvest.hf.space"
|
| 45 |
frameborder="0"
|
| 46 |
width="850"
|
| 47 |
height="450"
|
| 48 |
></iframe>
|
| 49 |
+
|
| 50 |
|
| 51 |
'''
|
| 52 |
st.code(code, language="html")
|
|
|
|
| 155 |
# Tree map
|
| 156 |
st.subheader("Tree map", divider = "violet")
|
| 157 |
fig_treemap = px.treemap(df, path=[px.Constant("all"), 'category', 'label', 'text'], values='score', color='category')
|
| 158 |
+
fig_treemap.update_layout(margin=dict(t=50, l=25, r=25, b=25))
|
| 159 |
st.plotly_chart(fig_treemap)
|
| 160 |
|
| 161 |
# Pie and Bar charts
|
|
|
|
| 168 |
fig_pie = px.pie(grouped_counts, values='count', names='category', hover_data=['count'], labels={'count': 'count'}, title='Percentage of predicted categories')
|
| 169 |
fig_pie.update_traces(textposition='inside', textinfo='percent+label')
|
| 170 |
fig_pie.update_layout(
|
| 171 |
+
|
|
|
|
| 172 |
)
|
| 173 |
st.plotly_chart(fig_pie)
|
| 174 |
|
|
|
|
| 179 |
st.subheader("Bar chart", divider = "violet")
|
| 180 |
fig_bar = px.bar(grouped_counts, x="count", y="category", color="category", text_auto=True, title='Occurrences of predicted categories')
|
| 181 |
fig_bar.update_layout( # Changed from fig_pie to fig_bar
|
| 182 |
+
|
|
|
|
| 183 |
)
|
| 184 |
st.plotly_chart(fig_bar)
|
| 185 |
|
|
|
|
| 192 |
st.dataframe(repeating_entities, use_container_width=True)
|
| 193 |
fig_repeating_bar = px.bar(repeating_entities, x='Entity', y='Count', color='Entity')
|
| 194 |
fig_repeating_bar.update_layout(xaxis={'categoryorder': 'total descending'},
|
| 195 |
+
)
|
|
|
|
| 196 |
st.plotly_chart(fig_repeating_bar)
|
| 197 |
else:
|
| 198 |
st.warning("No entities were found that occur more than once.")
|