-
Notifications
You must be signed in to change notification settings - Fork 1
/
demo.html
54 lines (48 loc) · 2.19 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
<!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 Protvista demo</title>
<!-- You can assume jquery is on the window. -->
<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ="
crossorigin="anonymous"></script>
<!-- You can assume imjs is on the window. -->
<script src="https://cdn.rawgit.com/intermine/CDN/1b9d0552cb6e04607eaf3dcd686d1ee26cb25838/js/intermine/imjs/3.15.0/im.min.js"></script>
<!-- this is the code that changes ProtVista to a BlueGenes initialisable component -->
<link rel="stylesheet" href="dist/style.css">
</head>
<body>
<div class="bluegenesToolProtvista" 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: "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
dataToInitialiseToolWith = {
"Protein": {
"class": "Protein",
"format": "id",
"value": 2892223
}
},
toolState = null; //to be confirmed how we use this.
//showing how we dynamically load the config file
$.ajax("config.json").then(function (config) {
//init the app, as per
//https://gist.github.com/joshkh/76091f1182d425934c1c5dbe2644d23a
bluegenesToolProtvista.main(
elem, imURL, dataToInitialiseToolWith, toolState, config);
});
}
</script>
<script src="dist/bundle.js"></script>
</body>
</html>