UNPKG

4.51 kBJavaScriptView Raw
1/**
2 * Created by xiachi on 17/1/17.
3 */
4
5var normalMap = {
6 t: {
7 align: 'bc tc',
8 rtlAlign: 'bc tc',
9 arrow: 'bottom',
10 trOrigin: 'bottom',
11 rtlTrOrigin: 'bottom',
12 offset: [0, -12]
13 },
14 r: {
15 align: 'cl cr',
16 rtlAlign: 'cr cl',
17 arrow: 'left',
18 trOrigin: 'left',
19 rtlTrOrigin: 'right',
20 offset: [12, 0]
21 },
22 b: {
23 align: 'tc bc',
24 rtlAlign: 'tc bc',
25 arrow: 'top',
26 trOrigin: 'top',
27 rtlTrOrigin: 'top',
28 offset: [0, 12]
29 },
30 l: {
31 align: 'cr cl',
32 rtlAlign: 'cl cr',
33 arrow: 'right',
34 trOrigin: 'right',
35 rtlTrOrigin: 'left',
36 offset: [-12, 0]
37 },
38 tl: {
39 align: 'br tc',
40 rtlAlign: 'bl tc',
41 arrow: 'bottom-right',
42 trOrigin: 'bottom right',
43 rtlTrOrigin: 'bottom left',
44 offset: [20, -12]
45 },
46 tr: {
47 align: 'bl tc',
48 rtlAlign: 'br tc',
49 arrow: 'bottom-left',
50 trOrigin: 'bottom left',
51 rtlTrOrigin: 'bottom right',
52 offset: [-20, -12]
53 },
54 rt: {
55 align: 'bl cr',
56 rtlAlign: 'br cl',
57 arrow: 'left-bottom',
58 trOrigin: 'bottom left',
59 rtlTrOrigin: 'bottom right',
60 offset: [12, 20]
61 },
62 rb: {
63 align: 'tl cr',
64 rtlAlign: 'tr cl',
65 arrow: 'left-top',
66 trOrigin: 'top left',
67 rtlTrOrigin: 'top right',
68 offset: [12, -20]
69 },
70 bl: {
71 align: 'tr bc',
72 rtlAlign: 'tl bc',
73 arrow: 'top-right',
74 trOrigin: 'top right',
75 rtlTrOrigin: 'top left',
76 offset: [20, 12]
77 },
78 br: {
79 align: 'tl bc',
80 rtlAlign: 'tr bc',
81 arrow: 'top-left',
82 trOrigin: 'top left',
83 rtlTrOrigin: 'top right',
84 offset: [-20, 12]
85 },
86 lt: {
87 align: 'br cl',
88 rtlAlign: 'bl cr',
89 arrow: 'right-bottom',
90 trOrigin: 'bottom right',
91 rtlTrOrigin: 'bottom left',
92 offset: [-12, 20]
93 },
94 lb: {
95 align: 'tr cl',
96 rtlAlign: 'tl cr',
97 arrow: 'right-top',
98 trOrigin: 'top right',
99 rtlTrOrigin: 'top left',
100 offset: [-12, -20]
101 }
102};
103var edgeMap = {
104 t: {
105 align: 'bc tc',
106 rtlAlign: 'bc tc',
107 arrow: 'bottom',
108 trOrigin: 'bottom',
109 rtlTrOrigin: 'bottom',
110 offset: [0, -12]
111 },
112 r: {
113 align: 'cl cr',
114 rtlAlign: 'cr cl',
115 arrow: 'left',
116 trOrigin: 'left',
117 rtlTrOrigin: 'right',
118 offset: [12, 0]
119 },
120 b: {
121 align: 'tc bc',
122 rtlAlign: 'tc bc',
123 arrow: 'top',
124 trOrigin: 'top',
125 rtlTrOrigin: 'top',
126 offset: [0, 12]
127 },
128 l: {
129 align: 'cr cl',
130 rtlAlign: 'cl cr',
131 arrow: 'right',
132 trOrigin: 'right',
133 rtlTrOrigin: 'left',
134 offset: [-12, 0]
135 },
136 tl: {
137 align: 'bl tl',
138 rtlAlign: 'br tr',
139 arrow: 'bottom-left',
140 trOrigin: 'bottom left',
141 rtlTrOrigin: 'bottom right',
142 offset: [0, -12]
143 },
144 tr: {
145 align: 'br tr',
146 rtlAlign: 'bl tl',
147 arrow: 'bottom-right',
148 trOrigin: 'bottom right',
149 rtlTrOrigin: 'bottom left',
150 offset: [0, -12]
151 },
152 rt: {
153 align: 'tl tr',
154 rtlAlign: 'tr tl',
155 arrow: 'left-top',
156 trOrigin: 'top left',
157 rtlTrOrigin: 'top right',
158 offset: [12, 0]
159 },
160 rb: {
161 align: 'bl br',
162 rtlAlign: 'br bl',
163 arrow: 'left-bottom',
164 trOrigin: 'bottom left',
165 rtlTrOrigin: 'bottom right',
166 offset: [12, 0]
167 },
168 bl: {
169 align: 'tl bl',
170 rtlAlign: 'tr br',
171 arrow: 'top-left',
172 trOrigin: 'top left',
173 rtlTrOrigin: 'top right',
174 offset: [0, 12]
175 },
176 br: {
177 align: 'tr br',
178 rtlAlign: 'tl bl',
179 arrow: 'top-right',
180 trOrigin: 'top right',
181 rtlTrOrigin: 'top left',
182 offset: [0, 12]
183 },
184 lt: {
185 align: 'tr tl',
186 rtlAlign: 'tl tr',
187 arrow: 'right-top',
188 trOrigin: 'top right',
189 rtlTrOrigin: 'top left',
190 offset: [-12, 0]
191 },
192 lb: {
193 align: 'br bl',
194 rtlAlign: 'bl br',
195 arrow: 'right-bottom',
196 trOrigin: 'bottom right',
197 rtlTrOrigin: 'bottom left',
198 offset: [-12, 0]
199 }
200};
201
202export { normalMap, edgeMap };
\No newline at end of file