-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
98 lines (76 loc) · 2.45 KB
/
index.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<!DOCTYPE>
<html>
<head>
<title>cytoscape-dagre.js demo</title>
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1">
<script src="/bower_components/requirejs/require.js"></script>
<script src="/bower_components/jquery/dist/jquery.min.js"></script>
<script>
requirejs.config({
paths: {
'jquery': "/bower_components/jquery/dist/jquery.min",
'yadage-js': 'yadage-js',
'cytoscape': 'bower_components/cytoscape/dist/cytoscape',
'cytoscape-dagre': 'bower_components/cytoscape-dagre/cytoscape-dagre',
'cytoscape-expand-collapse': '/bower_components/cytoscape-expand-collapse/cytoscape-expand-collapse',
'dagre': 'https://cdn.rawgit.com/cpettitt/dagre/v0.7.4/dist/dagre'
}
});
</script>
<script>
var test_data = undefined
$(document).ready(function(){
console.log("AJAX" + $)
var url = 'work/_yadage/yadage_snapshot_workflow.json'
var url = 'big.json'
$.ajax({url: url,success: function(data){
test_data = data;
require(["yadage-js"],function(yadage){
yadage.nodeSelectCallback = function(evt){
var details = evt.target.data().details
if (details) {
var html = `
<dl>
<dt>Name</dt>
<dd>${details.name}</dd>
</dl>
`
$('#yadage-task').html(html)
}}
yadage.initialize_graph($("#yadage-viz"))
yadage.redraw_graph(data)
})}})
})
</script>
<style>
body {
font-family: helvetica;
font-size: 14px;
}
#yadage-viz {
width: 50%;
height: 50%;
border: 1px solid black;
left: 0;
top: 0;
z-index: 999;
}
h1 {
opacity: 0.5;
font-size: 1em;
}
</style>
</head>
<body>
<div>
<div>
<button onclick="require('yadage-js').redraw_graph(test_data);">redraw</button>
<button onclick="require('yadage-js').relayout();">relayout</button>
<button onclick="require('yadage-js').collapse_api.collapseAll();">collapse</button>
<button onclick="require('yadage-js').collapse_api.expandAll();">expand</button>
</div>
<div id="yadage-viz"></div>
<div id="yadage-task"></div>
</div>
</body>
</html>