An open API service indexing awesome lists of open source software.

https://github.com/Martin-McCoy/shinyVirga

A Collection of R shiny utilities by Virga Labs
https://github.com/Martin-McCoy/shinyVirga

Last synced: 3 months ago
JSON representation

A Collection of R shiny utilities by Virga Labs

Awesome Lists containing this project

README

        

---
output: github_document
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
warning = FALSE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
devtools::load_all()
```

# shinyVirga

`r lifecycle::badge('experimental')`
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)

The goal of `shinyVirga` is to consolidate generalized utility functions useful in development of shiny apps that are currently used in the various Virga Labs repositories in one convenient location. `shinyVirga` is intended to supply Virga Labs developers with a toolkit of well-maintained functions and modules adaptable to various use cases encountered likely to be encountered during shiny development with Virga Labs.

## Installation

You can install the development version of shinyVirga like so:

``` r
virgaUtils::install_virga("shinyVirga")
```
```{r, echo = FALSE, eval = FALSE}

get_rd_section <- function (rd_path)
{
rd <- rvest::read_html(glue::glue_collapse(capture.output(tools::Rd2HTML(rd_path))))
out <- rvest::html_elements(rd, xpath = UU::xpath_sibling_between("h3[contains(text(), 'Description')]", following_sibling = "h3[contains(text(), 'Usage')]", preceding_sibling = "p")) |>
as.character()
shiny::HTML(out)
}

```

The utility functions are divided into five categories (some functions overlap categories):

```{r, echo = FALSE, results='asis', warning=FALSE, eval = FALSE}

purrr::map(rlang::set_names(c("General",
"UI",
"CSS",
"JS",
"Reactives",
"golem",
"debugging")), ~{
rlang::exec(htmltools::tags$ul,
style = "list-style-type:none;",
!!!functionMap::map_r_script(UU::dirs$R(glue::glue("utils_{tolower(.x)}"), ext = "R")) |> functionMap::functions() |> purrr::map(~{
htmltools::tags$li(htmltools::tags$code(.x),": ", get_rd_section(fs::path("man", .x, ext = "Rd")) %|try|% NULL)
})
)

}) |> named_to_li(style = "list-style-type:none;") |> htmltools::doRenderTags()

```

```{r, echo = FALSE}
bs4Dash::bs4Table(UU::fun_docs_table())
```