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,7 +112,7 @@ ui <- fluidPage(
112 112
                  status_off = "primary",
113 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 116
                 prettySwitch("controlswitch", value=TRUE, label = NULL,
117 117
                              slim = FALSE,
118 118
                                inline=TRUE, status="info",
@@ -348,8 +348,13 @@ server <- function(input, output) {
348 348
     updateMap()
349 349
   })
350 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 359
   observeEvent(input$mapinfobutton, ignoreInit = TRUE, {
355 360
     if (input$mapinfobutton) {

+ 4
- 3
viz/extras.R View File

@@ -169,7 +169,7 @@ infotext <- div(class="overflowable", id="infoint", tabindex="2",
169 169
     "https://datafinder.stats.govt.nz/data/category/census/2018/commuter-view/", 
170 170
     "commuter data"), 
171 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 173
     "Petra Lamborn's"),
174 174
     " entry for the ", em("There and Back Again"),
175 175
     a(href=
@@ -196,8 +196,9 @@ again-data-visualisation-competition", "data visualisation competition",
196 196
     a(href=paste0(
197 197
 "http://archive.stats.govt.nz/methods/classifications-and-standards/",
198 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 202
     "thousand, corresponding approximately to urban suburbs and rural towns. ",
202 203
     "The shapes of these areas have been heavily simplified in this map ",
203 204
     "to reduce bandwidth and memory usage. ",