displayCodeModal {shinymeta} | R Documentation |
Display a shinyAce code editor via shiny modal
Description
Show a shinyAce::aceEditor()
in a shiny::modalDialog()
.
Usage
displayCodeModal(
code,
title = NULL,
clip = "clipboard",
footer = shiny::modalButton("Dismiss"),
size = c("m", "s", "l"),
easyClose = TRUE,
fade = TRUE,
session = shiny::getDefaultReactiveDomain(),
...
)
Arguments
code |
Either a language object or a character string. |
title |
An optional title for the dialog. |
clip |
An |
footer |
UI for footer. Use |
size |
One of |
easyClose |
If |
fade |
If |
session |
a shiny session object (the default should almost always be used). |
... |
arguments passed along to |
Value
nothing. Call this function for its side effects.
See Also
Examples
if (interactive()) {
library(shiny)
ui <- fluidPage(
sliderInput("n", label = "Number of samples", min = 10, max = 100, value = 30),
actionButton("code", icon("code")),
plotOutput("p")
)
server <- function(input, output) {
output$p <- metaRender(renderPlot, {
plot(sample(..(input$n)))
})
observeEvent(input$code, {
code <- expandChain(output$p())
displayCodeModal(code)
})
}
shinyApp(ui, server)
}