-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathPlaceAdvisersAboveChildren.jsx
108 lines (102 loc) · 2.87 KB
/
PlaceAdvisersAboveChildren.jsx
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
import React, { Component } from 'react';
import { OrgDiagram } from '../Diagrams';
import { Enabled, PageFitMode, GroupByType, OrgItemConfig, ItemType, AdviserPlacementType } from 'basicprimitives';
class Sample extends Component {
constructor(props) {
super(props);
this.state = {
placeAdvisersAboveChildren: false
}
}
onplaceAdvisersAboveChildrenChanged(placeAdvisersAboveChildren) {
this.setState({ placeAdvisersAboveChildren });
}
render() {
const { placeAdvisersAboveChildren } = this.state;
const config = {
placeAdvisersAboveChildren,
hasSelectorCheckbox: Enabled.False,
pageFitMode: PageFitMode.None,
arrowsDirection: GroupByType.Children,
items: [
new OrgItemConfig({
id: 0,
parent: null,
title: "James Smith",
description: "Parent Item",
image: "./photos/a.png"
}),
new OrgItemConfig({
id: 1,
parent: 0,
itemType: ItemType.Adviser,
adviserPlacementType: AdviserPlacementType.Right,
title: "Robert Canon",
description: "Adviser item",
groupTitle: "Adviser",
image: "./photos/b.png"
}),
new OrgItemConfig({
id: 3,
parent: 1,
title: "Fritz Stuger",
description: "Regular Item",
image: "./photos/d.png"
}),
new OrgItemConfig({
id: 4,
parent: 1,
title: "Ted Lucas",
description: "Regular Item",
image: "./photos/d.png"
}),
new OrgItemConfig({
id: 5,
parent: 0,
title: "James Nunnally",
description: "Regular Item",
groupTitle: "Regular",
image: "./photos/d.png"
}),
new OrgItemConfig({
id: 6,
parent: 0,
title: "Harry Harter",
description: "Regular Item",
groupTitle: "Regular",
image: "./photos/d.png"
})
]
};
return <>
<p>Place Advisers Above Children:
<br />
<label>
<input
onChange={() => this.onplaceAdvisersAboveChildrenChanged(true)}
name="placeAdvisersAboveChildren"
type="radio"
value="1"
checked={placeAdvisersAboveChildren === true ? 'checked' : ''}
/>
True
</label>
<br />
<label>
<input
onChange={() => this.onplaceAdvisersAboveChildrenChanged(false)}
name="placeAdvisersAboveChildren"
type="radio"
value="0"
checked={placeAdvisersAboveChildren === false ? 'checked' : ''}
/>
False
</label>
</p>
<div className="placeholder">
<OrgDiagram centerOnCursor={true} config={config} />
</div>
</>
}
}
export default Sample;