Skip to content

Commit 6940976

Browse files
Updated nodes levels alignment with invisble nodes sample
1 parent 82919ae commit 6940976

File tree

1 file changed

+11
-85
lines changed

1 file changed

+11
-85
lines changed

samples/javascript.controls/CaseSkippedLevels.html

Lines changed: 11 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -64,105 +64,31 @@
6464
options.arrowsDirection = primitives.GroupByType.Children;
6565
options.placeAdvisersAboveChildren = true;
6666

67-
options.annotations = [
68-
{
67+
options.annotations = (new Array(10).fill(0)).map((_, index) => {
68+
return (index%2 == 0) ? {
6969
annotationType: primitives.AnnotationType.Level,
70-
levels: [0],
71-
title: "Level 0",
70+
levels: [index],
71+
title: "Level " + index.toString(),
7272
titleColor: primitives.Colors.RoyalBlue,
7373
offset: new primitives.Thickness(0, 0, 0, -1),
7474
lineWidth: new primitives.Thickness(0, 0, 0, 0),
75-
opacity: 0,
75+
opacity: 0,
7676
borderColor: primitives.Colors.Gray,
7777
fillColor: primitives.Colors.Gray,
7878
lineType: primitives.LineType.Dotted
79-
},
80-
{
79+
} : {
8180
annotationType: primitives.AnnotationType.Level,
82-
levels: [1],
83-
title: "Level 1",
81+
levels: [index],
82+
title: "Level " + index.toString(),
8483
titleColor: primitives.Colors.RoyalBlue,
8584
offset: new primitives.Thickness(0, 0, 0, -1),
8685
lineWidth: new primitives.Thickness(0, 0, 0, 0),
87-
opacity: 0.08,
86+
opacity: 0.08,
8887
borderColor: primitives.Colors.Gray,
8988
fillColor: primitives.Colors.Gray,
9089
lineType: primitives.LineType.Dotted
91-
},
92-
{
93-
annotationType: primitives.AnnotationType.Level,
94-
levels: [2],
95-
title: "Level 2",
96-
titleColor: primitives.Colors.RoyalBlue,
97-
offset: new primitives.Thickness(0, 0, 0, -1),
98-
lineWidth: new primitives.Thickness(0, 0, 0, 0),
99-
opacity: 0,
100-
borderColor: primitives.Colors.Gray,
101-
fillColor: primitives.Colors.Gray,
102-
lineType: primitives.LineType.Dotted
103-
},
104-
{
105-
annotationType: primitives.AnnotationType.Level,
106-
levels: [3],
107-
title: "Level 3",
108-
titleColor: primitives.Colors.RoyalBlue,
109-
offset: new primitives.Thickness(0, 0, 0, -1),
110-
lineWidth: new primitives.Thickness(0, 0, 0, 0),
111-
opacity: 0.08,
112-
borderColor: primitives.Colors.Gray,
113-
fillColor: primitives.Colors.Gray,
114-
lineType: primitives.LineType.Dotted
115-
},
116-
{
117-
annotationType: primitives.AnnotationType.Level,
118-
levels: [4],
119-
title: "Level 4",
120-
titleColor: primitives.Colors.RoyalBlue,
121-
offset: new primitives.Thickness(0, 0, 0, -1),
122-
lineWidth: new primitives.Thickness(0, 0, 0, 0),
123-
opacity: 0,
124-
borderColor: primitives.Colors.Gray,
125-
fillColor: primitives.Colors.Gray,
126-
lineType: primitives.LineType.Dotted
127-
},
128-
{
129-
annotationType: primitives.AnnotationType.Level,
130-
levels: [5],
131-
title: "Level 5",
132-
titleColor: primitives.Colors.RoyalBlue,
133-
offset: new primitives.Thickness(0, 0, 0, -1),
134-
lineWidth: new primitives.Thickness(0, 0, 0, 0),
135-
opacity: 0.08,
136-
borderColor: primitives.Colors.Gray,
137-
fillColor: primitives.Colors.Gray,
138-
lineType: primitives.LineType.Dotted
139-
},
140-
{
141-
annotationType: primitives.AnnotationType.Level,
142-
levels: [6],
143-
title: "Level 6",
144-
titleColor: primitives.Colors.RoyalBlue,
145-
offset: new primitives.Thickness(0, 0, 0, -1),
146-
lineWidth: new primitives.Thickness(0, 0, 0, 0),
147-
opacity: 0,
148-
borderColor: primitives.Colors.Gray,
149-
fillColor: primitives.Colors.Gray,
150-
lineType: primitives.LineType.Dotted
151-
},
152-
{
153-
annotationType: primitives.AnnotationType.Level,
154-
levels: [7],
155-
title: "Level 7",
156-
titleColor: primitives.Colors.RoyalBlue,
157-
offset: new primitives.Thickness(0, 0, 0, -1),
158-
lineWidth: new primitives.Thickness(0, 0, 0, 0),
159-
opacity: 0.08,
160-
borderColor: primitives.Colors.Gray,
161-
fillColor: primitives.Colors.Gray,
162-
lineType: primitives.LineType.Dotted
163-
}
164-
];
165-
90+
};
91+
});
16692
control = primitives.OrgDiagram(document.getElementById("basicdiagram"), options);
16793

16894
window.addEventListener('resize', function (event) {

0 commit comments

Comments
 (0)