| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/bootstrap-layout.R |
| 3 |
\name{splitLayout} |
| 4 |
\alias{splitLayout} |
| 5 |
\title{Split layout} |
| 6 |
\usage{ |
| 7 |
splitLayout(..., cellWidths = NULL, cellArgs = list()) |
| 8 |
} |
| 9 |
\arguments{ |
| 10 |
\item{...}{Unnamed arguments will become child elements of the layout. Named |
| 11 |
arguments will become HTML attributes on the outermost tag.} |
| 12 |
|
| 13 |
\item{cellWidths}{Character or numeric vector indicating the widths of the |
| 14 |
individual cells. Recycling will be used if needed. Character values will |
| 15 |
be interpreted as CSS lengths (see \code{\link[=validateCssUnit]{validateCssUnit()}}), numeric |
| 16 |
values as pixels.} |
| 17 |
|
| 18 |
\item{cellArgs}{Any additional attributes that should be used for each cell |
| 19 |
of the layout.} |
| 20 |
} |
| 21 |
\description{ |
| 22 |
Lays out elements horizontally, dividing the available horizontal space into |
| 23 |
equal parts (by default). |
| 24 |
} |
| 25 |
\examples{ |
| 26 |
## Only run examples in interactive R sessions |
| 27 |
if (interactive()) { |
| 28 |
options(device.ask.default = FALSE) |
| 29 |
|
| 30 |
# Server code used for all examples |
| 31 |
server <- function(input, output) { |
| 32 |
output$plot1 <- renderPlot(plot(cars)) |
| 33 |
output$plot2 <- renderPlot(plot(pressure)) |
| 34 |
output$plot3 <- renderPlot(plot(AirPassengers)) |
| 35 |
} |
| 36 |
|
| 37 |
# Equal sizing |
| 38 |
ui <- splitLayout( |
| 39 |
plotOutput("plot1"), |
| 40 |
plotOutput("plot2") |
| 41 |
) |
| 42 |
shinyApp(ui, server) |
| 43 |
|
| 44 |
# Custom widths |
| 45 |
ui <- splitLayout(cellWidths = c("25\%", "75\%"), |
| 46 |
plotOutput("plot1"), |
| 47 |
plotOutput("plot2") |
| 48 |
) |
| 49 |
shinyApp(ui, server) |
| 50 |
|
| 51 |
# All cells at 300 pixels wide, with cell padding |
| 52 |
# and a border around everything |
| 53 |
ui <- splitLayout( |
| 54 |
style = "border: 1px solid silver;", |
| 55 |
cellWidths = 300, |
| 56 |
cellArgs = list(style = "padding: 6px"), |
| 57 |
plotOutput("plot1"), |
| 58 |
plotOutput("plot2"), |
| 59 |
plotOutput("plot3") |
| 60 |
) |
| 61 |
shinyApp(ui, server) |
| 62 |
} |
| 63 |
} |
| 64 |
\seealso{ |
| 65 |
Other layout functions: |
| 66 |
\code{\link{fillPage}()}, |
| 67 |
\code{\link{fixedPage}()}, |
| 68 |
\code{\link{flowLayout}()}, |
| 69 |
\code{\link{fluidPage}()}, |
| 70 |
\code{\link{navbarPage}()}, |
| 71 |
\code{\link{sidebarLayout}()}, |
| 72 |
\code{\link{verticalLayout}()} |
| 73 |
} |
| 74 |
\concept{layout functions} |