From eb143d8322eee9e7b4323bb818cce5d9ada4074a Mon Sep 17 00:00:00 2001 From: Danielle Callan Date: Sat, 2 Dec 2023 23:59:17 -0500 Subject: [PATCH] wire in unipartite network --- R/server.R | 23 +++++++++++++++++++++++ R/ui.R | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/R/server.R b/R/server.R index 9f9b650..e380fde 100644 --- a/R/server.R +++ b/R/server.R @@ -193,6 +193,29 @@ server <- function(input, output, session) { return(edgeList) }) + output$correlationNetwork <- renderUI({ + if (is.null(data1$matrix)) { + return(NULL) + } else { + if (is.null(data2$matrix)) { + unipartiteNetworkOutput("unipartiteNetwork") + } else { + bipartiteNetworkOutput("bipartiteNetwork") + } + } + }) + + output$unipartiteNetwork <- renderUnipartiteNetwork({ + edgeList <- req(filteredEdgeList()) + + if (is.null(edgeList)) { + return(NULL) + } + + network <- unipartiteNetwork(edgeList, width = '100%', height = '400px') + return(network) + }) + output$bipartiteNetwork <- renderBipartiteNetwork({ edgeList <- req(filteredEdgeList()) diff --git a/R/ui.R b/R/ui.R index 305587b..d011200 100644 --- a/R/ui.R +++ b/R/ui.R @@ -49,7 +49,7 @@ ui <- shiny::fluidPage( tabsetPanel( type = "tabs", tabPanel("Network", - bipartiteNetworkOutput("bipartiteNetwork"), # need to add node labels and legend here + uiOutput("correlationNetwork") ), tabPanel("Table", DT::DTOutput("correlationMatrix")