Description Usage Arguments Value Examples
Grillade Output in Shiny
1 2 3 4 5 6 7 8 9 10 11 12 | grilladeOutput(outputId, width = "100%", ...)
renderGrillade(
expr,
n_col = NULL,
max_n_col = NULL,
cols_width = NULL,
gutter = FALSE,
output_height = "400px",
env = parent.frame(),
quoted = FALSE
)
|
outputId |
Output variable to read from. |
width |
If not |
... |
Other arguments to pass to the container tag function. This is useful for providing additional classes for the tag. |
expr |
An expression that generates a |
n_col |
Number of columns, default to |
max_n_col |
Maximum number of columns, used if |
cols_width |
Numeric vector, numbers of columns taken by each elements,
can be a single number or a |
gutter |
Add a gutter between columns, can be |
output_height |
Height to use for output(s),
this apply to |
env |
The environment in which to evaluate |
quoted |
Is |
An HTML output element that can be included in Shiny UI.
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 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | # Generate a grillade from the server -------------------------
library(grillade)
library(shiny)
ui <- fluidPage(
tags$h2("Grillade from server"),
sliderInput(
inputId = "n",
label = "Number of elements :",
value = 3, min = 1, max = 24
),
grilladeOutput("out")
)
server <- function(input, output, session) {
output$out <- renderGrillade({
lapply(
X = seq_len(input$n),
FUN = function(i) {
wellPanel(
paste("Column", i),
style = "text-align: center;"
)
}
)
})
}
if (interactive())
shinyApp(ui, server)
# Matrix of htmlwidgets ---------------------------------------
library(shiny)
library(apexcharter)
library(grillade)
data("economics", package = "ggplot2")
ui <- fluidPage(
tags$h2("Htmlwidgets matrix example with grillade"),
grilladeOutput("charts")
)
server <- function(input, output, session) {
make_chart <- function(data, variable) {
apex(
data = data,
mapping = aes(x = date, y = !!sym(variable)),
type = "line"
)
}
output$charts <- renderGrillade({
chart1 <- make_chart(economics, "pce")
chart2 <- make_chart(economics, "psavert")
chart3 <- make_chart(economics, "uempmed")
grillade(chart1, chart2, chart3)
})
}
if (interactive())
shinyApp(ui, server)
# Generate a matrix of plots from server ----------------------
library(grillade)
library(shiny)
library(ggplot2)
ui <- fluidPage(
tags$h2("Matrix of plots with grillade"),
sliderInput(
inputId = "n",
label = "Number of plots :",
value = 3, min = 1, max = 15
),
grilladeOutput("out")
)
server <- function(input, output, session) {
output$out <- renderGrillade({
lapply(
X = seq_len(input$n),
FUN = function(i) {
ggplot() + geom_text(aes(1, 1, label = i), size = 50)
}
)
}, max_n_col = 5)
}
if (interactive())
shinyApp(ui, server)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.