daattali / colourpicker

🎨 A colour picker tool for Shiny and for selecting colours in plots (in R)
https://daattali.com/shiny/colourInput/
Other
217 stars 28 forks source link

How to use with multiple colourpickers within splitLayout? #28

Closed zx8754 closed 6 years ago

zx8754 commented 6 years ago

When two pickers used side by side using splitLayout, colour map gets hidden. Probably issue with splitLayout than colourpicker, see example:

library(shiny)
library(colourpicker)

shinyApp(
  ui = fluidPage(
    sidebarPanel(
      splitLayout(
        colourInput("PlotThemeColour1",
                    "Plot theme shade 1",
                    "#C2C2C2"),
        colourInput("PlotThemeColour2",
                    "Plot theme shade 2",
                    "#E5E5E5"))),
    mainPanel(textOutput("myCols"))
  ),

  server = function(input, output, session) {
    output$myCols <- renderText({
      paste(input$PlotThemeColour1, "and", input$PlotThemeColour2)

    })
  })

colorpickersplit

zx8754 commented 6 years ago

OK, at StackOverflow, they suggested a workaround.

ui = fluidPage(
     tags$style(HTML('.shiny-split-layout>div {
                         overflow:visible;
                                   }')), 
    sidebarPanel(
      splitLayout(
      ...

If you agree that is best way, we can close this issue.

zx8754 commented 6 years ago

cellArgs, seems to be the right solution for me.

cellArgs = list (style = "overflow:visible")

I will close the issue.

Thank you for the package.