metroSplitter: Splitter

Description Usage Arguments Note Examples

View source: R/metro-grids.R

Description

Create a layout with panels that can be resized with splitter component

Usage

1
metroSplitter(panel1, panel2, vertical = FALSE, minSize = 100, gutterSize = 4)

Arguments

panel1

Left panel. Wrap in tagList. This can be a nested metroSplitter.

panel2

Right panel. Wrap in tagList. This can be a nested metroSplitter.

vertical

Vertical split. FALSE by default.

minSize

Minimum panel size. 100px by default.

gutterSize

Minimum gutter size (separator). 4 px by default.

Note

vertical does not work yet.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
if (interactive()) {
 library(shiny)
 library(shinyMetroUi)

 shiny::shinyApp(
  ui = metroPage(
    metroSplitter(
      vertical = FALSE,
      gutterSize = 10,
      panel1 = tagList(
        sliderInput(
          "obs",
          "Number of observations:",
          min = 0,
          max = 1000,
          value = 500
        ),
        plotOutput("distPlot")
      ),
      panel2 = tagList(
        sliderInput(
          "obs2",
          "Number of observations:",
          min = 0,
          max = 1000,
          value = 500
        ),
        plotOutput("distPlot2")
      )
    )
  ),
  server = function(input, output) {
    output$distPlot <- renderPlot({
      hist(rnorm(input$obs))
    })
    output$distPlot2 <- renderPlot({
      hist(rnorm(input$obs2))
    })
  }
 )
}

RinteRface/shinyMetroUi documentation built on Dec. 31, 2019, 8:47 a.m.