Skip to content

Commit

Permalink
wire in unipartite network
Browse files Browse the repository at this point in the history
  • Loading branch information
d-callan committed Dec 3, 2023
1 parent 5e82f09 commit eb143d8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions R/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand Down
2 changes: 1 addition & 1 deletion R/ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit eb143d8

Please sign in to comment.