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
- Host: GitHub
- URL: https://github.com/ColinFay/golemexample
- Owner: ColinFay
- Created: 2019-07-01T13:46:43.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-02T18:23:03.000Z (over 5 years ago)
- Last Synced: 2024-08-13T07:15:23.093Z (8 months ago)
- Language: R
- Size: 98.6 KB
- Stars: 25
- Watchers: 3
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- jimsghstars - ColinFay/golemexample - An example app for illustrating golem features (R)
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# golemexample[](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.