@@ -16,7 +16,7 @@ library (lubridate)
16
16
This page includes several graphs providing insight into the historical
17
17
development of the package.
18
18
19
- ### Data on individual functions
19
+ ## Data on individual functions
20
20
21
21
This plot shows time series for the development of the following measures for each function in the package:
22
22
@@ -50,7 +50,7 @@ stats <- tidyr::pivot_longer (stats, c ("doclines", "npars", "loc", "ext_calls")
50
50
``` {r ojs-in-stats, echo = FALSE}
51
51
ojs_define (stats_in = stats)
52
52
```
53
- ``` {ojs stats-transpose}
53
+ ``` {ojs stats-transpose-and-filter }
54
54
stats = {
55
55
return transpose(stats_in).map(row => ({
56
56
...row,
@@ -136,3 +136,98 @@ Plot.plot({
136
136
]
137
137
})
138
138
```
139
+
140
+ ## General data
141
+
142
+ This plot shows some general data.
143
+
144
+ ``` {r desc-data}
145
+ cols <- names (dat$desc_data) [which (!names (dat$desc_data) %in% c ("package"))]
146
+ desc <- dat$desc_data [, cols]
147
+ desc$date <- lubridate::ymd (strftime (desc$date, "%y-%m-%d"))
148
+
149
+ cols <- names (desc) [which (!names (desc) %in% c ("date"))]
150
+ desc <- tidyr::pivot_longer (
151
+ desc,
152
+ c ("n_aut", "n_ctb", "n_fns_tot", "n_fns_exp", "n_ext_pkgs", "base_calls")
153
+ )
154
+ names (desc) <- c ("date", "desc_variable", "value")
155
+ ```
156
+
157
+ ``` {r ojs-in-desc, echo = FALSE}
158
+ ojs_define (desc_in = desc)
159
+ ```
160
+
161
+ ``` {ojs desc-transpose-and-filter}
162
+ desc = {
163
+ return transpose(desc_in).map(row => ({
164
+ ...row,
165
+ date: new Date(row.date)
166
+ }));
167
+ }
168
+ viewof desc_variable = Inputs.radio(
169
+ ["n_aut", "n_ctb", "n_fns_tot", "n_fns_exp", "n_ext_pkgs", "base_calls"],
170
+ {
171
+ value: "n_fns_tot",
172
+ label: "Variable:",
173
+ }
174
+ )
175
+ descFiltered = desc.filter(function(row) {
176
+ return desc_variable.includes(row.desc_variable)
177
+ })
178
+ ```
179
+
180
+ ``` {ojs desc-plot}
181
+ Plot.plot({
182
+ style: `
183
+ overflow: visible;
184
+ `,
185
+ marginLeft: 60,
186
+ marginBottom: 50,
187
+ x: {grid: true},
188
+ y: {grid: true},
189
+ marks: [
190
+ Plot.ruleY([0]),
191
+ Plot.lineY(
192
+ descFiltered,
193
+ {
194
+ x: "date",
195
+ y: "value",
196
+ fontSize: 18
197
+ }
198
+ ),
199
+ Plot.axisX(
200
+ {
201
+ fontSize: 14,
202
+ label: "",
203
+ labelArrow: false
204
+ }
205
+ ),
206
+ Plot.axisX(
207
+ {
208
+ fontSize: 20,
209
+ label: "Date",
210
+ labelAnchor: "center",
211
+ labelOffset: 40,
212
+ ticks: []
213
+ }
214
+ ),
215
+ Plot.axisY(
216
+ {
217
+ fontSize: 14,
218
+ label: "",
219
+ labelArrow: false
220
+ }
221
+ ),
222
+ Plot.axisY(
223
+ {
224
+ fontSize: 24,
225
+ label: "Value",
226
+ labelAnchor: "center",
227
+ labelOffset: 55,
228
+ ticks: []
229
+ }
230
+ ),
231
+ ]
232
+ })
233
+ ```
0 commit comments