-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathLabelAnnotationConfig.js
More file actions
74 lines (67 loc) · 1.93 KB
/
Copy pathLabelAnnotationConfig.js
File metadata and controls
74 lines (67 loc) · 1.93 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
62
63
64
65
66
67
68
69
70
71
72
73
74
import {AnnotationType, Colors } from '../enums';
/**
* @class LabelAnnotationConfig
* @classdesc In-layout label annotations are placed between nodes,
* impacting diagram layout and node placement. Label annotations are
* designed for auto-placement and bundling connection lines between nodes when needed.
*
* @param {object} arg0 Object properties.
*/
export default function LabelAnnotationConfig(arg0, arg1) {
var property;
/**
* Annotation type property explicitly defines annotation object type when
* it is defined as a JSON object. The `annotations` collection contains
* a mixture of all kinds of control annotations.
*
* @type {AnnotationType}
*/
this.annotationType = AnnotationType.Label;
/**
* This is the item id you are creating annotation for.
*
* @type {string}
*/
this.fromItem = null;
/**
* The collection of destination nodes should have only child or parent
* items of the annotated item simultaneously. It cannot include children
* and parents at the same time. Suppose the annotated item has several
* label annotations for different sub-sets of children. In that case,
* annotations form into cascades of labels over connection lines in the diagram.
*
* @type {string[]}
*/
this.toItems = [];
/**
* The label of the annotation. It is styled with `bp-connector-label` CSS class name.
*
* @type {string}
*/
this.title = null;
/**
* Background color.
*
* @type {string}
*/
this.itemTitleColor = Colors.RoyalBlue;
/**
* Item template name. See items templates collection for more details.
*
* @type {string}
*/
this.templateName = null;
switch (arguments.length) {
case 1:
for (property in arg0) {
if (arg0.hasOwnProperty(property)) {
this[property] = arg0[property];
}
}
break;
case 2:
this.fromItem = arg0;
this.toItem = arg1;
break;
}
};