Learn R Programming

dashR (version 0.0.7)

Dash: Generate a Dash server

Description

Description coming soon

Usage

app <- Dash$new(
  name = "dash",
  server = fiery::Fire$new(),
  assets_folder = 'assets',
  assets_url_path = '/assets',
  assets_ignore = '',
  serve_locally = TRUE,
  routes_pathname_prefix = '/',
  requests_pathname_prefix = '/'
)

Format

An R6::R6Class generator object

Arguments

name The name of the Dash application (placed in the <title> of the HTML page).
server The web server used to power the application. Must be a fiery::Fire object.
serve_locally Whether to serve HTML dependencies locally or remotely (via URL).
routes_pathname_prefix a prefix applied to the backend routes.
requests_pathname_prefix a prefix applied to request endpoints made by Dash's front-end.
external_scripts An optional list of valid URLs from which to serve JavaScript source for rendered pages.
external_stylesheets An optional list of valid URLs from which to serve CSS for rendered pages.
suppress_callback_exceptions Whether to relay warnings about possible layout mis-specifications when registering a callback.

Fields

server

A cloned (and modified) version of the fiery::Fire object provided to the server argument (various routes will be added which enable the dashR functionality).

config

A list of configuration options passed along to dash-renderer. Users shouldn't need to alter any of these options unless they are constructing their own authorization front-end or otherwise need to know where the application is making API calls.

Methods

layout(...)

Set the layout (i.e., user interface). The layout should be either a collection of DashR components (e.g., dccSlider, htmlDiv, etc) or a function which returns a collection of components.

layout_get(render = TRUE)

Retrieves the layout. If render is TRUE, and the layout is a function, the result of the function (rather than the function itself) is returned.

callback(func = NULL, output = NULL)

A callback function defintion. The func argument accepts any R function and output defines which layout component property should adopt the results (via an output object). To determine what events trigger this callback, provide input (and/or state) object(s) (which should reference layout components) as argument value(s) to func.

run_server(host = NULL, port = NULL, block = TRUE, showcase = FALSE, ...)

Launch the application. If provided, host/port set the host/port fields of the underlying fiery::Fire web server. The block/showcase/... arguments are passed along to the ignite() method of the fiery::Fire server.

run_heroku(host = "0.0.0.0", port = Sys.getenv('PORT', 8080), ...)

Like run_server() but sets sensible host/port defaults for running the app on Heroku.

See Also

https://plot.ly/dashR/