shinycustomloader (version 0.9.0)

withLoader: Add a loader that shows when an output is recalculating

Description

Add a loader that shows when an output is recalculating

Usage

withLoader(ui_element, type = "html", loader = "dnaspin",
  proxy.height = if (grepl("height:\\s*\\d", ui_element)) NULL else
  "400px")

Arguments

ui_element

A UI element that should be wrapped with a loader when the corresponding output is being calculated.

type

The type of loader to use. Possible values are image, html or text.

loader

The name of the loader. The built in options are dnaspin, dancingtree, pacman and walkingcow. For custom html option, the name of the css and html file have to be the same and input must be without the extension. For custom image option, the name must include the extension of the file. For custom text option, loader must be a list of marquee objects.

proxy.height

If the output doesn't specify the output height, you can set a proxy height. It defaults to 400px for outputs with undefined height.

References

`shinycssloaders` https://github.com/andrewsali/shinycssloaders

`dnaspin` https://codepen.io/jsnanigans/pen/ORNJNp

`pacman` https://codepen.io/wifi/pen/olKxE

`loaders` https://codepen.io/Manoz/pen/pydxK

Examples

Run this code
# NOT RUN {
withLoader(plotOutput("my_plot"))
# }
# NOT RUN {
marquee_list <- list(marquee("Your custom text here"))
# }
# NOT RUN {
withLoader(plotOutput("distPlot"), type="text", loader=marquee_list)
# }

Run the code above in your browser using DataLab