rstudio / shinydashboard

Shiny Dashboarding framework
https://rstudio.github.io/shinydashboard/
Other
893 stars 298 forks source link

resizable boxes? #342

Open paul-shannon opened 4 years ago

paul-shannon commented 4 years ago

If individual boxes could be resized via direct manipulation - the usual click-corner-and-drag gesture - the user would be empowered, free to size each box as they wish according to their needs of the moment.

Not easy, I'm sure, to enhance a div to do this. But since you rstudio folks are magi, maybe this could go on the list?

Thanks for your excellent code!

ismirsehregal commented 4 years ago

You might want to have a look at shinyjqui and it's function jqui_resizable:

library(shiny)
library(shinydashboard)
library(shinyjqui)

ui <- dashboardPage(
  dashboardHeader(),
  dashboardSidebar(),
  dashboardBody(
    fluidRow(
      jqui_resizable(
        box(height = "100%",
            "Box content here", br(), "More box content",
            sliderInput("slider1", "Slider input:", 1, 100, 50),
            textInput("text1", "Text input:")
        )
      ),
      jqui_resizable(
        box(height = "100%",
        "Box content here", br(), "More box content",
        sliderInput("slider2", "Slider input:", 1, 100, 50),
        textInput("text2", "Text input:")
      )
      )
    )
  )
)

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

shinyApp(ui, server)

screen

paul-shannon commented 4 years ago

This looks like an excellent solution. I will try it out. Thank you!

On Jul 16, 2020, at 7:34 AM, ismirsehregal notifications@github.com wrote:

You might want to have a look at shinyjqui and it's function jqui_resizable:

library(shiny) library(shinydashboard) library(shinyjqui)

ui <- dashboardPage( dashboardHeader(), dashboardSidebar(), dashboardBody( fluidRow( jqui_resizable( box(height = "100%", "Box content here", br(), "More box content", sliderInput("slider1", "Slider input:", 1, 100, 50), textInput("text1", "Text input:") ) ), jqui_resizable( box(height = "100%", "Box content here", br(), "More box content", sliderInput("slider2", "Slider input:", 1, 100, 50), textInput("text2", "Text input:") ) ) ) ) )

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

shinyApp(ui, server)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.