0

This is baffling me for last couple of hours. In the below reprex the output turns out perfectly as expected if it is run using reprex() but gives unexpected UI output (wellPanel does not render outside valueboxes) if we run the same in two different machines and in a fresh R session as well !

I would really appreciate if some of you just ran the below code and see what output you get.

library(shiny)
library(shinydashboard)
#> 
#> Attaching package: 'shinydashboard'
#> The following object is masked from 'package:graphics':
#> 
#>     box

ui <- dashboardPage(
  dashboardHeader(),
  dashboardSidebar(),
  dashboardBody(
    fluidRow(
      column(
        width = 6,
        wellPanel(
          valueBoxOutput("vb1")
        )
      ),
      column(
        width = 6,
        wellPanel(
          valueBoxOutput("vb2")
        )
      )
    )
  )
)

server <- function(input, output) {
  output$vb1 <- renderValueBox({
    valueBox(42, "Value Box 1")
  })
  output$vb2 <- renderValueBox({
    valueBox(69, "Value Box 2")
  })
}

shinyApp(ui, server)
#> 
#> Listening on http://127.0.0.1:7101

Created on 2023-03-19 with reprex v2.0.2

Above is using reprex and gives the correct output.

But on running the same file in my ubuntu server as well as local macbook pro both give the following defective UI: enter image description here

I am starting a fresh R session and still the same output. The code when copied outside the original machine (ubuntu server) into a local machine in a fresh session also gives the same problem that wellPanels are not formed.

What's going on here?

Lazarus Thurston
  • 1,197
  • 15
  • 33

1 Answers1

0

The issue here is to do with the aspect ratio. If you take you browser window and make it less wide, the panels will rescale to the same view as the reprex example (tested on FF on Linux Mint)

Narrow Window:

Narrow Window

Wide Window:

Wide Window

Julian_Hn
  • 2,086
  • 1
  • 8
  • 18
  • Oh! I tried to run the reprex in a wider view pane but unfortunately the package hard codes the width, it seems. So this mean the problem now is that why wellPanel are not working on wider window. It doesn't work with anything wider than 750 (I tried many screen widths). – Lazarus Thurston Mar 19 '23 at 14:17