aboutsummaryrefslogtreecommitdiff
path: root/tex/src/figure-tools-per-year.tex
blob: 738cdaddc08e5e4f8c4f3ca8d7fca638ec9c1048 (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
% All macros commented
\newcommand{\paperpdf}{}              %  1
\newcommand{\papertex}{}              %  2
\newcommand{\projecttex}{}            %  3
\newcommand{\verifytex}{}             %  4
\newcommand{\demoplottex}{}           %  5
\newcommand{\toolsperyear}{}          %  6
\newcommand{\tablethree}{}            %  7
\newcommand{\menkexlsx}{}             %  8
\newcommand{\inputsconf}{}            %  9
\newcommand{\downloadtex}{}           % 10
\newcommand{\formattex}{}             % 11
\newcommand{\demoyearconf}{}          % 12
\newcommand{\initializetex}{}         % 13
\newcommand{\expandingproject}{}      % 14



\begin{tikzpicture}

  %% These white lines are only relevant when we want to add boxes in
  %% multiple figures (for example to build slides). They are used to fix
  %% the vertical position of the boxs in the figure so it doesn't change
  %% as we add more boxes.
  \draw [white] (-9cm,0) -- (9cm,0);
  \draw [white] (0,-5cm) -- (0,4cm);

  %% Right-side Y axis (red, logarithmic histogram). This should be created
  %% under the line, because the line doesn't interfere with interpretting
  %% the histogram, but the inverse is not true.
  \begin{axis}[
      ymode=log,
      width=5cm,
      height=5cm,
      axis on top,
      axis x line=none,
      axis y line*=right,
      at={(-7.4cm,-1.8cm)},
      enlarge x limits = false,
      ylabel={Num. papers (red, log-scale)},
      max space between ticks=20,
    ]
    \addplot+ [ybar, mark=none, fill=red!40!white, red!40!white]
    table [x index=0, y index=2] {tex/build/to-publish/tools-per-year.txt};
  \end{axis}

  %% Left-side Y axis (green, linear/percent line).
  \begin{axis}[
      ymin=0,
      ymax=100,
      width=5cm,
      height=5cm,
      xlabel={Year},
      axis y line*=left,
      at={(-7.4cm,-1.8cm)},
      enlarge x limits = false,
      ylabel={Frac. papers with tools (green)},
      yticklabel=\pgfmathprintnumber{\tick}\,\%,
      x tick label style={/pgf/number format/1000 sep=},
    ]

    %% Linear plot, showing the number of papers mentioning tools.
    \addplot+ [mark=none, ultra thick, green!60!black]
    table {tex/build/to-publish/tools-per-year.txt};
  \end{axis}

  %% Use small fonts for the rest.
  \scriptsize

  %% top-make.mk
  \node [rectangle,
         very thick,
         text centered,
         font=\ttfamily,
         text width=2.8cm,
         anchor=north west,
         at={(-2.6cm,3.5cm)},
         minimum width=11.6cm,
         minimum height=7.25cm,
         draw=green!50!black!50,
         fill=black!10!green!2!white,
         label={[shift={(0,-5mm)}]\texttt{top-make.mk}}] {};

  %% verify.mk
  \node [at={(-0.7cm,-2.9cm)},
         thick,
         rectangle,
         text centered,
         font=\ttfamily,
         text width=2.45cm,
         minimum width=3.5cm,
         minimum height=1.3cm,
         draw=green!50!black!50,
         fill=black!10!green!12!white,
         label={[shift={(1cm,-5mm)}]\texttt{verify.mk}}] {};

  %% Paper.mk
  \node [at={(5.35cm,-2.9cm)},
         thick,
         rectangle,
         text centered,
         text width=2.8cm,
         minimum width=7cm,
         minimum height=1.3cm,
         draw=green!50!black!50,
         fill=black!10!green!12!white,
         font=\ttfamily,
         label={[shift={(0,-5mm)}]\texttt{paper.mk}}] {};

  %% Work-horse Makefiles, the X axis value of the files is the same. The Y
  %% axis values range like this:
  %%      2.1cm
  %%      1.3cm
  %%      0.5cm
  %%     -0.4cm
  %%     -1.3cm
  \node [node-makefile, at={(-1.4cm,3cm)},
        label={[shift={(0,-5mm)}]\texttt{initialize.mk}}] {};
  \node [node-makefile, at={(0.9cm,3cm)},
        label={[shift={(0,-5mm)}]\texttt{download.mk}}] {};
  \node [node-makefile, at={(3.2cm,3cm)},
        label={[shift={(0,-5mm)}]\texttt{format.mk}}] {};
  \node [node-makefile, at={(5.5cm,3cm)},
        label={[shift={(0,-5mm)}]\texttt{demo-plot.mk}}] {};

  %% paper.pdf
  \ifdefined\paperpdf
  \node (paperpdf) [node-terminal, at={(7.8cm,-3cm)}] {paper.pdf};
  \fi

  %% paper.tex and references.tex
  \ifdefined\papertex
  \node (reftex) [node-nonterminal, at={(5.5cm,-3.9cm)}] {references.tex};
  \node (papertex) [node-nonterminal, at={(7.8cm,-3.9cm)}] {paper.tex};
  \node (papertex-north) [node-point, at={(7.8cm,-3.65cm)}] {};
  \draw [rounded corners, black!50, line width=1.5pt] (reftex) |- (papertex-north);
  \draw [->, black!50, line width=1.5pt] (papertex) -- (paperpdf);
  \fi

  %% project.tex
  \ifdefined\projecttex
  \node (projecttex) [node-terminal, at={(3.2cm,-3cm)}] {project.tex};
  \draw [->, black!50, line width=1.5pt] (projecttex) -- (paperpdf);
  \fi

  %% verify.tex
  \ifdefined\verifytex
  \node (verifytex) [node-terminal, at={(-1.4cm,-3cm)}] {verify.tex};
  \draw [->, black!50, line width=1.5pt] (verifytex) -- (projecttex);
  \fi

  %% demo-plot.tex
  \ifdefined\demoplottex
  \node (initialize-south) [node-point, at={(-1.4cm,-2cm)}] {};
  \node (verifytop) [node-point, at={(-1.4cm,-2.75cm)}] {};
  \node (dptex) [node-terminal, at={(5.5cm,-1.3cm)}] {demo-plot.tex};
  \draw [rounded corners, ->, black!50, line width=1.5pt]
        (dptex) |- (initialize-south) |- (verifytop);
  \fi

  %% tools-per-year.txt
  \ifdefined\toolsperyear
  \node (tpyear) [node-terminal, at={(5.5cm,-0.4cm)}] {tools-per-\\year.txt};
  \draw [->, black!50, line width=1.5pt] (tpyear) -- (dptex);
  \fi

  %% table-3.txt
  \ifdefined\tablethree
  \node (tabthree) [node-terminal, at={(3.2cm,0.5cm)}] {table-3.txt};
  \draw [rounded corners, ->, black!50, line width=1.5pt] (tabthree) |- (tpyear);
  \fi

  %% menkexlsx
  \ifdefined\menkexlsx
  \node (xlsx) [node-terminal, at={(0.9cm,1.3cm)}] {menke20.xlsx};
  \draw [->, rounded corners, black!50, line width=1.5pt] (xlsx) |- (tabthree);
  \fi

  %% INPUTS.conf
  \ifdefined\inputsconf
  \node (INPUTS) [node-nonterminal, at={(0.9cm,4cm)}] {INPUTS.conf};
  \node (xlsx-west) [node-point, at={(-0.25cm,1.37cm)}] {};
  \draw [->,rounded corners, black!50, line width=1.5pt]
        (INPUTS.west) -| (xlsx-west) |- (xlsx);
  \fi

  %% download.tex
  \ifdefined\downloadtex
  \node (downloadtex) [node-terminal, at={(0.9cm,-1.3cm)}] {download.tex};
  \node (downloadtex-west) [node-point, at={(-0.25cm,-1.25cm)}] {};
  \draw [->,rounded corners, black!50, line width=1.5pt]
        (INPUTS.west) -| (downloadtex-west) |- (downloadtex);
  \draw [rounded corners, -, black!50, line width=1.5pt]
        (downloadtex) |- (initialize-south);
  \fi

  %% format.tex
  \ifdefined\formattex
  \node (fmttex) [node-terminal, at={(3.2cm,-1.3cm)}] {format.tex};
  \draw [->, black!50, line width=1.5pt] (tabthree) -- (fmttex);
  \draw [rounded corners, -, black!50, line width=1.5pt]
        (fmttex) |- (initialize-south);
  \fi

  %% demo-year.conf
  \ifdefined\demoyearconf
  \node (dyearconf) [node-nonterminal, at={(5.5cm,4cm)}] {demo-year.conf};
  \node (dptex-west) [node-point, at={(4.35cm,-1.25cm)}] {};
  \draw [->,rounded corners, black!50, line width=1.5pt]
        (dyearconf.west) -| (dptex-west) |- (dptex);
  \fi

  %% Initialize.tex
  \ifdefined\initializetex
  \node (initializetex) [node-terminal, at={(-1.4cm,-1.3cm)}] {initialize.tex};
  \draw [->, black!50, line width=1.5pt] (initializetex) -- (verifytex);
  \node [anchor=west, at={(-2.4cm,1.5cm)}] {Basic project info};
  \node [anchor=west, at={(-2.4cm,1.2cm)}] {(e.g., Git commit).};
  \node [anchor=west, at={(-2.4cm,0.5cm)}] {Also defines};
  \node [anchor=west, at={(-2.4cm,0.2cm)}] {project structure};
  \node [anchor=west, at={(-2.4cm,-0.1cm)}] {(for \texttt{*.mk} files).};
  \fi

  %% Expanding project
  \ifdefined\expandingproject

    %% The Makefile.
    \node [node-makefile, dotted, at={(7.8cm,3cm)},
          label={[shift={(0,-5mm)}]\texttt{next-step.mk}}] {};

    %% next-step.tex
    \node [dotted] (a3tex) [node-terminal, at={(7.8cm,-1.3cm)}] {next-step.tex};
    \draw [dotted, rounded corners, -, black!50, line width=1.4pt]
          (a3tex) |- (initialize-south);

    % out-3a.dat and out-3b.dat
    \node [dotted] (out3a) [node-terminal, at={(7.8cm,2.1cm)}] {out-a.dat};
    \node [dotted] (out3b) [node-terminal, at={(7.8cm,0.5cm)}] {out-b.dat};
    \node (a3tex-east) [node-point, at={(8.93cm,-0.8cm)}] {};
    \draw [dotted, ->, rounded corners, black!50, line width=1.5pt]
          (out3a.east) -| (a3tex-east) |- (a3tex);
    \draw [dotted, ->, black!50, line width=1.5pt] (out3b) -- (a3tex);

    %% demo-out.dat
    \node [dotted] (dout) [node-terminal, at={(5.5cm,1.3cm)}] {demo-out.dat};
    \draw [dotted, rounded corners, ->, black!50, line width=1.5pt] (dout.south) |- (out3b);

    %% links
    \node (dout-west) [node-point, at={(5cm,1.3cm)}] {};
    \draw [dotted, ->, black!50, line width=1.5pt] (xlsx) -- (dout);
    \node [opacity=0.7] (out3a-west) [node-point, at={(6.65cm,2.1cm)}] {};
    \draw [dotted, ->, rounded corners, black!50, line width=1.5pt] (xlsx) |- (out3a);
    \node [dotted] (a3conf1) [node-nonterminal, at={(7.8cm,4cm)}]  {param.conf};
    \draw [dotted, rounded corners, black!50, line width=1.5pt]
          (a3conf1.west) -| (out3a-west) |- (out3a);
  \fi

\end{tikzpicture}