Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/patzaw/bscui

Build SVG Custom User Interface in R, rmd, qmd and Shiny
https://github.com/patzaw/bscui

Last synced: 9 days ago
JSON representation

Build SVG Custom User Interface in R, rmd, qmd and Shiny

Awesome Lists containing this project

README

        

---
output:
rmarkdown::github_document:
number_sections: false
toc: false
toc_depth: 2
editor_options:
chunk_output_type: console
---

```{r setup, include = FALSE}
library(here)
library(knitr)
library(bscui)
library(base64enc)
library(htmltools)
library(dplyr)
library(xml2)
cranRef <- function(x){
sprintf(
"[%s](https://CRAN.R-project.org/package=%s): %s",
x, x, packageDescription(x)$Title
)
}
```

# Build SVG Custom User Interface

[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/bscui)](https://cran.r-project.org/package=bscui)
[![CRAN Download Badge](https://cranlogs.r-pkg.org/badges/bscui)](https://cran.r-project.org/package=bscui)

`r packageDescription("bscui")$Description`

## Installation

### From CRAN

```{r, eval=FALSE}
install.packages("bscui")
```

### Dependencies

The following R packages available on CRAN are required:

```{r, echo=FALSE, results='asis'}
deps <- desc::desc_get_deps()
sdeps <- filter(deps, type %in% c("Depends", "Imports") & package!="R")
for(p in sdeps$package){
cat(paste("-", cranRef(p)), sep="\n")
}
```

And those are suggested for building the vignettes and running some examples:

```{r, echo=FALSE, results='asis'}
wdeps <- filter(deps, type=="Suggests" & package!="R")
for(p in wdeps$package){
cat(paste("-", cranRef(p)), sep="\n")
}
```

### From github

```{r, eval=FALSE}
devtools::install_github("patzaw/bscui")
```

## Documentation

- [Introduction to bscui](https://patzaw.github.io/bscui/articles/bscui.html);
this introduction vignette is also included in the package:

```{r, eval=FALSE}
vignette("bscui")
```

- [Preparing SVG: examples, tips and tricks](https://patzaw.github.io/bscui/articles/web_only/SVG-examples.html)

## Examples

### Building figures

This example relies on a figure of animal cells taken
from [SwissBioPics](https://www.swissbiopics.org/name/Animal_cell).

```{r, echo=FALSE, results='asis'}
ec <- readLines(system.file("examples", "main-example.R", package = "bscui"))
cat('```r', sep="\n")
cat(ec, sep="\n")
cat('```', sep="\n")
```

### Figures in 'shiny'

The following 'shiny' application relies on human female anatomical
diagram taken from the [EBI gene expression
group](https://github.com/ebi-gene-expression-group/anatomogram).

```{r, eval=FALSE}
shiny::runApp(system.file("examples", "shiny-anatomogram", package = "bscui"))
```