Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Plots doesn't resize inside grids #441

Open
1 task done
serkor1 opened this issue Jul 5, 2023 · 1 comment
Open
1 task done

[Bug]: Plots doesn't resize inside grids #441

serkor1 opened this issue Jul 5, 2023 · 1 comment
Labels

Comments

@serkor1
Copy link

serkor1 commented Jul 5, 2023

Guidelines

  • I agree to follow this project's Contributing Guidelines.

Project Version

No response

Platform and OS Version

Ubuntu 20.04

Existing Issues

No response

What happened?

If you include a plot in a grid-area, the plot doesn't adjust in size properly except when specifying cols_width as percentages. It does increase in size, but it doesn't decrease.

Steps to reproduce

# gc
rm(list = ls()); invisible(gc())

# library
library(shiny.semantic)
library(shiny)

# basic app;
ui <- semanticPage(
  
  column(
    width = 12,
    grid(
      grid_template = grid_template(
        default = list(
          areas = rbind(
            c('first')
          ),
          cols_width  = c('1fr'),
          rows_height = c('auto') 
        )
      ),
      first = tableOutput(
        'table'
      )
    ),
    
    grid(
      grid_template = grid_template(
        default = list(
          areas = rbind(
            c('first')
          ),
          cols_width  = c('1fr'),
          rows_height = c('auto') 
        )
      ),
      first = plotOutput(
        'plot',width = '100%'
      )
    )
  )
)

server <- function(input, output, session) {
  
  output$table <- renderTable(
    {
      head(
        mtcars
      )
    },
    width = '100%'
  )
  
  output$plot <- renderPlot(
    {
     plot(
       x = 1:100,
       y = 1:100
     )
    }
  )
  
}

shinyApp(ui, server)

Expected behavior

The plot should conform to the size of the grid-area, similar to the table but it doesn't.

Attachments

No response

Screenshots or Videos

No response

Additional Information

No response

@serkor1 serkor1 added the bug label Jul 5, 2023
@serkor1 serkor1 changed the title [Bug]: [Bug]: Plots doesn't resize inside grids Jul 5, 2023
@serkor1
Copy link
Author

serkor1 commented Jul 5, 2023

If the widths are defined as vw or %, then there is no issue - its strictly related to fr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant