Skip to content

Commit

Permalink
continue
Browse files Browse the repository at this point in the history
  • Loading branch information
catalamarti committed Aug 22, 2024
1 parent 06d058b commit ca51a4f
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ vignettes/*.pdf
.DS_Store
docs
shiny/
inst/doc
3 changes: 3 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,14 @@ Suggests:
ggplot2,
here,
htmlwidgets,
knitr,
plotly,
rmarkdown,
shinycssloaders,
shinyWidgets,
testthat (>= 3.1.5),
utils,
zip
Remotes:
darwin-eu-dev/omopgenerics
VignetteBuilder: knitr
Binary file modified R/sysdata.rda
Binary file not shown.
11 changes: 10 additions & 1 deletion R/visOmops.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,16 @@ visTable <- function(result,
return(result)
}

# # facet
# warning if default plot tab

# plotCohortTiming() ----
#
# plotCohortCharacteristics() ----
# facet = <groupping, settings, variable>
# x = <groupping, settings, variable>
# plotType = boxplot/barplot
# colour = <groupping, settings, variable> -> NULL
# # facet ----
# # colour
# visPlot <- function(result,
# facet = NULL,
Expand Down
30 changes: 27 additions & 3 deletions data-raw/internalData.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,30 @@
## code to prepare `DATASET` dataset goes here

resultTypeTabs <- dplyr::tribble(
~result_type, ~title, ~icon, ~raw, ~formatted, ~plot,
"summarised_characteristics", "Cohort characteristics", "people-group", TRUE, TRUE, TRUE
~result_type, ~title, ~icon,
"summarised_characteristics", "Cohort characteristics", "people-group"
)

plotType = boxplot/density
# timeScale = days/years
# facet = <groupping/settings/variable>
# colour = <groupping/settungs/variable>
# uniqueCombinations = #check#

resultTypePlots <- list(
"functions" = dplyr::tribble(
~plot_id, ~result_type, ~package, ~fun, ~output,
1L, "cohort_overlap", "CohortCharacteristics", "plotCohortOverlap", "ggplot2",
2L, "cohort_attrition", "CohortCharacteristics", "plotCohortAttrition", "grViz",
3L, "cohort_timing", "CohortCharacteristics", "plotCohortTimming", "ggplot2"
),
"arguments" = dplyr::tribble(
~plot_id, ~argument, ~type, ~opts,
1L, "facet", "selector", "<groupping>, <variable>, <settings>",
1L, "uniqueCombinations", "check", "",
3L, "plotType", "selector", "boxplot, density",
3L, "timeScale", "selector", "days, years"
)
)

proj <- c(
Expand Down Expand Up @@ -147,4 +169,6 @@ plot_config <- list(
)
# end plot config ----

usethis::use_data(resultTypeTabs, proj, global, plot_config, overwrite = TRUE, internal = TRUE)
usethis::use_data(
resultTypeTabs, resultTypePlots, proj, global, plot_config, overwrite = TRUE,
internal = TRUE)
2 changes: 2 additions & 0 deletions vignettes/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.html
*.R
34 changes: 34 additions & 0 deletions vignettes/supported_result_type.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: "Plot tabs in omopViewer"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{supported_result_type}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```

```{r, echo=FALSE}
x <- omopViewer:::resultTypePlots$functions
```


The **omopViewer** package supports `r x$result_type |> unique() |> length()` result types of `r x$package |> unique() |> length()` packages: `r cli::cli_text("{.pkg {unique(x$package)}}") |> cli::cli_fmt()`.

You can see the plot functions that have been configured in the package per result type in the following table:

```{r, echo = FALSE}
x |>
dplyr::select(
"Result type" = "result_type", "package", "Plot function" = "fun") |>
visOmopResults::gtTable(
groupColumn = "package", colsToMergeRows = "Result type")
```

0 comments on commit ca51a4f

Please sign in to comment.