-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1.html
60 lines (60 loc) · 1.27 KB
/
1.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
<!DOCTYPE html>
<html>
<head>
<title>Grafo em GraphML</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/cytoscape/3.22.1/cytoscape.min.js"></script>
</head>
<body>
<div id="cy"></div>
<script>
const cy = cytoscape({
container: document.getElementById('cy'),
elements: [
{ data: { id: 'n0' } },
{ data: { id: 'n1' } },
{ data: { id: 'n2' } },
{
data: {
id: 'e0',
source: 'n0',
target: 'n1'
}
},
{
data: {
id: 'e1',
source: 'n1',
target: 'n2'
}
},
{
data: {
id: 'e2',
source: 'n2',
target: 'n0'
}
}
],
style: [
{
selector: 'node',
style: {
shape: 'circle',
'background-color': '#666',
label: 'data(id)'
}
},
{
selector: 'edge',
style: {
width: 3,
'line-color': '#ccc',
'target-arrow-color': '#ccc',
'target-arrow-shape': 'triangle'
}
}
]
});
</script>
</body>
</html>