-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.R
More file actions
36 lines (29 loc) · 1.4 KB
/
server.R
File metadata and controls
36 lines (29 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function(input, output, session){
# on-load modal ========================================================================
showModal(modalDialog(title = "About", size = "l",
renderUI(includeMarkdown("www/about.md")),
easyClose = TRUE))
# filter network, prep title ===========================================================
net_selected <- reactive({
if(input$in_edge_type != "All"){
g <- CASP_net %E>% filter(edge_type %in% input$in_edge_type)
} else g <- CASP_net %E>% filter(edge_type != "Any")
title <- case_when(input$in_edge_type == "All" ~ "All",
input$in_edge_type == "Any" ~ "Any",
TRUE ~ paste0("\"", input$in_edge_type, "\""))
list(g = g, title = title)
})
# sociogram ===========================================================================
output$out_net <- renderVisNetwork({
visualize_graph(net_selected()$g, net_selected()$title)
})
# path distance histogram ==============================================================
output$distances <- renderHighchart({
plot_distances(net_selected()$g, net_selected()$title)
})
# liaison/betweenness barchart =========================================================
output$btwn <- renderHighchart({
plot_betweenness(net_selected()$g, net_selected()$title)
})
session$onSessionEnded(stopApp)
}