Is there any possibility to make a vertical slider in Shiny? I would basically want a plot, a vertical slider at its left, and a normal horizontal slider below it.
Split Screen Vertical Sliders As the user scrolls down the page, each side of the screen moves in independent sections in opposite directions, sliding to revealing new content.
You create a range slider for your R Shiny app by using the values= -argument of the sliderInput widget. Normally, this argument defines one default value of the slider.
Now it is very easy with this noUiSliderInput()
from the shinyWidgets package.
Example:
if (interactive()) {
### examples ----
# see ?demoNoUiSlider
demoNoUiSlider("more")
### basic usage ----
library( shiny )
library( shinyWidgets )
ui <- fluidPage(
tags$br(),
noUiSliderInput(
inputId = "noui1",
min = 0, max = 100,
value = 20
),
verbatimTextOutput(outputId = "res1"),
tags$br(),
noUiSliderInput(
inputId = "noui2", label = "Slider vertical:",
min = 0, max = 1000, step = 50,
value = c(100, 400), margin = 100,
orientation = "vertical",
width = "100px", height = "300px"
),
verbatimTextOutput(outputId = "res2")
)
server <- function(input, output, session) {
output$res1 <- renderPrint(input$noui1)
output$res2 <- renderPrint(input$noui2)
}
shinyApp(ui, server)
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With