-
Notifications
You must be signed in to change notification settings - Fork 7
/
demo.html
77 lines (68 loc) · 3.33 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>
BlueGenes GO-term Visualizer
</title>
<!-- You can assume imjs is on the window. -->
<script src="node_modules/imjs/dist/im.min.js"></script>
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<script crossorigin src="https://unpkg.com/react@16/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script>
<!-- These are styles that will be inherited from bluegenes -->
<link rel="stylesheet" href="css/site.css">
<!-- These are the styles YOU implement in src/style.less -->
<link rel="stylesheet" href="dist/style.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.2.0/socket.io.js"></script>
<script>
var socket = io("http://localhost:3457");
socket.on('reload', function(){
document.location.reload();
});
</script>
</head>
<body>
<div class="bluegenesGoTermVisualizer" id='yourDiv' />
<script>
window.onload = function() {
//The element to attach the viewer to. Must be an existing DOM element
var elem = document.getElementById('yourDiv'),
//InterMine service, including URL and token.
imURL = {
// root: 'http://www.humanmine.org/human',
root: 'https://www.flymine.org/flymine'
//could include token here too if we had one
},
//this is an example of data that could be passed to this tool be BlueGenes
//in reality (outside the demo) this would be dynamic and not hard-coded
// to an ID.
dataToInitialiseToolWith = {
Gene: {
"class" : "Gene",
"format" : "ids",
// PL_GenomicsEngland_GenePanel:Familial_Meniere_Disease, // 500 results
// PL_GenomicsEngland_GenePanel:Ocular_coloboma // 22 results
"value" : [1038365, 1011341, 1165074, 1007696, 1006132, 1043100, 1038456, 1053648, 1001890, 1035707, 1019900, 1097271, 1019789, 1030270, 1097061, 1187200, 1024557, 1045891, 1018196, 1024730, 1164215, 1020820, 1288961, 1007656, 1009498, 1023360, 1006331, 1043486, 1109399, 1032077, 1051163, 1024715, 1037694, 1007357, 1036662, 1073345, 1051259, 1006114, 1024968, 1032094, 1126475, 1028583, 1027775, 1105874, 1028844, 1082041, 1030337, 1028999, 1015103, 1035028, 1224490, 1076639, 1027212, 1014561, 1054160, 1023705, 1451662, 1022827, 1131042, 1017111, 1198949, 1007877, 1012710, 1021407, 1069577, 1040634, 1026618, 1053668, 1020359, 1199351, 1086089, 1019313, 1033707, 1028547, 1027236, 1003814, 1127087, 1127153, 1028032],
// current ids from list PL FlyTF_REDfly_TFs with 79 results
}
},
toolState = {}; //to be confirmed how we use this.
// THIS LINE IS THE IMPORTANT BIT. YOU SHOULDN'T NEED TO EDIT IT
// the method signature should match the signature in src/index.js
$.ajax('config.json').then(function(config) {
bluegenesGoTermVisualizer.main(
elem,
imURL,
dataToInitialiseToolWith,
toolState,
config,
);
});
};
</script>
<script src="dist/bundle.js"></script>
</body>
</html>