UNPKG

1.46 kBHTMLView Raw
1<!doctype html>
2<html>
3<head>
4 <title>Network | Label stroke</title>
5 <script type="text/javascript" src="../../../dist/vis-network.min.js"></script>
6 <link href="../../../dist/vis-network.min.css" rel="stylesheet" type="text/css" />
7
8 <style type="text/css">
9 #mynetwork {
10 width: 600px;
11 height: 600px;
12 border: 1px solid lightgray;
13 background:#d1d1d1;
14 }
15 p {
16 max-width:600px;
17 }
18 </style>
19
20</head>
21
22<body>
23<p>The style of the edges can be fully customized.</p>
24
25<div id="mynetwork"></div>
26
27<script type="text/javascript">
28 // create an array with nodes
29 var nodes = [
30 {id: 1, label: 'Node 1', font: '12px arial red'},
31 {id: 2, label: 'Node 2', font: {size:12, color:'lime', face:'arial'}},
32 {id: 3, label: 'Node 3', font: '18px verdana blue'},
33 {id: 4, label: 'Node 4', font: {size:12, color:'red', face:'sans', background:'white'}},
34 {id: 5, label: 'Node 5', font: {size:15, color:'red', face:'courier', strokeWidth:3, strokeColor:'#ffffff'}}
35 ];
36
37 // create an array with edges
38 var edges = [
39 {from: 1, to: 2},
40 {from: 1, to: 3},
41 {from: 2, to: 4},
42 {from: 2, to: 5}
43 ];
44
45 // create a network
46 var container = document.getElementById('mynetwork');
47 var data = {
48 nodes: nodes,
49 edges: edges
50 };
51 var options = {
52 nodes : {
53 shape: 'dot',
54 size: 10
55 }
56 };
57 var network = new vis.Network(container, data, options);
58</script>
59
60</body>
61</html>