forked from ismms-himc/clustergrammer-gl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
88 lines (69 loc) · 2.62 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>clustergrammer-gl</title>
</head>
<body>
<!-- <script src="bundle.js"></script> -->
<!--<script>console.log('loading webpack built bundle')</script>-->
<script src="lib/js/d3.js"></script>
<script src='lib/js/underscore-min.js'></script>
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/5.15.0/d3.min.js"></script> -->
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script> -->
<script src="./build/clustergrammer-gl.js"></script>
<script>
var inst_div = document.createElement('div')
inst_div.setAttribute('id', 'something')
document.body.appendChild(inst_div);
var inst_container = document.getElementById('something');
// the control panel is 135 pixels high
// var inst_height = 1000;
// var inst_width = 1000;
var x_offset = 10;
var y_offset = 10;
d3.select('#something')
// .style('height',inst_height + 'px')
// .style('width',inst_width+'px')
.style('background','white')
// .style('border', '2px solid #eee')
// .style('margin-left', x_offset + 'px')
// .style('margin-top', y_offset + 'px');
// var filename = "./build/data/77b4fbd7-b2e4-4550-abe2-dab5f9712abd_mult_view.json";
var filename = './data/mult_view.json';
// var filename = './build/data/big_data_mult_view.json';
var my_widget_callback = function(external_model){
console.log('-------------------------------')
console.log('RUNNING MY WIDGET CALLBACK')
console.log('-------------------------------')
}
var json_file = window.sessionStorage.getItem("json_file");
if (json_file) {
window.sessionStorage.removeItem("json_file");
cgm = CGM({
network: JSON.parse(json_file),
container: inst_container,
// viz_width: inst_width,
// viz_height: inst_height,
widget_callback: my_widget_callback,
use_hzome: true,
});
} else {
d3.json(filename).then(function(network) {
cgm = CGM({
network: network,
container: inst_container,
// viz_width: inst_width,
// viz_height: inst_height,
widget_callback: my_widget_callback,
use_hzome: true,
});
});
}
</script>
</body>
</html>