I would like to add a protein viewer to my shiny app. After loading the script my app is not responding anymore to any of my inputs. In the example the mtcars dataset is not loading or responding to my filter anymore.
My code:
library(shiny)
library(shinydashboard)
ui <- dashboardPage(
dashboardHeader(title = "Example"),
dashboardSidebar(
sidebarMenu(id = "sidebarmenu",
selectizeInput("sample2", "Sample: ",
choices = c("cyl", "mpg", "disp", "hp")))),
dashboardBody(
fluidRow(
box(title="3D Structure", width = 6, status="primary", solidHeader =TRUE,
tags$head(tags$script(src="http://3Dmol.csb.pitt.edu/build/3Dmol-min.js")),
tags$div(
style="height: 400px; width: 700px: position: relative;",
class='viewer_3Dmoljs',
'data-pdb'='2POR',
'data-backgroundcolor'='0xffffff',
'data-style'='cartoon'))),
fluidRow(
box(status="primary", solidHeader = FALSE, align = "center",
DT::dataTableOutput("table")))))
server <- function(input, output, session) {
mtcars2 <- reactive({
mtcars2 <- mtcars
return(mtcars2)
})
output$table <- DT::renderDataTable({
mtcars2 <- mtcars2()
mtcars2 <- subset(mtcars2, select = c(input$sample2))
table <- DT::datatable(mtcars2, rownames = FALSE)
})
}
shinyApp(ui = ui, server = server)
I also posted the same question on Stackoverflow but I didn`t get an answer that solved my problem yet:
Anybody have an idea how I could get this working?