Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,3 @@
|
|
| 1 |
-
# app.py
|
| 2 |
import asyncio
|
| 3 |
import re
|
| 4 |
from pathlib import Path
|
|
@@ -37,9 +36,9 @@ def _make_pdf(papers):
|
|
| 37 |
pdf.set_font("Helvetica", "B", 11)
|
| 38 |
pdf.multi_cell(0, 7, f"{i}. {p.get('title','')}")
|
| 39 |
pdf.set_font("Helvetica", size=9)
|
| 40 |
-
body = f"{p.get('authors','')}
|
| 41 |
{p.get('summary','')}
|
| 42 |
-
{p.get('link','')}"
|
| 43 |
pdf.multi_cell(0, 6, body)
|
| 44 |
pdf.ln(3)
|
| 45 |
return pdf.output(dest="S").encode("latin-1", errors="replace")
|
|
@@ -128,7 +127,7 @@ else:
|
|
| 128 |
with vis_tab:
|
| 129 |
years = [p.get("published", "")[:4] for p in res["papers"] if p.get("published")]
|
| 130 |
if years:
|
| 131 |
-
st.plotly_chart(px.histogram(years, nbins=10, title="Publication Year"))
|
| 132 |
|
| 133 |
# Protocols Tab
|
| 134 |
with proto_tab:
|
|
|
|
|
|
|
| 1 |
import asyncio
|
| 2 |
import re
|
| 3 |
from pathlib import Path
|
|
|
|
| 36 |
pdf.set_font("Helvetica", "B", 11)
|
| 37 |
pdf.multi_cell(0, 7, f"{i}. {p.get('title','')}")
|
| 38 |
pdf.set_font("Helvetica", size=9)
|
| 39 |
+
body = f"""{p.get('authors','')}
|
| 40 |
{p.get('summary','')}
|
| 41 |
+
{p.get('link','')}"""
|
| 42 |
pdf.multi_cell(0, 6, body)
|
| 43 |
pdf.ln(3)
|
| 44 |
return pdf.output(dest="S").encode("latin-1", errors="replace")
|
|
|
|
| 127 |
with vis_tab:
|
| 128 |
years = [p.get("published", "")[:4] for p in res["papers"] if p.get("published")]
|
| 129 |
if years:
|
| 130 |
+
st.plotly_chart(px.histogram(pd.DataFrame({'year': years}), x='year', nbins=10, title="Publication Year"))
|
| 131 |
|
| 132 |
# Protocols Tab
|
| 133 |
with proto_tab:
|