Description Usage Arguments Value Examples
Remove widgets in the dock
1 | removeWidgets(proxy, widgetIDs = NULL, .all = FALSE)
|
proxy |
Proxy LuminophoR object |
widgetIDs |
IDs for luminophor widget |
.all |
Remove all widgets? This will override any ids specified in |
Proxy LuminophoR object
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 | if (interactive()) {
library(shiny)
library(luminophor)
shinyApp(
ui = fluidPage(
titlePanel("Old Faithful Geyser Data"),
sidebarLayout(
sidebarPanel(
actionButton('rerender', 'Rerender', icon = icon('redo')),
actionButton('remove_slider', 'Remove Slider', icon = icon('times')),
actionButton('remove_all', 'Remove All', icon = icon('times'))
),
mainPanel(
luminophorOutput('lmo', height='90vh')
)
)
),
server = function(input, output) {
output$lmo <- renderLuminophor({
input$rerender
initval <- isolate({if (!is.null(input$bins)) input$bins else 30})
luminophor() %>%
addWidget("widget-slider",
title = "Slider",
ui = sliderInput("bins", "Number of bins:",
min = 1, max = 50, value = initval)) %>%
addWidget("widget-plot",
title = "Plot",
insertmode = "split-right",
refwidgetID = "widget-slider",
relsize = 0.75,
ui = plotOutput("distPlot"))
})
output$distPlot <- renderPlot({
x <- faithful[, 2]
bins <- seq(min(x), max(x), length.out = input$bins + 1)
hist(x, breaks = bins, col = 'darkgray', border = 'white')
})
observeEvent(input$remove_slider, {
luminophorProxy('lmo') %>%
removeWidgets('widget-slider')
})
observeEvent(input$remove_all, {
luminophorProxy('lmo') %>%
removeWidgets(.all = TRUE)
})
}
)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.