Skip to content

mock_frame() #1

@ColinFay

Description

@ColinFay

I think {shinipsum} should support a zoning functionality to mock shiny app UI blocks:

mock_frame <- function(n, o, txt){
  mapply(function(x, y, z){
    column(
      x, 
      class = "mock", 
      tagList(
        lapply(1:y, function(x) tags$p(HTML("&nbsp;"))), 
        p(class = "mockover", z)
      )
    )
  }, x = n, y = o, z = txt, SIMPLIFY = FALSE)
}

library(shiny)
ui <- function(request){
  fluidPage(
    tags$style(
      '.mock{
        border-width:2px;
        border-style:solid;
        border-color:black;
        margin: 1em;
      }
      .mockover{
        text-align: center;
      }'
    ),
    mock_frame(
      c(1, 2, 6, 1, 12), 
      c(2, 3, 4, 1, 4), 
      c("the frame with this", 
        "the frame with that", 
        "here a graph", 
        "an a knob", 
        "and this ")
    )
  )
}

server <- function(input, output, session){
  
}

shinyApp(ui, server)

Screenshot 2019-09-05 at 16 40 57

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions