|
@@ -11,7 +11,7 @@ source("extras.R")
|
11
|
11
|
|
12
|
12
|
# work_travel <- read_csv("../travel-work.csv")
|
13
|
13
|
load(file="datasets.RData")
|
14
|
|
-shpf <- readOGR(dsn="sa20025WGSfilcth")
|
|
14
|
+shpf <- readOGR(dsn="sa20025WGSfil")
|
15
|
15
|
sa.in.dest <- shpf@data$SA22018_V1 %in% work_to$work_code
|
16
|
16
|
sa.in.home <- shpf@data$SA22018_V1 %in% work_from$res_code
|
17
|
17
|
transport.t <- c("Private car", "Passenger in car",
|
|
@@ -47,18 +47,26 @@ hrstr <- "<hr/>"
|
47
|
47
|
ui <- fluidPage(
|
48
|
48
|
useShinyjs(),
|
49
|
49
|
leafletjs,
|
|
50
|
+ keyboardjs,
|
50
|
51
|
tags$style(type = "text/css", extracss),
|
|
52
|
+
|
51
|
53
|
leafletOutput("map"),
|
52
|
54
|
absolutePanel(top = 10, right = 10, id="mapcontrol",
|
53
|
55
|
div(
|
54
|
56
|
radioButtons("radioeduemp",
|
55
|
57
|
label = "Commuters (age 15+) travelling to",
|
56
|
|
- choices = c("Employment", "Education"),
|
|
58
|
+ choiceNames = list(
|
|
59
|
+ HTML("<span>E<u>m</u>ployment</span>"),
|
|
60
|
+ HTML("<span>E<u>d</u>ucation</span>")
|
|
61
|
+ ),
|
|
62
|
+ choiceValues = list(
|
|
63
|
+ "Employment", "Education"
|
|
64
|
+ ),
|
57
|
65
|
inline = TRUE),
|
58
|
66
|
radioButtons("radioinout", label="Show commuters who",
|
59
|
67
|
choiceNames = list(
|
60
|
|
- HTML("<p>Commute <b>from</b> selected area</p>"),
|
61
|
|
- HTML("<p>Commute <b>to</b> selected area</p>")),
|
|
68
|
+ HTML("<span>Commute <u>f</u>rom selected area</span>"),
|
|
69
|
+ HTML("<span>Commute <u>t</u>o selected area</span>")),
|
62
|
70
|
choiceValues = list(
|
63
|
71
|
"res",
|
64
|
72
|
"work"
|
|
@@ -67,8 +75,8 @@ ui <- fluidPage(
|
67
|
75
|
radioButtons("radiocolour",
|
68
|
76
|
label = "Colour by",
|
69
|
77
|
choiceNames = list(
|
70
|
|
- HTML("<p>Most common commute method</p>"),
|
71
|
|
- HTML("<p>Number of commuters</p>")
|
|
78
|
+ HTML("<span>M<u>o</u>st common commute method</span>"),
|
|
79
|
+ HTML("<span>N<u>u</u>mber of commuters</span>")
|
72
|
80
|
),
|
73
|
81
|
choiceValues = list(
|
74
|
82
|
"type",
|
|
@@ -110,7 +118,8 @@ server <- function(input, output) {
|
110
|
118
|
ifelse(lastout == lastover, 0, lastover)
|
111
|
119
|
})
|
112
|
120
|
output$map <- renderLeaflet({
|
113
|
|
- leaf <- leaflet(shpf, options = leafletOptions(minZoom = 3, maxZoom = 13)) %>%
|
|
121
|
+ leaf <- leaflet(shpf, options = leafletOptions(minZoom = 3, maxZoom = 13,
|
|
122
|
+ crs = NULL)) %>%
|
114
|
123
|
addPolygons(color="#000", opacity = 1, weight=1,
|
115
|
124
|
fillColor = startcols.res,
|
116
|
125
|
layerId = ~SA22018_V1,
|