Package 'dragulaR'

Title: Drag and Drop Elements in 'Shiny' using 'Dragula Javascript Library'
Description: Move elements between containers in 'Shiny' without explicitly using 'JavaScript'. It can be used to build custom inputs or to change the positions of user interface elements like plots or tables.
Authors: Nicolas Bevacqua [aut, cph] (dragula library in htmlwidgets/lib, https://github.com/bevacqua/dragula), Zygmunt Zawadzki [aut, cre] (R interface), Darren Maczka [ctb]
Maintainer: Zygmunt Zawadzki <[email protected]>
License: GPL-2
Version: 0.3.2
Built: 2024-11-01 05:10:04 UTC
Source: https://github.com/zzawadz/dragular

Help Index


Register containers to dragula.

Description

Create dragula instace to allow moving around elements of the registered containers.

Usage

dragula(x, ...)

Arguments

x

vector of containers ids. Their's elements will become draggable.

...

additonal arguments passed to dragula JS as options. E.g. id will be an id to read from in shiny.

Value

Return htmlWidget. Should be used only inside shiny ui.

Examples

if(interactive()) {
  path <- system.file("apps/example01-dragula", package = "dragulaR")
  runApp(path, display.mode = "showcase")
}

Dragula widget.

Description

Create dragula widget.

Usage

dragulaOutput(outputId)

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

Arguments

outputId

output variable to read from.

expr

An expression that generates a dragula object.

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.

Value

RETURN_DESCRIPTION

Examples

if(interactive()) {
  path <- system.file("apps/example02-input", package = "dragulaR")
  runApp(path, display.mode = "showcase")
}

Format dragula input object.

Description

This is a utility function for better formatting dragula's input.

Usage

dragulaValue(x)

Arguments

x

dragula input.

Examples

## Not run: 
# Example call:
dragulaValue(input$dragula)

## End(Not run)

Register dragulaR's js functions for refreshing dragula object.

Description

Register dragulaR's js functions for refreshing dragula object.

Usage

useDragulajs()

Examples

## Not run: 
# See example for more details
library(dragulaR)
runApp(
  system.file("apps/example05-dragula-dynamic-elements", package = "dragulaR"),
  display.mode = "showcase")

## End(Not run)