-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
60 lines (52 loc) · 2.24 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
<!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>Cytoscape Interaction Network</title>
<!-- You can assume imjs is on the window. -->
<script src="node_modules/imjs/dist/im.js"></script>
<script
src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
crossorigin="anonymous"></script>
<link rel="stylesheet" href="dist/style.css">
</head>
<body>
<div class="bluegenesToolCytoscape" id='yourDiv'></div>
<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.humanmine.org/humanmine"
//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": "id",
// right now this id corresponds to Human GATA1
// this is a bit fragile since IDs change with every build
// but we don't want to make the code more complicated than
// needed for the demo.
"value": 1145104
}
},
toolState = null; //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) {
bluegenesToolCytoscape.main(
elem, imURL, dataToInitialiseToolWith, toolState, config);
});
}
</script>
<script src="dist/bundle.js"></script>
</body>
</html>