-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.R
47 lines (42 loc) · 2.65 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
library(shiny)
# Produces the div for the map
dynMap <- function(inputoutputId)
{
div(id = inputoutputId, class = "d3map")
}
# Define UI for application
shinyUI(pageWithSidebar(
# Application title
headerPanel("CommuniD3",
windowTitle = "CommuniD3"),
sidebarPanel(
helpText(HTML("<b>Putting Down Roots: A Graphical Exploration of Community Attachment</b>")),
helpText(HTML("<p>Exploratory tool by <a href=\"http://www.andeekaplan.com\" target=\"_blank\">Andee Kaplan</a> and <a href=\"http://www.erichare.me\" target=\"_blank\">Eric Hare</a> based on <a href=\"http://www.soulofthecommunity.org/\" target=\"_blank\">'Soul of the Community'</a> data generated by the Knight Foundation in cooperation with Gallup. Project was created as part of the <a href=\"http://streaming.stat.iastate.edu/dataexpo/2013/\" target=\"_blank\">2013 Data Exposition</a>.</p><p>Further details pertaining to the data can be found in the accompanying <a href='http://harekaplan.github.io/dataexpo2013/Poster_DataExpo2013_Kaplan_Hare.pdf' target='_blank'>poster</a>.<p>")),
includeScript("http://d3js.org/d3.v3.min.js"),
includeScript("http://d3js.org/topojson.v1.min.js"),
includeScript("http://code.jquery.com/jquery-1.9.1.js"),
includeScript("http://code.jquery.com/ui/1.10.3/jquery-ui.js"),
#includeScript("scripts/ga.js"), #only include this for the actual application on the server, google analytics code.
includeCSS("http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css"),
includeScript("scripts/graph.js"),
includeCSS("css/map_style.css"),
includeCSS("css/graphs_style.css"),
includeCSS("css/button_style.css"),
includeCSS("css/table_style.css"),
div(id = 'namewrapper',
div(id = 'left', HTML('<a href=\"http://www.andeekaplan.com\" target=\"_blank\">Andee Kaplan</a><br/>Dept. of Statistics<br/>Iowa State University')),
div(id = 'right', HTML('<a href=\"http://www.erichare.me\" target=\"_blank\">Eric Hare</a><br/>Dept. of Statistics<br/>Iowa State University'))
),
div(class = 'controls',
checkboxInput("aggregate", "Aggregate all years", TRUE),
conditionalPanel(
condition = "input.aggregate == false",
sliderInput("year", "Choose year:", min = 2008, max = 2010, value = 2008, step = 1, sep = "")
)
),
helpText(HTML("<p>Data source: <a href='http://www.soulofthecommunity.org/' target='_blank'>Knight Foundation</a>, collected by Gallup.</p>"))
),
mainPanel(
dynMap(inputoutputId = 'd3io')
)
))