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

https://github.com/ColinFay/golemexample

An example app for illustrating golem features
https://github.com/ColinFay/golemexample

Last synced: 4 months ago
JSON representation

An example app for illustrating golem features

Awesome Lists containing this project

README

        

---
output: github_document
---

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

[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)

The goal of golemexample is to provide some examples for the inner configuration of a `{golem}` app.

## Share value across modules

+ Add a top level reactiveValue

+ Add a nested level inside modules

+ Share this across modules

## Change Shiny Options

## Adding external files

### CSS

+ Added with `dev/02_dev.R#29`

+ Personnalized in `inst/app/www/custom.css`

+ Linked to the app at `R/app_ui.R#27`

### JS

#### Classic

__A simple JS can be used from UI.__

+ Added with `dev/02_dev.R#27`

+ Personnalized in `inst/app/www/alertme.js`

+ Linked to the app at `R/app_ui.R#28`

+ Called with `tags$button("Alert!", onclick = "alertme();")` at `R/mod_my_first_module.R#33`

#### Handlers

__A handler JS can be used from server side with `golem::invoke_js()`.__

+ Added with `dev/02_dev.R#28`

+ Personnalized in `inst/app/www/handler.js`

+ Linked to the app at `R/app_ui.R#29`

+ Called with `golem::invoke_js("alertarg", "12")` at `R/mod_my_first_module.R#58`

### Image

+ Downloaded at `inst/app/www/guit.jpg`

+ Linked with `tags$img(src = "www/guit.jpg")` at `R/mod_my_first_module.R#23`

## Passing arguments to `run_app`

+ `run_app`

+ Read in UI at `R/app_ui.R#8`

+ Read in server at `R/app_server.R#5`

## Using datasets inside your app

+ Register your dataset as a package data
which is turned into

+ Use your data object wherever you need it (in your UI or server)

## Using shiny::includeXXX

+ Add elements in `inst/app/www`

+ Use `system.file("app/www/plop.md", package = "golemexample")`


Please note that the 'golemexample' project is released with a
[Contributor Code of Conduct](CODE_OF_CONDUCT.md).
By contributing to this project, you agree to abide by its terms.