Skip to content

Commit a6e542a

Browse files
committed
add second dashboard plot
1 parent bbf723e commit a6e542a

File tree

3 files changed

+100
-4
lines changed

3 files changed

+100
-4
lines changed

DESCRIPTION

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: githist
22
Title: Code analyses traced along the 'git' history of a package
3-
Version: 0.1.0.019
3+
Version: 0.1.0.020
44
Authors@R:
55
person("Mark", "Padgham", , "mark.padgham@email.com", role = c("aut", "cre"),
66
comment = c(ORCID = "0000-0003-2172-5265"))
@@ -22,6 +22,7 @@ Suggests:
2222
lubridate,
2323
quarto,
2424
testthat (>= 3.0.0),
25+
tidyr,
2526
withr
2627
Remotes:
2728
ropensci-review-tools/pkgstats

codemeta.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"codeRepository": "https://github.com/ropensci-review-tools/githist",
99
"issueTracker": "https://github.com/ropensci-review-tools/githist/issues",
1010
"license": "https://spdx.org/licenses/GPL-3.0",
11-
"version": "0.1.0.019",
11+
"version": "0.1.0.020",
1212
"programmingLanguage": {
1313
"@type": "ComputerLanguage",
1414
"name": "R",

inst/extdata/quarto/fn-stats.qmd

+97-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ library (lubridate)
1616
This page includes several graphs providing insight into the historical
1717
development of the package.
1818

19-
### Data on individual functions
19+
## Data on individual functions
2020

2121
This plot shows time series for the development of the following measures for each function in the package:
2222

@@ -50,7 +50,7 @@ stats <- tidyr::pivot_longer (stats, c ("doclines", "npars", "loc", "ext_calls")
5050
```{r ojs-in-stats, echo = FALSE}
5151
ojs_define (stats_in = stats)
5252
```
53-
```{ojs stats-transpose}
53+
```{ojs stats-transpose-and-filter}
5454
stats = {
5555
return transpose(stats_in).map(row => ({
5656
...row,
@@ -136,3 +136,98 @@ Plot.plot({
136136
]
137137
})
138138
```
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

Comments
 (0)