HTMLcopy
1
<div id="container"></div>
CSScopy
6
1
html, body, #container {
2
width: 100%;
3
height: 100%;
4
margin: 0;
5
padding: 0;
6
}
JavaScriptcopy
x
1
anychart.onDocumentLoad(function() {
2
var chart = anychart.graph(data);
3
4
var hoverGap = chart.interactivity().hoverGap();
5
6
var titleText = 'Distance between edge and mouse cursor that you can interact with edge is ' + hoverGap;
7
chart.title()
8
.enabled(true)
9
.text(titleText);
10
11
chart.container('container').draw();
12
});
13
14
var data = {
15
nodes: [
16
{id: 'a'},
17
{id: 'a1'},
18
{id: 'a2'},
19
{id: 'a3'},
20
{id: 'a4'},
21
{id: 'a5'},
22
{id: 'a6'},
23
{id: 'b'},
24
{id: 'b1'},
25
{id: 'b2'},
26
{id: 'b3'},
27
{id: 'b4'},
28
{id: 'b5'},
29
{id: 'b6'}
30
],
31
edges: [
32
{from: 'a', to: 'b'},
33
{from: 'a', to: 'a1'},
34
{from: 'a', to: 'a2'},
35
{from: 'a', to: 'a3'},
36
{from: 'a', to: 'a4'},
37
{from: 'a', to: 'a5'},
38
{from: 'a', to: 'a6'},
39
{from: 'b', to: 'b1'},
40
{from: 'b', to: 'b2'},
41
{from: 'b', to: 'b3'},
42
{from: 'b', to: 'b4'},
43
{from: 'b', to: 'b5'},
44
{from: 'b', to: 'b6'},
45
]
46
};