Package 'rdeck.controls'

Title: External Interactive Controls for {rdeck} in {rmarkdown}
Description: HTML widgets for external controls for toggling layers for {rdeck} in HTML documents.
Authors: Miles McBain [aut, cre]
Maintainer: Miles McBain <[email protected]>
License: MIT + file LICENSE
Version: 0.2.0
Built: 2024-11-19 05:26:24 UTC
Source: https://github.com/qfes/rdeck.controls

Help Index


convert rdeckContols to html allowing !important

Description

convert rdeckContols to html allowing !important

Usage

## S3 method for class 'rdeckControls'
as.tags(x, ...)

Arguments

x

an rdeckControls widget

...

other args passed to htmlwidgets:::toHTML

Value

html for the widget


Dropdown layer selector for rdeck maps

Description

Create an external layer control for an rdeck map in rmarkdown or shiny.

Usage

rdeck_layer_dropdown(
  rdeck,
  layer_names,
  layer_group_names,
  initial_selection = NULL,
  label = "",
  width = "100%",
  height = "1em"
)

Arguments

rdeck

the target rdeck instance to create a control for.

layer_names

a tidy select expression matching layer names. e.g. starts_with("demand")

layer_group_names

a tidy select expression matching layer group names. e.g. starts_with("rfs")

initial_selection

The layer or layer group that is to be selected by default before the user has interacted with the control. Defaults to the first matched layer name, then layer group name.

label

Some text that immediately precedes the dropdown control.

width

of the control div as css dimension string.

height

of the control div as css dimenson string.

Details

Match layer_names and or layer_group_names by using 'tidy select' syntax see tidyselect::eval_select().

The layer_names tidyselect can only be used to toggle visibility of ungrouped layers, that is layers with no group_name set. This is enforced by {rdeck}.


Generic rdeck control widget

Description

A generic control widget constructor.

Usage

rdeckControls(
  targetRDeckId,
  controlType = "dropdown",
  controlData = NULL,
  width = NULL,
  height = NULL,
  elementId = NULL
)

Shiny bindings for rdeckControls

Description

Output and render functions for using rdeckControls within Shiny applications and interactive Rmd documents.

Usage

rdeckControlsOutput(outputId, width = "100%", height = "1em")

renderRdeckControls(expr, env = parent.frame(), quoted = FALSE)

Arguments

outputId

output variable to read from

width, height

Must be a valid CSS unit (like '100%', '400px', 'auto') or a number, which will be coerced to a string and have 'px' appended.

expr

An expression that generates a rdeckControls

env

The environment in which to evaluate expr.

quoted

Is expr a quoted expression (with quote())? This is useful if you want to save an expression in a variable.