ThomasSiegmund / shinyTypeahead

A typeahead text input for Shiny based on the Bootstrap2 typeahead plugin
MIT License
11 stars 3 forks source link

How best to handle large datasets? #1

Open iainmwallace opened 8 years ago

iainmwallace commented 8 years ago

Hi,

Wonderful package! I was wondering if you have any suggestions on how to handle typeahead for very large datasets?

I am finding my minimal app, code below, is unstable when I use >200,000 names as my input choice. Ideally I would like to be able to do a type ahead for a very large dictionary >1million compound names similar to what is shown on this website http://www.chemspider.com/

I came across this discussion of local vs. remote typeahead and wondered if it was possible to implement something similar. http://sahatyalkabov.com/jsrecipes/?ref=devtoolsonline#!/frontend/typeahead

Thanks,

Iain

library(shiny) library(shinyTypeahead) library(shinythemes) library(randomNames)

rNames <- randomNames(200000) # max number of allowed choices 2 ^ 17 - 2

ui.R

--------------------------------------------------------

ui <- shinyUI(fluidPage(theme = shinytheme("journal"), title = 'shinyTypeahead test app', fluidRow( typeaheadInput('thirdTypeaheadInput', label = "Random names", choices = rNames, items = 5), textOutput('thirdoutput')

                      )

))

server.R

--------------------------------------------------------

server <- shinyServer(function(input, output, session) { output$thirdoutput <- renderText(input$thirdTypeaheadInput)

})

runApp(list(ui=ui,server=server))

ThomasSiegmund commented 8 years ago

Hi Iain,

I am finding my minimal app, code below, is unstable when I use >200,000 names as my input choice.

That's the expected behaviour. The Javascript code from the Bootstrap2 typeahead takes exactly 2 ^ 17 - 2 choices.

The only other option I am aware of is the Shiny selectizeInput, which can behave almost like a typeahead. In the well hidden "server mode" it scales to any number of choinces. It's documented in the updateSelectizeInput help text.

Hope this helps

Thomas

On Sat, Jun 11, 2016 at 10:39 PM, iainmwallace notifications@github.com wrote:

Hi,

Wonderful package! I was wondering if you have any suggestions on how to handle typeahead for very large datasets?

I am finding my minimal app, code below, is unstable when I use >200,000 names as my input choice. Ideally I would like to be able to do a type ahead for a very large dictionary >1million compound names similar to what is shown on this website http://www.chemspider.com/

I came across this discussion of local vs. remote typeahead and wondered if it was possible to implement something similar. http://sahatyalkabov.com/jsrecipes/?ref=devtoolsonline#!/frontend/typeahead

Thanks,

Iain

library(shiny) library(shinyTypeahead) library(shinythemes) library(randomNames)

rNames <- randomNames(200000) # max number of allowed choices 2 ^ 17 - 2 ui.R --------------------------------------------------------

ui <- shinyUI(fluidPage(theme = shinytheme("journal"), title = 'shinyTypeahead test app', fluidRow( typeaheadInput('thirdTypeaheadInput', label = "Random names", choices = rNames, items = 5), textOutput('thirdoutput')

                  )

)) server.R --------------------------------------------------------

server <- shinyServer(function(input, output, session) { output$thirdoutput <- renderText(input$thirdTypeaheadInput)

})

runApp(list(ui=ui,server=server))

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ThomasSiegmund/shinyTypeahead/issues/1, or mute the thread https://github.com/notifications/unsubscribe/AG1RbLQm-FOMA0cFyEpTVElJF9GDaq94ks5qKxzvgaJpZM4Izo0P .