README.md

shiny.info Rhino logo

Display simple information of the shiny project in the user interface of the app.

CRAN
status R build
status Codecov test
coverage

How to install shiny.info?

You can install shiny.info from CRAN repository:

install.packages("shiny.info")

You can get the most recent version from this repo using remotes.

remotes::install_github("Appsilon/shiny.info")

How to use shiny.info?

Just add one of the shiny.info functions to the UI of your app (some features require also adding a little bit of code to the server function). Check features section and documentation for more details.

See live demo.

An example of a shiny app that uses shiny.info can be found in ./examples directory.

Basic features

shiny.info::display("Hello user!", position = "top right")

shiny.info::git_info()

shiny.info::powered_by("Appsilon", link = "appsilon.com")

# global variable:
VERSION <- "1.2.2"

# in app ui
shiny.info::version()

shiny.info::busy()

shiny.info::info_panel(
    shiny.info::git_info(),
    shiny.info::powered_by("Appsilon", link = "appsilon.com"),
    position = "bottom left"
)

Advanced features

# in app ui
shiny.info::info_value("test_info_value")

# in app server
some_value <- reactiveVal("a test value to display")
output$test_info_value <- shiny.info::render_info_value(some_value())

# in app ui
shiny.info::info_value("session_info_value")

# in app server
output$session_info_value <- shiny.info::render_session_info()

# in app ui
shiny.info::inspect_btn_ui()

# in app server
shiny.info::inspect_btn_server(input)

shiny.info::toggle_info("Ctrl+Shift+K")

# in app global
VERSION = "1.2.2"
REPO = git2r::repository_head(repository("."))[[1]]
GIT_COMMIT_MESSAGE = git2r::commits(repository("."))[[1]]$message
GIT_COMMIT_HASH = git2r::commits(repository("."))[[1]]$sha

# in app ui
shiny.info::display(
    message = glue("I am running on repository {REPO}
    from [{GIT_COMMIT_HASH}]: {GIT_COMMIT_MESSAGE},
    and this is version: {VERSION}"),
    position = "top right",
    type = "custom_message"
)

# in app ui
shiny.info::info_value("test_info_value", position = "top right")

# in app server
a <- reactive({
  input$xcol
  rnorm(1,1)
})

output$test_info_value <- shiny.info::render_info_value(
  glue("a: {a()}, X Variable: {input$xcol}"),
  add_name = FALSE
)

How can I contribute?

If you want to contribute to this project please submit a regular PR once you’re done with your new feature or bug fix.

Appsilon

Appsilon is a Posit (formerly RStudio) Full Service Certified Partner. Learn more at appsilon.com.

Get in touch opensource@appsilon.com

Explore the Rhinoverse - a family of R packages built around Rhino!

We are hiring!



Appsilon/shiny.info documentation built on April 30, 2023, 10:13 p.m.