dreamRs / esquisse

RStudio add-in to make plots interactively with ggplot2
https://dreamrs.github.io/esquisse
Other
1.78k stars 229 forks source link

Is there an option to make items in dragulainput target boxes multiline? #129

Closed accliu closed 3 years ago

accliu commented 4 years ago

I'm learning this amazing tool. In running the demo: if (interactive()) {

library("shiny") library("esquisse")

ui <- fluidPage( tags$h2("Demo dragulaInput"), tags$br(), dragulaInput( inputId = "dad", sourceLabel = "Source", targetsLabels = c("Target 1", "Target 2"), choices = names(iris), width = "400px" ), verbatimTextOutput(outputId = "result") )

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

output$result <- renderPrint(str(input$dad))

}

shinyApp(ui = ui, server = server)

}

If several items are dragged to the target box: image, we can only see just a few of the variable names (items). I can set box style overflow: auto to scroll a bar to see the other variables, but this is not very handy. display: grid; may help, but the appearance is very different from the parent input box. Is there a way to make the items on multiple lines? Can we customize the styles of the parent box and the target boxes separately? Is there a way to change the location of the target labels c("Target 1", "Target 2")? Really appreciate your help.

pvictor commented 4 years ago

In dev version this should works fine:

library(shiny)
library(esquisse)

ui <- fluidPage(
  tags$h2("Demo dragulaInput"),
  tags$br(),
  fluidRow(
    column(
      width = 3,
      dragulaInput(
        inputId = "dad1",
        label = "Default:",
        sourceLabel = "Source",
        targetsLabels = c("Target 1", "Target 2"),
        choices = month.name,
        width = "100%"
      ),
      verbatimTextOutput(outputId = "result1")
    )
  )
)

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

  output$result1 <- renderPrint(str(input$dad1))

}

if (interactive())
  shinyApp(ui = ui, server = server)

Result:

image

Victor