library(shiny)
library(shinyDND)
# Define UI for application that draws a histogram
ui <- shinyUI(
mainPanel(
h2("Drop UI"),
dropUI("div4", row_n = 1, col_n = 1),
dropUI("div5", row_n = 1, col_n = 1),
h2("DragSetUI"),
dragSetUI("div1", textval = list("col1", "col2", "col3")),
dragSetUI("div2", textval = list("row1", "row2", "row3")),
dragSetUI("div3", textval = list("agg1", "agg2", "agg3"))
)
)
# server with reactive for observing reactive drop event
server = shinyServer(function(input, output,session) {
observeEvent(input$div2,{
output$foo = renderText(
paste("The dropUI element currently contains:", input$div2))
})
})
# Run the application
shinyApp(ui = ui, server = server)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.