-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathui.R
More file actions
75 lines (66 loc) · 3.28 KB
/
ui.R
File metadata and controls
75 lines (66 loc) · 3.28 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
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
library(shiny)
load("good_series.rda")
countries_list = read.csv("gs.csv")
shinyUI(fluidPage(
tags$style(HTML("
' @import url('https://fonts.googleapis.com/css?family=Poppins');
body {
font-family: 'Poppins', 'Lucida Grande', Verdana, Lucida, Helvetica, Arial, Calibri, sans-serif;
color: rgb(0,0,0);
background-color: #d2d2d2;
}
")),
# Application title
titlePanel("World Development Indicators from the World Bank"),
sidebarLayout(
sidebarPanel(
h3("Introduction"),
HTML("<p>This is an exploratory web app for analysis of the WDI.
The definitive, full set of data is on the
<a href = 'http://data.worldbank.org/data-catalog/world-development-indicators'>World Bank's website</a>."),
p("From the 'List of Series' tab, find a series you are interested in (the search function is helpful). Copy the
'indicator' field (eg 'AG.AGR.TRAC.NO') and paste it into Indicator text"),
p("From the 'List of Countries' tab, find a Country you are interested in (the search function is helpful). Copy the
'iso2c' field (eg 'IN, JP, US etc') and paste it into this Country text"),
checkboxInput("singleCountry", "Select ONLY 1 Country", value = F),
conditionalPanel("input.singleCountry",
textInput("countryName", "Paste or type a country Name here and press enter:", value = "IN")),
textInput("indicator", "Paste or type an indicator here and press enter:", value = "NY.GDP.PCAP.KD"),
p("This only really works on a large monitor. And it takes about 20 seconds to download the data
and draw the plot. So be warned; this is an exploration utility, not a polished end user experience."),
hr(),
checkboxInput("fixed_scale", "Same vertical axis for each facet?", value = TRUE),
checkboxInput("smoother", "Show a trend line (adds a few seconds drawing time)?", value = FALSE),
conditionalPanel("input.smoother",
sliderInput("span", "Span for loess smoothing function (smaller is wigglier)",
min = 0.1, max = 5, value = 2)),
checkboxInput("sample_only", "Only show 16 randomly chosen countries/groups?", value = FALSE),
conditionalPanel("input.sample_only",
actionButton("samp_count", "A different 16 please!", icon = icon("refresh"))
),
sliderInput("minimum", "Select a minimum number of observations for a country to be included", min = 1, max = 10, step = 1, value = 1),
selectInput("incl_groups", "Show:",
choices = c("Individual Countries", "Country Groups", "Both"),
selected = "Individual Countries"),
selectInput("imp_country", "Select Country:",
choices = countries_list$good_countries,
selected = "India")
),
mainPanel(
tabsetPanel(type = "tabs",
tabPanel("Plot",
plotOutput("the_plot", height = "750px")
),
tabPanel("List of series",
dataTableOutput("mytable")
),
tabPanel("List of Countries",
dataTableOutput("countryTable")
),
tabPanel("Importance",
plotOutput("the_importance_plot", height = "750px")
)
)
)
)
))