-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
112 lines (98 loc) · 2.76 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
101
102
103
104
105
106
107
108
109
110
111
112
<!DOCTYPE html>
<html>
<head>
<title>JSPlumb</title>
</head>
<body>
<style>
#diagramContainer {
padding: 20px;
width:80%; height: 200px;
border: 1px solid gray;
}
.item {
position: absolute;
}
.jtk-connector { z-index:4; }
.jtk-endpoint { z-index:5; }
.jtk-overlay { z-index:6; }
.endPoint {
fillStyle: red;
}
.endpointHover {
fill: red;
}
</style>
<div id="diagramContainer">
<div id="db" class="item">
<img src="img/db.png">
</div>
<div id="api-manager" class="item" style="left:450px;">
<img src="img/api-manager.png">
</div>
<div id="load-balancer" class="item" style="left:250px;">
<img src="img/load-balancer.png">
</div>
<div id="svn" class="item" style="left:250px; top: 200px">
<img src="img/svn.png">
</div>
</div>
<script src="jquery-1.9.1.min.js"></script>
<script src="jquery-ui-1.9.2.min.js"></script>
<script src="jquery.jsPlumb-1.4.1-all-min.js"></script>
<script>
var common = {
connector:["Bezier", {curviness: 50}], //"Straight",
endpoint: ["Dot", {
radius:5,
cssClass:"endPoint",
hoverClass:"endpointHover"
}],
paintStyle:{ fillStyle:"#234198", outlineWidth:1 },
// hoverPaintStyle:{ fillStyle:"lightblue" },
connectorStyle:{ strokeStyle:"grey", lineWidth:2 },
connectorHoverStyle:{ lineWidth:3 },
maxConnections: 3
};
jsPlumb.ready(function() {
//Enable dragging all item class elements
jsPlumb.draggable($(".item"), {});
jsPlumb.Defaults.Overlays = [
[ "Arrow", {
location:1,
id:"arrow",
length:14,
foldback:0.8
} ]
];
// jsPlumb.connect({
// source:"db",
// target:"api-manager",
// endpoint: ["Dot", {
// radius:10,
// cssClass:"endPoint"
// }],
// connector: ["Straight"],
// anchor:[ "Perimeter", { shape:"Circle" } ],
// paintStyle:{ strokeStyle:"gray", lineWidth:5 },
// endpointStyle:{ fillStyle:"lightgray", outlineColor:"gray" },
// overlays:[
// ["Arrow" , { width:20, length:20, location:0.97 }]
// ]
// });
jsPlumb.addEndpoint($(".item"), {
isSource:true,
anchor:["Right"]
}, common);
jsPlumb.makeTarget($(".item"), {
isTarget:true,
anchor:["Left"]
}, common);
// jsPlumb.addEndpoint($(".item"), {
// isTarget:true,
// anchor:["Left"]
// }, common);
});
</script>
</body>
</html>