Spaces:
Sleeping
Sleeping
mihaeladuta commited on
Commit ·
a3b9808
1
Parent(s): 98dd01b
Added ability to select an outputs type from a dropdown list.
Browse files- src/pages/2_Outputs.py +32 -4
src/pages/2_Outputs.py
CHANGED
|
@@ -34,6 +34,7 @@ st.markdown("Select from the charts below to view the "
|
|
| 34 |
for column in [cb.COL_PANEL_NAME,
|
| 35 |
cb.COL_UOA_NAME,
|
| 36 |
cb.COL_OUTPUT_TYPE_NAME,
|
|
|
|
| 37 |
cb.COL_OPEN_ACCESS]:
|
| 38 |
with st.expander(column):
|
| 39 |
dset_stats = proc.calculate_counts(dset,
|
|
@@ -42,9 +43,35 @@ for column in [cb.COL_PANEL_NAME,
|
|
| 42 |
vis.draw_counts_percent_chart(dset_stats,
|
| 43 |
column)
|
| 44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
st.markdown(f"## Outputs with a specified term in the '{cb.COL_OUTPUT_TITLE}'")
|
| 46 |
search_word = st.text_input(f"Enter a term to search the '{cb.COL_OUTPUT_TITLE}'"
|
| 47 |
-
" of the outputs
|
| 48 |
" for example software, computation, database, machine learning etc.",
|
| 49 |
max_chars=40,
|
| 50 |
value="",
|
|
@@ -63,10 +90,11 @@ if search_word:
|
|
| 63 |
for column in [cb.COL_PANEL_NAME,
|
| 64 |
cb.COL_UOA_NAME,
|
| 65 |
cb.COL_OUTPUT_TYPE_NAME,
|
|
|
|
| 66 |
cb.COL_OPEN_ACCESS]:
|
| 67 |
with st.expander(column):
|
| 68 |
dset_stats = proc.calculate_counts(dset_selected,
|
| 69 |
-
|
| 70 |
-
|
| 71 |
vis.draw_counts_percent_chart(dset_stats,
|
| 72 |
-
|
|
|
|
| 34 |
for column in [cb.COL_PANEL_NAME,
|
| 35 |
cb.COL_UOA_NAME,
|
| 36 |
cb.COL_OUTPUT_TYPE_NAME,
|
| 37 |
+
cb.COL_OUTPUT_INTERDISCIPLINARY,
|
| 38 |
cb.COL_OPEN_ACCESS]:
|
| 39 |
with st.expander(column):
|
| 40 |
dset_stats = proc.calculate_counts(dset,
|
|
|
|
| 43 |
vis.draw_counts_percent_chart(dset_stats,
|
| 44 |
column)
|
| 45 |
|
| 46 |
+
st.markdown(f"## Outputs of a specific type")
|
| 47 |
+
|
| 48 |
+
search_type = st.selectbox("Select an output type to display",
|
| 49 |
+
[""] + list(cb.OUTPUT_TYPE_NAMES.values()),
|
| 50 |
+
index=0
|
| 51 |
+
)
|
| 52 |
+
|
| 53 |
+
if search_type:
|
| 54 |
+
dset_selected = dset[dset[cb.COL_OUTPUT_TYPE_NAME] == search_type]
|
| 55 |
+
st.markdown(f"Number of outputs records of type '{search_type}': "
|
| 56 |
+
f"{dset_selected.shape[0]}")
|
| 57 |
+
st.markdown("Select from the charts below to view the "
|
| 58 |
+
"distributions for the number of selected outputs records by ...")
|
| 59 |
+
|
| 60 |
+
for column in [cb.COL_PANEL_NAME,
|
| 61 |
+
cb.COL_UOA_NAME,
|
| 62 |
+
cb.COL_OUTPUT_INTERDISCIPLINARY,
|
| 63 |
+
cb.COL_OPEN_ACCESS]:
|
| 64 |
+
with st.expander(column):
|
| 65 |
+
dset_stats = proc.calculate_counts(dset_selected,
|
| 66 |
+
column,
|
| 67 |
+
sort=False)
|
| 68 |
+
vis.draw_counts_percent_chart(dset_stats,
|
| 69 |
+
column)
|
| 70 |
+
|
| 71 |
+
|
| 72 |
st.markdown(f"## Outputs with a specified term in the '{cb.COL_OUTPUT_TITLE}'")
|
| 73 |
search_word = st.text_input(f"Enter a term to search the '{cb.COL_OUTPUT_TITLE}'"
|
| 74 |
+
" of the outputs,"
|
| 75 |
" for example software, computation, database, machine learning etc.",
|
| 76 |
max_chars=40,
|
| 77 |
value="",
|
|
|
|
| 90 |
for column in [cb.COL_PANEL_NAME,
|
| 91 |
cb.COL_UOA_NAME,
|
| 92 |
cb.COL_OUTPUT_TYPE_NAME,
|
| 93 |
+
cb.COL_OUTPUT_INTERDISCIPLINARY,
|
| 94 |
cb.COL_OPEN_ACCESS]:
|
| 95 |
with st.expander(column):
|
| 96 |
dset_stats = proc.calculate_counts(dset_selected,
|
| 97 |
+
column,
|
| 98 |
+
sort=False)
|
| 99 |
vis.draw_counts_percent_chart(dset_stats,
|
| 100 |
+
column)
|