Debian Codegraph @

texmf-dist/tex/latex/genealogytree/gtrlib.fanchart.code.tex

raw
1 %% The LaTeX package genealogytree - version 2.4.0 (2026/05/06)
2 %% gtrlib.fanchart.code.tex: Fancharts
3 %%
4 %% -------------------------------------------------------------------------------------------
5 %% Copyright (c) 2013-2026 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
6 %% -------------------------------------------------------------------------------------------
7 %%
8 %% This work may be distributed and/or modified under the
9 %% conditions of the LaTeX Project Public License, either version 1.3
10 %% of this license or (at your option) any later version.
11 %% The latest version of this license is in
12 %% http://www.latex-project.org/lppl.txt
13 %% and version 1.3 or later is part of all distributions of LaTeX
14 %% version 2005/12/01 or later.
15 %%
16 %% This work has the LPPL maintenance status `author-maintained'.
17 %%
18 %% This work consists of all files listed in README
19 %%
20 \gtr@set@library@version{2.4.0}
21
22 \ExplSyntaxOn
23
24 \tl_new:N \l_getree_fanchart_angle_a_tl
25 \tl_new:N \l_getree_fanchart_angle_b_tl
26 \tl_new:N \l_getree_fanchart_id_tl
27 \tl_new:N \l_getree_fanchart_level_tl
28 \tl_new:N \l_getree_fanchart_line_width_tl
29 \tl_new:N \l_getree_fanchart_major_angle_tl
30 \tl_new:N \l_getree_fanchart_minor_angle_tl
31 \tl_new:N \l_getree_fanchart_offset_a_tl
32 \tl_new:N \l_getree_fanchart_offset_b_tl
33 \tl_new:N \l_getree_fanchart_radius_a_tl
34 \tl_new:N \l_getree_fanchart_radius_b_tl
35 \tl_new:N \l_getree_fanchart_ratio_tl
36
37 \tl_const:Nn \c_getree_fanchart_maximum_rings_tl { 24 }
38
39 \bool_new:N \l__getree_fanchart_reset_bounds_bool
40
41 \tl_new:N \l__getree_fanchart_draw_root_code_tl
42 \tl_new:N \l__getree_fanchart_draw_segment_code_tl
43 \tl_new:N \l__getree_fanchart_landscape_level_tl
44 \tl_new:N \l__getree_fanchart_marker_definition_code_tl
45 \tl_new:N \l__getree_fanchart_recursive_action_tl
46 \tl_new:N \l__getree_fanchart_segment_definition_code_tl
47 \tl_new:N \l__getree_fanchart_tmpa_tl
48 \tl_new:N \l__getree_fanchart_tmpb_tl
49
50 \fp_new:N \l__getree_fanchart_angle_fp
51 \fp_new:N \l__getree_fanchart_boundary_scale_fp
52 \fp_new:N \l__getree_fanchart_boundary_width_fp
53 \fp_new:N \l__getree_fanchart_bounds_border_fp
54 \fp_new:N \l__getree_fanchart_bounds_xmax_fp
55 \fp_new:N \l__getree_fanchart_bounds_xmin_fp
56 \fp_new:N \l__getree_fanchart_bounds_ymax_fp
57 \fp_new:N \l__getree_fanchart_bounds_ymin_fp
58 \fp_new:N \l__getree_fanchart_inner_fp
59 \fp_new:N \l__getree_fanchart_inner_off_fp
60 \fp_new:N \l__getree_fanchart_outer_fp
61 \fp_new:N \l__getree_fanchart_outer_off_fp
62 \fp_new:N \l__getree_fanchart_radius_fp
63
64
65 \fparray_new:Nn \g__getree_fanchart_radii_fparray { \c_getree_fanchart_maximum_rings_tl + 1 }
66 \fparray_new:Nn \g__getree_fanchart_distances_fparray { \c_getree_fanchart_maximum_rings_tl }
67 \fparray_new:Nn \g__getree_fanchart_inner_fparray { \c_getree_fanchart_maximum_rings_tl }
68 \fparray_new:Nn \g__getree_fanchart_outer_fparray { \c_getree_fanchart_maximum_rings_tl }
69
70
71 %%%%%%%%%%%%%%%%%%%%%%%
72 %% Core
73 %%%%%%%%%%%%%%%%%%%%%%%
74
75
76 \cs_new_protected:Npn \__getree_fanchart_segment_computation:
77 {
78 \fp_compare:nNnF { \l_getree_fanchart_major_angle_tl } > { \l_getree_fanchart_minor_angle_tl }
79 {
80 \tl_set_eq:NN \l__getree_tmpa_tl \l_getree_fanchart_major_angle_tl
81 \tl_set_eq:NN \l_getree_fanchart_major_angle_tl \l_getree_fanchart_minor_angle_tl
82 \tl_set_eq:NN \l_getree_fanchart_minor_angle_tl \l__getree_tmpa_tl
83 }
84 \fp_set:Nn \l__getree_fanchart_angle_fp
85 {
86 ( \l_getree_fanchart_major_angle_tl - \l_getree_fanchart_minor_angle_tl ) / 2
87 }
88 \fp_set:Nn \l__getree_fanchart_inner_fp { \fparray_item:Nn \g__getree_fanchart_radii_fparray { 1 } }
89
90 \tl_set:Nn \l__getree_tmpa_tl { \fp_to_dim:n { sqrt(2)* \l__getree_fanchart_inner_fp }}
91 \exp_args:Ne \pgfkeys
92 {
93 /gtr/level~0/.append~code =
94 { \exp_not:N\pgfkeysalso
95 {
96 node~size = \l__getree_tmpa_tl, level~size = \l__getree_tmpa_tl
97 }
98 }
99 }
100 \int_step_inline:nnn { 1 } { \c_getree_fanchart_maximum_rings_tl - 1 }
101 {
102 \fp_set:Nn \l__getree_fanchart_outer_fp { \fparray_item:Nn \g__getree_fanchart_radii_fparray { ##1 + 1 } }
103
104 \fp_set:Nn \l__getree_fanchart_inner_off_fp
105 { \l__getree_fanchart_inner_fp + \fparray_item:Nn \g__getree_fanchart_inner_fparray {##1} }
106 \fp_set:Nn \l__getree_fanchart_outer_off_fp
107 { \l__getree_fanchart_outer_fp - \fparray_item:Nn \g__getree_fanchart_outer_fparray {##1} }
108
109 \fp_set:Nn \l__getree_fanchart_angle_fp { \l__getree_fanchart_angle_fp / 2 }
110 \fp_set:Nn \l__getree_fanchart_radius_fp { \l__getree_fanchart_inner_off_fp / \l__getree_fanchart_outer_off_fp }
111
112 \fp_set:Nn \l__getree_tmpb_fp { sqrt( \l__getree_fanchart_radius_fp ^2 + 8 ) }
113 \fp_set:Nn \l__getree_tmpa_fp { sqrt( 1 - ( ( \l__getree_fanchart_radius_fp + \l__getree_tmpb_fp )/4 )^2 ) }
114
115 \fp_compare:nNnTF { \l__getree_fanchart_angle_fp < 90
116 ? \l__getree_fanchart_radius_fp * tand( \l__getree_fanchart_angle_fp ) < \l__getree_tmpa_fp : 0 } = { 0 }
117 {
118 \tl_set:Ne \l__getree_tmpa_tl { \fp_to_dim:n { 2* \l__getree_tmpa_fp * \l__getree_fanchart_outer_off_fp } } % b
119 \tl_set:Ne \l__gtree_tmpb_tl { \fp_to_dim:n {
120 ( \l__getree_tmpb_fp - 3* \l__getree_fanchart_radius_fp )/4* \l__getree_fanchart_outer_off_fp }} % h
121 \fparray_gset:Nnn \g__getree_fanchart_distances_fparray { ##1 }
122 { ( \l__getree_tmpb_fp +5* \l__getree_fanchart_radius_fp )/8* \l__getree_fanchart_outer_off_fp }
123 }
124 {
125 \fp_set:Nn \l__getree_tmpa_fp
126 { sqrt( 1 - ( \l__getree_fanchart_radius_fp * tand( \l__getree_fanchart_angle_fp ) )^2 ) }
127 \fp_set:Nn \l__getree_tmpb_fp { cosd( \l__getree_fanchart_angle_fp /2 ) }
128 \fp_compare:nNnTF { \l__getree_tmpa_fp } < { \l__getree_tmpb_fp }
129 {
130 \tl_set:Ne \l__getree_tmpa_tl { \fp_to_dim:n { 2* \l__getree_fanchart_radius_fp
131 * tand( \l__getree_fanchart_angle_fp )* \l__getree_fanchart_outer_off_fp }} % b
132 \tl_set:Ne \l__gtree_tmpb_tl { \fp_to_dim:n { ( \l__getree_tmpa_fp - \l__getree_fanchart_radius_fp )
133 * \l__getree_fanchart_outer_off_fp }} % h
134 \fparray_gset:Nnn \g__getree_fanchart_distances_fparray { ##1 }
135 { ( \l__getree_tmpa_fp + \l__getree_fanchart_radius_fp ) /2 * \l__getree_fanchart_outer_off_fp }
136 }
137 {
138 \tl_set:Ne \l__getree_tmpa_tl { \fp_to_dim:n { 2*sind( \l__getree_fanchart_angle_fp /2)
139 * \l__getree_fanchart_outer_off_fp }} % b
140 \tl_set:Ne \l__gtree_tmpb_tl { \fp_to_dim:n { 1/(2* \l__getree_tmpb_fp )
141 * \l__getree_fanchart_outer_off_fp }} % h
142 \fparray_gset:Nnn \g__getree_fanchart_distances_fparray { ##1 }
143 { (2* \l__getree_tmpb_fp - 1/(2* \l__getree_tmpb_fp )) /2 * \l__getree_fanchart_outer_off_fp }
144 }
145 }
146 \int_compare:nNnTF {##1} < { \l__getree_fanchart_landscape_level_tl }
147 {
148 \exp_args:Ne \pgfkeys
149 {
150 /gtr/level~##1/.append~code =
151 {
152 \exp_not:N\pgfkeysalso{ node~size = \l__getree_tmpa_tl, level~size = \l__gtree_tmpb_tl }
153 }
154 }
155 }
156 {
157 \exp_args:Ne \pgfkeys
158 {
159 /gtr/level~##1/.append~code =
160 {
161 \exp_not:N\pgfkeysalso{ node~size = \l__gtree_tmpb_tl, level~size = \l__getree_tmpa_tl }
162 }
163 }
164 }
165 \fp_set_eq:NN \l__getree_fanchart_inner_fp \l__getree_fanchart_outer_fp
166 }
167 }
168
169
170 \prg_new_conditional:Npnn \getree_fanchart_if_complemented_node: { p, TF }
171 {
172 \str_if_eq:VnTF \gtrcomplemented { true }
173 {
174 \prg_return_true:
175 }
176 {
177 \prg_return_false:
178 }
179 }
180
181
182 % #1: person number
183 % #2: level
184 % #3: angle a
185 % #4: angle b
186 \cs_new_protected:Npn \__getree_fanchart_draw_person:nnnn #1#2#3#4
187 {
188 \cs_set_nopar:Npx \gtr@currentperson {#1}
189 \cs_set_nopar:Npx \gtrDBsex { \use:c { gtr@per@ \gtr@currentperson @flag@s } }
190 \cs_set_nopar:Npx \gtrDBrelation { \use:c { gtr@per@ \gtr@currentperson @flag@r } }
191 \cs_set_nopar:Npx \gtrcomplemented { \use:c { gtr@per@ \gtr@currentperson @flag@c } }
192 \tl_set:Nx \l_getree_fanchart_level_tl { \int_eval:n {#2} }
193 \tl_set:Nx \l_getree_fanchart_id_tl { \cs_if_exist_use:c { gtr@per@ \gtr@currentperson @id }}
194
195 \int_compare:nNnTF { \l_getree_fanchart_level_tl } > { 0 }
196 {
197 \tl_set:Nx \l_getree_fanchart_angle_a_tl { \fp_to_decimal:n {#3} }
198 \tl_set:Nx \l_getree_fanchart_angle_b_tl { \fp_to_decimal:n {#4} }
199 \tl_set:Nx \l_getree_fanchart_ratio_tl
200 { \fp_to_decimal:n {
201 (( \l_getree_fanchart_angle_a_tl + \l_getree_fanchart_angle_b_tl )/2- \l_getree_fanchart_minor_angle_tl )/
202 ( \l_getree_fanchart_major_angle_tl - \l_getree_fanchart_minor_angle_tl )
203 }
204 }
205 \tl_set:Nx \l_getree_fanchart_radius_a_tl { \fp_to_dim:n {
206 \fparray_item:Nn \g__getree_fanchart_radii_fparray {#2}} }
207 \fp_set:Nn \l__getree_tmpa_fp { \fparray_item:Nn \g__getree_fanchart_radii_fparray { #2 +1 } }
208 \fp_compare:nNnT { \l__getree_tmpa_fp } > { \l__getree_fanchart_bounds_xmax_fp }
209 {
210 \fp_set_eq:NN \l__getree_fanchart_bounds_xmax_fp \l__getree_tmpa_fp
211 }
212 \tl_set:Nx \l_getree_fanchart_radius_b_tl { \fp_to_dim:n { \l__getree_tmpa_fp } }
213 \tl_set:Nx \l_getree_fanchart_offset_a_tl { \fp_to_dim:n {
214 \fparray_item:Nn \g__getree_fanchart_inner_fparray {#2}} }
215 \tl_set:Nx \l_getree_fanchart_offset_b_tl { \fp_to_dim:n {
216 \fparray_item:Nn \g__getree_fanchart_outer_fparray {#2}} }
217 \tl_set:Nx \l_getree_fanchart_line_width_tl
218 {
219 \fp_to_dim:n
220 {
221 min( \l__getree_fanchart_boundary_width_fp,
222 \l_getree_fanchart_radius_a_tl *( \l_getree_fanchart_angle_b_tl - \l_getree_fanchart_angle_a_tl )
223 * \l__getree_fanchart_boundary_scale_fp /2000)
224 }
225 }
226
227 \l__getree_fanchart_segment_definition_code_tl
228 \l__getree_fanchart_marker_definition_code_tl
229 \l__getree_fanchart_draw_segment_code_tl
230
231 \fp_set:Nn \l__getree_fanchart_angle_fp { ( \l_getree_fanchart_angle_a_tl + \l_getree_fanchart_angle_b_tl )/2 }
232 \fp_set:Nn \l__getree_fanchart_radius_fp { \fparray_item:Nn \g__getree_fanchart_distances_fparray {#2} }
233
234 \int_compare:nNnTF { #2 } < { \l__getree_fanchart_landscape_level_tl }
235 {
236 \__getree_fanchart_portrait_angle:nnn
237 {
238 \fp_compare:nNnTF { sind( \l__getree_fanchart_angle_fp ) } < { 0 }
239 {
240 \fp_set:Nn \l__getree_tmpa_fp { \l__getree_fanchart_angle_fp +90 }
241 }
242 {
243 \fp_set:Nn \l__getree_tmpa_fp { \l__getree_fanchart_angle_fp -90 }
244 }
245 }
246 {
247 \fp_set:Nn \l__getree_tmpa_fp { \l__getree_fanchart_angle_fp -90 }
248 }
249 {
250 \fp_set:Nn \l__getree_tmpa_fp { \l__getree_fanchart_angle_fp +90 }
251 }
252 }
253 {
254 \__getree_fanchart_landscape_angle:nnn
255 {
256 \fp_compare:nNnTF { cosd( \l__getree_fanchart_angle_fp ) } < { 0 }
257 {
258 \fp_set:Nn \l__getree_tmpa_fp { \l__getree_fanchart_angle_fp -180 }
259 }
260 {
261 \fp_set_eq:NN \l__getree_tmpa_fp \l__getree_fanchart_angle_fp
262 }
263 }
264 {
265 \fp_set_eq:NN \l__getree_tmpa_fp \l__getree_fanchart_angle_fp
266 }
267 {
268 \fp_set:Nn \l__getree_tmpa_fp { \l__getree_fanchart_angle_fp -180 }
269 }
270 }
271 \node[ rotate = \fp_to_decimal:N \l__getree_tmpa_fp ]
272 at ( \fp_to_decimal:N \l__getree_fanchart_angle_fp \c_colon_str \fp_to_dim:N \l__getree_fanchart_radius_fp )
273 { \hbox_unpack_drop:c { gtr@per@#1@box } } ;
274 }
275 {
276 \tl_set:Nx \l_getree_fanchart_radius_b_tl
277 { \fp_to_dim:n { \fparray_item:Nn \g__getree_fanchart_radii_fparray { 1 } } }
278 \tl_set:Nn \l_getree_fanchart_line_width_tl { \fp_to_dim:N \l__getree_fanchart_boundary_width_fp }
279 \l__getree_fanchart_draw_root_code_tl
280 \node at ( 0,0 ) { \hbox_unpack_drop:c { gtr@per@#1@box } } ;
281 }
282 }
283
284
285
286 % #1: family number
287 % #2: level
288 % #3: angle a
289 % #4: angle b
290 \cs_new_protected:Npn \__getree_fanchart_draw_family:nnnn #1#2#3#4
291 {
292 \gtr@set@currentfamily {#1}
293 \cs_set_eq:Nc \gtr@node { gtr@fam@ \gtr@currentfamily @g }
294 \__getree_fanchart_draw_person:nnnn {\gtr@node} {#2} {#3} {#4}
295 \cs_set_protected_nopar:Npn \dodo ##1
296 {
297 \cs_if_exist:cT { gtr@per@##1@box }
298 {
299 \cs_if_exist:cTF { gtr@per@##1@chiof }
300 {
301 \tl_put_right:Nx \l__getree_fanchart_recursive_action_tl
302 {
303 \exp_not:N \__getree_fanchart_draw_family:nnnn { \use:c { gtr@per@##1@chiof } }
304 { \int_eval:n { #2+1 } } { #3 } { \l__getree_tmpa_tl }
305 }
306 }
307 {
308 \tl_put_right:Nx \l__getree_fanchart_recursive_action_tl
309 {
310 \exp_not:N \__getree_fanchart_draw_person:nnnn { ##1 } { #2+1 } { #3 } { \l__getree_tmpa_tl }
311 }
312 }
313 }
314 }
315 \cs_set_protected_nopar:Npn \do ##1
316 {
317 \cs_if_exist:cT { gtr@per@##1@box }
318 {
319 \cs_if_exist:cTF { gtr@per@##1@chiof }
320 {
321 \tl_put_right:Nx \l__getree_fanchart_recursive_action_tl
322 {
323 \exp_not:N \__getree_fanchart_draw_family:nnnn { \use:c { gtr@per@##1@chiof } }
324 { \int_eval:n { #2+1 } } { \l__getree_tmpa_tl } { #4 }
325 }
326 }
327 {
328 \tl_put_right:Nx \l__getree_fanchart_recursive_action_tl
329 {
330 \exp_not:N \__getree_fanchart_draw_person:nnnn { ##1 } { #2+1 } { \l__getree_tmpa_tl } { #4 }
331 }
332 }
333 }
334 \cs_set_eq:NN \do \dodo
335 }
336 \cs_if_exist:cT { gtr@fam@ \gtr@currentfamily @par }
337 {
338 \tl_set:Nx \l__getree_tmpa_tl { \fp_to_decimal:n { (#3+#4)/2 } }
339 \tl_clear:N \l__getree_fanchart_recursive_action_tl
340 \dolistcsloop{ gtr@fam@ \gtr@currentfamily @par }
341 \tl_use:N \l__getree_fanchart_recursive_action_tl
342 }
343 }
344
345
346 \cs_new_protected:Npn \__getree_fanchart_bounds_fit:n #1
347 {
348 \fp_set:Nn \l__getree_tmpa_fp { \l__getree_fanchart_radius_fp *cosd(#1) }
349 \fp_compare:nNnTF { \l__getree_tmpa_fp } < { \l__getree_fanchart_bounds_xmin_fp }
350 {
351 \fp_set_eq:NN \l__getree_fanchart_bounds_xmin_fp \l__getree_tmpa_fp
352 }
353 {
354 \fp_compare:nNnT { \l__getree_tmpa_fp } > { \l__getree_fanchart_bounds_xmax_fp }
355 {
356 \fp_set_eq:NN \l__getree_fanchart_bounds_xmax_fp \l__getree_tmpa_fp
357 }
358 }
359 \fp_set:Nn \l__getree_tmpa_fp { \l__getree_fanchart_radius_fp *sind(#1) }
360 \fp_compare:nNnTF { \l__getree_tmpa_fp } < { \l__getree_fanchart_bounds_ymin_fp }
361 {
362 \fp_set_eq:NN \l__getree_fanchart_bounds_ymin_fp \l__getree_tmpa_fp
363 }
364 {
365 \fp_compare:nNnT { \l__getree_tmpa_fp } > { \l__getree_fanchart_bounds_ymax_fp }
366 {
367 \fp_set_eq:NN \l__getree_fanchart_bounds_ymax_fp \l__getree_tmpa_fp
368 }
369 }
370 }
371
372
373 \cs_new_protected:Npn \__getree_fanchart_reset_bounds:
374 {
375 \fp_set_eq:NN \l__getree_fanchart_radius_fp \l__getree_fanchart_bounds_xmax_fp
376
377 \fp_set:Nn \l__getree_fanchart_bounds_xmax_fp { \fparray_item:Nn \g__getree_fanchart_radii_fparray { 1 } }
378 \fp_set_eq:NN \l__getree_fanchart_bounds_ymax_fp \l__getree_fanchart_bounds_xmax_fp
379 \fp_set:Nn \l__getree_fanchart_bounds_xmin_fp { - \l__getree_fanchart_bounds_xmax_fp }
380 \fp_set_eq:NN \l__getree_fanchart_bounds_ymin_fp \l__getree_fanchart_bounds_xmin_fp
381
382 \__getree_fanchart_bounds_fit:n { \l_getree_fanchart_minor_angle_tl }
383 \__getree_fanchart_bounds_fit:n { \l_getree_fanchart_major_angle_tl }
384 \fp_set:Nn \l__getree_fanchart_angle_fp { floor( \l_getree_fanchart_minor_angle_tl /90)*90+90 }
385 \fp_while_do:nNnn { \l__getree_fanchart_angle_fp } < { \l_getree_fanchart_major_angle_tl }
386 {
387 \__getree_fanchart_bounds_fit:n { \l__getree_fanchart_angle_fp }
388 \fp_set:Nn \l__getree_fanchart_angle_fp { \l__getree_fanchart_angle_fp +90 }
389 }
390
391 \pgfresetboundingbox
392 \path
393 ( \fp_to_dim:n { \l__getree_fanchart_bounds_xmin_fp - \l__getree_fanchart_bounds_border_fp },
394 \fp_to_dim:n { \l__getree_fanchart_bounds_ymin_fp - \l__getree_fanchart_bounds_border_fp } )
395 rectangle
396 ( \fp_to_dim:n { \l__getree_fanchart_bounds_xmax_fp + \l__getree_fanchart_bounds_border_fp },
397 \fp_to_dim:n { \l__getree_fanchart_bounds_ymax_fp + \l__getree_fanchart_bounds_border_fp } );
398 }
399
400
401 \cs_new_protected:Npn \__getree_fanchart:nn #1#2
402 {
403 \group_begin:
404 \cs_if_exist:NF \pgfpictureid
405 {
406 \gtr@error { \gtrfanchart \space ~outside~tikzpicture~environment }
407 { \gtrfanchart \space ~can~only~be~used~inside~a~tikzpicture~environment. }
408 }
409 \def\gtr@proc@@parent@end
410 {
411 \cs_if_exist:cF { gtr@fam@ \gtr@currentfamily @g }
412 {
413 \gtr@error{ No~g-node~in~parent~family~( \gtr@currentfamily ) } { Every~family~needs~a~g-node }
414 }
415 }
416 \def\gtr@positioning{}
417 \gtrset
418 {
419 phantom/.style =
420 { phantom* = {##1},
421 code =
422 {
423 \cs_if_exist:NT \gtr@currentperson
424 {
425 %\use:x
426 %{
427 % \exp_not:N\gappto\exp_not:N\gtrkv@after@parser{\exp_not:N\csundef{gtr@per@\gtr@currentperson @box}}
428 %}
429 \exp_args:NNx \gappto \gtrkv@after@parser
430 { \exp_not:N \csundef { gtr@per@ \gtr@currentperson @box } }
431 }
432 }
433 },
434 }
435 \gtr@reset@before@parser
436 \gtr@parsegraph
437 [
438 processing = database,
439 ignore~parent~childs,
440 box =
441 {
442 empty,
443 size = minimal,
444 boxsep = \tcbfitdim/10,
445 middle = \tcbfitdim/5,
446 halign = center,
447 valign = center,
448 before~upper = { \parskip = 0.1\tcbfitdim },
449 },
450 level/.prefix~code =
451 {
452 \int_compare:nNnT { ##1 } > { 5 }
453 {
454 \pgfkeysalso{ node = { list~separators = {\par} {~} {} {} } }
455 }
456 },
457 #1,
458 code = { \__getree_fanchart_segment_computation: }
459 ] {#2}
460 \gtrkv@after@parser
461 \fp_zero:N \l__getree_fanchart_bounds_xmax_fp
462 \__getree_fanchart_draw_family:nnnn { \gtr@num@fam@first } { 0 }
463 { \l_getree_fanchart_minor_angle_tl } { \l_getree_fanchart_major_angle_tl }
464 \bool_if:NT \l__getree_fanchart_reset_bounds_bool
465 {
466 \__getree_fanchart_reset_bounds:
467 }
468 \group_end:
469 }
470
471
472 \NewDocumentCommand \gtrfanchart { +O {} }
473 {
474 \__getree_fanchart:nn {#1}
475 }
476
477
478 \NewDocumentCommand \gtrfanchartinput { +O {} m }
479 {
480 \__getree_fanchart:nn {#1} { input {#2} }
481 }
482
483
484 %%%%%%%%%%%%%%%%%%%%%%%
485 %% Options
486 %%%%%%%%%%%%%%%%%%%%%%%
487
488
489 \cs_new_protected:Npn \__getree_fanchart_paper_fit:nn #1#2
490 {
491 \fp_set:Nn \l__getree_tmpa_fp {#1}
492 \fp_set:Nn \l__getree_tmpb_fp {#2}
493 \fp_compare:nNnTF { \l__getree_tmpa_fp } > { \l__getree_tmpb_fp }
494 {
495 \fp_compare:nNnTF { \l__getree_tmpb_fp } > { \l__getree_tmpa_fp /2 }
496 {
497 \fp_set:Nn \l__getree_tmpa_fp { 180+2*asind( 2* \l__getree_tmpb_fp / \l__getree_tmpa_fp - 1 ) }
498 \gtrset
499 {
500 fanchart~open~up = \l__getree_tmpa_fp,
501 fanchart~text~portrait = inwards
502 }
503 }
504 {
505 \gtrset
506 {
507 fanchart~open~up = 180,
508 fanchart~text~portrait = inwards
509 }
510 }
511 }
512 {
513 \fp_compare:nNnTF { \l__getree_tmpa_fp } > { \l__getree_tmpb_fp /2 }
514 {
515 \fp_set:Nn \l__getree_tmpa_fp { 180+2*asind( 2* \l__getree_tmpa_fp / \l__getree_tmpb_fp -1 ) }
516 \gtrset
517 {
518 fanchart~open~right = \l__getree_tmpa_fp,
519 fanchart~text~landscape = clockwise
520 }
521 }
522 {
523 \gtrset
524 {
525 fanchart~open~right = 180,
526 fanchart~text~landscape = clockwise
527 }
528 }
529 }
530 }
531
532
533 \gtrset{
534 fanchart~radii/.code =
535 {
536 \fparray_gzero:N \g__getree_fanchart_radii_fparray
537 \int_zero:N \l__getree_tmpa_int
538 \fp_zero:N \l__getree_tmpb_fp
539 \clist_map_inline:nn { #1 }
540 {
541 \int_incr:N \l__getree_tmpa_int
542 \fp_set:Nn \l__getree_tmpa_fp { ##1 }
543 \fp_add:Nn \l__getree_tmpb_fp { \l__getree_tmpa_fp }
544 \fparray_gset:Nnn \g__getree_fanchart_radii_fparray { \l__getree_tmpa_int } { \l__getree_tmpb_fp }
545 }
546 \int_step_inline:nnn { \l__getree_tmpa_int +1 } { \c_getree_fanchart_maximum_rings_tl }
547 {
548 \fp_add:Nn \l__getree_tmpb_fp { \l__getree_tmpa_fp }
549 \fparray_gset:Nnn \g__getree_fanchart_radii_fparray { ##1 } { \l__getree_tmpb_fp }
550 }
551 },
552 fanchart~inner~offset/.code =
553 {
554 \fparray_gzero:N \g__getree_fanchart_inner_fparray
555 \int_zero:N \l__getree_tmpa_int
556 \fp_zero:N \l__getree_tmpa_fp
557 \clist_map_inline:nn { #1 }
558 {
559 \int_incr:N \l__getree_tmpa_int
560 \fp_set:Nn \l__getree_tmpa_fp { ##1 }
561 \fparray_gset:Nnn \g__getree_fanchart_inner_fparray { \l__getree_tmpa_int } { \l__getree_tmpa_fp }
562 }
563 \int_step_inline:nnn { \l__getree_tmpa_int +1 } { \c_getree_fanchart_maximum_rings_tl }
564 {
565 \fp_add:Nn \l__getree_tmpb_fp { \l__getree_tmpa_fp }
566 \fparray_gset:Nnn \g__getree_fanchart_inner_fparray { ##1 } { \l__getree_tmpa_fp }
567 }
568 },
569 fanchart~outer~offset/.code =
570 {
571 \fparray_gzero:N \g__getree_fanchart_outer_fparray
572 \int_zero:N \l__getree_tmpa_int
573 \fp_zero:N \l__getree_tmpa_fp
574 \clist_map_inline:nn { #1 }
575 {
576 \int_incr:N \l__getree_tmpa_int
577 \fp_set:Nn \l__getree_tmpa_fp { ##1 }
578 \fparray_gset:Nnn \g__getree_fanchart_outer_fparray { \l__getree_tmpa_int } { \l__getree_tmpa_fp }
579 }
580 \int_step_inline:nnn { \l__getree_tmpa_int +1 } { \c_getree_fanchart_maximum_rings_tl }
581 {
582 \fp_add:Nn \l__getree_tmpb_fp { \l__getree_tmpa_fp }
583 \fparray_gset:Nnn \g__getree_fanchart_outer_fparray { ##1 } { \l__getree_tmpa_fp }
584 }
585 },
586 fanchart~minor~angle/.code = { \tl_set:Nx \l_getree_fanchart_minor_angle_tl { \fp_to_decimal:n {#1} } },
587 fanchart~major~angle/.code = { \tl_set:Nx \l_getree_fanchart_major_angle_tl { \fp_to_decimal:n {#1} } },
588 fanchart~open~up/.code =
589 {
590 \tl_set:Nx \l_getree_fanchart_minor_angle_tl { \fp_to_decimal:n { 90-(#1)/2 }}
591 \tl_set:Nx \l_getree_fanchart_major_angle_tl { \fp_to_decimal:n { 90+(#1)/2 }}
592 },
593 fanchart~open~up/.default = 220,
594 fanchart~open~left/.code =
595 {
596 \tl_set:Nx \l_getree_fanchart_minor_angle_tl { \fp_to_decimal:n { 180-(#1)/2 }}
597 \tl_set:Nx \l_getree_fanchart_major_angle_tl { \fp_to_decimal:n { 180+(#1)/2 }}
598 },
599 fanchart~open~left/.default = 160,
600 fanchart~open~right/.code =
601 {
602 \tl_set:Nx \l_getree_fanchart_minor_angle_tl { \fp_to_decimal:n { -(#1)/2 }}
603 \tl_set:Nx \l_getree_fanchart_major_angle_tl { \fp_to_decimal:n { (#1)/2 }}
604 },
605 fanchart~open~right/.default = 160,
606 fanchart~open~down/.code=
607 {
608 \tl_set:Nx \l_getree_fanchart_minor_angle_tl { \fp_to_decimal:n { 270-(#1)/2 }}
609 \tl_set:Nx \l_getree_fanchart_major_angle_tl { \fp_to_decimal:n { 270+(#1)/2 }}
610 },
611 fanchart~open~down/.default = 220,
612 fanchart~open~full/.style = { fanchart~open~right = 360 },
613 fanchart~open~for/.code~args = { #1x#2 } { \__getree_fanchart_paper_fit:nn {#1} {#2} },
614 fanchart~landscape~from~level/.code = { \tl_set:Nn \l__getree_fanchart_landscape_level_tl {#1} },
615 fanchart~text~portrait/.is~choice,
616 fanchart~text~portrait/.default = auto,
617 fanchart~text~portrait/auto/.code = \cs_set_eq:NN \__getree_fanchart_portrait_angle:nnn \use_i:nnn,
618 fanchart~text~portrait/inwards/.code = \cs_set_eq:NN \__getree_fanchart_portrait_angle:nnn \use_ii:nnn,
619 fanchart~text~portrait/outwards/.code = \cs_set_eq:NN \__getree_fanchart_portrait_angle:nnn \use_iii:nnn,
620 fanchart~text~landscape/.is~choice,
621 fanchart~text~landscape/.default = auto,
622 fanchart~text~landscape/auto/.code = \cs_set_eq:NN \__getree_fanchart_landscape_angle:nnn \use_i:nnn,
623 fanchart~text~landscape/clockwise/.code = \cs_set_eq:NN \__getree_fanchart_landscape_angle:nnn \use_ii:nnn,
624 fanchart~text~landscape/counterclockwise/.code = \cs_set_eq:NN \__getree_fanchart_landscape_angle:nnn \use_iii:nnn,
625 fanchart~boundary~color/.code = { \colorlet{ gtrfanchartboundary } {#1} },
626 fanchart~boundary~width/.code =
627 {
628 \fp_set:Nn \l__getree_fanchart_boundary_width_fp {#1}
629 \fp_set:Nn \l__getree_fanchart_boundary_scale_fp { min( 5, \l__getree_fanchart_boundary_width_fp /0.4pt ) }
630 },
631 fanchart~male~style/.code = { \tikzset{ gtr@fanchart@male@style/.style = {#1} }},
632 fanchart~female~style/.code = { \tikzset{ gtr@fanchart@female@style/.style = {#1} }},
633 fanchart~neuter~style/.code = { \tikzset{ gtr@fanchart@neuter@style/.style = {#1} }},
634 fanchart~ancestor~style/.code = { \tikzset{ gtr@fanchart@ancestor@style/.style = {#1} }},
635 fanchart~descendant~style/.code = { \tikzset{ gtr@fanchart@descendant@style/.style = {#1} }},
636 fanchart~sibling~style/.code = { \tikzset{ gtr@fanchart@sibling@style/.style = {#1} }},
637 fanchart~unrelated~style/.code = { \tikzset{ gtr@fanchart@unrelated@style/.style = {#1} }},
638 fanchart~reset~bounds/.is~choice,
639 fanchart~reset~bounds/.default = true,
640 fanchart~reset~bounds/true/.code = { \bool_set_true:N \l__getree_fanchart_reset_bounds_bool },
641 fanchart~reset~bounds/false/.code = { \bool_set_false:N \l__getree_fanchart_reset_bounds_bool },
642 fanchart~bounds~border/.code = { \fp_set:Nn \l__getree_fanchart_bounds_border_fp {#1} },
643 }
644
645
646 %%%%%%%%%%%%%%%%%%%%%%%
647 %% Segment Drawing
648 %%%%%%%%%%%%%%%%%%%%%%%
649
650
651 \cs_new:Npn \getree_fanchart_set_marker_style:n #1
652 {
653 \getree_fanchart_if_complemented_node:TF
654 {
655 \tikzset
656 {
657 gtr@fanchart@marker@style/.style =
658 {
659 #1,
660 gtr@fanchart/@mark@level@ \l_getree_fanchart_level_tl /.try,
661 gtr@fanchart@marker@complemented
662 }
663 }
664 }
665 {
666 \tikzset
667 {
668 gtr@fanchart@marker@style/.style =
669 {
670 #1,
671 gtr@fanchart/@mark@level@ \l_getree_fanchart_level_tl /.try,
672 gtr@fanchart/@mark@id@ \l_getree_fanchart_id_tl /.try
673 }
674 }
675 }
676 }
677
678 \cs_new:Npn \getree_fanchart_set_segment_style:n #1
679 {
680 \getree_fanchart_if_complemented_node:TF
681 {
682 \tikzset
683 {
684 gtr@fanchart@segment@style/.style =
685 {
686 #1,
687 gtr@fanchart/@seg@level@ \l_getree_fanchart_level_tl /.try,
688 gtr@fanchart@segment@complemented
689 }
690 }
691 }
692 {
693 \tikzset
694 {
695 gtr@fanchart@segment@style/.style =
696 {
697 #1,
698 gtr@fanchart/@seg@level@ \l_getree_fanchart_level_tl /.try,
699 gtr@fanchart/@seg@id@ \l_getree_fanchart_id_tl /.try
700 }
701 }
702 }
703 }
704
705
706 \cs_new:Npn \getree_fanchart_set_color_wave:n #1
707 {
708 \definecolor {#1} { rgb:wave } { \fp_to_decimal:n { 400 + (1- \l_getree_fanchart_ratio_tl )*360 } }
709 }
710
711
712 % customize by \def\rangetHsb
713 \cs_new:Npn \getree_fanchart_set_color_colorwheel:n #1
714 {
715 \definecolor {#1} { rgb:tHsb } { \fp_to_decimal:n { (1- \l_getree_fanchart_ratio_tl )*360 }, 1, 1 }
716 }
717
718 \cs_new:Npn \getree_fanchart_draw_path:n #1
719 {
720 \path[#1]
721 ( \l_getree_fanchart_angle_a_tl \c_colon_str \l_getree_fanchart_radius_a_tl )
722 arc ( \l_getree_fanchart_angle_a_tl \c_colon_str \l_getree_fanchart_angle_b_tl
723 \c_colon_str \l_getree_fanchart_radius_a_tl )
724 -- ( \l_getree_fanchart_angle_b_tl \c_colon_str \l_getree_fanchart_radius_b_tl )
725 arc ( \l_getree_fanchart_angle_b_tl \c_colon_str \l_getree_fanchart_angle_a_tl
726 \c_colon_str \l_getree_fanchart_radius_b_tl )
727 -- cycle;
728 }
729
730 \cs_new:Npn \getree_fanchart_draw_path:nnn #1#2#3
731 {
732 \tl_set:Nx \l__getree_fanchart_tmpa_tl { \fp_to_dim:n {#1} }
733 \tl_set:Nx \l__getree_fanchart_tmpb_tl { \fp_to_dim:n {#2} }
734 \path[#3]
735 ( \l_getree_fanchart_angle_a_tl \c_colon_str \l__getree_fanchart_tmpa_tl )
736 arc ( \l_getree_fanchart_angle_a_tl \c_colon_str \l_getree_fanchart_angle_b_tl
737 \c_colon_str \l__getree_fanchart_tmpa_tl )
738 -- ( \l_getree_fanchart_angle_b_tl \c_colon_str \l__getree_fanchart_tmpb_tl )
739 arc ( \l_getree_fanchart_angle_b_tl \c_colon_str \l_getree_fanchart_angle_a_tl
740 \c_colon_str \l__getree_fanchart_tmpb_tl )
741 -- cycle;
742 }
743
744
745 \cs_new:Npn \getree_fanchart_draw_segment_standard:
746 {
747 \fp_compare:nNnTF { \l_getree_fanchart_offset_b_tl } = { 0 }
748 {
749 \fp_compare:nNnTF { \l_getree_fanchart_offset_a_tl } = { 0 }
750 {
751 \getree_fanchart_draw_path:n
752 {
753 draw = gtrfanchartboundary,
754 line~width = \l_getree_fanchart_line_width_tl,
755 gtr@fanchart@segment@style
756 }
757 }
758 {
759 \getree_fanchart_draw_path:nnn
760 { \l_getree_fanchart_radius_a_tl + \l_getree_fanchart_offset_a_tl }
761 { \l_getree_fanchart_radius_b_tl }
762 {
763 draw = gtrfanchartboundary,
764 line~width = \l_getree_fanchart_line_width_tl,
765 gtr@fanchart@segment@style
766 }
767 }
768 }
769 {
770 \getree_fanchart_draw_path:nnn
771 { \l_getree_fanchart_radius_a_tl + \l_getree_fanchart_offset_a_tl }
772 { \l_getree_fanchart_radius_b_tl - \l_getree_fanchart_offset_b_tl }
773 {
774 gtr@fanchart@segment@style
775 }
776 \getree_fanchart_draw_path:nnn
777 { \l_getree_fanchart_radius_b_tl - \l_getree_fanchart_offset_b_tl }
778 { \l_getree_fanchart_radius_b_tl }
779 {
780 gtr@fanchart@marker@style
781 }
782 \getree_fanchart_draw_path:nnn
783 { \l_getree_fanchart_radius_a_tl + \l_getree_fanchart_offset_a_tl }
784 { \l_getree_fanchart_radius_b_tl }
785 {
786 draw = gtrfanchartboundary,
787 line~width = \l_getree_fanchart_line_width_tl
788 }
789 }
790 }
791
792
793 \cs_new:Npn \getree_fanchart_draw_root_style:n #1
794 {
795 \path
796 [
797 draw = gtrfanchartboundary,
798 line~width = \l_getree_fanchart_line_width_tl,
799 #1
800 ]
801 ( 0,0 ) circle[ radius = \l_getree_fanchart_radius_b_tl ];
802 }
803
804
805 \gtrset
806 {
807 fanchart-segment-code/.code=
808 {
809 \tl_set:Nn \l__getree_fanchart_draw_segment_code_tl { #1 }
810 },
811 fanchart-root-code/.code=
812 {
813 \tl_set:Nn \l__getree_fanchart_draw_root_code_tl { #1 }
814 },
815 fanchart-marker-definition/.code=
816 {
817 \tl_set:Nn \l__getree_fanchart_marker_definition_code_tl { #1 }
818 },
819 fanchart-segment-definition/.code=
820 {
821 \tl_set:Nn \l__getree_fanchart_segment_definition_code_tl {#1}
822 },
823 }
824
825 \tikzset
826 {
827 gtr~set~color~wave/.code = { \getree_fanchart_set_color_wave:n {#1} },
828 gtr~set~color~colorwheel/.code = { \getree_fanchart_set_color_colorwheel:n {#1} },
829 gtr~set~color~series/.code = { \colorlet{#1} { fanchart!![ \l_getree_fanchart_level_tl ] } },
830 }
831
832 \gtrset
833 {
834 fanchart-segment-code = { \getree_fanchart_draw_segment_standard: },
835
836 fanchart~root~style/.style =
837 {
838 fanchart-root-code = { \getree_fanchart_draw_root_style:n {#1} }
839 },
840 fanchart~root~malefemale/.style =
841 {
842 fanchart-root-code = { \getree_fanchart_draw_root_style:n { gtr@fanchart@ \gtrDBsex @style } }
843 },
844
845 fanchart~segment~style/.style =
846 {
847 fanchart-segment-definition = { \getree_fanchart_set_segment_style:n {#1} }
848 },
849 fanchart~segment~malefemale/.style =
850 {
851 fanchart~segment~style = { gtr@fanchart@ \gtrDBsex @style }
852 },
853 fanchart~segment~relation/.style =
854 {
855 fanchart~segment~style = { gtr@fanchart@ \gtrDBrelation @style }
856 },
857 fanchart~segment~wave/.style =
858 {
859 fanchart~segment~style =
860 {
861 gtr~set~color~wave = gtr@fanchart@segment,
862 top~color = gtr@fanchart@segment!20,
863 bottom~color = gtr@fanchart@segment!25
864 }
865 },
866 fanchart~segment~colorwheel/.style =
867 {
868 fanchart~segment~style =
869 {
870 gtr~set~color~colorwheel = gtr@fanchart@segment,
871 top~color = gtr@fanchart@segment!20,
872 bottom~color = gtr@fanchart@segment!25
873 }
874 },
875 fanchart~segment~radial/.style=
876 {
877 fanchart~segment~style =
878 {
879 gtr~set~color~series = gtr@fanchart@segment,
880 top~color = gtr@fanchart@segment!20,
881 bottom~color = gtr@fanchart@segment!25
882 }
883 },
884
885 fanchart~marker~style/.style =
886 {
887 fanchart-marker-definition = { \getree_fanchart_set_marker_style:n {#1} }
888 },
889 fanchart~marker~malefemale/.style =
890 {
891 fanchart~marker~style = { gtr@fanchart@ \gtrDBsex @style }
892 },
893 fanchart~marker~relation/.style =
894 {
895 fanchart~marker~style = { gtr@fanchart@ \gtrDBrelation @style }
896 },
897 fanchart~marker~wave/.style =
898 {
899 fanchart~marker~style =
900 {
901 gtr~set~color~wave = gtr@fanchart@marker,
902 fill = gtr@fanchart@marker
903 }
904 },
905 fanchart~marker~colorwheel/.style =
906 {
907 fanchart~marker~style =
908 {
909 gtr~set~color~colorwheel = gtr@fanchart@marker,
910 fill = gtr@fanchart@marker
911 }
912 },
913 fanchart~marker~radial/.style =
914 {
915 fanchart~marker~style =
916 {
917 gtr~set~color~series = gtr@fanchart@marker,
918 fill = gtr@fanchart@marker
919 }
920 },
921
922 fanchart~complemented~segment~style/.code =
923 {
924 \tikzset
925 {
926 gtr@fanchart@segment@complemented/.style = {#1}
927 }
928 },
929 fanchart~complemented~marker~style/.code =
930 {
931 \tikzset
932 {
933 gtr@fanchart@marker@complemented/.style = {#1}
934 }
935 },
936 %
937 fanchart~segment~style~for~levels/.code~2~args =
938 {
939 \clist_map_inline:nn { #1 }
940 {
941 \tikzset{ gtr@fanchart/@seg@level@##1/.style = {#2} }
942 }
943 },
944 fanchart~marker~style~for~levels/.code~2~args =
945 {
946 \clist_map_inline:nn { #1 }
947 {
948 \tikzset{ gtr@fanchart/@mark@level@##1/.style = {#2} }
949 }
950 },
951 fanchart~segment~style~for~ids/.code~2~args =
952 {
953 \clist_map_inline:nn { #1 }
954 {
955 \tikzset { gtr@fanchart/@seg@id@##1/.style = {#2} }
956 }
957 },
958 fanchart~marker~style~for~ids/.code~2~args =
959 {
960 \clist_map_inline:nn { #1 }
961 {
962 \tikzset{ gtr@fanchart/@mark@id@##1/.style = {#2} }
963 }
964 },
965 }
966
967 \ExplSyntaxOff
968
969
970 \gtrset{
971 fanchart angles/.style args={#1:#2}{fanchart minor angle=#1,fanchart major angle=#2},
972 }
973
974 \definecolorseries{fanchart}{rgb:hsb}{grad}[rgb:hsb]{.575,1,1}{.987,-.234,0}
975 \resetcolorseries[12]{fanchart}
976
977
978 %%%%%%%%%%%%%%%%%%%%%%%
979 %% Templates
980 %%%%%%%%%%%%%%%%%%%%%%%
981
982 \gtrset
983 {
984 fanchart template/.is choice,
985 %
986 fanchart template/spartan/.style=
987 {
988 fanchart inner offset={0mm},
989 fanchart outer offset={0mm},
990 fanchart boundary color=gray!50,
991 fanchart root style={fill=white},
992 fanchart segment style={fill=white},
993 empty name text={},
994 },
995 fanchart template/malefemale sober/.style=
996 {
997 fanchart inner offset={1mm},
998 fanchart outer offset={0mm},
999 fanchart boundary color=gray!50,
1000 fanchart root malefemale,
1001 fanchart segment malefemale,
1002 empty name text={},
1003 },
1004 fanchart template/malefemale relation/.style=
1005 {
1006 fanchart inner offset={1mm},
1007 fanchart outer offset={2mm},
1008 fanchart boundary color=gray!50,
1009 fanchart root malefemale,
1010 fanchart segment malefemale,
1011 fanchart marker relation,
1012 empty name text={},
1013 },
1014 fanchart template/colorwheel sober/.style=
1015 {
1016 fanchart inner offset={0mm},
1017 fanchart outer offset={2mm},
1018 fanchart boundary color=gray,
1019 fanchart root style={fill=white},
1020 fanchart segment style={fill=white},
1021 fanchart marker colorwheel,
1022 empty name text={},
1023 },
1024 fanchart template/colorwheel serious/.style=
1025 {
1026 fanchart inner offset={0mm},
1027 fanchart outer offset={2mm},
1028 fanchart boundary color=gray!50,
1029 fanchart root style={inner color=white,outer color=gray!4!white},
1030 fanchart segment style={top color=gray!1!white,bottom color=gray!4!white},
1031 fanchart marker colorwheel,
1032 empty name text={},
1033 },
1034 fanchart template/colorwheel malefemale/.style=
1035 {
1036 fanchart inner offset={1mm},
1037 fanchart outer offset={2mm},
1038 fanchart boundary color=gray!50,
1039 fanchart root malefemale,
1040 fanchart segment malefemale,
1041 fanchart marker colorwheel,
1042 empty name text={},
1043 },
1044 fanchart template/colorwheel rich/.style=
1045 {
1046 fanchart inner offset={1mm},
1047 fanchart outer offset={0mm},
1048 fanchart boundary color=white,
1049 fanchart root style={inner color=white,outer color=gray!15!white},
1050 fanchart segment colorwheel,
1051 empty name text={},
1052 },
1053 fanchart template/colorwheel opulent/.style=
1054 {
1055 fanchart inner offset={1mm},
1056 fanchart outer offset={2mm},
1057 fanchart boundary color=white,
1058 fanchart root style={inner color=white,outer color=gray!15!white},
1059 fanchart segment colorwheel,
1060 fanchart marker colorwheel,
1061 empty name text={},
1062 },
1063 %
1064 fanchart template/wave sober/.style=
1065 {
1066 fanchart inner offset={0mm},
1067 fanchart outer offset={2mm},
1068 fanchart boundary color=gray,
1069 fanchart root style={fill=white},
1070 fanchart segment style={fill=white},
1071 fanchart marker wave,
1072 empty name text={},
1073 },
1074 fanchart template/wave serious/.style=
1075 {
1076 fanchart inner offset={0mm},
1077 fanchart outer offset={2mm},
1078 fanchart boundary color=gray!50,
1079 fanchart root style={inner color=white,outer color=gray!4!white},
1080 fanchart segment style={top color=gray!1!white,bottom color=gray!4!white},
1081 fanchart marker wave,
1082 empty name text={},
1083 },
1084 fanchart template/wave malefemale/.style=
1085 {
1086 fanchart inner offset={1mm},
1087 fanchart outer offset={2mm},
1088 fanchart boundary color=gray!50,
1089 fanchart root malefemale,
1090 fanchart segment malefemale,
1091 fanchart marker wave,
1092 empty name text={},
1093 },
1094 fanchart template/wave rich/.style=
1095 {
1096 fanchart inner offset={1mm},
1097 fanchart outer offset={0mm},
1098 fanchart boundary color=white,
1099 fanchart root style={inner color=white,outer color=gray!15!white},
1100 fanchart segment wave,
1101 empty name text={},
1102 },
1103 fanchart template/wave opulent/.style=
1104 {
1105 fanchart inner offset={1mm},
1106 fanchart outer offset={2mm},
1107 fanchart boundary color=white,
1108 fanchart root style={inner color=white,outer color=gray!15!white},
1109 fanchart segment wave,
1110 fanchart marker wave,
1111 empty name text={},
1112 },
1113 fanchart template/radial sober/.style=
1114 {
1115 fanchart inner offset={0mm},
1116 fanchart outer offset={2mm},
1117 fanchart boundary color=gray,
1118 fanchart root style={fill=white},
1119 fanchart segment style={fill=white},
1120 fanchart marker radial,
1121 empty name text={},
1122 },
1123 fanchart template/radial serious/.style=
1124 {
1125 fanchart inner offset={0mm},
1126 fanchart outer offset={2mm},
1127 fanchart boundary color=gray!50,
1128 fanchart root style={inner color=white,outer color=gray!4!white},
1129 fanchart segment style={top color=gray!1!white,bottom color=gray!4!white},
1130 fanchart marker radial,
1131 empty name text={},
1132 },
1133 fanchart template/radial malefemale/.style=
1134 {
1135 fanchart inner offset={1mm},
1136 fanchart outer offset={2mm},
1137 fanchart boundary color=gray!50,
1138 fanchart root malefemale,
1139 fanchart segment malefemale,
1140 fanchart marker radial,
1141 empty name text={},
1142 },
1143 fanchart template/radial rich/.style=
1144 {
1145 fanchart inner offset={1mm},
1146 fanchart outer offset={0mm},
1147 fanchart boundary color=white,
1148 fanchart root style={inner color=white,outer color=gray!15!white},
1149 fanchart segment radial,
1150 empty name text={},
1151 },
1152 fanchart template/radial opulent/.style=
1153 {
1154 fanchart inner offset={1mm},
1155 fanchart outer offset={2mm},
1156 fanchart boundary color=white,
1157 fanchart root style={inner color=white,outer color=gray!15!white},
1158 fanchart segment radial,
1159 fanchart marker radial,
1160 empty name text={},
1161 },
1162 }
1163
1164
1165 %%%%%%%%%%%%%%%%%%%%%%%
1166 %% Presets
1167 %%%%%%%%%%%%%%%%%%%%%%%
1168
1169 \gtrset{
1170 fanchart radii={2.5cm,3.5cm,3cm},
1171 fanchart inner offset={0mm},
1172 fanchart outer offset={0mm},
1173 fanchart open up=220,
1174 fanchart landscape from level=5,
1175 fanchart text portrait=auto,
1176 fanchart text landscape=auto,
1177 fanchart boundary color=gray!50,
1178 fanchart boundary width=0.4pt,
1179 fanchart male style={top color=blue!1!white,bottom color=blue!6!white},
1180 fanchart female style={top color=red!1!white,bottom color=red!6!white},
1181 fanchart neuter style={top color=gray!1!white,bottom color=gray!6!white},
1182 fanchart ancestor style={fill=red!50!gray!50},
1183 fanchart descendant style={fill=red!50!gray!50},
1184 fanchart sibling style={fill=blue!50!gray!50},
1185 fanchart unrelated style={fill=gray!15},
1186 fanchart segment malefemale,
1187 fanchart root malefemale,
1188 fanchart marker style={fill=gtrfanchartboundary!50!white},
1189 fanchart complemented segment style=,
1190 fanchart complemented marker style=,
1191 fanchart reset bounds,
1192 fanchart bounds border=0.2pt,
1193 }
1194
1195