-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathLabelsCascadesInFamilyChart.jsx
77 lines (74 loc) · 2.55 KB
/
LabelsCascadesInFamilyChart.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
import React, { Component } from 'react';
import { FamDiagram } from '../Diagrams';
import { Enabled, AnnotationType } from 'basicprimitives';
class Sample extends Component {
render() {
const config = {
cursorItem: 2,
linesWidth: 1,
linesColor: "black",
hasSelectorCheckbox: Enabled.False,
normalLevelShift: 20,
dotLevelShift: 20,
lineLevelShift: 20,
normalItemsInterval: 5,
dotItemsInterval: 5,
lineItemsInterval: 5,
items: [
{ id: 1, parents: [2], title: "Thomas Williams", label: "Thomas Williams", description: "1, 1st husband", image: "./photos/t.png" },
{ id: 2, parents: [2], title: "Mary Spencer", label: "Mary Spencer", description: "2, The Mary", image: "./photos/m.png" },
{ id: 3, parents: [2], title: "David Kirby", label: "David Kirby", description: "3, 2nd Husband", image: "./photos/d.png" },
{ id: 4, parents: [2], title: "Brad Williams", label: "Brad Williams", description: "4, 1st son", image: "./photos/b.png" },
{ id: 5, parents: [2], title: "Mike Kirby", label: "Mike Kirby", description: "5, 2nd son, having 2 spouses", image: "./photos/m.png" }
],
annotations: [
{
annotationType: AnnotationType.Label,
fromItem: 2,
toItems: [1, 3, 4, 5],
title: <div className="InLayoutLabel">100%</div>
},
{
annotationType: AnnotationType.Label,
fromItem: 2,
toItems: [1, 3, 4],
title: <div className="InLayoutLabel">60%</div>
},
{
annotationType: AnnotationType.Label,
fromItem: 2,
toItems: [5],
title: <div className="InLayoutLabel">40%</div>
},
{
annotationType: AnnotationType.Label,
fromItem: 2,
toItems: [1, 3],
title: <div className="InLayoutLabel">20%</div>
},
{
annotationType: AnnotationType.Label,
fromItem: 2,
toItems: [4],
title: <div className="InLayoutLabel">80%</div>
},
{
annotationType: AnnotationType.Label,
fromItem: 2,
toItems: [1],
title: <div className="InLayoutLabel">35%</div>
},
{
annotationType: AnnotationType.Label,
fromItem: 2,
toItems: [3],
title: <div className="InLayoutLabel">65%</div>
}
]
};
return <div className="placeholder">
<FamDiagram centerOnCursor={true} config={config} />
</div>
}
}
export default Sample;