-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathui.R
127 lines (120 loc) · 7.38 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
###########################
# File: ui.R
# Description: UI for Shiny Application TrajPop
# Date: 26/06/2013
# Author: Robin Cura ([email protected])
###########################
library(shiny)
shinyUI(fluidPage(theme = "spacelab.bootstrap.min.css",
tags$head(tags$link(rel="icon", type="image/png", href="favicon.png"),
tags$title("TrajPop"),
includeScript("www/analytics.js"),
includeScript("http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"),
includeCSS("http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css")
),
#absolutePanel(h1("ABC"), bottom = "10%", left = "10%", width = "150px", height = "200px", draggable = TRUE, cursor = "move"),
fluidRow(
column(4, tags$img(src="logo_UMR.jpg", height="150px")),
column(4, h1("TrajPop")),
column(4, tags$img(src="logo_GeoDC.jpg", height="150px"))
),
sidebarLayout(
sidebarPanel(
checkboxInput(inputId = "slowInternet", label = "Slow internet ?", value = TRUE),
selectInput(inputId = 'dataset', label = "Choose country",
multiple = FALSE,
choices = c("South Africa", "Brazil", "Russia", "India", "China", "USA", "France")),
selectInput("timeColumnSelected", "Temporal columns :", choices="", multiple=TRUE),
htmlOutput('nbCities'),
selectizeInput(inputId = 'brewerPalette', label="Color Palette", choices = colorPaletteList,
multiple=FALSE, selected="Set1", options = list(
dropdownParent = 'body',
render = I(sprintf(
"{
option: function(item, escape) {
return '<div><img ' +
'src=\"palettes/' + item.value + '.svg\" /> ' + item.value + ' </div>';
}
}")))),
br(),
sliderInput("nbClusters",
"Number of wanted clusters:",
value = 3,
min = 2,
max = 20),
br(),
downloadButton("downloadPDF", "Download the PDF report")
),
mainPanel(
uiOutput(outputId='customTabsets'),
tabsetPanel(
tabPanel(title = "Clusters Plots",
#uiOutput("debugTools"),
plotOutput("tree"),
conditionalPanel(condition = "!input.slowInternet",
ggvisOutput("afc")),
conditionalPanel(condition = "input.slowInternet",
plotOutput("afc_slow")),
plotOutput("clustersMean"),
plotOutput("clustersWeights"),
plotOutput("clustersMeanWeights")
),
tabPanel(title="Clusters measures",
tags$h5("Means"),
tableOutput("clusterMeans"),
tags$h5("Counts"),
tableOutput("clustersCounts"),
tags$h5("Variances"),
tableOutput("clustersVariances"),
tags$h5("Distances (χ²)"),
tags$em("χ² distance between the mean profile and each cluster mean profile"),
tableOutput("clustersDistances")
),
tabPanel(title="RankSize & RankClock",
conditionalPanel(condition = "!input.slowInternet",
ggvisOutput("ranksize2")),
conditionalPanel(condition = "input.slowInternet",
plotOutput("ranksize"))
),
tabPanel("Table",
conditionalPanel(condition = "!input.slowInternet",
dataTableOutput('mytable')),
conditionalPanel(condition = "input.slowInternet",
tableOutput('mytable_slow')),
downloadButton(outputId='tableExport', label='Download Table')),
tabPanel("Maps",
fluidRow(
column(6,
selectInput('sizeAttribute', 'Scales points on :',
choices="", multiple=FALSE)),
column(6, sliderInput('maxSize', 'Max. point size',
value=25, min=1, max=100))
),
conditionalPanel(condition = "!input.slowInternet",
htmlOutput('webmap')),
conditionalPanel(condition = "input.slowInternet",
plotOutput('ggmap'))
),
tabPanel('Correspondence',
fluidRow(
column(6, selectInput("correspondanceColumnSelected", "Correspondence column :",choices="", multiple=FALSE)),
column(6, selectInput("correspondanceType", "Type :", choices=c("Chi2", 'ANOVA'), multiple=FALSE, selected="ANOVA"))
),
conditionalPanel(
condition = '(input.correspondanceType == "Chi2") && (input.correspondanceColumnSelected != "None")',
h3('Contingency Table'),
htmlOutput(outputId='contingencyTable'),
h3('Chi² test'),
htmlOutput(outputId='Chi2results'),
h3('Residuals Table'),
htmlOutput(outputId="Chi2residuals")
),
conditionalPanel(
condition = '(input.correspondanceType == "ANOVA")',
checkboxInput(inputId='logBoxPlot', label='Log10', value=TRUE),
plotOutput(outputId='AnovaBoxPlot'),
htmlOutput(outputId='AnovaResults')
)),
tabPanel(title="About", includeMarkdown(path="README.md"))
)
))))