2 Commits

Author SHA1 Message Date
  Petra Lamborn 3843f4d28a key command for options panel toggle 3 years ago
  Petra Lamborn ded4b97a46 Mark SA2 abbrev 3 years ago
2 changed files with 12 additions and 6 deletions
  1. 8
    3
      viz/app.R
  2. 4
    3
      viz/extras.R

+ 8
- 3
viz/app.R View File

112
                  status_off = "primary",
112
                  status_off = "primary",
113
                  value = TRUE)
113
                  value = TRUE)
114
   ),
114
   ),
115
-  absolutePanel(top = 40, right = 6, id="control2", title="Toggle panel",
115
+  absolutePanel(top = 40, right = 6, id="control2", title="Toggle pane(L)",
116
                 prettySwitch("controlswitch", value=TRUE, label = NULL,
116
                 prettySwitch("controlswitch", value=TRUE, label = NULL,
117
                              slim = FALSE,
117
                              slim = FALSE,
118
                                inline=TRUE, status="info",
118
                                inline=TRUE, status="info",
348
     updateMap()
348
     updateMap()
349
   })
349
   })
350
   observeEvent(input$controlswitch, ignoreInit = TRUE, {
350
   observeEvent(input$controlswitch, ignoreInit = TRUE, {
351
-    shinyjs::toggleElement("mapcontrol", anim=TRUE,
352
-                           time = 0.5)
351
+    if (input$controlswitch) {
352
+      shinyjs::showElement("mapcontrol", anim=TRUE,
353
+                             time = 0.5)
354
+    } else {
355
+      shinyjs::hideElement("mapcontrol", anim=TRUE,
356
+                             time = 0.5)
357
+    }
353
   })
358
   })
354
   observeEvent(input$mapinfobutton, ignoreInit = TRUE, {
359
   observeEvent(input$mapinfobutton, ignoreInit = TRUE, {
355
     if (input$mapinfobutton) {
360
     if (input$mapinfobutton) {

+ 4
- 3
viz/extras.R View File

169
     "https://datafinder.stats.govt.nz/data/category/census/2018/commuter-view/", 
169
     "https://datafinder.stats.govt.nz/data/category/census/2018/commuter-view/", 
170
     "commuter data"), 
170
     "commuter data"), 
171
   "to help visualise transport ",
171
   "to help visualise transport ",
172
-    "connections. It is ", a(href="http://petras.space/page/cv/", title="Hire me!",
172
+    "connections. It is ", a(href="http://petras.space", title="Hire me!",
173
     "Petra Lamborn's"),
173
     "Petra Lamborn's"),
174
     " entry for the ", em("There and Back Again"),
174
     " entry for the ", em("There and Back Again"),
175
     a(href=
175
     a(href=
196
     a(href=paste0(
196
     a(href=paste0(
197
 "http://archive.stats.govt.nz/methods/classifications-and-standards/",
197
 "http://archive.stats.govt.nz/methods/classifications-and-standards/",
198
 "classification-related-stats-standards/geographic-areas/pg4.aspx#gsc.tab=0"),
198
 "classification-related-stats-standards/geographic-areas/pg4.aspx#gsc.tab=0"),
199
-   "Statistical Area 2", .noWS = "after"), ". ",
200
-    "SA2 boundaries typically enclose areas with a population of a few ",
199
+   "Statistical Area 2", .noWS = "after"), ".",
200
+    shiny::tags$abbr(title = "Statistical Area 2", "SA2"),
201
+    "boundaries typically enclose areas with a population of a few ",
201
     "thousand, corresponding approximately to urban suburbs and rural towns. ",
202
     "thousand, corresponding approximately to urban suburbs and rural towns. ",
202
     "The shapes of these areas have been heavily simplified in this map ",
203
     "The shapes of these areas have been heavily simplified in this map ",
203
     "to reduce bandwidth and memory usage. ",
204
     "to reduce bandwidth and memory usage. ",