Update Home.py
Browse files
Home.py
CHANGED
|
@@ -67,8 +67,36 @@ if keyword_list_j is not None:
|
|
| 67 |
if text_search:
|
| 68 |
st.caption(f"Kami menemukan **{key_df_j.shape[0]}** artikel yang sesuai dengan apa yang dicari.")
|
| 69 |
|
|
|
|
|
|
|
| 70 |
opt_result = ["Hasil Pencarian", "Analisis Hasil"]
|
| 71 |
-
selection =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
|
| 73 |
if selection == "Hasil Pencarian":
|
| 74 |
|
|
@@ -78,7 +106,7 @@ if keyword_list_j is not None:
|
|
| 78 |
col1.markdown(f"**{row['Title'].strip()}**")
|
| 79 |
col2.caption(f"**{row['Journal'].strip()}, {row['Volume'].strip()} ({row['Issue'].strip()}) - {row['Year'].strip()}**")
|
| 80 |
|
| 81 |
-
st.markdown(f"
|
| 82 |
|
| 83 |
btn1, btn2, btn3, btn4 = st.columns(4)
|
| 84 |
popover1 = btn1.popover("Abstrak", icon="🔤", help="Klik untuk membaca abstrak dalam Bahasa Indonesia", use_container_width=False)
|
|
|
|
| 67 |
if text_search:
|
| 68 |
st.caption(f"Kami menemukan **{key_df_j.shape[0]}** artikel yang sesuai dengan apa yang dicari.")
|
| 69 |
|
| 70 |
+
col1, col2 = st.columns([7,3]])
|
| 71 |
+
|
| 72 |
opt_result = ["Hasil Pencarian", "Analisis Hasil"]
|
| 73 |
+
selection = col1.pills("Pilihan", opt_result, selection_mode="single", default="Hasil Pencarian", label_visibility="hidden")
|
| 74 |
+
|
| 75 |
+
popover = col2.popover("Unduh Hasil")
|
| 76 |
+
red = popover.checkbox("Show red items.", True)
|
| 77 |
+
blue = popover.checkbox("Show blue items.", True)
|
| 78 |
+
|
| 79 |
+
@st.cache_data
|
| 80 |
+
def get_data(df):
|
| 81 |
+
df = pd.DataFrame(
|
| 82 |
+
np.random.randn(50, 20), columns=("col %d" % i for i in range(20))
|
| 83 |
+
)
|
| 84 |
+
return df
|
| 85 |
+
|
| 86 |
+
@st.cache_data
|
| 87 |
+
def convert_for_download(dfs):
|
| 88 |
+
return df.to_csv().encode("utf-8")
|
| 89 |
+
|
| 90 |
+
dfs = get_data(df)
|
| 91 |
+
csv = convert_for_download(dfs)
|
| 92 |
+
|
| 93 |
+
popover.download_button(
|
| 94 |
+
label="Download CSV",
|
| 95 |
+
data=csv,
|
| 96 |
+
file_name="txtperpus.csv",
|
| 97 |
+
mime="text/csv",
|
| 98 |
+
icon=":material/download:",
|
| 99 |
+
)
|
| 100 |
|
| 101 |
if selection == "Hasil Pencarian":
|
| 102 |
|
|
|
|
| 106 |
col1.markdown(f"**{row['Title'].strip()}**")
|
| 107 |
col2.caption(f"**{row['Journal'].strip()}, {row['Volume'].strip()} ({row['Issue'].strip()}) - {row['Year'].strip()}**")
|
| 108 |
|
| 109 |
+
st.markdown(f"*{row['Authors'].strip()}*")
|
| 110 |
|
| 111 |
btn1, btn2, btn3, btn4 = st.columns(4)
|
| 112 |
popover1 = btn1.popover("Abstrak", icon="🔤", help="Klik untuk membaca abstrak dalam Bahasa Indonesia", use_container_width=False)
|