Skip to content

Commit

Permalink
fix on-screen error about NULLs
Browse files Browse the repository at this point in the history
  • Loading branch information
d-callan committed Nov 30, 2023
1 parent 5ddf460 commit 0c69159
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion R/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ server <- function(input, output, session) {
filteredEdgeList <- reactive({
edgeList <- req(edgeList())

if (is.null(edgeList)) {
return(NULL)
}

edgeList <- subset(edgeList, abs(edgeList$value) >= input$correlationFilter)
edgeList <- subset(edgeList, edgeList$p_value <= input$pValueFilter)

Expand All @@ -127,11 +131,18 @@ server <- function(input, output, session) {

output$correlationMatrix <- DT::renderDT({
edgeList <- req(filteredEdgeList())
return(edgeList)
})

output$bipartiteNetwork <- renderBipartiteNetwork({
edgeList <- req(filteredEdgeList())
bipartiteNetwork(edgeList, width = '100%', height = '400px')

if (is.null(edgeList)) {
return(NULL)
}

network <- bipartiteNetwork(edgeList, width = '100%', height = '400px')
return(network)
})

}

0 comments on commit 0c69159

Please sign in to comment.