-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
100 lines (91 loc) · 3 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
99
100
<!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.0">
<title>Document</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/cytoscape/3.20.0/cytoscape.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<script type="text/javascript" src="index.js"></script>
<script type="text/javascript" src="skilltree.js"></script>
<link rel="stylesheet" href="assets/skilltree.css">
</head>
<style>
#cy {
width: 100%;
height: 100%;
position: absolute;
top: 0px;
left: 0px;
}
</style>
<body>
<h1>Hello There! This is still under construction and heavy experimentation!</h1>
<div id="tooltip"></div>
<div id="cy"></div>
</body>
<script>
var cy = cytoscape({
container: document.getElementById('cy'), // container to render in
elements: skilltree,
style: [ // the stylesheet for the graph
{
selector: 'node',
style: {
'background-color': 'green',
'font-size': '0.4em',
'width': '0.9em',
'height': '0.9em',
'label': 'data(title)'
},
},
{
selector: 'edge',
style: {
'width': 3,
'line-color': '#ccc',
'target-arrow-color': '#ccc',
'target-arrow-shape': 'triangle',
'curve-style': 'bezier'
}
},
{
selector: 'node.main',
style: {
'background-color': 'red',
'width': '1.2em',
'height': '1.2em'
}
},
{
selector: 'node.book',
style: {
'font-size': 'smaller',
'background-color': 'blue',
'width': '0.5em',
'height': '0.5em'
}
},
{
selector: 'node.root',
style: {
'background-image': 'url("assets/AmmaarMinimalProfile.png")',
'background-image-containment': 'over',
'background-fit': 'contain',
'width': '2em',
'height': '2em'
}
}
],
layout: {
name: 'cose',
zoom: 0.8,
}
});
cy.on('tap', 'node', (event) => createCard(event));
cy.on('mouseout', 'node', (event) => deleteCard(event));
</script>
</html>