-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest2.html
59 lines (56 loc) · 2.15 KB
/
test2.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
<html>
<head>
<script src="dist/js/mascp-jstools.js"></script>
</head>
<body>
<div style="padding: 30px;">
<gator-uniprot id="blaz" interactive="true" auto="true" style="height: 300px; overflow: auto;" zoom="auto" geneid="1605" accession="q14118" exonmargin="300" caching="true">
<gator-track id="fooz" name="mutations">
<gator-localdata id="foo" caching="true" ></gator-localdata>
<gator-editabledata id="baz" ></gator-editabledata>
</gator-track>
<gator-track name="muppets">
</gator-track>
</gator-uniprot>
</div>
<script>
window.fakeblah = function() {
return function renderData(seq,datas) {
return [{ 'aa' : 100, 'type' : 'marker', 'width' : 1 ,'options': {
'content' : Object.keys(datas)[0],
'offset' : 1,
'height' : 24,
'events' : [{ 'type' : 'mousemove,mouseup,click,touchstart', 'data' : {'blah' : 'blaz'} }]
} }];
};
}
window.convertAnnotationsToDatablock = function(annotations) {
var result = {};
annotations.forEach(function(anno) {
if (anno.acc) {
if ( ! result[anno.acc] ) {
result[anno.acc] = [];
}
result[anno.acc].push(anno);
}
});
return result;
};
window.blah = function() {
setTimeout(function() {
document.getElementById('fooz').go();
},100);
window.anno_block = [ {"id" : 1, 'acc' : 'q14118', "type": "symbol" , "color" : "#0f0", "index" : 200 },
{"id" : 5, 'acc' : 'q14118', "length": 20 ,"index" : 150, "color" : "#f0f", "tag" : "Tagthing" },
{"id" : 2, 'acc' : 'q14118', "length": 100 ,"index" : 150, "color" : "#f00", "tag" : "Tagthing" },
{"id" : 3, 'acc' : 'q14118', "length": 100 ,"index" : 300, "color" : "#0f0", "tag" : "Tagthing" },
{"id" : 4, 'acc' : 'q14118', "length": 100 ,"index" : 220, "color" : "#ff0", "tag" : "Tagthing" },
];
document.getElementById('foo').data = {'q14118' : {'Faz' : 'bar'}};
document.getElementById('foo').renderer = window.fakeblah();
document.getElementById('baz').data = convertAnnotationsToDatablock(window.anno_block);
document.getElementById('blaz').renderer.selecting = true;
};
</script>
</body>
</html>