Resizing the Google chart

So far, so simple. However, there is a problem! Google visualization charts, unlike native R visualizations, are not automatically resized when the browser window changes. We're going to fix this problem very simply, using some values that we can extract from the session argument of function(input, output, session){...}. Shiny makes lots of things available in this variable, and one of the most useful of these is session$clientData. This tells you lots of things about your user's browser, such as the pixel ratio, as well as the height and width of individual output elements within the application. For more on the uses of the session argument, see shiny.rstudio.com/reference/shiny/1.0.2/session.html. In our case, ...

Get Web Application Development with R Using Shiny - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.