Spaces:
Running
Running
Update pages/4 Sunburst.py
Browse files- pages/4 Sunburst.py +27 -19
pages/4 Sunburst.py
CHANGED
|
@@ -52,22 +52,27 @@ with st.expander("Before you start", expanded = True):
|
|
| 52 |
|
| 53 |
with tab3:
|
| 54 |
st.code("""
|
| 55 |
-
|
| 56 |
-
| Source | File Type | Column
|
| 57 |
-
|
| 58 |
-
| Scopus | Comma-separated values | Source title,
|
| 59 |
-
| | (.csv) | Document Type,
|
| 60 |
-
+----------------+------------------------| Cited by, Year
|
| 61 |
-
| Web of Science | Tab delimited file |
|
| 62 |
-
| | (.txt) |
|
| 63 |
-
|
| 64 |
-
| Lens.org | Comma-separated values | Publication Year,
|
| 65 |
-
| | (.csv) | Publication Type,
|
| 66 |
-
| | | Source Title,
|
| 67 |
-
| | | Citing Works Count
|
| 68 |
-
|
| 69 |
-
|
|
| 70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
""", language=None)
|
| 72 |
|
| 73 |
with tab4:
|
|
@@ -96,9 +101,9 @@ def upload(extype):
|
|
| 96 |
papers = pd.read_csv(uploaded_file)
|
| 97 |
#lens.org
|
| 98 |
if 'Publication Year' in papers.columns:
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
papers = sf.dim(papers)
|
| 103 |
col_dict = {'MeSH terms': 'Keywords',
|
| 104 |
'PubYear': 'Year',
|
|
@@ -106,6 +111,9 @@ def upload(extype):
|
|
| 106 |
'Publication Type': 'Document Type'
|
| 107 |
}
|
| 108 |
papers.rename(columns=col_dict, inplace=True)
|
|
|
|
|
|
|
|
|
|
| 109 |
return papers
|
| 110 |
|
| 111 |
@st.cache_data(ttl=3600)
|
|
|
|
| 52 |
|
| 53 |
with tab3:
|
| 54 |
st.code("""
|
| 55 |
+
+----------------+------------------------+--------------------------------------+
|
| 56 |
+
| Source | File Type | Column |
|
| 57 |
+
+----------------+------------------------+--------------------------------------+
|
| 58 |
+
| Scopus | Comma-separated values | Source title, |
|
| 59 |
+
| | (.csv) | Document Type, |
|
| 60 |
+
+----------------+------------------------| Cited by, Year |
|
| 61 |
+
| Web of Science | Tab delimited file | |
|
| 62 |
+
| | (.txt) | |
|
| 63 |
+
+----------------+------------------------+--------------------------------------+
|
| 64 |
+
| Lens.org | Comma-separated values | Publication Year, |
|
| 65 |
+
| | (.csv) | Publication Type, |
|
| 66 |
+
| | | Source Title, |
|
| 67 |
+
| | | Citing Works Count |
|
| 68 |
+
+----------------+------------------------+--------------------------------------+
|
| 69 |
+
| OpenAlex | Comma-separated values | publication_year, |
|
| 70 |
+
| | (.csv) | cited_by_count, |
|
| 71 |
+
| | | type, |
|
| 72 |
+
| | | primary_location.source.display_name |
|
| 73 |
+
+----------------+------------------------+--------------------------------------+
|
| 74 |
+
| Hathitrust | .json | htid(Hathitrust ID) |
|
| 75 |
+
+----------------+------------------------+--------------------------------------+
|
| 76 |
""", language=None)
|
| 77 |
|
| 78 |
with tab4:
|
|
|
|
| 101 |
papers = pd.read_csv(uploaded_file)
|
| 102 |
#lens.org
|
| 103 |
if 'Publication Year' in papers.columns:
|
| 104 |
+
papers.rename(columns={'Publication Year': 'Year', 'Citing Works Count': 'Cited by',
|
| 105 |
+
'Publication Type': 'Document Type', 'Source Title': 'Source title'}, inplace=True)
|
| 106 |
+
elif "About the data" in papers.columns[0]:
|
| 107 |
papers = sf.dim(papers)
|
| 108 |
col_dict = {'MeSH terms': 'Keywords',
|
| 109 |
'PubYear': 'Year',
|
|
|
|
| 111 |
'Publication Type': 'Document Type'
|
| 112 |
}
|
| 113 |
papers.rename(columns=col_dict, inplace=True)
|
| 114 |
+
elif "ids.openalex" in papers.columns:
|
| 115 |
+
papers.rename(columns={'publication_year': 'Year', 'cited_by_count': 'Cited by',
|
| 116 |
+
'type': 'Document Type', 'primary_location.source.display_name': 'Source title'}, inplace=True)
|
| 117 |
return papers
|
| 118 |
|
| 119 |
@st.cache_data(ttl=3600)
|