-
Notifications
You must be signed in to change notification settings - Fork 8
/
ui.R
executable file
·136 lines (133 loc) · 3.58 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
library(shinydashboard)
#setwd(dirname(rstudioapi::getActiveDocumentContext()$path))
source("GenerateRGraphs.R")
library(shiny)
dashboardPage(
dashboardHeader(title = "Contagion Analysis"),
dashboardSidebar(sidebarMenu(
menuItem(
"Graph Analysis",
tabName = "graph",
icon = icon("signal")
),
menuItem("Contagion Simulation", tabName = "network", icon = icon("book"))
)),
dashboardBody(
tags$head(
tags$link(rel = "stylesheet", type = "text/css", href = "MyStyle.css"),
tags$link(rel="shortcut icon", href="/www/favicon.ico")
),
tabItems(
# First tab content
tabItem(
tabName = "graph",
fluidRow(
box(
numericInput("assets", label = "Total Value of Assets", value = 100000),
sliderInput(
"N",
"No. Of Banks",
min = 0,
max = 100,
value = 25,
step = 1
),
sliderInput(
"prob",
"Interconnectedness:",
min = 0,
max = 1,
value = 0.2,
step = 0.01
),
sliderInput(
"gamma",
"Capitalization",
min = 0,
max = 0.2,
value = 0.05,
step = 0.01
),
sliderInput(
"theta",
"Interbank Assets to Total Assets Ratio",
min = 0,
max = 1,
value = 0.2,
step = 0.01
), radioButtons(
"variable",
label = strong("Variable"),
choices = list(
"Capitalization" = "G",
"Interconnectedness" = "P",
"Interbank Asset to Asset Ratio" = "T",
"No. of Banks" = "N"
),
selected = "N"
),
sliderInput(
"simulations",
"MC Runs",
min = 0,
max = 1000,
value = 100,
step = 10
),
actionButton("update", "Run MC Simulation", class="action-button2"), width=3),
fluidRow(
box(plotOutput("plot",width = 75), class="plotbox"),
box(plotOutput("plot2",width = 75), class="plotbox"),
box(plotOutput("entropyPlot",width = 75), class="plotbox")
)
)
),
# Second tab content
tabItem(
tabName = "network",
fluidRow(
box(
numericInput("assets2", label = "Total Value of Assets", value = 10000),
sliderInput(
"N2",
"No. Of Banks",
min = 0,
max = 100,
value = 25,
step = 1
),
sliderInput(
"prob2",
"Interconnectedness:",
min = 0,
max = 1,
value = 0.2,
step = 0.01
),
sliderInput(
"gamma2",
"Capitalization",
min = 0,
max = 0.2,
value = 0.03,
step = 0.01
),
sliderInput(
"theta2",
"Interbank Assets to Total Assets Ratio",
min = 0,
max = 1,
value = 0.2,
step = 0.01
),
actionButton("update2", "Run Simulation", class="action-button2"), width = 3
),
box(numericInput("snapshot", label="Snapshot", value = 0, min = 0, max=100, width = 60),
plotOutput("plot3", width = 100, height=800),
downloadButton('downloadData', 'Download Graph', class="download-button"), class="box-body-custom"
)
)
)
)
)
)