citation_map
An interactive map of science based on citation
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (0.8%) to scientific vocabulary
Last synced: 6 months ago
·
JSON representation
·
Repository
An interactive map of science based on citation
Basic Info
- Host: GitHub
- Owner: lyuzhuoqi
- Language: Jupyter Notebook
- Default Branch: main
- Size: 7.81 KB
Statistics
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Created 10 months ago
· Last pushed 10 months ago
Metadata Files
Readme
Citation
README.md
citation_map
An interactive map of science based on citation
Owner
- Name: LYU Zhuoqi
- Login: lyuzhuoqi
- Kind: user
- Repositories: 1
- Profile: https://github.com/lyuzhuoqi
Citation (citation_map_app.ipynb)
{
"cells": [
{
"cell_type": "code",
"execution_count": 682,
"id": "2aa43754",
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd"
]
},
{
"cell_type": "code",
"execution_count": 743,
"id": "304eb3b0",
"metadata": {},
"outputs": [],
"source": [
"node_labels = {0: 'Law, Politics',\n",
" 1: 'Geography & Environment',\n",
" 2: 'Computing',\n",
" 3: 'Dentistry, Ophthalmology, Dermatology',\n",
" 4: 'Oncology',\n",
"5: 'Electrical & Electronic Engineering',\n",
"6: 'Physics',\n",
"7: 'Cardiology',\n",
"8: 'Ecology & Zoology',\n",
"9: 'Psychology',\n",
"10: 'Information Engineering',\n",
"11: 'Chemistry & Materials',\n",
"12: 'Geology',\n",
"13: 'History & Literature & Philosophy',\n",
"14: 'Mechanic Engineering',\n",
"15: 'Mathematics',\n",
"16: 'Animal',\n",
"17: 'Molecular & Cell Biology',\n",
"18: 'Infectious Diseases',\n",
"19: 'Linguistics',\n",
"20: 'Nursing',\n",
"21: 'Agriculture',\n",
"22: 'Rehabilitation & Sports',\n",
"23: 'Sociology & Culture',\n",
"24: 'Economics',\n",
"25: 'Education'}"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "473eba17",
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"from io import StringIO\n",
"\n",
"data = \"\"\"cluster,inner_citations,outer_citations,total_citations,inner_pct\n",
"0,711800,548049,1259849,56.498834384120634\n",
"1,2825306,4350637,7175943,39.37191251379784\n",
"2,545215,1038813,1584028,34.41953046284535\n",
"3,3032857,2105357,5138214,59.02550964206629\n",
"4,8835127,7723805,16558932,53.355657236831455\n",
"5,4895488,3669681,8565169,57.15576657039691\n",
"6,12930483,7209477,20139960,64.20312155535562\n",
"7,11827200,10544479,22371679,52.86684115215492\n",
"8,5666184,4822988,10489172,54.019363968862365\n",
"9,7727996,5622399,13350395,57.88589775808132\n",
"10,20884,181174,202058,10.33564620059587\n",
"11,42393393,17034051,59427444,71.33638963169946\n",
"12,10201614,5963339,16164953,63.109456612710225\n",
"13,175760,216233,391993,44.83753536415191\n",
"14,10137104,7893760,18030864,56.22084443651729\n",
"15,3357277,2073105,5430382,61.82395639938406\n",
"16,1788271,2342619,4130890,43.290211068317\n",
"17,32475251,23904513,56379764,57.600899145303266\n",
"18,1828191,3769129,5597320,32.66189890876348\n",
"19,372329,422513,794842,46.84314618502797\n",
"20,5412666,6430978,11843644,45.70101904447652\n",
"21,5092710,6579800,11672510,43.62994762908749\n",
"22,3578910,3525015,7103925,50.379332552075084\n",
"23,915814,1025574,1941388,47.17315652512532\n",
"24,4814264,1825075,6639339,72.5111942619589\n",
"25,1303886,980294,2284180,57.08332968505109\n",
"\"\"\"\n",
"\n",
"node_stats_df = pd.read_csv(StringIO(data))"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "b06e642c",
"metadata": {},
"outputs": [],
"source": [
"data = \"\"\"source,target,weight\n",
"1,0,66149\n",
"9,0,71487\n",
"13,0,23908\n",
"23,0,138078\n",
"24,0,146312\n",
"0,1,120324\n",
"8,1,408321\n",
"12,1,800313\n",
"14,1,562147\n",
"23,1,218507\n",
"24,1,699784\n",
"5,2,402426\n",
"17,2,108435\n",
"24,2,97128\n",
"4,3,299181\n",
"7,3,428572\n",
"17,3,622684\n",
"7,4,1994114\n",
"17,4,3630339\n",
"20,4,666158\n",
"2,5,498139\n",
"6,5,525336\n",
"10,5,22793\n",
"14,5,618541\n",
"15,5,499998\n",
"10,6,22375\n",
"11,6,3025458\n",
"15,6,597620\n",
"17,6,1345166\n",
"3,7,423672\n",
"4,7,1963211\n",
"17,7,3720848\n",
"18,7,699751\n",
"20,7,1762585\n",
"22,7,927212\n",
"12,8,727240\n",
"17,8,1993749\n",
"21,8,699519\n",
"0,9,73416\n",
"7,9,672196\n",
"17,9,1869135\n",
"19,9,170920\n",
"20,9,1119340\n",
"22,9,413857\n",
"23,9,166780\n",
"25,9,236031\n",
"5,10,18378\n",
"6,10,14412\n",
"11,10,51329\n",
"14,10,60540\n",
"6,11,4299903\n",
"8,11,652449\n",
"10,11,41463\n",
"12,11,1167841\n",
"14,11,2781998\n",
"17,11,4779059\n",
"21,11,1271460\n",
"1,12,768398\n",
"8,12,1012860\n",
"10,12,29281\n",
"11,12,1294923\n",
"13,12,25792\n",
"0,13,20819\n",
"8,13,21134\n",
"9,13,24415\n",
"12,13,24099\n",
"23,13,47977\n",
"1,14,500750\n",
"2,14,85965\n",
"5,14,841689\n",
"6,14,984505\n",
"10,14,80114\n",
"11,14,3330667\n",
"15,14,342352\n",
"5,15,331958\n",
"6,15,772570\n",
"8,16,275029\n",
"17,16,933612\n",
"18,16,370272\n",
"21,16,269749\n",
"3,17,657476\n",
"4,17,3800112\n",
"6,17,1079789\n",
"7,17,4784463\n",
"8,17,2025234\n",
"9,17,1780143\n",
"11,17,2987257\n",
"16,17,557236\n",
"18,17,1455812\n",
"20,17,1001315\n",
"21,17,1524990\n",
"22,17,1117967\n",
"4,18,301010\n",
"7,18,740642\n",
"16,18,207663\n",
"17,18,1233237\n",
"20,18,544621\n",
"9,19,195756\n",
"25,19,56815\n",
"4,20,653182\n",
"7,20,1799023\n",
"9,20,1121270\n",
"17,20,756893\n",
"18,20,562629\n",
"22,20,459085\n",
"23,20,125828\n",
"8,21,951619\n",
"11,21,1261571\n",
"16,21,322731\n",
"17,21,2391614\n",
"18,21,312984\n",
"7,22,995276\n",
"17,22,887859\n",
"20,22,470379\n",
"0,23,170152\n",
"1,23,142231\n",
"9,23,177747\n",
"13,23,52370\n",
"20,23,123757\n",
"24,23,138902\n",
"0,24,160567\n",
"1,24,424907\n",
"2,24,93550\n",
"23,24,165142\n",
"25,24,145669\n",
"9,25,296731\n",
"19,25,65181\n",
"23,25,115073\n",
"24,25,157661\n",
"\"\"\"\n",
"\n",
"edge_df = pd.read_csv(StringIO(data))"
]
},
{
"cell_type": "code",
"execution_count": 686,
"id": "db344533",
"metadata": {},
"outputs": [],
"source": [
"node_stats_df['color'] = (node_stats_df['inner_citations']-node_stats_df['inner_citations'].min())/(node_stats_df['inner_citations'].max()-node_stats_df['inner_citations'].min())\n",
"edge_df['normalized_weight'] = (edge_df['weight']-edge_df['weight'].min())/(edge_df['weight'].max()-edge_df['weight'].min())"
]
},
{
"cell_type": "code",
"execution_count": 943,
"id": "c0f35011",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "8d5d54bbb62a4a2a89f7e245f1de533a",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Figure(fig_margin={'top': 60, 'bottom': 60, 'left': 60, 'right': 60}, layout=Layout(height='1200px', width='12…"
]
},
"execution_count": 943,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from bqplot import Graph, ColorScale, Figure\n",
"import ipywidgets as widgets\n",
"import numpy as np\n",
"\n",
"# 转换节点和边数据\n",
"node_data = []\n",
"for _, row in node_stats_df.iterrows():\n",
" r = np.sqrt(row.total_citations)*0.005\n",
" label_text = node_labels[row.cluster]\n",
" label_loc = 'center'\n",
" if r < 15 or len(label_text) > 25:\n",
" label_loc = 'outside'\n",
" node_data.append({\n",
" 'label': label_text,\n",
" 'label_display': label_loc,\n",
" 'shape': 'circle',\n",
" 'color': row.color,\n",
" 'shape_attrs': {'r': r},\n",
" })\n",
"\n",
"link_data = []\n",
"for _, row in edge_df.iterrows(): \n",
" link_data.append({\n",
" 'source': row.source,\n",
" 'target': row.target,\n",
" 'value': row.normalized_weight,\n",
" })\n",
"\n",
"# 创建颜色比例尺\n",
"node_color_scale = ColorScale(min=node_stats_df.color.min(), \n",
" max=node_stats_df.color.max(),\n",
" colors=['#ffeda0', '#f03b20'])\n",
"link_color_scale = ColorScale(min=edge_df.normalized_weight.min(), \n",
" mid=edge_df.normalized_weight.mean(),\n",
" max=edge_df.normalized_weight.max(),\n",
" colors=['#f7fbff', '#6baed6', '#08306b'])\n",
"\n",
"# 创建图形标记\n",
"graph = Graph(\n",
" node_data=node_data,\n",
" link_data=link_data,\n",
" static=False,\n",
" directed=True,\n",
" link_type='arc',\n",
" scales={\n",
" 'color': node_color_scale,\n",
" 'link_color': link_color_scale\n",
" },\n",
" charge=-1500,\n",
")\n",
"\n",
"# 创建图形并添加图例\n",
"figure = Figure(\n",
" marks=[graph],\n",
" layout=widgets.Layout(width='1200px', height='1200px'),\n",
")\n",
"\n",
"figure"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "0980d0e6",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"<div style=\"width: 16%; padding: 15px; background: white; border-radius: 6px; box-shadow: 0 2px 4px rgba(0,0,0,0.1);\">\n",
" <h7 style=\"margin-top: 0; margin-bottom: -0px; color: #333;\">Node Size: Total Citations</h7>\n",
" \n",
" <div style=\"margin-bottom: -0px;\">\n",
" <div style=\"display: flex; align-items: flex-end; height: 100px; margin-top: 0px;\">\n",
" <div style=\"display: flex; flex-direction: column; align-items: center; margin: 0 8px;\"><div style=\"width: 4.495086206069913px; height: 4.495086206069913px; border-radius: 50%; background: #ffeda0; border: 1.75px solid #0b0b0b;\"></div><span style=\"margin-top: 8px; font-size: 12px; color: #333\">50514</span></div><div style=\"display: flex; flex-direction: column; align-items: center; margin: 0 8px;\"><div style=\"width: 22.643614076261304px; height: 22.643614076261304px; border-radius: 50%; background: #ffeda0; border: 1.75px solid #0b0b0b;\"></div><span style=\"margin-top: 8px; font-size: 12px; color: #333\">1281833</span></div><div style=\"display: flex; flex-direction: column; align-items: center; margin: 0 8px;\"><div style=\"width: 40.792141946452695px; height: 40.792141946452695px; border-radius: 50%; background: #ffeda0; border: 1.75px solid #0b0b0b;\"></div><span style=\"margin-top: 8px; font-size: 12px; color: #333\">4159997</span></div><div style=\"display: flex; flex-direction: column; align-items: center; margin: 0 8px;\"><div style=\"width: 58.94066981664409px; height: 58.94066981664409px; border-radius: 50%; background: #ffeda0; border: 1.75px solid #0b0b0b;\"></div><span style=\"margin-top: 8px; font-size: 12px; color: #333\">8685006</span></div><div style=\"display: flex; flex-direction: column; align-items: center; margin: 0 8px;\"><div style=\"width: 77.08919768683548px; height: 77.08919768683548px; border-radius: 50%; background: #ffeda0; border: 1.75px solid #0b0b0b;\"></div><span style=\"margin-top: 8px; font-size: 12px; color: #333\">14856861</span></div>\n",
" </div>\n",
" </div>\n",
" \n",
" <h7 style=\"margin-bottom: 5px; color: #333;\">Node Color: Intradisciplinary Citations</h7>\n",
" <div style=\"height: 10px; width: 100%; background: linear-gradient(to right, #ffeda0, #f03b20); border-radius: 4px;\"></div>\n",
" <div style=\"margin-bottom: -0px; display: flex; justify-content: space-between; font-size: 12px; color: #333\">\n",
" <span>20884</span>\n",
" <span>10614011</span>\n",
" <span>21207138</span>\n",
" <span>31800266</span>\n",
" <span>42393393</span>\n",
" </div>\n",
"\n",
" <h7 style=\"margin-bottom: 5px; color: #333;\">Edge Weight: Interdisciplinary Citations</h7>\n",
" <div style=\"height: 10px; width: 100%; background: linear-gradient(to right, #f7fbff, #6baed6, #08306b); border-radius: 4px;\"></div>\n",
" <div style=\"margin-bottom: -10px; display: flex; justify-content: space-between;\">\n",
" <span style=\"font-size: 12px; color: #333;\">14412</span>\n",
" <span style=\"font-size: 12px; color: #333;\">1206925</span>\n",
" <span style=\"font-size: 12px; color: #333;\">2399438</span>\n",
" <span style=\"font-size: 12px; color: #333;\">3591950</span>\n",
" <span style=\"font-size: 12px; color: #333;\">4784463</span>\n",
" </div>\n",
"</div>\n"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from IPython.display import display, HTML\n",
"import numpy as np\n",
"\n",
"# 计算实际显示参数\n",
"# 节点大小参数\n",
"node_sizes = np.sqrt(node_stats_df['total_citations']) * 0.005\n",
"min_size, max_size = node_sizes.min(), node_sizes.max()\n",
"size_legend_values = np.linspace(min_size, max_size, 5)\n",
"size_labels = [f\"{(s/0.01)**2:.0f}\" for s in size_legend_values]\n",
"\n",
"# 节点颜色参数\n",
"inner_citations_min = node_stats_df['inner_citations'].min()\n",
"inner_citations_max = node_stats_df['inner_citations'].max()\n",
"\n",
"# 边颜色参数\n",
"edge_min = edge_df['weight'].min()\n",
"edge_max = edge_df['weight'].max()\n",
"\n",
"legend_html = f\"\"\"\n",
"<div style=\"width: 14%; padding: 15px; background: white; border-radius: 6px; box-shadow: 0 2px 4px rgba(0,0,0,0.1);\">\n",
" <h7 style=\"color: #333;\">Node Size: Total Citations</h7>\n",
" \n",
" <div>\n",
" <div style=\"display: flex; align-items: flex-end; height: 100px;\">\n",
" {''.join([f'<div style=\"display: flex; flex-direction: column; align-items: center; margin: 0 8px;\">'\n",
" f'<div style=\"width: {s*2}px; height: {s*2}px; border-radius: 50%; '\n",
" f'background: #ffeda0; border: 1.75px solid #0b0b0b;\"></div>'\n",
" f'<span style=\"margin-top: 8px; font-size: 12px; color: #333\">{label}</span></div>'\n",
" for s, label in zip(size_legend_values, size_labels)])}\n",
" </div>\n",
" </div>\n",
" \n",
" <h7 style=\"margin-bottom: 5px; color: #333;\">Node Color: Intradisciplinary Citations</h7>\n",
" <div style=\"height: 10px; width: 100%; background: linear-gradient(to right, #ffeda0, #f03b20); border-radius: 4px;\"></div>\n",
" <div style=\"margin-bottom: -0px; display: flex; justify-content: space-between; font-size: 12px; color: #333\">\n",
" <span>{inner_citations_min}</span>\n",
" <span>{inner_citations_min+(inner_citations_max-inner_citations_min)/4:.0f}</span>\n",
" <span>{inner_citations_min+(inner_citations_max-inner_citations_min)/2:.0f}</span>\n",
" <span>{inner_citations_min+(inner_citations_max-inner_citations_min)*3/4:.0f}</span>\n",
" <span>{inner_citations_max}</span>\n",
" </div>\n",
"\n",
" <h7 style=\"margin-bottom: 5px; color: #333;\">Edge Weight: Interdisciplinary Citations</h7>\n",
" <div style=\"height: 10px; width: 100%; background: linear-gradient(to right, #f7fbff, #6baed6, #08306b); border-radius: 4px;\"></div>\n",
" <div style=\"margin-bottom: -10px; display: flex; justify-content: space-between;\">\n",
" <span style=\"font-size: 12px; color: #333;\">{edge_min}</span>\n",
" <span style=\"font-size: 12px; color: #333;\">{edge_min+(edge_max-edge_min)/4:.0f}</span>\n",
" <span style=\"font-size: 12px; color: #333;\">{edge_min+(edge_max-edge_min)/2:.0f}</span>\n",
" <span style=\"font-size: 12px; color: #333;\">{edge_min+(edge_max-edge_min)*3/4:.0f}</span>\n",
" <span style=\"font-size: 12px; color: #333;\">{edge_max}</span>\n",
" </div>\n",
"</div>\n",
"\"\"\"\n",
"\n",
"display(HTML(legend_html))"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
GitHub Events
Total
- Push event: 2
- Create event: 2
Last Year
- Push event: 2
- Create event: 2
Dependencies
requirements.txt
pypi
- bqplot ==0.12.44
- ipython ==8.12.3
- ipywidgets ==8.1.6
- numpy *
- pandas *
- voila ==0.5.8