Skip to content
Structure Shiny applications developed with modules
R
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
R supreme to data.frame return list columns Sep 9, 2019
inst Update README Aug 7, 2019
man supreme to data.frame return list columns Sep 9, 2019
tests
vignettes Remove dates from vignettes Aug 22, 2019
.Rbuildignore
.gitignore Ignore `docs/` used for local previews for pkgdown site Aug 24, 2019
.travis.yml
DESCRIPTION Switch to MIT license Sep 9, 2019
LICENSE Switch to MIT license Sep 9, 2019
NAMESPACE
NEWS.md Replace globals with package options Aug 20, 2019
README.Rmd
README.md Switch to MIT license Sep 9, 2019
_pkgdown.yml Change site theme Aug 24, 2019
appveyor.yml
codecov.yml
supreme.Rproj

README.md

supreme

Repo status Travis build status AppVeyor build status Coverage status

supreme helps you structure Shiny applications developed with modules

Therefore, you are able to:

  • Visualize relationship of modules in any existing application

  • Design new applications from scratch

Usage

First of all, the application has to be read as a model object by supreme.

For your existing application, you may read it from a file by using src_file(). Please see the vignette for the other options to read your application as model objects.

After reading, create a supreme object from the read model object:

library(supreme)
path <- example_app_path()
obj <- supreme(src_file(path))
obj
#> A supreme model object
#> 6 entities: server, customers_tab_module_server, items_tab_module_server, items_plot_server, ...

Visualize the module structure:

graph(obj)


See the generated supreme object in tabular form (as data.frame or tibble):

df <- as.data.frame(obj)
tbbl <- tibble::as_tibble(df)
tbbl
#> # A tibble: 6 x 6
#>   type   name                 input  output  calling_modules src           
#>   <chr>  <chr>                <I(ch> <I(chr> <I(list)>       <chr>         
#> 1 module server               <NA>   <NA>    <chr [3]>       app.R         
#> 2 module customers_tab_modul… <NA>   <NA>    <chr [1]>       module-custom…
#> 3 module items_tab_module_se… <NA>   <NA>    <chr [2]>       module-items.R
#> 4 module items_plot_server    <NA>   <NA>    <chr [1]>       module-items.R
#> 5 module transactions_tab_mo… <NA>   <NA>    <chr [1]>       module-transa…
#> 6 module main_table_server    <NA>   <NA>    <chr [1]>       module-utils.R

For designing a new application, or designing a new part in your existing application, use YAML:

Read more

The following vignettes contain more detailed information about how to use supreme in different ways.

(they’re under development)

Installation

devtools::install_github("strboul/supreme")

Contribution

This package is still on progress. API is subject to change.

PRs and issues are much appreciated.

Acknowledgements

  • R Core Team: supreme came to life thanks to R allowing to manipulate abstract syntax trees (AST) easily in the code that is a huge benefit of practising static analyses.

  • datamodelr: Inspiring work for creating modelling language

  • shinypod: Interesting thoughts regarding the implementation of Shiny modules

License

MIT © Metin Yazici

You can’t perform that action at this time.