-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdump_clinker.html
100 lines (99 loc) · 2.66 KB
/
dump_clinker.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<!DOCTYPE html>
<html lang="en">
<body>
<iframe id="clinker" style="width:100vw; height:100vh;"></iframe>
<script>
const clinker_conf = {
"plot": {
"transitionDuration": 250,
"scaleFactor": 45,
"scaleGenes": true,
"fontFamily": "system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Ubuntu, \"Helvetica Neue\", Oxygen, Cantarell, sans-serif"
},
"legend": {
"entryHeight": 0,
"fontSize": 0,
"onClickCircle": null,
"show": false,
"marginLeft": 0
},
"colourBar": {
"fontSize": 10,
"height": 12,
"show": true,
"width": 150,
"marginTop": 20
},
"scaleBar": {
"colour": "black",
"fontSize": 10,
"height": 12,
"basePair": 2500,
"show": true,
"stroke": 1,
"marginTop": 20
},
"link": {
"show": true,
"asLine": true,
"straight": false,
"threshold": 0,
"strokeWidth": 2,
"groupColour": false,
"bestOnly": true,
"label": {
"show": false,
"fontSize": 10,
"background": true,
"position": 0.5
}
},
"cluster": {
"nameFontSize": 12,
"lociFontSize": 10,
"hideLocusCoordinates": false,
"spacing": 200,
"alignLabels": true
},
"locus": {
"trackBar": {
"colour": "#111",
"stroke": 1
},
"spacing": 50
},
"gene": {
"shape": {
"bodyHeight": 12,
"tipHeight": 5,
"tipLength": 12,
"stroke": "black",
"strokeWidth": 1
},
"label": {
"anchor": "start",
"fontSize": 10,
"rotation": 25,
"position": "top",
"spacing": 2,
"show": true,
"start": 0.5,
"name": "uid"
}
}
}
const frame = document.getElementById("clinker")
let i = 0;
frame.src = `/curated_GIs/clinker/clusters${i}.html`;
frame.addEventListener("load", ()=>{
frame.contentWindow.d3.select("#plot").call(frame.contentWindow.ClusterMap.ClusterMap().config(clinker_conf));
frame.contentWindow.d3.select(".legend").remove()
setTimeout(()=>{
frame.contentDocument.getElementById("btn-save-svg").click();
++i;
if (i < 38) frame.src = `/curated_GIs/clinker/clusters${i}.html`;
}, 1000)
})
</script>
</body>
</html>