Prior to adding the conditional selectInput, I had a reactive statement that updated when a new pair was chosen. It worked as intended. Now that I added the conditional selectInput r shiny doesn't seem to ever run the reactive statement (as evidenced by no console printouts). I though shiny was supposed to update a reactive statement whenever one of it's input dependencies change, but this is clearly not working:
UI:
binancePAIRS <- c('ADABTC', 'BCCBTC', 'BNBBTC', 'BNBUSDT', 'BTCUSDT', 'EOSBTC', 'ETHBTC', 'ETHUSDT', 'ICXBTC', 'IOTABTC', 'LTCBTC', 'NEOBTC', 'OMGBTC', 'ONTBTC', 'TRXBTC', 'VENBTC', 'XLMBTC', 'XMRBTC', 'XRPBTC')
bitfinexPAIRS <- c('BCHUSD', 'BTCUSD', 'EOSUSD', 'ETHUSD', 'LTCUSD')
dashboardSidebar(
#sliderInput("bins", "Number of Breaks",1,100,50),
sidebarMenu(
# menuItem("Dashboard1", tabName='dashboard1', icon=icon('dashboard')),
selectInput('exchangeAinput' , label='exA', choices=c('binance', 'bitfinex'), selected = 'binance'),
conditionalPanel(condition = "input.exchangeAinput == 'binance'", selectInput('pairAbinance', label = 'Pair A', choices = binancePAIRS, selected= 'BTCUSDT')),
conditionalPanel(condition = "input.exchangeAinput == 'bitfinex'", selectInput('pairAbitfinex', label = 'Pair A', choices = bitfinexPAIRS, selected= 'BTCUSD')),
selectInput('exchangeBinput' , label='exB', choices=c('binance', 'bitfinex'), selected = 'binance'),
conditionalPanel(condition = "input.exchangeBinput == 'binance'", selectInput('pairBbinance', label = 'Pair B', choices = binancePAIRS, selected= 'BTCUSDT')),
conditionalPanel(condition = "input.exchangeBinput == 'bitfinex'", selectInput('pairBbitfinex', label = 'Pair B', choices = bitfinexPAIRS, selected= 'BTCUSD'))
)
),
Server:
shinyServer(function(input, output){
pairA <- reactive({
print('it A')
if(input$exchangeAinput %in% c('binance')){
print(input$pairAbinance)
exA <- 'binance'
nameA <- input$pairAbinance
print(exA)
print(nameA)
as.data.frame(fread(rawToChar(get_object(paste0("s3://info-datasets/binance-", nameA, "/small", nameA, ".csv")))))
}else{exA <- 'bitfinex'
nameA <- input$pairAbitfinex
print(exA)
print(nameA)
as.data.frame(fread(rawToChar(get_object(paste0("s3://info-datasets/bitfinex-", nameA, "/small", nameA, ".csv")))))}
})
pairB <- reactive({
print('it B')
if(input$exchangeBinput == 'binance'){
exB <- 'binance'
nameB <- input$pairBbinance
print(exB)
print(nameB)
as.data.frame(fread(rawToChar(get_object(paste0("s3://info-datasets/binance-", nameB, "/small", nameB, ".csv")))))
}else{exB <- 'bitfinex'
nameB <- input$pairBbitfinex
print(exB)
print(nameB)
as.data.frame(fread(rawToChar(get_object(paste0("s3://info-datasets/bitfinex-", nameB, "/small", nameB, ".csv")))))} })
nlpA <- reactive({as.data.frame(fread(rawToChar(get_object(paste0("s3://info-datasets/", exA, "-", nameA, "/sync/tracker.csv")))))})
nlpB <- reactive({as.data.frame(fread(rawToChar(get_object(paste0("s3://info-datasets/", exB, "-", nameB, "/sync/tracker.csv")))))})
Since no print messages make it to console, that means either the selectInput 'input$pairAbinance' variables are never be updated or the server is completely missing updates to input$pairAbinance or input$pairAexchange