In Shiny/R how to drag and drop and save state

65 Views Asked by At

I need to send a the link of my app to a client.

I will ask him to change de positions of the images (the images are inside the html divs). After he/she decide the order of positions he will save the state.

And then I will see how he ordered the images.

The app is deployed on Shinyapps.io

How can I do this process in shiny? Is it related with saving states?

This is the code:

---- bucket-list-app -----------------------------------------------

Example shiny app with bucket list

library(shiny)
library(sortable)


ui <- fluidPage(
  tags$head(
    tags$style(HTML(".bucket-list-container {min-height: 350px;}"),
               ),
    tags$style(
      "#rank_list_1,
      #rank_list_2{
      display: flex;
      }
      "
    )
  ),
  fluidRow(
    column(
      tags$b("Exercise"),
      width = 12,
      bucket_list(
        header = "Drag the items in any desired bucket",
        group_name = "bucket_list_group",
        orientation = "horizontal",
        add_rank_list(
          text = "Drag from here",
          input_id = "rank_list_1",
          labels = list(
            htmltools::tags$div(
              "Div 1"
            ),
            htmltools::tags$div(
              "Div 2"
            ),
            htmltools::tags$div(
              "Div 3"
            ),
            htmltools::tags$div(
              "Div 4"
            )
          )
        ),add_rank_list(
          text = "to here",
          labels = NULL,
          input_id = "rank_list_2"
        ))))

      )

server <- function(input, output, session) {


}


shinyApp(ui, server)

Any help?

0

There are 0 best solutions below