summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/smartdiagram/smartdiagramlibrarycore.definitions.code.tex
blob: 0b108b23ceda39290eb5930fc12e71f2170306c9 (plain)
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
%%
%% This is file `smartdiagramlibrarycore.definitions.code.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% smartdiagram.dtx  (with options: `definitions')
%% * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
%% smartdiagram --- Automatic creation of smart diagrams from lists of items.
%% 
%% E-mail: claudio <dot> fiandrino <at> gmail <dot> com
%% 
%% Released under the LaTeX Project Public License v1.3c or later
%% See http://www.latex-project.org/lppl.txt
%% * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
%% 

\@namedef{color@1}{red!40}
\@namedef{color@2}{cyan!40}
\@namedef{color@3}{blue!40}
\@namedef{color@4}{green!40}
\@namedef{color@5}{orange!40}
\@namedef{color@6}{yellow!40}
\@namedef{color@7}{magenta!40}
\@namedef{color@8}{brown!40}
\@namedef{color@9}{violet!40}
\@namedef{color@10}{teal!40}
\tikzset{rnd rectangle/.style={rectangle,rounded corners}
}

\def\CalcHeight(#1,#2)#3{%
\pgfpointdiff{\pgfpointanchor{#1}{south west}}{\pgfpointanchor{#2}{north west}}
\pgfmathsetmacro{\myheight}{veclen(\pgf@x,\pgf@y)}
\global\expandafter\edef\csname #3\endcsname{\myheight}
}
\pgfkeys{/smart diagram/.cd, module minimum width/.initial=2cm,
   module minimum height/.initial={1cm},
   module y sep/.initial={1.65},
   module x sep/.initial={2.75},
   descriptive items y sep/.initial={1.75},
   text width/.initial={1.5cm},
   description title width/.initial={1.5cm},
   description text width/.initial={5cm},
   description title text width/.initial={1.25cm},
   description title font/.initial={\small},
   description font/.initial={\small},
   description width/.initial={5.5cm},
   font/.initial={\small},
   border color/.initial={gray},
   circular distance/.initial={2.75cm},
   arrow line width/.initial={0.1cm},
   module shape/.initial={rnd rectangle},
   insert decoration/.initial={},
   arrow tip/.initial={stealth},
   arrow color/.initial={gray},
   bubble center node size/.initial={4cm},
   bubble center node font/.initial={\large},
   bubble center node color/.initial={lightgray!60},
   distance center/other bubbles/.initial=0.8cm,
   distance text center bubble/.initial={0.5cm},
   bubble fill opacity/.initial={0.5},
   bubble node size/.initial={2.5cm},
   bubble text opacity/.initial={0.8},
   bubble node font/.initial={\normalfont},
   planet size/.initial={2.5cm},
   planet color/.initial={lightgray!60},
   planet font/.initial={\large},
   distance planet-connection/.initial={0.1cm},
   distance planet-text/.initial={0.5cm},
   planet text width/.initial={1.75cm},
   satellite size/.initial={1.75cm},
   satellite font/.initial={\normalfont},
   satellite fill opacity/.initial={0.5},
   satellite text opacity/.initial={0.8},
   satellite text width/.initial={1.5cm},
   distance satellite-connection/.initial={0.075cm},
   connection line width/.initial={0.1cm},
   connection color/.initial={gray},
   distance planet-satellite/.initial={3.5cm},
   priority arrow width/.initial={1.5cm},
   priority arrow head extend/.initial={0.15cm},
   priority tick size/.initial={5pt},
   priority arrow height advance/.initial={2cm},
   sequence item height/.initial={1cm},
   sequence item width/.initial={2cm},
   sequence item border color/.initial={gray},
   sequence item border size/.initial={1.75\pgflinewidth},
   sequence item font size/.initial={\normalfont},
   sequence item fill opacity/.initial={1},
   sequence item text opacity/.initial={1},
   sequence item text width/.initial={1.9cm},
   sequence item text color/.initial={black},
   sequence item uniform color/.initial={gray!60!black},
   arrow style/.initial={<-},
   text color/.initial={black},
   back arrow distance/.initial={0.5},
}%

\pgfkeys{/smart diagram/.cd, module minimum width/.get=\sm@core@modulewidth,
   module minimum height/.get=\sm@core@moduleheight,
   module y sep/.get=\sm@core@moduleysep,
   module x sep/.get=\sm@core@modulexsep,
   descriptive items y sep/.get=\sm@core@descriptiveitemsysep,
   text width/.get=\sm@core@moduletextwidth,
   description title width/.get=\sm@core@descriptiontitlewidth,
   description text width/.get=\sm@core@descriptiontextwidth,
   description title text width/.get=\sm@core@descriptiontitletextwidth,
   description title font/.get=\sm@core@descriptiontitlefontsize,
   description font/.get=\sm@core@descriptionfontsize,
   description width/.get=\sm@core@descriptionwidth,
   font/.get=\sm@core@modulefontsize,
   border color/.get=\sm@core@bordercolor,
   circular distance/.get=\sm@core@circulardistance,
   arrow line width/.get=\sm@core@arrowlinewidth,
   module shape/.get=\sm@core@moduleshape,
   insert decoration/.get=\sm@core@borderdecoration,
   arrow tip/.get=\sm@core@arrowtip,
   arrow color/.get=\sm@core@arrowcolor,
   bubble center node size/.get=\sm@core@bubblecenternodesize,
   bubble center node font/.get=\sm@core@bubblecenternodefont,
   bubble center node color/.get=\sm@core@bubblecenternodecolor,
   distance center/other bubbles/.get=\sm@core@distancecenterotherbubbles,
   distance text center bubble/.get=\sm@core@distancetextcenterbubble,
   bubble fill opacity/.get=\sm@core@bubblefillopacity,
   bubble node size/.get=\sm@core@bubblenodesize,
   bubble text opacity/.get=\sm@core@bubbletextopacity,
   bubble node font/.get=\sm@core@bubblenodefont,
   planet size/.get=\sm@core@planetminimumsize,
   planet color/.get=\sm@core@planetcolor,
   planet font/.get=\sm@core@planetfont,
   distance planet-connection/.get=\sm@core@planetoutersep,
   distance planet-text/.get=\sm@core@planetinnersep,
   planet text width/.get=\sm@core@planettextwidth,
   satellite size/.get=\sm@core@satelliteminimumsize,
   satellite font/.get=\sm@core@satellitefont,
   satellite fill opacity/.get=\sm@core@satellitefillopacity,
   satellite text opacity/.get=\sm@core@satellitetextopacity,
   satellite text width/.get=\sm@core@satellitetextwidth,
   distance satellite-connection/.get=\sm@core@satelliteoutersep,
   connection line width/.get=\sm@core@connectionlinewidth,
   connection color/.get=\sm@core@connectioncolor,
   distance planet-satellite/.get=\sm@core@distanceplanetsatellite,
   priority arrow width/.get=\sm@core@priorityarrowwidth,
   priority arrow head extend/.get=\sm@core@priorityarrowheadextend,
   priority tick size/.get=\sm@core@prioritytick,
   priority arrow height advance/.get=\sm@core@priorityarrowheightadvance,
   sequence item height/.get=\sm@core@seqitemheight,
   sequence item width/.get=\sm@core@seqitemwidth,
   sequence item border color/.get=\sm@core@seqitembordercolor,
   sequence item border size/.get=\sm@core@seqlinewidth,
   sequence item font size/.get=\sm@core@seqitemfont,
   sequence item fill opacity/.get=\sm@core@seqitemfillopacity,
   sequence item text opacity/.get=\sm@core@seqitemtextopacity,
   sequence item text width/.get=\sm@core@seqitemtextwidth,
   sequence item text color/.get=\sm@core@seqitemtextcolor,
   sequence item uniform color/.get=\sm@core@seqitemuniformcol,
   arrow style/.get=\sm@core@arrowstyle,
   text color/.get=\sm@core@textcolor,
   back arrow distance/.get=\sm@core@backarrowdistance,
}%
\pgfkeys{/smart diagram/.cd, set color list/.code={
      \foreach \listitem [count=\i] in {#1}{
         \global\@namedef{color@\i\expandafter}\expandafter{\listitem}
      }
   }
}

\pgfkeys{/smart diagram/.cd, uniform color list/.code args={#1 for #2 items}{
      \foreach \listitem [count=\i] in {1,...,#2}{
         \global\@namedef{color@\i\expandafter}\expandafter{#1}
      }
   }
}

\pgfkeys{/smart diagram/.cd, use predefined color list/.code={
      \@namedef{color@1}{red!30}
      \@namedef{color@2}{cyan!30}
      \@namedef{color@3}{blue!30}
      \@namedef{color@4}{green!30}
      \@namedef{color@5}{orange!30}
      \@namedef{color@6}{yellow!30}
      \@namedef{color@7}{magenta!30}
      \@namedef{color@8}{brown!30}
      \@namedef{color@9}{violet!30}
      \@namedef{color@10}{teal!30}
   }
}
\newif\ifbackarrowdisabled
\pgfkeys{/smart diagram/.cd,
  back arrow disabled/.is if=backarrowdisabled,
  back arrow disabled=false,
}
\newif\ifcircularfinalarrowdisabled
\pgfkeys{/smart diagram/.cd,
  circular final arrow disabled/.is if=circularfinalarrowdisabled,
  circular final arrow disabled=false,
}
\NewDocumentCommand{\smartdiagramset}{m}{%
  \pgfkeys{/smart diagram/.cd,#1}%
  \pgfkeys{/smart diagram/.cd, module minimum width/.get=\sm@core@modulewidth,
   module minimum height/.get=\sm@core@moduleheight,
   module y sep/.get=\sm@core@moduleysep,
   module x sep/.get=\sm@core@modulexsep,
   descriptive items y sep/.get=\sm@core@descriptiveitemsysep,
   text width/.get=\sm@core@moduletextwidth,
   description title width/.get=\sm@core@descriptiontitlewidth,
   description text width/.get=\sm@core@descriptiontextwidth,
   description title text width/.get=\sm@core@descriptiontitletextwidth,
   description title font/.get=\sm@core@descriptiontitlefontsize,
   description font/.get=\sm@core@descriptionfontsize,
   description width/.get=\sm@core@descriptionwidth,
   font/.get=\sm@core@modulefontsize,
   border color/.get=\sm@core@bordercolor,
   circular distance/.get=\sm@core@circulardistance,
   arrow line width/.get=\sm@core@arrowlinewidth,
   module shape/.get=\sm@core@moduleshape,
   insert decoration/.get=\sm@core@borderdecoration,
   arrow tip/.get=\sm@core@arrowtip,
   arrow color/.get=\sm@core@arrowcolor,
   bubble center node size/.get=\sm@core@bubblecenternodesize,
   bubble center node font/.get=\sm@core@bubblecenternodefont,
   bubble center node color/.get=\sm@core@bubblecenternodecolor,
   distance center/other bubbles/.get=\sm@core@distancecenterotherbubbles,
   distance text center bubble/.get=\sm@core@distancetextcenterbubble,
   bubble fill opacity/.get=\sm@core@bubblefillopacity,
   bubble node size/.get=\sm@core@bubblenodesize,
   bubble text opacity/.get=\sm@core@bubbletextopacity,
   bubble node font/.get=\sm@core@bubblenodefont,
   planet size/.get=\sm@core@planetminimumsize,
   planet color/.get=\sm@core@planetcolor,
   planet font/.get=\sm@core@planetfont,
   distance planet-connection/.get=\sm@core@planetoutersep,
   distance planet-text/.get=\sm@core@planetinnersep,
   planet text width/.get=\sm@core@planettextwidth,
   satellite size/.get=\sm@core@satelliteminimumsize,
   satellite font/.get=\sm@core@satellitefont,
   satellite fill opacity/.get=\sm@core@satellitefillopacity,
   satellite text opacity/.get=\sm@core@satellitetextopacity,
   satellite text width/.get=\sm@core@satellitetextwidth,
   distance satellite-connection/.get=\sm@core@satelliteoutersep,
   connection line width/.get=\sm@core@connectionlinewidth,
   connection color/.get=\sm@core@connectioncolor,
   distance planet-satellite/.get=\sm@core@distanceplanetsatellite,
   priority arrow width/.get=\sm@core@priorityarrowwidth,
   priority arrow head extend/.get=\sm@core@priorityarrowheadextend,
   priority tick size/.get=\sm@core@prioritytick,
   priority arrow height advance/.get=\sm@core@priorityarrowheightadvance,
   sequence item height/.get=\sm@core@seqitemheight,
   sequence item width/.get=\sm@core@seqitemwidth,
   sequence item border color/.get=\sm@core@seqitembordercolor,
   sequence item border size/.get=\sm@core@seqlinewidth,
   sequence item font size/.get=\sm@core@seqitemfont,
   sequence item fill opacity/.get=\sm@core@seqitemfillopacity,
   sequence item text opacity/.get=\sm@core@seqitemtextopacity,
   sequence item text width/.get=\sm@core@seqitemtextwidth,
   sequence item text color/.get=\sm@core@seqitemtextcolor,
   sequence item uniform color/.get=\sm@core@seqitemuniformcol,
   arrow style/.get=\sm@core@arrowstyle,
   text color/.get=\sm@core@textcolor,
   back arrow distance/.get=\sm@core@backarrowdistance,
  }%
}%
\pgfkeys{/smart diagram/.cd,%
    uniform sequence color/.is choice,%
    uniform sequence color/true/.code={%
      \tikzset{sequence item/.append style={
         fill=\sm@core@seqitemuniformcol,
         },
       }
    },%
    uniform sequence color/false/.style={sequence item},%
    uniform sequence color/.default=false,
}%
\pgfkeys{/smart diagram/.cd,%
      uniform connection color/.is choice,%
      uniform connection color/true/.code={%
        \tikzset{connection planet satellite/.append style={
           \sm@core@connectioncolor
           },
        }
      },%
      uniform connection color/false/.style={connection planet satellite},%
    uniform connection color/.default=false,
}%
\pgfkeys{/smart diagram/.cd,%
      uniform arrow color/.is choice,%
      uniform arrow color/true/.code={%
        \tikzset{diagram arrow type/.append style={
           \sm@core@arrowcolor
           },
        }
      },%
      uniform arrow color/false/.style={diagram arrow type},%
    uniform arrow color/.default=false,
}%


%% 
%% Copyright (C) 2012-2013 by Claudio Fiandrino
%% E-mail: <claudio <dot> fiandrino <at> gmail <dot> com>
%% 
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License (LPPL), either
%% version 1.3c of this license or (at your option) any later
%% version.  The latest version of this license is in the file:
%% 
%% http://www.latex-project.org/lppl.txt
%% 
%% This work is "maintained" (as per LPPL maintenance status) by
%% Claudio Fiandrino.
%% 
%% This work consists of the file  smartdiagram.dtx
%% and the derived files           smartdiagram.ins,
%%                                 smartdiagram.pdf,
%%                                 smartdiagramlibrarycore.definitions.code.tex,
%%                                 smartdiagramlibrarycore.styles.code.tex,
%%                                 smartdiagramlibrarycore.commands.code.tex
%%                                 smartdiagramlibraryadditions.code.tex and
%%                                 smartdiagram.sty.
%% 
%%
%% End of file `smartdiagramlibrarycore.definitions.code.tex'.