forked from cytoscape/cytoscape.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmemory.html
51 lines (35 loc) · 1.15 KB
/
memory.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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1">
<link rel="shortcut icon" href="images/favicon.png" />
<script type="text/javascript" src="jquery-2.1.1.js"></script>
<script src="livereload.js"></script>
<script src="../build/cytoscape.js"></script>
<title>cytoscape.js memory debug page</title>
</head>
<body>
<button id="init">Init</button>
<button id="destroy">Destroy</button>
<div style="border: 1px solid #888; width: 300px; height: 300px;" id="cytoscape"></div>
<script>
function init(){
window.cy = cytoscape({
container: document.getElementById('cytoscape'),
elements: [
{ data: { id: 'foo' } },
{ data: { id: 'bar' } },
{ data: { id: 'baz', source: 'foo', target: 'bar' } }
]
});
}
function destroy(){
cy.destroy();
window.cy = null;
}
$('#init').on('click', init);
$('#destroy').on('click', destroy);
</script>
</body>
</html>