Update Home.py
Browse files
Home.py
CHANGED
|
@@ -140,20 +140,20 @@ try:
|
|
| 140 |
|
| 141 |
else:
|
| 142 |
st.write("Jurnal")
|
| 143 |
-
jrnl_counts =
|
| 144 |
jrnl_counts_df = pd.DataFrame({"Journal": jrnl_counts.index, "Count": jrnl_counts.values})
|
| 145 |
jrnl_counts_df = jrnl_counts_df.set_index("Journal")
|
| 146 |
|
| 147 |
# Display bar chart
|
| 148 |
-
st.bar_chart(jrnl_counts_df)
|
| 149 |
|
| 150 |
st.write("Tahun")
|
| 151 |
-
year_counts =
|
| 152 |
year_counts_df = pd.DataFrame({"Year": year_counts.index, "Count": year_counts.values})
|
| 153 |
year_counts_df = year_counts_df.set_index("Year")
|
| 154 |
|
| 155 |
# Display bar chart
|
| 156 |
-
st.bar_chart(year_counts_df)
|
| 157 |
|
| 158 |
institutions = (
|
| 159 |
key_df_j["Institution"]
|
|
@@ -177,7 +177,7 @@ try:
|
|
| 177 |
)
|
| 178 |
)
|
| 179 |
|
| 180 |
-
st.altair_chart(chart_ins, use_container_width=True)
|
| 181 |
|
| 182 |
|
| 183 |
author = (
|
|
@@ -189,7 +189,7 @@ try:
|
|
| 189 |
|
| 190 |
st.write("Author")
|
| 191 |
# Count occurrences
|
| 192 |
-
aut_counts =
|
| 193 |
aut_counts.columns = ["Authors", "Count"]
|
| 194 |
|
| 195 |
# Horizontal bar chart with Altair
|
|
@@ -202,7 +202,7 @@ try:
|
|
| 202 |
)
|
| 203 |
)
|
| 204 |
|
| 205 |
-
st.altair_chart(chart_aut, use_container_width=True)
|
| 206 |
|
| 207 |
|
| 208 |
|
|
@@ -234,6 +234,21 @@ try:
|
|
| 234 |
ax.axis("off")
|
| 235 |
st.pyplot(fig)
|
| 236 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 237 |
|
| 238 |
|
| 239 |
except Exception as e:
|
|
|
|
| 140 |
|
| 141 |
else:
|
| 142 |
st.write("Jurnal")
|
| 143 |
+
jrnl_counts = key_df_j["Journal"].value_counts().sort_index()
|
| 144 |
jrnl_counts_df = pd.DataFrame({"Journal": jrnl_counts.index, "Count": jrnl_counts.values})
|
| 145 |
jrnl_counts_df = jrnl_counts_df.set_index("Journal")
|
| 146 |
|
| 147 |
# Display bar chart
|
| 148 |
+
#st.bar_chart(jrnl_counts_df)
|
| 149 |
|
| 150 |
st.write("Tahun")
|
| 151 |
+
year_counts = key_df_j["Year"].value_counts().sort_index()
|
| 152 |
year_counts_df = pd.DataFrame({"Year": year_counts.index, "Count": year_counts.values})
|
| 153 |
year_counts_df = year_counts_df.set_index("Year")
|
| 154 |
|
| 155 |
# Display bar chart
|
| 156 |
+
#st.bar_chart(year_counts_df)
|
| 157 |
|
| 158 |
institutions = (
|
| 159 |
key_df_j["Institution"]
|
|
|
|
| 177 |
)
|
| 178 |
)
|
| 179 |
|
| 180 |
+
#st.altair_chart(chart_ins, use_container_width=True)
|
| 181 |
|
| 182 |
|
| 183 |
author = (
|
|
|
|
| 189 |
|
| 190 |
st.write("Author")
|
| 191 |
# Count occurrences
|
| 192 |
+
aut_counts = author.value_counts().reset_index()
|
| 193 |
aut_counts.columns = ["Authors", "Count"]
|
| 194 |
|
| 195 |
# Horizontal bar chart with Altair
|
|
|
|
| 202 |
)
|
| 203 |
)
|
| 204 |
|
| 205 |
+
#st.altair_chart(chart_aut, use_container_width=True)
|
| 206 |
|
| 207 |
|
| 208 |
|
|
|
|
| 234 |
ax.axis("off")
|
| 235 |
st.pyplot(fig)
|
| 236 |
|
| 237 |
+
|
| 238 |
+
|
| 239 |
+
# layout
|
| 240 |
+
col1, col2 = st.columns(2)
|
| 241 |
+
with col1.container():
|
| 242 |
+
st.bar_chart(jrnl_counts_df)
|
| 243 |
+
with col2.container():
|
| 244 |
+
st.bar_chart(year_counts_df)
|
| 245 |
+
with col1.container():
|
| 246 |
+
st.altair_chart(chart_ins, use_container_width=True)
|
| 247 |
+
with col2.container():
|
| 248 |
+
st.altair_chart(chart_aut, use_container_width=True)
|
| 249 |
+
|
| 250 |
+
|
| 251 |
+
|
| 252 |
|
| 253 |
|
| 254 |
except Exception as e:
|