Description Usage Arguments Examples
Options for Shuffle
1 2 3 4 5 6 7 8 |
is_centered |
Attempt to center grid items in each row. |
column_width |
A static number or function that returns a number which tells the plugin how wide the columns are (in pixels).
If function use |
gutter_width |
A static number or function that tells the plugin how wide the gutters between columns are (in pixels).
If function use |
speed |
Transition/animation speed (milliseconds). |
easing |
CSS easing function to use, for example: |
... |
Additional arguments, see https://vestride.github.io/Shuffle/ |
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 | if (interactive()) {
library(shiny)
library(shufflecards)
library(ggplot2)
ui <- fluidPage(
tags$h2("Responsive Shuffle Grid"),
fluidRow(
column(
width = 12,
shuffle_container(
shuffleId = "grid",
options = shuffle_options(
is_centered = FALSE,
column_width = I("function(containerWidth) {return 0.49 * containerWidth;}"),
gutter_width = I("function(containerWidth) {return 0.01 * containerWidth;}")
),
shuffle_card(
plotOutput(outputId = "plot1"), width = "49%"
),
shuffle_card(
plotOutput(outputId = "plot2"), width = "49%"
),
shuffle_card(
plotOutput(outputId = "plot3"), width = "49%"
)
)
)
)
)
server <- function(input, output, session) {
output$plot1 <- renderPlot({
ggplot() + geom_text(aes(1, 1, label = 1), size = 50)
})
output$plot2 <- renderPlot({
ggplot() + geom_text(aes(1, 1, label = 2), size = 50)
})
output$plot3 <- renderPlot({
ggplot() + geom_text(aes(1, 1, label = 3), size = 50)
})
}
shinyApp(ui, server)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.