forked from BasicPrimitives/javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCaseHighlightPathAnnotation.html
More file actions
61 lines (57 loc) · 2.4 KB
/
Copy pathCaseHighlightPathAnnotation.html
File metadata and controls
61 lines (57 loc) · 2.4 KB
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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Highlight Path Annotation</title>
<script type="text/javascript" src="../../primitives.js"></script>
<link href="../../css/primitives.css" media="screen" rel="stylesheet" type="text/css" />
<script type='text/javascript'>
var control;
document.addEventListener('DOMContentLoaded', function () {
/* This sample verifies JSON form of items & connector annotation creation */
control = primitives.OrgDiagram(document.getElementById('basicdiagram'), {
items: [
/* JSON noname objects equivalent to primitives.OrgItemConfig */
{ id: 0, parent: null, title: "James Smith", description: "VP, Public Sector", image: "../images/photos/a.png" },
{id: 1, parent: 0, title: "Ted Lucas", description: "VP, Human Resources", image: "../images/photos/b.png" },
{ id: 2, parent: 0, title: "Fritz Stuger", description: "Business Solutions, US", image: "../images/photos/c.png" },
{ id: 3, parent: 0, title: "Mike Wazowski", description: "Business Analyst, Canada", image: "../images/photos/o.png" },
{ id: 4, parent: 3, title: "Edward Smith", description: "Field Engineer", image: "../images/photos/s.png" },
{ id: 5, parent: 1, title: "Doug Parker", description: "Field Engineer", image: "../images/photos/p.png" }
],
annotations: [
/* JSON noname object equivalent to primitives.ConnectorAnnotationConfig */
{
annotationType: primitives.AnnotationType.HighlightPath,
items: [5, 0],
color: primitives.Colors.Navy,
lineWidth: 12,
opacity: 0.3,
showArrows: false
},
/* prototype based instantiation */
new primitives.HighlightPathAnnotationConfig({
items: [4, 0],
color: primitives.Colors.Red,
lineWidth: 2,
opacity: 1,
showArrows: true
})
],
cursorItem: 0,
hasSelectorCheckbox: primitives.Enabled.True,
highlightLinesColor: primitives.Colors.Red,
highlightLinesWidth: 1.5,
highlightLinesType: primitives.LineType.Dashed,
arrowsDirection: primitives.GroupByType.Parents,
pageFitMode: primitives.PageFitMode.AutoSize,
autoSizeMinimum: new primitives.Size(100, 100),
autoSizeMaximum: new primitives.Size(2000, 2000)
});
});
</script>
</head>
<body>
<div id="basicdiagram" style="border-style: dotted; border-width: 1px;"></div>
</body>
</html>