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 |
Create dragula instace to allow moving around elements of the registered containers.
dragula(x, ...)
dragula(x, ...)
x |
vector of containers ids. Their's elements will become draggable. |
... |
additonal arguments passed to dragula JS as options. E.g. |
Return htmlWidget. Should be used only inside shiny ui.
if(interactive()) { path <- system.file("apps/example01-dragula", package = "dragulaR") runApp(path, display.mode = "showcase") }
if(interactive()) { path <- system.file("apps/example01-dragula", package = "dragulaR") runApp(path, display.mode = "showcase") }
Create dragula widget.
dragulaOutput(outputId) renderDragula(expr, env = parent.frame(), quoted = FALSE)
dragulaOutput(outputId) renderDragula(expr, env = parent.frame(), quoted = FALSE)
outputId |
output variable to read from. |
expr |
An expression that generates a dragula object. |
env |
The environment in which to evaluate |
quoted |
Is |
RETURN_DESCRIPTION
if(interactive()) { path <- system.file("apps/example02-input", package = "dragulaR") runApp(path, display.mode = "showcase") }
if(interactive()) { path <- system.file("apps/example02-input", package = "dragulaR") runApp(path, display.mode = "showcase") }
This is a utility function for better formatting dragula's input.
dragulaValue(x)
dragulaValue(x)
x |
dragula input. |
## Not run: # Example call: dragulaValue(input$dragula) ## End(Not run)
## Not run: # Example call: dragulaValue(input$dragula) ## End(Not run)
Register dragulaR's js functions for refreshing dragula object.
useDragulajs()
useDragulajs()
## 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)
## 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)