Browse Source

change colours; hide control panel

Petra Lamborn 3 years ago
parent
commit
89395dd1e3
2 changed files with 10 additions and 2 deletions
  1. 2
    2
      scratch.R
  2. 8
    0
      viz/app.R

+ 2
- 2
scratch.R View File

90
     total = sum(ifelse(total < 0, 0, total)), .groups="drop"
90
     total = sum(ifelse(total < 0, 0, total)), .groups="drop"
91
   ) -> work_to
91
   ) -> work_to
92
 
92
 
93
-tencols <-  c("#a6cee3", "#1f78b4", "#b2df8a", "#33a02c", "#fb9a99", 
94
-              "#e31a1c", "#fdbf6f", "#ff7f00", "#cab2d6", "#6a3d9a")
93
+tencols <-  c("#6a3d9a", "#1f78b4", "#b2df8a", "#33a02c", "#fb9a99", 
94
+              "#e31a1c", "#fdbf6f", "#ff7f00", "#cab2d6", "#a6cee3")
95
 tencols[which.max(work_from[1, 5:14])]
95
 tencols[which.max(work_from[1, 5:14])]
96
 
96
 
97
 
97
 

+ 8
- 0
viz/app.R View File

4
 library(rgdal)
4
 library(rgdal)
5
 library(dplyr)
5
 library(dplyr)
6
 library(leaflet.extras)
6
 library(leaflet.extras)
7
+library(shinyWidgets)
7
 
8
 
8
 source("leafletfunctions.R")
9
 source("leafletfunctions.R")
9
 
10
 
97
                              inline = FALSE),
98
                              inline = FALSE),
98
                 div(id="locinfo",
99
                 div(id="locinfo",
99
                     htmlOutput("lochtml"))),
100
                     htmlOutput("lochtml"))),
101
+  absolutePanel(top = 25, right = 10, id="control2",
102
+                materialSwitch("controlswitch", value=TRUE, right=TRUE,
103
+                               inline=TRUE, status="info")),
100
   absolutePanel(bottom = 30, left = 10, id="loading",
104
   absolutePanel(bottom = 30, left = 10, id="loading",
101
                 p("Loading..."))
105
                 p("Loading..."))
102
 )
106
 )
235
   observeEvent(input$radiocolour, ignoreInit = TRUE, {
239
   observeEvent(input$radiocolour, ignoreInit = TRUE, {
236
     updateMap()
240
     updateMap()
237
   })
241
   })
242
+  observeEvent(input$controlswitch, ignoreInit = TRUE, {
243
+    shinyjs::toggleElement("mapcontrol", anim=TRUE,
244
+                           time = 0.5)
245
+  })
238
   output$lochtml <- renderUI({
246
   output$lochtml <- renderUI({
239
     seled <- sel.SA2.code()
247
     seled <- sel.SA2.code()
240
     seled <- ifelse(is.na(seled), 0, seled)
248
     seled <- ifelse(is.na(seled), 0, seled)