Spaces:
Sleeping
Sleeping
<div id="main" style="width:100%;height:100%;"></div> | |
<script src="https://cdn.jsdelivr.net/npm/echarts/dist/echarts.min.js"></script> | |
<script> | |
var chartDom = document.getElementById('main'); | |
var myChart = echarts.init(chartDom); | |
var option = { | |
tooltip: {}, | |
legend: [{ | |
data: ["complex", "compound", "disease", "genetic_disorder", "go", "pathway", "phenotype", "protein"], | |
}], | |
series: [{ | |
type: 'graph', | |
layout: 'force', | |
roam: true, | |
label: { show: true, position: 'right' }, | |
edgeSymbol: ['none', 'none'], | |
data: [{"name": "R-HSA-9838070", "value": "complex_0", "category": "complex", "symbolSize": 12.692307692307692, "url": "https://identifiers.org/reactome:R-HSA-9838070"}, {"name": "R-HSA-9837986", "value": "complex_1", "category": "complex", "symbolSize": 13.384615384615385, "url": "https://identifiers.org/reactome:R-HSA-9837986"}, {"name": "R-HSA-71721", "value": "complex_2", "category": "complex", "symbolSize": 13.038461538461538, "url": "https://identifiers.org/reactome:R-HSA-71721"}, {"name": "UCI:433035", "value": "compound_0", "category": "compound", "symbolSize": 13.384615384615385, "url": "https://www.ebi.ac.uk/unichem/compoundsources?type=uci&compound=433035"}, {"name": "UCI:13149", "value": "compound_1", "category": "compound", "symbolSize": 12.692307692307692, "url": "https://www.ebi.ac.uk/unichem/compoundsources?type=uci&compound=13149"}, {"name": "UCI:942443", "value": "compound_2", "category": "compound", "symbolSize": 12.692307692307692, "url": "https://www.ebi.ac.uk/unichem/compoundsources?type=uci&compound=942443"}, {"name": "UCI:185771", "value": "compound_3", "category": "compound", "symbolSize": 12.0, "url": "https://www.ebi.ac.uk/unichem/compoundsources?type=uci&compound=185771"}, {"name": "UCI:2874", "value": "compound_4", "category": "compound", "symbolSize": 14.423076923076923, "url": "https://www.ebi.ac.uk/unichem/compoundsources?type=uci&compound=2874"}, {"name": "UCI:179621", "value": "compound_5", "category": "compound", "symbolSize": 12.346153846153847, "url": "https://www.ebi.ac.uk/unichem/compoundsources?type=uci&compound=179621"}, {"name": "UCI:199606", "value": "compound_6", "category": "compound", "symbolSize": 12.0, "url": "https://www.ebi.ac.uk/unichem/compoundsources?type=uci&compound=199606"}, {"name": "UCI:384966", "value": "compound_7", "category": "compound", "symbolSize": 12.346153846153847, "url": "https://www.ebi.ac.uk/unichem/compoundsources?type=uci&compound=384966"}, {"name": "UCI:1101362", "value": "compound_8", "category": "compound", "symbolSize": 12.692307692307692, "url": "https://www.ebi.ac.uk/unichem/compoundsources?type=uci&compound=1101362"}, {"name": "UCI:540903", "value": "compound_9", "category": "compound", "symbolSize": 13.038461538461538, "url": "https://www.ebi.ac.uk/unichem/compoundsources?type=uci&compound=540903"}, {"name": "D010300", "value": "disease_0", "category": "disease", "symbolSize": 13.73076923076923, "url": "https://identifiers.org/mesh:D010300"}, {"name": "D000437", "value": "disease_1", "category": "disease", "symbolSize": 13.73076923076923, "url": "https://identifiers.org/mesh:D000437"}, {"name": "D007248", "value": "disease_2", "category": "disease", "symbolSize": 13.73076923076923, "url": "https://identifiers.org/mesh:D007248"}, {"name": "D008106", "value": "disease_3", "category": "disease", "symbolSize": 14.076923076923077, "url": "https://identifiers.org/mesh:D008106"}, {"name": "D018754", "value": "disease_4", "category": "disease", "symbolSize": 13.384615384615385, "url": "https://identifiers.org/mesh:D018754"}, {"name": "D014652", "value": "disease_5", "category": "disease", "symbolSize": 13.73076923076923, "url": "https://identifiers.org/mesh:D014652"}, {"name": "D001249", "value": "disease_6", "category": "disease", "symbolSize": 13.73076923076923, "url": "https://identifiers.org/mesh:D001249"}, {"name": "D065626", "value": "disease_7", "category": "disease", "symbolSize": 13.384615384615385, "url": "https://identifiers.org/mesh:D065626"}, {"name": "D015179", "value": "disease_8", "category": "disease", "symbolSize": 13.384615384615385, "url": "https://identifiers.org/mesh:D015179"}, {"name": "D004938", "value": "disease_9", "category": "disease", "symbolSize": 14.076923076923077, "url": "https://identifiers.org/mesh:D004938"}, {"name": "MIM:619151", "value": "genetic_disorder_0", "category": "genetic_disorder", "symbolSize": 12.0, "url": "https://identifiers.org/MIM:619151"}, {"name": "GO:0016491", "value": "go_0", "category": "go", "symbolSize": 13.384615384615385, "url": "https://identifiers.org/GO:0016491"}, {"name": "GO:0005739", "value": "go_1", "category": "go", "symbolSize": 13.73076923076923, "url": "https://identifiers.org/GO:0005739"}, {"name": "GO:0009055", "value": "go_2", "category": "go", "symbolSize": 12.0, "url": "https://identifiers.org/GO:0009055"}, {"name": "GO:0005975", "value": "go_3", "category": "go", "symbolSize": 12.0, "url": "https://identifiers.org/GO:0005975"}, {"name": "GO:0016620", "value": "go_4", "category": "go", "symbolSize": 12.0, "url": "https://identifiers.org/GO:0016620"}, {"name": "GO:0070062", "value": "go_5", "category": "go", "symbolSize": 12.692307692307692, "url": "https://identifiers.org/GO:0070062"}, {"name": "GO:0051287", "value": "go_6", "category": "go", "symbolSize": 12.0, "url": "https://identifiers.org/GO:0051287"}, {"name": "GO:0006068", "value": "go_7", "category": "go", "symbolSize": 12.346153846153847, "url": "https://identifiers.org/GO:0006068"}, {"name": "GO:0005759", "value": "go_8", "category": "go", "symbolSize": 13.384615384615385, "url": "https://identifiers.org/GO:0005759"}, {"name": "GO:1905627", "value": "go_9", "category": "go", "symbolSize": 12.0, "url": "https://identifiers.org/GO:1905627"}, {"name": "R-HSA-9837999", "value": "pathway_0", "category": "pathway", "symbolSize": 13.73076923076923, "url": "https://identifiers.org/reactome:R-HSA-9837999"}, {"name": "R-HSA-445355", "value": "pathway_1", "category": "pathway", "symbolSize": 13.384615384615385, "url": "https://identifiers.org/reactome:R-HSA-445355"}, {"name": "R-HSA-380612", "value": "pathway_2", "category": "pathway", "symbolSize": 15.807692307692307, "url": "https://identifiers.org/reactome:R-HSA-380612"}, {"name": "R-HSA-71384", "value": "pathway_3", "category": "pathway", "symbolSize": 16.153846153846153, "url": "https://identifiers.org/reactome:R-HSA-71384"}, {"name": "map00010", "value": "pathway_4", "category": "pathway", "symbolSize": 12.346153846153847, "url": "https://identifiers.org/map00010"}, {"name": "hsa01100", "value": "pathway_5", "category": "pathway", "symbolSize": 18.23076923076923, "url": "https://www.kegg.jp/pathway/hsa01100"}, {"name": "SMP00524", "value": "pathway_6", "category": "pathway", "symbolSize": 12.346153846153847, "url": "https://identifiers.org/smpdb:SMP00524"}, {"name": "hsa01240", "value": "pathway_7", "category": "pathway", "symbolSize": 12.0, "url": "https://www.kegg.jp/pathway/hsa01240"}, {"name": "SMP00244", "value": "pathway_8", "category": "pathway", "symbolSize": 12.346153846153847, "url": "https://identifiers.org/smpdb:SMP00244"}, {"name": "hsa00010", "value": "pathway_9", "category": "pathway", "symbolSize": 15.461538461538462, "url": "https://www.kegg.jp/pathway/hsa00010"}, {"name": "P01185", "value": "protein_0", "category": "protein", "symbolSize": 12.0, "url": "https://identifiers.org/uniprot:P01185"}, {"name": "Q08426", "value": "protein_1", "category": "protein", "symbolSize": 13.384615384615385, "url": "https://identifiers.org/uniprot:Q08426"}, {"name": "P50440", "value": "protein_2", "category": "protein", "symbolSize": 14.076923076923077, "url": "https://identifiers.org/uniprot:P50440"}, {"name": "P40926", "value": "protein_3", "category": "protein", "symbolSize": 15.461538461538462, "url": "https://identifiers.org/uniprot:P40926"}, {"name": "P09110", "value": "protein_4", "category": "protein", "symbolSize": 13.038461538461538, "url": "https://identifiers.org/uniprot:P09110"}, {"name": "Q16853", "value": "protein_5", "category": "protein", "symbolSize": 12.692307692307692, "url": "https://identifiers.org/uniprot:Q16853"}, {"name": "Q05329", "value": "protein_6", "category": "protein", "symbolSize": 13.038461538461538, "url": "https://identifiers.org/uniprot:Q05329"}, {"name": "P00367", "value": "protein_7", "category": "protein", "symbolSize": 15.115384615384615, "url": "https://identifiers.org/uniprot:P00367"}, {"name": "P11182", "value": "protein_8", "category": "protein", "symbolSize": 14.76923076923077, "url": "https://identifiers.org/uniprot:P11182"}, {"name": "P05091", "value": "protein_24", "category": "protein", "symbolSize": 30.0, "url": "https://identifiers.org/uniprot:P05091"}], | |
links: [{"source": "R-HSA-9838070", "target": "R-HSA-9837999"}, {"source": "R-HSA-9838070", "target": "P40926"}, {"source": "R-HSA-9838070", "target": "P05091"}, {"source": "R-HSA-9837986", "target": "R-HSA-9837999"}, {"source": "R-HSA-9837986", "target": "P40926"}, {"source": "R-HSA-9837986", "target": "P00367"}, {"source": "R-HSA-9837986", "target": "P11182"}, {"source": "R-HSA-9837986", "target": "P05091"}, {"source": "R-HSA-71721", "target": "R-HSA-380612"}, {"source": "R-HSA-71721", "target": "R-HSA-71384"}, {"source": "R-HSA-71721", "target": "R-HSA-445355"}, {"source": "R-HSA-71721", "target": "P05091"}, {"source": "UCI:433035", "target": "UCI:13149"}, {"source": "UCI:433035", "target": "UCI:942443"}, {"source": "UCI:433035", "target": "D000437"}, {"source": "UCI:433035", "target": "D004938"}, {"source": "UCI:433035", "target": "P05091"}, {"source": "UCI:13149", "target": "UCI:942443"}, {"source": "UCI:13149", "target": "P05091"}, {"source": "UCI:942443", "target": "P05091"}, {"source": "UCI:185771", "target": "P05091"}, {"source": "UCI:2874", "target": "UCI:384966"}, {"source": "UCI:2874", "target": "UCI:540903"}, {"source": "UCI:2874", "target": "UCI:1101362"}, {"source": "UCI:2874", "target": "D008106"}, {"source": "UCI:2874", "target": "D001249"}, {"source": "UCI:2874", "target": "D007248"}, {"source": "UCI:2874", "target": "D010300"}, {"source": "UCI:2874", "target": "P05091"}, {"source": "UCI:179621", "target": "UCI:540903"}, {"source": "UCI:179621", "target": "P05091"}, {"source": "UCI:199606", "target": "P05091"}, {"source": "UCI:384966", "target": "P05091"}, {"source": "UCI:1101362", "target": "UCI:540903"}, {"source": "UCI:1101362", "target": "P05091"}, {"source": "UCI:540903", "target": "P05091"}, {"source": "D010300", "target": "R-HSA-71384"}, {"source": "D010300", "target": "R-HSA-380612"}, {"source": "D010300", "target": "hsa01100"}, {"source": "D010300", "target": "hsa00010"}, {"source": "D010300", "target": "P05091"}, {"source": "D000437", "target": "R-HSA-71384"}, {"source": "D000437", "target": "R-HSA-380612"}, {"source": "D000437", "target": "hsa00010"}, {"source": "D000437", "target": "hsa01100"}, {"source": "D000437", "target": "P05091"}, {"source": "D007248", "target": "hsa00010"}, {"source": "D007248", "target": "hsa01100"}, {"source": "D007248", "target": "R-HSA-380612"}, {"source": "D007248", "target": "R-HSA-71384"}, {"source": "D007248", "target": "P05091"}, {"source": "D008106", "target": "hsa00010"}, {"source": "D008106", "target": "hsa01100"}, {"source": "D008106", "target": "R-HSA-71384"}, {"source": "D008106", "target": "R-HSA-380612"}, {"source": "D008106", "target": "R-HSA-445355"}, {"source": "D008106", "target": "P05091"}, {"source": "D018754", "target": "hsa00010"}, {"source": "D018754", "target": "hsa01100"}, {"source": "D018754", "target": "R-HSA-71384"}, {"source": "D018754", "target": "R-HSA-380612"}, {"source": "D018754", "target": "P05091"}, {"source": "D014652", "target": "hsa01100"}, {"source": "D014652", "target": "hsa00010"}, {"source": "D014652", "target": "R-HSA-380612"}, {"source": "D014652", "target": "R-HSA-71384"}, {"source": "D014652", "target": "R-HSA-445355"}, {"source": "D014652", "target": "P05091"}, {"source": "D001249", "target": "R-HSA-380612"}, {"source": "D001249", "target": "hsa00010"}, {"source": "D001249", "target": "R-HSA-71384"}, {"source": "D001249", "target": "hsa01100"}, {"source": "D001249", "target": "P05091"}, {"source": "D065626", "target": "hsa00010"}, {"source": "D065626", "target": "hsa01100"}, {"source": "D065626", "target": "R-HSA-380612"}, {"source": "D065626", "target": "R-HSA-71384"}, {"source": "D065626", "target": "P05091"}, {"source": "D015179", "target": "hsa01100"}, {"source": "D015179", "target": "R-HSA-71384"}, {"source": "D015179", "target": "R-HSA-380612"}, {"source": "D015179", "target": "hsa00010"}, {"source": "D015179", "target": "P05091"}, {"source": "D004938", "target": "hsa00010"}, {"source": "D004938", "target": "R-HSA-380612"}, {"source": "D004938", "target": "R-HSA-71384"}, {"source": "D004938", "target": "R-HSA-445355"}, {"source": "D004938", "target": "hsa01100"}, {"source": "D004938", "target": "P05091"}, {"source": "MIM:619151", "target": "P05091"}, {"source": "GO:0016491", "target": "Q08426"}, {"source": "GO:0016491", "target": "P40926"}, {"source": "GO:0016491", "target": "Q16853"}, {"source": "GO:0016491", "target": "P00367"}, {"source": "GO:0016491", "target": "P05091"}, {"source": "GO:0005739", "target": "GO:0005759"}, {"source": "GO:0005739", "target": "P50440"}, {"source": "GO:0005739", "target": "P40926"}, {"source": "GO:0005739", "target": "P00367"}, {"source": "GO:0005739", "target": "P11182"}, {"source": "GO:0005739", "target": "P05091"}, {"source": "GO:0009055", "target": "P05091"}, {"source": "GO:0005975", "target": "P05091"}, {"source": "GO:0016620", "target": "P05091"}, {"source": "GO:0070062", "target": "P50440"}, {"source": "GO:0070062", "target": "P40926"}, {"source": "GO:0070062", "target": "P05091"}, {"source": "GO:0051287", "target": "P05091"}, {"source": "GO:0006068", "target": "R-HSA-71384"}, {"source": "GO:0006068", "target": "P05091"}, {"source": "GO:0005759", "target": "P40926"}, {"source": "GO:0005759", "target": "P00367"}, {"source": "GO:0005759", "target": "P11182"}, {"source": "GO:0005759", "target": "P05091"}, {"source": "GO:1905627", "target": "P05091"}, {"source": "R-HSA-9837999", "target": "P40926"}, {"source": "R-HSA-9837999", "target": "P00367"}, {"source": "R-HSA-9837999", "target": "P11182"}, {"source": "R-HSA-9837999", "target": "P05091"}, {"source": "R-HSA-445355", "target": "P05091"}, {"source": "R-HSA-380612", "target": "P05091"}, {"source": "R-HSA-71384", "target": "P05091"}, {"source": "map00010", "target": "P40926"}, {"source": "map00010", "target": "P05091"}, {"source": "hsa01100", "target": "Q08426"}, {"source": "hsa01100", "target": "P50440"}, {"source": "hsa01100", "target": "P40926"}, {"source": "hsa01100", "target": "P09110"}, {"source": "hsa01100", "target": "Q16853"}, {"source": "hsa01100", "target": "Q05329"}, {"source": "hsa01100", "target": "P00367"}, {"source": "hsa01100", "target": "P11182"}, {"source": "hsa01100", "target": "P05091"}, {"source": "SMP00524", "target": "P11182"}, {"source": "SMP00524", "target": "P05091"}, {"source": "hsa01240", "target": "P05091"}, {"source": "SMP00244", "target": "P50440"}, {"source": "SMP00244", "target": "P05091"}, {"source": "hsa00010", "target": "P05091"}, {"source": "P01185", "target": "P05091"}, {"source": "Q08426", "target": "P09110"}, {"source": "Q08426", "target": "P11182"}, {"source": "Q08426", "target": "P05091"}, {"source": "P50440", "target": "Q05329"}, {"source": "P50440", "target": "P00367"}, {"source": "P50440", "target": "P05091"}, {"source": "P40926", "target": "P00367"}, {"source": "P40926", "target": "P05091"}, {"source": "P09110", "target": "P11182"}, {"source": "P09110", "target": "P05091"}, {"source": "Q16853", "target": "P05091"}, {"source": "Q05329", "target": "P00367"}, {"source": "Q05329", "target": "P05091"}, {"source": "P00367", "target": "P05091"}, {"source": "P11182", "target": "P05091"}], | |
categories: [{"name": "complex", "itemStyle": {"color": "#FFA07A"}}, {"name": "compound", "itemStyle": {"color": "#98FB98"}}, {"name": "disease", "itemStyle": {"color": "#FFD700"}}, {"name": "genetic_disorder", "itemStyle": {"color": "#FF69B4"}}, {"name": "go", "itemStyle": {"color": "#87CEEB"}}, {"name": "pathway", "itemStyle": {"color": "#DDA0DD"}}, {"name": "phenotype", "itemStyle": {"color": "#808080"}}, {"name": "protein", "itemStyle": {"color": "#FF6347"}}], | |
force: { | |
repulsion: 300, | |
edgeLength: 120 | |
}, | |
emphasis: { | |
focus: 'adjacency', | |
label: { show: true } | |
} | |
}] | |
}; | |
myChart.setOption(option); | |
myChart.on('click', function (params) { | |
if (params.data && params.data.url) { | |
window.open(params.data.url, '_blank'); | |
} | |
}); | |
// ✅ 添加响应式图表大小 | |
window.addEventListener('resize', function () { | |
myChart.resize(); | |
myChart.setOption(option); // 强制触发重新布局 | |
}); | |
</script> | |