-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathSelectionPathModeInFamilyChart.jsx
89 lines (83 loc) · 2.12 KB
/
SelectionPathModeInFamilyChart.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
import React, { Component } from 'react';
import { FamDiagram } from '../Diagrams';
import { SelectionPathMode, PageFitMode, Enabled } from 'basicprimitives';
class Sample extends Component {
constructor(props) {
super(props);
this.state = {
selectionPathMode: (SelectionPathMode.None)
}
}
onSelectionPathModeChanged(selectionPathMode) {
this.setState({ selectionPathMode });
}
render() {
const { selectionPathMode } = this.state;
const config = {
selectionPathMode,
pageFitMode: PageFitMode.Page,
hasSelectorCheckbox: Enabled.True,
selectedItems: [3],
items: [
{
id: 0,
parents: null,
title: "James Smith",
description: "VP, Public Sector",
image: "./photos/a.png"
},
{
id: 1,
parents: [0],
title: "Ted Lucas",
description: "VP, Human Resources",
image: "./photos/b.png"
},
{
id: 2,
parents: [1],
title: "Fritz Stuger",
description: "Business Solutions, US",
image: "./photos/c.png"
},
{
id: 3,
parents: [2],
title: "Robert Canon",
description: "Business Solutions, Canada",
image: "./photos/z.png"
}
]
};
return <>
<p>Selection Path Mode:
<br />
<label>
<input
onChange={() => this.onSelectionPathModeChanged(0)}
name="selectionPathMode"
type="radio"
value="0"
checked={selectionPathMode === 0 ? 'checked' : ''}
/>
None
</label>
<br />
<label>
<input
onChange={() => this.onSelectionPathModeChanged(1)}
name="selectionPathMode"
type="radio"
value="1"
checked={selectionPathMode === 1 ? 'checked' : ''}
/>
Full Stack
</label>
</p>
<div className="placeholder">
<FamDiagram centerOnCursor={true} config={config} />
</div>
</>
}
}
export default Sample;