Skip to content

Commit

Permalink
add first observable plot to fn-stats.qmd
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed Jul 16, 2024
1 parent 483b4e4 commit a16d1bb
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: githist
Title: Code analyses traced along the 'git' history of a package
Version: 0.1.0.013
Version: 0.1.0.014
Authors@R:
person("Mark", "Padgham", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-2172-5265"))
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"codeRepository": "https://github.com/ropensci-review-tools/githist",
"issueTracker": "https://github.com/ropensci-review-tools/githist/issues",
"license": "https://spdx.org/licenses/GPL-3.0",
"version": "0.1.0.013",
"version": "0.1.0.014",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down
67 changes: 66 additions & 1 deletion inst/extdata/quarto/fn-stats.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ development of ...

```{r load-data}
dat <- readRDS ("results.Rds")
nrow (dat)
nrow (dat$stats)
```
```{r stats-data}
cols <- names (dat$stats) [which (!names (dat$stats) %in% c ("package", "version"))]
Expand All @@ -33,4 +33,69 @@ ojs_define (stats_in = stats)
stats = {
return transpose(stats_in)
}
viewof measure = Inputs.checkbox(
["mean", "median", "sum"],
{ value: ["mean"],
label: "Measure:"
}
)
statsFiltered = stats.filter(function(row) {
return measure.includes(row.measure)
})
statsFiltered
```

```{ojs stats-plot}
Plot.plot({
style: `
overflow: visible;
`,
marginLeft: 60,
marginBottom: 50,
x: {grid: true},
y: {grid: true},
marks: [
Plot.ruleY([0]),
Plot.lineY(
statsFiltered,
{
x: "date",
y: "npars",
fontSize: 18
}
),
Plot.axisX(
{
fontSize: 14,
label: "",
labelArrow: false
}
),
Plot.axisX(
{
fontSize: 20,
label: "Year",
labelAnchor: "center",
labelOffset: 40,
ticks: []
}
),
Plot.axisY(
{
fontSize: 14,
label: "",
labelArrow: false
}
),
Plot.axisY(
{
fontSize: 24,
label: "Value",
labelAnchor: "center",
labelOffset: 55,
ticks: []
}
),
]
})
```

0 comments on commit a16d1bb

Please sign in to comment.