-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.html
109 lines (93 loc) · 2.98 KB
/
demo.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
101
102
103
104
105
106
107
108
109
<!DOCTYPE>
<html>
<head>
<title>Polywas Layout Demo</title>
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1">
<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
<script src="http://cytoscape.github.io/cytoscape.js/api/cytoscape.js-latest/cytoscape.min.js"></script>
<script src="polywas-layout.js"></script>
<style>
body {
font-family: helvetica;
font-size: 14px;
}
#cy {
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
z-index: 999;
}
h1 {
opacity: 0.5;
font-size: 1em;
}
</style>
<script>
$(function(){
var cy = window.cy = cytoscape({
container: document.getElementById('cy'),
boxSelectionEnabled: false,
autounselectify: true,
layout: {
name: 'polywas',
logSpacing: false,
chromPadding: 15,
},
style: [
{
selector: '[type = "gene"]',
style: {
'content': 'data(id)',
'color': 'white',
'text-valign': 'center',
'text-halign': 'center',
'background-color': '#62c',
'shape': 'circle',
}
},
{
selector: '[type = "snpG"]',
css: {
'background-color': 'black',
}
},
{
selector: 'edge',
css: {
'curve-style': 'unbundled-bezier',
'width': 3,
'opacity': 0.5,
'line-color': 'black'
}
}
],
elements: {
nodes: [
{data:{id:'a',snp:'z',chrom:'1',start:500,end:600}},
{data:{id:'b',snp:'y',chrom:'1',start:3700,end:3800}},
{data:{id:'c',snp:'x',chrom:'2',start:5700,end:5800}},
{data:{id:'d',snp:'w',chrom:'2',start:8000,end:8100}},
{data:{id:'e',snp:'v',chrom:'2',start:8100,end:8200}},
{data:{id:'f',snp:'v',chrom:'3',start:2000,end:2111}},
{data:{id:'g',snp:'u',chrom:'3',start:5000,end:5100}},
{data:{id:'h',snp:'t',chrom:'3',start:7498,end:7499}},
{data:{id:'i',snp:'s',chrom:'3',start:7500,end:7501}},
{data:{id:'j',snp:'r',chrom:'3',start:11000,end:11010}},
],
edges: [
{data:{id:'ai',source:'a',target:'i'}},
{data:{id:'dc',source:'d',target:'c'}},
{data:{id:'eb',source:'e',target:'d'}},
{data:{id:'gc',source:'g',target:'c'}},
{data:{id:'gh',source:'g',target:'h'}},
{data:{id:'hc',source:'h',target:'c'}},
]}})});
</script>
</head>
<body>
<h1>polywas Layout Demo</h1>
<div id="cy"></div>
</body>
</html>