-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
91 lines (86 loc) · 2.35 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<style>
html,
body,
#chromosummary {
width: 100%;
height: 100%;
margin: 0;
}
svg {
/* border: 1px solid #000; */
background-color: #ebeeee;
font-family: Helvetica;
}
/* .chromosome-group g {
filter: url(#dropshadow);
} */
.chromosome-group rect {
fill: #fefefe;
filter: url(#dropshadow);
}
.chromosome-group rect,
.chromosome-group polyline,
.chromosome-group .annot,
.chromosome-group line {
stroke: rgba(150, 150, 150, 1);
stroke-width: 2px;
}
.chromosome-group polyline {
fill: none;
}
.chromosome-group .annot .tip-human {
/*fill: #F00;*/
}
div.tooltip {
position: absolute;
padding: 10px;
font: 16px sans-serif;
background: #fff;
border: 1px solid #000;
border-radius: 4px;
pointer-events: none;
max-width: 300px;
}
</style>
</head>
<body>
<div id="chromosummary"></div>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="script.js"></script>
<script>
d3.tsv("calli_chromosomes.tsv", function(err, chromosomesData) {
if (err) throw error;
chromosomesData.map(function(x) {
x.size = parseInt(x.size);
x.phenotype = [];
});
getPhenotype(chromosomesData);
});
function getPhenotype(chromosomesData) {
d3.tsv("calli_phenotype.tsv", function(err, phenotypeData) {
var labels = [];
phenotypeData.map(function(phenotype) {
//reducing dataset
if (Math.random() > 0.9) {
phenotype.position = parseInt(phenotype.position);
chromosomesData
.filter(function(chromosome) {
return chromosome.chrname == phenotype.chrname;
})[0]
.phenotype.push(phenotype);
labels.push(phenotype.label);
}
});
// removing duplicates
labels = labels.filter(function(value, index, self) {
return self.indexOf(value) === index;
});
chromosummary({ chromosomesData: chromosomesData, labels: labels });
});
}
</script>
</body>
</html>