Spaces:
Sleeping
Sleeping
Commit
·
d747029
1
Parent(s):
8b9797b
Update
Browse files- .streamlit/config.toml +4 -0
- app.py +31 -4
- data/filtered_table.xlsx +0 -0
- data/table.docx +0 -0
- data/table.xlsx +0 -0
.streamlit/config.toml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#[theme]
|
2 |
+
#base="light"
|
3 |
+
#backgroundColor="#def3de"
|
4 |
+
#secondaryBackgroundColor="#9ea7b5"
|
app.py
CHANGED
@@ -21,6 +21,24 @@ bionic_prototype_list.sort()
|
|
21 |
method_list.sort()
|
22 |
multifunction_list.sort()
|
23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
with st.sidebar:
|
25 |
st.slider(
|
26 |
label="Search results limit",
|
@@ -34,8 +52,8 @@ with st.sidebar:
|
|
34 |
|
35 |
st.multiselect(
|
36 |
label="Display columns",
|
37 |
-
options=["Bionic prototype", "Multifunction", "Method", "Materials", "Res"],
|
38 |
-
default=["Bionic prototype", "Multifunction", "Method", "Materials", "Res"],
|
39 |
help="Select columns to display in the search results",
|
40 |
key="display_columns",
|
41 |
)
|
@@ -44,7 +62,7 @@ st.title("Bionic Path Selection")
|
|
44 |
|
45 |
st.multiselect(
|
46 |
label="Multifunction",
|
47 |
-
options=
|
48 |
default=[],
|
49 |
help="Select the multifunction to display in the search results",
|
50 |
placeholder="Select the multifunction to display in the search results",
|
@@ -92,5 +110,14 @@ if search:
|
|
92 |
filtered_df = filtered_df[filtered_df["Method"].apply(lambda x: any(method in x for method in method_option))] \
|
93 |
if (len(method_option) > 0 and not st.session_state.disabled and not filtered_df.empty) \
|
94 |
else filtered_df
|
|
|
|
|
95 |
|
96 |
-
st.dataframe(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
method_list.sort()
|
22 |
multifunction_list.sort()
|
23 |
|
24 |
+
ordered_multifunction_list = ["Antifogging", "Self-cleaning", "Antireflective", "Antibacterial", "Anti-icing",
|
25 |
+
"Antiwetting", "Large FOV", "Fast motion detection", "Structural color",
|
26 |
+
"Droplet directional migration", "Anti-drag", "Water collection",
|
27 |
+
"Self-propelled actuator"]
|
28 |
+
other_multifunction_list = [x for x in multifunction_list if x not in ordered_multifunction_list]
|
29 |
+
ordered_multifunction_list.extend(other_multifunction_list)
|
30 |
+
|
31 |
+
|
32 |
+
def show_res_link(row_idx):
|
33 |
+
res_link = df.iloc[row_idx]['Res link']
|
34 |
+
st.sidebar.info(f'Resource Link: {res_link}')
|
35 |
+
|
36 |
+
|
37 |
+
def show_bionic_prototype_content(row_idx):
|
38 |
+
bionic_prototype = df.iloc[row_idx]['Bionic prototype']
|
39 |
+
st.sidebar.info(f'Bionic prototype is: {bionic_prototype}')
|
40 |
+
|
41 |
+
|
42 |
with st.sidebar:
|
43 |
st.slider(
|
44 |
label="Search results limit",
|
|
|
52 |
|
53 |
st.multiselect(
|
54 |
label="Display columns",
|
55 |
+
options=["Bionic prototype", "Multifunction", "Method", "Materials", "Res link"],
|
56 |
+
default=["Bionic prototype", "Multifunction", "Method", "Materials", "Res link"],
|
57 |
help="Select columns to display in the search results",
|
58 |
key="display_columns",
|
59 |
)
|
|
|
62 |
|
63 |
st.multiselect(
|
64 |
label="Multifunction",
|
65 |
+
options=ordered_multifunction_list,
|
66 |
default=[],
|
67 |
help="Select the multifunction to display in the search results",
|
68 |
placeholder="Select the multifunction to display in the search results",
|
|
|
110 |
filtered_df = filtered_df[filtered_df["Method"].apply(lambda x: any(method in x for method in method_option))] \
|
111 |
if (len(method_option) > 0 and not st.session_state.disabled and not filtered_df.empty) \
|
112 |
else filtered_df
|
113 |
+
# Reset the index
|
114 |
+
filtered_df = filtered_df.reset_index(drop=True)
|
115 |
|
116 |
+
st.dataframe(
|
117 |
+
filtered_df[st.session_state.display_columns].head(st.session_state.limit),
|
118 |
+
column_config={
|
119 |
+
"Res link": st.column_config.LinkColumn(
|
120 |
+
"Resource", display_text=None
|
121 |
+
)
|
122 |
+
}
|
123 |
+
)
|
data/filtered_table.xlsx
CHANGED
Binary files a/data/filtered_table.xlsx and b/data/filtered_table.xlsx differ
|
|
data/table.docx
DELETED
Binary file (37 kB)
|
|
data/table.xlsx
CHANGED
Binary files a/data/table.xlsx and b/data/table.xlsx differ
|
|