knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
```{css, echo=FALSE} pre { max-height: 15em; overflow-y: auto; }
pre[class] { max-height: 15em; }
## Introduction Although `sortable` is designed to be a low-level wrapper around the `SortableJS` library, the package also exposes a few higher level functions. These functions enable you to easily using drag-and-drop widgets into a Shiny app for specific tasks: * To create a ranking task, use `rank_list()` * To create a bucketing task, use `bucket_list()` ## Rank list ### Demo This is a rank list app, allowing you to change the order of items in a list. The app demonstrates three types of drag-and-drop behaviour: * Default * Multi-drag, to select multiple items and drag as a group * Swap, to swap two items ```r library(htmltools) tags$div( class = "shiny-app-frame", tags$iframe( src = "https://andrie-de-vries.shinyapps.io/sortable_rank_list_app/", width = "100%", height = 550 ) )
This is the source code:
knitr::read_chunk( system.file("shiny/rank_list/app.R", package = "sortable") )
This is a bucket list app, where the bucket list allows you to drag from one bucket to another.
library(htmltools) tags$div( class = "shiny-app-frame", tags$iframe( src = "https://andrie-de-vries.shinyapps.io/sortable_bucket_list_app/", width = "100%", height = 800 ) )
This is the source code:
knitr::read_chunk( system.file("shiny/bucket_list/app.R", package = "sortable") )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.