-
Notifications
You must be signed in to change notification settings - Fork 72
/
Copy pathSeventhExample.tsx
81 lines (77 loc) · 1.99 KB
/
SeventhExample.tsx
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
import React from 'react';
import ArcherContainer from '../src/ArcherContainer/ArcherContainer';
import ArcherElement from '../src/ArcherElement/ArcherElement';
const rootStyle = {
display: 'flex',
justifyContent: 'center',
};
const rowStyle = {
margin: '200px 0',
display: 'flex',
justifyContent: 'space-between',
};
const boxStyle = {
padding: '10px',
border: '1px solid black',
};
const SeventhExample = () => {
return (
<div
style={{
height: '500px',
margin: '50px',
}}
>
<ArcherContainer strokeColor="red">
<div style={rootStyle}>
<ArcherElement
id="root"
relations={[
{
targetId: 'element2',
targetAnchor: 'top',
sourceAnchor: 'bottom',
// Draws this arrow on top
order: 100,
style: {
strokeColor: 'blue',
endShape: {
circle: {
radius: 3,
},
},
},
},
{
targetId: 'element3',
targetAnchor: 'top',
sourceAnchor: 'bottom',
style: {
endShape: {
circle: {
radius: 4,
fillColor: '#c0ffee',
strokeColor: 'black',
strokeWidth: 2,
},
},
},
},
]}
>
<div style={boxStyle}>Root</div>
</ArcherElement>
</div>
<div style={rowStyle}>
<ArcherElement id="element2">
<div style={boxStyle}>Element 2</div>
</ArcherElement>
<ArcherElement id="element3">
<div style={boxStyle}>Element 3</div>
</ArcherElement>
</div>
</ArcherContainer>
</div>
);
};
export default SeventhExample;