Closed elia427 closed 2 years ago
Hi @elia427 and thank you for your kind words!
You made the right analysis. The dataTableOutput
does not know then there is a resize event and its size remains the same. Fortunately, there is a ready to go extension from DT that is exactly what you need. You just need to add:
output$mtcars_table <- DT::renderDataTable(mtcars, options = list(dom = 't'), extensions = 'Responsive')
to your table.
I hope that this solution is good for you.
Kind Regards, Oriol
Thanks a lot, @osenan. That fixed the overlapping issue. However, the tab panel in the right box are moving out when I minimize the browser. It is not friendly with mobile browsing too. The semantic dashboard is a cutting edge solution for R shiny, but R shiny is supposed to behave nicely in mobile applications. For example, the same application behaves nicely with shinydashboardPlus. Any suggestion on how to make it friendly with mobile browsing?
Cheers, Elia
Hi again, let me answer your two questions.
I do not see changes on application when minimising the window. If I resize or reduce the screen size there is a shrink in the total width and there is a point that it is very difficult to see both tabsets but this is normal if you reduce the width. Moreover I do not see different behaviour comparing semantic.dashboard
and semanticdashboardPlus
testing this particular app.
There are several approaches you can take in order to make a Shiny App more mobile friendly. They are all related to app design, layouts and styling. Mobile devices are smaller than computer screens, that means that you will have less space for your app UI and you will require larger font size. This is a whole topic so I will just suggest few tools and ideas that you can try and use as principle:
Hope it helps, Oriol
Yes, that helps. Thanks a lot for the tips.
Thanks for the awesome work!
I wanted to have a table on the left and a tab box on the right on the page. The box and tabBox overlap when one resizes the browser. It seems the dataTableOutput doesn't resize with the box.
library(shiny) library(shiny.semantic) library(semantic.dashboard) library(plotly) library(DT)
ui <- dashboardPage( margin = TRUE, dashboardHeader( title = "Version 2.0", titleWidth = "thin",
logo_path = "http://d2v95fjda94ghc.cloudfront.net/appsilon_logo.png",
) server <- function(input, output) { output$mtcars_table <- DT::renderDataTable(mtcars, options = list(dom = 't')) output$mtcars_plot2 <- renderPlotly(plot_ly( mtcars, x = ~ mtcars[, input$variable1], y = ~ mtcars[, input$variable2], type = "scatter", mode = "markers" )) }
shinyApp(ui = ui, server = server)