lenamax2355 / shinyvs

Virtual Select widget for shiny apps

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

shinyvs

Lifecycle: experimental R-CMD-check

Virtual Select widget for shiny applications built for performance. Powered by virtual-select.

Installation

You can install the development version of shinyvs from GitHub with:

# install.packages("remotes")
remotes::install_github("dreamRs/shinyvs")

Example

Minimal example with 97310 choices from babynames package:

library(shiny)
library(shinyvs)

ui <- fluidPage(
  tags$h2("Virtual Select example"),
  
  virtualSelectInput(
    inputId = "single",
    label = "Single select (with 97310 choices) :",
    choices = sort(unique(babynames::babynames$name)),
    search = TRUE
  ),
  verbatimTextOutput("res_single")
)

server <- function(input, output, session) {
  output$res_single <- renderPrint(input$single)
}

shinyApp(ui, server)

Development

This package use {packer} to manage JavaScript assets, see packer's documentation for more.

Install nodes modules with:

packer::npm_install()

Modify srcjs/inputs/virtual-select.js, then run:

packer::bundle()

Re-install R package and try virtualSelectInput() function.

About

Virtual Select widget for shiny apps

License:Other


Languages

Language:R 78.4%Language:JavaScript 21.6%