forked from mdlincoln/adjacency_plot
/
ui.R
70 lines (55 loc) · 1.85 KB
/
ui.R
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
library(shiny)
library(markdown)
library(shinydashboard)
title <- "Adjacency matrices"
description <- includeMarkdown("description.md")
dataset_sel <- selectInput(
"graph_set",
"Dataset",
choices = c(
"Dutch Printmakers" = "goltzius",
"Les Misérables" = "les_mis",
"Karate Club" = "karate",
"Political Books" = "polbooks",
"'Copperfield' Noun/Adjective" = "copperfield",
"American College Football" = "football"
),
selected = "goltzius"
)
citation <-uiOutput("attribution")
ordering <- uiOutput("ordering_choices")
community <- uiOutput("comm_choices")
alpha <- conditionalPanel(
condition = "output.weighted",
checkboxInput("alpha_weight", "Set alpha by edge weight", FALSE)
)
annotate <- conditionalPanel(
condition = "output.annotate_vars",
checkboxInput("ann_var", "Annotate plot by node attribute sorting", FALSE)
)
plot <- plotOutput("adj_plot", height = "1300px", width = "100%")
membership <- uiOutput("membership_list")
# Layout every page section
header <- dashboardHeader(title = title)
sidebar <- dashboardSidebar(
sidebarMenu(
menuItem("Plot", tabName = "plot", icon = icon("bar-chart")),
menuItem("Communities", tabName = "communities", icon = icon("users")),
menuItem("About", tabName = "about", icon = icon("info-circle"))
),
dataset_sel,
citation,
community,
sidebarMenu(menuItem("Source Code", href = "https://github.com/mdlincoln/adjacency_plot", icon = icon("code")))
)
body <- dashboardBody(
tabItems(
tabItem(
"plot",
box(title = "Plot Properties", solidHeader = TRUE, status = "info", width = 12, fluidRow(column(4, ordering), column(4, annotate), column(4, alpha)), collapsible = TRUE),
box(width = 12, plot)),
tabItem("communities", membership),
tabItem("about", description)
))
# Render and display
dashboardPage(header, sidebar, body, title = title)