The fluidPage
and fixedPage
functions are used
for creating web pages that are laid out from the top down, leaving
whitespace at the bottom if the page content's height is smaller than the
browser window, and scrolling if the content is larger than the window.
fillPage
is designed to latch the document body's size to the size of
the window. This makes it possible to fill it with content that also scales
to the size of the window.
For example, fluidPage(plotOutput("plot", height = "100%"))
will not
work as expected; the plot element's effective height will be 0
,
because the plot's containing elements (<div>
and <body>
) have
automatic height; that is, they determine their own height based on
the height of their contained elements. However,
fillPage(plotOutput("plot", height = "100%"))
will work because
fillPage
fixes the <body>
height at 100% of the window height.
Note that fillPage(plotOutput("plot"))
will not cause the plot to fill
the page. Like most Shiny output widgets, plotOutput
's default height
is a fixed number of pixels. You must explicitly set height = "100%"
if you want a plot (or htmlwidget, say) to fill its container.
One must be careful what layouts/panels/elements come between the
fillPage
and the plots/widgets. Any container that has an automatic
height will cause children with height = "100%"
to misbehave. Stick
to functions that are designed for fill layouts, such as the ones in this
package.