-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbasic-example.html
51 lines (36 loc) · 1.24 KB
/
basic-example.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
<html>
<head>
<script type="module"
src="https://unpkg.com/@geneontology/wc-gocam-viz/dist/wc-gocam-viz/wc-gocam-viz.esm.js"></script>
<script nomodule="" src="https://unpkg.com/@geneontology/wc-gocam-viz/dist/wc-gocam-viz/wc-gocam-viz.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<!-- ACTUAL INTEGRATION OF THE GOCAM-VIZ COMPONENT 568b0f9600000284-->
<wc-gocam-viz id="gocam-1" gocam-id="62b4ffe300003754"></wc-gocam-viz>
<!-- OPTIONAL: SPECIAL HANDLING OF EVENTS -->
<script>
/**
* General Key listener, here to recenter the graph visualization
*/
document.addEventListener('keydown', (key) => {
key.preventDefault();
if (key.code == 'Space') {
let viz = document.getElementById("gocam-1");
if (viz) { viz.resetView(); }
}
})
/**
* Listen to a mouse over event on an activity node
*/
document.addEventListener('nodeOver', function hideMenu(e, v) {
let payload = e.detail;
});
/**
* Listen to a mouse out event from an activity node
*/
document.addEventListener('nodeOut', function hideMenu(e, v) {
});
</script>
</body>
</html>